Merge "Make IActivityClientController oneway as possible"
diff --git a/Android.bp b/Android.bp
index 598f4fc..1a73e9d 100644
--- a/Android.bp
+++ b/Android.bp
@@ -330,6 +330,7 @@
srcs: [
// Java/AIDL sources under frameworks/base
":framework-blobstore-sources",
+ ":framework-connectivity-sources", // framework-connectivity is not yet a module
":framework-core-sources",
":framework-drm-sources",
":framework-graphics-nonupdatable-sources",
@@ -349,6 +350,7 @@
":framework-telecomm-sources",
":framework-telephony-common-sources",
":framework-telephony-sources",
+ ":framework-vcn-util-sources",
":framework-wifi-annotations",
":framework-wifi-non-updatable-sources",
":PacProcessor-aidl-sources",
@@ -526,6 +528,7 @@
"android.hardware.vibrator-V1.1-java",
"android.hardware.vibrator-V1.2-java",
"android.hardware.vibrator-V1.3-java",
+ "android.security.apc-java",
"android.system.keystore2-java",
"android.system.suspend.control.internal-java",
"cameraprotosnano",
@@ -627,7 +630,6 @@
// in favor of an API stubs dependency in java_library "framework" below.
"mimemap",
"av-types-aidl-java",
- "mediatranscoding_aidl_interface-java",
"soundtrigger_middleware-aidl-java",
"modules-utils-os",
],
@@ -1350,6 +1352,7 @@
visibility: [
"//frameworks/base/wifi",
"//frameworks/base/services/net",
+ "//packages/modules/Wifi/framework",
],
}
@@ -1368,12 +1371,14 @@
"core/java/com/android/internal/util/StateMachine.java",
"core/java/com/android/internal/util/WakeupMessage.java",
],
- visibility: ["//frameworks/opt/net/wifi/service"],
+ visibility: [
+ "//frameworks/opt/net/wifi/service",
+ "//packages/modules/Wifi/service",
+ ],
}
// TODO(b/145644363): move this to under StubLibraries.bp or ApiDocs.bp
metalava_framework_docs_args = "--manifest $(location core/res/AndroidManifest.xml) " +
- "--ignore-classes-on-classpath " +
"--hide-package com.android.server " +
"--hide-package android.audio.policy.configuration.V7_0 " +
"--error UnhiddenSystemApi " +
diff --git a/ApiDocs.bp b/ApiDocs.bp
index 3d6bdbf..5f4f3c2 100644
--- a/ApiDocs.bp
+++ b/ApiDocs.bp
@@ -96,7 +96,9 @@
arg_files: [
"core/res/AndroidManifest.xml",
],
- args: metalava_framework_docs_args,
+ args: metalava_framework_docs_args +
+ // Needed for hidden libcore annotations for now.
+ " --ignore-classes-on-classpath ",
write_sdk_values: true,
}
@@ -106,7 +108,10 @@
arg_files: [
"core/res/AndroidManifest.xml",
],
- args: metalava_framework_docs_args + " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
+ args: metalava_framework_docs_args +
+ // Needed for hidden libcore annotations for now.
+ " --ignore-classes-on-classpath " +
+ " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
write_sdk_values: true,
}
diff --git a/StubLibraries.bp b/StubLibraries.bp
index 12ee889..3ff2546 100644
--- a/StubLibraries.bp
+++ b/StubLibraries.bp
@@ -47,10 +47,11 @@
"core/java/**/*.logtags",
":opt-telephony-srcs",
":opt-net-voip-srcs",
- ":art.module.public.api{.public.stubs.source}",
"**/package.html",
],
- sdk_version: "core_platform",
+ sdk_version: "none",
+ system_modules: "none",
+ java_version: "1.8",
arg_files: ["core/res/AndroidManifest.xml"],
// TODO(b/147699819, b/169090544): remove below aidl includes.
aidl: {
@@ -80,6 +81,7 @@
"android.hardware.usb.gadget-V1.0-java",
"android.hardware.vibrator-V1.3-java",
"framework-protos",
+ "stable.core.platform.api.stubs",
// There are a few classes from modules used as type arguments that
// need to be resolved by metalava. For now, we can use a previously
// finalized stub library to resolve them. If a new class gets added,
@@ -240,6 +242,7 @@
name: "android_stubs_current",
srcs: [ ":api-stubs-docs-non-updatable" ],
static_libs: [
+ "art.module.public.api.stubs",
"conscrypt.module.public.api.stubs",
"framework-appsearch.stubs",
"framework-graphics.stubs",
@@ -260,6 +263,7 @@
name: "android_system_stubs_current",
srcs: [ ":system-api-stubs-docs-non-updatable" ],
static_libs: [
+ "art.module.public.api.stubs",
"conscrypt.module.public.api.stubs",
"framework-appsearch.stubs.system",
"framework-graphics.stubs.system",
@@ -296,6 +300,7 @@
static_libs: [
// Modules do not have test APIs, but we want to include their SystemApis, like we include
// the SystemApi of framework-non-updatable-sources.
+ "art.module.public.api.stubs",
"conscrypt.module.public.api.stubs",
"framework-appsearch.stubs.system",
"framework-graphics.stubs.system",
@@ -334,25 +339,12 @@
"android_stubs_dists_default",
],
libs: ["sdk_system_29_android"],
+ static_libs: ["art.module.public.api.stubs"],
dist: {
dir: "apistubs/android/module-lib",
},
}
-java_library_static {
- name: "android_non_updatable_stubs_current",
- srcs: [":api-stubs-docs-non-updatable"],
- defaults: ["android_defaults_stubs_current"],
- libs: ["sdk_system_29_android"],
-}
-
-java_library_static {
- name: "android_system_non_updatable_stubs_current",
- srcs: [":system-api-stubs-docs-non-updatable"],
- defaults: ["android_defaults_stubs_current"],
- libs: ["sdk_system_29_android"],
-}
-
/////////////////////////////////////////////////////////////////////
// hwbinder.stubs provides APIs required for building HIDL Java
// libraries.
diff --git a/apct-tests/perftests/windowmanager/src/android/wm/WindowAddRemovePerfTest.java b/apct-tests/perftests/windowmanager/src/android/wm/WindowAddRemovePerfTest.java
index 9403e8b..c37f6d9 100644
--- a/apct-tests/perftests/windowmanager/src/android/wm/WindowAddRemovePerfTest.java
+++ b/apct-tests/perftests/windowmanager/src/android/wm/WindowAddRemovePerfTest.java
@@ -107,8 +107,8 @@
long startTime = SystemClock.elapsedRealtimeNanos();
session.addToDisplay(this, mLayoutParams, View.VISIBLE,
- Display.DEFAULT_DISPLAY, mRequestedVisibility, mOutFrame,
- mOutDisplayCutout, inputChannel, mOutInsetsState, mOutControls);
+ Display.DEFAULT_DISPLAY, mRequestedVisibility, mOutFrame, inputChannel,
+ mOutInsetsState, mOutControls);
final long elapsedTimeNsOfAdd = SystemClock.elapsedRealtimeNanos() - startTime;
state.addExtraResult("add", elapsedTimeNsOfAdd);
diff --git a/apex/appsearch/framework/Android.bp b/apex/appsearch/framework/Android.bp
index b3eb911..8ba7954 100644
--- a/apex/appsearch/framework/Android.bp
+++ b/apex/appsearch/framework/Android.bp
@@ -33,4 +33,5 @@
include_dirs: ["frameworks/base/core/java"], // TODO(b/146218515) should be removed
},
apex_available: ["com.android.appsearch"],
+ unsafe_ignore_missing_latest_api: true, // TODO(b/146218515) should be removed
}
diff --git a/apex/appsearch/framework/java/android/app/appsearch/AppSearchManager.java b/apex/appsearch/framework/java/android/app/appsearch/AppSearchManager.java
index c82119d..685e5ff 100644
--- a/apex/appsearch/framework/java/android/app/appsearch/AppSearchManager.java
+++ b/apex/appsearch/framework/java/android/app/appsearch/AppSearchManager.java
@@ -51,9 +51,11 @@
public static final String DEFAULT_DATABASE_NAME = "";
private final IAppSearchManager mService;
+ private final Context mContext;
/** @hide */
- public AppSearchManager(@NonNull IAppSearchManager service) {
+ public AppSearchManager(@NonNull Context context, @NonNull IAppSearchManager service) {
+ mContext = Objects.requireNonNull(context);
mService = Objects.requireNonNull(service);
}
@@ -137,7 +139,8 @@
Objects.requireNonNull(searchContext);
Objects.requireNonNull(executor);
Objects.requireNonNull(callback);
- AppSearchSession.createSearchSession(searchContext, mService, executor, callback);
+ AppSearchSession.createSearchSession(
+ searchContext, mService, mContext.getUserId(), executor, callback);
}
/**
@@ -158,7 +161,8 @@
@NonNull Consumer<AppSearchResult<GlobalSearchSession>> callback) {
Objects.requireNonNull(executor);
Objects.requireNonNull(callback);
- GlobalSearchSession.createGlobalSearchSession(mService, executor, callback);
+ GlobalSearchSession.createGlobalSearchSession(
+ mService, mContext.getUserId(), executor, callback);
}
/**
@@ -229,8 +233,9 @@
mService.setSchema(
DEFAULT_DATABASE_NAME,
schemaBundles,
- new ArrayList<>(request.getSchemasNotPlatformSurfaceable()),
+ new ArrayList<>(request.getSchemasNotVisibleToSystemUi()),
request.isForceOverride(),
+ mContext.getUserId(),
new IAppSearchResultCallback.Stub() {
public void onResult(AppSearchResult result) {
future.complete(result);
@@ -271,7 +276,7 @@
}
AndroidFuture<AppSearchBatchResult> future = new AndroidFuture<>();
try {
- mService.putDocuments(DEFAULT_DATABASE_NAME, documentBundles,
+ mService.putDocuments(DEFAULT_DATABASE_NAME, documentBundles, mContext.getUserId(),
new IAppSearchBatchResultCallback.Stub() {
public void onResult(AppSearchBatchResult result) {
future.complete(result);
@@ -312,6 +317,7 @@
AndroidFuture<AppSearchBatchResult> future = new AndroidFuture<>();
try {
mService.getDocuments(DEFAULT_DATABASE_NAME, request.getNamespace(), uris,
+ mContext.getUserId(),
new IAppSearchBatchResultCallback.Stub() {
public void onResult(AppSearchBatchResult result) {
future.complete(result);
@@ -412,6 +418,7 @@
AndroidFuture<AppSearchResult> future = new AndroidFuture<>();
try {
mService.query(DEFAULT_DATABASE_NAME, queryExpression, searchSpec.getBundle(),
+ mContext.getUserId(),
new IAppSearchResultCallback.Stub() {
public void onResult(AppSearchResult result) {
future.complete(result);
@@ -453,6 +460,7 @@
AndroidFuture<AppSearchBatchResult> future = new AndroidFuture<>();
try {
mService.removeByUri(DEFAULT_DATABASE_NAME, request.getNamespace(), uris,
+ mContext.getUserId(),
new IAppSearchBatchResultCallback.Stub() {
public void onResult(AppSearchBatchResult result) {
future.complete(result);
diff --git a/apex/appsearch/framework/java/android/app/appsearch/AppSearchManagerFrameworkInitializer.java b/apex/appsearch/framework/java/android/app/appsearch/AppSearchManagerFrameworkInitializer.java
index 02cc967..ec0533e 100644
--- a/apex/appsearch/framework/java/android/app/appsearch/AppSearchManagerFrameworkInitializer.java
+++ b/apex/appsearch/framework/java/android/app/appsearch/AppSearchManagerFrameworkInitializer.java
@@ -36,8 +36,9 @@
* {@link SystemServiceRegistry}
*/
public static void initialize() {
- SystemServiceRegistry.registerStaticService(
+ SystemServiceRegistry.registerContextAwareService(
Context.APP_SEARCH_SERVICE, AppSearchManager.class,
- (service) -> new AppSearchManager(IAppSearchManager.Stub.asInterface(service)));
+ (context, service) ->
+ new AppSearchManager(context, IAppSearchManager.Stub.asInterface(service)));
}
}
diff --git a/apex/appsearch/framework/java/android/app/appsearch/AppSearchSession.java b/apex/appsearch/framework/java/android/app/appsearch/AppSearchSession.java
index 3e813ea..da9b8bd 100644
--- a/apex/appsearch/framework/java/android/app/appsearch/AppSearchSession.java
+++ b/apex/appsearch/framework/java/android/app/appsearch/AppSearchSession.java
@@ -18,6 +18,7 @@
import android.annotation.CallbackExecutor;
import android.annotation.NonNull;
+import android.annotation.UserIdInt;
import android.os.Bundle;
import android.os.ParcelableException;
import android.os.RemoteException;
@@ -39,15 +40,18 @@
*/
public final class AppSearchSession {
private final String mDatabaseName;
+ @UserIdInt
+ private final int mUserId;
private final IAppSearchManager mService;
static void createSearchSession(
@NonNull AppSearchManager.SearchContext searchContext,
@NonNull IAppSearchManager service,
+ @UserIdInt int userId,
@NonNull @CallbackExecutor Executor executor,
@NonNull Consumer<AppSearchResult<AppSearchSession>> callback) {
AppSearchSession searchSession =
- new AppSearchSession(searchContext.mDatabaseName, service);
+ new AppSearchSession(service, userId, searchContext.mDatabaseName);
searchSession.initialize(executor, callback);
}
@@ -57,7 +61,7 @@
@NonNull @CallbackExecutor Executor executor,
@NonNull Consumer<AppSearchResult<AppSearchSession>> callback) {
try {
- mService.initialize(new IAppSearchResultCallback.Stub() {
+ mService.initialize(mUserId, new IAppSearchResultCallback.Stub() {
public void onResult(AppSearchResult result) {
executor.execute(() -> {
if (result.isSuccess()) {
@@ -74,9 +78,11 @@
}
}
- private AppSearchSession(@NonNull String databaseName, @NonNull IAppSearchManager service) {
+ private AppSearchSession(@NonNull IAppSearchManager service, @UserIdInt int userId,
+ @NonNull String databaseName) {
mDatabaseName = databaseName;
mService = service;
+ mUserId = userId;
}
/**
@@ -152,8 +158,9 @@
mService.setSchema(
mDatabaseName,
schemaBundles,
- new ArrayList<>(request.getSchemasNotPlatformSurfaceable()),
+ new ArrayList<>(request.getSchemasNotVisibleToSystemUi()),
request.isForceOverride(),
+ mUserId,
new IAppSearchResultCallback.Stub() {
public void onResult(AppSearchResult result) {
executor.execute(() -> callback.accept(result));
@@ -178,6 +185,7 @@
try {
mService.getSchema(
mDatabaseName,
+ mUserId,
new IAppSearchResultCallback.Stub() {
public void onResult(AppSearchResult result) {
executor.execute(() -> {
@@ -230,7 +238,7 @@
documentBundles.add(documents.get(i).getBundle());
}
try {
- mService.putDocuments(mDatabaseName, documentBundles,
+ mService.putDocuments(mDatabaseName, documentBundles, mUserId,
new IAppSearchBatchResultCallback.Stub() {
public void onResult(AppSearchBatchResult result) {
executor.execute(() -> callback.onResult(result));
@@ -269,7 +277,7 @@
Objects.requireNonNull(callback);
try {
mService.getDocuments(mDatabaseName, request.getNamespace(),
- new ArrayList<>(request.getUris()),
+ new ArrayList<>(request.getUris()), mUserId,
new IAppSearchBatchResultCallback.Stub() {
public void onResult(AppSearchBatchResult result) {
executor.execute(() -> {
@@ -371,7 +379,8 @@
Objects.requireNonNull(queryExpression);
Objects.requireNonNull(searchSpec);
Objects.requireNonNull(executor);
- return new SearchResults(mService, mDatabaseName, queryExpression, searchSpec, executor);
+ return new SearchResults(mService, mDatabaseName, queryExpression, searchSpec, mUserId,
+ executor);
}
/**
@@ -397,7 +406,7 @@
Objects.requireNonNull(callback);
try {
mService.removeByUri(mDatabaseName, request.getNamespace(),
- new ArrayList<>(request.getUris()),
+ new ArrayList<>(request.getUris()), mUserId,
new IAppSearchBatchResultCallback.Stub() {
public void onResult(AppSearchBatchResult result) {
executor.execute(() -> callback.onResult(result));
@@ -440,7 +449,7 @@
Objects.requireNonNull(executor);
Objects.requireNonNull(callback);
try {
- mService.removeByQuery(mDatabaseName, queryExpression, searchSpec.getBundle(),
+ mService.removeByQuery(mDatabaseName, queryExpression, searchSpec.getBundle(), mUserId,
new IAppSearchResultCallback.Stub() {
public void onResult(AppSearchResult result) {
executor.execute(() -> callback.accept(result));
diff --git a/apex/appsearch/framework/java/android/app/appsearch/GlobalSearchSession.java b/apex/appsearch/framework/java/android/app/appsearch/GlobalSearchSession.java
index 1c56a9b..95f7d79 100644
--- a/apex/appsearch/framework/java/android/app/appsearch/GlobalSearchSession.java
+++ b/apex/appsearch/framework/java/android/app/appsearch/GlobalSearchSession.java
@@ -20,6 +20,7 @@
import android.annotation.CallbackExecutor;
import android.annotation.NonNull;
import android.annotation.SystemApi;
+import android.annotation.UserIdInt;
import android.os.RemoteException;
import java.util.Objects;
@@ -36,12 +37,15 @@
public class GlobalSearchSession {
private final IAppSearchManager mService;
+ @UserIdInt
+ private final int mUserId;
static void createGlobalSearchSession(
@NonNull IAppSearchManager service,
+ @UserIdInt int userId,
@NonNull @CallbackExecutor Executor executor,
@NonNull Consumer<AppSearchResult<GlobalSearchSession>> callback) {
- GlobalSearchSession globalSearchSession = new GlobalSearchSession(service);
+ GlobalSearchSession globalSearchSession = new GlobalSearchSession(service, userId);
globalSearchSession.initialize(executor, callback);
}
@@ -51,7 +55,7 @@
@NonNull @CallbackExecutor Executor executor,
@NonNull Consumer<AppSearchResult<GlobalSearchSession>> callback) {
try {
- mService.initialize(new IAppSearchResultCallback.Stub() {
+ mService.initialize(mUserId, new IAppSearchResultCallback.Stub() {
public void onResult(AppSearchResult result) {
executor.execute(() -> {
if (result.isSuccess()) {
@@ -68,8 +72,9 @@
}
}
- private GlobalSearchSession(@NonNull IAppSearchManager service) {
+ private GlobalSearchSession(@NonNull IAppSearchManager service, @UserIdInt int userId) {
mService = service;
+ mUserId = userId;
}
/**
@@ -125,6 +130,6 @@
Objects.requireNonNull(searchSpec);
Objects.requireNonNull(executor);
return new SearchResults(mService, /*databaseName=*/null, queryExpression,
- searchSpec, executor);
+ searchSpec, mUserId, executor);
}
}
diff --git a/apex/appsearch/framework/java/android/app/appsearch/IAppSearchManager.aidl b/apex/appsearch/framework/java/android/app/appsearch/IAppSearchManager.aidl
index 7883046..c1c8047 100644
--- a/apex/appsearch/framework/java/android/app/appsearch/IAppSearchManager.aidl
+++ b/apex/appsearch/framework/java/android/app/appsearch/IAppSearchManager.aidl
@@ -36,6 +36,7 @@
* surfaces.
* @param forceOverride Whether to apply the new schema even if it is incompatible. All
* incompatible documents will be deleted.
+ * @param userId Id of the calling user
* @param callback {@link IAppSearchResultCallback#onResult} will be called with an
* {@link AppSearchResult}<{@link Void}>.
*/
@@ -44,6 +45,7 @@
in List<Bundle> schemaBundles,
in List<String> schemasNotPlatformSurfaceable,
boolean forceOverride,
+ in int userId,
in IAppSearchResultCallback callback);
@@ -51,17 +53,19 @@
* Retrieves the AppSearch schema for this database.
*
* @param databaseName The name of the database to retrieve.
+ * @param userId Id of the calling user
* @param callback {@link IAppSearchResultCallback#onResult} will be called with an
* {@link AppSearchResult}<{@link List}<{@link Bundle}>>, where the value are
* AppSearchSchema bundle.
*/
- void getSchema(in String databaseName, in IAppSearchResultCallback callback);
+ void getSchema(in String databaseName, in int userId, in IAppSearchResultCallback callback);
/**
* Inserts documents into the index.
*
* @param databaseName The name of the database where this document lives.
* @param documentBundes List of GenericDocument bundles.
+ * @param userId Id of the calling user
* @param callback
* If the call fails to start, {@link IAppSearchBatchResultCallback#onSystemError}
* will be called with the cause throwable. Otherwise,
@@ -72,6 +76,7 @@
void putDocuments(
in String databaseName,
in List<Bundle> documentBundles,
+ in int userId,
in IAppSearchBatchResultCallback callback);
/**
@@ -80,6 +85,7 @@
* @param databaseName The databaseName this document resides in.
* @param namespace The namespace this document resides in.
* @param uris The URIs of the documents to retrieve
+ * @param userId Id of the calling user
* @param callback
* If the call fails to start, {@link IAppSearchBatchResultCallback#onSystemError}
* will be called with the cause throwable. Otherwise,
@@ -91,6 +97,7 @@
in String databaseName,
in String namespace,
in List<String> uris,
+ in int userId,
in IAppSearchBatchResultCallback callback);
/**
@@ -99,6 +106,7 @@
* @param databaseName The databaseName this query for.
* @param queryExpression String to search for
* @param searchSpecBundle SearchSpec bundle
+ * @param userId Id of the calling user
* @param callback {@link AppSearchResult}<{@link Bundle}> of performing this
* operation.
*/
@@ -106,6 +114,7 @@
in String databaseName,
in String queryExpression,
in Bundle searchSpecBundle,
+ in int userId,
in IAppSearchResultCallback callback);
/**
@@ -114,12 +123,14 @@
*
* @param queryExpression String to search for
* @param searchSpecBundle SearchSpec bundle
+ * @param userId Id of the calling user
* @param callback {@link AppSearchResult}<{@link Bundle}> of performing this
* operation.
*/
void globalQuery(
in String queryExpression,
in Bundle searchSpecBundle,
+ in int userId,
in IAppSearchResultCallback callback);
/**
@@ -127,18 +138,20 @@
* next-page token is invalid or all pages have been returned.
*
* @param nextPageToken The token of pre-loaded results of previously executed query.
+ * @param userId Id of the calling user
* @param callback {@link AppSearchResult}<{@link Bundle}> of performing this
* operation.
*/
- void getNextPage(in long nextPageToken, in IAppSearchResultCallback callback);
+ void getNextPage(in long nextPageToken, in int userId, in IAppSearchResultCallback callback);
/**
* Invalidates the next-page token so that no more results of the related query can be returned.
*
* @param nextPageToken The token of pre-loaded results of previously executed query to be
* Invalidated.
+ * @param userId Id of the calling user
*/
- void invalidateNextPageToken(in long nextPageToken);
+ void invalidateNextPageToken(in long nextPageToken, in int userId);
/**
* Removes documents by URI.
@@ -146,6 +159,7 @@
* @param databaseName The databaseName the document is in.
* @param namespace Namespace of the document to remove.
* @param uris The URIs of the documents to delete
+ * @param userId Id of the calling user
* @param callback
* If the call fails to start, {@link IAppSearchBatchResultCallback#onSystemError}
* will be called with the cause throwable. Otherwise,
@@ -158,6 +172,7 @@
in String databaseName,
in String namespace,
in List<String> uris,
+ in int userId,
in IAppSearchBatchResultCallback callback);
/**
@@ -166,6 +181,7 @@
* @param databaseName The databaseName this query for.
* @param queryExpression String to search for
* @param searchSpecBundle SearchSpec bundle
+ * @param userId Id of the calling user
* @param callback {@link IAppSearchResultCallback#onResult} will be called with an
* {@link AppSearchResult}<{@link Void}>.
*/
@@ -173,13 +189,15 @@
in String databaseName,
in String queryExpression,
in Bundle searchSpecBundle,
+ in int userId,
in IAppSearchResultCallback callback);
/**
* Creates and initializes AppSearchImpl for the calling app.
*
+ * @param userId Id of the calling user
* @param callback {@link IAppSearchResultCallback#onResult} will be called with an
* {@link AppSearchResult}<{@link Void}>.
*/
- void initialize(in IAppSearchResultCallback callback);
+ void initialize(in int userId, in IAppSearchResultCallback callback);
}
diff --git a/apex/appsearch/framework/java/android/app/appsearch/SearchResults.java b/apex/appsearch/framework/java/android/app/appsearch/SearchResults.java
index 7dc13b4..82c2d26 100644
--- a/apex/appsearch/framework/java/android/app/appsearch/SearchResults.java
+++ b/apex/appsearch/framework/java/android/app/appsearch/SearchResults.java
@@ -19,14 +19,14 @@
import android.annotation.CallbackExecutor;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.UserIdInt;
import android.os.Bundle;
import android.os.RemoteException;
import android.util.Log;
-import com.android.internal.util.Preconditions;
-
import java.io.Closeable;
import java.util.List;
+import java.util.Objects;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
@@ -45,6 +45,7 @@
private final IAppSearchManager mService;
+ // The database name to search over. If null, this will search over all database names.
@Nullable
private final String mDatabaseName;
@@ -52,22 +53,28 @@
private final SearchSpec mSearchSpec;
+ @UserIdInt
+ private final int mUserId;
+
private final Executor mExecutor;
private long mNextPageToken;
private boolean mIsFirstLoad = true;
- SearchResults(@NonNull IAppSearchManager service,
+ SearchResults(
+ @NonNull IAppSearchManager service,
@Nullable String databaseName,
@NonNull String queryExpression,
@NonNull SearchSpec searchSpec,
+ @UserIdInt int userId,
@NonNull @CallbackExecutor Executor executor) {
- mService = Preconditions.checkNotNull(service);
- mExecutor = Preconditions.checkNotNull(executor);
+ mService = Objects.requireNonNull(service);
mDatabaseName = databaseName;
- mQueryExpression = Preconditions.checkNotNull(queryExpression);
- mSearchSpec = Preconditions.checkNotNull(searchSpec);
+ mQueryExpression = Objects.requireNonNull(queryExpression);
+ mSearchSpec = Objects.requireNonNull(searchSpec);
+ mUserId = userId;
+ mExecutor = Objects.requireNonNull(executor);
}
/**
@@ -85,20 +92,41 @@
if (mIsFirstLoad) {
mIsFirstLoad = false;
if (mDatabaseName == null) {
- mService.globalQuery(mQueryExpression, mSearchSpec.getBundle(),
+ // Global query, there's no one package-database combination to check.
+ mService.globalQuery(mQueryExpression, mSearchSpec.getBundle(), mUserId,
wrapCallback(callback));
} else {
- mService.query(mDatabaseName, mQueryExpression, mSearchSpec.getBundle(),
+ // Normal local query, pass in specified database.
+ mService.query(
+ mDatabaseName, mQueryExpression, mSearchSpec.getBundle(), mUserId,
wrapCallback(callback));
}
} else {
- mService.getNextPage(mNextPageToken, wrapCallback(callback));
+ mService.getNextPage(mNextPageToken, mUserId, wrapCallback(callback));
}
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
+ @Override
+ public void close() {
+ try {
+ mService.invalidateNextPageToken(mNextPageToken, mUserId);
+ } catch (RemoteException e) {
+ Log.d(TAG, "Unable to close the SearchResults", e);
+ }
+ }
+
+ private IAppSearchResultCallback wrapCallback(
+ @NonNull Consumer<AppSearchResult<List<SearchResult>>> callback) {
+ return new IAppSearchResultCallback.Stub() {
+ public void onResult(AppSearchResult result) {
+ mExecutor.execute(() -> invokeCallback(result, callback));
+ }
+ };
+ }
+
private void invokeCallback(AppSearchResult result,
@NonNull Consumer<AppSearchResult<List<SearchResult>>> callback) {
if (result.isSuccess()) {
@@ -115,23 +143,4 @@
callback.accept(result);
}
}
- @Override
- public void close() {
- mExecutor.execute(() -> {
- try {
- mService.invalidateNextPageToken(mNextPageToken);
- } catch (RemoteException e) {
- Log.d(TAG, "Unable to close the SearchResults", e);
- }
- });
- }
-
- private IAppSearchResultCallback wrapCallback(
- @NonNull Consumer<AppSearchResult<List<SearchResult>>> callback) {
- return new IAppSearchResultCallback.Stub() {
- public void onResult(AppSearchResult result) {
- mExecutor.execute(() -> invokeCallback(result, callback));
- }
- };
- }
}
diff --git a/apex/appsearch/framework/java/external/android/app/appsearch/PackageIdentifier.java b/apex/appsearch/framework/java/external/android/app/appsearch/PackageIdentifier.java
index b567dee..8b20c09 100644
--- a/apex/appsearch/framework/java/external/android/app/appsearch/PackageIdentifier.java
+++ b/apex/appsearch/framework/java/external/android/app/appsearch/PackageIdentifier.java
@@ -18,27 +18,38 @@
import android.annotation.NonNull;
+import com.android.internal.util.Preconditions;
+
import java.util.Arrays;
import java.util.Objects;
/**
* This class represents a uniquely identifiable package.
- *
* @hide
*/
public class PackageIdentifier {
- public final String packageName;
- public final byte[] certificate;
+ private final String mPackageName;
+ private final byte[] mSha256Certificate;
/**
* Creates a unique identifier for a package.
*
* @param packageName Name of the package.
- * @param certificate SHA256 certificate digest of the package.
+ * @param sha256Certificate SHA256 certificate digest of the package.
*/
- public PackageIdentifier(@NonNull String packageName, @NonNull byte[] certificate) {
- this.packageName = packageName;
- this.certificate = certificate;
+ public PackageIdentifier(@NonNull String packageName, @NonNull byte[] sha256Certificate) {
+ mPackageName = Preconditions.checkNotNull(packageName);
+ mSha256Certificate = Preconditions.checkNotNull(sha256Certificate);
+ }
+
+ @NonNull
+ public String getPackageName() {
+ return mPackageName;
+ }
+
+ @NonNull
+ public byte[] getSha256Certificate() {
+ return mSha256Certificate;
}
@Override
@@ -50,12 +61,12 @@
return false;
}
final PackageIdentifier other = (PackageIdentifier) obj;
- return this.packageName.equals(other.packageName)
- && Arrays.equals(this.certificate, other.certificate);
+ return this.mPackageName.equals(other.mPackageName)
+ && Arrays.equals(this.mSha256Certificate, other.mSha256Certificate);
}
@Override
public int hashCode() {
- return Objects.hash(packageName, Arrays.hashCode(certificate));
+ return Objects.hash(mPackageName, Arrays.hashCode(mSha256Certificate));
}
}
diff --git a/apex/appsearch/framework/java/external/android/app/appsearch/SearchSpec.java b/apex/appsearch/framework/java/external/android/app/appsearch/SearchSpec.java
index 68e31f0..400b630 100644
--- a/apex/appsearch/framework/java/external/android/app/appsearch/SearchSpec.java
+++ b/apex/appsearch/framework/java/external/android/app/appsearch/SearchSpec.java
@@ -23,6 +23,7 @@
import android.app.appsearch.exceptions.AppSearchException;
import android.app.appsearch.exceptions.IllegalSearchSpecException;
import android.os.Bundle;
+import android.util.ArrayMap;
import com.android.internal.util.Preconditions;
@@ -33,6 +34,8 @@
import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
/**
* This class represents the specification logic for AppSearch. It can be used to set the type of
@@ -40,6 +43,15 @@
*/
// TODO(sidchhabra) : AddResultSpec fields for Snippets etc.
public final class SearchSpec {
+ /**
+ * Schema type to be used in {@link SearchSpec.Builder#addProjectionTypePropertyPath} to apply
+ * property paths to all results, excepting any types that have had their own, specific property
+ * paths set.
+ *
+ * @hide
+ */
+ public static final String PROJECTION_SCHEMA_TYPE_WILDCARD = "*";
+
static final String TERM_MATCH_TYPE_FIELD = "termMatchType";
static final String SCHEMA_TYPE_FIELD = "schemaType";
static final String NAMESPACE_FIELD = "namespace";
@@ -49,6 +61,7 @@
static final String SNIPPET_COUNT_FIELD = "snippetCount";
static final String SNIPPET_COUNT_PER_PROPERTY_FIELD = "snippetCountPerProperty";
static final String MAX_SNIPPET_FIELD = "maxSnippet";
+ static final String PROJECTION_TYPE_PROPERTY_PATHS_FIELD = "projectionTypeFieldMasks";
/** @hide */
public static final int DEFAULT_NUM_PER_PAGE = 10;
@@ -206,12 +219,35 @@
return mBundle.getInt(MAX_SNIPPET_FIELD);
}
+ /**
+ * Returns a map from schema type to property paths to be used for projection.
+ *
+ * <p>If the map is empty, then all properties will be retrieved for all results.
+ *
+ * <p>Calling this function repeatedly is inefficient. Prefer to retain the Map returned by this
+ * function, rather than calling it multiple times.
+ *
+ * @hide
+ */
+ @NonNull
+ public Map<String, List<String>> getProjectionTypePropertyPaths() {
+ Bundle typePropertyPathsBundle = mBundle.getBundle(PROJECTION_TYPE_PROPERTY_PATHS_FIELD);
+ Set<String> schemaTypes = typePropertyPathsBundle.keySet();
+ Map<String, List<String>> typePropertyPathsMap = new ArrayMap<>(schemaTypes.size());
+ for (String schemaType : schemaTypes) {
+ typePropertyPathsMap.put(
+ schemaType, typePropertyPathsBundle.getStringArrayList(schemaType));
+ }
+ return typePropertyPathsMap;
+ }
+
/** Builder for {@link SearchSpec objects}. */
public static final class Builder {
private final Bundle mBundle;
private final ArrayList<String> mSchemaTypes = new ArrayList<>();
private final ArrayList<String> mNamespaces = new ArrayList<>();
+ private final Bundle mProjectionTypePropertyMasks = new Bundle();
private boolean mBuilt = false;
/** Creates a new {@link SearchSpec.Builder}. */
@@ -386,6 +422,109 @@
}
/**
+ * Adds property paths for the specified type to be used for projection. If property paths
+ * are added for a type, then only the properties referred to will be retrieved for results
+ * of that type. If a property path that is specified isn't present in a result, it will be
+ * ignored for that result. Property paths cannot be null.
+ *
+ * <p>If no property paths are added for a particular type, then all properties of results
+ * of that type will be retrieved.
+ *
+ * <p>If property path is added for the {@link SearchSpec#PROJECTION_SCHEMA_TYPE_WILDCARD},
+ * then those property paths will apply to all results, excepting any types that have their
+ * own, specific property paths set.
+ *
+ * <p>Suppose the following document is in the index.
+ *
+ * <pre>{@code
+ * Email: Document {
+ * sender: Document {
+ * name: "Mr. Person"
+ * email: "mrperson123@google.com"
+ * }
+ * recipients: [
+ * Document {
+ * name: "John Doe"
+ * email: "johndoe123@google.com"
+ * }
+ * Document {
+ * name: "Jane Doe"
+ * email: "janedoe123@google.com"
+ * }
+ * ]
+ * subject: "IMPORTANT"
+ * body: "Limited time offer!"
+ * }
+ * }</pre>
+ *
+ * <p>Then, suppose that a query for "important" is issued with the following projection
+ * type property paths:
+ *
+ * <pre>{@code
+ * {schemaType: "Email", ["subject", "sender.name", "recipients.name"]}
+ * }</pre>
+ *
+ * <p>The above document will be returned as:
+ *
+ * <pre>{@code
+ * Email: Document {
+ * sender: Document {
+ * name: "Mr. Body"
+ * }
+ * recipients: [
+ * Document {
+ * name: "John Doe"
+ * }
+ * Document {
+ * name: "Jane Doe"
+ * }
+ * ]
+ * subject: "IMPORTANT"
+ * }
+ * }</pre>
+ *
+ * @hide
+ */
+ @NonNull
+ public SearchSpec.Builder addProjectionTypePropertyPaths(
+ @NonNull String schemaType, @NonNull String... propertyPaths) {
+ Preconditions.checkNotNull(propertyPaths);
+ return addProjectionTypePropertyPaths(schemaType, Arrays.asList(propertyPaths));
+ }
+
+ /**
+ * Adds property paths for the specified type to be used for projection. If property paths
+ * are added for a type, then only the properties referred to will be retrieved for results
+ * of that type. If a property path that is specified isn't present in a result, it will be
+ * ignored for that result. Property paths cannot be null.
+ *
+ * <p>If no property paths are added for a particular type, then all properties of results
+ * of that type will be retrieved.
+ *
+ * <p>If property path is added for the {@link SearchSpec#PROJECTION_SCHEMA_TYPE_WILDCARD},
+ * then those property paths will apply to all results, excepting any types that have their
+ * own, specific property paths set.
+ *
+ * <p>{@see SearchSpec.Builder#addProjectionTypePropertyPath(String, String...)}
+ *
+ * @hide
+ */
+ @NonNull
+ public SearchSpec.Builder addProjectionTypePropertyPaths(
+ @NonNull String schemaType, @NonNull Collection<String> propertyPaths) {
+ Preconditions.checkState(!mBuilt, "Builder has already been used");
+ Preconditions.checkNotNull(schemaType);
+ Preconditions.checkNotNull(propertyPaths);
+ ArrayList<String> propertyPathsArrayList = new ArrayList<>(propertyPaths.size());
+ for (String propertyPath : propertyPaths) {
+ Preconditions.checkNotNull(propertyPath);
+ propertyPathsArrayList.add(propertyPath);
+ }
+ mProjectionTypePropertyMasks.putStringArrayList(schemaType, propertyPathsArrayList);
+ return this;
+ }
+
+ /**
* Constructs a new {@link SearchSpec} from the contents of this builder.
*
* <p>After calling this method, the builder must no longer be used.
@@ -398,6 +537,7 @@
}
mBundle.putStringArrayList(NAMESPACE_FIELD, mNamespaces);
mBundle.putStringArrayList(SCHEMA_TYPE_FIELD, mSchemaTypes);
+ mBundle.putBundle(PROJECTION_TYPE_PROPERTY_PATHS_FIELD, mProjectionTypePropertyMasks);
mBuilt = true;
return new SearchSpec(mBundle);
}
diff --git a/apex/appsearch/framework/java/external/android/app/appsearch/SetSchemaRequest.java b/apex/appsearch/framework/java/external/android/app/appsearch/SetSchemaRequest.java
index 4ef30c3..ad3ee05 100644
--- a/apex/appsearch/framework/java/external/android/app/appsearch/SetSchemaRequest.java
+++ b/apex/appsearch/framework/java/external/android/app/appsearch/SetSchemaRequest.java
@@ -18,17 +18,14 @@
import android.annotation.NonNull;
import android.annotation.SuppressLint;
-import android.app.appsearch.exceptions.AppSearchException;
import android.util.ArrayMap;
import android.util.ArraySet;
import com.android.internal.util.Preconditions;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
-import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -39,18 +36,18 @@
*/
public final class SetSchemaRequest {
private final Set<AppSearchSchema> mSchemas;
- private final Set<String> mSchemasNotPlatformSurfaceable;
- private final Map<String, Set<PackageIdentifier>> mSchemasPackageAccessible;
+ private final Set<String> mSchemasNotVisibleToSystemUi;
+ private final Map<String, Set<PackageIdentifier>> mSchemasVisibleToPackages;
private final boolean mForceOverride;
SetSchemaRequest(
@NonNull Set<AppSearchSchema> schemas,
- @NonNull Set<String> schemasNotPlatformSurfaceable,
- @NonNull Map<String, Set<PackageIdentifier>> schemasPackageAccessible,
+ @NonNull Set<String> schemasNotVisibleToSystemUi,
+ @NonNull Map<String, Set<PackageIdentifier>> schemasVisibleToPackages,
boolean forceOverride) {
mSchemas = Preconditions.checkNotNull(schemas);
- mSchemasNotPlatformSurfaceable = Preconditions.checkNotNull(schemasNotPlatformSurfaceable);
- mSchemasPackageAccessible = Preconditions.checkNotNull(schemasPackageAccessible);
+ mSchemasNotVisibleToSystemUi = Preconditions.checkNotNull(schemasNotVisibleToSystemUi);
+ mSchemasVisibleToPackages = Preconditions.checkNotNull(schemasVisibleToPackages);
mForceOverride = forceOverride;
}
@@ -62,12 +59,11 @@
/**
* Returns the set of schema types that have opted out of being visible on system UI surfaces.
- *
* @hide
*/
@NonNull
- public Set<String> getSchemasNotPlatformSurfaceable() {
- return Collections.unmodifiableSet(mSchemasNotPlatformSurfaceable);
+ public Set<String> getSchemasNotVisibleToSystemUi() {
+ return Collections.unmodifiableSet(mSchemasNotVisibleToSystemUi);
}
/**
@@ -76,14 +72,13 @@
* certificate.
*
* <p>This method is inefficient to call repeatedly.
- *
* @hide
*/
@NonNull
- public Map<String, Set<PackageIdentifier>> getSchemasPackageAccessible() {
+ public Map<String, Set<PackageIdentifier>> getSchemasVisibleToPackages() {
Map<String, Set<PackageIdentifier>> copy = new ArrayMap<>();
- for (String key : mSchemasPackageAccessible.keySet()) {
- copy.put(key, new ArraySet<>(mSchemasPackageAccessible.get(key)));
+ for (String key : mSchemasVisibleToPackages.keySet()) {
+ copy.put(key, new ArraySet<>(mSchemasVisibleToPackages.get(key)));
}
return copy;
}
@@ -93,14 +88,14 @@
* type. Each package is represented by a {@link PackageIdentifier}. name and byte[]
* certificate.
*
- * <p>A more efficient version of {@code #getSchemasPackageAccessible}, but it returns a
+ * <p>A more efficient version of {@link #getSchemasVisibleToPackages}, but it returns a
* modifiable map. This is not meant to be unhidden and should only be used by internal classes.
*
* @hide
*/
@NonNull
- public Map<String, Set<PackageIdentifier>> getSchemasPackageAccessibleInternal() {
- return mSchemasPackageAccessible;
+ public Map<String, Set<PackageIdentifier>> getSchemasVisibleToPackagesInternal() {
+ return mSchemasVisibleToPackages;
}
/** Returns whether this request will force the schema to be overridden. */
@@ -111,8 +106,8 @@
/** Builder for {@link SetSchemaRequest} objects. */
public static final class Builder {
private final Set<AppSearchSchema> mSchemas = new ArraySet<>();
- private final Set<String> mSchemasNotPlatformSurfaceable = new ArraySet<>();
- private final Map<String, Set<PackageIdentifier>> mSchemasPackageAccessible =
+ private final Set<String> mSchemasNotVisibleToSystemUi = new ArraySet<>();
+ private final Map<String, Set<PackageIdentifier>> mSchemasVisibleToPackages =
new ArrayMap<>();
private boolean mForceOverride = false;
private boolean mBuilt = false;
@@ -148,6 +143,8 @@
* @param visible Whether the {@code schemaType} will be visible or not.
* @hide
*/
+ // Merged list available from getSchemasNotVisibleToSystemUi
+ @SuppressLint("MissingGetterMatchingBuilder")
@NonNull
public Builder setSchemaTypeVisibilityForSystemUi(
@NonNull String schemaType, boolean visible) {
@@ -155,9 +152,9 @@
Preconditions.checkState(!mBuilt, "Builder has already been used");
if (visible) {
- mSchemasNotPlatformSurfaceable.remove(schemaType);
+ mSchemasNotVisibleToSystemUi.remove(schemaType);
} else {
- mSchemasNotPlatformSurfaceable.add(schemaType);
+ mSchemasNotVisibleToSystemUi.add(schemaType);
}
return this;
}
@@ -170,6 +167,8 @@
* @param packageIdentifier Represents the package that will be granted visibility.
* @hide
*/
+ // Merged list available from getSchemasVisibleToPackages
+ @SuppressLint("MissingGetterMatchingBuilder")
@NonNull
public Builder setSchemaTypeVisibilityForPackage(
@NonNull String schemaType,
@@ -179,13 +178,13 @@
Preconditions.checkNotNull(packageIdentifier);
Preconditions.checkState(!mBuilt, "Builder has already been used");
- Set<PackageIdentifier> packageIdentifiers = mSchemasPackageAccessible.get(schemaType);
+ Set<PackageIdentifier> packageIdentifiers = mSchemasVisibleToPackages.get(schemaType);
if (visible) {
if (packageIdentifiers == null) {
packageIdentifiers = new ArraySet<>();
}
packageIdentifiers.add(packageIdentifier);
- mSchemasPackageAccessible.put(schemaType, packageIdentifiers);
+ mSchemasVisibleToPackages.put(schemaType, packageIdentifiers);
} else {
if (packageIdentifiers == null) {
// Return early since there was nothing set to begin with.
@@ -194,7 +193,7 @@
packageIdentifiers.remove(packageIdentifier);
if (packageIdentifiers.isEmpty()) {
// Remove the entire key so that we don't have empty sets as values.
- mSchemasPackageAccessible.remove(schemaType);
+ mSchemasVisibleToPackages.remove(schemaType);
}
}
@@ -229,8 +228,8 @@
// Verify that any schema types with visibility settings refer to a real schema.
// Create a copy because we're going to remove from the set for verification purposes.
- Set<String> referencedSchemas = new ArraySet<>(mSchemasNotPlatformSurfaceable);
- referencedSchemas.addAll(mSchemasPackageAccessible.keySet());
+ Set<String> referencedSchemas = new ArraySet<>(mSchemasNotVisibleToSystemUi);
+ referencedSchemas.addAll(mSchemasVisibleToPackages.keySet());
for (AppSearchSchema schema : mSchemas) {
referencedSchemas.remove(schema.getSchemaType());
@@ -244,8 +243,8 @@
return new SetSchemaRequest(
mSchemas,
- mSchemasNotPlatformSurfaceable,
- mSchemasPackageAccessible,
+ mSchemasNotVisibleToSystemUi,
+ mSchemasVisibleToPackages,
mForceOverride);
}
}
diff --git a/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java b/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
index d81b794..8cf1ca0 100644
--- a/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
+++ b/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
@@ -18,6 +18,8 @@
import static android.app.appsearch.AppSearchResult.throwableToFailedResult;
import android.annotation.NonNull;
+import android.annotation.UserIdInt;
+import android.app.ActivityManager;
import android.app.appsearch.AppSearchBatchResult;
import android.app.appsearch.AppSearchResult;
import android.app.appsearch.AppSearchSchema;
@@ -32,7 +34,6 @@
import android.os.Bundle;
import android.os.ParcelableException;
import android.os.RemoteException;
-import android.os.UserHandle;
import android.util.Log;
import com.android.internal.util.Preconditions;
@@ -64,12 +65,13 @@
@NonNull List<Bundle> schemaBundles,
@NonNull List<String> schemasNotPlatformSurfaceable,
boolean forceOverride,
+ @UserIdInt int userId,
@NonNull IAppSearchResultCallback callback) {
Preconditions.checkNotNull(databaseName);
Preconditions.checkNotNull(schemaBundles);
Preconditions.checkNotNull(callback);
- int callingUid = Binder.getCallingUidOrThrow();
- int callingUserId = UserHandle.getUserId(callingUid);
+ int callingUid = Binder.getCallingUid();
+ int callingUserId = handleIncomingUser(userId, callingUid);
final long callingIdentity = Binder.clearCallingIdentity();
try {
List<AppSearchSchema> schemas = new ArrayList<>(schemaBundles.size());
@@ -92,11 +94,12 @@
@Override
public void getSchema(
@NonNull String databaseName,
+ @UserIdInt int userId,
@NonNull IAppSearchResultCallback callback) {
Preconditions.checkNotNull(databaseName);
Preconditions.checkNotNull(callback);
int callingUid = Binder.getCallingUidOrThrow();
- int callingUserId = UserHandle.getUserId(callingUid);
+ int callingUserId = handleIncomingUser(userId, callingUid);
final long callingIdentity = Binder.clearCallingIdentity();
try {
AppSearchImpl impl = ImplInstanceManager.getInstance(getContext(), callingUserId);
@@ -119,12 +122,13 @@
public void putDocuments(
@NonNull String databaseName,
@NonNull List<Bundle> documentBundles,
+ @UserIdInt int userId,
@NonNull IAppSearchBatchResultCallback callback) {
Preconditions.checkNotNull(databaseName);
Preconditions.checkNotNull(documentBundles);
Preconditions.checkNotNull(callback);
- int callingUid = Binder.getCallingUidOrThrow();
- int callingUserId = UserHandle.getUserId(callingUid);
+ int callingUid = Binder.getCallingUid();
+ int callingUserId = handleIncomingUser(userId, callingUid);
final long callingIdentity = Binder.clearCallingIdentity();
try {
AppSearchBatchResult.Builder<String, Void> resultBuilder =
@@ -151,15 +155,18 @@
}
@Override
- public void getDocuments(@NonNull String databaseName, @NonNull String namespace,
+ public void getDocuments(
+ @NonNull String databaseName,
+ @NonNull String namespace,
@NonNull List<String> uris,
+ @UserIdInt int userId,
@NonNull IAppSearchBatchResultCallback callback) {
Preconditions.checkNotNull(databaseName);
Preconditions.checkNotNull(namespace);
Preconditions.checkNotNull(uris);
Preconditions.checkNotNull(callback);
- int callingUid = Binder.getCallingUidOrThrow();
- int callingUserId = UserHandle.getUserId(callingUid);
+ int callingUid = Binder.getCallingUid();
+ int callingUserId = handleIncomingUser(userId, callingUid);
final long callingIdentity = Binder.clearCallingIdentity();
try {
AppSearchBatchResult.Builder<String, Bundle> resultBuilder =
@@ -190,13 +197,14 @@
@NonNull String databaseName,
@NonNull String queryExpression,
@NonNull Bundle searchSpecBundle,
+ @UserIdInt int userId,
@NonNull IAppSearchResultCallback callback) {
Preconditions.checkNotNull(databaseName);
Preconditions.checkNotNull(queryExpression);
Preconditions.checkNotNull(searchSpecBundle);
Preconditions.checkNotNull(callback);
- int callingUid = Binder.getCallingUidOrThrow();
- int callingUserId = UserHandle.getUserId(callingUid);
+ int callingUid = Binder.getCallingUid();
+ int callingUserId = handleIncomingUser(userId, callingUid);
final long callingIdentity = Binder.clearCallingIdentity();
try {
AppSearchImpl impl = ImplInstanceManager.getInstance(getContext(), callingUserId);
@@ -215,15 +223,17 @@
}
}
+ @Override
public void globalQuery(
@NonNull String queryExpression,
@NonNull Bundle searchSpecBundle,
+ @UserIdInt int userId,
@NonNull IAppSearchResultCallback callback) {
Preconditions.checkNotNull(queryExpression);
Preconditions.checkNotNull(searchSpecBundle);
Preconditions.checkNotNull(callback);
- int callingUid = Binder.getCallingUidOrThrow();
- int callingUserId = UserHandle.getUserId(callingUid);
+ int callingUid = Binder.getCallingUid();
+ int callingUserId = handleIncomingUser(userId, callingUid);
final long callingIdentity = Binder.clearCallingIdentity();
try {
AppSearchImpl impl = ImplInstanceManager.getInstance(getContext(), callingUserId);
@@ -240,11 +250,11 @@
}
@Override
- public void getNextPage(long nextPageToken,
+ public void getNextPage(long nextPageToken, @UserIdInt int userId,
@NonNull IAppSearchResultCallback callback) {
Preconditions.checkNotNull(callback);
- int callingUid = Binder.getCallingUidOrThrow();
- int callingUserId = UserHandle.getUserId(callingUid);
+ int callingUid = Binder.getCallingUid();
+ int callingUserId = handleIncomingUser(userId, callingUid);
final long callingIdentity = Binder.clearCallingIdentity();
// TODO(b/162450968) check nextPageToken is being advanced by the same uid as originally
// opened it
@@ -261,9 +271,9 @@
}
@Override
- public void invalidateNextPageToken(long nextPageToken) {
- int callingUid = Binder.getCallingUidOrThrow();
- int callingUserId = UserHandle.getUserId(callingUid);
+ public void invalidateNextPageToken(long nextPageToken, @UserIdInt int userId) {
+ int callingUid = Binder.getCallingUid();
+ int callingUserId = handleIncomingUser(userId, callingUid);
final long callingIdentity = Binder.clearCallingIdentity();
try {
AppSearchImpl impl = ImplInstanceManager.getInstance(getContext(), callingUserId);
@@ -276,14 +286,17 @@
}
@Override
- public void removeByUri(@NonNull String databaseName, @NonNull String namespace,
+ public void removeByUri(
+ @NonNull String databaseName,
+ @NonNull String namespace,
@NonNull List<String> uris,
+ @UserIdInt int userId,
@NonNull IAppSearchBatchResultCallback callback) {
Preconditions.checkNotNull(databaseName);
Preconditions.checkNotNull(uris);
Preconditions.checkNotNull(callback);
- int callingUid = Binder.getCallingUidOrThrow();
- int callingUserId = UserHandle.getUserId(callingUid);
+ int callingUid = Binder.getCallingUid();
+ int callingUserId = handleIncomingUser(userId, callingUid);
final long callingIdentity = Binder.clearCallingIdentity();
try {
AppSearchBatchResult.Builder<String, Void> resultBuilder =
@@ -312,13 +325,14 @@
@NonNull String databaseName,
@NonNull String queryExpression,
@NonNull Bundle searchSpecBundle,
+ @UserIdInt int userId,
@NonNull IAppSearchResultCallback callback) {
Preconditions.checkNotNull(databaseName);
Preconditions.checkNotNull(queryExpression);
Preconditions.checkNotNull(searchSpecBundle);
Preconditions.checkNotNull(callback);
- int callingUid = Binder.getCallingUidOrThrow();
- int callingUserId = UserHandle.getUserId(callingUid);
+ int callingUid = Binder.getCallingUid();
+ int callingUserId = handleIncomingUser(userId, callingUid);
final long callingIdentity = Binder.clearCallingIdentity();
try {
AppSearchImpl impl = ImplInstanceManager.getInstance(getContext(), callingUserId);
@@ -334,10 +348,10 @@
}
@Override
- public void initialize(@NonNull IAppSearchResultCallback callback) {
+ public void initialize(@UserIdInt int userId, @NonNull IAppSearchResultCallback callback) {
Preconditions.checkNotNull(callback);
- int callingUid = Binder.getCallingUidOrThrow();
- int callingUserId = UserHandle.getUserId(callingUid);
+ int callingUid = Binder.getCallingUid();
+ int callingUserId = handleIncomingUser(userId, callingUid);
final long callingIdentity = Binder.clearCallingIdentity();
try {
ImplInstanceManager.getInstance(getContext(), callingUserId);
@@ -415,4 +429,14 @@
}
}
}
+
+ //TODO(b/173553485) verifying that the caller has permission to access target user's data
+ //TODO(b/173553485) Handle ACTION_USER_REMOVED broadcast
+ //TODO(b/173553485) Implement SystemService.onUserStopping()
+ private static int handleIncomingUser(@UserIdInt int userId, int callingUid) {
+ int callingPid = Binder.getCallingPid();
+ return ActivityManager.handleIncomingUser(callingPid, callingUid, userId,
+ /*allowAll=*/ false, /*requireFull=*/ false,
+ /*name=*/ null, /*callerPackage=*/ null);
+ }
}
diff --git a/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/AppSearchImpl.java b/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/AppSearchImpl.java
index c806af5..1d5287b 100644
--- a/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/AppSearchImpl.java
+++ b/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/AppSearchImpl.java
@@ -156,7 +156,6 @@
}
private AppSearchImpl(@NonNull File icingDir) throws AppSearchException {
- boolean isReset = false;
mReadWriteLock.writeLock().lock();
try {
@@ -168,9 +167,11 @@
.build();
mIcingSearchEngineLocked = new IcingSearchEngine(options);
+ mVisibilityStoreLocked = new VisibilityStore(this);
+
InitializeResultProto initializeResultProto = mIcingSearchEngineLocked.initialize();
- SchemaProto schemaProto = null;
- GetAllNamespacesResultProto getAllNamespacesResultProto = null;
+ SchemaProto schemaProto;
+ GetAllNamespacesResultProto getAllNamespacesResultProto;
try {
checkSuccess(initializeResultProto.getStatus());
schemaProto = getSchemaProtoLocked();
@@ -180,7 +181,7 @@
Log.w(TAG, "Error initializing, resetting IcingSearchEngine.", e);
// Some error. Reset and see if it fixes it.
reset();
- isReset = true;
+ return;
}
// Populate schema map
@@ -196,11 +197,8 @@
// TODO(b/155939114): It's possible to optimize after init, which would reduce the time
// to when we're able to serve queries. Consider moving this optimize call out.
- if (!isReset) {
- checkForOptimizeLocked(/* force= */ true);
- }
+ checkForOptimizeLocked(/* force= */ true);
- mVisibilityStoreLocked = new VisibilityStore(this);
} finally {
mReadWriteLock.writeLock().unlock();
}
@@ -635,6 +633,9 @@
/**
* Clears documents and schema across all packages and databaseNames.
*
+ * <p>This method also clear all data in {@link VisibilityStore}, an {@link
+ * #initializeVisibilityStore()} must be called after this.
+ *
* <p>This method belongs to mutate group.
*
* @throws AppSearchException on IcingSearchEngine error.
diff --git a/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/VisibilityStore.java b/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/VisibilityStore.java
index 411da2f..7e4ebb5 100644
--- a/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/VisibilityStore.java
+++ b/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/VisibilityStore.java
@@ -213,14 +213,12 @@
}
/**
- * Handles an {@link AppSearchImpl#reset()} by clearing any cached state and resetting to a
- * first-initialized state.
+ * Handles an {@code AppSearchImpl#reset()} by clearing any cached state.
*
- * @throws AppSearchException on AppSearchImpl error.
+ * <p>{@link #initialize()} must be called after this.
*/
- public void handleReset() throws AppSearchException {
+ void handleReset() {
mNotPlatformSurfaceableMap.clear();
- initialize();
}
/**
diff --git a/apex/appsearch/synced_jetpack_changeid.txt b/apex/appsearch/synced_jetpack_changeid.txt
index 5a7ab1d..5b818c7 100644
--- a/apex/appsearch/synced_jetpack_changeid.txt
+++ b/apex/appsearch/synced_jetpack_changeid.txt
@@ -1 +1 @@
-Ia04e81bb574831fa7e8a26c725e53133b39ee3ef
+Idd770a064edfeb6dc648571fc6706c087b8e605a
diff --git a/apex/appsearch/testing/java/com/android/server/appsearch/testing/AppSearchSessionShim.java b/apex/appsearch/testing/java/com/android/server/appsearch/testing/AppSearchSessionShimImpl.java
similarity index 74%
rename from apex/appsearch/testing/java/com/android/server/appsearch/testing/AppSearchSessionShim.java
rename to apex/appsearch/testing/java/com/android/server/appsearch/testing/AppSearchSessionShimImpl.java
index b1e760a..1d2382a 100644
--- a/apex/appsearch/testing/java/com/android/server/appsearch/testing/AppSearchSessionShim.java
+++ b/apex/appsearch/testing/java/com/android/server/appsearch/testing/AppSearchSessionShimImpl.java
@@ -20,15 +20,19 @@
import android.app.appsearch.AppSearchBatchResult;
import android.app.appsearch.AppSearchManager;
import android.app.appsearch.AppSearchResult;
+import android.app.appsearch.AppSearchSchema;
import android.app.appsearch.AppSearchSession;
+import android.app.appsearch.AppSearchSessionShim;
import android.app.appsearch.BatchResultCallback;
import android.app.appsearch.GenericDocument;
import android.app.appsearch.GetByUriRequest;
import android.app.appsearch.PutDocumentsRequest;
import android.app.appsearch.RemoveByUriRequest;
import android.app.appsearch.SearchResults;
+import android.app.appsearch.SearchResultsShim;
import android.app.appsearch.SearchSpec;
import android.app.appsearch.SetSchemaRequest;
+import android.app.appsearch.exceptions.AppSearchException;
import android.content.Context;
import androidx.test.core.app.ApplicationProvider;
@@ -38,6 +42,7 @@
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
+import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -46,42 +51,47 @@
* a consistent interface.
* @hide
*/
-public class AppSearchSessionShim {
+public class AppSearchSessionShimImpl implements AppSearchSessionShim {
private final AppSearchSession mAppSearchSession;
private final ExecutorService mExecutor;
@NonNull
- public static ListenableFuture<AppSearchResult<AppSearchSessionShim>> createSearchSession(
+ public static ListenableFuture<AppSearchSessionShim> createSearchSession(
@NonNull AppSearchManager.SearchContext searchContext) {
Context context = ApplicationProvider.getApplicationContext();
AppSearchManager appSearchManager = context.getSystemService(AppSearchManager.class);
SettableFuture<AppSearchResult<AppSearchSession>> future = SettableFuture.create();
ExecutorService executor = Executors.newCachedThreadPool();
appSearchManager.createSearchSession(searchContext, executor, future::set);
- return Futures.transform(future, (instance) -> {
- if (!instance.isSuccess()) {
- return AppSearchResult.newFailedResult(
- instance.getResultCode(), instance.getErrorMessage());
- }
- AppSearchSession searchSession = instance.getResultValue();
- AppSearchSessionShim shim = new AppSearchSessionShim(searchSession, executor);
- return AppSearchResult.newSuccessfulResult(shim);
- }, executor);
+ return Futures.transform(
+ future,
+ instance -> new AppSearchSessionShimImpl(instance.getResultValue(), executor),
+ executor);
}
- private AppSearchSessionShim(
+ private AppSearchSessionShimImpl(
@NonNull AppSearchSession session, @NonNull ExecutorService executor) {
mAppSearchSession = Preconditions.checkNotNull(session);
mExecutor = Preconditions.checkNotNull(executor);
}
+ @Override
@NonNull
- public ListenableFuture<AppSearchResult<Void>> setSchema(@NonNull SetSchemaRequest request) {
+ public ListenableFuture<Void> setSchema(@NonNull SetSchemaRequest request) {
SettableFuture<AppSearchResult<Void>> future = SettableFuture.create();
mAppSearchSession.setSchema(request, mExecutor, future::set);
- return future;
+ return Futures.transformAsync(future, this::transformResult, mExecutor);
}
+ @Override
+ @NonNull
+ public ListenableFuture<Set<AppSearchSchema>> getSchema() {
+ SettableFuture<AppSearchResult<Set<AppSearchSchema>>> future = SettableFuture.create();
+ mAppSearchSession.getSchema(mExecutor, future::set);
+ return Futures.transformAsync(future, this::transformResult, mExecutor);
+ }
+
+ @Override
@NonNull
public ListenableFuture<AppSearchBatchResult<String, Void>> putDocuments(
@NonNull PutDocumentsRequest request) {
@@ -91,6 +101,7 @@
return future;
}
+ @Override
@NonNull
public ListenableFuture<AppSearchBatchResult<String, GenericDocument>> getByUri(
@NonNull GetByUriRequest request) {
@@ -100,14 +111,16 @@
return future;
}
+ @Override
@NonNull
public SearchResultsShim query(
@NonNull String queryExpression, @NonNull SearchSpec searchSpec) {
SearchResults searchResults =
mAppSearchSession.query(queryExpression, searchSpec, mExecutor);
- return new SearchResultsShim(searchResults);
+ return new SearchResultsShimImpl(searchResults, mExecutor);
}
+ @Override
@NonNull
public ListenableFuture<AppSearchBatchResult<String, Void>> removeByUri(
@NonNull RemoveByUriRequest request) {
@@ -116,12 +129,21 @@
return future;
}
+ @Override
@NonNull
- public ListenableFuture<AppSearchResult<Void>> removeByQuery(
+ public ListenableFuture<Void> removeByQuery(
@NonNull String queryExpression, @NonNull SearchSpec searchSpec) {
SettableFuture<AppSearchResult<Void>> future = SettableFuture.create();
mAppSearchSession.removeByQuery(queryExpression, searchSpec, mExecutor, future::set);
- return future;
+ return Futures.transformAsync(future, this::transformResult, mExecutor);
+ }
+
+ private <T> ListenableFuture<T> transformResult(
+ @NonNull AppSearchResult<T> result) throws AppSearchException {
+ if (!result.isSuccess()) {
+ throw new AppSearchException(result.getResultCode(), result.getErrorMessage());
+ }
+ return Futures.immediateFuture(result.getResultValue());
}
private static final class BatchResultCallbackAdapter<K, V>
diff --git a/apex/appsearch/testing/java/com/android/server/appsearch/testing/GlobalSearchSessionShim.java b/apex/appsearch/testing/java/com/android/server/appsearch/testing/GlobalSearchSessionShimImpl.java
similarity index 76%
rename from apex/appsearch/testing/java/com/android/server/appsearch/testing/GlobalSearchSessionShim.java
rename to apex/appsearch/testing/java/com/android/server/appsearch/testing/GlobalSearchSessionShimImpl.java
index 5146426..9e22bf6 100644
--- a/apex/appsearch/testing/java/com/android/server/appsearch/testing/GlobalSearchSessionShim.java
+++ b/apex/appsearch/testing/java/com/android/server/appsearch/testing/GlobalSearchSessionShimImpl.java
@@ -20,7 +20,9 @@
import android.app.appsearch.AppSearchManager;
import android.app.appsearch.AppSearchResult;
import android.app.appsearch.GlobalSearchSession;
+import android.app.appsearch.GlobalSearchSessionShim;
import android.app.appsearch.SearchResults;
+import android.app.appsearch.SearchResultsShim;
import android.app.appsearch.SearchSpec;
import android.content.Context;
@@ -39,40 +41,35 @@
* a consistent interface.
* @hide
*/
-public class GlobalSearchSessionShim {
+public class GlobalSearchSessionShimImpl implements GlobalSearchSessionShim {
private final GlobalSearchSession mGlobalSearchSession;
private final ExecutorService mExecutor;
@NonNull
- public static ListenableFuture<AppSearchResult<GlobalSearchSessionShim>>
- createGlobalSearchSession() {
+ public static ListenableFuture<GlobalSearchSessionShimImpl> createGlobalSearchSession() {
Context context = ApplicationProvider.getApplicationContext();
AppSearchManager appSearchManager = context.getSystemService(AppSearchManager.class);
SettableFuture<AppSearchResult<GlobalSearchSession>> future = SettableFuture.create();
ExecutorService executor = Executors.newCachedThreadPool();
appSearchManager.createGlobalSearchSession(executor, future::set);
- return Futures.transform(future, (instance) -> {
- if (!instance.isSuccess()) {
- return AppSearchResult.newFailedResult(
- instance.getResultCode(), instance.getErrorMessage());
- }
- GlobalSearchSession searchSession = instance.getResultValue();
- GlobalSearchSessionShim shim = new GlobalSearchSessionShim(searchSession, executor);
- return AppSearchResult.newSuccessfulResult(shim);
- }, executor);
+ return Futures.transform(
+ future,
+ instance -> new GlobalSearchSessionShimImpl(instance.getResultValue(), executor),
+ executor);
}
- private GlobalSearchSessionShim(
+ private GlobalSearchSessionShimImpl(
@NonNull GlobalSearchSession session, @NonNull ExecutorService executor) {
mGlobalSearchSession = Preconditions.checkNotNull(session);
mExecutor = Preconditions.checkNotNull(executor);
}
@NonNull
+ @Override
public SearchResultsShim query(
@NonNull String queryExpression, @NonNull SearchSpec searchSpec) {
SearchResults searchResults =
mGlobalSearchSession.query(queryExpression, searchSpec, mExecutor);
- return new SearchResultsShim(searchResults);
+ return new SearchResultsShimImpl(searchResults, mExecutor);
}
}
diff --git a/apex/appsearch/testing/java/com/android/server/appsearch/testing/SearchResultsShim.java b/apex/appsearch/testing/java/com/android/server/appsearch/testing/SearchResultsShimImpl.java
similarity index 73%
rename from apex/appsearch/testing/java/com/android/server/appsearch/testing/SearchResultsShim.java
rename to apex/appsearch/testing/java/com/android/server/appsearch/testing/SearchResultsShimImpl.java
index cf43401..75add81 100644
--- a/apex/appsearch/testing/java/com/android/server/appsearch/testing/SearchResultsShim.java
+++ b/apex/appsearch/testing/java/com/android/server/appsearch/testing/SearchResultsShimImpl.java
@@ -20,31 +20,35 @@
import android.app.appsearch.AppSearchResult;
import android.app.appsearch.SearchResult;
import android.app.appsearch.SearchResults;
+import android.app.appsearch.SearchResultsShim;
import com.google.common.base.Preconditions;
+import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
-import java.io.Closeable;
import java.util.List;
+import java.util.concurrent.Executor;
/**
* This test class adapts the AppSearch Framework API to ListenableFuture, so it can be tested via
* a consistent interface.
* @hide
*/
-public class SearchResultsShim implements Closeable {
+public class SearchResultsShimImpl implements SearchResultsShim {
+ private final Executor mExecutor;
private final SearchResults mSearchResults;
- SearchResultsShim(@NonNull SearchResults searchResults) {
+ SearchResultsShimImpl(@NonNull SearchResults searchResults, @NonNull Executor executor) {
+ mExecutor = Preconditions.checkNotNull(executor);
mSearchResults = Preconditions.checkNotNull(searchResults);
}
@NonNull
- public ListenableFuture<AppSearchResult<List<SearchResult>>> getNextPage() {
+ public ListenableFuture<List<SearchResult>> getNextPage() {
SettableFuture<AppSearchResult<List<SearchResult>>> future = SettableFuture.create();
mSearchResults.getNextPage(future::set);
- return future;
+ return Futures.transform(future, AppSearchResult::getResultValue, mExecutor);
}
@Override
diff --git a/apex/appsearch/testing/java/com/android/server/appsearch/testing/external/AppSearchSessionShim.java b/apex/appsearch/testing/java/com/android/server/appsearch/testing/external/AppSearchSessionShim.java
new file mode 100644
index 0000000..8c42b2d
--- /dev/null
+++ b/apex/appsearch/testing/java/com/android/server/appsearch/testing/external/AppSearchSessionShim.java
@@ -0,0 +1,211 @@
+/*
+ * 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.appsearch;
+
+import android.annotation.NonNull;
+import android.annotation.SuppressLint;
+
+import com.google.common.util.concurrent.ListenableFuture;
+
+import java.util.Set;
+
+/**
+ * Represents a connection to an AppSearch storage system where {@link GenericDocument}s can be
+ * placed and queried.
+ *
+ * All implementations of this interface must be thread safe.
+ */
+public interface AppSearchSessionShim {
+
+ /**
+ * Sets the schema that will be used by documents provided to the {@link #putDocuments} method.
+ *
+ * <p>The schema provided here is compared to the stored copy of the schema previously supplied
+ * to {@link #setSchema}, if any, to determine how to treat existing documents. The following
+ * types of schema modifications are always safe and are made without deleting any existing
+ * documents:
+ * <ul>
+ * <li>Addition of new types
+ * <li>Addition of new
+ * {@link AppSearchSchema.PropertyConfig#CARDINALITY_OPTIONAL OPTIONAL} or
+ * {@link AppSearchSchema.PropertyConfig#CARDINALITY_REPEATED REPEATED} properties to a
+ * type
+ * <li>Changing the cardinality of a data type to be less restrictive (e.g. changing an
+ * {@link AppSearchSchema.PropertyConfig#CARDINALITY_OPTIONAL OPTIONAL} property into a
+ * {@link AppSearchSchema.PropertyConfig#CARDINALITY_REPEATED REPEATED} property.
+ * </ul>
+ *
+ * <p>The following types of schema changes are not backwards-compatible:
+ * <ul>
+ * <li>Removal of an existing type
+ * <li>Removal of a property from a type
+ * <li>Changing the data type ({@code boolean}, {@code long}, etc.) of an existing property
+ * <li>For properties of {@code Document} type, changing the schema type of
+ * {@code Document}s of that property
+ * <li>Changing the cardinality of a data type to be more restrictive (e.g. changing an
+ * {@link AppSearchSchema.PropertyConfig#CARDINALITY_OPTIONAL OPTIONAL} property into a
+ * {@link AppSearchSchema.PropertyConfig#CARDINALITY_REQUIRED REQUIRED} property).
+ * <li>Adding a
+ * {@link AppSearchSchema.PropertyConfig#CARDINALITY_REQUIRED REQUIRED} property.
+ * </ul>
+ * <p>Supplying a schema with such changes will, by default, result in this call completing its
+ * future with an {@link androidx.appsearch.exceptions.AppSearchException} with a code of
+ * {@link AppSearchResult#RESULT_INVALID_SCHEMA} and a message describing the incompatibility.
+ * In this case the previously set schema will remain active.
+ *
+ * <p>If you need to make non-backwards-compatible changes as described above, you can set the
+ * {@link SetSchemaRequest.Builder#setForceOverride} method to {@code true}. In this case,
+ * instead of completing its future with an
+ * {@link androidx.appsearch.exceptions.AppSearchException} with the
+ * {@link AppSearchResult#RESULT_INVALID_SCHEMA} error code, all documents which are not
+ * compatible with the new schema will be deleted and the incompatible schema will be applied.
+ *
+ * <p>It is a no-op to set the same schema as has been previously set; this is handled
+ * efficiently.
+ *
+ * <p>By default, documents are visible on platform surfaces. To opt out, call {@code
+ * SetSchemaRequest.Builder#setPlatformSurfaceable} with {@code surfaceable} as false. Any
+ * visibility settings apply only to the schemas that are included in the {@code request}.
+ * Visibility settings for a schema type do not apply or persist across
+ * {@link SetSchemaRequest}s.
+ *
+ * @param request The schema update request.
+ * @return The pending result of performing this operation.
+ */
+ // TODO(b/169883602): Change @code references to @link when setPlatformSurfaceable APIs are
+ // exposed.
+ @NonNull
+ ListenableFuture<Void> setSchema(@NonNull SetSchemaRequest request);
+
+ /**
+ * Retrieves the schema most recently successfully provided to {@link #setSchema}.
+ *
+ * @return The pending result of performing this operation.
+ */
+ // This call hits disk; async API prevents us from treating these calls as properties.
+ @SuppressLint("KotlinPropertyAccess")
+ @NonNull
+ ListenableFuture<Set<AppSearchSchema>> getSchema();
+
+ /**
+ * Indexes documents into AppSearch.
+ *
+ * <p>Each {@link GenericDocument}'s {@code schemaType} field must be set to the name of a
+ * schema type previously registered via the {@link #setSchema} method.
+ *
+ * @param request {@link PutDocumentsRequest} containing documents to be indexed
+ * @return The pending result of performing this operation. The keys of the returned
+ * {@link AppSearchBatchResult} are the URIs of the input documents. The values are
+ * {@code null} if they were successfully indexed, or a failed {@link AppSearchResult}
+ * otherwise.
+ */
+ @NonNull
+ ListenableFuture<AppSearchBatchResult<String, Void>> putDocuments(
+ @NonNull PutDocumentsRequest request);
+
+ /**
+ * Retrieves {@link GenericDocument}s by URI.
+ *
+ * @param request {@link GetByUriRequest} containing URIs to be retrieved.
+ * @return The pending result of performing this operation. The keys of the returned
+ * {@link AppSearchBatchResult} are the input URIs. The values are the returned
+ * {@link GenericDocument}s on success, or a failed {@link AppSearchResult} otherwise.
+ * URIs that are not found will return a failed {@link AppSearchResult} with a result code
+ * of {@link AppSearchResult#RESULT_NOT_FOUND}.
+ */
+ @NonNull
+ ListenableFuture<AppSearchBatchResult<String, GenericDocument>> getByUri(
+ @NonNull GetByUriRequest request);
+
+ /**
+ * Searches a document based on a given query string.
+ *
+ * <p>Currently we support following features in the raw query format:
+ * <ul>
+ * <li>AND
+ * <p>AND joins (e.g. “match documents that have both the terms ‘dog’ and
+ * ‘cat’”).
+ * Example: hello world matches documents that have both ‘hello’ and ‘world’
+ * <li>OR
+ * <p>OR joins (e.g. “match documents that have either the term ‘dog’ or
+ * ‘cat’”).
+ * Example: dog OR puppy
+ * <li>Exclusion
+ * <p>Exclude a term (e.g. “match documents that do
+ * not have the term ‘dog’”).
+ * Example: -dog excludes the term ‘dog’
+ * <li>Grouping terms
+ * <p>Allow for conceptual grouping of subqueries to enable hierarchical structures (e.g.
+ * “match documents that have either ‘dog’ or ‘puppy’, and either ‘cat’ or ‘kitten’”).
+ * Example: (dog puppy) (cat kitten) two one group containing two terms.
+ * <li>Property restricts
+ * <p> Specifies which properties of a document to specifically match terms in (e.g.
+ * “match documents where the ‘subject’ property contains ‘important’”).
+ * Example: subject:important matches documents with the term ‘important’ in the
+ * ‘subject’ property
+ * <li>Schema type restricts
+ * <p>This is similar to property restricts, but allows for restricts on top-level document
+ * fields, such as schema_type. Clients should be able to limit their query to documents of
+ * a certain schema_type (e.g. “match documents that are of the ‘Email’ schema_type”).
+ * Example: { schema_type_filters: “Email”, “Video”,query: “dog” } will match documents
+ * that contain the query term ‘dog’ and are of either the ‘Email’ schema type or the
+ * ‘Video’ schema type.
+ * </ul>
+ *
+ * <p> This method is lightweight. The heavy work will be done in
+ * {@link SearchResults#getNextPage()}.
+ *
+ * @param queryExpression Query String to search.
+ * @param searchSpec Spec for setting filters, raw query etc.
+ * @return The search result of performing this operation.
+ */
+ @NonNull
+ SearchResultsShim query(@NonNull String queryExpression, @NonNull SearchSpec searchSpec);
+
+ /**
+ * Removes {@link GenericDocument}s from the index by URI.
+ *
+ * @param request Request containing URIs to be removed.
+ * @return The pending result of performing this operation. The keys of the returned
+ * {@link AppSearchBatchResult} are the input URIs. The values are {@code null} on success,
+ * or a failed {@link AppSearchResult} otherwise. URIs that are not found will return a
+ * failed {@link AppSearchResult} with a result code of
+ * {@link AppSearchResult#RESULT_NOT_FOUND}.
+ */
+ @NonNull
+ ListenableFuture<AppSearchBatchResult<String, Void>> removeByUri(
+ @NonNull RemoveByUriRequest request);
+
+ /**
+ * Removes {@link GenericDocument}s from the index by Query. Documents will be removed if they
+ * match the {@code queryExpression} in given namespaces and schemaTypes which is set via
+ * {@link SearchSpec.Builder#addNamespace} and {@link SearchSpec.Builder#addSchemaType}.
+ *
+ * <p> An empty {@code queryExpression} matches all documents.
+ *
+ * <p> An empty set of namespaces or schemaTypes matches all namespaces or schemaTypes in
+ * the current database.
+ *
+ * @param queryExpression Query String to search.
+ * @param searchSpec Spec containing schemaTypes, namespaces and query expression
+ * indicates how document will be removed. All specific about how to
+ * scoring, ordering, snippeting and resulting will be ignored.
+ * @return The pending result of performing this operation.
+ */
+ @NonNull
+ ListenableFuture<Void> removeByQuery(
+ @NonNull String queryExpression, @NonNull SearchSpec searchSpec);
+}
diff --git a/apex/appsearch/testing/java/com/android/server/appsearch/testing/external/AppSearchTestUtils.java b/apex/appsearch/testing/java/com/android/server/appsearch/testing/external/AppSearchTestUtils.java
index 907509c..459fd151 100644
--- a/apex/appsearch/testing/java/com/android/server/appsearch/testing/external/AppSearchTestUtils.java
+++ b/apex/appsearch/testing/java/com/android/server/appsearch/testing/external/AppSearchTestUtils.java
@@ -17,19 +17,14 @@
package com.android.server.appsearch.testing;
import static com.google.common.truth.Truth.assertThat;
+import static com.google.common.truth.Truth.assertWithMessage;
import android.app.appsearch.AppSearchBatchResult;
-import android.app.appsearch.AppSearchManager;
-import android.app.appsearch.AppSearchResult;
+import android.app.appsearch.AppSearchSessionShim;
import android.app.appsearch.GenericDocument;
import android.app.appsearch.GetByUriRequest;
import android.app.appsearch.SearchResult;
-import android.app.appsearch.SetSchemaRequest;
-import android.content.Context;
-
-import com.google.common.collect.ImmutableList;
-
-import junit.framework.AssertionFailedError;
+import android.app.appsearch.SearchResultsShim;
import java.util.ArrayList;
import java.util.List;
@@ -37,47 +32,24 @@
public class AppSearchTestUtils {
- // List of databases that may be used in tests. Keeping them in a centralized location helps
- // #cleanup know which databases to clear.
- public static final String DEFAULT_DATABASE = AppSearchManager.DEFAULT_DATABASE_NAME;
- public static final String DB_1 = "testDb1";
- public static final String DB_2 = "testDb2";
-
- public static void cleanup(Context context) throws Exception {
- List<String> databases = ImmutableList.of(DEFAULT_DATABASE, DB_1, DB_2);
- for (String database : databases) {
- AppSearchSessionShim session = checkIsResultSuccess(
- AppSearchSessionShim.createSearchSession(
- new AppSearchManager.SearchContext.Builder()
- .setDatabaseName(database).build()));
- checkIsResultSuccess(session.setSchema(
- new SetSchemaRequest.Builder().setForceOverride(true).build()));
- }
- }
-
- public static <V> V checkIsResultSuccess(Future<AppSearchResult<V>> future) throws Exception {
- AppSearchResult<V> result = future.get();
- if (!result.isSuccess()) {
- throw new AssertionFailedError("AppSearchResult not successful: " + result);
- }
- return result.getResultValue();
- }
-
public static <K, V> AppSearchBatchResult<K, V> checkIsBatchResultSuccess(
Future<AppSearchBatchResult<K, V>> future) throws Exception {
AppSearchBatchResult<K, V> result = future.get();
- if (!result.isSuccess()) {
- throw new AssertionFailedError("AppSearchBatchResult not successful: " + result);
- }
+ assertWithMessage("AppSearchBatchResult not successful: " + result)
+ .that(result.isSuccess())
+ .isTrue();
return result;
}
public static List<GenericDocument> doGet(
AppSearchSessionShim session, String namespace, String... uris) throws Exception {
- AppSearchBatchResult<String, GenericDocument> result = checkIsBatchResultSuccess(
- session.getByUri(
- new GetByUriRequest.Builder()
- .setNamespace(namespace).addUri(uris).build()));
+ AppSearchBatchResult<String, GenericDocument> result =
+ checkIsBatchResultSuccess(
+ session.getByUri(
+ new GetByUriRequest.Builder()
+ .setNamespace(namespace)
+ .addUri(uris)
+ .build()));
assertThat(result.getSuccesses()).hasSize(uris.length);
assertThat(result.getFailures()).isEmpty();
List<GenericDocument> list = new ArrayList<>(uris.length);
@@ -89,13 +61,13 @@
public static List<GenericDocument> convertSearchResultsToDocuments(
SearchResultsShim searchResults) throws Exception {
- List<SearchResult> results = checkIsResultSuccess(searchResults.getNextPage());
+ List<SearchResult> results = searchResults.getNextPage().get();
List<GenericDocument> documents = new ArrayList<>();
while (results.size() > 0) {
for (SearchResult result : results) {
documents.add(result.getDocument());
}
- results = checkIsResultSuccess(searchResults.getNextPage());
+ results = searchResults.getNextPage().get();
}
return documents;
}
diff --git a/apex/appsearch/testing/java/com/android/server/appsearch/testing/external/GlobalSearchSessionShim.java b/apex/appsearch/testing/java/com/android/server/appsearch/testing/external/GlobalSearchSessionShim.java
new file mode 100644
index 0000000..33dc379
--- /dev/null
+++ b/apex/appsearch/testing/java/com/android/server/appsearch/testing/external/GlobalSearchSessionShim.java
@@ -0,0 +1,70 @@
+/*
+ * 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.appsearch;
+
+import android.annotation.NonNull;
+
+/**
+ * This class provides global access to the centralized AppSearch index maintained by the system.
+ *
+ * <p>Apps can retrieve indexed documents through the query API.
+ */
+public interface GlobalSearchSessionShim {
+ /**
+ * Searches across all documents in the storage based on a given query string.
+ *
+ * <p>Currently we support following features in the raw query format:
+ * <ul>
+ * <li>AND
+ * <p>AND joins (e.g. “match documents that have both the terms ‘dog’ and
+ * ‘cat’”).
+ * Example: hello world matches documents that have both ‘hello’ and ‘world’
+ * <li>OR
+ * <p>OR joins (e.g. “match documents that have either the term ‘dog’ or
+ * ‘cat’”).
+ * Example: dog OR puppy
+ * <li>Exclusion
+ * <p>Exclude a term (e.g. “match documents that do
+ * not have the term ‘dog’”).
+ * Example: -dog excludes the term ‘dog’
+ * <li>Grouping terms
+ * <p>Allow for conceptual grouping of subqueries to enable hierarchical structures (e.g.
+ * “match documents that have either ‘dog’ or ‘puppy’, and either ‘cat’ or ‘kitten’”).
+ * Example: (dog puppy) (cat kitten) two one group containing two terms.
+ * <li>Property restricts
+ * <p> Specifies which properties of a document to specifically match terms in (e.g.
+ * “match documents where the ‘subject’ property contains ‘important’”).
+ * Example: subject:important matches documents with the term ‘important’ in the
+ * ‘subject’ property
+ * <li>Schema type restricts
+ * <p>This is similar to property restricts, but allows for restricts on top-level document
+ * fields, such as schema_type. Clients should be able to limit their query to documents of
+ * a certain schema_type (e.g. “match documents that are of the ‘Email’ schema_type”).
+ * Example: { schema_type_filters: “Email”, “Video”,query: “dog” } will match documents
+ * that contain the query term ‘dog’ and are of either the ‘Email’ schema type or the
+ * ‘Video’ schema type.
+ * </ul>
+ *
+ * <p> This method is lightweight. The heavy work will be done in
+ * {@link SearchResults#getNextPage}.
+ *
+ * @param queryExpression Query String to search.
+ * @param searchSpec Spec for setting filters, raw query etc.
+ * @return The search result of performing this operation.
+ */
+ @NonNull
+ SearchResultsShim query(@NonNull String queryExpression, @NonNull SearchSpec searchSpec);
+}
diff --git a/apex/appsearch/testing/java/com/android/server/appsearch/testing/external/SearchResultsShim.java b/apex/appsearch/testing/java/com/android/server/appsearch/testing/external/SearchResultsShim.java
new file mode 100644
index 0000000..f387a17
--- /dev/null
+++ b/apex/appsearch/testing/java/com/android/server/appsearch/testing/external/SearchResultsShim.java
@@ -0,0 +1,52 @@
+/*
+ * 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.appsearch;
+
+import android.annotation.NonNull;
+
+import com.google.common.util.concurrent.ListenableFuture;
+
+import java.io.Closeable;
+import java.util.List;
+
+/**
+ * SearchResults are a returned object from a query API.
+ *
+ * <p>Each {@link SearchResult} contains a document and may contain other fields like snippets
+ * based on request.
+ *
+ * <p>Should close this object after finish fetching results.
+ *
+ * <p>This class is not thread safe.
+ */
+public interface SearchResultsShim extends Closeable {
+ /**
+ * Gets a whole page of {@link SearchResult}s.
+ *
+ * <p>Re-call this method to get next page of {@link SearchResult}, until it returns an
+ * empty list.
+ *
+ * <p>The page size is set by
+ * {@link android.app.appsearch.SearchSpec.Builder#setResultCountPerPage}.
+ *
+ * @return The pending result of performing this operation.
+ */
+ @NonNull
+ ListenableFuture<List<SearchResult>> getNextPage();
+
+ @Override
+ void close();
+}
diff --git a/apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java b/apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java
index 20c77da..7842d48 100644
--- a/apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java
+++ b/apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java
@@ -3061,7 +3061,8 @@
if (mMaxDelayTime < thisDelayTime) {
mMaxDelayTime = thisDelayTime;
}
- deliverAlarmsLocked(mPendingNonWakeupAlarms, nowELAPSED);
+ final ArrayList<Alarm> triggerList = new ArrayList<>(mPendingNonWakeupAlarms);
+ deliverAlarmsLocked(triggerList, nowELAPSED);
mPendingNonWakeupAlarms.clear();
}
if (mNonInteractiveStartTime > 0) {
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 1910553..df0a0ee 100644
--- a/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java
+++ b/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java
@@ -1502,11 +1502,14 @@
mControllers.add(mBatteryController);
mStorageController = new StorageController(this);
mControllers.add(mStorageController);
- mControllers.add(new BackgroundJobsController(this));
+ final BackgroundJobsController backgroundJobsController =
+ new BackgroundJobsController(this);
+ mControllers.add(backgroundJobsController);
mControllers.add(new ContentObserverController(this));
mDeviceIdleJobsController = new DeviceIdleJobsController(this);
mControllers.add(mDeviceIdleJobsController);
- mQuotaController = new QuotaController(this);
+ mQuotaController =
+ new QuotaController(this, backgroundJobsController, connectivityController);
mControllers.add(mQuotaController);
mControllers.add(new ComponentController(this));
diff --git a/apex/jobscheduler/service/java/com/android/server/job/controllers/BackgroundJobsController.java b/apex/jobscheduler/service/java/com/android/server/job/controllers/BackgroundJobsController.java
index f647db9..04d6947 100644
--- a/apex/jobscheduler/service/java/com/android/server/job/controllers/BackgroundJobsController.java
+++ b/apex/jobscheduler/service/java/com/android/server/job/controllers/BackgroundJobsController.java
@@ -78,6 +78,11 @@
}
@Override
+ public void evaluateStateLocked(JobStatus jobStatus) {
+ updateSingleJobRestrictionLocked(jobStatus, UNKNOWN);
+ }
+
+ @Override
public void dumpControllerStateLocked(final IndentingPrintWriter pw,
final Predicate<JobStatus> predicate) {
mAppStateTracker.dump(pw);
diff --git a/apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java b/apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java
index cd71247..51525e0 100644
--- a/apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java
+++ b/apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java
@@ -1151,6 +1151,11 @@
if (setConstraintSatisfied(CONSTRAINT_WITHIN_EXPEDITED_QUOTA, state)) {
// The constraint was changed. Update the ready flag.
mReadyWithinExpeditedQuota = state;
+ // DeviceIdleJobsController currently only tracks jobs with the WILL_BE_FOREGROUND flag.
+ // Making it also track requested-expedited jobs would add unnecessary hops since the
+ // controller would then defer to canRunInDoze. Avoid the hops and just update
+ // mReadyNotDozing directly.
+ mReadyNotDozing = isConstraintSatisfied(CONSTRAINT_DEVICE_NOT_DOZING) || canRunInDoze();
return true;
}
return false;
diff --git a/apex/jobscheduler/service/java/com/android/server/job/controllers/QuotaController.java b/apex/jobscheduler/service/java/com/android/server/job/controllers/QuotaController.java
index 7b87dfb..2d55aa5 100644
--- a/apex/jobscheduler/service/java/com/android/server/job/controllers/QuotaController.java
+++ b/apex/jobscheduler/service/java/com/android/server/job/controllers/QuotaController.java
@@ -347,6 +347,9 @@
private final QcHandler mHandler;
private final QcConstants mQcConstants;
+ private final BackgroundJobsController mBackgroundJobsController;
+ private final ConnectivityController mConnectivityController;
+
/** How much time each app will have to run jobs within their standby bucket window. */
private long mAllowedTimePerPeriodMs = QcConstants.DEFAULT_ALLOWED_TIME_PER_PERIOD_MS;
@@ -552,7 +555,9 @@
*/
private static final int MSG_PROCESS_USAGE_EVENT = 5;
- public QuotaController(JobSchedulerService service) {
+ public QuotaController(@NonNull JobSchedulerService service,
+ @NonNull BackgroundJobsController backgroundJobsController,
+ @NonNull ConnectivityController connectivityController) {
super(service);
mHandler = new QcHandler(mContext.getMainLooper());
mChargeTracker = new ChargingTracker();
@@ -560,6 +565,8 @@
mActivityManagerInternal = LocalServices.getService(ActivityManagerInternal.class);
mAlarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);
mQcConstants = new QcConstants();
+ mBackgroundJobsController = backgroundJobsController;
+ mConnectivityController = connectivityController;
final IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
mContext.registerReceiverAsUser(mPackageAddedReceiver, UserHandle.ALL, filter, null, null);
@@ -596,7 +603,7 @@
final boolean outOfEJQuota;
if (jobStatus.isRequestedExpeditedJob()) {
final boolean isWithinEJQuota = isWithinEJQuotaLocked(jobStatus);
- jobStatus.setExpeditedJobQuotaConstraintSatisfied(isWithinEJQuota);
+ setExpeditedConstraintSatisfied(jobStatus, isWithinEJQuota);
outOfEJQuota = !isWithinEJQuota;
} else {
outOfEJQuota = false;
@@ -1473,7 +1480,7 @@
if (js.isRequestedExpeditedJob()) {
boolean isWithinEJQuota = isWithinEJQuotaLocked(js);
- changed |= js.setExpeditedJobQuotaConstraintSatisfied(isWithinEJQuota);
+ changed |= setExpeditedConstraintSatisfied(js, isWithinEJQuota);
outOfEJQuota |= !isWithinEJQuota;
}
}
@@ -1499,7 +1506,7 @@
final boolean outOfEJQuota;
if (jobStatus.isRequestedExpeditedJob()) {
final boolean isWithinEJQuota = isWithinEJQuotaLocked(jobStatus);
- wasJobChanged |= jobStatus.setExpeditedJobQuotaConstraintSatisfied(isWithinEJQuota);
+ wasJobChanged |= setExpeditedConstraintSatisfied(jobStatus, isWithinEJQuota);
outOfEJQuota = !isWithinEJQuota;
} else {
outOfEJQuota = false;
@@ -1650,6 +1657,23 @@
return jobStatus.setQuotaConstraintSatisfied(isWithinQuota);
}
+ /**
+ * If the satisfaction changes, this will tell connectivity & background jobs controller to
+ * also re-evaluate their state.
+ */
+ private boolean setExpeditedConstraintSatisfied(@NonNull JobStatus jobStatus,
+ boolean isWithinQuota) {
+ if (jobStatus.setExpeditedJobQuotaConstraintSatisfied(isWithinQuota)) {
+ mBackgroundJobsController.evaluateStateLocked(jobStatus);
+ mConnectivityController.evaluateStateLocked(jobStatus);
+ if (isWithinQuota && jobStatus.isReady()) {
+ mStateChangedListener.onRunJobNow(jobStatus);
+ }
+ return true;
+ }
+ return false;
+ }
+
private final class ChargingTracker extends BroadcastReceiver {
/**
* Track whether we're charging. This has a slightly different definition than that of
diff --git a/apex/media/framework/Android.bp b/apex/media/framework/Android.bp
index 811a700..60dea07 100644
--- a/apex/media/framework/Android.bp
+++ b/apex/media/framework/Android.bp
@@ -36,7 +36,8 @@
"framework_media_annotation",
],
static_libs: [
- "exoplayer2-extractor"
+ "exoplayer2-extractor",
+ "mediatranscoding_aidl_interface-java",
],
jarjar_rules: "jarjar_rules.txt",
@@ -57,10 +58,12 @@
filegroup {
name: "updatable-media-srcs",
srcs: [
+ "java/android/media/MediaFrameworkInitializer.java",
":media-aidl-srcs",
":mediaparceledlistslice-java-srcs",
":mediaparser-srcs",
":mediasession2-java-srcs",
+ ":mediatranscoding-srcs",
],
visibility: ["//frameworks/base"],
}
@@ -98,6 +101,17 @@
path: "java",
}
+filegroup {
+ name: "mediatranscoding-srcs",
+ srcs: [
+ "java/android/media/ApplicationMediaCapabilities.java",
+ "java/android/media/MediaFeature.java",
+ "java/android/media/MediaTranscodeManager.java",
+ "java/android/media/MediaTranscodingException.java",
+ ],
+ path: "java",
+}
+
java_sdk_library {
name: "framework-media",
defaults: ["framework-module-defaults"],
diff --git a/apex/media/framework/api/current.txt b/apex/media/framework/api/current.txt
index 0cc8e52..ce3bcbe 100644
--- a/apex/media/framework/api/current.txt
+++ b/apex/media/framework/api/current.txt
@@ -1,6 +1,26 @@
// Signature format: 2.0
package android.media {
+ public final class ApplicationMediaCapabilities implements android.os.Parcelable {
+ method @NonNull public static android.media.ApplicationMediaCapabilities createFromXml(@NonNull org.xmlpull.v1.XmlPullParser);
+ method public int describeContents();
+ method @NonNull public java.util.List<java.lang.String> getSupportedHdrTypes();
+ method @NonNull public java.util.List<java.lang.String> getSupportedVideoMimeTypes();
+ method public boolean isHdrTypeSupported(@NonNull String);
+ method public boolean isSlowMotionSupported();
+ method public boolean isVideoMimeTypeSupported(@NonNull String);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.ApplicationMediaCapabilities> CREATOR;
+ }
+
+ public static final class ApplicationMediaCapabilities.Builder {
+ ctor public ApplicationMediaCapabilities.Builder();
+ method @NonNull public android.media.ApplicationMediaCapabilities.Builder addSupportedHdrType(@NonNull String);
+ method @NonNull public android.media.ApplicationMediaCapabilities.Builder addSupportedVideoMimeType(@NonNull String);
+ method @NonNull public android.media.ApplicationMediaCapabilities build();
+ method @NonNull public android.media.ApplicationMediaCapabilities.Builder setSlowMotionSupported(boolean);
+ }
+
public class MediaController2 implements java.lang.AutoCloseable {
method public void cancelSessionCommand(@NonNull Object);
method public void close();
@@ -25,6 +45,17 @@
method @Nullable public android.media.Session2Command.Result onSessionCommand(@NonNull android.media.MediaController2, @NonNull android.media.Session2Command, @Nullable android.os.Bundle);
}
+ public final class MediaFeature {
+ ctor public MediaFeature();
+ }
+
+ public static final class MediaFeature.HdrType {
+ field public static final String DOLBY_VISION = "android.media.feature.hdr.dolby_vision";
+ field public static final String HDR10 = "android.media.feature.hdr.hdr10";
+ field public static final String HDR10_PLUS = "android.media.feature.hdr.hdr10_plus";
+ field public static final String HLG = "android.media.feature.hdr.hlg";
+ }
+
public final class MediaParser {
method public boolean advance(@NonNull android.media.MediaParser.SeekableInputReader) throws java.io.IOException;
method @NonNull public static android.media.MediaParser create(@NonNull android.media.MediaParser.OutputConsumer, @NonNull java.lang.String...);
@@ -170,6 +201,12 @@
method public int getNotificationId();
}
+ public class MediaTranscodingException extends java.lang.Exception {
+ }
+
+ public static final class MediaTranscodingException.ServiceNotAvailableException extends android.media.MediaTranscodingException {
+ }
+
public final class Session2Command implements android.os.Parcelable {
ctor public Session2Command(int);
ctor public Session2Command(@NonNull String, @Nullable android.os.Bundle);
diff --git a/apex/media/framework/api/module-lib-current.txt b/apex/media/framework/api/module-lib-current.txt
index 2b69863..ad9114f 100644
--- a/apex/media/framework/api/module-lib-current.txt
+++ b/apex/media/framework/api/module-lib-current.txt
@@ -1,6 +1,11 @@
// Signature format: 2.0
package android.media {
+ public class MediaFrameworkInitializer {
+ method public static void registerServiceWrappers();
+ method public static void setMediaServiceManager(@NonNull android.media.MediaServiceManager);
+ }
+
@Deprecated public final class MediaParceledListSlice<T extends android.os.Parcelable> implements android.os.Parcelable {
ctor @Deprecated public MediaParceledListSlice(@NonNull java.util.List<T>);
method @Deprecated public int describeContents();
diff --git a/apex/media/framework/api/system-current.txt b/apex/media/framework/api/system-current.txt
index d802177..89cf77c 100644
--- a/apex/media/framework/api/system-current.txt
+++ b/apex/media/framework/api/system-current.txt
@@ -1 +1,67 @@
// Signature format: 2.0
+package android.media {
+
+ public final class MediaTranscodeManager {
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingSession enqueueRequest(@NonNull android.media.MediaTranscodeManager.TranscodingRequest, @NonNull java.util.concurrent.Executor, @NonNull android.media.MediaTranscodeManager.OnTranscodingFinishedListener) throws java.io.FileNotFoundException, android.media.MediaTranscodingException.ServiceNotAvailableException;
+ field public static final int PRIORITY_REALTIME = 1; // 0x1
+ field public static final int TRANSCODING_TYPE_VIDEO = 1; // 0x1
+ }
+
+ @java.lang.FunctionalInterface public static interface MediaTranscodeManager.OnTranscodingFinishedListener {
+ method public void onTranscodingFinished(@NonNull android.media.MediaTranscodeManager.TranscodingSession);
+ }
+
+ public static final class MediaTranscodeManager.TranscodingRequest {
+ method public int getClientPid();
+ method public int getClientUid();
+ method @NonNull public android.net.Uri getDestinationUri();
+ method public int getPriority();
+ method @NonNull public android.net.Uri getSourceUri();
+ method public int getType();
+ method @Nullable public android.media.MediaFormat getVideoTrackFormat();
+ }
+
+ public static final class MediaTranscodeManager.TranscodingRequest.Builder {
+ ctor public MediaTranscodeManager.TranscodingRequest.Builder();
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest build();
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setClientPid(int);
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setClientUid(int);
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setDestinationUri(@NonNull android.net.Uri);
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setPriority(int);
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setSourceUri(@NonNull android.net.Uri);
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setType(int);
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setVideoTrackFormat(@NonNull android.media.MediaFormat);
+ }
+
+ public static class MediaTranscodeManager.TranscodingRequest.MediaFormatResolver {
+ ctor public MediaTranscodeManager.TranscodingRequest.MediaFormatResolver();
+ method @Nullable public android.media.MediaFormat resolveVideoFormat();
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.MediaFormatResolver setClientCapabilities(@NonNull android.media.ApplicationMediaCapabilities);
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.MediaFormatResolver setSourceVideoFormatHint(@NonNull android.media.MediaFormat);
+ method public boolean shouldTranscode();
+ }
+
+ public static final class MediaTranscodeManager.TranscodingSession {
+ method public void cancel();
+ method @IntRange(from=0, to=100) public int getProgress();
+ method public int getResult();
+ method public int getSessionId();
+ method public int getStatus();
+ method public void setOnProgressUpdateListener(@NonNull java.util.concurrent.Executor, @Nullable android.media.MediaTranscodeManager.TranscodingSession.OnProgressUpdateListener);
+ method public void setOnProgressUpdateListener(int, @NonNull java.util.concurrent.Executor, @Nullable android.media.MediaTranscodeManager.TranscodingSession.OnProgressUpdateListener);
+ field public static final int RESULT_CANCELED = 4; // 0x4
+ field public static final int RESULT_ERROR = 3; // 0x3
+ field public static final int RESULT_NONE = 1; // 0x1
+ field public static final int RESULT_SUCCESS = 2; // 0x2
+ field public static final int STATUS_FINISHED = 3; // 0x3
+ field public static final int STATUS_PAUSED = 4; // 0x4
+ field public static final int STATUS_PENDING = 1; // 0x1
+ field public static final int STATUS_RUNNING = 2; // 0x2
+ }
+
+ @java.lang.FunctionalInterface public static interface MediaTranscodeManager.TranscodingSession.OnProgressUpdateListener {
+ method public void onProgressUpdate(@NonNull android.media.MediaTranscodeManager.TranscodingSession, @IntRange(from=0, to=100) int);
+ }
+
+}
+
diff --git a/media/java/android/media/ApplicationMediaCapabilities.java b/apex/media/framework/java/android/media/ApplicationMediaCapabilities.java
similarity index 100%
rename from media/java/android/media/ApplicationMediaCapabilities.java
rename to apex/media/framework/java/android/media/ApplicationMediaCapabilities.java
diff --git a/media/java/android/media/MediaFeature.java b/apex/media/framework/java/android/media/MediaFeature.java
similarity index 100%
rename from media/java/android/media/MediaFeature.java
rename to apex/media/framework/java/android/media/MediaFeature.java
diff --git a/media/java/android/media/MediaFrameworkInitializer.java b/apex/media/framework/java/android/media/MediaFrameworkInitializer.java
similarity index 73%
copy from media/java/android/media/MediaFrameworkInitializer.java
copy to apex/media/framework/java/android/media/MediaFrameworkInitializer.java
index 577442e..813ad7b 100644
--- a/media/java/android/media/MediaFrameworkInitializer.java
+++ b/apex/media/framework/java/android/media/MediaFrameworkInitializer.java
@@ -17,20 +17,18 @@
package android.media;
import android.annotation.NonNull;
+import android.annotation.SystemApi;
+import android.annotation.SystemApi.Client;
+import android.media.MediaTranscodeManager;
import android.app.SystemServiceRegistry;
import android.content.Context;
-import android.media.session.MediaSessionManager;
-
-import com.android.internal.util.Preconditions;
-
-import java.util.Objects;
/**
- * Class for performing registration for all media services
+ * Class for performing registration for all media services on com.android.media apex.
*
- * TODO (b/160513103): Move this class when moving media service code to APEX
* @hide
*/
+@SystemApi(client = Client.MODULE_LIBRARIES)
public class MediaFrameworkInitializer {
private MediaFrameworkInitializer() {
}
@@ -47,9 +45,15 @@
*/
public static void setMediaServiceManager(
@NonNull MediaServiceManager mediaServiceManager) {
- Preconditions.checkState(sMediaServiceManager == null,
- "setMediaServiceManager called twice!");
- sMediaServiceManager = Objects.requireNonNull(mediaServiceManager);
+ if (sMediaServiceManager != null) {
+ throw new IllegalStateException("setMediaServiceManager called twice!");
+ }
+
+ if (mediaServiceManager == null) {
+ throw new NullPointerException("mediaServiceManager is null!");
+ }
+
+ sMediaServiceManager = mediaServiceManager;
}
/** @hide */
@@ -66,9 +70,9 @@
*/
public static void registerServiceWrappers() {
SystemServiceRegistry.registerContextAwareService(
- Context.MEDIA_SESSION_SERVICE,
- MediaSessionManager.class,
- context -> new MediaSessionManager(context)
+ Context.MEDIA_TRANSCODING_SERVICE,
+ MediaTranscodeManager.class,
+ context -> new MediaTranscodeManager(context)
);
}
}
diff --git a/media/java/android/media/MediaTranscodeManager.java b/apex/media/framework/java/android/media/MediaTranscodeManager.java
similarity index 99%
rename from media/java/android/media/MediaTranscodeManager.java
rename to apex/media/framework/java/android/media/MediaTranscodeManager.java
index 705da19..d449289 100644
--- a/media/java/android/media/MediaTranscodeManager.java
+++ b/apex/media/framework/java/android/media/MediaTranscodeManager.java
@@ -28,7 +28,6 @@
import android.net.Uri;
import android.os.ParcelFileDescriptor;
import android.os.RemoteException;
-import android.os.ServiceManager;
import android.os.ServiceSpecificException;
import android.system.Os;
import android.util.Log;
@@ -104,8 +103,6 @@
public final class MediaTranscodeManager {
private static final String TAG = "MediaTranscodeManager";
- private static final String MEDIA_TRANSCODING_SERVICE = "media.transcoding";
-
/** Maximum number of retry to connect to the service. */
private static final int CONNECT_SERVICE_RETRY_COUNT = 100;
@@ -281,7 +278,10 @@
for (int count = 1; count <= retryCount; count++) {
Log.d(TAG, "Trying to connect to service. Try count: " + count);
IMediaTranscodingService service = IMediaTranscodingService.Stub.asInterface(
- ServiceManager.getService(MEDIA_TRANSCODING_SERVICE));
+ MediaFrameworkInitializer
+ .getMediaServiceManager()
+ .getMediaTranscodingServiceRegisterer()
+ .get());
if (service != null) {
return service;
}
diff --git a/media/java/android/media/MediaTranscodingException.java b/apex/media/framework/java/android/media/MediaTranscodingException.java
similarity index 100%
rename from media/java/android/media/MediaTranscodingException.java
rename to apex/media/framework/java/android/media/MediaTranscodingException.java
diff --git a/apex/permission/service/Android.bp b/apex/permission/service/Android.bp
index f6c3156..349eeb42 100644
--- a/apex/permission/service/Android.bp
+++ b/apex/permission/service/Android.bp
@@ -40,4 +40,6 @@
"test_com.android.permission",
],
installable: true,
+ // We don't have last-api tracking files for the public part of this jar's API.
+ unsafe_ignore_missing_latest_api: true,
}
diff --git a/api/Android.bp b/api/Android.bp
index 9417030..69f03b8 100644
--- a/api/Android.bp
+++ b/api/Android.bp
@@ -28,6 +28,7 @@
genrule {
name: "frameworks-base-api-current.txt",
srcs: [
+ ":art.module.public.api{.public.api.txt}",
":conscrypt.module.public.api{.public.api.txt}",
":framework-appsearch{.public.api.txt}",
":framework-graphics{.public.api.txt}",
@@ -66,6 +67,7 @@
name: "frameworks-base-api-current.srcjar",
srcs: [
":api-stubs-docs-non-updatable",
+ ":art.module.public.api{.public.stubs.source}",
":conscrypt.module.public.api{.public.stubs.source}",
":framework-appsearch{.public.stubs.source}",
":framework-graphics{.public.stubs.source}",
@@ -87,6 +89,7 @@
genrule {
name: "frameworks-base-api-removed.txt",
srcs: [
+ ":art.module.public.api{.public.removed-api.txt}",
":conscrypt.module.public.api{.public.removed-api.txt}",
":framework-appsearch{.public.removed-api.txt}",
":framework-graphics{.public.removed-api.txt}",
diff --git a/cmds/idmap2/idmap2/Lookup.cpp b/cmds/idmap2/idmap2/Lookup.cpp
index 8323d0b..437180d 100644
--- a/cmds/idmap2/idmap2/Lookup.cpp
+++ b/cmds/idmap2/idmap2/Lookup.cpp
@@ -71,7 +71,7 @@
}
// next, try to parse as a package:type/name string
- if (auto resid = am.GetResourceId(res, "", fallback_package)) {
+ if (auto resid = am.GetResourceId(res, "", fallback_package); resid.ok()) {
return *resid;
}
@@ -94,7 +94,7 @@
case Res_value::TYPE_STRING: {
const ResStringPool* pool = am->GetStringPoolForCookie(value.cookie);
out->append("\"");
- if (auto str = pool->string8ObjectAt(value.data)) {
+ if (auto str = pool->string8ObjectAt(value.data); str.ok()) {
out->append(*str);
}
} break;
diff --git a/cmds/idmap2/libidmap2/XmlParser.cpp b/cmds/idmap2/libidmap2/XmlParser.cpp
index 7c55b64..4030b83 100644
--- a/cmds/idmap2/libidmap2/XmlParser.cpp
+++ b/cmds/idmap2/libidmap2/XmlParser.cpp
@@ -98,7 +98,7 @@
switch ((*value).dataType) {
case Res_value::TYPE_STRING: {
- if (auto str = parser_.getStrings().string8ObjectAt((*value).data)) {
+ if (auto str = parser_.getStrings().string8ObjectAt((*value).data); str.ok()) {
return std::string(str->string());
}
break;
diff --git a/core/api/current.txt b/core/api/current.txt
index 1c50e14..f6d0d9d 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -2856,6 +2856,7 @@
public final class AccessibilityGestureEvent implements android.os.Parcelable {
method public int describeContents();
+ method @NonNull public static String gestureIdToString(int);
method public int getDisplayId();
method public int getGestureId();
method @NonNull public java.util.List<android.view.MotionEvent> getMotionEvents();
@@ -6988,6 +6989,7 @@
method public boolean installKeyPair(@Nullable android.content.ComponentName, @NonNull java.security.PrivateKey, @NonNull java.security.cert.Certificate[], @NonNull String, int);
method public void installSystemUpdate(@NonNull android.content.ComponentName, @NonNull android.net.Uri, @NonNull java.util.concurrent.Executor, @NonNull android.app.admin.DevicePolicyManager.InstallSystemUpdateCallback);
method public boolean isActivePasswordSufficient();
+ method public boolean isActivePasswordSufficientForDeviceRequirement();
method public boolean isAdminActive(@NonNull android.content.ComponentName);
method public boolean isAffiliatedUser();
method public boolean isAlwaysOnVpnLockdownEnabled(@NonNull android.content.ComponentName);
@@ -10134,6 +10136,7 @@
method public abstract android.content.Context createDisplayContext(@NonNull android.view.Display);
method public abstract android.content.Context createPackageContext(String, int) throws android.content.pm.PackageManager.NameNotFoundException;
method @NonNull public android.content.Context createWindowContext(int, @Nullable android.os.Bundle);
+ method @NonNull public android.content.Context createWindowContext(@NonNull android.view.Display, int, @Nullable android.os.Bundle);
method public abstract String[] databaseList();
method public abstract boolean deleteDatabase(String);
method public abstract boolean deleteFile(String);
@@ -11638,6 +11641,14 @@
method public final int compare(android.content.pm.ApplicationInfo, android.content.pm.ApplicationInfo);
}
+ public final class Attribution implements android.os.Parcelable {
+ method public int describeContents();
+ method @IdRes public int getLabel();
+ method @NonNull public String getTag();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.Attribution> CREATOR;
+ }
+
public final class ChangedPackages implements android.os.Parcelable {
ctor public ChangedPackages(int, @NonNull java.util.List<java.lang.String>);
method public int describeContents();
@@ -11887,6 +11898,7 @@
field public static final int REQUESTED_PERMISSION_GRANTED = 2; // 0x2
field public android.content.pm.ActivityInfo[] activities;
field public android.content.pm.ApplicationInfo applicationInfo;
+ field @Nullable public android.content.pm.Attribution[] attributions;
field public int baseRevisionCode;
field public android.content.pm.ConfigurationInfo[] configPreferences;
field public android.content.pm.FeatureGroupInfo[] featureGroups;
@@ -12335,6 +12347,7 @@
field public static final int FLAG_PERMISSION_WHITELIST_SYSTEM = 1; // 0x1
field public static final int FLAG_PERMISSION_WHITELIST_UPGRADE = 4; // 0x4
field public static final int GET_ACTIVITIES = 1; // 0x1
+ field public static final int GET_ATTRIBUTIONS = -2147483648; // 0x80000000
field public static final int GET_CONFIGURATIONS = 16384; // 0x4000
field @Deprecated public static final int GET_DISABLED_COMPONENTS = 512; // 0x200
field @Deprecated public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
@@ -16241,7 +16254,7 @@
method public static android.graphics.drawable.Icon createWithResource(android.content.Context, @DrawableRes int);
method public static android.graphics.drawable.Icon createWithResource(String, @DrawableRes int);
method public int describeContents();
- method @IdRes public int getResId();
+ method @DrawableRes public int getResId();
method @NonNull public String getResPackage();
method public int getType();
method @NonNull public android.net.Uri getUri();
@@ -18963,8 +18976,23 @@
field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssAntennaInfo.SphericalCorrections> CREATOR;
}
- public final class GnssCapabilities {
- method public boolean hasGnssAntennaInfo();
+ public final class GnssCapabilities implements android.os.Parcelable {
+ method public int describeContents();
+ method public boolean hasAntennaInfo();
+ method @Deprecated public boolean hasGnssAntennaInfo();
+ method public boolean hasMeasurements();
+ method public boolean hasNavigationMessages();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssCapabilities> CREATOR;
+ }
+
+ public static final class GnssCapabilities.Builder {
+ ctor public GnssCapabilities.Builder();
+ ctor public GnssCapabilities.Builder(@NonNull android.location.GnssCapabilities);
+ method @NonNull public android.location.GnssCapabilities build();
+ method @NonNull public android.location.GnssCapabilities.Builder setHasAntennaInfo(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurements(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasNavigationMessages(boolean);
}
public final class GnssClock implements android.os.Parcelable {
@@ -19300,9 +19328,11 @@
method public int getGnssYearOfHardware();
method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public android.location.GpsStatus getGpsStatus(@Nullable android.location.GpsStatus);
method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public android.location.Location getLastKnownLocation(@NonNull String);
- method @Nullable public android.location.LocationProvider getProvider(@NonNull String);
+ method @Deprecated @Nullable public android.location.LocationProvider getProvider(@NonNull String);
+ method @Nullable public android.location.ProviderProperties getProviderProperties(@NonNull String);
method @NonNull public java.util.List<java.lang.String> getProviders(boolean);
method @NonNull public java.util.List<java.lang.String> getProviders(@NonNull android.location.Criteria, boolean);
+ method public boolean hasProvider(@NonNull String);
method public boolean isLocationEnabled();
method public boolean isProviderEnabled(@NonNull String);
method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerAntennaInfoListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssAntennaInfo.Listener);
@@ -19363,18 +19393,18 @@
field public static final String PROVIDERS_CHANGED_ACTION = "android.location.PROVIDERS_CHANGED";
}
- public class LocationProvider {
- method public int getAccuracy();
- method public String getName();
- method public int getPowerRequirement();
- method public boolean hasMonetaryCost();
- method public boolean meetsCriteria(android.location.Criteria);
- method public boolean requiresCell();
- method public boolean requiresNetwork();
- method public boolean requiresSatellite();
- method public boolean supportsAltitude();
- method public boolean supportsBearing();
- method public boolean supportsSpeed();
+ @Deprecated public class LocationProvider {
+ method @Deprecated public int getAccuracy();
+ method @Deprecated public String getName();
+ method @Deprecated public int getPowerRequirement();
+ method @Deprecated public boolean hasMonetaryCost();
+ method @Deprecated public boolean meetsCriteria(android.location.Criteria);
+ method @Deprecated public boolean requiresCell();
+ method @Deprecated public boolean requiresNetwork();
+ method @Deprecated public boolean requiresSatellite();
+ method @Deprecated public boolean supportsAltitude();
+ method @Deprecated public boolean supportsBearing();
+ method @Deprecated public boolean supportsSpeed();
field @Deprecated public static final int AVAILABLE = 2; // 0x2
field @Deprecated public static final int OUT_OF_SERVICE = 0; // 0x0
field @Deprecated public static final int TEMPORARILY_UNAVAILABLE = 1; // 0x1
@@ -19427,6 +19457,26 @@
method public void onNmeaMessage(String, long);
}
+ public final class ProviderProperties implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getAccuracy();
+ method public int getPowerUsage();
+ method public boolean hasAltitudeSupport();
+ method public boolean hasBearingSupport();
+ method public boolean hasCellRequirement();
+ method public boolean hasMonetaryCost();
+ method public boolean hasNetworkRequirement();
+ method public boolean hasSatelliteRequirement();
+ method public boolean hasSpeedSupport();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final int ACCURACY_COARSE = 2; // 0x2
+ field public static final int ACCURACY_FINE = 1; // 0x1
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.ProviderProperties> CREATOR;
+ field public static final int POWER_USAGE_HIGH = 3; // 0x3
+ field public static final int POWER_USAGE_LOW = 1; // 0x1
+ field public static final int POWER_USAGE_MEDIUM = 2; // 0x2
+ }
+
public abstract class SettingInjectorService extends android.app.Service {
ctor public SettingInjectorService(String);
method public final android.os.IBinder onBind(android.content.Intent);
@@ -19445,26 +19495,6 @@
package android.media {
- public final class ApplicationMediaCapabilities implements android.os.Parcelable {
- method @NonNull public static android.media.ApplicationMediaCapabilities createFromXml(@NonNull org.xmlpull.v1.XmlPullParser);
- method public int describeContents();
- method @NonNull public java.util.List<java.lang.String> getSupportedHdrTypes();
- method @NonNull public java.util.List<java.lang.String> getSupportedVideoMimeTypes();
- method public boolean isHdrTypeSupported(@NonNull String);
- method public boolean isSlowMotionSupported();
- method public boolean isVideoMimeTypeSupported(@NonNull String);
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.media.ApplicationMediaCapabilities> CREATOR;
- }
-
- public static final class ApplicationMediaCapabilities.Builder {
- ctor public ApplicationMediaCapabilities.Builder();
- method @NonNull public android.media.ApplicationMediaCapabilities.Builder addSupportedHdrType(@NonNull String);
- method @NonNull public android.media.ApplicationMediaCapabilities.Builder addSupportedVideoMimeType(@NonNull String);
- method @NonNull public android.media.ApplicationMediaCapabilities build();
- method @NonNull public android.media.ApplicationMediaCapabilities.Builder setSlowMotionSupported(boolean);
- }
-
public class AsyncPlayer {
ctor public AsyncPlayer(String);
method @Deprecated public void play(android.content.Context, android.net.Uri, boolean, int);
@@ -19931,7 +19961,6 @@
public final class AudioPlaybackConfiguration implements android.os.Parcelable {
method public int describeContents();
method public android.media.AudioAttributes getAudioAttributes();
- method @Nullable public android.media.AudioDeviceInfo getAudioDevice();
method public void writeToParcel(android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.media.AudioPlaybackConfiguration> CREATOR;
}
@@ -21585,17 +21614,6 @@
field public static final String TRACKS = "android.media.mediaextractor.ntrk";
}
- public final class MediaFeature {
- ctor public MediaFeature();
- }
-
- public static final class MediaFeature.HdrType {
- field public static final String DOLBY_VISION = "android.media.feature.hdr.dolby_vision";
- field public static final String HDR10 = "android.media.feature.hdr.hdr10";
- field public static final String HDR10_PLUS = "android.media.feature.hdr.hdr10_plus";
- field public static final String HLG = "android.media.feature.hdr.hlg";
- }
-
public final class MediaFormat {
ctor public MediaFormat();
ctor public MediaFormat(@NonNull android.media.MediaFormat);
@@ -21894,6 +21912,8 @@
field public static final int METADATA_KEY_VIDEO_ROTATION = 24; // 0x18
field public static final int METADATA_KEY_VIDEO_WIDTH = 18; // 0x12
field public static final int METADATA_KEY_WRITER = 11; // 0xb
+ field public static final int METADATA_KEY_XMP_LENGTH = 42; // 0x2a
+ field public static final int METADATA_KEY_XMP_OFFSET = 41; // 0x29
field public static final int METADATA_KEY_YEAR = 8; // 0x8
field public static final int OPTION_CLOSEST = 3; // 0x3
field public static final int OPTION_CLOSEST_SYNC = 2; // 0x2
@@ -22616,12 +22636,6 @@
field public static final android.media.MediaTimestamp TIMESTAMP_UNKNOWN;
}
- public class MediaTranscodingException extends java.lang.Exception {
- }
-
- public static final class MediaTranscodingException.ServiceNotAvailableException extends android.media.MediaTranscodingException {
- }
-
public interface MicrophoneDirection {
method public boolean setPreferredMicrophoneDirection(int);
method public boolean setPreferredMicrophoneFieldDimension(@FloatRange(from=-1.0, to=1.0) float);
@@ -33635,8 +33649,8 @@
}
protected static interface ContactsContract.DataColumns {
- field public static final String CARRIER_PRESENCE = "carrier_presence";
- field public static final int CARRIER_PRESENCE_VT_CAPABLE = 1; // 0x1
+ field @Deprecated public static final String CARRIER_PRESENCE = "carrier_presence";
+ field @Deprecated public static final int CARRIER_PRESENCE_VT_CAPABLE = 1; // 0x1
field public static final String DATA1 = "data1";
field public static final String DATA10 = "data10";
field public static final String DATA11 = "data11";
@@ -38530,708 +38544,6 @@
}
-package android.system {
-
- public final class ErrnoException extends java.lang.Exception {
- ctor public ErrnoException(String, int);
- ctor public ErrnoException(String, int, Throwable);
- method @NonNull public java.io.IOException rethrowAsIOException() throws java.io.IOException;
- method @NonNull public java.net.SocketException rethrowAsSocketException() throws java.net.SocketException;
- field public final int errno;
- }
-
- public class Int64Ref {
- ctor public Int64Ref(long);
- field public long value;
- }
-
- public final class Os {
- method public static java.io.FileDescriptor accept(java.io.FileDescriptor, java.net.InetSocketAddress) throws android.system.ErrnoException, java.net.SocketException;
- method public static boolean access(String, int) throws android.system.ErrnoException;
- method public static void bind(java.io.FileDescriptor, java.net.InetAddress, int) throws android.system.ErrnoException, java.net.SocketException;
- method public static void bind(@NonNull java.io.FileDescriptor, @NonNull java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException;
- method public static void chmod(String, int) throws android.system.ErrnoException;
- method public static void chown(String, int, int) throws android.system.ErrnoException;
- method public static void close(java.io.FileDescriptor) throws android.system.ErrnoException;
- method public static void connect(java.io.FileDescriptor, java.net.InetAddress, int) throws android.system.ErrnoException, java.net.SocketException;
- method public static void connect(@NonNull java.io.FileDescriptor, @NonNull java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException;
- method public static java.io.FileDescriptor dup(java.io.FileDescriptor) throws android.system.ErrnoException;
- method public static java.io.FileDescriptor dup2(java.io.FileDescriptor, int) throws android.system.ErrnoException;
- method public static String[] environ();
- method public static void execv(String, String[]) throws android.system.ErrnoException;
- method public static void execve(String, String[], String[]) throws android.system.ErrnoException;
- method public static void fchmod(java.io.FileDescriptor, int) throws android.system.ErrnoException;
- method public static void fchown(java.io.FileDescriptor, int, int) throws android.system.ErrnoException;
- method public static int fcntlInt(@NonNull java.io.FileDescriptor, int, int) throws android.system.ErrnoException;
- method public static void fdatasync(java.io.FileDescriptor) throws android.system.ErrnoException;
- method public static android.system.StructStat fstat(java.io.FileDescriptor) throws android.system.ErrnoException;
- method public static android.system.StructStatVfs fstatvfs(java.io.FileDescriptor) throws android.system.ErrnoException;
- method public static void fsync(java.io.FileDescriptor) throws android.system.ErrnoException;
- method public static void ftruncate(java.io.FileDescriptor, long) throws android.system.ErrnoException;
- method public static String gai_strerror(int);
- method public static int getegid();
- method public static String getenv(String);
- method public static int geteuid();
- method public static int getgid();
- method public static java.net.SocketAddress getpeername(java.io.FileDescriptor) throws android.system.ErrnoException;
- method public static int getpid();
- method public static int getppid();
- method public static java.net.SocketAddress getsockname(java.io.FileDescriptor) throws android.system.ErrnoException;
- method @NonNull public static android.system.StructTimeval getsockoptTimeval(@NonNull java.io.FileDescriptor, int, int) throws android.system.ErrnoException;
- method public static int gettid();
- method public static int getuid();
- method public static byte[] getxattr(String, String) throws android.system.ErrnoException;
- method public static String if_indextoname(int);
- method public static int if_nametoindex(String);
- method public static java.net.InetAddress inet_pton(int, String);
- method public static boolean isatty(java.io.FileDescriptor);
- method public static void kill(int, int) throws android.system.ErrnoException;
- method public static void lchown(String, int, int) throws android.system.ErrnoException;
- method public static void link(String, String) throws android.system.ErrnoException;
- method public static void listen(java.io.FileDescriptor, int) throws android.system.ErrnoException;
- method public static String[] listxattr(String) throws android.system.ErrnoException;
- method public static long lseek(java.io.FileDescriptor, long, int) throws android.system.ErrnoException;
- method public static android.system.StructStat lstat(String) throws android.system.ErrnoException;
- method @NonNull public static java.io.FileDescriptor memfd_create(@NonNull String, int) throws android.system.ErrnoException;
- method public static void mincore(long, long, byte[]) throws android.system.ErrnoException;
- method public static void mkdir(String, int) throws android.system.ErrnoException;
- method public static void mkfifo(String, int) throws android.system.ErrnoException;
- method public static void mlock(long, long) throws android.system.ErrnoException;
- method public static long mmap(long, long, int, int, java.io.FileDescriptor, long) throws android.system.ErrnoException;
- method public static void msync(long, long, int) throws android.system.ErrnoException;
- method public static void munlock(long, long) throws android.system.ErrnoException;
- method public static void munmap(long, long) throws android.system.ErrnoException;
- method public static java.io.FileDescriptor open(String, int, int) throws android.system.ErrnoException;
- method public static java.io.FileDescriptor[] pipe() throws android.system.ErrnoException;
- method public static int poll(android.system.StructPollfd[], int) throws android.system.ErrnoException;
- method public static void posix_fallocate(java.io.FileDescriptor, long, long) throws android.system.ErrnoException;
- method public static int prctl(int, long, long, long, long) throws android.system.ErrnoException;
- method public static int pread(java.io.FileDescriptor, java.nio.ByteBuffer, long) throws android.system.ErrnoException, java.io.InterruptedIOException;
- method public static int pread(java.io.FileDescriptor, byte[], int, int, long) throws android.system.ErrnoException, java.io.InterruptedIOException;
- method public static int pwrite(java.io.FileDescriptor, java.nio.ByteBuffer, long) throws android.system.ErrnoException, java.io.InterruptedIOException;
- method public static int pwrite(java.io.FileDescriptor, byte[], int, int, long) throws android.system.ErrnoException, java.io.InterruptedIOException;
- method public static int read(java.io.FileDescriptor, java.nio.ByteBuffer) throws android.system.ErrnoException, java.io.InterruptedIOException;
- method public static int read(java.io.FileDescriptor, byte[], int, int) throws android.system.ErrnoException, java.io.InterruptedIOException;
- method public static String readlink(String) throws android.system.ErrnoException;
- method public static int readv(java.io.FileDescriptor, Object[], int[], int[]) throws android.system.ErrnoException, java.io.InterruptedIOException;
- method public static int recvfrom(java.io.FileDescriptor, java.nio.ByteBuffer, int, java.net.InetSocketAddress) throws android.system.ErrnoException, java.net.SocketException;
- method public static int recvfrom(java.io.FileDescriptor, byte[], int, int, int, java.net.InetSocketAddress) throws android.system.ErrnoException, java.net.SocketException;
- method public static void remove(String) throws android.system.ErrnoException;
- method public static void removexattr(String, String) throws android.system.ErrnoException;
- method public static void rename(String, String) throws android.system.ErrnoException;
- method public static long sendfile(java.io.FileDescriptor, java.io.FileDescriptor, android.system.Int64Ref, long) throws android.system.ErrnoException;
- method public static int sendto(java.io.FileDescriptor, java.nio.ByteBuffer, int, java.net.InetAddress, int) throws android.system.ErrnoException, java.net.SocketException;
- method public static int sendto(java.io.FileDescriptor, byte[], int, int, int, java.net.InetAddress, int) throws android.system.ErrnoException, java.net.SocketException;
- method public static int sendto(@NonNull java.io.FileDescriptor, @NonNull byte[], int, int, int, @Nullable java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException;
- method @Deprecated public static void setegid(int) throws android.system.ErrnoException;
- method public static void setenv(String, String, boolean) throws android.system.ErrnoException;
- method @Deprecated public static void seteuid(int) throws android.system.ErrnoException;
- method @Deprecated public static void setgid(int) throws android.system.ErrnoException;
- method public static int setsid() throws android.system.ErrnoException;
- method public static void setsockoptInt(java.io.FileDescriptor, int, int, int) throws android.system.ErrnoException;
- method public static void setsockoptTimeval(@NonNull java.io.FileDescriptor, int, int, @NonNull android.system.StructTimeval) throws android.system.ErrnoException;
- method @Deprecated public static void setuid(int) throws android.system.ErrnoException;
- method public static void setxattr(String, String, byte[], int) throws android.system.ErrnoException;
- method public static void shutdown(java.io.FileDescriptor, int) throws android.system.ErrnoException;
- method public static java.io.FileDescriptor socket(int, int, int) throws android.system.ErrnoException;
- method public static void socketpair(int, int, int, java.io.FileDescriptor, java.io.FileDescriptor) throws android.system.ErrnoException;
- method public static android.system.StructStat stat(String) throws android.system.ErrnoException;
- method public static android.system.StructStatVfs statvfs(String) throws android.system.ErrnoException;
- method public static String strerror(int);
- method public static String strsignal(int);
- method public static void symlink(String, String) throws android.system.ErrnoException;
- method public static long sysconf(int);
- method public static void tcdrain(java.io.FileDescriptor) throws android.system.ErrnoException;
- method public static void tcsendbreak(java.io.FileDescriptor, int) throws android.system.ErrnoException;
- method public static int umask(int);
- method public static android.system.StructUtsname uname();
- method public static void unsetenv(String) throws android.system.ErrnoException;
- method public static int write(java.io.FileDescriptor, java.nio.ByteBuffer) throws android.system.ErrnoException, java.io.InterruptedIOException;
- method public static int write(java.io.FileDescriptor, byte[], int, int) throws android.system.ErrnoException, java.io.InterruptedIOException;
- method public static int writev(java.io.FileDescriptor, Object[], int[], int[]) throws android.system.ErrnoException, java.io.InterruptedIOException;
- }
-
- public final class OsConstants {
- method public static boolean S_ISBLK(int);
- method public static boolean S_ISCHR(int);
- method public static boolean S_ISDIR(int);
- method public static boolean S_ISFIFO(int);
- method public static boolean S_ISLNK(int);
- method public static boolean S_ISREG(int);
- method public static boolean S_ISSOCK(int);
- method public static boolean WCOREDUMP(int);
- method public static int WEXITSTATUS(int);
- method public static boolean WIFEXITED(int);
- method public static boolean WIFSIGNALED(int);
- method public static boolean WIFSTOPPED(int);
- method public static int WSTOPSIG(int);
- method public static int WTERMSIG(int);
- method public static String errnoName(int);
- method public static String gaiName(int);
- field public static final int AF_INET;
- field public static final int AF_INET6;
- field public static final int AF_NETLINK;
- field public static final int AF_PACKET;
- field public static final int AF_UNIX;
- field public static final int AF_UNSPEC;
- field public static final int AI_ADDRCONFIG;
- field public static final int AI_ALL;
- field public static final int AI_CANONNAME;
- field public static final int AI_NUMERICHOST;
- field public static final int AI_NUMERICSERV;
- field public static final int AI_PASSIVE;
- field public static final int AI_V4MAPPED;
- field public static final int ARPHRD_ETHER;
- field public static final int CAP_AUDIT_CONTROL;
- field public static final int CAP_AUDIT_WRITE;
- field public static final int CAP_BLOCK_SUSPEND;
- field public static final int CAP_CHOWN;
- field public static final int CAP_DAC_OVERRIDE;
- field public static final int CAP_DAC_READ_SEARCH;
- field public static final int CAP_FOWNER;
- field public static final int CAP_FSETID;
- field public static final int CAP_IPC_LOCK;
- field public static final int CAP_IPC_OWNER;
- field public static final int CAP_KILL;
- field public static final int CAP_LAST_CAP;
- field public static final int CAP_LEASE;
- field public static final int CAP_LINUX_IMMUTABLE;
- field public static final int CAP_MAC_ADMIN;
- field public static final int CAP_MAC_OVERRIDE;
- field public static final int CAP_MKNOD;
- field public static final int CAP_NET_ADMIN;
- field public static final int CAP_NET_BIND_SERVICE;
- field public static final int CAP_NET_BROADCAST;
- field public static final int CAP_NET_RAW;
- field public static final int CAP_SETFCAP;
- field public static final int CAP_SETGID;
- field public static final int CAP_SETPCAP;
- field public static final int CAP_SETUID;
- field public static final int CAP_SYSLOG;
- field public static final int CAP_SYS_ADMIN;
- field public static final int CAP_SYS_BOOT;
- field public static final int CAP_SYS_CHROOT;
- field public static final int CAP_SYS_MODULE;
- field public static final int CAP_SYS_NICE;
- field public static final int CAP_SYS_PACCT;
- field public static final int CAP_SYS_PTRACE;
- field public static final int CAP_SYS_RAWIO;
- field public static final int CAP_SYS_RESOURCE;
- field public static final int CAP_SYS_TIME;
- field public static final int CAP_SYS_TTY_CONFIG;
- field public static final int CAP_WAKE_ALARM;
- field public static final int E2BIG;
- field public static final int EACCES;
- field public static final int EADDRINUSE;
- field public static final int EADDRNOTAVAIL;
- field public static final int EAFNOSUPPORT;
- field public static final int EAGAIN;
- field public static final int EAI_AGAIN;
- field public static final int EAI_BADFLAGS;
- field public static final int EAI_FAIL;
- field public static final int EAI_FAMILY;
- field public static final int EAI_MEMORY;
- field public static final int EAI_NODATA;
- field public static final int EAI_NONAME;
- field public static final int EAI_OVERFLOW;
- field public static final int EAI_SERVICE;
- field public static final int EAI_SOCKTYPE;
- field public static final int EAI_SYSTEM;
- field public static final int EALREADY;
- field public static final int EBADF;
- field public static final int EBADMSG;
- field public static final int EBUSY;
- field public static final int ECANCELED;
- field public static final int ECHILD;
- field public static final int ECONNABORTED;
- field public static final int ECONNREFUSED;
- field public static final int ECONNRESET;
- field public static final int EDEADLK;
- field public static final int EDESTADDRREQ;
- field public static final int EDOM;
- field public static final int EDQUOT;
- field public static final int EEXIST;
- field public static final int EFAULT;
- field public static final int EFBIG;
- field public static final int EHOSTUNREACH;
- field public static final int EIDRM;
- field public static final int EILSEQ;
- field public static final int EINPROGRESS;
- field public static final int EINTR;
- field public static final int EINVAL;
- field public static final int EIO;
- field public static final int EISCONN;
- field public static final int EISDIR;
- field public static final int ELOOP;
- field public static final int EMFILE;
- field public static final int EMLINK;
- field public static final int EMSGSIZE;
- field public static final int EMULTIHOP;
- field public static final int ENAMETOOLONG;
- field public static final int ENETDOWN;
- field public static final int ENETRESET;
- field public static final int ENETUNREACH;
- field public static final int ENFILE;
- field public static final int ENOBUFS;
- field public static final int ENODATA;
- field public static final int ENODEV;
- field public static final int ENOENT;
- field public static final int ENOEXEC;
- field public static final int ENOLCK;
- field public static final int ENOLINK;
- field public static final int ENOMEM;
- field public static final int ENOMSG;
- field public static final int ENOPROTOOPT;
- field public static final int ENOSPC;
- field public static final int ENOSR;
- field public static final int ENOSTR;
- field public static final int ENOSYS;
- field public static final int ENOTCONN;
- field public static final int ENOTDIR;
- field public static final int ENOTEMPTY;
- field public static final int ENOTSOCK;
- field public static final int ENOTSUP;
- field public static final int ENOTTY;
- field public static final int ENXIO;
- field public static final int EOPNOTSUPP;
- field public static final int EOVERFLOW;
- field public static final int EPERM;
- field public static final int EPIPE;
- field public static final int EPROTO;
- field public static final int EPROTONOSUPPORT;
- field public static final int EPROTOTYPE;
- field public static final int ERANGE;
- field public static final int EROFS;
- field public static final int ESPIPE;
- field public static final int ESRCH;
- field public static final int ESTALE;
- field public static final int ETH_P_ALL;
- field public static final int ETH_P_ARP;
- field public static final int ETH_P_IP;
- field public static final int ETH_P_IPV6;
- field public static final int ETIME;
- field public static final int ETIMEDOUT;
- field public static final int ETXTBSY;
- field public static final int EXDEV;
- field public static final int EXIT_FAILURE;
- field public static final int EXIT_SUCCESS;
- field public static final int FD_CLOEXEC;
- field public static final int FIONREAD;
- field public static final int F_DUPFD;
- field public static final int F_DUPFD_CLOEXEC;
- field public static final int F_GETFD;
- field public static final int F_GETFL;
- field public static final int F_GETLK;
- field public static final int F_GETLK64;
- field public static final int F_GETOWN;
- field public static final int F_OK;
- field public static final int F_RDLCK;
- field public static final int F_SETFD;
- field public static final int F_SETFL;
- field public static final int F_SETLK;
- field public static final int F_SETLK64;
- field public static final int F_SETLKW;
- field public static final int F_SETLKW64;
- field public static final int F_SETOWN;
- field public static final int F_UNLCK;
- field public static final int F_WRLCK;
- field public static final int ICMP6_ECHO_REPLY;
- field public static final int ICMP6_ECHO_REQUEST;
- field public static final int ICMP_ECHO;
- field public static final int ICMP_ECHOREPLY;
- field public static final int IFA_F_DADFAILED;
- field public static final int IFA_F_DEPRECATED;
- field public static final int IFA_F_HOMEADDRESS;
- field public static final int IFA_F_NODAD;
- field public static final int IFA_F_OPTIMISTIC;
- field public static final int IFA_F_PERMANENT;
- field public static final int IFA_F_SECONDARY;
- field public static final int IFA_F_TEMPORARY;
- field public static final int IFA_F_TENTATIVE;
- field public static final int IFF_ALLMULTI;
- field public static final int IFF_AUTOMEDIA;
- field public static final int IFF_BROADCAST;
- field public static final int IFF_DEBUG;
- field public static final int IFF_DYNAMIC;
- field public static final int IFF_LOOPBACK;
- field public static final int IFF_MASTER;
- field public static final int IFF_MULTICAST;
- field public static final int IFF_NOARP;
- field public static final int IFF_NOTRAILERS;
- field public static final int IFF_POINTOPOINT;
- field public static final int IFF_PORTSEL;
- field public static final int IFF_PROMISC;
- field public static final int IFF_RUNNING;
- field public static final int IFF_SLAVE;
- field public static final int IFF_UP;
- field public static final int IPPROTO_ICMP;
- field public static final int IPPROTO_ICMPV6;
- field public static final int IPPROTO_IP;
- field public static final int IPPROTO_IPV6;
- field public static final int IPPROTO_RAW;
- field public static final int IPPROTO_TCP;
- field public static final int IPPROTO_UDP;
- field public static final int IPV6_CHECKSUM;
- field public static final int IPV6_MULTICAST_HOPS;
- field public static final int IPV6_MULTICAST_IF;
- field public static final int IPV6_MULTICAST_LOOP;
- field public static final int IPV6_RECVDSTOPTS;
- field public static final int IPV6_RECVHOPLIMIT;
- field public static final int IPV6_RECVHOPOPTS;
- field public static final int IPV6_RECVPKTINFO;
- field public static final int IPV6_RECVRTHDR;
- field public static final int IPV6_RECVTCLASS;
- field public static final int IPV6_TCLASS;
- field public static final int IPV6_UNICAST_HOPS;
- field public static final int IPV6_V6ONLY;
- field public static final int IP_MULTICAST_IF;
- field public static final int IP_MULTICAST_LOOP;
- field public static final int IP_MULTICAST_TTL;
- field public static final int IP_TOS;
- field public static final int IP_TTL;
- field public static final int MAP_ANONYMOUS;
- field public static final int MAP_FIXED;
- field public static final int MAP_PRIVATE;
- field public static final int MAP_SHARED;
- field public static final int MCAST_BLOCK_SOURCE;
- field public static final int MCAST_JOIN_GROUP;
- field public static final int MCAST_JOIN_SOURCE_GROUP;
- field public static final int MCAST_LEAVE_GROUP;
- field public static final int MCAST_LEAVE_SOURCE_GROUP;
- field public static final int MCAST_UNBLOCK_SOURCE;
- field public static final int MCL_CURRENT;
- field public static final int MCL_FUTURE;
- field public static final int MFD_CLOEXEC;
- field public static final int MSG_CTRUNC;
- field public static final int MSG_DONTROUTE;
- field public static final int MSG_EOR;
- field public static final int MSG_OOB;
- field public static final int MSG_PEEK;
- field public static final int MSG_TRUNC;
- field public static final int MSG_WAITALL;
- field public static final int MS_ASYNC;
- field public static final int MS_INVALIDATE;
- field public static final int MS_SYNC;
- field public static final int NETLINK_INET_DIAG;
- field public static final int NETLINK_NETFILTER;
- field public static final int NETLINK_ROUTE;
- field public static final int NI_DGRAM;
- field public static final int NI_NAMEREQD;
- field public static final int NI_NOFQDN;
- field public static final int NI_NUMERICHOST;
- field public static final int NI_NUMERICSERV;
- field public static final int O_ACCMODE;
- field public static final int O_APPEND;
- field public static final int O_CLOEXEC;
- field public static final int O_CREAT;
- field public static final int O_DSYNC;
- field public static final int O_EXCL;
- field public static final int O_NOCTTY;
- field public static final int O_NOFOLLOW;
- field public static final int O_NONBLOCK;
- field public static final int O_RDONLY;
- field public static final int O_RDWR;
- field public static final int O_SYNC;
- field public static final int O_TRUNC;
- field public static final int O_WRONLY;
- field public static final int POLLERR;
- field public static final int POLLHUP;
- field public static final int POLLIN;
- field public static final int POLLNVAL;
- field public static final int POLLOUT;
- field public static final int POLLPRI;
- field public static final int POLLRDBAND;
- field public static final int POLLRDNORM;
- field public static final int POLLWRBAND;
- field public static final int POLLWRNORM;
- field public static final int PROT_EXEC;
- field public static final int PROT_NONE;
- field public static final int PROT_READ;
- field public static final int PROT_WRITE;
- field public static final int PR_GET_DUMPABLE;
- field public static final int PR_SET_DUMPABLE;
- field public static final int PR_SET_NO_NEW_PRIVS;
- field public static final int RTMGRP_NEIGH;
- field public static final int RT_SCOPE_HOST;
- field public static final int RT_SCOPE_LINK;
- field public static final int RT_SCOPE_NOWHERE;
- field public static final int RT_SCOPE_SITE;
- field public static final int RT_SCOPE_UNIVERSE;
- field public static final int R_OK;
- field public static final int SEEK_CUR;
- field public static final int SEEK_END;
- field public static final int SEEK_SET;
- field public static final int SHUT_RD;
- field public static final int SHUT_RDWR;
- field public static final int SHUT_WR;
- field public static final int SIGABRT;
- field public static final int SIGALRM;
- field public static final int SIGBUS;
- field public static final int SIGCHLD;
- field public static final int SIGCONT;
- field public static final int SIGFPE;
- field public static final int SIGHUP;
- field public static final int SIGILL;
- field public static final int SIGINT;
- field public static final int SIGIO;
- field public static final int SIGKILL;
- field public static final int SIGPIPE;
- field public static final int SIGPROF;
- field public static final int SIGPWR;
- field public static final int SIGQUIT;
- field public static final int SIGRTMAX;
- field public static final int SIGRTMIN;
- field public static final int SIGSEGV;
- field public static final int SIGSTKFLT;
- field public static final int SIGSTOP;
- field public static final int SIGSYS;
- field public static final int SIGTERM;
- field public static final int SIGTRAP;
- field public static final int SIGTSTP;
- field public static final int SIGTTIN;
- field public static final int SIGTTOU;
- field public static final int SIGURG;
- field public static final int SIGUSR1;
- field public static final int SIGUSR2;
- field public static final int SIGVTALRM;
- field public static final int SIGWINCH;
- field public static final int SIGXCPU;
- field public static final int SIGXFSZ;
- field public static final int SIOCGIFADDR;
- field public static final int SIOCGIFBRDADDR;
- field public static final int SIOCGIFDSTADDR;
- field public static final int SIOCGIFNETMASK;
- field public static final int SOCK_CLOEXEC;
- field public static final int SOCK_DGRAM;
- field public static final int SOCK_NONBLOCK;
- field public static final int SOCK_RAW;
- field public static final int SOCK_SEQPACKET;
- field public static final int SOCK_STREAM;
- field public static final int SOL_SOCKET;
- field public static final int SO_BINDTODEVICE;
- field public static final int SO_BROADCAST;
- field public static final int SO_DEBUG;
- field public static final int SO_DONTROUTE;
- field public static final int SO_ERROR;
- field public static final int SO_KEEPALIVE;
- field public static final int SO_LINGER;
- field public static final int SO_OOBINLINE;
- field public static final int SO_PASSCRED;
- field public static final int SO_PEERCRED;
- field public static final int SO_RCVBUF;
- field public static final int SO_RCVLOWAT;
- field public static final int SO_RCVTIMEO;
- field public static final int SO_REUSEADDR;
- field public static final int SO_SNDBUF;
- field public static final int SO_SNDLOWAT;
- field public static final int SO_SNDTIMEO;
- field public static final int SO_TYPE;
- field public static final int STDERR_FILENO;
- field public static final int STDIN_FILENO;
- field public static final int STDOUT_FILENO;
- field public static final int ST_MANDLOCK;
- field public static final int ST_NOATIME;
- field public static final int ST_NODEV;
- field public static final int ST_NODIRATIME;
- field public static final int ST_NOEXEC;
- field public static final int ST_NOSUID;
- field public static final int ST_RDONLY;
- field public static final int ST_RELATIME;
- field public static final int ST_SYNCHRONOUS;
- field public static final int S_IFBLK;
- field public static final int S_IFCHR;
- field public static final int S_IFDIR;
- field public static final int S_IFIFO;
- field public static final int S_IFLNK;
- field public static final int S_IFMT;
- field public static final int S_IFREG;
- field public static final int S_IFSOCK;
- field public static final int S_IRGRP;
- field public static final int S_IROTH;
- field public static final int S_IRUSR;
- field public static final int S_IRWXG;
- field public static final int S_IRWXO;
- field public static final int S_IRWXU;
- field public static final int S_ISGID;
- field public static final int S_ISUID;
- field public static final int S_ISVTX;
- field public static final int S_IWGRP;
- field public static final int S_IWOTH;
- field public static final int S_IWUSR;
- field public static final int S_IXGRP;
- field public static final int S_IXOTH;
- field public static final int S_IXUSR;
- field public static final int TCP_NODELAY;
- field public static final int TCP_USER_TIMEOUT;
- field public static final int WCONTINUED;
- field public static final int WEXITED;
- field public static final int WNOHANG;
- field public static final int WNOWAIT;
- field public static final int WSTOPPED;
- field public static final int WUNTRACED;
- field public static final int W_OK;
- field public static final int X_OK;
- field public static final int _SC_2_CHAR_TERM;
- field public static final int _SC_2_C_BIND;
- field public static final int _SC_2_C_DEV;
- field public static final int _SC_2_C_VERSION;
- field public static final int _SC_2_FORT_DEV;
- field public static final int _SC_2_FORT_RUN;
- field public static final int _SC_2_LOCALEDEF;
- field public static final int _SC_2_SW_DEV;
- field public static final int _SC_2_UPE;
- field public static final int _SC_2_VERSION;
- field public static final int _SC_AIO_LISTIO_MAX;
- field public static final int _SC_AIO_MAX;
- field public static final int _SC_AIO_PRIO_DELTA_MAX;
- field public static final int _SC_ARG_MAX;
- field public static final int _SC_ASYNCHRONOUS_IO;
- field public static final int _SC_ATEXIT_MAX;
- field public static final int _SC_AVPHYS_PAGES;
- field public static final int _SC_BC_BASE_MAX;
- field public static final int _SC_BC_DIM_MAX;
- field public static final int _SC_BC_SCALE_MAX;
- field public static final int _SC_BC_STRING_MAX;
- field public static final int _SC_CHILD_MAX;
- field public static final int _SC_CLK_TCK;
- field public static final int _SC_COLL_WEIGHTS_MAX;
- field public static final int _SC_DELAYTIMER_MAX;
- field public static final int _SC_EXPR_NEST_MAX;
- field public static final int _SC_FSYNC;
- field public static final int _SC_GETGR_R_SIZE_MAX;
- field public static final int _SC_GETPW_R_SIZE_MAX;
- field public static final int _SC_IOV_MAX;
- field public static final int _SC_JOB_CONTROL;
- field public static final int _SC_LINE_MAX;
- field public static final int _SC_LOGIN_NAME_MAX;
- field public static final int _SC_MAPPED_FILES;
- field public static final int _SC_MEMLOCK;
- field public static final int _SC_MEMLOCK_RANGE;
- field public static final int _SC_MEMORY_PROTECTION;
- field public static final int _SC_MESSAGE_PASSING;
- field public static final int _SC_MQ_OPEN_MAX;
- field public static final int _SC_MQ_PRIO_MAX;
- field public static final int _SC_NGROUPS_MAX;
- field public static final int _SC_NPROCESSORS_CONF;
- field public static final int _SC_NPROCESSORS_ONLN;
- field public static final int _SC_OPEN_MAX;
- field public static final int _SC_PAGESIZE;
- field public static final int _SC_PAGE_SIZE;
- field public static final int _SC_PASS_MAX;
- field public static final int _SC_PHYS_PAGES;
- field public static final int _SC_PRIORITIZED_IO;
- field public static final int _SC_PRIORITY_SCHEDULING;
- field public static final int _SC_REALTIME_SIGNALS;
- field public static final int _SC_RE_DUP_MAX;
- field public static final int _SC_RTSIG_MAX;
- field public static final int _SC_SAVED_IDS;
- field public static final int _SC_SEMAPHORES;
- field public static final int _SC_SEM_NSEMS_MAX;
- field public static final int _SC_SEM_VALUE_MAX;
- field public static final int _SC_SHARED_MEMORY_OBJECTS;
- field public static final int _SC_SIGQUEUE_MAX;
- field public static final int _SC_STREAM_MAX;
- field public static final int _SC_SYNCHRONIZED_IO;
- field public static final int _SC_THREADS;
- field public static final int _SC_THREAD_ATTR_STACKADDR;
- field public static final int _SC_THREAD_ATTR_STACKSIZE;
- field public static final int _SC_THREAD_DESTRUCTOR_ITERATIONS;
- field public static final int _SC_THREAD_KEYS_MAX;
- field public static final int _SC_THREAD_PRIORITY_SCHEDULING;
- field public static final int _SC_THREAD_PRIO_INHERIT;
- field public static final int _SC_THREAD_PRIO_PROTECT;
- field public static final int _SC_THREAD_SAFE_FUNCTIONS;
- field public static final int _SC_THREAD_STACK_MIN;
- field public static final int _SC_THREAD_THREADS_MAX;
- field public static final int _SC_TIMERS;
- field public static final int _SC_TIMER_MAX;
- field public static final int _SC_TTY_NAME_MAX;
- field public static final int _SC_TZNAME_MAX;
- field public static final int _SC_VERSION;
- field public static final int _SC_XBS5_ILP32_OFF32;
- field public static final int _SC_XBS5_ILP32_OFFBIG;
- field public static final int _SC_XBS5_LP64_OFF64;
- field public static final int _SC_XBS5_LPBIG_OFFBIG;
- field public static final int _SC_XOPEN_CRYPT;
- field public static final int _SC_XOPEN_ENH_I18N;
- field public static final int _SC_XOPEN_LEGACY;
- field public static final int _SC_XOPEN_REALTIME;
- field public static final int _SC_XOPEN_REALTIME_THREADS;
- field public static final int _SC_XOPEN_SHM;
- field public static final int _SC_XOPEN_UNIX;
- field public static final int _SC_XOPEN_VERSION;
- field public static final int _SC_XOPEN_XCU_VERSION;
- }
-
- public final class StructPollfd {
- ctor public StructPollfd();
- field public short events;
- field public java.io.FileDescriptor fd;
- field public short revents;
- field public Object userData;
- }
-
- public final class StructStat {
- ctor public StructStat(long, long, int, long, int, int, long, long, long, long, long, long, long);
- ctor public StructStat(long, long, int, long, int, int, long, long, android.system.StructTimespec, android.system.StructTimespec, android.system.StructTimespec, long, long);
- field public final android.system.StructTimespec st_atim;
- field public final long st_atime;
- field public final long st_blksize;
- field public final long st_blocks;
- field public final android.system.StructTimespec st_ctim;
- field public final long st_ctime;
- field public final long st_dev;
- field public final int st_gid;
- field public final long st_ino;
- field public final int st_mode;
- field public final android.system.StructTimespec st_mtim;
- field public final long st_mtime;
- field public final long st_nlink;
- field public final long st_rdev;
- field public final long st_size;
- field public final int st_uid;
- }
-
- public final class StructStatVfs {
- ctor public StructStatVfs(long, long, long, long, long, long, long, long, long, long, long);
- field public final long f_bavail;
- field public final long f_bfree;
- field public final long f_blocks;
- field public final long f_bsize;
- field public final long f_favail;
- field public final long f_ffree;
- field public final long f_files;
- field public final long f_flag;
- field public final long f_frsize;
- field public final long f_fsid;
- field public final long f_namemax;
- }
-
- public final class StructTimespec implements java.lang.Comparable<android.system.StructTimespec> {
- ctor public StructTimespec(long, long);
- method public int compareTo(android.system.StructTimespec);
- field public final long tv_nsec;
- field public final long tv_sec;
- }
-
- public final class StructTimeval {
- method @NonNull public static android.system.StructTimeval fromMillis(long);
- method public long toMillis();
- field public final long tv_sec;
- field public final long tv_usec;
- }
-
- public final class StructUtsname {
- ctor public StructUtsname(String, String, String, String, String);
- field public final String machine;
- field public final String nodename;
- field public final String release;
- field public final String sysname;
- field public final String version;
- }
-
-}
-
package android.telecom {
public final class Call {
@@ -40689,7 +40001,7 @@
field public static final String KEY_USE_ACS_FOR_RCS_BOOL = "use_acs_for_rcs_bool";
field public static final String KEY_USE_HFA_FOR_PROVISIONING_BOOL = "use_hfa_for_provisioning_bool";
field public static final String KEY_USE_OTASP_FOR_PROVISIONING_BOOL = "use_otasp_for_provisioning_bool";
- field public static final String KEY_USE_RCS_PRESENCE_BOOL = "use_rcs_presence_bool";
+ field @Deprecated public static final String KEY_USE_RCS_PRESENCE_BOOL = "use_rcs_presence_bool";
field public static final String KEY_USE_RCS_SIP_OPTIONS_BOOL = "use_rcs_sip_options_bool";
field public static final String KEY_USE_WFC_HOME_NETWORK_MODE_IN_ROAMING_NETWORK_BOOL = "use_wfc_home_network_mode_in_roaming_network_bool";
field public static final String KEY_VOICEMAIL_NOTIFICATION_PERSISTENT_BOOL = "voicemail_notification_persistent_bool";
@@ -40729,9 +40041,12 @@
}
public static final class CarrierConfigManager.Ims {
+ field public static final String KEY_ENABLE_PRESENCE_CAPABILITY_EXCHANGE_BOOL = "ims.enable_presence_capability_exchange_bool";
+ field public static final String KEY_ENABLE_PRESENCE_GROUP_SUBSCRIBE_BOOL = "ims.enable_presence_group_subscribe_bool";
field public static final String KEY_ENABLE_PRESENCE_PUBLISH_BOOL = "ims.enable_presence_publish_bool";
field public static final String KEY_IMS_SINGLE_REGISTRATION_REQUIRED_BOOL = "ims.ims_single_registration_required_bool";
field public static final String KEY_PREFIX = "ims.";
+ field public static final String KEY_RCS_BULK_CAPABILITY_EXCHANGE_BOOL = "ims.rcs_bulk_capability_exchange_bool";
field public static final String KEY_WIFI_OFF_DEFERRING_TIME_MILLIS_INT = "ims.wifi_off_deferring_time_millis_int";
}
@@ -41387,6 +40702,7 @@
field public static final int SERVICE_OPTION_OUT_OF_ORDER = 34; // 0x22
field public static final int SIGNAL_LOST = -3; // 0xfffffffd
field public static final int SIM_CARD_CHANGED = 2043; // 0x7fb
+ field public static final int SLICE_REJECTED = 2252; // 0x8cc
field public static final int SYNCHRONIZATION_FAILURE = 2184; // 0x888
field public static final int TEST_LOOPBACK_REGULAR_DEACTIVATION = 2196; // 0x894
field public static final int TETHERED_CALL_ACTIVE = -6; // 0xfffffffa
@@ -42296,6 +41612,7 @@
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean doesSwitchMultiSimConfigTriggerReboot();
method public int getActiveModemCount();
method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public java.util.List<android.telephony.CellInfo> getAllCellInfo();
+ method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public int getCallComposerStatus();
method public int getCallState();
method public int getCardIdForDefaultEuicc();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) @WorkerThread public android.os.PersistableBundle getCarrierConfig();
@@ -42392,6 +41709,7 @@
method @Deprecated public String sendEnvelopeWithStatus(String);
method @RequiresPermission(android.Manifest.permission.CALL_PHONE) public void sendUssdRequest(String, android.telephony.TelephonyManager.UssdResponseCallback, android.os.Handler);
method public void sendVisualVoicemailSms(String, int, String, android.app.PendingIntent);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallComposerStatus(int);
method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataEnabled(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataEnabledForReason(int, boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setForbiddenPlmns(@NonNull java.util.List<java.lang.String>);
@@ -42432,6 +41750,8 @@
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
+ field public static final int CALL_COMPOSER_STATUS_OFF = 0; // 0x0
+ field public static final int CALL_COMPOSER_STATUS_ON = 1; // 0x1
field public static final int CALL_STATE_IDLE = 0; // 0x0
field public static final int CALL_STATE_OFFHOOK = 2; // 0x2
field public static final int CALL_STATE_RINGING = 1; // 0x1
@@ -45953,7 +45273,7 @@
field public static final java.util.regex.Pattern DOMAIN_NAME;
field public static final java.util.regex.Pattern EMAIL_ADDRESS;
field @Deprecated public static final String GOOD_IRI_CHAR = "a-zA-Z0-9\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef";
- field public static final java.util.regex.Pattern IP_ADDRESS;
+ field @Deprecated public static final java.util.regex.Pattern IP_ADDRESS;
field public static final java.util.regex.Pattern PHONE;
field @Deprecated public static final java.util.regex.Pattern TOP_LEVEL_DOMAIN;
field @Deprecated public static final String TOP_LEVEL_DOMAIN_STR = "((aero|arpa|asia|a[cdefgilmnoqrstuwxz])|(biz|b[abdefghijmnorstvwyz])|(cat|com|coop|c[acdfghiklmnoruvxyz])|d[ejkmoz]|(edu|e[cegrstu])|f[ijkmor]|(gov|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(info|int|i[delmnoqrst])|(jobs|j[emop])|k[eghimnprwyz]|l[abcikrstuvy]|(mil|mobi|museum|m[acdeghklmnopqrstuvwxyz])|(name|net|n[acefgilopruz])|(org|om)|(pro|p[aefghklmnrstwy])|qa|r[eosuw]|s[abcdeghijklmnortuvyz]|(tel|travel|t[cdfghjklmnoprtvwz])|u[agksyz]|v[aceginu]|w[fs]|(\u03b4\u03bf\u03ba\u03b9\u03bc\u03ae|\u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435|\u0440\u0444|\u0441\u0440\u0431|\u05d8\u05e2\u05e1\u05d8|\u0622\u0632\u0645\u0627\u06cc\u0634\u06cc|\u0625\u062e\u062a\u0628\u0627\u0631|\u0627\u0644\u0627\u0631\u062f\u0646|\u0627\u0644\u062c\u0632\u0627\u0626\u0631|\u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629|\u0627\u0644\u0645\u063a\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062a|\u0628\u06be\u0627\u0631\u062a|\u062a\u0648\u0646\u0633|\u0633\u0648\u0631\u064a\u0629|\u0641\u0644\u0633\u0637\u064a\u0646|\u0642\u0637\u0631|\u0645\u0635\u0631|\u092a\u0930\u0940\u0915\u094d\u0937\u093e|\u092d\u093e\u0930\u0924|\u09ad\u09be\u09b0\u09a4|\u0a2d\u0a3e\u0a30\u0a24|\u0aad\u0abe\u0ab0\u0aa4|\u0b87\u0ba8\u0bcd\u0ba4\u0bbf\u0baf\u0bbe|\u0b87\u0bb2\u0b99\u0bcd\u0b95\u0bc8|\u0b9a\u0bbf\u0b99\u0bcd\u0b95\u0baa\u0bcd\u0baa\u0bc2\u0bb0\u0bcd|\u0baa\u0bb0\u0bbf\u0b9f\u0bcd\u0b9a\u0bc8|\u0c2d\u0c3e\u0c30\u0c24\u0c4d|\u0dbd\u0d82\u0d9a\u0dcf|\u0e44\u0e17\u0e22|\u30c6\u30b9\u30c8|\u4e2d\u56fd|\u4e2d\u570b|\u53f0\u6e7e|\u53f0\u7063|\u65b0\u52a0\u5761|\u6d4b\u8bd5|\u6e2c\u8a66|\u9999\u6e2f|\ud14c\uc2a4\ud2b8|\ud55c\uad6d|xn\\-\\-0zwm56d|xn\\-\\-11b5bs3a9aj6g|xn\\-\\-3e0b707e|xn\\-\\-45brj9c|xn\\-\\-80akhbyknj4f|xn\\-\\-90a3ac|xn\\-\\-9t4b11yi5a|xn\\-\\-clchc0ea0b2g2a9gcd|xn\\-\\-deba0ad|xn\\-\\-fiqs8s|xn\\-\\-fiqz9s|xn\\-\\-fpcrj9c3d|xn\\-\\-fzc2c9e2c|xn\\-\\-g6w251d|xn\\-\\-gecrj9c|xn\\-\\-h2brj9c|xn\\-\\-hgbk6aj7f53bba|xn\\-\\-hlcj6aya9esc7a|xn\\-\\-j6w193g|xn\\-\\-jxalpdlp|xn\\-\\-kgbechtv|xn\\-\\-kprw13d|xn\\-\\-kpry57d|xn\\-\\-lgbbat1ad8j|xn\\-\\-mgbaam7a8h|xn\\-\\-mgbayh7gpa|xn\\-\\-mgbbh1a71e|xn\\-\\-mgbc0a9azcg|xn\\-\\-mgberp4a5d4ar|xn\\-\\-o3cw4h|xn\\-\\-ogbpf8fl|xn\\-\\-p1ai|xn\\-\\-pgbs0dh|xn\\-\\-s9brj9c|xn\\-\\-wgbh1c|xn\\-\\-wgbl6a|xn\\-\\-xkc2al3hye2a|xn\\-\\-xkc2dl3a5ee0h|xn\\-\\-yfro4i67o|xn\\-\\-ygbi2ammx|xn\\-\\-zckzah|xxx)|y[et]|z[amw])";
@@ -55889,16952 +55209,6 @@
}
-package dalvik.annotation {
-
- @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface TestTarget {
- method @Deprecated public abstract String conceptName() default "";
- method @Deprecated public abstract Class<?>[] methodArgs() default {};
- method @Deprecated public abstract String methodName() default "";
- }
-
- @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public @interface TestTargetClass {
- method @Deprecated public abstract Class<?> value();
- }
-
-}
-
-package dalvik.bytecode {
-
- public final class OpcodeInfo {
- field public static final int MAXIMUM_PACKED_VALUE;
- field public static final int MAXIMUM_VALUE;
- }
-
- public interface Opcodes {
- field public static final int OP_ADD_DOUBLE = 171; // 0xab
- field public static final int OP_ADD_DOUBLE_2ADDR = 203; // 0xcb
- field public static final int OP_ADD_FLOAT = 166; // 0xa6
- field public static final int OP_ADD_FLOAT_2ADDR = 198; // 0xc6
- field public static final int OP_ADD_INT = 144; // 0x90
- field public static final int OP_ADD_INT_2ADDR = 176; // 0xb0
- field public static final int OP_ADD_INT_LIT16 = 208; // 0xd0
- field public static final int OP_ADD_INT_LIT8 = 216; // 0xd8
- field public static final int OP_ADD_LONG = 155; // 0x9b
- field public static final int OP_ADD_LONG_2ADDR = 187; // 0xbb
- field public static final int OP_AGET = 68; // 0x44
- field public static final int OP_AGET_BOOLEAN = 71; // 0x47
- field public static final int OP_AGET_BYTE = 72; // 0x48
- field public static final int OP_AGET_CHAR = 73; // 0x49
- field public static final int OP_AGET_OBJECT = 70; // 0x46
- field public static final int OP_AGET_SHORT = 74; // 0x4a
- field public static final int OP_AGET_WIDE = 69; // 0x45
- field public static final int OP_AND_INT = 149; // 0x95
- field public static final int OP_AND_INT_2ADDR = 181; // 0xb5
- field public static final int OP_AND_INT_LIT16 = 213; // 0xd5
- field public static final int OP_AND_INT_LIT8 = 221; // 0xdd
- field public static final int OP_AND_LONG = 160; // 0xa0
- field public static final int OP_AND_LONG_2ADDR = 192; // 0xc0
- field public static final int OP_APUT = 75; // 0x4b
- field public static final int OP_APUT_BOOLEAN = 78; // 0x4e
- field public static final int OP_APUT_BYTE = 79; // 0x4f
- field public static final int OP_APUT_CHAR = 80; // 0x50
- field public static final int OP_APUT_OBJECT = 77; // 0x4d
- field public static final int OP_APUT_SHORT = 81; // 0x51
- field public static final int OP_APUT_WIDE = 76; // 0x4c
- field public static final int OP_ARRAY_LENGTH = 33; // 0x21
- field @Deprecated public static final int OP_BREAKPOINT = 236; // 0xec
- field public static final int OP_CHECK_CAST = 31; // 0x1f
- field public static final int OP_CHECK_CAST_JUMBO = 511; // 0x1ff
- field public static final int OP_CMPG_DOUBLE = 48; // 0x30
- field public static final int OP_CMPG_FLOAT = 46; // 0x2e
- field public static final int OP_CMPL_DOUBLE = 47; // 0x2f
- field public static final int OP_CMPL_FLOAT = 45; // 0x2d
- field public static final int OP_CMP_LONG = 49; // 0x31
- field public static final int OP_CONST = 20; // 0x14
- field public static final int OP_CONST_16 = 19; // 0x13
- field public static final int OP_CONST_4 = 18; // 0x12
- field public static final int OP_CONST_CLASS = 28; // 0x1c
- field public static final int OP_CONST_CLASS_JUMBO = 255; // 0xff
- field public static final int OP_CONST_HIGH16 = 21; // 0x15
- field public static final int OP_CONST_METHOD_HANDLE = 254; // 0xfe
- field public static final int OP_CONST_METHOD_TYPE = 255; // 0xff
- field public static final int OP_CONST_STRING = 26; // 0x1a
- field public static final int OP_CONST_STRING_JUMBO = 27; // 0x1b
- field public static final int OP_CONST_WIDE = 24; // 0x18
- field public static final int OP_CONST_WIDE_16 = 22; // 0x16
- field public static final int OP_CONST_WIDE_32 = 23; // 0x17
- field public static final int OP_CONST_WIDE_HIGH16 = 25; // 0x19
- field public static final int OP_DIV_DOUBLE = 174; // 0xae
- field public static final int OP_DIV_DOUBLE_2ADDR = 206; // 0xce
- field public static final int OP_DIV_FLOAT = 169; // 0xa9
- field public static final int OP_DIV_FLOAT_2ADDR = 201; // 0xc9
- field public static final int OP_DIV_INT = 147; // 0x93
- field public static final int OP_DIV_INT_2ADDR = 179; // 0xb3
- field public static final int OP_DIV_INT_LIT16 = 211; // 0xd3
- field public static final int OP_DIV_INT_LIT8 = 219; // 0xdb
- field public static final int OP_DIV_LONG = 158; // 0x9e
- field public static final int OP_DIV_LONG_2ADDR = 190; // 0xbe
- field public static final int OP_DOUBLE_TO_FLOAT = 140; // 0x8c
- field public static final int OP_DOUBLE_TO_INT = 138; // 0x8a
- field public static final int OP_DOUBLE_TO_LONG = 139; // 0x8b
- field @Deprecated public static final int OP_EXECUTE_INLINE = 238; // 0xee
- field @Deprecated public static final int OP_EXECUTE_INLINE_RANGE = 239; // 0xef
- field public static final int OP_FILLED_NEW_ARRAY = 36; // 0x24
- field public static final int OP_FILLED_NEW_ARRAY_JUMBO = 1535; // 0x5ff
- field public static final int OP_FILLED_NEW_ARRAY_RANGE = 37; // 0x25
- field public static final int OP_FILL_ARRAY_DATA = 38; // 0x26
- field public static final int OP_FLOAT_TO_DOUBLE = 137; // 0x89
- field public static final int OP_FLOAT_TO_INT = 135; // 0x87
- field public static final int OP_FLOAT_TO_LONG = 136; // 0x88
- field public static final int OP_GOTO = 40; // 0x28
- field public static final int OP_GOTO_16 = 41; // 0x29
- field public static final int OP_GOTO_32 = 42; // 0x2a
- field public static final int OP_IF_EQ = 50; // 0x32
- field public static final int OP_IF_EQZ = 56; // 0x38
- field public static final int OP_IF_GE = 53; // 0x35
- field public static final int OP_IF_GEZ = 59; // 0x3b
- field public static final int OP_IF_GT = 54; // 0x36
- field public static final int OP_IF_GTZ = 60; // 0x3c
- field public static final int OP_IF_LE = 55; // 0x37
- field public static final int OP_IF_LEZ = 61; // 0x3d
- field public static final int OP_IF_LT = 52; // 0x34
- field public static final int OP_IF_LTZ = 58; // 0x3a
- field public static final int OP_IF_NE = 51; // 0x33
- field public static final int OP_IF_NEZ = 57; // 0x39
- field public static final int OP_IGET = 82; // 0x52
- field public static final int OP_IGET_BOOLEAN = 85; // 0x55
- field public static final int OP_IGET_BOOLEAN_JUMBO = 2559; // 0x9ff
- field public static final int OP_IGET_BYTE = 86; // 0x56
- field public static final int OP_IGET_BYTE_JUMBO = 2815; // 0xaff
- field public static final int OP_IGET_CHAR = 87; // 0x57
- field public static final int OP_IGET_CHAR_JUMBO = 3071; // 0xbff
- field public static final int OP_IGET_JUMBO = 1791; // 0x6ff
- field public static final int OP_IGET_OBJECT = 84; // 0x54
- field public static final int OP_IGET_OBJECT_JUMBO = 2303; // 0x8ff
- field @Deprecated public static final int OP_IGET_OBJECT_QUICK = 244; // 0xf4
- field @Deprecated public static final int OP_IGET_QUICK = 242; // 0xf2
- field public static final int OP_IGET_SHORT = 88; // 0x58
- field public static final int OP_IGET_SHORT_JUMBO = 3327; // 0xcff
- field public static final int OP_IGET_WIDE = 83; // 0x53
- field public static final int OP_IGET_WIDE_JUMBO = 2047; // 0x7ff
- field @Deprecated public static final int OP_IGET_WIDE_QUICK = 243; // 0xf3
- field @Deprecated public static final int OP_IGET_WIDE_VOLATILE = 232; // 0xe8
- field public static final int OP_INSTANCE_OF = 32; // 0x20
- field public static final int OP_INSTANCE_OF_JUMBO = 767; // 0x2ff
- field public static final int OP_INT_TO_BYTE = 141; // 0x8d
- field public static final int OP_INT_TO_CHAR = 142; // 0x8e
- field public static final int OP_INT_TO_DOUBLE = 131; // 0x83
- field public static final int OP_INT_TO_FLOAT = 130; // 0x82
- field public static final int OP_INT_TO_LONG = 129; // 0x81
- field public static final int OP_INT_TO_SHORT = 143; // 0x8f
- field public static final int OP_INVOKE_CUSTOM = 252; // 0xfc
- field public static final int OP_INVOKE_CUSTOM_RANGE = 253; // 0xfd
- field public static final int OP_INVOKE_DIRECT = 112; // 0x70
- field @Deprecated public static final int OP_INVOKE_DIRECT_EMPTY = 240; // 0xf0
- field public static final int OP_INVOKE_DIRECT_JUMBO = 9471; // 0x24ff
- field public static final int OP_INVOKE_DIRECT_RANGE = 118; // 0x76
- field public static final int OP_INVOKE_INTERFACE = 114; // 0x72
- field public static final int OP_INVOKE_INTERFACE_JUMBO = 9983; // 0x26ff
- field public static final int OP_INVOKE_INTERFACE_RANGE = 120; // 0x78
- field public static final int OP_INVOKE_POLYMORPHIC = 250; // 0xfa
- field public static final int OP_INVOKE_POLYMORPHIC_RANGE = 251; // 0xfb
- field public static final int OP_INVOKE_STATIC = 113; // 0x71
- field public static final int OP_INVOKE_STATIC_JUMBO = 9727; // 0x25ff
- field public static final int OP_INVOKE_STATIC_RANGE = 119; // 0x77
- field public static final int OP_INVOKE_SUPER = 111; // 0x6f
- field public static final int OP_INVOKE_SUPER_JUMBO = 9215; // 0x23ff
- field @Deprecated public static final int OP_INVOKE_SUPER_QUICK = 250; // 0xfa
- field @Deprecated public static final int OP_INVOKE_SUPER_QUICK_RANGE = 251; // 0xfb
- field public static final int OP_INVOKE_SUPER_RANGE = 117; // 0x75
- field public static final int OP_INVOKE_VIRTUAL = 110; // 0x6e
- field public static final int OP_INVOKE_VIRTUAL_JUMBO = 8959; // 0x22ff
- field @Deprecated public static final int OP_INVOKE_VIRTUAL_QUICK = 248; // 0xf8
- field @Deprecated public static final int OP_INVOKE_VIRTUAL_QUICK_RANGE = 249; // 0xf9
- field public static final int OP_INVOKE_VIRTUAL_RANGE = 116; // 0x74
- field public static final int OP_IPUT = 89; // 0x59
- field public static final int OP_IPUT_BOOLEAN = 92; // 0x5c
- field public static final int OP_IPUT_BOOLEAN_JUMBO = 4351; // 0x10ff
- field public static final int OP_IPUT_BYTE = 93; // 0x5d
- field public static final int OP_IPUT_BYTE_JUMBO = 4607; // 0x11ff
- field public static final int OP_IPUT_CHAR = 94; // 0x5e
- field public static final int OP_IPUT_CHAR_JUMBO = 4863; // 0x12ff
- field public static final int OP_IPUT_JUMBO = 3583; // 0xdff
- field public static final int OP_IPUT_OBJECT = 91; // 0x5b
- field public static final int OP_IPUT_OBJECT_JUMBO = 4095; // 0xfff
- field @Deprecated public static final int OP_IPUT_OBJECT_QUICK = 247; // 0xf7
- field @Deprecated public static final int OP_IPUT_QUICK = 245; // 0xf5
- field public static final int OP_IPUT_SHORT = 95; // 0x5f
- field public static final int OP_IPUT_SHORT_JUMBO = 5119; // 0x13ff
- field public static final int OP_IPUT_WIDE = 90; // 0x5a
- field public static final int OP_IPUT_WIDE_JUMBO = 3839; // 0xeff
- field @Deprecated public static final int OP_IPUT_WIDE_QUICK = 246; // 0xf6
- field @Deprecated public static final int OP_IPUT_WIDE_VOLATILE = 233; // 0xe9
- field public static final int OP_LONG_TO_DOUBLE = 134; // 0x86
- field public static final int OP_LONG_TO_FLOAT = 133; // 0x85
- field public static final int OP_LONG_TO_INT = 132; // 0x84
- field public static final int OP_MONITOR_ENTER = 29; // 0x1d
- field public static final int OP_MONITOR_EXIT = 30; // 0x1e
- field public static final int OP_MOVE = 1; // 0x1
- field public static final int OP_MOVE_16 = 3; // 0x3
- field public static final int OP_MOVE_EXCEPTION = 13; // 0xd
- field public static final int OP_MOVE_FROM16 = 2; // 0x2
- field public static final int OP_MOVE_OBJECT = 7; // 0x7
- field public static final int OP_MOVE_OBJECT_16 = 9; // 0x9
- field public static final int OP_MOVE_OBJECT_FROM16 = 8; // 0x8
- field public static final int OP_MOVE_RESULT = 10; // 0xa
- field public static final int OP_MOVE_RESULT_OBJECT = 12; // 0xc
- field public static final int OP_MOVE_RESULT_WIDE = 11; // 0xb
- field public static final int OP_MOVE_WIDE = 4; // 0x4
- field public static final int OP_MOVE_WIDE_16 = 6; // 0x6
- field public static final int OP_MOVE_WIDE_FROM16 = 5; // 0x5
- field public static final int OP_MUL_DOUBLE = 173; // 0xad
- field public static final int OP_MUL_DOUBLE_2ADDR = 205; // 0xcd
- field public static final int OP_MUL_FLOAT = 168; // 0xa8
- field public static final int OP_MUL_FLOAT_2ADDR = 200; // 0xc8
- field public static final int OP_MUL_INT = 146; // 0x92
- field public static final int OP_MUL_INT_2ADDR = 178; // 0xb2
- field public static final int OP_MUL_INT_LIT16 = 210; // 0xd2
- field public static final int OP_MUL_INT_LIT8 = 218; // 0xda
- field public static final int OP_MUL_LONG = 157; // 0x9d
- field public static final int OP_MUL_LONG_2ADDR = 189; // 0xbd
- field public static final int OP_NEG_DOUBLE = 128; // 0x80
- field public static final int OP_NEG_FLOAT = 127; // 0x7f
- field public static final int OP_NEG_INT = 123; // 0x7b
- field public static final int OP_NEG_LONG = 125; // 0x7d
- field public static final int OP_NEW_ARRAY = 35; // 0x23
- field public static final int OP_NEW_ARRAY_JUMBO = 1279; // 0x4ff
- field public static final int OP_NEW_INSTANCE = 34; // 0x22
- field public static final int OP_NEW_INSTANCE_JUMBO = 1023; // 0x3ff
- field public static final int OP_NOP = 0; // 0x0
- field public static final int OP_NOT_INT = 124; // 0x7c
- field public static final int OP_NOT_LONG = 126; // 0x7e
- field public static final int OP_OR_INT = 150; // 0x96
- field public static final int OP_OR_INT_2ADDR = 182; // 0xb6
- field public static final int OP_OR_INT_LIT16 = 214; // 0xd6
- field public static final int OP_OR_INT_LIT8 = 222; // 0xde
- field public static final int OP_OR_LONG = 161; // 0xa1
- field public static final int OP_OR_LONG_2ADDR = 193; // 0xc1
- field public static final int OP_PACKED_SWITCH = 43; // 0x2b
- field public static final int OP_REM_DOUBLE = 175; // 0xaf
- field public static final int OP_REM_DOUBLE_2ADDR = 207; // 0xcf
- field public static final int OP_REM_FLOAT = 170; // 0xaa
- field public static final int OP_REM_FLOAT_2ADDR = 202; // 0xca
- field public static final int OP_REM_INT = 148; // 0x94
- field public static final int OP_REM_INT_2ADDR = 180; // 0xb4
- field public static final int OP_REM_INT_LIT16 = 212; // 0xd4
- field public static final int OP_REM_INT_LIT8 = 220; // 0xdc
- field public static final int OP_REM_LONG = 159; // 0x9f
- field public static final int OP_REM_LONG_2ADDR = 191; // 0xbf
- field public static final int OP_RETURN = 15; // 0xf
- field public static final int OP_RETURN_OBJECT = 17; // 0x11
- field public static final int OP_RETURN_VOID = 14; // 0xe
- field public static final int OP_RETURN_WIDE = 16; // 0x10
- field public static final int OP_RSUB_INT = 209; // 0xd1
- field public static final int OP_RSUB_INT_LIT8 = 217; // 0xd9
- field public static final int OP_SGET = 96; // 0x60
- field public static final int OP_SGET_BOOLEAN = 99; // 0x63
- field public static final int OP_SGET_BOOLEAN_JUMBO = 6143; // 0x17ff
- field public static final int OP_SGET_BYTE = 100; // 0x64
- field public static final int OP_SGET_BYTE_JUMBO = 6399; // 0x18ff
- field public static final int OP_SGET_CHAR = 101; // 0x65
- field public static final int OP_SGET_CHAR_JUMBO = 6655; // 0x19ff
- field public static final int OP_SGET_JUMBO = 5375; // 0x14ff
- field public static final int OP_SGET_OBJECT = 98; // 0x62
- field public static final int OP_SGET_OBJECT_JUMBO = 5887; // 0x16ff
- field public static final int OP_SGET_SHORT = 102; // 0x66
- field public static final int OP_SGET_SHORT_JUMBO = 6911; // 0x1aff
- field public static final int OP_SGET_WIDE = 97; // 0x61
- field public static final int OP_SGET_WIDE_JUMBO = 5631; // 0x15ff
- field @Deprecated public static final int OP_SGET_WIDE_VOLATILE = 234; // 0xea
- field public static final int OP_SHL_INT = 152; // 0x98
- field public static final int OP_SHL_INT_2ADDR = 184; // 0xb8
- field public static final int OP_SHL_INT_LIT8 = 224; // 0xe0
- field public static final int OP_SHL_LONG = 163; // 0xa3
- field public static final int OP_SHL_LONG_2ADDR = 195; // 0xc3
- field public static final int OP_SHR_INT = 153; // 0x99
- field public static final int OP_SHR_INT_2ADDR = 185; // 0xb9
- field public static final int OP_SHR_INT_LIT8 = 225; // 0xe1
- field public static final int OP_SHR_LONG = 164; // 0xa4
- field public static final int OP_SHR_LONG_2ADDR = 196; // 0xc4
- field public static final int OP_SPARSE_SWITCH = 44; // 0x2c
- field public static final int OP_SPUT = 103; // 0x67
- field public static final int OP_SPUT_BOOLEAN = 106; // 0x6a
- field public static final int OP_SPUT_BOOLEAN_JUMBO = 7935; // 0x1eff
- field public static final int OP_SPUT_BYTE = 107; // 0x6b
- field public static final int OP_SPUT_BYTE_JUMBO = 8191; // 0x1fff
- field public static final int OP_SPUT_CHAR = 108; // 0x6c
- field public static final int OP_SPUT_CHAR_JUMBO = 8447; // 0x20ff
- field public static final int OP_SPUT_JUMBO = 7167; // 0x1bff
- field public static final int OP_SPUT_OBJECT = 105; // 0x69
- field public static final int OP_SPUT_OBJECT_JUMBO = 7679; // 0x1dff
- field public static final int OP_SPUT_SHORT = 109; // 0x6d
- field public static final int OP_SPUT_SHORT_JUMBO = 8703; // 0x21ff
- field public static final int OP_SPUT_WIDE = 104; // 0x68
- field public static final int OP_SPUT_WIDE_JUMBO = 7423; // 0x1cff
- field @Deprecated public static final int OP_SPUT_WIDE_VOLATILE = 235; // 0xeb
- field public static final int OP_SUB_DOUBLE = 172; // 0xac
- field public static final int OP_SUB_DOUBLE_2ADDR = 204; // 0xcc
- field public static final int OP_SUB_FLOAT = 167; // 0xa7
- field public static final int OP_SUB_FLOAT_2ADDR = 199; // 0xc7
- field public static final int OP_SUB_INT = 145; // 0x91
- field public static final int OP_SUB_INT_2ADDR = 177; // 0xb1
- field public static final int OP_SUB_LONG = 156; // 0x9c
- field public static final int OP_SUB_LONG_2ADDR = 188; // 0xbc
- field public static final int OP_THROW = 39; // 0x27
- field @Deprecated public static final int OP_THROW_VERIFICATION_ERROR = 237; // 0xed
- field public static final int OP_USHR_INT = 154; // 0x9a
- field public static final int OP_USHR_INT_2ADDR = 186; // 0xba
- field public static final int OP_USHR_INT_LIT8 = 226; // 0xe2
- field public static final int OP_USHR_LONG = 165; // 0xa5
- field public static final int OP_USHR_LONG_2ADDR = 197; // 0xc5
- field public static final int OP_XOR_INT = 151; // 0x97
- field public static final int OP_XOR_INT_2ADDR = 183; // 0xb7
- field public static final int OP_XOR_INT_LIT16 = 215; // 0xd7
- field public static final int OP_XOR_INT_LIT8 = 223; // 0xdf
- field public static final int OP_XOR_LONG = 162; // 0xa2
- field public static final int OP_XOR_LONG_2ADDR = 194; // 0xc2
- }
-
-}
-
-package dalvik.system {
-
- public class BaseDexClassLoader extends java.lang.ClassLoader {
- ctor public BaseDexClassLoader(String, java.io.File, String, ClassLoader);
- method public String findLibrary(String);
- method protected java.util.Enumeration<java.net.URL> findResources(String);
- }
-
- public final class DelegateLastClassLoader extends dalvik.system.PathClassLoader {
- ctor public DelegateLastClassLoader(String, ClassLoader);
- ctor public DelegateLastClassLoader(String, String, ClassLoader);
- ctor public DelegateLastClassLoader(@NonNull String, @Nullable String, @Nullable ClassLoader, boolean);
- }
-
- public class DexClassLoader extends dalvik.system.BaseDexClassLoader {
- ctor public DexClassLoader(String, String, String, ClassLoader);
- }
-
- @Deprecated public final class DexFile {
- ctor @Deprecated public DexFile(java.io.File) throws java.io.IOException;
- ctor @Deprecated public DexFile(String) throws java.io.IOException;
- method @Deprecated public void close() throws java.io.IOException;
- method @Deprecated public java.util.Enumeration<java.lang.String> entries();
- method @Deprecated public String getName();
- method @Deprecated public static boolean isDexOptNeeded(String) throws java.io.FileNotFoundException, java.io.IOException;
- method @Deprecated public Class loadClass(String, ClassLoader);
- method @Deprecated public static dalvik.system.DexFile loadDex(String, String, int) throws java.io.IOException;
- }
-
- public final class InMemoryDexClassLoader extends dalvik.system.BaseDexClassLoader {
- ctor public InMemoryDexClassLoader(@NonNull java.nio.ByteBuffer[], @Nullable String, @Nullable ClassLoader);
- ctor public InMemoryDexClassLoader(@NonNull java.nio.ByteBuffer[], @Nullable ClassLoader);
- ctor public InMemoryDexClassLoader(@NonNull java.nio.ByteBuffer, @Nullable ClassLoader);
- }
-
- public class PathClassLoader extends dalvik.system.BaseDexClassLoader {
- ctor public PathClassLoader(String, ClassLoader);
- ctor public PathClassLoader(String, String, ClassLoader);
- }
-
-}
-
-package java.awt.font {
-
- public final class NumericShaper implements java.io.Serializable {
- method public static java.awt.font.NumericShaper getContextualShaper(int);
- method public static java.awt.font.NumericShaper getContextualShaper(java.util.Set<java.awt.font.NumericShaper.Range>);
- method public static java.awt.font.NumericShaper getContextualShaper(int, int);
- method public static java.awt.font.NumericShaper getContextualShaper(java.util.Set<java.awt.font.NumericShaper.Range>, java.awt.font.NumericShaper.Range);
- method public java.util.Set<java.awt.font.NumericShaper.Range> getRangeSet();
- method public int getRanges();
- method public static java.awt.font.NumericShaper getShaper(int);
- method public static java.awt.font.NumericShaper getShaper(java.awt.font.NumericShaper.Range);
- method public boolean isContextual();
- method public void shape(char[], int, int);
- method public void shape(char[], int, int, int);
- method public void shape(char[], int, int, java.awt.font.NumericShaper.Range);
- field public static final int ALL_RANGES = 524287; // 0x7ffff
- field public static final int ARABIC = 2; // 0x2
- field public static final int BENGALI = 16; // 0x10
- field public static final int DEVANAGARI = 8; // 0x8
- field public static final int EASTERN_ARABIC = 4; // 0x4
- field public static final int ETHIOPIC = 65536; // 0x10000
- field public static final int EUROPEAN = 1; // 0x1
- field public static final int GUJARATI = 64; // 0x40
- field public static final int GURMUKHI = 32; // 0x20
- field public static final int KANNADA = 1024; // 0x400
- field public static final int KHMER = 131072; // 0x20000
- field public static final int LAO = 8192; // 0x2000
- field public static final int MALAYALAM = 2048; // 0x800
- field public static final int MONGOLIAN = 262144; // 0x40000
- field public static final int MYANMAR = 32768; // 0x8000
- field public static final int ORIYA = 128; // 0x80
- field public static final int TAMIL = 256; // 0x100
- field public static final int TELUGU = 512; // 0x200
- field public static final int THAI = 4096; // 0x1000
- field public static final int TIBETAN = 16384; // 0x4000
- }
-
- public enum NumericShaper.Range {
- enum_constant public static final java.awt.font.NumericShaper.Range ARABIC;
- enum_constant public static final java.awt.font.NumericShaper.Range BALINESE;
- enum_constant public static final java.awt.font.NumericShaper.Range BENGALI;
- enum_constant public static final java.awt.font.NumericShaper.Range CHAM;
- enum_constant public static final java.awt.font.NumericShaper.Range DEVANAGARI;
- enum_constant public static final java.awt.font.NumericShaper.Range EASTERN_ARABIC;
- enum_constant public static final java.awt.font.NumericShaper.Range ETHIOPIC;
- enum_constant public static final java.awt.font.NumericShaper.Range EUROPEAN;
- enum_constant public static final java.awt.font.NumericShaper.Range GUJARATI;
- enum_constant public static final java.awt.font.NumericShaper.Range GURMUKHI;
- enum_constant public static final java.awt.font.NumericShaper.Range JAVANESE;
- enum_constant public static final java.awt.font.NumericShaper.Range KANNADA;
- enum_constant public static final java.awt.font.NumericShaper.Range KAYAH_LI;
- enum_constant public static final java.awt.font.NumericShaper.Range KHMER;
- enum_constant public static final java.awt.font.NumericShaper.Range LAO;
- enum_constant public static final java.awt.font.NumericShaper.Range LEPCHA;
- enum_constant public static final java.awt.font.NumericShaper.Range LIMBU;
- enum_constant public static final java.awt.font.NumericShaper.Range MALAYALAM;
- enum_constant public static final java.awt.font.NumericShaper.Range MEETEI_MAYEK;
- enum_constant public static final java.awt.font.NumericShaper.Range MONGOLIAN;
- enum_constant public static final java.awt.font.NumericShaper.Range MYANMAR;
- enum_constant public static final java.awt.font.NumericShaper.Range MYANMAR_SHAN;
- enum_constant public static final java.awt.font.NumericShaper.Range NEW_TAI_LUE;
- enum_constant public static final java.awt.font.NumericShaper.Range NKO;
- enum_constant public static final java.awt.font.NumericShaper.Range OL_CHIKI;
- enum_constant public static final java.awt.font.NumericShaper.Range ORIYA;
- enum_constant public static final java.awt.font.NumericShaper.Range SAURASHTRA;
- enum_constant public static final java.awt.font.NumericShaper.Range SUNDANESE;
- enum_constant public static final java.awt.font.NumericShaper.Range TAI_THAM_HORA;
- enum_constant public static final java.awt.font.NumericShaper.Range TAI_THAM_THAM;
- enum_constant public static final java.awt.font.NumericShaper.Range TAMIL;
- enum_constant public static final java.awt.font.NumericShaper.Range TELUGU;
- enum_constant public static final java.awt.font.NumericShaper.Range THAI;
- enum_constant public static final java.awt.font.NumericShaper.Range TIBETAN;
- enum_constant public static final java.awt.font.NumericShaper.Range VAI;
- }
-
- public final class TextAttribute extends java.text.AttributedCharacterIterator.Attribute {
- ctor protected TextAttribute(String);
- field public static final java.awt.font.TextAttribute BACKGROUND;
- field public static final java.awt.font.TextAttribute BIDI_EMBEDDING;
- field public static final java.awt.font.TextAttribute CHAR_REPLACEMENT;
- field public static final java.awt.font.TextAttribute FAMILY;
- field public static final java.awt.font.TextAttribute FONT;
- field public static final java.awt.font.TextAttribute FOREGROUND;
- field public static final java.awt.font.TextAttribute INPUT_METHOD_HIGHLIGHT;
- field public static final java.awt.font.TextAttribute INPUT_METHOD_UNDERLINE;
- field public static final java.awt.font.TextAttribute JUSTIFICATION;
- field public static final Float JUSTIFICATION_FULL;
- field public static final Float JUSTIFICATION_NONE;
- field public static final java.awt.font.TextAttribute KERNING;
- field public static final Integer KERNING_ON;
- field public static final java.awt.font.TextAttribute LIGATURES;
- field public static final Integer LIGATURES_ON;
- field public static final java.awt.font.TextAttribute NUMERIC_SHAPING;
- field public static final java.awt.font.TextAttribute POSTURE;
- field public static final Float POSTURE_OBLIQUE;
- field public static final Float POSTURE_REGULAR;
- field public static final java.awt.font.TextAttribute RUN_DIRECTION;
- field public static final Boolean RUN_DIRECTION_LTR;
- field public static final Boolean RUN_DIRECTION_RTL;
- field public static final java.awt.font.TextAttribute SIZE;
- field public static final java.awt.font.TextAttribute STRIKETHROUGH;
- field public static final Boolean STRIKETHROUGH_ON;
- field public static final java.awt.font.TextAttribute SUPERSCRIPT;
- field public static final Integer SUPERSCRIPT_SUB;
- field public static final Integer SUPERSCRIPT_SUPER;
- field public static final java.awt.font.TextAttribute SWAP_COLORS;
- field public static final Boolean SWAP_COLORS_ON;
- field public static final java.awt.font.TextAttribute TRACKING;
- field public static final Float TRACKING_LOOSE;
- field public static final Float TRACKING_TIGHT;
- field public static final java.awt.font.TextAttribute TRANSFORM;
- field public static final java.awt.font.TextAttribute UNDERLINE;
- field public static final Integer UNDERLINE_LOW_DASHED;
- field public static final Integer UNDERLINE_LOW_DOTTED;
- field public static final Integer UNDERLINE_LOW_GRAY;
- field public static final Integer UNDERLINE_LOW_ONE_PIXEL;
- field public static final Integer UNDERLINE_LOW_TWO_PIXEL;
- field public static final Integer UNDERLINE_ON;
- field public static final java.awt.font.TextAttribute WEIGHT;
- field public static final Float WEIGHT_BOLD;
- field public static final Float WEIGHT_DEMIBOLD;
- field public static final Float WEIGHT_DEMILIGHT;
- field public static final Float WEIGHT_EXTRABOLD;
- field public static final Float WEIGHT_EXTRA_LIGHT;
- field public static final Float WEIGHT_HEAVY;
- field public static final Float WEIGHT_LIGHT;
- field public static final Float WEIGHT_MEDIUM;
- field public static final Float WEIGHT_REGULAR;
- field public static final Float WEIGHT_SEMIBOLD;
- field public static final Float WEIGHT_ULTRABOLD;
- field public static final java.awt.font.TextAttribute WIDTH;
- field public static final Float WIDTH_CONDENSED;
- field public static final Float WIDTH_EXTENDED;
- field public static final Float WIDTH_REGULAR;
- field public static final Float WIDTH_SEMI_CONDENSED;
- field public static final Float WIDTH_SEMI_EXTENDED;
- }
-
-}
-
-package java.beans {
-
- public class IndexedPropertyChangeEvent extends java.beans.PropertyChangeEvent {
- ctor public IndexedPropertyChangeEvent(Object, String, Object, Object, int);
- method public int getIndex();
- }
-
- public class PropertyChangeEvent extends java.util.EventObject {
- ctor public PropertyChangeEvent(Object, String, Object, Object);
- method public Object getNewValue();
- method public Object getOldValue();
- method public Object getPropagationId();
- method public String getPropertyName();
- method public void setPropagationId(Object);
- }
-
- public interface PropertyChangeListener extends java.util.EventListener {
- method public void propertyChange(java.beans.PropertyChangeEvent);
- }
-
- public class PropertyChangeListenerProxy extends java.util.EventListenerProxy<java.beans.PropertyChangeListener> implements java.beans.PropertyChangeListener {
- ctor public PropertyChangeListenerProxy(String, java.beans.PropertyChangeListener);
- method public String getPropertyName();
- method public void propertyChange(java.beans.PropertyChangeEvent);
- }
-
- public class PropertyChangeSupport implements java.io.Serializable {
- ctor public PropertyChangeSupport(Object);
- method public void addPropertyChangeListener(java.beans.PropertyChangeListener);
- method public void addPropertyChangeListener(String, java.beans.PropertyChangeListener);
- method public void fireIndexedPropertyChange(String, int, Object, Object);
- method public void fireIndexedPropertyChange(String, int, int, int);
- method public void fireIndexedPropertyChange(String, int, boolean, boolean);
- method public void firePropertyChange(String, Object, Object);
- method public void firePropertyChange(String, int, int);
- method public void firePropertyChange(String, boolean, boolean);
- method public void firePropertyChange(java.beans.PropertyChangeEvent);
- method public java.beans.PropertyChangeListener[] getPropertyChangeListeners();
- method public java.beans.PropertyChangeListener[] getPropertyChangeListeners(String);
- method public boolean hasListeners(String);
- method public void removePropertyChangeListener(java.beans.PropertyChangeListener);
- method public void removePropertyChangeListener(String, java.beans.PropertyChangeListener);
- }
-
-}
-
-package java.io {
-
- public class BufferedInputStream extends java.io.FilterInputStream {
- ctor public BufferedInputStream(java.io.InputStream);
- ctor public BufferedInputStream(java.io.InputStream, int);
- field protected volatile byte[] buf;
- field protected int count;
- field protected int marklimit;
- field protected int markpos;
- field protected int pos;
- }
-
- public class BufferedOutputStream extends java.io.FilterOutputStream {
- ctor public BufferedOutputStream(java.io.OutputStream);
- ctor public BufferedOutputStream(java.io.OutputStream, int);
- field protected byte[] buf;
- field protected int count;
- }
-
- public class BufferedReader extends java.io.Reader {
- ctor public BufferedReader(java.io.Reader, int);
- ctor public BufferedReader(java.io.Reader);
- method public void close() throws java.io.IOException;
- method public java.util.stream.Stream<java.lang.String> lines();
- method public int read(char[], int, int) throws java.io.IOException;
- method public String readLine() throws java.io.IOException;
- }
-
- public class BufferedWriter extends java.io.Writer {
- ctor public BufferedWriter(java.io.Writer);
- ctor public BufferedWriter(java.io.Writer, int);
- method public void close() throws java.io.IOException;
- method public void flush() throws java.io.IOException;
- method public void newLine() throws java.io.IOException;
- method public void write(char[], int, int) throws java.io.IOException;
- }
-
- public class ByteArrayInputStream extends java.io.InputStream {
- ctor public ByteArrayInputStream(byte[]);
- ctor public ByteArrayInputStream(byte[], int, int);
- method public int available();
- method public int read();
- method public int read(byte[], int, int);
- method public void reset();
- method public long skip(long);
- field protected byte[] buf;
- field protected int count;
- field protected int mark;
- field protected int pos;
- }
-
- public class ByteArrayOutputStream extends java.io.OutputStream {
- ctor public ByteArrayOutputStream();
- ctor public ByteArrayOutputStream(int);
- method public void reset();
- method public int size();
- method @NonNull public byte[] toByteArray();
- method @NonNull public String toString(@NonNull String) throws java.io.UnsupportedEncodingException;
- method @Deprecated @NonNull public String toString(int);
- method public void write(int);
- method public void write(@NonNull byte[], int, int);
- method public void writeTo(@NonNull java.io.OutputStream) throws java.io.IOException;
- field @NonNull protected byte[] buf;
- field protected int count;
- }
-
- public class CharArrayReader extends java.io.Reader {
- ctor public CharArrayReader(char[]);
- ctor public CharArrayReader(char[], int, int);
- method public void close();
- method public int read(char[], int, int) throws java.io.IOException;
- field protected char[] buf;
- field protected int count;
- field protected int markedPos;
- field protected int pos;
- }
-
- public class CharArrayWriter extends java.io.Writer {
- ctor public CharArrayWriter();
- ctor public CharArrayWriter(int);
- method public java.io.CharArrayWriter append(CharSequence);
- method public java.io.CharArrayWriter append(CharSequence, int, int);
- method public java.io.CharArrayWriter append(char);
- method public void close();
- method public void flush();
- method public void reset();
- method public int size();
- method public char[] toCharArray();
- method public void write(int);
- method public void write(char[], int, int);
- method public void write(String, int, int);
- method public void writeTo(java.io.Writer) throws java.io.IOException;
- field protected char[] buf;
- field protected int count;
- }
-
- public class CharConversionException extends java.io.IOException {
- ctor public CharConversionException();
- ctor public CharConversionException(String);
- }
-
- public interface Closeable extends java.lang.AutoCloseable {
- method public void close() throws java.io.IOException;
- }
-
- public final class Console implements java.io.Flushable {
- method public void flush();
- method public java.io.Console format(String, java.lang.Object...);
- method public java.io.Console printf(String, java.lang.Object...);
- method public String readLine(String, java.lang.Object...);
- method public String readLine();
- method public char[] readPassword(String, java.lang.Object...);
- method public char[] readPassword();
- method public java.io.Reader reader();
- method public java.io.PrintWriter writer();
- }
-
- public interface DataInput {
- method public boolean readBoolean() throws java.io.IOException;
- method public byte readByte() throws java.io.IOException;
- method public char readChar() throws java.io.IOException;
- method public double readDouble() throws java.io.IOException;
- method public float readFloat() throws java.io.IOException;
- method public void readFully(byte[]) throws java.io.IOException;
- method public void readFully(byte[], int, int) throws java.io.IOException;
- method public int readInt() throws java.io.IOException;
- method public String readLine() throws java.io.IOException;
- method public long readLong() throws java.io.IOException;
- method public short readShort() throws java.io.IOException;
- method public String readUTF() throws java.io.IOException;
- method public int readUnsignedByte() throws java.io.IOException;
- method public int readUnsignedShort() throws java.io.IOException;
- method public int skipBytes(int) throws java.io.IOException;
- }
-
- public class DataInputStream extends java.io.FilterInputStream implements java.io.DataInput {
- ctor public DataInputStream(java.io.InputStream);
- method public final int read(byte[]) throws java.io.IOException;
- method public final int read(byte[], int, int) throws java.io.IOException;
- method public final boolean readBoolean() throws java.io.IOException;
- method public final byte readByte() throws java.io.IOException;
- method public final char readChar() throws java.io.IOException;
- method public final double readDouble() throws java.io.IOException;
- method public final float readFloat() throws java.io.IOException;
- method public final void readFully(byte[]) throws java.io.IOException;
- method public final void readFully(byte[], int, int) throws java.io.IOException;
- method public final int readInt() throws java.io.IOException;
- method @Deprecated public final String readLine() throws java.io.IOException;
- method public final long readLong() throws java.io.IOException;
- method public final short readShort() throws java.io.IOException;
- method public final String readUTF() throws java.io.IOException;
- method public static final String readUTF(java.io.DataInput) throws java.io.IOException;
- method public final int readUnsignedByte() throws java.io.IOException;
- method public final int readUnsignedShort() throws java.io.IOException;
- method public final int skipBytes(int) throws java.io.IOException;
- }
-
- public interface DataOutput {
- method public void write(int) throws java.io.IOException;
- method public void write(byte[]) throws java.io.IOException;
- method public void write(byte[], int, int) throws java.io.IOException;
- method public void writeBoolean(boolean) throws java.io.IOException;
- method public void writeByte(int) throws java.io.IOException;
- method public void writeBytes(String) throws java.io.IOException;
- method public void writeChar(int) throws java.io.IOException;
- method public void writeChars(String) throws java.io.IOException;
- method public void writeDouble(double) throws java.io.IOException;
- method public void writeFloat(float) throws java.io.IOException;
- method public void writeInt(int) throws java.io.IOException;
- method public void writeLong(long) throws java.io.IOException;
- method public void writeShort(int) throws java.io.IOException;
- method public void writeUTF(String) throws java.io.IOException;
- }
-
- public class DataOutputStream extends java.io.FilterOutputStream implements java.io.DataOutput {
- ctor public DataOutputStream(java.io.OutputStream);
- method public final int size();
- method public final void writeBoolean(boolean) throws java.io.IOException;
- method public final void writeByte(int) throws java.io.IOException;
- method public final void writeBytes(String) throws java.io.IOException;
- method public final void writeChar(int) throws java.io.IOException;
- method public final void writeChars(String) throws java.io.IOException;
- method public final void writeDouble(double) throws java.io.IOException;
- method public final void writeFloat(float) throws java.io.IOException;
- method public final void writeInt(int) throws java.io.IOException;
- method public final void writeLong(long) throws java.io.IOException;
- method public final void writeShort(int) throws java.io.IOException;
- method public final void writeUTF(String) throws java.io.IOException;
- field protected int written;
- }
-
- public class EOFException extends java.io.IOException {
- ctor public EOFException();
- ctor public EOFException(String);
- }
-
- public interface Externalizable extends java.io.Serializable {
- method public void readExternal(java.io.ObjectInput) throws java.lang.ClassNotFoundException, java.io.IOException;
- method public void writeExternal(java.io.ObjectOutput) throws java.io.IOException;
- }
-
- public class File implements java.lang.Comparable<java.io.File> java.io.Serializable {
- ctor public File(@NonNull String);
- ctor public File(@Nullable String, @NonNull String);
- ctor public File(@Nullable java.io.File, @NonNull String);
- ctor public File(@NonNull java.net.URI);
- method public boolean canExecute();
- method public boolean canRead();
- method public boolean canWrite();
- method public int compareTo(@NonNull java.io.File);
- method public boolean createNewFile() throws java.io.IOException;
- method @NonNull public static java.io.File createTempFile(@NonNull String, @Nullable String, @Nullable java.io.File) throws java.io.IOException;
- method @NonNull public static java.io.File createTempFile(@NonNull String, @Nullable String) throws java.io.IOException;
- method public boolean delete();
- method public void deleteOnExit();
- method public boolean exists();
- method @NonNull public java.io.File getAbsoluteFile();
- method @NonNull public String getAbsolutePath();
- method @NonNull public java.io.File getCanonicalFile() throws java.io.IOException;
- method @NonNull public String getCanonicalPath() throws java.io.IOException;
- method public long getFreeSpace();
- method @NonNull public String getName();
- method @Nullable public String getParent();
- method @Nullable public java.io.File getParentFile();
- method @NonNull public String getPath();
- method public long getTotalSpace();
- method public long getUsableSpace();
- method public boolean isAbsolute();
- method public boolean isDirectory();
- method public boolean isFile();
- method public boolean isHidden();
- method public long lastModified();
- method public long length();
- method @Nullable public String[] list();
- method @Nullable public String[] list(@Nullable java.io.FilenameFilter);
- method @Nullable public java.io.File[] listFiles();
- method @Nullable public java.io.File[] listFiles(@Nullable java.io.FilenameFilter);
- method @Nullable public java.io.File[] listFiles(@Nullable java.io.FileFilter);
- method @NonNull public static java.io.File[] listRoots();
- method public boolean mkdir();
- method public boolean mkdirs();
- method public boolean renameTo(@NonNull java.io.File);
- method public boolean setExecutable(boolean, boolean);
- method public boolean setExecutable(boolean);
- method public boolean setLastModified(long);
- method public boolean setReadOnly();
- method public boolean setReadable(boolean, boolean);
- method public boolean setReadable(boolean);
- method public boolean setWritable(boolean, boolean);
- method public boolean setWritable(boolean);
- method @NonNull public java.nio.file.Path toPath();
- method @NonNull public java.net.URI toURI();
- method @Deprecated @NonNull public java.net.URL toURL() throws java.net.MalformedURLException;
- field @NonNull public static final String pathSeparator;
- field public static final char pathSeparatorChar;
- field @NonNull public static final String separator;
- field public static final char separatorChar;
- }
-
- public final class FileDescriptor {
- ctor public FileDescriptor();
- method public void sync() throws java.io.SyncFailedException;
- method public boolean valid();
- field public static final java.io.FileDescriptor err;
- field public static final java.io.FileDescriptor in;
- field public static final java.io.FileDescriptor out;
- }
-
- @java.lang.FunctionalInterface public interface FileFilter {
- method public boolean accept(java.io.File);
- }
-
- public class FileInputStream extends java.io.InputStream {
- ctor public FileInputStream(String) throws java.io.FileNotFoundException;
- ctor public FileInputStream(java.io.File) throws java.io.FileNotFoundException;
- ctor public FileInputStream(java.io.FileDescriptor);
- method protected void finalize() throws java.io.IOException;
- method public java.nio.channels.FileChannel getChannel();
- method public final java.io.FileDescriptor getFD() throws java.io.IOException;
- method public int read() throws java.io.IOException;
- }
-
- public class FileNotFoundException extends java.io.IOException {
- ctor public FileNotFoundException();
- ctor public FileNotFoundException(String);
- }
-
- public class FileOutputStream extends java.io.OutputStream {
- ctor public FileOutputStream(String) throws java.io.FileNotFoundException;
- ctor public FileOutputStream(String, boolean) throws java.io.FileNotFoundException;
- ctor public FileOutputStream(java.io.File) throws java.io.FileNotFoundException;
- ctor public FileOutputStream(java.io.File, boolean) throws java.io.FileNotFoundException;
- ctor public FileOutputStream(java.io.FileDescriptor);
- method protected void finalize() throws java.io.IOException;
- method public java.nio.channels.FileChannel getChannel();
- method public final java.io.FileDescriptor getFD() throws java.io.IOException;
- method public void write(int) throws java.io.IOException;
- }
-
- public final class FilePermission extends java.security.Permission implements java.io.Serializable {
- ctor public FilePermission(String, String);
- method public String getActions();
- method public boolean implies(java.security.Permission);
- }
-
- public class FileReader extends java.io.InputStreamReader {
- ctor public FileReader(String) throws java.io.FileNotFoundException;
- ctor public FileReader(java.io.File) throws java.io.FileNotFoundException;
- ctor public FileReader(java.io.FileDescriptor);
- }
-
- public class FileWriter extends java.io.OutputStreamWriter {
- ctor public FileWriter(String) throws java.io.IOException;
- ctor public FileWriter(String, boolean) throws java.io.IOException;
- ctor public FileWriter(java.io.File) throws java.io.IOException;
- ctor public FileWriter(java.io.File, boolean) throws java.io.IOException;
- ctor public FileWriter(java.io.FileDescriptor);
- }
-
- @java.lang.FunctionalInterface public interface FilenameFilter {
- method public boolean accept(java.io.File, String);
- }
-
- public class FilterInputStream extends java.io.InputStream {
- ctor protected FilterInputStream(java.io.InputStream);
- method public int read() throws java.io.IOException;
- field protected volatile java.io.InputStream in;
- }
-
- public class FilterOutputStream extends java.io.OutputStream {
- ctor public FilterOutputStream(java.io.OutputStream);
- method public void write(int) throws java.io.IOException;
- field protected java.io.OutputStream out;
- }
-
- public abstract class FilterReader extends java.io.Reader {
- ctor protected FilterReader(java.io.Reader);
- method public void close() throws java.io.IOException;
- method public int read(char[], int, int) throws java.io.IOException;
- field protected java.io.Reader in;
- }
-
- public abstract class FilterWriter extends java.io.Writer {
- ctor protected FilterWriter(java.io.Writer);
- method public void close() throws java.io.IOException;
- method public void flush() throws java.io.IOException;
- method public void write(char[], int, int) throws java.io.IOException;
- field protected java.io.Writer out;
- }
-
- public interface Flushable {
- method public void flush() throws java.io.IOException;
- }
-
- public class IOError extends java.lang.Error {
- ctor public IOError(Throwable);
- }
-
- public class IOException extends java.lang.Exception {
- ctor public IOException();
- ctor public IOException(String);
- ctor public IOException(String, Throwable);
- ctor public IOException(Throwable);
- }
-
- public abstract class InputStream implements java.io.Closeable {
- ctor public InputStream();
- method public int available() throws java.io.IOException;
- method public void close() throws java.io.IOException;
- method public void mark(int);
- method public boolean markSupported();
- method public abstract int read() throws java.io.IOException;
- method public int read(byte[]) throws java.io.IOException;
- method public int read(byte[], int, int) throws java.io.IOException;
- method public void reset() throws java.io.IOException;
- method public long skip(long) throws java.io.IOException;
- }
-
- public class InputStreamReader extends java.io.Reader {
- ctor public InputStreamReader(java.io.InputStream);
- ctor public InputStreamReader(java.io.InputStream, String) throws java.io.UnsupportedEncodingException;
- ctor public InputStreamReader(java.io.InputStream, java.nio.charset.Charset);
- ctor public InputStreamReader(java.io.InputStream, java.nio.charset.CharsetDecoder);
- method public void close() throws java.io.IOException;
- method public String getEncoding();
- method public int read(char[], int, int) throws java.io.IOException;
- }
-
- public class InterruptedIOException extends java.io.IOException {
- ctor public InterruptedIOException();
- ctor public InterruptedIOException(String);
- field public int bytesTransferred;
- }
-
- public class InvalidClassException extends java.io.ObjectStreamException {
- ctor public InvalidClassException(String);
- ctor public InvalidClassException(String, String);
- field public String classname;
- }
-
- public class InvalidObjectException extends java.io.ObjectStreamException {
- ctor public InvalidObjectException(String);
- }
-
- @Deprecated public class LineNumberInputStream extends java.io.FilterInputStream {
- ctor @Deprecated public LineNumberInputStream(java.io.InputStream);
- method @Deprecated public int getLineNumber();
- method @Deprecated public void setLineNumber(int);
- }
-
- public class LineNumberReader extends java.io.BufferedReader {
- ctor public LineNumberReader(java.io.Reader);
- ctor public LineNumberReader(java.io.Reader, int);
- method public int getLineNumber();
- method public void setLineNumber(int);
- }
-
- public class NotActiveException extends java.io.ObjectStreamException {
- ctor public NotActiveException(String);
- ctor public NotActiveException();
- }
-
- public class NotSerializableException extends java.io.ObjectStreamException {
- ctor public NotSerializableException(String);
- ctor public NotSerializableException();
- }
-
- public interface ObjectInput extends java.io.DataInput java.lang.AutoCloseable {
- method public int available() throws java.io.IOException;
- method public void close() throws java.io.IOException;
- method public int read() throws java.io.IOException;
- method public int read(byte[]) throws java.io.IOException;
- method public int read(byte[], int, int) throws java.io.IOException;
- method public Object readObject() throws java.lang.ClassNotFoundException, java.io.IOException;
- method public long skip(long) throws java.io.IOException;
- }
-
- public class ObjectInputStream extends java.io.InputStream implements java.io.ObjectInput java.io.ObjectStreamConstants {
- ctor public ObjectInputStream(java.io.InputStream) throws java.io.IOException;
- ctor protected ObjectInputStream() throws java.io.IOException, java.lang.SecurityException;
- method public void defaultReadObject() throws java.lang.ClassNotFoundException, java.io.IOException;
- method protected boolean enableResolveObject(boolean) throws java.lang.SecurityException;
- method public int read() throws java.io.IOException;
- method public boolean readBoolean() throws java.io.IOException;
- method public byte readByte() throws java.io.IOException;
- method public char readChar() throws java.io.IOException;
- method protected java.io.ObjectStreamClass readClassDescriptor() throws java.lang.ClassNotFoundException, java.io.IOException;
- method public double readDouble() throws java.io.IOException;
- method public java.io.ObjectInputStream.GetField readFields() throws java.lang.ClassNotFoundException, java.io.IOException;
- method public float readFloat() throws java.io.IOException;
- method public void readFully(byte[]) throws java.io.IOException;
- method public void readFully(byte[], int, int) throws java.io.IOException;
- method public int readInt() throws java.io.IOException;
- method @Deprecated public String readLine() throws java.io.IOException;
- method public long readLong() throws java.io.IOException;
- method public final Object readObject() throws java.lang.ClassNotFoundException, java.io.IOException;
- method protected Object readObjectOverride() throws java.lang.ClassNotFoundException, java.io.IOException;
- method public short readShort() throws java.io.IOException;
- method protected void readStreamHeader() throws java.io.IOException, java.io.StreamCorruptedException;
- method public String readUTF() throws java.io.IOException;
- method public Object readUnshared() throws java.lang.ClassNotFoundException, java.io.IOException;
- method public int readUnsignedByte() throws java.io.IOException;
- method public int readUnsignedShort() throws java.io.IOException;
- method public void registerValidation(java.io.ObjectInputValidation, int) throws java.io.InvalidObjectException, java.io.NotActiveException;
- method protected Class<?> resolveClass(java.io.ObjectStreamClass) throws java.lang.ClassNotFoundException, java.io.IOException;
- method protected Object resolveObject(Object) throws java.io.IOException;
- method protected Class<?> resolveProxyClass(String[]) throws java.lang.ClassNotFoundException, java.io.IOException;
- method public int skipBytes(int) throws java.io.IOException;
- }
-
- public abstract static class ObjectInputStream.GetField {
- ctor public ObjectInputStream.GetField();
- method public abstract boolean defaulted(String) throws java.io.IOException;
- method public abstract boolean get(String, boolean) throws java.io.IOException;
- method public abstract byte get(String, byte) throws java.io.IOException;
- method public abstract char get(String, char) throws java.io.IOException;
- method public abstract short get(String, short) throws java.io.IOException;
- method public abstract int get(String, int) throws java.io.IOException;
- method public abstract long get(String, long) throws java.io.IOException;
- method public abstract float get(String, float) throws java.io.IOException;
- method public abstract double get(String, double) throws java.io.IOException;
- method public abstract Object get(String, Object) throws java.io.IOException;
- method public abstract java.io.ObjectStreamClass getObjectStreamClass();
- }
-
- public interface ObjectInputValidation {
- method public void validateObject() throws java.io.InvalidObjectException;
- }
-
- public interface ObjectOutput extends java.io.DataOutput java.lang.AutoCloseable {
- method public void close() throws java.io.IOException;
- method public void flush() throws java.io.IOException;
- method public void writeObject(Object) throws java.io.IOException;
- }
-
- public class ObjectOutputStream extends java.io.OutputStream implements java.io.ObjectOutput java.io.ObjectStreamConstants {
- ctor public ObjectOutputStream(java.io.OutputStream) throws java.io.IOException;
- ctor protected ObjectOutputStream() throws java.io.IOException, java.lang.SecurityException;
- method protected void annotateClass(Class<?>) throws java.io.IOException;
- method protected void annotateProxyClass(Class<?>) throws java.io.IOException;
- method public void defaultWriteObject() throws java.io.IOException;
- method protected void drain() throws java.io.IOException;
- method protected boolean enableReplaceObject(boolean) throws java.lang.SecurityException;
- method public java.io.ObjectOutputStream.PutField putFields() throws java.io.IOException;
- method protected Object replaceObject(Object) throws java.io.IOException;
- method public void reset() throws java.io.IOException;
- method public void useProtocolVersion(int) throws java.io.IOException;
- method public void write(int) throws java.io.IOException;
- method public void writeBoolean(boolean) throws java.io.IOException;
- method public void writeByte(int) throws java.io.IOException;
- method public void writeBytes(String) throws java.io.IOException;
- method public void writeChar(int) throws java.io.IOException;
- method public void writeChars(String) throws java.io.IOException;
- method protected void writeClassDescriptor(java.io.ObjectStreamClass) throws java.io.IOException;
- method public void writeDouble(double) throws java.io.IOException;
- method public void writeFields() throws java.io.IOException;
- method public void writeFloat(float) throws java.io.IOException;
- method public void writeInt(int) throws java.io.IOException;
- method public void writeLong(long) throws java.io.IOException;
- method public final void writeObject(Object) throws java.io.IOException;
- method protected void writeObjectOverride(Object) throws java.io.IOException;
- method public void writeShort(int) throws java.io.IOException;
- method protected void writeStreamHeader() throws java.io.IOException;
- method public void writeUTF(String) throws java.io.IOException;
- method public void writeUnshared(Object) throws java.io.IOException;
- }
-
- public abstract static class ObjectOutputStream.PutField {
- ctor public ObjectOutputStream.PutField();
- method public abstract void put(String, boolean);
- method public abstract void put(String, byte);
- method public abstract void put(String, char);
- method public abstract void put(String, short);
- method public abstract void put(String, int);
- method public abstract void put(String, long);
- method public abstract void put(String, float);
- method public abstract void put(String, double);
- method public abstract void put(String, Object);
- method @Deprecated public abstract void write(java.io.ObjectOutput) throws java.io.IOException;
- }
-
- public class ObjectStreamClass implements java.io.Serializable {
- method public Class<?> forClass();
- method public java.io.ObjectStreamField getField(String);
- method public java.io.ObjectStreamField[] getFields();
- method public String getName();
- method public long getSerialVersionUID();
- method public static java.io.ObjectStreamClass lookup(Class<?>);
- method public static java.io.ObjectStreamClass lookupAny(Class<?>);
- field public static final java.io.ObjectStreamField[] NO_FIELDS;
- }
-
- public interface ObjectStreamConstants {
- field public static final int PROTOCOL_VERSION_1 = 1; // 0x1
- field public static final int PROTOCOL_VERSION_2 = 2; // 0x2
- field public static final byte SC_BLOCK_DATA = 8; // 0x8
- field public static final byte SC_ENUM = 16; // 0x10
- field public static final byte SC_EXTERNALIZABLE = 4; // 0x4
- field public static final byte SC_SERIALIZABLE = 2; // 0x2
- field public static final byte SC_WRITE_METHOD = 1; // 0x1
- field public static final short STREAM_MAGIC = -21267; // 0xffffaced
- field public static final short STREAM_VERSION = 5; // 0x5
- field public static final java.io.SerializablePermission SUBCLASS_IMPLEMENTATION_PERMISSION;
- field public static final java.io.SerializablePermission SUBSTITUTION_PERMISSION;
- field public static final byte TC_ARRAY = 117; // 0x75
- field public static final byte TC_BASE = 112; // 0x70
- field public static final byte TC_BLOCKDATA = 119; // 0x77
- field public static final byte TC_BLOCKDATALONG = 122; // 0x7a
- field public static final byte TC_CLASS = 118; // 0x76
- field public static final byte TC_CLASSDESC = 114; // 0x72
- field public static final byte TC_ENDBLOCKDATA = 120; // 0x78
- field public static final byte TC_ENUM = 126; // 0x7e
- field public static final byte TC_EXCEPTION = 123; // 0x7b
- field public static final byte TC_LONGSTRING = 124; // 0x7c
- field public static final byte TC_MAX = 126; // 0x7e
- field public static final byte TC_NULL = 112; // 0x70
- field public static final byte TC_OBJECT = 115; // 0x73
- field public static final byte TC_PROXYCLASSDESC = 125; // 0x7d
- field public static final byte TC_REFERENCE = 113; // 0x71
- field public static final byte TC_RESET = 121; // 0x79
- field public static final byte TC_STRING = 116; // 0x74
- field public static final int baseWireHandle = 8257536; // 0x7e0000
- }
-
- public abstract class ObjectStreamException extends java.io.IOException {
- ctor protected ObjectStreamException(String);
- ctor protected ObjectStreamException();
- }
-
- public class ObjectStreamField implements java.lang.Comparable<java.lang.Object> {
- ctor public ObjectStreamField(String, Class<?>);
- ctor public ObjectStreamField(String, Class<?>, boolean);
- method public int compareTo(Object);
- method public String getName();
- method public int getOffset();
- method public Class<?> getType();
- method public char getTypeCode();
- method public String getTypeString();
- method public boolean isPrimitive();
- method public boolean isUnshared();
- method protected void setOffset(int);
- }
-
- public class OptionalDataException extends java.io.ObjectStreamException {
- field public boolean eof;
- field public int length;
- }
-
- public abstract class OutputStream implements java.io.Closeable java.io.Flushable {
- ctor public OutputStream();
- method public void close() throws java.io.IOException;
- method public void flush() throws java.io.IOException;
- method public abstract void write(int) throws java.io.IOException;
- method public void write(byte[]) throws java.io.IOException;
- method public void write(byte[], int, int) throws java.io.IOException;
- }
-
- public class OutputStreamWriter extends java.io.Writer {
- ctor public OutputStreamWriter(java.io.OutputStream, String) throws java.io.UnsupportedEncodingException;
- ctor public OutputStreamWriter(java.io.OutputStream);
- ctor public OutputStreamWriter(java.io.OutputStream, java.nio.charset.Charset);
- ctor public OutputStreamWriter(java.io.OutputStream, java.nio.charset.CharsetEncoder);
- method public void close() throws java.io.IOException;
- method public void flush() throws java.io.IOException;
- method public String getEncoding();
- method public void write(char[], int, int) throws java.io.IOException;
- }
-
- public class PipedInputStream extends java.io.InputStream {
- ctor public PipedInputStream(java.io.PipedOutputStream) throws java.io.IOException;
- ctor public PipedInputStream(java.io.PipedOutputStream, int) throws java.io.IOException;
- ctor public PipedInputStream();
- ctor public PipedInputStream(int);
- method public void connect(java.io.PipedOutputStream) throws java.io.IOException;
- method public int read() throws java.io.IOException;
- method protected void receive(int) throws java.io.IOException;
- field protected static final int PIPE_SIZE = 1024; // 0x400
- field protected byte[] buffer;
- field protected int in;
- field protected int out;
- }
-
- public class PipedOutputStream extends java.io.OutputStream {
- ctor public PipedOutputStream(java.io.PipedInputStream) throws java.io.IOException;
- ctor public PipedOutputStream();
- method public void connect(java.io.PipedInputStream) throws java.io.IOException;
- method public void write(int) throws java.io.IOException;
- }
-
- public class PipedReader extends java.io.Reader {
- ctor public PipedReader(java.io.PipedWriter) throws java.io.IOException;
- ctor public PipedReader(java.io.PipedWriter, int) throws java.io.IOException;
- ctor public PipedReader();
- ctor public PipedReader(int);
- method public void close() throws java.io.IOException;
- method public void connect(java.io.PipedWriter) throws java.io.IOException;
- method public int read(char[], int, int) throws java.io.IOException;
- }
-
- public class PipedWriter extends java.io.Writer {
- ctor public PipedWriter(java.io.PipedReader) throws java.io.IOException;
- ctor public PipedWriter();
- method public void close() throws java.io.IOException;
- method public void connect(java.io.PipedReader) throws java.io.IOException;
- method public void flush() throws java.io.IOException;
- method public void write(char[], int, int) throws java.io.IOException;
- }
-
- public class PrintStream extends java.io.FilterOutputStream implements java.lang.Appendable java.io.Closeable {
- ctor public PrintStream(java.io.OutputStream);
- ctor public PrintStream(java.io.OutputStream, boolean);
- ctor public PrintStream(java.io.OutputStream, boolean, String) throws java.io.UnsupportedEncodingException;
- ctor public PrintStream(String) throws java.io.FileNotFoundException;
- ctor public PrintStream(String, String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
- ctor public PrintStream(java.io.File) throws java.io.FileNotFoundException;
- ctor public PrintStream(java.io.File, String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
- method public java.io.PrintStream append(CharSequence);
- method public java.io.PrintStream append(CharSequence, int, int);
- method public java.io.PrintStream append(char);
- method public boolean checkError();
- method protected void clearError();
- method public void close();
- method public void flush();
- method public java.io.PrintStream format(String, java.lang.Object...);
- method public java.io.PrintStream format(java.util.Locale, String, java.lang.Object...);
- method public void print(boolean);
- method public void print(char);
- method public void print(int);
- method public void print(long);
- method public void print(float);
- method public void print(double);
- method public void print(char[]);
- method public void print(String);
- method public void print(Object);
- method public java.io.PrintStream printf(String, java.lang.Object...);
- method public java.io.PrintStream printf(java.util.Locale, String, java.lang.Object...);
- method public void println();
- method public void println(boolean);
- method public void println(char);
- method public void println(int);
- method public void println(long);
- method public void println(float);
- method public void println(double);
- method public void println(char[]);
- method public void println(String);
- method public void println(Object);
- method protected void setError();
- method public void write(int);
- method public void write(byte[], int, int);
- }
-
- public class PrintWriter extends java.io.Writer {
- ctor public PrintWriter(@NonNull java.io.Writer);
- ctor public PrintWriter(@NonNull java.io.Writer, boolean);
- ctor public PrintWriter(@NonNull java.io.OutputStream);
- ctor public PrintWriter(@NonNull java.io.OutputStream, boolean);
- ctor public PrintWriter(@NonNull String) throws java.io.FileNotFoundException;
- ctor public PrintWriter(@NonNull String, @NonNull String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
- ctor public PrintWriter(@NonNull java.io.File) throws java.io.FileNotFoundException;
- ctor public PrintWriter(@NonNull java.io.File, @NonNull String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
- method @NonNull public java.io.PrintWriter append(@Nullable CharSequence);
- method @NonNull public java.io.PrintWriter append(@Nullable CharSequence, int, int);
- method @NonNull public java.io.PrintWriter append(char);
- method public boolean checkError();
- method protected void clearError();
- method public void close();
- method public void flush();
- method @NonNull public java.io.PrintWriter format(@NonNull String, @NonNull java.lang.Object...);
- method @NonNull public java.io.PrintWriter format(@Nullable java.util.Locale, @NonNull String, @NonNull java.lang.Object...);
- method public void print(boolean);
- method public void print(char);
- method public void print(int);
- method public void print(long);
- method public void print(float);
- method public void print(double);
- method public void print(char[]);
- method public void print(@Nullable String);
- method public void print(@Nullable Object);
- method @NonNull public java.io.PrintWriter printf(@NonNull String, @NonNull java.lang.Object...);
- method @NonNull public java.io.PrintWriter printf(@Nullable java.util.Locale, @NonNull String, @NonNull java.lang.Object...);
- method public void println();
- method public void println(boolean);
- method public void println(char);
- method public void println(int);
- method public void println(long);
- method public void println(float);
- method public void println(double);
- method public void println(char[]);
- method public void println(@Nullable String);
- method public void println(@Nullable Object);
- method protected void setError();
- method public void write(int);
- method public void write(char[], int, int);
- method public void write(char[]);
- method public void write(@NonNull String, int, int);
- method public void write(@NonNull String);
- field protected java.io.Writer out;
- }
-
- public class PushbackInputStream extends java.io.FilterInputStream {
- ctor public PushbackInputStream(java.io.InputStream, int);
- ctor public PushbackInputStream(java.io.InputStream);
- method public void unread(int) throws java.io.IOException;
- method public void unread(byte[], int, int) throws java.io.IOException;
- method public void unread(byte[]) throws java.io.IOException;
- field protected byte[] buf;
- field protected int pos;
- }
-
- public class PushbackReader extends java.io.FilterReader {
- ctor public PushbackReader(java.io.Reader, int);
- ctor public PushbackReader(java.io.Reader);
- method public void unread(int) throws java.io.IOException;
- method public void unread(char[], int, int) throws java.io.IOException;
- method public void unread(char[]) throws java.io.IOException;
- }
-
- public class RandomAccessFile implements java.io.Closeable java.io.DataInput java.io.DataOutput {
- ctor public RandomAccessFile(String, String) throws java.io.FileNotFoundException;
- ctor public RandomAccessFile(java.io.File, String) throws java.io.FileNotFoundException;
- method public void close() throws java.io.IOException;
- method public final java.nio.channels.FileChannel getChannel();
- method public final java.io.FileDescriptor getFD() throws java.io.IOException;
- method public long getFilePointer() throws java.io.IOException;
- method public long length() throws java.io.IOException;
- method public int read() throws java.io.IOException;
- method public int read(byte[], int, int) throws java.io.IOException;
- method public int read(byte[]) throws java.io.IOException;
- method public final boolean readBoolean() throws java.io.IOException;
- method public final byte readByte() throws java.io.IOException;
- method public final char readChar() throws java.io.IOException;
- method public final double readDouble() throws java.io.IOException;
- method public final float readFloat() throws java.io.IOException;
- method public final void readFully(byte[]) throws java.io.IOException;
- method public final void readFully(byte[], int, int) throws java.io.IOException;
- method public final int readInt() throws java.io.IOException;
- method public final String readLine() throws java.io.IOException;
- method public final long readLong() throws java.io.IOException;
- method public final short readShort() throws java.io.IOException;
- method public final String readUTF() throws java.io.IOException;
- method public final int readUnsignedByte() throws java.io.IOException;
- method public final int readUnsignedShort() throws java.io.IOException;
- method public void seek(long) throws java.io.IOException;
- method public void setLength(long) throws java.io.IOException;
- method public int skipBytes(int) throws java.io.IOException;
- method public void write(int) throws java.io.IOException;
- method public void write(byte[]) throws java.io.IOException;
- method public void write(byte[], int, int) throws java.io.IOException;
- method public final void writeBoolean(boolean) throws java.io.IOException;
- method public final void writeByte(int) throws java.io.IOException;
- method public final void writeBytes(String) throws java.io.IOException;
- method public final void writeChar(int) throws java.io.IOException;
- method public final void writeChars(String) throws java.io.IOException;
- method public final void writeDouble(double) throws java.io.IOException;
- method public final void writeFloat(float) throws java.io.IOException;
- method public final void writeInt(int) throws java.io.IOException;
- method public final void writeLong(long) throws java.io.IOException;
- method public final void writeShort(int) throws java.io.IOException;
- method public final void writeUTF(String) throws java.io.IOException;
- }
-
- public abstract class Reader implements java.io.Closeable java.lang.Readable {
- ctor protected Reader();
- ctor protected Reader(Object);
- method public void mark(int) throws java.io.IOException;
- method public boolean markSupported();
- method public int read(java.nio.CharBuffer) throws java.io.IOException;
- method public int read() throws java.io.IOException;
- method public int read(char[]) throws java.io.IOException;
- method public abstract int read(char[], int, int) throws java.io.IOException;
- method public boolean ready() throws java.io.IOException;
- method public void reset() throws java.io.IOException;
- method public long skip(long) throws java.io.IOException;
- field protected Object lock;
- }
-
- public class SequenceInputStream extends java.io.InputStream {
- ctor public SequenceInputStream(java.util.Enumeration<? extends java.io.InputStream>);
- ctor public SequenceInputStream(java.io.InputStream, java.io.InputStream);
- method public int read() throws java.io.IOException;
- }
-
- public interface Serializable {
- }
-
- public final class SerializablePermission extends java.security.BasicPermission {
- ctor public SerializablePermission(String);
- ctor public SerializablePermission(String, String);
- }
-
- public class StreamCorruptedException extends java.io.ObjectStreamException {
- ctor public StreamCorruptedException(String);
- ctor public StreamCorruptedException();
- }
-
- public class StreamTokenizer {
- ctor @Deprecated public StreamTokenizer(java.io.InputStream);
- ctor public StreamTokenizer(java.io.Reader);
- method public void commentChar(int);
- method public void eolIsSignificant(boolean);
- method public int lineno();
- method public void lowerCaseMode(boolean);
- method public int nextToken() throws java.io.IOException;
- method public void ordinaryChar(int);
- method public void ordinaryChars(int, int);
- method public void parseNumbers();
- method public void pushBack();
- method public void quoteChar(int);
- method public void resetSyntax();
- method public void slashSlashComments(boolean);
- method public void slashStarComments(boolean);
- method public void whitespaceChars(int, int);
- method public void wordChars(int, int);
- field public static final int TT_EOF = -1; // 0xffffffff
- field public static final int TT_EOL = 10; // 0xa
- field public static final int TT_NUMBER = -2; // 0xfffffffe
- field public static final int TT_WORD = -3; // 0xfffffffd
- field public double nval;
- field public String sval;
- field public int ttype;
- }
-
- @Deprecated public class StringBufferInputStream extends java.io.InputStream {
- ctor @Deprecated public StringBufferInputStream(String);
- method @Deprecated public int available();
- method @Deprecated public int read();
- method @Deprecated public int read(byte[], int, int);
- method @Deprecated public void reset();
- method @Deprecated public long skip(long);
- field @Deprecated protected String buffer;
- field @Deprecated protected int count;
- field @Deprecated protected int pos;
- }
-
- public class StringReader extends java.io.Reader {
- ctor public StringReader(String);
- method public void close();
- method public int read(char[], int, int) throws java.io.IOException;
- }
-
- public class StringWriter extends java.io.Writer {
- ctor public StringWriter();
- ctor public StringWriter(int);
- method public java.io.StringWriter append(CharSequence);
- method public java.io.StringWriter append(CharSequence, int, int);
- method public java.io.StringWriter append(char);
- method public void close() throws java.io.IOException;
- method public void flush();
- method public StringBuffer getBuffer();
- method public void write(int);
- method public void write(char[], int, int);
- method public void write(String);
- method public void write(String, int, int);
- }
-
- public class SyncFailedException extends java.io.IOException {
- ctor public SyncFailedException(String);
- }
-
- public class UTFDataFormatException extends java.io.IOException {
- ctor public UTFDataFormatException();
- ctor public UTFDataFormatException(String);
- }
-
- public class UncheckedIOException extends java.lang.RuntimeException {
- ctor public UncheckedIOException(String, java.io.IOException);
- ctor public UncheckedIOException(java.io.IOException);
- method public java.io.IOException getCause();
- }
-
- public class UnsupportedEncodingException extends java.io.IOException {
- ctor public UnsupportedEncodingException();
- ctor public UnsupportedEncodingException(String);
- }
-
- public class WriteAbortedException extends java.io.ObjectStreamException {
- ctor public WriteAbortedException(String, Exception);
- field public Exception detail;
- }
-
- public abstract class Writer implements java.lang.Appendable java.io.Closeable java.io.Flushable {
- ctor protected Writer();
- ctor protected Writer(Object);
- method public java.io.Writer append(CharSequence) throws java.io.IOException;
- method public java.io.Writer append(CharSequence, int, int) throws java.io.IOException;
- method public java.io.Writer append(char) throws java.io.IOException;
- method public void write(int) throws java.io.IOException;
- method public void write(char[]) throws java.io.IOException;
- method public abstract void write(char[], int, int) throws java.io.IOException;
- method public void write(String) throws java.io.IOException;
- method public void write(String, int, int) throws java.io.IOException;
- field protected Object lock;
- }
-
-}
-
-package java.lang {
-
- public class AbstractMethodError extends java.lang.IncompatibleClassChangeError {
- ctor public AbstractMethodError();
- ctor public AbstractMethodError(String);
- }
-
- public interface Appendable {
- method @NonNull public Appendable append(@Nullable CharSequence) throws java.io.IOException;
- method @NonNull public Appendable append(@Nullable CharSequence, int, int) throws java.io.IOException;
- method @NonNull public Appendable append(char) throws java.io.IOException;
- }
-
- public class ArithmeticException extends java.lang.RuntimeException {
- ctor public ArithmeticException();
- ctor public ArithmeticException(String);
- }
-
- public class ArrayIndexOutOfBoundsException extends java.lang.IndexOutOfBoundsException {
- ctor public ArrayIndexOutOfBoundsException();
- ctor public ArrayIndexOutOfBoundsException(int);
- ctor public ArrayIndexOutOfBoundsException(String);
- }
-
- public class ArrayStoreException extends java.lang.RuntimeException {
- ctor public ArrayStoreException();
- ctor public ArrayStoreException(String);
- }
-
- public class AssertionError extends java.lang.Error {
- ctor public AssertionError();
- ctor public AssertionError(Object);
- ctor public AssertionError(boolean);
- ctor public AssertionError(char);
- ctor public AssertionError(int);
- ctor public AssertionError(long);
- ctor public AssertionError(float);
- ctor public AssertionError(double);
- ctor public AssertionError(String, Throwable);
- }
-
- public interface AutoCloseable {
- method public void close() throws java.lang.Exception;
- }
-
- public final class Boolean implements java.lang.Comparable<java.lang.Boolean> java.io.Serializable {
- ctor public Boolean(boolean);
- ctor public Boolean(@Nullable String);
- method public boolean booleanValue();
- method public static int compare(boolean, boolean);
- method public int compareTo(@NonNull Boolean);
- method public static boolean getBoolean(@NonNull String);
- method public static int hashCode(boolean);
- method public static boolean logicalAnd(boolean, boolean);
- method public static boolean logicalOr(boolean, boolean);
- method public static boolean logicalXor(boolean, boolean);
- method public static boolean parseBoolean(@Nullable String);
- method @NonNull public static String toString(boolean);
- method @NonNull public static Boolean valueOf(boolean);
- method @NonNull public static Boolean valueOf(@Nullable String);
- field public static final Boolean FALSE;
- field public static final Boolean TRUE;
- field public static final Class<java.lang.Boolean> TYPE;
- }
-
- public class BootstrapMethodError extends java.lang.LinkageError {
- ctor public BootstrapMethodError();
- ctor public BootstrapMethodError(String);
- ctor public BootstrapMethodError(String, Throwable);
- ctor public BootstrapMethodError(Throwable);
- }
-
- public final class Byte extends java.lang.Number implements java.lang.Comparable<java.lang.Byte> {
- ctor public Byte(byte);
- ctor public Byte(@NonNull String) throws java.lang.NumberFormatException;
- method public static int compare(byte, byte);
- method public int compareTo(@NonNull Byte);
- method @NonNull public static Byte decode(@NonNull String) throws java.lang.NumberFormatException;
- method public double doubleValue();
- method public float floatValue();
- method public static int hashCode(byte);
- method public int intValue();
- method public long longValue();
- method public static byte parseByte(@NonNull String, int) throws java.lang.NumberFormatException;
- method public static byte parseByte(@NonNull String) throws java.lang.NumberFormatException;
- method @NonNull public static String toString(byte);
- method public static int toUnsignedInt(byte);
- method public static long toUnsignedLong(byte);
- method @NonNull public static Byte valueOf(byte);
- method @NonNull public static Byte valueOf(@NonNull String, int) throws java.lang.NumberFormatException;
- method @NonNull public static Byte valueOf(@NonNull String) throws java.lang.NumberFormatException;
- field public static final int BYTES = 1; // 0x1
- field public static final byte MAX_VALUE = 127; // 0x7f
- field public static final byte MIN_VALUE = -128; // 0xffffff80
- field public static final int SIZE = 8; // 0x8
- field public static final Class<java.lang.Byte> TYPE;
- }
-
- public interface CharSequence {
- method public char charAt(int);
- method @NonNull public default java.util.stream.IntStream chars();
- method @NonNull public default java.util.stream.IntStream codePoints();
- method public int length();
- method @NonNull public CharSequence subSequence(int, int);
- method @NonNull public String toString();
- }
-
- public final class Character implements java.lang.Comparable<java.lang.Character> java.io.Serializable {
- ctor public Character(char);
- method public static int charCount(int);
- method public char charValue();
- method public static int codePointAt(@NonNull CharSequence, int);
- method public static int codePointAt(char[], int);
- method public static int codePointAt(char[], int, int);
- method public static int codePointBefore(@NonNull CharSequence, int);
- method public static int codePointBefore(char[], int);
- method public static int codePointBefore(char[], int, int);
- method public static int codePointCount(@NonNull CharSequence, int, int);
- method public static int codePointCount(char[], int, int);
- method public static int compare(char, char);
- method public int compareTo(@NonNull Character);
- method public static int digit(char, int);
- method public static int digit(int, int);
- method public static char forDigit(int, int);
- method public static byte getDirectionality(char);
- method public static byte getDirectionality(int);
- method @Nullable public static String getName(int);
- method public static int getNumericValue(char);
- method public static int getNumericValue(int);
- method public static int getType(char);
- method public static int getType(int);
- method public static int hashCode(char);
- method public static char highSurrogate(int);
- method public static boolean isAlphabetic(int);
- method public static boolean isBmpCodePoint(int);
- method public static boolean isDefined(char);
- method public static boolean isDefined(int);
- method public static boolean isDigit(char);
- method public static boolean isDigit(int);
- method public static boolean isHighSurrogate(char);
- method public static boolean isISOControl(char);
- method public static boolean isISOControl(int);
- method public static boolean isIdentifierIgnorable(char);
- method public static boolean isIdentifierIgnorable(int);
- method public static boolean isIdeographic(int);
- method public static boolean isJavaIdentifierPart(char);
- method public static boolean isJavaIdentifierPart(int);
- method public static boolean isJavaIdentifierStart(char);
- method public static boolean isJavaIdentifierStart(int);
- method @Deprecated public static boolean isJavaLetter(char);
- method @Deprecated public static boolean isJavaLetterOrDigit(char);
- method public static boolean isLetter(char);
- method public static boolean isLetter(int);
- method public static boolean isLetterOrDigit(char);
- method public static boolean isLetterOrDigit(int);
- method public static boolean isLowSurrogate(char);
- method public static boolean isLowerCase(char);
- method public static boolean isLowerCase(int);
- method public static boolean isMirrored(char);
- method public static boolean isMirrored(int);
- method @Deprecated public static boolean isSpace(char);
- method public static boolean isSpaceChar(char);
- method public static boolean isSpaceChar(int);
- method public static boolean isSupplementaryCodePoint(int);
- method public static boolean isSurrogate(char);
- method public static boolean isSurrogatePair(char, char);
- method public static boolean isTitleCase(char);
- method public static boolean isTitleCase(int);
- method public static boolean isUnicodeIdentifierPart(char);
- method public static boolean isUnicodeIdentifierPart(int);
- method public static boolean isUnicodeIdentifierStart(char);
- method public static boolean isUnicodeIdentifierStart(int);
- method public static boolean isUpperCase(char);
- method public static boolean isUpperCase(int);
- method public static boolean isValidCodePoint(int);
- method public static boolean isWhitespace(char);
- method public static boolean isWhitespace(int);
- method public static char lowSurrogate(int);
- method public static int offsetByCodePoints(@NonNull CharSequence, int, int);
- method public static int offsetByCodePoints(char[], int, int, int, int);
- method public static char reverseBytes(char);
- method public static int toChars(int, char[], int);
- method public static char[] toChars(int);
- method public static int toCodePoint(char, char);
- method public static char toLowerCase(char);
- method public static int toLowerCase(int);
- method @NonNull public static String toString(char);
- method public static char toTitleCase(char);
- method public static int toTitleCase(int);
- method public static char toUpperCase(char);
- method public static int toUpperCase(int);
- method @NonNull public static Character valueOf(char);
- field public static final int BYTES = 2; // 0x2
- field public static final byte COMBINING_SPACING_MARK = 8; // 0x8
- field public static final byte CONNECTOR_PUNCTUATION = 23; // 0x17
- field public static final byte CONTROL = 15; // 0xf
- field public static final byte CURRENCY_SYMBOL = 26; // 0x1a
- field public static final byte DASH_PUNCTUATION = 20; // 0x14
- field public static final byte DECIMAL_DIGIT_NUMBER = 9; // 0x9
- field public static final byte DIRECTIONALITY_ARABIC_NUMBER = 6; // 0x6
- field public static final byte DIRECTIONALITY_BOUNDARY_NEUTRAL = 9; // 0x9
- field public static final byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR = 7; // 0x7
- field public static final byte DIRECTIONALITY_EUROPEAN_NUMBER = 3; // 0x3
- field public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR = 4; // 0x4
- field public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR = 5; // 0x5
- field public static final byte DIRECTIONALITY_LEFT_TO_RIGHT = 0; // 0x0
- field public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING = 14; // 0xe
- field public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE = 15; // 0xf
- field public static final byte DIRECTIONALITY_NONSPACING_MARK = 8; // 0x8
- field public static final byte DIRECTIONALITY_OTHER_NEUTRALS = 13; // 0xd
- field public static final byte DIRECTIONALITY_PARAGRAPH_SEPARATOR = 10; // 0xa
- field public static final byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT = 18; // 0x12
- field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT = 1; // 0x1
- field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC = 2; // 0x2
- field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING = 16; // 0x10
- field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE = 17; // 0x11
- field public static final byte DIRECTIONALITY_SEGMENT_SEPARATOR = 11; // 0xb
- field public static final byte DIRECTIONALITY_UNDEFINED = -1; // 0xffffffff
- field public static final byte DIRECTIONALITY_WHITESPACE = 12; // 0xc
- field public static final byte ENCLOSING_MARK = 7; // 0x7
- field public static final byte END_PUNCTUATION = 22; // 0x16
- field public static final byte FINAL_QUOTE_PUNCTUATION = 30; // 0x1e
- field public static final byte FORMAT = 16; // 0x10
- field public static final byte INITIAL_QUOTE_PUNCTUATION = 29; // 0x1d
- 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 = 25; // 0x19
- 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 char MAX_VALUE = 65535; // 0xffff '\uffff'
- 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 char MIN_VALUE = 0; // 0x0000 '\u0000'
- field public static final byte MODIFIER_LETTER = 4; // 0x4
- field public static final byte MODIFIER_SYMBOL = 27; // 0x1b
- 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 = 24; // 0x18
- field public static final byte OTHER_SYMBOL = 28; // 0x1c
- field public static final byte PARAGRAPH_SEPARATOR = 14; // 0xe
- field public static final byte PRIVATE_USE = 18; // 0x12
- field public static final int SIZE = 16; // 0x10
- field public static final byte SPACE_SEPARATOR = 12; // 0xc
- field public static final byte START_PUNCTUATION = 21; // 0x15
- field public static final byte SURROGATE = 19; // 0x13
- field public static final byte TITLECASE_LETTER = 3; // 0x3
- field public static final Class<java.lang.Character> TYPE;
- field public static final byte UNASSIGNED = 0; // 0x0
- field public static final byte UPPERCASE_LETTER = 1; // 0x1
- }
-
- public static class Character.Subset {
- ctor protected Character.Subset(@NonNull String);
- method public final boolean equals(@Nullable Object);
- method public final int hashCode();
- method @NonNull public final String toString();
- }
-
- public static final class Character.UnicodeBlock extends java.lang.Character.Subset {
- method @NonNull public static java.lang.Character.UnicodeBlock forName(@NonNull String);
- method @Nullable public static java.lang.Character.UnicodeBlock of(char);
- method @Nullable public static java.lang.Character.UnicodeBlock of(int);
- field public static final java.lang.Character.UnicodeBlock AEGEAN_NUMBERS;
- field public static final java.lang.Character.UnicodeBlock ALCHEMICAL_SYMBOLS;
- field public static final java.lang.Character.UnicodeBlock ALPHABETIC_PRESENTATION_FORMS;
- field public static final java.lang.Character.UnicodeBlock ANCIENT_GREEK_MUSICAL_NOTATION;
- field public static final java.lang.Character.UnicodeBlock ANCIENT_GREEK_NUMBERS;
- field public static final java.lang.Character.UnicodeBlock ANCIENT_SYMBOLS;
- field public static final java.lang.Character.UnicodeBlock ARABIC;
- field public static final java.lang.Character.UnicodeBlock ARABIC_EXTENDED_A;
- field public static final java.lang.Character.UnicodeBlock ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS;
- field public static final java.lang.Character.UnicodeBlock ARABIC_PRESENTATION_FORMS_A;
- field public static final java.lang.Character.UnicodeBlock ARABIC_PRESENTATION_FORMS_B;
- field public static final java.lang.Character.UnicodeBlock ARABIC_SUPPLEMENT;
- field public static final java.lang.Character.UnicodeBlock ARMENIAN;
- field public static final java.lang.Character.UnicodeBlock ARROWS;
- field public static final java.lang.Character.UnicodeBlock AVESTAN;
- field public static final java.lang.Character.UnicodeBlock BALINESE;
- field public static final java.lang.Character.UnicodeBlock BAMUM;
- field public static final java.lang.Character.UnicodeBlock BAMUM_SUPPLEMENT;
- field public static final java.lang.Character.UnicodeBlock BASIC_LATIN;
- field public static final java.lang.Character.UnicodeBlock BATAK;
- field public static final java.lang.Character.UnicodeBlock BENGALI;
- field public static final java.lang.Character.UnicodeBlock BLOCK_ELEMENTS;
- field public static final java.lang.Character.UnicodeBlock BOPOMOFO;
- field public static final java.lang.Character.UnicodeBlock BOPOMOFO_EXTENDED;
- field public static final java.lang.Character.UnicodeBlock BOX_DRAWING;
- field public static final java.lang.Character.UnicodeBlock BRAHMI;
- field public static final java.lang.Character.UnicodeBlock BRAILLE_PATTERNS;
- field public static final java.lang.Character.UnicodeBlock BUGINESE;
- field public static final java.lang.Character.UnicodeBlock BUHID;
- field public static final java.lang.Character.UnicodeBlock BYZANTINE_MUSICAL_SYMBOLS;
- field public static final java.lang.Character.UnicodeBlock CARIAN;
- field public static final java.lang.Character.UnicodeBlock CHAKMA;
- field public static final java.lang.Character.UnicodeBlock CHAM;
- field public static final java.lang.Character.UnicodeBlock CHEROKEE;
- field public static final java.lang.Character.UnicodeBlock CJK_COMPATIBILITY;
- field public static final java.lang.Character.UnicodeBlock CJK_COMPATIBILITY_FORMS;
- field public static final java.lang.Character.UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS;
- field public static final java.lang.Character.UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT;
- field public static final java.lang.Character.UnicodeBlock CJK_RADICALS_SUPPLEMENT;
- field public static final java.lang.Character.UnicodeBlock CJK_STROKES;
- field public static final java.lang.Character.UnicodeBlock CJK_SYMBOLS_AND_PUNCTUATION;
- field public static final java.lang.Character.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS;
- field public static final java.lang.Character.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A;
- field public static final java.lang.Character.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B;
- field public static final java.lang.Character.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C;
- field public static final java.lang.Character.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D;
- field public static final java.lang.Character.UnicodeBlock COMBINING_DIACRITICAL_MARKS;
- field public static final java.lang.Character.UnicodeBlock COMBINING_DIACRITICAL_MARKS_SUPPLEMENT;
- field public static final java.lang.Character.UnicodeBlock COMBINING_HALF_MARKS;
- field public static final java.lang.Character.UnicodeBlock COMBINING_MARKS_FOR_SYMBOLS;
- field public static final java.lang.Character.UnicodeBlock COMMON_INDIC_NUMBER_FORMS;
- field public static final java.lang.Character.UnicodeBlock CONTROL_PICTURES;
- field public static final java.lang.Character.UnicodeBlock COPTIC;
- field public static final java.lang.Character.UnicodeBlock COUNTING_ROD_NUMERALS;
- field public static final java.lang.Character.UnicodeBlock CUNEIFORM;
- field public static final java.lang.Character.UnicodeBlock CUNEIFORM_NUMBERS_AND_PUNCTUATION;
- field public static final java.lang.Character.UnicodeBlock CURRENCY_SYMBOLS;
- field public static final java.lang.Character.UnicodeBlock CYPRIOT_SYLLABARY;
- field public static final java.lang.Character.UnicodeBlock CYRILLIC;
- field public static final java.lang.Character.UnicodeBlock CYRILLIC_EXTENDED_A;
- field public static final java.lang.Character.UnicodeBlock CYRILLIC_EXTENDED_B;
- field public static final java.lang.Character.UnicodeBlock CYRILLIC_SUPPLEMENTARY;
- field public static final java.lang.Character.UnicodeBlock DESERET;
- field public static final java.lang.Character.UnicodeBlock DEVANAGARI;
- field public static final java.lang.Character.UnicodeBlock DEVANAGARI_EXTENDED;
- field public static final java.lang.Character.UnicodeBlock DINGBATS;
- field public static final java.lang.Character.UnicodeBlock DOMINO_TILES;
- field public static final java.lang.Character.UnicodeBlock EGYPTIAN_HIEROGLYPHS;
- field public static final java.lang.Character.UnicodeBlock EMOTICONS;
- field public static final java.lang.Character.UnicodeBlock ENCLOSED_ALPHANUMERICS;
- field public static final java.lang.Character.UnicodeBlock ENCLOSED_ALPHANUMERIC_SUPPLEMENT;
- field public static final java.lang.Character.UnicodeBlock ENCLOSED_CJK_LETTERS_AND_MONTHS;
- field public static final java.lang.Character.UnicodeBlock ENCLOSED_IDEOGRAPHIC_SUPPLEMENT;
- field public static final java.lang.Character.UnicodeBlock ETHIOPIC;
- field public static final java.lang.Character.UnicodeBlock ETHIOPIC_EXTENDED;
- field public static final java.lang.Character.UnicodeBlock ETHIOPIC_EXTENDED_A;
- field public static final java.lang.Character.UnicodeBlock ETHIOPIC_SUPPLEMENT;
- field public static final java.lang.Character.UnicodeBlock GENERAL_PUNCTUATION;
- field public static final java.lang.Character.UnicodeBlock GEOMETRIC_SHAPES;
- field public static final java.lang.Character.UnicodeBlock GEORGIAN;
- field public static final java.lang.Character.UnicodeBlock GEORGIAN_SUPPLEMENT;
- field public static final java.lang.Character.UnicodeBlock GLAGOLITIC;
- field public static final java.lang.Character.UnicodeBlock GOTHIC;
- field public static final java.lang.Character.UnicodeBlock GREEK;
- field public static final java.lang.Character.UnicodeBlock GREEK_EXTENDED;
- field public static final java.lang.Character.UnicodeBlock GUJARATI;
- field public static final java.lang.Character.UnicodeBlock GURMUKHI;
- field public static final java.lang.Character.UnicodeBlock HALFWIDTH_AND_FULLWIDTH_FORMS;
- field public static final java.lang.Character.UnicodeBlock HANGUL_COMPATIBILITY_JAMO;
- field public static final java.lang.Character.UnicodeBlock HANGUL_JAMO;
- field public static final java.lang.Character.UnicodeBlock HANGUL_JAMO_EXTENDED_A;
- field public static final java.lang.Character.UnicodeBlock HANGUL_JAMO_EXTENDED_B;
- field public static final java.lang.Character.UnicodeBlock HANGUL_SYLLABLES;
- field public static final java.lang.Character.UnicodeBlock HANUNOO;
- field public static final java.lang.Character.UnicodeBlock HEBREW;
- field public static final java.lang.Character.UnicodeBlock HIGH_PRIVATE_USE_SURROGATES;
- field public static final java.lang.Character.UnicodeBlock HIGH_SURROGATES;
- field public static final java.lang.Character.UnicodeBlock HIRAGANA;
- field public static final java.lang.Character.UnicodeBlock IDEOGRAPHIC_DESCRIPTION_CHARACTERS;
- field public static final java.lang.Character.UnicodeBlock IMPERIAL_ARAMAIC;
- field public static final java.lang.Character.UnicodeBlock INSCRIPTIONAL_PAHLAVI;
- field public static final java.lang.Character.UnicodeBlock INSCRIPTIONAL_PARTHIAN;
- field public static final java.lang.Character.UnicodeBlock IPA_EXTENSIONS;
- field public static final java.lang.Character.UnicodeBlock JAVANESE;
- field public static final java.lang.Character.UnicodeBlock KAITHI;
- field public static final java.lang.Character.UnicodeBlock KANA_SUPPLEMENT;
- field public static final java.lang.Character.UnicodeBlock KANBUN;
- field public static final java.lang.Character.UnicodeBlock KANGXI_RADICALS;
- field public static final java.lang.Character.UnicodeBlock KANNADA;
- field public static final java.lang.Character.UnicodeBlock KATAKANA;
- field public static final java.lang.Character.UnicodeBlock KATAKANA_PHONETIC_EXTENSIONS;
- field public static final java.lang.Character.UnicodeBlock KAYAH_LI;
- field public static final java.lang.Character.UnicodeBlock KHAROSHTHI;
- field public static final java.lang.Character.UnicodeBlock KHMER;
- field public static final java.lang.Character.UnicodeBlock KHMER_SYMBOLS;
- field public static final java.lang.Character.UnicodeBlock LAO;
- field public static final java.lang.Character.UnicodeBlock LATIN_1_SUPPLEMENT;
- field public static final java.lang.Character.UnicodeBlock LATIN_EXTENDED_A;
- field public static final java.lang.Character.UnicodeBlock LATIN_EXTENDED_ADDITIONAL;
- field public static final java.lang.Character.UnicodeBlock LATIN_EXTENDED_B;
- field public static final java.lang.Character.UnicodeBlock LATIN_EXTENDED_C;
- field public static final java.lang.Character.UnicodeBlock LATIN_EXTENDED_D;
- field public static final java.lang.Character.UnicodeBlock LEPCHA;
- field public static final java.lang.Character.UnicodeBlock LETTERLIKE_SYMBOLS;
- field public static final java.lang.Character.UnicodeBlock LIMBU;
- field public static final java.lang.Character.UnicodeBlock LINEAR_B_IDEOGRAMS;
- field public static final java.lang.Character.UnicodeBlock LINEAR_B_SYLLABARY;
- field public static final java.lang.Character.UnicodeBlock LISU;
- field public static final java.lang.Character.UnicodeBlock LOW_SURROGATES;
- field public static final java.lang.Character.UnicodeBlock LYCIAN;
- field public static final java.lang.Character.UnicodeBlock LYDIAN;
- field public static final java.lang.Character.UnicodeBlock MAHJONG_TILES;
- field public static final java.lang.Character.UnicodeBlock MALAYALAM;
- field public static final java.lang.Character.UnicodeBlock MANDAIC;
- field public static final java.lang.Character.UnicodeBlock MATHEMATICAL_ALPHANUMERIC_SYMBOLS;
- field public static final java.lang.Character.UnicodeBlock MATHEMATICAL_OPERATORS;
- field public static final java.lang.Character.UnicodeBlock MEETEI_MAYEK;
- field public static final java.lang.Character.UnicodeBlock MEETEI_MAYEK_EXTENSIONS;
- field public static final java.lang.Character.UnicodeBlock MEROITIC_CURSIVE;
- field public static final java.lang.Character.UnicodeBlock MEROITIC_HIEROGLYPHS;
- field public static final java.lang.Character.UnicodeBlock MIAO;
- field public static final java.lang.Character.UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A;
- field public static final java.lang.Character.UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B;
- field public static final java.lang.Character.UnicodeBlock MISCELLANEOUS_SYMBOLS;
- field public static final java.lang.Character.UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_ARROWS;
- field public static final java.lang.Character.UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS;
- field public static final java.lang.Character.UnicodeBlock MISCELLANEOUS_TECHNICAL;
- field public static final java.lang.Character.UnicodeBlock MODIFIER_TONE_LETTERS;
- field public static final java.lang.Character.UnicodeBlock MONGOLIAN;
- field public static final java.lang.Character.UnicodeBlock MUSICAL_SYMBOLS;
- field public static final java.lang.Character.UnicodeBlock MYANMAR;
- field public static final java.lang.Character.UnicodeBlock MYANMAR_EXTENDED_A;
- field public static final java.lang.Character.UnicodeBlock NEW_TAI_LUE;
- field public static final java.lang.Character.UnicodeBlock NKO;
- field public static final java.lang.Character.UnicodeBlock NUMBER_FORMS;
- field public static final java.lang.Character.UnicodeBlock OGHAM;
- field public static final java.lang.Character.UnicodeBlock OLD_ITALIC;
- field public static final java.lang.Character.UnicodeBlock OLD_PERSIAN;
- field public static final java.lang.Character.UnicodeBlock OLD_SOUTH_ARABIAN;
- field public static final java.lang.Character.UnicodeBlock OLD_TURKIC;
- field public static final java.lang.Character.UnicodeBlock OL_CHIKI;
- field public static final java.lang.Character.UnicodeBlock OPTICAL_CHARACTER_RECOGNITION;
- field public static final java.lang.Character.UnicodeBlock ORIYA;
- field public static final java.lang.Character.UnicodeBlock OSMANYA;
- field public static final java.lang.Character.UnicodeBlock PHAGS_PA;
- field public static final java.lang.Character.UnicodeBlock PHAISTOS_DISC;
- field public static final java.lang.Character.UnicodeBlock PHOENICIAN;
- field public static final java.lang.Character.UnicodeBlock PHONETIC_EXTENSIONS;
- field public static final java.lang.Character.UnicodeBlock PHONETIC_EXTENSIONS_SUPPLEMENT;
- field public static final java.lang.Character.UnicodeBlock PLAYING_CARDS;
- field public static final java.lang.Character.UnicodeBlock PRIVATE_USE_AREA;
- field public static final java.lang.Character.UnicodeBlock REJANG;
- field public static final java.lang.Character.UnicodeBlock RUMI_NUMERAL_SYMBOLS;
- field public static final java.lang.Character.UnicodeBlock RUNIC;
- field public static final java.lang.Character.UnicodeBlock SAMARITAN;
- field public static final java.lang.Character.UnicodeBlock SAURASHTRA;
- field public static final java.lang.Character.UnicodeBlock SHARADA;
- field public static final java.lang.Character.UnicodeBlock SHAVIAN;
- field public static final java.lang.Character.UnicodeBlock SINHALA;
- field public static final java.lang.Character.UnicodeBlock SMALL_FORM_VARIANTS;
- field public static final java.lang.Character.UnicodeBlock SORA_SOMPENG;
- field public static final java.lang.Character.UnicodeBlock SPACING_MODIFIER_LETTERS;
- field public static final java.lang.Character.UnicodeBlock SPECIALS;
- field public static final java.lang.Character.UnicodeBlock SUNDANESE;
- field public static final java.lang.Character.UnicodeBlock SUNDANESE_SUPPLEMENT;
- field public static final java.lang.Character.UnicodeBlock SUPERSCRIPTS_AND_SUBSCRIPTS;
- field public static final java.lang.Character.UnicodeBlock SUPPLEMENTAL_ARROWS_A;
- field public static final java.lang.Character.UnicodeBlock SUPPLEMENTAL_ARROWS_B;
- field public static final java.lang.Character.UnicodeBlock SUPPLEMENTAL_MATHEMATICAL_OPERATORS;
- field public static final java.lang.Character.UnicodeBlock SUPPLEMENTAL_PUNCTUATION;
- field public static final java.lang.Character.UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_A;
- field public static final java.lang.Character.UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_B;
- field @Deprecated public static final java.lang.Character.UnicodeBlock SURROGATES_AREA;
- field public static final java.lang.Character.UnicodeBlock SYLOTI_NAGRI;
- field public static final java.lang.Character.UnicodeBlock SYRIAC;
- field public static final java.lang.Character.UnicodeBlock TAGALOG;
- field public static final java.lang.Character.UnicodeBlock TAGBANWA;
- field public static final java.lang.Character.UnicodeBlock TAGS;
- field public static final java.lang.Character.UnicodeBlock TAI_LE;
- field public static final java.lang.Character.UnicodeBlock TAI_THAM;
- field public static final java.lang.Character.UnicodeBlock TAI_VIET;
- field public static final java.lang.Character.UnicodeBlock TAI_XUAN_JING_SYMBOLS;
- field public static final java.lang.Character.UnicodeBlock TAKRI;
- field public static final java.lang.Character.UnicodeBlock TAMIL;
- field public static final java.lang.Character.UnicodeBlock TELUGU;
- field public static final java.lang.Character.UnicodeBlock THAANA;
- field public static final java.lang.Character.UnicodeBlock THAI;
- field public static final java.lang.Character.UnicodeBlock TIBETAN;
- field public static final java.lang.Character.UnicodeBlock TIFINAGH;
- field public static final java.lang.Character.UnicodeBlock TRANSPORT_AND_MAP_SYMBOLS;
- field public static final java.lang.Character.UnicodeBlock UGARITIC;
- field public static final java.lang.Character.UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS;
- field public static final java.lang.Character.UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED;
- field public static final java.lang.Character.UnicodeBlock VAI;
- field public static final java.lang.Character.UnicodeBlock VARIATION_SELECTORS;
- field public static final java.lang.Character.UnicodeBlock VARIATION_SELECTORS_SUPPLEMENT;
- field public static final java.lang.Character.UnicodeBlock VEDIC_EXTENSIONS;
- field public static final java.lang.Character.UnicodeBlock VERTICAL_FORMS;
- field public static final java.lang.Character.UnicodeBlock YIJING_HEXAGRAM_SYMBOLS;
- field public static final java.lang.Character.UnicodeBlock YI_RADICALS;
- field public static final java.lang.Character.UnicodeBlock YI_SYLLABLES;
- }
-
- public enum Character.UnicodeScript {
- method @NonNull public static java.lang.Character.UnicodeScript forName(@NonNull String);
- method @NonNull public static java.lang.Character.UnicodeScript of(int);
- enum_constant public static final java.lang.Character.UnicodeScript ARABIC;
- enum_constant public static final java.lang.Character.UnicodeScript ARMENIAN;
- enum_constant public static final java.lang.Character.UnicodeScript AVESTAN;
- enum_constant public static final java.lang.Character.UnicodeScript BALINESE;
- enum_constant public static final java.lang.Character.UnicodeScript BAMUM;
- enum_constant public static final java.lang.Character.UnicodeScript BATAK;
- enum_constant public static final java.lang.Character.UnicodeScript BENGALI;
- enum_constant public static final java.lang.Character.UnicodeScript BOPOMOFO;
- enum_constant public static final java.lang.Character.UnicodeScript BRAHMI;
- enum_constant public static final java.lang.Character.UnicodeScript BRAILLE;
- enum_constant public static final java.lang.Character.UnicodeScript BUGINESE;
- enum_constant public static final java.lang.Character.UnicodeScript BUHID;
- enum_constant public static final java.lang.Character.UnicodeScript CANADIAN_ABORIGINAL;
- enum_constant public static final java.lang.Character.UnicodeScript CARIAN;
- enum_constant public static final java.lang.Character.UnicodeScript CHAKMA;
- enum_constant public static final java.lang.Character.UnicodeScript CHAM;
- enum_constant public static final java.lang.Character.UnicodeScript CHEROKEE;
- enum_constant public static final java.lang.Character.UnicodeScript COMMON;
- enum_constant public static final java.lang.Character.UnicodeScript COPTIC;
- enum_constant public static final java.lang.Character.UnicodeScript CUNEIFORM;
- enum_constant public static final java.lang.Character.UnicodeScript CYPRIOT;
- enum_constant public static final java.lang.Character.UnicodeScript CYRILLIC;
- enum_constant public static final java.lang.Character.UnicodeScript DESERET;
- enum_constant public static final java.lang.Character.UnicodeScript DEVANAGARI;
- enum_constant public static final java.lang.Character.UnicodeScript EGYPTIAN_HIEROGLYPHS;
- enum_constant public static final java.lang.Character.UnicodeScript ETHIOPIC;
- enum_constant public static final java.lang.Character.UnicodeScript GEORGIAN;
- enum_constant public static final java.lang.Character.UnicodeScript GLAGOLITIC;
- enum_constant public static final java.lang.Character.UnicodeScript GOTHIC;
- enum_constant public static final java.lang.Character.UnicodeScript GREEK;
- enum_constant public static final java.lang.Character.UnicodeScript GUJARATI;
- enum_constant public static final java.lang.Character.UnicodeScript GURMUKHI;
- enum_constant public static final java.lang.Character.UnicodeScript HAN;
- enum_constant public static final java.lang.Character.UnicodeScript HANGUL;
- enum_constant public static final java.lang.Character.UnicodeScript HANUNOO;
- enum_constant public static final java.lang.Character.UnicodeScript HEBREW;
- enum_constant public static final java.lang.Character.UnicodeScript HIRAGANA;
- enum_constant public static final java.lang.Character.UnicodeScript IMPERIAL_ARAMAIC;
- enum_constant public static final java.lang.Character.UnicodeScript INHERITED;
- enum_constant public static final java.lang.Character.UnicodeScript INSCRIPTIONAL_PAHLAVI;
- enum_constant public static final java.lang.Character.UnicodeScript INSCRIPTIONAL_PARTHIAN;
- enum_constant public static final java.lang.Character.UnicodeScript JAVANESE;
- enum_constant public static final java.lang.Character.UnicodeScript KAITHI;
- enum_constant public static final java.lang.Character.UnicodeScript KANNADA;
- enum_constant public static final java.lang.Character.UnicodeScript KATAKANA;
- enum_constant public static final java.lang.Character.UnicodeScript KAYAH_LI;
- enum_constant public static final java.lang.Character.UnicodeScript KHAROSHTHI;
- enum_constant public static final java.lang.Character.UnicodeScript KHMER;
- enum_constant public static final java.lang.Character.UnicodeScript LAO;
- enum_constant public static final java.lang.Character.UnicodeScript LATIN;
- enum_constant public static final java.lang.Character.UnicodeScript LEPCHA;
- enum_constant public static final java.lang.Character.UnicodeScript LIMBU;
- enum_constant public static final java.lang.Character.UnicodeScript LINEAR_B;
- enum_constant public static final java.lang.Character.UnicodeScript LISU;
- enum_constant public static final java.lang.Character.UnicodeScript LYCIAN;
- enum_constant public static final java.lang.Character.UnicodeScript LYDIAN;
- enum_constant public static final java.lang.Character.UnicodeScript MALAYALAM;
- enum_constant public static final java.lang.Character.UnicodeScript MANDAIC;
- enum_constant public static final java.lang.Character.UnicodeScript MEETEI_MAYEK;
- enum_constant public static final java.lang.Character.UnicodeScript MEROITIC_CURSIVE;
- enum_constant public static final java.lang.Character.UnicodeScript MEROITIC_HIEROGLYPHS;
- enum_constant public static final java.lang.Character.UnicodeScript MIAO;
- enum_constant public static final java.lang.Character.UnicodeScript MONGOLIAN;
- enum_constant public static final java.lang.Character.UnicodeScript MYANMAR;
- enum_constant public static final java.lang.Character.UnicodeScript NEW_TAI_LUE;
- enum_constant public static final java.lang.Character.UnicodeScript NKO;
- enum_constant public static final java.lang.Character.UnicodeScript OGHAM;
- enum_constant public static final java.lang.Character.UnicodeScript OLD_ITALIC;
- enum_constant public static final java.lang.Character.UnicodeScript OLD_PERSIAN;
- enum_constant public static final java.lang.Character.UnicodeScript OLD_SOUTH_ARABIAN;
- enum_constant public static final java.lang.Character.UnicodeScript OLD_TURKIC;
- enum_constant public static final java.lang.Character.UnicodeScript OL_CHIKI;
- enum_constant public static final java.lang.Character.UnicodeScript ORIYA;
- enum_constant public static final java.lang.Character.UnicodeScript OSMANYA;
- enum_constant public static final java.lang.Character.UnicodeScript PHAGS_PA;
- enum_constant public static final java.lang.Character.UnicodeScript PHOENICIAN;
- enum_constant public static final java.lang.Character.UnicodeScript REJANG;
- enum_constant public static final java.lang.Character.UnicodeScript RUNIC;
- enum_constant public static final java.lang.Character.UnicodeScript SAMARITAN;
- enum_constant public static final java.lang.Character.UnicodeScript SAURASHTRA;
- enum_constant public static final java.lang.Character.UnicodeScript SHARADA;
- enum_constant public static final java.lang.Character.UnicodeScript SHAVIAN;
- enum_constant public static final java.lang.Character.UnicodeScript SINHALA;
- enum_constant public static final java.lang.Character.UnicodeScript SORA_SOMPENG;
- enum_constant public static final java.lang.Character.UnicodeScript SUNDANESE;
- enum_constant public static final java.lang.Character.UnicodeScript SYLOTI_NAGRI;
- enum_constant public static final java.lang.Character.UnicodeScript SYRIAC;
- enum_constant public static final java.lang.Character.UnicodeScript TAGALOG;
- enum_constant public static final java.lang.Character.UnicodeScript TAGBANWA;
- enum_constant public static final java.lang.Character.UnicodeScript TAI_LE;
- enum_constant public static final java.lang.Character.UnicodeScript TAI_THAM;
- enum_constant public static final java.lang.Character.UnicodeScript TAI_VIET;
- enum_constant public static final java.lang.Character.UnicodeScript TAKRI;
- enum_constant public static final java.lang.Character.UnicodeScript TAMIL;
- enum_constant public static final java.lang.Character.UnicodeScript TELUGU;
- enum_constant public static final java.lang.Character.UnicodeScript THAANA;
- enum_constant public static final java.lang.Character.UnicodeScript THAI;
- enum_constant public static final java.lang.Character.UnicodeScript TIBETAN;
- enum_constant public static final java.lang.Character.UnicodeScript TIFINAGH;
- enum_constant public static final java.lang.Character.UnicodeScript UGARITIC;
- enum_constant public static final java.lang.Character.UnicodeScript UNKNOWN;
- enum_constant public static final java.lang.Character.UnicodeScript VAI;
- enum_constant public static final java.lang.Character.UnicodeScript YI;
- }
-
- public final class Class<T> implements java.lang.reflect.AnnotatedElement java.lang.reflect.GenericDeclaration java.io.Serializable java.lang.reflect.Type {
- method @NonNull public <U> Class<? extends U> asSubclass(@NonNull Class<U>);
- method @Nullable public T cast(@Nullable Object);
- method public boolean desiredAssertionStatus();
- method @NonNull public static Class<?> forName(@NonNull String) throws java.lang.ClassNotFoundException;
- method @NonNull public static Class<?> forName(@NonNull String, boolean, @Nullable ClassLoader) throws java.lang.ClassNotFoundException;
- method @Nullable public <A extends java.lang.annotation.Annotation> A getAnnotation(@NonNull Class<A>);
- method @NonNull public java.lang.annotation.Annotation[] getAnnotations();
- method @NonNull public <A extends java.lang.annotation.Annotation> A[] getAnnotationsByType(@NonNull Class<A>);
- method @Nullable public String getCanonicalName();
- method @Nullable public ClassLoader getClassLoader();
- method @NonNull public Class<?>[] getClasses();
- method @Nullable public Class<?> getComponentType();
- method @NonNull public java.lang.reflect.Constructor<T> getConstructor(@Nullable Class<?>...) throws java.lang.NoSuchMethodException, java.lang.SecurityException;
- method @NonNull public java.lang.reflect.Constructor<?>[] getConstructors() throws java.lang.SecurityException;
- method @Nullable public <A extends java.lang.annotation.Annotation> A getDeclaredAnnotation(@NonNull Class<A>);
- method @NonNull public java.lang.annotation.Annotation[] getDeclaredAnnotations();
- method @NonNull public Class<?>[] getDeclaredClasses();
- method @NonNull public java.lang.reflect.Constructor<T> getDeclaredConstructor(@Nullable Class<?>...) throws java.lang.NoSuchMethodException, java.lang.SecurityException;
- method @NonNull public java.lang.reflect.Constructor<?>[] getDeclaredConstructors() throws java.lang.SecurityException;
- method @NonNull public java.lang.reflect.Field getDeclaredField(@NonNull String) throws java.lang.NoSuchFieldException;
- method @NonNull public java.lang.reflect.Field[] getDeclaredFields();
- method @NonNull public java.lang.reflect.Method getDeclaredMethod(@NonNull String, @Nullable Class<?>...) throws java.lang.NoSuchMethodException, java.lang.SecurityException;
- method @NonNull public java.lang.reflect.Method[] getDeclaredMethods() throws java.lang.SecurityException;
- method @Nullable public Class<?> getDeclaringClass();
- method @Nullable public Class<?> getEnclosingClass();
- method @Nullable public java.lang.reflect.Constructor<?> getEnclosingConstructor();
- method @Nullable public java.lang.reflect.Method getEnclosingMethod();
- method @Nullable public T[] getEnumConstants();
- method @NonNull public java.lang.reflect.Field getField(@NonNull String) throws java.lang.NoSuchFieldException;
- method @NonNull public java.lang.reflect.Field[] getFields() throws java.lang.SecurityException;
- method @NonNull public java.lang.reflect.Type[] getGenericInterfaces();
- method @Nullable public java.lang.reflect.Type getGenericSuperclass();
- method @NonNull public Class<?>[] getInterfaces();
- method @NonNull public java.lang.reflect.Method getMethod(@NonNull String, @Nullable Class<?>...) throws java.lang.NoSuchMethodException, java.lang.SecurityException;
- method @NonNull public java.lang.reflect.Method[] getMethods() throws java.lang.SecurityException;
- method public int getModifiers();
- method @NonNull public String getName();
- method @Nullable public Package getPackage();
- method @NonNull public String getPackageName();
- method @Nullable public java.security.ProtectionDomain getProtectionDomain();
- method @Nullable public java.net.URL getResource(@NonNull String);
- method @Nullable public java.io.InputStream getResourceAsStream(@NonNull String);
- method @Nullable public Object[] getSigners();
- method @NonNull public String getSimpleName();
- method @Nullable public Class<? super T> getSuperclass();
- method @NonNull public java.lang.reflect.TypeVariable<java.lang.Class<T>>[] getTypeParameters();
- method public boolean isAnnotation();
- method public boolean isAnonymousClass();
- method public boolean isArray();
- method public boolean isAssignableFrom(@NonNull Class<?>);
- method public boolean isEnum();
- method public boolean isInstance(@Nullable Object);
- method public boolean isInterface();
- method public boolean isLocalClass();
- method public boolean isMemberClass();
- method public boolean isPrimitive();
- method public boolean isSynthetic();
- method @NonNull public T newInstance() throws java.lang.IllegalAccessException, java.lang.InstantiationException;
- method @NonNull public String toGenericString();
- }
-
- public class ClassCastException extends java.lang.RuntimeException {
- ctor public ClassCastException();
- ctor public ClassCastException(String);
- }
-
- public class ClassCircularityError extends java.lang.LinkageError {
- ctor public ClassCircularityError();
- ctor public ClassCircularityError(String);
- }
-
- public class ClassFormatError extends java.lang.LinkageError {
- ctor public ClassFormatError();
- ctor public ClassFormatError(String);
- }
-
- public abstract class ClassLoader {
- ctor protected ClassLoader(ClassLoader);
- ctor protected ClassLoader();
- method public void clearAssertionStatus();
- method @Deprecated protected final Class<?> defineClass(byte[], int, int) throws java.lang.ClassFormatError;
- method protected final Class<?> defineClass(String, byte[], int, int) throws java.lang.ClassFormatError;
- method protected final Class<?> defineClass(String, byte[], int, int, java.security.ProtectionDomain) throws java.lang.ClassFormatError;
- method protected final Class<?> defineClass(String, java.nio.ByteBuffer, java.security.ProtectionDomain) throws java.lang.ClassFormatError;
- method protected Package definePackage(String, String, String, String, String, String, String, java.net.URL) throws java.lang.IllegalArgumentException;
- method protected Class<?> findClass(String) throws java.lang.ClassNotFoundException;
- method protected String findLibrary(String);
- method protected final Class<?> findLoadedClass(String);
- method protected java.net.URL findResource(String);
- method protected java.util.Enumeration<java.net.URL> findResources(String) throws java.io.IOException;
- method protected final Class<?> findSystemClass(String) throws java.lang.ClassNotFoundException;
- method protected Package getPackage(String);
- method protected Package[] getPackages();
- method public final ClassLoader getParent();
- method public java.net.URL getResource(String);
- method public java.io.InputStream getResourceAsStream(String);
- method public java.util.Enumeration<java.net.URL> getResources(String) throws java.io.IOException;
- method public static ClassLoader getSystemClassLoader();
- method public static java.net.URL getSystemResource(String);
- method public static java.io.InputStream getSystemResourceAsStream(String);
- method public static java.util.Enumeration<java.net.URL> getSystemResources(String) throws java.io.IOException;
- method public Class<?> loadClass(String) throws java.lang.ClassNotFoundException;
- method protected Class<?> loadClass(String, boolean) throws java.lang.ClassNotFoundException;
- method protected static boolean registerAsParallelCapable();
- method protected final void resolveClass(Class<?>);
- method public void setClassAssertionStatus(String, boolean);
- method public void setDefaultAssertionStatus(boolean);
- method public void setPackageAssertionStatus(String, boolean);
- method protected final void setSigners(Class<?>, Object[]);
- }
-
- public class ClassNotFoundException extends java.lang.ReflectiveOperationException {
- ctor public ClassNotFoundException();
- ctor public ClassNotFoundException(String);
- ctor public ClassNotFoundException(String, Throwable);
- method public Throwable getException();
- }
-
- public class CloneNotSupportedException extends java.lang.Exception {
- ctor public CloneNotSupportedException();
- ctor public CloneNotSupportedException(String);
- }
-
- public interface Cloneable {
- }
-
- public interface Comparable<T> {
- method public int compareTo(T);
- }
-
- public final class Compiler {
- method public static Object command(Object);
- method public static boolean compileClass(Class<?>);
- method public static boolean compileClasses(String);
- method public static void disable();
- method public static void enable();
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PACKAGE, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.TYPE}) public @interface Deprecated {
- }
-
- public final class Double extends java.lang.Number implements java.lang.Comparable<java.lang.Double> {
- ctor public Double(double);
- ctor public Double(@NonNull String) throws java.lang.NumberFormatException;
- method public static int compare(double, double);
- method public int compareTo(@NonNull Double);
- method public static long doubleToLongBits(double);
- method public static long doubleToRawLongBits(double);
- method public double doubleValue();
- method public float floatValue();
- method public static int hashCode(double);
- method public int intValue();
- method public static boolean isFinite(double);
- method public static boolean isInfinite(double);
- method public boolean isInfinite();
- method public static boolean isNaN(double);
- method public boolean isNaN();
- method public static double longBitsToDouble(long);
- method public long longValue();
- method public static double max(double, double);
- method public static double min(double, double);
- method public static double parseDouble(@NonNull String) throws java.lang.NumberFormatException;
- method public static double sum(double, double);
- method @NonNull public static String toHexString(double);
- method @NonNull public static String toString(double);
- method @NonNull public static Double valueOf(@NonNull String) throws java.lang.NumberFormatException;
- method @NonNull public static Double valueOf(double);
- field public static final int BYTES = 8; // 0x8
- field public static final int MAX_EXPONENT = 1023; // 0x3ff
- field public static final double MAX_VALUE = 1.7976931348623157E308;
- field public static final int MIN_EXPONENT = -1022; // 0xfffffc02
- field public static final double MIN_NORMAL = 2.2250738585072014E-308;
- field public static final double MIN_VALUE = 4.9E-324;
- field public static final double NEGATIVE_INFINITY = (-1.0/0.0);
- field public static final double NaN = (0.0/0.0);
- field public static final double POSITIVE_INFINITY = (1.0/0.0);
- field public static final int SIZE = 64; // 0x40
- field public static final Class<java.lang.Double> TYPE;
- }
-
- public abstract class Enum<E extends java.lang.Enum<E>> implements java.lang.Comparable<E> java.io.Serializable {
- ctor protected Enum(@NonNull String, int);
- method @NonNull protected final Object clone() throws java.lang.CloneNotSupportedException;
- method public final int compareTo(E);
- method public final boolean equals(@Nullable Object);
- method protected final void finalize();
- method @NonNull public final Class<E> getDeclaringClass();
- method public final int hashCode();
- method @NonNull public final String name();
- method public final int ordinal();
- method @NonNull public static <T extends java.lang.Enum<T>> T valueOf(@NonNull Class<T>, @NonNull String);
- }
-
- public class EnumConstantNotPresentException extends java.lang.RuntimeException {
- ctor public EnumConstantNotPresentException(Class<? extends java.lang.Enum>, String);
- method public String constantName();
- method public Class<? extends java.lang.Enum> enumType();
- }
-
- public class Error extends java.lang.Throwable {
- ctor public Error();
- ctor public Error(String);
- ctor public Error(String, Throwable);
- ctor public Error(Throwable);
- ctor protected Error(String, Throwable, boolean, boolean);
- }
-
- public class Exception extends java.lang.Throwable {
- ctor public Exception();
- ctor public Exception(String);
- ctor public Exception(String, Throwable);
- ctor public Exception(Throwable);
- ctor protected Exception(String, Throwable, boolean, boolean);
- }
-
- public class ExceptionInInitializerError extends java.lang.LinkageError {
- ctor public ExceptionInInitializerError();
- ctor public ExceptionInInitializerError(Throwable);
- ctor public ExceptionInInitializerError(String);
- method public Throwable getException();
- }
-
- public final class Float extends java.lang.Number implements java.lang.Comparable<java.lang.Float> {
- ctor public Float(float);
- ctor public Float(double);
- ctor public Float(@NonNull String) throws java.lang.NumberFormatException;
- method public static int compare(float, float);
- method public int compareTo(@NonNull Float);
- method public double doubleValue();
- method public static int floatToIntBits(float);
- method public static int floatToRawIntBits(float);
- method public float floatValue();
- method public static int hashCode(float);
- method public static float intBitsToFloat(int);
- method public int intValue();
- method public static boolean isFinite(float);
- method public static boolean isInfinite(float);
- method public boolean isInfinite();
- method public static boolean isNaN(float);
- method public boolean isNaN();
- method public long longValue();
- method public static float max(float, float);
- method public static float min(float, float);
- method public static float parseFloat(@NonNull String) throws java.lang.NumberFormatException;
- method public static float sum(float, float);
- method @NonNull public static String toHexString(float);
- method @NonNull public static String toString(float);
- method @NonNull public static Float valueOf(@NonNull String) throws java.lang.NumberFormatException;
- method @NonNull public static Float valueOf(float);
- field public static final int BYTES = 4; // 0x4
- field public static final int MAX_EXPONENT = 127; // 0x7f
- field public static final float MAX_VALUE = 3.4028235E38f;
- field public static final int MIN_EXPONENT = -126; // 0xffffff82
- field public static final float MIN_NORMAL = 1.17549435E-38f;
- field public static final float MIN_VALUE = 1.4E-45f;
- field public static final float NEGATIVE_INFINITY = (-1.0f/0.0f);
- field public static final float NaN = (0.0f/0.0f);
- field public static final float POSITIVE_INFINITY = (1.0f/0.0f);
- field public static final int SIZE = 32; // 0x20
- field public static final Class<java.lang.Float> TYPE;
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) public @interface FunctionalInterface {
- }
-
- public class IllegalAccessError extends java.lang.IncompatibleClassChangeError {
- ctor public IllegalAccessError();
- ctor public IllegalAccessError(String);
- }
-
- public class IllegalAccessException extends java.lang.ReflectiveOperationException {
- ctor public IllegalAccessException();
- ctor public IllegalAccessException(String);
- }
-
- public class IllegalArgumentException extends java.lang.RuntimeException {
- ctor public IllegalArgumentException();
- ctor public IllegalArgumentException(String);
- ctor public IllegalArgumentException(String, Throwable);
- ctor public IllegalArgumentException(Throwable);
- }
-
- public class IllegalMonitorStateException extends java.lang.RuntimeException {
- ctor public IllegalMonitorStateException();
- ctor public IllegalMonitorStateException(String);
- }
-
- public class IllegalStateException extends java.lang.RuntimeException {
- ctor public IllegalStateException();
- ctor public IllegalStateException(String);
- ctor public IllegalStateException(String, Throwable);
- ctor public IllegalStateException(Throwable);
- }
-
- public class IllegalThreadStateException extends java.lang.IllegalArgumentException {
- ctor public IllegalThreadStateException();
- ctor public IllegalThreadStateException(String);
- }
-
- public class IncompatibleClassChangeError extends java.lang.LinkageError {
- ctor public IncompatibleClassChangeError();
- ctor public IncompatibleClassChangeError(String);
- }
-
- public class IndexOutOfBoundsException extends java.lang.RuntimeException {
- ctor public IndexOutOfBoundsException();
- ctor public IndexOutOfBoundsException(String);
- }
-
- public class InheritableThreadLocal<T> extends java.lang.ThreadLocal<T> {
- ctor public InheritableThreadLocal();
- method protected T childValue(T);
- }
-
- public class InstantiationError extends java.lang.IncompatibleClassChangeError {
- ctor public InstantiationError();
- ctor public InstantiationError(String);
- }
-
- public class InstantiationException extends java.lang.ReflectiveOperationException {
- ctor public InstantiationException();
- ctor public InstantiationException(String);
- }
-
- public final class Integer extends java.lang.Number implements java.lang.Comparable<java.lang.Integer> {
- ctor public Integer(int);
- ctor public Integer(@NonNull String) throws java.lang.NumberFormatException;
- method public static int bitCount(int);
- method public static int compare(int, int);
- method public int compareTo(@NonNull Integer);
- method public static int compareUnsigned(int, int);
- method @NonNull public static Integer decode(@NonNull String) throws java.lang.NumberFormatException;
- method public static int divideUnsigned(int, int);
- method public double doubleValue();
- method public float floatValue();
- method @Nullable public static Integer getInteger(@NonNull String);
- method @Nullable public static Integer getInteger(@NonNull String, int);
- method @Nullable public static Integer getInteger(@NonNull String, @Nullable Integer);
- method public static int hashCode(int);
- method public static int highestOneBit(int);
- method public int intValue();
- method public long longValue();
- method public static int lowestOneBit(int);
- method public static int max(int, int);
- method public static int min(int, int);
- method public static int numberOfLeadingZeros(int);
- method public static int numberOfTrailingZeros(int);
- method public static int parseInt(@NonNull String, int) throws java.lang.NumberFormatException;
- method public static int parseInt(@NonNull String) throws java.lang.NumberFormatException;
- method public static int parseUnsignedInt(@NonNull String, int) throws java.lang.NumberFormatException;
- method public static int parseUnsignedInt(@NonNull String) throws java.lang.NumberFormatException;
- method public static int remainderUnsigned(int, int);
- method public static int reverse(int);
- method public static int reverseBytes(int);
- method public static int rotateLeft(int, int);
- method public static int rotateRight(int, int);
- method public static int signum(int);
- method public static int sum(int, int);
- method @NonNull public static String toBinaryString(int);
- method @NonNull public static String toHexString(int);
- method @NonNull public static String toOctalString(int);
- method @NonNull public static String toString(int, int);
- method @NonNull public static String toString(int);
- method public static long toUnsignedLong(int);
- method @NonNull public static String toUnsignedString(int, int);
- method @NonNull public static String toUnsignedString(int);
- method @NonNull public static Integer valueOf(@NonNull String, int) throws java.lang.NumberFormatException;
- method @NonNull public static Integer valueOf(@NonNull String) throws java.lang.NumberFormatException;
- method @NonNull public static Integer valueOf(int);
- field public static final int BYTES = 4; // 0x4
- field public static final int MAX_VALUE = 2147483647; // 0x7fffffff
- field public static final int MIN_VALUE = -2147483648; // 0x80000000
- field public static final int SIZE = 32; // 0x20
- field public static final Class<java.lang.Integer> TYPE;
- }
-
- public class InternalError extends java.lang.VirtualMachineError {
- ctor public InternalError();
- ctor public InternalError(String);
- ctor public InternalError(String, Throwable);
- ctor public InternalError(Throwable);
- }
-
- public class InterruptedException extends java.lang.Exception {
- ctor public InterruptedException();
- ctor public InterruptedException(String);
- }
-
- public interface Iterable<T> {
- method public default void forEach(@NonNull java.util.function.Consumer<? super T>);
- method @NonNull public java.util.Iterator<T> iterator();
- method @NonNull public default java.util.Spliterator<T> spliterator();
- }
-
- public class LinkageError extends java.lang.Error {
- ctor public LinkageError();
- ctor public LinkageError(String);
- ctor public LinkageError(String, Throwable);
- }
-
- public final class Long extends java.lang.Number implements java.lang.Comparable<java.lang.Long> {
- ctor public Long(long);
- ctor public Long(@NonNull String) throws java.lang.NumberFormatException;
- method public static int bitCount(long);
- method public static int compare(long, long);
- method public int compareTo(@NonNull Long);
- method public static int compareUnsigned(long, long);
- method @NonNull public static Long decode(@NonNull String) throws java.lang.NumberFormatException;
- method public static long divideUnsigned(long, long);
- method public double doubleValue();
- method public float floatValue();
- method @Nullable public static Long getLong(@NonNull String);
- method @Nullable public static Long getLong(@NonNull String, long);
- method @Nullable public static Long getLong(@NonNull String, @Nullable Long);
- method public static int hashCode(long);
- method public static long highestOneBit(long);
- method public int intValue();
- method public long longValue();
- method public static long lowestOneBit(long);
- method public static long max(long, long);
- method public static long min(long, long);
- method public static int numberOfLeadingZeros(long);
- method public static int numberOfTrailingZeros(long);
- method public static long parseLong(@NonNull String, int) throws java.lang.NumberFormatException;
- method public static long parseLong(@NonNull String) throws java.lang.NumberFormatException;
- method public static long parseUnsignedLong(@NonNull String, int) throws java.lang.NumberFormatException;
- method public static long parseUnsignedLong(@NonNull String) throws java.lang.NumberFormatException;
- method public static long remainderUnsigned(long, long);
- method public static long reverse(long);
- method public static long reverseBytes(long);
- method public static long rotateLeft(long, int);
- method public static long rotateRight(long, int);
- method public static int signum(long);
- method public static long sum(long, long);
- method @NonNull public static String toBinaryString(long);
- method @NonNull public static String toHexString(long);
- method @NonNull public static String toOctalString(long);
- method @NonNull public static String toString(long, int);
- method @NonNull public static String toString(long);
- method @NonNull public static String toUnsignedString(long, int);
- method @NonNull public static String toUnsignedString(long);
- method @NonNull public static Long valueOf(@NonNull String, int) throws java.lang.NumberFormatException;
- method @NonNull public static Long valueOf(@NonNull String) throws java.lang.NumberFormatException;
- method @NonNull public static Long valueOf(long);
- field public static final int BYTES = 8; // 0x8
- field public static final long MAX_VALUE = 9223372036854775807L; // 0x7fffffffffffffffL
- field public static final long MIN_VALUE = -9223372036854775808L; // 0x8000000000000000L
- field public static final int SIZE = 64; // 0x40
- field public static final Class<java.lang.Long> TYPE;
- }
-
- public final class Math {
- method public static double IEEEremainder(double, double);
- method public static int abs(int);
- method public static long abs(long);
- method public static float abs(float);
- method public static double abs(double);
- method public static double acos(double);
- method public static int addExact(int, int);
- method public static long addExact(long, long);
- method public static double asin(double);
- method public static double atan(double);
- method public static double atan2(double, double);
- method public static double cbrt(double);
- method public static double ceil(double);
- method public static double copySign(double, double);
- method public static float copySign(float, float);
- method public static double cos(double);
- method public static double cosh(double);
- method public static int decrementExact(int);
- method public static long decrementExact(long);
- method public static double exp(double);
- method public static double expm1(double);
- method public static double floor(double);
- method public static int floorDiv(int, int);
- method public static long floorDiv(long, long);
- method public static int floorMod(int, int);
- method public static long floorMod(long, long);
- method public static int getExponent(float);
- method public static int getExponent(double);
- method public static double hypot(double, double);
- method public static int incrementExact(int);
- method public static long incrementExact(long);
- method public static double log(double);
- method public static double log10(double);
- method public static double log1p(double);
- method public static int max(int, int);
- method public static long max(long, long);
- method public static float max(float, float);
- method public static double max(double, double);
- method public static int min(int, int);
- method public static long min(long, long);
- method public static float min(float, float);
- method public static double min(double, double);
- method public static int multiplyExact(int, int);
- method public static long multiplyExact(long, long);
- method public static int negateExact(int);
- method public static long negateExact(long);
- method public static double nextAfter(double, double);
- method public static float nextAfter(float, double);
- method public static double nextDown(double);
- method public static float nextDown(float);
- method public static double nextUp(double);
- method public static float nextUp(float);
- method public static double pow(double, double);
- method public static double random();
- method public static double rint(double);
- method public static int round(float);
- method public static long round(double);
- method public static double scalb(double, int);
- method public static float scalb(float, int);
- method public static double signum(double);
- method public static float signum(float);
- method public static double sin(double);
- method public static double sinh(double);
- method public static double sqrt(double);
- method public static int subtractExact(int, int);
- method public static long subtractExact(long, long);
- method public static double tan(double);
- method public static double tanh(double);
- method public static double toDegrees(double);
- method public static int toIntExact(long);
- method public static double toRadians(double);
- method public static double ulp(double);
- method public static float ulp(float);
- field public static final double E = 2.718281828459045;
- field public static final double PI = 3.141592653589793;
- }
-
- public class NegativeArraySizeException extends java.lang.RuntimeException {
- ctor public NegativeArraySizeException();
- ctor public NegativeArraySizeException(String);
- }
-
- public class NoClassDefFoundError extends java.lang.LinkageError {
- ctor public NoClassDefFoundError();
- ctor public NoClassDefFoundError(String);
- }
-
- public class NoSuchFieldError extends java.lang.IncompatibleClassChangeError {
- ctor public NoSuchFieldError();
- ctor public NoSuchFieldError(String);
- }
-
- public class NoSuchFieldException extends java.lang.ReflectiveOperationException {
- ctor public NoSuchFieldException();
- ctor public NoSuchFieldException(String);
- }
-
- public class NoSuchMethodError extends java.lang.IncompatibleClassChangeError {
- ctor public NoSuchMethodError();
- ctor public NoSuchMethodError(String);
- }
-
- public class NoSuchMethodException extends java.lang.ReflectiveOperationException {
- ctor public NoSuchMethodException();
- ctor public NoSuchMethodException(String);
- }
-
- public class NullPointerException extends java.lang.RuntimeException {
- ctor public NullPointerException();
- ctor public NullPointerException(String);
- }
-
- public abstract class Number implements java.io.Serializable {
- ctor public Number();
- method public byte byteValue();
- method public abstract double doubleValue();
- method public abstract float floatValue();
- method public abstract int intValue();
- method public abstract long longValue();
- method public short shortValue();
- }
-
- public class NumberFormatException extends java.lang.IllegalArgumentException {
- ctor public NumberFormatException();
- ctor public NumberFormatException(String);
- }
-
- public class Object {
- ctor public Object();
- method @NonNull protected Object clone() throws java.lang.CloneNotSupportedException;
- method public boolean equals(@Nullable Object);
- method protected void finalize() throws java.lang.Throwable;
- method @NonNull public final Class<?> getClass();
- method public int hashCode();
- method public final void notify();
- method public final void notifyAll();
- method @NonNull public String toString();
- method public final void wait(long) throws java.lang.InterruptedException;
- method public final void wait(long, int) throws java.lang.InterruptedException;
- method public final void wait() throws java.lang.InterruptedException;
- }
-
- public class OutOfMemoryError extends java.lang.VirtualMachineError {
- ctor public OutOfMemoryError();
- ctor public OutOfMemoryError(String);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target(java.lang.annotation.ElementType.METHOD) public @interface Override {
- }
-
- public class Package implements java.lang.reflect.AnnotatedElement {
- method public <A extends java.lang.annotation.Annotation> A getAnnotation(Class<A>);
- method public java.lang.annotation.Annotation[] getAnnotations();
- method public <A extends java.lang.annotation.Annotation> A[] getAnnotationsByType(Class<A>);
- method public <A extends java.lang.annotation.Annotation> A getDeclaredAnnotation(Class<A>);
- method public java.lang.annotation.Annotation[] getDeclaredAnnotations();
- method public <A extends java.lang.annotation.Annotation> A[] getDeclaredAnnotationsByType(Class<A>);
- method public String getImplementationTitle();
- method public String getImplementationVendor();
- method public String getImplementationVersion();
- method public String getName();
- method public static Package getPackage(String);
- method public static Package[] getPackages();
- method public String getSpecificationTitle();
- method public String getSpecificationVendor();
- method public String getSpecificationVersion();
- method public boolean isCompatibleWith(String) throws java.lang.NumberFormatException;
- method public boolean isSealed();
- method public boolean isSealed(java.net.URL);
- }
-
- public abstract class Process {
- ctor public Process();
- method public abstract void destroy();
- method public Process destroyForcibly();
- method public abstract int exitValue();
- method public abstract java.io.InputStream getErrorStream();
- method public abstract java.io.InputStream getInputStream();
- method public abstract java.io.OutputStream getOutputStream();
- method public boolean isAlive();
- method public abstract int waitFor() throws java.lang.InterruptedException;
- method public boolean waitFor(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- }
-
- public final class ProcessBuilder {
- ctor public ProcessBuilder(java.util.List<java.lang.String>);
- ctor public ProcessBuilder(java.lang.String...);
- method public ProcessBuilder command(java.util.List<java.lang.String>);
- method public ProcessBuilder command(java.lang.String...);
- method public java.util.List<java.lang.String> command();
- method public java.io.File directory();
- method public ProcessBuilder directory(java.io.File);
- method public java.util.Map<java.lang.String,java.lang.String> environment();
- method public ProcessBuilder inheritIO();
- method public ProcessBuilder redirectError(java.lang.ProcessBuilder.Redirect);
- method public ProcessBuilder redirectError(java.io.File);
- method public java.lang.ProcessBuilder.Redirect redirectError();
- method public boolean redirectErrorStream();
- method public ProcessBuilder redirectErrorStream(boolean);
- method public ProcessBuilder redirectInput(java.lang.ProcessBuilder.Redirect);
- method public ProcessBuilder redirectInput(java.io.File);
- method public java.lang.ProcessBuilder.Redirect redirectInput();
- method public ProcessBuilder redirectOutput(java.lang.ProcessBuilder.Redirect);
- method public ProcessBuilder redirectOutput(java.io.File);
- method public java.lang.ProcessBuilder.Redirect redirectOutput();
- method public Process start() throws java.io.IOException;
- }
-
- public abstract static class ProcessBuilder.Redirect {
- method public static java.lang.ProcessBuilder.Redirect appendTo(java.io.File);
- method public java.io.File file();
- method public static java.lang.ProcessBuilder.Redirect from(java.io.File);
- method public static java.lang.ProcessBuilder.Redirect to(java.io.File);
- method public abstract java.lang.ProcessBuilder.Redirect.Type type();
- field public static final java.lang.ProcessBuilder.Redirect INHERIT;
- field public static final java.lang.ProcessBuilder.Redirect PIPE;
- }
-
- public enum ProcessBuilder.Redirect.Type {
- enum_constant public static final java.lang.ProcessBuilder.Redirect.Type APPEND;
- enum_constant public static final java.lang.ProcessBuilder.Redirect.Type INHERIT;
- enum_constant public static final java.lang.ProcessBuilder.Redirect.Type PIPE;
- enum_constant public static final java.lang.ProcessBuilder.Redirect.Type READ;
- enum_constant public static final java.lang.ProcessBuilder.Redirect.Type WRITE;
- }
-
- public interface Readable {
- method public int read(java.nio.CharBuffer) throws java.io.IOException;
- }
-
- public class ReflectiveOperationException extends java.lang.Exception {
- ctor public ReflectiveOperationException();
- ctor public ReflectiveOperationException(String);
- ctor public ReflectiveOperationException(String, Throwable);
- ctor public ReflectiveOperationException(Throwable);
- }
-
- @java.lang.FunctionalInterface public interface Runnable {
- method public void run();
- }
-
- public class Runtime {
- method public void addShutdownHook(Thread);
- method public int availableProcessors();
- method public Process exec(String) throws java.io.IOException;
- method public Process exec(String, String[]) throws java.io.IOException;
- method public Process exec(String, String[], java.io.File) throws java.io.IOException;
- method public Process exec(String[]) throws java.io.IOException;
- method public Process exec(String[], String[]) throws java.io.IOException;
- method public Process exec(String[], String[], java.io.File) throws java.io.IOException;
- method public void exit(int);
- method public long freeMemory();
- method public void gc();
- method @Deprecated public java.io.InputStream getLocalizedInputStream(java.io.InputStream);
- method @Deprecated public java.io.OutputStream getLocalizedOutputStream(java.io.OutputStream);
- method public static Runtime getRuntime();
- method public void halt(int);
- method public void load(String);
- method public void loadLibrary(String);
- method public long maxMemory();
- method public boolean removeShutdownHook(Thread);
- method public void runFinalization();
- method @Deprecated public static void runFinalizersOnExit(boolean);
- method public long totalMemory();
- method public void traceInstructions(boolean);
- method public void traceMethodCalls(boolean);
- }
-
- public class RuntimeException extends java.lang.Exception {
- ctor public RuntimeException();
- ctor public RuntimeException(String);
- ctor public RuntimeException(String, Throwable);
- ctor public RuntimeException(Throwable);
- ctor protected RuntimeException(String, Throwable, boolean, boolean);
- }
-
- public final class RuntimePermission extends java.security.BasicPermission {
- ctor public RuntimePermission(String);
- ctor public RuntimePermission(String, String);
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.METHOD}) public @interface SafeVarargs {
- }
-
- public class SecurityException extends java.lang.RuntimeException {
- ctor public SecurityException();
- ctor public SecurityException(String);
- ctor public SecurityException(String, Throwable);
- ctor public SecurityException(Throwable);
- }
-
- public class SecurityManager {
- ctor public SecurityManager();
- method public void checkAccept(String, int);
- method public void checkAccess(Thread);
- method public void checkAccess(ThreadGroup);
- method public void checkAwtEventQueueAccess();
- method public void checkConnect(String, int);
- method public void checkConnect(String, int, Object);
- method public void checkCreateClassLoader();
- method public void checkDelete(String);
- method public void checkExec(String);
- method public void checkExit(int);
- method public void checkLink(String);
- method public void checkListen(int);
- method public void checkMemberAccess(Class<?>, int);
- method public void checkMulticast(java.net.InetAddress);
- method @Deprecated public void checkMulticast(java.net.InetAddress, byte);
- method public void checkPackageAccess(String);
- method public void checkPackageDefinition(String);
- method public void checkPermission(java.security.Permission);
- method public void checkPermission(java.security.Permission, Object);
- method public void checkPrintJobAccess();
- method public void checkPropertiesAccess();
- method public void checkPropertyAccess(String);
- method public void checkRead(java.io.FileDescriptor);
- method public void checkRead(String);
- method public void checkRead(String, Object);
- method public void checkSecurityAccess(String);
- method public void checkSetFactory();
- method public void checkSystemClipboardAccess();
- method public boolean checkTopLevelWindow(Object);
- method public void checkWrite(java.io.FileDescriptor);
- method public void checkWrite(String);
- method @Deprecated protected int classDepth(String);
- method @Deprecated protected int classLoaderDepth();
- method @Deprecated protected ClassLoader currentClassLoader();
- method @Deprecated protected Class<?> currentLoadedClass();
- method protected Class[] getClassContext();
- method @Deprecated public boolean getInCheck();
- method public Object getSecurityContext();
- method public ThreadGroup getThreadGroup();
- method @Deprecated protected boolean inClass(String);
- method @Deprecated protected boolean inClassLoader();
- field @Deprecated protected boolean inCheck;
- }
-
- public final class Short extends java.lang.Number implements java.lang.Comparable<java.lang.Short> {
- ctor public Short(short);
- ctor public Short(String) throws java.lang.NumberFormatException;
- method public static int compare(short, short);
- method public int compareTo(Short);
- method public static Short decode(String) throws java.lang.NumberFormatException;
- method public double doubleValue();
- method public float floatValue();
- method public static int hashCode(short);
- method public int intValue();
- method public long longValue();
- method public static short parseShort(String, int) throws java.lang.NumberFormatException;
- method public static short parseShort(String) throws java.lang.NumberFormatException;
- method public static short reverseBytes(short);
- method public static String toString(short);
- method public static int toUnsignedInt(short);
- method public static long toUnsignedLong(short);
- method public static Short valueOf(String, int) throws java.lang.NumberFormatException;
- method public static Short valueOf(String) throws java.lang.NumberFormatException;
- method public static Short valueOf(short);
- field public static final int BYTES = 2; // 0x2
- field public static final short MAX_VALUE = 32767; // 0x7fff
- field public static final short MIN_VALUE = -32768; // 0xffff8000
- field public static final int SIZE = 16; // 0x10
- field public static final Class<java.lang.Short> TYPE;
- }
-
- public class StackOverflowError extends java.lang.VirtualMachineError {
- ctor public StackOverflowError();
- ctor public StackOverflowError(String);
- }
-
- public final class StackTraceElement implements java.io.Serializable {
- ctor public StackTraceElement(String, String, String, int);
- method public String getClassName();
- method public String getFileName();
- method public int getLineNumber();
- method public String getMethodName();
- method public boolean isNativeMethod();
- }
-
- public final class StrictMath {
- method public static double IEEEremainder(double, double);
- method public static int abs(int);
- method public static long abs(long);
- method public static float abs(float);
- method public static double abs(double);
- method public static double acos(double);
- method public static int addExact(int, int);
- method public static long addExact(long, long);
- method public static double asin(double);
- method public static double atan(double);
- method public static double atan2(double, double);
- method public static double cbrt(double);
- method public static double ceil(double);
- method public static double copySign(double, double);
- method public static float copySign(float, float);
- method public static double cos(double);
- method public static double cosh(double);
- method public static double exp(double);
- method public static double expm1(double);
- method public static double floor(double);
- method public static int floorDiv(int, int);
- method public static long floorDiv(long, long);
- method public static int floorMod(int, int);
- method public static long floorMod(long, long);
- method public static int getExponent(float);
- method public static int getExponent(double);
- method public static double hypot(double, double);
- method public static double log(double);
- method public static double log10(double);
- method public static double log1p(double);
- method public static int max(int, int);
- method public static long max(long, long);
- method public static float max(float, float);
- method public static double max(double, double);
- method public static int min(int, int);
- method public static long min(long, long);
- method public static float min(float, float);
- method public static double min(double, double);
- method public static int multiplyExact(int, int);
- method public static long multiplyExact(long, long);
- method public static double nextAfter(double, double);
- method public static float nextAfter(float, double);
- method public static double nextDown(double);
- method public static float nextDown(float);
- method public static double nextUp(double);
- method public static float nextUp(float);
- method public static double pow(double, double);
- method public static double random();
- method public static double rint(double);
- method public static int round(float);
- method public static long round(double);
- method public static double scalb(double, int);
- method public static float scalb(float, int);
- method public static double signum(double);
- method public static float signum(float);
- method public static double sin(double);
- method public static double sinh(double);
- method public static double sqrt(double);
- method public static int subtractExact(int, int);
- method public static long subtractExact(long, long);
- method public static double tan(double);
- method public static double tanh(double);
- method public static double toDegrees(double);
- method public static int toIntExact(long);
- method public static double toRadians(double);
- method public static double ulp(double);
- method public static float ulp(float);
- field public static final double E = 2.718281828459045;
- field public static final double PI = 3.141592653589793;
- }
-
- public final class String implements java.lang.CharSequence java.lang.Comparable<java.lang.String> java.io.Serializable {
- ctor public String();
- ctor public String(@NonNull String);
- ctor public String(char[]);
- ctor public String(char[], int, int);
- ctor public String(int[], int, int);
- ctor @Deprecated public String(byte[], int, int, int);
- ctor @Deprecated public String(byte[], int);
- ctor public String(byte[], int, int, @NonNull String) throws java.io.UnsupportedEncodingException;
- ctor public String(byte[], int, int, @NonNull java.nio.charset.Charset);
- ctor public String(byte[], @NonNull String) throws java.io.UnsupportedEncodingException;
- ctor public String(byte[], @NonNull java.nio.charset.Charset);
- ctor public String(byte[], int, int);
- ctor public String(byte[]);
- ctor public String(@NonNull StringBuffer);
- ctor public String(@NonNull StringBuilder);
- method public char charAt(int);
- method public int codePointAt(int);
- method public int codePointBefore(int);
- method public int codePointCount(int, int);
- method public int compareTo(@NonNull String);
- method public int compareToIgnoreCase(@NonNull String);
- method @NonNull public String concat(@NonNull String);
- method public boolean contains(@NonNull CharSequence);
- method public boolean contentEquals(@NonNull StringBuffer);
- method public boolean contentEquals(@NonNull CharSequence);
- method @NonNull public static String copyValueOf(char[], int, int);
- method @NonNull public static String copyValueOf(char[]);
- method public boolean endsWith(@NonNull String);
- method public boolean equalsIgnoreCase(@Nullable String);
- method @NonNull public static String format(@NonNull String, @NonNull java.lang.Object...);
- method @NonNull public static String format(@NonNull java.util.Locale, @NonNull String, @NonNull java.lang.Object...);
- method @Deprecated public void getBytes(int, int, byte[], int);
- method public byte[] getBytes(@NonNull String) throws java.io.UnsupportedEncodingException;
- method public byte[] getBytes(@NonNull java.nio.charset.Charset);
- method public byte[] getBytes();
- method public void getChars(int, int, char[], int);
- method public int indexOf(int);
- method public int indexOf(int, int);
- method public int indexOf(@NonNull String);
- method public int indexOf(@NonNull String, int);
- method @NonNull public String intern();
- method public boolean isEmpty();
- method @NonNull public static String join(@NonNull CharSequence, @Nullable java.lang.CharSequence...);
- method @NonNull public static String join(@NonNull CharSequence, @NonNull Iterable<? extends java.lang.CharSequence>);
- method public int lastIndexOf(int);
- method public int lastIndexOf(int, int);
- method public int lastIndexOf(@NonNull String);
- method public int lastIndexOf(@NonNull String, int);
- method public int length();
- method public boolean matches(@NonNull String);
- method public int offsetByCodePoints(int, int);
- method public boolean regionMatches(int, @NonNull String, int, int);
- method public boolean regionMatches(boolean, int, @NonNull String, int, int);
- method @NonNull public String replace(char, char);
- method @NonNull public String replace(@NonNull CharSequence, @NonNull CharSequence);
- method @NonNull public String replaceAll(@NonNull String, @NonNull String);
- method @NonNull public String replaceFirst(@NonNull String, @NonNull String);
- method @NonNull public String[] split(@NonNull String, int);
- method @NonNull public String[] split(@NonNull String);
- method public boolean startsWith(@NonNull String, int);
- method public boolean startsWith(@NonNull String);
- method @NonNull public CharSequence subSequence(int, int);
- method @NonNull public String substring(int);
- method @NonNull public String substring(int, int);
- method public char[] toCharArray();
- method @NonNull public String toLowerCase(@NonNull java.util.Locale);
- method @NonNull public String toLowerCase();
- method @NonNull public String toUpperCase(@NonNull java.util.Locale);
- method @NonNull public String toUpperCase();
- method @NonNull public String trim();
- method @NonNull public static String valueOf(@Nullable Object);
- method @NonNull public static String valueOf(char[]);
- method @NonNull public static String valueOf(char[], int, int);
- method @NonNull public static String valueOf(boolean);
- method @NonNull public static String valueOf(char);
- method @NonNull public static String valueOf(int);
- method @NonNull public static String valueOf(long);
- method @NonNull public static String valueOf(float);
- method @NonNull public static String valueOf(double);
- field public static final java.util.Comparator<java.lang.String> CASE_INSENSITIVE_ORDER;
- }
-
- public final class StringBuffer implements java.lang.Appendable java.lang.CharSequence java.io.Serializable {
- ctor public StringBuffer();
- ctor public StringBuffer(int);
- ctor public StringBuffer(@NonNull String);
- ctor public StringBuffer(@NonNull CharSequence);
- method @NonNull public StringBuffer append(@Nullable Object);
- method @NonNull public StringBuffer append(@Nullable String);
- method @NonNull public StringBuffer append(@Nullable StringBuffer);
- method @NonNull public StringBuffer append(@Nullable CharSequence);
- method @NonNull public StringBuffer append(@Nullable CharSequence, int, int);
- method @NonNull public StringBuffer append(char[]);
- method @NonNull public StringBuffer append(char[], int, int);
- method @NonNull public StringBuffer append(boolean);
- method @NonNull public StringBuffer append(char);
- method @NonNull public StringBuffer append(int);
- method @NonNull public StringBuffer append(long);
- method @NonNull public StringBuffer append(float);
- method @NonNull public StringBuffer append(double);
- method @NonNull public StringBuffer appendCodePoint(int);
- method public int capacity();
- method public char charAt(int);
- method public int codePointAt(int);
- method public int codePointBefore(int);
- method public int codePointCount(int, int);
- method @NonNull public StringBuffer delete(int, int);
- method @NonNull public StringBuffer deleteCharAt(int);
- method public void ensureCapacity(int);
- method public void getChars(int, int, char[], int);
- method public int indexOf(@NonNull String);
- method public int indexOf(@NonNull String, int);
- method @NonNull public StringBuffer insert(int, char[], int, int);
- method @NonNull public StringBuffer insert(int, @Nullable Object);
- method @NonNull public StringBuffer insert(int, @Nullable String);
- method @NonNull public StringBuffer insert(int, char[]);
- method @NonNull public StringBuffer insert(int, @Nullable CharSequence);
- method @NonNull public StringBuffer insert(int, @Nullable CharSequence, int, int);
- method @NonNull public StringBuffer insert(int, boolean);
- method @NonNull public StringBuffer insert(int, char);
- method @NonNull public StringBuffer insert(int, int);
- method @NonNull public StringBuffer insert(int, long);
- method @NonNull public StringBuffer insert(int, float);
- method @NonNull public StringBuffer insert(int, double);
- method public int lastIndexOf(@NonNull String);
- method public int lastIndexOf(@NonNull String, int);
- method public int length();
- method public int offsetByCodePoints(int, int);
- method @NonNull public StringBuffer replace(int, int, @NonNull String);
- method @NonNull public StringBuffer reverse();
- method public void setCharAt(int, char);
- method public void setLength(int);
- method @NonNull public CharSequence subSequence(int, int);
- method @NonNull public String substring(int);
- method @NonNull public String substring(int, int);
- method public void trimToSize();
- }
-
- public final class StringBuilder implements java.lang.Appendable java.lang.CharSequence java.io.Serializable {
- ctor public StringBuilder();
- ctor public StringBuilder(int);
- ctor public StringBuilder(@NonNull String);
- ctor public StringBuilder(@NonNull CharSequence);
- method @NonNull public StringBuilder append(@Nullable Object);
- method @NonNull public StringBuilder append(@Nullable String);
- method @NonNull public StringBuilder append(@Nullable StringBuffer);
- method @NonNull public StringBuilder append(@Nullable CharSequence);
- method @NonNull public StringBuilder append(@Nullable CharSequence, int, int);
- method @NonNull public StringBuilder append(char[]);
- method @NonNull public StringBuilder append(char[], int, int);
- method @NonNull public StringBuilder append(boolean);
- method @NonNull public StringBuilder append(char);
- method @NonNull public StringBuilder append(int);
- method @NonNull public StringBuilder append(long);
- method @NonNull public StringBuilder append(float);
- method @NonNull public StringBuilder append(double);
- method @NonNull public StringBuilder appendCodePoint(int);
- method public int capacity();
- method public char charAt(int);
- method public int codePointAt(int);
- method public int codePointBefore(int);
- method public int codePointCount(int, int);
- method @NonNull public StringBuilder delete(int, int);
- method @NonNull public StringBuilder deleteCharAt(int);
- method public void ensureCapacity(int);
- method public void getChars(int, int, char[], int);
- method public int indexOf(@NonNull String);
- method public int indexOf(@NonNull String, int);
- method @NonNull public StringBuilder insert(int, char[], int, int);
- method @NonNull public StringBuilder insert(int, @Nullable Object);
- method @NonNull public StringBuilder insert(int, @Nullable String);
- method @NonNull public StringBuilder insert(int, char[]);
- method @NonNull public StringBuilder insert(int, @Nullable CharSequence);
- method @NonNull public StringBuilder insert(int, @Nullable CharSequence, int, int);
- method @NonNull public StringBuilder insert(int, boolean);
- method @NonNull public StringBuilder insert(int, char);
- method @NonNull public StringBuilder insert(int, int);
- method @NonNull public StringBuilder insert(int, long);
- method @NonNull public StringBuilder insert(int, float);
- method @NonNull public StringBuilder insert(int, double);
- method public int lastIndexOf(@NonNull String);
- method public int lastIndexOf(@NonNull String, int);
- method public int length();
- method public int offsetByCodePoints(int, int);
- method @NonNull public StringBuilder replace(int, int, @NonNull String);
- method @NonNull public StringBuilder reverse();
- method public void setCharAt(int, char);
- method public void setLength(int);
- method @NonNull public CharSequence subSequence(int, int);
- method @NonNull public String substring(int);
- method @NonNull public String substring(int, int);
- method public void trimToSize();
- }
-
- public class StringIndexOutOfBoundsException extends java.lang.IndexOutOfBoundsException {
- ctor public StringIndexOutOfBoundsException();
- ctor public StringIndexOutOfBoundsException(String);
- ctor public StringIndexOutOfBoundsException(int);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface SuppressWarnings {
- method public abstract String[] value();
- }
-
- public final class System {
- method public static void arraycopy(@NonNull Object, int, @NonNull Object, int, int);
- method @Nullable public static String clearProperty(@NonNull String);
- method @Nullable public static java.io.Console console();
- method public static long currentTimeMillis();
- method public static void exit(int);
- method public static void gc();
- method @NonNull public static java.util.Properties getProperties();
- method @Nullable public static String getProperty(@NonNull String);
- method @Nullable public static String getProperty(@NonNull String, @Nullable String);
- method @Nullable public static SecurityManager getSecurityManager();
- method @Nullable public static String getenv(@NonNull String);
- method @NonNull public static java.util.Map<java.lang.String,java.lang.String> getenv();
- method public static int identityHashCode(@Nullable Object);
- method @Nullable public static java.nio.channels.Channel inheritedChannel() throws java.io.IOException;
- method @NonNull public static String lineSeparator();
- method public static void load(@NonNull String);
- method public static void loadLibrary(@NonNull String);
- method @NonNull public static String mapLibraryName(@NonNull String);
- method public static long nanoTime();
- method public static void runFinalization();
- method @Deprecated public static void runFinalizersOnExit(boolean);
- method public static void setErr(@Nullable java.io.PrintStream);
- method public static void setIn(@Nullable java.io.InputStream);
- method public static void setOut(@Nullable java.io.PrintStream);
- method public static void setProperties(@Nullable java.util.Properties);
- method @Nullable public static String setProperty(@NonNull String, @Nullable String);
- method public static void setSecurityManager(@Nullable SecurityManager);
- field public static final java.io.PrintStream err;
- field public static final java.io.InputStream in;
- field public static final java.io.PrintStream out;
- }
-
- public class Thread implements java.lang.Runnable {
- ctor public Thread();
- ctor public Thread(@Nullable Runnable);
- ctor public Thread(@Nullable ThreadGroup, @Nullable Runnable);
- ctor public Thread(@NonNull String);
- ctor public Thread(@Nullable ThreadGroup, @NonNull String);
- ctor public Thread(@Nullable Runnable, @NonNull String);
- ctor public Thread(@Nullable ThreadGroup, @Nullable Runnable, @NonNull String);
- ctor public Thread(@Nullable ThreadGroup, @Nullable Runnable, @NonNull String, long);
- method public static int activeCount();
- method public final void checkAccess();
- method @Deprecated public int countStackFrames();
- method @NonNull public static Thread currentThread();
- method @Deprecated public void destroy();
- method public static void dumpStack();
- method public static int enumerate(Thread[]);
- method @NonNull public static java.util.Map<java.lang.Thread,java.lang.StackTraceElement[]> getAllStackTraces();
- method @Nullable public ClassLoader getContextClassLoader();
- method @Nullable public static java.lang.Thread.UncaughtExceptionHandler getDefaultUncaughtExceptionHandler();
- method public long getId();
- method @NonNull public final String getName();
- method public final int getPriority();
- method @NonNull public StackTraceElement[] getStackTrace();
- method @NonNull public java.lang.Thread.State getState();
- method @Nullable public final ThreadGroup getThreadGroup();
- method @Nullable public java.lang.Thread.UncaughtExceptionHandler getUncaughtExceptionHandler();
- method public static boolean holdsLock(@NonNull Object);
- method public void interrupt();
- method public static boolean interrupted();
- method public final boolean isAlive();
- method public final boolean isDaemon();
- method public boolean isInterrupted();
- method public final void join(long) throws java.lang.InterruptedException;
- method public final void join(long, int) throws java.lang.InterruptedException;
- method public final void join() throws java.lang.InterruptedException;
- method @Deprecated public final void resume();
- method public void run();
- method public void setContextClassLoader(@Nullable ClassLoader);
- method public final void setDaemon(boolean);
- method public static void setDefaultUncaughtExceptionHandler(@Nullable java.lang.Thread.UncaughtExceptionHandler);
- method public final void setName(@NonNull String);
- method public final void setPriority(int);
- method public void setUncaughtExceptionHandler(@Nullable java.lang.Thread.UncaughtExceptionHandler);
- method public static void sleep(long) throws java.lang.InterruptedException;
- method public static void sleep(long, int) throws java.lang.InterruptedException;
- method public void start();
- method @Deprecated public final void stop();
- method @Deprecated public final void stop(@Nullable Throwable);
- method @Deprecated public final void suspend();
- method public static void yield();
- field public static final int MAX_PRIORITY = 10; // 0xa
- field public static final int MIN_PRIORITY = 1; // 0x1
- field public static final int NORM_PRIORITY = 5; // 0x5
- }
-
- public enum Thread.State {
- enum_constant public static final java.lang.Thread.State BLOCKED;
- enum_constant public static final java.lang.Thread.State NEW;
- enum_constant public static final java.lang.Thread.State RUNNABLE;
- enum_constant public static final java.lang.Thread.State TERMINATED;
- enum_constant public static final java.lang.Thread.State TIMED_WAITING;
- enum_constant public static final java.lang.Thread.State WAITING;
- }
-
- @java.lang.FunctionalInterface public static interface Thread.UncaughtExceptionHandler {
- method public void uncaughtException(@NonNull Thread, @NonNull Throwable);
- }
-
- public class ThreadDeath extends java.lang.Error {
- ctor public ThreadDeath();
- }
-
- public class ThreadGroup implements java.lang.Thread.UncaughtExceptionHandler {
- ctor public ThreadGroup(String);
- ctor public ThreadGroup(ThreadGroup, String);
- method public int activeCount();
- method public int activeGroupCount();
- method @Deprecated public boolean allowThreadSuspension(boolean);
- method public final void checkAccess();
- method public final void destroy();
- method public int enumerate(Thread[]);
- method public int enumerate(Thread[], boolean);
- method public int enumerate(ThreadGroup[]);
- method public int enumerate(ThreadGroup[], boolean);
- method public final int getMaxPriority();
- method public final String getName();
- method public final ThreadGroup getParent();
- method public final void interrupt();
- method public final boolean isDaemon();
- method public boolean isDestroyed();
- method public void list();
- method public final boolean parentOf(ThreadGroup);
- method @Deprecated public final void resume();
- method public final void setDaemon(boolean);
- method public final void setMaxPriority(int);
- method @Deprecated public final void stop();
- method @Deprecated public final void suspend();
- method public void uncaughtException(Thread, Throwable);
- }
-
- public class ThreadLocal<T> {
- ctor public ThreadLocal();
- method @Nullable public T get();
- method @Nullable protected T initialValue();
- method public void remove();
- method public void set(T);
- method @NonNull public static <S> ThreadLocal<S> withInitial(@NonNull java.util.function.Supplier<? extends S>);
- }
-
- public class Throwable implements java.io.Serializable {
- ctor public Throwable();
- ctor public Throwable(@Nullable String);
- ctor public Throwable(@Nullable String, @Nullable Throwable);
- ctor public Throwable(@Nullable Throwable);
- ctor protected Throwable(@Nullable String, @Nullable Throwable, boolean, boolean);
- method public final void addSuppressed(@NonNull Throwable);
- method @NonNull public Throwable fillInStackTrace();
- method @Nullable public Throwable getCause();
- method @Nullable public String getLocalizedMessage();
- method @Nullable public String getMessage();
- method @NonNull public StackTraceElement[] getStackTrace();
- method @NonNull public final Throwable[] getSuppressed();
- method @NonNull public Throwable initCause(@Nullable Throwable);
- method public void printStackTrace();
- method public void printStackTrace(@NonNull java.io.PrintStream);
- method public void printStackTrace(@NonNull java.io.PrintWriter);
- method public void setStackTrace(@NonNull StackTraceElement[]);
- }
-
- public class TypeNotPresentException extends java.lang.RuntimeException {
- ctor public TypeNotPresentException(String, Throwable);
- method public String typeName();
- }
-
- public class UnknownError extends java.lang.VirtualMachineError {
- ctor public UnknownError();
- ctor public UnknownError(String);
- }
-
- public class UnsatisfiedLinkError extends java.lang.LinkageError {
- ctor public UnsatisfiedLinkError();
- ctor public UnsatisfiedLinkError(String);
- }
-
- public class UnsupportedClassVersionError extends java.lang.ClassFormatError {
- ctor public UnsupportedClassVersionError();
- ctor public UnsupportedClassVersionError(String);
- }
-
- public class UnsupportedOperationException extends java.lang.RuntimeException {
- ctor public UnsupportedOperationException();
- ctor public UnsupportedOperationException(String);
- ctor public UnsupportedOperationException(String, Throwable);
- ctor public UnsupportedOperationException(Throwable);
- }
-
- public class VerifyError extends java.lang.LinkageError {
- ctor public VerifyError();
- ctor public VerifyError(String);
- }
-
- public abstract class VirtualMachineError extends java.lang.Error {
- ctor public VirtualMachineError();
- ctor public VirtualMachineError(String);
- ctor public VirtualMachineError(String, Throwable);
- ctor public VirtualMachineError(Throwable);
- }
-
- public final class Void {
- field public static final Class<java.lang.Void> TYPE;
- }
-
-}
-
-package java.lang.annotation {
-
- public interface Annotation {
- method public Class<? extends java.lang.annotation.Annotation> annotationType();
- method public boolean equals(Object);
- method public int hashCode();
- method public String toString();
- }
-
- public class AnnotationFormatError extends java.lang.Error {
- ctor public AnnotationFormatError(String);
- ctor public AnnotationFormatError(String, Throwable);
- ctor public AnnotationFormatError(Throwable);
- }
-
- public class AnnotationTypeMismatchException extends java.lang.RuntimeException {
- ctor public AnnotationTypeMismatchException(java.lang.reflect.Method, String);
- method public java.lang.reflect.Method element();
- method public String foundType();
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.ANNOTATION_TYPE) public @interface Documented {
- }
-
- public enum ElementType {
- enum_constant public static final java.lang.annotation.ElementType ANNOTATION_TYPE;
- enum_constant public static final java.lang.annotation.ElementType CONSTRUCTOR;
- enum_constant public static final java.lang.annotation.ElementType FIELD;
- enum_constant public static final java.lang.annotation.ElementType LOCAL_VARIABLE;
- enum_constant public static final java.lang.annotation.ElementType METHOD;
- enum_constant public static final java.lang.annotation.ElementType PACKAGE;
- enum_constant public static final java.lang.annotation.ElementType PARAMETER;
- enum_constant public static final java.lang.annotation.ElementType TYPE;
- enum_constant public static final java.lang.annotation.ElementType TYPE_PARAMETER;
- enum_constant public static final java.lang.annotation.ElementType TYPE_USE;
- }
-
- public class IncompleteAnnotationException extends java.lang.RuntimeException {
- ctor public IncompleteAnnotationException(Class<? extends java.lang.annotation.Annotation>, String);
- method public Class<? extends java.lang.annotation.Annotation> annotationType();
- method public String elementName();
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.ANNOTATION_TYPE) public @interface Inherited {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target(java.lang.annotation.ElementType.FIELD) public @interface Native {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.ANNOTATION_TYPE) public @interface Repeatable {
- method public abstract Class<? extends java.lang.annotation.Annotation> value();
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.ANNOTATION_TYPE) public @interface Retention {
- method public abstract java.lang.annotation.RetentionPolicy value();
- }
-
- public enum RetentionPolicy {
- enum_constant public static final java.lang.annotation.RetentionPolicy CLASS;
- enum_constant public static final java.lang.annotation.RetentionPolicy RUNTIME;
- enum_constant public static final java.lang.annotation.RetentionPolicy SOURCE;
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.ANNOTATION_TYPE) public @interface Target {
- method public abstract java.lang.annotation.ElementType[] value();
- }
-
-}
-
-package java.lang.invoke {
-
- public abstract class CallSite {
- method public abstract java.lang.invoke.MethodHandle dynamicInvoker();
- method public abstract java.lang.invoke.MethodHandle getTarget();
- method public abstract void setTarget(java.lang.invoke.MethodHandle);
- method public java.lang.invoke.MethodType type();
- }
-
- public class ConstantCallSite extends java.lang.invoke.CallSite {
- ctor public ConstantCallSite(java.lang.invoke.MethodHandle);
- ctor protected ConstantCallSite(java.lang.invoke.MethodType, java.lang.invoke.MethodHandle) throws java.lang.Throwable;
- method public final java.lang.invoke.MethodHandle dynamicInvoker();
- method public final java.lang.invoke.MethodHandle getTarget();
- method public final void setTarget(java.lang.invoke.MethodHandle);
- }
-
- public class LambdaConversionException extends java.lang.Exception {
- ctor public LambdaConversionException();
- ctor public LambdaConversionException(String);
- ctor public LambdaConversionException(String, Throwable);
- ctor public LambdaConversionException(Throwable);
- ctor public LambdaConversionException(String, Throwable, boolean, boolean);
- }
-
- public abstract class MethodHandle {
- method public java.lang.invoke.MethodHandle asCollector(Class<?>, int);
- method public java.lang.invoke.MethodHandle asFixedArity();
- method public java.lang.invoke.MethodHandle asSpreader(Class<?>, int);
- method public java.lang.invoke.MethodHandle asType(java.lang.invoke.MethodType);
- method public java.lang.invoke.MethodHandle asVarargsCollector(Class<?>);
- method public java.lang.invoke.MethodHandle bindTo(Object);
- method public final Object invoke(java.lang.Object...) throws java.lang.Throwable;
- method public final Object invokeExact(java.lang.Object...) throws java.lang.Throwable;
- method public Object invokeWithArguments(java.lang.Object...) throws java.lang.Throwable;
- method public Object invokeWithArguments(java.util.List<?>) throws java.lang.Throwable;
- method public boolean isVarargsCollector();
- method public java.lang.invoke.MethodType type();
- }
-
- public interface MethodHandleInfo {
- method public Class<?> getDeclaringClass();
- method public java.lang.invoke.MethodType getMethodType();
- method public int getModifiers();
- method public String getName();
- method public int getReferenceKind();
- method public default boolean isVarArgs();
- method @Deprecated public static boolean refKindIsField(int);
- method @Deprecated public static boolean refKindIsValid(int);
- method @Deprecated public static String refKindName(int);
- method public static String referenceKindToString(int);
- method public <T extends java.lang.reflect.Member> T reflectAs(Class<T>, java.lang.invoke.MethodHandles.Lookup);
- method public static String toString(int, Class<?>, String, java.lang.invoke.MethodType);
- field public static final int REF_getField = 1; // 0x1
- field public static final int REF_getStatic = 2; // 0x2
- field public static final int REF_invokeInterface = 9; // 0x9
- field public static final int REF_invokeSpecial = 7; // 0x7
- field public static final int REF_invokeStatic = 6; // 0x6
- field public static final int REF_invokeVirtual = 5; // 0x5
- field public static final int REF_newInvokeSpecial = 8; // 0x8
- field public static final int REF_putField = 3; // 0x3
- field public static final int REF_putStatic = 4; // 0x4
- }
-
- public class MethodHandles {
- method public static java.lang.invoke.MethodHandle arrayElementGetter(Class<?>) throws java.lang.IllegalArgumentException;
- method public static java.lang.invoke.MethodHandle arrayElementSetter(Class<?>) throws java.lang.IllegalArgumentException;
- method public static java.lang.invoke.MethodHandle catchException(java.lang.invoke.MethodHandle, Class<? extends java.lang.Throwable>, java.lang.invoke.MethodHandle);
- method public static java.lang.invoke.MethodHandle collectArguments(java.lang.invoke.MethodHandle, int, java.lang.invoke.MethodHandle);
- method public static java.lang.invoke.MethodHandle constant(Class<?>, Object);
- method public static java.lang.invoke.MethodHandle dropArguments(java.lang.invoke.MethodHandle, int, java.util.List<java.lang.Class<?>>);
- method public static java.lang.invoke.MethodHandle dropArguments(java.lang.invoke.MethodHandle, int, Class<?>...);
- method public static java.lang.invoke.MethodHandle exactInvoker(java.lang.invoke.MethodType);
- method public static java.lang.invoke.MethodHandle explicitCastArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType);
- method public static java.lang.invoke.MethodHandle filterArguments(java.lang.invoke.MethodHandle, int, java.lang.invoke.MethodHandle...);
- method public static java.lang.invoke.MethodHandle filterReturnValue(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle);
- method public static java.lang.invoke.MethodHandle foldArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle);
- method public static java.lang.invoke.MethodHandle guardWithTest(java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandle);
- method public static java.lang.invoke.MethodHandle identity(Class<?>);
- method public static java.lang.invoke.MethodHandle insertArguments(java.lang.invoke.MethodHandle, int, java.lang.Object...);
- method public static java.lang.invoke.MethodHandle invoker(java.lang.invoke.MethodType);
- method public static java.lang.invoke.MethodHandles.Lookup lookup();
- method public static java.lang.invoke.MethodHandle permuteArguments(java.lang.invoke.MethodHandle, java.lang.invoke.MethodType, int...);
- method public static java.lang.invoke.MethodHandles.Lookup publicLookup();
- method public static <T extends java.lang.reflect.Member> T reflectAs(Class<T>, java.lang.invoke.MethodHandle);
- method public static java.lang.invoke.MethodHandle spreadInvoker(java.lang.invoke.MethodType, int);
- method public static java.lang.invoke.MethodHandle throwException(Class<?>, Class<? extends java.lang.Throwable>);
- }
-
- public static final class MethodHandles.Lookup {
- method public java.lang.invoke.MethodHandle bind(Object, String, java.lang.invoke.MethodType) throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException;
- method public java.lang.invoke.MethodHandle findConstructor(Class<?>, java.lang.invoke.MethodType) throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException;
- method public java.lang.invoke.MethodHandle findGetter(Class<?>, String, Class<?>) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException;
- method public java.lang.invoke.MethodHandle findSetter(Class<?>, String, Class<?>) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException;
- method public java.lang.invoke.MethodHandle findSpecial(Class<?>, String, java.lang.invoke.MethodType, Class<?>) throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException;
- method public java.lang.invoke.MethodHandle findStatic(Class<?>, String, java.lang.invoke.MethodType) throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException;
- method public java.lang.invoke.MethodHandle findStaticGetter(Class<?>, String, Class<?>) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException;
- method public java.lang.invoke.MethodHandle findStaticSetter(Class<?>, String, Class<?>) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException;
- method public java.lang.invoke.MethodHandle findVirtual(Class<?>, String, java.lang.invoke.MethodType) throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException;
- method public java.lang.invoke.MethodHandles.Lookup in(Class<?>);
- method public Class<?> lookupClass();
- method public int lookupModes();
- method public java.lang.invoke.MethodHandleInfo revealDirect(java.lang.invoke.MethodHandle);
- method public java.lang.invoke.MethodHandle unreflect(java.lang.reflect.Method) throws java.lang.IllegalAccessException;
- method public java.lang.invoke.MethodHandle unreflectConstructor(java.lang.reflect.Constructor<?>) throws java.lang.IllegalAccessException;
- method public java.lang.invoke.MethodHandle unreflectGetter(java.lang.reflect.Field) throws java.lang.IllegalAccessException;
- method public java.lang.invoke.MethodHandle unreflectSetter(java.lang.reflect.Field) throws java.lang.IllegalAccessException;
- method public java.lang.invoke.MethodHandle unreflectSpecial(java.lang.reflect.Method, Class<?>) throws java.lang.IllegalAccessException;
- field public static final int PACKAGE = 8; // 0x8
- field public static final int PRIVATE = 2; // 0x2
- field public static final int PROTECTED = 4; // 0x4
- field public static final int PUBLIC = 1; // 0x1
- }
-
- public final class MethodType implements java.io.Serializable {
- method public java.lang.invoke.MethodType appendParameterTypes(Class<?>...);
- method public java.lang.invoke.MethodType appendParameterTypes(java.util.List<java.lang.Class<?>>);
- method public java.lang.invoke.MethodType changeParameterType(int, Class<?>);
- method public java.lang.invoke.MethodType changeReturnType(Class<?>);
- method public java.lang.invoke.MethodType dropParameterTypes(int, int);
- method public java.lang.invoke.MethodType erase();
- method public static java.lang.invoke.MethodType fromMethodDescriptorString(String, ClassLoader) throws java.lang.IllegalArgumentException, java.lang.TypeNotPresentException;
- method public java.lang.invoke.MethodType generic();
- method public static java.lang.invoke.MethodType genericMethodType(int, boolean);
- method public static java.lang.invoke.MethodType genericMethodType(int);
- method public boolean hasPrimitives();
- method public boolean hasWrappers();
- method public java.lang.invoke.MethodType insertParameterTypes(int, Class<?>...);
- method public java.lang.invoke.MethodType insertParameterTypes(int, java.util.List<java.lang.Class<?>>);
- method public static java.lang.invoke.MethodType methodType(Class<?>, Class<?>[]);
- method public static java.lang.invoke.MethodType methodType(Class<?>, java.util.List<java.lang.Class<?>>);
- method public static java.lang.invoke.MethodType methodType(Class<?>, Class<?>, Class<?>...);
- method public static java.lang.invoke.MethodType methodType(Class<?>);
- method public static java.lang.invoke.MethodType methodType(Class<?>, Class<?>);
- method public static java.lang.invoke.MethodType methodType(Class<?>, java.lang.invoke.MethodType);
- method public Class<?>[] parameterArray();
- method public int parameterCount();
- method public java.util.List<java.lang.Class<?>> parameterList();
- method public Class<?> parameterType(int);
- method public Class<?> returnType();
- method public String toMethodDescriptorString();
- method public java.lang.invoke.MethodType unwrap();
- method public java.lang.invoke.MethodType wrap();
- }
-
- public class MutableCallSite extends java.lang.invoke.CallSite {
- ctor public MutableCallSite(java.lang.invoke.MethodType);
- ctor public MutableCallSite(java.lang.invoke.MethodHandle);
- method public final java.lang.invoke.MethodHandle dynamicInvoker();
- method public final java.lang.invoke.MethodHandle getTarget();
- method public void setTarget(java.lang.invoke.MethodHandle);
- }
-
- public class VolatileCallSite extends java.lang.invoke.CallSite {
- ctor public VolatileCallSite(java.lang.invoke.MethodType);
- ctor public VolatileCallSite(java.lang.invoke.MethodHandle);
- method public final java.lang.invoke.MethodHandle dynamicInvoker();
- method public final java.lang.invoke.MethodHandle getTarget();
- method public void setTarget(java.lang.invoke.MethodHandle);
- }
-
- public class WrongMethodTypeException extends java.lang.RuntimeException {
- ctor public WrongMethodTypeException();
- ctor public WrongMethodTypeException(String);
- }
-
-}
-
-package java.lang.ref {
-
- public class PhantomReference<T> extends java.lang.ref.Reference<T> {
- ctor public PhantomReference(T, java.lang.ref.ReferenceQueue<? super T>);
- }
-
- public abstract class Reference<T> {
- method public void clear();
- method public boolean enqueue();
- method public T get();
- method public boolean isEnqueued();
- method public static void reachabilityFence(Object);
- }
-
- public class ReferenceQueue<T> {
- ctor public ReferenceQueue();
- method public java.lang.ref.Reference<? extends T> poll();
- method public java.lang.ref.Reference<? extends T> remove(long) throws java.lang.IllegalArgumentException, java.lang.InterruptedException;
- method public java.lang.ref.Reference<? extends T> remove() throws java.lang.InterruptedException;
- }
-
- public class SoftReference<T> extends java.lang.ref.Reference<T> {
- ctor public SoftReference(T);
- ctor public SoftReference(T, java.lang.ref.ReferenceQueue<? super T>);
- }
-
- public class WeakReference<T> extends java.lang.ref.Reference<T> {
- ctor public WeakReference(T);
- ctor public WeakReference(T, java.lang.ref.ReferenceQueue<? super T>);
- }
-
-}
-
-package java.lang.reflect {
-
- public class AccessibleObject implements java.lang.reflect.AnnotatedElement {
- ctor protected AccessibleObject();
- method @Nullable public <T extends java.lang.annotation.Annotation> T getAnnotation(@NonNull Class<T>);
- method @NonNull public java.lang.annotation.Annotation[] getAnnotations();
- method @NonNull public java.lang.annotation.Annotation[] getDeclaredAnnotations();
- method public boolean isAccessible();
- method public static void setAccessible(java.lang.reflect.AccessibleObject[], boolean) throws java.lang.SecurityException;
- method public void setAccessible(boolean) throws java.lang.SecurityException;
- }
-
- public interface AnnotatedElement {
- method @Nullable public <T extends java.lang.annotation.Annotation> T getAnnotation(@NonNull Class<T>);
- method @NonNull public java.lang.annotation.Annotation[] getAnnotations();
- method public default <T extends java.lang.annotation.Annotation> T[] getAnnotationsByType(@NonNull Class<T>);
- method @Nullable public default <T extends java.lang.annotation.Annotation> T getDeclaredAnnotation(@NonNull Class<T>);
- method @NonNull public java.lang.annotation.Annotation[] getDeclaredAnnotations();
- method public default <T extends java.lang.annotation.Annotation> T[] getDeclaredAnnotationsByType(@NonNull Class<T>);
- method public default boolean isAnnotationPresent(@NonNull Class<? extends java.lang.annotation.Annotation>);
- }
-
- public final class Array {
- method @Nullable public static Object get(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- method public static boolean getBoolean(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- method public static byte getByte(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- method public static char getChar(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- method public static double getDouble(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- method public static float getFloat(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- method public static int getInt(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- method public static int getLength(@NonNull Object);
- method public static long getLong(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- method public static short getShort(@NonNull Object, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- method @NonNull public static Object newInstance(@NonNull Class<?>, int) throws java.lang.NegativeArraySizeException;
- method @NonNull public static Object newInstance(@NonNull Class<?>, int...) throws java.lang.IllegalArgumentException, java.lang.NegativeArraySizeException;
- method public static void set(@NonNull Object, int, @Nullable Object) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- method public static void setBoolean(@NonNull Object, int, boolean);
- method public static void setByte(@NonNull Object, int, byte) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- method public static void setChar(@NonNull Object, int, char) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- method public static void setDouble(@NonNull Object, int, double) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- method public static void setFloat(@NonNull Object, int, float) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- method public static void setInt(@NonNull Object, int, int) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- method public static void setLong(@NonNull Object, int, long) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- method public static void setShort(@NonNull Object, int, short) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException;
- }
-
- public final class Constructor<T> extends java.lang.reflect.Executable {
- method @NonNull public Class<T> getDeclaringClass();
- method public Class<?>[] getExceptionTypes();
- method public int getModifiers();
- method @NonNull public String getName();
- method public java.lang.annotation.Annotation[][] getParameterAnnotations();
- method @NonNull public Class<?>[] getParameterTypes();
- method public java.lang.reflect.TypeVariable<java.lang.reflect.Constructor<T>>[] getTypeParameters();
- method @NonNull public T newInstance(java.lang.Object...) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException;
- method @NonNull public String toGenericString();
- }
-
- public abstract class Executable extends java.lang.reflect.AccessibleObject implements java.lang.reflect.GenericDeclaration java.lang.reflect.Member {
- method @NonNull public abstract Class<?>[] getExceptionTypes();
- method @NonNull public java.lang.reflect.Type[] getGenericExceptionTypes();
- method @NonNull public java.lang.reflect.Type[] getGenericParameterTypes();
- method @NonNull public abstract java.lang.annotation.Annotation[][] getParameterAnnotations();
- method public int getParameterCount();
- method @NonNull public abstract Class<?>[] getParameterTypes();
- method @NonNull public java.lang.reflect.Parameter[] getParameters();
- method public final boolean isAnnotationPresent(@NonNull Class<? extends java.lang.annotation.Annotation>);
- method public boolean isSynthetic();
- method public boolean isVarArgs();
- method @NonNull public abstract String toGenericString();
- }
-
- public final class Field extends java.lang.reflect.AccessibleObject implements java.lang.reflect.Member {
- method @Nullable public Object get(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method public boolean getBoolean(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method public byte getByte(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method public char getChar(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method @NonNull public Class<?> getDeclaringClass();
- method public double getDouble(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method public float getFloat(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method @NonNull public java.lang.reflect.Type getGenericType();
- method public int getInt(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method public long getLong(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method public int getModifiers();
- method @NonNull public String getName();
- method public short getShort(@Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method @NonNull public Class<?> getType();
- method public boolean isEnumConstant();
- method public boolean isSynthetic();
- method public void set(@Nullable Object, @Nullable Object) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method public void setBoolean(@Nullable Object, boolean) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method public void setByte(@Nullable Object, byte) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method public void setChar(@Nullable Object, char) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method public void setDouble(@Nullable Object, double) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method public void setFloat(@Nullable Object, float) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method public void setInt(@Nullable Object, int) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method public void setLong(@Nullable Object, long) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method public void setShort(@Nullable Object, short) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException;
- method @NonNull public String toGenericString();
- }
-
- public interface GenericArrayType extends java.lang.reflect.Type {
- method @NonNull public java.lang.reflect.Type getGenericComponentType();
- }
-
- public interface GenericDeclaration extends java.lang.reflect.AnnotatedElement {
- method @NonNull public java.lang.reflect.TypeVariable<?>[] getTypeParameters();
- }
-
- public class GenericSignatureFormatError extends java.lang.ClassFormatError {
- ctor public GenericSignatureFormatError();
- ctor public GenericSignatureFormatError(String);
- }
-
- public interface InvocationHandler {
- method public Object invoke(Object, java.lang.reflect.Method, Object[]) throws java.lang.Throwable;
- }
-
- public class InvocationTargetException extends java.lang.ReflectiveOperationException {
- ctor protected InvocationTargetException();
- ctor public InvocationTargetException(Throwable);
- ctor public InvocationTargetException(Throwable, String);
- method public Throwable getTargetException();
- }
-
- public class MalformedParameterizedTypeException extends java.lang.RuntimeException {
- ctor public MalformedParameterizedTypeException();
- }
-
- public class MalformedParametersException extends java.lang.RuntimeException {
- ctor public MalformedParametersException();
- ctor public MalformedParametersException(String);
- }
-
- public interface Member {
- method @NonNull public Class<?> getDeclaringClass();
- method public int getModifiers();
- method @NonNull public String getName();
- method public boolean isSynthetic();
- field public static final int DECLARED = 1; // 0x1
- field public static final int PUBLIC = 0; // 0x0
- }
-
- public final class Method extends java.lang.reflect.Executable {
- method @NonNull public Class<?> getDeclaringClass();
- method @Nullable public Object getDefaultValue();
- method @NonNull public Class<?>[] getExceptionTypes();
- method @NonNull public java.lang.reflect.Type getGenericReturnType();
- method public int getModifiers();
- method @NonNull public String getName();
- method @NonNull public java.lang.annotation.Annotation[][] getParameterAnnotations();
- method @NonNull public Class<?>[] getParameterTypes();
- method @NonNull public Class<?> getReturnType();
- method @NonNull public java.lang.reflect.TypeVariable<java.lang.reflect.Method>[] getTypeParameters();
- method @Nullable public Object invoke(@Nullable Object, @Nullable java.lang.Object...) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException;
- method public boolean isBridge();
- method public boolean isDefault();
- method @NonNull public String toGenericString();
- }
-
- public class Modifier {
- ctor public Modifier();
- method public static int classModifiers();
- method public static int constructorModifiers();
- method public static int fieldModifiers();
- method public static int interfaceModifiers();
- method public static boolean isAbstract(int);
- method public static boolean isFinal(int);
- method public static boolean isInterface(int);
- method public static boolean isNative(int);
- method public static boolean isPrivate(int);
- method public static boolean isProtected(int);
- method public static boolean isPublic(int);
- method public static boolean isStatic(int);
- method public static boolean isStrict(int);
- method public static boolean isSynchronized(int);
- method public static boolean isTransient(int);
- method public static boolean isVolatile(int);
- method public static int methodModifiers();
- method public static int parameterModifiers();
- method public static String toString(int);
- field public static final int ABSTRACT = 1024; // 0x400
- field public static final int FINAL = 16; // 0x10
- field public static final int INTERFACE = 512; // 0x200
- field public static final int NATIVE = 256; // 0x100
- field public static final int PRIVATE = 2; // 0x2
- field public static final int PROTECTED = 4; // 0x4
- field public static final int PUBLIC = 1; // 0x1
- field public static final int STATIC = 8; // 0x8
- field public static final int STRICT = 2048; // 0x800
- field public static final int SYNCHRONIZED = 32; // 0x20
- field public static final int TRANSIENT = 128; // 0x80
- field public static final int VOLATILE = 64; // 0x40
- }
-
- public final class Parameter implements java.lang.reflect.AnnotatedElement {
- method @Nullable public <T extends java.lang.annotation.Annotation> T getAnnotation(@NonNull Class<T>);
- method @NonNull public java.lang.annotation.Annotation[] getAnnotations();
- method @NonNull public java.lang.annotation.Annotation[] getDeclaredAnnotations();
- method @NonNull public java.lang.reflect.Executable getDeclaringExecutable();
- method public int getModifiers();
- method @NonNull public String getName();
- method @NonNull public java.lang.reflect.Type getParameterizedType();
- method @NonNull public Class<?> getType();
- method public boolean isImplicit();
- method public boolean isNamePresent();
- method public boolean isSynthetic();
- method public boolean isVarArgs();
- }
-
- public interface ParameterizedType extends java.lang.reflect.Type {
- method @NonNull public java.lang.reflect.Type[] getActualTypeArguments();
- method @Nullable public java.lang.reflect.Type getOwnerType();
- method @NonNull public java.lang.reflect.Type getRawType();
- }
-
- public class Proxy implements java.io.Serializable {
- ctor protected Proxy(@NonNull java.lang.reflect.InvocationHandler);
- method @NonNull public static java.lang.reflect.InvocationHandler getInvocationHandler(@NonNull Object) throws java.lang.IllegalArgumentException;
- method @NonNull public static Class<?> getProxyClass(@Nullable ClassLoader, @NonNull Class<?>...) throws java.lang.IllegalArgumentException;
- method public static boolean isProxyClass(@NonNull Class<?>);
- method @NonNull public static Object newProxyInstance(@Nullable ClassLoader, @NonNull Class<?>[], @NonNull java.lang.reflect.InvocationHandler) throws java.lang.IllegalArgumentException;
- field protected java.lang.reflect.InvocationHandler h;
- }
-
- public final class ReflectPermission extends java.security.BasicPermission {
- ctor public ReflectPermission(String);
- ctor public ReflectPermission(String, String);
- }
-
- public interface Type {
- method @NonNull public default String getTypeName();
- }
-
- public interface TypeVariable<D extends java.lang.reflect.GenericDeclaration> extends java.lang.reflect.Type {
- method @NonNull public java.lang.reflect.Type[] getBounds();
- method @NonNull public D getGenericDeclaration();
- method @NonNull public String getName();
- }
-
- public class UndeclaredThrowableException extends java.lang.RuntimeException {
- ctor public UndeclaredThrowableException(Throwable);
- ctor public UndeclaredThrowableException(Throwable, String);
- method public Throwable getUndeclaredThrowable();
- }
-
- public interface WildcardType extends java.lang.reflect.Type {
- method @NonNull public java.lang.reflect.Type[] getLowerBounds();
- method @NonNull public java.lang.reflect.Type[] getUpperBounds();
- }
-
-}
-
-package java.math {
-
- public class BigDecimal extends java.lang.Number implements java.lang.Comparable<java.math.BigDecimal> {
- ctor public BigDecimal(char[], int, int);
- ctor public BigDecimal(char[], int, int, java.math.MathContext);
- ctor public BigDecimal(char[]);
- ctor public BigDecimal(char[], java.math.MathContext);
- ctor public BigDecimal(String);
- ctor public BigDecimal(String, java.math.MathContext);
- ctor public BigDecimal(double);
- ctor public BigDecimal(double, java.math.MathContext);
- ctor public BigDecimal(java.math.BigInteger);
- ctor public BigDecimal(java.math.BigInteger, java.math.MathContext);
- ctor public BigDecimal(java.math.BigInteger, int);
- ctor public BigDecimal(java.math.BigInteger, int, java.math.MathContext);
- ctor public BigDecimal(int);
- ctor public BigDecimal(int, java.math.MathContext);
- ctor public BigDecimal(long);
- ctor public BigDecimal(long, java.math.MathContext);
- method public java.math.BigDecimal abs();
- method public java.math.BigDecimal abs(java.math.MathContext);
- method public java.math.BigDecimal add(java.math.BigDecimal);
- method public java.math.BigDecimal add(java.math.BigDecimal, java.math.MathContext);
- method public byte byteValueExact();
- method public int compareTo(java.math.BigDecimal);
- method public java.math.BigDecimal divide(java.math.BigDecimal, int, int);
- method public java.math.BigDecimal divide(java.math.BigDecimal, int, java.math.RoundingMode);
- method public java.math.BigDecimal divide(java.math.BigDecimal, int);
- method public java.math.BigDecimal divide(java.math.BigDecimal, java.math.RoundingMode);
- method public java.math.BigDecimal divide(java.math.BigDecimal);
- method public java.math.BigDecimal divide(java.math.BigDecimal, java.math.MathContext);
- method public java.math.BigDecimal[] divideAndRemainder(java.math.BigDecimal);
- method public java.math.BigDecimal[] divideAndRemainder(java.math.BigDecimal, java.math.MathContext);
- method public java.math.BigDecimal divideToIntegralValue(java.math.BigDecimal);
- method public java.math.BigDecimal divideToIntegralValue(java.math.BigDecimal, java.math.MathContext);
- method public double doubleValue();
- method public float floatValue();
- method public int intValue();
- method public int intValueExact();
- method public long longValue();
- method public long longValueExact();
- method public java.math.BigDecimal max(java.math.BigDecimal);
- method public java.math.BigDecimal min(java.math.BigDecimal);
- method public java.math.BigDecimal movePointLeft(int);
- method public java.math.BigDecimal movePointRight(int);
- method public java.math.BigDecimal multiply(java.math.BigDecimal);
- method public java.math.BigDecimal multiply(java.math.BigDecimal, java.math.MathContext);
- method public java.math.BigDecimal negate();
- method public java.math.BigDecimal negate(java.math.MathContext);
- method public java.math.BigDecimal plus();
- method public java.math.BigDecimal plus(java.math.MathContext);
- method public java.math.BigDecimal pow(int);
- method public java.math.BigDecimal pow(int, java.math.MathContext);
- method public int precision();
- method public java.math.BigDecimal remainder(java.math.BigDecimal);
- method public java.math.BigDecimal remainder(java.math.BigDecimal, java.math.MathContext);
- method public java.math.BigDecimal round(java.math.MathContext);
- method public int scale();
- method public java.math.BigDecimal scaleByPowerOfTen(int);
- method public java.math.BigDecimal setScale(int, java.math.RoundingMode);
- method public java.math.BigDecimal setScale(int, int);
- method public java.math.BigDecimal setScale(int);
- method public short shortValueExact();
- method public int signum();
- method public java.math.BigDecimal stripTrailingZeros();
- method public java.math.BigDecimal subtract(java.math.BigDecimal);
- method public java.math.BigDecimal subtract(java.math.BigDecimal, java.math.MathContext);
- method public java.math.BigInteger toBigInteger();
- method public java.math.BigInteger toBigIntegerExact();
- method public String toEngineeringString();
- method public String toPlainString();
- method public java.math.BigDecimal ulp();
- method public java.math.BigInteger unscaledValue();
- method public static java.math.BigDecimal valueOf(long, int);
- method public static java.math.BigDecimal valueOf(long);
- method public static java.math.BigDecimal valueOf(double);
- field public static final java.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 java.math.BigDecimal TEN;
- field public static final java.math.BigDecimal ZERO;
- }
-
- public class BigInteger extends java.lang.Number implements java.lang.Comparable<java.math.BigInteger> {
- ctor public BigInteger(byte[]);
- ctor public BigInteger(int, byte[]);
- ctor public BigInteger(@NonNull String, int);
- ctor public BigInteger(@NonNull String);
- ctor public BigInteger(int, @NonNull java.util.Random);
- ctor public BigInteger(int, int, @NonNull java.util.Random);
- method @NonNull public java.math.BigInteger abs();
- method @NonNull public java.math.BigInteger add(@NonNull java.math.BigInteger);
- method @NonNull public java.math.BigInteger and(@NonNull java.math.BigInteger);
- method @NonNull public java.math.BigInteger andNot(@NonNull java.math.BigInteger);
- method public int bitCount();
- method public int bitLength();
- method public byte byteValueExact();
- method @NonNull public java.math.BigInteger clearBit(int);
- method public int compareTo(@NonNull java.math.BigInteger);
- method @NonNull public java.math.BigInteger divide(@NonNull java.math.BigInteger);
- method @NonNull public java.math.BigInteger[] divideAndRemainder(@NonNull java.math.BigInteger);
- method public double doubleValue();
- method @NonNull public java.math.BigInteger flipBit(int);
- method public float floatValue();
- method @NonNull public java.math.BigInteger gcd(@NonNull java.math.BigInteger);
- method public int getLowestSetBit();
- method public int intValue();
- method public int intValueExact();
- method public boolean isProbablePrime(int);
- method public long longValue();
- method public long longValueExact();
- method @NonNull public java.math.BigInteger max(@NonNull java.math.BigInteger);
- method @NonNull public java.math.BigInteger min(@NonNull java.math.BigInteger);
- method @NonNull public java.math.BigInteger mod(@NonNull java.math.BigInteger);
- method @NonNull public java.math.BigInteger modInverse(@NonNull java.math.BigInteger);
- method @NonNull public java.math.BigInteger modPow(@NonNull java.math.BigInteger, @NonNull java.math.BigInteger);
- method @NonNull public java.math.BigInteger multiply(@NonNull java.math.BigInteger);
- method @NonNull public java.math.BigInteger negate();
- method @NonNull public java.math.BigInteger nextProbablePrime();
- method @NonNull public java.math.BigInteger not();
- method @NonNull public java.math.BigInteger or(@NonNull java.math.BigInteger);
- method @NonNull public java.math.BigInteger pow(int);
- method @NonNull public static java.math.BigInteger probablePrime(int, @NonNull java.util.Random);
- method @NonNull public java.math.BigInteger remainder(@NonNull java.math.BigInteger);
- method @NonNull public java.math.BigInteger setBit(int);
- method @NonNull public java.math.BigInteger shiftLeft(int);
- method @NonNull public java.math.BigInteger shiftRight(int);
- method public short shortValueExact();
- method public int signum();
- method @NonNull public java.math.BigInteger subtract(@NonNull java.math.BigInteger);
- method public boolean testBit(int);
- method public byte[] toByteArray();
- method @NonNull public String toString(int);
- method @NonNull public static java.math.BigInteger valueOf(long);
- method @NonNull public java.math.BigInteger xor(@NonNull java.math.BigInteger);
- field @NonNull public static final java.math.BigInteger ONE;
- field @NonNull public static final java.math.BigInteger TEN;
- field @NonNull public static final java.math.BigInteger ZERO;
- }
-
- public final class MathContext implements java.io.Serializable {
- ctor public MathContext(int);
- ctor public MathContext(int, java.math.RoundingMode);
- ctor public MathContext(String);
- method public int getPrecision();
- method public java.math.RoundingMode getRoundingMode();
- field public static final java.math.MathContext DECIMAL128;
- field public static final java.math.MathContext DECIMAL32;
- field public static final java.math.MathContext DECIMAL64;
- field public static final java.math.MathContext UNLIMITED;
- }
-
- public enum RoundingMode {
- method public static java.math.RoundingMode valueOf(int);
- enum_constant public static final java.math.RoundingMode CEILING;
- enum_constant public static final java.math.RoundingMode DOWN;
- enum_constant public static final java.math.RoundingMode FLOOR;
- enum_constant public static final java.math.RoundingMode HALF_DOWN;
- enum_constant public static final java.math.RoundingMode HALF_EVEN;
- enum_constant public static final java.math.RoundingMode HALF_UP;
- enum_constant public static final java.math.RoundingMode UNNECESSARY;
- enum_constant public static final java.math.RoundingMode UP;
- }
-
-}
-
-package java.net {
-
- public abstract class Authenticator {
- ctor public Authenticator();
- method protected java.net.PasswordAuthentication getPasswordAuthentication();
- method protected final String getRequestingHost();
- method protected final int getRequestingPort();
- method protected final String getRequestingPrompt();
- method protected final String getRequestingProtocol();
- method protected final String getRequestingScheme();
- method protected final java.net.InetAddress getRequestingSite();
- method protected java.net.URL getRequestingURL();
- method protected java.net.Authenticator.RequestorType getRequestorType();
- method public static java.net.PasswordAuthentication requestPasswordAuthentication(java.net.InetAddress, int, String, String, String);
- method public static java.net.PasswordAuthentication requestPasswordAuthentication(String, java.net.InetAddress, int, String, String, String);
- method public static java.net.PasswordAuthentication requestPasswordAuthentication(String, java.net.InetAddress, int, String, String, String, java.net.URL, java.net.Authenticator.RequestorType);
- method public static void setDefault(java.net.Authenticator);
- }
-
- public enum Authenticator.RequestorType {
- enum_constant public static final java.net.Authenticator.RequestorType PROXY;
- enum_constant public static final java.net.Authenticator.RequestorType SERVER;
- }
-
- public class BindException extends java.net.SocketException {
- ctor public BindException(String);
- ctor public BindException();
- }
-
- public abstract class CacheRequest {
- ctor public CacheRequest();
- method public abstract void abort();
- method public abstract java.io.OutputStream getBody() throws java.io.IOException;
- }
-
- public abstract class CacheResponse {
- ctor public CacheResponse();
- method public abstract java.io.InputStream getBody() throws java.io.IOException;
- method public abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaders() throws java.io.IOException;
- }
-
- public class ConnectException extends java.net.SocketException {
- ctor public ConnectException(String);
- ctor public ConnectException();
- }
-
- public abstract class ContentHandler {
- ctor public ContentHandler();
- method public abstract Object getContent(java.net.URLConnection) throws java.io.IOException;
- method public Object getContent(java.net.URLConnection, Class[]) throws java.io.IOException;
- }
-
- public interface ContentHandlerFactory {
- method public java.net.ContentHandler createContentHandler(String);
- }
-
- public abstract class CookieHandler {
- ctor public CookieHandler();
- method public abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> get(java.net.URI, java.util.Map<java.lang.String,java.util.List<java.lang.String>>) throws java.io.IOException;
- method public static java.net.CookieHandler getDefault();
- method public abstract void put(java.net.URI, java.util.Map<java.lang.String,java.util.List<java.lang.String>>) throws java.io.IOException;
- method public static void setDefault(java.net.CookieHandler);
- }
-
- public class CookieManager extends java.net.CookieHandler {
- ctor public CookieManager();
- ctor public CookieManager(java.net.CookieStore, java.net.CookiePolicy);
- method public java.util.Map<java.lang.String,java.util.List<java.lang.String>> get(java.net.URI, java.util.Map<java.lang.String,java.util.List<java.lang.String>>) throws java.io.IOException;
- method public java.net.CookieStore getCookieStore();
- method public void put(java.net.URI, java.util.Map<java.lang.String,java.util.List<java.lang.String>>) throws java.io.IOException;
- method public void setCookiePolicy(java.net.CookiePolicy);
- }
-
- public interface CookiePolicy {
- method public boolean shouldAccept(java.net.URI, java.net.HttpCookie);
- field public static final java.net.CookiePolicy ACCEPT_ALL;
- field public static final java.net.CookiePolicy ACCEPT_NONE;
- field public static final java.net.CookiePolicy ACCEPT_ORIGINAL_SERVER;
- }
-
- public interface CookieStore {
- method public void add(java.net.URI, java.net.HttpCookie);
- method public java.util.List<java.net.HttpCookie> get(java.net.URI);
- method public java.util.List<java.net.HttpCookie> getCookies();
- method public java.util.List<java.net.URI> getURIs();
- method public boolean remove(java.net.URI, java.net.HttpCookie);
- method public boolean removeAll();
- }
-
- public final class DatagramPacket {
- ctor public DatagramPacket(byte[], int, int);
- ctor public DatagramPacket(byte[], int);
- ctor public DatagramPacket(byte[], int, int, java.net.InetAddress, int);
- ctor public DatagramPacket(byte[], int, int, java.net.SocketAddress);
- ctor public DatagramPacket(byte[], int, java.net.InetAddress, int);
- ctor public DatagramPacket(byte[], int, java.net.SocketAddress);
- method public java.net.InetAddress getAddress();
- method public byte[] getData();
- method public int getLength();
- method public int getOffset();
- method public int getPort();
- method public java.net.SocketAddress getSocketAddress();
- method public void setAddress(java.net.InetAddress);
- method public void setData(byte[], int, int);
- method public void setData(byte[]);
- method public void setLength(int);
- method public void setPort(int);
- method public void setSocketAddress(java.net.SocketAddress);
- }
-
- public class DatagramSocket implements java.io.Closeable {
- ctor public DatagramSocket() throws java.net.SocketException;
- ctor protected DatagramSocket(java.net.DatagramSocketImpl);
- ctor public DatagramSocket(java.net.SocketAddress) throws java.net.SocketException;
- ctor public DatagramSocket(int) throws java.net.SocketException;
- ctor public DatagramSocket(int, java.net.InetAddress) throws java.net.SocketException;
- method public void bind(java.net.SocketAddress) throws java.net.SocketException;
- method public void close();
- method public void connect(java.net.InetAddress, int);
- method public void connect(java.net.SocketAddress) throws java.net.SocketException;
- method public void disconnect();
- method public boolean getBroadcast() throws java.net.SocketException;
- method public java.nio.channels.DatagramChannel getChannel();
- method public java.net.InetAddress getInetAddress();
- method public java.net.InetAddress getLocalAddress();
- method public int getLocalPort();
- method public java.net.SocketAddress getLocalSocketAddress();
- method public int getPort();
- method public int getReceiveBufferSize() throws java.net.SocketException;
- method public java.net.SocketAddress getRemoteSocketAddress();
- method public boolean getReuseAddress() throws java.net.SocketException;
- method public int getSendBufferSize() throws java.net.SocketException;
- method public int getSoTimeout() throws java.net.SocketException;
- method public int getTrafficClass() throws java.net.SocketException;
- method public boolean isBound();
- method public boolean isClosed();
- method public boolean isConnected();
- method public void receive(java.net.DatagramPacket) throws java.io.IOException;
- method public void send(java.net.DatagramPacket) throws java.io.IOException;
- method public void setBroadcast(boolean) throws java.net.SocketException;
- method public static void setDatagramSocketImplFactory(java.net.DatagramSocketImplFactory) throws java.io.IOException;
- method public void setReceiveBufferSize(int) throws java.net.SocketException;
- method public void setReuseAddress(boolean) throws java.net.SocketException;
- method public void setSendBufferSize(int) throws java.net.SocketException;
- method public void setSoTimeout(int) throws java.net.SocketException;
- method public void setTrafficClass(int) throws java.net.SocketException;
- }
-
- public abstract class DatagramSocketImpl implements java.net.SocketOptions {
- ctor public DatagramSocketImpl();
- method protected abstract void bind(int, java.net.InetAddress) throws java.net.SocketException;
- method protected abstract void close();
- method protected void connect(java.net.InetAddress, int) throws java.net.SocketException;
- method protected abstract void create() throws java.net.SocketException;
- method protected void disconnect();
- method protected java.io.FileDescriptor getFileDescriptor();
- method protected int getLocalPort();
- method @Deprecated protected abstract byte getTTL() throws java.io.IOException;
- method protected abstract int getTimeToLive() throws java.io.IOException;
- method protected abstract void join(java.net.InetAddress) throws java.io.IOException;
- method protected abstract void joinGroup(java.net.SocketAddress, java.net.NetworkInterface) throws java.io.IOException;
- method protected abstract void leave(java.net.InetAddress) throws java.io.IOException;
- method protected abstract void leaveGroup(java.net.SocketAddress, java.net.NetworkInterface) throws java.io.IOException;
- method protected abstract int peek(java.net.InetAddress) throws java.io.IOException;
- method protected abstract int peekData(java.net.DatagramPacket) throws java.io.IOException;
- method protected abstract void receive(java.net.DatagramPacket) throws java.io.IOException;
- method protected abstract void send(java.net.DatagramPacket) throws java.io.IOException;
- method @Deprecated protected abstract void setTTL(byte) throws java.io.IOException;
- method protected abstract void setTimeToLive(int) throws java.io.IOException;
- field protected java.io.FileDescriptor fd;
- field protected int localPort;
- }
-
- public interface DatagramSocketImplFactory {
- method public java.net.DatagramSocketImpl createDatagramSocketImpl();
- }
-
- public interface FileNameMap {
- method public String getContentTypeFor(String);
- }
-
- public final class HttpCookie implements java.lang.Cloneable {
- ctor public HttpCookie(String, String);
- method public Object clone();
- method public static boolean domainMatches(String, String);
- method public String getComment();
- method public String getCommentURL();
- method public boolean getDiscard();
- method public String getDomain();
- method public long getMaxAge();
- method public String getName();
- method public String getPath();
- method public String getPortlist();
- method public boolean getSecure();
- method public String getValue();
- method public int getVersion();
- method public boolean hasExpired();
- method public boolean isHttpOnly();
- method public static java.util.List<java.net.HttpCookie> parse(String);
- method public void setComment(String);
- method public void setCommentURL(String);
- method public void setDiscard(boolean);
- method public void setDomain(String);
- method public void setHttpOnly(boolean);
- method public void setMaxAge(long);
- method public void setPath(String);
- method public void setPortlist(String);
- method public void setSecure(boolean);
- method public void setValue(String);
- method public void setVersion(int);
- }
-
- public class HttpRetryException extends java.io.IOException {
- ctor public HttpRetryException(String, int);
- ctor public HttpRetryException(String, int, String);
- method public String getLocation();
- method public String getReason();
- method public int responseCode();
- }
-
- public abstract class HttpURLConnection extends java.net.URLConnection {
- ctor protected HttpURLConnection(java.net.URL);
- method public abstract void disconnect();
- method public java.io.InputStream getErrorStream();
- method public static boolean getFollowRedirects();
- method public boolean getInstanceFollowRedirects();
- method public String getRequestMethod();
- method public int getResponseCode() throws java.io.IOException;
- method public String getResponseMessage() throws java.io.IOException;
- method public void setChunkedStreamingMode(int);
- method public void setFixedLengthStreamingMode(int);
- method public void setFixedLengthStreamingMode(long);
- method public static void setFollowRedirects(boolean);
- method public void setInstanceFollowRedirects(boolean);
- method public void setRequestMethod(String) throws java.net.ProtocolException;
- method public abstract boolean usingProxy();
- field public static final int HTTP_ACCEPTED = 202; // 0xca
- field public static final int HTTP_BAD_GATEWAY = 502; // 0x1f6
- field public static final int HTTP_BAD_METHOD = 405; // 0x195
- field public static final int HTTP_BAD_REQUEST = 400; // 0x190
- field public static final int HTTP_CLIENT_TIMEOUT = 408; // 0x198
- field public static final int HTTP_CONFLICT = 409; // 0x199
- field public static final int HTTP_CREATED = 201; // 0xc9
- field public static final int HTTP_ENTITY_TOO_LARGE = 413; // 0x19d
- field public static final int HTTP_FORBIDDEN = 403; // 0x193
- field public static final int HTTP_GATEWAY_TIMEOUT = 504; // 0x1f8
- field public static final int HTTP_GONE = 410; // 0x19a
- field public static final int HTTP_INTERNAL_ERROR = 500; // 0x1f4
- field public static final int HTTP_LENGTH_REQUIRED = 411; // 0x19b
- field public static final int HTTP_MOVED_PERM = 301; // 0x12d
- field public static final int HTTP_MOVED_TEMP = 302; // 0x12e
- field public static final int HTTP_MULT_CHOICE = 300; // 0x12c
- field public static final int HTTP_NOT_ACCEPTABLE = 406; // 0x196
- field public static final int HTTP_NOT_AUTHORITATIVE = 203; // 0xcb
- field public static final int HTTP_NOT_FOUND = 404; // 0x194
- field public static final int HTTP_NOT_IMPLEMENTED = 501; // 0x1f5
- field public static final int HTTP_NOT_MODIFIED = 304; // 0x130
- field public static final int HTTP_NO_CONTENT = 204; // 0xcc
- field public static final int HTTP_OK = 200; // 0xc8
- field public static final int HTTP_PARTIAL = 206; // 0xce
- field public static final int HTTP_PAYMENT_REQUIRED = 402; // 0x192
- field public static final int HTTP_PRECON_FAILED = 412; // 0x19c
- field public static final int HTTP_PROXY_AUTH = 407; // 0x197
- field public static final int HTTP_REQ_TOO_LONG = 414; // 0x19e
- field public static final int HTTP_RESET = 205; // 0xcd
- field public static final int HTTP_SEE_OTHER = 303; // 0x12f
- field @Deprecated public static final int HTTP_SERVER_ERROR = 500; // 0x1f4
- field public static final int HTTP_UNAUTHORIZED = 401; // 0x191
- field public static final int HTTP_UNAVAILABLE = 503; // 0x1f7
- field public static final int HTTP_UNSUPPORTED_TYPE = 415; // 0x19f
- field public static final int HTTP_USE_PROXY = 305; // 0x131
- field public static final int HTTP_VERSION = 505; // 0x1f9
- field protected int chunkLength;
- field protected int fixedContentLength;
- field protected long fixedContentLengthLong;
- field protected boolean instanceFollowRedirects;
- field protected String method;
- field protected int responseCode;
- field protected String responseMessage;
- }
-
- public final class IDN {
- method public static String toASCII(String, int);
- method public static String toASCII(String);
- method public static String toUnicode(String, int);
- method public static String toUnicode(String);
- field public static final int ALLOW_UNASSIGNED = 1; // 0x1
- field public static final int USE_STD3_ASCII_RULES = 2; // 0x2
- }
-
- public final class Inet4Address extends java.net.InetAddress {
- }
-
- public final class Inet6Address extends java.net.InetAddress {
- method public static java.net.Inet6Address getByAddress(String, byte[], java.net.NetworkInterface) throws java.net.UnknownHostException;
- method public static java.net.Inet6Address getByAddress(String, byte[], int) throws java.net.UnknownHostException;
- method public int getScopeId();
- method public java.net.NetworkInterface getScopedInterface();
- method public boolean isIPv4CompatibleAddress();
- }
-
- public class InetAddress implements java.io.Serializable {
- method public byte[] getAddress();
- method public static java.net.InetAddress[] getAllByName(String) throws java.net.UnknownHostException;
- method public static java.net.InetAddress getByAddress(String, byte[]) throws java.net.UnknownHostException;
- method public static java.net.InetAddress getByAddress(byte[]) throws java.net.UnknownHostException;
- method public static java.net.InetAddress getByName(String) throws java.net.UnknownHostException;
- method public String getCanonicalHostName();
- method public String getHostAddress();
- method public String getHostName();
- method public static java.net.InetAddress getLocalHost() throws java.net.UnknownHostException;
- method public static java.net.InetAddress getLoopbackAddress();
- method public boolean isAnyLocalAddress();
- method public boolean isLinkLocalAddress();
- method public boolean isLoopbackAddress();
- method public boolean isMCGlobal();
- method public boolean isMCLinkLocal();
- method public boolean isMCNodeLocal();
- method public boolean isMCOrgLocal();
- method public boolean isMCSiteLocal();
- method public boolean isMulticastAddress();
- method public boolean isReachable(int) throws java.io.IOException;
- method public boolean isReachable(java.net.NetworkInterface, int, int) throws java.io.IOException;
- method public boolean isSiteLocalAddress();
- }
-
- public class InetSocketAddress extends java.net.SocketAddress {
- ctor public InetSocketAddress(int);
- ctor public InetSocketAddress(java.net.InetAddress, int);
- ctor public InetSocketAddress(String, int);
- method public static java.net.InetSocketAddress createUnresolved(String, int);
- method public final boolean equals(Object);
- method public final java.net.InetAddress getAddress();
- method public final String getHostName();
- method public final String getHostString();
- method public final int getPort();
- method public final int hashCode();
- method public final boolean isUnresolved();
- }
-
- public class InterfaceAddress {
- method public java.net.InetAddress getAddress();
- method public java.net.InetAddress getBroadcast();
- method public short getNetworkPrefixLength();
- }
-
- public abstract class JarURLConnection extends java.net.URLConnection {
- ctor protected JarURLConnection(java.net.URL) throws java.net.MalformedURLException;
- method public java.util.jar.Attributes getAttributes() throws java.io.IOException;
- method public java.security.cert.Certificate[] getCertificates() throws java.io.IOException;
- method public String getEntryName();
- method public java.util.jar.JarEntry getJarEntry() throws java.io.IOException;
- method public abstract java.util.jar.JarFile getJarFile() throws java.io.IOException;
- method public java.net.URL getJarFileURL();
- method public java.util.jar.Attributes getMainAttributes() throws java.io.IOException;
- method public java.util.jar.Manifest getManifest() throws java.io.IOException;
- field protected java.net.URLConnection jarFileURLConnection;
- }
-
- public class MalformedURLException extends java.io.IOException {
- ctor public MalformedURLException();
- ctor public MalformedURLException(String);
- }
-
- public class MulticastSocket extends java.net.DatagramSocket {
- ctor public MulticastSocket() throws java.io.IOException;
- ctor public MulticastSocket(int) throws java.io.IOException;
- ctor public MulticastSocket(java.net.SocketAddress) throws java.io.IOException;
- method public java.net.InetAddress getInterface() throws java.net.SocketException;
- method public boolean getLoopbackMode() throws java.net.SocketException;
- method public java.net.NetworkInterface getNetworkInterface() throws java.net.SocketException;
- method @Deprecated public byte getTTL() throws java.io.IOException;
- method public int getTimeToLive() throws java.io.IOException;
- method public void joinGroup(java.net.InetAddress) throws java.io.IOException;
- method public void joinGroup(java.net.SocketAddress, java.net.NetworkInterface) throws java.io.IOException;
- method public void leaveGroup(java.net.InetAddress) throws java.io.IOException;
- method public void leaveGroup(java.net.SocketAddress, java.net.NetworkInterface) throws java.io.IOException;
- method @Deprecated public void send(java.net.DatagramPacket, byte) throws java.io.IOException;
- method public void setInterface(java.net.InetAddress) throws java.net.SocketException;
- method public void setLoopbackMode(boolean) throws java.net.SocketException;
- method public void setNetworkInterface(java.net.NetworkInterface) throws java.net.SocketException;
- method @Deprecated public void setTTL(byte) throws java.io.IOException;
- method public void setTimeToLive(int) throws java.io.IOException;
- }
-
- public final class NetPermission extends java.security.BasicPermission {
- ctor public NetPermission(String);
- ctor public NetPermission(String, String);
- }
-
- public final class NetworkInterface {
- method public static java.net.NetworkInterface getByIndex(int) throws java.net.SocketException;
- method public static java.net.NetworkInterface getByInetAddress(java.net.InetAddress) throws java.net.SocketException;
- method public static java.net.NetworkInterface getByName(String) throws java.net.SocketException;
- method public String getDisplayName();
- method public byte[] getHardwareAddress() throws java.net.SocketException;
- method public int getIndex();
- method public java.util.Enumeration<java.net.InetAddress> getInetAddresses();
- method public java.util.List<java.net.InterfaceAddress> getInterfaceAddresses();
- method public int getMTU() throws java.net.SocketException;
- method public String getName();
- method public static java.util.Enumeration<java.net.NetworkInterface> getNetworkInterfaces() throws java.net.SocketException;
- method public java.net.NetworkInterface getParent();
- method public java.util.Enumeration<java.net.NetworkInterface> getSubInterfaces();
- method public boolean isLoopback() throws java.net.SocketException;
- method public boolean isPointToPoint() throws java.net.SocketException;
- method public boolean isUp() throws java.net.SocketException;
- method public boolean isVirtual();
- method public boolean supportsMulticast() throws java.net.SocketException;
- }
-
- public class NoRouteToHostException extends java.net.SocketException {
- ctor public NoRouteToHostException(String);
- ctor public NoRouteToHostException();
- }
-
- public final class PasswordAuthentication {
- ctor public PasswordAuthentication(String, char[]);
- method public char[] getPassword();
- method public String getUserName();
- }
-
- public class PortUnreachableException extends java.net.SocketException {
- ctor public PortUnreachableException(String);
- ctor public PortUnreachableException();
- }
-
- public class ProtocolException extends java.io.IOException {
- ctor public ProtocolException(String);
- ctor public ProtocolException();
- }
-
- public interface ProtocolFamily {
- method public String name();
- }
-
- public class Proxy {
- ctor public Proxy(java.net.Proxy.Type, java.net.SocketAddress);
- method public java.net.SocketAddress address();
- method public final boolean equals(Object);
- method public final int hashCode();
- method public java.net.Proxy.Type type();
- field public static final java.net.Proxy NO_PROXY;
- }
-
- public enum Proxy.Type {
- enum_constant public static final java.net.Proxy.Type DIRECT;
- enum_constant public static final java.net.Proxy.Type HTTP;
- enum_constant public static final java.net.Proxy.Type SOCKS;
- }
-
- public abstract class ProxySelector {
- ctor public ProxySelector();
- method public abstract void connectFailed(java.net.URI, java.net.SocketAddress, java.io.IOException);
- method public static java.net.ProxySelector getDefault();
- method public abstract java.util.List<java.net.Proxy> select(java.net.URI);
- method public static void setDefault(java.net.ProxySelector);
- }
-
- public abstract class ResponseCache {
- ctor public ResponseCache();
- method public abstract java.net.CacheResponse get(java.net.URI, String, java.util.Map<java.lang.String,java.util.List<java.lang.String>>) throws java.io.IOException;
- method public static java.net.ResponseCache getDefault();
- method public abstract java.net.CacheRequest put(java.net.URI, java.net.URLConnection) throws java.io.IOException;
- method public static void setDefault(java.net.ResponseCache);
- }
-
- public abstract class SecureCacheResponse extends java.net.CacheResponse {
- ctor public SecureCacheResponse();
- method public abstract String getCipherSuite();
- method public abstract java.util.List<java.security.cert.Certificate> getLocalCertificateChain();
- method public abstract java.security.Principal getLocalPrincipal();
- method public abstract java.security.Principal getPeerPrincipal() throws javax.net.ssl.SSLPeerUnverifiedException;
- method public abstract java.util.List<java.security.cert.Certificate> getServerCertificateChain() throws javax.net.ssl.SSLPeerUnverifiedException;
- }
-
- public class ServerSocket implements java.io.Closeable {
- ctor public ServerSocket() throws java.io.IOException;
- ctor public ServerSocket(int) throws java.io.IOException;
- ctor public ServerSocket(int, int) throws java.io.IOException;
- ctor public ServerSocket(int, int, java.net.InetAddress) throws java.io.IOException;
- method public java.net.Socket accept() throws java.io.IOException;
- method public void bind(java.net.SocketAddress) throws java.io.IOException;
- method public void bind(java.net.SocketAddress, int) throws java.io.IOException;
- method public void close() throws java.io.IOException;
- method public java.nio.channels.ServerSocketChannel getChannel();
- method public java.net.InetAddress getInetAddress();
- method public int getLocalPort();
- method public java.net.SocketAddress getLocalSocketAddress();
- method public int getReceiveBufferSize() throws java.net.SocketException;
- method public boolean getReuseAddress() throws java.net.SocketException;
- method public int getSoTimeout() throws java.io.IOException;
- method protected final void implAccept(java.net.Socket) throws java.io.IOException;
- method public boolean isBound();
- method public boolean isClosed();
- method public void setPerformancePreferences(int, int, int);
- method public void setReceiveBufferSize(int) throws java.net.SocketException;
- method public void setReuseAddress(boolean) throws java.net.SocketException;
- method public void setSoTimeout(int) throws java.net.SocketException;
- method public static void setSocketFactory(java.net.SocketImplFactory) throws java.io.IOException;
- }
-
- public class Socket implements java.io.Closeable {
- ctor public Socket();
- ctor public Socket(java.net.Proxy);
- ctor protected Socket(java.net.SocketImpl) throws java.net.SocketException;
- ctor public Socket(String, int) throws java.io.IOException, java.net.UnknownHostException;
- ctor public Socket(java.net.InetAddress, int) throws java.io.IOException;
- ctor public Socket(String, int, java.net.InetAddress, int) throws java.io.IOException;
- ctor public Socket(java.net.InetAddress, int, java.net.InetAddress, int) throws java.io.IOException;
- ctor @Deprecated public Socket(String, int, boolean) throws java.io.IOException;
- ctor @Deprecated public Socket(java.net.InetAddress, int, boolean) throws java.io.IOException;
- method public void bind(java.net.SocketAddress) throws java.io.IOException;
- method public void close() throws java.io.IOException;
- method public void connect(java.net.SocketAddress) throws java.io.IOException;
- method public void connect(java.net.SocketAddress, int) throws java.io.IOException;
- method public java.nio.channels.SocketChannel getChannel();
- method public java.net.InetAddress getInetAddress();
- method public java.io.InputStream getInputStream() throws java.io.IOException;
- method public boolean getKeepAlive() throws java.net.SocketException;
- method public java.net.InetAddress getLocalAddress();
- method public int getLocalPort();
- method public java.net.SocketAddress getLocalSocketAddress();
- method public boolean getOOBInline() throws java.net.SocketException;
- method public java.io.OutputStream getOutputStream() throws java.io.IOException;
- method public int getPort();
- method public int getReceiveBufferSize() throws java.net.SocketException;
- method public java.net.SocketAddress getRemoteSocketAddress();
- method public boolean getReuseAddress() throws java.net.SocketException;
- method public int getSendBufferSize() throws java.net.SocketException;
- method public int getSoLinger() throws java.net.SocketException;
- method public int getSoTimeout() throws java.net.SocketException;
- method public boolean getTcpNoDelay() throws java.net.SocketException;
- method public int getTrafficClass() throws java.net.SocketException;
- method public boolean isBound();
- method public boolean isClosed();
- method public boolean isConnected();
- method public boolean isInputShutdown();
- method public boolean isOutputShutdown();
- method public void sendUrgentData(int) throws java.io.IOException;
- method public void setKeepAlive(boolean) throws java.net.SocketException;
- method public void setOOBInline(boolean) throws java.net.SocketException;
- method public void setPerformancePreferences(int, int, int);
- method public void setReceiveBufferSize(int) throws java.net.SocketException;
- method public void setReuseAddress(boolean) throws java.net.SocketException;
- method public void setSendBufferSize(int) throws java.net.SocketException;
- method public void setSoLinger(boolean, int) throws java.net.SocketException;
- method public void setSoTimeout(int) throws java.net.SocketException;
- method public static void setSocketImplFactory(java.net.SocketImplFactory) throws java.io.IOException;
- method public void setTcpNoDelay(boolean) throws java.net.SocketException;
- method public void setTrafficClass(int) throws java.net.SocketException;
- method public void shutdownInput() throws java.io.IOException;
- method public void shutdownOutput() throws java.io.IOException;
- }
-
- public abstract class SocketAddress implements java.io.Serializable {
- ctor public SocketAddress();
- }
-
- public class SocketException extends java.io.IOException {
- ctor public SocketException(String);
- ctor public SocketException();
- }
-
- public abstract class SocketImpl implements java.net.SocketOptions {
- ctor public SocketImpl();
- method protected abstract void accept(java.net.SocketImpl) throws java.io.IOException;
- method protected abstract int available() throws java.io.IOException;
- method protected abstract void bind(java.net.InetAddress, int) throws java.io.IOException;
- method protected abstract void close() throws java.io.IOException;
- method protected abstract void connect(String, int) throws java.io.IOException;
- method protected abstract void connect(java.net.InetAddress, int) throws java.io.IOException;
- method protected abstract void connect(java.net.SocketAddress, int) throws java.io.IOException;
- method protected abstract void create(boolean) throws java.io.IOException;
- method protected java.io.FileDescriptor getFileDescriptor();
- method protected java.net.InetAddress getInetAddress();
- method protected abstract java.io.InputStream getInputStream() throws java.io.IOException;
- method protected int getLocalPort();
- method protected abstract java.io.OutputStream getOutputStream() throws java.io.IOException;
- method protected int getPort();
- method protected abstract void listen(int) throws java.io.IOException;
- method protected abstract void sendUrgentData(int) throws java.io.IOException;
- method protected void setPerformancePreferences(int, int, int);
- method protected void shutdownInput() throws java.io.IOException;
- method protected void shutdownOutput() throws java.io.IOException;
- method protected boolean supportsUrgentData();
- field protected java.net.InetAddress address;
- field protected java.io.FileDescriptor fd;
- field protected int localport;
- field protected int port;
- }
-
- public interface SocketImplFactory {
- method public java.net.SocketImpl createSocketImpl();
- }
-
- public interface SocketOption<T> {
- method public String name();
- method public Class<T> type();
- }
-
- public interface SocketOptions {
- method public Object getOption(int) throws java.net.SocketException;
- method public void setOption(int, Object) throws java.net.SocketException;
- field public static final int IP_MULTICAST_IF = 16; // 0x10
- field public static final int IP_MULTICAST_IF2 = 31; // 0x1f
- field public static final int IP_MULTICAST_LOOP = 18; // 0x12
- field public static final int IP_TOS = 3; // 0x3
- field public static final int SO_BINDADDR = 15; // 0xf
- field public static final int SO_BROADCAST = 32; // 0x20
- field public static final int SO_KEEPALIVE = 8; // 0x8
- field public static final int SO_LINGER = 128; // 0x80
- field public static final int SO_OOBINLINE = 4099; // 0x1003
- field public static final int SO_RCVBUF = 4098; // 0x1002
- field public static final int SO_REUSEADDR = 4; // 0x4
- field public static final int SO_SNDBUF = 4097; // 0x1001
- field public static final int SO_TIMEOUT = 4102; // 0x1006
- field public static final int TCP_NODELAY = 1; // 0x1
- }
-
- public final class SocketPermission extends java.security.Permission implements java.io.Serializable {
- ctor public SocketPermission(String, String);
- method public String getActions();
- method public boolean implies(java.security.Permission);
- }
-
- public class SocketTimeoutException extends java.io.InterruptedIOException {
- ctor public SocketTimeoutException(String);
- ctor public SocketTimeoutException();
- }
-
- public enum StandardProtocolFamily implements java.net.ProtocolFamily {
- enum_constant public static final java.net.StandardProtocolFamily INET;
- enum_constant public static final java.net.StandardProtocolFamily INET6;
- }
-
- public final class StandardSocketOptions {
- field public static final java.net.SocketOption<java.net.NetworkInterface> IP_MULTICAST_IF;
- field public static final java.net.SocketOption<java.lang.Boolean> IP_MULTICAST_LOOP;
- field public static final java.net.SocketOption<java.lang.Integer> IP_MULTICAST_TTL;
- field public static final java.net.SocketOption<java.lang.Integer> IP_TOS;
- field public static final java.net.SocketOption<java.lang.Boolean> SO_BROADCAST;
- field public static final java.net.SocketOption<java.lang.Boolean> SO_KEEPALIVE;
- field public static final java.net.SocketOption<java.lang.Integer> SO_LINGER;
- field public static final java.net.SocketOption<java.lang.Integer> SO_RCVBUF;
- field public static final java.net.SocketOption<java.lang.Boolean> SO_REUSEADDR;
- field public static final java.net.SocketOption<java.lang.Integer> SO_SNDBUF;
- field public static final java.net.SocketOption<java.lang.Boolean> TCP_NODELAY;
- }
-
- public final class URI implements java.lang.Comparable<java.net.URI> java.io.Serializable {
- ctor public URI(String) throws java.net.URISyntaxException;
- ctor public URI(String, String, String, int, String, String, String) throws java.net.URISyntaxException;
- ctor public URI(String, String, String, String, String) throws java.net.URISyntaxException;
- ctor public URI(String, String, String, String) throws java.net.URISyntaxException;
- ctor public URI(String, String, String) throws java.net.URISyntaxException;
- method public int compareTo(java.net.URI);
- method public static java.net.URI create(String);
- method public String getAuthority();
- method public String getFragment();
- method public String getHost();
- method public String getPath();
- method public int getPort();
- method public String getQuery();
- method public String getRawAuthority();
- method public String getRawFragment();
- method public String getRawPath();
- method public String getRawQuery();
- method public String getRawSchemeSpecificPart();
- method public String getRawUserInfo();
- method public String getScheme();
- method public String getSchemeSpecificPart();
- method public String getUserInfo();
- method public boolean isAbsolute();
- method public boolean isOpaque();
- method public java.net.URI normalize();
- method public java.net.URI parseServerAuthority() throws java.net.URISyntaxException;
- method public java.net.URI relativize(java.net.URI);
- method public java.net.URI resolve(java.net.URI);
- method public java.net.URI resolve(String);
- method public String toASCIIString();
- method public java.net.URL toURL() throws java.net.MalformedURLException;
- }
-
- public class URISyntaxException extends java.lang.Exception {
- ctor public URISyntaxException(String, String, int);
- ctor public URISyntaxException(String, String);
- method public int getIndex();
- method public String getInput();
- method public String getReason();
- }
-
- public final class URL implements java.io.Serializable {
- ctor public URL(String, String, int, String) throws java.net.MalformedURLException;
- ctor public URL(String, String, String) throws java.net.MalformedURLException;
- ctor public URL(String, String, int, String, java.net.URLStreamHandler) throws java.net.MalformedURLException;
- ctor public URL(String) throws java.net.MalformedURLException;
- ctor public URL(java.net.URL, String) throws java.net.MalformedURLException;
- ctor public URL(java.net.URL, String, java.net.URLStreamHandler) throws java.net.MalformedURLException;
- method public String getAuthority();
- method public Object getContent() throws java.io.IOException;
- method public Object getContent(Class[]) throws java.io.IOException;
- method public int getDefaultPort();
- method public String getFile();
- method public String getHost();
- method public String getPath();
- method public int getPort();
- method public String getProtocol();
- method public String getQuery();
- method public String getRef();
- method public String getUserInfo();
- method public java.net.URLConnection openConnection() throws java.io.IOException;
- method public java.net.URLConnection openConnection(java.net.Proxy) throws java.io.IOException;
- method public java.io.InputStream openStream() throws java.io.IOException;
- method public boolean sameFile(java.net.URL);
- method public static void setURLStreamHandlerFactory(java.net.URLStreamHandlerFactory);
- method public String toExternalForm();
- method public java.net.URI toURI() throws java.net.URISyntaxException;
- }
-
- public class URLClassLoader extends java.security.SecureClassLoader implements java.io.Closeable {
- ctor public URLClassLoader(java.net.URL[], ClassLoader);
- ctor public URLClassLoader(java.net.URL[]);
- ctor public URLClassLoader(java.net.URL[], ClassLoader, java.net.URLStreamHandlerFactory);
- method protected void addURL(java.net.URL);
- method public void close() throws java.io.IOException;
- method protected Package definePackage(String, java.util.jar.Manifest, java.net.URL) throws java.lang.IllegalArgumentException;
- method public java.net.URL findResource(String);
- method public java.util.Enumeration<java.net.URL> findResources(String) throws java.io.IOException;
- method public java.net.URL[] getURLs();
- method public static java.net.URLClassLoader newInstance(java.net.URL[], ClassLoader);
- method public static java.net.URLClassLoader newInstance(java.net.URL[]);
- }
-
- public abstract class URLConnection {
- ctor protected URLConnection(java.net.URL);
- method public void addRequestProperty(String, String);
- method public abstract void connect() throws java.io.IOException;
- method public boolean getAllowUserInteraction();
- method public int getConnectTimeout();
- method public Object getContent() throws java.io.IOException;
- method public Object getContent(Class[]) throws java.io.IOException;
- method public String getContentEncoding();
- method public int getContentLength();
- method public long getContentLengthLong();
- method public String getContentType();
- method public long getDate();
- method public static boolean getDefaultAllowUserInteraction();
- method @Deprecated public static String getDefaultRequestProperty(String);
- method public boolean getDefaultUseCaches();
- method public boolean getDoInput();
- method public boolean getDoOutput();
- method public long getExpiration();
- method public static java.net.FileNameMap getFileNameMap();
- method public String getHeaderField(String);
- method public String getHeaderField(int);
- method public long getHeaderFieldDate(String, long);
- method public int getHeaderFieldInt(String, int);
- method public String getHeaderFieldKey(int);
- method public long getHeaderFieldLong(String, long);
- method public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaderFields();
- method public long getIfModifiedSince();
- method public java.io.InputStream getInputStream() throws java.io.IOException;
- method public long getLastModified();
- method public java.io.OutputStream getOutputStream() throws java.io.IOException;
- method public java.security.Permission getPermission() throws java.io.IOException;
- method public int getReadTimeout();
- method public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getRequestProperties();
- method public String getRequestProperty(String);
- method public java.net.URL getURL();
- method public boolean getUseCaches();
- method public static String guessContentTypeFromName(String);
- method public static String guessContentTypeFromStream(java.io.InputStream) throws java.io.IOException;
- method public void setAllowUserInteraction(boolean);
- method public void setConnectTimeout(int);
- method public static void setContentHandlerFactory(java.net.ContentHandlerFactory);
- method public static void setDefaultAllowUserInteraction(boolean);
- method @Deprecated public static void setDefaultRequestProperty(String, String);
- method public void setDefaultUseCaches(boolean);
- method public void setDoInput(boolean);
- method public void setDoOutput(boolean);
- method public static void setFileNameMap(java.net.FileNameMap);
- method public void setIfModifiedSince(long);
- method public void setReadTimeout(int);
- method public void setRequestProperty(String, String);
- method public void setUseCaches(boolean);
- field protected boolean allowUserInteraction;
- field protected boolean connected;
- field protected boolean doInput;
- field protected boolean doOutput;
- field protected long ifModifiedSince;
- field protected java.net.URL url;
- field protected boolean useCaches;
- }
-
- public class URLDecoder {
- ctor public URLDecoder();
- method @Deprecated public static String decode(String);
- method public static String decode(String, String) throws java.io.UnsupportedEncodingException;
- }
-
- public class URLEncoder {
- method @Deprecated public static String encode(String);
- method public static String encode(String, String) throws java.io.UnsupportedEncodingException;
- }
-
- public abstract class URLStreamHandler {
- ctor public URLStreamHandler();
- method protected boolean equals(java.net.URL, java.net.URL);
- method protected int getDefaultPort();
- method protected java.net.InetAddress getHostAddress(java.net.URL);
- method protected int hashCode(java.net.URL);
- method protected boolean hostsEqual(java.net.URL, java.net.URL);
- method protected abstract java.net.URLConnection openConnection(java.net.URL) throws java.io.IOException;
- method protected java.net.URLConnection openConnection(java.net.URL, java.net.Proxy) throws java.io.IOException;
- method protected void parseURL(java.net.URL, String, int, int);
- method protected boolean sameFile(java.net.URL, java.net.URL);
- method protected void setURL(java.net.URL, String, String, int, String, String, String, String, String);
- method @Deprecated protected void setURL(java.net.URL, String, String, int, String, String);
- method protected String toExternalForm(java.net.URL);
- }
-
- public interface URLStreamHandlerFactory {
- method public java.net.URLStreamHandler createURLStreamHandler(String);
- }
-
- public class UnknownHostException extends java.io.IOException {
- ctor public UnknownHostException(String);
- ctor public UnknownHostException();
- }
-
- public class UnknownServiceException extends java.io.IOException {
- ctor public UnknownServiceException();
- ctor public UnknownServiceException(String);
- }
-
-}
-
-package java.nio {
-
- public abstract class Buffer {
- method public abstract Object array();
- method public abstract int arrayOffset();
- method public final int capacity();
- method public java.nio.Buffer clear();
- method public java.nio.Buffer flip();
- method public abstract boolean hasArray();
- method public final boolean hasRemaining();
- method public abstract boolean isDirect();
- method public abstract boolean isReadOnly();
- method public final int limit();
- method public java.nio.Buffer limit(int);
- method public java.nio.Buffer mark();
- method public final int position();
- method public java.nio.Buffer position(int);
- method public final int remaining();
- method public java.nio.Buffer reset();
- method public java.nio.Buffer rewind();
- }
-
- public class BufferOverflowException extends java.lang.RuntimeException {
- ctor public BufferOverflowException();
- }
-
- public class BufferUnderflowException extends java.lang.RuntimeException {
- ctor public BufferUnderflowException();
- }
-
- public abstract class ByteBuffer extends java.nio.Buffer implements java.lang.Comparable<java.nio.ByteBuffer> {
- method @NonNull public static java.nio.ByteBuffer allocate(int);
- method @NonNull public static java.nio.ByteBuffer allocateDirect(int);
- method @NonNull public final byte[] array();
- method public final int arrayOffset();
- method @NonNull public abstract java.nio.CharBuffer asCharBuffer();
- method @NonNull public abstract java.nio.DoubleBuffer asDoubleBuffer();
- method @NonNull public abstract java.nio.FloatBuffer asFloatBuffer();
- method @NonNull public abstract java.nio.IntBuffer asIntBuffer();
- method @NonNull public abstract java.nio.LongBuffer asLongBuffer();
- method @NonNull public abstract java.nio.ByteBuffer asReadOnlyBuffer();
- method @NonNull public abstract java.nio.ShortBuffer asShortBuffer();
- method @NonNull public abstract java.nio.ByteBuffer compact();
- method public int compareTo(@NonNull java.nio.ByteBuffer);
- method @NonNull public abstract java.nio.ByteBuffer duplicate();
- method public abstract byte get();
- method public abstract byte get(int);
- method @NonNull public java.nio.ByteBuffer get(@NonNull byte[], int, int);
- method @NonNull public java.nio.ByteBuffer get(@NonNull byte[]);
- method public abstract char getChar();
- method public abstract char getChar(int);
- method public abstract double getDouble();
- method public abstract double getDouble(int);
- method public abstract float getFloat();
- method public abstract float getFloat(int);
- method public abstract int getInt();
- method public abstract int getInt(int);
- method public abstract long getLong();
- method public abstract long getLong(int);
- method public abstract short getShort();
- method public abstract short getShort(int);
- method public final boolean hasArray();
- method @NonNull public final java.nio.ByteOrder order();
- method @NonNull public final java.nio.ByteBuffer order(@NonNull java.nio.ByteOrder);
- method @NonNull public abstract java.nio.ByteBuffer put(byte);
- method @NonNull public abstract java.nio.ByteBuffer put(int, byte);
- method @NonNull public java.nio.ByteBuffer put(@NonNull java.nio.ByteBuffer);
- method @NonNull public java.nio.ByteBuffer put(@NonNull byte[], int, int);
- method @NonNull public final java.nio.ByteBuffer put(@NonNull byte[]);
- method @NonNull public abstract java.nio.ByteBuffer putChar(char);
- method @NonNull public abstract java.nio.ByteBuffer putChar(int, char);
- method @NonNull public abstract java.nio.ByteBuffer putDouble(double);
- method @NonNull public abstract java.nio.ByteBuffer putDouble(int, double);
- method @NonNull public abstract java.nio.ByteBuffer putFloat(float);
- method @NonNull public abstract java.nio.ByteBuffer putFloat(int, float);
- method @NonNull public abstract java.nio.ByteBuffer putInt(int);
- method @NonNull public abstract java.nio.ByteBuffer putInt(int, int);
- method @NonNull public abstract java.nio.ByteBuffer putLong(long);
- method @NonNull public abstract java.nio.ByteBuffer putLong(int, long);
- method @NonNull public abstract java.nio.ByteBuffer putShort(short);
- method @NonNull public abstract java.nio.ByteBuffer putShort(int, short);
- method @NonNull public abstract java.nio.ByteBuffer slice();
- method @NonNull public static java.nio.ByteBuffer wrap(@NonNull byte[], int, int);
- method @NonNull public static java.nio.ByteBuffer wrap(@NonNull byte[]);
- }
-
- public final class ByteOrder {
- method public static java.nio.ByteOrder nativeOrder();
- field public static final java.nio.ByteOrder BIG_ENDIAN;
- field public static final java.nio.ByteOrder LITTLE_ENDIAN;
- }
-
- public abstract class CharBuffer extends java.nio.Buffer implements java.lang.Appendable java.lang.CharSequence java.lang.Comparable<java.nio.CharBuffer> java.lang.Readable {
- method public static java.nio.CharBuffer allocate(int);
- method public java.nio.CharBuffer append(CharSequence);
- method public java.nio.CharBuffer append(CharSequence, int, int);
- method public java.nio.CharBuffer append(char);
- method public final char[] array();
- method public final int arrayOffset();
- method public abstract java.nio.CharBuffer asReadOnlyBuffer();
- method public final char charAt(int);
- method public abstract java.nio.CharBuffer compact();
- method public int compareTo(java.nio.CharBuffer);
- method public abstract java.nio.CharBuffer duplicate();
- method public abstract char get();
- method public abstract char get(int);
- method public java.nio.CharBuffer get(char[], int, int);
- method public java.nio.CharBuffer get(char[]);
- method public final boolean hasArray();
- method public final int length();
- method public abstract java.nio.ByteOrder order();
- method public abstract java.nio.CharBuffer put(char);
- method public abstract java.nio.CharBuffer put(int, char);
- method public java.nio.CharBuffer put(java.nio.CharBuffer);
- method public java.nio.CharBuffer put(char[], int, int);
- method public final java.nio.CharBuffer put(char[]);
- method public java.nio.CharBuffer put(String, int, int);
- method public final java.nio.CharBuffer put(String);
- method public int read(java.nio.CharBuffer) throws java.io.IOException;
- method public abstract java.nio.CharBuffer slice();
- method public abstract java.nio.CharBuffer subSequence(int, int);
- method public static java.nio.CharBuffer wrap(char[], int, int);
- method public static java.nio.CharBuffer wrap(char[]);
- method public static java.nio.CharBuffer wrap(CharSequence, int, int);
- method public static java.nio.CharBuffer wrap(CharSequence);
- }
-
- public abstract class DoubleBuffer extends java.nio.Buffer implements java.lang.Comparable<java.nio.DoubleBuffer> {
- method public static java.nio.DoubleBuffer allocate(int);
- method public final double[] array();
- method public final int arrayOffset();
- method public abstract java.nio.DoubleBuffer asReadOnlyBuffer();
- method public abstract java.nio.DoubleBuffer compact();
- method public int compareTo(java.nio.DoubleBuffer);
- method public abstract java.nio.DoubleBuffer duplicate();
- method public abstract double get();
- method public abstract double get(int);
- method public java.nio.DoubleBuffer get(double[], int, int);
- method public java.nio.DoubleBuffer get(double[]);
- method public final boolean hasArray();
- method public abstract java.nio.ByteOrder order();
- method public abstract java.nio.DoubleBuffer put(double);
- method public abstract java.nio.DoubleBuffer put(int, double);
- method public java.nio.DoubleBuffer put(java.nio.DoubleBuffer);
- method public java.nio.DoubleBuffer put(double[], int, int);
- method public final java.nio.DoubleBuffer put(double[]);
- method public abstract java.nio.DoubleBuffer slice();
- method public static java.nio.DoubleBuffer wrap(double[], int, int);
- method public static java.nio.DoubleBuffer wrap(double[]);
- }
-
- public abstract class FloatBuffer extends java.nio.Buffer implements java.lang.Comparable<java.nio.FloatBuffer> {
- method public static java.nio.FloatBuffer allocate(int);
- method public final float[] array();
- method public final int arrayOffset();
- method public abstract java.nio.FloatBuffer asReadOnlyBuffer();
- method public abstract java.nio.FloatBuffer compact();
- method public int compareTo(java.nio.FloatBuffer);
- method public abstract java.nio.FloatBuffer duplicate();
- method public abstract float get();
- method public abstract float get(int);
- method public java.nio.FloatBuffer get(float[], int, int);
- method public java.nio.FloatBuffer get(float[]);
- method public final boolean hasArray();
- method public abstract java.nio.ByteOrder order();
- method public abstract java.nio.FloatBuffer put(float);
- method public abstract java.nio.FloatBuffer put(int, float);
- method public java.nio.FloatBuffer put(java.nio.FloatBuffer);
- method public java.nio.FloatBuffer put(float[], int, int);
- method public final java.nio.FloatBuffer put(float[]);
- method public abstract java.nio.FloatBuffer slice();
- method public static java.nio.FloatBuffer wrap(float[], int, int);
- method public static java.nio.FloatBuffer wrap(float[]);
- }
-
- public abstract class IntBuffer extends java.nio.Buffer implements java.lang.Comparable<java.nio.IntBuffer> {
- method public static java.nio.IntBuffer allocate(int);
- method public final int[] array();
- method public final int arrayOffset();
- method public abstract java.nio.IntBuffer asReadOnlyBuffer();
- method public abstract java.nio.IntBuffer compact();
- method public int compareTo(java.nio.IntBuffer);
- method public abstract java.nio.IntBuffer duplicate();
- method public abstract int get();
- method public abstract int get(int);
- method public java.nio.IntBuffer get(int[], int, int);
- method public java.nio.IntBuffer get(int[]);
- method public final boolean hasArray();
- method public abstract java.nio.ByteOrder order();
- method public abstract java.nio.IntBuffer put(int);
- method public abstract java.nio.IntBuffer put(int, int);
- method public java.nio.IntBuffer put(java.nio.IntBuffer);
- method public java.nio.IntBuffer put(int[], int, int);
- method public final java.nio.IntBuffer put(int[]);
- method public abstract java.nio.IntBuffer slice();
- method public static java.nio.IntBuffer wrap(int[], int, int);
- method public static java.nio.IntBuffer wrap(int[]);
- }
-
- public class InvalidMarkException extends java.lang.IllegalStateException {
- ctor public InvalidMarkException();
- }
-
- public abstract class LongBuffer extends java.nio.Buffer implements java.lang.Comparable<java.nio.LongBuffer> {
- method public static java.nio.LongBuffer allocate(int);
- method public final long[] array();
- method public final int arrayOffset();
- method public abstract java.nio.LongBuffer asReadOnlyBuffer();
- method public abstract java.nio.LongBuffer compact();
- method public int compareTo(java.nio.LongBuffer);
- method public abstract java.nio.LongBuffer duplicate();
- method public abstract long get();
- method public abstract long get(int);
- method public java.nio.LongBuffer get(long[], int, int);
- method public java.nio.LongBuffer get(long[]);
- method public final boolean hasArray();
- method public abstract java.nio.ByteOrder order();
- method public abstract java.nio.LongBuffer put(long);
- method public abstract java.nio.LongBuffer put(int, long);
- method public java.nio.LongBuffer put(java.nio.LongBuffer);
- method public java.nio.LongBuffer put(long[], int, int);
- method public final java.nio.LongBuffer put(long[]);
- method public abstract java.nio.LongBuffer slice();
- method public static java.nio.LongBuffer wrap(long[], int, int);
- method public static java.nio.LongBuffer wrap(long[]);
- }
-
- public abstract class MappedByteBuffer extends java.nio.ByteBuffer {
- method public final java.nio.MappedByteBuffer force();
- method public final boolean isLoaded();
- method public final java.nio.MappedByteBuffer load();
- }
-
- public class ReadOnlyBufferException extends java.lang.UnsupportedOperationException {
- ctor public ReadOnlyBufferException();
- }
-
- public abstract class ShortBuffer extends java.nio.Buffer implements java.lang.Comparable<java.nio.ShortBuffer> {
- method public static java.nio.ShortBuffer allocate(int);
- method public final short[] array();
- method public final int arrayOffset();
- method public abstract java.nio.ShortBuffer asReadOnlyBuffer();
- method public abstract java.nio.ShortBuffer compact();
- method public int compareTo(java.nio.ShortBuffer);
- method public abstract java.nio.ShortBuffer duplicate();
- method public abstract short get();
- method public abstract short get(int);
- method public java.nio.ShortBuffer get(short[], int, int);
- method public java.nio.ShortBuffer get(short[]);
- method public final boolean hasArray();
- method public abstract java.nio.ByteOrder order();
- method public abstract java.nio.ShortBuffer put(short);
- method public abstract java.nio.ShortBuffer put(int, short);
- method public java.nio.ShortBuffer put(java.nio.ShortBuffer);
- method public java.nio.ShortBuffer put(short[], int, int);
- method public final java.nio.ShortBuffer put(short[]);
- method public abstract java.nio.ShortBuffer slice();
- method public static java.nio.ShortBuffer wrap(short[], int, int);
- method public static java.nio.ShortBuffer wrap(short[]);
- }
-
-}
-
-package java.nio.channels {
-
- public class AcceptPendingException extends java.lang.IllegalStateException {
- ctor public AcceptPendingException();
- }
-
- public class AlreadyBoundException extends java.lang.IllegalStateException {
- ctor public AlreadyBoundException();
- }
-
- public class AlreadyConnectedException extends java.lang.IllegalStateException {
- ctor public AlreadyConnectedException();
- }
-
- public interface AsynchronousByteChannel extends java.nio.channels.AsynchronousChannel {
- method public <A> void read(java.nio.ByteBuffer, A, java.nio.channels.CompletionHandler<java.lang.Integer,? super A>);
- method public java.util.concurrent.Future<java.lang.Integer> read(java.nio.ByteBuffer);
- method public <A> void write(java.nio.ByteBuffer, A, java.nio.channels.CompletionHandler<java.lang.Integer,? super A>);
- method public java.util.concurrent.Future<java.lang.Integer> write(java.nio.ByteBuffer);
- }
-
- public interface AsynchronousChannel extends java.nio.channels.Channel {
- }
-
- public abstract class AsynchronousChannelGroup {
- ctor protected AsynchronousChannelGroup(java.nio.channels.spi.AsynchronousChannelProvider);
- method public abstract boolean awaitTermination(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public abstract boolean isShutdown();
- method public abstract boolean isTerminated();
- method public final java.nio.channels.spi.AsynchronousChannelProvider provider();
- method public abstract void shutdown();
- method public abstract void shutdownNow() throws java.io.IOException;
- method public static java.nio.channels.AsynchronousChannelGroup withCachedThreadPool(java.util.concurrent.ExecutorService, int) throws java.io.IOException;
- method public static java.nio.channels.AsynchronousChannelGroup withFixedThreadPool(int, java.util.concurrent.ThreadFactory) throws java.io.IOException;
- method public static java.nio.channels.AsynchronousChannelGroup withThreadPool(java.util.concurrent.ExecutorService) throws java.io.IOException;
- }
-
- public class AsynchronousCloseException extends java.nio.channels.ClosedChannelException {
- ctor public AsynchronousCloseException();
- }
-
- public abstract class AsynchronousFileChannel implements java.nio.channels.AsynchronousChannel {
- ctor protected AsynchronousFileChannel();
- method public abstract void force(boolean) throws java.io.IOException;
- method public abstract <A> void lock(long, long, boolean, A, java.nio.channels.CompletionHandler<java.nio.channels.FileLock,? super A>);
- method public final <A> void lock(A, java.nio.channels.CompletionHandler<java.nio.channels.FileLock,? super A>);
- method public abstract java.util.concurrent.Future<java.nio.channels.FileLock> lock(long, long, boolean);
- method public final java.util.concurrent.Future<java.nio.channels.FileLock> lock();
- method public static java.nio.channels.AsynchronousFileChannel open(java.nio.file.Path, java.util.Set<? extends java.nio.file.OpenOption>, java.util.concurrent.ExecutorService, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public static java.nio.channels.AsynchronousFileChannel open(java.nio.file.Path, java.nio.file.OpenOption...) throws java.io.IOException;
- method public abstract <A> void read(java.nio.ByteBuffer, long, A, java.nio.channels.CompletionHandler<java.lang.Integer,? super A>);
- method public abstract java.util.concurrent.Future<java.lang.Integer> read(java.nio.ByteBuffer, long);
- method public abstract long size() throws java.io.IOException;
- method public abstract java.nio.channels.AsynchronousFileChannel truncate(long) throws java.io.IOException;
- method public abstract java.nio.channels.FileLock tryLock(long, long, boolean) throws java.io.IOException;
- method public final java.nio.channels.FileLock tryLock() throws java.io.IOException;
- method public abstract <A> void write(java.nio.ByteBuffer, long, A, java.nio.channels.CompletionHandler<java.lang.Integer,? super A>);
- method public abstract java.util.concurrent.Future<java.lang.Integer> write(java.nio.ByteBuffer, long);
- }
-
- public abstract class AsynchronousServerSocketChannel implements java.nio.channels.AsynchronousChannel java.nio.channels.NetworkChannel {
- ctor protected AsynchronousServerSocketChannel(java.nio.channels.spi.AsynchronousChannelProvider);
- method public abstract <A> void accept(A, java.nio.channels.CompletionHandler<java.nio.channels.AsynchronousSocketChannel,? super A>);
- method public abstract java.util.concurrent.Future<java.nio.channels.AsynchronousSocketChannel> accept();
- method public final java.nio.channels.AsynchronousServerSocketChannel bind(java.net.SocketAddress) throws java.io.IOException;
- method public abstract java.nio.channels.AsynchronousServerSocketChannel bind(java.net.SocketAddress, int) throws java.io.IOException;
- method public static java.nio.channels.AsynchronousServerSocketChannel open(java.nio.channels.AsynchronousChannelGroup) throws java.io.IOException;
- method public static java.nio.channels.AsynchronousServerSocketChannel open() throws java.io.IOException;
- method public final java.nio.channels.spi.AsynchronousChannelProvider provider();
- method public abstract <T> java.nio.channels.AsynchronousServerSocketChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
- }
-
- public abstract class AsynchronousSocketChannel implements java.nio.channels.AsynchronousByteChannel java.nio.channels.NetworkChannel {
- ctor protected AsynchronousSocketChannel(java.nio.channels.spi.AsynchronousChannelProvider);
- method public abstract java.nio.channels.AsynchronousSocketChannel bind(java.net.SocketAddress) throws java.io.IOException;
- method public abstract <A> void connect(java.net.SocketAddress, A, java.nio.channels.CompletionHandler<java.lang.Void,? super A>);
- method public abstract java.util.concurrent.Future<java.lang.Void> connect(java.net.SocketAddress);
- method public abstract java.net.SocketAddress getRemoteAddress() throws java.io.IOException;
- method public static java.nio.channels.AsynchronousSocketChannel open(java.nio.channels.AsynchronousChannelGroup) throws java.io.IOException;
- method public static java.nio.channels.AsynchronousSocketChannel open() throws java.io.IOException;
- method public final java.nio.channels.spi.AsynchronousChannelProvider provider();
- method public abstract <A> void read(java.nio.ByteBuffer, long, java.util.concurrent.TimeUnit, A, java.nio.channels.CompletionHandler<java.lang.Integer,? super A>);
- method public final <A> void read(java.nio.ByteBuffer, A, java.nio.channels.CompletionHandler<java.lang.Integer,? super A>);
- method public abstract <A> void read(java.nio.ByteBuffer[], int, int, long, java.util.concurrent.TimeUnit, A, java.nio.channels.CompletionHandler<java.lang.Long,? super A>);
- method public abstract <T> java.nio.channels.AsynchronousSocketChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
- method public abstract java.nio.channels.AsynchronousSocketChannel shutdownInput() throws java.io.IOException;
- method public abstract java.nio.channels.AsynchronousSocketChannel shutdownOutput() throws java.io.IOException;
- method public abstract <A> void write(java.nio.ByteBuffer, long, java.util.concurrent.TimeUnit, A, java.nio.channels.CompletionHandler<java.lang.Integer,? super A>);
- method public final <A> void write(java.nio.ByteBuffer, A, java.nio.channels.CompletionHandler<java.lang.Integer,? super A>);
- method public abstract <A> void write(java.nio.ByteBuffer[], int, int, long, java.util.concurrent.TimeUnit, A, java.nio.channels.CompletionHandler<java.lang.Long,? super A>);
- }
-
- public interface ByteChannel extends java.nio.channels.ReadableByteChannel java.nio.channels.WritableByteChannel {
- }
-
- public class CancelledKeyException extends java.lang.IllegalStateException {
- ctor public CancelledKeyException();
- }
-
- public interface Channel extends java.io.Closeable {
- method public boolean isOpen();
- }
-
- public final class Channels {
- method public static java.nio.channels.ReadableByteChannel newChannel(java.io.InputStream);
- method public static java.nio.channels.WritableByteChannel newChannel(java.io.OutputStream);
- method public static java.io.InputStream newInputStream(java.nio.channels.ReadableByteChannel);
- method public static java.io.InputStream newInputStream(java.nio.channels.AsynchronousByteChannel);
- method public static java.io.OutputStream newOutputStream(java.nio.channels.WritableByteChannel);
- method public static java.io.OutputStream newOutputStream(java.nio.channels.AsynchronousByteChannel);
- method public static java.io.Reader newReader(java.nio.channels.ReadableByteChannel, java.nio.charset.CharsetDecoder, int);
- method public static java.io.Reader newReader(java.nio.channels.ReadableByteChannel, String);
- method public static java.io.Writer newWriter(java.nio.channels.WritableByteChannel, java.nio.charset.CharsetEncoder, int);
- method public static java.io.Writer newWriter(java.nio.channels.WritableByteChannel, String);
- }
-
- public class ClosedByInterruptException extends java.nio.channels.AsynchronousCloseException {
- ctor public ClosedByInterruptException();
- }
-
- public class ClosedChannelException extends java.io.IOException {
- ctor public ClosedChannelException();
- }
-
- public class ClosedSelectorException extends java.lang.IllegalStateException {
- ctor public ClosedSelectorException();
- }
-
- public interface CompletionHandler<V, A> {
- method public void completed(V, A);
- method public void failed(Throwable, A);
- }
-
- public class ConnectionPendingException extends java.lang.IllegalStateException {
- ctor public ConnectionPendingException();
- }
-
- public abstract class DatagramChannel extends java.nio.channels.spi.AbstractSelectableChannel implements java.nio.channels.ByteChannel java.nio.channels.GatheringByteChannel java.nio.channels.MulticastChannel java.nio.channels.ScatteringByteChannel {
- ctor protected DatagramChannel(java.nio.channels.spi.SelectorProvider);
- method public abstract java.nio.channels.DatagramChannel bind(java.net.SocketAddress) throws java.io.IOException;
- method public abstract java.nio.channels.DatagramChannel connect(java.net.SocketAddress) throws java.io.IOException;
- method public abstract java.nio.channels.DatagramChannel disconnect() throws java.io.IOException;
- method public abstract java.net.SocketAddress getRemoteAddress() throws java.io.IOException;
- method public abstract boolean isConnected();
- method public static java.nio.channels.DatagramChannel open() throws java.io.IOException;
- method public static java.nio.channels.DatagramChannel open(java.net.ProtocolFamily) throws java.io.IOException;
- method public final long read(java.nio.ByteBuffer[]) throws java.io.IOException;
- method public abstract java.net.SocketAddress receive(java.nio.ByteBuffer) throws java.io.IOException;
- method public abstract int send(java.nio.ByteBuffer, java.net.SocketAddress) throws java.io.IOException;
- method public abstract <T> java.nio.channels.DatagramChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
- method public abstract java.net.DatagramSocket socket();
- method public final int validOps();
- method public final long write(java.nio.ByteBuffer[]) throws java.io.IOException;
- }
-
- public abstract class FileChannel extends java.nio.channels.spi.AbstractInterruptibleChannel implements java.nio.channels.GatheringByteChannel java.nio.channels.ScatteringByteChannel java.nio.channels.SeekableByteChannel {
- ctor protected FileChannel();
- method public abstract void force(boolean) throws java.io.IOException;
- method public abstract java.nio.channels.FileLock lock(long, long, boolean) throws java.io.IOException;
- method public final java.nio.channels.FileLock lock() throws java.io.IOException;
- method public abstract java.nio.MappedByteBuffer map(java.nio.channels.FileChannel.MapMode, long, long) throws java.io.IOException;
- method public static java.nio.channels.FileChannel open(java.nio.file.Path, java.util.Set<? extends java.nio.file.OpenOption>, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public static java.nio.channels.FileChannel open(java.nio.file.Path, java.nio.file.OpenOption...) throws java.io.IOException;
- method public abstract java.nio.channels.FileChannel position(long) throws java.io.IOException;
- method public final long read(java.nio.ByteBuffer[]) throws java.io.IOException;
- method public abstract int read(java.nio.ByteBuffer, long) throws java.io.IOException;
- method public abstract long transferFrom(java.nio.channels.ReadableByteChannel, long, long) throws java.io.IOException;
- method public abstract long transferTo(long, long, java.nio.channels.WritableByteChannel) throws java.io.IOException;
- method public abstract java.nio.channels.FileChannel truncate(long) throws java.io.IOException;
- method public abstract java.nio.channels.FileLock tryLock(long, long, boolean) throws java.io.IOException;
- method public final java.nio.channels.FileLock tryLock() throws java.io.IOException;
- method public final long write(java.nio.ByteBuffer[]) throws java.io.IOException;
- method public abstract int write(java.nio.ByteBuffer, long) throws java.io.IOException;
- }
-
- public static class FileChannel.MapMode {
- field public static final java.nio.channels.FileChannel.MapMode PRIVATE;
- field public static final java.nio.channels.FileChannel.MapMode READ_ONLY;
- field public static final java.nio.channels.FileChannel.MapMode READ_WRITE;
- }
-
- public abstract class FileLock implements java.lang.AutoCloseable {
- ctor protected FileLock(java.nio.channels.FileChannel, long, long, boolean);
- ctor protected FileLock(java.nio.channels.AsynchronousFileChannel, long, long, boolean);
- method public java.nio.channels.Channel acquiredBy();
- method public final java.nio.channels.FileChannel channel();
- method public final void close() throws java.io.IOException;
- method public final boolean isShared();
- method public abstract boolean isValid();
- method public final boolean overlaps(long, long);
- method public final long position();
- method public abstract void release() throws java.io.IOException;
- method public final long size();
- method public final String toString();
- }
-
- public class FileLockInterruptionException extends java.io.IOException {
- ctor public FileLockInterruptionException();
- }
-
- public interface GatheringByteChannel extends java.nio.channels.WritableByteChannel {
- method public long write(java.nio.ByteBuffer[], int, int) throws java.io.IOException;
- method public long write(java.nio.ByteBuffer[]) throws java.io.IOException;
- }
-
- public class IllegalBlockingModeException extends java.lang.IllegalStateException {
- ctor public IllegalBlockingModeException();
- }
-
- public class IllegalChannelGroupException extends java.lang.IllegalArgumentException {
- ctor public IllegalChannelGroupException();
- }
-
- public class IllegalSelectorException extends java.lang.IllegalArgumentException {
- ctor public IllegalSelectorException();
- }
-
- public class InterruptedByTimeoutException extends java.io.IOException {
- ctor public InterruptedByTimeoutException();
- }
-
- public interface InterruptibleChannel extends java.nio.channels.Channel {
- }
-
- public abstract class MembershipKey {
- ctor protected MembershipKey();
- method public abstract java.nio.channels.MembershipKey block(java.net.InetAddress) throws java.io.IOException;
- method public abstract java.nio.channels.MulticastChannel channel();
- method public abstract void drop();
- method public abstract java.net.InetAddress group();
- method public abstract boolean isValid();
- method public abstract java.net.NetworkInterface networkInterface();
- method public abstract java.net.InetAddress sourceAddress();
- method public abstract java.nio.channels.MembershipKey unblock(java.net.InetAddress);
- }
-
- public interface MulticastChannel extends java.nio.channels.NetworkChannel {
- method public java.nio.channels.MembershipKey join(java.net.InetAddress, java.net.NetworkInterface) throws java.io.IOException;
- method public java.nio.channels.MembershipKey join(java.net.InetAddress, java.net.NetworkInterface, java.net.InetAddress) throws java.io.IOException;
- }
-
- public interface NetworkChannel extends java.nio.channels.Channel {
- method public java.nio.channels.NetworkChannel bind(java.net.SocketAddress) throws java.io.IOException;
- method public java.net.SocketAddress getLocalAddress() throws java.io.IOException;
- method public <T> T getOption(java.net.SocketOption<T>) throws java.io.IOException;
- method public <T> java.nio.channels.NetworkChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
- method public java.util.Set<java.net.SocketOption<?>> supportedOptions();
- }
-
- public class NoConnectionPendingException extends java.lang.IllegalStateException {
- ctor public NoConnectionPendingException();
- }
-
- public class NonReadableChannelException extends java.lang.IllegalStateException {
- ctor public NonReadableChannelException();
- }
-
- public class NonWritableChannelException extends java.lang.IllegalStateException {
- ctor public NonWritableChannelException();
- }
-
- public class NotYetBoundException extends java.lang.IllegalStateException {
- ctor public NotYetBoundException();
- }
-
- public class NotYetConnectedException extends java.lang.IllegalStateException {
- ctor public NotYetConnectedException();
- }
-
- public class OverlappingFileLockException extends java.lang.IllegalStateException {
- ctor public OverlappingFileLockException();
- }
-
- public abstract class Pipe {
- ctor protected Pipe();
- method public static java.nio.channels.Pipe open() throws java.io.IOException;
- method public abstract java.nio.channels.Pipe.SinkChannel sink();
- method public abstract java.nio.channels.Pipe.SourceChannel source();
- }
-
- public abstract static class Pipe.SinkChannel extends java.nio.channels.spi.AbstractSelectableChannel implements java.nio.channels.GatheringByteChannel java.nio.channels.WritableByteChannel {
- ctor protected Pipe.SinkChannel(java.nio.channels.spi.SelectorProvider);
- method public final int validOps();
- }
-
- public abstract static class Pipe.SourceChannel extends java.nio.channels.spi.AbstractSelectableChannel implements java.nio.channels.ReadableByteChannel java.nio.channels.ScatteringByteChannel {
- ctor protected Pipe.SourceChannel(java.nio.channels.spi.SelectorProvider);
- method public final int validOps();
- }
-
- public class ReadPendingException extends java.lang.IllegalStateException {
- ctor public ReadPendingException();
- }
-
- public interface ReadableByteChannel extends java.nio.channels.Channel {
- method public int read(java.nio.ByteBuffer) throws java.io.IOException;
- }
-
- public interface ScatteringByteChannel extends java.nio.channels.ReadableByteChannel {
- method public long read(java.nio.ByteBuffer[], int, int) throws java.io.IOException;
- method public long read(java.nio.ByteBuffer[]) throws java.io.IOException;
- }
-
- public interface SeekableByteChannel extends java.nio.channels.ByteChannel {
- method public long position() throws java.io.IOException;
- method public java.nio.channels.SeekableByteChannel position(long) throws java.io.IOException;
- method public long size() throws java.io.IOException;
- method public java.nio.channels.SeekableByteChannel truncate(long) throws java.io.IOException;
- }
-
- public abstract class SelectableChannel extends java.nio.channels.spi.AbstractInterruptibleChannel implements java.nio.channels.Channel {
- ctor protected SelectableChannel();
- method public abstract Object blockingLock();
- method public abstract java.nio.channels.SelectableChannel configureBlocking(boolean) throws java.io.IOException;
- method public abstract boolean isBlocking();
- method public abstract boolean isRegistered();
- method public abstract java.nio.channels.SelectionKey keyFor(java.nio.channels.Selector);
- method public abstract java.nio.channels.spi.SelectorProvider provider();
- method public abstract java.nio.channels.SelectionKey register(java.nio.channels.Selector, int, Object) throws java.nio.channels.ClosedChannelException;
- method public final java.nio.channels.SelectionKey register(java.nio.channels.Selector, int) throws java.nio.channels.ClosedChannelException;
- method public abstract int validOps();
- }
-
- public abstract class SelectionKey {
- ctor protected SelectionKey();
- method public final Object attach(Object);
- method public final Object attachment();
- method public abstract void cancel();
- method public abstract java.nio.channels.SelectableChannel channel();
- method public abstract int interestOps();
- method public abstract java.nio.channels.SelectionKey interestOps(int);
- method public final boolean isAcceptable();
- method public final boolean isConnectable();
- method public final boolean isReadable();
- method public abstract boolean isValid();
- method public final boolean isWritable();
- method public abstract int readyOps();
- method public abstract java.nio.channels.Selector selector();
- field public static final int OP_ACCEPT = 16; // 0x10
- field public static final int OP_CONNECT = 8; // 0x8
- field public static final int OP_READ = 1; // 0x1
- field public static final int OP_WRITE = 4; // 0x4
- }
-
- public abstract class Selector implements java.io.Closeable {
- ctor protected Selector();
- method public abstract boolean isOpen();
- method public abstract java.util.Set<java.nio.channels.SelectionKey> keys();
- method public static java.nio.channels.Selector open() throws java.io.IOException;
- method public abstract java.nio.channels.spi.SelectorProvider provider();
- method public abstract int select(long) throws java.io.IOException;
- method public abstract int select() throws java.io.IOException;
- method public abstract int selectNow() throws java.io.IOException;
- method public abstract java.util.Set<java.nio.channels.SelectionKey> selectedKeys();
- method public abstract java.nio.channels.Selector wakeup();
- }
-
- public abstract class ServerSocketChannel extends java.nio.channels.spi.AbstractSelectableChannel implements java.nio.channels.NetworkChannel {
- ctor protected ServerSocketChannel(java.nio.channels.spi.SelectorProvider);
- method public abstract java.nio.channels.SocketChannel accept() throws java.io.IOException;
- method public final java.nio.channels.ServerSocketChannel bind(java.net.SocketAddress) throws java.io.IOException;
- method public abstract java.nio.channels.ServerSocketChannel bind(java.net.SocketAddress, int) throws java.io.IOException;
- method public static java.nio.channels.ServerSocketChannel open() throws java.io.IOException;
- method public abstract <T> java.nio.channels.ServerSocketChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
- method public abstract java.net.ServerSocket socket();
- method public final int validOps();
- }
-
- public class ShutdownChannelGroupException extends java.lang.IllegalStateException {
- ctor public ShutdownChannelGroupException();
- }
-
- public abstract class SocketChannel extends java.nio.channels.spi.AbstractSelectableChannel implements java.nio.channels.ByteChannel java.nio.channels.GatheringByteChannel java.nio.channels.NetworkChannel java.nio.channels.ScatteringByteChannel {
- ctor protected SocketChannel(java.nio.channels.spi.SelectorProvider);
- method public abstract java.nio.channels.SocketChannel bind(java.net.SocketAddress) throws java.io.IOException;
- method public abstract boolean connect(java.net.SocketAddress) throws java.io.IOException;
- method public abstract boolean finishConnect() throws java.io.IOException;
- method public abstract java.net.SocketAddress getRemoteAddress() throws java.io.IOException;
- method public abstract boolean isConnected();
- method public abstract boolean isConnectionPending();
- method public static java.nio.channels.SocketChannel open() throws java.io.IOException;
- method public static java.nio.channels.SocketChannel open(java.net.SocketAddress) throws java.io.IOException;
- method public final long read(java.nio.ByteBuffer[]) throws java.io.IOException;
- method public abstract <T> java.nio.channels.SocketChannel setOption(java.net.SocketOption<T>, T) throws java.io.IOException;
- method public abstract java.nio.channels.SocketChannel shutdownInput() throws java.io.IOException;
- method public abstract java.nio.channels.SocketChannel shutdownOutput() throws java.io.IOException;
- method public abstract java.net.Socket socket();
- method public final int validOps();
- method public final long write(java.nio.ByteBuffer[]) throws java.io.IOException;
- }
-
- public class UnresolvedAddressException extends java.lang.IllegalArgumentException {
- ctor public UnresolvedAddressException();
- }
-
- public class UnsupportedAddressTypeException extends java.lang.IllegalArgumentException {
- ctor public UnsupportedAddressTypeException();
- }
-
- public interface WritableByteChannel extends java.nio.channels.Channel {
- method public int write(java.nio.ByteBuffer) throws java.io.IOException;
- }
-
- public class WritePendingException extends java.lang.IllegalStateException {
- ctor public WritePendingException();
- }
-
-}
-
-package java.nio.channels.spi {
-
- public abstract class AbstractInterruptibleChannel implements java.nio.channels.Channel java.nio.channels.InterruptibleChannel {
- ctor protected AbstractInterruptibleChannel();
- method protected final void begin();
- method public final void close() throws java.io.IOException;
- method protected final void end(boolean) throws java.nio.channels.AsynchronousCloseException;
- method protected abstract void implCloseChannel() throws java.io.IOException;
- method public final boolean isOpen();
- }
-
- public abstract class AbstractSelectableChannel extends java.nio.channels.SelectableChannel {
- ctor protected AbstractSelectableChannel(java.nio.channels.spi.SelectorProvider);
- method public final Object blockingLock();
- method public final java.nio.channels.SelectableChannel configureBlocking(boolean) throws java.io.IOException;
- method protected final void implCloseChannel() throws java.io.IOException;
- method protected abstract void implCloseSelectableChannel() throws java.io.IOException;
- method protected abstract void implConfigureBlocking(boolean) throws java.io.IOException;
- method public final boolean isBlocking();
- method public final boolean isRegistered();
- method public final java.nio.channels.SelectionKey keyFor(java.nio.channels.Selector);
- method public final java.nio.channels.spi.SelectorProvider provider();
- method public final java.nio.channels.SelectionKey register(java.nio.channels.Selector, int, Object) throws java.nio.channels.ClosedChannelException;
- }
-
- public abstract class AbstractSelectionKey extends java.nio.channels.SelectionKey {
- ctor protected AbstractSelectionKey();
- method public final void cancel();
- method public final boolean isValid();
- }
-
- public abstract class AbstractSelector extends java.nio.channels.Selector {
- ctor protected AbstractSelector(java.nio.channels.spi.SelectorProvider);
- method protected final void begin();
- method protected final java.util.Set<java.nio.channels.SelectionKey> cancelledKeys();
- method public final void close() throws java.io.IOException;
- method protected final void deregister(java.nio.channels.spi.AbstractSelectionKey);
- method protected final void end();
- method protected abstract void implCloseSelector() throws java.io.IOException;
- method public final boolean isOpen();
- method public final java.nio.channels.spi.SelectorProvider provider();
- method protected abstract java.nio.channels.SelectionKey register(java.nio.channels.spi.AbstractSelectableChannel, int, Object);
- }
-
- public abstract class AsynchronousChannelProvider {
- ctor protected AsynchronousChannelProvider();
- method public abstract java.nio.channels.AsynchronousChannelGroup openAsynchronousChannelGroup(int, java.util.concurrent.ThreadFactory) throws java.io.IOException;
- method public abstract java.nio.channels.AsynchronousChannelGroup openAsynchronousChannelGroup(java.util.concurrent.ExecutorService, int) throws java.io.IOException;
- method public abstract java.nio.channels.AsynchronousServerSocketChannel openAsynchronousServerSocketChannel(java.nio.channels.AsynchronousChannelGroup) throws java.io.IOException;
- method public abstract java.nio.channels.AsynchronousSocketChannel openAsynchronousSocketChannel(java.nio.channels.AsynchronousChannelGroup) throws java.io.IOException;
- method public static java.nio.channels.spi.AsynchronousChannelProvider provider();
- }
-
- public abstract class SelectorProvider {
- ctor protected SelectorProvider();
- method public java.nio.channels.Channel inheritedChannel() throws java.io.IOException;
- method public abstract java.nio.channels.DatagramChannel openDatagramChannel() throws java.io.IOException;
- method public abstract java.nio.channels.DatagramChannel openDatagramChannel(java.net.ProtocolFamily) throws java.io.IOException;
- method public abstract java.nio.channels.Pipe openPipe() throws java.io.IOException;
- method public abstract java.nio.channels.spi.AbstractSelector openSelector() throws java.io.IOException;
- method public abstract java.nio.channels.ServerSocketChannel openServerSocketChannel() throws java.io.IOException;
- method public abstract java.nio.channels.SocketChannel openSocketChannel() throws java.io.IOException;
- method public static java.nio.channels.spi.SelectorProvider provider();
- }
-
-}
-
-package java.nio.charset {
-
- public class CharacterCodingException extends java.io.IOException {
- ctor public CharacterCodingException();
- }
-
- public abstract class Charset implements java.lang.Comparable<java.nio.charset.Charset> {
- ctor protected Charset(String, String[]);
- method public final java.util.Set<java.lang.String> aliases();
- method public static java.util.SortedMap<java.lang.String,java.nio.charset.Charset> availableCharsets();
- method public boolean canEncode();
- method public final int compareTo(java.nio.charset.Charset);
- method public abstract boolean contains(java.nio.charset.Charset);
- method public final java.nio.CharBuffer decode(java.nio.ByteBuffer);
- method public static java.nio.charset.Charset defaultCharset();
- method public String displayName();
- method public String displayName(java.util.Locale);
- method public final java.nio.ByteBuffer encode(java.nio.CharBuffer);
- method public final java.nio.ByteBuffer encode(String);
- method public final boolean equals(Object);
- method public static java.nio.charset.Charset forName(String);
- method public final int hashCode();
- method public final boolean isRegistered();
- method public static boolean isSupported(String);
- method public final String name();
- method public abstract java.nio.charset.CharsetDecoder newDecoder();
- method public abstract java.nio.charset.CharsetEncoder newEncoder();
- method public final String toString();
- }
-
- public abstract class CharsetDecoder {
- ctor protected CharsetDecoder(java.nio.charset.Charset, float, float);
- method public final float averageCharsPerByte();
- method public final java.nio.charset.Charset charset();
- method public final java.nio.charset.CoderResult decode(java.nio.ByteBuffer, java.nio.CharBuffer, boolean);
- method public final java.nio.CharBuffer decode(java.nio.ByteBuffer) throws java.nio.charset.CharacterCodingException;
- method protected abstract java.nio.charset.CoderResult decodeLoop(java.nio.ByteBuffer, java.nio.CharBuffer);
- method public java.nio.charset.Charset detectedCharset();
- method public final java.nio.charset.CoderResult flush(java.nio.CharBuffer);
- method protected java.nio.charset.CoderResult implFlush(java.nio.CharBuffer);
- method protected void implOnMalformedInput(java.nio.charset.CodingErrorAction);
- method protected void implOnUnmappableCharacter(java.nio.charset.CodingErrorAction);
- method protected void implReplaceWith(String);
- method protected void implReset();
- method public boolean isAutoDetecting();
- method public boolean isCharsetDetected();
- method public java.nio.charset.CodingErrorAction malformedInputAction();
- method public final float maxCharsPerByte();
- method public final java.nio.charset.CharsetDecoder onMalformedInput(java.nio.charset.CodingErrorAction);
- method public final java.nio.charset.CharsetDecoder onUnmappableCharacter(java.nio.charset.CodingErrorAction);
- method public final java.nio.charset.CharsetDecoder replaceWith(String);
- method public final String replacement();
- method public final java.nio.charset.CharsetDecoder reset();
- method public java.nio.charset.CodingErrorAction unmappableCharacterAction();
- }
-
- public abstract class CharsetEncoder {
- ctor protected CharsetEncoder(java.nio.charset.Charset, float, float, byte[]);
- ctor protected CharsetEncoder(java.nio.charset.Charset, float, float);
- method public final float averageBytesPerChar();
- method public boolean canEncode(char);
- method public boolean canEncode(CharSequence);
- method public final java.nio.charset.Charset charset();
- method public final java.nio.charset.CoderResult encode(java.nio.CharBuffer, java.nio.ByteBuffer, boolean);
- method public final java.nio.ByteBuffer encode(java.nio.CharBuffer) throws java.nio.charset.CharacterCodingException;
- method protected abstract java.nio.charset.CoderResult encodeLoop(java.nio.CharBuffer, java.nio.ByteBuffer);
- method public final java.nio.charset.CoderResult flush(java.nio.ByteBuffer);
- method protected java.nio.charset.CoderResult implFlush(java.nio.ByteBuffer);
- method protected void implOnMalformedInput(java.nio.charset.CodingErrorAction);
- method protected void implOnUnmappableCharacter(java.nio.charset.CodingErrorAction);
- method protected void implReplaceWith(byte[]);
- method protected void implReset();
- method public boolean isLegalReplacement(byte[]);
- method public java.nio.charset.CodingErrorAction malformedInputAction();
- method public final float maxBytesPerChar();
- method public final java.nio.charset.CharsetEncoder onMalformedInput(java.nio.charset.CodingErrorAction);
- method public final java.nio.charset.CharsetEncoder onUnmappableCharacter(java.nio.charset.CodingErrorAction);
- method public final java.nio.charset.CharsetEncoder replaceWith(byte[]);
- method public final byte[] replacement();
- method public final java.nio.charset.CharsetEncoder reset();
- method public java.nio.charset.CodingErrorAction unmappableCharacterAction();
- }
-
- public class CoderMalfunctionError extends java.lang.Error {
- ctor public CoderMalfunctionError(Exception);
- }
-
- public class CoderResult {
- method public boolean isError();
- method public boolean isMalformed();
- method public boolean isOverflow();
- method public boolean isUnderflow();
- method public boolean isUnmappable();
- method public int length();
- method public static java.nio.charset.CoderResult malformedForLength(int);
- method public void throwException() throws java.nio.charset.CharacterCodingException;
- method public static java.nio.charset.CoderResult unmappableForLength(int);
- field public static final java.nio.charset.CoderResult OVERFLOW;
- field public static final java.nio.charset.CoderResult UNDERFLOW;
- }
-
- public class CodingErrorAction {
- field public static final java.nio.charset.CodingErrorAction IGNORE;
- field public static final java.nio.charset.CodingErrorAction REPLACE;
- field public static final java.nio.charset.CodingErrorAction REPORT;
- }
-
- public class IllegalCharsetNameException extends java.lang.IllegalArgumentException {
- ctor public IllegalCharsetNameException(String);
- method public String getCharsetName();
- }
-
- public class MalformedInputException extends java.nio.charset.CharacterCodingException {
- ctor public MalformedInputException(int);
- method public int getInputLength();
- }
-
- public final class StandardCharsets {
- field public static final java.nio.charset.Charset ISO_8859_1;
- field public static final java.nio.charset.Charset US_ASCII;
- field public static final java.nio.charset.Charset UTF_16;
- field public static final java.nio.charset.Charset UTF_16BE;
- field public static final java.nio.charset.Charset UTF_16LE;
- field public static final java.nio.charset.Charset UTF_8;
- }
-
- public class UnmappableCharacterException extends java.nio.charset.CharacterCodingException {
- ctor public UnmappableCharacterException(int);
- method public int getInputLength();
- }
-
- public class UnsupportedCharsetException extends java.lang.IllegalArgumentException {
- ctor public UnsupportedCharsetException(String);
- method public String getCharsetName();
- }
-
-}
-
-package java.nio.charset.spi {
-
- public abstract class CharsetProvider {
- ctor protected CharsetProvider();
- method public abstract java.nio.charset.Charset charsetForName(String);
- method public abstract java.util.Iterator<java.nio.charset.Charset> charsets();
- }
-
-}
-
-package java.nio.file {
-
- public class AccessDeniedException extends java.nio.file.FileSystemException {
- ctor public AccessDeniedException(String);
- ctor public AccessDeniedException(String, String, String);
- }
-
- public enum AccessMode {
- enum_constant public static final java.nio.file.AccessMode EXECUTE;
- enum_constant public static final java.nio.file.AccessMode READ;
- enum_constant public static final java.nio.file.AccessMode WRITE;
- }
-
- public class AtomicMoveNotSupportedException extends java.nio.file.FileSystemException {
- ctor public AtomicMoveNotSupportedException(String, String, String);
- }
-
- public class ClosedDirectoryStreamException extends java.lang.IllegalStateException {
- ctor public ClosedDirectoryStreamException();
- }
-
- public class ClosedFileSystemException extends java.lang.IllegalStateException {
- ctor public ClosedFileSystemException();
- }
-
- public class ClosedWatchServiceException extends java.lang.IllegalStateException {
- ctor public ClosedWatchServiceException();
- }
-
- public interface CopyOption {
- }
-
- public final class DirectoryIteratorException extends java.util.ConcurrentModificationException {
- ctor public DirectoryIteratorException(java.io.IOException);
- method public java.io.IOException getCause();
- }
-
- public class DirectoryNotEmptyException extends java.nio.file.FileSystemException {
- ctor public DirectoryNotEmptyException(String);
- }
-
- public interface DirectoryStream<T> extends java.io.Closeable java.lang.Iterable<T> {
- }
-
- @java.lang.FunctionalInterface public static interface DirectoryStream.Filter<T> {
- method public boolean accept(T) throws java.io.IOException;
- }
-
- public class FileAlreadyExistsException extends java.nio.file.FileSystemException {
- ctor public FileAlreadyExistsException(String);
- ctor public FileAlreadyExistsException(String, String, String);
- }
-
- public abstract class FileStore {
- ctor protected FileStore();
- method public abstract Object getAttribute(String) throws java.io.IOException;
- method public abstract <V extends java.nio.file.attribute.FileStoreAttributeView> V getFileStoreAttributeView(Class<V>);
- method public abstract long getTotalSpace() throws java.io.IOException;
- method public abstract long getUnallocatedSpace() throws java.io.IOException;
- method public abstract long getUsableSpace() throws java.io.IOException;
- method public abstract boolean isReadOnly();
- method public abstract String name();
- method public abstract boolean supportsFileAttributeView(Class<? extends java.nio.file.attribute.FileAttributeView>);
- method public abstract boolean supportsFileAttributeView(String);
- method public abstract String type();
- }
-
- public abstract class FileSystem implements java.io.Closeable {
- ctor protected FileSystem();
- method public abstract Iterable<java.nio.file.FileStore> getFileStores();
- method public abstract java.nio.file.Path getPath(String, java.lang.String...);
- method public abstract java.nio.file.PathMatcher getPathMatcher(String);
- method public abstract Iterable<java.nio.file.Path> getRootDirectories();
- method public abstract String getSeparator();
- method public abstract java.nio.file.attribute.UserPrincipalLookupService getUserPrincipalLookupService();
- method public abstract boolean isOpen();
- method public abstract boolean isReadOnly();
- method public abstract java.nio.file.WatchService newWatchService() throws java.io.IOException;
- method public abstract java.nio.file.spi.FileSystemProvider provider();
- method public abstract java.util.Set<java.lang.String> supportedFileAttributeViews();
- }
-
- public class FileSystemAlreadyExistsException extends java.lang.RuntimeException {
- ctor public FileSystemAlreadyExistsException();
- ctor public FileSystemAlreadyExistsException(String);
- }
-
- public class FileSystemException extends java.io.IOException {
- ctor public FileSystemException(String);
- ctor public FileSystemException(String, String, String);
- method public String getFile();
- method public String getOtherFile();
- method public String getReason();
- }
-
- public class FileSystemLoopException extends java.nio.file.FileSystemException {
- ctor public FileSystemLoopException(String);
- }
-
- public class FileSystemNotFoundException extends java.lang.RuntimeException {
- ctor public FileSystemNotFoundException();
- ctor public FileSystemNotFoundException(String);
- }
-
- public final class FileSystems {
- method public static java.nio.file.FileSystem getDefault();
- method public static java.nio.file.FileSystem getFileSystem(java.net.URI);
- method public static java.nio.file.FileSystem newFileSystem(java.net.URI, java.util.Map<java.lang.String,?>) throws java.io.IOException;
- method public static java.nio.file.FileSystem newFileSystem(java.net.URI, java.util.Map<java.lang.String,?>, ClassLoader) throws java.io.IOException;
- method public static java.nio.file.FileSystem newFileSystem(java.nio.file.Path, ClassLoader) throws java.io.IOException;
- }
-
- public enum FileVisitOption {
- enum_constant public static final java.nio.file.FileVisitOption FOLLOW_LINKS;
- }
-
- public enum FileVisitResult {
- enum_constant public static final java.nio.file.FileVisitResult CONTINUE;
- enum_constant public static final java.nio.file.FileVisitResult SKIP_SIBLINGS;
- enum_constant public static final java.nio.file.FileVisitResult SKIP_SUBTREE;
- enum_constant public static final java.nio.file.FileVisitResult TERMINATE;
- }
-
- public interface FileVisitor<T> {
- method public java.nio.file.FileVisitResult postVisitDirectory(T, java.io.IOException) throws java.io.IOException;
- method public java.nio.file.FileVisitResult preVisitDirectory(T, java.nio.file.attribute.BasicFileAttributes) throws java.io.IOException;
- method public java.nio.file.FileVisitResult visitFile(T, java.nio.file.attribute.BasicFileAttributes) throws java.io.IOException;
- method public java.nio.file.FileVisitResult visitFileFailed(T, java.io.IOException) throws java.io.IOException;
- }
-
- public final class Files {
- method public static java.nio.file.Path copy(java.nio.file.Path, java.nio.file.Path, java.nio.file.CopyOption...) throws java.io.IOException;
- method public static long copy(java.io.InputStream, java.nio.file.Path, java.nio.file.CopyOption...) throws java.io.IOException;
- method public static long copy(java.nio.file.Path, java.io.OutputStream) throws java.io.IOException;
- method public static java.nio.file.Path createDirectories(java.nio.file.Path, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public static java.nio.file.Path createDirectory(java.nio.file.Path, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public static java.nio.file.Path createFile(java.nio.file.Path, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public static java.nio.file.Path createLink(java.nio.file.Path, java.nio.file.Path) throws java.io.IOException;
- method public static java.nio.file.Path createSymbolicLink(java.nio.file.Path, java.nio.file.Path, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public static java.nio.file.Path createTempDirectory(java.nio.file.Path, String, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public static java.nio.file.Path createTempDirectory(String, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public static java.nio.file.Path createTempFile(java.nio.file.Path, String, String, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public static java.nio.file.Path createTempFile(String, String, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public static void delete(java.nio.file.Path) throws java.io.IOException;
- method public static boolean deleteIfExists(java.nio.file.Path) throws java.io.IOException;
- method public static boolean exists(java.nio.file.Path, java.nio.file.LinkOption...);
- method public static java.util.stream.Stream<java.nio.file.Path> find(java.nio.file.Path, int, java.util.function.BiPredicate<java.nio.file.Path,java.nio.file.attribute.BasicFileAttributes>, java.nio.file.FileVisitOption...) throws java.io.IOException;
- method public static Object getAttribute(java.nio.file.Path, String, java.nio.file.LinkOption...) throws java.io.IOException;
- method public static <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView(java.nio.file.Path, Class<V>, java.nio.file.LinkOption...);
- method public static java.nio.file.FileStore getFileStore(java.nio.file.Path) throws java.io.IOException;
- method public static java.nio.file.attribute.FileTime getLastModifiedTime(java.nio.file.Path, java.nio.file.LinkOption...) throws java.io.IOException;
- method public static java.nio.file.attribute.UserPrincipal getOwner(java.nio.file.Path, java.nio.file.LinkOption...) throws java.io.IOException;
- method public static java.util.Set<java.nio.file.attribute.PosixFilePermission> getPosixFilePermissions(java.nio.file.Path, java.nio.file.LinkOption...) throws java.io.IOException;
- method public static boolean isDirectory(java.nio.file.Path, java.nio.file.LinkOption...);
- method public static boolean isExecutable(java.nio.file.Path);
- method public static boolean isHidden(java.nio.file.Path) throws java.io.IOException;
- method public static boolean isReadable(java.nio.file.Path);
- method public static boolean isRegularFile(java.nio.file.Path, java.nio.file.LinkOption...);
- method public static boolean isSameFile(java.nio.file.Path, java.nio.file.Path) throws java.io.IOException;
- method public static boolean isSymbolicLink(java.nio.file.Path);
- method public static boolean isWritable(java.nio.file.Path);
- method public static java.util.stream.Stream<java.lang.String> lines(java.nio.file.Path, java.nio.charset.Charset) throws java.io.IOException;
- method public static java.util.stream.Stream<java.lang.String> lines(java.nio.file.Path) throws java.io.IOException;
- method public static java.util.stream.Stream<java.nio.file.Path> list(java.nio.file.Path) throws java.io.IOException;
- method public static java.nio.file.Path move(java.nio.file.Path, java.nio.file.Path, java.nio.file.CopyOption...) throws java.io.IOException;
- method public static java.io.BufferedReader newBufferedReader(java.nio.file.Path, java.nio.charset.Charset) throws java.io.IOException;
- method public static java.io.BufferedReader newBufferedReader(java.nio.file.Path) throws java.io.IOException;
- method public static java.io.BufferedWriter newBufferedWriter(java.nio.file.Path, java.nio.charset.Charset, java.nio.file.OpenOption...) throws java.io.IOException;
- method public static java.io.BufferedWriter newBufferedWriter(java.nio.file.Path, java.nio.file.OpenOption...) throws java.io.IOException;
- method public static java.nio.channels.SeekableByteChannel newByteChannel(java.nio.file.Path, java.util.Set<? extends java.nio.file.OpenOption>, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public static java.nio.channels.SeekableByteChannel newByteChannel(java.nio.file.Path, java.nio.file.OpenOption...) throws java.io.IOException;
- method public static java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path) throws java.io.IOException;
- method public static java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path, String) throws java.io.IOException;
- method public static java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path, java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path>) throws java.io.IOException;
- method public static java.io.InputStream newInputStream(java.nio.file.Path, java.nio.file.OpenOption...) throws java.io.IOException;
- method public static java.io.OutputStream newOutputStream(java.nio.file.Path, java.nio.file.OpenOption...) throws java.io.IOException;
- method public static boolean notExists(java.nio.file.Path, java.nio.file.LinkOption...);
- method public static String probeContentType(java.nio.file.Path) throws java.io.IOException;
- method public static byte[] readAllBytes(java.nio.file.Path) throws java.io.IOException;
- method public static java.util.List<java.lang.String> readAllLines(java.nio.file.Path, java.nio.charset.Charset) throws java.io.IOException;
- method public static java.util.List<java.lang.String> readAllLines(java.nio.file.Path) throws java.io.IOException;
- method public static <A extends java.nio.file.attribute.BasicFileAttributes> A readAttributes(java.nio.file.Path, Class<A>, java.nio.file.LinkOption...) throws java.io.IOException;
- method public static java.util.Map<java.lang.String,java.lang.Object> readAttributes(java.nio.file.Path, String, java.nio.file.LinkOption...) throws java.io.IOException;
- method public static java.nio.file.Path readSymbolicLink(java.nio.file.Path) throws java.io.IOException;
- method public static java.nio.file.Path setAttribute(java.nio.file.Path, String, Object, java.nio.file.LinkOption...) throws java.io.IOException;
- method public static java.nio.file.Path setLastModifiedTime(java.nio.file.Path, java.nio.file.attribute.FileTime) throws java.io.IOException;
- method public static java.nio.file.Path setOwner(java.nio.file.Path, java.nio.file.attribute.UserPrincipal) throws java.io.IOException;
- method public static java.nio.file.Path setPosixFilePermissions(java.nio.file.Path, java.util.Set<java.nio.file.attribute.PosixFilePermission>) throws java.io.IOException;
- method public static long size(java.nio.file.Path) throws java.io.IOException;
- method public static java.util.stream.Stream<java.nio.file.Path> walk(java.nio.file.Path, int, java.nio.file.FileVisitOption...) throws java.io.IOException;
- method public static java.util.stream.Stream<java.nio.file.Path> walk(java.nio.file.Path, java.nio.file.FileVisitOption...) throws java.io.IOException;
- method public static java.nio.file.Path walkFileTree(java.nio.file.Path, java.util.Set<java.nio.file.FileVisitOption>, int, java.nio.file.FileVisitor<? super java.nio.file.Path>) throws java.io.IOException;
- method public static java.nio.file.Path walkFileTree(java.nio.file.Path, java.nio.file.FileVisitor<? super java.nio.file.Path>) throws java.io.IOException;
- method public static java.nio.file.Path write(java.nio.file.Path, byte[], java.nio.file.OpenOption...) throws java.io.IOException;
- method public static java.nio.file.Path write(java.nio.file.Path, Iterable<? extends java.lang.CharSequence>, java.nio.charset.Charset, java.nio.file.OpenOption...) throws java.io.IOException;
- method public static java.nio.file.Path write(java.nio.file.Path, Iterable<? extends java.lang.CharSequence>, java.nio.file.OpenOption...) throws java.io.IOException;
- }
-
- public class InvalidPathException extends java.lang.IllegalArgumentException {
- ctor public InvalidPathException(String, String, int);
- ctor public InvalidPathException(String, String);
- method public int getIndex();
- method public String getInput();
- method public String getReason();
- }
-
- public enum LinkOption implements java.nio.file.CopyOption java.nio.file.OpenOption {
- enum_constant public static final java.nio.file.LinkOption NOFOLLOW_LINKS;
- }
-
- public final class LinkPermission extends java.security.BasicPermission {
- ctor public LinkPermission(String);
- ctor public LinkPermission(String, String);
- }
-
- public class NoSuchFileException extends java.nio.file.FileSystemException {
- ctor public NoSuchFileException(String);
- ctor public NoSuchFileException(String, String, String);
- }
-
- public class NotDirectoryException extends java.nio.file.FileSystemException {
- ctor public NotDirectoryException(String);
- }
-
- public class NotLinkException extends java.nio.file.FileSystemException {
- ctor public NotLinkException(String);
- ctor public NotLinkException(String, String, String);
- }
-
- public interface OpenOption {
- }
-
- public interface Path extends java.lang.Comparable<java.nio.file.Path> java.lang.Iterable<java.nio.file.Path> java.nio.file.Watchable {
- method public int compareTo(java.nio.file.Path);
- method public boolean endsWith(java.nio.file.Path);
- method public boolean endsWith(String);
- method public boolean equals(Object);
- method public java.nio.file.Path getFileName();
- method public java.nio.file.FileSystem getFileSystem();
- method public java.nio.file.Path getName(int);
- method public int getNameCount();
- method public java.nio.file.Path getParent();
- method public java.nio.file.Path getRoot();
- method public int hashCode();
- method public boolean isAbsolute();
- method public java.util.Iterator<java.nio.file.Path> iterator();
- method public java.nio.file.Path normalize();
- method public java.nio.file.Path relativize(java.nio.file.Path);
- method public java.nio.file.Path resolve(java.nio.file.Path);
- method public java.nio.file.Path resolve(String);
- method public java.nio.file.Path resolveSibling(java.nio.file.Path);
- method public java.nio.file.Path resolveSibling(String);
- method public boolean startsWith(java.nio.file.Path);
- method public boolean startsWith(String);
- method public java.nio.file.Path subpath(int, int);
- method public java.nio.file.Path toAbsolutePath();
- method public java.io.File toFile();
- method public java.nio.file.Path toRealPath(java.nio.file.LinkOption...) throws java.io.IOException;
- method public String toString();
- method public java.net.URI toUri();
- }
-
- @java.lang.FunctionalInterface public interface PathMatcher {
- method public boolean matches(java.nio.file.Path);
- }
-
- public final class Paths {
- method public static java.nio.file.Path get(String, java.lang.String...);
- method public static java.nio.file.Path get(java.net.URI);
- }
-
- public class ProviderMismatchException extends java.lang.IllegalArgumentException {
- ctor public ProviderMismatchException();
- ctor public ProviderMismatchException(String);
- }
-
- public class ProviderNotFoundException extends java.lang.RuntimeException {
- ctor public ProviderNotFoundException();
- ctor public ProviderNotFoundException(String);
- }
-
- public class ReadOnlyFileSystemException extends java.lang.UnsupportedOperationException {
- ctor public ReadOnlyFileSystemException();
- }
-
- public interface SecureDirectoryStream<T> extends java.nio.file.DirectoryStream<T> {
- method public void deleteDirectory(T) throws java.io.IOException;
- method public void deleteFile(T) throws java.io.IOException;
- method public <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView(Class<V>);
- method public <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView(T, Class<V>, java.nio.file.LinkOption...);
- method public void move(T, java.nio.file.SecureDirectoryStream<T>, T) throws java.io.IOException;
- method public java.nio.channels.SeekableByteChannel newByteChannel(T, java.util.Set<? extends java.nio.file.OpenOption>, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public java.nio.file.SecureDirectoryStream<T> newDirectoryStream(T, java.nio.file.LinkOption...) throws java.io.IOException;
- }
-
- public class SimpleFileVisitor<T> implements java.nio.file.FileVisitor<T> {
- ctor protected SimpleFileVisitor();
- method public java.nio.file.FileVisitResult postVisitDirectory(T, java.io.IOException) throws java.io.IOException;
- method public java.nio.file.FileVisitResult preVisitDirectory(T, java.nio.file.attribute.BasicFileAttributes) throws java.io.IOException;
- method public java.nio.file.FileVisitResult visitFile(T, java.nio.file.attribute.BasicFileAttributes) throws java.io.IOException;
- method public java.nio.file.FileVisitResult visitFileFailed(T, java.io.IOException) throws java.io.IOException;
- }
-
- public enum StandardCopyOption implements java.nio.file.CopyOption {
- enum_constant public static final java.nio.file.StandardCopyOption ATOMIC_MOVE;
- enum_constant public static final java.nio.file.StandardCopyOption COPY_ATTRIBUTES;
- enum_constant public static final java.nio.file.StandardCopyOption REPLACE_EXISTING;
- }
-
- public enum StandardOpenOption implements java.nio.file.OpenOption {
- enum_constant public static final java.nio.file.StandardOpenOption APPEND;
- enum_constant public static final java.nio.file.StandardOpenOption CREATE;
- enum_constant public static final java.nio.file.StandardOpenOption CREATE_NEW;
- enum_constant public static final java.nio.file.StandardOpenOption DELETE_ON_CLOSE;
- enum_constant public static final java.nio.file.StandardOpenOption DSYNC;
- enum_constant public static final java.nio.file.StandardOpenOption READ;
- enum_constant public static final java.nio.file.StandardOpenOption SPARSE;
- enum_constant public static final java.nio.file.StandardOpenOption SYNC;
- enum_constant public static final java.nio.file.StandardOpenOption TRUNCATE_EXISTING;
- enum_constant public static final java.nio.file.StandardOpenOption WRITE;
- }
-
- public final class StandardWatchEventKinds {
- field public static final java.nio.file.WatchEvent.Kind<java.nio.file.Path> ENTRY_CREATE;
- field public static final java.nio.file.WatchEvent.Kind<java.nio.file.Path> ENTRY_DELETE;
- field public static final java.nio.file.WatchEvent.Kind<java.nio.file.Path> ENTRY_MODIFY;
- field public static final java.nio.file.WatchEvent.Kind<java.lang.Object> OVERFLOW;
- }
-
- public interface WatchEvent<T> {
- method public T context();
- method public int count();
- method public java.nio.file.WatchEvent.Kind<T> kind();
- }
-
- public static interface WatchEvent.Kind<T> {
- method public String name();
- method public Class<T> type();
- }
-
- public static interface WatchEvent.Modifier {
- method public String name();
- }
-
- public interface WatchKey {
- method public void cancel();
- method public boolean isValid();
- method public java.util.List<java.nio.file.WatchEvent<?>> pollEvents();
- method public boolean reset();
- method public java.nio.file.Watchable watchable();
- }
-
- public interface WatchService extends java.io.Closeable {
- method public java.nio.file.WatchKey poll();
- method public java.nio.file.WatchKey poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public java.nio.file.WatchKey take() throws java.lang.InterruptedException;
- }
-
- public interface Watchable {
- method public java.nio.file.WatchKey register(java.nio.file.WatchService, java.nio.file.WatchEvent.Kind<?>[], java.nio.file.WatchEvent.Modifier...) throws java.io.IOException;
- method public java.nio.file.WatchKey register(java.nio.file.WatchService, java.nio.file.WatchEvent.Kind<?>...) throws java.io.IOException;
- }
-
-}
-
-package java.nio.file.attribute {
-
- public final class AclEntry {
- method public java.util.Set<java.nio.file.attribute.AclEntryFlag> flags();
- method public static java.nio.file.attribute.AclEntry.Builder newBuilder();
- method public static java.nio.file.attribute.AclEntry.Builder newBuilder(java.nio.file.attribute.AclEntry);
- method public java.util.Set<java.nio.file.attribute.AclEntryPermission> permissions();
- method public java.nio.file.attribute.UserPrincipal principal();
- method public java.nio.file.attribute.AclEntryType type();
- }
-
- public static final class AclEntry.Builder {
- method public java.nio.file.attribute.AclEntry build();
- method public java.nio.file.attribute.AclEntry.Builder setFlags(java.util.Set<java.nio.file.attribute.AclEntryFlag>);
- method public java.nio.file.attribute.AclEntry.Builder setFlags(java.nio.file.attribute.AclEntryFlag...);
- method public java.nio.file.attribute.AclEntry.Builder setPermissions(java.util.Set<java.nio.file.attribute.AclEntryPermission>);
- method public java.nio.file.attribute.AclEntry.Builder setPermissions(java.nio.file.attribute.AclEntryPermission...);
- method public java.nio.file.attribute.AclEntry.Builder setPrincipal(java.nio.file.attribute.UserPrincipal);
- method public java.nio.file.attribute.AclEntry.Builder setType(java.nio.file.attribute.AclEntryType);
- }
-
- public enum AclEntryFlag {
- enum_constant public static final java.nio.file.attribute.AclEntryFlag DIRECTORY_INHERIT;
- enum_constant public static final java.nio.file.attribute.AclEntryFlag FILE_INHERIT;
- enum_constant public static final java.nio.file.attribute.AclEntryFlag INHERIT_ONLY;
- enum_constant public static final java.nio.file.attribute.AclEntryFlag NO_PROPAGATE_INHERIT;
- }
-
- public enum AclEntryPermission {
- enum_constant public static final java.nio.file.attribute.AclEntryPermission APPEND_DATA;
- enum_constant public static final java.nio.file.attribute.AclEntryPermission DELETE;
- enum_constant public static final java.nio.file.attribute.AclEntryPermission DELETE_CHILD;
- enum_constant public static final java.nio.file.attribute.AclEntryPermission EXECUTE;
- enum_constant public static final java.nio.file.attribute.AclEntryPermission READ_ACL;
- enum_constant public static final java.nio.file.attribute.AclEntryPermission READ_ATTRIBUTES;
- enum_constant public static final java.nio.file.attribute.AclEntryPermission READ_DATA;
- enum_constant public static final java.nio.file.attribute.AclEntryPermission READ_NAMED_ATTRS;
- enum_constant public static final java.nio.file.attribute.AclEntryPermission SYNCHRONIZE;
- enum_constant public static final java.nio.file.attribute.AclEntryPermission WRITE_ACL;
- enum_constant public static final java.nio.file.attribute.AclEntryPermission WRITE_ATTRIBUTES;
- enum_constant public static final java.nio.file.attribute.AclEntryPermission WRITE_DATA;
- enum_constant public static final java.nio.file.attribute.AclEntryPermission WRITE_NAMED_ATTRS;
- enum_constant public static final java.nio.file.attribute.AclEntryPermission WRITE_OWNER;
- field public static final java.nio.file.attribute.AclEntryPermission ADD_FILE;
- field public static final java.nio.file.attribute.AclEntryPermission ADD_SUBDIRECTORY;
- field public static final java.nio.file.attribute.AclEntryPermission LIST_DIRECTORY;
- }
-
- public enum AclEntryType {
- enum_constant public static final java.nio.file.attribute.AclEntryType ALARM;
- enum_constant public static final java.nio.file.attribute.AclEntryType ALLOW;
- enum_constant public static final java.nio.file.attribute.AclEntryType AUDIT;
- enum_constant public static final java.nio.file.attribute.AclEntryType DENY;
- }
-
- public interface AclFileAttributeView extends java.nio.file.attribute.FileOwnerAttributeView {
- method public java.util.List<java.nio.file.attribute.AclEntry> getAcl() throws java.io.IOException;
- method public void setAcl(java.util.List<java.nio.file.attribute.AclEntry>) throws java.io.IOException;
- }
-
- public interface AttributeView {
- method public String name();
- }
-
- public interface BasicFileAttributeView extends java.nio.file.attribute.FileAttributeView {
- method public java.nio.file.attribute.BasicFileAttributes readAttributes() throws java.io.IOException;
- method public void setTimes(java.nio.file.attribute.FileTime, java.nio.file.attribute.FileTime, java.nio.file.attribute.FileTime) throws java.io.IOException;
- }
-
- public interface BasicFileAttributes {
- method public java.nio.file.attribute.FileTime creationTime();
- method public Object fileKey();
- method public boolean isDirectory();
- method public boolean isOther();
- method public boolean isRegularFile();
- method public boolean isSymbolicLink();
- method public java.nio.file.attribute.FileTime lastAccessTime();
- method public java.nio.file.attribute.FileTime lastModifiedTime();
- method public long size();
- }
-
- public interface DosFileAttributeView extends java.nio.file.attribute.BasicFileAttributeView {
- method public java.nio.file.attribute.DosFileAttributes readAttributes() throws java.io.IOException;
- method public void setArchive(boolean) throws java.io.IOException;
- method public void setHidden(boolean) throws java.io.IOException;
- method public void setReadOnly(boolean) throws java.io.IOException;
- method public void setSystem(boolean) throws java.io.IOException;
- }
-
- public interface DosFileAttributes extends java.nio.file.attribute.BasicFileAttributes {
- method public boolean isArchive();
- method public boolean isHidden();
- method public boolean isReadOnly();
- method public boolean isSystem();
- }
-
- public interface FileAttribute<T> {
- method public String name();
- method public T value();
- }
-
- public interface FileAttributeView extends java.nio.file.attribute.AttributeView {
- }
-
- public interface FileOwnerAttributeView extends java.nio.file.attribute.FileAttributeView {
- method public java.nio.file.attribute.UserPrincipal getOwner() throws java.io.IOException;
- method public void setOwner(java.nio.file.attribute.UserPrincipal) throws java.io.IOException;
- }
-
- public interface FileStoreAttributeView extends java.nio.file.attribute.AttributeView {
- }
-
- public final class FileTime implements java.lang.Comparable<java.nio.file.attribute.FileTime> {
- method public int compareTo(java.nio.file.attribute.FileTime);
- method public static java.nio.file.attribute.FileTime from(long, java.util.concurrent.TimeUnit);
- method public static java.nio.file.attribute.FileTime from(java.time.Instant);
- method public static java.nio.file.attribute.FileTime fromMillis(long);
- method public long to(java.util.concurrent.TimeUnit);
- method public java.time.Instant toInstant();
- method public long toMillis();
- }
-
- public interface GroupPrincipal extends java.nio.file.attribute.UserPrincipal {
- }
-
- public interface PosixFileAttributeView extends java.nio.file.attribute.BasicFileAttributeView java.nio.file.attribute.FileOwnerAttributeView {
- method public java.nio.file.attribute.PosixFileAttributes readAttributes() throws java.io.IOException;
- method public void setGroup(java.nio.file.attribute.GroupPrincipal) throws java.io.IOException;
- method public void setPermissions(java.util.Set<java.nio.file.attribute.PosixFilePermission>) throws java.io.IOException;
- }
-
- public interface PosixFileAttributes extends java.nio.file.attribute.BasicFileAttributes {
- method public java.nio.file.attribute.GroupPrincipal group();
- method public java.nio.file.attribute.UserPrincipal owner();
- method public java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions();
- }
-
- public enum PosixFilePermission {
- enum_constant public static final java.nio.file.attribute.PosixFilePermission GROUP_EXECUTE;
- enum_constant public static final java.nio.file.attribute.PosixFilePermission GROUP_READ;
- enum_constant public static final java.nio.file.attribute.PosixFilePermission GROUP_WRITE;
- enum_constant public static final java.nio.file.attribute.PosixFilePermission OTHERS_EXECUTE;
- enum_constant public static final java.nio.file.attribute.PosixFilePermission OTHERS_READ;
- enum_constant public static final java.nio.file.attribute.PosixFilePermission OTHERS_WRITE;
- enum_constant public static final java.nio.file.attribute.PosixFilePermission OWNER_EXECUTE;
- enum_constant public static final java.nio.file.attribute.PosixFilePermission OWNER_READ;
- enum_constant public static final java.nio.file.attribute.PosixFilePermission OWNER_WRITE;
- }
-
- public final class PosixFilePermissions {
- method public static java.nio.file.attribute.FileAttribute<java.util.Set<java.nio.file.attribute.PosixFilePermission>> asFileAttribute(java.util.Set<java.nio.file.attribute.PosixFilePermission>);
- method public static java.util.Set<java.nio.file.attribute.PosixFilePermission> fromString(String);
- method public static String toString(java.util.Set<java.nio.file.attribute.PosixFilePermission>);
- }
-
- public interface UserDefinedFileAttributeView extends java.nio.file.attribute.FileAttributeView {
- method public void delete(String) throws java.io.IOException;
- method public java.util.List<java.lang.String> list() throws java.io.IOException;
- method public int read(String, java.nio.ByteBuffer) throws java.io.IOException;
- method public int size(String) throws java.io.IOException;
- method public int write(String, java.nio.ByteBuffer) throws java.io.IOException;
- }
-
- public interface UserPrincipal extends java.security.Principal {
- }
-
- public abstract class UserPrincipalLookupService {
- ctor protected UserPrincipalLookupService();
- method public abstract java.nio.file.attribute.GroupPrincipal lookupPrincipalByGroupName(String) throws java.io.IOException;
- method public abstract java.nio.file.attribute.UserPrincipal lookupPrincipalByName(String) throws java.io.IOException;
- }
-
- public class UserPrincipalNotFoundException extends java.io.IOException {
- ctor public UserPrincipalNotFoundException(String);
- method public String getName();
- }
-
-}
-
-package java.nio.file.spi {
-
- public abstract class FileSystemProvider {
- ctor protected FileSystemProvider();
- method public abstract void checkAccess(java.nio.file.Path, java.nio.file.AccessMode...) throws java.io.IOException;
- method public abstract void copy(java.nio.file.Path, java.nio.file.Path, java.nio.file.CopyOption...) throws java.io.IOException;
- method public abstract void createDirectory(java.nio.file.Path, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public void createLink(java.nio.file.Path, java.nio.file.Path) throws java.io.IOException;
- method public void createSymbolicLink(java.nio.file.Path, java.nio.file.Path, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public abstract void delete(java.nio.file.Path) throws java.io.IOException;
- method public boolean deleteIfExists(java.nio.file.Path) throws java.io.IOException;
- method public abstract <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView(java.nio.file.Path, Class<V>, java.nio.file.LinkOption...);
- method public abstract java.nio.file.FileStore getFileStore(java.nio.file.Path) throws java.io.IOException;
- method public abstract java.nio.file.FileSystem getFileSystem(java.net.URI);
- method public abstract java.nio.file.Path getPath(java.net.URI);
- method public abstract String getScheme();
- method public static java.util.List<java.nio.file.spi.FileSystemProvider> installedProviders();
- method public abstract boolean isHidden(java.nio.file.Path) throws java.io.IOException;
- method public abstract boolean isSameFile(java.nio.file.Path, java.nio.file.Path) throws java.io.IOException;
- method public abstract void move(java.nio.file.Path, java.nio.file.Path, java.nio.file.CopyOption...) throws java.io.IOException;
- method public java.nio.channels.AsynchronousFileChannel newAsynchronousFileChannel(java.nio.file.Path, java.util.Set<? extends java.nio.file.OpenOption>, java.util.concurrent.ExecutorService, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public abstract java.nio.channels.SeekableByteChannel newByteChannel(java.nio.file.Path, java.util.Set<? extends java.nio.file.OpenOption>, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public abstract java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path, java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path>) throws java.io.IOException;
- method public java.nio.channels.FileChannel newFileChannel(java.nio.file.Path, java.util.Set<? extends java.nio.file.OpenOption>, java.nio.file.attribute.FileAttribute<?>...) throws java.io.IOException;
- method public abstract java.nio.file.FileSystem newFileSystem(java.net.URI, java.util.Map<java.lang.String,?>) throws java.io.IOException;
- method public java.nio.file.FileSystem newFileSystem(java.nio.file.Path, java.util.Map<java.lang.String,?>) throws java.io.IOException;
- method public java.io.InputStream newInputStream(java.nio.file.Path, java.nio.file.OpenOption...) throws java.io.IOException;
- method public java.io.OutputStream newOutputStream(java.nio.file.Path, java.nio.file.OpenOption...) throws java.io.IOException;
- method public abstract <A extends java.nio.file.attribute.BasicFileAttributes> A readAttributes(java.nio.file.Path, Class<A>, java.nio.file.LinkOption...) throws java.io.IOException;
- method public abstract java.util.Map<java.lang.String,java.lang.Object> readAttributes(java.nio.file.Path, String, java.nio.file.LinkOption...) throws java.io.IOException;
- method public java.nio.file.Path readSymbolicLink(java.nio.file.Path) throws java.io.IOException;
- method public abstract void setAttribute(java.nio.file.Path, String, Object, java.nio.file.LinkOption...) throws java.io.IOException;
- }
-
- public abstract class FileTypeDetector {
- ctor protected FileTypeDetector();
- method public abstract String probeContentType(java.nio.file.Path) throws java.io.IOException;
- }
-
-}
-
-package java.security {
-
- public final class AccessControlContext {
- ctor public AccessControlContext(java.security.ProtectionDomain[]);
- ctor public AccessControlContext(java.security.AccessControlContext, java.security.DomainCombiner);
- method public void checkPermission(java.security.Permission) throws java.security.AccessControlException;
- method public java.security.DomainCombiner getDomainCombiner();
- }
-
- public class AccessControlException extends java.lang.SecurityException {
- ctor public AccessControlException(String);
- ctor public AccessControlException(String, java.security.Permission);
- method public java.security.Permission getPermission();
- }
-
- public final class AccessController {
- method public static void checkPermission(java.security.Permission) throws java.security.AccessControlException;
- method public static <T> T doPrivileged(java.security.PrivilegedAction<T>);
- method public static <T> T doPrivileged(java.security.PrivilegedAction<T>, java.security.AccessControlContext);
- method public static <T> T doPrivileged(java.security.PrivilegedExceptionAction<T>) throws java.security.PrivilegedActionException;
- method public static <T> T doPrivileged(java.security.PrivilegedExceptionAction<T>, java.security.AccessControlContext) throws java.security.PrivilegedActionException;
- method public static <T> T doPrivilegedWithCombiner(java.security.PrivilegedAction<T>);
- method public static <T> T doPrivilegedWithCombiner(java.security.PrivilegedExceptionAction<T>) throws java.security.PrivilegedActionException;
- method public static java.security.AccessControlContext getContext();
- }
-
- public interface AlgorithmConstraints {
- method public boolean permits(java.util.Set<java.security.CryptoPrimitive>, String, java.security.AlgorithmParameters);
- method public boolean permits(java.util.Set<java.security.CryptoPrimitive>, java.security.Key);
- method public boolean permits(java.util.Set<java.security.CryptoPrimitive>, String, java.security.Key, java.security.AlgorithmParameters);
- }
-
- public class AlgorithmParameterGenerator {
- ctor protected AlgorithmParameterGenerator(java.security.AlgorithmParameterGeneratorSpi, java.security.Provider, String);
- method public final java.security.AlgorithmParameters generateParameters();
- method public final String getAlgorithm();
- method public static java.security.AlgorithmParameterGenerator getInstance(String) throws java.security.NoSuchAlgorithmException;
- method public static java.security.AlgorithmParameterGenerator getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static java.security.AlgorithmParameterGenerator getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method public final java.security.Provider getProvider();
- method public final void init(int);
- method public final void init(int, java.security.SecureRandom);
- method public final void init(java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException;
- method public final void init(java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException;
- }
-
- public abstract class AlgorithmParameterGeneratorSpi {
- ctor public AlgorithmParameterGeneratorSpi();
- method protected abstract java.security.AlgorithmParameters engineGenerateParameters();
- method protected abstract void engineInit(int, java.security.SecureRandom);
- method protected abstract void engineInit(java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException;
- }
-
- public class AlgorithmParameters {
- ctor protected AlgorithmParameters(java.security.AlgorithmParametersSpi, java.security.Provider, String);
- method public final String getAlgorithm();
- method public final byte[] getEncoded() throws java.io.IOException;
- method public final byte[] getEncoded(String) throws java.io.IOException;
- method public static java.security.AlgorithmParameters getInstance(String) throws java.security.NoSuchAlgorithmException;
- method public static java.security.AlgorithmParameters getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static java.security.AlgorithmParameters getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method public final <T extends java.security.spec.AlgorithmParameterSpec> T getParameterSpec(Class<T>) throws java.security.spec.InvalidParameterSpecException;
- method public final java.security.Provider getProvider();
- method public final void init(java.security.spec.AlgorithmParameterSpec) throws java.security.spec.InvalidParameterSpecException;
- method public final void init(byte[]) throws java.io.IOException;
- method public final void init(byte[], String) throws java.io.IOException;
- method public final String toString();
- }
-
- public abstract class AlgorithmParametersSpi {
- ctor public AlgorithmParametersSpi();
- method protected abstract byte[] engineGetEncoded() throws java.io.IOException;
- method protected abstract byte[] engineGetEncoded(String) throws java.io.IOException;
- method protected abstract <T extends java.security.spec.AlgorithmParameterSpec> T engineGetParameterSpec(Class<T>) throws java.security.spec.InvalidParameterSpecException;
- method protected abstract void engineInit(java.security.spec.AlgorithmParameterSpec) throws java.security.spec.InvalidParameterSpecException;
- method protected abstract void engineInit(byte[]) throws java.io.IOException;
- method protected abstract void engineInit(byte[], String) throws java.io.IOException;
- method protected abstract String engineToString();
- }
-
- public final class AllPermission extends java.security.Permission {
- ctor public AllPermission();
- ctor public AllPermission(String, String);
- method public String getActions();
- method public boolean implies(java.security.Permission);
- }
-
- public abstract class AuthProvider extends java.security.Provider {
- ctor protected AuthProvider(String, double, String);
- method public abstract void login(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler) throws javax.security.auth.login.LoginException;
- method public abstract void logout() throws javax.security.auth.login.LoginException;
- method public abstract void setCallbackHandler(javax.security.auth.callback.CallbackHandler);
- }
-
- public abstract class BasicPermission extends java.security.Permission implements java.io.Serializable {
- ctor public BasicPermission(String);
- ctor public BasicPermission(String, String);
- method public String getActions();
- method public boolean implies(java.security.Permission);
- }
-
- @Deprecated public interface Certificate {
- method @Deprecated public void decode(java.io.InputStream) throws java.io.IOException, java.security.KeyException;
- method @Deprecated public void encode(java.io.OutputStream) throws java.io.IOException, java.security.KeyException;
- method @Deprecated public String getFormat();
- method @Deprecated public java.security.Principal getGuarantor();
- method @Deprecated public java.security.Principal getPrincipal();
- method @Deprecated public java.security.PublicKey getPublicKey();
- method @Deprecated public String toString(boolean);
- }
-
- public final class CodeSigner implements java.io.Serializable {
- ctor public CodeSigner(java.security.cert.CertPath, java.security.Timestamp);
- method public java.security.cert.CertPath getSignerCertPath();
- method public java.security.Timestamp getTimestamp();
- }
-
- public class CodeSource implements java.io.Serializable {
- ctor public CodeSource(java.net.URL, java.security.cert.Certificate[]);
- ctor public CodeSource(java.net.URL, java.security.CodeSigner[]);
- method public final java.security.cert.Certificate[] getCertificates();
- method public final java.security.CodeSigner[] getCodeSigners();
- method public final java.net.URL getLocation();
- method public boolean implies(java.security.CodeSource);
- }
-
- public enum CryptoPrimitive {
- enum_constant public static final java.security.CryptoPrimitive BLOCK_CIPHER;
- enum_constant public static final java.security.CryptoPrimitive KEY_AGREEMENT;
- enum_constant public static final java.security.CryptoPrimitive KEY_ENCAPSULATION;
- enum_constant public static final java.security.CryptoPrimitive KEY_WRAP;
- enum_constant public static final java.security.CryptoPrimitive MAC;
- enum_constant public static final java.security.CryptoPrimitive MESSAGE_DIGEST;
- enum_constant public static final java.security.CryptoPrimitive PUBLIC_KEY_ENCRYPTION;
- enum_constant public static final java.security.CryptoPrimitive SECURE_RANDOM;
- enum_constant public static final java.security.CryptoPrimitive SIGNATURE;
- enum_constant public static final java.security.CryptoPrimitive STREAM_CIPHER;
- }
-
- public class DigestException extends java.security.GeneralSecurityException {
- ctor public DigestException();
- ctor public DigestException(String);
- ctor public DigestException(String, Throwable);
- ctor public DigestException(Throwable);
- }
-
- public class DigestInputStream extends java.io.FilterInputStream {
- ctor public DigestInputStream(java.io.InputStream, java.security.MessageDigest);
- method public java.security.MessageDigest getMessageDigest();
- method public void on(boolean);
- method public void setMessageDigest(java.security.MessageDigest);
- field protected java.security.MessageDigest digest;
- }
-
- public class DigestOutputStream extends java.io.FilterOutputStream {
- ctor public DigestOutputStream(java.io.OutputStream, java.security.MessageDigest);
- method public java.security.MessageDigest getMessageDigest();
- method public void on(boolean);
- method public void setMessageDigest(java.security.MessageDigest);
- field protected java.security.MessageDigest digest;
- }
-
- public interface DomainCombiner {
- method public java.security.ProtectionDomain[] combine(java.security.ProtectionDomain[], java.security.ProtectionDomain[]);
- }
-
- public final class DomainLoadStoreParameter implements java.security.KeyStore.LoadStoreParameter {
- ctor public DomainLoadStoreParameter(java.net.URI, java.util.Map<java.lang.String,java.security.KeyStore.ProtectionParameter>);
- method public java.net.URI getConfiguration();
- method public java.security.KeyStore.ProtectionParameter getProtectionParameter();
- method public java.util.Map<java.lang.String,java.security.KeyStore.ProtectionParameter> getProtectionParams();
- }
-
- public class GeneralSecurityException extends java.lang.Exception {
- ctor public GeneralSecurityException();
- ctor public GeneralSecurityException(String);
- ctor public GeneralSecurityException(String, Throwable);
- ctor public GeneralSecurityException(Throwable);
- }
-
- public interface Guard {
- method public void checkGuard(Object) throws java.lang.SecurityException;
- }
-
- public class GuardedObject implements java.io.Serializable {
- ctor public GuardedObject(Object, java.security.Guard);
- method public Object getObject() throws java.lang.SecurityException;
- }
-
- @Deprecated public abstract class Identity implements java.security.Principal java.io.Serializable {
- ctor @Deprecated protected Identity();
- ctor @Deprecated public Identity(String, java.security.IdentityScope) throws java.security.KeyManagementException;
- ctor @Deprecated public Identity(String);
- method @Deprecated public void addCertificate(java.security.Certificate) throws java.security.KeyManagementException;
- method @Deprecated public java.security.Certificate[] certificates();
- method @Deprecated public final boolean equals(Object);
- method @Deprecated public String getInfo();
- method @Deprecated public final String getName();
- method @Deprecated public java.security.PublicKey getPublicKey();
- method @Deprecated public final java.security.IdentityScope getScope();
- method @Deprecated protected boolean identityEquals(java.security.Identity);
- method @Deprecated public void removeCertificate(java.security.Certificate) throws java.security.KeyManagementException;
- method @Deprecated public void setInfo(String);
- method @Deprecated public void setPublicKey(java.security.PublicKey) throws java.security.KeyManagementException;
- method @Deprecated public String toString(boolean);
- }
-
- @Deprecated public abstract class IdentityScope extends java.security.Identity {
- ctor @Deprecated protected IdentityScope();
- ctor @Deprecated public IdentityScope(String);
- ctor @Deprecated public IdentityScope(String, java.security.IdentityScope) throws java.security.KeyManagementException;
- method @Deprecated public abstract void addIdentity(java.security.Identity) throws java.security.KeyManagementException;
- method @Deprecated public abstract java.security.Identity getIdentity(String);
- method @Deprecated public java.security.Identity getIdentity(java.security.Principal);
- method @Deprecated public abstract java.security.Identity getIdentity(java.security.PublicKey);
- method @Deprecated public static java.security.IdentityScope getSystemScope();
- method @Deprecated public abstract java.util.Enumeration<java.security.Identity> identities();
- method @Deprecated public abstract void removeIdentity(java.security.Identity) throws java.security.KeyManagementException;
- method @Deprecated protected static void setSystemScope(java.security.IdentityScope);
- method @Deprecated public abstract int size();
- }
-
- public class InvalidAlgorithmParameterException extends java.security.GeneralSecurityException {
- ctor public InvalidAlgorithmParameterException();
- ctor public InvalidAlgorithmParameterException(String);
- ctor public InvalidAlgorithmParameterException(String, Throwable);
- ctor public InvalidAlgorithmParameterException(Throwable);
- }
-
- public class InvalidKeyException extends java.security.KeyException {
- ctor public InvalidKeyException();
- ctor public InvalidKeyException(String);
- ctor public InvalidKeyException(String, Throwable);
- ctor public InvalidKeyException(Throwable);
- }
-
- public class InvalidParameterException extends java.lang.IllegalArgumentException {
- ctor public InvalidParameterException();
- ctor public InvalidParameterException(String);
- }
-
- public interface Key extends java.io.Serializable {
- method public String getAlgorithm();
- method public byte[] getEncoded();
- method public String getFormat();
- field public static final long serialVersionUID = 6603384152749567654L; // 0x5ba3eee69414eea6L
- }
-
- public class KeyException extends java.security.GeneralSecurityException {
- ctor public KeyException();
- ctor public KeyException(String);
- ctor public KeyException(String, Throwable);
- ctor public KeyException(Throwable);
- }
-
- public class KeyFactory {
- ctor protected KeyFactory(java.security.KeyFactorySpi, java.security.Provider, String);
- method public final java.security.PrivateKey generatePrivate(java.security.spec.KeySpec) throws java.security.spec.InvalidKeySpecException;
- method public final java.security.PublicKey generatePublic(java.security.spec.KeySpec) throws java.security.spec.InvalidKeySpecException;
- method public final String getAlgorithm();
- method public static java.security.KeyFactory getInstance(String) throws java.security.NoSuchAlgorithmException;
- method public static java.security.KeyFactory getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static java.security.KeyFactory getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method public final <T extends java.security.spec.KeySpec> T getKeySpec(java.security.Key, Class<T>) throws java.security.spec.InvalidKeySpecException;
- method public final java.security.Provider getProvider();
- method public final java.security.Key translateKey(java.security.Key) throws java.security.InvalidKeyException;
- }
-
- public abstract class KeyFactorySpi {
- ctor public KeyFactorySpi();
- method protected abstract java.security.PrivateKey engineGeneratePrivate(java.security.spec.KeySpec) throws java.security.spec.InvalidKeySpecException;
- method protected abstract java.security.PublicKey engineGeneratePublic(java.security.spec.KeySpec) throws java.security.spec.InvalidKeySpecException;
- method protected abstract <T extends java.security.spec.KeySpec> T engineGetKeySpec(java.security.Key, Class<T>) throws java.security.spec.InvalidKeySpecException;
- method protected abstract java.security.Key engineTranslateKey(java.security.Key) throws java.security.InvalidKeyException;
- }
-
- public class KeyManagementException extends java.security.KeyException {
- ctor public KeyManagementException();
- ctor public KeyManagementException(String);
- ctor public KeyManagementException(String, Throwable);
- ctor public KeyManagementException(Throwable);
- }
-
- public final class KeyPair implements java.io.Serializable {
- ctor public KeyPair(java.security.PublicKey, java.security.PrivateKey);
- method public java.security.PrivateKey getPrivate();
- method public java.security.PublicKey getPublic();
- }
-
- public abstract class KeyPairGenerator extends java.security.KeyPairGeneratorSpi {
- ctor protected KeyPairGenerator(String);
- method public final java.security.KeyPair genKeyPair();
- method public java.security.KeyPair generateKeyPair();
- method public String getAlgorithm();
- method public static java.security.KeyPairGenerator getInstance(String) throws java.security.NoSuchAlgorithmException;
- method public static java.security.KeyPairGenerator getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static java.security.KeyPairGenerator getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method public final java.security.Provider getProvider();
- method public void initialize(int);
- method public void initialize(int, java.security.SecureRandom);
- method public void initialize(java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException;
- }
-
- public abstract class KeyPairGeneratorSpi {
- ctor public KeyPairGeneratorSpi();
- method public abstract java.security.KeyPair generateKeyPair();
- method public abstract void initialize(int, java.security.SecureRandom);
- method public void initialize(java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException;
- }
-
- public class KeyRep implements java.io.Serializable {
- ctor public KeyRep(java.security.KeyRep.Type, String, String, byte[]);
- method protected Object readResolve() throws java.io.ObjectStreamException;
- }
-
- public enum KeyRep.Type {
- enum_constant public static final java.security.KeyRep.Type PRIVATE;
- enum_constant public static final java.security.KeyRep.Type PUBLIC;
- enum_constant public static final java.security.KeyRep.Type SECRET;
- }
-
- public class KeyStore {
- ctor protected KeyStore(java.security.KeyStoreSpi, java.security.Provider, String);
- method public final java.util.Enumeration<java.lang.String> aliases() throws java.security.KeyStoreException;
- method public final boolean containsAlias(String) throws java.security.KeyStoreException;
- method public final void deleteEntry(String) throws java.security.KeyStoreException;
- method public final boolean entryInstanceOf(String, Class<? extends java.security.KeyStore.Entry>) throws java.security.KeyStoreException;
- method public final java.security.cert.Certificate getCertificate(String) throws java.security.KeyStoreException;
- method public final String getCertificateAlias(java.security.cert.Certificate) throws java.security.KeyStoreException;
- method public final java.security.cert.Certificate[] getCertificateChain(String) throws java.security.KeyStoreException;
- method public final java.util.Date getCreationDate(String) throws java.security.KeyStoreException;
- method public static final String getDefaultType();
- method public final java.security.KeyStore.Entry getEntry(String, java.security.KeyStore.ProtectionParameter) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableEntryException;
- method public static java.security.KeyStore getInstance(String) throws java.security.KeyStoreException;
- method public static java.security.KeyStore getInstance(String, String) throws java.security.KeyStoreException, java.security.NoSuchProviderException;
- method public static java.security.KeyStore getInstance(String, java.security.Provider) throws java.security.KeyStoreException;
- method public final java.security.Key getKey(String, char[]) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
- method public final java.security.Provider getProvider();
- method public final String getType();
- method public final boolean isCertificateEntry(String) throws java.security.KeyStoreException;
- method public final boolean isKeyEntry(String) throws java.security.KeyStoreException;
- method public final void load(java.io.InputStream, char[]) throws java.security.cert.CertificateException, java.io.IOException, java.security.NoSuchAlgorithmException;
- method public final void load(java.security.KeyStore.LoadStoreParameter) throws java.security.cert.CertificateException, java.io.IOException, java.security.NoSuchAlgorithmException;
- method public final void setCertificateEntry(String, java.security.cert.Certificate) throws java.security.KeyStoreException;
- method public final void setEntry(String, java.security.KeyStore.Entry, java.security.KeyStore.ProtectionParameter) throws java.security.KeyStoreException;
- method public final void setKeyEntry(String, java.security.Key, char[], java.security.cert.Certificate[]) throws java.security.KeyStoreException;
- method public final void setKeyEntry(String, byte[], java.security.cert.Certificate[]) throws java.security.KeyStoreException;
- method public final int size() throws java.security.KeyStoreException;
- method public final void store(java.io.OutputStream, char[]) throws java.security.cert.CertificateException, java.io.IOException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException;
- method public final void store(java.security.KeyStore.LoadStoreParameter) throws java.security.cert.CertificateException, java.io.IOException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException;
- }
-
- public abstract static class KeyStore.Builder {
- ctor protected KeyStore.Builder();
- method public abstract java.security.KeyStore getKeyStore() throws java.security.KeyStoreException;
- method public abstract java.security.KeyStore.ProtectionParameter getProtectionParameter(String) throws java.security.KeyStoreException;
- method public static java.security.KeyStore.Builder newInstance(java.security.KeyStore, java.security.KeyStore.ProtectionParameter);
- method public static java.security.KeyStore.Builder newInstance(String, java.security.Provider, java.io.File, java.security.KeyStore.ProtectionParameter);
- method public static java.security.KeyStore.Builder newInstance(String, java.security.Provider, java.security.KeyStore.ProtectionParameter);
- }
-
- public static class KeyStore.CallbackHandlerProtection implements java.security.KeyStore.ProtectionParameter {
- ctor public KeyStore.CallbackHandlerProtection(javax.security.auth.callback.CallbackHandler);
- method public javax.security.auth.callback.CallbackHandler getCallbackHandler();
- }
-
- public static interface KeyStore.Entry {
- method public default java.util.Set<java.security.KeyStore.Entry.Attribute> getAttributes();
- }
-
- public static interface KeyStore.Entry.Attribute {
- method public String getName();
- method public String getValue();
- }
-
- public static interface KeyStore.LoadStoreParameter {
- method public java.security.KeyStore.ProtectionParameter getProtectionParameter();
- }
-
- public static class KeyStore.PasswordProtection implements javax.security.auth.Destroyable java.security.KeyStore.ProtectionParameter {
- ctor public KeyStore.PasswordProtection(char[]);
- ctor public KeyStore.PasswordProtection(char[], String, java.security.spec.AlgorithmParameterSpec);
- method public char[] getPassword();
- method public String getProtectionAlgorithm();
- method public java.security.spec.AlgorithmParameterSpec getProtectionParameters();
- }
-
- public static final class KeyStore.PrivateKeyEntry implements java.security.KeyStore.Entry {
- ctor public KeyStore.PrivateKeyEntry(java.security.PrivateKey, java.security.cert.Certificate[]);
- ctor public KeyStore.PrivateKeyEntry(java.security.PrivateKey, java.security.cert.Certificate[], java.util.Set<java.security.KeyStore.Entry.Attribute>);
- method public java.security.cert.Certificate getCertificate();
- method public java.security.cert.Certificate[] getCertificateChain();
- method public java.security.PrivateKey getPrivateKey();
- }
-
- public static interface KeyStore.ProtectionParameter {
- }
-
- public static final class KeyStore.SecretKeyEntry implements java.security.KeyStore.Entry {
- ctor public KeyStore.SecretKeyEntry(javax.crypto.SecretKey);
- ctor public KeyStore.SecretKeyEntry(javax.crypto.SecretKey, java.util.Set<java.security.KeyStore.Entry.Attribute>);
- method public javax.crypto.SecretKey getSecretKey();
- }
-
- public static final class KeyStore.TrustedCertificateEntry implements java.security.KeyStore.Entry {
- ctor public KeyStore.TrustedCertificateEntry(java.security.cert.Certificate);
- ctor public KeyStore.TrustedCertificateEntry(java.security.cert.Certificate, java.util.Set<java.security.KeyStore.Entry.Attribute>);
- method public java.security.cert.Certificate getTrustedCertificate();
- }
-
- public class KeyStoreException extends java.security.GeneralSecurityException {
- ctor public KeyStoreException();
- ctor public KeyStoreException(String);
- ctor public KeyStoreException(String, Throwable);
- ctor public KeyStoreException(Throwable);
- }
-
- public abstract class KeyStoreSpi {
- ctor public KeyStoreSpi();
- method public abstract java.util.Enumeration<java.lang.String> engineAliases();
- method public abstract boolean engineContainsAlias(String);
- method public abstract void engineDeleteEntry(String) throws java.security.KeyStoreException;
- method public boolean engineEntryInstanceOf(String, Class<? extends java.security.KeyStore.Entry>);
- method public abstract java.security.cert.Certificate engineGetCertificate(String);
- method public abstract String engineGetCertificateAlias(java.security.cert.Certificate);
- method public abstract java.security.cert.Certificate[] engineGetCertificateChain(String);
- method public abstract java.util.Date engineGetCreationDate(String);
- method public java.security.KeyStore.Entry engineGetEntry(String, java.security.KeyStore.ProtectionParameter) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableEntryException;
- method public abstract java.security.Key engineGetKey(String, char[]) throws java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
- method public abstract boolean engineIsCertificateEntry(String);
- method public abstract boolean engineIsKeyEntry(String);
- method public abstract void engineLoad(java.io.InputStream, char[]) throws java.security.cert.CertificateException, java.io.IOException, java.security.NoSuchAlgorithmException;
- method public void engineLoad(java.security.KeyStore.LoadStoreParameter) throws java.security.cert.CertificateException, java.io.IOException, java.security.NoSuchAlgorithmException;
- method public abstract void engineSetCertificateEntry(String, java.security.cert.Certificate) throws java.security.KeyStoreException;
- method public void engineSetEntry(String, java.security.KeyStore.Entry, java.security.KeyStore.ProtectionParameter) throws java.security.KeyStoreException;
- method public abstract void engineSetKeyEntry(String, java.security.Key, char[], java.security.cert.Certificate[]) throws java.security.KeyStoreException;
- method public abstract void engineSetKeyEntry(String, byte[], java.security.cert.Certificate[]) throws java.security.KeyStoreException;
- method public abstract int engineSize();
- method public abstract void engineStore(java.io.OutputStream, char[]) throws java.security.cert.CertificateException, java.io.IOException, java.security.NoSuchAlgorithmException;
- method public void engineStore(java.security.KeyStore.LoadStoreParameter) throws java.security.cert.CertificateException, java.io.IOException, java.security.NoSuchAlgorithmException;
- }
-
- public abstract class MessageDigest extends java.security.MessageDigestSpi {
- ctor protected MessageDigest(@NonNull String);
- method @NonNull public byte[] digest();
- method public int digest(@NonNull byte[], int, int) throws java.security.DigestException;
- method @NonNull public byte[] digest(@NonNull byte[]);
- method @NonNull public final String getAlgorithm();
- method public final int getDigestLength();
- method @NonNull public static java.security.MessageDigest getInstance(@NonNull String) throws java.security.NoSuchAlgorithmException;
- method @NonNull public static java.security.MessageDigest getInstance(@NonNull String, @NonNull String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method @NonNull public static java.security.MessageDigest getInstance(@NonNull String, @NonNull java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method @NonNull public final java.security.Provider getProvider();
- method public static boolean isEqual(@Nullable byte[], @Nullable byte[]);
- method public void reset();
- method public void update(byte);
- method public void update(@NonNull byte[], int, int);
- method public void update(@NonNull byte[]);
- method public final void update(@NonNull java.nio.ByteBuffer);
- }
-
- public abstract class MessageDigestSpi {
- ctor public MessageDigestSpi();
- method public Object clone() throws java.lang.CloneNotSupportedException;
- method protected abstract byte[] engineDigest();
- method protected int engineDigest(byte[], int, int) throws java.security.DigestException;
- method protected int engineGetDigestLength();
- method protected abstract void engineReset();
- method protected abstract void engineUpdate(byte);
- method protected abstract void engineUpdate(byte[], int, int);
- method protected void engineUpdate(java.nio.ByteBuffer);
- }
-
- public class NoSuchAlgorithmException extends java.security.GeneralSecurityException {
- ctor public NoSuchAlgorithmException();
- ctor public NoSuchAlgorithmException(String);
- ctor public NoSuchAlgorithmException(String, Throwable);
- ctor public NoSuchAlgorithmException(Throwable);
- }
-
- public class NoSuchProviderException extends java.security.GeneralSecurityException {
- ctor public NoSuchProviderException();
- ctor public NoSuchProviderException(String);
- }
-
- public final class PKCS12Attribute implements java.security.KeyStore.Entry.Attribute {
- ctor public PKCS12Attribute(String, String);
- ctor public PKCS12Attribute(byte[]);
- method public byte[] getEncoded();
- method public String getName();
- method public String getValue();
- }
-
- public abstract class Permission implements java.security.Guard java.io.Serializable {
- ctor public Permission(String);
- method public void checkGuard(Object) throws java.lang.SecurityException;
- method public abstract String getActions();
- method public final String getName();
- method public abstract boolean implies(java.security.Permission);
- method public java.security.PermissionCollection newPermissionCollection();
- }
-
- public abstract class PermissionCollection implements java.io.Serializable {
- ctor public PermissionCollection();
- method public abstract void add(java.security.Permission);
- method public abstract java.util.Enumeration<java.security.Permission> elements();
- method public abstract boolean implies(java.security.Permission);
- method public boolean isReadOnly();
- method public void setReadOnly();
- }
-
- public final class Permissions extends java.security.PermissionCollection implements java.io.Serializable {
- ctor public Permissions();
- method public void add(java.security.Permission);
- method public java.util.Enumeration<java.security.Permission> elements();
- method public boolean implies(java.security.Permission);
- }
-
- public abstract class Policy {
- ctor public Policy();
- method public static java.security.Policy getInstance(String, java.security.Policy.Parameters) throws java.security.NoSuchAlgorithmException;
- method public static java.security.Policy getInstance(String, java.security.Policy.Parameters, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static java.security.Policy getInstance(String, java.security.Policy.Parameters, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method public java.security.Policy.Parameters getParameters();
- method public java.security.PermissionCollection getPermissions(java.security.CodeSource);
- method public java.security.PermissionCollection getPermissions(java.security.ProtectionDomain);
- method public static java.security.Policy getPolicy();
- method public java.security.Provider getProvider();
- method public String getType();
- method public boolean implies(java.security.ProtectionDomain, java.security.Permission);
- method public void refresh();
- method public static void setPolicy(java.security.Policy);
- field public static final java.security.PermissionCollection UNSUPPORTED_EMPTY_COLLECTION;
- }
-
- public static interface Policy.Parameters {
- }
-
- public abstract class PolicySpi {
- ctor public PolicySpi();
- method protected java.security.PermissionCollection engineGetPermissions(java.security.CodeSource);
- method protected java.security.PermissionCollection engineGetPermissions(java.security.ProtectionDomain);
- method protected abstract boolean engineImplies(java.security.ProtectionDomain, java.security.Permission);
- method protected void engineRefresh();
- }
-
- public interface Principal {
- method public boolean equals(Object);
- method public String getName();
- method public int hashCode();
- method public default boolean implies(javax.security.auth.Subject);
- method public String toString();
- }
-
- public interface PrivateKey extends java.security.Key javax.security.auth.Destroyable {
- field public static final long serialVersionUID = 6034044314589513430L; // 0x53bd3b559a12c6d6L
- }
-
- public interface PrivilegedAction<T> {
- method public T run();
- }
-
- public class PrivilegedActionException extends java.lang.Exception {
- ctor public PrivilegedActionException(Exception);
- method public Exception getException();
- }
-
- public interface PrivilegedExceptionAction<T> {
- method public T run() throws java.lang.Exception;
- }
-
- public class ProtectionDomain {
- ctor public ProtectionDomain(java.security.CodeSource, java.security.PermissionCollection);
- ctor public ProtectionDomain(java.security.CodeSource, java.security.PermissionCollection, ClassLoader, java.security.Principal[]);
- method public final ClassLoader getClassLoader();
- method public final java.security.CodeSource getCodeSource();
- method public final java.security.PermissionCollection getPermissions();
- method public final java.security.Principal[] getPrincipals();
- method public boolean implies(java.security.Permission);
- }
-
- public abstract class Provider extends java.util.Properties {
- ctor protected Provider(String, double, String);
- method public Object compute(Object, java.util.function.BiFunction<? super java.lang.Object,? super java.lang.Object,?>);
- method public Object computeIfAbsent(Object, java.util.function.Function<? super java.lang.Object,?>);
- method public Object computeIfPresent(Object, java.util.function.BiFunction<? super java.lang.Object,? super java.lang.Object,?>);
- method public java.util.Enumeration<java.lang.Object> elements();
- method public java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>> entrySet();
- method public void forEach(java.util.function.BiConsumer<? super java.lang.Object,? super java.lang.Object>);
- method public Object get(Object);
- method public String getInfo();
- method public String getName();
- method public Object getOrDefault(Object, Object);
- method public java.security.Provider.Service getService(String, String);
- method public java.util.Set<java.security.Provider.Service> getServices();
- method public double getVersion();
- method public java.util.Set<java.lang.Object> keySet();
- method public java.util.Enumeration<java.lang.Object> keys();
- method public Object merge(Object, Object, java.util.function.BiFunction<? super java.lang.Object,? super java.lang.Object,?>);
- method public Object put(Object, Object);
- method public void putAll(java.util.Map<?,?>);
- method public Object putIfAbsent(Object, Object);
- method protected void putService(java.security.Provider.Service);
- method public Object remove(Object);
- method protected void removeService(java.security.Provider.Service);
- method public boolean replace(Object, Object, Object);
- method public Object replace(Object, Object);
- method public void replaceAll(java.util.function.BiFunction<? super java.lang.Object,? super java.lang.Object,?>);
- method public java.util.Collection<java.lang.Object> values();
- }
-
- public static class Provider.Service {
- ctor public Provider.Service(java.security.Provider, String, String, String, java.util.List<java.lang.String>, java.util.Map<java.lang.String,java.lang.String>);
- method public final String getAlgorithm();
- method public final String getAttribute(String);
- method public final String getClassName();
- method public final java.security.Provider getProvider();
- method public final String getType();
- method public Object newInstance(Object) throws java.security.NoSuchAlgorithmException;
- method public boolean supportsParameter(Object);
- }
-
- public class ProviderException extends java.lang.RuntimeException {
- ctor public ProviderException();
- ctor public ProviderException(String);
- ctor public ProviderException(String, Throwable);
- ctor public ProviderException(Throwable);
- }
-
- public interface PublicKey extends java.security.Key {
- field public static final long serialVersionUID = 7187392471159151072L; // 0x63bebf5f40c219e0L
- }
-
- public class SecureClassLoader extends java.lang.ClassLoader {
- ctor protected SecureClassLoader(ClassLoader);
- ctor protected SecureClassLoader();
- method protected final Class<?> defineClass(String, byte[], int, int, java.security.CodeSource);
- method protected final Class<?> defineClass(String, java.nio.ByteBuffer, java.security.CodeSource);
- method protected java.security.PermissionCollection getPermissions(java.security.CodeSource);
- }
-
- public class SecureRandom extends java.util.Random {
- ctor public SecureRandom();
- ctor public SecureRandom(byte[]);
- ctor protected SecureRandom(java.security.SecureRandomSpi, java.security.Provider);
- method public byte[] generateSeed(int);
- method public String getAlgorithm();
- method public static java.security.SecureRandom getInstance(String) throws java.security.NoSuchAlgorithmException;
- method public static java.security.SecureRandom getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static java.security.SecureRandom getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method public static java.security.SecureRandom getInstanceStrong() throws java.security.NoSuchAlgorithmException;
- method public final java.security.Provider getProvider();
- method public static byte[] getSeed(int);
- method protected final int next(int);
- method public void setSeed(byte[]);
- }
-
- public abstract class SecureRandomSpi implements java.io.Serializable {
- ctor public SecureRandomSpi();
- method protected abstract byte[] engineGenerateSeed(int);
- method protected abstract void engineNextBytes(byte[]);
- method protected abstract void engineSetSeed(byte[]);
- }
-
- public final class Security {
- method public static int addProvider(java.security.Provider);
- method @Deprecated public static String getAlgorithmProperty(String, String);
- method public static java.util.Set<java.lang.String> getAlgorithms(String);
- method public static String getProperty(String);
- method public static java.security.Provider getProvider(String);
- method public static java.security.Provider[] getProviders();
- method public static java.security.Provider[] getProviders(String);
- method public static java.security.Provider[] getProviders(java.util.Map<java.lang.String,java.lang.String>);
- method public static int insertProviderAt(java.security.Provider, int);
- method public static void removeProvider(String);
- method public static void setProperty(String, String);
- }
-
- public final class SecurityPermission extends java.security.BasicPermission {
- ctor public SecurityPermission(String);
- ctor public SecurityPermission(String, String);
- }
-
- public abstract class Signature extends java.security.SignatureSpi {
- ctor protected Signature(String);
- method public final String getAlgorithm();
- method public static java.security.Signature getInstance(String) throws java.security.NoSuchAlgorithmException;
- method public static java.security.Signature getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static java.security.Signature getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method @Deprecated public final Object getParameter(String) throws java.security.InvalidParameterException;
- method public final java.security.AlgorithmParameters getParameters();
- method public final java.security.Provider getProvider();
- method public final void initSign(java.security.PrivateKey) throws java.security.InvalidKeyException;
- method public final void initSign(java.security.PrivateKey, java.security.SecureRandom) throws java.security.InvalidKeyException;
- method public final void initVerify(java.security.PublicKey) throws java.security.InvalidKeyException;
- method public final void initVerify(java.security.cert.Certificate) throws java.security.InvalidKeyException;
- method @Deprecated public final void setParameter(String, Object) throws java.security.InvalidParameterException;
- method public final void setParameter(java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException;
- method public final byte[] sign() throws java.security.SignatureException;
- method public final int sign(byte[], int, int) throws java.security.SignatureException;
- method public final void update(byte) throws java.security.SignatureException;
- method public final void update(byte[]) throws java.security.SignatureException;
- method public final void update(byte[], int, int) throws java.security.SignatureException;
- method public final void update(java.nio.ByteBuffer) throws java.security.SignatureException;
- method public final boolean verify(byte[]) throws java.security.SignatureException;
- method public final boolean verify(byte[], int, int) throws java.security.SignatureException;
- field protected static final int SIGN = 2; // 0x2
- field protected static final int UNINITIALIZED = 0; // 0x0
- field protected static final int VERIFY = 3; // 0x3
- field protected int state;
- }
-
- public class SignatureException extends java.security.GeneralSecurityException {
- ctor public SignatureException();
- ctor public SignatureException(String);
- ctor public SignatureException(String, Throwable);
- ctor public SignatureException(Throwable);
- }
-
- public abstract class SignatureSpi {
- ctor public SignatureSpi();
- method public Object clone() throws java.lang.CloneNotSupportedException;
- method @Deprecated protected abstract Object engineGetParameter(String) throws java.security.InvalidParameterException;
- method protected java.security.AlgorithmParameters engineGetParameters();
- method protected abstract void engineInitSign(java.security.PrivateKey) throws java.security.InvalidKeyException;
- method protected void engineInitSign(java.security.PrivateKey, java.security.SecureRandom) throws java.security.InvalidKeyException;
- method protected abstract void engineInitVerify(java.security.PublicKey) throws java.security.InvalidKeyException;
- method @Deprecated protected abstract void engineSetParameter(String, Object) throws java.security.InvalidParameterException;
- method protected void engineSetParameter(java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException;
- method protected abstract byte[] engineSign() throws java.security.SignatureException;
- method protected int engineSign(byte[], int, int) throws java.security.SignatureException;
- method protected abstract void engineUpdate(byte) throws java.security.SignatureException;
- method protected abstract void engineUpdate(byte[], int, int) throws java.security.SignatureException;
- method protected void engineUpdate(java.nio.ByteBuffer);
- method protected abstract boolean engineVerify(byte[]) throws java.security.SignatureException;
- method protected boolean engineVerify(byte[], int, int) throws java.security.SignatureException;
- field protected java.security.SecureRandom appRandom;
- }
-
- public final class SignedObject implements java.io.Serializable {
- ctor public SignedObject(java.io.Serializable, java.security.PrivateKey, java.security.Signature) throws java.io.IOException, java.security.InvalidKeyException, java.security.SignatureException;
- method public String getAlgorithm();
- method public Object getObject() throws java.lang.ClassNotFoundException, java.io.IOException;
- method public byte[] getSignature();
- method public boolean verify(java.security.PublicKey, java.security.Signature) throws java.security.InvalidKeyException, java.security.SignatureException;
- }
-
- @Deprecated public abstract class Signer extends java.security.Identity {
- ctor @Deprecated protected Signer();
- ctor @Deprecated public Signer(String);
- ctor @Deprecated public Signer(String, java.security.IdentityScope) throws java.security.KeyManagementException;
- method @Deprecated public java.security.PrivateKey getPrivateKey();
- method @Deprecated public final void setKeyPair(java.security.KeyPair) throws java.security.InvalidParameterException, java.security.KeyException;
- }
-
- public final class Timestamp implements java.io.Serializable {
- ctor public Timestamp(java.util.Date, java.security.cert.CertPath);
- method public java.security.cert.CertPath getSignerCertPath();
- method public java.util.Date getTimestamp();
- }
-
- public class UnrecoverableEntryException extends java.security.GeneralSecurityException {
- ctor public UnrecoverableEntryException();
- ctor public UnrecoverableEntryException(String);
- }
-
- public class UnrecoverableKeyException extends java.security.UnrecoverableEntryException {
- ctor public UnrecoverableKeyException();
- ctor public UnrecoverableKeyException(String);
- }
-
- public final class UnresolvedPermission extends java.security.Permission implements java.io.Serializable {
- ctor public UnresolvedPermission(String, String, String, java.security.cert.Certificate[]);
- method public String getActions();
- method public String getUnresolvedActions();
- method public java.security.cert.Certificate[] getUnresolvedCerts();
- method public String getUnresolvedName();
- method public String getUnresolvedType();
- method public boolean implies(java.security.Permission);
- }
-
-}
-
-package java.security.acl {
-
- public interface Acl extends java.security.acl.Owner {
- method public boolean addEntry(java.security.Principal, java.security.acl.AclEntry) throws java.security.acl.NotOwnerException;
- method public boolean checkPermission(java.security.Principal, java.security.acl.Permission);
- method public java.util.Enumeration<java.security.acl.AclEntry> entries();
- method public String getName();
- method public java.util.Enumeration<java.security.acl.Permission> getPermissions(java.security.Principal);
- method public boolean removeEntry(java.security.Principal, java.security.acl.AclEntry) throws java.security.acl.NotOwnerException;
- method public void setName(java.security.Principal, String) throws java.security.acl.NotOwnerException;
- method public String toString();
- }
-
- public interface AclEntry extends java.lang.Cloneable {
- method public boolean addPermission(java.security.acl.Permission);
- method public boolean checkPermission(java.security.acl.Permission);
- method public Object clone();
- method public java.security.Principal getPrincipal();
- method public boolean isNegative();
- method public java.util.Enumeration<java.security.acl.Permission> permissions();
- method public boolean removePermission(java.security.acl.Permission);
- method public void setNegativePermissions();
- method public boolean setPrincipal(java.security.Principal);
- method public String toString();
- }
-
- public class AclNotFoundException extends java.lang.Exception {
- ctor public AclNotFoundException();
- }
-
- public interface Group extends java.security.Principal {
- method public boolean addMember(java.security.Principal);
- method public boolean isMember(java.security.Principal);
- method public java.util.Enumeration<? extends java.security.Principal> members();
- method public boolean removeMember(java.security.Principal);
- }
-
- public class LastOwnerException extends java.lang.Exception {
- ctor public LastOwnerException();
- }
-
- public class NotOwnerException extends java.lang.Exception {
- ctor public NotOwnerException();
- }
-
- public interface Owner {
- method public boolean addOwner(java.security.Principal, java.security.Principal) throws java.security.acl.NotOwnerException;
- method public boolean deleteOwner(java.security.Principal, java.security.Principal) throws java.security.acl.LastOwnerException, java.security.acl.NotOwnerException;
- method public boolean isOwner(java.security.Principal);
- }
-
- public interface Permission {
- }
-
-}
-
-package java.security.cert {
-
- public abstract class CRL {
- ctor protected CRL(String);
- method public final String getType();
- method public abstract boolean isRevoked(java.security.cert.Certificate);
- method public abstract String toString();
- }
-
- public class CRLException extends java.security.GeneralSecurityException {
- ctor public CRLException();
- ctor public CRLException(String);
- ctor public CRLException(String, Throwable);
- ctor public CRLException(Throwable);
- }
-
- public enum CRLReason {
- enum_constant public static final java.security.cert.CRLReason AA_COMPROMISE;
- enum_constant public static final java.security.cert.CRLReason AFFILIATION_CHANGED;
- enum_constant public static final java.security.cert.CRLReason CA_COMPROMISE;
- enum_constant public static final java.security.cert.CRLReason CERTIFICATE_HOLD;
- enum_constant public static final java.security.cert.CRLReason CESSATION_OF_OPERATION;
- enum_constant public static final java.security.cert.CRLReason KEY_COMPROMISE;
- enum_constant public static final java.security.cert.CRLReason PRIVILEGE_WITHDRAWN;
- enum_constant public static final java.security.cert.CRLReason REMOVE_FROM_CRL;
- enum_constant public static final java.security.cert.CRLReason SUPERSEDED;
- enum_constant public static final java.security.cert.CRLReason UNSPECIFIED;
- enum_constant public static final java.security.cert.CRLReason UNUSED;
- }
-
- public interface CRLSelector extends java.lang.Cloneable {
- method public Object clone();
- method public boolean match(java.security.cert.CRL);
- }
-
- public abstract class CertPath implements java.io.Serializable {
- ctor protected CertPath(String);
- method public abstract java.util.List<? extends java.security.cert.Certificate> getCertificates();
- method public abstract byte[] getEncoded() throws java.security.cert.CertificateEncodingException;
- method public abstract byte[] getEncoded(String) throws java.security.cert.CertificateEncodingException;
- method public abstract java.util.Iterator<java.lang.String> getEncodings();
- method public String getType();
- method protected Object writeReplace() throws java.io.ObjectStreamException;
- }
-
- protected static class CertPath.CertPathRep implements java.io.Serializable {
- ctor protected CertPath.CertPathRep(String, byte[]);
- method protected Object readResolve() throws java.io.ObjectStreamException;
- }
-
- public class CertPathBuilder {
- ctor protected CertPathBuilder(java.security.cert.CertPathBuilderSpi, java.security.Provider, String);
- method public final java.security.cert.CertPathBuilderResult build(java.security.cert.CertPathParameters) throws java.security.cert.CertPathBuilderException, java.security.InvalidAlgorithmParameterException;
- method public final String getAlgorithm();
- method public static final String getDefaultType();
- method public static java.security.cert.CertPathBuilder getInstance(String) throws java.security.NoSuchAlgorithmException;
- method public static java.security.cert.CertPathBuilder getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static java.security.cert.CertPathBuilder getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method public final java.security.Provider getProvider();
- method public final java.security.cert.CertPathChecker getRevocationChecker();
- }
-
- public class CertPathBuilderException extends java.security.GeneralSecurityException {
- ctor public CertPathBuilderException();
- ctor public CertPathBuilderException(String);
- ctor public CertPathBuilderException(Throwable);
- ctor public CertPathBuilderException(String, Throwable);
- }
-
- public interface CertPathBuilderResult extends java.lang.Cloneable {
- method public Object clone();
- method public java.security.cert.CertPath getCertPath();
- }
-
- public abstract class CertPathBuilderSpi {
- ctor public CertPathBuilderSpi();
- method public abstract java.security.cert.CertPathBuilderResult engineBuild(java.security.cert.CertPathParameters) throws java.security.cert.CertPathBuilderException, java.security.InvalidAlgorithmParameterException;
- method public java.security.cert.CertPathChecker engineGetRevocationChecker();
- }
-
- public interface CertPathChecker {
- method public void check(java.security.cert.Certificate) throws java.security.cert.CertPathValidatorException;
- method public void init(boolean) throws java.security.cert.CertPathValidatorException;
- method public boolean isForwardCheckingSupported();
- }
-
- public interface CertPathParameters extends java.lang.Cloneable {
- method public Object clone();
- }
-
- public class CertPathValidator {
- ctor protected CertPathValidator(java.security.cert.CertPathValidatorSpi, java.security.Provider, String);
- method public final String getAlgorithm();
- method public static final String getDefaultType();
- method public static java.security.cert.CertPathValidator getInstance(String) throws java.security.NoSuchAlgorithmException;
- method public static java.security.cert.CertPathValidator getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static java.security.cert.CertPathValidator getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method public final java.security.Provider getProvider();
- method public final java.security.cert.CertPathChecker getRevocationChecker();
- method public final java.security.cert.CertPathValidatorResult validate(java.security.cert.CertPath, java.security.cert.CertPathParameters) throws java.security.cert.CertPathValidatorException, java.security.InvalidAlgorithmParameterException;
- }
-
- public class CertPathValidatorException extends java.security.GeneralSecurityException {
- ctor public CertPathValidatorException();
- ctor public CertPathValidatorException(String);
- ctor public CertPathValidatorException(Throwable);
- ctor public CertPathValidatorException(String, Throwable);
- ctor public CertPathValidatorException(String, Throwable, java.security.cert.CertPath, int);
- ctor public CertPathValidatorException(String, Throwable, java.security.cert.CertPath, int, java.security.cert.CertPathValidatorException.Reason);
- method public java.security.cert.CertPath getCertPath();
- method public int getIndex();
- method public java.security.cert.CertPathValidatorException.Reason getReason();
- }
-
- public enum CertPathValidatorException.BasicReason implements java.security.cert.CertPathValidatorException.Reason {
- enum_constant public static final java.security.cert.CertPathValidatorException.BasicReason ALGORITHM_CONSTRAINED;
- enum_constant public static final java.security.cert.CertPathValidatorException.BasicReason EXPIRED;
- enum_constant public static final java.security.cert.CertPathValidatorException.BasicReason INVALID_SIGNATURE;
- enum_constant public static final java.security.cert.CertPathValidatorException.BasicReason NOT_YET_VALID;
- enum_constant public static final java.security.cert.CertPathValidatorException.BasicReason REVOKED;
- enum_constant public static final java.security.cert.CertPathValidatorException.BasicReason UNDETERMINED_REVOCATION_STATUS;
- enum_constant public static final java.security.cert.CertPathValidatorException.BasicReason UNSPECIFIED;
- }
-
- public static interface CertPathValidatorException.Reason extends java.io.Serializable {
- }
-
- public interface CertPathValidatorResult extends java.lang.Cloneable {
- method public Object clone();
- }
-
- public abstract class CertPathValidatorSpi {
- ctor public CertPathValidatorSpi();
- method public java.security.cert.CertPathChecker engineGetRevocationChecker();
- method public abstract java.security.cert.CertPathValidatorResult engineValidate(java.security.cert.CertPath, java.security.cert.CertPathParameters) throws java.security.cert.CertPathValidatorException, java.security.InvalidAlgorithmParameterException;
- }
-
- public interface CertSelector extends java.lang.Cloneable {
- method public Object clone();
- method public boolean match(java.security.cert.Certificate);
- }
-
- public class CertStore {
- ctor protected CertStore(java.security.cert.CertStoreSpi, java.security.Provider, String, java.security.cert.CertStoreParameters);
- method public final java.util.Collection<? extends java.security.cert.CRL> getCRLs(java.security.cert.CRLSelector) throws java.security.cert.CertStoreException;
- method public final java.security.cert.CertStoreParameters getCertStoreParameters();
- method public final java.util.Collection<? extends java.security.cert.Certificate> getCertificates(java.security.cert.CertSelector) throws java.security.cert.CertStoreException;
- method public static final String getDefaultType();
- method public static java.security.cert.CertStore getInstance(String, java.security.cert.CertStoreParameters) throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException;
- method public static java.security.cert.CertStore getInstance(String, java.security.cert.CertStoreParameters, String) throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static java.security.cert.CertStore getInstance(String, java.security.cert.CertStoreParameters, java.security.Provider) throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException;
- method public final java.security.Provider getProvider();
- method public final String getType();
- }
-
- public class CertStoreException extends java.security.GeneralSecurityException {
- ctor public CertStoreException();
- ctor public CertStoreException(String);
- ctor public CertStoreException(Throwable);
- ctor public CertStoreException(String, Throwable);
- }
-
- public interface CertStoreParameters extends java.lang.Cloneable {
- method public Object clone();
- }
-
- public abstract class CertStoreSpi {
- ctor public CertStoreSpi(java.security.cert.CertStoreParameters) throws java.security.InvalidAlgorithmParameterException;
- method public abstract java.util.Collection<? extends java.security.cert.CRL> engineGetCRLs(java.security.cert.CRLSelector) throws java.security.cert.CertStoreException;
- method public abstract java.util.Collection<? extends java.security.cert.Certificate> engineGetCertificates(java.security.cert.CertSelector) throws java.security.cert.CertStoreException;
- }
-
- public abstract class Certificate implements java.io.Serializable {
- ctor protected Certificate(String);
- method public abstract byte[] getEncoded() throws java.security.cert.CertificateEncodingException;
- method public abstract java.security.PublicKey getPublicKey();
- method public final String getType();
- method public abstract String toString();
- method public abstract void verify(java.security.PublicKey) throws java.security.cert.CertificateException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException;
- method public abstract void verify(java.security.PublicKey, String) throws java.security.cert.CertificateException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException;
- method public void verify(java.security.PublicKey, java.security.Provider) throws java.security.cert.CertificateException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.SignatureException;
- method protected Object writeReplace() throws java.io.ObjectStreamException;
- }
-
- protected static class Certificate.CertificateRep implements java.io.Serializable {
- ctor protected Certificate.CertificateRep(String, byte[]);
- method protected Object readResolve() throws java.io.ObjectStreamException;
- }
-
- public class CertificateEncodingException extends java.security.cert.CertificateException {
- ctor public CertificateEncodingException();
- ctor public CertificateEncodingException(String);
- ctor public CertificateEncodingException(String, Throwable);
- ctor public CertificateEncodingException(Throwable);
- }
-
- public class CertificateException extends java.security.GeneralSecurityException {
- ctor public CertificateException();
- ctor public CertificateException(String);
- ctor public CertificateException(String, Throwable);
- ctor public CertificateException(Throwable);
- }
-
- public class CertificateExpiredException extends java.security.cert.CertificateException {
- ctor public CertificateExpiredException();
- ctor public CertificateExpiredException(String);
- }
-
- public class CertificateFactory {
- ctor protected CertificateFactory(java.security.cert.CertificateFactorySpi, java.security.Provider, String);
- method public final java.security.cert.CRL generateCRL(java.io.InputStream) throws java.security.cert.CRLException;
- method public final java.util.Collection<? extends java.security.cert.CRL> generateCRLs(java.io.InputStream) throws java.security.cert.CRLException;
- method public final java.security.cert.CertPath generateCertPath(java.io.InputStream) throws java.security.cert.CertificateException;
- method public final java.security.cert.CertPath generateCertPath(java.io.InputStream, String) throws java.security.cert.CertificateException;
- method public final java.security.cert.CertPath generateCertPath(java.util.List<? extends java.security.cert.Certificate>) throws java.security.cert.CertificateException;
- method public final java.security.cert.Certificate generateCertificate(java.io.InputStream) throws java.security.cert.CertificateException;
- method public final java.util.Collection<? extends java.security.cert.Certificate> generateCertificates(java.io.InputStream) throws java.security.cert.CertificateException;
- method public final java.util.Iterator<java.lang.String> getCertPathEncodings();
- method public static final java.security.cert.CertificateFactory getInstance(String) throws java.security.cert.CertificateException;
- method public static final java.security.cert.CertificateFactory getInstance(String, String) throws java.security.cert.CertificateException, java.security.NoSuchProviderException;
- method public static final java.security.cert.CertificateFactory getInstance(String, java.security.Provider) throws java.security.cert.CertificateException;
- method public final java.security.Provider getProvider();
- method public final String getType();
- }
-
- public abstract class CertificateFactorySpi {
- ctor public CertificateFactorySpi();
- method public abstract java.security.cert.CRL engineGenerateCRL(java.io.InputStream) throws java.security.cert.CRLException;
- method public abstract java.util.Collection<? extends java.security.cert.CRL> engineGenerateCRLs(java.io.InputStream) throws java.security.cert.CRLException;
- method public java.security.cert.CertPath engineGenerateCertPath(java.io.InputStream) throws java.security.cert.CertificateException;
- method public java.security.cert.CertPath engineGenerateCertPath(java.io.InputStream, String) throws java.security.cert.CertificateException;
- method public java.security.cert.CertPath engineGenerateCertPath(java.util.List<? extends java.security.cert.Certificate>) throws java.security.cert.CertificateException;
- method public abstract java.security.cert.Certificate engineGenerateCertificate(java.io.InputStream) throws java.security.cert.CertificateException;
- method public abstract java.util.Collection<? extends java.security.cert.Certificate> engineGenerateCertificates(java.io.InputStream) throws java.security.cert.CertificateException;
- method public java.util.Iterator<java.lang.String> engineGetCertPathEncodings();
- }
-
- public class CertificateNotYetValidException extends java.security.cert.CertificateException {
- ctor public CertificateNotYetValidException();
- ctor public CertificateNotYetValidException(String);
- }
-
- public class CertificateParsingException extends java.security.cert.CertificateException {
- ctor public CertificateParsingException();
- ctor public CertificateParsingException(String);
- ctor public CertificateParsingException(String, Throwable);
- ctor public CertificateParsingException(Throwable);
- }
-
- public class CertificateRevokedException extends java.security.cert.CertificateException {
- ctor public CertificateRevokedException(java.util.Date, java.security.cert.CRLReason, javax.security.auth.x500.X500Principal, java.util.Map<java.lang.String,java.security.cert.Extension>);
- method public javax.security.auth.x500.X500Principal getAuthorityName();
- method public java.util.Map<java.lang.String,java.security.cert.Extension> getExtensions();
- method public java.util.Date getInvalidityDate();
- method public java.util.Date getRevocationDate();
- method public java.security.cert.CRLReason getRevocationReason();
- }
-
- public class CollectionCertStoreParameters implements java.security.cert.CertStoreParameters {
- ctor public CollectionCertStoreParameters(java.util.Collection<?>);
- ctor public CollectionCertStoreParameters();
- method public Object clone();
- method public java.util.Collection<?> getCollection();
- }
-
- public interface Extension {
- method public void encode(java.io.OutputStream) throws java.io.IOException;
- method public String getId();
- method public byte[] getValue();
- method public boolean isCritical();
- }
-
- public class LDAPCertStoreParameters implements java.security.cert.CertStoreParameters {
- ctor public LDAPCertStoreParameters(String, int);
- ctor public LDAPCertStoreParameters(String);
- ctor public LDAPCertStoreParameters();
- method public Object clone();
- method public int getPort();
- method public String getServerName();
- }
-
- public class PKIXBuilderParameters extends java.security.cert.PKIXParameters {
- ctor public PKIXBuilderParameters(java.util.Set<java.security.cert.TrustAnchor>, java.security.cert.CertSelector) throws java.security.InvalidAlgorithmParameterException;
- ctor public PKIXBuilderParameters(java.security.KeyStore, java.security.cert.CertSelector) throws java.security.InvalidAlgorithmParameterException, java.security.KeyStoreException;
- method public int getMaxPathLength();
- method public void setMaxPathLength(int);
- }
-
- public class PKIXCertPathBuilderResult extends java.security.cert.PKIXCertPathValidatorResult implements java.security.cert.CertPathBuilderResult {
- ctor public PKIXCertPathBuilderResult(java.security.cert.CertPath, java.security.cert.TrustAnchor, java.security.cert.PolicyNode, java.security.PublicKey);
- method public java.security.cert.CertPath getCertPath();
- }
-
- public abstract class PKIXCertPathChecker implements java.security.cert.CertPathChecker java.lang.Cloneable {
- ctor protected PKIXCertPathChecker();
- method public abstract void check(java.security.cert.Certificate, java.util.Collection<java.lang.String>) throws java.security.cert.CertPathValidatorException;
- method public void check(java.security.cert.Certificate) throws java.security.cert.CertPathValidatorException;
- method public Object clone();
- method public abstract java.util.Set<java.lang.String> getSupportedExtensions();
- }
-
- public class PKIXCertPathValidatorResult implements java.security.cert.CertPathValidatorResult {
- ctor public PKIXCertPathValidatorResult(java.security.cert.TrustAnchor, java.security.cert.PolicyNode, java.security.PublicKey);
- method public Object clone();
- method public java.security.cert.PolicyNode getPolicyTree();
- method public java.security.PublicKey getPublicKey();
- method public java.security.cert.TrustAnchor getTrustAnchor();
- }
-
- public class PKIXParameters implements java.security.cert.CertPathParameters {
- ctor public PKIXParameters(java.util.Set<java.security.cert.TrustAnchor>) throws java.security.InvalidAlgorithmParameterException;
- ctor public PKIXParameters(java.security.KeyStore) throws java.security.InvalidAlgorithmParameterException, java.security.KeyStoreException;
- method public void addCertPathChecker(java.security.cert.PKIXCertPathChecker);
- method public void addCertStore(java.security.cert.CertStore);
- method public Object clone();
- method public java.util.List<java.security.cert.PKIXCertPathChecker> getCertPathCheckers();
- method public java.util.List<java.security.cert.CertStore> getCertStores();
- method public java.util.Date getDate();
- method public java.util.Set<java.lang.String> getInitialPolicies();
- method public boolean getPolicyQualifiersRejected();
- method public String getSigProvider();
- method public java.security.cert.CertSelector getTargetCertConstraints();
- method public java.util.Set<java.security.cert.TrustAnchor> getTrustAnchors();
- method public boolean isAnyPolicyInhibited();
- method public boolean isExplicitPolicyRequired();
- method public boolean isPolicyMappingInhibited();
- method public boolean isRevocationEnabled();
- method public void setAnyPolicyInhibited(boolean);
- method public void setCertPathCheckers(java.util.List<java.security.cert.PKIXCertPathChecker>);
- method public void setCertStores(java.util.List<java.security.cert.CertStore>);
- method public void setDate(java.util.Date);
- method public void setExplicitPolicyRequired(boolean);
- method public void setInitialPolicies(java.util.Set<java.lang.String>);
- method public void setPolicyMappingInhibited(boolean);
- method public void setPolicyQualifiersRejected(boolean);
- method public void setRevocationEnabled(boolean);
- method public void setSigProvider(String);
- method public void setTargetCertConstraints(java.security.cert.CertSelector);
- method public void setTrustAnchors(java.util.Set<java.security.cert.TrustAnchor>) throws java.security.InvalidAlgorithmParameterException;
- }
-
- public enum PKIXReason implements java.security.cert.CertPathValidatorException.Reason {
- enum_constant public static final java.security.cert.PKIXReason INVALID_KEY_USAGE;
- enum_constant public static final java.security.cert.PKIXReason INVALID_NAME;
- enum_constant public static final java.security.cert.PKIXReason INVALID_POLICY;
- enum_constant public static final java.security.cert.PKIXReason NAME_CHAINING;
- enum_constant public static final java.security.cert.PKIXReason NOT_CA_CERT;
- enum_constant public static final java.security.cert.PKIXReason NO_TRUST_ANCHOR;
- enum_constant public static final java.security.cert.PKIXReason PATH_TOO_LONG;
- enum_constant public static final java.security.cert.PKIXReason UNRECOGNIZED_CRIT_EXT;
- }
-
- public abstract class PKIXRevocationChecker extends java.security.cert.PKIXCertPathChecker {
- ctor protected PKIXRevocationChecker();
- method public java.security.cert.PKIXRevocationChecker clone();
- method public java.util.List<java.security.cert.Extension> getOcspExtensions();
- method public java.net.URI getOcspResponder();
- method public java.security.cert.X509Certificate getOcspResponderCert();
- method public java.util.Map<java.security.cert.X509Certificate,byte[]> getOcspResponses();
- method public java.util.Set<java.security.cert.PKIXRevocationChecker.Option> getOptions();
- method public abstract java.util.List<java.security.cert.CertPathValidatorException> getSoftFailExceptions();
- method public void setOcspExtensions(java.util.List<java.security.cert.Extension>);
- method public void setOcspResponder(java.net.URI);
- method public void setOcspResponderCert(java.security.cert.X509Certificate);
- method public void setOcspResponses(java.util.Map<java.security.cert.X509Certificate,byte[]>);
- method public void setOptions(java.util.Set<java.security.cert.PKIXRevocationChecker.Option>);
- }
-
- public enum PKIXRevocationChecker.Option {
- enum_constant public static final java.security.cert.PKIXRevocationChecker.Option NO_FALLBACK;
- enum_constant public static final java.security.cert.PKIXRevocationChecker.Option ONLY_END_ENTITY;
- enum_constant public static final java.security.cert.PKIXRevocationChecker.Option PREFER_CRLS;
- enum_constant public static final java.security.cert.PKIXRevocationChecker.Option SOFT_FAIL;
- }
-
- public interface PolicyNode {
- method public java.util.Iterator<? extends java.security.cert.PolicyNode> getChildren();
- method public int getDepth();
- method public java.util.Set<java.lang.String> getExpectedPolicies();
- method public java.security.cert.PolicyNode getParent();
- method public java.util.Set<? extends java.security.cert.PolicyQualifierInfo> getPolicyQualifiers();
- method public String getValidPolicy();
- method public boolean isCritical();
- }
-
- public class PolicyQualifierInfo {
- ctor public PolicyQualifierInfo(byte[]) throws java.io.IOException;
- method public final byte[] getEncoded();
- method public final byte[] getPolicyQualifier();
- method public final String getPolicyQualifierId();
- }
-
- public class TrustAnchor {
- ctor public TrustAnchor(java.security.cert.X509Certificate, byte[]);
- ctor public TrustAnchor(javax.security.auth.x500.X500Principal, java.security.PublicKey, byte[]);
- ctor public TrustAnchor(String, java.security.PublicKey, byte[]);
- method public final javax.security.auth.x500.X500Principal getCA();
- method public final String getCAName();
- method public final java.security.PublicKey getCAPublicKey();
- method public final byte[] getNameConstraints();
- method public final java.security.cert.X509Certificate getTrustedCert();
- }
-
- public abstract class X509CRL extends java.security.cert.CRL implements java.security.cert.X509Extension {
- ctor protected X509CRL();
- method public abstract byte[] getEncoded() throws java.security.cert.CRLException;
- method public abstract java.security.Principal getIssuerDN();
- method public javax.security.auth.x500.X500Principal getIssuerX500Principal();
- method public abstract java.util.Date getNextUpdate();
- method public abstract java.security.cert.X509CRLEntry getRevokedCertificate(java.math.BigInteger);
- method public java.security.cert.X509CRLEntry getRevokedCertificate(java.security.cert.X509Certificate);
- method public abstract java.util.Set<? extends java.security.cert.X509CRLEntry> getRevokedCertificates();
- method public abstract String getSigAlgName();
- method public abstract String getSigAlgOID();
- method public abstract byte[] getSigAlgParams();
- method public abstract byte[] getSignature();
- method public abstract byte[] getTBSCertList() throws java.security.cert.CRLException;
- method public abstract java.util.Date getThisUpdate();
- method public abstract int getVersion();
- method public abstract void verify(java.security.PublicKey) throws java.security.cert.CRLException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException;
- method public abstract void verify(java.security.PublicKey, String) throws java.security.cert.CRLException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException;
- method public void verify(java.security.PublicKey, java.security.Provider) throws java.security.cert.CRLException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.SignatureException;
- }
-
- public abstract class X509CRLEntry implements java.security.cert.X509Extension {
- ctor public X509CRLEntry();
- method public javax.security.auth.x500.X500Principal getCertificateIssuer();
- method public abstract byte[] getEncoded() throws java.security.cert.CRLException;
- method public abstract java.util.Date getRevocationDate();
- method public java.security.cert.CRLReason getRevocationReason();
- method public abstract java.math.BigInteger getSerialNumber();
- method public abstract boolean hasExtensions();
- method public abstract String toString();
- }
-
- public class X509CRLSelector implements java.security.cert.CRLSelector {
- ctor public X509CRLSelector();
- method public void addIssuer(javax.security.auth.x500.X500Principal);
- method public void addIssuerName(String) throws java.io.IOException;
- method public void addIssuerName(byte[]) throws java.io.IOException;
- method public Object clone();
- method public java.security.cert.X509Certificate getCertificateChecking();
- method public java.util.Date getDateAndTime();
- method public java.util.Collection<java.lang.Object> getIssuerNames();
- method public java.util.Collection<javax.security.auth.x500.X500Principal> getIssuers();
- method public java.math.BigInteger getMaxCRL();
- method public java.math.BigInteger getMinCRL();
- method public boolean match(java.security.cert.CRL);
- method public void setCertificateChecking(java.security.cert.X509Certificate);
- method public void setDateAndTime(java.util.Date);
- method public void setIssuerNames(java.util.Collection<?>) throws java.io.IOException;
- method public void setIssuers(java.util.Collection<javax.security.auth.x500.X500Principal>);
- method public void setMaxCRLNumber(java.math.BigInteger);
- method public void setMinCRLNumber(java.math.BigInteger);
- }
-
- public class X509CertSelector implements java.security.cert.CertSelector {
- ctor public X509CertSelector();
- method public void addPathToName(int, String) throws java.io.IOException;
- method public void addPathToName(int, byte[]) throws java.io.IOException;
- method public void addSubjectAlternativeName(int, String) throws java.io.IOException;
- method public void addSubjectAlternativeName(int, byte[]) throws java.io.IOException;
- method public Object clone();
- method public byte[] getAuthorityKeyIdentifier();
- method public int getBasicConstraints();
- method public java.security.cert.X509Certificate getCertificate();
- method public java.util.Date getCertificateValid();
- method public java.util.Set<java.lang.String> getExtendedKeyUsage();
- method public javax.security.auth.x500.X500Principal getIssuer();
- method public byte[] getIssuerAsBytes() throws java.io.IOException;
- method public String getIssuerAsString();
- method public boolean[] getKeyUsage();
- method public boolean getMatchAllSubjectAltNames();
- method public byte[] getNameConstraints();
- method public java.util.Collection<java.util.List<?>> getPathToNames();
- method public java.util.Set<java.lang.String> getPolicy();
- method public java.util.Date getPrivateKeyValid();
- method public java.math.BigInteger getSerialNumber();
- method public javax.security.auth.x500.X500Principal getSubject();
- method public java.util.Collection<java.util.List<?>> getSubjectAlternativeNames();
- method public byte[] getSubjectAsBytes() throws java.io.IOException;
- method public String getSubjectAsString();
- method public byte[] getSubjectKeyIdentifier();
- method public java.security.PublicKey getSubjectPublicKey();
- method public String getSubjectPublicKeyAlgID();
- method public boolean match(java.security.cert.Certificate);
- method public void setAuthorityKeyIdentifier(byte[]);
- method public void setBasicConstraints(int);
- method public void setCertificate(java.security.cert.X509Certificate);
- method public void setCertificateValid(java.util.Date);
- method public void setExtendedKeyUsage(java.util.Set<java.lang.String>) throws java.io.IOException;
- method public void setIssuer(javax.security.auth.x500.X500Principal);
- method public void setIssuer(String) throws java.io.IOException;
- method public void setIssuer(byte[]) throws java.io.IOException;
- method public void setKeyUsage(boolean[]);
- method public void setMatchAllSubjectAltNames(boolean);
- method public void setNameConstraints(byte[]) throws java.io.IOException;
- method public void setPathToNames(java.util.Collection<java.util.List<?>>) throws java.io.IOException;
- method public void setPolicy(java.util.Set<java.lang.String>) throws java.io.IOException;
- method public void setPrivateKeyValid(java.util.Date);
- method public void setSerialNumber(java.math.BigInteger);
- method public void setSubject(javax.security.auth.x500.X500Principal);
- method public void setSubject(String) throws java.io.IOException;
- method public void setSubject(byte[]) throws java.io.IOException;
- method public void setSubjectAlternativeNames(java.util.Collection<java.util.List<?>>) throws java.io.IOException;
- method public void setSubjectKeyIdentifier(byte[]);
- method public void setSubjectPublicKey(java.security.PublicKey);
- method public void setSubjectPublicKey(byte[]) throws java.io.IOException;
- method public void setSubjectPublicKeyAlgID(String) throws java.io.IOException;
- }
-
- public abstract class X509Certificate extends java.security.cert.Certificate implements java.security.cert.X509Extension {
- ctor protected X509Certificate();
- method public abstract void checkValidity() throws java.security.cert.CertificateExpiredException, java.security.cert.CertificateNotYetValidException;
- method public abstract void checkValidity(java.util.Date) throws java.security.cert.CertificateExpiredException, java.security.cert.CertificateNotYetValidException;
- method public abstract int getBasicConstraints();
- method public java.util.List<java.lang.String> getExtendedKeyUsage() throws java.security.cert.CertificateParsingException;
- method public java.util.Collection<java.util.List<?>> getIssuerAlternativeNames() throws java.security.cert.CertificateParsingException;
- method public abstract java.security.Principal getIssuerDN();
- method public abstract boolean[] getIssuerUniqueID();
- method public javax.security.auth.x500.X500Principal getIssuerX500Principal();
- method public abstract boolean[] getKeyUsage();
- method public abstract java.util.Date getNotAfter();
- method public abstract java.util.Date getNotBefore();
- method public abstract java.math.BigInteger getSerialNumber();
- method public abstract String getSigAlgName();
- method public abstract String getSigAlgOID();
- method public abstract byte[] getSigAlgParams();
- method public abstract byte[] getSignature();
- method public java.util.Collection<java.util.List<?>> getSubjectAlternativeNames() throws java.security.cert.CertificateParsingException;
- method public abstract java.security.Principal getSubjectDN();
- method public abstract boolean[] getSubjectUniqueID();
- method public javax.security.auth.x500.X500Principal getSubjectX500Principal();
- method public abstract byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException;
- method public abstract int getVersion();
- }
-
- public interface X509Extension {
- method public java.util.Set<java.lang.String> getCriticalExtensionOIDs();
- method public byte[] getExtensionValue(String);
- method public java.util.Set<java.lang.String> getNonCriticalExtensionOIDs();
- method public boolean hasUnsupportedCriticalExtension();
- }
-
-}
-
-package java.security.interfaces {
-
- public interface DSAKey {
- method public java.security.interfaces.DSAParams getParams();
- }
-
- public interface DSAKeyPairGenerator {
- method public void initialize(java.security.interfaces.DSAParams, java.security.SecureRandom) throws java.security.InvalidParameterException;
- method public void initialize(int, boolean, java.security.SecureRandom) throws java.security.InvalidParameterException;
- }
-
- public interface DSAParams {
- method public java.math.BigInteger getG();
- method public java.math.BigInteger getP();
- method public java.math.BigInteger getQ();
- }
-
- public interface DSAPrivateKey extends java.security.interfaces.DSAKey java.security.PrivateKey {
- method public java.math.BigInteger getX();
- field public static final long serialVersionUID = 7776497482533790279L; // 0x6bebab423b256247L
- }
-
- public interface DSAPublicKey extends java.security.interfaces.DSAKey java.security.PublicKey {
- method public java.math.BigInteger getY();
- field public static final long serialVersionUID = 1234526332779022332L; // 0x1121eb28ab28c7fcL
- }
-
- public interface ECKey {
- method public java.security.spec.ECParameterSpec getParams();
- }
-
- public interface ECPrivateKey extends java.security.PrivateKey java.security.interfaces.ECKey {
- method public java.math.BigInteger getS();
- field public static final long serialVersionUID = -7896394956925609184L; // 0x926a5e9fa2435b20L
- }
-
- public interface ECPublicKey extends java.security.PublicKey java.security.interfaces.ECKey {
- method public java.security.spec.ECPoint getW();
- field public static final long serialVersionUID = -3314988629879632826L; // 0xd1fecb679990cc46L
- }
-
- public interface RSAKey {
- method public java.math.BigInteger getModulus();
- }
-
- public interface RSAMultiPrimePrivateCrtKey extends java.security.interfaces.RSAPrivateKey {
- method public java.math.BigInteger getCrtCoefficient();
- method public java.security.spec.RSAOtherPrimeInfo[] getOtherPrimeInfo();
- method public java.math.BigInteger getPrimeExponentP();
- method public java.math.BigInteger getPrimeExponentQ();
- method public java.math.BigInteger getPrimeP();
- method public java.math.BigInteger getPrimeQ();
- method public java.math.BigInteger getPublicExponent();
- field public static final long serialVersionUID = 618058533534628008L; // 0x893c8f62dbaf8a8L
- }
-
- public interface RSAPrivateCrtKey extends java.security.interfaces.RSAPrivateKey {
- method public java.math.BigInteger getCrtCoefficient();
- method public java.math.BigInteger getPrimeExponentP();
- method public java.math.BigInteger getPrimeExponentQ();
- method public java.math.BigInteger getPrimeP();
- method public java.math.BigInteger getPrimeQ();
- method public java.math.BigInteger getPublicExponent();
- field public static final long serialVersionUID = -5682214253527700368L; // 0xb124b83df8d1ec70L
- }
-
- public interface RSAPrivateKey extends java.security.PrivateKey java.security.interfaces.RSAKey {
- method public java.math.BigInteger getPrivateExponent();
- field public static final long serialVersionUID = 5187144804936595022L; // 0x47fc70b7a8c2364eL
- }
-
- public interface RSAPublicKey extends java.security.PublicKey java.security.interfaces.RSAKey {
- method public java.math.BigInteger getPublicExponent();
- field public static final long serialVersionUID = -8727434096241101194L; // 0x86e1ecedeceab676L
- }
-
-}
-
-package java.security.spec {
-
- public interface AlgorithmParameterSpec {
- }
-
- public class DSAParameterSpec implements java.security.spec.AlgorithmParameterSpec java.security.interfaces.DSAParams {
- ctor public DSAParameterSpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
- method public java.math.BigInteger getG();
- method public java.math.BigInteger getP();
- method public java.math.BigInteger getQ();
- }
-
- public class DSAPrivateKeySpec implements java.security.spec.KeySpec {
- ctor public DSAPrivateKeySpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
- method public java.math.BigInteger getG();
- method public java.math.BigInteger getP();
- method public java.math.BigInteger getQ();
- method public java.math.BigInteger getX();
- }
-
- public class DSAPublicKeySpec implements java.security.spec.KeySpec {
- ctor public DSAPublicKeySpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
- method public java.math.BigInteger getG();
- method public java.math.BigInteger getP();
- method public java.math.BigInteger getQ();
- method public java.math.BigInteger getY();
- }
-
- public interface ECField {
- method public int getFieldSize();
- }
-
- public class ECFieldF2m implements java.security.spec.ECField {
- ctor public ECFieldF2m(int);
- ctor public ECFieldF2m(int, java.math.BigInteger);
- ctor public ECFieldF2m(int, int[]);
- method public int getFieldSize();
- method public int getM();
- method public int[] getMidTermsOfReductionPolynomial();
- method public java.math.BigInteger getReductionPolynomial();
- }
-
- public class ECFieldFp implements java.security.spec.ECField {
- ctor public ECFieldFp(java.math.BigInteger);
- method public int getFieldSize();
- method public java.math.BigInteger getP();
- }
-
- public class ECGenParameterSpec implements java.security.spec.AlgorithmParameterSpec {
- ctor public ECGenParameterSpec(String);
- method public String getName();
- }
-
- public class ECParameterSpec implements java.security.spec.AlgorithmParameterSpec {
- ctor public ECParameterSpec(java.security.spec.EllipticCurve, java.security.spec.ECPoint, java.math.BigInteger, int);
- method public int getCofactor();
- method public java.security.spec.EllipticCurve getCurve();
- method public java.security.spec.ECPoint getGenerator();
- method public java.math.BigInteger getOrder();
- }
-
- public class ECPoint {
- ctor public ECPoint(java.math.BigInteger, java.math.BigInteger);
- method public java.math.BigInteger getAffineX();
- method public java.math.BigInteger getAffineY();
- field public static final java.security.spec.ECPoint POINT_INFINITY;
- }
-
- public class ECPrivateKeySpec implements java.security.spec.KeySpec {
- ctor public ECPrivateKeySpec(java.math.BigInteger, java.security.spec.ECParameterSpec);
- method public java.security.spec.ECParameterSpec getParams();
- method public java.math.BigInteger getS();
- }
-
- public class ECPublicKeySpec implements java.security.spec.KeySpec {
- ctor public ECPublicKeySpec(java.security.spec.ECPoint, java.security.spec.ECParameterSpec);
- method public java.security.spec.ECParameterSpec getParams();
- method public java.security.spec.ECPoint getW();
- }
-
- public class EllipticCurve {
- ctor public EllipticCurve(java.security.spec.ECField, java.math.BigInteger, java.math.BigInteger);
- ctor public EllipticCurve(java.security.spec.ECField, java.math.BigInteger, java.math.BigInteger, byte[]);
- method public java.math.BigInteger getA();
- method public java.math.BigInteger getB();
- method public java.security.spec.ECField getField();
- method public byte[] getSeed();
- }
-
- public abstract class EncodedKeySpec implements java.security.spec.KeySpec {
- ctor public EncodedKeySpec(byte[]);
- method public byte[] getEncoded();
- method public abstract String getFormat();
- }
-
- public class InvalidKeySpecException extends java.security.GeneralSecurityException {
- ctor public InvalidKeySpecException();
- ctor public InvalidKeySpecException(String);
- ctor public InvalidKeySpecException(String, Throwable);
- ctor public InvalidKeySpecException(Throwable);
- }
-
- public class InvalidParameterSpecException extends java.security.GeneralSecurityException {
- ctor public InvalidParameterSpecException();
- ctor public InvalidParameterSpecException(String);
- }
-
- public interface KeySpec {
- }
-
- public class MGF1ParameterSpec implements java.security.spec.AlgorithmParameterSpec {
- ctor public MGF1ParameterSpec(String);
- method public String getDigestAlgorithm();
- field public static final java.security.spec.MGF1ParameterSpec SHA1;
- field public static final java.security.spec.MGF1ParameterSpec SHA224;
- field public static final java.security.spec.MGF1ParameterSpec SHA256;
- field public static final java.security.spec.MGF1ParameterSpec SHA384;
- field public static final java.security.spec.MGF1ParameterSpec SHA512;
- }
-
- public class PKCS8EncodedKeySpec extends java.security.spec.EncodedKeySpec {
- ctor public PKCS8EncodedKeySpec(byte[]);
- method public final String getFormat();
- }
-
- public class PSSParameterSpec implements java.security.spec.AlgorithmParameterSpec {
- ctor public PSSParameterSpec(String, String, java.security.spec.AlgorithmParameterSpec, int, int);
- ctor public PSSParameterSpec(int);
- method public String getDigestAlgorithm();
- method public String getMGFAlgorithm();
- method public java.security.spec.AlgorithmParameterSpec getMGFParameters();
- method public int getSaltLength();
- method public int getTrailerField();
- field public static final java.security.spec.PSSParameterSpec DEFAULT;
- }
-
- public class RSAKeyGenParameterSpec implements java.security.spec.AlgorithmParameterSpec {
- ctor public RSAKeyGenParameterSpec(int, java.math.BigInteger);
- method public int getKeysize();
- method public java.math.BigInteger getPublicExponent();
- field public static final java.math.BigInteger F0;
- field public static final java.math.BigInteger F4;
- }
-
- public class RSAMultiPrimePrivateCrtKeySpec extends java.security.spec.RSAPrivateKeySpec {
- ctor public RSAMultiPrimePrivateCrtKeySpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.security.spec.RSAOtherPrimeInfo[]);
- method public java.math.BigInteger getCrtCoefficient();
- method public java.security.spec.RSAOtherPrimeInfo[] getOtherPrimeInfo();
- method public java.math.BigInteger getPrimeExponentP();
- method public java.math.BigInteger getPrimeExponentQ();
- method public java.math.BigInteger getPrimeP();
- method public java.math.BigInteger getPrimeQ();
- method public java.math.BigInteger getPublicExponent();
- }
-
- public class RSAOtherPrimeInfo {
- ctor public RSAOtherPrimeInfo(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
- method public final java.math.BigInteger getCrtCoefficient();
- method public final java.math.BigInteger getExponent();
- method public final java.math.BigInteger getPrime();
- }
-
- public class RSAPrivateCrtKeySpec extends java.security.spec.RSAPrivateKeySpec {
- ctor public RSAPrivateCrtKeySpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
- method public java.math.BigInteger getCrtCoefficient();
- method public java.math.BigInteger getPrimeExponentP();
- method public java.math.BigInteger getPrimeExponentQ();
- method public java.math.BigInteger getPrimeP();
- method public java.math.BigInteger getPrimeQ();
- method public java.math.BigInteger getPublicExponent();
- }
-
- public class RSAPrivateKeySpec implements java.security.spec.KeySpec {
- ctor public RSAPrivateKeySpec(java.math.BigInteger, java.math.BigInteger);
- method public java.math.BigInteger getModulus();
- method public java.math.BigInteger getPrivateExponent();
- }
-
- public class RSAPublicKeySpec implements java.security.spec.KeySpec {
- ctor public RSAPublicKeySpec(java.math.BigInteger, java.math.BigInteger);
- method public java.math.BigInteger getModulus();
- method public java.math.BigInteger getPublicExponent();
- }
-
- public class X509EncodedKeySpec extends java.security.spec.EncodedKeySpec {
- ctor public X509EncodedKeySpec(byte[]);
- method public final String getFormat();
- }
-
-}
-
-package java.sql {
-
- public interface Array {
- method public void free() throws java.sql.SQLException;
- method public Object getArray() throws java.sql.SQLException;
- method public Object getArray(java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
- method public Object getArray(long, int) throws java.sql.SQLException;
- method public Object getArray(long, int, java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
- method public int getBaseType() throws java.sql.SQLException;
- method public String getBaseTypeName() throws java.sql.SQLException;
- method public java.sql.ResultSet getResultSet() throws java.sql.SQLException;
- method public java.sql.ResultSet getResultSet(java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
- method public java.sql.ResultSet getResultSet(long, int) throws java.sql.SQLException;
- method public java.sql.ResultSet getResultSet(long, int, java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
- }
-
- public class BatchUpdateException extends java.sql.SQLException {
- ctor public BatchUpdateException(String, String, int, int[]);
- ctor public BatchUpdateException(String, String, int[]);
- ctor public BatchUpdateException(String, int[]);
- ctor public BatchUpdateException(int[]);
- ctor public BatchUpdateException();
- ctor public BatchUpdateException(Throwable);
- ctor public BatchUpdateException(int[], Throwable);
- ctor public BatchUpdateException(String, int[], Throwable);
- ctor public BatchUpdateException(String, String, int[], Throwable);
- ctor public BatchUpdateException(String, String, int, int[], Throwable);
- method public int[] getUpdateCounts();
- }
-
- public interface Blob {
- method public void free() throws java.sql.SQLException;
- method public java.io.InputStream getBinaryStream() throws java.sql.SQLException;
- method public java.io.InputStream getBinaryStream(long, long) throws java.sql.SQLException;
- method public byte[] getBytes(long, int) throws java.sql.SQLException;
- method public long length() throws java.sql.SQLException;
- method public long position(byte[], long) throws java.sql.SQLException;
- method public long position(java.sql.Blob, long) throws java.sql.SQLException;
- method public java.io.OutputStream setBinaryStream(long) throws java.sql.SQLException;
- method public int setBytes(long, byte[]) throws java.sql.SQLException;
- method public int setBytes(long, byte[], int, int) throws java.sql.SQLException;
- method public void truncate(long) throws java.sql.SQLException;
- }
-
- public interface CallableStatement extends java.sql.PreparedStatement {
- method public java.sql.Array getArray(int) throws java.sql.SQLException;
- method public java.sql.Array getArray(String) throws java.sql.SQLException;
- method @Deprecated public java.math.BigDecimal getBigDecimal(int, int) throws java.sql.SQLException;
- method public java.math.BigDecimal getBigDecimal(int) throws java.sql.SQLException;
- method public java.math.BigDecimal getBigDecimal(String) throws java.sql.SQLException;
- method public java.sql.Blob getBlob(int) throws java.sql.SQLException;
- method public java.sql.Blob getBlob(String) throws java.sql.SQLException;
- method public boolean getBoolean(int) throws java.sql.SQLException;
- method public boolean getBoolean(String) throws java.sql.SQLException;
- method public byte getByte(int) throws java.sql.SQLException;
- method public byte getByte(String) throws java.sql.SQLException;
- method public byte[] getBytes(int) throws java.sql.SQLException;
- method public byte[] getBytes(String) throws java.sql.SQLException;
- method public java.io.Reader getCharacterStream(int) throws java.sql.SQLException;
- method public java.io.Reader getCharacterStream(String) throws java.sql.SQLException;
- method public java.sql.Clob getClob(int) throws java.sql.SQLException;
- method public java.sql.Clob getClob(String) throws java.sql.SQLException;
- method public java.sql.Date getDate(int) throws java.sql.SQLException;
- method public java.sql.Date getDate(int, java.util.Calendar) throws java.sql.SQLException;
- method public java.sql.Date getDate(String) throws java.sql.SQLException;
- method public java.sql.Date getDate(String, java.util.Calendar) throws java.sql.SQLException;
- method public double getDouble(int) throws java.sql.SQLException;
- method public double getDouble(String) throws java.sql.SQLException;
- method public float getFloat(int) throws java.sql.SQLException;
- method public float getFloat(String) throws java.sql.SQLException;
- method public int getInt(int) throws java.sql.SQLException;
- method public int getInt(String) throws java.sql.SQLException;
- method public long getLong(int) throws java.sql.SQLException;
- method public long getLong(String) throws java.sql.SQLException;
- method public java.io.Reader getNCharacterStream(int) throws java.sql.SQLException;
- method public java.io.Reader getNCharacterStream(String) throws java.sql.SQLException;
- method public java.sql.NClob getNClob(int) throws java.sql.SQLException;
- method public java.sql.NClob getNClob(String) throws java.sql.SQLException;
- method public String getNString(int) throws java.sql.SQLException;
- method public String getNString(String) throws java.sql.SQLException;
- method public Object getObject(int) throws java.sql.SQLException;
- method public Object getObject(int, java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
- method public Object getObject(String) throws java.sql.SQLException;
- method public Object getObject(String, java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
- method public java.sql.Ref getRef(int) throws java.sql.SQLException;
- method public java.sql.Ref getRef(String) throws java.sql.SQLException;
- method public java.sql.RowId getRowId(int) throws java.sql.SQLException;
- method public java.sql.RowId getRowId(String) throws java.sql.SQLException;
- method public java.sql.SQLXML getSQLXML(int) throws java.sql.SQLException;
- method public java.sql.SQLXML getSQLXML(String) throws java.sql.SQLException;
- method public short getShort(int) throws java.sql.SQLException;
- method public short getShort(String) throws java.sql.SQLException;
- method public String getString(int) throws java.sql.SQLException;
- method public String getString(String) throws java.sql.SQLException;
- method public java.sql.Time getTime(int) throws java.sql.SQLException;
- method public java.sql.Time getTime(int, java.util.Calendar) throws java.sql.SQLException;
- method public java.sql.Time getTime(String) throws java.sql.SQLException;
- method public java.sql.Time getTime(String, java.util.Calendar) throws java.sql.SQLException;
- method public java.sql.Timestamp getTimestamp(int) throws java.sql.SQLException;
- method public java.sql.Timestamp getTimestamp(int, java.util.Calendar) throws java.sql.SQLException;
- method public java.sql.Timestamp getTimestamp(String) throws java.sql.SQLException;
- method public java.sql.Timestamp getTimestamp(String, java.util.Calendar) throws java.sql.SQLException;
- method public java.net.URL getURL(int) throws java.sql.SQLException;
- method public java.net.URL getURL(String) throws java.sql.SQLException;
- method public void registerOutParameter(int, int) throws java.sql.SQLException;
- method public void registerOutParameter(int, int, int) throws java.sql.SQLException;
- method public void registerOutParameter(int, int, String) throws java.sql.SQLException;
- method public void registerOutParameter(String, int) throws java.sql.SQLException;
- method public void registerOutParameter(String, int, int) throws java.sql.SQLException;
- method public void registerOutParameter(String, int, String) throws java.sql.SQLException;
- method public void setAsciiStream(String, java.io.InputStream, int) throws java.sql.SQLException;
- method public void setAsciiStream(String, java.io.InputStream, long) throws java.sql.SQLException;
- method public void setAsciiStream(String, java.io.InputStream) throws java.sql.SQLException;
- method public void setBigDecimal(String, java.math.BigDecimal) throws java.sql.SQLException;
- method public void setBinaryStream(String, java.io.InputStream, int) throws java.sql.SQLException;
- method public void setBinaryStream(String, java.io.InputStream, long) throws java.sql.SQLException;
- method public void setBinaryStream(String, java.io.InputStream) throws java.sql.SQLException;
- method public void setBlob(String, java.io.InputStream, long) throws java.sql.SQLException;
- method public void setBlob(String, java.sql.Blob) throws java.sql.SQLException;
- method public void setBlob(String, java.io.InputStream) throws java.sql.SQLException;
- method public void setBoolean(String, boolean) throws java.sql.SQLException;
- method public void setByte(String, byte) throws java.sql.SQLException;
- method public void setBytes(String, byte[]) throws java.sql.SQLException;
- method public void setCharacterStream(String, java.io.Reader, int) throws java.sql.SQLException;
- method public void setCharacterStream(String, java.io.Reader, long) throws java.sql.SQLException;
- method public void setCharacterStream(String, java.io.Reader) throws java.sql.SQLException;
- method public void setClob(String, java.io.Reader, long) throws java.sql.SQLException;
- method public void setClob(String, java.sql.Clob) throws java.sql.SQLException;
- method public void setClob(String, java.io.Reader) throws java.sql.SQLException;
- method public void setDate(String, java.sql.Date) throws java.sql.SQLException;
- method public void setDate(String, java.sql.Date, java.util.Calendar) throws java.sql.SQLException;
- method public void setDouble(String, double) throws java.sql.SQLException;
- method public void setFloat(String, float) throws java.sql.SQLException;
- method public void setInt(String, int) throws java.sql.SQLException;
- method public void setLong(String, long) throws java.sql.SQLException;
- method public void setNCharacterStream(String, java.io.Reader, long) throws java.sql.SQLException;
- method public void setNCharacterStream(String, java.io.Reader) throws java.sql.SQLException;
- method public void setNClob(String, java.sql.NClob) throws java.sql.SQLException;
- method public void setNClob(String, java.io.Reader, long) throws java.sql.SQLException;
- method public void setNClob(String, java.io.Reader) throws java.sql.SQLException;
- method public void setNString(String, String) throws java.sql.SQLException;
- method public void setNull(String, int) throws java.sql.SQLException;
- method public void setNull(String, int, String) throws java.sql.SQLException;
- method public void setObject(String, Object, int, int) throws java.sql.SQLException;
- method public void setObject(String, Object, int) throws java.sql.SQLException;
- method public void setObject(String, Object) throws java.sql.SQLException;
- method public void setRowId(String, java.sql.RowId) throws java.sql.SQLException;
- method public void setSQLXML(String, java.sql.SQLXML) throws java.sql.SQLException;
- method public void setShort(String, short) throws java.sql.SQLException;
- method public void setString(String, String) throws java.sql.SQLException;
- method public void setTime(String, java.sql.Time) throws java.sql.SQLException;
- method public void setTime(String, java.sql.Time, java.util.Calendar) throws java.sql.SQLException;
- method public void setTimestamp(String, java.sql.Timestamp) throws java.sql.SQLException;
- method public void setTimestamp(String, java.sql.Timestamp, java.util.Calendar) throws java.sql.SQLException;
- method public void setURL(String, java.net.URL) throws java.sql.SQLException;
- method public boolean wasNull() throws java.sql.SQLException;
- }
-
- public enum ClientInfoStatus {
- enum_constant public static final java.sql.ClientInfoStatus REASON_UNKNOWN;
- enum_constant public static final java.sql.ClientInfoStatus REASON_UNKNOWN_PROPERTY;
- enum_constant public static final java.sql.ClientInfoStatus REASON_VALUE_INVALID;
- enum_constant public static final java.sql.ClientInfoStatus REASON_VALUE_TRUNCATED;
- }
-
- public interface Clob {
- method public void free() throws java.sql.SQLException;
- method public java.io.InputStream getAsciiStream() throws java.sql.SQLException;
- method public java.io.Reader getCharacterStream() throws java.sql.SQLException;
- method public java.io.Reader getCharacterStream(long, long) throws java.sql.SQLException;
- method public String getSubString(long, int) throws java.sql.SQLException;
- method public long length() throws java.sql.SQLException;
- method public long position(String, long) throws java.sql.SQLException;
- method public long position(java.sql.Clob, long) throws java.sql.SQLException;
- method public java.io.OutputStream setAsciiStream(long) throws java.sql.SQLException;
- method public java.io.Writer setCharacterStream(long) throws java.sql.SQLException;
- method public int setString(long, String) throws java.sql.SQLException;
- method public int setString(long, String, int, int) throws java.sql.SQLException;
- method public void truncate(long) throws java.sql.SQLException;
- }
-
- public interface Connection extends java.sql.Wrapper java.lang.AutoCloseable {
- method public void clearWarnings() throws java.sql.SQLException;
- method public void close() throws java.sql.SQLException;
- method public void commit() throws java.sql.SQLException;
- method public java.sql.Array createArrayOf(String, Object[]) throws java.sql.SQLException;
- method public java.sql.Blob createBlob() throws java.sql.SQLException;
- method public java.sql.Clob createClob() throws java.sql.SQLException;
- method public java.sql.NClob createNClob() throws java.sql.SQLException;
- method public java.sql.SQLXML createSQLXML() throws java.sql.SQLException;
- method public java.sql.Statement createStatement() throws java.sql.SQLException;
- method public java.sql.Statement createStatement(int, int) throws java.sql.SQLException;
- method public java.sql.Statement createStatement(int, int, int) throws java.sql.SQLException;
- method public java.sql.Struct createStruct(String, Object[]) throws java.sql.SQLException;
- method public boolean getAutoCommit() throws java.sql.SQLException;
- method public String getCatalog() throws java.sql.SQLException;
- method public String getClientInfo(String) throws java.sql.SQLException;
- method public java.util.Properties getClientInfo() throws java.sql.SQLException;
- method public int getHoldability() throws java.sql.SQLException;
- method public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException;
- method public int getTransactionIsolation() throws java.sql.SQLException;
- method public java.util.Map<java.lang.String,java.lang.Class<?>> getTypeMap() throws java.sql.SQLException;
- method public java.sql.SQLWarning getWarnings() throws java.sql.SQLException;
- method public boolean isClosed() throws java.sql.SQLException;
- method public boolean isReadOnly() throws java.sql.SQLException;
- method public boolean isValid(int) throws java.sql.SQLException;
- method public String nativeSQL(String) throws java.sql.SQLException;
- method public java.sql.CallableStatement prepareCall(String) throws java.sql.SQLException;
- method public java.sql.CallableStatement prepareCall(String, int, int) throws java.sql.SQLException;
- method public java.sql.CallableStatement prepareCall(String, int, int, int) throws java.sql.SQLException;
- method public java.sql.PreparedStatement prepareStatement(String) throws java.sql.SQLException;
- method public java.sql.PreparedStatement prepareStatement(String, int, int) throws java.sql.SQLException;
- method public java.sql.PreparedStatement prepareStatement(String, int, int, int) throws java.sql.SQLException;
- method public java.sql.PreparedStatement prepareStatement(String, int) throws java.sql.SQLException;
- method public java.sql.PreparedStatement prepareStatement(String, int[]) throws java.sql.SQLException;
- method public java.sql.PreparedStatement prepareStatement(String, String[]) throws java.sql.SQLException;
- method public void releaseSavepoint(java.sql.Savepoint) throws java.sql.SQLException;
- method public void rollback() throws java.sql.SQLException;
- method public void rollback(java.sql.Savepoint) throws java.sql.SQLException;
- method public void setAutoCommit(boolean) throws java.sql.SQLException;
- method public void setCatalog(String) throws java.sql.SQLException;
- method public void setClientInfo(String, String) throws java.sql.SQLClientInfoException;
- method public void setClientInfo(java.util.Properties) throws java.sql.SQLClientInfoException;
- method public void setHoldability(int) throws java.sql.SQLException;
- method public void setReadOnly(boolean) throws java.sql.SQLException;
- method public java.sql.Savepoint setSavepoint() throws java.sql.SQLException;
- method public java.sql.Savepoint setSavepoint(String) throws java.sql.SQLException;
- method public void setTransactionIsolation(int) throws java.sql.SQLException;
- method public void setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
- field public static final int TRANSACTION_NONE = 0; // 0x0
- field public static final int TRANSACTION_READ_COMMITTED = 2; // 0x2
- field public static final int TRANSACTION_READ_UNCOMMITTED = 1; // 0x1
- field public static final int TRANSACTION_REPEATABLE_READ = 4; // 0x4
- field public static final int TRANSACTION_SERIALIZABLE = 8; // 0x8
- }
-
- public class DataTruncation extends java.sql.SQLWarning {
- ctor public DataTruncation(int, boolean, boolean, int, int);
- ctor public DataTruncation(int, boolean, boolean, int, int, Throwable);
- method public int getDataSize();
- method public int getIndex();
- method public boolean getParameter();
- method public boolean getRead();
- method public int getTransferSize();
- }
-
- public interface DatabaseMetaData extends java.sql.Wrapper {
- method public boolean allProceduresAreCallable() throws java.sql.SQLException;
- method public boolean allTablesAreSelectable() throws java.sql.SQLException;
- method public boolean autoCommitFailureClosesAllResultSets() throws java.sql.SQLException;
- method public boolean dataDefinitionCausesTransactionCommit() throws java.sql.SQLException;
- method public boolean dataDefinitionIgnoredInTransactions() throws java.sql.SQLException;
- method public boolean deletesAreDetected(int) throws java.sql.SQLException;
- method public boolean doesMaxRowSizeIncludeBlobs() throws java.sql.SQLException;
- method public java.sql.ResultSet getAttributes(String, String, String, String) throws java.sql.SQLException;
- method public java.sql.ResultSet getBestRowIdentifier(String, String, String, int, boolean) throws java.sql.SQLException;
- method public String getCatalogSeparator() throws java.sql.SQLException;
- method public String getCatalogTerm() throws java.sql.SQLException;
- method public java.sql.ResultSet getCatalogs() throws java.sql.SQLException;
- method public java.sql.ResultSet getClientInfoProperties() throws java.sql.SQLException;
- method public java.sql.ResultSet getColumnPrivileges(String, String, String, String) throws java.sql.SQLException;
- method public java.sql.ResultSet getColumns(String, String, String, String) throws java.sql.SQLException;
- method public java.sql.Connection getConnection() throws java.sql.SQLException;
- method public java.sql.ResultSet getCrossReference(String, String, String, String, String, String) throws java.sql.SQLException;
- method public int getDatabaseMajorVersion() throws java.sql.SQLException;
- method public int getDatabaseMinorVersion() throws java.sql.SQLException;
- method public String getDatabaseProductName() throws java.sql.SQLException;
- method public String getDatabaseProductVersion() throws java.sql.SQLException;
- method public int getDefaultTransactionIsolation() throws java.sql.SQLException;
- method public int getDriverMajorVersion();
- method public int getDriverMinorVersion();
- method public String getDriverName() throws java.sql.SQLException;
- method public String getDriverVersion() throws java.sql.SQLException;
- method public java.sql.ResultSet getExportedKeys(String, String, String) throws java.sql.SQLException;
- method public String getExtraNameCharacters() throws java.sql.SQLException;
- method public java.sql.ResultSet getFunctionColumns(String, String, String, String) throws java.sql.SQLException;
- method public java.sql.ResultSet getFunctions(String, String, String) throws java.sql.SQLException;
- method public String getIdentifierQuoteString() throws java.sql.SQLException;
- method public java.sql.ResultSet getImportedKeys(String, String, String) throws java.sql.SQLException;
- method public java.sql.ResultSet getIndexInfo(String, String, String, boolean, boolean) throws java.sql.SQLException;
- method public int getJDBCMajorVersion() throws java.sql.SQLException;
- method public int getJDBCMinorVersion() throws java.sql.SQLException;
- method public int getMaxBinaryLiteralLength() throws java.sql.SQLException;
- method public int getMaxCatalogNameLength() throws java.sql.SQLException;
- method public int getMaxCharLiteralLength() throws java.sql.SQLException;
- method public int getMaxColumnNameLength() throws java.sql.SQLException;
- method public int getMaxColumnsInGroupBy() throws java.sql.SQLException;
- method public int getMaxColumnsInIndex() throws java.sql.SQLException;
- method public int getMaxColumnsInOrderBy() throws java.sql.SQLException;
- method public int getMaxColumnsInSelect() throws java.sql.SQLException;
- method public int getMaxColumnsInTable() throws java.sql.SQLException;
- method public int getMaxConnections() throws java.sql.SQLException;
- method public int getMaxCursorNameLength() throws java.sql.SQLException;
- method public int getMaxIndexLength() throws java.sql.SQLException;
- method public int getMaxProcedureNameLength() throws java.sql.SQLException;
- method public int getMaxRowSize() throws java.sql.SQLException;
- method public int getMaxSchemaNameLength() throws java.sql.SQLException;
- method public int getMaxStatementLength() throws java.sql.SQLException;
- method public int getMaxStatements() throws java.sql.SQLException;
- method public int getMaxTableNameLength() throws java.sql.SQLException;
- method public int getMaxTablesInSelect() throws java.sql.SQLException;
- method public int getMaxUserNameLength() throws java.sql.SQLException;
- method public String getNumericFunctions() throws java.sql.SQLException;
- method public java.sql.ResultSet getPrimaryKeys(String, String, String) throws java.sql.SQLException;
- method public java.sql.ResultSet getProcedureColumns(String, String, String, String) throws java.sql.SQLException;
- method public String getProcedureTerm() throws java.sql.SQLException;
- method public java.sql.ResultSet getProcedures(String, String, String) throws java.sql.SQLException;
- method public int getResultSetHoldability() throws java.sql.SQLException;
- method public java.sql.RowIdLifetime getRowIdLifetime() throws java.sql.SQLException;
- method public String getSQLKeywords() throws java.sql.SQLException;
- method public int getSQLStateType() throws java.sql.SQLException;
- method public String getSchemaTerm() throws java.sql.SQLException;
- method public java.sql.ResultSet getSchemas() throws java.sql.SQLException;
- method public java.sql.ResultSet getSchemas(String, String) throws java.sql.SQLException;
- method public String getSearchStringEscape() throws java.sql.SQLException;
- method public String getStringFunctions() throws java.sql.SQLException;
- method public java.sql.ResultSet getSuperTables(String, String, String) throws java.sql.SQLException;
- method public java.sql.ResultSet getSuperTypes(String, String, String) throws java.sql.SQLException;
- method public String getSystemFunctions() throws java.sql.SQLException;
- method public java.sql.ResultSet getTablePrivileges(String, String, String) throws java.sql.SQLException;
- method public java.sql.ResultSet getTableTypes() throws java.sql.SQLException;
- method public java.sql.ResultSet getTables(String, String, String, String[]) throws java.sql.SQLException;
- method public String getTimeDateFunctions() throws java.sql.SQLException;
- method public java.sql.ResultSet getTypeInfo() throws java.sql.SQLException;
- method public java.sql.ResultSet getUDTs(String, String, String, int[]) throws java.sql.SQLException;
- method public String getURL() throws java.sql.SQLException;
- method public String getUserName() throws java.sql.SQLException;
- method public java.sql.ResultSet getVersionColumns(String, String, String) throws java.sql.SQLException;
- method public boolean insertsAreDetected(int) throws java.sql.SQLException;
- method public boolean isCatalogAtStart() throws java.sql.SQLException;
- method public boolean isReadOnly() throws java.sql.SQLException;
- method public boolean locatorsUpdateCopy() throws java.sql.SQLException;
- method public boolean nullPlusNonNullIsNull() throws java.sql.SQLException;
- method public boolean nullsAreSortedAtEnd() throws java.sql.SQLException;
- method public boolean nullsAreSortedAtStart() throws java.sql.SQLException;
- method public boolean nullsAreSortedHigh() throws java.sql.SQLException;
- method public boolean nullsAreSortedLow() throws java.sql.SQLException;
- method public boolean othersDeletesAreVisible(int) throws java.sql.SQLException;
- method public boolean othersInsertsAreVisible(int) throws java.sql.SQLException;
- method public boolean othersUpdatesAreVisible(int) throws java.sql.SQLException;
- method public boolean ownDeletesAreVisible(int) throws java.sql.SQLException;
- method public boolean ownInsertsAreVisible(int) throws java.sql.SQLException;
- method public boolean ownUpdatesAreVisible(int) throws java.sql.SQLException;
- method public boolean storesLowerCaseIdentifiers() throws java.sql.SQLException;
- method public boolean storesLowerCaseQuotedIdentifiers() throws java.sql.SQLException;
- method public boolean storesMixedCaseIdentifiers() throws java.sql.SQLException;
- method public boolean storesMixedCaseQuotedIdentifiers() throws java.sql.SQLException;
- method public boolean storesUpperCaseIdentifiers() throws java.sql.SQLException;
- method public boolean storesUpperCaseQuotedIdentifiers() throws java.sql.SQLException;
- method public boolean supportsANSI92EntryLevelSQL() throws java.sql.SQLException;
- method public boolean supportsANSI92FullSQL() throws java.sql.SQLException;
- method public boolean supportsANSI92IntermediateSQL() throws java.sql.SQLException;
- method public boolean supportsAlterTableWithAddColumn() throws java.sql.SQLException;
- method public boolean supportsAlterTableWithDropColumn() throws java.sql.SQLException;
- method public boolean supportsBatchUpdates() throws java.sql.SQLException;
- method public boolean supportsCatalogsInDataManipulation() throws java.sql.SQLException;
- method public boolean supportsCatalogsInIndexDefinitions() throws java.sql.SQLException;
- method public boolean supportsCatalogsInPrivilegeDefinitions() throws java.sql.SQLException;
- method public boolean supportsCatalogsInProcedureCalls() throws java.sql.SQLException;
- method public boolean supportsCatalogsInTableDefinitions() throws java.sql.SQLException;
- method public boolean supportsColumnAliasing() throws java.sql.SQLException;
- method public boolean supportsConvert() throws java.sql.SQLException;
- method public boolean supportsConvert(int, int) throws java.sql.SQLException;
- method public boolean supportsCoreSQLGrammar() throws java.sql.SQLException;
- method public boolean supportsCorrelatedSubqueries() throws java.sql.SQLException;
- method public boolean supportsDataDefinitionAndDataManipulationTransactions() throws java.sql.SQLException;
- method public boolean supportsDataManipulationTransactionsOnly() throws java.sql.SQLException;
- method public boolean supportsDifferentTableCorrelationNames() throws java.sql.SQLException;
- method public boolean supportsExpressionsInOrderBy() throws java.sql.SQLException;
- method public boolean supportsExtendedSQLGrammar() throws java.sql.SQLException;
- method public boolean supportsFullOuterJoins() throws java.sql.SQLException;
- method public boolean supportsGetGeneratedKeys() throws java.sql.SQLException;
- method public boolean supportsGroupBy() throws java.sql.SQLException;
- method public boolean supportsGroupByBeyondSelect() throws java.sql.SQLException;
- method public boolean supportsGroupByUnrelated() throws java.sql.SQLException;
- method public boolean supportsIntegrityEnhancementFacility() throws java.sql.SQLException;
- method public boolean supportsLikeEscapeClause() throws java.sql.SQLException;
- method public boolean supportsLimitedOuterJoins() throws java.sql.SQLException;
- method public boolean supportsMinimumSQLGrammar() throws java.sql.SQLException;
- method public boolean supportsMixedCaseIdentifiers() throws java.sql.SQLException;
- method public boolean supportsMixedCaseQuotedIdentifiers() throws java.sql.SQLException;
- method public boolean supportsMultipleOpenResults() throws java.sql.SQLException;
- method public boolean supportsMultipleResultSets() throws java.sql.SQLException;
- method public boolean supportsMultipleTransactions() throws java.sql.SQLException;
- method public boolean supportsNamedParameters() throws java.sql.SQLException;
- method public boolean supportsNonNullableColumns() throws java.sql.SQLException;
- method public boolean supportsOpenCursorsAcrossCommit() throws java.sql.SQLException;
- method public boolean supportsOpenCursorsAcrossRollback() throws java.sql.SQLException;
- method public boolean supportsOpenStatementsAcrossCommit() throws java.sql.SQLException;
- method public boolean supportsOpenStatementsAcrossRollback() throws java.sql.SQLException;
- method public boolean supportsOrderByUnrelated() throws java.sql.SQLException;
- method public boolean supportsOuterJoins() throws java.sql.SQLException;
- method public boolean supportsPositionedDelete() throws java.sql.SQLException;
- method public boolean supportsPositionedUpdate() throws java.sql.SQLException;
- method public boolean supportsResultSetConcurrency(int, int) throws java.sql.SQLException;
- method public boolean supportsResultSetHoldability(int) throws java.sql.SQLException;
- method public boolean supportsResultSetType(int) throws java.sql.SQLException;
- method public boolean supportsSavepoints() throws java.sql.SQLException;
- method public boolean supportsSchemasInDataManipulation() throws java.sql.SQLException;
- method public boolean supportsSchemasInIndexDefinitions() throws java.sql.SQLException;
- method public boolean supportsSchemasInPrivilegeDefinitions() throws java.sql.SQLException;
- method public boolean supportsSchemasInProcedureCalls() throws java.sql.SQLException;
- method public boolean supportsSchemasInTableDefinitions() throws java.sql.SQLException;
- method public boolean supportsSelectForUpdate() throws java.sql.SQLException;
- method public boolean supportsStatementPooling() throws java.sql.SQLException;
- method public boolean supportsStoredFunctionsUsingCallSyntax() throws java.sql.SQLException;
- method public boolean supportsStoredProcedures() throws java.sql.SQLException;
- method public boolean supportsSubqueriesInComparisons() throws java.sql.SQLException;
- method public boolean supportsSubqueriesInExists() throws java.sql.SQLException;
- method public boolean supportsSubqueriesInIns() throws java.sql.SQLException;
- method public boolean supportsSubqueriesInQuantifieds() throws java.sql.SQLException;
- method public boolean supportsTableCorrelationNames() throws java.sql.SQLException;
- method public boolean supportsTransactionIsolationLevel(int) throws java.sql.SQLException;
- method public boolean supportsTransactions() throws java.sql.SQLException;
- method public boolean supportsUnion() throws java.sql.SQLException;
- method public boolean supportsUnionAll() throws java.sql.SQLException;
- method public boolean updatesAreDetected(int) throws java.sql.SQLException;
- method public boolean usesLocalFilePerTable() throws java.sql.SQLException;
- method public boolean usesLocalFiles() throws java.sql.SQLException;
- field public static final short attributeNoNulls = 0; // 0x0
- field public static final short attributeNullable = 1; // 0x1
- field public static final short attributeNullableUnknown = 2; // 0x2
- field public static final int bestRowNotPseudo = 1; // 0x1
- field public static final int bestRowPseudo = 2; // 0x2
- field public static final int bestRowSession = 2; // 0x2
- field public static final int bestRowTemporary = 0; // 0x0
- field public static final int bestRowTransaction = 1; // 0x1
- field public static final int bestRowUnknown = 0; // 0x0
- field public static final int columnNoNulls = 0; // 0x0
- field public static final int columnNullable = 1; // 0x1
- field public static final int columnNullableUnknown = 2; // 0x2
- field public static final int functionColumnIn = 1; // 0x1
- field public static final int functionColumnInOut = 2; // 0x2
- field public static final int functionColumnOut = 3; // 0x3
- field public static final int functionColumnResult = 5; // 0x5
- field public static final int functionColumnUnknown = 0; // 0x0
- field public static final int functionNoNulls = 0; // 0x0
- field public static final int functionNoTable = 1; // 0x1
- field public static final int functionNullable = 1; // 0x1
- field public static final int functionNullableUnknown = 2; // 0x2
- field public static final int functionResultUnknown = 0; // 0x0
- field public static final int functionReturn = 4; // 0x4
- field public static final int functionReturnsTable = 2; // 0x2
- field public static final int importedKeyCascade = 0; // 0x0
- field public static final int importedKeyInitiallyDeferred = 5; // 0x5
- field public static final int importedKeyInitiallyImmediate = 6; // 0x6
- field public static final int importedKeyNoAction = 3; // 0x3
- field public static final int importedKeyNotDeferrable = 7; // 0x7
- field public static final int importedKeyRestrict = 1; // 0x1
- field public static final int importedKeySetDefault = 4; // 0x4
- field public static final int importedKeySetNull = 2; // 0x2
- field public static final int procedureColumnIn = 1; // 0x1
- field public static final int procedureColumnInOut = 2; // 0x2
- field public static final int procedureColumnOut = 4; // 0x4
- field public static final int procedureColumnResult = 3; // 0x3
- field public static final int procedureColumnReturn = 5; // 0x5
- field public static final int procedureColumnUnknown = 0; // 0x0
- field public static final int procedureNoNulls = 0; // 0x0
- field public static final int procedureNoResult = 1; // 0x1
- field public static final int procedureNullable = 1; // 0x1
- field public static final int procedureNullableUnknown = 2; // 0x2
- field public static final int procedureResultUnknown = 0; // 0x0
- field public static final int procedureReturnsResult = 2; // 0x2
- field public static final int sqlStateSQL = 2; // 0x2
- field public static final int sqlStateSQL99 = 2; // 0x2
- field public static final int sqlStateXOpen = 1; // 0x1
- field public static final short tableIndexClustered = 1; // 0x1
- field public static final short tableIndexHashed = 2; // 0x2
- field public static final short tableIndexOther = 3; // 0x3
- field public static final short tableIndexStatistic = 0; // 0x0
- field public static final int typeNoNulls = 0; // 0x0
- field public static final int typeNullable = 1; // 0x1
- field public static final int typeNullableUnknown = 2; // 0x2
- field public static final int typePredBasic = 2; // 0x2
- field public static final int typePredChar = 1; // 0x1
- field public static final int typePredNone = 0; // 0x0
- field public static final int typeSearchable = 3; // 0x3
- field public static final int versionColumnNotPseudo = 1; // 0x1
- field public static final int versionColumnPseudo = 2; // 0x2
- field public static final int versionColumnUnknown = 0; // 0x0
- }
-
- public class Date extends java.util.Date {
- ctor @Deprecated public Date(int, int, int);
- ctor public Date(long);
- method public static java.sql.Date valueOf(String);
- }
-
- public interface Driver {
- method public boolean acceptsURL(String) throws java.sql.SQLException;
- method public java.sql.Connection connect(String, java.util.Properties) throws java.sql.SQLException;
- method public int getMajorVersion();
- method public int getMinorVersion();
- method public java.sql.DriverPropertyInfo[] getPropertyInfo(String, java.util.Properties) throws java.sql.SQLException;
- method public boolean jdbcCompliant();
- }
-
- public class DriverManager {
- method public static void deregisterDriver(java.sql.Driver) throws java.sql.SQLException;
- method public static java.sql.Connection getConnection(String, java.util.Properties) throws java.sql.SQLException;
- method public static java.sql.Connection getConnection(String, String, String) throws java.sql.SQLException;
- method public static java.sql.Connection getConnection(String) throws java.sql.SQLException;
- method public static java.sql.Driver getDriver(String) throws java.sql.SQLException;
- method public static java.util.Enumeration<java.sql.Driver> getDrivers();
- method @Deprecated public static java.io.PrintStream getLogStream();
- method public static java.io.PrintWriter getLogWriter();
- method public static int getLoginTimeout();
- method public static void println(String);
- method public static void registerDriver(java.sql.Driver) throws java.sql.SQLException;
- method @Deprecated public static void setLogStream(java.io.PrintStream);
- method public static void setLogWriter(java.io.PrintWriter);
- method public static void setLoginTimeout(int);
- }
-
- public class DriverPropertyInfo {
- ctor public DriverPropertyInfo(String, String);
- field public String[] choices;
- field public String description;
- field public String name;
- field public boolean required;
- field public String value;
- }
-
- public interface NClob extends java.sql.Clob {
- }
-
- public interface ParameterMetaData extends java.sql.Wrapper {
- method public String getParameterClassName(int) throws java.sql.SQLException;
- method public int getParameterCount() throws java.sql.SQLException;
- method public int getParameterMode(int) throws java.sql.SQLException;
- method public int getParameterType(int) throws java.sql.SQLException;
- method public String getParameterTypeName(int) throws java.sql.SQLException;
- method public int getPrecision(int) throws java.sql.SQLException;
- method public int getScale(int) throws java.sql.SQLException;
- method public int isNullable(int) throws java.sql.SQLException;
- method public boolean isSigned(int) throws java.sql.SQLException;
- field public static final int parameterModeIn = 1; // 0x1
- field public static final int parameterModeInOut = 2; // 0x2
- field public static final int parameterModeOut = 4; // 0x4
- field public static final int parameterModeUnknown = 0; // 0x0
- field public static final int parameterNoNulls = 0; // 0x0
- field public static final int parameterNullable = 1; // 0x1
- field public static final int parameterNullableUnknown = 2; // 0x2
- }
-
- public interface PreparedStatement extends java.sql.Statement {
- method public void addBatch() throws java.sql.SQLException;
- method public void clearParameters() throws java.sql.SQLException;
- method public boolean execute() throws java.sql.SQLException;
- method public java.sql.ResultSet executeQuery() throws java.sql.SQLException;
- method public int executeUpdate() throws java.sql.SQLException;
- method public java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException;
- method public java.sql.ParameterMetaData getParameterMetaData() throws java.sql.SQLException;
- method public void setArray(int, java.sql.Array) throws java.sql.SQLException;
- method public void setAsciiStream(int, java.io.InputStream, int) throws java.sql.SQLException;
- method public void setAsciiStream(int, java.io.InputStream, long) throws java.sql.SQLException;
- method public void setAsciiStream(int, java.io.InputStream) throws java.sql.SQLException;
- method public void setBigDecimal(int, java.math.BigDecimal) throws java.sql.SQLException;
- method public void setBinaryStream(int, java.io.InputStream, int) throws java.sql.SQLException;
- method public void setBinaryStream(int, java.io.InputStream, long) throws java.sql.SQLException;
- method public void setBinaryStream(int, java.io.InputStream) throws java.sql.SQLException;
- method public void setBlob(int, java.sql.Blob) throws java.sql.SQLException;
- method public void setBlob(int, java.io.InputStream, long) throws java.sql.SQLException;
- method public void setBlob(int, java.io.InputStream) throws java.sql.SQLException;
- method public void setBoolean(int, boolean) throws java.sql.SQLException;
- method public void setByte(int, byte) throws java.sql.SQLException;
- method public void setBytes(int, byte[]) throws java.sql.SQLException;
- method public void setCharacterStream(int, java.io.Reader, int) throws java.sql.SQLException;
- method public void setCharacterStream(int, java.io.Reader, long) throws java.sql.SQLException;
- method public void setCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
- method public void setClob(int, java.sql.Clob) throws java.sql.SQLException;
- method public void setClob(int, java.io.Reader, long) throws java.sql.SQLException;
- method public void setClob(int, java.io.Reader) throws java.sql.SQLException;
- method public void setDate(int, java.sql.Date) throws java.sql.SQLException;
- method public void setDate(int, java.sql.Date, java.util.Calendar) throws java.sql.SQLException;
- method public void setDouble(int, double) throws java.sql.SQLException;
- method public void setFloat(int, float) throws java.sql.SQLException;
- method public void setInt(int, int) throws java.sql.SQLException;
- method public void setLong(int, long) throws java.sql.SQLException;
- method public void setNCharacterStream(int, java.io.Reader, long) throws java.sql.SQLException;
- method public void setNCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
- method public void setNClob(int, java.sql.NClob) throws java.sql.SQLException;
- method public void setNClob(int, java.io.Reader, long) throws java.sql.SQLException;
- method public void setNClob(int, java.io.Reader) throws java.sql.SQLException;
- method public void setNString(int, String) throws java.sql.SQLException;
- method public void setNull(int, int) throws java.sql.SQLException;
- method public void setNull(int, int, String) throws java.sql.SQLException;
- method public void setObject(int, Object, int) throws java.sql.SQLException;
- method public void setObject(int, Object) throws java.sql.SQLException;
- method public void setObject(int, Object, int, int) throws java.sql.SQLException;
- method public void setRef(int, java.sql.Ref) throws java.sql.SQLException;
- method public void setRowId(int, java.sql.RowId) throws java.sql.SQLException;
- method public void setSQLXML(int, java.sql.SQLXML) throws java.sql.SQLException;
- method public void setShort(int, short) throws java.sql.SQLException;
- method public void setString(int, String) throws java.sql.SQLException;
- method public void setTime(int, java.sql.Time) throws java.sql.SQLException;
- method public void setTime(int, java.sql.Time, java.util.Calendar) throws java.sql.SQLException;
- method public void setTimestamp(int, java.sql.Timestamp) throws java.sql.SQLException;
- method public void setTimestamp(int, java.sql.Timestamp, java.util.Calendar) throws java.sql.SQLException;
- method public void setURL(int, java.net.URL) throws java.sql.SQLException;
- method @Deprecated public void setUnicodeStream(int, java.io.InputStream, int) throws java.sql.SQLException;
- }
-
- public interface Ref {
- method public String getBaseTypeName() throws java.sql.SQLException;
- method public Object getObject(java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
- method public Object getObject() throws java.sql.SQLException;
- method public void setObject(Object) throws java.sql.SQLException;
- }
-
- public interface ResultSet extends java.sql.Wrapper java.lang.AutoCloseable {
- method public boolean absolute(int) throws java.sql.SQLException;
- method public void afterLast() throws java.sql.SQLException;
- method public void beforeFirst() throws java.sql.SQLException;
- method public void cancelRowUpdates() throws java.sql.SQLException;
- method public void clearWarnings() throws java.sql.SQLException;
- method public void close() throws java.sql.SQLException;
- method public void deleteRow() throws java.sql.SQLException;
- method public int findColumn(String) throws java.sql.SQLException;
- method public boolean first() throws java.sql.SQLException;
- method public java.sql.Array getArray(int) throws java.sql.SQLException;
- method public java.sql.Array getArray(String) throws java.sql.SQLException;
- method public java.io.InputStream getAsciiStream(int) throws java.sql.SQLException;
- method public java.io.InputStream getAsciiStream(String) throws java.sql.SQLException;
- method @Deprecated public java.math.BigDecimal getBigDecimal(int, int) throws java.sql.SQLException;
- method @Deprecated public java.math.BigDecimal getBigDecimal(String, int) throws java.sql.SQLException;
- method public java.math.BigDecimal getBigDecimal(int) throws java.sql.SQLException;
- method public java.math.BigDecimal getBigDecimal(String) throws java.sql.SQLException;
- method public java.io.InputStream getBinaryStream(int) throws java.sql.SQLException;
- method public java.io.InputStream getBinaryStream(String) throws java.sql.SQLException;
- method public java.sql.Blob getBlob(int) throws java.sql.SQLException;
- method public java.sql.Blob getBlob(String) throws java.sql.SQLException;
- method public boolean getBoolean(int) throws java.sql.SQLException;
- method public boolean getBoolean(String) throws java.sql.SQLException;
- method public byte getByte(int) throws java.sql.SQLException;
- method public byte getByte(String) throws java.sql.SQLException;
- method public byte[] getBytes(int) throws java.sql.SQLException;
- method public byte[] getBytes(String) throws java.sql.SQLException;
- method public java.io.Reader getCharacterStream(int) throws java.sql.SQLException;
- method public java.io.Reader getCharacterStream(String) throws java.sql.SQLException;
- method public java.sql.Clob getClob(int) throws java.sql.SQLException;
- method public java.sql.Clob getClob(String) throws java.sql.SQLException;
- method public int getConcurrency() throws java.sql.SQLException;
- method public String getCursorName() throws java.sql.SQLException;
- method public java.sql.Date getDate(int) throws java.sql.SQLException;
- method public java.sql.Date getDate(String) throws java.sql.SQLException;
- method public java.sql.Date getDate(int, java.util.Calendar) throws java.sql.SQLException;
- method public java.sql.Date getDate(String, java.util.Calendar) throws java.sql.SQLException;
- method public double getDouble(int) throws java.sql.SQLException;
- method public double getDouble(String) throws java.sql.SQLException;
- method public int getFetchDirection() throws java.sql.SQLException;
- method public int getFetchSize() throws java.sql.SQLException;
- method public float getFloat(int) throws java.sql.SQLException;
- method public float getFloat(String) throws java.sql.SQLException;
- method public int getHoldability() throws java.sql.SQLException;
- method public int getInt(int) throws java.sql.SQLException;
- method public int getInt(String) throws java.sql.SQLException;
- method public long getLong(int) throws java.sql.SQLException;
- method public long getLong(String) throws java.sql.SQLException;
- method public java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException;
- method public java.io.Reader getNCharacterStream(int) throws java.sql.SQLException;
- method public java.io.Reader getNCharacterStream(String) throws java.sql.SQLException;
- method public java.sql.NClob getNClob(int) throws java.sql.SQLException;
- method public java.sql.NClob getNClob(String) throws java.sql.SQLException;
- method public String getNString(int) throws java.sql.SQLException;
- method public String getNString(String) throws java.sql.SQLException;
- method public Object getObject(int) throws java.sql.SQLException;
- method public Object getObject(String) throws java.sql.SQLException;
- method public Object getObject(int, java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
- method public Object getObject(String, java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
- method public java.sql.Ref getRef(int) throws java.sql.SQLException;
- method public java.sql.Ref getRef(String) throws java.sql.SQLException;
- method public int getRow() throws java.sql.SQLException;
- method public java.sql.RowId getRowId(int) throws java.sql.SQLException;
- method public java.sql.RowId getRowId(String) throws java.sql.SQLException;
- method public java.sql.SQLXML getSQLXML(int) throws java.sql.SQLException;
- method public java.sql.SQLXML getSQLXML(String) throws java.sql.SQLException;
- method public short getShort(int) throws java.sql.SQLException;
- method public short getShort(String) throws java.sql.SQLException;
- method public java.sql.Statement getStatement() throws java.sql.SQLException;
- method public String getString(int) throws java.sql.SQLException;
- method public String getString(String) throws java.sql.SQLException;
- method public java.sql.Time getTime(int) throws java.sql.SQLException;
- method public java.sql.Time getTime(String) throws java.sql.SQLException;
- method public java.sql.Time getTime(int, java.util.Calendar) throws java.sql.SQLException;
- method public java.sql.Time getTime(String, java.util.Calendar) throws java.sql.SQLException;
- method public java.sql.Timestamp getTimestamp(int) throws java.sql.SQLException;
- method public java.sql.Timestamp getTimestamp(String) throws java.sql.SQLException;
- method public java.sql.Timestamp getTimestamp(int, java.util.Calendar) throws java.sql.SQLException;
- method public java.sql.Timestamp getTimestamp(String, java.util.Calendar) throws java.sql.SQLException;
- method public int getType() throws java.sql.SQLException;
- method public java.net.URL getURL(int) throws java.sql.SQLException;
- method public java.net.URL getURL(String) throws java.sql.SQLException;
- method @Deprecated public java.io.InputStream getUnicodeStream(int) throws java.sql.SQLException;
- method @Deprecated public java.io.InputStream getUnicodeStream(String) throws java.sql.SQLException;
- method public java.sql.SQLWarning getWarnings() throws java.sql.SQLException;
- method public void insertRow() throws java.sql.SQLException;
- method public boolean isAfterLast() throws java.sql.SQLException;
- method public boolean isBeforeFirst() throws java.sql.SQLException;
- method public boolean isClosed() throws java.sql.SQLException;
- method public boolean isFirst() throws java.sql.SQLException;
- method public boolean isLast() throws java.sql.SQLException;
- method public boolean last() throws java.sql.SQLException;
- method public void moveToCurrentRow() throws java.sql.SQLException;
- method public void moveToInsertRow() throws java.sql.SQLException;
- method public boolean next() throws java.sql.SQLException;
- method public boolean previous() throws java.sql.SQLException;
- method public void refreshRow() throws java.sql.SQLException;
- method public boolean relative(int) throws java.sql.SQLException;
- method public boolean rowDeleted() throws java.sql.SQLException;
- method public boolean rowInserted() throws java.sql.SQLException;
- method public boolean rowUpdated() throws java.sql.SQLException;
- method public void setFetchDirection(int) throws java.sql.SQLException;
- method public void setFetchSize(int) throws java.sql.SQLException;
- method public void updateArray(int, java.sql.Array) throws java.sql.SQLException;
- method public void updateArray(String, java.sql.Array) throws java.sql.SQLException;
- method public void updateAsciiStream(int, java.io.InputStream, int) throws java.sql.SQLException;
- method public void updateAsciiStream(String, java.io.InputStream, int) throws java.sql.SQLException;
- method public void updateAsciiStream(int, java.io.InputStream, long) throws java.sql.SQLException;
- method public void updateAsciiStream(String, java.io.InputStream, long) throws java.sql.SQLException;
- method public void updateAsciiStream(int, java.io.InputStream) throws java.sql.SQLException;
- method public void updateAsciiStream(String, java.io.InputStream) throws java.sql.SQLException;
- method public void updateBigDecimal(int, java.math.BigDecimal) throws java.sql.SQLException;
- method public void updateBigDecimal(String, java.math.BigDecimal) throws java.sql.SQLException;
- method public void updateBinaryStream(int, java.io.InputStream, int) throws java.sql.SQLException;
- method public void updateBinaryStream(String, java.io.InputStream, int) throws java.sql.SQLException;
- method public void updateBinaryStream(int, java.io.InputStream, long) throws java.sql.SQLException;
- method public void updateBinaryStream(String, java.io.InputStream, long) throws java.sql.SQLException;
- method public void updateBinaryStream(int, java.io.InputStream) throws java.sql.SQLException;
- method public void updateBinaryStream(String, java.io.InputStream) throws java.sql.SQLException;
- method public void updateBlob(int, java.sql.Blob) throws java.sql.SQLException;
- method public void updateBlob(String, java.sql.Blob) throws java.sql.SQLException;
- method public void updateBlob(int, java.io.InputStream, long) throws java.sql.SQLException;
- method public void updateBlob(String, java.io.InputStream, long) throws java.sql.SQLException;
- method public void updateBlob(int, java.io.InputStream) throws java.sql.SQLException;
- method public void updateBlob(String, java.io.InputStream) throws java.sql.SQLException;
- method public void updateBoolean(int, boolean) throws java.sql.SQLException;
- method public void updateBoolean(String, boolean) throws java.sql.SQLException;
- method public void updateByte(int, byte) throws java.sql.SQLException;
- method public void updateByte(String, byte) throws java.sql.SQLException;
- method public void updateBytes(int, byte[]) throws java.sql.SQLException;
- method public void updateBytes(String, byte[]) throws java.sql.SQLException;
- method public void updateCharacterStream(int, java.io.Reader, int) throws java.sql.SQLException;
- method public void updateCharacterStream(String, java.io.Reader, int) throws java.sql.SQLException;
- method public void updateCharacterStream(int, java.io.Reader, long) throws java.sql.SQLException;
- method public void updateCharacterStream(String, java.io.Reader, long) throws java.sql.SQLException;
- method public void updateCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
- method public void updateCharacterStream(String, java.io.Reader) throws java.sql.SQLException;
- method public void updateClob(int, java.sql.Clob) throws java.sql.SQLException;
- method public void updateClob(String, java.sql.Clob) throws java.sql.SQLException;
- method public void updateClob(int, java.io.Reader, long) throws java.sql.SQLException;
- method public void updateClob(String, java.io.Reader, long) throws java.sql.SQLException;
- method public void updateClob(int, java.io.Reader) throws java.sql.SQLException;
- method public void updateClob(String, java.io.Reader) throws java.sql.SQLException;
- method public void updateDate(int, java.sql.Date) throws java.sql.SQLException;
- method public void updateDate(String, java.sql.Date) throws java.sql.SQLException;
- method public void updateDouble(int, double) throws java.sql.SQLException;
- method public void updateDouble(String, double) throws java.sql.SQLException;
- method public void updateFloat(int, float) throws java.sql.SQLException;
- method public void updateFloat(String, float) throws java.sql.SQLException;
- method public void updateInt(int, int) throws java.sql.SQLException;
- method public void updateInt(String, int) throws java.sql.SQLException;
- method public void updateLong(int, long) throws java.sql.SQLException;
- method public void updateLong(String, long) throws java.sql.SQLException;
- method public void updateNCharacterStream(int, java.io.Reader, long) throws java.sql.SQLException;
- method public void updateNCharacterStream(String, java.io.Reader, long) throws java.sql.SQLException;
- method public void updateNCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
- method public void updateNCharacterStream(String, java.io.Reader) throws java.sql.SQLException;
- method public void updateNClob(int, java.sql.NClob) throws java.sql.SQLException;
- method public void updateNClob(String, java.sql.NClob) throws java.sql.SQLException;
- method public void updateNClob(int, java.io.Reader, long) throws java.sql.SQLException;
- method public void updateNClob(String, java.io.Reader, long) throws java.sql.SQLException;
- method public void updateNClob(int, java.io.Reader) throws java.sql.SQLException;
- method public void updateNClob(String, java.io.Reader) throws java.sql.SQLException;
- method public void updateNString(int, String) throws java.sql.SQLException;
- method public void updateNString(String, String) throws java.sql.SQLException;
- method public void updateNull(int) throws java.sql.SQLException;
- method public void updateNull(String) throws java.sql.SQLException;
- method public void updateObject(int, Object, int) throws java.sql.SQLException;
- method public void updateObject(int, Object) throws java.sql.SQLException;
- method public void updateObject(String, Object, int) throws java.sql.SQLException;
- method public void updateObject(String, Object) throws java.sql.SQLException;
- method public void updateRef(int, java.sql.Ref) throws java.sql.SQLException;
- method public void updateRef(String, java.sql.Ref) throws java.sql.SQLException;
- method public void updateRow() throws java.sql.SQLException;
- method public void updateRowId(int, java.sql.RowId) throws java.sql.SQLException;
- method public void updateRowId(String, java.sql.RowId) throws java.sql.SQLException;
- method public void updateSQLXML(int, java.sql.SQLXML) throws java.sql.SQLException;
- method public void updateSQLXML(String, java.sql.SQLXML) throws java.sql.SQLException;
- method public void updateShort(int, short) throws java.sql.SQLException;
- method public void updateShort(String, short) throws java.sql.SQLException;
- method public void updateString(int, String) throws java.sql.SQLException;
- method public void updateString(String, String) throws java.sql.SQLException;
- method public void updateTime(int, java.sql.Time) throws java.sql.SQLException;
- method public void updateTime(String, java.sql.Time) throws java.sql.SQLException;
- method public void updateTimestamp(int, java.sql.Timestamp) throws java.sql.SQLException;
- method public void updateTimestamp(String, java.sql.Timestamp) throws java.sql.SQLException;
- method public boolean wasNull() throws java.sql.SQLException;
- field public static final int CLOSE_CURSORS_AT_COMMIT = 2; // 0x2
- field public static final int CONCUR_READ_ONLY = 1007; // 0x3ef
- field public static final int CONCUR_UPDATABLE = 1008; // 0x3f0
- field public static final int FETCH_FORWARD = 1000; // 0x3e8
- field public static final int FETCH_REVERSE = 1001; // 0x3e9
- field public static final int FETCH_UNKNOWN = 1002; // 0x3ea
- field public static final int HOLD_CURSORS_OVER_COMMIT = 1; // 0x1
- field public static final int TYPE_FORWARD_ONLY = 1003; // 0x3eb
- field public static final int TYPE_SCROLL_INSENSITIVE = 1004; // 0x3ec
- field public static final int TYPE_SCROLL_SENSITIVE = 1005; // 0x3ed
- }
-
- public interface ResultSetMetaData extends java.sql.Wrapper {
- method public String getCatalogName(int) throws java.sql.SQLException;
- method public String getColumnClassName(int) throws java.sql.SQLException;
- method public int getColumnCount() throws java.sql.SQLException;
- method public int getColumnDisplaySize(int) throws java.sql.SQLException;
- method public String getColumnLabel(int) throws java.sql.SQLException;
- method public String getColumnName(int) throws java.sql.SQLException;
- method public int getColumnType(int) throws java.sql.SQLException;
- method public String getColumnTypeName(int) throws java.sql.SQLException;
- method public int getPrecision(int) throws java.sql.SQLException;
- method public int getScale(int) throws java.sql.SQLException;
- method public String getSchemaName(int) throws java.sql.SQLException;
- method public String getTableName(int) throws java.sql.SQLException;
- method public boolean isAutoIncrement(int) throws java.sql.SQLException;
- method public boolean isCaseSensitive(int) throws java.sql.SQLException;
- method public boolean isCurrency(int) throws java.sql.SQLException;
- method public boolean isDefinitelyWritable(int) throws java.sql.SQLException;
- method public int isNullable(int) throws java.sql.SQLException;
- method public boolean isReadOnly(int) throws java.sql.SQLException;
- method public boolean isSearchable(int) throws java.sql.SQLException;
- method public boolean isSigned(int) throws java.sql.SQLException;
- method public boolean isWritable(int) throws java.sql.SQLException;
- field public static final int columnNoNulls = 0; // 0x0
- field public static final int columnNullable = 1; // 0x1
- field public static final int columnNullableUnknown = 2; // 0x2
- }
-
- public interface RowId {
- method public boolean equals(Object);
- method public byte[] getBytes();
- method public int hashCode();
- method public String toString();
- }
-
- public enum RowIdLifetime {
- enum_constant public static final java.sql.RowIdLifetime ROWID_UNSUPPORTED;
- enum_constant public static final java.sql.RowIdLifetime ROWID_VALID_FOREVER;
- enum_constant public static final java.sql.RowIdLifetime ROWID_VALID_OTHER;
- enum_constant public static final java.sql.RowIdLifetime ROWID_VALID_SESSION;
- enum_constant public static final java.sql.RowIdLifetime ROWID_VALID_TRANSACTION;
- }
-
- public class SQLClientInfoException extends java.sql.SQLException {
- ctor public SQLClientInfoException();
- ctor public SQLClientInfoException(java.util.Map<java.lang.String,java.sql.ClientInfoStatus>);
- ctor public SQLClientInfoException(java.util.Map<java.lang.String,java.sql.ClientInfoStatus>, Throwable);
- ctor public SQLClientInfoException(String, java.util.Map<java.lang.String,java.sql.ClientInfoStatus>);
- ctor public SQLClientInfoException(String, java.util.Map<java.lang.String,java.sql.ClientInfoStatus>, Throwable);
- ctor public SQLClientInfoException(String, String, java.util.Map<java.lang.String,java.sql.ClientInfoStatus>);
- ctor public SQLClientInfoException(String, String, java.util.Map<java.lang.String,java.sql.ClientInfoStatus>, Throwable);
- ctor public SQLClientInfoException(String, String, int, java.util.Map<java.lang.String,java.sql.ClientInfoStatus>);
- ctor public SQLClientInfoException(String, String, int, java.util.Map<java.lang.String,java.sql.ClientInfoStatus>, Throwable);
- method public java.util.Map<java.lang.String,java.sql.ClientInfoStatus> getFailedProperties();
- }
-
- public interface SQLData {
- method public String getSQLTypeName() throws java.sql.SQLException;
- method public void readSQL(java.sql.SQLInput, String) throws java.sql.SQLException;
- method public void writeSQL(java.sql.SQLOutput) throws java.sql.SQLException;
- }
-
- public class SQLDataException extends java.sql.SQLNonTransientException {
- ctor public SQLDataException();
- ctor public SQLDataException(String);
- ctor public SQLDataException(String, String);
- ctor public SQLDataException(String, String, int);
- ctor public SQLDataException(Throwable);
- ctor public SQLDataException(String, Throwable);
- ctor public SQLDataException(String, String, Throwable);
- ctor public SQLDataException(String, String, int, Throwable);
- }
-
- public class SQLException extends java.lang.Exception implements java.lang.Iterable<java.lang.Throwable> {
- ctor public SQLException(String, String, int);
- ctor public SQLException(String, String);
- ctor public SQLException(String);
- ctor public SQLException();
- ctor public SQLException(Throwable);
- ctor public SQLException(String, Throwable);
- ctor public SQLException(String, String, Throwable);
- ctor public SQLException(String, String, int, Throwable);
- method public int getErrorCode();
- method public java.sql.SQLException getNextException();
- method public String getSQLState();
- method public java.util.Iterator<java.lang.Throwable> iterator();
- method public void setNextException(java.sql.SQLException);
- }
-
- public class SQLFeatureNotSupportedException extends java.sql.SQLNonTransientException {
- ctor public SQLFeatureNotSupportedException();
- ctor public SQLFeatureNotSupportedException(String);
- ctor public SQLFeatureNotSupportedException(String, String);
- ctor public SQLFeatureNotSupportedException(String, String, int);
- ctor public SQLFeatureNotSupportedException(Throwable);
- ctor public SQLFeatureNotSupportedException(String, Throwable);
- ctor public SQLFeatureNotSupportedException(String, String, Throwable);
- ctor public SQLFeatureNotSupportedException(String, String, int, Throwable);
- }
-
- public interface SQLInput {
- method public java.sql.Array readArray() throws java.sql.SQLException;
- method public java.io.InputStream readAsciiStream() throws java.sql.SQLException;
- method public java.math.BigDecimal readBigDecimal() throws java.sql.SQLException;
- method public java.io.InputStream readBinaryStream() throws java.sql.SQLException;
- method public java.sql.Blob readBlob() throws java.sql.SQLException;
- method public boolean readBoolean() throws java.sql.SQLException;
- method public byte readByte() throws java.sql.SQLException;
- method public byte[] readBytes() throws java.sql.SQLException;
- method public java.io.Reader readCharacterStream() throws java.sql.SQLException;
- method public java.sql.Clob readClob() throws java.sql.SQLException;
- method public java.sql.Date readDate() throws java.sql.SQLException;
- method public double readDouble() throws java.sql.SQLException;
- method public float readFloat() throws java.sql.SQLException;
- method public int readInt() throws java.sql.SQLException;
- method public long readLong() throws java.sql.SQLException;
- method public java.sql.NClob readNClob() throws java.sql.SQLException;
- method public String readNString() throws java.sql.SQLException;
- method public Object readObject() throws java.sql.SQLException;
- method public java.sql.Ref readRef() throws java.sql.SQLException;
- method public java.sql.RowId readRowId() throws java.sql.SQLException;
- method public java.sql.SQLXML readSQLXML() throws java.sql.SQLException;
- method public short readShort() throws java.sql.SQLException;
- method public String readString() throws java.sql.SQLException;
- method public java.sql.Time readTime() throws java.sql.SQLException;
- method public java.sql.Timestamp readTimestamp() throws java.sql.SQLException;
- method public java.net.URL readURL() throws java.sql.SQLException;
- method public boolean wasNull() throws java.sql.SQLException;
- }
-
- public class SQLIntegrityConstraintViolationException extends java.sql.SQLNonTransientException {
- ctor public SQLIntegrityConstraintViolationException();
- ctor public SQLIntegrityConstraintViolationException(String);
- ctor public SQLIntegrityConstraintViolationException(String, String);
- ctor public SQLIntegrityConstraintViolationException(String, String, int);
- ctor public SQLIntegrityConstraintViolationException(Throwable);
- ctor public SQLIntegrityConstraintViolationException(String, Throwable);
- ctor public SQLIntegrityConstraintViolationException(String, String, Throwable);
- ctor public SQLIntegrityConstraintViolationException(String, String, int, Throwable);
- }
-
- public class SQLInvalidAuthorizationSpecException extends java.sql.SQLNonTransientException {
- ctor public SQLInvalidAuthorizationSpecException();
- ctor public SQLInvalidAuthorizationSpecException(String);
- ctor public SQLInvalidAuthorizationSpecException(String, String);
- ctor public SQLInvalidAuthorizationSpecException(String, String, int);
- ctor public SQLInvalidAuthorizationSpecException(Throwable);
- ctor public SQLInvalidAuthorizationSpecException(String, Throwable);
- ctor public SQLInvalidAuthorizationSpecException(String, String, Throwable);
- ctor public SQLInvalidAuthorizationSpecException(String, String, int, Throwable);
- }
-
- public class SQLNonTransientConnectionException extends java.sql.SQLNonTransientException {
- ctor public SQLNonTransientConnectionException();
- ctor public SQLNonTransientConnectionException(String);
- ctor public SQLNonTransientConnectionException(String, String);
- ctor public SQLNonTransientConnectionException(String, String, int);
- ctor public SQLNonTransientConnectionException(Throwable);
- ctor public SQLNonTransientConnectionException(String, Throwable);
- ctor public SQLNonTransientConnectionException(String, String, Throwable);
- ctor public SQLNonTransientConnectionException(String, String, int, Throwable);
- }
-
- public class SQLNonTransientException extends java.sql.SQLException {
- ctor public SQLNonTransientException();
- ctor public SQLNonTransientException(String);
- ctor public SQLNonTransientException(String, String);
- ctor public SQLNonTransientException(String, String, int);
- ctor public SQLNonTransientException(Throwable);
- ctor public SQLNonTransientException(String, Throwable);
- ctor public SQLNonTransientException(String, String, Throwable);
- ctor public SQLNonTransientException(String, String, int, Throwable);
- }
-
- public interface SQLOutput {
- method public void writeArray(java.sql.Array) throws java.sql.SQLException;
- method public void writeAsciiStream(java.io.InputStream) throws java.sql.SQLException;
- method public void writeBigDecimal(java.math.BigDecimal) throws java.sql.SQLException;
- method public void writeBinaryStream(java.io.InputStream) throws java.sql.SQLException;
- method public void writeBlob(java.sql.Blob) throws java.sql.SQLException;
- method public void writeBoolean(boolean) throws java.sql.SQLException;
- method public void writeByte(byte) throws java.sql.SQLException;
- method public void writeBytes(byte[]) throws java.sql.SQLException;
- method public void writeCharacterStream(java.io.Reader) throws java.sql.SQLException;
- method public void writeClob(java.sql.Clob) throws java.sql.SQLException;
- method public void writeDate(java.sql.Date) throws java.sql.SQLException;
- method public void writeDouble(double) throws java.sql.SQLException;
- method public void writeFloat(float) throws java.sql.SQLException;
- method public void writeInt(int) throws java.sql.SQLException;
- method public void writeLong(long) throws java.sql.SQLException;
- method public void writeNClob(java.sql.NClob) throws java.sql.SQLException;
- method public void writeNString(String) throws java.sql.SQLException;
- method public void writeObject(java.sql.SQLData) throws java.sql.SQLException;
- method public void writeRef(java.sql.Ref) throws java.sql.SQLException;
- method public void writeRowId(java.sql.RowId) throws java.sql.SQLException;
- method public void writeSQLXML(java.sql.SQLXML) throws java.sql.SQLException;
- method public void writeShort(short) throws java.sql.SQLException;
- method public void writeString(String) throws java.sql.SQLException;
- method public void writeStruct(java.sql.Struct) throws java.sql.SQLException;
- method public void writeTime(java.sql.Time) throws java.sql.SQLException;
- method public void writeTimestamp(java.sql.Timestamp) throws java.sql.SQLException;
- method public void writeURL(java.net.URL) throws java.sql.SQLException;
- }
-
- public final class SQLPermission extends java.security.BasicPermission {
- ctor public SQLPermission(String);
- ctor public SQLPermission(String, String);
- }
-
- public class SQLRecoverableException extends java.sql.SQLException {
- ctor public SQLRecoverableException();
- ctor public SQLRecoverableException(String);
- ctor public SQLRecoverableException(String, String);
- ctor public SQLRecoverableException(String, String, int);
- ctor public SQLRecoverableException(Throwable);
- ctor public SQLRecoverableException(String, Throwable);
- ctor public SQLRecoverableException(String, String, Throwable);
- ctor public SQLRecoverableException(String, String, int, Throwable);
- }
-
- public class SQLSyntaxErrorException extends java.sql.SQLNonTransientException {
- ctor public SQLSyntaxErrorException();
- ctor public SQLSyntaxErrorException(String);
- ctor public SQLSyntaxErrorException(String, String);
- ctor public SQLSyntaxErrorException(String, String, int);
- ctor public SQLSyntaxErrorException(Throwable);
- ctor public SQLSyntaxErrorException(String, Throwable);
- ctor public SQLSyntaxErrorException(String, String, Throwable);
- ctor public SQLSyntaxErrorException(String, String, int, Throwable);
- }
-
- public class SQLTimeoutException extends java.sql.SQLTransientException {
- ctor public SQLTimeoutException();
- ctor public SQLTimeoutException(String);
- ctor public SQLTimeoutException(String, String);
- ctor public SQLTimeoutException(String, String, int);
- ctor public SQLTimeoutException(Throwable);
- ctor public SQLTimeoutException(String, Throwable);
- ctor public SQLTimeoutException(String, String, Throwable);
- ctor public SQLTimeoutException(String, String, int, Throwable);
- }
-
- public class SQLTransactionRollbackException extends java.sql.SQLTransientException {
- ctor public SQLTransactionRollbackException();
- ctor public SQLTransactionRollbackException(String);
- ctor public SQLTransactionRollbackException(String, String);
- ctor public SQLTransactionRollbackException(String, String, int);
- ctor public SQLTransactionRollbackException(Throwable);
- ctor public SQLTransactionRollbackException(String, Throwable);
- ctor public SQLTransactionRollbackException(String, String, Throwable);
- ctor public SQLTransactionRollbackException(String, String, int, Throwable);
- }
-
- public class SQLTransientConnectionException extends java.sql.SQLTransientException {
- ctor public SQLTransientConnectionException();
- ctor public SQLTransientConnectionException(String);
- ctor public SQLTransientConnectionException(String, String);
- ctor public SQLTransientConnectionException(String, String, int);
- ctor public SQLTransientConnectionException(Throwable);
- ctor public SQLTransientConnectionException(String, Throwable);
- ctor public SQLTransientConnectionException(String, String, Throwable);
- ctor public SQLTransientConnectionException(String, String, int, Throwable);
- }
-
- public class SQLTransientException extends java.sql.SQLException {
- ctor public SQLTransientException();
- ctor public SQLTransientException(String);
- ctor public SQLTransientException(String, String);
- ctor public SQLTransientException(String, String, int);
- ctor public SQLTransientException(Throwable);
- ctor public SQLTransientException(String, Throwable);
- ctor public SQLTransientException(String, String, Throwable);
- ctor public SQLTransientException(String, String, int, Throwable);
- }
-
- public class SQLWarning extends java.sql.SQLException {
- ctor public SQLWarning(String, String, int);
- ctor public SQLWarning(String, String);
- ctor public SQLWarning(String);
- ctor public SQLWarning();
- ctor public SQLWarning(Throwable);
- ctor public SQLWarning(String, Throwable);
- ctor public SQLWarning(String, String, Throwable);
- ctor public SQLWarning(String, String, int, Throwable);
- method public java.sql.SQLWarning getNextWarning();
- method public void setNextWarning(java.sql.SQLWarning);
- }
-
- public interface SQLXML {
- method public void free() throws java.sql.SQLException;
- method public java.io.InputStream getBinaryStream() throws java.sql.SQLException;
- method public java.io.Reader getCharacterStream() throws java.sql.SQLException;
- method public <T extends javax.xml.transform.Source> T getSource(Class<T>) throws java.sql.SQLException;
- method public String getString() throws java.sql.SQLException;
- method public java.io.OutputStream setBinaryStream() throws java.sql.SQLException;
- method public java.io.Writer setCharacterStream() throws java.sql.SQLException;
- method public <T extends javax.xml.transform.Result> T setResult(Class<T>) throws java.sql.SQLException;
- method public void setString(String) throws java.sql.SQLException;
- }
-
- public interface Savepoint {
- method public int getSavepointId() throws java.sql.SQLException;
- method public String getSavepointName() throws java.sql.SQLException;
- }
-
- public interface Statement extends java.sql.Wrapper java.lang.AutoCloseable {
- method public void addBatch(String) throws java.sql.SQLException;
- method public void cancel() throws java.sql.SQLException;
- method public void clearBatch() throws java.sql.SQLException;
- method public void clearWarnings() throws java.sql.SQLException;
- method public void close() throws java.sql.SQLException;
- method public boolean execute(String) throws java.sql.SQLException;
- method public boolean execute(String, int) throws java.sql.SQLException;
- method public boolean execute(String, int[]) throws java.sql.SQLException;
- method public boolean execute(String, String[]) throws java.sql.SQLException;
- method public int[] executeBatch() throws java.sql.SQLException;
- method public java.sql.ResultSet executeQuery(String) throws java.sql.SQLException;
- method public int executeUpdate(String) throws java.sql.SQLException;
- method public int executeUpdate(String, int) throws java.sql.SQLException;
- method public int executeUpdate(String, int[]) throws java.sql.SQLException;
- method public int executeUpdate(String, String[]) throws java.sql.SQLException;
- method public java.sql.Connection getConnection() throws java.sql.SQLException;
- method public int getFetchDirection() throws java.sql.SQLException;
- method public int getFetchSize() throws java.sql.SQLException;
- method public java.sql.ResultSet getGeneratedKeys() throws java.sql.SQLException;
- method public int getMaxFieldSize() throws java.sql.SQLException;
- method public int getMaxRows() throws java.sql.SQLException;
- method public boolean getMoreResults() throws java.sql.SQLException;
- method public boolean getMoreResults(int) throws java.sql.SQLException;
- method public int getQueryTimeout() throws java.sql.SQLException;
- method public java.sql.ResultSet getResultSet() throws java.sql.SQLException;
- method public int getResultSetConcurrency() throws java.sql.SQLException;
- method public int getResultSetHoldability() throws java.sql.SQLException;
- method public int getResultSetType() throws java.sql.SQLException;
- method public int getUpdateCount() throws java.sql.SQLException;
- method public java.sql.SQLWarning getWarnings() throws java.sql.SQLException;
- method public boolean isClosed() throws java.sql.SQLException;
- method public boolean isPoolable() throws java.sql.SQLException;
- method public void setCursorName(String) throws java.sql.SQLException;
- method public void setEscapeProcessing(boolean) throws java.sql.SQLException;
- method public void setFetchDirection(int) throws java.sql.SQLException;
- method public void setFetchSize(int) throws java.sql.SQLException;
- method public void setMaxFieldSize(int) throws java.sql.SQLException;
- method public void setMaxRows(int) throws java.sql.SQLException;
- method public void setPoolable(boolean) throws java.sql.SQLException;
- method public void setQueryTimeout(int) throws java.sql.SQLException;
- field public static final int CLOSE_ALL_RESULTS = 3; // 0x3
- field public static final int CLOSE_CURRENT_RESULT = 1; // 0x1
- field public static final int EXECUTE_FAILED = -3; // 0xfffffffd
- field public static final int KEEP_CURRENT_RESULT = 2; // 0x2
- field public static final int NO_GENERATED_KEYS = 2; // 0x2
- field public static final int RETURN_GENERATED_KEYS = 1; // 0x1
- field public static final int SUCCESS_NO_INFO = -2; // 0xfffffffe
- }
-
- public interface Struct {
- method public Object[] getAttributes() throws java.sql.SQLException;
- method public Object[] getAttributes(java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
- method public String getSQLTypeName() throws java.sql.SQLException;
- }
-
- public class Time extends java.util.Date {
- ctor @Deprecated public Time(int, int, int);
- ctor public Time(long);
- method public static java.sql.Time valueOf(String);
- }
-
- public class Timestamp extends java.util.Date {
- ctor @Deprecated public Timestamp(int, int, int, int, int, int, int);
- ctor public Timestamp(long);
- method public boolean after(java.sql.Timestamp);
- method public boolean before(java.sql.Timestamp);
- method public int compareTo(java.sql.Timestamp);
- method public boolean equals(java.sql.Timestamp);
- method public int getNanos();
- method public void setNanos(int);
- method public static java.sql.Timestamp valueOf(String);
- }
-
- public class Types {
- field public static final int ARRAY = 2003; // 0x7d3
- field public static final int BIGINT = -5; // 0xfffffffb
- field public static final int BINARY = -2; // 0xfffffffe
- field public static final int BIT = -7; // 0xfffffff9
- field public static final int BLOB = 2004; // 0x7d4
- field public static final int BOOLEAN = 16; // 0x10
- field public static final int CHAR = 1; // 0x1
- field public static final int CLOB = 2005; // 0x7d5
- field public static final int DATALINK = 70; // 0x46
- field public static final int DATE = 91; // 0x5b
- field public static final int DECIMAL = 3; // 0x3
- field public static final int DISTINCT = 2001; // 0x7d1
- field public static final int DOUBLE = 8; // 0x8
- field public static final int FLOAT = 6; // 0x6
- field public static final int INTEGER = 4; // 0x4
- field public static final int JAVA_OBJECT = 2000; // 0x7d0
- field public static final int LONGNVARCHAR = -16; // 0xfffffff0
- field public static final int LONGVARBINARY = -4; // 0xfffffffc
- field public static final int LONGVARCHAR = -1; // 0xffffffff
- field public static final int NCHAR = -15; // 0xfffffff1
- field public static final int NCLOB = 2011; // 0x7db
- field public static final int NULL = 0; // 0x0
- field public static final int NUMERIC = 2; // 0x2
- field public static final int NVARCHAR = -9; // 0xfffffff7
- field public static final int OTHER = 1111; // 0x457
- field public static final int REAL = 7; // 0x7
- field public static final int REF = 2006; // 0x7d6
- field public static final int ROWID = -8; // 0xfffffff8
- field public static final int SMALLINT = 5; // 0x5
- field public static final int SQLXML = 2009; // 0x7d9
- field public static final int STRUCT = 2002; // 0x7d2
- field public static final int TIME = 92; // 0x5c
- field public static final int TIMESTAMP = 93; // 0x5d
- field public static final int TINYINT = -6; // 0xfffffffa
- field public static final int VARBINARY = -3; // 0xfffffffd
- field public static final int VARCHAR = 12; // 0xc
- }
-
- public interface Wrapper {
- method public boolean isWrapperFor(Class<?>) throws java.sql.SQLException;
- method public <T> T unwrap(Class<T>) throws java.sql.SQLException;
- }
-
-}
-
-package java.text {
-
- public class Annotation {
- ctor public Annotation(Object);
- method public Object getValue();
- }
-
- public interface AttributedCharacterIterator extends java.text.CharacterIterator {
- method public java.util.Set<java.text.AttributedCharacterIterator.Attribute> getAllAttributeKeys();
- method public Object getAttribute(java.text.AttributedCharacterIterator.Attribute);
- method public java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> getAttributes();
- method public int getRunLimit();
- method public int getRunLimit(java.text.AttributedCharacterIterator.Attribute);
- method public int getRunLimit(java.util.Set<? extends java.text.AttributedCharacterIterator.Attribute>);
- method public int getRunStart();
- method public int getRunStart(java.text.AttributedCharacterIterator.Attribute);
- method public int getRunStart(java.util.Set<? extends java.text.AttributedCharacterIterator.Attribute>);
- }
-
- public static class AttributedCharacterIterator.Attribute implements java.io.Serializable {
- ctor protected AttributedCharacterIterator.Attribute(String);
- method public final boolean equals(Object);
- method protected String getName();
- method public final int hashCode();
- method protected Object readResolve() throws java.io.InvalidObjectException;
- field public static final java.text.AttributedCharacterIterator.Attribute INPUT_METHOD_SEGMENT;
- field public static final java.text.AttributedCharacterIterator.Attribute LANGUAGE;
- field public static final java.text.AttributedCharacterIterator.Attribute READING;
- }
-
- public class AttributedString {
- ctor public AttributedString(String);
- ctor public AttributedString(String, java.util.Map<? extends java.text.AttributedCharacterIterator.Attribute,?>);
- ctor public AttributedString(java.text.AttributedCharacterIterator);
- ctor public AttributedString(java.text.AttributedCharacterIterator, int, int);
- ctor public AttributedString(java.text.AttributedCharacterIterator, int, int, java.text.AttributedCharacterIterator.Attribute[]);
- method public void addAttribute(java.text.AttributedCharacterIterator.Attribute, Object);
- method public void addAttribute(java.text.AttributedCharacterIterator.Attribute, Object, int, int);
- method public void addAttributes(java.util.Map<? extends java.text.AttributedCharacterIterator.Attribute,?>, int, int);
- method public java.text.AttributedCharacterIterator getIterator();
- method public java.text.AttributedCharacterIterator getIterator(java.text.AttributedCharacterIterator.Attribute[]);
- method public java.text.AttributedCharacterIterator getIterator(java.text.AttributedCharacterIterator.Attribute[], int, int);
- }
-
- public final class Bidi {
- 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 java.text.Bidi createLineBidi(int, int);
- method public int getBaseLevel();
- method public int getLength();
- method public int getLevelAt(int);
- method public int getRunCount();
- method public int getRunLevel(int);
- method public int getRunLimit(int);
- method public int getRunStart(int);
- method public boolean isLeftToRight();
- method public boolean isMixed();
- method public boolean isRightToLeft();
- method public static void reorderVisually(byte[], int, Object[], int, int);
- method public static boolean requiresBidi(char[], int, int);
- field public static final int DIRECTION_DEFAULT_LEFT_TO_RIGHT = -2; // 0xfffffffe
- field public static final int DIRECTION_DEFAULT_RIGHT_TO_LEFT = -1; // 0xffffffff
- field public static final int DIRECTION_LEFT_TO_RIGHT = 0; // 0x0
- field public static final int DIRECTION_RIGHT_TO_LEFT = 1; // 0x1
- }
-
- 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 java.text.BreakIterator getCharacterInstance();
- method public static java.text.BreakIterator getCharacterInstance(java.util.Locale);
- method public static java.text.BreakIterator getLineInstance();
- method public static java.text.BreakIterator getLineInstance(java.util.Locale);
- method public static java.text.BreakIterator getSentenceInstance();
- method public static java.text.BreakIterator getSentenceInstance(java.util.Locale);
- method public abstract java.text.CharacterIterator getText();
- method public static java.text.BreakIterator getWordInstance();
- method public static java.text.BreakIterator getWordInstance(java.util.Locale);
- 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 abstract void setText(java.text.CharacterIterator);
- field public static final int DONE = -1; // 0xffffffff
- }
-
- public interface CharacterIterator extends java.lang.Cloneable {
- method public Object clone();
- method public char current();
- method public char first();
- method public int getBeginIndex();
- method public int getEndIndex();
- method public int getIndex();
- method public char last();
- method public char next();
- method public char previous();
- method public char setIndex(int);
- field public static final char DONE = 65535; // 0xffff '\uffff'
- }
-
- public class ChoiceFormat extends java.text.NumberFormat {
- ctor public ChoiceFormat(String);
- ctor public ChoiceFormat(double[], String[]);
- method public void applyPattern(String);
- method public StringBuffer format(long, StringBuffer, java.text.FieldPosition);
- method public StringBuffer format(double, StringBuffer, java.text.FieldPosition);
- method public Object[] getFormats();
- method public double[] getLimits();
- method public static final double nextDouble(double);
- method public static double nextDouble(double, boolean);
- method public Number parse(String, java.text.ParsePosition);
- method public static final double previousDouble(double);
- method public void setChoices(double[], String[]);
- method public String toPattern();
- }
-
- 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 short secondaryOrder(int);
- method public void setOffset(int);
- method public void setText(String);
- method public void setText(java.text.CharacterIterator);
- method public static short tertiaryOrder(int);
- field public static final int NULLORDER = -1; // 0xffffffff
- }
-
- public abstract class CollationKey implements java.lang.Comparable<java.text.CollationKey> {
- ctor protected CollationKey(String);
- method public abstract int compareTo(java.text.CollationKey);
- method public String getSourceString();
- method public abstract byte[] toByteArray();
- }
-
- public abstract class Collator implements java.lang.Cloneable java.util.Comparator<java.lang.Object> {
- ctor protected Collator();
- method public Object clone();
- method public abstract int compare(String, String);
- method public int compare(Object, Object);
- method public boolean equals(String, String);
- method public static java.util.Locale[] getAvailableLocales();
- method public abstract java.text.CollationKey getCollationKey(String);
- method public int getDecomposition();
- method public static java.text.Collator getInstance();
- method public static java.text.Collator getInstance(java.util.Locale);
- method public int getStrength();
- method public abstract int hashCode();
- method public void setDecomposition(int);
- method public void setStrength(int);
- field public static final int CANONICAL_DECOMPOSITION = 1; // 0x1
- field public static final int FULL_DECOMPOSITION = 2; // 0x2
- field public static final int IDENTICAL = 3; // 0x3
- field public static final int NO_DECOMPOSITION = 0; // 0x0
- field public static final int PRIMARY = 0; // 0x0
- field public static final int SECONDARY = 1; // 0x1
- field public static final int TERTIARY = 2; // 0x2
- }
-
- public abstract class DateFormat extends java.text.Format {
- ctor protected DateFormat();
- method @NonNull public final StringBuffer format(@NonNull Object, @NonNull StringBuffer, @NonNull java.text.FieldPosition);
- method @NonNull public abstract StringBuffer format(@NonNull java.util.Date, @NonNull StringBuffer, @NonNull java.text.FieldPosition);
- method @NonNull public final String format(@NonNull java.util.Date);
- method @NonNull public static java.util.Locale[] getAvailableLocales();
- method @NonNull public java.util.Calendar getCalendar();
- method @NonNull public static final java.text.DateFormat getDateInstance();
- method @NonNull public static final java.text.DateFormat getDateInstance(int);
- method @NonNull public static final java.text.DateFormat getDateInstance(int, @NonNull java.util.Locale);
- method @NonNull public static final java.text.DateFormat getDateTimeInstance();
- method @NonNull public static final java.text.DateFormat getDateTimeInstance(int, int);
- method @NonNull public static final java.text.DateFormat getDateTimeInstance(int, int, @NonNull java.util.Locale);
- method @NonNull public static final java.text.DateFormat getInstance();
- method @NonNull public java.text.NumberFormat getNumberFormat();
- method @NonNull public static final java.text.DateFormat getTimeInstance();
- method @NonNull public static final java.text.DateFormat getTimeInstance(int);
- method @NonNull public static final java.text.DateFormat getTimeInstance(int, @NonNull java.util.Locale);
- method @NonNull public java.util.TimeZone getTimeZone();
- method public boolean isLenient();
- method @Nullable public java.util.Date parse(@NonNull String) throws java.text.ParseException;
- method @Nullable public abstract java.util.Date parse(@NonNull String, @NonNull java.text.ParsePosition);
- method @Nullable public Object parseObject(@NonNull String, @NonNull java.text.ParsePosition);
- method public void setCalendar(@NonNull java.util.Calendar);
- method public void setLenient(boolean);
- method public void setNumberFormat(@NonNull java.text.NumberFormat);
- method public void setTimeZone(@NonNull java.util.TimeZone);
- field public static final int AM_PM_FIELD = 14; // 0xe
- field public static final int DATE_FIELD = 3; // 0x3
- 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 ERA_FIELD = 0; // 0x0
- field public static final int FULL = 0; // 0x0
- field public static final int HOUR0_FIELD = 16; // 0x10
- field public static final int HOUR1_FIELD = 15; // 0xf
- 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 LONG = 1; // 0x1
- field public static final int MEDIUM = 2; // 0x2
- field public static final int MILLISECOND_FIELD = 8; // 0x8
- field public static final int MINUTE_FIELD = 6; // 0x6
- field public static final int MONTH_FIELD = 2; // 0x2
- field public static final int SECOND_FIELD = 7; // 0x7
- field public static final int SHORT = 3; // 0x3
- field public static final int TIMEZONE_FIELD = 17; // 0x11
- 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 int YEAR_FIELD = 1; // 0x1
- field @NonNull protected java.util.Calendar calendar;
- field @NonNull protected java.text.NumberFormat numberFormat;
- }
-
- public static class DateFormat.Field extends java.text.Format.Field {
- ctor protected DateFormat.Field(@NonNull String, int);
- method public int getCalendarField();
- method @NonNull public static java.text.DateFormat.Field ofCalendarField(int);
- field @NonNull public static final java.text.DateFormat.Field AM_PM;
- field @NonNull public static final java.text.DateFormat.Field DAY_OF_MONTH;
- field @NonNull public static final java.text.DateFormat.Field DAY_OF_WEEK;
- field @NonNull public static final java.text.DateFormat.Field DAY_OF_WEEK_IN_MONTH;
- field @NonNull public static final java.text.DateFormat.Field DAY_OF_YEAR;
- field @NonNull public static final java.text.DateFormat.Field ERA;
- field @NonNull public static final java.text.DateFormat.Field HOUR0;
- field @NonNull public static final java.text.DateFormat.Field HOUR1;
- field @NonNull public static final java.text.DateFormat.Field HOUR_OF_DAY0;
- field @NonNull public static final java.text.DateFormat.Field HOUR_OF_DAY1;
- field @NonNull public static final java.text.DateFormat.Field MILLISECOND;
- field @NonNull public static final java.text.DateFormat.Field MINUTE;
- field @NonNull public static final java.text.DateFormat.Field MONTH;
- field @NonNull public static final java.text.DateFormat.Field SECOND;
- field @NonNull public static final java.text.DateFormat.Field TIME_ZONE;
- field @NonNull public static final java.text.DateFormat.Field WEEK_OF_MONTH;
- field @NonNull public static final java.text.DateFormat.Field WEEK_OF_YEAR;
- field @NonNull public static final java.text.DateFormat.Field YEAR;
- }
-
- public class DateFormatSymbols implements java.lang.Cloneable java.io.Serializable {
- ctor public DateFormatSymbols();
- ctor public DateFormatSymbols(java.util.Locale);
- method public Object clone();
- method public String[] getAmPmStrings();
- method public static java.util.Locale[] getAvailableLocales();
- method public String[] getEras();
- method public static final java.text.DateFormatSymbols getInstance();
- method public static final java.text.DateFormatSymbols getInstance(java.util.Locale);
- method public String getLocalPatternChars();
- method public String[] getMonths();
- method public String[] getShortMonths();
- method public String[] getShortWeekdays();
- method public String[] getWeekdays();
- method public String[][] getZoneStrings();
- method public void setAmPmStrings(String[]);
- method public void setEras(String[]);
- method public void setLocalPatternChars(String);
- method public void setMonths(String[]);
- method public void setShortMonths(String[]);
- method public void setShortWeekdays(String[]);
- method public void setWeekdays(String[]);
- method public void setZoneStrings(String[][]);
- }
-
- public class DecimalFormat extends java.text.NumberFormat {
- ctor public DecimalFormat();
- ctor public DecimalFormat(String);
- ctor public DecimalFormat(String, java.text.DecimalFormatSymbols);
- method public void applyLocalizedPattern(String);
- method public void applyPattern(String);
- method public final StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public StringBuffer format(double, StringBuffer, java.text.FieldPosition);
- method public StringBuffer format(long, StringBuffer, java.text.FieldPosition);
- method public java.text.DecimalFormatSymbols getDecimalFormatSymbols();
- method public int getGroupingSize();
- method public int getMultiplier();
- method public String getNegativePrefix();
- method public String getNegativeSuffix();
- method public String getPositivePrefix();
- method public String getPositiveSuffix();
- method public boolean isDecimalSeparatorAlwaysShown();
- method public boolean isParseBigDecimal();
- method public Number parse(String, java.text.ParsePosition);
- method public void setDecimalFormatSymbols(java.text.DecimalFormatSymbols);
- method public void setDecimalSeparatorAlwaysShown(boolean);
- method public void setGroupingSize(int);
- method public void setMultiplier(int);
- method public void setNegativePrefix(String);
- method public void setNegativeSuffix(String);
- method public void setParseBigDecimal(boolean);
- method public void setPositivePrefix(String);
- method public void setPositiveSuffix(String);
- method public String toLocalizedPattern();
- method public String toPattern();
- }
-
- public class DecimalFormatSymbols implements java.lang.Cloneable java.io.Serializable {
- ctor public DecimalFormatSymbols();
- ctor public DecimalFormatSymbols(java.util.Locale);
- method public Object clone();
- method public static java.util.Locale[] getAvailableLocales();
- method public java.util.Currency getCurrency();
- method public String getCurrencySymbol();
- method public char getDecimalSeparator();
- method public char getDigit();
- method public String getExponentSeparator();
- method public char getGroupingSeparator();
- method public String getInfinity();
- method public static final java.text.DecimalFormatSymbols getInstance();
- method public static final java.text.DecimalFormatSymbols getInstance(java.util.Locale);
- method public String getInternationalCurrencySymbol();
- method public char getMinusSign();
- method public char getMonetaryDecimalSeparator();
- method public String getNaN();
- method public char getPatternSeparator();
- method public char getPerMill();
- method public char getPercent();
- method public char getZeroDigit();
- method public void setCurrency(java.util.Currency);
- method public void setCurrencySymbol(String);
- method public void setDecimalSeparator(char);
- method public void setDigit(char);
- method public void setExponentSeparator(String);
- method public void setGroupingSeparator(char);
- method public void setInfinity(String);
- method public void setInternationalCurrencySymbol(String);
- method public void setMinusSign(char);
- method public void setMonetaryDecimalSeparator(char);
- method public void setNaN(String);
- method public void setPatternSeparator(char);
- method public void setPerMill(char);
- method public void setPercent(char);
- method public void setZeroDigit(char);
- }
-
- public class FieldPosition {
- ctor public FieldPosition(int);
- ctor public FieldPosition(java.text.Format.Field);
- ctor public FieldPosition(java.text.Format.Field, int);
- method public int getBeginIndex();
- method public int getEndIndex();
- method public int getField();
- method public java.text.Format.Field getFieldAttribute();
- method public void setBeginIndex(int);
- method public void setEndIndex(int);
- }
-
- public abstract class Format implements java.lang.Cloneable java.io.Serializable {
- ctor protected Format();
- method public Object clone();
- method public final String format(Object);
- method public abstract StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public java.text.AttributedCharacterIterator formatToCharacterIterator(Object);
- method public abstract Object parseObject(String, java.text.ParsePosition);
- method public Object parseObject(String) throws java.text.ParseException;
- }
-
- public static class Format.Field extends java.text.AttributedCharacterIterator.Attribute {
- ctor protected Format.Field(String);
- }
-
- public class MessageFormat extends java.text.Format {
- ctor public MessageFormat(String);
- ctor public MessageFormat(String, java.util.Locale);
- method public void applyPattern(String);
- method public final StringBuffer format(Object[], StringBuffer, java.text.FieldPosition);
- method public static String format(String, java.lang.Object...);
- method public final StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public java.text.Format[] getFormats();
- method public java.text.Format[] getFormatsByArgumentIndex();
- method public java.util.Locale getLocale();
- 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 void setFormat(int, java.text.Format);
- method public void setFormatByArgumentIndex(int, java.text.Format);
- method public void setFormats(java.text.Format[]);
- method public void setFormatsByArgumentIndex(java.text.Format[]);
- method public void setLocale(java.util.Locale);
- method public String toPattern();
- }
-
- public static class MessageFormat.Field extends java.text.Format.Field {
- ctor protected MessageFormat.Field(String);
- field public static final java.text.MessageFormat.Field ARGUMENT;
- }
-
- public final class Normalizer {
- method public static boolean isNormalized(CharSequence, java.text.Normalizer.Form);
- method public static String normalize(CharSequence, java.text.Normalizer.Form);
- }
-
- public enum Normalizer.Form {
- enum_constant public static final java.text.Normalizer.Form NFC;
- enum_constant public static final java.text.Normalizer.Form NFD;
- enum_constant public static final java.text.Normalizer.Form NFKC;
- enum_constant public static final java.text.Normalizer.Form NFKD;
- }
-
- public abstract class NumberFormat extends java.text.Format {
- ctor protected NumberFormat();
- method @NonNull public StringBuffer format(@NonNull Object, @NonNull StringBuffer, @NonNull java.text.FieldPosition);
- method @NonNull public final String format(double);
- method @NonNull public final String format(long);
- method @NonNull public abstract StringBuffer format(double, @NonNull StringBuffer, @NonNull java.text.FieldPosition);
- method @NonNull public abstract StringBuffer format(long, @NonNull StringBuffer, @NonNull java.text.FieldPosition);
- method @NonNull public static java.util.Locale[] getAvailableLocales();
- method @Nullable public java.util.Currency getCurrency();
- method @NonNull public static final java.text.NumberFormat getCurrencyInstance();
- method @NonNull public static java.text.NumberFormat getCurrencyInstance(@NonNull java.util.Locale);
- method @NonNull public static final java.text.NumberFormat getInstance();
- method @NonNull public static java.text.NumberFormat getInstance(@NonNull java.util.Locale);
- method @NonNull public static final java.text.NumberFormat getIntegerInstance();
- method @NonNull public static java.text.NumberFormat getIntegerInstance(@NonNull java.util.Locale);
- method public int getMaximumFractionDigits();
- method public int getMaximumIntegerDigits();
- method public int getMinimumFractionDigits();
- method public int getMinimumIntegerDigits();
- method @NonNull public static final java.text.NumberFormat getNumberInstance();
- method @NonNull public static java.text.NumberFormat getNumberInstance(@NonNull java.util.Locale);
- method @NonNull public static final java.text.NumberFormat getPercentInstance();
- method @NonNull public static java.text.NumberFormat getPercentInstance(@NonNull java.util.Locale);
- method @NonNull public java.math.RoundingMode getRoundingMode();
- method public boolean isGroupingUsed();
- method public boolean isParseIntegerOnly();
- method @Nullable public abstract Number parse(@NonNull String, @NonNull java.text.ParsePosition);
- method @Nullable public Number parse(@NonNull String) throws java.text.ParseException;
- method @Nullable public final Object parseObject(@NonNull String, @NonNull java.text.ParsePosition);
- method public void setCurrency(@NonNull java.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 setRoundingMode(@Nullable java.math.RoundingMode);
- field public static final int FRACTION_FIELD = 1; // 0x1
- field public static final int INTEGER_FIELD = 0; // 0x0
- }
-
- public static class NumberFormat.Field extends java.text.Format.Field {
- ctor protected NumberFormat.Field(@NonNull String);
- field @NonNull public static final java.text.NumberFormat.Field CURRENCY;
- field @NonNull public static final java.text.NumberFormat.Field DECIMAL_SEPARATOR;
- field @NonNull public static final java.text.NumberFormat.Field EXPONENT;
- field @NonNull public static final java.text.NumberFormat.Field EXPONENT_SIGN;
- field @NonNull public static final java.text.NumberFormat.Field EXPONENT_SYMBOL;
- field @NonNull public static final java.text.NumberFormat.Field FRACTION;
- field @NonNull public static final java.text.NumberFormat.Field GROUPING_SEPARATOR;
- field @NonNull public static final java.text.NumberFormat.Field INTEGER;
- field @NonNull public static final java.text.NumberFormat.Field PERCENT;
- field @NonNull public static final java.text.NumberFormat.Field PERMILLE;
- field @NonNull public static final java.text.NumberFormat.Field SIGN;
- }
-
- public class ParseException extends java.lang.Exception {
- ctor public ParseException(String, int);
- method public int getErrorOffset();
- }
-
- public class ParsePosition {
- ctor public ParsePosition(int);
- method public int getErrorIndex();
- method public int getIndex();
- method public void setErrorIndex(int);
- method public void setIndex(int);
- }
-
- public class RuleBasedCollator extends java.text.Collator {
- ctor public RuleBasedCollator(String) throws java.text.ParseException;
- method public int compare(String, String);
- method public java.text.CollationElementIterator getCollationElementIterator(String);
- method public java.text.CollationElementIterator getCollationElementIterator(java.text.CharacterIterator);
- method public java.text.CollationKey getCollationKey(String);
- method public String getRules();
- }
-
- public class SimpleDateFormat extends java.text.DateFormat {
- ctor public SimpleDateFormat();
- ctor public SimpleDateFormat(String);
- ctor public SimpleDateFormat(String, java.util.Locale);
- ctor public SimpleDateFormat(String, java.text.DateFormatSymbols);
- method public void applyLocalizedPattern(String);
- method public void applyPattern(String);
- method public StringBuffer format(java.util.Date, StringBuffer, java.text.FieldPosition);
- method public java.util.Date get2DigitYearStart();
- method public java.text.DateFormatSymbols getDateFormatSymbols();
- method public java.util.Date parse(String, java.text.ParsePosition);
- method public void set2DigitYearStart(java.util.Date);
- method public void setDateFormatSymbols(java.text.DateFormatSymbols);
- method public String toLocalizedPattern();
- method public String toPattern();
- }
-
- public final class StringCharacterIterator implements java.text.CharacterIterator {
- ctor public StringCharacterIterator(String);
- ctor public StringCharacterIterator(String, int);
- ctor public StringCharacterIterator(String, int, int, int);
- method public Object clone();
- method public char current();
- method public char first();
- method public int getBeginIndex();
- method public int getEndIndex();
- method public int getIndex();
- method public char last();
- method public char next();
- method public char previous();
- method public char setIndex(int);
- method public void setText(String);
- }
-
-}
-
-package java.time {
-
- public abstract class Clock {
- ctor protected Clock();
- method public static java.time.Clock fixed(java.time.Instant, java.time.ZoneId);
- method public abstract java.time.ZoneId getZone();
- method public abstract java.time.Instant instant();
- method public long millis();
- method public static java.time.Clock offset(java.time.Clock, java.time.Duration);
- method public static java.time.Clock system(java.time.ZoneId);
- method public static java.time.Clock systemDefaultZone();
- method public static java.time.Clock systemUTC();
- method public static java.time.Clock tick(java.time.Clock, java.time.Duration);
- method public static java.time.Clock tickMinutes(java.time.ZoneId);
- method public static java.time.Clock tickSeconds(java.time.ZoneId);
- method public abstract java.time.Clock withZone(java.time.ZoneId);
- }
-
- public class DateTimeException extends java.lang.RuntimeException {
- ctor public DateTimeException(String);
- ctor public DateTimeException(String, Throwable);
- }
-
- public enum DayOfWeek implements java.time.temporal.TemporalAccessor java.time.temporal.TemporalAdjuster {
- method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
- method public static java.time.DayOfWeek from(java.time.temporal.TemporalAccessor);
- method public String getDisplayName(java.time.format.TextStyle, java.util.Locale);
- method public long getLong(java.time.temporal.TemporalField);
- method public int getValue();
- method public boolean isSupported(java.time.temporal.TemporalField);
- method public java.time.DayOfWeek minus(long);
- method public static java.time.DayOfWeek of(int);
- method public java.time.DayOfWeek plus(long);
- enum_constant public static final java.time.DayOfWeek FRIDAY;
- enum_constant public static final java.time.DayOfWeek MONDAY;
- enum_constant public static final java.time.DayOfWeek SATURDAY;
- enum_constant public static final java.time.DayOfWeek SUNDAY;
- enum_constant public static final java.time.DayOfWeek THURSDAY;
- enum_constant public static final java.time.DayOfWeek TUESDAY;
- enum_constant public static final java.time.DayOfWeek WEDNESDAY;
- }
-
- public final class Duration implements java.lang.Comparable<java.time.Duration> java.io.Serializable java.time.temporal.TemporalAmount {
- method public java.time.Duration abs();
- method public java.time.temporal.Temporal addTo(java.time.temporal.Temporal);
- method public static java.time.Duration between(java.time.temporal.Temporal, java.time.temporal.Temporal);
- method public int compareTo(java.time.Duration);
- method public java.time.Duration dividedBy(long);
- method public static java.time.Duration from(java.time.temporal.TemporalAmount);
- method public long get(java.time.temporal.TemporalUnit);
- method public int getNano();
- method public long getSeconds();
- method public java.util.List<java.time.temporal.TemporalUnit> getUnits();
- method public boolean isNegative();
- method public boolean isZero();
- method public java.time.Duration minus(java.time.Duration);
- method public java.time.Duration minus(long, java.time.temporal.TemporalUnit);
- method public java.time.Duration minusDays(long);
- method public java.time.Duration minusHours(long);
- method public java.time.Duration minusMillis(long);
- method public java.time.Duration minusMinutes(long);
- method public java.time.Duration minusNanos(long);
- method public java.time.Duration minusSeconds(long);
- method public java.time.Duration multipliedBy(long);
- method public java.time.Duration negated();
- method public static java.time.Duration of(long, java.time.temporal.TemporalUnit);
- method public static java.time.Duration ofDays(long);
- method public static java.time.Duration ofHours(long);
- method public static java.time.Duration ofMillis(long);
- method public static java.time.Duration ofMinutes(long);
- method public static java.time.Duration ofNanos(long);
- method public static java.time.Duration ofSeconds(long);
- method public static java.time.Duration ofSeconds(long, long);
- method public static java.time.Duration parse(CharSequence);
- method public java.time.Duration plus(java.time.Duration);
- method public java.time.Duration plus(long, java.time.temporal.TemporalUnit);
- method public java.time.Duration plusDays(long);
- method public java.time.Duration plusHours(long);
- method public java.time.Duration plusMillis(long);
- method public java.time.Duration plusMinutes(long);
- method public java.time.Duration plusNanos(long);
- method public java.time.Duration plusSeconds(long);
- method public java.time.temporal.Temporal subtractFrom(java.time.temporal.Temporal);
- method public long toDays();
- method public long toHours();
- method public long toMillis();
- method public long toMinutes();
- method public long toNanos();
- method public java.time.Duration withNanos(int);
- method public java.time.Duration withSeconds(long);
- field public static final java.time.Duration ZERO;
- }
-
- public final class Instant implements java.lang.Comparable<java.time.Instant> java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
- method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
- method public java.time.OffsetDateTime atOffset(java.time.ZoneOffset);
- method public java.time.ZonedDateTime atZone(java.time.ZoneId);
- method public int compareTo(java.time.Instant);
- method public static java.time.Instant from(java.time.temporal.TemporalAccessor);
- method public long getEpochSecond();
- method public long getLong(java.time.temporal.TemporalField);
- method public int getNano();
- method public boolean isAfter(java.time.Instant);
- method public boolean isBefore(java.time.Instant);
- method public boolean isSupported(java.time.temporal.TemporalField);
- method public boolean isSupported(java.time.temporal.TemporalUnit);
- method public java.time.Instant minus(java.time.temporal.TemporalAmount);
- method public java.time.Instant minus(long, java.time.temporal.TemporalUnit);
- method public java.time.Instant minusMillis(long);
- method public java.time.Instant minusNanos(long);
- method public java.time.Instant minusSeconds(long);
- method public static java.time.Instant now();
- method public static java.time.Instant now(java.time.Clock);
- method public static java.time.Instant ofEpochMilli(long);
- method public static java.time.Instant ofEpochSecond(long);
- method public static java.time.Instant ofEpochSecond(long, long);
- method public static java.time.Instant parse(CharSequence);
- method public java.time.Instant plus(java.time.temporal.TemporalAmount);
- method public java.time.Instant plus(long, java.time.temporal.TemporalUnit);
- method public java.time.Instant plusMillis(long);
- method public java.time.Instant plusNanos(long);
- method public java.time.Instant plusSeconds(long);
- method public long toEpochMilli();
- method public java.time.Instant truncatedTo(java.time.temporal.TemporalUnit);
- method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
- method public java.time.Instant with(java.time.temporal.TemporalAdjuster);
- method public java.time.Instant with(java.time.temporal.TemporalField, long);
- field public static final java.time.Instant EPOCH;
- field public static final java.time.Instant MAX;
- field public static final java.time.Instant MIN;
- }
-
- public final class LocalDate implements java.time.chrono.ChronoLocalDate java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
- method public java.time.LocalDateTime atStartOfDay();
- method public java.time.ZonedDateTime atStartOfDay(java.time.ZoneId);
- method public java.time.LocalDateTime atTime(java.time.LocalTime);
- method public java.time.LocalDateTime atTime(int, int);
- method public java.time.LocalDateTime atTime(int, int, int);
- method public java.time.LocalDateTime atTime(int, int, int, int);
- method public java.time.OffsetDateTime atTime(java.time.OffsetTime);
- method public static java.time.LocalDate from(java.time.temporal.TemporalAccessor);
- method public java.time.chrono.IsoChronology getChronology();
- method public int getDayOfMonth();
- method public java.time.DayOfWeek getDayOfWeek();
- method public int getDayOfYear();
- method public long getLong(java.time.temporal.TemporalField);
- method public java.time.Month getMonth();
- method public int getMonthValue();
- method public int getYear();
- method public int lengthOfMonth();
- method public java.time.LocalDate minus(java.time.temporal.TemporalAmount);
- method public java.time.LocalDate minus(long, java.time.temporal.TemporalUnit);
- method public java.time.LocalDate minusDays(long);
- method public java.time.LocalDate minusMonths(long);
- method public java.time.LocalDate minusWeeks(long);
- method public java.time.LocalDate minusYears(long);
- method public static java.time.LocalDate now();
- method public static java.time.LocalDate now(java.time.ZoneId);
- method public static java.time.LocalDate now(java.time.Clock);
- method public static java.time.LocalDate of(int, java.time.Month, int);
- method public static java.time.LocalDate of(int, int, int);
- method public static java.time.LocalDate ofEpochDay(long);
- method public static java.time.LocalDate ofYearDay(int, int);
- method public static java.time.LocalDate parse(CharSequence);
- method public static java.time.LocalDate parse(CharSequence, java.time.format.DateTimeFormatter);
- method public java.time.LocalDate plus(java.time.temporal.TemporalAmount);
- method public java.time.LocalDate plus(long, java.time.temporal.TemporalUnit);
- method public java.time.LocalDate plusDays(long);
- method public java.time.LocalDate plusMonths(long);
- method public java.time.LocalDate plusWeeks(long);
- method public java.time.LocalDate plusYears(long);
- method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
- method public java.time.Period until(java.time.chrono.ChronoLocalDate);
- method public java.time.LocalDate with(java.time.temporal.TemporalAdjuster);
- method public java.time.LocalDate with(java.time.temporal.TemporalField, long);
- method public java.time.LocalDate withDayOfMonth(int);
- method public java.time.LocalDate withDayOfYear(int);
- method public java.time.LocalDate withMonth(int);
- method public java.time.LocalDate withYear(int);
- field public static final java.time.LocalDate MAX;
- field public static final java.time.LocalDate MIN;
- }
-
- public final class LocalDateTime implements java.time.chrono.ChronoLocalDateTime<java.time.LocalDate> java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
- method public java.time.OffsetDateTime atOffset(java.time.ZoneOffset);
- method public java.time.ZonedDateTime atZone(java.time.ZoneId);
- method public static java.time.LocalDateTime from(java.time.temporal.TemporalAccessor);
- method public int getDayOfMonth();
- method public java.time.DayOfWeek getDayOfWeek();
- method public int getDayOfYear();
- method public int getHour();
- method public long getLong(java.time.temporal.TemporalField);
- method public int getMinute();
- method public java.time.Month getMonth();
- method public int getMonthValue();
- method public int getNano();
- method public int getSecond();
- method public int getYear();
- method public boolean isSupported(java.time.temporal.TemporalField);
- method public java.time.LocalDateTime minus(java.time.temporal.TemporalAmount);
- method public java.time.LocalDateTime minus(long, java.time.temporal.TemporalUnit);
- method public java.time.LocalDateTime minusDays(long);
- method public java.time.LocalDateTime minusHours(long);
- method public java.time.LocalDateTime minusMinutes(long);
- method public java.time.LocalDateTime minusMonths(long);
- method public java.time.LocalDateTime minusNanos(long);
- method public java.time.LocalDateTime minusSeconds(long);
- method public java.time.LocalDateTime minusWeeks(long);
- method public java.time.LocalDateTime minusYears(long);
- method public static java.time.LocalDateTime now();
- method public static java.time.LocalDateTime now(java.time.ZoneId);
- method public static java.time.LocalDateTime now(java.time.Clock);
- method public static java.time.LocalDateTime of(int, java.time.Month, int, int, int);
- method public static java.time.LocalDateTime of(int, java.time.Month, int, int, int, int);
- method public static java.time.LocalDateTime of(int, java.time.Month, int, int, int, int, int);
- method public static java.time.LocalDateTime of(int, int, int, int, int);
- method public static java.time.LocalDateTime of(int, int, int, int, int, int);
- method public static java.time.LocalDateTime of(int, int, int, int, int, int, int);
- method public static java.time.LocalDateTime of(java.time.LocalDate, java.time.LocalTime);
- method public static java.time.LocalDateTime ofEpochSecond(long, int, java.time.ZoneOffset);
- method public static java.time.LocalDateTime ofInstant(java.time.Instant, java.time.ZoneId);
- method public static java.time.LocalDateTime parse(CharSequence);
- method public static java.time.LocalDateTime parse(CharSequence, java.time.format.DateTimeFormatter);
- method public java.time.LocalDateTime plus(java.time.temporal.TemporalAmount);
- method public java.time.LocalDateTime plus(long, java.time.temporal.TemporalUnit);
- method public java.time.LocalDateTime plusDays(long);
- method public java.time.LocalDateTime plusHours(long);
- method public java.time.LocalDateTime plusMinutes(long);
- method public java.time.LocalDateTime plusMonths(long);
- method public java.time.LocalDateTime plusNanos(long);
- method public java.time.LocalDateTime plusSeconds(long);
- method public java.time.LocalDateTime plusWeeks(long);
- method public java.time.LocalDateTime plusYears(long);
- method public java.time.LocalDate toLocalDate();
- method public java.time.LocalTime toLocalTime();
- method public java.time.LocalDateTime truncatedTo(java.time.temporal.TemporalUnit);
- method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
- method public java.time.LocalDateTime with(java.time.temporal.TemporalAdjuster);
- method public java.time.LocalDateTime with(java.time.temporal.TemporalField, long);
- method public java.time.LocalDateTime withDayOfMonth(int);
- method public java.time.LocalDateTime withDayOfYear(int);
- method public java.time.LocalDateTime withHour(int);
- method public java.time.LocalDateTime withMinute(int);
- method public java.time.LocalDateTime withMonth(int);
- method public java.time.LocalDateTime withNano(int);
- method public java.time.LocalDateTime withSecond(int);
- method public java.time.LocalDateTime withYear(int);
- field public static final java.time.LocalDateTime MAX;
- field public static final java.time.LocalDateTime MIN;
- }
-
- public final class LocalTime implements java.lang.Comparable<java.time.LocalTime> java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
- method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
- method public java.time.LocalDateTime atDate(java.time.LocalDate);
- method public java.time.OffsetTime atOffset(java.time.ZoneOffset);
- method public int compareTo(java.time.LocalTime);
- method public String format(java.time.format.DateTimeFormatter);
- method public static java.time.LocalTime from(java.time.temporal.TemporalAccessor);
- method public int getHour();
- method public long getLong(java.time.temporal.TemporalField);
- method public int getMinute();
- method public int getNano();
- method public int getSecond();
- method public boolean isAfter(java.time.LocalTime);
- method public boolean isBefore(java.time.LocalTime);
- method public boolean isSupported(java.time.temporal.TemporalField);
- method public boolean isSupported(java.time.temporal.TemporalUnit);
- method public java.time.LocalTime minus(java.time.temporal.TemporalAmount);
- method public java.time.LocalTime minus(long, java.time.temporal.TemporalUnit);
- method public java.time.LocalTime minusHours(long);
- method public java.time.LocalTime minusMinutes(long);
- method public java.time.LocalTime minusNanos(long);
- method public java.time.LocalTime minusSeconds(long);
- method public static java.time.LocalTime now();
- method public static java.time.LocalTime now(java.time.ZoneId);
- method public static java.time.LocalTime now(java.time.Clock);
- method public static java.time.LocalTime of(int, int);
- method public static java.time.LocalTime of(int, int, int);
- method public static java.time.LocalTime of(int, int, int, int);
- method public static java.time.LocalTime ofNanoOfDay(long);
- method public static java.time.LocalTime ofSecondOfDay(long);
- method public static java.time.LocalTime parse(CharSequence);
- method public static java.time.LocalTime parse(CharSequence, java.time.format.DateTimeFormatter);
- method public java.time.LocalTime plus(java.time.temporal.TemporalAmount);
- method public java.time.LocalTime plus(long, java.time.temporal.TemporalUnit);
- method public java.time.LocalTime plusHours(long);
- method public java.time.LocalTime plusMinutes(long);
- method public java.time.LocalTime plusNanos(long);
- method public java.time.LocalTime plusSeconds(long);
- method public long toNanoOfDay();
- method public int toSecondOfDay();
- method public java.time.LocalTime truncatedTo(java.time.temporal.TemporalUnit);
- method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
- method public java.time.LocalTime with(java.time.temporal.TemporalAdjuster);
- method public java.time.LocalTime with(java.time.temporal.TemporalField, long);
- method public java.time.LocalTime withHour(int);
- method public java.time.LocalTime withMinute(int);
- method public java.time.LocalTime withNano(int);
- method public java.time.LocalTime withSecond(int);
- field public static final java.time.LocalTime MAX;
- field public static final java.time.LocalTime MIDNIGHT;
- field public static final java.time.LocalTime MIN;
- field public static final java.time.LocalTime NOON;
- }
-
- public enum Month implements java.time.temporal.TemporalAccessor java.time.temporal.TemporalAdjuster {
- method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
- method public int firstDayOfYear(boolean);
- method public java.time.Month firstMonthOfQuarter();
- method public static java.time.Month from(java.time.temporal.TemporalAccessor);
- method public String getDisplayName(java.time.format.TextStyle, java.util.Locale);
- method public long getLong(java.time.temporal.TemporalField);
- method public int getValue();
- method public boolean isSupported(java.time.temporal.TemporalField);
- method public int length(boolean);
- method public int maxLength();
- method public int minLength();
- method public java.time.Month minus(long);
- method public static java.time.Month of(int);
- method public java.time.Month plus(long);
- enum_constant public static final java.time.Month APRIL;
- enum_constant public static final java.time.Month AUGUST;
- enum_constant public static final java.time.Month DECEMBER;
- enum_constant public static final java.time.Month FEBRUARY;
- enum_constant public static final java.time.Month JANUARY;
- enum_constant public static final java.time.Month JULY;
- enum_constant public static final java.time.Month JUNE;
- enum_constant public static final java.time.Month MARCH;
- enum_constant public static final java.time.Month MAY;
- enum_constant public static final java.time.Month NOVEMBER;
- enum_constant public static final java.time.Month OCTOBER;
- enum_constant public static final java.time.Month SEPTEMBER;
- }
-
- public final class MonthDay implements java.lang.Comparable<java.time.MonthDay> java.io.Serializable java.time.temporal.TemporalAccessor java.time.temporal.TemporalAdjuster {
- method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
- method public java.time.LocalDate atYear(int);
- method public int compareTo(java.time.MonthDay);
- method public String format(java.time.format.DateTimeFormatter);
- method public static java.time.MonthDay from(java.time.temporal.TemporalAccessor);
- method public int getDayOfMonth();
- method public long getLong(java.time.temporal.TemporalField);
- method public java.time.Month getMonth();
- method public int getMonthValue();
- method public boolean isAfter(java.time.MonthDay);
- method public boolean isBefore(java.time.MonthDay);
- method public boolean isSupported(java.time.temporal.TemporalField);
- method public boolean isValidYear(int);
- method public static java.time.MonthDay now();
- method public static java.time.MonthDay now(java.time.ZoneId);
- method public static java.time.MonthDay now(java.time.Clock);
- method public static java.time.MonthDay of(java.time.Month, int);
- method public static java.time.MonthDay of(int, int);
- method public static java.time.MonthDay parse(CharSequence);
- method public static java.time.MonthDay parse(CharSequence, java.time.format.DateTimeFormatter);
- method public java.time.MonthDay with(java.time.Month);
- method public java.time.MonthDay withDayOfMonth(int);
- method public java.time.MonthDay withMonth(int);
- }
-
- public final class OffsetDateTime implements java.lang.Comparable<java.time.OffsetDateTime> java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
- method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
- method public java.time.ZonedDateTime atZoneSameInstant(java.time.ZoneId);
- method public java.time.ZonedDateTime atZoneSimilarLocal(java.time.ZoneId);
- method public int compareTo(java.time.OffsetDateTime);
- method public String format(java.time.format.DateTimeFormatter);
- method public static java.time.OffsetDateTime from(java.time.temporal.TemporalAccessor);
- method public int getDayOfMonth();
- method public java.time.DayOfWeek getDayOfWeek();
- method public int getDayOfYear();
- method public int getHour();
- method public long getLong(java.time.temporal.TemporalField);
- method public int getMinute();
- method public java.time.Month getMonth();
- method public int getMonthValue();
- method public int getNano();
- method public java.time.ZoneOffset getOffset();
- method public int getSecond();
- method public int getYear();
- method public boolean isAfter(java.time.OffsetDateTime);
- method public boolean isBefore(java.time.OffsetDateTime);
- method public boolean isEqual(java.time.OffsetDateTime);
- method public boolean isSupported(java.time.temporal.TemporalField);
- method public boolean isSupported(java.time.temporal.TemporalUnit);
- method public java.time.OffsetDateTime minus(java.time.temporal.TemporalAmount);
- method public java.time.OffsetDateTime minus(long, java.time.temporal.TemporalUnit);
- method public java.time.OffsetDateTime minusDays(long);
- method public java.time.OffsetDateTime minusHours(long);
- method public java.time.OffsetDateTime minusMinutes(long);
- method public java.time.OffsetDateTime minusMonths(long);
- method public java.time.OffsetDateTime minusNanos(long);
- method public java.time.OffsetDateTime minusSeconds(long);
- method public java.time.OffsetDateTime minusWeeks(long);
- method public java.time.OffsetDateTime minusYears(long);
- method public static java.time.OffsetDateTime now();
- method public static java.time.OffsetDateTime now(java.time.ZoneId);
- method public static java.time.OffsetDateTime now(java.time.Clock);
- method public static java.time.OffsetDateTime of(java.time.LocalDate, java.time.LocalTime, java.time.ZoneOffset);
- method public static java.time.OffsetDateTime of(java.time.LocalDateTime, java.time.ZoneOffset);
- method public static java.time.OffsetDateTime of(int, int, int, int, int, int, int, java.time.ZoneOffset);
- method public static java.time.OffsetDateTime ofInstant(java.time.Instant, java.time.ZoneId);
- method public static java.time.OffsetDateTime parse(CharSequence);
- method public static java.time.OffsetDateTime parse(CharSequence, java.time.format.DateTimeFormatter);
- method public java.time.OffsetDateTime plus(java.time.temporal.TemporalAmount);
- method public java.time.OffsetDateTime plus(long, java.time.temporal.TemporalUnit);
- method public java.time.OffsetDateTime plusDays(long);
- method public java.time.OffsetDateTime plusHours(long);
- method public java.time.OffsetDateTime plusMinutes(long);
- method public java.time.OffsetDateTime plusMonths(long);
- method public java.time.OffsetDateTime plusNanos(long);
- method public java.time.OffsetDateTime plusSeconds(long);
- method public java.time.OffsetDateTime plusWeeks(long);
- method public java.time.OffsetDateTime plusYears(long);
- method public static java.util.Comparator<java.time.OffsetDateTime> timeLineOrder();
- method public long toEpochSecond();
- method public java.time.Instant toInstant();
- method public java.time.LocalDate toLocalDate();
- method public java.time.LocalDateTime toLocalDateTime();
- method public java.time.LocalTime toLocalTime();
- method public java.time.OffsetTime toOffsetTime();
- method public java.time.ZonedDateTime toZonedDateTime();
- method public java.time.OffsetDateTime truncatedTo(java.time.temporal.TemporalUnit);
- method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
- method public java.time.OffsetDateTime with(java.time.temporal.TemporalAdjuster);
- method public java.time.OffsetDateTime with(java.time.temporal.TemporalField, long);
- method public java.time.OffsetDateTime withDayOfMonth(int);
- method public java.time.OffsetDateTime withDayOfYear(int);
- method public java.time.OffsetDateTime withHour(int);
- method public java.time.OffsetDateTime withMinute(int);
- method public java.time.OffsetDateTime withMonth(int);
- method public java.time.OffsetDateTime withNano(int);
- method public java.time.OffsetDateTime withOffsetSameInstant(java.time.ZoneOffset);
- method public java.time.OffsetDateTime withOffsetSameLocal(java.time.ZoneOffset);
- method public java.time.OffsetDateTime withSecond(int);
- method public java.time.OffsetDateTime withYear(int);
- field public static final java.time.OffsetDateTime MAX;
- field public static final java.time.OffsetDateTime MIN;
- }
-
- public final class OffsetTime implements java.lang.Comparable<java.time.OffsetTime> java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
- method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
- method public java.time.OffsetDateTime atDate(java.time.LocalDate);
- method public int compareTo(java.time.OffsetTime);
- method public String format(java.time.format.DateTimeFormatter);
- method public static java.time.OffsetTime from(java.time.temporal.TemporalAccessor);
- method public int getHour();
- method public long getLong(java.time.temporal.TemporalField);
- method public int getMinute();
- method public int getNano();
- method public java.time.ZoneOffset getOffset();
- method public int getSecond();
- method public boolean isAfter(java.time.OffsetTime);
- method public boolean isBefore(java.time.OffsetTime);
- method public boolean isEqual(java.time.OffsetTime);
- method public boolean isSupported(java.time.temporal.TemporalField);
- method public boolean isSupported(java.time.temporal.TemporalUnit);
- method public java.time.OffsetTime minus(java.time.temporal.TemporalAmount);
- method public java.time.OffsetTime minus(long, java.time.temporal.TemporalUnit);
- method public java.time.OffsetTime minusHours(long);
- method public java.time.OffsetTime minusMinutes(long);
- method public java.time.OffsetTime minusNanos(long);
- method public java.time.OffsetTime minusSeconds(long);
- method public static java.time.OffsetTime now();
- method public static java.time.OffsetTime now(java.time.ZoneId);
- method public static java.time.OffsetTime now(java.time.Clock);
- method public static java.time.OffsetTime of(java.time.LocalTime, java.time.ZoneOffset);
- method public static java.time.OffsetTime of(int, int, int, int, java.time.ZoneOffset);
- method public static java.time.OffsetTime ofInstant(java.time.Instant, java.time.ZoneId);
- method public static java.time.OffsetTime parse(CharSequence);
- method public static java.time.OffsetTime parse(CharSequence, java.time.format.DateTimeFormatter);
- method public java.time.OffsetTime plus(java.time.temporal.TemporalAmount);
- method public java.time.OffsetTime plus(long, java.time.temporal.TemporalUnit);
- method public java.time.OffsetTime plusHours(long);
- method public java.time.OffsetTime plusMinutes(long);
- method public java.time.OffsetTime plusNanos(long);
- method public java.time.OffsetTime plusSeconds(long);
- method public java.time.LocalTime toLocalTime();
- method public java.time.OffsetTime truncatedTo(java.time.temporal.TemporalUnit);
- method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
- method public java.time.OffsetTime with(java.time.temporal.TemporalAdjuster);
- method public java.time.OffsetTime with(java.time.temporal.TemporalField, long);
- method public java.time.OffsetTime withHour(int);
- method public java.time.OffsetTime withMinute(int);
- method public java.time.OffsetTime withNano(int);
- method public java.time.OffsetTime withOffsetSameInstant(java.time.ZoneOffset);
- method public java.time.OffsetTime withOffsetSameLocal(java.time.ZoneOffset);
- method public java.time.OffsetTime withSecond(int);
- field public static final java.time.OffsetTime MAX;
- field public static final java.time.OffsetTime MIN;
- }
-
- public final class Period implements java.time.chrono.ChronoPeriod java.io.Serializable {
- method public java.time.temporal.Temporal addTo(java.time.temporal.Temporal);
- method public static java.time.Period between(java.time.LocalDate, java.time.LocalDate);
- method public static java.time.Period from(java.time.temporal.TemporalAmount);
- method public long get(java.time.temporal.TemporalUnit);
- method public java.time.chrono.IsoChronology getChronology();
- method public int getDays();
- method public int getMonths();
- method public java.util.List<java.time.temporal.TemporalUnit> getUnits();
- method public int getYears();
- method public java.time.Period minus(java.time.temporal.TemporalAmount);
- method public java.time.Period minusDays(long);
- method public java.time.Period minusMonths(long);
- method public java.time.Period minusYears(long);
- method public java.time.Period multipliedBy(int);
- method public java.time.Period negated();
- method public java.time.Period normalized();
- method public static java.time.Period of(int, int, int);
- method public static java.time.Period ofDays(int);
- method public static java.time.Period ofMonths(int);
- method public static java.time.Period ofWeeks(int);
- method public static java.time.Period ofYears(int);
- method public static java.time.Period parse(CharSequence);
- method public java.time.Period plus(java.time.temporal.TemporalAmount);
- method public java.time.Period plusDays(long);
- method public java.time.Period plusMonths(long);
- method public java.time.Period plusYears(long);
- method public java.time.temporal.Temporal subtractFrom(java.time.temporal.Temporal);
- method public long toTotalMonths();
- method public java.time.Period withDays(int);
- method public java.time.Period withMonths(int);
- method public java.time.Period withYears(int);
- field public static final java.time.Period ZERO;
- }
-
- public final class Year implements java.lang.Comparable<java.time.Year> java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
- method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
- method public java.time.LocalDate atDay(int);
- method public java.time.YearMonth atMonth(java.time.Month);
- method public java.time.YearMonth atMonth(int);
- method public java.time.LocalDate atMonthDay(java.time.MonthDay);
- method public int compareTo(java.time.Year);
- method public String format(java.time.format.DateTimeFormatter);
- method public static java.time.Year from(java.time.temporal.TemporalAccessor);
- method public long getLong(java.time.temporal.TemporalField);
- method public int getValue();
- method public boolean isAfter(java.time.Year);
- method public boolean isBefore(java.time.Year);
- method public static boolean isLeap(long);
- method public boolean isLeap();
- method public boolean isSupported(java.time.temporal.TemporalField);
- method public boolean isSupported(java.time.temporal.TemporalUnit);
- method public boolean isValidMonthDay(java.time.MonthDay);
- method public int length();
- method public java.time.Year minus(java.time.temporal.TemporalAmount);
- method public java.time.Year minus(long, java.time.temporal.TemporalUnit);
- method public java.time.Year minusYears(long);
- method public static java.time.Year now();
- method public static java.time.Year now(java.time.ZoneId);
- method public static java.time.Year now(java.time.Clock);
- method public static java.time.Year of(int);
- method public static java.time.Year parse(CharSequence);
- method public static java.time.Year parse(CharSequence, java.time.format.DateTimeFormatter);
- method public java.time.Year plus(java.time.temporal.TemporalAmount);
- method public java.time.Year plus(long, java.time.temporal.TemporalUnit);
- method public java.time.Year plusYears(long);
- method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
- method public java.time.Year with(java.time.temporal.TemporalAdjuster);
- method public java.time.Year with(java.time.temporal.TemporalField, long);
- field public static final int MAX_VALUE = 999999999; // 0x3b9ac9ff
- field public static final int MIN_VALUE = -999999999; // 0xc4653601
- }
-
- public final class YearMonth implements java.lang.Comparable<java.time.YearMonth> java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
- method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
- method public java.time.LocalDate atDay(int);
- method public java.time.LocalDate atEndOfMonth();
- method public int compareTo(java.time.YearMonth);
- method public String format(java.time.format.DateTimeFormatter);
- method public static java.time.YearMonth from(java.time.temporal.TemporalAccessor);
- method public long getLong(java.time.temporal.TemporalField);
- method public java.time.Month getMonth();
- method public int getMonthValue();
- method public int getYear();
- method public boolean isAfter(java.time.YearMonth);
- method public boolean isBefore(java.time.YearMonth);
- method public boolean isLeapYear();
- method public boolean isSupported(java.time.temporal.TemporalField);
- method public boolean isSupported(java.time.temporal.TemporalUnit);
- method public boolean isValidDay(int);
- method public int lengthOfMonth();
- method public int lengthOfYear();
- method public java.time.YearMonth minus(java.time.temporal.TemporalAmount);
- method public java.time.YearMonth minus(long, java.time.temporal.TemporalUnit);
- method public java.time.YearMonth minusMonths(long);
- method public java.time.YearMonth minusYears(long);
- method public static java.time.YearMonth now();
- method public static java.time.YearMonth now(java.time.ZoneId);
- method public static java.time.YearMonth now(java.time.Clock);
- method public static java.time.YearMonth of(int, java.time.Month);
- method public static java.time.YearMonth of(int, int);
- method public static java.time.YearMonth parse(CharSequence);
- method public static java.time.YearMonth parse(CharSequence, java.time.format.DateTimeFormatter);
- method public java.time.YearMonth plus(java.time.temporal.TemporalAmount);
- method public java.time.YearMonth plus(long, java.time.temporal.TemporalUnit);
- method public java.time.YearMonth plusMonths(long);
- method public java.time.YearMonth plusYears(long);
- method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
- method public java.time.YearMonth with(java.time.temporal.TemporalAdjuster);
- method public java.time.YearMonth with(java.time.temporal.TemporalField, long);
- method public java.time.YearMonth withMonth(int);
- method public java.time.YearMonth withYear(int);
- }
-
- public abstract class ZoneId implements java.io.Serializable {
- method public static java.time.ZoneId from(java.time.temporal.TemporalAccessor);
- method public static java.util.Set<java.lang.String> getAvailableZoneIds();
- method public String getDisplayName(java.time.format.TextStyle, java.util.Locale);
- method public abstract String getId();
- method public abstract java.time.zone.ZoneRules getRules();
- method public java.time.ZoneId normalized();
- method public static java.time.ZoneId of(String, java.util.Map<java.lang.String,java.lang.String>);
- method public static java.time.ZoneId of(String);
- method public static java.time.ZoneId ofOffset(String, java.time.ZoneOffset);
- method public static java.time.ZoneId systemDefault();
- field public static final java.util.Map<java.lang.String,java.lang.String> SHORT_IDS;
- }
-
- public final class ZoneOffset extends java.time.ZoneId implements java.lang.Comparable<java.time.ZoneOffset> java.io.Serializable java.time.temporal.TemporalAccessor java.time.temporal.TemporalAdjuster {
- method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
- method public int compareTo(java.time.ZoneOffset);
- method public static java.time.ZoneOffset from(java.time.temporal.TemporalAccessor);
- method public String getId();
- method public long getLong(java.time.temporal.TemporalField);
- method public java.time.zone.ZoneRules getRules();
- method public int getTotalSeconds();
- method public boolean isSupported(java.time.temporal.TemporalField);
- method public static java.time.ZoneOffset of(String);
- method public static java.time.ZoneOffset ofHours(int);
- method public static java.time.ZoneOffset ofHoursMinutes(int, int);
- method public static java.time.ZoneOffset ofHoursMinutesSeconds(int, int, int);
- method public static java.time.ZoneOffset ofTotalSeconds(int);
- field public static final java.time.ZoneOffset MAX;
- field public static final java.time.ZoneOffset MIN;
- field public static final java.time.ZoneOffset UTC;
- }
-
- public final class ZonedDateTime implements java.time.chrono.ChronoZonedDateTime<java.time.LocalDate> java.io.Serializable java.time.temporal.Temporal {
- method public static java.time.ZonedDateTime from(java.time.temporal.TemporalAccessor);
- method public int getDayOfMonth();
- method public java.time.DayOfWeek getDayOfWeek();
- method public int getDayOfYear();
- method public int getHour();
- method public int getMinute();
- method public java.time.Month getMonth();
- method public int getMonthValue();
- method public int getNano();
- method public java.time.ZoneOffset getOffset();
- method public int getSecond();
- method public int getYear();
- method public java.time.ZoneId getZone();
- method public boolean isSupported(java.time.temporal.TemporalField);
- method public java.time.ZonedDateTime minus(java.time.temporal.TemporalAmount);
- method public java.time.ZonedDateTime minus(long, java.time.temporal.TemporalUnit);
- method public java.time.ZonedDateTime minusDays(long);
- method public java.time.ZonedDateTime minusHours(long);
- method public java.time.ZonedDateTime minusMinutes(long);
- method public java.time.ZonedDateTime minusMonths(long);
- method public java.time.ZonedDateTime minusNanos(long);
- method public java.time.ZonedDateTime minusSeconds(long);
- method public java.time.ZonedDateTime minusWeeks(long);
- method public java.time.ZonedDateTime minusYears(long);
- method public static java.time.ZonedDateTime now();
- method public static java.time.ZonedDateTime now(java.time.ZoneId);
- method public static java.time.ZonedDateTime now(java.time.Clock);
- method public static java.time.ZonedDateTime of(java.time.LocalDate, java.time.LocalTime, java.time.ZoneId);
- method public static java.time.ZonedDateTime of(java.time.LocalDateTime, java.time.ZoneId);
- method public static java.time.ZonedDateTime of(int, int, int, int, int, int, int, java.time.ZoneId);
- method public static java.time.ZonedDateTime ofInstant(java.time.Instant, java.time.ZoneId);
- method public static java.time.ZonedDateTime ofInstant(java.time.LocalDateTime, java.time.ZoneOffset, java.time.ZoneId);
- method public static java.time.ZonedDateTime ofLocal(java.time.LocalDateTime, java.time.ZoneId, java.time.ZoneOffset);
- method public static java.time.ZonedDateTime ofStrict(java.time.LocalDateTime, java.time.ZoneOffset, java.time.ZoneId);
- method public static java.time.ZonedDateTime parse(CharSequence);
- method public static java.time.ZonedDateTime parse(CharSequence, java.time.format.DateTimeFormatter);
- method public java.time.ZonedDateTime plus(java.time.temporal.TemporalAmount);
- method public java.time.ZonedDateTime plus(long, java.time.temporal.TemporalUnit);
- method public java.time.ZonedDateTime plusDays(long);
- method public java.time.ZonedDateTime plusHours(long);
- method public java.time.ZonedDateTime plusMinutes(long);
- method public java.time.ZonedDateTime plusMonths(long);
- method public java.time.ZonedDateTime plusNanos(long);
- method public java.time.ZonedDateTime plusSeconds(long);
- method public java.time.ZonedDateTime plusWeeks(long);
- method public java.time.ZonedDateTime plusYears(long);
- method public java.time.LocalDate toLocalDate();
- method public java.time.LocalDateTime toLocalDateTime();
- method public java.time.OffsetDateTime toOffsetDateTime();
- method public java.time.ZonedDateTime truncatedTo(java.time.temporal.TemporalUnit);
- method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
- method public java.time.ZonedDateTime with(java.time.temporal.TemporalAdjuster);
- method public java.time.ZonedDateTime with(java.time.temporal.TemporalField, long);
- method public java.time.ZonedDateTime withDayOfMonth(int);
- method public java.time.ZonedDateTime withDayOfYear(int);
- method public java.time.ZonedDateTime withEarlierOffsetAtOverlap();
- method public java.time.ZonedDateTime withFixedOffsetZone();
- method public java.time.ZonedDateTime withHour(int);
- method public java.time.ZonedDateTime withLaterOffsetAtOverlap();
- method public java.time.ZonedDateTime withMinute(int);
- method public java.time.ZonedDateTime withMonth(int);
- method public java.time.ZonedDateTime withNano(int);
- method public java.time.ZonedDateTime withSecond(int);
- method public java.time.ZonedDateTime withYear(int);
- method public java.time.ZonedDateTime withZoneSameInstant(java.time.ZoneId);
- method public java.time.ZonedDateTime withZoneSameLocal(java.time.ZoneId);
- }
-
-}
-
-package java.time.chrono {
-
- public abstract class AbstractChronology implements java.time.chrono.Chronology {
- ctor protected AbstractChronology();
- method public int compareTo(java.time.chrono.Chronology);
- method public java.time.chrono.ChronoLocalDate resolveDate(java.util.Map<java.time.temporal.TemporalField,java.lang.Long>, java.time.format.ResolverStyle);
- }
-
- public interface ChronoLocalDate extends java.time.temporal.Temporal java.lang.Comparable<java.time.chrono.ChronoLocalDate> java.time.temporal.TemporalAdjuster {
- method public default java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
- method public default java.time.chrono.ChronoLocalDateTime<?> atTime(java.time.LocalTime);
- method public default int compareTo(java.time.chrono.ChronoLocalDate);
- method public boolean equals(Object);
- method public default String format(java.time.format.DateTimeFormatter);
- method public static java.time.chrono.ChronoLocalDate from(java.time.temporal.TemporalAccessor);
- method public java.time.chrono.Chronology getChronology();
- method public default java.time.chrono.Era getEra();
- method public int hashCode();
- method public default boolean isAfter(java.time.chrono.ChronoLocalDate);
- method public default boolean isBefore(java.time.chrono.ChronoLocalDate);
- method public default boolean isEqual(java.time.chrono.ChronoLocalDate);
- method public default boolean isLeapYear();
- method public default boolean isSupported(java.time.temporal.TemporalField);
- method public default boolean isSupported(java.time.temporal.TemporalUnit);
- method public int lengthOfMonth();
- method public default int lengthOfYear();
- method public default java.time.chrono.ChronoLocalDate minus(java.time.temporal.TemporalAmount);
- method public default java.time.chrono.ChronoLocalDate minus(long, java.time.temporal.TemporalUnit);
- method public default java.time.chrono.ChronoLocalDate plus(java.time.temporal.TemporalAmount);
- method public default java.time.chrono.ChronoLocalDate plus(long, java.time.temporal.TemporalUnit);
- method public static java.util.Comparator<java.time.chrono.ChronoLocalDate> timeLineOrder();
- method public default long toEpochDay();
- method public String toString();
- method public java.time.chrono.ChronoPeriod until(java.time.chrono.ChronoLocalDate);
- method public default java.time.chrono.ChronoLocalDate with(java.time.temporal.TemporalAdjuster);
- method public default java.time.chrono.ChronoLocalDate with(java.time.temporal.TemporalField, long);
- }
-
- public interface ChronoLocalDateTime<D extends java.time.chrono.ChronoLocalDate> extends java.time.temporal.Temporal java.lang.Comparable<java.time.chrono.ChronoLocalDateTime<?>> java.time.temporal.TemporalAdjuster {
- method public default java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
- method public java.time.chrono.ChronoZonedDateTime<D> atZone(java.time.ZoneId);
- method public default int compareTo(java.time.chrono.ChronoLocalDateTime<?>);
- method public boolean equals(Object);
- method public default String format(java.time.format.DateTimeFormatter);
- method public static java.time.chrono.ChronoLocalDateTime<?> from(java.time.temporal.TemporalAccessor);
- method public default java.time.chrono.Chronology getChronology();
- method public int hashCode();
- method public default boolean isAfter(java.time.chrono.ChronoLocalDateTime<?>);
- method public default boolean isBefore(java.time.chrono.ChronoLocalDateTime<?>);
- method public default boolean isEqual(java.time.chrono.ChronoLocalDateTime<?>);
- method public default boolean isSupported(java.time.temporal.TemporalUnit);
- method public default java.time.chrono.ChronoLocalDateTime<D> minus(java.time.temporal.TemporalAmount);
- method public default java.time.chrono.ChronoLocalDateTime<D> minus(long, java.time.temporal.TemporalUnit);
- method public default java.time.chrono.ChronoLocalDateTime<D> plus(java.time.temporal.TemporalAmount);
- method public java.time.chrono.ChronoLocalDateTime<D> plus(long, java.time.temporal.TemporalUnit);
- method public static java.util.Comparator<java.time.chrono.ChronoLocalDateTime<?>> timeLineOrder();
- method public default long toEpochSecond(java.time.ZoneOffset);
- method public default java.time.Instant toInstant(java.time.ZoneOffset);
- method public D toLocalDate();
- method public java.time.LocalTime toLocalTime();
- method public String toString();
- method public default java.time.chrono.ChronoLocalDateTime<D> with(java.time.temporal.TemporalAdjuster);
- method public java.time.chrono.ChronoLocalDateTime<D> with(java.time.temporal.TemporalField, long);
- }
-
- public interface ChronoPeriod extends java.time.temporal.TemporalAmount {
- method public static java.time.chrono.ChronoPeriod between(java.time.chrono.ChronoLocalDate, java.time.chrono.ChronoLocalDate);
- method public boolean equals(Object);
- method public java.time.chrono.Chronology getChronology();
- method public int hashCode();
- method public default boolean isNegative();
- method public default boolean isZero();
- method public java.time.chrono.ChronoPeriod minus(java.time.temporal.TemporalAmount);
- method public java.time.chrono.ChronoPeriod multipliedBy(int);
- method public default java.time.chrono.ChronoPeriod negated();
- method public java.time.chrono.ChronoPeriod normalized();
- method public java.time.chrono.ChronoPeriod plus(java.time.temporal.TemporalAmount);
- method public String toString();
- }
-
- public interface ChronoZonedDateTime<D extends java.time.chrono.ChronoLocalDate> extends java.time.temporal.Temporal java.lang.Comparable<java.time.chrono.ChronoZonedDateTime<?>> {
- method public default int compareTo(java.time.chrono.ChronoZonedDateTime<?>);
- method public boolean equals(Object);
- method public default String format(java.time.format.DateTimeFormatter);
- method public static java.time.chrono.ChronoZonedDateTime<?> from(java.time.temporal.TemporalAccessor);
- method public default java.time.chrono.Chronology getChronology();
- method public default long getLong(java.time.temporal.TemporalField);
- method public java.time.ZoneOffset getOffset();
- method public java.time.ZoneId getZone();
- method public int hashCode();
- method public default boolean isAfter(java.time.chrono.ChronoZonedDateTime<?>);
- method public default boolean isBefore(java.time.chrono.ChronoZonedDateTime<?>);
- method public default boolean isEqual(java.time.chrono.ChronoZonedDateTime<?>);
- method public default boolean isSupported(java.time.temporal.TemporalUnit);
- method public default java.time.chrono.ChronoZonedDateTime<D> minus(java.time.temporal.TemporalAmount);
- method public default java.time.chrono.ChronoZonedDateTime<D> minus(long, java.time.temporal.TemporalUnit);
- method public default java.time.chrono.ChronoZonedDateTime<D> plus(java.time.temporal.TemporalAmount);
- method public java.time.chrono.ChronoZonedDateTime<D> plus(long, java.time.temporal.TemporalUnit);
- method public static java.util.Comparator<java.time.chrono.ChronoZonedDateTime<?>> timeLineOrder();
- method public default long toEpochSecond();
- method public default java.time.Instant toInstant();
- method public default D toLocalDate();
- method public java.time.chrono.ChronoLocalDateTime<D> toLocalDateTime();
- method public default java.time.LocalTime toLocalTime();
- method public String toString();
- method public default java.time.chrono.ChronoZonedDateTime<D> with(java.time.temporal.TemporalAdjuster);
- method public java.time.chrono.ChronoZonedDateTime<D> with(java.time.temporal.TemporalField, long);
- method public java.time.chrono.ChronoZonedDateTime<D> withEarlierOffsetAtOverlap();
- method public java.time.chrono.ChronoZonedDateTime<D> withLaterOffsetAtOverlap();
- method public java.time.chrono.ChronoZonedDateTime<D> withZoneSameInstant(java.time.ZoneId);
- method public java.time.chrono.ChronoZonedDateTime<D> withZoneSameLocal(java.time.ZoneId);
- }
-
- public interface Chronology extends java.lang.Comparable<java.time.chrono.Chronology> {
- method public int compareTo(java.time.chrono.Chronology);
- method public default java.time.chrono.ChronoLocalDate date(java.time.chrono.Era, int, int, int);
- method public java.time.chrono.ChronoLocalDate date(int, int, int);
- method public java.time.chrono.ChronoLocalDate date(java.time.temporal.TemporalAccessor);
- method public java.time.chrono.ChronoLocalDate dateEpochDay(long);
- method public default java.time.chrono.ChronoLocalDate dateNow();
- method public default java.time.chrono.ChronoLocalDate dateNow(java.time.ZoneId);
- method public default java.time.chrono.ChronoLocalDate dateNow(java.time.Clock);
- method public default java.time.chrono.ChronoLocalDate dateYearDay(java.time.chrono.Era, int, int);
- method public java.time.chrono.ChronoLocalDate dateYearDay(int, int);
- method public boolean equals(Object);
- method public java.time.chrono.Era eraOf(int);
- method public java.util.List<java.time.chrono.Era> eras();
- method public static java.time.chrono.Chronology from(java.time.temporal.TemporalAccessor);
- method public static java.util.Set<java.time.chrono.Chronology> getAvailableChronologies();
- method public String getCalendarType();
- method public default String getDisplayName(java.time.format.TextStyle, java.util.Locale);
- method public String getId();
- method public int hashCode();
- method public boolean isLeapYear(long);
- method public default java.time.chrono.ChronoLocalDateTime<? extends java.time.chrono.ChronoLocalDate> localDateTime(java.time.temporal.TemporalAccessor);
- method public static java.time.chrono.Chronology of(String);
- method public static java.time.chrono.Chronology ofLocale(java.util.Locale);
- method public default java.time.chrono.ChronoPeriod period(int, int, int);
- method public int prolepticYear(java.time.chrono.Era, int);
- method public java.time.temporal.ValueRange range(java.time.temporal.ChronoField);
- method public java.time.chrono.ChronoLocalDate resolveDate(java.util.Map<java.time.temporal.TemporalField,java.lang.Long>, java.time.format.ResolverStyle);
- method public String toString();
- method public default java.time.chrono.ChronoZonedDateTime<? extends java.time.chrono.ChronoLocalDate> zonedDateTime(java.time.temporal.TemporalAccessor);
- method public default java.time.chrono.ChronoZonedDateTime<? extends java.time.chrono.ChronoLocalDate> zonedDateTime(java.time.Instant, java.time.ZoneId);
- }
-
- public interface Era extends java.time.temporal.TemporalAccessor java.time.temporal.TemporalAdjuster {
- method public default java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
- method public default String getDisplayName(java.time.format.TextStyle, java.util.Locale);
- method public default long getLong(java.time.temporal.TemporalField);
- method public int getValue();
- method public default boolean isSupported(java.time.temporal.TemporalField);
- }
-
- public final class HijrahChronology extends java.time.chrono.AbstractChronology implements java.io.Serializable {
- method public java.time.chrono.HijrahDate date(java.time.chrono.Era, int, int, int);
- method public java.time.chrono.HijrahDate date(int, int, int);
- method public java.time.chrono.HijrahDate date(java.time.temporal.TemporalAccessor);
- method public java.time.chrono.HijrahDate dateEpochDay(long);
- method public java.time.chrono.HijrahDate dateNow();
- method public java.time.chrono.HijrahDate dateNow(java.time.ZoneId);
- method public java.time.chrono.HijrahDate dateNow(java.time.Clock);
- method public java.time.chrono.HijrahDate dateYearDay(java.time.chrono.Era, int, int);
- method public java.time.chrono.HijrahDate dateYearDay(int, int);
- method public java.time.chrono.HijrahEra eraOf(int);
- method public java.util.List<java.time.chrono.Era> eras();
- method public String getCalendarType();
- method public String getId();
- method public boolean isLeapYear(long);
- method public java.time.chrono.ChronoLocalDateTime<java.time.chrono.HijrahDate> localDateTime(java.time.temporal.TemporalAccessor);
- method public int prolepticYear(java.time.chrono.Era, int);
- method public java.time.temporal.ValueRange range(java.time.temporal.ChronoField);
- method public java.time.chrono.HijrahDate resolveDate(java.util.Map<java.time.temporal.TemporalField,java.lang.Long>, java.time.format.ResolverStyle);
- method public java.time.chrono.ChronoZonedDateTime<java.time.chrono.HijrahDate> zonedDateTime(java.time.temporal.TemporalAccessor);
- method public java.time.chrono.ChronoZonedDateTime<java.time.chrono.HijrahDate> zonedDateTime(java.time.Instant, java.time.ZoneId);
- field public static final java.time.chrono.HijrahChronology INSTANCE;
- }
-
- public final class HijrahDate implements java.time.chrono.ChronoLocalDate java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
- method public java.time.chrono.ChronoLocalDateTime<java.time.chrono.HijrahDate> atTime(java.time.LocalTime);
- method public static java.time.chrono.HijrahDate from(java.time.temporal.TemporalAccessor);
- method public java.time.chrono.HijrahChronology getChronology();
- method public java.time.chrono.HijrahEra getEra();
- method public long getLong(java.time.temporal.TemporalField);
- method public int lengthOfMonth();
- method public java.time.chrono.HijrahDate minus(java.time.temporal.TemporalAmount);
- method public java.time.chrono.HijrahDate minus(long, java.time.temporal.TemporalUnit);
- method public static java.time.chrono.HijrahDate now();
- method public static java.time.chrono.HijrahDate now(java.time.ZoneId);
- method public static java.time.chrono.HijrahDate now(java.time.Clock);
- method public static java.time.chrono.HijrahDate of(int, int, int);
- method public java.time.chrono.HijrahDate plus(java.time.temporal.TemporalAmount);
- method public java.time.chrono.HijrahDate plus(long, java.time.temporal.TemporalUnit);
- method public java.time.chrono.ChronoPeriod until(java.time.chrono.ChronoLocalDate);
- method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
- method public java.time.chrono.HijrahDate with(java.time.temporal.TemporalField, long);
- method public java.time.chrono.HijrahDate with(java.time.temporal.TemporalAdjuster);
- method public java.time.chrono.HijrahDate withVariant(java.time.chrono.HijrahChronology);
- }
-
- public enum HijrahEra implements java.time.chrono.Era {
- method public int getValue();
- method public static java.time.chrono.HijrahEra of(int);
- enum_constant public static final java.time.chrono.HijrahEra AH;
- }
-
- public final class IsoChronology extends java.time.chrono.AbstractChronology implements java.io.Serializable {
- method public java.time.LocalDate date(java.time.chrono.Era, int, int, int);
- method public java.time.LocalDate date(int, int, int);
- method public java.time.LocalDate date(java.time.temporal.TemporalAccessor);
- method public java.time.LocalDate dateEpochDay(long);
- method public java.time.LocalDate dateNow();
- method public java.time.LocalDate dateNow(java.time.ZoneId);
- method public java.time.LocalDate dateNow(java.time.Clock);
- method public java.time.LocalDate dateYearDay(java.time.chrono.Era, int, int);
- method public java.time.LocalDate dateYearDay(int, int);
- method public java.time.chrono.IsoEra eraOf(int);
- method public java.util.List<java.time.chrono.Era> eras();
- method public String getCalendarType();
- method public String getId();
- method public boolean isLeapYear(long);
- method public java.time.LocalDateTime localDateTime(java.time.temporal.TemporalAccessor);
- method public java.time.Period period(int, int, int);
- method public int prolepticYear(java.time.chrono.Era, int);
- method public java.time.temporal.ValueRange range(java.time.temporal.ChronoField);
- method public java.time.LocalDate resolveDate(java.util.Map<java.time.temporal.TemporalField,java.lang.Long>, java.time.format.ResolverStyle);
- method public java.time.ZonedDateTime zonedDateTime(java.time.temporal.TemporalAccessor);
- method public java.time.ZonedDateTime zonedDateTime(java.time.Instant, java.time.ZoneId);
- field public static final java.time.chrono.IsoChronology INSTANCE;
- }
-
- public enum IsoEra implements java.time.chrono.Era {
- method public int getValue();
- method public static java.time.chrono.IsoEra of(int);
- enum_constant public static final java.time.chrono.IsoEra BCE;
- enum_constant public static final java.time.chrono.IsoEra CE;
- }
-
- public final class JapaneseChronology extends java.time.chrono.AbstractChronology implements java.io.Serializable {
- method public java.time.chrono.JapaneseDate date(java.time.chrono.Era, int, int, int);
- method public java.time.chrono.JapaneseDate date(int, int, int);
- method public java.time.chrono.JapaneseDate date(java.time.temporal.TemporalAccessor);
- method public java.time.chrono.JapaneseDate dateEpochDay(long);
- method public java.time.chrono.JapaneseDate dateNow();
- method public java.time.chrono.JapaneseDate dateNow(java.time.ZoneId);
- method public java.time.chrono.JapaneseDate dateNow(java.time.Clock);
- method public java.time.chrono.JapaneseDate dateYearDay(java.time.chrono.Era, int, int);
- method public java.time.chrono.JapaneseDate dateYearDay(int, int);
- method public java.time.chrono.JapaneseEra eraOf(int);
- method public java.util.List<java.time.chrono.Era> eras();
- method public String getCalendarType();
- method public String getId();
- method public boolean isLeapYear(long);
- method public java.time.chrono.ChronoLocalDateTime<java.time.chrono.JapaneseDate> localDateTime(java.time.temporal.TemporalAccessor);
- method public int prolepticYear(java.time.chrono.Era, int);
- method public java.time.temporal.ValueRange range(java.time.temporal.ChronoField);
- method public java.time.chrono.JapaneseDate resolveDate(java.util.Map<java.time.temporal.TemporalField,java.lang.Long>, java.time.format.ResolverStyle);
- method public java.time.chrono.ChronoZonedDateTime<java.time.chrono.JapaneseDate> zonedDateTime(java.time.temporal.TemporalAccessor);
- method public java.time.chrono.ChronoZonedDateTime<java.time.chrono.JapaneseDate> zonedDateTime(java.time.Instant, java.time.ZoneId);
- field public static final java.time.chrono.JapaneseChronology INSTANCE;
- }
-
- public final class JapaneseDate implements java.time.chrono.ChronoLocalDate java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
- method public java.time.chrono.ChronoLocalDateTime<java.time.chrono.JapaneseDate> atTime(java.time.LocalTime);
- method public static java.time.chrono.JapaneseDate from(java.time.temporal.TemporalAccessor);
- method public java.time.chrono.JapaneseChronology getChronology();
- method public java.time.chrono.JapaneseEra getEra();
- method public long getLong(java.time.temporal.TemporalField);
- method public int lengthOfMonth();
- method public java.time.chrono.JapaneseDate minus(java.time.temporal.TemporalAmount);
- method public java.time.chrono.JapaneseDate minus(long, java.time.temporal.TemporalUnit);
- method public static java.time.chrono.JapaneseDate now();
- method public static java.time.chrono.JapaneseDate now(java.time.ZoneId);
- method public static java.time.chrono.JapaneseDate now(java.time.Clock);
- method public static java.time.chrono.JapaneseDate of(java.time.chrono.JapaneseEra, int, int, int);
- method public static java.time.chrono.JapaneseDate of(int, int, int);
- method public java.time.chrono.JapaneseDate plus(java.time.temporal.TemporalAmount);
- method public java.time.chrono.JapaneseDate plus(long, java.time.temporal.TemporalUnit);
- method public java.time.chrono.ChronoPeriod until(java.time.chrono.ChronoLocalDate);
- method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
- method public java.time.chrono.JapaneseDate with(java.time.temporal.TemporalField, long);
- method public java.time.chrono.JapaneseDate with(java.time.temporal.TemporalAdjuster);
- }
-
- public final class JapaneseEra implements java.time.chrono.Era java.io.Serializable {
- method public int getValue();
- method public static java.time.chrono.JapaneseEra of(int);
- method public static java.time.chrono.JapaneseEra valueOf(String);
- method public static java.time.chrono.JapaneseEra[] values();
- field public static final java.time.chrono.JapaneseEra HEISEI;
- field public static final java.time.chrono.JapaneseEra MEIJI;
- field public static final java.time.chrono.JapaneseEra REIWA;
- field public static final java.time.chrono.JapaneseEra SHOWA;
- field public static final java.time.chrono.JapaneseEra TAISHO;
- }
-
- public final class MinguoChronology extends java.time.chrono.AbstractChronology implements java.io.Serializable {
- method public java.time.chrono.MinguoDate date(java.time.chrono.Era, int, int, int);
- method public java.time.chrono.MinguoDate date(int, int, int);
- method public java.time.chrono.MinguoDate date(java.time.temporal.TemporalAccessor);
- method public java.time.chrono.MinguoDate dateEpochDay(long);
- method public java.time.chrono.MinguoDate dateNow();
- method public java.time.chrono.MinguoDate dateNow(java.time.ZoneId);
- method public java.time.chrono.MinguoDate dateNow(java.time.Clock);
- method public java.time.chrono.MinguoDate dateYearDay(java.time.chrono.Era, int, int);
- method public java.time.chrono.MinguoDate dateYearDay(int, int);
- method public java.time.chrono.MinguoEra eraOf(int);
- method public java.util.List<java.time.chrono.Era> eras();
- method public String getCalendarType();
- method public String getId();
- method public boolean isLeapYear(long);
- method public java.time.chrono.ChronoLocalDateTime<java.time.chrono.MinguoDate> localDateTime(java.time.temporal.TemporalAccessor);
- method public int prolepticYear(java.time.chrono.Era, int);
- method public java.time.temporal.ValueRange range(java.time.temporal.ChronoField);
- method public java.time.chrono.MinguoDate resolveDate(java.util.Map<java.time.temporal.TemporalField,java.lang.Long>, java.time.format.ResolverStyle);
- method public java.time.chrono.ChronoZonedDateTime<java.time.chrono.MinguoDate> zonedDateTime(java.time.temporal.TemporalAccessor);
- method public java.time.chrono.ChronoZonedDateTime<java.time.chrono.MinguoDate> zonedDateTime(java.time.Instant, java.time.ZoneId);
- field public static final java.time.chrono.MinguoChronology INSTANCE;
- }
-
- public final class MinguoDate implements java.time.chrono.ChronoLocalDate java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
- method public java.time.chrono.ChronoLocalDateTime<java.time.chrono.MinguoDate> atTime(java.time.LocalTime);
- method public static java.time.chrono.MinguoDate from(java.time.temporal.TemporalAccessor);
- method public java.time.chrono.MinguoChronology getChronology();
- method public java.time.chrono.MinguoEra getEra();
- method public long getLong(java.time.temporal.TemporalField);
- method public int lengthOfMonth();
- method public java.time.chrono.MinguoDate minus(java.time.temporal.TemporalAmount);
- method public java.time.chrono.MinguoDate minus(long, java.time.temporal.TemporalUnit);
- method public static java.time.chrono.MinguoDate now();
- method public static java.time.chrono.MinguoDate now(java.time.ZoneId);
- method public static java.time.chrono.MinguoDate now(java.time.Clock);
- method public static java.time.chrono.MinguoDate of(int, int, int);
- method public java.time.chrono.MinguoDate plus(java.time.temporal.TemporalAmount);
- method public java.time.chrono.MinguoDate plus(long, java.time.temporal.TemporalUnit);
- method public java.time.chrono.ChronoPeriod until(java.time.chrono.ChronoLocalDate);
- method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
- method public java.time.chrono.MinguoDate with(java.time.temporal.TemporalField, long);
- method public java.time.chrono.MinguoDate with(java.time.temporal.TemporalAdjuster);
- }
-
- public enum MinguoEra implements java.time.chrono.Era {
- method public int getValue();
- method public static java.time.chrono.MinguoEra of(int);
- enum_constant public static final java.time.chrono.MinguoEra BEFORE_ROC;
- enum_constant public static final java.time.chrono.MinguoEra ROC;
- }
-
- public final class ThaiBuddhistChronology extends java.time.chrono.AbstractChronology implements java.io.Serializable {
- method public java.time.chrono.ThaiBuddhistDate date(java.time.chrono.Era, int, int, int);
- method public java.time.chrono.ThaiBuddhistDate date(int, int, int);
- method public java.time.chrono.ThaiBuddhistDate date(java.time.temporal.TemporalAccessor);
- method public java.time.chrono.ThaiBuddhistDate dateEpochDay(long);
- method public java.time.chrono.ThaiBuddhistDate dateNow();
- method public java.time.chrono.ThaiBuddhistDate dateNow(java.time.ZoneId);
- method public java.time.chrono.ThaiBuddhistDate dateNow(java.time.Clock);
- method public java.time.chrono.ThaiBuddhistDate dateYearDay(java.time.chrono.Era, int, int);
- method public java.time.chrono.ThaiBuddhistDate dateYearDay(int, int);
- method public java.time.chrono.ThaiBuddhistEra eraOf(int);
- method public java.util.List<java.time.chrono.Era> eras();
- method public String getCalendarType();
- method public String getId();
- method public boolean isLeapYear(long);
- method public java.time.chrono.ChronoLocalDateTime<java.time.chrono.ThaiBuddhistDate> localDateTime(java.time.temporal.TemporalAccessor);
- method public int prolepticYear(java.time.chrono.Era, int);
- method public java.time.temporal.ValueRange range(java.time.temporal.ChronoField);
- method public java.time.chrono.ThaiBuddhistDate resolveDate(java.util.Map<java.time.temporal.TemporalField,java.lang.Long>, java.time.format.ResolverStyle);
- method public java.time.chrono.ChronoZonedDateTime<java.time.chrono.ThaiBuddhistDate> zonedDateTime(java.time.temporal.TemporalAccessor);
- method public java.time.chrono.ChronoZonedDateTime<java.time.chrono.ThaiBuddhistDate> zonedDateTime(java.time.Instant, java.time.ZoneId);
- field public static final java.time.chrono.ThaiBuddhistChronology INSTANCE;
- }
-
- public final class ThaiBuddhistDate implements java.time.chrono.ChronoLocalDate java.io.Serializable java.time.temporal.Temporal java.time.temporal.TemporalAdjuster {
- method public java.time.chrono.ChronoLocalDateTime<java.time.chrono.ThaiBuddhistDate> atTime(java.time.LocalTime);
- method public static java.time.chrono.ThaiBuddhistDate from(java.time.temporal.TemporalAccessor);
- method public java.time.chrono.ThaiBuddhistChronology getChronology();
- method public java.time.chrono.ThaiBuddhistEra getEra();
- method public long getLong(java.time.temporal.TemporalField);
- method public int lengthOfMonth();
- method public java.time.chrono.ThaiBuddhistDate minus(java.time.temporal.TemporalAmount);
- method public java.time.chrono.ThaiBuddhistDate minus(long, java.time.temporal.TemporalUnit);
- method public static java.time.chrono.ThaiBuddhistDate now();
- method public static java.time.chrono.ThaiBuddhistDate now(java.time.ZoneId);
- method public static java.time.chrono.ThaiBuddhistDate now(java.time.Clock);
- method public static java.time.chrono.ThaiBuddhistDate of(int, int, int);
- method public java.time.chrono.ThaiBuddhistDate plus(java.time.temporal.TemporalAmount);
- method public java.time.chrono.ThaiBuddhistDate plus(long, java.time.temporal.TemporalUnit);
- method public java.time.chrono.ChronoPeriod until(java.time.chrono.ChronoLocalDate);
- method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
- method public java.time.chrono.ThaiBuddhistDate with(java.time.temporal.TemporalField, long);
- method public java.time.chrono.ThaiBuddhistDate with(java.time.temporal.TemporalAdjuster);
- }
-
- public enum ThaiBuddhistEra implements java.time.chrono.Era {
- method public int getValue();
- method public static java.time.chrono.ThaiBuddhistEra of(int);
- enum_constant public static final java.time.chrono.ThaiBuddhistEra BE;
- enum_constant public static final java.time.chrono.ThaiBuddhistEra BEFORE_BE;
- }
-
-}
-
-package java.time.format {
-
- public final class DateTimeFormatter {
- method public String format(java.time.temporal.TemporalAccessor);
- method public void formatTo(java.time.temporal.TemporalAccessor, Appendable);
- method public java.time.chrono.Chronology getChronology();
- method public java.time.format.DecimalStyle getDecimalStyle();
- method public java.util.Locale getLocale();
- method public java.util.Set<java.time.temporal.TemporalField> getResolverFields();
- method public java.time.format.ResolverStyle getResolverStyle();
- method public java.time.ZoneId getZone();
- method public static java.time.format.DateTimeFormatter ofLocalizedDate(java.time.format.FormatStyle);
- method public static java.time.format.DateTimeFormatter ofLocalizedDateTime(java.time.format.FormatStyle);
- method public static java.time.format.DateTimeFormatter ofLocalizedDateTime(java.time.format.FormatStyle, java.time.format.FormatStyle);
- method public static java.time.format.DateTimeFormatter ofLocalizedTime(java.time.format.FormatStyle);
- method public static java.time.format.DateTimeFormatter ofPattern(String);
- method public static java.time.format.DateTimeFormatter ofPattern(String, java.util.Locale);
- method public java.time.temporal.TemporalAccessor parse(CharSequence);
- method public java.time.temporal.TemporalAccessor parse(CharSequence, java.text.ParsePosition);
- method public <T> T parse(CharSequence, java.time.temporal.TemporalQuery<T>);
- method public java.time.temporal.TemporalAccessor parseBest(CharSequence, java.time.temporal.TemporalQuery<?>...);
- method public java.time.temporal.TemporalAccessor parseUnresolved(CharSequence, java.text.ParsePosition);
- method public static java.time.temporal.TemporalQuery<java.time.Period> parsedExcessDays();
- method public static java.time.temporal.TemporalQuery<java.lang.Boolean> parsedLeapSecond();
- method public java.text.Format toFormat();
- method public java.text.Format toFormat(java.time.temporal.TemporalQuery<?>);
- method public java.time.format.DateTimeFormatter withChronology(java.time.chrono.Chronology);
- method public java.time.format.DateTimeFormatter withDecimalStyle(java.time.format.DecimalStyle);
- method public java.time.format.DateTimeFormatter withLocale(java.util.Locale);
- method public java.time.format.DateTimeFormatter withResolverFields(java.time.temporal.TemporalField...);
- method public java.time.format.DateTimeFormatter withResolverFields(java.util.Set<java.time.temporal.TemporalField>);
- method public java.time.format.DateTimeFormatter withResolverStyle(java.time.format.ResolverStyle);
- method public java.time.format.DateTimeFormatter withZone(java.time.ZoneId);
- field public static final java.time.format.DateTimeFormatter BASIC_ISO_DATE;
- field public static final java.time.format.DateTimeFormatter ISO_DATE;
- field public static final java.time.format.DateTimeFormatter ISO_DATE_TIME;
- field public static final java.time.format.DateTimeFormatter ISO_INSTANT;
- field public static final java.time.format.DateTimeFormatter ISO_LOCAL_DATE;
- field public static final java.time.format.DateTimeFormatter ISO_LOCAL_DATE_TIME;
- field public static final java.time.format.DateTimeFormatter ISO_LOCAL_TIME;
- field public static final java.time.format.DateTimeFormatter ISO_OFFSET_DATE;
- field public static final java.time.format.DateTimeFormatter ISO_OFFSET_DATE_TIME;
- field public static final java.time.format.DateTimeFormatter ISO_OFFSET_TIME;
- field public static final java.time.format.DateTimeFormatter ISO_ORDINAL_DATE;
- field public static final java.time.format.DateTimeFormatter ISO_TIME;
- field public static final java.time.format.DateTimeFormatter ISO_WEEK_DATE;
- field public static final java.time.format.DateTimeFormatter ISO_ZONED_DATE_TIME;
- field public static final java.time.format.DateTimeFormatter RFC_1123_DATE_TIME;
- }
-
- public final class DateTimeFormatterBuilder {
- ctor public DateTimeFormatterBuilder();
- method public java.time.format.DateTimeFormatterBuilder append(java.time.format.DateTimeFormatter);
- method public java.time.format.DateTimeFormatterBuilder appendChronologyId();
- method public java.time.format.DateTimeFormatterBuilder appendChronologyText(java.time.format.TextStyle);
- method public java.time.format.DateTimeFormatterBuilder appendFraction(java.time.temporal.TemporalField, int, int, boolean);
- method public java.time.format.DateTimeFormatterBuilder appendInstant();
- method public java.time.format.DateTimeFormatterBuilder appendInstant(int);
- method public java.time.format.DateTimeFormatterBuilder appendLiteral(char);
- method public java.time.format.DateTimeFormatterBuilder appendLiteral(String);
- method public java.time.format.DateTimeFormatterBuilder appendLocalized(java.time.format.FormatStyle, java.time.format.FormatStyle);
- method public java.time.format.DateTimeFormatterBuilder appendLocalizedOffset(java.time.format.TextStyle);
- method public java.time.format.DateTimeFormatterBuilder appendOffset(String, String);
- method public java.time.format.DateTimeFormatterBuilder appendOffsetId();
- method public java.time.format.DateTimeFormatterBuilder appendOptional(java.time.format.DateTimeFormatter);
- method public java.time.format.DateTimeFormatterBuilder appendPattern(String);
- method public java.time.format.DateTimeFormatterBuilder appendText(java.time.temporal.TemporalField);
- method public java.time.format.DateTimeFormatterBuilder appendText(java.time.temporal.TemporalField, java.time.format.TextStyle);
- method public java.time.format.DateTimeFormatterBuilder appendText(java.time.temporal.TemporalField, java.util.Map<java.lang.Long,java.lang.String>);
- method public java.time.format.DateTimeFormatterBuilder appendValue(java.time.temporal.TemporalField);
- method public java.time.format.DateTimeFormatterBuilder appendValue(java.time.temporal.TemporalField, int);
- method public java.time.format.DateTimeFormatterBuilder appendValue(java.time.temporal.TemporalField, int, int, java.time.format.SignStyle);
- method public java.time.format.DateTimeFormatterBuilder appendValueReduced(java.time.temporal.TemporalField, int, int, int);
- method public java.time.format.DateTimeFormatterBuilder appendValueReduced(java.time.temporal.TemporalField, int, int, java.time.chrono.ChronoLocalDate);
- method public java.time.format.DateTimeFormatterBuilder appendZoneId();
- method public java.time.format.DateTimeFormatterBuilder appendZoneOrOffsetId();
- method public java.time.format.DateTimeFormatterBuilder appendZoneRegionId();
- method public java.time.format.DateTimeFormatterBuilder appendZoneText(java.time.format.TextStyle);
- method public java.time.format.DateTimeFormatterBuilder appendZoneText(java.time.format.TextStyle, java.util.Set<java.time.ZoneId>);
- method public static String getLocalizedDateTimePattern(java.time.format.FormatStyle, java.time.format.FormatStyle, java.time.chrono.Chronology, java.util.Locale);
- method public java.time.format.DateTimeFormatterBuilder optionalEnd();
- method public java.time.format.DateTimeFormatterBuilder optionalStart();
- method public java.time.format.DateTimeFormatterBuilder padNext(int);
- method public java.time.format.DateTimeFormatterBuilder padNext(int, char);
- method public java.time.format.DateTimeFormatterBuilder parseCaseInsensitive();
- method public java.time.format.DateTimeFormatterBuilder parseCaseSensitive();
- method public java.time.format.DateTimeFormatterBuilder parseDefaulting(java.time.temporal.TemporalField, long);
- method public java.time.format.DateTimeFormatterBuilder parseLenient();
- method public java.time.format.DateTimeFormatterBuilder parseStrict();
- method public java.time.format.DateTimeFormatter toFormatter();
- method public java.time.format.DateTimeFormatter toFormatter(java.util.Locale);
- }
-
- public class DateTimeParseException extends java.time.DateTimeException {
- ctor public DateTimeParseException(String, CharSequence, int);
- ctor public DateTimeParseException(String, CharSequence, int, Throwable);
- method public int getErrorIndex();
- method public String getParsedString();
- }
-
- public final class DecimalStyle {
- method public static java.util.Set<java.util.Locale> getAvailableLocales();
- method public char getDecimalSeparator();
- method public char getNegativeSign();
- method public char getPositiveSign();
- method public char getZeroDigit();
- method public static java.time.format.DecimalStyle of(java.util.Locale);
- method public static java.time.format.DecimalStyle ofDefaultLocale();
- method public java.time.format.DecimalStyle withDecimalSeparator(char);
- method public java.time.format.DecimalStyle withNegativeSign(char);
- method public java.time.format.DecimalStyle withPositiveSign(char);
- method public java.time.format.DecimalStyle withZeroDigit(char);
- field public static final java.time.format.DecimalStyle STANDARD;
- }
-
- public enum FormatStyle {
- enum_constant public static final java.time.format.FormatStyle FULL;
- enum_constant public static final java.time.format.FormatStyle LONG;
- enum_constant public static final java.time.format.FormatStyle MEDIUM;
- enum_constant public static final java.time.format.FormatStyle SHORT;
- }
-
- public enum ResolverStyle {
- enum_constant public static final java.time.format.ResolverStyle LENIENT;
- enum_constant public static final java.time.format.ResolverStyle SMART;
- enum_constant public static final java.time.format.ResolverStyle STRICT;
- }
-
- public enum SignStyle {
- enum_constant public static final java.time.format.SignStyle ALWAYS;
- enum_constant public static final java.time.format.SignStyle EXCEEDS_PAD;
- enum_constant public static final java.time.format.SignStyle NEVER;
- enum_constant public static final java.time.format.SignStyle NORMAL;
- enum_constant public static final java.time.format.SignStyle NOT_NEGATIVE;
- }
-
- public enum TextStyle {
- method public java.time.format.TextStyle asNormal();
- method public java.time.format.TextStyle asStandalone();
- method public boolean isStandalone();
- enum_constant public static final java.time.format.TextStyle FULL;
- enum_constant public static final java.time.format.TextStyle FULL_STANDALONE;
- enum_constant public static final java.time.format.TextStyle NARROW;
- enum_constant public static final java.time.format.TextStyle NARROW_STANDALONE;
- enum_constant public static final java.time.format.TextStyle SHORT;
- enum_constant public static final java.time.format.TextStyle SHORT_STANDALONE;
- }
-
-}
-
-package java.time.temporal {
-
- public enum ChronoField implements java.time.temporal.TemporalField {
- method public <R extends java.time.temporal.Temporal> R adjustInto(R, long);
- method public int checkValidIntValue(long);
- method public long checkValidValue(long);
- method public java.time.temporal.TemporalUnit getBaseUnit();
- method public long getFrom(java.time.temporal.TemporalAccessor);
- method public java.time.temporal.TemporalUnit getRangeUnit();
- method public boolean isDateBased();
- method public boolean isSupportedBy(java.time.temporal.TemporalAccessor);
- method public boolean isTimeBased();
- method public java.time.temporal.ValueRange range();
- method public java.time.temporal.ValueRange rangeRefinedBy(java.time.temporal.TemporalAccessor);
- enum_constant public static final java.time.temporal.ChronoField ALIGNED_DAY_OF_WEEK_IN_MONTH;
- enum_constant public static final java.time.temporal.ChronoField ALIGNED_DAY_OF_WEEK_IN_YEAR;
- enum_constant public static final java.time.temporal.ChronoField ALIGNED_WEEK_OF_MONTH;
- enum_constant public static final java.time.temporal.ChronoField ALIGNED_WEEK_OF_YEAR;
- enum_constant public static final java.time.temporal.ChronoField AMPM_OF_DAY;
- enum_constant public static final java.time.temporal.ChronoField CLOCK_HOUR_OF_AMPM;
- enum_constant public static final java.time.temporal.ChronoField CLOCK_HOUR_OF_DAY;
- enum_constant public static final java.time.temporal.ChronoField DAY_OF_MONTH;
- enum_constant public static final java.time.temporal.ChronoField DAY_OF_WEEK;
- enum_constant public static final java.time.temporal.ChronoField DAY_OF_YEAR;
- enum_constant public static final java.time.temporal.ChronoField EPOCH_DAY;
- enum_constant public static final java.time.temporal.ChronoField ERA;
- enum_constant public static final java.time.temporal.ChronoField HOUR_OF_AMPM;
- enum_constant public static final java.time.temporal.ChronoField HOUR_OF_DAY;
- enum_constant public static final java.time.temporal.ChronoField INSTANT_SECONDS;
- enum_constant public static final java.time.temporal.ChronoField MICRO_OF_DAY;
- enum_constant public static final java.time.temporal.ChronoField MICRO_OF_SECOND;
- enum_constant public static final java.time.temporal.ChronoField MILLI_OF_DAY;
- enum_constant public static final java.time.temporal.ChronoField MILLI_OF_SECOND;
- enum_constant public static final java.time.temporal.ChronoField MINUTE_OF_DAY;
- enum_constant public static final java.time.temporal.ChronoField MINUTE_OF_HOUR;
- enum_constant public static final java.time.temporal.ChronoField MONTH_OF_YEAR;
- enum_constant public static final java.time.temporal.ChronoField NANO_OF_DAY;
- enum_constant public static final java.time.temporal.ChronoField NANO_OF_SECOND;
- enum_constant public static final java.time.temporal.ChronoField OFFSET_SECONDS;
- enum_constant public static final java.time.temporal.ChronoField PROLEPTIC_MONTH;
- enum_constant public static final java.time.temporal.ChronoField SECOND_OF_DAY;
- enum_constant public static final java.time.temporal.ChronoField SECOND_OF_MINUTE;
- enum_constant public static final java.time.temporal.ChronoField YEAR;
- enum_constant public static final java.time.temporal.ChronoField YEAR_OF_ERA;
- }
-
- public enum ChronoUnit implements java.time.temporal.TemporalUnit {
- method public <R extends java.time.temporal.Temporal> R addTo(R, long);
- method public long between(java.time.temporal.Temporal, java.time.temporal.Temporal);
- method public java.time.Duration getDuration();
- method public boolean isDateBased();
- method public boolean isDurationEstimated();
- method public boolean isTimeBased();
- enum_constant public static final java.time.temporal.ChronoUnit CENTURIES;
- enum_constant public static final java.time.temporal.ChronoUnit DAYS;
- enum_constant public static final java.time.temporal.ChronoUnit DECADES;
- enum_constant public static final java.time.temporal.ChronoUnit ERAS;
- enum_constant public static final java.time.temporal.ChronoUnit FOREVER;
- enum_constant public static final java.time.temporal.ChronoUnit HALF_DAYS;
- enum_constant public static final java.time.temporal.ChronoUnit HOURS;
- enum_constant public static final java.time.temporal.ChronoUnit MICROS;
- enum_constant public static final java.time.temporal.ChronoUnit MILLENNIA;
- enum_constant public static final java.time.temporal.ChronoUnit MILLIS;
- enum_constant public static final java.time.temporal.ChronoUnit MINUTES;
- enum_constant public static final java.time.temporal.ChronoUnit MONTHS;
- enum_constant public static final java.time.temporal.ChronoUnit NANOS;
- enum_constant public static final java.time.temporal.ChronoUnit SECONDS;
- enum_constant public static final java.time.temporal.ChronoUnit WEEKS;
- enum_constant public static final java.time.temporal.ChronoUnit YEARS;
- }
-
- public final class IsoFields {
- field public static final java.time.temporal.TemporalField DAY_OF_QUARTER;
- field public static final java.time.temporal.TemporalField QUARTER_OF_YEAR;
- field public static final java.time.temporal.TemporalUnit QUARTER_YEARS;
- field public static final java.time.temporal.TemporalField WEEK_BASED_YEAR;
- field public static final java.time.temporal.TemporalUnit WEEK_BASED_YEARS;
- field public static final java.time.temporal.TemporalField WEEK_OF_WEEK_BASED_YEAR;
- }
-
- public final class JulianFields {
- field public static final java.time.temporal.TemporalField JULIAN_DAY;
- field public static final java.time.temporal.TemporalField MODIFIED_JULIAN_DAY;
- field public static final java.time.temporal.TemporalField RATA_DIE;
- }
-
- public interface Temporal extends java.time.temporal.TemporalAccessor {
- method public boolean isSupported(java.time.temporal.TemporalUnit);
- method public default java.time.temporal.Temporal minus(java.time.temporal.TemporalAmount);
- method public default java.time.temporal.Temporal minus(long, java.time.temporal.TemporalUnit);
- method public default java.time.temporal.Temporal plus(java.time.temporal.TemporalAmount);
- method public java.time.temporal.Temporal plus(long, java.time.temporal.TemporalUnit);
- method public long until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit);
- method public default java.time.temporal.Temporal with(java.time.temporal.TemporalAdjuster);
- method public java.time.temporal.Temporal with(java.time.temporal.TemporalField, long);
- }
-
- public interface TemporalAccessor {
- method public default int get(java.time.temporal.TemporalField);
- method public long getLong(java.time.temporal.TemporalField);
- method public boolean isSupported(java.time.temporal.TemporalField);
- method public default <R> R query(java.time.temporal.TemporalQuery<R>);
- method public default java.time.temporal.ValueRange range(java.time.temporal.TemporalField);
- }
-
- @java.lang.FunctionalInterface public interface TemporalAdjuster {
- method public java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal);
- }
-
- public final class TemporalAdjusters {
- method public static java.time.temporal.TemporalAdjuster dayOfWeekInMonth(int, java.time.DayOfWeek);
- method public static java.time.temporal.TemporalAdjuster firstDayOfMonth();
- method public static java.time.temporal.TemporalAdjuster firstDayOfNextMonth();
- method public static java.time.temporal.TemporalAdjuster firstDayOfNextYear();
- method public static java.time.temporal.TemporalAdjuster firstDayOfYear();
- method public static java.time.temporal.TemporalAdjuster firstInMonth(java.time.DayOfWeek);
- method public static java.time.temporal.TemporalAdjuster lastDayOfMonth();
- method public static java.time.temporal.TemporalAdjuster lastDayOfYear();
- method public static java.time.temporal.TemporalAdjuster lastInMonth(java.time.DayOfWeek);
- method public static java.time.temporal.TemporalAdjuster next(java.time.DayOfWeek);
- method public static java.time.temporal.TemporalAdjuster nextOrSame(java.time.DayOfWeek);
- method public static java.time.temporal.TemporalAdjuster ofDateAdjuster(java.util.function.UnaryOperator<java.time.LocalDate>);
- method public static java.time.temporal.TemporalAdjuster previous(java.time.DayOfWeek);
- method public static java.time.temporal.TemporalAdjuster previousOrSame(java.time.DayOfWeek);
- }
-
- public interface TemporalAmount {
- method public java.time.temporal.Temporal addTo(java.time.temporal.Temporal);
- method public long get(java.time.temporal.TemporalUnit);
- method public java.util.List<java.time.temporal.TemporalUnit> getUnits();
- method public java.time.temporal.Temporal subtractFrom(java.time.temporal.Temporal);
- }
-
- public interface TemporalField {
- method public <R extends java.time.temporal.Temporal> R adjustInto(R, long);
- method public java.time.temporal.TemporalUnit getBaseUnit();
- method public default String getDisplayName(java.util.Locale);
- method public long getFrom(java.time.temporal.TemporalAccessor);
- method public java.time.temporal.TemporalUnit getRangeUnit();
- method public boolean isDateBased();
- method public boolean isSupportedBy(java.time.temporal.TemporalAccessor);
- method public boolean isTimeBased();
- method public java.time.temporal.ValueRange range();
- method public java.time.temporal.ValueRange rangeRefinedBy(java.time.temporal.TemporalAccessor);
- method public default java.time.temporal.TemporalAccessor resolve(java.util.Map<java.time.temporal.TemporalField,java.lang.Long>, java.time.temporal.TemporalAccessor, java.time.format.ResolverStyle);
- method public String toString();
- }
-
- public final class TemporalQueries {
- method public static java.time.temporal.TemporalQuery<java.time.chrono.Chronology> chronology();
- method public static java.time.temporal.TemporalQuery<java.time.LocalDate> localDate();
- method public static java.time.temporal.TemporalQuery<java.time.LocalTime> localTime();
- method public static java.time.temporal.TemporalQuery<java.time.ZoneOffset> offset();
- method public static java.time.temporal.TemporalQuery<java.time.temporal.TemporalUnit> precision();
- method public static java.time.temporal.TemporalQuery<java.time.ZoneId> zone();
- method public static java.time.temporal.TemporalQuery<java.time.ZoneId> zoneId();
- }
-
- @java.lang.FunctionalInterface public interface TemporalQuery<R> {
- method public R queryFrom(java.time.temporal.TemporalAccessor);
- }
-
- public interface TemporalUnit {
- method public <R extends java.time.temporal.Temporal> R addTo(R, long);
- method public long between(java.time.temporal.Temporal, java.time.temporal.Temporal);
- method public java.time.Duration getDuration();
- method public boolean isDateBased();
- method public boolean isDurationEstimated();
- method public default boolean isSupportedBy(java.time.temporal.Temporal);
- method public boolean isTimeBased();
- method public String toString();
- }
-
- public class UnsupportedTemporalTypeException extends java.time.DateTimeException {
- ctor public UnsupportedTemporalTypeException(String);
- ctor public UnsupportedTemporalTypeException(String, Throwable);
- }
-
- public final class ValueRange implements java.io.Serializable {
- method public int checkValidIntValue(long, java.time.temporal.TemporalField);
- method public long checkValidValue(long, java.time.temporal.TemporalField);
- method public long getLargestMinimum();
- method public long getMaximum();
- method public long getMinimum();
- method public long getSmallestMaximum();
- method public boolean isFixed();
- method public boolean isIntValue();
- method public boolean isValidIntValue(long);
- method public boolean isValidValue(long);
- method public static java.time.temporal.ValueRange of(long, long);
- method public static java.time.temporal.ValueRange of(long, long, long);
- method public static java.time.temporal.ValueRange of(long, long, long, long);
- }
-
- public final class WeekFields implements java.io.Serializable {
- method public java.time.temporal.TemporalField dayOfWeek();
- method public java.time.DayOfWeek getFirstDayOfWeek();
- method public int getMinimalDaysInFirstWeek();
- method public static java.time.temporal.WeekFields of(java.util.Locale);
- method public static java.time.temporal.WeekFields of(java.time.DayOfWeek, int);
- method public java.time.temporal.TemporalField weekBasedYear();
- method public java.time.temporal.TemporalField weekOfMonth();
- method public java.time.temporal.TemporalField weekOfWeekBasedYear();
- method public java.time.temporal.TemporalField weekOfYear();
- field public static final java.time.temporal.WeekFields ISO;
- field public static final java.time.temporal.WeekFields SUNDAY_START;
- field public static final java.time.temporal.TemporalUnit WEEK_BASED_YEARS;
- }
-
-}
-
-package java.time.zone {
-
- public final class ZoneOffsetTransition implements java.lang.Comparable<java.time.zone.ZoneOffsetTransition> java.io.Serializable {
- method public int compareTo(java.time.zone.ZoneOffsetTransition);
- method public java.time.LocalDateTime getDateTimeAfter();
- method public java.time.LocalDateTime getDateTimeBefore();
- method public java.time.Duration getDuration();
- method public java.time.Instant getInstant();
- method public java.time.ZoneOffset getOffsetAfter();
- method public java.time.ZoneOffset getOffsetBefore();
- method public boolean isGap();
- method public boolean isOverlap();
- method public boolean isValidOffset(java.time.ZoneOffset);
- method public static java.time.zone.ZoneOffsetTransition of(java.time.LocalDateTime, java.time.ZoneOffset, java.time.ZoneOffset);
- method public long toEpochSecond();
- }
-
- public final class ZoneOffsetTransitionRule implements java.io.Serializable {
- method public java.time.zone.ZoneOffsetTransition createTransition(int);
- method public int getDayOfMonthIndicator();
- method public java.time.DayOfWeek getDayOfWeek();
- method public java.time.LocalTime getLocalTime();
- method public java.time.Month getMonth();
- method public java.time.ZoneOffset getOffsetAfter();
- method public java.time.ZoneOffset getOffsetBefore();
- method public java.time.ZoneOffset getStandardOffset();
- method public java.time.zone.ZoneOffsetTransitionRule.TimeDefinition getTimeDefinition();
- method public boolean isMidnightEndOfDay();
- method public static java.time.zone.ZoneOffsetTransitionRule of(java.time.Month, int, java.time.DayOfWeek, java.time.LocalTime, boolean, java.time.zone.ZoneOffsetTransitionRule.TimeDefinition, java.time.ZoneOffset, java.time.ZoneOffset, java.time.ZoneOffset);
- }
-
- public enum ZoneOffsetTransitionRule.TimeDefinition {
- method public java.time.LocalDateTime createDateTime(java.time.LocalDateTime, java.time.ZoneOffset, java.time.ZoneOffset);
- enum_constant public static final java.time.zone.ZoneOffsetTransitionRule.TimeDefinition STANDARD;
- enum_constant public static final java.time.zone.ZoneOffsetTransitionRule.TimeDefinition UTC;
- enum_constant public static final java.time.zone.ZoneOffsetTransitionRule.TimeDefinition WALL;
- }
-
- public final class ZoneRules implements java.io.Serializable {
- method public java.time.Duration getDaylightSavings(java.time.Instant);
- method public java.time.ZoneOffset getOffset(java.time.Instant);
- method public java.time.ZoneOffset getOffset(java.time.LocalDateTime);
- method public java.time.ZoneOffset getStandardOffset(java.time.Instant);
- method public java.time.zone.ZoneOffsetTransition getTransition(java.time.LocalDateTime);
- method public java.util.List<java.time.zone.ZoneOffsetTransitionRule> getTransitionRules();
- method public java.util.List<java.time.zone.ZoneOffsetTransition> getTransitions();
- method public java.util.List<java.time.ZoneOffset> getValidOffsets(java.time.LocalDateTime);
- method public boolean isDaylightSavings(java.time.Instant);
- method public boolean isFixedOffset();
- method public boolean isValidOffset(java.time.LocalDateTime, java.time.ZoneOffset);
- method public java.time.zone.ZoneOffsetTransition nextTransition(java.time.Instant);
- method public static java.time.zone.ZoneRules of(java.time.ZoneOffset, java.time.ZoneOffset, java.util.List<java.time.zone.ZoneOffsetTransition>, java.util.List<java.time.zone.ZoneOffsetTransition>, java.util.List<java.time.zone.ZoneOffsetTransitionRule>);
- method public static java.time.zone.ZoneRules of(java.time.ZoneOffset);
- method public java.time.zone.ZoneOffsetTransition previousTransition(java.time.Instant);
- }
-
- public class ZoneRulesException extends java.time.DateTimeException {
- ctor public ZoneRulesException(String);
- ctor public ZoneRulesException(String, Throwable);
- }
-
-}
-
-package java.util {
-
- public abstract class AbstractCollection<E> implements java.util.Collection<E> {
- ctor protected AbstractCollection();
- method public boolean add(E);
- method public boolean addAll(@NonNull java.util.Collection<? extends E>);
- method public void clear();
- method public boolean contains(@Nullable Object);
- method public boolean containsAll(@NonNull java.util.Collection<?>);
- method public boolean isEmpty();
- method public boolean remove(@Nullable Object);
- method public boolean removeAll(@NonNull java.util.Collection<?>);
- method public boolean retainAll(@NonNull java.util.Collection<?>);
- method @NonNull public Object[] toArray();
- method @NonNull public <T> T[] toArray(@NonNull T[]);
- }
-
- public abstract class AbstractList<E> extends java.util.AbstractCollection<E> implements java.util.List<E> {
- ctor protected AbstractList();
- method public void add(int, E);
- method public boolean addAll(int, @NonNull java.util.Collection<? extends E>);
- method public int indexOf(@Nullable Object);
- method @NonNull public java.util.Iterator<E> iterator();
- method public int lastIndexOf(@Nullable Object);
- method @NonNull public java.util.ListIterator<E> listIterator();
- method @NonNull public java.util.ListIterator<E> listIterator(int);
- method public E remove(int);
- method protected void removeRange(int, int);
- method public E set(int, E);
- method @NonNull public java.util.List<E> subList(int, int);
- field protected transient int modCount;
- }
-
- public abstract class AbstractMap<K, V> implements java.util.Map<K,V> {
- ctor protected AbstractMap();
- method public void clear();
- method public boolean containsKey(@Nullable Object);
- method public boolean containsValue(@Nullable Object);
- method @Nullable public V get(@Nullable Object);
- method public boolean isEmpty();
- method @NonNull public java.util.Set<K> keySet();
- method @Nullable public V put(K, V);
- method public void putAll(@NonNull java.util.Map<? extends K,? extends V>);
- method @Nullable public V remove(@Nullable Object);
- method public int size();
- method @NonNull public java.util.Collection<V> values();
- }
-
- public static class AbstractMap.SimpleEntry<K, V> implements java.util.Map.Entry<K,V> java.io.Serializable {
- ctor public AbstractMap.SimpleEntry(K, V);
- ctor public AbstractMap.SimpleEntry(@NonNull java.util.Map.Entry<? extends K,? extends V>);
- method public K getKey();
- method public V getValue();
- method public V setValue(V);
- }
-
- public static class AbstractMap.SimpleImmutableEntry<K, V> implements java.util.Map.Entry<K,V> java.io.Serializable {
- ctor public AbstractMap.SimpleImmutableEntry(K, V);
- ctor public AbstractMap.SimpleImmutableEntry(@NonNull java.util.Map.Entry<? extends K,? extends V>);
- method public K getKey();
- method public V getValue();
- method public V setValue(V);
- }
-
- public abstract class AbstractQueue<E> extends java.util.AbstractCollection<E> implements java.util.Queue<E> {
- ctor protected AbstractQueue();
- method public E element();
- method public E remove();
- }
-
- public abstract class AbstractSequentialList<E> extends java.util.AbstractList<E> {
- ctor protected AbstractSequentialList();
- method public E get(int);
- }
-
- public abstract class AbstractSet<E> extends java.util.AbstractCollection<E> implements java.util.Set<E> {
- ctor protected AbstractSet();
- }
-
- public class ArrayDeque<E> extends java.util.AbstractCollection<E> implements java.lang.Cloneable java.util.Deque<E> java.io.Serializable {
- ctor public ArrayDeque();
- ctor public ArrayDeque(int);
- ctor public ArrayDeque(@NonNull java.util.Collection<? extends E>);
- method public void addFirst(E);
- method public void addLast(E);
- method @NonNull public java.util.ArrayDeque<E> clone();
- method @NonNull public java.util.Iterator<E> descendingIterator();
- method public E element();
- method public E getFirst();
- method public E getLast();
- method @NonNull public java.util.Iterator<E> iterator();
- method public boolean offer(E);
- method public boolean offerFirst(E);
- method public boolean offerLast(E);
- method @Nullable public E peek();
- method @Nullable public E peekFirst();
- method @Nullable public E peekLast();
- method @Nullable public E poll();
- method @Nullable public E pollFirst();
- method @Nullable public E pollLast();
- method public E pop();
- method public void push(E);
- method public E remove();
- method public E removeFirst();
- method public boolean removeFirstOccurrence(@Nullable Object);
- method public E removeLast();
- method public boolean removeLastOccurrence(@Nullable Object);
- method public int size();
- }
-
- public class ArrayList<E> extends java.util.AbstractList<E> implements java.lang.Cloneable java.util.List<E> java.util.RandomAccess java.io.Serializable {
- ctor public ArrayList(int);
- ctor public ArrayList();
- ctor public ArrayList(@NonNull java.util.Collection<? extends E>);
- method @NonNull public Object clone();
- method public void ensureCapacity(int);
- method public void forEach(@NonNull java.util.function.Consumer<? super E>);
- method public E get(int);
- method public int size();
- method public void trimToSize();
- }
-
- public class Arrays {
- method @NonNull @java.lang.SafeVarargs public static <T> java.util.List<T> asList(@NonNull T...);
- method public static int binarySearch(@NonNull long[], long);
- method public static int binarySearch(@NonNull long[], int, int, long);
- method public static int binarySearch(@NonNull int[], int);
- method public static int binarySearch(@NonNull int[], int, int, int);
- method public static int binarySearch(@NonNull short[], short);
- method public static int binarySearch(@NonNull short[], int, int, short);
- method public static int binarySearch(@NonNull char[], char);
- method public static int binarySearch(@NonNull char[], int, int, char);
- method public static int binarySearch(@NonNull byte[], byte);
- method public static int binarySearch(@NonNull byte[], int, int, byte);
- method public static int binarySearch(@NonNull double[], double);
- method public static int binarySearch(@NonNull double[], int, int, double);
- method public static int binarySearch(@NonNull float[], float);
- method public static int binarySearch(@NonNull float[], int, int, float);
- method public static int binarySearch(@NonNull Object[], @NonNull Object);
- method public static int binarySearch(@NonNull Object[], int, int, @NonNull Object);
- method public static <T> int binarySearch(@NonNull T[], T, @Nullable java.util.Comparator<? super T>);
- method public static <T> int binarySearch(@NonNull T[], int, int, T, @Nullable java.util.Comparator<? super T>);
- method @NonNull public static <T> T[] copyOf(@NonNull T[], int);
- method @NonNull public static <T, U> T[] copyOf(@NonNull U[], int, @NonNull Class<? extends T[]>);
- method @NonNull public static byte[] copyOf(@NonNull byte[], int);
- method @NonNull public static short[] copyOf(@NonNull short[], int);
- method @NonNull public static int[] copyOf(@NonNull int[], int);
- method @NonNull public static long[] copyOf(@NonNull long[], int);
- method @NonNull public static char[] copyOf(@NonNull char[], int);
- method @NonNull public static float[] copyOf(@NonNull float[], int);
- method @NonNull public static double[] copyOf(@NonNull double[], int);
- method @NonNull public static boolean[] copyOf(@NonNull boolean[], int);
- method @NonNull public static <T> T[] copyOfRange(@NonNull T[], int, int);
- method @NonNull public static <T, U> T[] copyOfRange(@NonNull U[], int, int, @NonNull Class<? extends T[]>);
- method @NonNull public static byte[] copyOfRange(@NonNull byte[], int, int);
- method @NonNull public static short[] copyOfRange(@NonNull short[], int, int);
- method @NonNull public static int[] copyOfRange(@NonNull int[], int, int);
- method @NonNull public static long[] copyOfRange(@NonNull long[], int, int);
- method @NonNull public static char[] copyOfRange(@NonNull char[], int, int);
- method @NonNull public static float[] copyOfRange(@NonNull float[], int, int);
- method @NonNull public static double[] copyOfRange(@NonNull double[], int, int);
- method @NonNull public static boolean[] copyOfRange(@NonNull boolean[], int, int);
- method public static boolean deepEquals(@Nullable Object[], @Nullable Object[]);
- method public static int deepHashCode(@Nullable Object[]);
- method @NonNull public static String deepToString(@Nullable Object[]);
- method public static boolean equals(@Nullable long[], @Nullable long[]);
- method public static boolean equals(@Nullable int[], @Nullable int[]);
- method public static boolean equals(@Nullable short[], @Nullable short[]);
- method public static boolean equals(@Nullable char[], @Nullable char[]);
- method public static boolean equals(@Nullable byte[], @Nullable byte[]);
- method public static boolean equals(@Nullable boolean[], @Nullable boolean[]);
- method public static boolean equals(@Nullable double[], @Nullable double[]);
- method public static boolean equals(@Nullable float[], @Nullable float[]);
- method public static boolean equals(@Nullable Object[], @Nullable Object[]);
- method public static void fill(@NonNull long[], long);
- method public static void fill(@NonNull long[], int, int, long);
- method public static void fill(@NonNull int[], int);
- method public static void fill(@NonNull int[], int, int, int);
- method public static void fill(@NonNull short[], short);
- method public static void fill(@NonNull short[], int, int, short);
- method public static void fill(@NonNull char[], char);
- method public static void fill(@NonNull char[], int, int, char);
- method public static void fill(@NonNull byte[], byte);
- method public static void fill(@NonNull byte[], int, int, byte);
- method public static void fill(@NonNull boolean[], boolean);
- method public static void fill(@NonNull boolean[], int, int, boolean);
- method public static void fill(@NonNull double[], double);
- method public static void fill(@NonNull double[], int, int, double);
- method public static void fill(@NonNull float[], float);
- method public static void fill(@NonNull float[], int, int, float);
- method public static void fill(@NonNull Object[], @Nullable Object);
- method public static void fill(@NonNull Object[], int, int, @Nullable Object);
- method public static int hashCode(@Nullable long[]);
- method public static int hashCode(@Nullable int[]);
- method public static int hashCode(@Nullable short[]);
- method public static int hashCode(@Nullable char[]);
- method public static int hashCode(@Nullable byte[]);
- method public static int hashCode(@Nullable boolean[]);
- method public static int hashCode(@Nullable float[]);
- method public static int hashCode(@Nullable double[]);
- method public static int hashCode(@Nullable Object[]);
- method public static <T> void parallelPrefix(@NonNull T[], @NonNull java.util.function.BinaryOperator<T>);
- method public static <T> void parallelPrefix(@NonNull T[], int, int, @NonNull java.util.function.BinaryOperator<T>);
- method public static void parallelPrefix(@NonNull long[], @NonNull java.util.function.LongBinaryOperator);
- method public static void parallelPrefix(@NonNull long[], int, int, @NonNull java.util.function.LongBinaryOperator);
- method public static void parallelPrefix(@NonNull double[], @NonNull java.util.function.DoubleBinaryOperator);
- method public static void parallelPrefix(@NonNull double[], int, int, @NonNull java.util.function.DoubleBinaryOperator);
- method public static void parallelPrefix(@NonNull int[], @NonNull java.util.function.IntBinaryOperator);
- method public static void parallelPrefix(@NonNull int[], int, int, @NonNull java.util.function.IntBinaryOperator);
- method public static <T> void parallelSetAll(@NonNull T[], @NonNull java.util.function.IntFunction<? extends T>);
- method public static void parallelSetAll(@NonNull int[], @NonNull java.util.function.IntUnaryOperator);
- method public static void parallelSetAll(@NonNull long[], @NonNull java.util.function.IntToLongFunction);
- method public static void parallelSetAll(@NonNull double[], @NonNull java.util.function.IntToDoubleFunction);
- method public static void parallelSort(@NonNull byte[]);
- method public static void parallelSort(@NonNull byte[], int, int);
- method public static void parallelSort(@NonNull char[]);
- method public static void parallelSort(@NonNull char[], int, int);
- method public static void parallelSort(@NonNull short[]);
- method public static void parallelSort(@NonNull short[], int, int);
- method public static void parallelSort(@NonNull int[]);
- method public static void parallelSort(@NonNull int[], int, int);
- method public static void parallelSort(@NonNull long[]);
- method public static void parallelSort(@NonNull long[], int, int);
- method public static void parallelSort(@NonNull float[]);
- method public static void parallelSort(@NonNull float[], int, int);
- method public static void parallelSort(@NonNull double[]);
- method public static void parallelSort(@NonNull double[], int, int);
- method public static <T extends java.lang.Comparable<? super T>> void parallelSort(@NonNull T[]);
- method public static <T extends java.lang.Comparable<? super T>> void parallelSort(@NonNull T[], int, int);
- method public static <T> void parallelSort(@NonNull T[], @Nullable java.util.Comparator<? super T>);
- method public static <T> void parallelSort(@NonNull T[], int, int, @Nullable java.util.Comparator<? super T>);
- method public static <T> void setAll(@NonNull T[], @NonNull java.util.function.IntFunction<? extends T>);
- method public static void setAll(@NonNull int[], @NonNull java.util.function.IntUnaryOperator);
- method public static void setAll(@NonNull long[], @NonNull java.util.function.IntToLongFunction);
- method public static void setAll(@NonNull double[], @NonNull java.util.function.IntToDoubleFunction);
- method public static void sort(@NonNull int[]);
- method public static void sort(@NonNull int[], int, int);
- method public static void sort(@NonNull long[]);
- method public static void sort(@NonNull long[], int, int);
- method public static void sort(@NonNull short[]);
- method public static void sort(@NonNull short[], int, int);
- method public static void sort(@NonNull char[]);
- method public static void sort(@NonNull char[], int, int);
- method public static void sort(@NonNull byte[]);
- method public static void sort(@NonNull byte[], int, int);
- method public static void sort(@NonNull float[]);
- method public static void sort(@NonNull float[], int, int);
- method public static void sort(@NonNull double[]);
- method public static void sort(@NonNull double[], int, int);
- method public static void sort(@NonNull Object[]);
- method public static void sort(@NonNull Object[], int, int);
- method public static <T> void sort(@NonNull T[], @Nullable java.util.Comparator<? super T>);
- method public static <T> void sort(@NonNull T[], int, int, @Nullable java.util.Comparator<? super T>);
- method @NonNull public static <T> java.util.Spliterator<T> spliterator(@NonNull T[]);
- method @NonNull public static <T> java.util.Spliterator<T> spliterator(@NonNull T[], int, int);
- method @NonNull public static java.util.Spliterator.OfInt spliterator(@NonNull int[]);
- method @NonNull public static java.util.Spliterator.OfInt spliterator(@NonNull int[], int, int);
- method @NonNull public static java.util.Spliterator.OfLong spliterator(@NonNull long[]);
- method @NonNull public static java.util.Spliterator.OfLong spliterator(@NonNull long[], int, int);
- method @NonNull public static java.util.Spliterator.OfDouble spliterator(@NonNull double[]);
- method @NonNull public static java.util.Spliterator.OfDouble spliterator(@NonNull double[], int, int);
- method @NonNull public static <T> java.util.stream.Stream<T> stream(@NonNull T[]);
- method @NonNull public static <T> java.util.stream.Stream<T> stream(@NonNull T[], int, int);
- method @NonNull public static java.util.stream.IntStream stream(@NonNull int[]);
- method @NonNull public static java.util.stream.IntStream stream(@NonNull int[], int, int);
- method @NonNull public static java.util.stream.LongStream stream(@NonNull long[]);
- method @NonNull public static java.util.stream.LongStream stream(@NonNull long[], int, int);
- method @NonNull public static java.util.stream.DoubleStream stream(@NonNull double[]);
- method @NonNull public static java.util.stream.DoubleStream stream(@NonNull double[], int, int);
- method @NonNull public static String toString(@Nullable long[]);
- method @NonNull public static String toString(@Nullable int[]);
- method @NonNull public static String toString(@Nullable short[]);
- method @NonNull public static String toString(@Nullable char[]);
- method @NonNull public static String toString(@Nullable byte[]);
- method @NonNull public static String toString(@Nullable boolean[]);
- method @NonNull public static String toString(@Nullable float[]);
- method @NonNull public static String toString(@Nullable double[]);
- method @NonNull public static String toString(@Nullable Object[]);
- }
-
- public class Base64 {
- method public static java.util.Base64.Decoder getDecoder();
- method public static java.util.Base64.Encoder getEncoder();
- method public static java.util.Base64.Decoder getMimeDecoder();
- method public static java.util.Base64.Encoder getMimeEncoder();
- method public static java.util.Base64.Encoder getMimeEncoder(int, byte[]);
- method public static java.util.Base64.Decoder getUrlDecoder();
- method public static java.util.Base64.Encoder getUrlEncoder();
- }
-
- public static class Base64.Decoder {
- method public byte[] decode(byte[]);
- method public byte[] decode(String);
- method public int decode(byte[], byte[]);
- method public java.nio.ByteBuffer decode(java.nio.ByteBuffer);
- method public java.io.InputStream wrap(java.io.InputStream);
- }
-
- public static class Base64.Encoder {
- method public byte[] encode(byte[]);
- method public int encode(byte[], byte[]);
- method public java.nio.ByteBuffer encode(java.nio.ByteBuffer);
- method public String encodeToString(byte[]);
- method public java.util.Base64.Encoder withoutPadding();
- method public java.io.OutputStream wrap(java.io.OutputStream);
- }
-
- public class BitSet implements java.lang.Cloneable java.io.Serializable {
- ctor public BitSet();
- ctor public BitSet(int);
- method public void and(java.util.BitSet);
- method public void andNot(java.util.BitSet);
- method public int cardinality();
- method public void clear(int);
- method public void clear(int, int);
- method public void clear();
- method public Object clone();
- method public void flip(int);
- method public void flip(int, int);
- method public boolean get(int);
- method public java.util.BitSet get(int, int);
- method public boolean intersects(java.util.BitSet);
- method public boolean isEmpty();
- method public int length();
- method public int nextClearBit(int);
- method public int nextSetBit(int);
- method public void or(java.util.BitSet);
- method public int previousClearBit(int);
- method public int previousSetBit(int);
- method public void set(int);
- method public void set(int, boolean);
- method public void set(int, int);
- method public void set(int, int, boolean);
- method public int size();
- method public java.util.stream.IntStream stream();
- method public byte[] toByteArray();
- method public long[] toLongArray();
- method public static java.util.BitSet valueOf(long[]);
- method public static java.util.BitSet valueOf(java.nio.LongBuffer);
- method public static java.util.BitSet valueOf(byte[]);
- method public static java.util.BitSet valueOf(java.nio.ByteBuffer);
- method public void xor(java.util.BitSet);
- }
-
- public abstract class Calendar implements java.lang.Cloneable java.lang.Comparable<java.util.Calendar> java.io.Serializable {
- ctor protected Calendar();
- ctor protected Calendar(@NonNull java.util.TimeZone, @NonNull java.util.Locale);
- method public abstract void add(int, int);
- method public boolean after(@Nullable Object);
- method public boolean before(@Nullable Object);
- method public final void clear();
- method public final void clear(int);
- method @NonNull public Object clone();
- method public int compareTo(@NonNull java.util.Calendar);
- method protected void complete();
- method protected abstract void computeFields();
- method protected abstract void computeTime();
- method public int get(int);
- method public int getActualMaximum(int);
- method public int getActualMinimum(int);
- method @NonNull public static java.util.Set<java.lang.String> getAvailableCalendarTypes();
- method @NonNull public static java.util.Locale[] getAvailableLocales();
- method @NonNull public String getCalendarType();
- method @Nullable public String getDisplayName(int, int, @NonNull java.util.Locale);
- method @Nullable public java.util.Map<java.lang.String,java.lang.Integer> getDisplayNames(int, int, @NonNull java.util.Locale);
- method public int getFirstDayOfWeek();
- method public abstract int getGreatestMinimum(int);
- method @NonNull public static java.util.Calendar getInstance();
- method @NonNull public static java.util.Calendar getInstance(@NonNull java.util.TimeZone);
- method @NonNull public static java.util.Calendar getInstance(@NonNull java.util.Locale);
- method @NonNull public static java.util.Calendar getInstance(@NonNull java.util.TimeZone, @NonNull java.util.Locale);
- method public abstract int getLeastMaximum(int);
- method public abstract int getMaximum(int);
- method public int getMinimalDaysInFirstWeek();
- method public abstract int getMinimum(int);
- method @NonNull public final java.util.Date getTime();
- method public long getTimeInMillis();
- method @NonNull public java.util.TimeZone getTimeZone();
- method public int getWeekYear();
- method public int getWeeksInWeekYear();
- method protected final int internalGet(int);
- method public boolean isLenient();
- method public final boolean isSet(int);
- method public boolean isWeekDateSupported();
- method public abstract void roll(int, boolean);
- method public void roll(int, int);
- method public 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 final void setTime(@NonNull java.util.Date);
- method public void setTimeInMillis(long);
- method public void setTimeZone(@NonNull java.util.TimeZone);
- method public void setWeekDate(int, int, int);
- method @NonNull public final java.time.Instant toInstant();
- field public static final int ALL_STYLES = 0; // 0x0
- 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 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 DST_OFFSET = 16; // 0x10
- field public static final int ERA = 0; // 0x0
- field public static final int FEBRUARY = 1; // 0x1
- field public static final int FIELD_COUNT = 17; // 0x11
- field public static final int FRIDAY = 6; // 0x6
- field public static final int HOUR = 10; // 0xa
- field public static final int HOUR_OF_DAY = 11; // 0xb
- field public static final int JANUARY = 0; // 0x0
- field public static final int JULY = 6; // 0x6
- field public static final int JUNE = 5; // 0x5
- field public static final int LONG = 2; // 0x2
- field public static final int LONG_FORMAT = 2; // 0x2
- field public static final int LONG_STANDALONE = 32770; // 0x8002
- field public static final int MARCH = 2; // 0x2
- field public static final int MAY = 4; // 0x4
- field public static final int MILLISECOND = 14; // 0xe
- field public static final int MINUTE = 12; // 0xc
- field public static final int MONDAY = 2; // 0x2
- field public static final int MONTH = 2; // 0x2
- field public static final int NARROW_FORMAT = 4; // 0x4
- field public static final int NARROW_STANDALONE = 32772; // 0x8004
- field public static final int NOVEMBER = 10; // 0xa
- field public static final int OCTOBER = 9; // 0x9
- field public static final int PM = 1; // 0x1
- 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 SHORT = 1; // 0x1
- field public static final int SHORT_FORMAT = 1; // 0x1
- field public static final int SHORT_STANDALONE = 32769; // 0x8001
- 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 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 ZONE_OFFSET = 15; // 0xf
- field protected boolean areFieldsSet;
- field @NonNull protected int[] fields;
- field @NonNull protected boolean[] isSet;
- field protected boolean isTimeSet;
- field protected long time;
- }
-
- public static class Calendar.Builder {
- ctor public Calendar.Builder();
- method @NonNull public java.util.Calendar build();
- method @NonNull public java.util.Calendar.Builder set(int, int);
- method @NonNull public java.util.Calendar.Builder setCalendarType(@NonNull String);
- method @NonNull public java.util.Calendar.Builder setDate(int, int, int);
- method @NonNull public java.util.Calendar.Builder setFields(@NonNull int...);
- method @NonNull public java.util.Calendar.Builder setInstant(long);
- method @NonNull public java.util.Calendar.Builder setInstant(@NonNull java.util.Date);
- method @NonNull public java.util.Calendar.Builder setLenient(boolean);
- method @NonNull public java.util.Calendar.Builder setLocale(@NonNull java.util.Locale);
- method @NonNull public java.util.Calendar.Builder setTimeOfDay(int, int, int);
- method @NonNull public java.util.Calendar.Builder setTimeOfDay(int, int, int, int);
- method @NonNull public java.util.Calendar.Builder setTimeZone(@NonNull java.util.TimeZone);
- method @NonNull public java.util.Calendar.Builder setWeekDate(int, int, int);
- method @NonNull public java.util.Calendar.Builder setWeekDefinition(int, int);
- }
-
- public interface Collection<E> extends java.lang.Iterable<E> {
- method public boolean add(E);
- method public boolean addAll(@NonNull java.util.Collection<? extends E>);
- method public void clear();
- method public boolean contains(@Nullable Object);
- method public boolean containsAll(@NonNull java.util.Collection<?>);
- method public boolean equals(@Nullable Object);
- method public int hashCode();
- method public boolean isEmpty();
- method @NonNull public java.util.Iterator<E> iterator();
- method @NonNull public default java.util.stream.Stream<E> parallelStream();
- method public boolean remove(@Nullable Object);
- method public boolean removeAll(@NonNull java.util.Collection<?>);
- method public default boolean removeIf(@NonNull java.util.function.Predicate<? super E>);
- method public boolean retainAll(@NonNull java.util.Collection<?>);
- method public int size();
- method @NonNull public default java.util.Spliterator<E> spliterator();
- method @NonNull public default java.util.stream.Stream<E> stream();
- method @NonNull public Object[] toArray();
- method @NonNull public <T> T[] toArray(@NonNull T[]);
- }
-
- public class Collections {
- method @java.lang.SafeVarargs public static <T> boolean addAll(@NonNull java.util.Collection<? super T>, @NonNull T...);
- method @NonNull public static <T> java.util.Queue<T> asLifoQueue(@NonNull java.util.Deque<T>);
- method public static <T> int binarySearch(@NonNull java.util.List<? extends java.lang.Comparable<? super T>>, @NonNull T);
- method public static <T> int binarySearch(@NonNull java.util.List<? extends T>, T, @Nullable java.util.Comparator<? super T>);
- method @NonNull public static <E> java.util.Collection<E> checkedCollection(@NonNull java.util.Collection<E>, @NonNull Class<E>);
- method @NonNull public static <E> java.util.List<E> checkedList(@NonNull java.util.List<E>, @NonNull Class<E>);
- method @NonNull public static <K, V> java.util.Map<K,V> checkedMap(@NonNull java.util.Map<K,V>, @NonNull Class<K>, @NonNull Class<V>);
- method @NonNull public static <K, V> java.util.NavigableMap<K,V> checkedNavigableMap(@NonNull java.util.NavigableMap<K,V>, @NonNull Class<K>, @NonNull Class<V>);
- method @NonNull public static <E> java.util.NavigableSet<E> checkedNavigableSet(@NonNull java.util.NavigableSet<E>, @NonNull Class<E>);
- method @NonNull public static <E> java.util.Queue<E> checkedQueue(@NonNull java.util.Queue<E>, @NonNull Class<E>);
- method @NonNull public static <E> java.util.Set<E> checkedSet(@NonNull java.util.Set<E>, @NonNull Class<E>);
- method @NonNull public static <K, V> java.util.SortedMap<K,V> checkedSortedMap(@NonNull java.util.SortedMap<K,V>, @NonNull Class<K>, @NonNull Class<V>);
- method @NonNull public static <E> java.util.SortedSet<E> checkedSortedSet(@NonNull java.util.SortedSet<E>, @NonNull Class<E>);
- method public static <T> void copy(@NonNull java.util.List<? super T>, @NonNull java.util.List<? extends T>);
- method public static boolean disjoint(@NonNull java.util.Collection<?>, @NonNull java.util.Collection<?>);
- method @NonNull public static <T> java.util.Enumeration<T> emptyEnumeration();
- method @NonNull public static <T> java.util.Iterator<T> emptyIterator();
- method @NonNull public static final <T> java.util.List<T> emptyList();
- method @NonNull public static <T> java.util.ListIterator<T> emptyListIterator();
- method @NonNull public static final <K, V> java.util.Map<K,V> emptyMap();
- method @NonNull public static final <K, V> java.util.NavigableMap<K,V> emptyNavigableMap();
- method @NonNull public static <E> java.util.NavigableSet<E> emptyNavigableSet();
- method @NonNull public static final <T> java.util.Set<T> emptySet();
- method @NonNull public static final <K, V> java.util.SortedMap<K,V> emptySortedMap();
- method @NonNull public static <E> java.util.SortedSet<E> emptySortedSet();
- method @NonNull public static <T> java.util.Enumeration<T> enumeration(@NonNull java.util.Collection<T>);
- method public static <T> void fill(@NonNull java.util.List<? super T>, T);
- method public static int frequency(@NonNull java.util.Collection<?>, @Nullable Object);
- method public static int indexOfSubList(@NonNull java.util.List<?>, @NonNull java.util.List<?>);
- method public static int lastIndexOfSubList(@NonNull java.util.List<?>, @NonNull java.util.List<?>);
- method @NonNull public static <T> java.util.ArrayList<T> list(@NonNull java.util.Enumeration<T>);
- method @NonNull public static <T extends java.lang.Object & java.lang.Comparable<? super T>> T max(@NonNull java.util.Collection<? extends T>);
- method public static <T> T max(@NonNull java.util.Collection<? extends T>, @Nullable java.util.Comparator<? super T>);
- method @NonNull public static <T extends java.lang.Object & java.lang.Comparable<? super T>> T min(@NonNull java.util.Collection<? extends T>);
- method public static <T> T min(@NonNull java.util.Collection<? extends T>, @Nullable java.util.Comparator<? super T>);
- method @NonNull public static <T> java.util.List<T> nCopies(int, T);
- method @NonNull public static <E> java.util.Set<E> newSetFromMap(@NonNull java.util.Map<E,java.lang.Boolean>);
- method public static <T> boolean replaceAll(@NonNull java.util.List<T>, T, T);
- method public static void reverse(@NonNull java.util.List<?>);
- method @NonNull public static <T> java.util.Comparator<T> reverseOrder();
- method @NonNull public static <T> java.util.Comparator<T> reverseOrder(@Nullable java.util.Comparator<T>);
- method public static void rotate(@NonNull java.util.List<?>, int);
- method public static void shuffle(@NonNull java.util.List<?>);
- method public static void shuffle(@NonNull java.util.List<?>, @NonNull java.util.Random);
- method @NonNull public static <T> java.util.Set<T> singleton(T);
- method @NonNull public static <T> java.util.List<T> singletonList(T);
- method @NonNull public static <K, V> java.util.Map<K,V> singletonMap(K, V);
- method public static <T extends java.lang.Comparable<? super T>> void sort(@NonNull java.util.List<T>);
- method public static <T> void sort(@NonNull java.util.List<T>, @Nullable java.util.Comparator<? super T>);
- method public static void swap(@NonNull java.util.List<?>, int, int);
- method @NonNull public static <T> java.util.Collection<T> synchronizedCollection(@NonNull java.util.Collection<T>);
- method @NonNull public static <T> java.util.List<T> synchronizedList(@NonNull java.util.List<T>);
- method @NonNull public static <K, V> java.util.Map<K,V> synchronizedMap(@NonNull java.util.Map<K,V>);
- method @NonNull public static <K, V> java.util.NavigableMap<K,V> synchronizedNavigableMap(@NonNull java.util.NavigableMap<K,V>);
- method @NonNull public static <T> java.util.NavigableSet<T> synchronizedNavigableSet(@NonNull java.util.NavigableSet<T>);
- method @NonNull public static <T> java.util.Set<T> synchronizedSet(@NonNull java.util.Set<T>);
- method @NonNull public static <K, V> java.util.SortedMap<K,V> synchronizedSortedMap(@NonNull java.util.SortedMap<K,V>);
- method @NonNull public static <T> java.util.SortedSet<T> synchronizedSortedSet(@NonNull java.util.SortedSet<T>);
- method @NonNull public static <T> java.util.Collection<T> unmodifiableCollection(@NonNull java.util.Collection<? extends T>);
- method @NonNull public static <T> java.util.List<T> unmodifiableList(@NonNull java.util.List<? extends T>);
- method @NonNull public static <K, V> java.util.Map<K,V> unmodifiableMap(@NonNull java.util.Map<? extends K,? extends V>);
- method @NonNull public static <K, V> java.util.NavigableMap<K,V> unmodifiableNavigableMap(@NonNull java.util.NavigableMap<K,? extends V>);
- method @NonNull public static <T> java.util.NavigableSet<T> unmodifiableNavigableSet(@NonNull java.util.NavigableSet<T>);
- method @NonNull public static <T> java.util.Set<T> unmodifiableSet(@NonNull java.util.Set<? extends T>);
- method @NonNull public static <K, V> java.util.SortedMap<K,V> unmodifiableSortedMap(@NonNull java.util.SortedMap<K,? extends V>);
- method @NonNull public static <T> java.util.SortedSet<T> unmodifiableSortedSet(@NonNull java.util.SortedSet<T>);
- field @NonNull public static final java.util.List EMPTY_LIST;
- field @NonNull public static final java.util.Map EMPTY_MAP;
- field @NonNull public static final java.util.Set EMPTY_SET;
- }
-
- @java.lang.FunctionalInterface public interface Comparator<T> {
- method public int compare(T, T);
- method public static <T, U> java.util.Comparator<T> comparing(java.util.function.Function<? super T,? extends U>, java.util.Comparator<? super U>);
- method public static <T, U extends java.lang.Comparable<? super U>> java.util.Comparator<T> comparing(java.util.function.Function<? super T,? extends U>);
- method public static <T> java.util.Comparator<T> comparingDouble(java.util.function.ToDoubleFunction<? super T>);
- method public static <T> java.util.Comparator<T> comparingInt(java.util.function.ToIntFunction<? super T>);
- method public static <T> java.util.Comparator<T> comparingLong(java.util.function.ToLongFunction<? super T>);
- method public boolean equals(Object);
- method public static <T extends java.lang.Comparable<? super T>> java.util.Comparator<T> naturalOrder();
- method public static <T> java.util.Comparator<T> nullsFirst(java.util.Comparator<? super T>);
- method public static <T> java.util.Comparator<T> nullsLast(java.util.Comparator<? super T>);
- method public static <T extends java.lang.Comparable<? super T>> java.util.Comparator<T> reverseOrder();
- method public default java.util.Comparator<T> reversed();
- method public default java.util.Comparator<T> thenComparing(java.util.Comparator<? super T>);
- method public default <U> java.util.Comparator<T> thenComparing(java.util.function.Function<? super T,? extends U>, java.util.Comparator<? super U>);
- method public default <U extends java.lang.Comparable<? super U>> java.util.Comparator<T> thenComparing(java.util.function.Function<? super T,? extends U>);
- method public default java.util.Comparator<T> thenComparingDouble(java.util.function.ToDoubleFunction<? super T>);
- method public default java.util.Comparator<T> thenComparingInt(java.util.function.ToIntFunction<? super T>);
- method public default java.util.Comparator<T> thenComparingLong(java.util.function.ToLongFunction<? super T>);
- }
-
- public class ConcurrentModificationException extends java.lang.RuntimeException {
- ctor public ConcurrentModificationException();
- ctor public ConcurrentModificationException(String);
- ctor public ConcurrentModificationException(Throwable);
- ctor public ConcurrentModificationException(String, Throwable);
- }
-
- public final class Currency implements java.io.Serializable {
- method public static java.util.Set<java.util.Currency> getAvailableCurrencies();
- method public String getCurrencyCode();
- method public int getDefaultFractionDigits();
- method public String getDisplayName();
- method public String getDisplayName(java.util.Locale);
- method public static java.util.Currency getInstance(String);
- method public static java.util.Currency getInstance(java.util.Locale);
- method public int getNumericCode();
- method public String getSymbol();
- method public String getSymbol(java.util.Locale);
- }
-
- public class Date implements java.lang.Cloneable java.lang.Comparable<java.util.Date> java.io.Serializable {
- ctor public Date();
- ctor public Date(long);
- ctor @Deprecated public Date(int, int, int);
- ctor @Deprecated public Date(int, int, int, int, int);
- ctor @Deprecated public Date(int, int, int, int, int, int);
- ctor @Deprecated public Date(String);
- method @Deprecated public static long UTC(int, int, int, int, int, int);
- method public boolean after(java.util.Date);
- method public boolean before(java.util.Date);
- method public Object clone();
- method public int compareTo(java.util.Date);
- method public static java.util.Date from(java.time.Instant);
- method @Deprecated public int getDate();
- method @Deprecated public int getDay();
- method @Deprecated public int getHours();
- method @Deprecated public int getMinutes();
- method @Deprecated public int getMonth();
- method @Deprecated public int getSeconds();
- method public long getTime();
- method @Deprecated public int getTimezoneOffset();
- method @Deprecated public int getYear();
- method @Deprecated public static long parse(String);
- method @Deprecated public void setDate(int);
- method @Deprecated public void setHours(int);
- method @Deprecated public void setMinutes(int);
- method @Deprecated public void setMonth(int);
- method @Deprecated public void setSeconds(int);
- method public void setTime(long);
- method @Deprecated public void setYear(int);
- method @Deprecated public String toGMTString();
- method public java.time.Instant toInstant();
- method @Deprecated public String toLocaleString();
- }
-
- public interface Deque<E> extends java.util.Queue<E> {
- method public void addFirst(E);
- method public void addLast(E);
- method @NonNull public java.util.Iterator<E> descendingIterator();
- method public E getFirst();
- method public E getLast();
- method public boolean offerFirst(E);
- method public boolean offerLast(E);
- method @Nullable public E peekFirst();
- method @Nullable public E peekLast();
- method @Nullable public E pollFirst();
- method @Nullable public E pollLast();
- method public E pop();
- method public void push(E);
- method public E removeFirst();
- method public boolean removeFirstOccurrence(@Nullable Object);
- method public E removeLast();
- method public boolean removeLastOccurrence(@Nullable Object);
- }
-
- public abstract class Dictionary<K, V> {
- ctor public Dictionary();
- method public abstract java.util.Enumeration<V> elements();
- method public abstract V get(Object);
- method public abstract boolean isEmpty();
- method public abstract java.util.Enumeration<K> keys();
- method public abstract V put(K, V);
- method public abstract V remove(Object);
- method public abstract int size();
- }
-
- public class DoubleSummaryStatistics implements java.util.function.DoubleConsumer {
- ctor public DoubleSummaryStatistics();
- method public void accept(double);
- method public void combine(java.util.DoubleSummaryStatistics);
- method public final double getAverage();
- method public final long getCount();
- method public final double getMax();
- method public final double getMin();
- method public final double getSum();
- }
-
- public class DuplicateFormatFlagsException extends java.util.IllegalFormatException {
- ctor public DuplicateFormatFlagsException(String);
- method public String getFlags();
- }
-
- public class EmptyStackException extends java.lang.RuntimeException {
- ctor public EmptyStackException();
- }
-
- public class EnumMap<K extends java.lang.Enum<K>, V> extends java.util.AbstractMap<K,V> implements java.lang.Cloneable java.io.Serializable {
- ctor public EnumMap(Class<K>);
- ctor public EnumMap(java.util.EnumMap<K,? extends V>);
- ctor public EnumMap(java.util.Map<K,? extends V>);
- method public java.util.EnumMap<K,V> clone();
- method public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
- }
-
- public abstract class EnumSet<E extends java.lang.Enum<E>> extends java.util.AbstractSet<E> implements java.lang.Cloneable java.io.Serializable {
- method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> allOf(Class<E>);
- method public java.util.EnumSet<E> clone();
- method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> complementOf(java.util.EnumSet<E>);
- method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> copyOf(java.util.EnumSet<E>);
- method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> copyOf(java.util.Collection<E>);
- method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> noneOf(Class<E>);
- method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> of(E);
- method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> of(E, E);
- method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> of(E, E, E);
- method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> of(E, E, E, E);
- method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> of(E, E, E, E, E);
- method @java.lang.SafeVarargs public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> of(E, E...);
- method public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> range(E, E);
- }
-
- public interface Enumeration<E> {
- method public boolean hasMoreElements();
- method public E nextElement();
- }
-
- public interface EventListener {
- }
-
- public abstract class EventListenerProxy<T extends java.util.EventListener> implements java.util.EventListener {
- ctor public EventListenerProxy(T);
- method public T getListener();
- }
-
- public class EventObject implements java.io.Serializable {
- ctor public EventObject(Object);
- method public Object getSource();
- field protected transient Object source;
- }
-
- public class FormatFlagsConversionMismatchException extends java.util.IllegalFormatException {
- ctor public FormatFlagsConversionMismatchException(String, char);
- method public char getConversion();
- method public String getFlags();
- }
-
- public interface Formattable {
- method public void formatTo(java.util.Formatter, int, int, int);
- }
-
- public class FormattableFlags {
- field public static final int ALTERNATE = 4; // 0x4
- field public static final int LEFT_JUSTIFY = 1; // 0x1
- field public static final int UPPERCASE = 2; // 0x2
- }
-
- public final class Formatter implements java.io.Closeable java.io.Flushable {
- ctor public Formatter();
- ctor public Formatter(Appendable);
- ctor public Formatter(java.util.Locale);
- ctor public Formatter(Appendable, java.util.Locale);
- ctor public Formatter(String) throws java.io.FileNotFoundException;
- ctor public Formatter(String, String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
- ctor public Formatter(String, String, java.util.Locale) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
- ctor public Formatter(java.io.File) throws java.io.FileNotFoundException;
- ctor public Formatter(java.io.File, String) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
- ctor public Formatter(java.io.File, String, java.util.Locale) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException;
- ctor public Formatter(java.io.PrintStream);
- ctor public Formatter(java.io.OutputStream);
- ctor public Formatter(java.io.OutputStream, String) throws java.io.UnsupportedEncodingException;
- ctor public Formatter(java.io.OutputStream, String, java.util.Locale) throws java.io.UnsupportedEncodingException;
- method public void close();
- method public void flush();
- method public java.util.Formatter format(String, java.lang.Object...);
- method public java.util.Formatter format(java.util.Locale, String, java.lang.Object...);
- method public java.io.IOException ioException();
- method public java.util.Locale locale();
- method public Appendable out();
- }
-
- public enum Formatter.BigDecimalLayoutForm {
- enum_constant public static final java.util.Formatter.BigDecimalLayoutForm DECIMAL_FLOAT;
- enum_constant public static final java.util.Formatter.BigDecimalLayoutForm SCIENTIFIC;
- }
-
- public class FormatterClosedException extends java.lang.IllegalStateException {
- ctor public FormatterClosedException();
- }
-
- public class GregorianCalendar extends java.util.Calendar {
- ctor public GregorianCalendar();
- ctor public GregorianCalendar(java.util.TimeZone);
- ctor public GregorianCalendar(java.util.Locale);
- ctor public GregorianCalendar(java.util.TimeZone, java.util.Locale);
- 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 void add(int, int);
- method protected void computeFields();
- method protected void computeTime();
- method public static java.util.GregorianCalendar from(java.time.ZonedDateTime);
- method public int getGreatestMinimum(int);
- method public final java.util.Date getGregorianChange();
- method public int getLeastMaximum(int);
- method public int getMaximum(int);
- method public int getMinimum(int);
- method public boolean isLeapYear(int);
- method public final boolean isWeekDateSupported();
- method public void roll(int, boolean);
- method public void setGregorianChange(java.util.Date);
- method public java.time.ZonedDateTime toZonedDateTime();
- field public static final int AD = 1; // 0x1
- field public static final int BC = 0; // 0x0
- }
-
- public class HashMap<K, V> extends java.util.AbstractMap<K,V> implements java.lang.Cloneable java.util.Map<K,V> java.io.Serializable {
- ctor public HashMap(int, float);
- ctor public HashMap(int);
- ctor public HashMap();
- ctor public HashMap(@NonNull java.util.Map<? extends K,? extends V>);
- method @NonNull public Object clone();
- method @NonNull public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
- }
-
- public class HashSet<E> extends java.util.AbstractSet<E> implements java.lang.Cloneable java.io.Serializable java.util.Set<E> {
- ctor public HashSet();
- ctor public HashSet(@NonNull java.util.Collection<? extends E>);
- ctor public HashSet(int, float);
- ctor public HashSet(int);
- method @NonNull public Object clone();
- method @NonNull public java.util.Iterator<E> iterator();
- method public int size();
- }
-
- public class Hashtable<K, V> extends java.util.Dictionary<K,V> implements java.lang.Cloneable java.util.Map<K,V> java.io.Serializable {
- ctor public Hashtable(int, float);
- ctor public Hashtable(int);
- ctor public Hashtable();
- ctor public Hashtable(java.util.Map<? extends K,? extends V>);
- method public void clear();
- method public Object clone();
- method public boolean contains(Object);
- method public boolean containsKey(Object);
- method public boolean containsValue(Object);
- method public java.util.Enumeration<V> elements();
- method public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
- method public V get(Object);
- method public boolean isEmpty();
- method public java.util.Set<K> keySet();
- method public java.util.Enumeration<K> keys();
- method public V put(K, V);
- method public void putAll(java.util.Map<? extends K,? extends V>);
- method protected void rehash();
- method public V remove(Object);
- method public int size();
- method public java.util.Collection<V> values();
- }
-
- public class IdentityHashMap<K, V> extends java.util.AbstractMap<K,V> implements java.lang.Cloneable java.util.Map<K,V> java.io.Serializable {
- ctor public IdentityHashMap();
- ctor public IdentityHashMap(int);
- ctor public IdentityHashMap(java.util.Map<? extends K,? extends V>);
- method public Object clone();
- method public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
- }
-
- public class IllegalFormatCodePointException extends java.util.IllegalFormatException {
- ctor public IllegalFormatCodePointException(int);
- method public int getCodePoint();
- }
-
- public class IllegalFormatConversionException extends java.util.IllegalFormatException {
- ctor public IllegalFormatConversionException(char, Class<?>);
- method public Class<?> getArgumentClass();
- method public char getConversion();
- }
-
- public class IllegalFormatException extends java.lang.IllegalArgumentException {
- }
-
- public class IllegalFormatFlagsException extends java.util.IllegalFormatException {
- ctor public IllegalFormatFlagsException(String);
- method public String getFlags();
- }
-
- public class IllegalFormatPrecisionException extends java.util.IllegalFormatException {
- ctor public IllegalFormatPrecisionException(int);
- method public int getPrecision();
- }
-
- public class IllegalFormatWidthException extends java.util.IllegalFormatException {
- ctor public IllegalFormatWidthException(int);
- method public int getWidth();
- }
-
- 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 InputMismatchException extends java.util.NoSuchElementException {
- ctor public InputMismatchException();
- ctor public InputMismatchException(String);
- }
-
- public class IntSummaryStatistics implements java.util.function.IntConsumer {
- ctor public IntSummaryStatistics();
- method public void accept(int);
- method public void combine(java.util.IntSummaryStatistics);
- method public final double getAverage();
- method public final long getCount();
- method public final int getMax();
- method public final int getMin();
- method public final long getSum();
- }
-
- public class InvalidPropertiesFormatException extends java.io.IOException {
- ctor public InvalidPropertiesFormatException(Throwable);
- ctor public InvalidPropertiesFormatException(String);
- }
-
- public interface Iterator<E> {
- method public default void forEachRemaining(@NonNull java.util.function.Consumer<? super E>);
- method public boolean hasNext();
- method public E next();
- method public default void remove();
- }
-
- public class LinkedHashMap<K, V> extends java.util.HashMap<K,V> implements java.util.Map<K,V> {
- ctor public LinkedHashMap(int, float);
- ctor public LinkedHashMap(int);
- ctor public LinkedHashMap();
- ctor public LinkedHashMap(java.util.Map<? extends K,? extends V>);
- ctor public LinkedHashMap(int, float, boolean);
- method protected boolean removeEldestEntry(java.util.Map.Entry<K,V>);
- }
-
- public class LinkedHashSet<E> extends java.util.HashSet<E> implements java.lang.Cloneable java.io.Serializable java.util.Set<E> {
- ctor public LinkedHashSet(int, float);
- ctor public LinkedHashSet(int);
- ctor public LinkedHashSet();
- ctor public LinkedHashSet(java.util.Collection<? extends E>);
- }
-
- public class LinkedList<E> extends java.util.AbstractSequentialList<E> implements java.lang.Cloneable java.util.Deque<E> java.util.List<E> java.io.Serializable {
- ctor public LinkedList();
- ctor public LinkedList(@NonNull java.util.Collection<? extends E>);
- method public void addFirst(E);
- method public void addLast(E);
- method @NonNull public Object clone();
- method @NonNull public java.util.Iterator<E> descendingIterator();
- method public E element();
- method public E getFirst();
- method public E getLast();
- method public boolean offer(E);
- method public boolean offerFirst(E);
- method public boolean offerLast(E);
- method @Nullable public E peek();
- method @Nullable public E peekFirst();
- method @Nullable public E peekLast();
- method @Nullable public E poll();
- method @Nullable public E pollFirst();
- method @Nullable public E pollLast();
- method public E pop();
- method public void push(E);
- method public E remove();
- method public E removeFirst();
- method public boolean removeFirstOccurrence(@Nullable Object);
- method public E removeLast();
- method public boolean removeLastOccurrence(@Nullable Object);
- method public int size();
- }
-
- public interface List<E> extends java.util.Collection<E> {
- method public void add(int, E);
- method public boolean addAll(int, @NonNull java.util.Collection<? extends E>);
- method public E get(int);
- method public int indexOf(@Nullable Object);
- method public int lastIndexOf(@Nullable Object);
- method @NonNull public java.util.ListIterator<E> listIterator();
- method @NonNull public java.util.ListIterator<E> listIterator(int);
- method @NonNull public static <E> java.util.List<E> of();
- method @NonNull public static <E> java.util.List<E> of(@NonNull E);
- method @NonNull public static <E> java.util.List<E> of(@NonNull E, @NonNull E);
- method @NonNull public static <E> java.util.List<E> of(@NonNull E, @NonNull E, @NonNull E);
- method @NonNull public static <E> java.util.List<E> of(@NonNull E, @NonNull E, @NonNull E, @NonNull E);
- method @NonNull public static <E> java.util.List<E> of(@NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E);
- method @NonNull public static <E> java.util.List<E> of(@NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E);
- method @NonNull public static <E> java.util.List<E> of(@NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E);
- method @NonNull public static <E> java.util.List<E> of(@NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E);
- method @NonNull public static <E> java.util.List<E> of(@NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E);
- method @NonNull public static <E> java.util.List<E> of(@NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E);
- method @NonNull @java.lang.SafeVarargs public static <E> java.util.List<E> of(@NonNull E...);
- method public E remove(int);
- method public default void replaceAll(@NonNull java.util.function.UnaryOperator<E>);
- method public E set(int, E);
- method public default void sort(@Nullable java.util.Comparator<? super E>);
- method @NonNull public java.util.List<E> subList(int, int);
- }
-
- public interface ListIterator<E> extends java.util.Iterator<E> {
- method public void add(E);
- method public boolean hasPrevious();
- method public int nextIndex();
- method public E previous();
- method public int previousIndex();
- method public void remove();
- method public void set(E);
- }
-
- public abstract class ListResourceBundle extends java.util.ResourceBundle {
- ctor public ListResourceBundle();
- method protected abstract Object[][] getContents();
- method public java.util.Enumeration<java.lang.String> getKeys();
- method public final Object handleGetObject(String);
- }
-
- public final class Locale implements java.lang.Cloneable java.io.Serializable {
- ctor public Locale(@NonNull String, @NonNull String, @NonNull String);
- ctor public Locale(@NonNull String, @NonNull String);
- ctor public Locale(@NonNull String);
- method @NonNull public Object clone();
- method @NonNull public static java.util.List<java.util.Locale> filter(@NonNull java.util.List<java.util.Locale.LanguageRange>, @NonNull java.util.Collection<java.util.Locale>, @NonNull java.util.Locale.FilteringMode);
- method @NonNull public static java.util.List<java.util.Locale> filter(@NonNull java.util.List<java.util.Locale.LanguageRange>, @NonNull java.util.Collection<java.util.Locale>);
- method @NonNull public static java.util.List<java.lang.String> filterTags(@NonNull java.util.List<java.util.Locale.LanguageRange>, @NonNull java.util.Collection<java.lang.String>, @NonNull java.util.Locale.FilteringMode);
- method @NonNull public static java.util.List<java.lang.String> filterTags(@NonNull java.util.List<java.util.Locale.LanguageRange>, @NonNull java.util.Collection<java.lang.String>);
- method @NonNull public static java.util.Locale forLanguageTag(@NonNull String);
- method @NonNull public static java.util.Locale[] getAvailableLocales();
- method @NonNull public String getCountry();
- method @NonNull public static java.util.Locale getDefault();
- method @NonNull public static java.util.Locale getDefault(@NonNull java.util.Locale.Category);
- method @NonNull public String getDisplayCountry();
- method @NonNull public String getDisplayCountry(@NonNull java.util.Locale);
- method @NonNull public String getDisplayLanguage();
- method @NonNull public String getDisplayLanguage(@NonNull java.util.Locale);
- method @NonNull public String getDisplayName();
- method @NonNull public String getDisplayName(@NonNull java.util.Locale);
- method @NonNull public String getDisplayScript();
- method @NonNull public String getDisplayScript(@NonNull java.util.Locale);
- method @NonNull public String getDisplayVariant();
- method @NonNull public String getDisplayVariant(@NonNull java.util.Locale);
- method @Nullable public String getExtension(char);
- method @NonNull public java.util.Set<java.lang.Character> getExtensionKeys();
- method @NonNull public String getISO3Country() throws java.util.MissingResourceException;
- method @NonNull public String getISO3Language() throws java.util.MissingResourceException;
- method @NonNull public static String[] getISOCountries();
- method @NonNull public static String[] getISOLanguages();
- method @NonNull public String getLanguage();
- method @NonNull public String getScript();
- method @NonNull public java.util.Set<java.lang.String> getUnicodeLocaleAttributes();
- method @NonNull public java.util.Set<java.lang.String> getUnicodeLocaleKeys();
- method @Nullable public String getUnicodeLocaleType(@NonNull String);
- method @NonNull public String getVariant();
- method public boolean hasExtensions();
- method @Nullable public static java.util.Locale lookup(@NonNull java.util.List<java.util.Locale.LanguageRange>, @NonNull java.util.Collection<java.util.Locale>);
- method @Nullable public static String lookupTag(@NonNull java.util.List<java.util.Locale.LanguageRange>, @NonNull java.util.Collection<java.lang.String>);
- method public static void setDefault(@NonNull java.util.Locale);
- method public static void setDefault(@NonNull java.util.Locale.Category, @NonNull java.util.Locale);
- method @NonNull public java.util.Locale stripExtensions();
- method @NonNull public String toLanguageTag();
- field @NonNull public static final java.util.Locale CANADA;
- field @NonNull public static final java.util.Locale CANADA_FRENCH;
- field @NonNull public static final java.util.Locale CHINA;
- field @NonNull public static final java.util.Locale CHINESE;
- field @NonNull public static final java.util.Locale ENGLISH;
- field @NonNull public static final java.util.Locale FRANCE;
- field @NonNull public static final java.util.Locale FRENCH;
- field @NonNull public static final java.util.Locale GERMAN;
- field @NonNull public static final java.util.Locale GERMANY;
- field @NonNull public static final java.util.Locale ITALIAN;
- field @NonNull public static final java.util.Locale ITALY;
- field @NonNull public static final java.util.Locale JAPAN;
- field @NonNull public static final java.util.Locale JAPANESE;
- field @NonNull public static final java.util.Locale KOREA;
- field @NonNull public static final java.util.Locale KOREAN;
- field @NonNull public static final java.util.Locale PRC;
- field public static final char PRIVATE_USE_EXTENSION = 120; // 0x0078 'x'
- field @NonNull public static final java.util.Locale ROOT;
- field @NonNull public static final java.util.Locale SIMPLIFIED_CHINESE;
- field @NonNull public static final java.util.Locale TAIWAN;
- field @NonNull public static final java.util.Locale TRADITIONAL_CHINESE;
- field @NonNull public static final java.util.Locale UK;
- field public static final char UNICODE_LOCALE_EXTENSION = 117; // 0x0075 'u'
- field @NonNull public static final java.util.Locale US;
- }
-
- public static final class Locale.Builder {
- ctor public Locale.Builder();
- method @NonNull public java.util.Locale.Builder addUnicodeLocaleAttribute(@NonNull String);
- method @NonNull public java.util.Locale build();
- method @NonNull public java.util.Locale.Builder clear();
- method @NonNull public java.util.Locale.Builder clearExtensions();
- method @NonNull public java.util.Locale.Builder removeUnicodeLocaleAttribute(@NonNull String);
- method @NonNull public java.util.Locale.Builder setExtension(char, @Nullable String);
- method @NonNull public java.util.Locale.Builder setLanguage(@Nullable String);
- method @NonNull public java.util.Locale.Builder setLanguageTag(@NonNull String);
- method @NonNull public java.util.Locale.Builder setLocale(@NonNull java.util.Locale);
- method @NonNull public java.util.Locale.Builder setRegion(@Nullable String);
- method @NonNull public java.util.Locale.Builder setScript(@Nullable String);
- method @NonNull public java.util.Locale.Builder setUnicodeLocaleKeyword(@NonNull String, @Nullable String);
- method @NonNull public java.util.Locale.Builder setVariant(@Nullable String);
- }
-
- public enum Locale.Category {
- enum_constant public static final java.util.Locale.Category DISPLAY;
- enum_constant public static final java.util.Locale.Category FORMAT;
- }
-
- public enum Locale.FilteringMode {
- enum_constant public static final java.util.Locale.FilteringMode AUTOSELECT_FILTERING;
- enum_constant public static final java.util.Locale.FilteringMode EXTENDED_FILTERING;
- enum_constant public static final java.util.Locale.FilteringMode IGNORE_EXTENDED_RANGES;
- enum_constant public static final java.util.Locale.FilteringMode MAP_EXTENDED_RANGES;
- enum_constant public static final java.util.Locale.FilteringMode REJECT_EXTENDED_RANGES;
- }
-
- public static final class Locale.LanguageRange {
- ctor public Locale.LanguageRange(@NonNull String);
- ctor public Locale.LanguageRange(@NonNull String, double);
- method @NonNull public String getRange();
- method public double getWeight();
- method @NonNull public static java.util.List<java.util.Locale.LanguageRange> mapEquivalents(@NonNull java.util.List<java.util.Locale.LanguageRange>, @NonNull java.util.Map<java.lang.String,java.util.List<java.lang.String>>);
- method @NonNull public static java.util.List<java.util.Locale.LanguageRange> parse(@NonNull String);
- method @NonNull public static java.util.List<java.util.Locale.LanguageRange> parse(@NonNull String, @NonNull java.util.Map<java.lang.String,java.util.List<java.lang.String>>);
- field public static final double MAX_WEIGHT = 1.0;
- field public static final double MIN_WEIGHT = 0.0;
- }
-
- public class LongSummaryStatistics implements java.util.function.IntConsumer java.util.function.LongConsumer {
- ctor public LongSummaryStatistics();
- method public void accept(int);
- method public void accept(long);
- method public void combine(java.util.LongSummaryStatistics);
- method public final double getAverage();
- method public final long getCount();
- method public final long getMax();
- method public final long getMin();
- method public final long getSum();
- }
-
- public interface Map<K, V> {
- method public void clear();
- method @Nullable public default V compute(K, @NonNull java.util.function.BiFunction<? super K,? super V,? extends V>);
- method @Nullable public default V computeIfAbsent(K, @NonNull java.util.function.Function<? super K,? extends V>);
- method @Nullable public default V computeIfPresent(K, @NonNull java.util.function.BiFunction<? super K,? super V,? extends V>);
- method public boolean containsKey(@Nullable Object);
- method public boolean containsValue(@Nullable Object);
- method @NonNull public static <K, V> java.util.Map.Entry<K,V> entry(@NonNull K, @NonNull V);
- method @NonNull public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
- method public boolean equals(@Nullable Object);
- method public default void forEach(@NonNull java.util.function.BiConsumer<? super K,? super V>);
- method @Nullable public V get(@Nullable Object);
- method @Nullable public default V getOrDefault(@Nullable Object, @Nullable V);
- method public int hashCode();
- method public boolean isEmpty();
- method @NonNull public java.util.Set<K> keySet();
- method @Nullable public default V merge(K, @NonNull V, @NonNull java.util.function.BiFunction<? super V,? super V,? extends V>);
- method @NonNull public static <K, V> java.util.Map<K,V> of();
- method @NonNull public static <K, V> java.util.Map<K,V> of(@NonNull K, @NonNull V);
- method @NonNull public static <K, V> java.util.Map<K,V> of(@NonNull K, @NonNull V, @NonNull K, @NonNull V);
- method @NonNull public static <K, V> java.util.Map<K,V> of(@NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V);
- method @NonNull public static <K, V> java.util.Map<K,V> of(@NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V);
- method @NonNull public static <K, V> java.util.Map<K,V> of(@NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V);
- method @NonNull public static <K, V> java.util.Map<K,V> of(@NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V);
- method @NonNull public static <K, V> java.util.Map<K,V> of(@NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V);
- method @NonNull public static <K, V> java.util.Map<K,V> of(@NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V);
- method @NonNull public static <K, V> java.util.Map<K,V> of(@NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V);
- method @NonNull public static <K, V> java.util.Map<K,V> of(@NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V, @NonNull K, @NonNull V);
- method @NonNull @java.lang.SafeVarargs public static <K, V> java.util.Map<K,V> ofEntries(@NonNull java.util.Map.Entry<? extends K,? extends V>...);
- method @Nullable public V put(K, V);
- method public void putAll(@NonNull java.util.Map<? extends K,? extends V>);
- method @Nullable public default V putIfAbsent(K, V);
- method @Nullable public V remove(@Nullable Object);
- method public default boolean remove(@Nullable Object, @Nullable Object);
- method public default boolean replace(K, @Nullable V, V);
- method @Nullable public default V replace(K, V);
- method public default void replaceAll(@NonNull java.util.function.BiFunction<? super K,? super V,? extends V>);
- method public int size();
- method @NonNull public java.util.Collection<V> values();
- }
-
- public static interface Map.Entry<K, V> {
- method @NonNull public static <K extends java.lang.Comparable<? super K>, V> java.util.Comparator<java.util.Map.Entry<K,V>> comparingByKey();
- method @NonNull public static <K, V> java.util.Comparator<java.util.Map.Entry<K,V>> comparingByKey(@NonNull java.util.Comparator<? super K>);
- method @NonNull public static <K, V extends java.lang.Comparable<? super V>> java.util.Comparator<java.util.Map.Entry<K,V>> comparingByValue();
- method @NonNull public static <K, V> java.util.Comparator<java.util.Map.Entry<K,V>> comparingByValue(@NonNull java.util.Comparator<? super V>);
- method public boolean equals(@Nullable Object);
- method public K getKey();
- method public V getValue();
- method public int hashCode();
- method public V setValue(V);
- }
-
- public class MissingFormatArgumentException extends java.util.IllegalFormatException {
- ctor public MissingFormatArgumentException(String);
- method public String getFormatSpecifier();
- }
-
- public class MissingFormatWidthException extends java.util.IllegalFormatException {
- ctor public MissingFormatWidthException(String);
- method public String getFormatSpecifier();
- }
-
- public class MissingResourceException extends java.lang.RuntimeException {
- ctor public MissingResourceException(String, String, String);
- method public String getClassName();
- method public String getKey();
- }
-
- public interface NavigableMap<K, V> extends java.util.SortedMap<K,V> {
- method @Nullable public java.util.Map.Entry<K,V> ceilingEntry(K);
- method @Nullable public K ceilingKey(K);
- method @NonNull public java.util.NavigableSet<K> descendingKeySet();
- method @NonNull public java.util.NavigableMap<K,V> descendingMap();
- method @Nullable public java.util.Map.Entry<K,V> firstEntry();
- method @Nullable public java.util.Map.Entry<K,V> floorEntry(K);
- method @Nullable public K floorKey(K);
- method @NonNull public java.util.NavigableMap<K,V> headMap(K, boolean);
- method @Nullable public java.util.Map.Entry<K,V> higherEntry(K);
- method @Nullable public K higherKey(K);
- method @Nullable public java.util.Map.Entry<K,V> lastEntry();
- method @Nullable public java.util.Map.Entry<K,V> lowerEntry(K);
- method @Nullable public K lowerKey(K);
- method @NonNull public java.util.NavigableSet<K> navigableKeySet();
- method @Nullable public java.util.Map.Entry<K,V> pollFirstEntry();
- method @Nullable public java.util.Map.Entry<K,V> pollLastEntry();
- method @NonNull public java.util.NavigableMap<K,V> subMap(K, boolean, K, boolean);
- method @NonNull public java.util.NavigableMap<K,V> tailMap(K, boolean);
- }
-
- public interface NavigableSet<E> extends java.util.SortedSet<E> {
- method public E ceiling(E);
- method public java.util.Iterator<E> descendingIterator();
- method public java.util.NavigableSet<E> descendingSet();
- method public E floor(E);
- method public java.util.NavigableSet<E> headSet(E, boolean);
- method public E higher(E);
- method public E lower(E);
- method public E pollFirst();
- method public E pollLast();
- method public java.util.NavigableSet<E> subSet(E, boolean, E, boolean);
- method public java.util.NavigableSet<E> tailSet(E, boolean);
- }
-
- public class NoSuchElementException extends java.lang.RuntimeException {
- ctor public NoSuchElementException();
- ctor public NoSuchElementException(String);
- }
-
- public final class Objects {
- method public static int checkFromIndexSize(int, int, int);
- method public static int checkFromToIndex(int, int, int);
- method public static int checkIndex(int, int);
- method public static <T> int compare(T, T, @NonNull java.util.Comparator<? super T>);
- method public static boolean deepEquals(@Nullable Object, @Nullable Object);
- method public static boolean equals(@Nullable Object, @Nullable Object);
- method public static int hash(@Nullable java.lang.Object...);
- method public static int hashCode(@Nullable Object);
- method public static boolean isNull(@Nullable Object);
- method public static boolean nonNull(@Nullable Object);
- method @NonNull public static <T> T requireNonNull(@Nullable T);
- method @NonNull public static <T> T requireNonNull(@Nullable T, @NonNull String);
- method @NonNull public static <T> T requireNonNull(@Nullable T, @NonNull java.util.function.Supplier<java.lang.String>);
- method @NonNull public static <T> T requireNonNullElse(@Nullable T, @NonNull T);
- method @NonNull public static <T> T requireNonNullElseGet(@Nullable T, @NonNull java.util.function.Supplier<? extends T>);
- method @NonNull public static String toString(@Nullable Object);
- method @NonNull public static String toString(@Nullable Object, @NonNull String);
- }
-
- public class Observable {
- ctor public Observable();
- method public void addObserver(java.util.Observer);
- method protected void clearChanged();
- method public int countObservers();
- method public void deleteObserver(java.util.Observer);
- method public void deleteObservers();
- method public boolean hasChanged();
- method public void notifyObservers();
- method public void notifyObservers(Object);
- method protected void setChanged();
- }
-
- public interface Observer {
- method public void update(java.util.Observable, Object);
- }
-
- public final class Optional<T> {
- method public static <T> java.util.Optional<T> empty();
- method public java.util.Optional<T> filter(java.util.function.Predicate<? super T>);
- method public <U> java.util.Optional<U> flatMap(java.util.function.Function<? super T,java.util.Optional<U>>);
- method public T get();
- method public void ifPresent(java.util.function.Consumer<? super T>);
- method public boolean isPresent();
- method public <U> java.util.Optional<U> map(java.util.function.Function<? super T,? extends U>);
- method public static <T> java.util.Optional<T> of(T);
- method public static <T> java.util.Optional<T> ofNullable(T);
- method public T orElse(T);
- method public T orElseGet(java.util.function.Supplier<? extends T>);
- method public <X extends java.lang.Throwable> T orElseThrow(java.util.function.Supplier<? extends X>) throws X;
- }
-
- public final class OptionalDouble {
- method public static java.util.OptionalDouble empty();
- method public double getAsDouble();
- method public void ifPresent(java.util.function.DoubleConsumer);
- method public boolean isPresent();
- method public static java.util.OptionalDouble of(double);
- method public double orElse(double);
- method public double orElseGet(java.util.function.DoubleSupplier);
- method public <X extends java.lang.Throwable> double orElseThrow(java.util.function.Supplier<X>) throws X;
- }
-
- public final class OptionalInt {
- method public static java.util.OptionalInt empty();
- method public int getAsInt();
- method public void ifPresent(java.util.function.IntConsumer);
- method public boolean isPresent();
- method public static java.util.OptionalInt of(int);
- method public int orElse(int);
- method public int orElseGet(java.util.function.IntSupplier);
- method public <X extends java.lang.Throwable> int orElseThrow(java.util.function.Supplier<X>) throws X;
- }
-
- public final class OptionalLong {
- method public static java.util.OptionalLong empty();
- method public long getAsLong();
- method public void ifPresent(java.util.function.LongConsumer);
- method public boolean isPresent();
- method public static java.util.OptionalLong of(long);
- method public long orElse(long);
- method public long orElseGet(java.util.function.LongSupplier);
- method public <X extends java.lang.Throwable> long orElseThrow(java.util.function.Supplier<X>) throws X;
- }
-
- public interface PrimitiveIterator<T, T_CONS> extends java.util.Iterator<T> {
- method public void forEachRemaining(T_CONS);
- }
-
- public static interface PrimitiveIterator.OfDouble extends java.util.PrimitiveIterator<java.lang.Double,java.util.function.DoubleConsumer> {
- method public default void forEachRemaining(java.util.function.DoubleConsumer);
- method public default void forEachRemaining(java.util.function.Consumer<? super java.lang.Double>);
- method public default Double next();
- method public double nextDouble();
- }
-
- public static interface PrimitiveIterator.OfInt extends java.util.PrimitiveIterator<java.lang.Integer,java.util.function.IntConsumer> {
- method public default void forEachRemaining(java.util.function.IntConsumer);
- method public default void forEachRemaining(java.util.function.Consumer<? super java.lang.Integer>);
- method public default Integer next();
- method public int nextInt();
- }
-
- public static interface PrimitiveIterator.OfLong extends java.util.PrimitiveIterator<java.lang.Long,java.util.function.LongConsumer> {
- method public default void forEachRemaining(java.util.function.LongConsumer);
- method public default void forEachRemaining(java.util.function.Consumer<? super java.lang.Long>);
- method public default Long next();
- method public long nextLong();
- }
-
- public class PriorityQueue<E> extends java.util.AbstractQueue<E> implements java.io.Serializable {
- ctor public PriorityQueue();
- ctor public PriorityQueue(int);
- ctor public PriorityQueue(java.util.Comparator<? super E>);
- ctor public PriorityQueue(int, java.util.Comparator<? super E>);
- ctor public PriorityQueue(java.util.Collection<? extends E>);
- ctor public PriorityQueue(java.util.PriorityQueue<? extends E>);
- ctor public PriorityQueue(java.util.SortedSet<? extends E>);
- method public java.util.Comparator<? super E> comparator();
- method public java.util.Iterator<E> iterator();
- method public boolean offer(E);
- method public E peek();
- method public E poll();
- method public int size();
- method public final java.util.Spliterator<E> spliterator();
- }
-
- public class Properties extends java.util.Hashtable<java.lang.Object,java.lang.Object> {
- ctor public Properties();
- ctor public Properties(java.util.Properties);
- method public String getProperty(String);
- method public String getProperty(String, String);
- method public void list(java.io.PrintStream);
- method public void list(java.io.PrintWriter);
- method public void load(java.io.Reader) throws java.io.IOException;
- method public void load(java.io.InputStream) throws java.io.IOException;
- method public void loadFromXML(java.io.InputStream) throws java.io.IOException, java.util.InvalidPropertiesFormatException;
- method public java.util.Enumeration<?> propertyNames();
- method @Deprecated public void save(java.io.OutputStream, String);
- method public Object setProperty(String, String);
- method public void store(java.io.Writer, String) throws java.io.IOException;
- method public void store(java.io.OutputStream, String) throws java.io.IOException;
- method public void storeToXML(java.io.OutputStream, String) throws java.io.IOException;
- method public void storeToXML(java.io.OutputStream, String, String) throws java.io.IOException;
- method public java.util.Set<java.lang.String> stringPropertyNames();
- field protected java.util.Properties defaults;
- }
-
- public final class PropertyPermission extends java.security.BasicPermission {
- ctor public PropertyPermission(String, String);
- }
-
- public class PropertyResourceBundle extends java.util.ResourceBundle {
- ctor public PropertyResourceBundle(java.io.InputStream) throws java.io.IOException;
- ctor public PropertyResourceBundle(java.io.Reader) throws java.io.IOException;
- method public java.util.Enumeration<java.lang.String> getKeys();
- method public Object handleGetObject(String);
- }
-
- public interface Queue<E> extends java.util.Collection<E> {
- method public E element();
- method public boolean offer(E);
- method @Nullable public E peek();
- method @Nullable public E poll();
- method public E remove();
- }
-
- public class Random implements java.io.Serializable {
- ctor public Random();
- ctor public Random(long);
- method public java.util.stream.DoubleStream doubles(long);
- method public java.util.stream.DoubleStream doubles();
- method public java.util.stream.DoubleStream doubles(long, double, double);
- method public java.util.stream.DoubleStream doubles(double, double);
- method public java.util.stream.IntStream ints(long);
- method public java.util.stream.IntStream ints();
- method public java.util.stream.IntStream ints(long, int, int);
- method public java.util.stream.IntStream ints(int, int);
- method public java.util.stream.LongStream longs(long);
- method public java.util.stream.LongStream longs();
- method public java.util.stream.LongStream longs(long, long, long);
- method public java.util.stream.LongStream longs(long, long);
- method protected int next(int);
- method public boolean nextBoolean();
- method public void nextBytes(byte[]);
- method public double nextDouble();
- method public float nextFloat();
- method public double nextGaussian();
- method public int nextInt();
- method public int nextInt(int);
- method public long nextLong();
- method public void setSeed(long);
- }
-
- public interface RandomAccess {
- }
-
- public abstract class ResourceBundle {
- ctor public ResourceBundle();
- method public static final void clearCache();
- method public static final void clearCache(ClassLoader);
- method public boolean containsKey(String);
- method public String getBaseBundleName();
- method public static final java.util.ResourceBundle getBundle(String);
- method public static final java.util.ResourceBundle getBundle(String, java.util.ResourceBundle.Control);
- method public static final java.util.ResourceBundle getBundle(String, java.util.Locale);
- method public static final java.util.ResourceBundle getBundle(String, java.util.Locale, java.util.ResourceBundle.Control);
- method public static java.util.ResourceBundle getBundle(String, java.util.Locale, ClassLoader);
- method public static java.util.ResourceBundle getBundle(String, java.util.Locale, ClassLoader, java.util.ResourceBundle.Control);
- method public abstract java.util.Enumeration<java.lang.String> getKeys();
- method public java.util.Locale getLocale();
- method public final Object getObject(String);
- method public final String getString(String);
- method public final String[] getStringArray(String);
- method protected abstract Object handleGetObject(String);
- method protected java.util.Set<java.lang.String> handleKeySet();
- method public java.util.Set<java.lang.String> keySet();
- method protected void setParent(java.util.ResourceBundle);
- field protected java.util.ResourceBundle parent;
- }
-
- public static class ResourceBundle.Control {
- ctor protected ResourceBundle.Control();
- method public java.util.List<java.util.Locale> getCandidateLocales(String, java.util.Locale);
- method public static final java.util.ResourceBundle.Control getControl(java.util.List<java.lang.String>);
- method public java.util.Locale getFallbackLocale(String, java.util.Locale);
- method public java.util.List<java.lang.String> getFormats(String);
- method public static final java.util.ResourceBundle.Control getNoFallbackControl(java.util.List<java.lang.String>);
- method public long getTimeToLive(String, java.util.Locale);
- method public boolean needsReload(String, java.util.Locale, String, ClassLoader, java.util.ResourceBundle, long);
- method public java.util.ResourceBundle newBundle(String, java.util.Locale, String, ClassLoader, boolean) throws java.io.IOException, java.lang.IllegalAccessException, java.lang.InstantiationException;
- method public String toBundleName(String, java.util.Locale);
- method public final String toResourceName(String, String);
- field public static final java.util.List<java.lang.String> FORMAT_CLASS;
- field public static final java.util.List<java.lang.String> FORMAT_DEFAULT;
- field public static final java.util.List<java.lang.String> FORMAT_PROPERTIES;
- field public static final long TTL_DONT_CACHE = -1L; // 0xffffffffffffffffL
- field public static final long TTL_NO_EXPIRATION_CONTROL = -2L; // 0xfffffffffffffffeL
- }
-
- public final class Scanner implements java.io.Closeable java.util.Iterator<java.lang.String> {
- ctor public Scanner(Readable);
- ctor public Scanner(java.io.InputStream);
- ctor public Scanner(java.io.InputStream, String);
- ctor public Scanner(java.io.File) throws java.io.FileNotFoundException;
- ctor public Scanner(java.io.File, String) throws java.io.FileNotFoundException;
- ctor public Scanner(java.nio.file.Path) throws java.io.IOException;
- ctor public Scanner(java.nio.file.Path, String) throws java.io.IOException;
- ctor public Scanner(String);
- ctor public Scanner(java.nio.channels.ReadableByteChannel);
- ctor public Scanner(java.nio.channels.ReadableByteChannel, String);
- method public void close();
- method public java.util.regex.Pattern delimiter();
- method public String findInLine(String);
- method public String findInLine(java.util.regex.Pattern);
- method public String findWithinHorizon(String, int);
- method public String findWithinHorizon(java.util.regex.Pattern, int);
- method public boolean hasNext();
- method public boolean hasNext(String);
- method public boolean hasNext(java.util.regex.Pattern);
- method public boolean hasNextBigDecimal();
- method public boolean hasNextBigInteger();
- method public boolean hasNextBigInteger(int);
- method public boolean hasNextBoolean();
- method public boolean hasNextByte();
- method public boolean hasNextByte(int);
- method public boolean hasNextDouble();
- method public boolean hasNextFloat();
- method public boolean hasNextInt();
- method public boolean hasNextInt(int);
- method public boolean hasNextLine();
- method public boolean hasNextLong();
- method public boolean hasNextLong(int);
- method public boolean hasNextShort();
- method public boolean hasNextShort(int);
- method public java.io.IOException ioException();
- method public java.util.Locale locale();
- method public java.util.regex.MatchResult match();
- method public String next();
- method public String next(String);
- method public String next(java.util.regex.Pattern);
- method public java.math.BigDecimal nextBigDecimal();
- method public java.math.BigInteger nextBigInteger();
- method public java.math.BigInteger nextBigInteger(int);
- method public boolean nextBoolean();
- method public byte nextByte();
- method public byte nextByte(int);
- method public double nextDouble();
- method public float nextFloat();
- method public int nextInt();
- method public int nextInt(int);
- method public String nextLine();
- method public long nextLong();
- method public long nextLong(int);
- method public short nextShort();
- method public short nextShort(int);
- method public int radix();
- method public java.util.Scanner reset();
- method public java.util.Scanner skip(java.util.regex.Pattern);
- method public java.util.Scanner skip(String);
- method public java.util.Scanner useDelimiter(java.util.regex.Pattern);
- method public java.util.Scanner useDelimiter(String);
- method public java.util.Scanner useLocale(java.util.Locale);
- method public java.util.Scanner useRadix(int);
- }
-
- public class ServiceConfigurationError extends java.lang.Error {
- ctor public ServiceConfigurationError(String);
- ctor public ServiceConfigurationError(String, Throwable);
- }
-
- public final class ServiceLoader<S> implements java.lang.Iterable<S> {
- method public java.util.Iterator<S> iterator();
- method public static <S> java.util.ServiceLoader<S> load(Class<S>, ClassLoader);
- method public static <S> java.util.ServiceLoader<S> load(Class<S>);
- method public static <S> java.util.ServiceLoader<S> loadInstalled(Class<S>);
- method public void reload();
- }
-
- public interface Set<E> extends java.util.Collection<E> {
- method @NonNull public static <E> java.util.Set<E> of();
- method @NonNull public static <E> java.util.Set<E> of(@NonNull E);
- method @NonNull public static <E> java.util.Set<E> of(@NonNull E, @NonNull E);
- method @NonNull public static <E> java.util.Set<E> of(@NonNull E, @NonNull E, @NonNull E);
- method @NonNull public static <E> java.util.Set<E> of(@NonNull E, @NonNull E, @NonNull E, @NonNull E);
- method @NonNull public static <E> java.util.Set<E> of(@NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E);
- method @NonNull public static <E> java.util.Set<E> of(@NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E);
- method @NonNull public static <E> java.util.Set<E> of(@NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E);
- method @NonNull public static <E> java.util.Set<E> of(@NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E);
- method @NonNull public static <E> java.util.Set<E> of(@NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E);
- method @NonNull public static <E> java.util.Set<E> of(@NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E, @NonNull E);
- method @NonNull @java.lang.SafeVarargs public static <E> java.util.Set<E> of(@NonNull E...);
- }
-
- public class SimpleTimeZone extends java.util.TimeZone {
- ctor public SimpleTimeZone(int, String);
- ctor public SimpleTimeZone(int, String, int, int, int, int, int, int, int, int);
- ctor public SimpleTimeZone(int, String, int, int, int, int, int, int, int, int, int);
- ctor public SimpleTimeZone(int, String, int, int, int, int, int, int, int, int, int, int, int);
- method public int getOffset(int, int, int, int, int, int);
- method public int getRawOffset();
- method public boolean inDaylightTime(java.util.Date);
- method public void setDSTSavings(int);
- method public void setEndRule(int, int, int, int);
- method public void setEndRule(int, int, int);
- method public void setEndRule(int, int, int, int, boolean);
- method public void setRawOffset(int);
- method public void setStartRule(int, int, int, int);
- method public void setStartRule(int, int, int);
- method public void setStartRule(int, int, int, int, boolean);
- method public void setStartYear(int);
- method public boolean useDaylightTime();
- field public static final int STANDARD_TIME = 1; // 0x1
- field public static final int UTC_TIME = 2; // 0x2
- field public static final int WALL_TIME = 0; // 0x0
- }
-
- public interface SortedMap<K, V> extends java.util.Map<K,V> {
- method @Nullable public java.util.Comparator<? super K> comparator();
- method public K firstKey();
- method @NonNull public java.util.SortedMap<K,V> headMap(K);
- method public K lastKey();
- method @NonNull public java.util.SortedMap<K,V> subMap(K, K);
- method @NonNull public java.util.SortedMap<K,V> tailMap(K);
- }
-
- public interface SortedSet<E> extends java.util.Set<E> {
- method public java.util.Comparator<? super E> comparator();
- method public E first();
- method public java.util.SortedSet<E> headSet(E);
- method public E last();
- method public java.util.SortedSet<E> subSet(E, E);
- method public java.util.SortedSet<E> tailSet(E);
- }
-
- public interface Spliterator<T> {
- method public int characteristics();
- method public long estimateSize();
- method public default void forEachRemaining(java.util.function.Consumer<? super T>);
- method public default java.util.Comparator<? super T> getComparator();
- method public default long getExactSizeIfKnown();
- method public default boolean hasCharacteristics(int);
- method public boolean tryAdvance(java.util.function.Consumer<? super T>);
- method public java.util.Spliterator<T> trySplit();
- field public static final int CONCURRENT = 4096; // 0x1000
- field public static final int DISTINCT = 1; // 0x1
- field public static final int IMMUTABLE = 1024; // 0x400
- field public static final int NONNULL = 256; // 0x100
- field public static final int ORDERED = 16; // 0x10
- field public static final int SIZED = 64; // 0x40
- field public static final int SORTED = 4; // 0x4
- field public static final int SUBSIZED = 16384; // 0x4000
- }
-
- public static interface Spliterator.OfDouble extends java.util.Spliterator.OfPrimitive<java.lang.Double,java.util.function.DoubleConsumer,java.util.Spliterator.OfDouble> {
- method public default void forEachRemaining(java.util.function.DoubleConsumer);
- method public default void forEachRemaining(java.util.function.Consumer<? super java.lang.Double>);
- method public boolean tryAdvance(java.util.function.DoubleConsumer);
- method public default boolean tryAdvance(java.util.function.Consumer<? super java.lang.Double>);
- method public java.util.Spliterator.OfDouble trySplit();
- }
-
- public static interface Spliterator.OfInt extends java.util.Spliterator.OfPrimitive<java.lang.Integer,java.util.function.IntConsumer,java.util.Spliterator.OfInt> {
- method public default void forEachRemaining(java.util.function.IntConsumer);
- method public default void forEachRemaining(java.util.function.Consumer<? super java.lang.Integer>);
- method public boolean tryAdvance(java.util.function.IntConsumer);
- method public default boolean tryAdvance(java.util.function.Consumer<? super java.lang.Integer>);
- method public java.util.Spliterator.OfInt trySplit();
- }
-
- public static interface Spliterator.OfLong extends java.util.Spliterator.OfPrimitive<java.lang.Long,java.util.function.LongConsumer,java.util.Spliterator.OfLong> {
- method public default void forEachRemaining(java.util.function.LongConsumer);
- method public default void forEachRemaining(java.util.function.Consumer<? super java.lang.Long>);
- method public boolean tryAdvance(java.util.function.LongConsumer);
- method public default boolean tryAdvance(java.util.function.Consumer<? super java.lang.Long>);
- method public java.util.Spliterator.OfLong trySplit();
- }
-
- public static interface Spliterator.OfPrimitive<T, T_CONS, T_SPLITR extends java.util.Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>> extends java.util.Spliterator<T> {
- method public default void forEachRemaining(T_CONS);
- method public boolean tryAdvance(T_CONS);
- method public T_SPLITR trySplit();
- }
-
- public final class Spliterators {
- method public static java.util.Spliterator.OfDouble emptyDoubleSpliterator();
- method public static java.util.Spliterator.OfInt emptyIntSpliterator();
- method public static java.util.Spliterator.OfLong emptyLongSpliterator();
- method public static <T> java.util.Spliterator<T> emptySpliterator();
- method public static <T> java.util.Iterator<T> iterator(java.util.Spliterator<? extends T>);
- method public static java.util.PrimitiveIterator.OfInt iterator(java.util.Spliterator.OfInt);
- method public static java.util.PrimitiveIterator.OfLong iterator(java.util.Spliterator.OfLong);
- method public static java.util.PrimitiveIterator.OfDouble iterator(java.util.Spliterator.OfDouble);
- method public static <T> java.util.Spliterator<T> spliterator(Object[], int);
- method public static <T> java.util.Spliterator<T> spliterator(Object[], int, int, int);
- method public static java.util.Spliterator.OfInt spliterator(int[], int);
- method public static java.util.Spliterator.OfInt spliterator(int[], int, int, int);
- method public static java.util.Spliterator.OfLong spliterator(long[], int);
- method public static java.util.Spliterator.OfLong spliterator(long[], int, int, int);
- method public static java.util.Spliterator.OfDouble spliterator(double[], int);
- method public static java.util.Spliterator.OfDouble spliterator(double[], int, int, int);
- method public static <T> java.util.Spliterator<T> spliterator(java.util.Collection<? extends T>, int);
- method public static <T> java.util.Spliterator<T> spliterator(java.util.Iterator<? extends T>, long, int);
- method public static java.util.Spliterator.OfInt spliterator(java.util.PrimitiveIterator.OfInt, long, int);
- method public static java.util.Spliterator.OfLong spliterator(java.util.PrimitiveIterator.OfLong, long, int);
- method public static java.util.Spliterator.OfDouble spliterator(java.util.PrimitiveIterator.OfDouble, long, int);
- method public static <T> java.util.Spliterator<T> spliteratorUnknownSize(java.util.Iterator<? extends T>, int);
- method public static java.util.Spliterator.OfInt spliteratorUnknownSize(java.util.PrimitiveIterator.OfInt, int);
- method public static java.util.Spliterator.OfLong spliteratorUnknownSize(java.util.PrimitiveIterator.OfLong, int);
- method public static java.util.Spliterator.OfDouble spliteratorUnknownSize(java.util.PrimitiveIterator.OfDouble, int);
- }
-
- public abstract static class Spliterators.AbstractDoubleSpliterator implements java.util.Spliterator.OfDouble {
- ctor protected Spliterators.AbstractDoubleSpliterator(long, int);
- method public int characteristics();
- method public long estimateSize();
- method public java.util.Spliterator.OfDouble trySplit();
- }
-
- public abstract static class Spliterators.AbstractIntSpliterator implements java.util.Spliterator.OfInt {
- ctor protected Spliterators.AbstractIntSpliterator(long, int);
- method public int characteristics();
- method public long estimateSize();
- method public java.util.Spliterator.OfInt trySplit();
- }
-
- public abstract static class Spliterators.AbstractLongSpliterator implements java.util.Spliterator.OfLong {
- ctor protected Spliterators.AbstractLongSpliterator(long, int);
- method public int characteristics();
- method public long estimateSize();
- method public java.util.Spliterator.OfLong trySplit();
- }
-
- public abstract static class Spliterators.AbstractSpliterator<T> implements java.util.Spliterator<T> {
- ctor protected Spliterators.AbstractSpliterator(long, int);
- method public int characteristics();
- method public long estimateSize();
- method public java.util.Spliterator<T> trySplit();
- }
-
- public final class SplittableRandom {
- ctor public SplittableRandom(long);
- ctor public SplittableRandom();
- method public java.util.stream.DoubleStream doubles(long);
- method public java.util.stream.DoubleStream doubles();
- method public java.util.stream.DoubleStream doubles(long, double, double);
- method public java.util.stream.DoubleStream doubles(double, double);
- method public java.util.stream.IntStream ints(long);
- method public java.util.stream.IntStream ints();
- method public java.util.stream.IntStream ints(long, int, int);
- method public java.util.stream.IntStream ints(int, int);
- method public java.util.stream.LongStream longs(long);
- method public java.util.stream.LongStream longs();
- method public java.util.stream.LongStream longs(long, long, long);
- method public java.util.stream.LongStream longs(long, long);
- method public boolean nextBoolean();
- method public double nextDouble();
- method public double nextDouble(double);
- method public double nextDouble(double, double);
- method public int nextInt();
- method public int nextInt(int);
- method public int nextInt(int, int);
- method public long nextLong();
- method public long nextLong(long);
- method public long nextLong(long, long);
- method public java.util.SplittableRandom split();
- }
-
- public class Stack<E> extends java.util.Vector<E> {
- ctor public Stack();
- method public boolean empty();
- method public E peek();
- method public E pop();
- method public E push(E);
- method public int search(Object);
- }
-
- public final class StringJoiner {
- ctor public StringJoiner(CharSequence);
- ctor public StringJoiner(CharSequence, CharSequence, CharSequence);
- method public java.util.StringJoiner add(CharSequence);
- method public int length();
- method public java.util.StringJoiner merge(java.util.StringJoiner);
- method public java.util.StringJoiner setEmptyValue(CharSequence);
- }
-
- public class StringTokenizer implements java.util.Enumeration<java.lang.Object> {
- ctor public StringTokenizer(String, String, boolean);
- ctor public StringTokenizer(String, String);
- ctor public StringTokenizer(String);
- method public int countTokens();
- method public boolean hasMoreElements();
- method public boolean hasMoreTokens();
- method public Object nextElement();
- method public String nextToken();
- method public String nextToken(String);
- }
-
- public abstract class TimeZone implements java.lang.Cloneable java.io.Serializable {
- ctor public TimeZone();
- method public Object clone();
- method public static String[] getAvailableIDs(int);
- method public static String[] getAvailableIDs();
- method public int getDSTSavings();
- method public static java.util.TimeZone getDefault();
- method public final String getDisplayName();
- method public final String getDisplayName(java.util.Locale);
- method public final String getDisplayName(boolean, int);
- method public String getDisplayName(boolean, int, java.util.Locale);
- method public String getID();
- method public abstract int getOffset(int, int, int, int, int, int);
- method public int getOffset(long);
- method public abstract int getRawOffset();
- method public static java.util.TimeZone getTimeZone(String);
- method public static java.util.TimeZone getTimeZone(java.time.ZoneId);
- method public boolean hasSameRules(java.util.TimeZone);
- method public abstract boolean inDaylightTime(java.util.Date);
- method public boolean observesDaylightTime();
- method public static void setDefault(java.util.TimeZone);
- method public void setID(String);
- method public abstract void setRawOffset(int);
- method public java.time.ZoneId toZoneId();
- method public abstract boolean useDaylightTime();
- field public static final int LONG = 1; // 0x1
- field public static final int SHORT = 0; // 0x0
- }
-
- public class Timer {
- ctor public Timer();
- ctor public Timer(boolean);
- ctor public Timer(String);
- ctor public Timer(String, boolean);
- method public void cancel();
- method public int purge();
- method public void schedule(java.util.TimerTask, long);
- method public void schedule(java.util.TimerTask, java.util.Date);
- method public void schedule(java.util.TimerTask, long, long);
- method public void schedule(java.util.TimerTask, java.util.Date, long);
- method public void scheduleAtFixedRate(java.util.TimerTask, long, long);
- method public void scheduleAtFixedRate(java.util.TimerTask, java.util.Date, long);
- }
-
- public abstract class TimerTask implements java.lang.Runnable {
- ctor protected TimerTask();
- method public boolean cancel();
- method public long scheduledExecutionTime();
- }
-
- public class TooManyListenersException extends java.lang.Exception {
- ctor public TooManyListenersException();
- ctor public TooManyListenersException(String);
- }
-
- public class TreeMap<K, V> extends java.util.AbstractMap<K,V> implements java.lang.Cloneable java.util.NavigableMap<K,V> java.io.Serializable {
- ctor public TreeMap();
- ctor public TreeMap(@Nullable java.util.Comparator<? super K>);
- ctor public TreeMap(@NonNull java.util.Map<? extends K,? extends V>);
- ctor public TreeMap(@NonNull java.util.SortedMap<K,? extends V>);
- method @Nullable public java.util.Map.Entry<K,V> ceilingEntry(K);
- method @Nullable public K ceilingKey(K);
- method @NonNull public Object clone();
- method @Nullable public java.util.Comparator<? super K> comparator();
- method @NonNull public java.util.NavigableSet<K> descendingKeySet();
- method @NonNull public java.util.NavigableMap<K,V> descendingMap();
- method @NonNull public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
- method @Nullable public java.util.Map.Entry<K,V> firstEntry();
- method public K firstKey();
- method @Nullable public java.util.Map.Entry<K,V> floorEntry(K);
- method @Nullable public K floorKey(K);
- method @NonNull public java.util.NavigableMap<K,V> headMap(K, boolean);
- method @NonNull public java.util.SortedMap<K,V> headMap(K);
- method @Nullable public java.util.Map.Entry<K,V> higherEntry(K);
- method @Nullable public K higherKey(K);
- method @Nullable public java.util.Map.Entry<K,V> lastEntry();
- method public K lastKey();
- method @Nullable public java.util.Map.Entry<K,V> lowerEntry(K);
- method @Nullable public K lowerKey(K);
- method @NonNull public java.util.NavigableSet<K> navigableKeySet();
- method @Nullable public java.util.Map.Entry<K,V> pollFirstEntry();
- method @Nullable public java.util.Map.Entry<K,V> pollLastEntry();
- method @NonNull public java.util.NavigableMap<K,V> subMap(K, boolean, K, boolean);
- method @NonNull public java.util.SortedMap<K,V> subMap(K, K);
- method @NonNull public java.util.NavigableMap<K,V> tailMap(K, boolean);
- method @NonNull public java.util.SortedMap<K,V> tailMap(K);
- }
-
- public class TreeSet<E> extends java.util.AbstractSet<E> implements java.lang.Cloneable java.util.NavigableSet<E> java.io.Serializable {
- ctor public TreeSet();
- ctor public TreeSet(java.util.Comparator<? super E>);
- ctor public TreeSet(java.util.Collection<? extends E>);
- ctor public TreeSet(java.util.SortedSet<E>);
- method public E ceiling(E);
- method public Object clone();
- method public java.util.Comparator<? super E> comparator();
- method public java.util.Iterator<E> descendingIterator();
- method public java.util.NavigableSet<E> descendingSet();
- method public E first();
- method public E floor(E);
- method public java.util.NavigableSet<E> headSet(E, boolean);
- method public java.util.SortedSet<E> headSet(E);
- method public E higher(E);
- method public java.util.Iterator<E> iterator();
- method public E last();
- method public E lower(E);
- method public E pollFirst();
- method public E pollLast();
- method public int size();
- method public java.util.NavigableSet<E> subSet(E, boolean, E, boolean);
- method public java.util.SortedSet<E> subSet(E, E);
- method public java.util.NavigableSet<E> tailSet(E, boolean);
- method public java.util.SortedSet<E> tailSet(E);
- }
-
- public final class UUID implements java.lang.Comparable<java.util.UUID> java.io.Serializable {
- ctor public UUID(long, long);
- method public int clockSequence();
- method public int compareTo(java.util.UUID);
- method public static java.util.UUID fromString(String);
- method public long getLeastSignificantBits();
- method public long getMostSignificantBits();
- method public static java.util.UUID nameUUIDFromBytes(byte[]);
- method public long node();
- method public static java.util.UUID randomUUID();
- method public long timestamp();
- method public int variant();
- method public int version();
- }
-
- public class UnknownFormatConversionException extends java.util.IllegalFormatException {
- ctor public UnknownFormatConversionException(String);
- method public String getConversion();
- }
-
- public class UnknownFormatFlagsException extends java.util.IllegalFormatException {
- ctor public UnknownFormatFlagsException(String);
- method public String getFlags();
- }
-
- public class Vector<E> extends java.util.AbstractList<E> implements java.lang.Cloneable java.util.List<E> java.util.RandomAccess java.io.Serializable {
- ctor public Vector(int, int);
- ctor public Vector(int);
- ctor public Vector();
- ctor public Vector(@NonNull java.util.Collection<? extends E>);
- method public void addElement(E);
- method public int capacity();
- method @NonNull public Object clone();
- method public void copyInto(@NonNull Object[]);
- method public E elementAt(int);
- method @NonNull public java.util.Enumeration<E> elements();
- method public void ensureCapacity(int);
- method public E firstElement();
- method public void forEach(@NonNull java.util.function.Consumer<? super E>);
- method public E get(int);
- method public int indexOf(@Nullable Object, int);
- method public void insertElementAt(E, int);
- method public E lastElement();
- method public int lastIndexOf(@Nullable Object, int);
- method public void removeAllElements();
- method public boolean removeElement(@Nullable Object);
- method public void removeElementAt(int);
- method public void setElementAt(E, int);
- method public void setSize(int);
- method public int size();
- method public void trimToSize();
- field protected int capacityIncrement;
- field protected int elementCount;
- field @NonNull protected Object[] elementData;
- }
-
- public class WeakHashMap<K, V> extends java.util.AbstractMap<K,V> implements java.util.Map<K,V> {
- ctor public WeakHashMap(int, float);
- ctor public WeakHashMap(int);
- ctor public WeakHashMap();
- ctor public WeakHashMap(@NonNull java.util.Map<? extends K,? extends V>);
- method @NonNull public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
- }
-
-}
-
-package java.util.concurrent {
-
- public abstract class AbstractExecutorService implements java.util.concurrent.ExecutorService {
- ctor public AbstractExecutorService();
- method public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>>) throws java.lang.InterruptedException;
- method public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>>, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>>) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
- method public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>>, long, java.util.concurrent.TimeUnit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
- method protected <T> java.util.concurrent.RunnableFuture<T> newTaskFor(Runnable, T);
- method protected <T> java.util.concurrent.RunnableFuture<T> newTaskFor(java.util.concurrent.Callable<T>);
- method public java.util.concurrent.Future<?> submit(Runnable);
- method public <T> java.util.concurrent.Future<T> submit(Runnable, T);
- method public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T>);
- }
-
- public class ArrayBlockingQueue<E> extends java.util.AbstractQueue<E> implements java.util.concurrent.BlockingQueue<E> java.io.Serializable {
- ctor public ArrayBlockingQueue(int);
- ctor public ArrayBlockingQueue(int, boolean);
- ctor public ArrayBlockingQueue(int, boolean, java.util.Collection<? extends E>);
- method public int drainTo(java.util.Collection<? super E>);
- method public int drainTo(java.util.Collection<? super E>, int);
- method public java.util.Iterator<E> iterator();
- method public boolean offer(E);
- method public boolean offer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public E peek();
- method public E poll();
- method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public void put(E) throws java.lang.InterruptedException;
- method public int remainingCapacity();
- method public int size();
- method public E take() throws java.lang.InterruptedException;
- }
-
- public interface BlockingDeque<E> extends java.util.concurrent.BlockingQueue<E> java.util.Deque<E> {
- method public boolean offerFirst(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public boolean offerLast(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public E pollFirst(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public E pollLast(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public void putFirst(E) throws java.lang.InterruptedException;
- method public void putLast(E) throws java.lang.InterruptedException;
- method public E takeFirst() throws java.lang.InterruptedException;
- method public E takeLast() throws java.lang.InterruptedException;
- }
-
- public interface BlockingQueue<E> extends java.util.Queue<E> {
- method public int drainTo(java.util.Collection<? super E>);
- method public int drainTo(java.util.Collection<? super E>, int);
- method public boolean offer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public void put(E) throws java.lang.InterruptedException;
- method public int remainingCapacity();
- method public E take() throws java.lang.InterruptedException;
- }
-
- public class BrokenBarrierException extends java.lang.Exception {
- ctor public BrokenBarrierException();
- ctor public BrokenBarrierException(String);
- }
-
- @java.lang.FunctionalInterface public interface Callable<V> {
- method public V call() throws java.lang.Exception;
- }
-
- public class CancellationException extends java.lang.IllegalStateException {
- ctor public CancellationException();
- ctor public CancellationException(String);
- }
-
- public class CompletableFuture<T> implements java.util.concurrent.CompletionStage<T> java.util.concurrent.Future<T> {
- ctor public CompletableFuture();
- method public java.util.concurrent.CompletableFuture<java.lang.Void> acceptEither(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Consumer<? super T>);
- method public java.util.concurrent.CompletableFuture<java.lang.Void> acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Consumer<? super T>);
- method public java.util.concurrent.CompletableFuture<java.lang.Void> acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Consumer<? super T>, java.util.concurrent.Executor);
- method public static java.util.concurrent.CompletableFuture<java.lang.Void> allOf(java.util.concurrent.CompletableFuture<?>...);
- method public static java.util.concurrent.CompletableFuture<java.lang.Object> anyOf(java.util.concurrent.CompletableFuture<?>...);
- method public <U> java.util.concurrent.CompletableFuture<U> applyToEither(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Function<? super T,U>);
- method public <U> java.util.concurrent.CompletableFuture<U> applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Function<? super T,U>);
- method public <U> java.util.concurrent.CompletableFuture<U> applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Function<? super T,U>, java.util.concurrent.Executor);
- method public boolean cancel(boolean);
- method public boolean complete(T);
- method public boolean completeExceptionally(Throwable);
- method public static <U> java.util.concurrent.CompletableFuture<U> completedFuture(U);
- method public java.util.concurrent.CompletableFuture<T> exceptionally(java.util.function.Function<java.lang.Throwable,? extends T>);
- method public T get() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
- method public T get(long, java.util.concurrent.TimeUnit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
- method public T getNow(T);
- method public int getNumberOfDependents();
- method public <U> java.util.concurrent.CompletableFuture<U> handle(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U>);
- method public <U> java.util.concurrent.CompletableFuture<U> handleAsync(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U>);
- method public <U> java.util.concurrent.CompletableFuture<U> handleAsync(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U>, java.util.concurrent.Executor);
- method public boolean isCancelled();
- method public boolean isCompletedExceptionally();
- method public boolean isDone();
- method public T join();
- method public void obtrudeException(Throwable);
- method public void obtrudeValue(T);
- method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterBoth(java.util.concurrent.CompletionStage<?>, Runnable);
- method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterBothAsync(java.util.concurrent.CompletionStage<?>, Runnable);
- method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterBothAsync(java.util.concurrent.CompletionStage<?>, Runnable, java.util.concurrent.Executor);
- method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterEither(java.util.concurrent.CompletionStage<?>, Runnable);
- method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterEitherAsync(java.util.concurrent.CompletionStage<?>, Runnable);
- method public java.util.concurrent.CompletableFuture<java.lang.Void> runAfterEitherAsync(java.util.concurrent.CompletionStage<?>, Runnable, java.util.concurrent.Executor);
- method public static java.util.concurrent.CompletableFuture<java.lang.Void> runAsync(Runnable);
- method public static java.util.concurrent.CompletableFuture<java.lang.Void> runAsync(Runnable, java.util.concurrent.Executor);
- method public static <U> java.util.concurrent.CompletableFuture<U> supplyAsync(java.util.function.Supplier<U>);
- method public static <U> java.util.concurrent.CompletableFuture<U> supplyAsync(java.util.function.Supplier<U>, java.util.concurrent.Executor);
- method public java.util.concurrent.CompletableFuture<java.lang.Void> thenAccept(java.util.function.Consumer<? super T>);
- method public java.util.concurrent.CompletableFuture<java.lang.Void> thenAcceptAsync(java.util.function.Consumer<? super T>);
- method public java.util.concurrent.CompletableFuture<java.lang.Void> thenAcceptAsync(java.util.function.Consumer<? super T>, java.util.concurrent.Executor);
- method public <U> java.util.concurrent.CompletableFuture<java.lang.Void> thenAcceptBoth(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiConsumer<? super T,? super U>);
- method public <U> java.util.concurrent.CompletableFuture<java.lang.Void> thenAcceptBothAsync(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiConsumer<? super T,? super U>);
- method public <U> java.util.concurrent.CompletableFuture<java.lang.Void> thenAcceptBothAsync(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiConsumer<? super T,? super U>, java.util.concurrent.Executor);
- method public <U> java.util.concurrent.CompletableFuture<U> thenApply(java.util.function.Function<? super T,? extends U>);
- method public <U> java.util.concurrent.CompletableFuture<U> thenApplyAsync(java.util.function.Function<? super T,? extends U>);
- method public <U> java.util.concurrent.CompletableFuture<U> thenApplyAsync(java.util.function.Function<? super T,? extends U>, java.util.concurrent.Executor);
- method public <U, V> java.util.concurrent.CompletableFuture<V> thenCombine(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiFunction<? super T,? super U,? extends V>);
- method public <U, V> java.util.concurrent.CompletableFuture<V> thenCombineAsync(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiFunction<? super T,? super U,? extends V>);
- method public <U, V> java.util.concurrent.CompletableFuture<V> thenCombineAsync(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiFunction<? super T,? super U,? extends V>, java.util.concurrent.Executor);
- method public <U> java.util.concurrent.CompletableFuture<U> thenCompose(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>>);
- method public <U> java.util.concurrent.CompletableFuture<U> thenComposeAsync(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>>);
- method public <U> java.util.concurrent.CompletableFuture<U> thenComposeAsync(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>>, java.util.concurrent.Executor);
- method public java.util.concurrent.CompletableFuture<java.lang.Void> thenRun(Runnable);
- method public java.util.concurrent.CompletableFuture<java.lang.Void> thenRunAsync(Runnable);
- method public java.util.concurrent.CompletableFuture<java.lang.Void> thenRunAsync(Runnable, java.util.concurrent.Executor);
- method public java.util.concurrent.CompletableFuture<T> toCompletableFuture();
- method public java.util.concurrent.CompletableFuture<T> whenComplete(java.util.function.BiConsumer<? super T,? super java.lang.Throwable>);
- method public java.util.concurrent.CompletableFuture<T> whenCompleteAsync(java.util.function.BiConsumer<? super T,? super java.lang.Throwable>);
- method public java.util.concurrent.CompletableFuture<T> whenCompleteAsync(java.util.function.BiConsumer<? super T,? super java.lang.Throwable>, java.util.concurrent.Executor);
- }
-
- public static interface CompletableFuture.AsynchronousCompletionTask {
- }
-
- public class CompletionException extends java.lang.RuntimeException {
- ctor protected CompletionException();
- ctor protected CompletionException(String);
- ctor public CompletionException(String, Throwable);
- ctor public CompletionException(Throwable);
- }
-
- public interface CompletionService<V> {
- method public java.util.concurrent.Future<V> poll();
- method public java.util.concurrent.Future<V> poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public java.util.concurrent.Future<V> submit(java.util.concurrent.Callable<V>);
- method public java.util.concurrent.Future<V> submit(Runnable, V);
- method public java.util.concurrent.Future<V> take() throws java.lang.InterruptedException;
- }
-
- public interface CompletionStage<T> {
- method public java.util.concurrent.CompletionStage<java.lang.Void> acceptEither(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Consumer<? super T>);
- method public java.util.concurrent.CompletionStage<java.lang.Void> acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Consumer<? super T>);
- method public java.util.concurrent.CompletionStage<java.lang.Void> acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Consumer<? super T>, java.util.concurrent.Executor);
- method public <U> java.util.concurrent.CompletionStage<U> applyToEither(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Function<? super T,U>);
- method public <U> java.util.concurrent.CompletionStage<U> applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Function<? super T,U>);
- method public <U> java.util.concurrent.CompletionStage<U> applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T>, java.util.function.Function<? super T,U>, java.util.concurrent.Executor);
- method public java.util.concurrent.CompletionStage<T> exceptionally(java.util.function.Function<java.lang.Throwable,? extends T>);
- method public <U> java.util.concurrent.CompletionStage<U> handle(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U>);
- method public <U> java.util.concurrent.CompletionStage<U> handleAsync(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U>);
- method public <U> java.util.concurrent.CompletionStage<U> handleAsync(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U>, java.util.concurrent.Executor);
- method public java.util.concurrent.CompletionStage<java.lang.Void> runAfterBoth(java.util.concurrent.CompletionStage<?>, Runnable);
- method public java.util.concurrent.CompletionStage<java.lang.Void> runAfterBothAsync(java.util.concurrent.CompletionStage<?>, Runnable);
- method public java.util.concurrent.CompletionStage<java.lang.Void> runAfterBothAsync(java.util.concurrent.CompletionStage<?>, Runnable, java.util.concurrent.Executor);
- method public java.util.concurrent.CompletionStage<java.lang.Void> runAfterEither(java.util.concurrent.CompletionStage<?>, Runnable);
- method public java.util.concurrent.CompletionStage<java.lang.Void> runAfterEitherAsync(java.util.concurrent.CompletionStage<?>, Runnable);
- method public java.util.concurrent.CompletionStage<java.lang.Void> runAfterEitherAsync(java.util.concurrent.CompletionStage<?>, Runnable, java.util.concurrent.Executor);
- method public java.util.concurrent.CompletionStage<java.lang.Void> thenAccept(java.util.function.Consumer<? super T>);
- method public java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync(java.util.function.Consumer<? super T>);
- method public java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync(java.util.function.Consumer<? super T>, java.util.concurrent.Executor);
- method public <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBoth(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiConsumer<? super T,? super U>);
- method public <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBothAsync(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiConsumer<? super T,? super U>);
- method public <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBothAsync(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiConsumer<? super T,? super U>, java.util.concurrent.Executor);
- method public <U> java.util.concurrent.CompletionStage<U> thenApply(java.util.function.Function<? super T,? extends U>);
- method public <U> java.util.concurrent.CompletionStage<U> thenApplyAsync(java.util.function.Function<? super T,? extends U>);
- method public <U> java.util.concurrent.CompletionStage<U> thenApplyAsync(java.util.function.Function<? super T,? extends U>, java.util.concurrent.Executor);
- method public <U, V> java.util.concurrent.CompletionStage<V> thenCombine(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiFunction<? super T,? super U,? extends V>);
- method public <U, V> java.util.concurrent.CompletionStage<V> thenCombineAsync(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiFunction<? super T,? super U,? extends V>);
- method public <U, V> java.util.concurrent.CompletionStage<V> thenCombineAsync(java.util.concurrent.CompletionStage<? extends U>, java.util.function.BiFunction<? super T,? super U,? extends V>, java.util.concurrent.Executor);
- method public <U> java.util.concurrent.CompletionStage<U> thenCompose(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>>);
- method public <U> java.util.concurrent.CompletionStage<U> thenComposeAsync(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>>);
- method public <U> java.util.concurrent.CompletionStage<U> thenComposeAsync(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>>, java.util.concurrent.Executor);
- method public java.util.concurrent.CompletionStage<java.lang.Void> thenRun(Runnable);
- method public java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync(Runnable);
- method public java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync(Runnable, java.util.concurrent.Executor);
- method public java.util.concurrent.CompletableFuture<T> toCompletableFuture();
- method public java.util.concurrent.CompletionStage<T> whenComplete(java.util.function.BiConsumer<? super T,? super java.lang.Throwable>);
- method public java.util.concurrent.CompletionStage<T> whenCompleteAsync(java.util.function.BiConsumer<? super T,? super java.lang.Throwable>);
- method public java.util.concurrent.CompletionStage<T> whenCompleteAsync(java.util.function.BiConsumer<? super T,? super java.lang.Throwable>, java.util.concurrent.Executor);
- }
-
- public class ConcurrentHashMap<K, V> extends java.util.AbstractMap<K,V> implements java.util.concurrent.ConcurrentMap<K,V> java.io.Serializable {
- ctor public ConcurrentHashMap();
- ctor public ConcurrentHashMap(int);
- ctor public ConcurrentHashMap(@NonNull java.util.Map<? extends K,? extends V>);
- ctor public ConcurrentHashMap(int, float);
- ctor public ConcurrentHashMap(int, float, int);
- method public boolean contains(@NonNull Object);
- method @NonNull public java.util.Enumeration<V> elements();
- method @NonNull public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
- method public void forEach(long, @NonNull java.util.function.BiConsumer<? super K,? super V>);
- method public <U> void forEach(long, @NonNull java.util.function.BiFunction<? super K,? super V,? extends U>, @NonNull java.util.function.Consumer<? super U>);
- method public void forEachEntry(long, @NonNull java.util.function.Consumer<? super java.util.Map.Entry<K,V>>);
- method public <U> void forEachEntry(long, @NonNull java.util.function.Function<java.util.Map.Entry<K,V>,? extends U>, @NonNull java.util.function.Consumer<? super U>);
- method public void forEachKey(long, @NonNull java.util.function.Consumer<? super K>);
- method public <U> void forEachKey(long, @NonNull java.util.function.Function<? super K,? extends U>, @NonNull java.util.function.Consumer<? super U>);
- method public void forEachValue(long, @NonNull java.util.function.Consumer<? super V>);
- method public <U> void forEachValue(long, @NonNull java.util.function.Function<? super V,? extends U>, @NonNull java.util.function.Consumer<? super U>);
- method @NonNull public java.util.concurrent.ConcurrentHashMap.KeySetView<K,V> keySet(@NonNull V);
- method @NonNull public java.util.Enumeration<K> keys();
- method public long mappingCount();
- method @NonNull public static <K> java.util.concurrent.ConcurrentHashMap.KeySetView<K,java.lang.Boolean> newKeySet();
- method @NonNull public static <K> java.util.concurrent.ConcurrentHashMap.KeySetView<K,java.lang.Boolean> newKeySet(int);
- method @Nullable public <U> U reduce(long, @NonNull java.util.function.BiFunction<? super K,? super V,? extends U>, @NonNull java.util.function.BiFunction<? super U,? super U,? extends U>);
- method @Nullable public java.util.Map.Entry<K,V> reduceEntries(long, @NonNull java.util.function.BiFunction<java.util.Map.Entry<K,V>,java.util.Map.Entry<K,V>,? extends java.util.Map.Entry<K,V>>);
- method @Nullable public <U> U reduceEntries(long, @NonNull java.util.function.Function<java.util.Map.Entry<K,V>,? extends U>, @NonNull java.util.function.BiFunction<? super U,? super U,? extends U>);
- method public double reduceEntriesToDouble(long, @NonNull java.util.function.ToDoubleFunction<java.util.Map.Entry<K,V>>, double, @NonNull java.util.function.DoubleBinaryOperator);
- method public int reduceEntriesToInt(long, @NonNull java.util.function.ToIntFunction<java.util.Map.Entry<K,V>>, int, @NonNull java.util.function.IntBinaryOperator);
- method public long reduceEntriesToLong(long, @NonNull java.util.function.ToLongFunction<java.util.Map.Entry<K,V>>, long, @NonNull java.util.function.LongBinaryOperator);
- method @Nullable public K reduceKeys(long, @NonNull java.util.function.BiFunction<? super K,? super K,? extends K>);
- method @Nullable public <U> U reduceKeys(long, @NonNull java.util.function.Function<? super K,? extends U>, @NonNull java.util.function.BiFunction<? super U,? super U,? extends U>);
- method public double reduceKeysToDouble(long, @NonNull java.util.function.ToDoubleFunction<? super K>, double, @NonNull java.util.function.DoubleBinaryOperator);
- method public int reduceKeysToInt(long, @NonNull java.util.function.ToIntFunction<? super K>, int, @NonNull java.util.function.IntBinaryOperator);
- method public long reduceKeysToLong(long, @NonNull java.util.function.ToLongFunction<? super K>, long, @NonNull java.util.function.LongBinaryOperator);
- method public double reduceToDouble(long, @NonNull java.util.function.ToDoubleBiFunction<? super K,? super V>, double, @NonNull java.util.function.DoubleBinaryOperator);
- method public int reduceToInt(long, @NonNull java.util.function.ToIntBiFunction<? super K,? super V>, int, @NonNull java.util.function.IntBinaryOperator);
- method public long reduceToLong(long, @NonNull java.util.function.ToLongBiFunction<? super K,? super V>, long, @NonNull java.util.function.LongBinaryOperator);
- method @Nullable public V reduceValues(long, @NonNull java.util.function.BiFunction<? super V,? super V,? extends V>);
- method @Nullable public <U> U reduceValues(long, @NonNull java.util.function.Function<? super V,? extends U>, @NonNull java.util.function.BiFunction<? super U,? super U,? extends U>);
- method public double reduceValuesToDouble(long, @NonNull java.util.function.ToDoubleFunction<? super V>, double, @NonNull java.util.function.DoubleBinaryOperator);
- method public int reduceValuesToInt(long, @NonNull java.util.function.ToIntFunction<? super V>, int, @NonNull java.util.function.IntBinaryOperator);
- method public long reduceValuesToLong(long, @NonNull java.util.function.ToLongFunction<? super V>, long, @NonNull java.util.function.LongBinaryOperator);
- method @Nullable public <U> U search(long, @NonNull java.util.function.BiFunction<? super K,? super V,? extends U>);
- method @Nullable public <U> U searchEntries(long, @NonNull java.util.function.Function<java.util.Map.Entry<K,V>,? extends U>);
- method @Nullable public <U> U searchKeys(long, @NonNull java.util.function.Function<? super K,? extends U>);
- method @Nullable public <U> U searchValues(long, @NonNull java.util.function.Function<? super V,? extends U>);
- }
-
- public static class ConcurrentHashMap.KeySetView<K, V> implements java.util.Collection<K> java.io.Serializable java.util.Set<K> {
- method public boolean add(@NonNull K);
- method public boolean addAll(@NonNull java.util.Collection<? extends K>);
- method public final void clear();
- method public boolean contains(@NonNull Object);
- method public final boolean containsAll(@NonNull java.util.Collection<?>);
- method public void forEach(@NonNull java.util.function.Consumer<? super K>);
- method @NonNull public java.util.concurrent.ConcurrentHashMap<K,V> getMap();
- method @Nullable public V getMappedValue();
- method public final boolean isEmpty();
- method @NonNull public java.util.Iterator<K> iterator();
- method public boolean remove(@NonNull Object);
- method public final boolean removeAll(@NonNull java.util.Collection<?>);
- method public final boolean retainAll(@NonNull java.util.Collection<?>);
- method public final int size();
- method @NonNull public java.util.Spliterator<K> spliterator();
- method @NonNull public final Object[] toArray();
- method @NonNull public final <T> T[] toArray(@NonNull T[]);
- method @NonNull public final String toString();
- }
-
- public class ConcurrentLinkedDeque<E> extends java.util.AbstractCollection<E> implements java.util.Deque<E> java.io.Serializable {
- ctor public ConcurrentLinkedDeque();
- ctor public ConcurrentLinkedDeque(java.util.Collection<? extends E>);
- method public void addFirst(E);
- method public void addLast(E);
- method public java.util.Iterator<E> descendingIterator();
- method public E element();
- method public E getFirst();
- method public E getLast();
- method public java.util.Iterator<E> iterator();
- method public boolean offer(E);
- method public boolean offerFirst(E);
- method public boolean offerLast(E);
- method public E peek();
- method public E peekFirst();
- method public E peekLast();
- method public E poll();
- method public E pollFirst();
- method public E pollLast();
- method public E pop();
- method public void push(E);
- method public E remove();
- method public E removeFirst();
- method public boolean removeFirstOccurrence(Object);
- method public E removeLast();
- method public boolean removeLastOccurrence(Object);
- method public int size();
- }
-
- public class ConcurrentLinkedQueue<E> extends java.util.AbstractQueue<E> implements java.util.Queue<E> java.io.Serializable {
- ctor public ConcurrentLinkedQueue();
- ctor public ConcurrentLinkedQueue(java.util.Collection<? extends E>);
- method public java.util.Iterator<E> iterator();
- method public boolean offer(E);
- method public E peek();
- method public E poll();
- method public int size();
- }
-
- public interface ConcurrentMap<K, V> extends java.util.Map<K,V> {
- method public V putIfAbsent(K, V);
- method public boolean remove(Object, Object);
- method public boolean replace(K, V, V);
- method public V replace(K, V);
- }
-
- public interface ConcurrentNavigableMap<K, V> extends java.util.concurrent.ConcurrentMap<K,V> java.util.NavigableMap<K,V> {
- method public java.util.concurrent.ConcurrentNavigableMap<K,V> descendingMap();
- method public java.util.concurrent.ConcurrentNavigableMap<K,V> headMap(K, boolean);
- method public java.util.concurrent.ConcurrentNavigableMap<K,V> headMap(K);
- method public java.util.NavigableSet<K> keySet();
- method public java.util.concurrent.ConcurrentNavigableMap<K,V> subMap(K, boolean, K, boolean);
- method public java.util.concurrent.ConcurrentNavigableMap<K,V> subMap(K, K);
- method public java.util.concurrent.ConcurrentNavigableMap<K,V> tailMap(K, boolean);
- method public java.util.concurrent.ConcurrentNavigableMap<K,V> tailMap(K);
- }
-
- public class ConcurrentSkipListMap<K, V> extends java.util.AbstractMap<K,V> implements java.lang.Cloneable java.util.concurrent.ConcurrentNavigableMap<K,V> java.io.Serializable {
- ctor public ConcurrentSkipListMap();
- ctor public ConcurrentSkipListMap(java.util.Comparator<? super K>);
- ctor public ConcurrentSkipListMap(java.util.Map<? extends K,? extends V>);
- ctor public ConcurrentSkipListMap(java.util.SortedMap<K,? extends V>);
- method public java.util.Map.Entry<K,V> ceilingEntry(K);
- method public K ceilingKey(K);
- method public java.util.concurrent.ConcurrentSkipListMap<K,V> clone();
- method public java.util.Comparator<? super K> comparator();
- method public java.util.NavigableSet<K> descendingKeySet();
- method public java.util.concurrent.ConcurrentNavigableMap<K,V> descendingMap();
- method public java.util.Set<java.util.Map.Entry<K,V>> entrySet();
- method public java.util.Map.Entry<K,V> firstEntry();
- method public K firstKey();
- method public java.util.Map.Entry<K,V> floorEntry(K);
- method public K floorKey(K);
- method public java.util.concurrent.ConcurrentNavigableMap<K,V> headMap(K, boolean);
- method public java.util.concurrent.ConcurrentNavigableMap<K,V> headMap(K);
- method public java.util.Map.Entry<K,V> higherEntry(K);
- method public K higherKey(K);
- method public java.util.NavigableSet<K> keySet();
- method public java.util.Map.Entry<K,V> lastEntry();
- method public K lastKey();
- method public java.util.Map.Entry<K,V> lowerEntry(K);
- method public K lowerKey(K);
- method public java.util.NavigableSet<K> navigableKeySet();
- method public java.util.Map.Entry<K,V> pollFirstEntry();
- method public java.util.Map.Entry<K,V> pollLastEntry();
- method public java.util.concurrent.ConcurrentNavigableMap<K,V> subMap(K, boolean, K, boolean);
- method public java.util.concurrent.ConcurrentNavigableMap<K,V> subMap(K, K);
- method public java.util.concurrent.ConcurrentNavigableMap<K,V> tailMap(K, boolean);
- method public java.util.concurrent.ConcurrentNavigableMap<K,V> tailMap(K);
- }
-
- public class ConcurrentSkipListSet<E> extends java.util.AbstractSet<E> implements java.lang.Cloneable java.util.NavigableSet<E> java.io.Serializable {
- ctor public ConcurrentSkipListSet();
- ctor public ConcurrentSkipListSet(java.util.Comparator<? super E>);
- ctor public ConcurrentSkipListSet(java.util.Collection<? extends E>);
- ctor public ConcurrentSkipListSet(java.util.SortedSet<E>);
- method public E ceiling(E);
- method public java.util.concurrent.ConcurrentSkipListSet<E> clone();
- method public java.util.Comparator<? super E> comparator();
- method public java.util.Iterator<E> descendingIterator();
- method public java.util.NavigableSet<E> descendingSet();
- method public E first();
- method public E floor(E);
- method public java.util.NavigableSet<E> headSet(E, boolean);
- method public java.util.NavigableSet<E> headSet(E);
- method public E higher(E);
- method public java.util.Iterator<E> iterator();
- method public E last();
- method public E lower(E);
- method public E pollFirst();
- method public E pollLast();
- method public int size();
- method public java.util.NavigableSet<E> subSet(E, boolean, E, boolean);
- method public java.util.NavigableSet<E> subSet(E, E);
- method public java.util.NavigableSet<E> tailSet(E, boolean);
- method public java.util.NavigableSet<E> tailSet(E);
- }
-
- public class CopyOnWriteArrayList<E> implements java.lang.Cloneable java.util.List<E> java.util.RandomAccess java.io.Serializable {
- ctor public CopyOnWriteArrayList();
- ctor public CopyOnWriteArrayList(@NonNull java.util.Collection<? extends E>);
- ctor public CopyOnWriteArrayList(@NonNull E[]);
- method public boolean add(E);
- method public void add(int, E);
- method public boolean addAll(@NonNull java.util.Collection<? extends E>);
- method public boolean addAll(int, @NonNull java.util.Collection<? extends E>);
- method public int addAllAbsent(@NonNull java.util.Collection<? extends E>);
- method public boolean addIfAbsent(E);
- method public void clear();
- method @NonNull public Object clone();
- method public boolean contains(@Nullable Object);
- method public boolean containsAll(@NonNull java.util.Collection<?>);
- method public void forEach(@NonNull java.util.function.Consumer<? super E>);
- method public E get(int);
- method public int indexOf(@Nullable Object);
- method public int indexOf(@Nullable E, int);
- method public boolean isEmpty();
- method @NonNull public java.util.Iterator<E> iterator();
- method public int lastIndexOf(@Nullable Object);
- method public int lastIndexOf(@Nullable E, int);
- method @NonNull public java.util.ListIterator<E> listIterator();
- method @NonNull public java.util.ListIterator<E> listIterator(int);
- method public E remove(int);
- method public boolean remove(@Nullable Object);
- method public boolean removeAll(@NonNull java.util.Collection<?>);
- method public boolean retainAll(@NonNull java.util.Collection<?>);
- method public E set(int, E);
- method public int size();
- method @NonNull public java.util.List<E> subList(int, int);
- method @NonNull public Object[] toArray();
- method @NonNull public <T> T[] toArray(@NonNull T[]);
- }
-
- public class CopyOnWriteArraySet<E> extends java.util.AbstractSet<E> implements java.io.Serializable {
- ctor public CopyOnWriteArraySet();
- ctor public CopyOnWriteArraySet(java.util.Collection<? extends E>);
- method public void forEach(java.util.function.Consumer<? super E>);
- method public java.util.Iterator<E> iterator();
- method public int size();
- }
-
- public class CountDownLatch {
- ctor public CountDownLatch(int);
- method public void await() throws java.lang.InterruptedException;
- method public boolean await(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public void countDown();
- method public long getCount();
- }
-
- public abstract class CountedCompleter<T> extends java.util.concurrent.ForkJoinTask<T> {
- ctor protected CountedCompleter(java.util.concurrent.CountedCompleter<?>, int);
- ctor protected CountedCompleter(java.util.concurrent.CountedCompleter<?>);
- ctor protected CountedCompleter();
- method public final void addToPendingCount(int);
- method public final boolean compareAndSetPendingCount(int, int);
- method public void complete(T);
- method public abstract void compute();
- method public final int decrementPendingCountUnlessZero();
- method protected final boolean exec();
- method public final java.util.concurrent.CountedCompleter<?> firstComplete();
- method public final java.util.concurrent.CountedCompleter<?> getCompleter();
- method public final int getPendingCount();
- method public T getRawResult();
- method public final java.util.concurrent.CountedCompleter<?> getRoot();
- method public final void helpComplete(int);
- method public final java.util.concurrent.CountedCompleter<?> nextComplete();
- method public void onCompletion(java.util.concurrent.CountedCompleter<?>);
- method public boolean onExceptionalCompletion(Throwable, java.util.concurrent.CountedCompleter<?>);
- method public final void propagateCompletion();
- method public final void quietlyCompleteRoot();
- method public final void setPendingCount(int);
- method protected void setRawResult(T);
- method public final void tryComplete();
- }
-
- public class CyclicBarrier {
- ctor public CyclicBarrier(int, Runnable);
- ctor public CyclicBarrier(int);
- method public int await() throws java.util.concurrent.BrokenBarrierException, java.lang.InterruptedException;
- method public int await(long, java.util.concurrent.TimeUnit) throws java.util.concurrent.BrokenBarrierException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
- method public int getNumberWaiting();
- method public int getParties();
- method public boolean isBroken();
- method public void reset();
- }
-
- public class DelayQueue<E extends java.util.concurrent.Delayed> extends java.util.AbstractQueue<E> implements java.util.concurrent.BlockingQueue<E> {
- ctor public DelayQueue();
- ctor public DelayQueue(java.util.Collection<? extends E>);
- method public int drainTo(java.util.Collection<? super E>);
- method public int drainTo(java.util.Collection<? super E>, int);
- method public java.util.Iterator<E> iterator();
- method public boolean offer(E);
- method public boolean offer(E, long, java.util.concurrent.TimeUnit);
- method public E peek();
- method public E poll();
- method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public void put(E);
- method public int remainingCapacity();
- method public int size();
- method public E take() throws java.lang.InterruptedException;
- }
-
- public interface Delayed extends java.lang.Comparable<java.util.concurrent.Delayed> {
- method public long getDelay(java.util.concurrent.TimeUnit);
- }
-
- public class Exchanger<V> {
- ctor public Exchanger();
- method public V exchange(V) throws java.lang.InterruptedException;
- method public V exchange(V, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException;
- }
-
- public class ExecutionException extends java.lang.Exception {
- ctor protected ExecutionException();
- ctor protected ExecutionException(String);
- ctor public ExecutionException(String, Throwable);
- ctor public ExecutionException(Throwable);
- }
-
- public interface Executor {
- method public void execute(Runnable);
- }
-
- public class ExecutorCompletionService<V> implements java.util.concurrent.CompletionService<V> {
- ctor public ExecutorCompletionService(java.util.concurrent.Executor);
- ctor public ExecutorCompletionService(java.util.concurrent.Executor, java.util.concurrent.BlockingQueue<java.util.concurrent.Future<V>>);
- method public java.util.concurrent.Future<V> poll();
- method public java.util.concurrent.Future<V> poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public java.util.concurrent.Future<V> submit(java.util.concurrent.Callable<V>);
- method public java.util.concurrent.Future<V> submit(Runnable, V);
- method public java.util.concurrent.Future<V> take() throws java.lang.InterruptedException;
- }
-
- public interface ExecutorService extends java.util.concurrent.Executor {
- method public boolean awaitTermination(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>>) throws java.lang.InterruptedException;
- method public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>>, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>>) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
- method public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>>, long, java.util.concurrent.TimeUnit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
- method public boolean isShutdown();
- method public boolean isTerminated();
- method public void shutdown();
- method public java.util.List<java.lang.Runnable> shutdownNow();
- method public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T>);
- method public <T> java.util.concurrent.Future<T> submit(Runnable, T);
- method public java.util.concurrent.Future<?> submit(Runnable);
- }
-
- public class Executors {
- method public static <T> java.util.concurrent.Callable<T> callable(Runnable, T);
- method public static java.util.concurrent.Callable<java.lang.Object> callable(Runnable);
- method public static java.util.concurrent.Callable<java.lang.Object> callable(java.security.PrivilegedAction<?>);
- method public static java.util.concurrent.Callable<java.lang.Object> callable(java.security.PrivilegedExceptionAction<?>);
- method public static java.util.concurrent.ThreadFactory defaultThreadFactory();
- method public static java.util.concurrent.ExecutorService newCachedThreadPool();
- method public static java.util.concurrent.ExecutorService newCachedThreadPool(java.util.concurrent.ThreadFactory);
- method public static java.util.concurrent.ExecutorService newFixedThreadPool(int);
- method public static java.util.concurrent.ExecutorService newFixedThreadPool(int, java.util.concurrent.ThreadFactory);
- method public static java.util.concurrent.ScheduledExecutorService newScheduledThreadPool(int);
- method public static java.util.concurrent.ScheduledExecutorService newScheduledThreadPool(int, java.util.concurrent.ThreadFactory);
- method public static java.util.concurrent.ExecutorService newSingleThreadExecutor();
- method public static java.util.concurrent.ExecutorService newSingleThreadExecutor(java.util.concurrent.ThreadFactory);
- method public static java.util.concurrent.ScheduledExecutorService newSingleThreadScheduledExecutor();
- method public static java.util.concurrent.ScheduledExecutorService newSingleThreadScheduledExecutor(java.util.concurrent.ThreadFactory);
- method public static java.util.concurrent.ExecutorService newWorkStealingPool(int);
- method public static java.util.concurrent.ExecutorService newWorkStealingPool();
- method public static <T> java.util.concurrent.Callable<T> privilegedCallable(java.util.concurrent.Callable<T>);
- method public static <T> java.util.concurrent.Callable<T> privilegedCallableUsingCurrentClassLoader(java.util.concurrent.Callable<T>);
- method public static java.util.concurrent.ThreadFactory privilegedThreadFactory();
- method public static java.util.concurrent.ExecutorService unconfigurableExecutorService(java.util.concurrent.ExecutorService);
- method public static java.util.concurrent.ScheduledExecutorService unconfigurableScheduledExecutorService(java.util.concurrent.ScheduledExecutorService);
- }
-
- public final class Flow {
- method public static int defaultBufferSize();
- }
-
- public static interface Flow.Processor<T, R> extends java.util.concurrent.Flow.Subscriber<T> java.util.concurrent.Flow.Publisher<R> {
- }
-
- @java.lang.FunctionalInterface public static interface Flow.Publisher<T> {
- method public void subscribe(java.util.concurrent.Flow.Subscriber<? super T>);
- }
-
- public static interface Flow.Subscriber<T> {
- method public void onComplete();
- method public void onError(Throwable);
- method public void onNext(T);
- method public void onSubscribe(java.util.concurrent.Flow.Subscription);
- }
-
- public static interface Flow.Subscription {
- method public void cancel();
- method public void request(long);
- }
-
- public class ForkJoinPool extends java.util.concurrent.AbstractExecutorService {
- ctor public ForkJoinPool();
- ctor public ForkJoinPool(int);
- ctor public ForkJoinPool(int, java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory, java.lang.Thread.UncaughtExceptionHandler, boolean);
- method public boolean awaitQuiescence(long, java.util.concurrent.TimeUnit);
- method public boolean awaitTermination(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public static java.util.concurrent.ForkJoinPool commonPool();
- method protected int drainTasksTo(java.util.Collection<? super java.util.concurrent.ForkJoinTask<?>>);
- method public void execute(java.util.concurrent.ForkJoinTask<?>);
- method public void execute(Runnable);
- method public int getActiveThreadCount();
- method public boolean getAsyncMode();
- method public static int getCommonPoolParallelism();
- method public java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory getFactory();
- method public int getParallelism();
- method public int getPoolSize();
- method public int getQueuedSubmissionCount();
- method public long getQueuedTaskCount();
- method public int getRunningThreadCount();
- method public long getStealCount();
- method public java.lang.Thread.UncaughtExceptionHandler getUncaughtExceptionHandler();
- method public boolean hasQueuedSubmissions();
- method public <T> T invoke(java.util.concurrent.ForkJoinTask<T>);
- method public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>>);
- method public boolean isQuiescent();
- method public boolean isShutdown();
- method public boolean isTerminated();
- method public boolean isTerminating();
- method public static void managedBlock(java.util.concurrent.ForkJoinPool.ManagedBlocker) throws java.lang.InterruptedException;
- method protected java.util.concurrent.ForkJoinTask<?> pollSubmission();
- method public void shutdown();
- method public java.util.List<java.lang.Runnable> shutdownNow();
- method public <T> java.util.concurrent.ForkJoinTask<T> submit(java.util.concurrent.ForkJoinTask<T>);
- method public <T> java.util.concurrent.ForkJoinTask<T> submit(java.util.concurrent.Callable<T>);
- method public <T> java.util.concurrent.ForkJoinTask<T> submit(Runnable, T);
- method public java.util.concurrent.ForkJoinTask<?> submit(Runnable);
- field public static final java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory defaultForkJoinWorkerThreadFactory;
- }
-
- public static interface ForkJoinPool.ForkJoinWorkerThreadFactory {
- method public java.util.concurrent.ForkJoinWorkerThread newThread(java.util.concurrent.ForkJoinPool);
- }
-
- public static interface ForkJoinPool.ManagedBlocker {
- method public boolean block() throws java.lang.InterruptedException;
- method public boolean isReleasable();
- }
-
- public abstract class ForkJoinTask<V> implements java.util.concurrent.Future<V> java.io.Serializable {
- ctor public ForkJoinTask();
- method public static java.util.concurrent.ForkJoinTask<?> adapt(Runnable);
- method public static <T> java.util.concurrent.ForkJoinTask<T> adapt(Runnable, T);
- method public static <T> java.util.concurrent.ForkJoinTask<T> adapt(java.util.concurrent.Callable<? extends T>);
- method public boolean cancel(boolean);
- method public final boolean compareAndSetForkJoinTaskTag(short, short);
- method public void complete(V);
- method public void completeExceptionally(Throwable);
- method protected abstract boolean exec();
- method public final java.util.concurrent.ForkJoinTask<V> fork();
- method public final V get() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
- method public final V get(long, java.util.concurrent.TimeUnit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
- method public final Throwable getException();
- method public final short getForkJoinTaskTag();
- method public static java.util.concurrent.ForkJoinPool getPool();
- method public static int getQueuedTaskCount();
- method public abstract V getRawResult();
- method public static int getSurplusQueuedTaskCount();
- method public static void helpQuiesce();
- method public static boolean inForkJoinPool();
- method public final V invoke();
- method public static void invokeAll(java.util.concurrent.ForkJoinTask<?>, java.util.concurrent.ForkJoinTask<?>);
- method public static void invokeAll(java.util.concurrent.ForkJoinTask<?>...);
- method public static <T extends java.util.concurrent.ForkJoinTask<?>> java.util.Collection<T> invokeAll(java.util.Collection<T>);
- method public final boolean isCancelled();
- method public final boolean isCompletedAbnormally();
- method public final boolean isCompletedNormally();
- method public final boolean isDone();
- method public final V join();
- method protected static java.util.concurrent.ForkJoinTask<?> peekNextLocalTask();
- method protected static java.util.concurrent.ForkJoinTask<?> pollNextLocalTask();
- method protected static java.util.concurrent.ForkJoinTask<?> pollTask();
- method public final void quietlyComplete();
- method public final void quietlyInvoke();
- method public final void quietlyJoin();
- method public void reinitialize();
- method public final short setForkJoinTaskTag(short);
- method protected abstract void setRawResult(V);
- method public boolean tryUnfork();
- }
-
- public class ForkJoinWorkerThread extends java.lang.Thread {
- ctor protected ForkJoinWorkerThread(java.util.concurrent.ForkJoinPool);
- method public java.util.concurrent.ForkJoinPool getPool();
- method public int getPoolIndex();
- method protected void onStart();
- method protected void onTermination(Throwable);
- }
-
- public interface Future<V> {
- method public boolean cancel(boolean);
- method public V get() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
- method public V get(long, java.util.concurrent.TimeUnit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
- method public boolean isCancelled();
- method public boolean isDone();
- }
-
- public class FutureTask<V> implements java.util.concurrent.RunnableFuture<V> {
- ctor public FutureTask(java.util.concurrent.Callable<V>);
- ctor public FutureTask(Runnable, V);
- method public boolean cancel(boolean);
- method protected void done();
- method public V get() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException;
- method public V get(long, java.util.concurrent.TimeUnit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException;
- method public boolean isCancelled();
- method public boolean isDone();
- method public void run();
- method protected boolean runAndReset();
- method protected void set(V);
- method protected void setException(Throwable);
- }
-
- public class LinkedBlockingDeque<E> extends java.util.AbstractQueue<E> implements java.util.concurrent.BlockingDeque<E> java.io.Serializable {
- ctor public LinkedBlockingDeque();
- ctor public LinkedBlockingDeque(int);
- ctor public LinkedBlockingDeque(java.util.Collection<? extends E>);
- method public void addFirst(E);
- method public void addLast(E);
- method public java.util.Iterator<E> descendingIterator();
- method public int drainTo(java.util.Collection<? super E>);
- method public int drainTo(java.util.Collection<? super E>, int);
- method public E getFirst();
- method public E getLast();
- method public java.util.Iterator<E> iterator();
- method public boolean offer(E);
- method public boolean offer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public boolean offerFirst(E);
- method public boolean offerFirst(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public boolean offerLast(E);
- method public boolean offerLast(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public E peek();
- method public E peekFirst();
- method public E peekLast();
- method public E poll();
- method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public E pollFirst();
- method public E pollFirst(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public E pollLast();
- method public E pollLast(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public E pop();
- method public void push(E);
- method public void put(E) throws java.lang.InterruptedException;
- method public void putFirst(E) throws java.lang.InterruptedException;
- method public void putLast(E) throws java.lang.InterruptedException;
- method public int remainingCapacity();
- method public E removeFirst();
- method public boolean removeFirstOccurrence(Object);
- method public E removeLast();
- method public boolean removeLastOccurrence(Object);
- method public int size();
- method public E take() throws java.lang.InterruptedException;
- method public E takeFirst() throws java.lang.InterruptedException;
- method public E takeLast() throws java.lang.InterruptedException;
- }
-
- public class LinkedBlockingQueue<E> extends java.util.AbstractQueue<E> implements java.util.concurrent.BlockingQueue<E> java.io.Serializable {
- ctor public LinkedBlockingQueue();
- ctor public LinkedBlockingQueue(int);
- ctor public LinkedBlockingQueue(java.util.Collection<? extends E>);
- method public int drainTo(java.util.Collection<? super E>);
- method public int drainTo(java.util.Collection<? super E>, int);
- method public java.util.Iterator<E> iterator();
- method public boolean offer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public boolean offer(E);
- method public E peek();
- method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public E poll();
- method public void put(E) throws java.lang.InterruptedException;
- method public int remainingCapacity();
- method public int size();
- method public E take() throws java.lang.InterruptedException;
- }
-
- public class LinkedTransferQueue<E> extends java.util.AbstractQueue<E> implements java.io.Serializable java.util.concurrent.TransferQueue<E> {
- ctor public LinkedTransferQueue();
- ctor public LinkedTransferQueue(java.util.Collection<? extends E>);
- method public int drainTo(java.util.Collection<? super E>);
- method public int drainTo(java.util.Collection<? super E>, int);
- method public int getWaitingConsumerCount();
- method public boolean hasWaitingConsumer();
- method public java.util.Iterator<E> iterator();
- method public boolean offer(E, long, java.util.concurrent.TimeUnit);
- method public boolean offer(E);
- method public E peek();
- method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public E poll();
- method public void put(E);
- method public int remainingCapacity();
- method public int size();
- method public E take() throws java.lang.InterruptedException;
- method public void transfer(E) throws java.lang.InterruptedException;
- method public boolean tryTransfer(E);
- method public boolean tryTransfer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- }
-
- public class Phaser {
- ctor public Phaser();
- ctor public Phaser(int);
- ctor public Phaser(java.util.concurrent.Phaser);
- ctor public Phaser(java.util.concurrent.Phaser, int);
- method public int arrive();
- method public int arriveAndAwaitAdvance();
- method public int arriveAndDeregister();
- method public int awaitAdvance(int);
- method public int awaitAdvanceInterruptibly(int) throws java.lang.InterruptedException;
- method public int awaitAdvanceInterruptibly(int, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException;
- method public int bulkRegister(int);
- method public void forceTermination();
- method public int getArrivedParties();
- method public java.util.concurrent.Phaser getParent();
- method public final int getPhase();
- method public int getRegisteredParties();
- method public java.util.concurrent.Phaser getRoot();
- method public int getUnarrivedParties();
- method public boolean isTerminated();
- method protected boolean onAdvance(int, int);
- method public int register();
- }
-
- public class PriorityBlockingQueue<E> extends java.util.AbstractQueue<E> implements java.util.concurrent.BlockingQueue<E> java.io.Serializable {
- ctor public PriorityBlockingQueue();
- ctor public PriorityBlockingQueue(int);
- ctor public PriorityBlockingQueue(int, java.util.Comparator<? super E>);
- ctor public PriorityBlockingQueue(java.util.Collection<? extends E>);
- method public java.util.Comparator<? super E> comparator();
- method public int drainTo(java.util.Collection<? super E>);
- method public int drainTo(java.util.Collection<? super E>, int);
- method public java.util.Iterator<E> iterator();
- method public boolean offer(E);
- method public boolean offer(E, long, java.util.concurrent.TimeUnit);
- method public E peek();
- method public E poll();
- method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public void put(E);
- method public int remainingCapacity();
- method public int size();
- method public E take() throws java.lang.InterruptedException;
- }
-
- public abstract class RecursiveAction extends java.util.concurrent.ForkJoinTask<java.lang.Void> {
- ctor public RecursiveAction();
- method protected abstract void compute();
- method protected final boolean exec();
- method public final Void getRawResult();
- method protected final void setRawResult(Void);
- }
-
- public abstract class RecursiveTask<V> extends java.util.concurrent.ForkJoinTask<V> {
- ctor public RecursiveTask();
- method protected abstract V compute();
- method protected final boolean exec();
- method public final V getRawResult();
- method protected final void setRawResult(V);
- }
-
- public class RejectedExecutionException extends java.lang.RuntimeException {
- ctor public RejectedExecutionException();
- ctor public RejectedExecutionException(String);
- ctor public RejectedExecutionException(String, Throwable);
- ctor public RejectedExecutionException(Throwable);
- }
-
- public interface RejectedExecutionHandler {
- method public void rejectedExecution(Runnable, java.util.concurrent.ThreadPoolExecutor);
- }
-
- public interface RunnableFuture<V> extends java.lang.Runnable java.util.concurrent.Future<V> {
- }
-
- public interface RunnableScheduledFuture<V> extends java.util.concurrent.RunnableFuture<V> java.util.concurrent.ScheduledFuture<V> {
- method public boolean isPeriodic();
- }
-
- public interface ScheduledExecutorService extends java.util.concurrent.ExecutorService {
- method public java.util.concurrent.ScheduledFuture<?> schedule(Runnable, long, java.util.concurrent.TimeUnit);
- method public <V> java.util.concurrent.ScheduledFuture<V> schedule(java.util.concurrent.Callable<V>, long, java.util.concurrent.TimeUnit);
- method public java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(Runnable, long, long, java.util.concurrent.TimeUnit);
- method public java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(Runnable, long, long, java.util.concurrent.TimeUnit);
- }
-
- public interface ScheduledFuture<V> extends java.util.concurrent.Delayed java.util.concurrent.Future<V> {
- }
-
- public class ScheduledThreadPoolExecutor extends java.util.concurrent.ThreadPoolExecutor implements java.util.concurrent.ScheduledExecutorService {
- ctor public ScheduledThreadPoolExecutor(int);
- ctor public ScheduledThreadPoolExecutor(int, java.util.concurrent.ThreadFactory);
- ctor public ScheduledThreadPoolExecutor(int, java.util.concurrent.RejectedExecutionHandler);
- ctor public ScheduledThreadPoolExecutor(int, java.util.concurrent.ThreadFactory, java.util.concurrent.RejectedExecutionHandler);
- method protected <V> java.util.concurrent.RunnableScheduledFuture<V> decorateTask(Runnable, java.util.concurrent.RunnableScheduledFuture<V>);
- method protected <V> java.util.concurrent.RunnableScheduledFuture<V> decorateTask(java.util.concurrent.Callable<V>, java.util.concurrent.RunnableScheduledFuture<V>);
- method public boolean getContinueExistingPeriodicTasksAfterShutdownPolicy();
- method public boolean getExecuteExistingDelayedTasksAfterShutdownPolicy();
- method public boolean getRemoveOnCancelPolicy();
- method public java.util.concurrent.ScheduledFuture<?> schedule(Runnable, long, java.util.concurrent.TimeUnit);
- method public <V> java.util.concurrent.ScheduledFuture<V> schedule(java.util.concurrent.Callable<V>, long, java.util.concurrent.TimeUnit);
- method public java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(Runnable, long, long, java.util.concurrent.TimeUnit);
- method public java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(Runnable, long, long, java.util.concurrent.TimeUnit);
- method public void setContinueExistingPeriodicTasksAfterShutdownPolicy(boolean);
- method public void setExecuteExistingDelayedTasksAfterShutdownPolicy(boolean);
- method public void setRemoveOnCancelPolicy(boolean);
- }
-
- public class Semaphore implements java.io.Serializable {
- ctor public Semaphore(int);
- ctor public Semaphore(int, boolean);
- method public void acquire() throws java.lang.InterruptedException;
- method public void acquire(int) throws java.lang.InterruptedException;
- method public void acquireUninterruptibly();
- method public void acquireUninterruptibly(int);
- method public int availablePermits();
- method public int drainPermits();
- method public final int getQueueLength();
- method protected java.util.Collection<java.lang.Thread> getQueuedThreads();
- method public final boolean hasQueuedThreads();
- method public boolean isFair();
- method protected void reducePermits(int);
- method public void release();
- method public void release(int);
- method public boolean tryAcquire();
- method public boolean tryAcquire(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public boolean tryAcquire(int);
- method public boolean tryAcquire(int, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- }
-
- public class SynchronousQueue<E> extends java.util.AbstractQueue<E> implements java.util.concurrent.BlockingQueue<E> java.io.Serializable {
- ctor public SynchronousQueue();
- ctor public SynchronousQueue(boolean);
- method public int drainTo(java.util.Collection<? super E>);
- method public int drainTo(java.util.Collection<? super E>, int);
- method public java.util.Iterator<E> iterator();
- method public boolean offer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public boolean offer(E);
- method public E peek();
- method public E poll(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public E poll();
- method public void put(E) throws java.lang.InterruptedException;
- method public int remainingCapacity();
- method public int size();
- method public E take() throws java.lang.InterruptedException;
- }
-
- public interface ThreadFactory {
- method public Thread newThread(Runnable);
- }
-
- public class ThreadLocalRandom extends java.util.Random {
- method public static java.util.concurrent.ThreadLocalRandom current();
- method public double nextDouble(double);
- method public double nextDouble(double, double);
- method public int nextInt(int, int);
- method public long nextLong(long);
- method public long nextLong(long, long);
- }
-
- public class ThreadPoolExecutor extends java.util.concurrent.AbstractExecutorService {
- ctor public ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>);
- ctor public ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>, java.util.concurrent.ThreadFactory);
- ctor public ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>, java.util.concurrent.RejectedExecutionHandler);
- ctor public ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>, java.util.concurrent.ThreadFactory, java.util.concurrent.RejectedExecutionHandler);
- method protected void afterExecute(Runnable, Throwable);
- method public void allowCoreThreadTimeOut(boolean);
- method public boolean allowsCoreThreadTimeOut();
- method public boolean awaitTermination(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method protected void beforeExecute(Thread, Runnable);
- method public void execute(Runnable);
- method protected void finalize();
- method public int getActiveCount();
- method public long getCompletedTaskCount();
- method public int getCorePoolSize();
- method public long getKeepAliveTime(java.util.concurrent.TimeUnit);
- method public int getLargestPoolSize();
- method public int getMaximumPoolSize();
- method public int getPoolSize();
- method public java.util.concurrent.BlockingQueue<java.lang.Runnable> getQueue();
- method public java.util.concurrent.RejectedExecutionHandler getRejectedExecutionHandler();
- method public long getTaskCount();
- method public java.util.concurrent.ThreadFactory getThreadFactory();
- method public boolean isShutdown();
- method public boolean isTerminated();
- method public boolean isTerminating();
- method public int prestartAllCoreThreads();
- method public boolean prestartCoreThread();
- method public void purge();
- method public boolean remove(Runnable);
- method public void setCorePoolSize(int);
- method public void setKeepAliveTime(long, java.util.concurrent.TimeUnit);
- method public void setMaximumPoolSize(int);
- method public void setRejectedExecutionHandler(java.util.concurrent.RejectedExecutionHandler);
- method public void setThreadFactory(java.util.concurrent.ThreadFactory);
- method public void shutdown();
- method public java.util.List<java.lang.Runnable> shutdownNow();
- method protected void terminated();
- }
-
- public static class ThreadPoolExecutor.AbortPolicy implements java.util.concurrent.RejectedExecutionHandler {
- ctor public ThreadPoolExecutor.AbortPolicy();
- method public void rejectedExecution(Runnable, java.util.concurrent.ThreadPoolExecutor);
- }
-
- public static class ThreadPoolExecutor.CallerRunsPolicy implements java.util.concurrent.RejectedExecutionHandler {
- ctor public ThreadPoolExecutor.CallerRunsPolicy();
- method public void rejectedExecution(Runnable, java.util.concurrent.ThreadPoolExecutor);
- }
-
- public static class ThreadPoolExecutor.DiscardOldestPolicy implements java.util.concurrent.RejectedExecutionHandler {
- ctor public ThreadPoolExecutor.DiscardOldestPolicy();
- method public void rejectedExecution(Runnable, java.util.concurrent.ThreadPoolExecutor);
- }
-
- public static class ThreadPoolExecutor.DiscardPolicy implements java.util.concurrent.RejectedExecutionHandler {
- ctor public ThreadPoolExecutor.DiscardPolicy();
- method public void rejectedExecution(Runnable, java.util.concurrent.ThreadPoolExecutor);
- }
-
- public enum TimeUnit {
- method public long convert(long, java.util.concurrent.TimeUnit);
- method public void sleep(long) throws java.lang.InterruptedException;
- method public void timedJoin(Thread, long) throws java.lang.InterruptedException;
- method public void timedWait(Object, long) throws java.lang.InterruptedException;
- method public long toDays(long);
- method public long toHours(long);
- method public long toMicros(long);
- method public long toMillis(long);
- method public long toMinutes(long);
- method public long toNanos(long);
- method public long toSeconds(long);
- enum_constant public static final java.util.concurrent.TimeUnit DAYS;
- enum_constant public static final java.util.concurrent.TimeUnit HOURS;
- enum_constant public static final java.util.concurrent.TimeUnit MICROSECONDS;
- enum_constant public static final java.util.concurrent.TimeUnit MILLISECONDS;
- enum_constant public static final java.util.concurrent.TimeUnit MINUTES;
- enum_constant public static final java.util.concurrent.TimeUnit NANOSECONDS;
- enum_constant public static final java.util.concurrent.TimeUnit SECONDS;
- }
-
- public class TimeoutException extends java.lang.Exception {
- ctor public TimeoutException();
- ctor public TimeoutException(String);
- }
-
- public interface TransferQueue<E> extends java.util.concurrent.BlockingQueue<E> {
- method public int getWaitingConsumerCount();
- method public boolean hasWaitingConsumer();
- method public void transfer(E) throws java.lang.InterruptedException;
- method public boolean tryTransfer(E);
- method public boolean tryTransfer(E, long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- }
-
-}
-
-package java.util.concurrent.atomic {
-
- public class AtomicBoolean implements java.io.Serializable {
- ctor public AtomicBoolean(boolean);
- ctor public AtomicBoolean();
- method public final boolean compareAndSet(boolean, boolean);
- method public final boolean get();
- method public final boolean getAndSet(boolean);
- method public final void lazySet(boolean);
- method public final void set(boolean);
- method public boolean weakCompareAndSet(boolean, boolean);
- }
-
- public class AtomicInteger extends java.lang.Number implements java.io.Serializable {
- ctor public AtomicInteger(int);
- ctor public AtomicInteger();
- method public final int accumulateAndGet(int, java.util.function.IntBinaryOperator);
- method public final int addAndGet(int);
- method public final boolean compareAndSet(int, int);
- method public final int decrementAndGet();
- method public double doubleValue();
- method public float floatValue();
- method public final int get();
- method public final int getAndAccumulate(int, java.util.function.IntBinaryOperator);
- method public final int getAndAdd(int);
- method public final int getAndDecrement();
- method public final int getAndIncrement();
- method public final int getAndSet(int);
- method public final int getAndUpdate(java.util.function.IntUnaryOperator);
- method public final int incrementAndGet();
- method public int intValue();
- method public final void lazySet(int);
- method public long longValue();
- method public final void set(int);
- method public final int updateAndGet(java.util.function.IntUnaryOperator);
- method public final boolean weakCompareAndSet(int, int);
- }
-
- public class AtomicIntegerArray implements java.io.Serializable {
- ctor public AtomicIntegerArray(int);
- ctor public AtomicIntegerArray(int[]);
- method public final int accumulateAndGet(int, int, java.util.function.IntBinaryOperator);
- method public final int addAndGet(int, int);
- method public final boolean compareAndSet(int, int, int);
- method public final int decrementAndGet(int);
- method public final int get(int);
- method public final int getAndAccumulate(int, int, java.util.function.IntBinaryOperator);
- method public final int getAndAdd(int, int);
- method public final int getAndDecrement(int);
- method public final int getAndIncrement(int);
- method public final int getAndSet(int, int);
- method public final int getAndUpdate(int, java.util.function.IntUnaryOperator);
- method public final int incrementAndGet(int);
- method public final void lazySet(int, int);
- method public final int length();
- method public final void set(int, int);
- method public final int updateAndGet(int, java.util.function.IntUnaryOperator);
- method public final boolean weakCompareAndSet(int, int, int);
- }
-
- public abstract class AtomicIntegerFieldUpdater<T> {
- ctor protected AtomicIntegerFieldUpdater();
- method public final int accumulateAndGet(T, int, java.util.function.IntBinaryOperator);
- method public int addAndGet(T, int);
- method public abstract boolean compareAndSet(T, int, int);
- method public int decrementAndGet(T);
- method public abstract int get(T);
- method public final int getAndAccumulate(T, int, java.util.function.IntBinaryOperator);
- method public int getAndAdd(T, int);
- method public int getAndDecrement(T);
- method public int getAndIncrement(T);
- method public int getAndSet(T, int);
- method public final int getAndUpdate(T, java.util.function.IntUnaryOperator);
- method public int incrementAndGet(T);
- method public abstract void lazySet(T, int);
- method public static <U> java.util.concurrent.atomic.AtomicIntegerFieldUpdater<U> newUpdater(Class<U>, String);
- method public abstract void set(T, int);
- method public final int updateAndGet(T, java.util.function.IntUnaryOperator);
- method public abstract boolean weakCompareAndSet(T, int, int);
- }
-
- public class AtomicLong extends java.lang.Number implements java.io.Serializable {
- ctor public AtomicLong(long);
- ctor public AtomicLong();
- method public final long accumulateAndGet(long, java.util.function.LongBinaryOperator);
- method public final long addAndGet(long);
- method public final boolean compareAndSet(long, long);
- method public final long decrementAndGet();
- method public double doubleValue();
- method public float floatValue();
- method public final long get();
- method public final long getAndAccumulate(long, java.util.function.LongBinaryOperator);
- method public final long getAndAdd(long);
- method public final long getAndDecrement();
- method public final long getAndIncrement();
- method public final long getAndSet(long);
- method public final long getAndUpdate(java.util.function.LongUnaryOperator);
- method public final long incrementAndGet();
- method public int intValue();
- method public final void lazySet(long);
- method public long longValue();
- method public final void set(long);
- method public final long updateAndGet(java.util.function.LongUnaryOperator);
- method public final boolean weakCompareAndSet(long, long);
- }
-
- public class AtomicLongArray implements java.io.Serializable {
- ctor public AtomicLongArray(int);
- ctor public AtomicLongArray(long[]);
- method public final long accumulateAndGet(int, long, java.util.function.LongBinaryOperator);
- method public long addAndGet(int, long);
- method public final boolean compareAndSet(int, long, long);
- method public final long decrementAndGet(int);
- method public final long get(int);
- method public final long getAndAccumulate(int, long, java.util.function.LongBinaryOperator);
- method public final long getAndAdd(int, long);
- method public final long getAndDecrement(int);
- method public final long getAndIncrement(int);
- method public final long getAndSet(int, long);
- method public final long getAndUpdate(int, java.util.function.LongUnaryOperator);
- method public final long incrementAndGet(int);
- method public final void lazySet(int, long);
- method public final int length();
- method public final void set(int, long);
- method public final long updateAndGet(int, java.util.function.LongUnaryOperator);
- method public final boolean weakCompareAndSet(int, long, long);
- }
-
- public abstract class AtomicLongFieldUpdater<T> {
- ctor protected AtomicLongFieldUpdater();
- method public final long accumulateAndGet(T, long, java.util.function.LongBinaryOperator);
- method public long addAndGet(T, long);
- method public abstract boolean compareAndSet(T, long, long);
- method public long decrementAndGet(T);
- method public abstract long get(T);
- method public final long getAndAccumulate(T, long, java.util.function.LongBinaryOperator);
- method public long getAndAdd(T, long);
- method public long getAndDecrement(T);
- method public long getAndIncrement(T);
- method public long getAndSet(T, long);
- method public final long getAndUpdate(T, java.util.function.LongUnaryOperator);
- method public long incrementAndGet(T);
- method public abstract void lazySet(T, long);
- method public static <U> java.util.concurrent.atomic.AtomicLongFieldUpdater<U> newUpdater(Class<U>, String);
- method public abstract void set(T, long);
- method public final long updateAndGet(T, java.util.function.LongUnaryOperator);
- method public abstract boolean weakCompareAndSet(T, long, long);
- }
-
- public class AtomicMarkableReference<V> {
- ctor public AtomicMarkableReference(V, boolean);
- method public boolean attemptMark(V, boolean);
- method public boolean compareAndSet(V, V, boolean, boolean);
- method public V get(boolean[]);
- method public V getReference();
- method public boolean isMarked();
- method public void set(V, boolean);
- method public boolean weakCompareAndSet(V, V, boolean, boolean);
- }
-
- public class AtomicReference<V> implements java.io.Serializable {
- ctor public AtomicReference(V);
- ctor public AtomicReference();
- method public final V accumulateAndGet(V, java.util.function.BinaryOperator<V>);
- method public final boolean compareAndSet(V, V);
- method public final V get();
- method public final V getAndAccumulate(V, java.util.function.BinaryOperator<V>);
- method public final V getAndSet(V);
- method public final V getAndUpdate(java.util.function.UnaryOperator<V>);
- method public final void lazySet(V);
- method public final void set(V);
- method public final V updateAndGet(java.util.function.UnaryOperator<V>);
- method public final boolean weakCompareAndSet(V, V);
- }
-
- public class AtomicReferenceArray<E> implements java.io.Serializable {
- ctor public AtomicReferenceArray(int);
- ctor public AtomicReferenceArray(E[]);
- method public final E accumulateAndGet(int, E, java.util.function.BinaryOperator<E>);
- method public final boolean compareAndSet(int, E, E);
- method public final E get(int);
- method public final E getAndAccumulate(int, E, java.util.function.BinaryOperator<E>);
- method public final E getAndSet(int, E);
- method public final E getAndUpdate(int, java.util.function.UnaryOperator<E>);
- method public final void lazySet(int, E);
- method public final int length();
- method public final void set(int, E);
- method public final E updateAndGet(int, java.util.function.UnaryOperator<E>);
- method public final boolean weakCompareAndSet(int, E, E);
- }
-
- public abstract class AtomicReferenceFieldUpdater<T, V> {
- ctor protected AtomicReferenceFieldUpdater();
- method public final V accumulateAndGet(T, V, java.util.function.BinaryOperator<V>);
- method public abstract boolean compareAndSet(T, V, V);
- method public abstract V get(T);
- method public final V getAndAccumulate(T, V, java.util.function.BinaryOperator<V>);
- method public V getAndSet(T, V);
- method public final V getAndUpdate(T, java.util.function.UnaryOperator<V>);
- method public abstract void lazySet(T, V);
- method public static <U, W> java.util.concurrent.atomic.AtomicReferenceFieldUpdater<U,W> newUpdater(Class<U>, Class<W>, String);
- method public abstract void set(T, V);
- method public final V updateAndGet(T, java.util.function.UnaryOperator<V>);
- method public abstract boolean weakCompareAndSet(T, V, V);
- }
-
- public class AtomicStampedReference<V> {
- ctor public AtomicStampedReference(V, int);
- method public boolean attemptStamp(V, int);
- method public boolean compareAndSet(V, V, int, int);
- method public V get(int[]);
- method public V getReference();
- method public int getStamp();
- method public void set(V, int);
- method public boolean weakCompareAndSet(V, V, int, int);
- }
-
- public class DoubleAccumulator extends java.lang.Number implements java.io.Serializable {
- ctor public DoubleAccumulator(java.util.function.DoubleBinaryOperator, double);
- method public void accumulate(double);
- method public double doubleValue();
- method public float floatValue();
- method public double get();
- method public double getThenReset();
- method public int intValue();
- method public long longValue();
- method public void reset();
- }
-
- public class DoubleAdder extends java.lang.Number implements java.io.Serializable {
- ctor public DoubleAdder();
- method public void add(double);
- method public double doubleValue();
- method public float floatValue();
- method public int intValue();
- method public long longValue();
- method public void reset();
- method public double sum();
- method public double sumThenReset();
- }
-
- public class LongAccumulator extends java.lang.Number implements java.io.Serializable {
- ctor public LongAccumulator(java.util.function.LongBinaryOperator, long);
- method public void accumulate(long);
- method public double doubleValue();
- method public float floatValue();
- method public long get();
- method public long getThenReset();
- method public int intValue();
- method public long longValue();
- method public void reset();
- }
-
- public class LongAdder extends java.lang.Number implements java.io.Serializable {
- ctor public LongAdder();
- method public void add(long);
- method public void decrement();
- method public double doubleValue();
- method public float floatValue();
- method public void increment();
- method public int intValue();
- method public long longValue();
- method public void reset();
- method public long sum();
- method public long sumThenReset();
- }
-
-}
-
-package java.util.concurrent.locks {
-
- public abstract class AbstractOwnableSynchronizer implements java.io.Serializable {
- ctor protected AbstractOwnableSynchronizer();
- method protected final Thread getExclusiveOwnerThread();
- method protected final void setExclusiveOwnerThread(Thread);
- }
-
- public abstract class AbstractQueuedLongSynchronizer extends java.util.concurrent.locks.AbstractOwnableSynchronizer implements java.io.Serializable {
- ctor protected AbstractQueuedLongSynchronizer();
- method public final void acquire(long);
- method public final void acquireInterruptibly(long) throws java.lang.InterruptedException;
- method public final void acquireShared(long);
- method public final void acquireSharedInterruptibly(long) throws java.lang.InterruptedException;
- method protected final boolean compareAndSetState(long, long);
- method public final java.util.Collection<java.lang.Thread> getExclusiveQueuedThreads();
- method public final Thread getFirstQueuedThread();
- method public final int getQueueLength();
- method public final java.util.Collection<java.lang.Thread> getQueuedThreads();
- method public final java.util.Collection<java.lang.Thread> getSharedQueuedThreads();
- method protected final long getState();
- method public final int getWaitQueueLength(java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject);
- method public final java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject);
- method public final boolean hasContended();
- method public final boolean hasQueuedPredecessors();
- method public final boolean hasQueuedThreads();
- method public final boolean hasWaiters(java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject);
- method protected boolean isHeldExclusively();
- method public final boolean isQueued(Thread);
- method public final boolean owns(java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject);
- method public final boolean release(long);
- method public final boolean releaseShared(long);
- method protected final void setState(long);
- method protected boolean tryAcquire(long);
- method public final boolean tryAcquireNanos(long, long) throws java.lang.InterruptedException;
- method protected long tryAcquireShared(long);
- method public final boolean tryAcquireSharedNanos(long, long) throws java.lang.InterruptedException;
- method protected boolean tryRelease(long);
- method protected boolean tryReleaseShared(long);
- }
-
- public class AbstractQueuedLongSynchronizer.ConditionObject implements java.util.concurrent.locks.Condition java.io.Serializable {
- ctor public AbstractQueuedLongSynchronizer.ConditionObject();
- method public final void await() throws java.lang.InterruptedException;
- method public final boolean await(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public final long awaitNanos(long) throws java.lang.InterruptedException;
- method public final void awaitUninterruptibly();
- method public final boolean awaitUntil(java.util.Date) throws java.lang.InterruptedException;
- method protected final int getWaitQueueLength();
- method protected final java.util.Collection<java.lang.Thread> getWaitingThreads();
- method protected final boolean hasWaiters();
- method public final void signal();
- method public final void signalAll();
- }
-
- public abstract class AbstractQueuedSynchronizer extends java.util.concurrent.locks.AbstractOwnableSynchronizer implements java.io.Serializable {
- ctor protected AbstractQueuedSynchronizer();
- method public final void acquire(int);
- method public final void acquireInterruptibly(int) throws java.lang.InterruptedException;
- method public final void acquireShared(int);
- method public final void acquireSharedInterruptibly(int) throws java.lang.InterruptedException;
- method protected final boolean compareAndSetState(int, int);
- method public final java.util.Collection<java.lang.Thread> getExclusiveQueuedThreads();
- method public final Thread getFirstQueuedThread();
- method public final int getQueueLength();
- method public final java.util.Collection<java.lang.Thread> getQueuedThreads();
- method public final java.util.Collection<java.lang.Thread> getSharedQueuedThreads();
- method protected final int getState();
- method public final int getWaitQueueLength(java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject);
- method public final java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject);
- method public final boolean hasContended();
- method public final boolean hasQueuedPredecessors();
- method public final boolean hasQueuedThreads();
- method public final boolean hasWaiters(java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject);
- method protected boolean isHeldExclusively();
- method public final boolean isQueued(Thread);
- method public final boolean owns(java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject);
- method public final boolean release(int);
- method public final boolean releaseShared(int);
- method protected final void setState(int);
- method protected boolean tryAcquire(int);
- method public final boolean tryAcquireNanos(int, long) throws java.lang.InterruptedException;
- method protected int tryAcquireShared(int);
- method public final boolean tryAcquireSharedNanos(int, long) throws java.lang.InterruptedException;
- method protected boolean tryRelease(int);
- method protected boolean tryReleaseShared(int);
- }
-
- public class AbstractQueuedSynchronizer.ConditionObject implements java.util.concurrent.locks.Condition java.io.Serializable {
- ctor public AbstractQueuedSynchronizer.ConditionObject();
- method public final void await() throws java.lang.InterruptedException;
- method public final boolean await(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public final long awaitNanos(long) throws java.lang.InterruptedException;
- method public final void awaitUninterruptibly();
- method public final boolean awaitUntil(java.util.Date) throws java.lang.InterruptedException;
- method protected final int getWaitQueueLength();
- method protected final java.util.Collection<java.lang.Thread> getWaitingThreads();
- method protected final boolean hasWaiters();
- method public final void signal();
- method public final void signalAll();
- }
-
- public interface Condition {
- method public void await() throws java.lang.InterruptedException;
- method public boolean await(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public long awaitNanos(long) throws java.lang.InterruptedException;
- method public void awaitUninterruptibly();
- method public boolean awaitUntil(java.util.Date) throws java.lang.InterruptedException;
- method public void signal();
- method public void signalAll();
- }
-
- public interface Lock {
- method public void lock();
- method public void lockInterruptibly() throws java.lang.InterruptedException;
- method public java.util.concurrent.locks.Condition newCondition();
- method public boolean tryLock();
- method public boolean tryLock(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public void unlock();
- }
-
- public class LockSupport {
- method public static Object getBlocker(Thread);
- method public static void park(Object);
- method public static void park();
- method public static void parkNanos(Object, long);
- method public static void parkNanos(long);
- method public static void parkUntil(Object, long);
- method public static void parkUntil(long);
- method public static void unpark(Thread);
- }
-
- public interface ReadWriteLock {
- method public java.util.concurrent.locks.Lock readLock();
- method public java.util.concurrent.locks.Lock writeLock();
- }
-
- public class ReentrantLock implements java.util.concurrent.locks.Lock java.io.Serializable {
- ctor public ReentrantLock();
- ctor public ReentrantLock(boolean);
- method public int getHoldCount();
- method protected Thread getOwner();
- method public final int getQueueLength();
- method protected java.util.Collection<java.lang.Thread> getQueuedThreads();
- method public int getWaitQueueLength(java.util.concurrent.locks.Condition);
- method protected java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.Condition);
- method public final boolean hasQueuedThread(Thread);
- method public final boolean hasQueuedThreads();
- method public boolean hasWaiters(java.util.concurrent.locks.Condition);
- method public final boolean isFair();
- method public boolean isHeldByCurrentThread();
- method public boolean isLocked();
- method public void lock();
- method public void lockInterruptibly() throws java.lang.InterruptedException;
- method public java.util.concurrent.locks.Condition newCondition();
- method public boolean tryLock();
- method public boolean tryLock(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public void unlock();
- }
-
- public class ReentrantReadWriteLock implements java.util.concurrent.locks.ReadWriteLock java.io.Serializable {
- ctor public ReentrantReadWriteLock();
- ctor public ReentrantReadWriteLock(boolean);
- method protected Thread getOwner();
- method public final int getQueueLength();
- method protected java.util.Collection<java.lang.Thread> getQueuedReaderThreads();
- method protected java.util.Collection<java.lang.Thread> getQueuedThreads();
- method protected java.util.Collection<java.lang.Thread> getQueuedWriterThreads();
- method public int getReadHoldCount();
- method public int getReadLockCount();
- method public int getWaitQueueLength(java.util.concurrent.locks.Condition);
- method protected java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.Condition);
- method public int getWriteHoldCount();
- method public final boolean hasQueuedThread(Thread);
- method public final boolean hasQueuedThreads();
- method public boolean hasWaiters(java.util.concurrent.locks.Condition);
- method public final boolean isFair();
- method public boolean isWriteLocked();
- method public boolean isWriteLockedByCurrentThread();
- method public java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock readLock();
- method public java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock writeLock();
- }
-
- public static class ReentrantReadWriteLock.ReadLock implements java.util.concurrent.locks.Lock java.io.Serializable {
- ctor protected ReentrantReadWriteLock.ReadLock(java.util.concurrent.locks.ReentrantReadWriteLock);
- method public void lock();
- method public void lockInterruptibly() throws java.lang.InterruptedException;
- method public java.util.concurrent.locks.Condition newCondition();
- method public boolean tryLock();
- method public boolean tryLock(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public void unlock();
- }
-
- public static class ReentrantReadWriteLock.WriteLock implements java.util.concurrent.locks.Lock java.io.Serializable {
- ctor protected ReentrantReadWriteLock.WriteLock(java.util.concurrent.locks.ReentrantReadWriteLock);
- method public int getHoldCount();
- method public boolean isHeldByCurrentThread();
- method public void lock();
- method public void lockInterruptibly() throws java.lang.InterruptedException;
- method public java.util.concurrent.locks.Condition newCondition();
- method public boolean tryLock();
- method public boolean tryLock(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public void unlock();
- }
-
- public class StampedLock implements java.io.Serializable {
- ctor public StampedLock();
- method public java.util.concurrent.locks.Lock asReadLock();
- method public java.util.concurrent.locks.ReadWriteLock asReadWriteLock();
- method public java.util.concurrent.locks.Lock asWriteLock();
- method public int getReadLockCount();
- method public boolean isReadLocked();
- method public boolean isWriteLocked();
- method public long readLock();
- method public long readLockInterruptibly() throws java.lang.InterruptedException;
- method public long tryConvertToOptimisticRead(long);
- method public long tryConvertToReadLock(long);
- method public long tryConvertToWriteLock(long);
- method public long tryOptimisticRead();
- method public long tryReadLock();
- method public long tryReadLock(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public boolean tryUnlockRead();
- method public boolean tryUnlockWrite();
- method public long tryWriteLock();
- method public long tryWriteLock(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException;
- method public void unlock(long);
- method public void unlockRead(long);
- method public void unlockWrite(long);
- method public boolean validate(long);
- method public long writeLock();
- method public long writeLockInterruptibly() throws java.lang.InterruptedException;
- }
-
-}
-
-package java.util.function {
-
- @java.lang.FunctionalInterface public interface BiConsumer<T, U> {
- method public void accept(T, U);
- method public default java.util.function.BiConsumer<T,U> andThen(java.util.function.BiConsumer<? super T,? super U>);
- }
-
- @java.lang.FunctionalInterface public interface BiFunction<T, U, R> {
- method public default <V> java.util.function.BiFunction<T,U,V> andThen(java.util.function.Function<? super R,? extends V>);
- method public R apply(T, U);
- }
-
- @java.lang.FunctionalInterface public interface BiPredicate<T, U> {
- method public default java.util.function.BiPredicate<T,U> and(java.util.function.BiPredicate<? super T,? super U>);
- method public default java.util.function.BiPredicate<T,U> negate();
- method public default java.util.function.BiPredicate<T,U> or(java.util.function.BiPredicate<? super T,? super U>);
- method public boolean test(T, U);
- }
-
- @java.lang.FunctionalInterface public interface BinaryOperator<T> extends java.util.function.BiFunction<T,T,T> {
- method public static <T> java.util.function.BinaryOperator<T> maxBy(java.util.Comparator<? super T>);
- method public static <T> java.util.function.BinaryOperator<T> minBy(java.util.Comparator<? super T>);
- }
-
- @java.lang.FunctionalInterface public interface BooleanSupplier {
- method public boolean getAsBoolean();
- }
-
- @java.lang.FunctionalInterface public interface Consumer<T> {
- method public void accept(T);
- method public default java.util.function.Consumer<T> andThen(java.util.function.Consumer<? super T>);
- }
-
- @java.lang.FunctionalInterface public interface DoubleBinaryOperator {
- method public double applyAsDouble(double, double);
- }
-
- @java.lang.FunctionalInterface public interface DoubleConsumer {
- method public void accept(double);
- method public default java.util.function.DoubleConsumer andThen(java.util.function.DoubleConsumer);
- }
-
- @java.lang.FunctionalInterface public interface DoubleFunction<R> {
- method public R apply(double);
- }
-
- @java.lang.FunctionalInterface public interface DoublePredicate {
- method public default java.util.function.DoublePredicate and(java.util.function.DoublePredicate);
- method public default java.util.function.DoublePredicate negate();
- method public default java.util.function.DoublePredicate or(java.util.function.DoublePredicate);
- method public boolean test(double);
- }
-
- @java.lang.FunctionalInterface public interface DoubleSupplier {
- method public double getAsDouble();
- }
-
- @java.lang.FunctionalInterface public interface DoubleToIntFunction {
- method public int applyAsInt(double);
- }
-
- @java.lang.FunctionalInterface public interface DoubleToLongFunction {
- method public long applyAsLong(double);
- }
-
- @java.lang.FunctionalInterface public interface DoubleUnaryOperator {
- method public default java.util.function.DoubleUnaryOperator andThen(java.util.function.DoubleUnaryOperator);
- method public double applyAsDouble(double);
- method public default java.util.function.DoubleUnaryOperator compose(java.util.function.DoubleUnaryOperator);
- method public static java.util.function.DoubleUnaryOperator identity();
- }
-
- @java.lang.FunctionalInterface public interface Function<T, R> {
- method public default <V> java.util.function.Function<T,V> andThen(java.util.function.Function<? super R,? extends V>);
- method public R apply(T);
- method public default <V> java.util.function.Function<V,R> compose(java.util.function.Function<? super V,? extends T>);
- method public static <T> java.util.function.Function<T,T> identity();
- }
-
- @java.lang.FunctionalInterface public interface IntBinaryOperator {
- method public int applyAsInt(int, int);
- }
-
- @java.lang.FunctionalInterface public interface IntConsumer {
- method public void accept(int);
- method public default java.util.function.IntConsumer andThen(java.util.function.IntConsumer);
- }
-
- @java.lang.FunctionalInterface public interface IntFunction<R> {
- method public R apply(int);
- }
-
- @java.lang.FunctionalInterface public interface IntPredicate {
- method public default java.util.function.IntPredicate and(java.util.function.IntPredicate);
- method public default java.util.function.IntPredicate negate();
- method public default java.util.function.IntPredicate or(java.util.function.IntPredicate);
- method public boolean test(int);
- }
-
- @java.lang.FunctionalInterface public interface IntSupplier {
- method public int getAsInt();
- }
-
- @java.lang.FunctionalInterface public interface IntToDoubleFunction {
- method public double applyAsDouble(int);
- }
-
- @java.lang.FunctionalInterface public interface IntToLongFunction {
- method public long applyAsLong(int);
- }
-
- @java.lang.FunctionalInterface public interface IntUnaryOperator {
- method public default java.util.function.IntUnaryOperator andThen(java.util.function.IntUnaryOperator);
- method public int applyAsInt(int);
- method public default java.util.function.IntUnaryOperator compose(java.util.function.IntUnaryOperator);
- method public static java.util.function.IntUnaryOperator identity();
- }
-
- @java.lang.FunctionalInterface public interface LongBinaryOperator {
- method public long applyAsLong(long, long);
- }
-
- @java.lang.FunctionalInterface public interface LongConsumer {
- method public void accept(long);
- method public default java.util.function.LongConsumer andThen(java.util.function.LongConsumer);
- }
-
- @java.lang.FunctionalInterface public interface LongFunction<R> {
- method public R apply(long);
- }
-
- @java.lang.FunctionalInterface public interface LongPredicate {
- method public default java.util.function.LongPredicate and(java.util.function.LongPredicate);
- method public default java.util.function.LongPredicate negate();
- method public default java.util.function.LongPredicate or(java.util.function.LongPredicate);
- method public boolean test(long);
- }
-
- @java.lang.FunctionalInterface public interface LongSupplier {
- method public long getAsLong();
- }
-
- @java.lang.FunctionalInterface public interface LongToDoubleFunction {
- method public double applyAsDouble(long);
- }
-
- @java.lang.FunctionalInterface public interface LongToIntFunction {
- method public int applyAsInt(long);
- }
-
- @java.lang.FunctionalInterface public interface LongUnaryOperator {
- method public default java.util.function.LongUnaryOperator andThen(java.util.function.LongUnaryOperator);
- method public long applyAsLong(long);
- method public default java.util.function.LongUnaryOperator compose(java.util.function.LongUnaryOperator);
- method public static java.util.function.LongUnaryOperator identity();
- }
-
- @java.lang.FunctionalInterface public interface ObjDoubleConsumer<T> {
- method public void accept(T, double);
- }
-
- @java.lang.FunctionalInterface public interface ObjIntConsumer<T> {
- method public void accept(T, int);
- }
-
- @java.lang.FunctionalInterface public interface ObjLongConsumer<T> {
- method public void accept(T, long);
- }
-
- @java.lang.FunctionalInterface public interface Predicate<T> {
- method public default java.util.function.Predicate<T> and(java.util.function.Predicate<? super T>);
- method public static <T> java.util.function.Predicate<T> isEqual(Object);
- method public default java.util.function.Predicate<T> negate();
- method public default java.util.function.Predicate<T> or(java.util.function.Predicate<? super T>);
- method public boolean test(T);
- }
-
- @java.lang.FunctionalInterface public interface Supplier<T> {
- method public T get();
- }
-
- @java.lang.FunctionalInterface public interface ToDoubleBiFunction<T, U> {
- method public double applyAsDouble(T, U);
- }
-
- @java.lang.FunctionalInterface public interface ToDoubleFunction<T> {
- method public double applyAsDouble(T);
- }
-
- @java.lang.FunctionalInterface public interface ToIntBiFunction<T, U> {
- method public int applyAsInt(T, U);
- }
-
- @java.lang.FunctionalInterface public interface ToIntFunction<T> {
- method public int applyAsInt(T);
- }
-
- @java.lang.FunctionalInterface public interface ToLongBiFunction<T, U> {
- method public long applyAsLong(T, U);
- }
-
- @java.lang.FunctionalInterface public interface ToLongFunction<T> {
- method public long applyAsLong(T);
- }
-
- @java.lang.FunctionalInterface public interface UnaryOperator<T> extends java.util.function.Function<T,T> {
- method public static <T> java.util.function.UnaryOperator<T> identity();
- }
-
-}
-
-package java.util.jar {
-
- public class Attributes implements java.lang.Cloneable java.util.Map<java.lang.Object,java.lang.Object> {
- ctor public Attributes();
- ctor public Attributes(int);
- ctor public Attributes(java.util.jar.Attributes);
- method public void clear();
- method public Object clone();
- method public boolean containsKey(Object);
- method public boolean containsValue(Object);
- method public java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>> entrySet();
- method public Object get(Object);
- method public String getValue(String);
- method public String getValue(java.util.jar.Attributes.Name);
- method public boolean isEmpty();
- method public java.util.Set<java.lang.Object> keySet();
- method public Object put(Object, Object);
- method public void putAll(java.util.Map<?,?>);
- method public String putValue(String, String);
- method public Object remove(Object);
- method public int size();
- method public java.util.Collection<java.lang.Object> values();
- field protected java.util.Map<java.lang.Object,java.lang.Object> map;
- }
-
- public static class Attributes.Name {
- ctor public Attributes.Name(String);
- field public static final java.util.jar.Attributes.Name CLASS_PATH;
- field public static final java.util.jar.Attributes.Name CONTENT_TYPE;
- field @Deprecated public static final java.util.jar.Attributes.Name EXTENSION_INSTALLATION;
- field public static final java.util.jar.Attributes.Name EXTENSION_LIST;
- field public static final java.util.jar.Attributes.Name EXTENSION_NAME;
- field public static final java.util.jar.Attributes.Name IMPLEMENTATION_TITLE;
- field @Deprecated public static final java.util.jar.Attributes.Name IMPLEMENTATION_URL;
- field public static final java.util.jar.Attributes.Name IMPLEMENTATION_VENDOR;
- field @Deprecated public static final java.util.jar.Attributes.Name IMPLEMENTATION_VENDOR_ID;
- field public static final java.util.jar.Attributes.Name IMPLEMENTATION_VERSION;
- field public static final java.util.jar.Attributes.Name MAIN_CLASS;
- field public static final java.util.jar.Attributes.Name MANIFEST_VERSION;
- field public static final java.util.jar.Attributes.Name SEALED;
- field public static final java.util.jar.Attributes.Name SIGNATURE_VERSION;
- field public static final java.util.jar.Attributes.Name SPECIFICATION_TITLE;
- field public static final java.util.jar.Attributes.Name SPECIFICATION_VENDOR;
- field public static final java.util.jar.Attributes.Name SPECIFICATION_VERSION;
- }
-
- public class JarEntry extends java.util.zip.ZipEntry {
- ctor public JarEntry(String);
- ctor public JarEntry(java.util.zip.ZipEntry);
- ctor public JarEntry(java.util.jar.JarEntry);
- method public java.util.jar.Attributes getAttributes() throws java.io.IOException;
- method public java.security.cert.Certificate[] getCertificates();
- method public java.security.CodeSigner[] getCodeSigners();
- field public static final int CENATT = 36; // 0x24
- field public static final int CENATX = 38; // 0x26
- field public static final int CENCOM = 32; // 0x20
- field public static final int CENCRC = 16; // 0x10
- field public static final int CENDSK = 34; // 0x22
- field public static final int CENEXT = 30; // 0x1e
- field public static final int CENFLG = 8; // 0x8
- field public static final int CENHDR = 46; // 0x2e
- field public static final int CENHOW = 10; // 0xa
- field public static final int CENLEN = 24; // 0x18
- field public static final int CENNAM = 28; // 0x1c
- field public static final int CENOFF = 42; // 0x2a
- field public static final long CENSIG = 33639248L; // 0x2014b50L
- field public static final int CENSIZ = 20; // 0x14
- field public static final int CENTIM = 12; // 0xc
- field public static final int CENVEM = 4; // 0x4
- field public static final int CENVER = 6; // 0x6
- field public static final int ENDCOM = 20; // 0x14
- field public static final int ENDHDR = 22; // 0x16
- field public static final int ENDOFF = 16; // 0x10
- field public static final long ENDSIG = 101010256L; // 0x6054b50L
- field public static final int ENDSIZ = 12; // 0xc
- field public static final int ENDSUB = 8; // 0x8
- field public static final int ENDTOT = 10; // 0xa
- field public static final int EXTCRC = 4; // 0x4
- field public static final int EXTHDR = 16; // 0x10
- field public static final int EXTLEN = 12; // 0xc
- field public static final long EXTSIG = 134695760L; // 0x8074b50L
- field public static final int EXTSIZ = 8; // 0x8
- field public static final int LOCCRC = 14; // 0xe
- field public static final int LOCEXT = 28; // 0x1c
- field public static final int LOCFLG = 6; // 0x6
- field public static final int LOCHDR = 30; // 0x1e
- field public static final int LOCHOW = 8; // 0x8
- field public static final int LOCLEN = 22; // 0x16
- field public static final int LOCNAM = 26; // 0x1a
- field public static final long LOCSIG = 67324752L; // 0x4034b50L
- field public static final int LOCSIZ = 18; // 0x12
- field public static final int LOCTIM = 10; // 0xa
- field public static final int LOCVER = 4; // 0x4
- }
-
- public class JarException extends java.util.zip.ZipException {
- ctor public JarException();
- ctor public JarException(String);
- }
-
- public class JarFile extends java.util.zip.ZipFile {
- ctor public JarFile(String) throws java.io.IOException;
- ctor public JarFile(String, boolean) throws java.io.IOException;
- ctor public JarFile(java.io.File) throws java.io.IOException;
- ctor public JarFile(java.io.File, boolean) throws java.io.IOException;
- ctor public JarFile(java.io.File, boolean, int) throws java.io.IOException;
- method public java.util.Enumeration<java.util.jar.JarEntry> entries();
- method public java.util.jar.JarEntry getJarEntry(String);
- method public java.util.jar.Manifest getManifest() throws java.io.IOException;
- method public java.util.stream.Stream<java.util.jar.JarEntry> stream();
- field public static final int CENATT = 36; // 0x24
- field public static final int CENATX = 38; // 0x26
- field public static final int CENCOM = 32; // 0x20
- field public static final int CENCRC = 16; // 0x10
- field public static final int CENDSK = 34; // 0x22
- field public static final int CENEXT = 30; // 0x1e
- field public static final int CENFLG = 8; // 0x8
- field public static final int CENHDR = 46; // 0x2e
- field public static final int CENHOW = 10; // 0xa
- field public static final int CENLEN = 24; // 0x18
- field public static final int CENNAM = 28; // 0x1c
- field public static final int CENOFF = 42; // 0x2a
- field public static final long CENSIG = 33639248L; // 0x2014b50L
- field public static final int CENSIZ = 20; // 0x14
- field public static final int CENTIM = 12; // 0xc
- field public static final int CENVEM = 4; // 0x4
- field public static final int CENVER = 6; // 0x6
- field public static final int ENDCOM = 20; // 0x14
- field public static final int ENDHDR = 22; // 0x16
- field public static final int ENDOFF = 16; // 0x10
- field public static final long ENDSIG = 101010256L; // 0x6054b50L
- field public static final int ENDSIZ = 12; // 0xc
- field public static final int ENDSUB = 8; // 0x8
- field public static final int ENDTOT = 10; // 0xa
- field public static final int EXTCRC = 4; // 0x4
- field public static final int EXTHDR = 16; // 0x10
- field public static final int EXTLEN = 12; // 0xc
- field public static final long EXTSIG = 134695760L; // 0x8074b50L
- field public static final int EXTSIZ = 8; // 0x8
- field public static final int LOCCRC = 14; // 0xe
- field public static final int LOCEXT = 28; // 0x1c
- field public static final int LOCFLG = 6; // 0x6
- field public static final int LOCHDR = 30; // 0x1e
- field public static final int LOCHOW = 8; // 0x8
- field public static final int LOCLEN = 22; // 0x16
- field public static final int LOCNAM = 26; // 0x1a
- field public static final long LOCSIG = 67324752L; // 0x4034b50L
- field public static final int LOCSIZ = 18; // 0x12
- field public static final int LOCTIM = 10; // 0xa
- field public static final int LOCVER = 4; // 0x4
- field public static final String MANIFEST_NAME = "META-INF/MANIFEST.MF";
- }
-
- public class JarInputStream extends java.util.zip.ZipInputStream {
- ctor public JarInputStream(java.io.InputStream) throws java.io.IOException;
- ctor public JarInputStream(java.io.InputStream, boolean) throws java.io.IOException;
- method public java.util.jar.Manifest getManifest();
- method public java.util.jar.JarEntry getNextJarEntry() throws java.io.IOException;
- field public static final int CENATT = 36; // 0x24
- field public static final int CENATX = 38; // 0x26
- field public static final int CENCOM = 32; // 0x20
- field public static final int CENCRC = 16; // 0x10
- field public static final int CENDSK = 34; // 0x22
- field public static final int CENEXT = 30; // 0x1e
- field public static final int CENFLG = 8; // 0x8
- field public static final int CENHDR = 46; // 0x2e
- field public static final int CENHOW = 10; // 0xa
- field public static final int CENLEN = 24; // 0x18
- field public static final int CENNAM = 28; // 0x1c
- field public static final int CENOFF = 42; // 0x2a
- field public static final long CENSIG = 33639248L; // 0x2014b50L
- field public static final int CENSIZ = 20; // 0x14
- field public static final int CENTIM = 12; // 0xc
- field public static final int CENVEM = 4; // 0x4
- field public static final int CENVER = 6; // 0x6
- field public static final int ENDCOM = 20; // 0x14
- field public static final int ENDHDR = 22; // 0x16
- field public static final int ENDOFF = 16; // 0x10
- field public static final long ENDSIG = 101010256L; // 0x6054b50L
- field public static final int ENDSIZ = 12; // 0xc
- field public static final int ENDSUB = 8; // 0x8
- field public static final int ENDTOT = 10; // 0xa
- field public static final int EXTCRC = 4; // 0x4
- field public static final int EXTHDR = 16; // 0x10
- field public static final int EXTLEN = 12; // 0xc
- field public static final long EXTSIG = 134695760L; // 0x8074b50L
- field public static final int EXTSIZ = 8; // 0x8
- field public static final int LOCCRC = 14; // 0xe
- field public static final int LOCEXT = 28; // 0x1c
- field public static final int LOCFLG = 6; // 0x6
- field public static final int LOCHDR = 30; // 0x1e
- field public static final int LOCHOW = 8; // 0x8
- field public static final int LOCLEN = 22; // 0x16
- field public static final int LOCNAM = 26; // 0x1a
- field public static final long LOCSIG = 67324752L; // 0x4034b50L
- field public static final int LOCSIZ = 18; // 0x12
- field public static final int LOCTIM = 10; // 0xa
- field public static final int LOCVER = 4; // 0x4
- }
-
- public class JarOutputStream extends java.util.zip.ZipOutputStream {
- ctor public JarOutputStream(java.io.OutputStream, java.util.jar.Manifest) throws java.io.IOException;
- ctor public JarOutputStream(java.io.OutputStream) throws java.io.IOException;
- field public static final int CENATT = 36; // 0x24
- field public static final int CENATX = 38; // 0x26
- field public static final int CENCOM = 32; // 0x20
- field public static final int CENCRC = 16; // 0x10
- field public static final int CENDSK = 34; // 0x22
- field public static final int CENEXT = 30; // 0x1e
- field public static final int CENFLG = 8; // 0x8
- field public static final int CENHDR = 46; // 0x2e
- field public static final int CENHOW = 10; // 0xa
- field public static final int CENLEN = 24; // 0x18
- field public static final int CENNAM = 28; // 0x1c
- field public static final int CENOFF = 42; // 0x2a
- field public static final long CENSIG = 33639248L; // 0x2014b50L
- field public static final int CENSIZ = 20; // 0x14
- field public static final int CENTIM = 12; // 0xc
- field public static final int CENVEM = 4; // 0x4
- field public static final int CENVER = 6; // 0x6
- field public static final int ENDCOM = 20; // 0x14
- field public static final int ENDHDR = 22; // 0x16
- field public static final int ENDOFF = 16; // 0x10
- field public static final long ENDSIG = 101010256L; // 0x6054b50L
- field public static final int ENDSIZ = 12; // 0xc
- field public static final int ENDSUB = 8; // 0x8
- field public static final int ENDTOT = 10; // 0xa
- field public static final int EXTCRC = 4; // 0x4
- field public static final int EXTHDR = 16; // 0x10
- field public static final int EXTLEN = 12; // 0xc
- field public static final long EXTSIG = 134695760L; // 0x8074b50L
- field public static final int EXTSIZ = 8; // 0x8
- field public static final int LOCCRC = 14; // 0xe
- field public static final int LOCEXT = 28; // 0x1c
- field public static final int LOCFLG = 6; // 0x6
- field public static final int LOCHDR = 30; // 0x1e
- field public static final int LOCHOW = 8; // 0x8
- field public static final int LOCLEN = 22; // 0x16
- field public static final int LOCNAM = 26; // 0x1a
- field public static final long LOCSIG = 67324752L; // 0x4034b50L
- field public static final int LOCSIZ = 18; // 0x12
- field public static final int LOCTIM = 10; // 0xa
- field public static final int LOCVER = 4; // 0x4
- }
-
- public class Manifest implements java.lang.Cloneable {
- ctor public Manifest();
- ctor public Manifest(java.io.InputStream) throws java.io.IOException;
- ctor public Manifest(java.util.jar.Manifest);
- method public void clear();
- method public Object clone();
- method public java.util.jar.Attributes getAttributes(String);
- method public java.util.Map<java.lang.String,java.util.jar.Attributes> getEntries();
- method public java.util.jar.Attributes getMainAttributes();
- method public void read(java.io.InputStream) throws java.io.IOException;
- method public void write(java.io.OutputStream) throws java.io.IOException;
- }
-
- public abstract class Pack200 {
- method public static java.util.jar.Pack200.Packer newPacker();
- method public static java.util.jar.Pack200.Unpacker newUnpacker();
- }
-
- public static interface Pack200.Packer {
- method @Deprecated public default void addPropertyChangeListener(java.beans.PropertyChangeListener);
- method public void pack(java.util.jar.JarFile, java.io.OutputStream) throws java.io.IOException;
- method public void pack(java.util.jar.JarInputStream, java.io.OutputStream) throws java.io.IOException;
- method public java.util.SortedMap<java.lang.String,java.lang.String> properties();
- method @Deprecated public default void removePropertyChangeListener(java.beans.PropertyChangeListener);
- field public static final String CLASS_ATTRIBUTE_PFX = "pack.class.attribute.";
- field public static final String CODE_ATTRIBUTE_PFX = "pack.code.attribute.";
- field public static final String DEFLATE_HINT = "pack.deflate.hint";
- field public static final String EFFORT = "pack.effort";
- field public static final String ERROR = "error";
- field public static final String FALSE = "false";
- field public static final String FIELD_ATTRIBUTE_PFX = "pack.field.attribute.";
- field public static final String KEEP = "keep";
- field public static final String KEEP_FILE_ORDER = "pack.keep.file.order";
- field public static final String LATEST = "latest";
- field public static final String METHOD_ATTRIBUTE_PFX = "pack.method.attribute.";
- field public static final String MODIFICATION_TIME = "pack.modification.time";
- field public static final String PASS = "pass";
- field public static final String PASS_FILE_PFX = "pack.pass.file.";
- field public static final String PROGRESS = "pack.progress";
- field public static final String SEGMENT_LIMIT = "pack.segment.limit";
- field public static final String STRIP = "strip";
- field public static final String TRUE = "true";
- field public static final String UNKNOWN_ATTRIBUTE = "pack.unknown.attribute";
- }
-
- public static interface Pack200.Unpacker {
- method @Deprecated public default void addPropertyChangeListener(java.beans.PropertyChangeListener);
- method public java.util.SortedMap<java.lang.String,java.lang.String> properties();
- method @Deprecated public default void removePropertyChangeListener(java.beans.PropertyChangeListener);
- method public void unpack(java.io.InputStream, java.util.jar.JarOutputStream) throws java.io.IOException;
- method public void unpack(java.io.File, java.util.jar.JarOutputStream) throws java.io.IOException;
- field public static final String DEFLATE_HINT = "unpack.deflate.hint";
- field public static final String FALSE = "false";
- field public static final String KEEP = "keep";
- field public static final String PROGRESS = "unpack.progress";
- field public static final String TRUE = "true";
- }
-
-}
-
-package java.util.logging {
-
- public class ConsoleHandler extends java.util.logging.StreamHandler {
- ctor public ConsoleHandler();
- method public void close();
- }
-
- public class ErrorManager {
- ctor public ErrorManager();
- method public void error(String, Exception, int);
- field public static final int CLOSE_FAILURE = 3; // 0x3
- field public static final int FLUSH_FAILURE = 2; // 0x2
- field public static final int FORMAT_FAILURE = 5; // 0x5
- field public static final int GENERIC_FAILURE = 0; // 0x0
- field public static final int OPEN_FAILURE = 4; // 0x4
- field public static final int WRITE_FAILURE = 1; // 0x1
- }
-
- public class FileHandler extends java.util.logging.StreamHandler {
- ctor public FileHandler() throws java.io.IOException, java.lang.SecurityException;
- ctor public FileHandler(String) throws java.io.IOException, java.lang.SecurityException;
- ctor public FileHandler(String, boolean) throws java.io.IOException, java.lang.SecurityException;
- ctor public FileHandler(String, int, int) throws java.io.IOException, java.lang.SecurityException;
- ctor public FileHandler(String, int, int, boolean) throws java.io.IOException, java.lang.SecurityException;
- }
-
- @java.lang.FunctionalInterface public interface Filter {
- method public boolean isLoggable(java.util.logging.LogRecord);
- }
-
- public abstract class Formatter {
- ctor protected Formatter();
- method public abstract String format(java.util.logging.LogRecord);
- method public String formatMessage(java.util.logging.LogRecord);
- method public String getHead(java.util.logging.Handler);
- method public String getTail(java.util.logging.Handler);
- }
-
- public abstract class Handler {
- ctor protected Handler();
- method public abstract void close() throws java.lang.SecurityException;
- method public abstract void flush();
- method public String getEncoding();
- method public java.util.logging.ErrorManager getErrorManager();
- method public java.util.logging.Filter getFilter();
- method public java.util.logging.Formatter getFormatter();
- method public java.util.logging.Level getLevel();
- method public boolean isLoggable(java.util.logging.LogRecord);
- method public abstract void publish(java.util.logging.LogRecord);
- method protected void reportError(String, Exception, int);
- method public void setEncoding(String) throws java.lang.SecurityException, java.io.UnsupportedEncodingException;
- method public void setErrorManager(java.util.logging.ErrorManager);
- method public void setFilter(java.util.logging.Filter) throws java.lang.SecurityException;
- method public void setFormatter(java.util.logging.Formatter) throws java.lang.SecurityException;
- method public void setLevel(java.util.logging.Level) throws java.lang.SecurityException;
- }
-
- public class Level implements java.io.Serializable {
- ctor protected Level(@NonNull String, int);
- ctor protected Level(@NonNull String, int, @Nullable String);
- method @NonNull public String getLocalizedName();
- method @NonNull public String getName();
- method @Nullable public String getResourceBundleName();
- method public final int intValue();
- method @NonNull public static java.util.logging.Level parse(@NonNull String) throws java.lang.IllegalArgumentException;
- method @NonNull public final String toString();
- field @NonNull public static final java.util.logging.Level ALL;
- field @NonNull public static final java.util.logging.Level CONFIG;
- field @NonNull public static final java.util.logging.Level FINE;
- field @NonNull public static final java.util.logging.Level FINER;
- field @NonNull public static final java.util.logging.Level FINEST;
- field @NonNull public static final java.util.logging.Level INFO;
- field @NonNull public static final java.util.logging.Level OFF;
- field @NonNull public static final java.util.logging.Level SEVERE;
- field @NonNull public static final java.util.logging.Level WARNING;
- }
-
- public class LogManager {
- ctor protected LogManager();
- method public boolean addLogger(java.util.logging.Logger);
- method @Deprecated public void addPropertyChangeListener(java.beans.PropertyChangeListener) throws java.lang.SecurityException;
- method public void checkAccess() throws java.lang.SecurityException;
- method public static java.util.logging.LogManager getLogManager();
- method public java.util.logging.Logger getLogger(String);
- method public java.util.Enumeration<java.lang.String> getLoggerNames();
- method public static java.util.logging.LoggingMXBean getLoggingMXBean();
- method public String getProperty(String);
- method public void readConfiguration() throws java.io.IOException, java.lang.SecurityException;
- method public void readConfiguration(java.io.InputStream) throws java.io.IOException, java.lang.SecurityException;
- method @Deprecated public void removePropertyChangeListener(java.beans.PropertyChangeListener) throws java.lang.SecurityException;
- method public void reset() throws java.lang.SecurityException;
- field public static final String LOGGING_MXBEAN_NAME = "java.util.logging:type=Logging";
- }
-
- public class LogRecord implements java.io.Serializable {
- ctor public LogRecord(java.util.logging.Level, String);
- method public java.util.logging.Level getLevel();
- method public String getLoggerName();
- method public String getMessage();
- method public long getMillis();
- method public Object[] getParameters();
- method public java.util.ResourceBundle getResourceBundle();
- method public String getResourceBundleName();
- method public long getSequenceNumber();
- method public String getSourceClassName();
- method public String getSourceMethodName();
- method public int getThreadID();
- method public Throwable getThrown();
- method public void setLevel(java.util.logging.Level);
- method public void setLoggerName(String);
- method public void setMessage(String);
- method public void setMillis(long);
- method public void setParameters(Object[]);
- method public void setResourceBundle(java.util.ResourceBundle);
- method public void setResourceBundleName(String);
- method public void setSequenceNumber(long);
- method public void setSourceClassName(String);
- method public void setSourceMethodName(String);
- method public void setThreadID(int);
- method public void setThrown(Throwable);
- }
-
- public class Logger {
- ctor protected Logger(@Nullable String, @Nullable String);
- method public void addHandler(@NonNull java.util.logging.Handler) throws java.lang.SecurityException;
- method public void config(@Nullable String);
- method public void config(@NonNull java.util.function.Supplier<java.lang.String>);
- method public void entering(@Nullable String, @Nullable String);
- method public void entering(@Nullable String, @Nullable String, @Nullable Object);
- method public void entering(@Nullable String, @Nullable String, @Nullable Object[]);
- method public void exiting(@Nullable String, @Nullable String);
- method public void exiting(@Nullable String, @Nullable String, @Nullable Object);
- method public void fine(@Nullable String);
- method public void fine(@NonNull java.util.function.Supplier<java.lang.String>);
- method public void finer(@Nullable String);
- method public void finer(@NonNull java.util.function.Supplier<java.lang.String>);
- method public void finest(@Nullable String);
- method public void finest(@NonNull java.util.function.Supplier<java.lang.String>);
- method @NonNull public static java.util.logging.Logger getAnonymousLogger();
- method @NonNull public static java.util.logging.Logger getAnonymousLogger(@Nullable String);
- method @Nullable public java.util.logging.Filter getFilter();
- method @NonNull public static final java.util.logging.Logger getGlobal();
- method @NonNull public java.util.logging.Handler[] getHandlers();
- method @Nullable public java.util.logging.Level getLevel();
- method @NonNull public static java.util.logging.Logger getLogger(@NonNull String);
- method @NonNull public static java.util.logging.Logger getLogger(@NonNull String, @Nullable String);
- method @Nullable public String getName();
- method @Nullable public java.util.logging.Logger getParent();
- method @Nullable public java.util.ResourceBundle getResourceBundle();
- method @Nullable public String getResourceBundleName();
- method public boolean getUseParentHandlers();
- method public void info(@Nullable String);
- method public void info(@NonNull java.util.function.Supplier<java.lang.String>);
- method public boolean isLoggable(@NonNull java.util.logging.Level);
- method public void log(@NonNull java.util.logging.LogRecord);
- method public void log(@NonNull java.util.logging.Level, @Nullable String);
- method public void log(@NonNull java.util.logging.Level, @NonNull java.util.function.Supplier<java.lang.String>);
- method public void log(@NonNull java.util.logging.Level, @Nullable String, @Nullable Object);
- method public void log(@NonNull java.util.logging.Level, @Nullable String, @Nullable Object[]);
- method public void log(@NonNull java.util.logging.Level, @Nullable String, @Nullable Throwable);
- method public void log(@NonNull java.util.logging.Level, @Nullable Throwable, @NonNull java.util.function.Supplier<java.lang.String>);
- method public void logp(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable String);
- method public void logp(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @NonNull java.util.function.Supplier<java.lang.String>);
- method public void logp(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable String, @Nullable Object);
- method public void logp(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable String, @Nullable Object[]);
- method public void logp(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable String, @Nullable Throwable);
- method public void logp(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable Throwable, @NonNull java.util.function.Supplier<java.lang.String>);
- method @Deprecated public void logrb(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable String, @Nullable String);
- method @Deprecated public void logrb(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable String, @Nullable String, @Nullable Object);
- method @Deprecated public void logrb(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable String, @Nullable String, @Nullable Object[]);
- method public void logrb(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable java.util.ResourceBundle, @Nullable String, @Nullable java.lang.Object...);
- method @Deprecated public void logrb(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable String, @Nullable String, @Nullable Throwable);
- method public void logrb(@NonNull java.util.logging.Level, @Nullable String, @Nullable String, @Nullable java.util.ResourceBundle, @Nullable String, @Nullable Throwable);
- method public void removeHandler(@Nullable java.util.logging.Handler) throws java.lang.SecurityException;
- method public void setFilter(@Nullable java.util.logging.Filter) throws java.lang.SecurityException;
- method public void setLevel(@Nullable java.util.logging.Level) throws java.lang.SecurityException;
- method public void setParent(@NonNull java.util.logging.Logger);
- method public void setResourceBundle(@NonNull java.util.ResourceBundle);
- method public void setUseParentHandlers(boolean);
- method public void severe(@Nullable String);
- method public void severe(@NonNull java.util.function.Supplier<java.lang.String>);
- method public void throwing(@Nullable String, @Nullable String, @Nullable Throwable);
- method public void warning(@Nullable String);
- method public void warning(@NonNull java.util.function.Supplier<java.lang.String>);
- field @NonNull public static final String GLOBAL_LOGGER_NAME = "global";
- field @Deprecated @NonNull public static final java.util.logging.Logger global;
- }
-
- public interface LoggingMXBean {
- method public String getLoggerLevel(String);
- method public java.util.List<java.lang.String> getLoggerNames();
- method public String getParentLoggerName(String);
- method public void setLoggerLevel(String, String);
- }
-
- public final class LoggingPermission extends java.security.BasicPermission {
- ctor public LoggingPermission(String, String) throws java.lang.IllegalArgumentException;
- }
-
- public class MemoryHandler extends java.util.logging.Handler {
- ctor public MemoryHandler();
- ctor public MemoryHandler(java.util.logging.Handler, int, java.util.logging.Level);
- method public void close() throws java.lang.SecurityException;
- method public void flush();
- method public java.util.logging.Level getPushLevel();
- method public void publish(java.util.logging.LogRecord);
- method public void push();
- method public void setPushLevel(java.util.logging.Level) throws java.lang.SecurityException;
- }
-
- public class SimpleFormatter extends java.util.logging.Formatter {
- ctor public SimpleFormatter();
- method public String format(java.util.logging.LogRecord);
- }
-
- public class SocketHandler extends java.util.logging.StreamHandler {
- ctor public SocketHandler() throws java.io.IOException;
- ctor public SocketHandler(String, int) throws java.io.IOException;
- }
-
- public class StreamHandler extends java.util.logging.Handler {
- ctor public StreamHandler();
- ctor public StreamHandler(java.io.OutputStream, java.util.logging.Formatter);
- method public void close() throws java.lang.SecurityException;
- method public void flush();
- method public void publish(java.util.logging.LogRecord);
- method protected void setOutputStream(java.io.OutputStream) throws java.lang.SecurityException;
- }
-
- public class XMLFormatter extends java.util.logging.Formatter {
- ctor public XMLFormatter();
- method public String format(java.util.logging.LogRecord);
- }
-
-}
-
-package java.util.prefs {
-
- public abstract class AbstractPreferences extends java.util.prefs.Preferences {
- ctor protected AbstractPreferences(java.util.prefs.AbstractPreferences, String);
- method public String absolutePath();
- method public void addNodeChangeListener(java.util.prefs.NodeChangeListener);
- method public void addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener);
- method protected final java.util.prefs.AbstractPreferences[] cachedChildren();
- method protected abstract java.util.prefs.AbstractPreferences childSpi(String);
- method public String[] childrenNames() throws java.util.prefs.BackingStoreException;
- method protected abstract String[] childrenNamesSpi() throws java.util.prefs.BackingStoreException;
- method public void clear() throws java.util.prefs.BackingStoreException;
- method public void exportNode(java.io.OutputStream) throws java.util.prefs.BackingStoreException, java.io.IOException;
- method public void exportSubtree(java.io.OutputStream) throws java.util.prefs.BackingStoreException, java.io.IOException;
- method public void flush() throws java.util.prefs.BackingStoreException;
- method protected abstract void flushSpi() throws java.util.prefs.BackingStoreException;
- method public String get(String, String);
- method public boolean getBoolean(String, boolean);
- method public byte[] getByteArray(String, byte[]);
- method protected java.util.prefs.AbstractPreferences getChild(String) throws java.util.prefs.BackingStoreException;
- method public double getDouble(String, double);
- method public float getFloat(String, float);
- method public int getInt(String, int);
- method public long getLong(String, long);
- method protected abstract String getSpi(String);
- method protected boolean isRemoved();
- method public boolean isUserNode();
- method public String[] keys() throws java.util.prefs.BackingStoreException;
- method protected abstract String[] keysSpi() throws java.util.prefs.BackingStoreException;
- method public String name();
- method public java.util.prefs.Preferences node(String);
- method public boolean nodeExists(String) throws java.util.prefs.BackingStoreException;
- method public java.util.prefs.Preferences parent();
- method public void put(String, String);
- method public void putBoolean(String, boolean);
- method public void putByteArray(String, byte[]);
- method public void putDouble(String, double);
- method public void putFloat(String, float);
- method public void putInt(String, int);
- method public void putLong(String, long);
- method protected abstract void putSpi(String, String);
- method public void remove(String);
- method public void removeNode() throws java.util.prefs.BackingStoreException;
- method public void removeNodeChangeListener(java.util.prefs.NodeChangeListener);
- method protected abstract void removeNodeSpi() throws java.util.prefs.BackingStoreException;
- method public void removePreferenceChangeListener(java.util.prefs.PreferenceChangeListener);
- method protected abstract void removeSpi(String);
- method public void sync() throws java.util.prefs.BackingStoreException;
- method protected abstract void syncSpi() throws java.util.prefs.BackingStoreException;
- field protected final Object lock;
- field protected boolean newNode;
- }
-
- public class BackingStoreException extends java.lang.Exception {
- ctor public BackingStoreException(String);
- ctor public BackingStoreException(Throwable);
- }
-
- public class InvalidPreferencesFormatException extends java.lang.Exception {
- ctor public InvalidPreferencesFormatException(Throwable);
- ctor public InvalidPreferencesFormatException(String);
- ctor public InvalidPreferencesFormatException(String, Throwable);
- }
-
- public class NodeChangeEvent extends java.util.EventObject {
- ctor public NodeChangeEvent(java.util.prefs.Preferences, java.util.prefs.Preferences);
- method public java.util.prefs.Preferences getChild();
- method public java.util.prefs.Preferences getParent();
- }
-
- public interface NodeChangeListener extends java.util.EventListener {
- method public void childAdded(java.util.prefs.NodeChangeEvent);
- method public void childRemoved(java.util.prefs.NodeChangeEvent);
- }
-
- public class PreferenceChangeEvent extends java.util.EventObject {
- ctor public PreferenceChangeEvent(java.util.prefs.Preferences, String, String);
- method public String getKey();
- method public String getNewValue();
- method public java.util.prefs.Preferences getNode();
- }
-
- @java.lang.FunctionalInterface public interface PreferenceChangeListener extends java.util.EventListener {
- method public void preferenceChange(java.util.prefs.PreferenceChangeEvent);
- }
-
- public abstract class Preferences {
- ctor protected Preferences();
- method public abstract String absolutePath();
- method public abstract void addNodeChangeListener(java.util.prefs.NodeChangeListener);
- method public abstract void addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener);
- method public abstract String[] childrenNames() throws java.util.prefs.BackingStoreException;
- method public abstract void clear() throws java.util.prefs.BackingStoreException;
- method public abstract void exportNode(java.io.OutputStream) throws java.util.prefs.BackingStoreException, java.io.IOException;
- method public abstract void exportSubtree(java.io.OutputStream) throws java.util.prefs.BackingStoreException, java.io.IOException;
- method public abstract void flush() throws java.util.prefs.BackingStoreException;
- method public abstract String get(String, String);
- method public abstract boolean getBoolean(String, boolean);
- method public abstract byte[] getByteArray(String, byte[]);
- method public abstract double getDouble(String, double);
- method public abstract float getFloat(String, float);
- method public abstract int getInt(String, int);
- method public abstract long getLong(String, long);
- method public static void importPreferences(java.io.InputStream) throws java.io.IOException, java.util.prefs.InvalidPreferencesFormatException;
- method public abstract boolean isUserNode();
- method public abstract String[] keys() throws java.util.prefs.BackingStoreException;
- method public abstract String name();
- method public abstract java.util.prefs.Preferences node(String);
- method public abstract boolean nodeExists(String) throws java.util.prefs.BackingStoreException;
- method public abstract java.util.prefs.Preferences parent();
- method public abstract void put(String, String);
- method public abstract void putBoolean(String, boolean);
- method public abstract void putByteArray(String, byte[]);
- method public abstract void putDouble(String, double);
- method public abstract void putFloat(String, float);
- method public abstract void putInt(String, int);
- method public abstract void putLong(String, long);
- method public abstract void remove(String);
- method public abstract void removeNode() throws java.util.prefs.BackingStoreException;
- method public abstract void removeNodeChangeListener(java.util.prefs.NodeChangeListener);
- method public abstract void removePreferenceChangeListener(java.util.prefs.PreferenceChangeListener);
- method public abstract void sync() throws java.util.prefs.BackingStoreException;
- method public static java.util.prefs.Preferences systemNodeForPackage(Class<?>);
- method public static java.util.prefs.Preferences systemRoot();
- method public abstract String toString();
- method public static java.util.prefs.Preferences userNodeForPackage(Class<?>);
- method public static java.util.prefs.Preferences userRoot();
- field public static final int MAX_KEY_LENGTH = 80; // 0x50
- field public static final int MAX_NAME_LENGTH = 80; // 0x50
- field public static final int MAX_VALUE_LENGTH = 8192; // 0x2000
- }
-
- public interface PreferencesFactory {
- method public java.util.prefs.Preferences systemRoot();
- method public java.util.prefs.Preferences userRoot();
- }
-
-}
-
-package java.util.regex {
-
- public interface MatchResult {
- method public int end();
- method public int end(int);
- method public String group();
- method public String group(int);
- method public int groupCount();
- method public int start();
- method public int start(int);
- }
-
- public final class Matcher implements java.util.regex.MatchResult {
- method @NonNull public java.util.regex.Matcher appendReplacement(@NonNull StringBuffer, @NonNull String);
- method @NonNull public StringBuffer appendTail(@NonNull StringBuffer);
- method public int end();
- method public int end(int);
- method public int end(@NonNull String);
- method public boolean find();
- method public boolean find(int);
- method @NonNull public String group();
- method @Nullable public String group(int);
- method @Nullable public String group(@NonNull String);
- method public int groupCount();
- method public boolean hasAnchoringBounds();
- method public boolean hasTransparentBounds();
- method public boolean hitEnd();
- method public boolean lookingAt();
- method public boolean matches();
- method @NonNull public java.util.regex.Pattern pattern();
- method @NonNull public static String quoteReplacement(@NonNull String);
- method @NonNull public java.util.regex.Matcher region(int, int);
- method public int regionEnd();
- method public int regionStart();
- method @NonNull public String replaceAll(@NonNull String);
- method @NonNull public String replaceFirst(@NonNull String);
- method public boolean requireEnd();
- method @NonNull public java.util.regex.Matcher reset();
- method @NonNull public java.util.regex.Matcher reset(@NonNull CharSequence);
- method public int start();
- method public int start(int);
- method public int start(@NonNull String);
- method @NonNull public java.util.regex.MatchResult toMatchResult();
- method @NonNull public java.util.regex.Matcher useAnchoringBounds(boolean);
- method @NonNull public java.util.regex.Matcher usePattern(@NonNull java.util.regex.Pattern);
- method @NonNull public java.util.regex.Matcher useTransparentBounds(boolean);
- }
-
- public final class Pattern implements java.io.Serializable {
- method @NonNull public java.util.function.Predicate<java.lang.String> asPredicate();
- method @NonNull public static java.util.regex.Pattern compile(@NonNull String);
- method @NonNull public static java.util.regex.Pattern compile(@NonNull String, int);
- method public int flags();
- method @NonNull public java.util.regex.Matcher matcher(@NonNull CharSequence);
- method public static boolean matches(@NonNull String, @NonNull CharSequence);
- method @NonNull public String pattern();
- method @NonNull public static String quote(@NonNull String);
- method @NonNull public String[] split(@NonNull CharSequence, int);
- method @NonNull public String[] split(@NonNull CharSequence);
- method @NonNull public java.util.stream.Stream<java.lang.String> splitAsStream(@NonNull CharSequence);
- field public static final int CANON_EQ = 128; // 0x80
- field public static final int CASE_INSENSITIVE = 2; // 0x2
- field public static final int COMMENTS = 4; // 0x4
- field public static final int DOTALL = 32; // 0x20
- field public static final int LITERAL = 16; // 0x10
- field public static final int MULTILINE = 8; // 0x8
- field public static final int UNICODE_CASE = 64; // 0x40
- field public static final int UNICODE_CHARACTER_CLASS = 256; // 0x100
- field public static final int UNIX_LINES = 1; // 0x1
- }
-
- public class PatternSyntaxException extends java.lang.IllegalArgumentException {
- ctor public PatternSyntaxException(String, String, int);
- method public String getDescription();
- method public int getIndex();
- method public String getPattern();
- }
-
-}
-
-package java.util.stream {
-
- public interface BaseStream<T, S extends java.util.stream.BaseStream<T, S>> extends java.lang.AutoCloseable {
- method public void close();
- method public boolean isParallel();
- method public java.util.Iterator<T> iterator();
- method public S onClose(Runnable);
- method public S parallel();
- method public S sequential();
- method public java.util.Spliterator<T> spliterator();
- method public S unordered();
- }
-
- public interface Collector<T, A, R> {
- method public java.util.function.BiConsumer<A,T> accumulator();
- method public java.util.Set<java.util.stream.Collector.Characteristics> characteristics();
- method public java.util.function.BinaryOperator<A> combiner();
- method public java.util.function.Function<A,R> finisher();
- method public static <T, R> java.util.stream.Collector<T,R,R> of(java.util.function.Supplier<R>, java.util.function.BiConsumer<R,T>, java.util.function.BinaryOperator<R>, java.util.stream.Collector.Characteristics...);
- method public static <T, A, R> java.util.stream.Collector<T,A,R> of(java.util.function.Supplier<A>, java.util.function.BiConsumer<A,T>, java.util.function.BinaryOperator<A>, java.util.function.Function<A,R>, java.util.stream.Collector.Characteristics...);
- method public java.util.function.Supplier<A> supplier();
- }
-
- public enum Collector.Characteristics {
- enum_constant public static final java.util.stream.Collector.Characteristics CONCURRENT;
- enum_constant public static final java.util.stream.Collector.Characteristics IDENTITY_FINISH;
- enum_constant public static final java.util.stream.Collector.Characteristics UNORDERED;
- }
-
- public final class Collectors {
- method public static <T> java.util.stream.Collector<T,?,java.lang.Double> averagingDouble(java.util.function.ToDoubleFunction<? super T>);
- method public static <T> java.util.stream.Collector<T,?,java.lang.Double> averagingInt(java.util.function.ToIntFunction<? super T>);
- method public static <T> java.util.stream.Collector<T,?,java.lang.Double> averagingLong(java.util.function.ToLongFunction<? super T>);
- method public static <T, A, R, RR> java.util.stream.Collector<T,A,RR> collectingAndThen(java.util.stream.Collector<T,A,R>, java.util.function.Function<R,RR>);
- method public static <T> java.util.stream.Collector<T,?,java.lang.Long> counting();
- method public static <T, K> java.util.stream.Collector<T,?,java.util.Map<K,java.util.List<T>>> groupingBy(java.util.function.Function<? super T,? extends K>);
- method public static <T, K, A, D> java.util.stream.Collector<T,?,java.util.Map<K,D>> groupingBy(java.util.function.Function<? super T,? extends K>, java.util.stream.Collector<? super T,A,D>);
- method public static <T, K, D, A, M extends java.util.Map<K, D>> java.util.stream.Collector<T,?,M> groupingBy(java.util.function.Function<? super T,? extends K>, java.util.function.Supplier<M>, java.util.stream.Collector<? super T,A,D>);
- method public static <T, K> java.util.stream.Collector<T,?,java.util.concurrent.ConcurrentMap<K,java.util.List<T>>> groupingByConcurrent(java.util.function.Function<? super T,? extends K>);
- method public static <T, K, A, D> java.util.stream.Collector<T,?,java.util.concurrent.ConcurrentMap<K,D>> groupingByConcurrent(java.util.function.Function<? super T,? extends K>, java.util.stream.Collector<? super T,A,D>);
- method public static <T, K, A, D, M extends java.util.concurrent.ConcurrentMap<K, D>> java.util.stream.Collector<T,?,M> groupingByConcurrent(java.util.function.Function<? super T,? extends K>, java.util.function.Supplier<M>, java.util.stream.Collector<? super T,A,D>);
- method public static java.util.stream.Collector<java.lang.CharSequence,?,java.lang.String> joining();
- method public static java.util.stream.Collector<java.lang.CharSequence,?,java.lang.String> joining(CharSequence);
- method public static java.util.stream.Collector<java.lang.CharSequence,?,java.lang.String> joining(CharSequence, CharSequence, CharSequence);
- method public static <T, U, A, R> java.util.stream.Collector<T,?,R> mapping(java.util.function.Function<? super T,? extends U>, java.util.stream.Collector<? super U,A,R>);
- method public static <T> java.util.stream.Collector<T,?,java.util.Optional<T>> maxBy(java.util.Comparator<? super T>);
- method public static <T> java.util.stream.Collector<T,?,java.util.Optional<T>> minBy(java.util.Comparator<? super T>);
- method public static <T> java.util.stream.Collector<T,?,java.util.Map<java.lang.Boolean,java.util.List<T>>> partitioningBy(java.util.function.Predicate<? super T>);
- method public static <T, D, A> java.util.stream.Collector<T,?,java.util.Map<java.lang.Boolean,D>> partitioningBy(java.util.function.Predicate<? super T>, java.util.stream.Collector<? super T,A,D>);
- method public static <T> java.util.stream.Collector<T,?,T> reducing(T, java.util.function.BinaryOperator<T>);
- method public static <T> java.util.stream.Collector<T,?,java.util.Optional<T>> reducing(java.util.function.BinaryOperator<T>);
- method public static <T, U> java.util.stream.Collector<T,?,U> reducing(U, java.util.function.Function<? super T,? extends U>, java.util.function.BinaryOperator<U>);
- method public static <T> java.util.stream.Collector<T,?,java.util.DoubleSummaryStatistics> summarizingDouble(java.util.function.ToDoubleFunction<? super T>);
- method public static <T> java.util.stream.Collector<T,?,java.util.IntSummaryStatistics> summarizingInt(java.util.function.ToIntFunction<? super T>);
- method public static <T> java.util.stream.Collector<T,?,java.util.LongSummaryStatistics> summarizingLong(java.util.function.ToLongFunction<? super T>);
- method public static <T> java.util.stream.Collector<T,?,java.lang.Double> summingDouble(java.util.function.ToDoubleFunction<? super T>);
- method public static <T> java.util.stream.Collector<T,?,java.lang.Integer> summingInt(java.util.function.ToIntFunction<? super T>);
- method public static <T> java.util.stream.Collector<T,?,java.lang.Long> summingLong(java.util.function.ToLongFunction<? super T>);
- method public static <T, C extends java.util.Collection<T>> java.util.stream.Collector<T,?,C> toCollection(java.util.function.Supplier<C>);
- method public static <T, K, U> java.util.stream.Collector<T,?,java.util.concurrent.ConcurrentMap<K,U>> toConcurrentMap(java.util.function.Function<? super T,? extends K>, java.util.function.Function<? super T,? extends U>);
- method public static <T, K, U> java.util.stream.Collector<T,?,java.util.concurrent.ConcurrentMap<K,U>> toConcurrentMap(java.util.function.Function<? super T,? extends K>, java.util.function.Function<? super T,? extends U>, java.util.function.BinaryOperator<U>);
- method public static <T, K, U, M extends java.util.concurrent.ConcurrentMap<K, U>> java.util.stream.Collector<T,?,M> toConcurrentMap(java.util.function.Function<? super T,? extends K>, java.util.function.Function<? super T,? extends U>, java.util.function.BinaryOperator<U>, java.util.function.Supplier<M>);
- method public static <T> java.util.stream.Collector<T,?,java.util.List<T>> toList();
- method public static <T, K, U> java.util.stream.Collector<T,?,java.util.Map<K,U>> toMap(java.util.function.Function<? super T,? extends K>, java.util.function.Function<? super T,? extends U>);
- method public static <T, K, U> java.util.stream.Collector<T,?,java.util.Map<K,U>> toMap(java.util.function.Function<? super T,? extends K>, java.util.function.Function<? super T,? extends U>, java.util.function.BinaryOperator<U>);
- method public static <T, K, U, M extends java.util.Map<K, U>> java.util.stream.Collector<T,?,M> toMap(java.util.function.Function<? super T,? extends K>, java.util.function.Function<? super T,? extends U>, java.util.function.BinaryOperator<U>, java.util.function.Supplier<M>);
- method public static <T> java.util.stream.Collector<T,?,java.util.Set<T>> toSet();
- }
-
- public interface DoubleStream extends java.util.stream.BaseStream<java.lang.Double,java.util.stream.DoubleStream> {
- method public boolean allMatch(java.util.function.DoublePredicate);
- method public boolean anyMatch(java.util.function.DoublePredicate);
- method public java.util.OptionalDouble average();
- method public java.util.stream.Stream<java.lang.Double> boxed();
- method public static java.util.stream.DoubleStream.Builder builder();
- method public <R> R collect(java.util.function.Supplier<R>, java.util.function.ObjDoubleConsumer<R>, java.util.function.BiConsumer<R,R>);
- method public static java.util.stream.DoubleStream concat(java.util.stream.DoubleStream, java.util.stream.DoubleStream);
- method public long count();
- method public java.util.stream.DoubleStream distinct();
- method public static java.util.stream.DoubleStream empty();
- method public java.util.stream.DoubleStream filter(java.util.function.DoublePredicate);
- method public java.util.OptionalDouble findAny();
- method public java.util.OptionalDouble findFirst();
- method public java.util.stream.DoubleStream flatMap(java.util.function.DoubleFunction<? extends java.util.stream.DoubleStream>);
- method public void forEach(java.util.function.DoubleConsumer);
- method public void forEachOrdered(java.util.function.DoubleConsumer);
- method public static java.util.stream.DoubleStream generate(java.util.function.DoubleSupplier);
- method public static java.util.stream.DoubleStream iterate(double, java.util.function.DoubleUnaryOperator);
- method public java.util.PrimitiveIterator.OfDouble iterator();
- method public java.util.stream.DoubleStream limit(long);
- method public java.util.stream.DoubleStream map(java.util.function.DoubleUnaryOperator);
- method public java.util.stream.IntStream mapToInt(java.util.function.DoubleToIntFunction);
- method public java.util.stream.LongStream mapToLong(java.util.function.DoubleToLongFunction);
- method public <U> java.util.stream.Stream<U> mapToObj(java.util.function.DoubleFunction<? extends U>);
- method public java.util.OptionalDouble max();
- method public java.util.OptionalDouble min();
- method public boolean noneMatch(java.util.function.DoublePredicate);
- method public static java.util.stream.DoubleStream of(double);
- method public static java.util.stream.DoubleStream of(double...);
- method public java.util.stream.DoubleStream parallel();
- method public java.util.stream.DoubleStream peek(java.util.function.DoubleConsumer);
- method public double reduce(double, java.util.function.DoubleBinaryOperator);
- method public java.util.OptionalDouble reduce(java.util.function.DoubleBinaryOperator);
- method public java.util.stream.DoubleStream sequential();
- method public java.util.stream.DoubleStream skip(long);
- method public java.util.stream.DoubleStream sorted();
- method public java.util.Spliterator.OfDouble spliterator();
- method public double sum();
- method public java.util.DoubleSummaryStatistics summaryStatistics();
- method public double[] toArray();
- }
-
- public static interface DoubleStream.Builder extends java.util.function.DoubleConsumer {
- method public default java.util.stream.DoubleStream.Builder add(double);
- method public java.util.stream.DoubleStream build();
- }
-
- public interface IntStream extends java.util.stream.BaseStream<java.lang.Integer,java.util.stream.IntStream> {
- method public boolean allMatch(java.util.function.IntPredicate);
- method public boolean anyMatch(java.util.function.IntPredicate);
- method public java.util.stream.DoubleStream asDoubleStream();
- method public java.util.stream.LongStream asLongStream();
- method public java.util.OptionalDouble average();
- method public java.util.stream.Stream<java.lang.Integer> boxed();
- method public static java.util.stream.IntStream.Builder builder();
- method public <R> R collect(java.util.function.Supplier<R>, java.util.function.ObjIntConsumer<R>, java.util.function.BiConsumer<R,R>);
- method public static java.util.stream.IntStream concat(java.util.stream.IntStream, java.util.stream.IntStream);
- method public long count();
- method public java.util.stream.IntStream distinct();
- method public static java.util.stream.IntStream empty();
- method public java.util.stream.IntStream filter(java.util.function.IntPredicate);
- method public java.util.OptionalInt findAny();
- method public java.util.OptionalInt findFirst();
- method public java.util.stream.IntStream flatMap(java.util.function.IntFunction<? extends java.util.stream.IntStream>);
- method public void forEach(java.util.function.IntConsumer);
- method public void forEachOrdered(java.util.function.IntConsumer);
- method public static java.util.stream.IntStream generate(java.util.function.IntSupplier);
- method public static java.util.stream.IntStream iterate(int, java.util.function.IntUnaryOperator);
- method public java.util.PrimitiveIterator.OfInt iterator();
- method public java.util.stream.IntStream limit(long);
- method public java.util.stream.IntStream map(java.util.function.IntUnaryOperator);
- method public java.util.stream.DoubleStream mapToDouble(java.util.function.IntToDoubleFunction);
- method public java.util.stream.LongStream mapToLong(java.util.function.IntToLongFunction);
- method public <U> java.util.stream.Stream<U> mapToObj(java.util.function.IntFunction<? extends U>);
- method public java.util.OptionalInt max();
- method public java.util.OptionalInt min();
- method public boolean noneMatch(java.util.function.IntPredicate);
- method public static java.util.stream.IntStream of(int);
- method public static java.util.stream.IntStream of(int...);
- method public java.util.stream.IntStream parallel();
- method public java.util.stream.IntStream peek(java.util.function.IntConsumer);
- method public static java.util.stream.IntStream range(int, int);
- method public static java.util.stream.IntStream rangeClosed(int, int);
- method public int reduce(int, java.util.function.IntBinaryOperator);
- method public java.util.OptionalInt reduce(java.util.function.IntBinaryOperator);
- method public java.util.stream.IntStream sequential();
- method public java.util.stream.IntStream skip(long);
- method public java.util.stream.IntStream sorted();
- method public java.util.Spliterator.OfInt spliterator();
- method public int sum();
- method public java.util.IntSummaryStatistics summaryStatistics();
- method public int[] toArray();
- }
-
- public static interface IntStream.Builder extends java.util.function.IntConsumer {
- method public default java.util.stream.IntStream.Builder add(int);
- method public java.util.stream.IntStream build();
- }
-
- public interface LongStream extends java.util.stream.BaseStream<java.lang.Long,java.util.stream.LongStream> {
- method public boolean allMatch(java.util.function.LongPredicate);
- method public boolean anyMatch(java.util.function.LongPredicate);
- method public java.util.stream.DoubleStream asDoubleStream();
- method public java.util.OptionalDouble average();
- method public java.util.stream.Stream<java.lang.Long> boxed();
- method public static java.util.stream.LongStream.Builder builder();
- method public <R> R collect(java.util.function.Supplier<R>, java.util.function.ObjLongConsumer<R>, java.util.function.BiConsumer<R,R>);
- method public static java.util.stream.LongStream concat(java.util.stream.LongStream, java.util.stream.LongStream);
- method public long count();
- method public java.util.stream.LongStream distinct();
- method public static java.util.stream.LongStream empty();
- method public java.util.stream.LongStream filter(java.util.function.LongPredicate);
- method public java.util.OptionalLong findAny();
- method public java.util.OptionalLong findFirst();
- method public java.util.stream.LongStream flatMap(java.util.function.LongFunction<? extends java.util.stream.LongStream>);
- method public void forEach(java.util.function.LongConsumer);
- method public void forEachOrdered(java.util.function.LongConsumer);
- method public static java.util.stream.LongStream generate(java.util.function.LongSupplier);
- method public static java.util.stream.LongStream iterate(long, java.util.function.LongUnaryOperator);
- method public java.util.PrimitiveIterator.OfLong iterator();
- method public java.util.stream.LongStream limit(long);
- method public java.util.stream.LongStream map(java.util.function.LongUnaryOperator);
- method public java.util.stream.DoubleStream mapToDouble(java.util.function.LongToDoubleFunction);
- method public java.util.stream.IntStream mapToInt(java.util.function.LongToIntFunction);
- method public <U> java.util.stream.Stream<U> mapToObj(java.util.function.LongFunction<? extends U>);
- method public java.util.OptionalLong max();
- method public java.util.OptionalLong min();
- method public boolean noneMatch(java.util.function.LongPredicate);
- method public static java.util.stream.LongStream of(long);
- method public static java.util.stream.LongStream of(long...);
- method public java.util.stream.LongStream parallel();
- method public java.util.stream.LongStream peek(java.util.function.LongConsumer);
- method public static java.util.stream.LongStream range(long, long);
- method public static java.util.stream.LongStream rangeClosed(long, long);
- method public long reduce(long, java.util.function.LongBinaryOperator);
- method public java.util.OptionalLong reduce(java.util.function.LongBinaryOperator);
- method public java.util.stream.LongStream sequential();
- method public java.util.stream.LongStream skip(long);
- method public java.util.stream.LongStream sorted();
- method public java.util.Spliterator.OfLong spliterator();
- method public long sum();
- method public java.util.LongSummaryStatistics summaryStatistics();
- method public long[] toArray();
- }
-
- public static interface LongStream.Builder extends java.util.function.LongConsumer {
- method public default java.util.stream.LongStream.Builder add(long);
- method public java.util.stream.LongStream build();
- }
-
- public interface Stream<T> extends java.util.stream.BaseStream<T,java.util.stream.Stream<T>> {
- method public boolean allMatch(java.util.function.Predicate<? super T>);
- method public boolean anyMatch(java.util.function.Predicate<? super T>);
- method public static <T> java.util.stream.Stream.Builder<T> builder();
- method public <R> R collect(java.util.function.Supplier<R>, java.util.function.BiConsumer<R,? super T>, java.util.function.BiConsumer<R,R>);
- method public <R, A> R collect(java.util.stream.Collector<? super T,A,R>);
- method public static <T> java.util.stream.Stream<T> concat(java.util.stream.Stream<? extends T>, java.util.stream.Stream<? extends T>);
- method public long count();
- method public java.util.stream.Stream<T> distinct();
- method public static <T> java.util.stream.Stream<T> empty();
- method public java.util.stream.Stream<T> filter(java.util.function.Predicate<? super T>);
- method public java.util.Optional<T> findAny();
- method public java.util.Optional<T> findFirst();
- method public <R> java.util.stream.Stream<R> flatMap(java.util.function.Function<? super T,? extends java.util.stream.Stream<? extends R>>);
- method public java.util.stream.DoubleStream flatMapToDouble(java.util.function.Function<? super T,? extends java.util.stream.DoubleStream>);
- method public java.util.stream.IntStream flatMapToInt(java.util.function.Function<? super T,? extends java.util.stream.IntStream>);
- method public java.util.stream.LongStream flatMapToLong(java.util.function.Function<? super T,? extends java.util.stream.LongStream>);
- method public void forEach(java.util.function.Consumer<? super T>);
- method public void forEachOrdered(java.util.function.Consumer<? super T>);
- method public static <T> java.util.stream.Stream<T> generate(java.util.function.Supplier<T>);
- method public static <T> java.util.stream.Stream<T> iterate(T, java.util.function.UnaryOperator<T>);
- method public java.util.stream.Stream<T> limit(long);
- method public <R> java.util.stream.Stream<R> map(java.util.function.Function<? super T,? extends R>);
- method public java.util.stream.DoubleStream mapToDouble(java.util.function.ToDoubleFunction<? super T>);
- method public java.util.stream.IntStream mapToInt(java.util.function.ToIntFunction<? super T>);
- method public java.util.stream.LongStream mapToLong(java.util.function.ToLongFunction<? super T>);
- method public java.util.Optional<T> max(java.util.Comparator<? super T>);
- method public java.util.Optional<T> min(java.util.Comparator<? super T>);
- method public boolean noneMatch(java.util.function.Predicate<? super T>);
- method public static <T> java.util.stream.Stream<T> of(T);
- method @java.lang.SafeVarargs public static <T> java.util.stream.Stream<T> of(T...);
- method public java.util.stream.Stream<T> peek(java.util.function.Consumer<? super T>);
- method public T reduce(T, java.util.function.BinaryOperator<T>);
- method public java.util.Optional<T> reduce(java.util.function.BinaryOperator<T>);
- method public <U> U reduce(U, java.util.function.BiFunction<U,? super T,U>, java.util.function.BinaryOperator<U>);
- method public java.util.stream.Stream<T> skip(long);
- method public java.util.stream.Stream<T> sorted();
- method public java.util.stream.Stream<T> sorted(java.util.Comparator<? super T>);
- method public Object[] toArray();
- method public <A> A[] toArray(java.util.function.IntFunction<A[]>);
- }
-
- public static interface Stream.Builder<T> extends java.util.function.Consumer<T> {
- method public default java.util.stream.Stream.Builder<T> add(T);
- method public java.util.stream.Stream<T> build();
- }
-
- public final class StreamSupport {
- method public static java.util.stream.DoubleStream doubleStream(java.util.Spliterator.OfDouble, boolean);
- method public static java.util.stream.DoubleStream doubleStream(java.util.function.Supplier<? extends java.util.Spliterator.OfDouble>, int, boolean);
- method public static java.util.stream.IntStream intStream(java.util.Spliterator.OfInt, boolean);
- method public static java.util.stream.IntStream intStream(java.util.function.Supplier<? extends java.util.Spliterator.OfInt>, int, boolean);
- method public static java.util.stream.LongStream longStream(java.util.Spliterator.OfLong, boolean);
- method public static java.util.stream.LongStream longStream(java.util.function.Supplier<? extends java.util.Spliterator.OfLong>, int, boolean);
- method public static <T> java.util.stream.Stream<T> stream(java.util.Spliterator<T>, boolean);
- method public static <T> java.util.stream.Stream<T> stream(java.util.function.Supplier<? extends java.util.Spliterator<T>>, int, boolean);
- }
-
-}
-
-package java.util.zip {
-
- public class Adler32 implements java.util.zip.Checksum {
- ctor public Adler32();
- method public long getValue();
- method public void reset();
- method public void update(int);
- method public void update(byte[], int, int);
- method public void update(byte[]);
- method public void update(java.nio.ByteBuffer);
- }
-
- public class CRC32 implements java.util.zip.Checksum {
- ctor public CRC32();
- method public long getValue();
- method public void reset();
- method public void update(int);
- method public void update(byte[], int, int);
- method public void update(byte[]);
- method public void update(java.nio.ByteBuffer);
- }
-
- public class CheckedInputStream extends java.io.FilterInputStream {
- ctor public CheckedInputStream(java.io.InputStream, java.util.zip.Checksum);
- method public java.util.zip.Checksum getChecksum();
- }
-
- public class CheckedOutputStream extends java.io.FilterOutputStream {
- ctor public CheckedOutputStream(java.io.OutputStream, java.util.zip.Checksum);
- method public java.util.zip.Checksum getChecksum();
- }
-
- public interface Checksum {
- method public long getValue();
- method public void reset();
- method public void update(int);
- method public void update(byte[], int, int);
- }
-
- public class DataFormatException extends java.lang.Exception {
- ctor public DataFormatException();
- ctor public DataFormatException(String);
- }
-
- public class Deflater {
- ctor public Deflater(int, boolean);
- ctor public Deflater(int);
- ctor public Deflater();
- method public int deflate(byte[], int, int);
- method public int deflate(byte[]);
- method public int deflate(byte[], int, int, int);
- method public void end();
- method protected void finalize();
- method public void finish();
- method public boolean finished();
- method public int getAdler();
- method public long getBytesRead();
- method public long getBytesWritten();
- method public int getTotalIn();
- method public int getTotalOut();
- method public boolean needsInput();
- method public void reset();
- method public void setDictionary(byte[], int, int);
- method public void setDictionary(byte[]);
- method public void setInput(byte[], int, int);
- method public void setInput(byte[]);
- method public void setLevel(int);
- method public void setStrategy(int);
- field public static final int BEST_COMPRESSION = 9; // 0x9
- field public static final int BEST_SPEED = 1; // 0x1
- field public static final int DEFAULT_COMPRESSION = -1; // 0xffffffff
- field public static final int DEFAULT_STRATEGY = 0; // 0x0
- field public static final int DEFLATED = 8; // 0x8
- field public static final int FILTERED = 1; // 0x1
- field public static final int FULL_FLUSH = 3; // 0x3
- field public static final int HUFFMAN_ONLY = 2; // 0x2
- field public static final int NO_COMPRESSION = 0; // 0x0
- field public static final int NO_FLUSH = 0; // 0x0
- field public static final int SYNC_FLUSH = 2; // 0x2
- }
-
- public class DeflaterInputStream extends java.io.FilterInputStream {
- ctor public DeflaterInputStream(java.io.InputStream);
- ctor public DeflaterInputStream(java.io.InputStream, java.util.zip.Deflater);
- ctor public DeflaterInputStream(java.io.InputStream, java.util.zip.Deflater, int);
- field protected final byte[] buf;
- field protected final java.util.zip.Deflater def;
- }
-
- public class DeflaterOutputStream extends java.io.FilterOutputStream {
- ctor public DeflaterOutputStream(java.io.OutputStream, java.util.zip.Deflater, int, boolean);
- ctor public DeflaterOutputStream(java.io.OutputStream, java.util.zip.Deflater, int);
- ctor public DeflaterOutputStream(java.io.OutputStream, java.util.zip.Deflater, boolean);
- ctor public DeflaterOutputStream(java.io.OutputStream, java.util.zip.Deflater);
- ctor public DeflaterOutputStream(java.io.OutputStream, boolean);
- ctor public DeflaterOutputStream(java.io.OutputStream);
- method protected void deflate() throws java.io.IOException;
- method public void finish() throws java.io.IOException;
- field protected byte[] buf;
- field protected java.util.zip.Deflater def;
- }
-
- public class GZIPInputStream extends java.util.zip.InflaterInputStream {
- ctor public GZIPInputStream(java.io.InputStream, int) throws java.io.IOException;
- ctor public GZIPInputStream(java.io.InputStream) throws java.io.IOException;
- field public static final int GZIP_MAGIC = 35615; // 0x8b1f
- field protected java.util.zip.CRC32 crc;
- field protected boolean eos;
- }
-
- public class GZIPOutputStream extends java.util.zip.DeflaterOutputStream {
- ctor public GZIPOutputStream(java.io.OutputStream, int) throws java.io.IOException;
- ctor public GZIPOutputStream(java.io.OutputStream, int, boolean) throws java.io.IOException;
- ctor public GZIPOutputStream(java.io.OutputStream) throws java.io.IOException;
- ctor public GZIPOutputStream(java.io.OutputStream, boolean) throws java.io.IOException;
- field protected java.util.zip.CRC32 crc;
- }
-
- public class Inflater {
- ctor public Inflater(boolean);
- ctor public Inflater();
- method public void end();
- method protected void finalize();
- method public boolean finished();
- method public int getAdler();
- method public long getBytesRead();
- method public long getBytesWritten();
- method public int getRemaining();
- method public int getTotalIn();
- method public int getTotalOut();
- method public int inflate(byte[], int, int) throws java.util.zip.DataFormatException;
- method public int inflate(byte[]) throws java.util.zip.DataFormatException;
- method public boolean needsDictionary();
- method public boolean needsInput();
- method public void reset();
- method public void setDictionary(byte[], int, int);
- method public void setDictionary(byte[]);
- method public void setInput(byte[], int, int);
- method public void setInput(byte[]);
- }
-
- public class InflaterInputStream extends java.io.FilterInputStream {
- ctor public InflaterInputStream(java.io.InputStream, java.util.zip.Inflater, int);
- ctor public InflaterInputStream(java.io.InputStream, java.util.zip.Inflater);
- ctor public InflaterInputStream(java.io.InputStream);
- method protected void fill() throws java.io.IOException;
- field protected byte[] buf;
- field @Deprecated protected boolean closed;
- field protected java.util.zip.Inflater inf;
- field protected int len;
- }
-
- public class InflaterOutputStream extends java.io.FilterOutputStream {
- ctor public InflaterOutputStream(java.io.OutputStream);
- ctor public InflaterOutputStream(java.io.OutputStream, java.util.zip.Inflater);
- ctor public InflaterOutputStream(java.io.OutputStream, java.util.zip.Inflater, int);
- method public void finish() throws java.io.IOException;
- field protected final byte[] buf;
- field protected final java.util.zip.Inflater inf;
- }
-
- public class ZipEntry implements java.lang.Cloneable {
- ctor public ZipEntry(String);
- ctor public ZipEntry(java.util.zip.ZipEntry);
- method public Object clone();
- method public String getComment();
- method public long getCompressedSize();
- method public long getCrc();
- method public java.nio.file.attribute.FileTime getCreationTime();
- method public byte[] getExtra();
- method public java.nio.file.attribute.FileTime getLastAccessTime();
- method public java.nio.file.attribute.FileTime getLastModifiedTime();
- method public int getMethod();
- method public String getName();
- method public long getSize();
- method public long getTime();
- method public boolean isDirectory();
- method public void setComment(String);
- method public void setCompressedSize(long);
- method public void setCrc(long);
- method public java.util.zip.ZipEntry setCreationTime(java.nio.file.attribute.FileTime);
- method public void setExtra(byte[]);
- method public java.util.zip.ZipEntry setLastAccessTime(java.nio.file.attribute.FileTime);
- method public java.util.zip.ZipEntry setLastModifiedTime(java.nio.file.attribute.FileTime);
- method public void setMethod(int);
- method public void setSize(long);
- method public void setTime(long);
- field public static final int CENATT = 36; // 0x24
- field public static final int CENATX = 38; // 0x26
- field public static final int CENCOM = 32; // 0x20
- field public static final int CENCRC = 16; // 0x10
- field public static final int CENDSK = 34; // 0x22
- field public static final int CENEXT = 30; // 0x1e
- field public static final int CENFLG = 8; // 0x8
- field public static final int CENHDR = 46; // 0x2e
- field public static final int CENHOW = 10; // 0xa
- field public static final int CENLEN = 24; // 0x18
- field public static final int CENNAM = 28; // 0x1c
- field public static final int CENOFF = 42; // 0x2a
- field public static final long CENSIG = 33639248L; // 0x2014b50L
- field public static final int CENSIZ = 20; // 0x14
- field public static final int CENTIM = 12; // 0xc
- field public static final int CENVEM = 4; // 0x4
- field public static final int CENVER = 6; // 0x6
- field public static final int DEFLATED = 8; // 0x8
- field public static final int ENDCOM = 20; // 0x14
- field public static final int ENDHDR = 22; // 0x16
- field public static final int ENDOFF = 16; // 0x10
- field public static final long ENDSIG = 101010256L; // 0x6054b50L
- field public static final int ENDSIZ = 12; // 0xc
- field public static final int ENDSUB = 8; // 0x8
- field public static final int ENDTOT = 10; // 0xa
- field public static final int EXTCRC = 4; // 0x4
- field public static final int EXTHDR = 16; // 0x10
- field public static final int EXTLEN = 12; // 0xc
- field public static final long EXTSIG = 134695760L; // 0x8074b50L
- field public static final int EXTSIZ = 8; // 0x8
- field public static final int LOCCRC = 14; // 0xe
- field public static final int LOCEXT = 28; // 0x1c
- field public static final int LOCFLG = 6; // 0x6
- field public static final int LOCHDR = 30; // 0x1e
- field public static final int LOCHOW = 8; // 0x8
- field public static final int LOCLEN = 22; // 0x16
- field public static final int LOCNAM = 26; // 0x1a
- field public static final long LOCSIG = 67324752L; // 0x4034b50L
- field public static final int LOCSIZ = 18; // 0x12
- field public static final int LOCTIM = 10; // 0xa
- field public static final int LOCVER = 4; // 0x4
- field public static final int STORED = 0; // 0x0
- }
-
- public class ZipError extends java.lang.InternalError {
- ctor public ZipError(String);
- }
-
- public class ZipException extends java.io.IOException {
- ctor public ZipException();
- ctor public ZipException(String);
- }
-
- public class ZipFile implements java.io.Closeable {
- ctor public ZipFile(String) throws java.io.IOException;
- ctor public ZipFile(java.io.File, int) throws java.io.IOException;
- ctor public ZipFile(java.io.File) throws java.io.IOException, java.util.zip.ZipException;
- ctor public ZipFile(java.io.File, int, java.nio.charset.Charset) throws java.io.IOException;
- ctor public ZipFile(String, java.nio.charset.Charset) throws java.io.IOException;
- ctor public ZipFile(java.io.File, java.nio.charset.Charset) throws java.io.IOException;
- method public void close() throws java.io.IOException;
- method public java.util.Enumeration<? extends java.util.zip.ZipEntry> entries();
- method protected void finalize() throws java.io.IOException;
- method public String getComment();
- method public java.util.zip.ZipEntry getEntry(String);
- method public java.io.InputStream getInputStream(java.util.zip.ZipEntry) throws java.io.IOException;
- method public String getName();
- method public int size();
- method public java.util.stream.Stream<? extends java.util.zip.ZipEntry> stream();
- field public static final int CENATT = 36; // 0x24
- field public static final int CENATX = 38; // 0x26
- field public static final int CENCOM = 32; // 0x20
- field public static final int CENCRC = 16; // 0x10
- field public static final int CENDSK = 34; // 0x22
- field public static final int CENEXT = 30; // 0x1e
- field public static final int CENFLG = 8; // 0x8
- field public static final int CENHDR = 46; // 0x2e
- field public static final int CENHOW = 10; // 0xa
- field public static final int CENLEN = 24; // 0x18
- field public static final int CENNAM = 28; // 0x1c
- field public static final int CENOFF = 42; // 0x2a
- field public static final long CENSIG = 33639248L; // 0x2014b50L
- field public static final int CENSIZ = 20; // 0x14
- field public static final int CENTIM = 12; // 0xc
- field public static final int CENVEM = 4; // 0x4
- field public static final int CENVER = 6; // 0x6
- field public static final int ENDCOM = 20; // 0x14
- field public static final int ENDHDR = 22; // 0x16
- field public static final int ENDOFF = 16; // 0x10
- field public static final long ENDSIG = 101010256L; // 0x6054b50L
- field public static final int ENDSIZ = 12; // 0xc
- field public static final int ENDSUB = 8; // 0x8
- field public static final int ENDTOT = 10; // 0xa
- field public static final int EXTCRC = 4; // 0x4
- field public static final int EXTHDR = 16; // 0x10
- field public static final int EXTLEN = 12; // 0xc
- field public static final long EXTSIG = 134695760L; // 0x8074b50L
- field public static final int EXTSIZ = 8; // 0x8
- field public static final int LOCCRC = 14; // 0xe
- field public static final int LOCEXT = 28; // 0x1c
- field public static final int LOCFLG = 6; // 0x6
- field public static final int LOCHDR = 30; // 0x1e
- field public static final int LOCHOW = 8; // 0x8
- field public static final int LOCLEN = 22; // 0x16
- field public static final int LOCNAM = 26; // 0x1a
- field public static final long LOCSIG = 67324752L; // 0x4034b50L
- field public static final int LOCSIZ = 18; // 0x12
- field public static final int LOCTIM = 10; // 0xa
- field public static final int LOCVER = 4; // 0x4
- field public static final int OPEN_DELETE = 4; // 0x4
- field public static final int OPEN_READ = 1; // 0x1
- }
-
- public class ZipInputStream extends java.util.zip.InflaterInputStream {
- ctor public ZipInputStream(java.io.InputStream);
- ctor public ZipInputStream(java.io.InputStream, java.nio.charset.Charset);
- method public void closeEntry() throws java.io.IOException;
- method protected java.util.zip.ZipEntry createZipEntry(String);
- method public java.util.zip.ZipEntry getNextEntry() throws java.io.IOException;
- field public static final int CENATT = 36; // 0x24
- field public static final int CENATX = 38; // 0x26
- field public static final int CENCOM = 32; // 0x20
- field public static final int CENCRC = 16; // 0x10
- field public static final int CENDSK = 34; // 0x22
- field public static final int CENEXT = 30; // 0x1e
- field public static final int CENFLG = 8; // 0x8
- field public static final int CENHDR = 46; // 0x2e
- field public static final int CENHOW = 10; // 0xa
- field public static final int CENLEN = 24; // 0x18
- field public static final int CENNAM = 28; // 0x1c
- field public static final int CENOFF = 42; // 0x2a
- field public static final long CENSIG = 33639248L; // 0x2014b50L
- field public static final int CENSIZ = 20; // 0x14
- field public static final int CENTIM = 12; // 0xc
- field public static final int CENVEM = 4; // 0x4
- field public static final int CENVER = 6; // 0x6
- field public static final int ENDCOM = 20; // 0x14
- field public static final int ENDHDR = 22; // 0x16
- field public static final int ENDOFF = 16; // 0x10
- field public static final long ENDSIG = 101010256L; // 0x6054b50L
- field public static final int ENDSIZ = 12; // 0xc
- field public static final int ENDSUB = 8; // 0x8
- field public static final int ENDTOT = 10; // 0xa
- field public static final int EXTCRC = 4; // 0x4
- field public static final int EXTHDR = 16; // 0x10
- field public static final int EXTLEN = 12; // 0xc
- field public static final long EXTSIG = 134695760L; // 0x8074b50L
- field public static final int EXTSIZ = 8; // 0x8
- field public static final int LOCCRC = 14; // 0xe
- field public static final int LOCEXT = 28; // 0x1c
- field public static final int LOCFLG = 6; // 0x6
- field public static final int LOCHDR = 30; // 0x1e
- field public static final int LOCHOW = 8; // 0x8
- field public static final int LOCLEN = 22; // 0x16
- field public static final int LOCNAM = 26; // 0x1a
- field public static final long LOCSIG = 67324752L; // 0x4034b50L
- field public static final int LOCSIZ = 18; // 0x12
- field public static final int LOCTIM = 10; // 0xa
- field public static final int LOCVER = 4; // 0x4
- }
-
- public class ZipOutputStream extends java.util.zip.DeflaterOutputStream {
- ctor public ZipOutputStream(java.io.OutputStream);
- ctor public ZipOutputStream(java.io.OutputStream, java.nio.charset.Charset);
- method public void closeEntry() throws java.io.IOException;
- method public void putNextEntry(java.util.zip.ZipEntry) throws java.io.IOException;
- method public void setComment(String);
- method public void setLevel(int);
- method public void setMethod(int);
- field public static final int CENATT = 36; // 0x24
- field public static final int CENATX = 38; // 0x26
- field public static final int CENCOM = 32; // 0x20
- field public static final int CENCRC = 16; // 0x10
- field public static final int CENDSK = 34; // 0x22
- field public static final int CENEXT = 30; // 0x1e
- field public static final int CENFLG = 8; // 0x8
- field public static final int CENHDR = 46; // 0x2e
- field public static final int CENHOW = 10; // 0xa
- field public static final int CENLEN = 24; // 0x18
- field public static final int CENNAM = 28; // 0x1c
- field public static final int CENOFF = 42; // 0x2a
- field public static final long CENSIG = 33639248L; // 0x2014b50L
- field public static final int CENSIZ = 20; // 0x14
- field public static final int CENTIM = 12; // 0xc
- field public static final int CENVEM = 4; // 0x4
- field public static final int CENVER = 6; // 0x6
- field public static final int DEFLATED = 8; // 0x8
- field public static final int ENDCOM = 20; // 0x14
- field public static final int ENDHDR = 22; // 0x16
- field public static final int ENDOFF = 16; // 0x10
- field public static final long ENDSIG = 101010256L; // 0x6054b50L
- field public static final int ENDSIZ = 12; // 0xc
- field public static final int ENDSUB = 8; // 0x8
- field public static final int ENDTOT = 10; // 0xa
- field public static final int EXTCRC = 4; // 0x4
- field public static final int EXTHDR = 16; // 0x10
- field public static final int EXTLEN = 12; // 0xc
- field public static final long EXTSIG = 134695760L; // 0x8074b50L
- field public static final int EXTSIZ = 8; // 0x8
- field public static final int LOCCRC = 14; // 0xe
- field public static final int LOCEXT = 28; // 0x1c
- field public static final int LOCFLG = 6; // 0x6
- field public static final int LOCHDR = 30; // 0x1e
- field public static final int LOCHOW = 8; // 0x8
- field public static final int LOCLEN = 22; // 0x16
- field public static final int LOCNAM = 26; // 0x1a
- field public static final long LOCSIG = 67324752L; // 0x4034b50L
- field public static final int LOCSIZ = 18; // 0x12
- field public static final int LOCTIM = 10; // 0xa
- field public static final int LOCVER = 4; // 0x4
- field public static final int STORED = 0; // 0x0
- }
-
-}
-
-package javax.crypto {
-
- public class AEADBadTagException extends javax.crypto.BadPaddingException {
- ctor public AEADBadTagException();
- ctor public AEADBadTagException(String);
- }
-
- public class BadPaddingException extends java.security.GeneralSecurityException {
- ctor public BadPaddingException();
- ctor public BadPaddingException(String);
- }
-
- public class Cipher {
- ctor protected Cipher(javax.crypto.CipherSpi, java.security.Provider, String);
- method public final byte[] doFinal() throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException;
- method public final int doFinal(byte[], int) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.ShortBufferException;
- method public final byte[] doFinal(byte[]) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException;
- method public final byte[] doFinal(byte[], int, int) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException;
- method public final int doFinal(byte[], int, int, byte[]) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.ShortBufferException;
- method public final int doFinal(byte[], int, int, byte[], int) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.ShortBufferException;
- method public final int doFinal(java.nio.ByteBuffer, java.nio.ByteBuffer) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.ShortBufferException;
- method public final String getAlgorithm();
- method public final int getBlockSize();
- method public final javax.crypto.ExemptionMechanism getExemptionMechanism();
- method public final byte[] getIV();
- method public static final javax.crypto.Cipher getInstance(String) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException;
- method public static final javax.crypto.Cipher getInstance(String, String) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException, java.security.NoSuchProviderException;
- method public static final javax.crypto.Cipher getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException;
- method public static final int getMaxAllowedKeyLength(String) throws java.security.NoSuchAlgorithmException;
- method public static final java.security.spec.AlgorithmParameterSpec getMaxAllowedParameterSpec(String) throws java.security.NoSuchAlgorithmException;
- method public final int getOutputSize(int);
- method public final java.security.AlgorithmParameters getParameters();
- method public final java.security.Provider getProvider();
- method public final void init(int, java.security.Key) throws java.security.InvalidKeyException;
- method public final void init(int, java.security.Key, java.security.SecureRandom) throws java.security.InvalidKeyException;
- method public final void init(int, java.security.Key, java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
- method public final void init(int, java.security.Key, java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
- method public final void init(int, java.security.Key, java.security.AlgorithmParameters) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
- method public final void init(int, java.security.Key, java.security.AlgorithmParameters, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
- method public final void init(int, java.security.cert.Certificate) throws java.security.InvalidKeyException;
- method public final void init(int, java.security.cert.Certificate, java.security.SecureRandom) throws java.security.InvalidKeyException;
- method public final java.security.Key unwrap(byte[], String, int) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException;
- method public final byte[] update(byte[]);
- method public final byte[] update(byte[], int, int);
- method public final int update(byte[], int, int, byte[]) throws javax.crypto.ShortBufferException;
- method public final int update(byte[], int, int, byte[], int) throws javax.crypto.ShortBufferException;
- method public final int update(java.nio.ByteBuffer, java.nio.ByteBuffer) throws javax.crypto.ShortBufferException;
- method public final void updateAAD(byte[]);
- method public final void updateAAD(byte[], int, int);
- method public final void updateAAD(java.nio.ByteBuffer);
- method public final byte[] wrap(java.security.Key) throws javax.crypto.IllegalBlockSizeException, java.security.InvalidKeyException;
- field public static final int DECRYPT_MODE = 2; // 0x2
- field public static final int ENCRYPT_MODE = 1; // 0x1
- field public static final int PRIVATE_KEY = 2; // 0x2
- field public static final int PUBLIC_KEY = 1; // 0x1
- field public static final int SECRET_KEY = 3; // 0x3
- field public static final int UNWRAP_MODE = 4; // 0x4
- field public static final int WRAP_MODE = 3; // 0x3
- }
-
- public class CipherInputStream extends java.io.FilterInputStream {
- ctor public CipherInputStream(java.io.InputStream, javax.crypto.Cipher);
- ctor protected CipherInputStream(java.io.InputStream);
- }
-
- public class CipherOutputStream extends java.io.FilterOutputStream {
- ctor public CipherOutputStream(java.io.OutputStream, javax.crypto.Cipher);
- ctor protected CipherOutputStream(java.io.OutputStream);
- }
-
- public abstract class CipherSpi {
- ctor public CipherSpi();
- method protected abstract byte[] engineDoFinal(byte[], int, int) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException;
- method protected abstract int engineDoFinal(byte[], int, int, byte[], int) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.ShortBufferException;
- method protected int engineDoFinal(java.nio.ByteBuffer, java.nio.ByteBuffer) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.ShortBufferException;
- method protected abstract int engineGetBlockSize();
- method protected abstract byte[] engineGetIV();
- method protected int engineGetKeySize(java.security.Key) throws java.security.InvalidKeyException;
- method protected abstract int engineGetOutputSize(int);
- method protected abstract java.security.AlgorithmParameters engineGetParameters();
- method protected abstract void engineInit(int, java.security.Key, java.security.SecureRandom) throws java.security.InvalidKeyException;
- method protected abstract void engineInit(int, java.security.Key, java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
- method protected abstract void engineInit(int, java.security.Key, java.security.AlgorithmParameters, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
- method protected abstract void engineSetMode(String) throws java.security.NoSuchAlgorithmException;
- method protected abstract void engineSetPadding(String) throws javax.crypto.NoSuchPaddingException;
- method protected java.security.Key engineUnwrap(byte[], String, int) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException;
- method protected abstract byte[] engineUpdate(byte[], int, int);
- method protected abstract int engineUpdate(byte[], int, int, byte[], int) throws javax.crypto.ShortBufferException;
- method protected int engineUpdate(java.nio.ByteBuffer, java.nio.ByteBuffer) throws javax.crypto.ShortBufferException;
- method protected void engineUpdateAAD(byte[], int, int);
- method protected void engineUpdateAAD(java.nio.ByteBuffer);
- method protected byte[] engineWrap(java.security.Key) throws javax.crypto.IllegalBlockSizeException, java.security.InvalidKeyException;
- }
-
- public class EncryptedPrivateKeyInfo {
- ctor public EncryptedPrivateKeyInfo(byte[]) throws java.io.IOException;
- ctor public EncryptedPrivateKeyInfo(String, byte[]) throws java.security.NoSuchAlgorithmException;
- ctor public EncryptedPrivateKeyInfo(java.security.AlgorithmParameters, byte[]) throws java.security.NoSuchAlgorithmException;
- method public String getAlgName();
- method public java.security.AlgorithmParameters getAlgParameters();
- method public byte[] getEncoded() throws java.io.IOException;
- method public byte[] getEncryptedData();
- method public java.security.spec.PKCS8EncodedKeySpec getKeySpec(javax.crypto.Cipher) throws java.security.spec.InvalidKeySpecException;
- method public java.security.spec.PKCS8EncodedKeySpec getKeySpec(java.security.Key) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException;
- method public java.security.spec.PKCS8EncodedKeySpec getKeySpec(java.security.Key, String) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public java.security.spec.PKCS8EncodedKeySpec getKeySpec(java.security.Key, java.security.Provider) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException;
- }
-
- public class ExemptionMechanism {
- ctor protected ExemptionMechanism(javax.crypto.ExemptionMechanismSpi, java.security.Provider, String);
- method public final byte[] genExemptionBlob() throws javax.crypto.ExemptionMechanismException, java.lang.IllegalStateException;
- method public final int genExemptionBlob(byte[]) throws javax.crypto.ExemptionMechanismException, java.lang.IllegalStateException, javax.crypto.ShortBufferException;
- method public final int genExemptionBlob(byte[], int) throws javax.crypto.ExemptionMechanismException, java.lang.IllegalStateException, javax.crypto.ShortBufferException;
- method public static final javax.crypto.ExemptionMechanism getInstance(String) throws java.security.NoSuchAlgorithmException;
- method public static final javax.crypto.ExemptionMechanism getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static final javax.crypto.ExemptionMechanism getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method public final String getName();
- method public final int getOutputSize(int) throws java.lang.IllegalStateException;
- method public final java.security.Provider getProvider();
- method public final void init(java.security.Key) throws javax.crypto.ExemptionMechanismException, java.security.InvalidKeyException;
- method public final void init(java.security.Key, java.security.spec.AlgorithmParameterSpec) throws javax.crypto.ExemptionMechanismException, java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
- method public final void init(java.security.Key, java.security.AlgorithmParameters) throws javax.crypto.ExemptionMechanismException, java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
- method public final boolean isCryptoAllowed(java.security.Key) throws javax.crypto.ExemptionMechanismException;
- }
-
- public class ExemptionMechanismException extends java.security.GeneralSecurityException {
- ctor public ExemptionMechanismException();
- ctor public ExemptionMechanismException(String);
- }
-
- public abstract class ExemptionMechanismSpi {
- ctor public ExemptionMechanismSpi();
- method protected abstract byte[] engineGenExemptionBlob() throws javax.crypto.ExemptionMechanismException;
- method protected abstract int engineGenExemptionBlob(byte[], int) throws javax.crypto.ExemptionMechanismException, javax.crypto.ShortBufferException;
- method protected abstract int engineGetOutputSize(int);
- method protected abstract void engineInit(java.security.Key) throws javax.crypto.ExemptionMechanismException, java.security.InvalidKeyException;
- method protected abstract void engineInit(java.security.Key, java.security.spec.AlgorithmParameterSpec) throws javax.crypto.ExemptionMechanismException, java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
- method protected abstract void engineInit(java.security.Key, java.security.AlgorithmParameters) throws javax.crypto.ExemptionMechanismException, java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
- }
-
- public class IllegalBlockSizeException extends java.security.GeneralSecurityException {
- ctor public IllegalBlockSizeException();
- ctor public IllegalBlockSizeException(String);
- }
-
- public class KeyAgreement {
- ctor protected KeyAgreement(javax.crypto.KeyAgreementSpi, java.security.Provider, String);
- method public final java.security.Key doPhase(java.security.Key, boolean) throws java.lang.IllegalStateException, java.security.InvalidKeyException;
- method public final byte[] generateSecret() throws java.lang.IllegalStateException;
- method public final int generateSecret(byte[], int) throws java.lang.IllegalStateException, javax.crypto.ShortBufferException;
- method public final javax.crypto.SecretKey generateSecret(String) throws java.lang.IllegalStateException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException;
- method public final String getAlgorithm();
- method public static final javax.crypto.KeyAgreement getInstance(String) throws java.security.NoSuchAlgorithmException;
- method public static final javax.crypto.KeyAgreement getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static final javax.crypto.KeyAgreement getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method public final java.security.Provider getProvider();
- method public final void init(java.security.Key) throws java.security.InvalidKeyException;
- method public final void init(java.security.Key, java.security.SecureRandom) throws java.security.InvalidKeyException;
- method public final void init(java.security.Key, java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
- method public final void init(java.security.Key, java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
- }
-
- public abstract class KeyAgreementSpi {
- ctor public KeyAgreementSpi();
- method protected abstract java.security.Key engineDoPhase(java.security.Key, boolean) throws java.lang.IllegalStateException, java.security.InvalidKeyException;
- method protected abstract byte[] engineGenerateSecret() throws java.lang.IllegalStateException;
- method protected abstract int engineGenerateSecret(byte[], int) throws java.lang.IllegalStateException, javax.crypto.ShortBufferException;
- method protected abstract javax.crypto.SecretKey engineGenerateSecret(String) throws java.lang.IllegalStateException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException;
- method protected abstract void engineInit(java.security.Key, java.security.SecureRandom) throws java.security.InvalidKeyException;
- method protected abstract void engineInit(java.security.Key, java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
- }
-
- public class KeyGenerator {
- ctor protected KeyGenerator(javax.crypto.KeyGeneratorSpi, java.security.Provider, String);
- method public final javax.crypto.SecretKey generateKey();
- method public final String getAlgorithm();
- method public static final javax.crypto.KeyGenerator getInstance(String) throws java.security.NoSuchAlgorithmException;
- method public static final javax.crypto.KeyGenerator getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static final javax.crypto.KeyGenerator getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method public final java.security.Provider getProvider();
- method public final void init(java.security.SecureRandom);
- method public final void init(java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException;
- method public final void init(java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException;
- method public final void init(int);
- method public final void init(int, java.security.SecureRandom);
- }
-
- public abstract class KeyGeneratorSpi {
- ctor public KeyGeneratorSpi();
- method protected abstract javax.crypto.SecretKey engineGenerateKey();
- method protected abstract void engineInit(java.security.SecureRandom);
- method protected abstract void engineInit(java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom) throws java.security.InvalidAlgorithmParameterException;
- method protected abstract void engineInit(int, java.security.SecureRandom);
- }
-
- public class Mac implements java.lang.Cloneable {
- ctor protected Mac(javax.crypto.MacSpi, java.security.Provider, String);
- method public final Object clone() throws java.lang.CloneNotSupportedException;
- method public final byte[] doFinal() throws java.lang.IllegalStateException;
- method public final void doFinal(byte[], int) throws java.lang.IllegalStateException, javax.crypto.ShortBufferException;
- method public final byte[] doFinal(byte[]) throws java.lang.IllegalStateException;
- method public final String getAlgorithm();
- method public static final javax.crypto.Mac getInstance(String) throws java.security.NoSuchAlgorithmException;
- method public static final javax.crypto.Mac getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static final javax.crypto.Mac getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method public final int getMacLength();
- method public final java.security.Provider getProvider();
- method public final void init(java.security.Key) throws java.security.InvalidKeyException;
- method public final void init(java.security.Key, java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
- method public final void reset();
- method public final void update(byte) throws java.lang.IllegalStateException;
- method public final void update(byte[]) throws java.lang.IllegalStateException;
- method public final void update(byte[], int, int) throws java.lang.IllegalStateException;
- method public final void update(java.nio.ByteBuffer);
- }
-
- public abstract class MacSpi {
- ctor public MacSpi();
- method public Object clone() throws java.lang.CloneNotSupportedException;
- method protected abstract byte[] engineDoFinal();
- method protected abstract int engineGetMacLength();
- method protected abstract void engineInit(java.security.Key, java.security.spec.AlgorithmParameterSpec) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException;
- method protected abstract void engineReset();
- method protected abstract void engineUpdate(byte);
- method protected abstract void engineUpdate(byte[], int, int);
- method protected void engineUpdate(java.nio.ByteBuffer);
- }
-
- public class NoSuchPaddingException extends java.security.GeneralSecurityException {
- ctor public NoSuchPaddingException();
- ctor public NoSuchPaddingException(String);
- }
-
- public class NullCipher extends javax.crypto.Cipher {
- ctor public NullCipher();
- }
-
- public class SealedObject implements java.io.Serializable {
- ctor public SealedObject(java.io.Serializable, javax.crypto.Cipher) throws java.io.IOException, javax.crypto.IllegalBlockSizeException;
- ctor protected SealedObject(javax.crypto.SealedObject);
- method public final String getAlgorithm();
- method public final Object getObject(java.security.Key) throws java.lang.ClassNotFoundException, java.io.IOException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException;
- method public final Object getObject(javax.crypto.Cipher) throws javax.crypto.BadPaddingException, java.lang.ClassNotFoundException, java.io.IOException, javax.crypto.IllegalBlockSizeException;
- method public final Object getObject(java.security.Key, String) throws java.lang.ClassNotFoundException, java.io.IOException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- field protected byte[] encodedParams;
- }
-
- public interface SecretKey extends java.security.Key javax.security.auth.Destroyable {
- field public static final long serialVersionUID = -4795878709595146952L; // 0xbd719db928b8f538L
- }
-
- public class SecretKeyFactory {
- ctor protected SecretKeyFactory(javax.crypto.SecretKeyFactorySpi, java.security.Provider, String);
- method public final javax.crypto.SecretKey generateSecret(java.security.spec.KeySpec) throws java.security.spec.InvalidKeySpecException;
- method public final String getAlgorithm();
- method public static final javax.crypto.SecretKeyFactory getInstance(String) throws java.security.NoSuchAlgorithmException;
- method public static final javax.crypto.SecretKeyFactory getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static final javax.crypto.SecretKeyFactory getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method public final java.security.spec.KeySpec getKeySpec(javax.crypto.SecretKey, Class<?>) throws java.security.spec.InvalidKeySpecException;
- method public final java.security.Provider getProvider();
- method public final javax.crypto.SecretKey translateKey(javax.crypto.SecretKey) throws java.security.InvalidKeyException;
- }
-
- public abstract class SecretKeyFactorySpi {
- ctor public SecretKeyFactorySpi();
- method protected abstract javax.crypto.SecretKey engineGenerateSecret(java.security.spec.KeySpec) throws java.security.spec.InvalidKeySpecException;
- method protected abstract java.security.spec.KeySpec engineGetKeySpec(javax.crypto.SecretKey, Class<?>) throws java.security.spec.InvalidKeySpecException;
- method protected abstract javax.crypto.SecretKey engineTranslateKey(javax.crypto.SecretKey) throws java.security.InvalidKeyException;
- }
-
- public class ShortBufferException extends java.security.GeneralSecurityException {
- ctor public ShortBufferException();
- ctor public ShortBufferException(String);
- }
-
-}
-
-package javax.crypto.interfaces {
-
- public interface DHKey {
- method public javax.crypto.spec.DHParameterSpec getParams();
- }
-
- public interface DHPrivateKey extends javax.crypto.interfaces.DHKey java.security.PrivateKey {
- method public java.math.BigInteger getX();
- field public static final long serialVersionUID = 2211791113380396553L; // 0x1eb1dc4c8e677e09L
- }
-
- public interface DHPublicKey extends javax.crypto.interfaces.DHKey java.security.PublicKey {
- method public java.math.BigInteger getY();
- field public static final long serialVersionUID = -6628103563352519193L; // 0xa4043eed23df4de7L
- }
-
- public interface PBEKey extends javax.crypto.SecretKey {
- method public int getIterationCount();
- method public char[] getPassword();
- method public byte[] getSalt();
- field public static final long serialVersionUID = -1430015993304333921L; // 0xec279007d7f7c19fL
- }
-
-}
-
-package javax.crypto.spec {
-
- public class DESKeySpec implements java.security.spec.KeySpec {
- ctor public DESKeySpec(byte[]) throws java.security.InvalidKeyException;
- ctor public DESKeySpec(byte[], int) throws java.security.InvalidKeyException;
- method public byte[] getKey();
- method public static boolean isParityAdjusted(byte[], int) throws java.security.InvalidKeyException;
- method public static boolean isWeak(byte[], int) throws java.security.InvalidKeyException;
- field public static final int DES_KEY_LEN = 8; // 0x8
- }
-
- public class DESedeKeySpec implements java.security.spec.KeySpec {
- ctor public DESedeKeySpec(byte[]) throws java.security.InvalidKeyException;
- ctor public DESedeKeySpec(byte[], int) throws java.security.InvalidKeyException;
- method public byte[] getKey();
- method public static boolean isParityAdjusted(byte[], int) throws java.security.InvalidKeyException;
- field public static final int DES_EDE_KEY_LEN = 24; // 0x18
- }
-
- public class DHGenParameterSpec implements java.security.spec.AlgorithmParameterSpec {
- ctor public DHGenParameterSpec(int, int);
- method public int getExponentSize();
- method public int getPrimeSize();
- }
-
- public class DHParameterSpec implements java.security.spec.AlgorithmParameterSpec {
- ctor public DHParameterSpec(java.math.BigInteger, java.math.BigInteger);
- ctor public DHParameterSpec(java.math.BigInteger, java.math.BigInteger, int);
- method public java.math.BigInteger getG();
- method public int getL();
- method public java.math.BigInteger getP();
- }
-
- public class DHPrivateKeySpec implements java.security.spec.KeySpec {
- ctor public DHPrivateKeySpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
- method public java.math.BigInteger getG();
- method public java.math.BigInteger getP();
- method public java.math.BigInteger getX();
- }
-
- public class DHPublicKeySpec implements java.security.spec.KeySpec {
- ctor public DHPublicKeySpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
- method public java.math.BigInteger getG();
- method public java.math.BigInteger getP();
- method public java.math.BigInteger getY();
- }
-
- public class GCMParameterSpec implements java.security.spec.AlgorithmParameterSpec {
- ctor public GCMParameterSpec(int, byte[]);
- ctor public GCMParameterSpec(int, byte[], int, int);
- method public byte[] getIV();
- method public int getTLen();
- }
-
- public class IvParameterSpec implements java.security.spec.AlgorithmParameterSpec {
- ctor public IvParameterSpec(byte[]);
- ctor public IvParameterSpec(byte[], int, int);
- method public byte[] getIV();
- }
-
- public class OAEPParameterSpec implements java.security.spec.AlgorithmParameterSpec {
- ctor public OAEPParameterSpec(String, String, java.security.spec.AlgorithmParameterSpec, javax.crypto.spec.PSource);
- method public String getDigestAlgorithm();
- method public String getMGFAlgorithm();
- method public java.security.spec.AlgorithmParameterSpec getMGFParameters();
- method public javax.crypto.spec.PSource getPSource();
- field public static final javax.crypto.spec.OAEPParameterSpec DEFAULT;
- }
-
- public class PBEKeySpec implements java.security.spec.KeySpec {
- ctor public PBEKeySpec(char[]);
- ctor public PBEKeySpec(char[], byte[], int, int);
- ctor public PBEKeySpec(char[], byte[], int);
- method public final void clearPassword();
- method public final int getIterationCount();
- method public final int getKeyLength();
- method public final char[] getPassword();
- method public final byte[] getSalt();
- }
-
- public class PBEParameterSpec implements java.security.spec.AlgorithmParameterSpec {
- ctor public PBEParameterSpec(byte[], int);
- ctor public PBEParameterSpec(byte[], int, java.security.spec.AlgorithmParameterSpec);
- method public int getIterationCount();
- method public java.security.spec.AlgorithmParameterSpec getParameterSpec();
- method public byte[] getSalt();
- }
-
- public class PSource {
- ctor protected PSource(String);
- method public String getAlgorithm();
- }
-
- public static final class PSource.PSpecified extends javax.crypto.spec.PSource {
- ctor public PSource.PSpecified(byte[]);
- method public byte[] getValue();
- field public static final javax.crypto.spec.PSource.PSpecified DEFAULT;
- }
-
- public class RC2ParameterSpec implements java.security.spec.AlgorithmParameterSpec {
- ctor public RC2ParameterSpec(int);
- ctor public RC2ParameterSpec(int, byte[]);
- ctor public RC2ParameterSpec(int, byte[], int);
- method public int getEffectiveKeyBits();
- method public byte[] getIV();
- }
-
- public class RC5ParameterSpec implements java.security.spec.AlgorithmParameterSpec {
- ctor public RC5ParameterSpec(int, int, int);
- ctor public RC5ParameterSpec(int, int, int, byte[]);
- ctor public RC5ParameterSpec(int, int, int, byte[], int);
- method public byte[] getIV();
- method public int getRounds();
- method public int getVersion();
- method public int getWordSize();
- }
-
- public class SecretKeySpec implements java.security.spec.KeySpec javax.crypto.SecretKey {
- ctor public SecretKeySpec(byte[], String);
- ctor public SecretKeySpec(byte[], int, int, String);
- method public String getAlgorithm();
- method public byte[] getEncoded();
- method public String getFormat();
- }
-
-}
-
package javax.microedition.khronos.egl {
public interface EGL {
@@ -73712,1527 +56086,6 @@
}
-package javax.net {
-
- public abstract class ServerSocketFactory {
- ctor protected ServerSocketFactory();
- method public java.net.ServerSocket createServerSocket() throws java.io.IOException;
- method public abstract java.net.ServerSocket createServerSocket(int) throws java.io.IOException;
- method public abstract java.net.ServerSocket createServerSocket(int, int) throws java.io.IOException;
- method public abstract java.net.ServerSocket createServerSocket(int, int, java.net.InetAddress) throws java.io.IOException;
- method public static javax.net.ServerSocketFactory getDefault();
- }
-
- public abstract class SocketFactory {
- ctor protected SocketFactory();
- method public java.net.Socket createSocket() throws java.io.IOException;
- method public abstract java.net.Socket createSocket(String, int) throws java.io.IOException, java.net.UnknownHostException;
- method public abstract java.net.Socket createSocket(String, int, java.net.InetAddress, int) throws java.io.IOException, java.net.UnknownHostException;
- method public abstract java.net.Socket createSocket(java.net.InetAddress, int) throws java.io.IOException;
- method public abstract java.net.Socket createSocket(java.net.InetAddress, int, java.net.InetAddress, int) throws java.io.IOException;
- method public static javax.net.SocketFactory getDefault();
- }
-
-}
-
-package javax.net.ssl {
-
- public class CertPathTrustManagerParameters implements javax.net.ssl.ManagerFactoryParameters {
- ctor public CertPathTrustManagerParameters(java.security.cert.CertPathParameters);
- method public java.security.cert.CertPathParameters getParameters();
- }
-
- public abstract class ExtendedSSLSession implements javax.net.ssl.SSLSession {
- ctor public ExtendedSSLSession();
- method public abstract String[] getLocalSupportedSignatureAlgorithms();
- method public abstract String[] getPeerSupportedSignatureAlgorithms();
- method public java.util.List<javax.net.ssl.SNIServerName> getRequestedServerNames();
- }
-
- public class HandshakeCompletedEvent extends java.util.EventObject {
- ctor public HandshakeCompletedEvent(javax.net.ssl.SSLSocket, javax.net.ssl.SSLSession);
- method public String getCipherSuite();
- method public java.security.cert.Certificate[] getLocalCertificates();
- method public java.security.Principal getLocalPrincipal();
- method public javax.security.cert.X509Certificate[] getPeerCertificateChain() throws javax.net.ssl.SSLPeerUnverifiedException;
- method public java.security.cert.Certificate[] getPeerCertificates() throws javax.net.ssl.SSLPeerUnverifiedException;
- method public java.security.Principal getPeerPrincipal() throws javax.net.ssl.SSLPeerUnverifiedException;
- method public javax.net.ssl.SSLSession getSession();
- method public javax.net.ssl.SSLSocket getSocket();
- }
-
- public interface HandshakeCompletedListener extends java.util.EventListener {
- method public void handshakeCompleted(javax.net.ssl.HandshakeCompletedEvent);
- }
-
- public interface HostnameVerifier {
- method public boolean verify(String, javax.net.ssl.SSLSession);
- }
-
- public abstract class HttpsURLConnection extends java.net.HttpURLConnection {
- ctor protected HttpsURLConnection(java.net.URL);
- method public abstract String getCipherSuite();
- method public static javax.net.ssl.HostnameVerifier getDefaultHostnameVerifier();
- method public static javax.net.ssl.SSLSocketFactory getDefaultSSLSocketFactory();
- method public javax.net.ssl.HostnameVerifier getHostnameVerifier();
- method public abstract java.security.cert.Certificate[] getLocalCertificates();
- method public java.security.Principal getLocalPrincipal();
- method public java.security.Principal getPeerPrincipal() throws javax.net.ssl.SSLPeerUnverifiedException;
- method public javax.net.ssl.SSLSocketFactory getSSLSocketFactory();
- method public abstract java.security.cert.Certificate[] getServerCertificates() throws javax.net.ssl.SSLPeerUnverifiedException;
- method public static void setDefaultHostnameVerifier(javax.net.ssl.HostnameVerifier);
- method public static void setDefaultSSLSocketFactory(javax.net.ssl.SSLSocketFactory);
- method public void setHostnameVerifier(javax.net.ssl.HostnameVerifier);
- method public void setSSLSocketFactory(javax.net.ssl.SSLSocketFactory);
- field protected javax.net.ssl.HostnameVerifier hostnameVerifier;
- }
-
- public interface KeyManager {
- }
-
- public class KeyManagerFactory {
- ctor protected KeyManagerFactory(javax.net.ssl.KeyManagerFactorySpi, java.security.Provider, String);
- method public final String getAlgorithm();
- method public static final String getDefaultAlgorithm();
- method public static final javax.net.ssl.KeyManagerFactory getInstance(String) throws java.security.NoSuchAlgorithmException;
- method public static final javax.net.ssl.KeyManagerFactory getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static final javax.net.ssl.KeyManagerFactory getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method public final javax.net.ssl.KeyManager[] getKeyManagers();
- method public final java.security.Provider getProvider();
- method public final void init(java.security.KeyStore, char[]) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
- method public final void init(javax.net.ssl.ManagerFactoryParameters) throws java.security.InvalidAlgorithmParameterException;
- }
-
- public abstract class KeyManagerFactorySpi {
- ctor public KeyManagerFactorySpi();
- method protected abstract javax.net.ssl.KeyManager[] engineGetKeyManagers();
- method protected abstract void engineInit(java.security.KeyStore, char[]) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException;
- method protected abstract void engineInit(javax.net.ssl.ManagerFactoryParameters) throws java.security.InvalidAlgorithmParameterException;
- }
-
- public class KeyStoreBuilderParameters implements javax.net.ssl.ManagerFactoryParameters {
- ctor public KeyStoreBuilderParameters(java.security.KeyStore.Builder);
- ctor public KeyStoreBuilderParameters(java.util.List<java.security.KeyStore.Builder>);
- method public java.util.List<java.security.KeyStore.Builder> getParameters();
- }
-
- public interface ManagerFactoryParameters {
- }
-
- public final class SNIHostName extends javax.net.ssl.SNIServerName {
- ctor public SNIHostName(String);
- ctor public SNIHostName(byte[]);
- method public static javax.net.ssl.SNIMatcher createSNIMatcher(String);
- method public String getAsciiName();
- }
-
- public abstract class SNIMatcher {
- ctor protected SNIMatcher(int);
- method public final int getType();
- method public abstract boolean matches(javax.net.ssl.SNIServerName);
- }
-
- public abstract class SNIServerName {
- ctor protected SNIServerName(int, byte[]);
- method public final byte[] getEncoded();
- method public final int getType();
- }
-
- public class SSLContext {
- ctor protected SSLContext(javax.net.ssl.SSLContextSpi, java.security.Provider, String);
- method public final javax.net.ssl.SSLEngine createSSLEngine();
- method public final javax.net.ssl.SSLEngine createSSLEngine(String, int);
- method public final javax.net.ssl.SSLSessionContext getClientSessionContext();
- method public static javax.net.ssl.SSLContext getDefault() throws java.security.NoSuchAlgorithmException;
- method public final javax.net.ssl.SSLParameters getDefaultSSLParameters();
- method public static javax.net.ssl.SSLContext getInstance(String) throws java.security.NoSuchAlgorithmException;
- method public static javax.net.ssl.SSLContext getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static javax.net.ssl.SSLContext getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method public final String getProtocol();
- method public final java.security.Provider getProvider();
- method public final javax.net.ssl.SSLSessionContext getServerSessionContext();
- method public final javax.net.ssl.SSLServerSocketFactory getServerSocketFactory();
- method public final javax.net.ssl.SSLSocketFactory getSocketFactory();
- method public final javax.net.ssl.SSLParameters getSupportedSSLParameters();
- method public final void init(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], java.security.SecureRandom) throws java.security.KeyManagementException;
- method public static void setDefault(javax.net.ssl.SSLContext);
- }
-
- public abstract class SSLContextSpi {
- ctor public SSLContextSpi();
- method protected abstract javax.net.ssl.SSLEngine engineCreateSSLEngine();
- method protected abstract javax.net.ssl.SSLEngine engineCreateSSLEngine(String, int);
- method protected abstract javax.net.ssl.SSLSessionContext engineGetClientSessionContext();
- method protected javax.net.ssl.SSLParameters engineGetDefaultSSLParameters();
- method protected abstract javax.net.ssl.SSLSessionContext engineGetServerSessionContext();
- method protected abstract javax.net.ssl.SSLServerSocketFactory engineGetServerSocketFactory();
- method protected abstract javax.net.ssl.SSLSocketFactory engineGetSocketFactory();
- method protected javax.net.ssl.SSLParameters engineGetSupportedSSLParameters();
- method protected abstract void engineInit(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], java.security.SecureRandom) throws java.security.KeyManagementException;
- }
-
- public abstract class SSLEngine {
- ctor protected SSLEngine();
- ctor protected SSLEngine(String, int);
- method public abstract void beginHandshake() throws javax.net.ssl.SSLException;
- method public abstract void closeInbound() throws javax.net.ssl.SSLException;
- method public abstract void closeOutbound();
- method public String getApplicationProtocol();
- method public abstract Runnable getDelegatedTask();
- method public abstract boolean getEnableSessionCreation();
- method public abstract String[] getEnabledCipherSuites();
- method public abstract String[] getEnabledProtocols();
- method public String getHandshakeApplicationProtocol();
- method public java.util.function.BiFunction<javax.net.ssl.SSLEngine,java.util.List<java.lang.String>,java.lang.String> getHandshakeApplicationProtocolSelector();
- method public javax.net.ssl.SSLSession getHandshakeSession();
- method public abstract javax.net.ssl.SSLEngineResult.HandshakeStatus getHandshakeStatus();
- method public abstract boolean getNeedClientAuth();
- method public String getPeerHost();
- method public int getPeerPort();
- method public javax.net.ssl.SSLParameters getSSLParameters();
- method public abstract javax.net.ssl.SSLSession getSession();
- method public abstract String[] getSupportedCipherSuites();
- method public abstract String[] getSupportedProtocols();
- method public abstract boolean getUseClientMode();
- method public abstract boolean getWantClientAuth();
- method public abstract boolean isInboundDone();
- method public abstract boolean isOutboundDone();
- method public abstract void setEnableSessionCreation(boolean);
- method public abstract void setEnabledCipherSuites(String[]);
- method public abstract void setEnabledProtocols(String[]);
- method public void setHandshakeApplicationProtocolSelector(java.util.function.BiFunction<javax.net.ssl.SSLEngine,java.util.List<java.lang.String>,java.lang.String>);
- method public abstract void setNeedClientAuth(boolean);
- method public void setSSLParameters(javax.net.ssl.SSLParameters);
- method public abstract void setUseClientMode(boolean);
- method public abstract void setWantClientAuth(boolean);
- method public javax.net.ssl.SSLEngineResult unwrap(java.nio.ByteBuffer, java.nio.ByteBuffer) throws javax.net.ssl.SSLException;
- method public javax.net.ssl.SSLEngineResult unwrap(java.nio.ByteBuffer, java.nio.ByteBuffer[]) throws javax.net.ssl.SSLException;
- method public abstract javax.net.ssl.SSLEngineResult unwrap(java.nio.ByteBuffer, java.nio.ByteBuffer[], int, int) throws javax.net.ssl.SSLException;
- method public javax.net.ssl.SSLEngineResult wrap(java.nio.ByteBuffer, java.nio.ByteBuffer) throws javax.net.ssl.SSLException;
- method public javax.net.ssl.SSLEngineResult wrap(java.nio.ByteBuffer[], java.nio.ByteBuffer) throws javax.net.ssl.SSLException;
- method public abstract javax.net.ssl.SSLEngineResult wrap(java.nio.ByteBuffer[], int, int, java.nio.ByteBuffer) throws javax.net.ssl.SSLException;
- }
-
- public class SSLEngineResult {
- ctor public SSLEngineResult(javax.net.ssl.SSLEngineResult.Status, javax.net.ssl.SSLEngineResult.HandshakeStatus, int, int);
- method public final int bytesConsumed();
- method public final int bytesProduced();
- method public final javax.net.ssl.SSLEngineResult.HandshakeStatus getHandshakeStatus();
- method public final javax.net.ssl.SSLEngineResult.Status getStatus();
- }
-
- public enum SSLEngineResult.HandshakeStatus {
- enum_constant public static final javax.net.ssl.SSLEngineResult.HandshakeStatus FINISHED;
- enum_constant public static final javax.net.ssl.SSLEngineResult.HandshakeStatus NEED_TASK;
- enum_constant public static final javax.net.ssl.SSLEngineResult.HandshakeStatus NEED_UNWRAP;
- enum_constant public static final javax.net.ssl.SSLEngineResult.HandshakeStatus NEED_WRAP;
- enum_constant public static final javax.net.ssl.SSLEngineResult.HandshakeStatus NOT_HANDSHAKING;
- }
-
- public enum SSLEngineResult.Status {
- enum_constant public static final javax.net.ssl.SSLEngineResult.Status BUFFER_OVERFLOW;
- enum_constant public static final javax.net.ssl.SSLEngineResult.Status BUFFER_UNDERFLOW;
- enum_constant public static final javax.net.ssl.SSLEngineResult.Status CLOSED;
- enum_constant public static final javax.net.ssl.SSLEngineResult.Status OK;
- }
-
- public class SSLException extends java.io.IOException {
- ctor public SSLException(String);
- ctor public SSLException(String, Throwable);
- ctor public SSLException(Throwable);
- }
-
- public class SSLHandshakeException extends javax.net.ssl.SSLException {
- ctor public SSLHandshakeException(String);
- }
-
- public class SSLKeyException extends javax.net.ssl.SSLException {
- ctor public SSLKeyException(String);
- }
-
- public class SSLParameters {
- ctor public SSLParameters();
- ctor public SSLParameters(String[]);
- ctor public SSLParameters(String[], String[]);
- method public java.security.AlgorithmConstraints getAlgorithmConstraints();
- method public String[] getApplicationProtocols();
- method public String[] getCipherSuites();
- method public String getEndpointIdentificationAlgorithm();
- method public boolean getNeedClientAuth();
- method public String[] getProtocols();
- method public final java.util.Collection<javax.net.ssl.SNIMatcher> getSNIMatchers();
- method public final java.util.List<javax.net.ssl.SNIServerName> getServerNames();
- method public final boolean getUseCipherSuitesOrder();
- method public boolean getWantClientAuth();
- method public void setAlgorithmConstraints(java.security.AlgorithmConstraints);
- method public void setApplicationProtocols(String[]);
- method public void setCipherSuites(String[]);
- method public void setEndpointIdentificationAlgorithm(String);
- method public void setNeedClientAuth(boolean);
- method public void setProtocols(String[]);
- method public final void setSNIMatchers(java.util.Collection<javax.net.ssl.SNIMatcher>);
- method public final void setServerNames(java.util.List<javax.net.ssl.SNIServerName>);
- method public final void setUseCipherSuitesOrder(boolean);
- method public void setWantClientAuth(boolean);
- }
-
- public class SSLPeerUnverifiedException extends javax.net.ssl.SSLException {
- ctor public SSLPeerUnverifiedException(String);
- }
-
- public final class SSLPermission extends java.security.BasicPermission {
- ctor public SSLPermission(String);
- ctor public SSLPermission(String, String);
- }
-
- public class SSLProtocolException extends javax.net.ssl.SSLException {
- ctor public SSLProtocolException(String);
- }
-
- public abstract class SSLServerSocket extends java.net.ServerSocket {
- ctor protected SSLServerSocket() throws java.io.IOException;
- ctor protected SSLServerSocket(int) throws java.io.IOException;
- ctor protected SSLServerSocket(int, int) throws java.io.IOException;
- ctor protected SSLServerSocket(int, int, java.net.InetAddress) throws java.io.IOException;
- method public abstract boolean getEnableSessionCreation();
- method public abstract String[] getEnabledCipherSuites();
- method public abstract String[] getEnabledProtocols();
- method public abstract boolean getNeedClientAuth();
- method public javax.net.ssl.SSLParameters getSSLParameters();
- method public abstract String[] getSupportedCipherSuites();
- method public abstract String[] getSupportedProtocols();
- method public abstract boolean getUseClientMode();
- method public abstract boolean getWantClientAuth();
- method public abstract void setEnableSessionCreation(boolean);
- method public abstract void setEnabledCipherSuites(String[]);
- method public abstract void setEnabledProtocols(String[]);
- method public abstract void setNeedClientAuth(boolean);
- method public void setSSLParameters(javax.net.ssl.SSLParameters);
- method public abstract void setUseClientMode(boolean);
- method public abstract void setWantClientAuth(boolean);
- }
-
- public abstract class SSLServerSocketFactory extends javax.net.ServerSocketFactory {
- ctor protected SSLServerSocketFactory();
- method public static javax.net.ServerSocketFactory getDefault();
- method public abstract String[] getDefaultCipherSuites();
- method public abstract String[] getSupportedCipherSuites();
- }
-
- public interface SSLSession {
- method public int getApplicationBufferSize();
- method public String getCipherSuite();
- method public long getCreationTime();
- method public byte[] getId();
- method public long getLastAccessedTime();
- method public java.security.cert.Certificate[] getLocalCertificates();
- method public java.security.Principal getLocalPrincipal();
- method public int getPacketBufferSize();
- method public javax.security.cert.X509Certificate[] getPeerCertificateChain() throws javax.net.ssl.SSLPeerUnverifiedException;
- method public java.security.cert.Certificate[] getPeerCertificates() throws javax.net.ssl.SSLPeerUnverifiedException;
- method public String getPeerHost();
- method public int getPeerPort();
- method public java.security.Principal getPeerPrincipal() throws javax.net.ssl.SSLPeerUnverifiedException;
- method public String getProtocol();
- method public javax.net.ssl.SSLSessionContext getSessionContext();
- method public Object getValue(String);
- method public String[] getValueNames();
- method public void invalidate();
- method public boolean isValid();
- method public void putValue(String, Object);
- method public void removeValue(String);
- }
-
- public class SSLSessionBindingEvent extends java.util.EventObject {
- ctor public SSLSessionBindingEvent(javax.net.ssl.SSLSession, String);
- method public String getName();
- method public javax.net.ssl.SSLSession getSession();
- }
-
- public interface SSLSessionBindingListener extends java.util.EventListener {
- method public void valueBound(javax.net.ssl.SSLSessionBindingEvent);
- method public void valueUnbound(javax.net.ssl.SSLSessionBindingEvent);
- }
-
- public interface SSLSessionContext {
- method public java.util.Enumeration<byte[]> getIds();
- method public javax.net.ssl.SSLSession getSession(byte[]);
- method public int getSessionCacheSize();
- method public int getSessionTimeout();
- method public void setSessionCacheSize(int) throws java.lang.IllegalArgumentException;
- method public void setSessionTimeout(int) throws java.lang.IllegalArgumentException;
- }
-
- public abstract class SSLSocket extends java.net.Socket {
- ctor protected SSLSocket();
- ctor protected SSLSocket(String, int) throws java.io.IOException, java.net.UnknownHostException;
- ctor protected SSLSocket(java.net.InetAddress, int) throws java.io.IOException;
- ctor protected SSLSocket(String, int, java.net.InetAddress, int) throws java.io.IOException, java.net.UnknownHostException;
- ctor protected SSLSocket(java.net.InetAddress, int, java.net.InetAddress, int) throws java.io.IOException;
- method public abstract void addHandshakeCompletedListener(javax.net.ssl.HandshakeCompletedListener);
- method public String getApplicationProtocol();
- method public abstract boolean getEnableSessionCreation();
- method public abstract String[] getEnabledCipherSuites();
- method public abstract String[] getEnabledProtocols();
- method public String getHandshakeApplicationProtocol();
- method public java.util.function.BiFunction<javax.net.ssl.SSLSocket,java.util.List<java.lang.String>,java.lang.String> getHandshakeApplicationProtocolSelector();
- method public javax.net.ssl.SSLSession getHandshakeSession();
- method public abstract boolean getNeedClientAuth();
- method public javax.net.ssl.SSLParameters getSSLParameters();
- method public abstract javax.net.ssl.SSLSession getSession();
- method public abstract String[] getSupportedCipherSuites();
- method public abstract String[] getSupportedProtocols();
- method public abstract boolean getUseClientMode();
- method public abstract boolean getWantClientAuth();
- method public abstract void removeHandshakeCompletedListener(javax.net.ssl.HandshakeCompletedListener);
- method public abstract void setEnableSessionCreation(boolean);
- method public abstract void setEnabledCipherSuites(String[]);
- method public abstract void setEnabledProtocols(String[]);
- method public void setHandshakeApplicationProtocolSelector(java.util.function.BiFunction<javax.net.ssl.SSLSocket,java.util.List<java.lang.String>,java.lang.String>);
- method public abstract void setNeedClientAuth(boolean);
- method public void setSSLParameters(javax.net.ssl.SSLParameters);
- method public abstract void setUseClientMode(boolean);
- method public abstract void setWantClientAuth(boolean);
- method public abstract void startHandshake() throws java.io.IOException;
- }
-
- public abstract class SSLSocketFactory extends javax.net.SocketFactory {
- ctor public SSLSocketFactory();
- method public abstract java.net.Socket createSocket(java.net.Socket, String, int, boolean) throws java.io.IOException;
- method public static javax.net.SocketFactory getDefault();
- method public abstract String[] getDefaultCipherSuites();
- method public abstract String[] getSupportedCipherSuites();
- }
-
- public final class StandardConstants {
- field public static final int SNI_HOST_NAME = 0; // 0x0
- }
-
- public interface TrustManager {
- }
-
- public class TrustManagerFactory {
- ctor protected TrustManagerFactory(javax.net.ssl.TrustManagerFactorySpi, java.security.Provider, String);
- method public final String getAlgorithm();
- method public static final String getDefaultAlgorithm();
- method public static final javax.net.ssl.TrustManagerFactory getInstance(String) throws java.security.NoSuchAlgorithmException;
- method public static final javax.net.ssl.TrustManagerFactory getInstance(String, String) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException;
- method public static final javax.net.ssl.TrustManagerFactory getInstance(String, java.security.Provider) throws java.security.NoSuchAlgorithmException;
- method public final java.security.Provider getProvider();
- method public final javax.net.ssl.TrustManager[] getTrustManagers();
- method public final void init(java.security.KeyStore) throws java.security.KeyStoreException;
- method public final void init(javax.net.ssl.ManagerFactoryParameters) throws java.security.InvalidAlgorithmParameterException;
- }
-
- public abstract class TrustManagerFactorySpi {
- ctor public TrustManagerFactorySpi();
- method protected abstract javax.net.ssl.TrustManager[] engineGetTrustManagers();
- method protected abstract void engineInit(java.security.KeyStore) throws java.security.KeyStoreException;
- method protected abstract void engineInit(javax.net.ssl.ManagerFactoryParameters) throws java.security.InvalidAlgorithmParameterException;
- }
-
- public abstract class X509ExtendedKeyManager implements javax.net.ssl.X509KeyManager {
- ctor protected X509ExtendedKeyManager();
- method public String chooseEngineClientAlias(String[], java.security.Principal[], javax.net.ssl.SSLEngine);
- method public String chooseEngineServerAlias(String, java.security.Principal[], javax.net.ssl.SSLEngine);
- }
-
- public abstract class X509ExtendedTrustManager implements javax.net.ssl.X509TrustManager {
- ctor public X509ExtendedTrustManager();
- method public abstract void checkClientTrusted(java.security.cert.X509Certificate[], String, java.net.Socket) throws java.security.cert.CertificateException;
- method public abstract void checkClientTrusted(java.security.cert.X509Certificate[], String, javax.net.ssl.SSLEngine) throws java.security.cert.CertificateException;
- method public abstract void checkServerTrusted(java.security.cert.X509Certificate[], String, java.net.Socket) throws java.security.cert.CertificateException;
- method public abstract void checkServerTrusted(java.security.cert.X509Certificate[], String, javax.net.ssl.SSLEngine) throws java.security.cert.CertificateException;
- }
-
- public interface X509KeyManager extends javax.net.ssl.KeyManager {
- method public String chooseClientAlias(String[], java.security.Principal[], java.net.Socket);
- method public String chooseServerAlias(String, java.security.Principal[], java.net.Socket);
- method public java.security.cert.X509Certificate[] getCertificateChain(String);
- method public String[] getClientAliases(String, java.security.Principal[]);
- method public java.security.PrivateKey getPrivateKey(String);
- method public String[] getServerAliases(String, java.security.Principal[]);
- }
-
- public interface X509TrustManager extends javax.net.ssl.TrustManager {
- method public void checkClientTrusted(java.security.cert.X509Certificate[], String) throws java.security.cert.CertificateException;
- method public void checkServerTrusted(java.security.cert.X509Certificate[], String) throws java.security.cert.CertificateException;
- method public java.security.cert.X509Certificate[] getAcceptedIssuers();
- }
-
-}
-
-package javax.security.auth {
-
- public final class AuthPermission extends java.security.BasicPermission {
- ctor public AuthPermission(String);
- ctor public AuthPermission(String, String);
- }
-
- public class DestroyFailedException extends java.lang.Exception {
- ctor public DestroyFailedException();
- ctor public DestroyFailedException(String);
- }
-
- public interface Destroyable {
- method public default void destroy() throws javax.security.auth.DestroyFailedException;
- method public default boolean isDestroyed();
- }
-
- public final class PrivateCredentialPermission extends java.security.Permission {
- ctor public PrivateCredentialPermission(String, String);
- method public String getActions();
- method public String getCredentialClass();
- method public String[][] getPrincipals();
- method public boolean implies(java.security.Permission);
- }
-
- public final class Subject implements java.io.Serializable {
- ctor public Subject();
- ctor public Subject(boolean, java.util.Set<? extends java.security.Principal>, java.util.Set<?>, java.util.Set<?>);
- method public static <T> T doAs(javax.security.auth.Subject, java.security.PrivilegedAction<T>);
- method public static <T> T doAs(javax.security.auth.Subject, java.security.PrivilegedExceptionAction<T>) throws java.security.PrivilegedActionException;
- method public static <T> T doAsPrivileged(javax.security.auth.Subject, java.security.PrivilegedAction<T>, java.security.AccessControlContext);
- method public static <T> T doAsPrivileged(javax.security.auth.Subject, java.security.PrivilegedExceptionAction<T>, java.security.AccessControlContext) throws java.security.PrivilegedActionException;
- method public java.util.Set<java.security.Principal> getPrincipals();
- method public <T extends java.security.Principal> java.util.Set<T> getPrincipals(Class<T>);
- method public java.util.Set<java.lang.Object> getPrivateCredentials();
- method public <T> java.util.Set<T> getPrivateCredentials(Class<T>);
- method public java.util.Set<java.lang.Object> getPublicCredentials();
- method public <T> java.util.Set<T> getPublicCredentials(Class<T>);
- method public static javax.security.auth.Subject getSubject(java.security.AccessControlContext);
- method public boolean isReadOnly();
- method public void setReadOnly();
- }
-
- public class SubjectDomainCombiner implements java.security.DomainCombiner {
- ctor public SubjectDomainCombiner(javax.security.auth.Subject);
- method public java.security.ProtectionDomain[] combine(java.security.ProtectionDomain[], java.security.ProtectionDomain[]);
- method public javax.security.auth.Subject getSubject();
- }
-
-}
-
-package javax.security.auth.callback {
-
- public interface Callback {
- }
-
- public interface CallbackHandler {
- method public void handle(javax.security.auth.callback.Callback[]) throws java.io.IOException, javax.security.auth.callback.UnsupportedCallbackException;
- }
-
- public class PasswordCallback implements javax.security.auth.callback.Callback java.io.Serializable {
- ctor public PasswordCallback(String, boolean);
- method public void clearPassword();
- method public char[] getPassword();
- method public String getPrompt();
- method public boolean isEchoOn();
- method public void setPassword(char[]);
- }
-
- public class UnsupportedCallbackException extends java.lang.Exception {
- ctor public UnsupportedCallbackException(javax.security.auth.callback.Callback);
- ctor public UnsupportedCallbackException(javax.security.auth.callback.Callback, String);
- method public javax.security.auth.callback.Callback getCallback();
- }
-
-}
-
-package javax.security.auth.login {
-
- public class LoginException extends java.security.GeneralSecurityException {
- ctor public LoginException();
- ctor public LoginException(String);
- }
-
-}
-
-package javax.security.auth.x500 {
-
- public final class X500Principal implements java.security.Principal java.io.Serializable {
- ctor public X500Principal(String);
- ctor public X500Principal(String, java.util.Map<java.lang.String,java.lang.String>);
- ctor public X500Principal(byte[]);
- ctor public X500Principal(java.io.InputStream);
- method public byte[] getEncoded();
- method public String getName();
- method public String getName(String);
- method public String getName(String, java.util.Map<java.lang.String,java.lang.String>);
- field public static final String CANONICAL = "CANONICAL";
- field public static final String RFC1779 = "RFC1779";
- field public static final String RFC2253 = "RFC2253";
- }
-
-}
-
-package javax.security.cert {
-
- public abstract class Certificate {
- ctor public Certificate();
- method public abstract byte[] getEncoded() throws javax.security.cert.CertificateEncodingException;
- method public abstract java.security.PublicKey getPublicKey();
- method public abstract String toString();
- method public abstract void verify(java.security.PublicKey) throws javax.security.cert.CertificateException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException;
- method public abstract void verify(java.security.PublicKey, String) throws javax.security.cert.CertificateException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException;
- }
-
- public class CertificateEncodingException extends javax.security.cert.CertificateException {
- ctor public CertificateEncodingException();
- ctor public CertificateEncodingException(String);
- }
-
- public class CertificateException extends java.lang.Exception {
- ctor public CertificateException();
- ctor public CertificateException(String);
- }
-
- public class CertificateExpiredException extends javax.security.cert.CertificateException {
- ctor public CertificateExpiredException();
- ctor public CertificateExpiredException(String);
- }
-
- public class CertificateNotYetValidException extends javax.security.cert.CertificateException {
- ctor public CertificateNotYetValidException();
- ctor public CertificateNotYetValidException(String);
- }
-
- public class CertificateParsingException extends javax.security.cert.CertificateException {
- ctor public CertificateParsingException();
- ctor public CertificateParsingException(String);
- }
-
- public abstract class X509Certificate extends javax.security.cert.Certificate {
- ctor public X509Certificate();
- method public abstract void checkValidity() throws javax.security.cert.CertificateExpiredException, javax.security.cert.CertificateNotYetValidException;
- method public abstract void checkValidity(java.util.Date) throws javax.security.cert.CertificateExpiredException, javax.security.cert.CertificateNotYetValidException;
- method public static final javax.security.cert.X509Certificate getInstance(java.io.InputStream) throws javax.security.cert.CertificateException;
- method public static final javax.security.cert.X509Certificate getInstance(byte[]) throws javax.security.cert.CertificateException;
- method public abstract java.security.Principal getIssuerDN();
- method public abstract java.util.Date getNotAfter();
- method public abstract java.util.Date getNotBefore();
- method public abstract java.math.BigInteger getSerialNumber();
- method public abstract String getSigAlgName();
- method public abstract String getSigAlgOID();
- method public abstract byte[] getSigAlgParams();
- method public abstract java.security.Principal getSubjectDN();
- method public abstract int getVersion();
- }
-
-}
-
-package javax.sql {
-
- public interface CommonDataSource {
- method public java.io.PrintWriter getLogWriter() throws java.sql.SQLException;
- method public int getLoginTimeout() throws java.sql.SQLException;
- method public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException;
- method public void setLogWriter(java.io.PrintWriter) throws java.sql.SQLException;
- method public void setLoginTimeout(int) throws java.sql.SQLException;
- }
-
- public class ConnectionEvent extends java.util.EventObject {
- ctor public ConnectionEvent(javax.sql.PooledConnection);
- ctor public ConnectionEvent(javax.sql.PooledConnection, java.sql.SQLException);
- method public java.sql.SQLException getSQLException();
- }
-
- public interface ConnectionEventListener extends java.util.EventListener {
- method public void connectionClosed(javax.sql.ConnectionEvent);
- method public void connectionErrorOccurred(javax.sql.ConnectionEvent);
- }
-
- public interface ConnectionPoolDataSource extends javax.sql.CommonDataSource {
- method public javax.sql.PooledConnection getPooledConnection() throws java.sql.SQLException;
- method public javax.sql.PooledConnection getPooledConnection(String, String) throws java.sql.SQLException;
- }
-
- public interface DataSource extends javax.sql.CommonDataSource java.sql.Wrapper {
- method public java.sql.Connection getConnection() throws java.sql.SQLException;
- method public java.sql.Connection getConnection(String, String) throws java.sql.SQLException;
- }
-
- public interface PooledConnection {
- method public void addConnectionEventListener(javax.sql.ConnectionEventListener);
- method public void addStatementEventListener(javax.sql.StatementEventListener);
- method public void close() throws java.sql.SQLException;
- method public java.sql.Connection getConnection() throws java.sql.SQLException;
- method public void removeConnectionEventListener(javax.sql.ConnectionEventListener);
- method public void removeStatementEventListener(javax.sql.StatementEventListener);
- }
-
- public interface RowSet extends java.sql.ResultSet {
- method public void addRowSetListener(javax.sql.RowSetListener);
- method public void clearParameters() throws java.sql.SQLException;
- method public void execute() throws java.sql.SQLException;
- method public String getCommand();
- method public String getDataSourceName();
- method public boolean getEscapeProcessing() throws java.sql.SQLException;
- method public int getMaxFieldSize() throws java.sql.SQLException;
- method public int getMaxRows() throws java.sql.SQLException;
- method public String getPassword();
- method public int getQueryTimeout() throws java.sql.SQLException;
- method public int getTransactionIsolation();
- method public java.util.Map<java.lang.String,java.lang.Class<?>> getTypeMap() throws java.sql.SQLException;
- method public String getUrl() throws java.sql.SQLException;
- method public String getUsername();
- method public boolean isReadOnly();
- method public void removeRowSetListener(javax.sql.RowSetListener);
- method public void setArray(int, java.sql.Array) throws java.sql.SQLException;
- method public void setAsciiStream(int, java.io.InputStream, int) throws java.sql.SQLException;
- method public void setAsciiStream(String, java.io.InputStream, int) throws java.sql.SQLException;
- method public void setAsciiStream(int, java.io.InputStream) throws java.sql.SQLException;
- method public void setAsciiStream(String, java.io.InputStream) throws java.sql.SQLException;
- method public void setBigDecimal(int, java.math.BigDecimal) throws java.sql.SQLException;
- method public void setBigDecimal(String, java.math.BigDecimal) throws java.sql.SQLException;
- method public void setBinaryStream(int, java.io.InputStream, int) throws java.sql.SQLException;
- method public void setBinaryStream(String, java.io.InputStream, int) throws java.sql.SQLException;
- method public void setBinaryStream(int, java.io.InputStream) throws java.sql.SQLException;
- method public void setBinaryStream(String, java.io.InputStream) throws java.sql.SQLException;
- method public void setBlob(int, java.sql.Blob) throws java.sql.SQLException;
- method public void setBlob(int, java.io.InputStream, long) throws java.sql.SQLException;
- method public void setBlob(int, java.io.InputStream) throws java.sql.SQLException;
- method public void setBlob(String, java.io.InputStream, long) throws java.sql.SQLException;
- method public void setBlob(String, java.sql.Blob) throws java.sql.SQLException;
- method public void setBlob(String, java.io.InputStream) throws java.sql.SQLException;
- method public void setBoolean(int, boolean) throws java.sql.SQLException;
- method public void setBoolean(String, boolean) throws java.sql.SQLException;
- method public void setByte(int, byte) throws java.sql.SQLException;
- method public void setByte(String, byte) throws java.sql.SQLException;
- method public void setBytes(int, byte[]) throws java.sql.SQLException;
- method public void setBytes(String, byte[]) throws java.sql.SQLException;
- method public void setCharacterStream(int, java.io.Reader, int) throws java.sql.SQLException;
- method public void setCharacterStream(String, java.io.Reader, int) throws java.sql.SQLException;
- method public void setCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
- method public void setCharacterStream(String, java.io.Reader) throws java.sql.SQLException;
- method public void setClob(int, java.sql.Clob) throws java.sql.SQLException;
- method public void setClob(int, java.io.Reader, long) throws java.sql.SQLException;
- method public void setClob(int, java.io.Reader) throws java.sql.SQLException;
- method public void setClob(String, java.io.Reader, long) throws java.sql.SQLException;
- method public void setClob(String, java.sql.Clob) throws java.sql.SQLException;
- method public void setClob(String, java.io.Reader) throws java.sql.SQLException;
- method public void setCommand(String) throws java.sql.SQLException;
- method public void setConcurrency(int) throws java.sql.SQLException;
- method public void setDataSourceName(String) throws java.sql.SQLException;
- method public void setDate(int, java.sql.Date) throws java.sql.SQLException;
- method public void setDate(int, java.sql.Date, java.util.Calendar) throws java.sql.SQLException;
- method public void setDate(String, java.sql.Date) throws java.sql.SQLException;
- method public void setDate(String, java.sql.Date, java.util.Calendar) throws java.sql.SQLException;
- method public void setDouble(int, double) throws java.sql.SQLException;
- method public void setDouble(String, double) throws java.sql.SQLException;
- method public void setEscapeProcessing(boolean) throws java.sql.SQLException;
- method public void setFloat(int, float) throws java.sql.SQLException;
- method public void setFloat(String, float) throws java.sql.SQLException;
- method public void setInt(int, int) throws java.sql.SQLException;
- method public void setInt(String, int) throws java.sql.SQLException;
- method public void setLong(int, long) throws java.sql.SQLException;
- method public void setLong(String, long) throws java.sql.SQLException;
- method public void setMaxFieldSize(int) throws java.sql.SQLException;
- method public void setMaxRows(int) throws java.sql.SQLException;
- method public void setNCharacterStream(int, java.io.Reader) throws java.sql.SQLException;
- method public void setNCharacterStream(int, java.io.Reader, long) throws java.sql.SQLException;
- method public void setNCharacterStream(String, java.io.Reader, long) throws java.sql.SQLException;
- method public void setNCharacterStream(String, java.io.Reader) throws java.sql.SQLException;
- method public void setNClob(String, java.sql.NClob) throws java.sql.SQLException;
- method public void setNClob(String, java.io.Reader, long) throws java.sql.SQLException;
- method public void setNClob(String, java.io.Reader) throws java.sql.SQLException;
- method public void setNClob(int, java.io.Reader, long) throws java.sql.SQLException;
- method public void setNClob(int, java.sql.NClob) throws java.sql.SQLException;
- method public void setNClob(int, java.io.Reader) throws java.sql.SQLException;
- method public void setNString(int, String) throws java.sql.SQLException;
- method public void setNString(String, String) throws java.sql.SQLException;
- method public void setNull(int, int) throws java.sql.SQLException;
- method public void setNull(String, int) throws java.sql.SQLException;
- method public void setNull(int, int, String) throws java.sql.SQLException;
- method public void setNull(String, int, String) throws java.sql.SQLException;
- method public void setObject(int, Object, int, int) throws java.sql.SQLException;
- method public void setObject(String, Object, int, int) throws java.sql.SQLException;
- method public void setObject(int, Object, int) throws java.sql.SQLException;
- method public void setObject(String, Object, int) throws java.sql.SQLException;
- method public void setObject(String, Object) throws java.sql.SQLException;
- method public void setObject(int, Object) throws java.sql.SQLException;
- method public void setPassword(String) throws java.sql.SQLException;
- method public void setQueryTimeout(int) throws java.sql.SQLException;
- method public void setReadOnly(boolean) throws java.sql.SQLException;
- method public void setRef(int, java.sql.Ref) throws java.sql.SQLException;
- method public void setRowId(int, java.sql.RowId) throws java.sql.SQLException;
- method public void setRowId(String, java.sql.RowId) throws java.sql.SQLException;
- method public void setSQLXML(int, java.sql.SQLXML) throws java.sql.SQLException;
- method public void setSQLXML(String, java.sql.SQLXML) throws java.sql.SQLException;
- method public void setShort(int, short) throws java.sql.SQLException;
- method public void setShort(String, short) throws java.sql.SQLException;
- method public void setString(int, String) throws java.sql.SQLException;
- method public void setString(String, String) throws java.sql.SQLException;
- method public void setTime(int, java.sql.Time) throws java.sql.SQLException;
- method public void setTime(int, java.sql.Time, java.util.Calendar) throws java.sql.SQLException;
- method public void setTime(String, java.sql.Time) throws java.sql.SQLException;
- method public void setTime(String, java.sql.Time, java.util.Calendar) throws java.sql.SQLException;
- method public void setTimestamp(int, java.sql.Timestamp) throws java.sql.SQLException;
- method public void setTimestamp(String, java.sql.Timestamp) throws java.sql.SQLException;
- method public void setTimestamp(int, java.sql.Timestamp, java.util.Calendar) throws java.sql.SQLException;
- method public void setTimestamp(String, java.sql.Timestamp, java.util.Calendar) throws java.sql.SQLException;
- method public void setTransactionIsolation(int) throws java.sql.SQLException;
- method public void setType(int) throws java.sql.SQLException;
- method public void setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>>) throws java.sql.SQLException;
- method public void setURL(int, java.net.URL) throws java.sql.SQLException;
- method public void setUrl(String) throws java.sql.SQLException;
- method public void setUsername(String) throws java.sql.SQLException;
- }
-
- public class RowSetEvent extends java.util.EventObject {
- ctor public RowSetEvent(javax.sql.RowSet);
- }
-
- public interface RowSetInternal {
- method public java.sql.Connection getConnection() throws java.sql.SQLException;
- method public java.sql.ResultSet getOriginal() throws java.sql.SQLException;
- method public java.sql.ResultSet getOriginalRow() throws java.sql.SQLException;
- method public Object[] getParams() throws java.sql.SQLException;
- method public void setMetaData(javax.sql.RowSetMetaData) throws java.sql.SQLException;
- }
-
- public interface RowSetListener extends java.util.EventListener {
- method public void cursorMoved(javax.sql.RowSetEvent);
- method public void rowChanged(javax.sql.RowSetEvent);
- method public void rowSetChanged(javax.sql.RowSetEvent);
- }
-
- public interface RowSetMetaData extends java.sql.ResultSetMetaData {
- method public void setAutoIncrement(int, boolean) throws java.sql.SQLException;
- method public void setCaseSensitive(int, boolean) throws java.sql.SQLException;
- method public void setCatalogName(int, String) throws java.sql.SQLException;
- method public void setColumnCount(int) throws java.sql.SQLException;
- method public void setColumnDisplaySize(int, int) throws java.sql.SQLException;
- method public void setColumnLabel(int, String) throws java.sql.SQLException;
- method public void setColumnName(int, String) throws java.sql.SQLException;
- method public void setColumnType(int, int) throws java.sql.SQLException;
- method public void setColumnTypeName(int, String) throws java.sql.SQLException;
- method public void setCurrency(int, boolean) throws java.sql.SQLException;
- method public void setNullable(int, int) throws java.sql.SQLException;
- method public void setPrecision(int, int) throws java.sql.SQLException;
- method public void setScale(int, int) throws java.sql.SQLException;
- method public void setSchemaName(int, String) throws java.sql.SQLException;
- method public void setSearchable(int, boolean) throws java.sql.SQLException;
- method public void setSigned(int, boolean) throws java.sql.SQLException;
- method public void setTableName(int, String) throws java.sql.SQLException;
- }
-
- public interface RowSetReader {
- method public void readData(javax.sql.RowSetInternal) throws java.sql.SQLException;
- }
-
- public interface RowSetWriter {
- method public boolean writeData(javax.sql.RowSetInternal) throws java.sql.SQLException;
- }
-
- public class StatementEvent extends java.util.EventObject {
- ctor public StatementEvent(javax.sql.PooledConnection, java.sql.PreparedStatement);
- ctor public StatementEvent(javax.sql.PooledConnection, java.sql.PreparedStatement, java.sql.SQLException);
- method public java.sql.SQLException getSQLException();
- method public java.sql.PreparedStatement getStatement();
- }
-
- public interface StatementEventListener extends java.util.EventListener {
- method public void statementClosed(javax.sql.StatementEvent);
- method public void statementErrorOccurred(javax.sql.StatementEvent);
- }
-
-}
-
-package javax.xml {
-
- public final class XMLConstants {
- field public static final String DEFAULT_NS_PREFIX = "";
- field public static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing";
- field public static final String NULL_NS_URI = "";
- field public static final String RELAXNG_NS_URI = "http://relaxng.org/ns/structure/1.0";
- field public static final String W3C_XML_SCHEMA_INSTANCE_NS_URI = "http://www.w3.org/2001/XMLSchema-instance";
- field public static final String W3C_XML_SCHEMA_NS_URI = "http://www.w3.org/2001/XMLSchema";
- field public static final String W3C_XPATH_DATATYPE_NS_URI = "http://www.w3.org/2003/11/xpath-datatypes";
- field public static final String XMLNS_ATTRIBUTE = "xmlns";
- field public static final String XMLNS_ATTRIBUTE_NS_URI = "http://www.w3.org/2000/xmlns/";
- field public static final String XML_DTD_NS_URI = "http://www.w3.org/TR/REC-xml";
- field public static final String XML_NS_PREFIX = "xml";
- field public static final String XML_NS_URI = "http://www.w3.org/XML/1998/namespace";
- }
-
-}
-
-package javax.xml.datatype {
-
- public class DatatypeConfigurationException extends java.lang.Exception {
- ctor public DatatypeConfigurationException();
- ctor public DatatypeConfigurationException(String);
- ctor public DatatypeConfigurationException(String, Throwable);
- ctor public DatatypeConfigurationException(Throwable);
- }
-
- public final class DatatypeConstants {
- field public static final int APRIL = 4; // 0x4
- field public static final int AUGUST = 8; // 0x8
- field public static final javax.xml.namespace.QName DATE;
- field public static final javax.xml.namespace.QName DATETIME;
- field public static final javax.xml.datatype.DatatypeConstants.Field DAYS;
- field public static final int DECEMBER = 12; // 0xc
- field public static final javax.xml.namespace.QName DURATION;
- field public static final javax.xml.namespace.QName DURATION_DAYTIME;
- field public static final javax.xml.namespace.QName DURATION_YEARMONTH;
- field public static final int EQUAL = 0; // 0x0
- field public static final int FEBRUARY = 2; // 0x2
- field public static final int FIELD_UNDEFINED = -2147483648; // 0x80000000
- field public static final javax.xml.namespace.QName GDAY;
- field public static final javax.xml.namespace.QName GMONTH;
- field public static final javax.xml.namespace.QName GMONTHDAY;
- field public static final int GREATER = 1; // 0x1
- field public static final javax.xml.namespace.QName GYEAR;
- field public static final javax.xml.namespace.QName GYEARMONTH;
- field public static final javax.xml.datatype.DatatypeConstants.Field HOURS;
- field public static final int INDETERMINATE = 2; // 0x2
- field public static final int JANUARY = 1; // 0x1
- field public static final int JULY = 7; // 0x7
- field public static final int JUNE = 6; // 0x6
- field public static final int LESSER = -1; // 0xffffffff
- field public static final int MARCH = 3; // 0x3
- field public static final int MAX_TIMEZONE_OFFSET = -840; // 0xfffffcb8
- field public static final int MAY = 5; // 0x5
- field public static final javax.xml.datatype.DatatypeConstants.Field MINUTES;
- field public static final int MIN_TIMEZONE_OFFSET = 840; // 0x348
- field public static final javax.xml.datatype.DatatypeConstants.Field MONTHS;
- field public static final int NOVEMBER = 11; // 0xb
- field public static final int OCTOBER = 10; // 0xa
- field public static final javax.xml.datatype.DatatypeConstants.Field SECONDS;
- field public static final int SEPTEMBER = 9; // 0x9
- field public static final javax.xml.namespace.QName TIME;
- field public static final javax.xml.datatype.DatatypeConstants.Field YEARS;
- }
-
- public static final class DatatypeConstants.Field {
- method public int getId();
- }
-
- public abstract class DatatypeFactory {
- ctor protected DatatypeFactory();
- method public abstract javax.xml.datatype.Duration newDuration(String);
- method public abstract javax.xml.datatype.Duration newDuration(long);
- method public abstract javax.xml.datatype.Duration newDuration(boolean, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigDecimal);
- method public javax.xml.datatype.Duration newDuration(boolean, int, int, int, int, int, int);
- method public javax.xml.datatype.Duration newDurationDayTime(String);
- method public javax.xml.datatype.Duration newDurationDayTime(long);
- method public javax.xml.datatype.Duration newDurationDayTime(boolean, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger);
- method public javax.xml.datatype.Duration newDurationDayTime(boolean, int, int, int, int);
- method public javax.xml.datatype.Duration newDurationYearMonth(String);
- method public javax.xml.datatype.Duration newDurationYearMonth(long);
- method public javax.xml.datatype.Duration newDurationYearMonth(boolean, java.math.BigInteger, java.math.BigInteger);
- method public javax.xml.datatype.Duration newDurationYearMonth(boolean, int, int);
- method public static javax.xml.datatype.DatatypeFactory newInstance() throws javax.xml.datatype.DatatypeConfigurationException;
- method public static javax.xml.datatype.DatatypeFactory newInstance(String, ClassLoader) throws javax.xml.datatype.DatatypeConfigurationException;
- method public abstract javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar();
- method public abstract javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar(String);
- method public abstract javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar(java.util.GregorianCalendar);
- method public abstract javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar(java.math.BigInteger, int, int, int, int, int, java.math.BigDecimal, int);
- method public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar(int, int, int, int, int, int, int, int);
- method public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendarDate(int, int, int, int);
- method public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendarTime(int, int, int, int);
- method public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendarTime(int, int, int, java.math.BigDecimal, int);
- method public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendarTime(int, int, int, int, int);
- field public static final String DATATYPEFACTORY_IMPLEMENTATION_CLASS;
- field public static final String DATATYPEFACTORY_PROPERTY = "javax.xml.datatype.DatatypeFactory";
- }
-
- public abstract class Duration {
- ctor public Duration();
- method public abstract javax.xml.datatype.Duration add(javax.xml.datatype.Duration);
- method public abstract void addTo(java.util.Calendar);
- method public void addTo(java.util.Date);
- method public abstract int compare(javax.xml.datatype.Duration);
- method public int getDays();
- method public abstract Number getField(javax.xml.datatype.DatatypeConstants.Field);
- method public int getHours();
- method public int getMinutes();
- method public int getMonths();
- method public int getSeconds();
- method public abstract int getSign();
- method public long getTimeInMillis(java.util.Calendar);
- method public long getTimeInMillis(java.util.Date);
- method public javax.xml.namespace.QName getXMLSchemaType();
- method public int getYears();
- method public abstract int hashCode();
- method public boolean isLongerThan(javax.xml.datatype.Duration);
- method public abstract boolean isSet(javax.xml.datatype.DatatypeConstants.Field);
- method public boolean isShorterThan(javax.xml.datatype.Duration);
- method public javax.xml.datatype.Duration multiply(int);
- method public abstract javax.xml.datatype.Duration multiply(java.math.BigDecimal);
- method public abstract javax.xml.datatype.Duration negate();
- method public abstract javax.xml.datatype.Duration normalizeWith(java.util.Calendar);
- method public javax.xml.datatype.Duration subtract(javax.xml.datatype.Duration);
- }
-
- public abstract class XMLGregorianCalendar implements java.lang.Cloneable {
- ctor public XMLGregorianCalendar();
- method public abstract void add(javax.xml.datatype.Duration);
- method public abstract void clear();
- method public abstract Object clone();
- method public abstract int compare(javax.xml.datatype.XMLGregorianCalendar);
- method public abstract int getDay();
- method public abstract java.math.BigInteger getEon();
- method public abstract java.math.BigInteger getEonAndYear();
- method public abstract java.math.BigDecimal getFractionalSecond();
- method public abstract int getHour();
- method public int getMillisecond();
- method public abstract int getMinute();
- method public abstract int getMonth();
- method public abstract int getSecond();
- method public abstract java.util.TimeZone getTimeZone(int);
- method public abstract int getTimezone();
- method public abstract javax.xml.namespace.QName getXMLSchemaType();
- method public abstract int getYear();
- method public abstract boolean isValid();
- method public abstract javax.xml.datatype.XMLGregorianCalendar normalize();
- method public abstract void reset();
- method public abstract void setDay(int);
- method public abstract void setFractionalSecond(java.math.BigDecimal);
- method public abstract void setHour(int);
- method public abstract void setMillisecond(int);
- method public abstract void setMinute(int);
- method public abstract void setMonth(int);
- method public abstract void setSecond(int);
- method public void setTime(int, int, int);
- method public void setTime(int, int, int, java.math.BigDecimal);
- method public void setTime(int, int, int, int);
- method public abstract void setTimezone(int);
- method public abstract void setYear(java.math.BigInteger);
- method public abstract void setYear(int);
- method public abstract java.util.GregorianCalendar toGregorianCalendar();
- method public abstract java.util.GregorianCalendar toGregorianCalendar(java.util.TimeZone, java.util.Locale, javax.xml.datatype.XMLGregorianCalendar);
- method public abstract String toXMLFormat();
- }
-
-}
-
-package javax.xml.namespace {
-
- public interface NamespaceContext {
- method public String getNamespaceURI(String);
- method public String getPrefix(String);
- method public java.util.Iterator getPrefixes(String);
- }
-
- public class QName implements java.io.Serializable {
- ctor public QName(String, String);
- ctor public QName(String, String, String);
- ctor public QName(String);
- method public final boolean equals(Object);
- method public String getLocalPart();
- method public String getNamespaceURI();
- method public String getPrefix();
- method public final int hashCode();
- method public static javax.xml.namespace.QName valueOf(String);
- }
-
-}
-
-package javax.xml.parsers {
-
- public abstract class DocumentBuilder {
- ctor protected DocumentBuilder();
- method public abstract org.w3c.dom.DOMImplementation getDOMImplementation();
- method public javax.xml.validation.Schema getSchema();
- method public abstract boolean isNamespaceAware();
- method public abstract boolean isValidating();
- method public boolean isXIncludeAware();
- method public abstract org.w3c.dom.Document newDocument();
- method public org.w3c.dom.Document parse(java.io.InputStream) throws java.io.IOException, org.xml.sax.SAXException;
- method public org.w3c.dom.Document parse(java.io.InputStream, String) throws java.io.IOException, org.xml.sax.SAXException;
- method public org.w3c.dom.Document parse(String) throws java.io.IOException, org.xml.sax.SAXException;
- method public org.w3c.dom.Document parse(java.io.File) throws java.io.IOException, org.xml.sax.SAXException;
- method public abstract org.w3c.dom.Document parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
- method public void reset();
- method public abstract void setEntityResolver(org.xml.sax.EntityResolver);
- method public abstract void setErrorHandler(org.xml.sax.ErrorHandler);
- }
-
- public abstract class DocumentBuilderFactory {
- ctor protected DocumentBuilderFactory();
- method public abstract Object getAttribute(String) throws java.lang.IllegalArgumentException;
- method public abstract boolean getFeature(String) throws javax.xml.parsers.ParserConfigurationException;
- method public javax.xml.validation.Schema getSchema();
- method public boolean isCoalescing();
- method public boolean isExpandEntityReferences();
- method public boolean isIgnoringComments();
- method public boolean isIgnoringElementContentWhitespace();
- method public boolean isNamespaceAware();
- method public boolean isValidating();
- method public boolean isXIncludeAware();
- method public abstract javax.xml.parsers.DocumentBuilder newDocumentBuilder() throws javax.xml.parsers.ParserConfigurationException;
- method public static javax.xml.parsers.DocumentBuilderFactory newInstance();
- method public static javax.xml.parsers.DocumentBuilderFactory newInstance(String, ClassLoader);
- method public abstract void setAttribute(String, Object) throws java.lang.IllegalArgumentException;
- method public void setCoalescing(boolean);
- method public void setExpandEntityReferences(boolean);
- method public abstract void setFeature(String, boolean) throws javax.xml.parsers.ParserConfigurationException;
- method public void setIgnoringComments(boolean);
- method public void setIgnoringElementContentWhitespace(boolean);
- method public void setNamespaceAware(boolean);
- method public void setSchema(javax.xml.validation.Schema);
- method public void setValidating(boolean);
- method public void setXIncludeAware(boolean);
- }
-
- public class FactoryConfigurationError extends java.lang.Error {
- ctor public FactoryConfigurationError();
- ctor public FactoryConfigurationError(String);
- ctor public FactoryConfigurationError(Exception);
- ctor public FactoryConfigurationError(Exception, String);
- method public Exception getException();
- }
-
- public class ParserConfigurationException extends java.lang.Exception {
- ctor public ParserConfigurationException();
- ctor public ParserConfigurationException(String);
- }
-
- public abstract class SAXParser {
- ctor protected SAXParser();
- method public abstract org.xml.sax.Parser getParser() throws org.xml.sax.SAXException;
- method public abstract Object getProperty(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public javax.xml.validation.Schema getSchema();
- method public abstract org.xml.sax.XMLReader getXMLReader() throws org.xml.sax.SAXException;
- method public abstract boolean isNamespaceAware();
- method public abstract boolean isValidating();
- method public boolean isXIncludeAware();
- method public void parse(java.io.InputStream, org.xml.sax.HandlerBase) throws java.io.IOException, org.xml.sax.SAXException;
- method public void parse(java.io.InputStream, org.xml.sax.HandlerBase, String) throws java.io.IOException, org.xml.sax.SAXException;
- method public void parse(java.io.InputStream, org.xml.sax.helpers.DefaultHandler) throws java.io.IOException, org.xml.sax.SAXException;
- method public void parse(java.io.InputStream, org.xml.sax.helpers.DefaultHandler, String) throws java.io.IOException, org.xml.sax.SAXException;
- method public void parse(String, org.xml.sax.HandlerBase) throws java.io.IOException, org.xml.sax.SAXException;
- method public void parse(String, org.xml.sax.helpers.DefaultHandler) throws java.io.IOException, org.xml.sax.SAXException;
- method public void parse(java.io.File, org.xml.sax.HandlerBase) throws java.io.IOException, org.xml.sax.SAXException;
- method public void parse(java.io.File, org.xml.sax.helpers.DefaultHandler) throws java.io.IOException, org.xml.sax.SAXException;
- method public void parse(org.xml.sax.InputSource, org.xml.sax.HandlerBase) throws java.io.IOException, org.xml.sax.SAXException;
- method public void parse(org.xml.sax.InputSource, org.xml.sax.helpers.DefaultHandler) throws java.io.IOException, org.xml.sax.SAXException;
- method public void reset();
- method public abstract void setProperty(String, Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- }
-
- public abstract class SAXParserFactory {
- ctor protected SAXParserFactory();
- method public abstract boolean getFeature(String) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public javax.xml.validation.Schema getSchema();
- method public boolean isNamespaceAware();
- method public boolean isValidating();
- method public boolean isXIncludeAware();
- method public static javax.xml.parsers.SAXParserFactory newInstance();
- method public static javax.xml.parsers.SAXParserFactory newInstance(String, ClassLoader);
- method public abstract javax.xml.parsers.SAXParser newSAXParser() throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException;
- method public abstract void setFeature(String, boolean) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public void setNamespaceAware(boolean);
- method public void setSchema(javax.xml.validation.Schema);
- method public void setValidating(boolean);
- method public void setXIncludeAware(boolean);
- }
-
-}
-
-package javax.xml.transform {
-
- public interface ErrorListener {
- method public void error(javax.xml.transform.TransformerException) throws javax.xml.transform.TransformerException;
- method public void fatalError(javax.xml.transform.TransformerException) throws javax.xml.transform.TransformerException;
- method public void warning(javax.xml.transform.TransformerException) throws javax.xml.transform.TransformerException;
- }
-
- public class OutputKeys {
- field public static final String CDATA_SECTION_ELEMENTS = "cdata-section-elements";
- field public static final String DOCTYPE_PUBLIC = "doctype-public";
- field public static final String DOCTYPE_SYSTEM = "doctype-system";
- field public static final String ENCODING = "encoding";
- field public static final String INDENT = "indent";
- field public static final String MEDIA_TYPE = "media-type";
- field public static final String METHOD = "method";
- field public static final String OMIT_XML_DECLARATION = "omit-xml-declaration";
- field public static final String STANDALONE = "standalone";
- field public static final String VERSION = "version";
- }
-
- public interface Result {
- method public String getSystemId();
- method public void setSystemId(String);
- field public static final String PI_DISABLE_OUTPUT_ESCAPING = "javax.xml.transform.disable-output-escaping";
- field public static final String PI_ENABLE_OUTPUT_ESCAPING = "javax.xml.transform.enable-output-escaping";
- }
-
- public interface Source {
- method public String getSystemId();
- method public void setSystemId(String);
- }
-
- public interface SourceLocator {
- method public int getColumnNumber();
- method public int getLineNumber();
- method public String getPublicId();
- method public String getSystemId();
- }
-
- public interface Templates {
- method public java.util.Properties getOutputProperties();
- method public javax.xml.transform.Transformer newTransformer() throws javax.xml.transform.TransformerConfigurationException;
- }
-
- public abstract class Transformer {
- ctor protected Transformer();
- method public abstract void clearParameters();
- method public abstract javax.xml.transform.ErrorListener getErrorListener();
- method public abstract java.util.Properties getOutputProperties();
- method public abstract String getOutputProperty(String) throws java.lang.IllegalArgumentException;
- method public abstract Object getParameter(String);
- method public abstract javax.xml.transform.URIResolver getURIResolver();
- method public void reset();
- method public abstract void setErrorListener(javax.xml.transform.ErrorListener) throws java.lang.IllegalArgumentException;
- method public abstract void setOutputProperties(java.util.Properties);
- method public abstract void setOutputProperty(String, String) throws java.lang.IllegalArgumentException;
- method public abstract void setParameter(String, Object);
- method public abstract void setURIResolver(javax.xml.transform.URIResolver);
- method public abstract void transform(javax.xml.transform.Source, javax.xml.transform.Result) throws javax.xml.transform.TransformerException;
- }
-
- public class TransformerConfigurationException extends javax.xml.transform.TransformerException {
- ctor public TransformerConfigurationException();
- ctor public TransformerConfigurationException(String);
- ctor public TransformerConfigurationException(Throwable);
- ctor public TransformerConfigurationException(String, Throwable);
- ctor public TransformerConfigurationException(String, javax.xml.transform.SourceLocator);
- ctor public TransformerConfigurationException(String, javax.xml.transform.SourceLocator, Throwable);
- }
-
- public class TransformerException extends java.lang.Exception {
- ctor public TransformerException(String);
- ctor public TransformerException(Throwable);
- ctor public TransformerException(String, Throwable);
- ctor public TransformerException(String, javax.xml.transform.SourceLocator);
- ctor public TransformerException(String, javax.xml.transform.SourceLocator, Throwable);
- method public Throwable getException();
- method public String getLocationAsString();
- method public javax.xml.transform.SourceLocator getLocator();
- method public String getMessageAndLocation();
- method public void setLocator(javax.xml.transform.SourceLocator);
- }
-
- public abstract class TransformerFactory {
- ctor protected TransformerFactory();
- method public abstract javax.xml.transform.Source getAssociatedStylesheet(javax.xml.transform.Source, String, String, String) throws javax.xml.transform.TransformerConfigurationException;
- method public abstract Object getAttribute(String);
- method public abstract javax.xml.transform.ErrorListener getErrorListener();
- method public abstract boolean getFeature(String);
- method public abstract javax.xml.transform.URIResolver getURIResolver();
- method public static javax.xml.transform.TransformerFactory newInstance() throws javax.xml.transform.TransformerFactoryConfigurationError;
- method public static javax.xml.transform.TransformerFactory newInstance(String, ClassLoader) throws javax.xml.transform.TransformerFactoryConfigurationError;
- method public abstract javax.xml.transform.Templates newTemplates(javax.xml.transform.Source) throws javax.xml.transform.TransformerConfigurationException;
- method public abstract javax.xml.transform.Transformer newTransformer(javax.xml.transform.Source) throws javax.xml.transform.TransformerConfigurationException;
- method public abstract javax.xml.transform.Transformer newTransformer() throws javax.xml.transform.TransformerConfigurationException;
- method public abstract void setAttribute(String, Object);
- method public abstract void setErrorListener(javax.xml.transform.ErrorListener);
- method public abstract void setFeature(String, boolean) throws javax.xml.transform.TransformerConfigurationException;
- method public abstract void setURIResolver(javax.xml.transform.URIResolver);
- }
-
- public class TransformerFactoryConfigurationError extends java.lang.Error {
- ctor public TransformerFactoryConfigurationError();
- ctor public TransformerFactoryConfigurationError(String);
- ctor public TransformerFactoryConfigurationError(Exception);
- ctor public TransformerFactoryConfigurationError(Exception, String);
- method public Exception getException();
- }
-
- public interface URIResolver {
- method public javax.xml.transform.Source resolve(String, String) throws javax.xml.transform.TransformerException;
- }
-
-}
-
-package javax.xml.transform.dom {
-
- public interface DOMLocator extends javax.xml.transform.SourceLocator {
- method public org.w3c.dom.Node getOriginatingNode();
- }
-
- public class DOMResult implements javax.xml.transform.Result {
- ctor public DOMResult();
- ctor public DOMResult(org.w3c.dom.Node);
- ctor public DOMResult(org.w3c.dom.Node, String);
- ctor public DOMResult(org.w3c.dom.Node, org.w3c.dom.Node);
- ctor public DOMResult(org.w3c.dom.Node, org.w3c.dom.Node, String);
- method public org.w3c.dom.Node getNextSibling();
- method public org.w3c.dom.Node getNode();
- method public String getSystemId();
- method public void setNextSibling(org.w3c.dom.Node);
- method public void setNode(org.w3c.dom.Node);
- method public void setSystemId(String);
- field public static final String FEATURE = "http://javax.xml.transform.dom.DOMResult/feature";
- }
-
- public class DOMSource implements javax.xml.transform.Source {
- ctor public DOMSource();
- ctor public DOMSource(org.w3c.dom.Node);
- ctor public DOMSource(org.w3c.dom.Node, String);
- method public org.w3c.dom.Node getNode();
- method public String getSystemId();
- method public void setNode(org.w3c.dom.Node);
- method public void setSystemId(String);
- field public static final String FEATURE = "http://javax.xml.transform.dom.DOMSource/feature";
- }
-
-}
-
-package javax.xml.transform.sax {
-
- public class SAXResult implements javax.xml.transform.Result {
- ctor public SAXResult();
- ctor public SAXResult(org.xml.sax.ContentHandler);
- method public org.xml.sax.ContentHandler getHandler();
- method public org.xml.sax.ext.LexicalHandler getLexicalHandler();
- method public String getSystemId();
- method public void setHandler(org.xml.sax.ContentHandler);
- method public void setLexicalHandler(org.xml.sax.ext.LexicalHandler);
- method public void setSystemId(String);
- field public static final String FEATURE = "http://javax.xml.transform.sax.SAXResult/feature";
- }
-
- public class SAXSource implements javax.xml.transform.Source {
- ctor public SAXSource();
- ctor public SAXSource(org.xml.sax.XMLReader, org.xml.sax.InputSource);
- ctor public SAXSource(org.xml.sax.InputSource);
- method public org.xml.sax.InputSource getInputSource();
- method public String getSystemId();
- method public org.xml.sax.XMLReader getXMLReader();
- method public void setInputSource(org.xml.sax.InputSource);
- method public void setSystemId(String);
- method public void setXMLReader(org.xml.sax.XMLReader);
- method public static org.xml.sax.InputSource sourceToInputSource(javax.xml.transform.Source);
- field public static final String FEATURE = "http://javax.xml.transform.sax.SAXSource/feature";
- }
-
- public abstract class SAXTransformerFactory extends javax.xml.transform.TransformerFactory {
- ctor protected SAXTransformerFactory();
- method public abstract javax.xml.transform.sax.TemplatesHandler newTemplatesHandler() throws javax.xml.transform.TransformerConfigurationException;
- method public abstract javax.xml.transform.sax.TransformerHandler newTransformerHandler(javax.xml.transform.Source) throws javax.xml.transform.TransformerConfigurationException;
- method public abstract javax.xml.transform.sax.TransformerHandler newTransformerHandler(javax.xml.transform.Templates) throws javax.xml.transform.TransformerConfigurationException;
- method public abstract javax.xml.transform.sax.TransformerHandler newTransformerHandler() throws javax.xml.transform.TransformerConfigurationException;
- method public abstract org.xml.sax.XMLFilter newXMLFilter(javax.xml.transform.Source) throws javax.xml.transform.TransformerConfigurationException;
- method public abstract org.xml.sax.XMLFilter newXMLFilter(javax.xml.transform.Templates) throws javax.xml.transform.TransformerConfigurationException;
- field public static final String FEATURE = "http://javax.xml.transform.sax.SAXTransformerFactory/feature";
- field public static final String FEATURE_XMLFILTER = "http://javax.xml.transform.sax.SAXTransformerFactory/feature/xmlfilter";
- }
-
- public interface TemplatesHandler extends org.xml.sax.ContentHandler {
- method public String getSystemId();
- method public javax.xml.transform.Templates getTemplates();
- method public void setSystemId(String);
- }
-
- public interface TransformerHandler extends org.xml.sax.ContentHandler org.xml.sax.DTDHandler org.xml.sax.ext.LexicalHandler {
- method public String getSystemId();
- method public javax.xml.transform.Transformer getTransformer();
- method public void setResult(javax.xml.transform.Result) throws java.lang.IllegalArgumentException;
- method public void setSystemId(String);
- }
-
-}
-
-package javax.xml.transform.stream {
-
- public class StreamResult implements javax.xml.transform.Result {
- ctor public StreamResult();
- ctor public StreamResult(java.io.OutputStream);
- ctor public StreamResult(java.io.Writer);
- ctor public StreamResult(String);
- ctor public StreamResult(java.io.File);
- method public java.io.OutputStream getOutputStream();
- method public String getSystemId();
- method public java.io.Writer getWriter();
- method public void setOutputStream(java.io.OutputStream);
- method public void setSystemId(String);
- method public void setSystemId(java.io.File);
- method public void setWriter(java.io.Writer);
- field public static final String FEATURE = "http://javax.xml.transform.stream.StreamResult/feature";
- }
-
- public class StreamSource implements javax.xml.transform.Source {
- ctor public StreamSource();
- ctor public StreamSource(java.io.InputStream);
- ctor public StreamSource(java.io.InputStream, String);
- ctor public StreamSource(java.io.Reader);
- ctor public StreamSource(java.io.Reader, String);
- ctor public StreamSource(String);
- ctor public StreamSource(java.io.File);
- method public java.io.InputStream getInputStream();
- method public String getPublicId();
- method public java.io.Reader getReader();
- method public String getSystemId();
- method public void setInputStream(java.io.InputStream);
- method public void setPublicId(String);
- method public void setReader(java.io.Reader);
- method public void setSystemId(String);
- method public void setSystemId(java.io.File);
- field public static final String FEATURE = "http://javax.xml.transform.stream.StreamSource/feature";
- }
-
-}
-
-package javax.xml.validation {
-
- public abstract class Schema {
- ctor protected Schema();
- method public abstract javax.xml.validation.Validator newValidator();
- method public abstract javax.xml.validation.ValidatorHandler newValidatorHandler();
- }
-
- public abstract class SchemaFactory {
- ctor protected SchemaFactory();
- method public abstract org.xml.sax.ErrorHandler getErrorHandler();
- method public boolean getFeature(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public Object getProperty(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public abstract org.w3c.dom.ls.LSResourceResolver getResourceResolver();
- method public abstract boolean isSchemaLanguageSupported(String);
- method public static javax.xml.validation.SchemaFactory newInstance(String);
- method public static javax.xml.validation.SchemaFactory newInstance(String, String, ClassLoader);
- method public javax.xml.validation.Schema newSchema(javax.xml.transform.Source) throws org.xml.sax.SAXException;
- method public javax.xml.validation.Schema newSchema(java.io.File) throws org.xml.sax.SAXException;
- method public javax.xml.validation.Schema newSchema(java.net.URL) throws org.xml.sax.SAXException;
- method public abstract javax.xml.validation.Schema newSchema(javax.xml.transform.Source[]) throws org.xml.sax.SAXException;
- method public abstract javax.xml.validation.Schema newSchema() throws org.xml.sax.SAXException;
- method public abstract void setErrorHandler(org.xml.sax.ErrorHandler);
- method public void setFeature(String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public void setProperty(String, Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public abstract void setResourceResolver(org.w3c.dom.ls.LSResourceResolver);
- }
-
- public abstract class SchemaFactoryLoader {
- ctor protected SchemaFactoryLoader();
- method public abstract javax.xml.validation.SchemaFactory newFactory(String);
- }
-
- public abstract class TypeInfoProvider {
- ctor protected TypeInfoProvider();
- method public abstract org.w3c.dom.TypeInfo getAttributeTypeInfo(int);
- method public abstract org.w3c.dom.TypeInfo getElementTypeInfo();
- method public abstract boolean isIdAttribute(int);
- method public abstract boolean isSpecified(int);
- }
-
- public abstract class Validator {
- ctor protected Validator();
- method public abstract org.xml.sax.ErrorHandler getErrorHandler();
- method public boolean getFeature(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public Object getProperty(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public abstract org.w3c.dom.ls.LSResourceResolver getResourceResolver();
- method public abstract void reset();
- method public abstract void setErrorHandler(org.xml.sax.ErrorHandler);
- method public void setFeature(String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public void setProperty(String, Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public abstract void setResourceResolver(org.w3c.dom.ls.LSResourceResolver);
- method public void validate(javax.xml.transform.Source) throws java.io.IOException, org.xml.sax.SAXException;
- method public abstract void validate(javax.xml.transform.Source, javax.xml.transform.Result) throws java.io.IOException, org.xml.sax.SAXException;
- }
-
- public abstract class ValidatorHandler implements org.xml.sax.ContentHandler {
- ctor protected ValidatorHandler();
- method public abstract org.xml.sax.ContentHandler getContentHandler();
- method public abstract org.xml.sax.ErrorHandler getErrorHandler();
- method public boolean getFeature(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public Object getProperty(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public abstract org.w3c.dom.ls.LSResourceResolver getResourceResolver();
- method public abstract javax.xml.validation.TypeInfoProvider getTypeInfoProvider();
- method public abstract void setContentHandler(org.xml.sax.ContentHandler);
- method public abstract void setErrorHandler(org.xml.sax.ErrorHandler);
- method public void setFeature(String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public void setProperty(String, Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public abstract void setResourceResolver(org.w3c.dom.ls.LSResourceResolver);
- }
-
-}
-
-package javax.xml.xpath {
-
- public interface XPath {
- method public javax.xml.xpath.XPathExpression compile(String) throws javax.xml.xpath.XPathExpressionException;
- method public Object evaluate(String, Object, javax.xml.namespace.QName) throws javax.xml.xpath.XPathExpressionException;
- method public String evaluate(String, Object) throws javax.xml.xpath.XPathExpressionException;
- method public Object evaluate(String, org.xml.sax.InputSource, javax.xml.namespace.QName) throws javax.xml.xpath.XPathExpressionException;
- method public String evaluate(String, org.xml.sax.InputSource) throws javax.xml.xpath.XPathExpressionException;
- method public javax.xml.namespace.NamespaceContext getNamespaceContext();
- method public javax.xml.xpath.XPathFunctionResolver getXPathFunctionResolver();
- method public javax.xml.xpath.XPathVariableResolver getXPathVariableResolver();
- method public void reset();
- method public void setNamespaceContext(javax.xml.namespace.NamespaceContext);
- method public void setXPathFunctionResolver(javax.xml.xpath.XPathFunctionResolver);
- method public void setXPathVariableResolver(javax.xml.xpath.XPathVariableResolver);
- }
-
- public class XPathConstants {
- field public static final javax.xml.namespace.QName BOOLEAN;
- field public static final String DOM_OBJECT_MODEL = "http://java.sun.com/jaxp/xpath/dom";
- field public static final javax.xml.namespace.QName NODE;
- field public static final javax.xml.namespace.QName NODESET;
- field public static final javax.xml.namespace.QName NUMBER;
- field public static final javax.xml.namespace.QName STRING;
- }
-
- public class XPathException extends java.lang.Exception {
- ctor public XPathException(String);
- ctor public XPathException(Throwable);
- }
-
- public interface XPathExpression {
- method public Object evaluate(Object, javax.xml.namespace.QName) throws javax.xml.xpath.XPathExpressionException;
- method public String evaluate(Object) throws javax.xml.xpath.XPathExpressionException;
- method public Object evaluate(org.xml.sax.InputSource, javax.xml.namespace.QName) throws javax.xml.xpath.XPathExpressionException;
- method public String evaluate(org.xml.sax.InputSource) throws javax.xml.xpath.XPathExpressionException;
- }
-
- public class XPathExpressionException extends javax.xml.xpath.XPathException {
- ctor public XPathExpressionException(String);
- ctor public XPathExpressionException(Throwable);
- }
-
- public abstract class XPathFactory {
- ctor protected XPathFactory();
- method public abstract boolean getFeature(String) throws javax.xml.xpath.XPathFactoryConfigurationException;
- method public abstract boolean isObjectModelSupported(String);
- method public static final javax.xml.xpath.XPathFactory newInstance();
- method public static final javax.xml.xpath.XPathFactory newInstance(String) throws javax.xml.xpath.XPathFactoryConfigurationException;
- method public static javax.xml.xpath.XPathFactory newInstance(String, String, ClassLoader) throws javax.xml.xpath.XPathFactoryConfigurationException;
- method public abstract javax.xml.xpath.XPath newXPath();
- method public abstract void setFeature(String, boolean) throws javax.xml.xpath.XPathFactoryConfigurationException;
- method public abstract void setXPathFunctionResolver(javax.xml.xpath.XPathFunctionResolver);
- method public abstract void setXPathVariableResolver(javax.xml.xpath.XPathVariableResolver);
- field public static final String DEFAULT_OBJECT_MODEL_URI = "http://java.sun.com/jaxp/xpath/dom";
- field public static final String DEFAULT_PROPERTY_NAME = "javax.xml.xpath.XPathFactory";
- }
-
- public class XPathFactoryConfigurationException extends javax.xml.xpath.XPathException {
- ctor public XPathFactoryConfigurationException(String);
- ctor public XPathFactoryConfigurationException(Throwable);
- }
-
- public interface XPathFunction {
- method public Object evaluate(java.util.List) throws javax.xml.xpath.XPathFunctionException;
- }
-
- public class XPathFunctionException extends javax.xml.xpath.XPathExpressionException {
- ctor public XPathFunctionException(String);
- ctor public XPathFunctionException(Throwable);
- }
-
- public interface XPathFunctionResolver {
- method public javax.xml.xpath.XPathFunction resolveFunction(javax.xml.namespace.QName, int);
- }
-
- public interface XPathVariableResolver {
- method public Object resolveVariable(javax.xml.namespace.QName);
- }
-
-}
-
package org.apache.http.conn {
@Deprecated public class ConnectTimeoutException extends java.io.InterruptedIOException {
@@ -75367,1152 +56220,3 @@
}
-package org.json {
-
- public class JSONArray {
- ctor public JSONArray();
- ctor public JSONArray(java.util.Collection);
- ctor public JSONArray(org.json.JSONTokener) throws org.json.JSONException;
- ctor public JSONArray(String) throws org.json.JSONException;
- ctor public JSONArray(Object) throws org.json.JSONException;
- method public Object get(int) throws org.json.JSONException;
- method public boolean getBoolean(int) throws org.json.JSONException;
- method public double getDouble(int) throws org.json.JSONException;
- method public int getInt(int) throws org.json.JSONException;
- method public org.json.JSONArray getJSONArray(int) throws org.json.JSONException;
- method public org.json.JSONObject getJSONObject(int) throws org.json.JSONException;
- method public long getLong(int) throws org.json.JSONException;
- method public String getString(int) throws org.json.JSONException;
- method public boolean isNull(int);
- method public String join(String) throws org.json.JSONException;
- method public int length();
- method public Object opt(int);
- method public boolean optBoolean(int);
- method public boolean optBoolean(int, boolean);
- method public double optDouble(int);
- method public double optDouble(int, double);
- method public int optInt(int);
- method public int optInt(int, int);
- method public org.json.JSONArray optJSONArray(int);
- method public org.json.JSONObject optJSONObject(int);
- method public long optLong(int);
- method public long optLong(int, long);
- method public String optString(int);
- method public String optString(int, String);
- method public org.json.JSONArray put(boolean);
- method public org.json.JSONArray put(double) throws org.json.JSONException;
- method public org.json.JSONArray put(int);
- method public org.json.JSONArray put(long);
- method public org.json.JSONArray put(Object);
- method public org.json.JSONArray put(int, boolean) throws org.json.JSONException;
- method public org.json.JSONArray put(int, double) throws org.json.JSONException;
- method public org.json.JSONArray put(int, int) throws org.json.JSONException;
- method public org.json.JSONArray put(int, long) throws org.json.JSONException;
- method public org.json.JSONArray put(int, Object) throws org.json.JSONException;
- method public Object remove(int);
- method public org.json.JSONObject toJSONObject(org.json.JSONArray) throws org.json.JSONException;
- method public String toString(int) throws org.json.JSONException;
- }
-
- public class JSONException extends java.lang.Exception {
- ctor public JSONException(String);
- ctor public JSONException(String, Throwable);
- ctor public JSONException(Throwable);
- }
-
- public class JSONObject {
- ctor public JSONObject();
- ctor public JSONObject(@NonNull java.util.Map);
- ctor public JSONObject(@NonNull org.json.JSONTokener) throws org.json.JSONException;
- ctor public JSONObject(@NonNull String) throws org.json.JSONException;
- ctor public JSONObject(@NonNull org.json.JSONObject, @NonNull String[]) throws org.json.JSONException;
- method @NonNull public org.json.JSONObject accumulate(@NonNull String, @Nullable Object) throws org.json.JSONException;
- method @NonNull public Object get(@NonNull String) throws org.json.JSONException;
- method public boolean getBoolean(@NonNull String) throws org.json.JSONException;
- method public double getDouble(@NonNull String) throws org.json.JSONException;
- method public int getInt(@NonNull String) throws org.json.JSONException;
- method @NonNull public org.json.JSONArray getJSONArray(@NonNull String) throws org.json.JSONException;
- method @NonNull public org.json.JSONObject getJSONObject(@NonNull String) throws org.json.JSONException;
- method public long getLong(@NonNull String) throws org.json.JSONException;
- method @NonNull public String getString(@NonNull String) throws org.json.JSONException;
- method public boolean has(@Nullable String);
- method public boolean isNull(@Nullable String);
- method @NonNull public java.util.Iterator<java.lang.String> keys();
- method public int length();
- method @Nullable public org.json.JSONArray names();
- method @NonNull public static String numberToString(@NonNull Number) throws org.json.JSONException;
- method @Nullable public Object opt(@Nullable String);
- method public boolean optBoolean(@Nullable String);
- method public boolean optBoolean(@Nullable String, boolean);
- method public double optDouble(@Nullable String);
- method public double optDouble(@Nullable String, double);
- method public int optInt(@Nullable String);
- method public int optInt(@Nullable String, int);
- method @Nullable public org.json.JSONArray optJSONArray(@Nullable String);
- method @Nullable public org.json.JSONObject optJSONObject(@Nullable String);
- method public long optLong(@Nullable String);
- method public long optLong(@Nullable String, long);
- method @NonNull public String optString(@Nullable String);
- method @NonNull public String optString(@Nullable String, @NonNull String);
- method @NonNull public org.json.JSONObject put(@NonNull String, boolean) throws org.json.JSONException;
- method @NonNull public org.json.JSONObject put(@NonNull String, double) throws org.json.JSONException;
- method @NonNull public org.json.JSONObject put(@NonNull String, int) throws org.json.JSONException;
- method @NonNull public org.json.JSONObject put(@NonNull String, long) throws org.json.JSONException;
- method @NonNull public org.json.JSONObject put(@NonNull String, @Nullable Object) throws org.json.JSONException;
- method @NonNull public org.json.JSONObject putOpt(@Nullable String, @Nullable Object) throws org.json.JSONException;
- method @NonNull public static String quote(@Nullable String);
- method @Nullable public Object remove(@Nullable String);
- method @Nullable public org.json.JSONArray toJSONArray(@Nullable org.json.JSONArray) throws org.json.JSONException;
- method @NonNull public String toString(int) throws org.json.JSONException;
- method @Nullable public static Object wrap(@Nullable Object);
- field @NonNull public static final Object NULL;
- }
-
- public class JSONStringer {
- ctor public JSONStringer();
- method public org.json.JSONStringer array() throws org.json.JSONException;
- method public org.json.JSONStringer endArray() throws org.json.JSONException;
- method public org.json.JSONStringer endObject() throws org.json.JSONException;
- method public org.json.JSONStringer key(String) throws org.json.JSONException;
- method public org.json.JSONStringer object() throws org.json.JSONException;
- method public org.json.JSONStringer value(Object) throws org.json.JSONException;
- method public org.json.JSONStringer value(boolean) throws org.json.JSONException;
- method public org.json.JSONStringer value(double) throws org.json.JSONException;
- method public org.json.JSONStringer value(long) throws org.json.JSONException;
- }
-
- public class JSONTokener {
- ctor public JSONTokener(String);
- method public void back();
- method public static int dehexchar(char);
- method public boolean more();
- method public char next();
- method public char next(char) throws org.json.JSONException;
- method public String next(int) throws org.json.JSONException;
- method public char nextClean() throws org.json.JSONException;
- method public String nextString(char) throws org.json.JSONException;
- method public String nextTo(String);
- method public String nextTo(char);
- method public Object nextValue() throws org.json.JSONException;
- method public void skipPast(String);
- method public char skipTo(char);
- method public org.json.JSONException syntaxError(String);
- }
-
-}
-
-package org.w3c.dom {
-
- public interface Attr extends org.w3c.dom.Node {
- method public String getName();
- method public org.w3c.dom.Element getOwnerElement();
- method public org.w3c.dom.TypeInfo getSchemaTypeInfo();
- method public boolean getSpecified();
- method public String getValue();
- method public boolean isId();
- method public void setValue(String) throws org.w3c.dom.DOMException;
- }
-
- public interface CDATASection extends org.w3c.dom.Text {
- }
-
- public interface CharacterData extends org.w3c.dom.Node {
- method public void appendData(String) throws org.w3c.dom.DOMException;
- method public void deleteData(int, int) throws org.w3c.dom.DOMException;
- method public String getData() throws org.w3c.dom.DOMException;
- method public int getLength();
- method public void insertData(int, String) throws org.w3c.dom.DOMException;
- method public void replaceData(int, int, String) throws org.w3c.dom.DOMException;
- method public void setData(String) throws org.w3c.dom.DOMException;
- method public String substringData(int, int) throws org.w3c.dom.DOMException;
- }
-
- public interface Comment extends org.w3c.dom.CharacterData {
- }
-
- public interface DOMConfiguration {
- method public boolean canSetParameter(String, Object);
- method public Object getParameter(String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.DOMStringList getParameterNames();
- method public void setParameter(String, Object) throws org.w3c.dom.DOMException;
- }
-
- public interface DOMError {
- method public org.w3c.dom.DOMLocator getLocation();
- method public String getMessage();
- method public Object getRelatedData();
- method public Object getRelatedException();
- method public short getSeverity();
- method public String getType();
- field public static final short SEVERITY_ERROR = 2; // 0x2
- field public static final short SEVERITY_FATAL_ERROR = 3; // 0x3
- field public static final short SEVERITY_WARNING = 1; // 0x1
- }
-
- public interface DOMErrorHandler {
- method public boolean handleError(org.w3c.dom.DOMError);
- }
-
- public class DOMException extends java.lang.RuntimeException {
- ctor public DOMException(short, String);
- field public static final short DOMSTRING_SIZE_ERR = 2; // 0x2
- field public static final short HIERARCHY_REQUEST_ERR = 3; // 0x3
- field public static final short INDEX_SIZE_ERR = 1; // 0x1
- field public static final short INUSE_ATTRIBUTE_ERR = 10; // 0xa
- field public static final short INVALID_ACCESS_ERR = 15; // 0xf
- field public static final short INVALID_CHARACTER_ERR = 5; // 0x5
- field public static final short INVALID_MODIFICATION_ERR = 13; // 0xd
- field public static final short INVALID_STATE_ERR = 11; // 0xb
- field public static final short NAMESPACE_ERR = 14; // 0xe
- field public static final short NOT_FOUND_ERR = 8; // 0x8
- field public static final short NOT_SUPPORTED_ERR = 9; // 0x9
- field public static final short NO_DATA_ALLOWED_ERR = 6; // 0x6
- field public static final short NO_MODIFICATION_ALLOWED_ERR = 7; // 0x7
- field public static final short SYNTAX_ERR = 12; // 0xc
- field public static final short TYPE_MISMATCH_ERR = 17; // 0x11
- field public static final short VALIDATION_ERR = 16; // 0x10
- field public static final short WRONG_DOCUMENT_ERR = 4; // 0x4
- field public short code;
- }
-
- public interface DOMImplementation {
- method public org.w3c.dom.Document createDocument(String, String, org.w3c.dom.DocumentType) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.DocumentType createDocumentType(String, String, String) throws org.w3c.dom.DOMException;
- method public Object getFeature(String, String);
- method public boolean hasFeature(String, String);
- }
-
- public interface DOMImplementationList {
- method public int getLength();
- method public org.w3c.dom.DOMImplementation item(int);
- }
-
- public interface DOMImplementationSource {
- method public org.w3c.dom.DOMImplementation getDOMImplementation(String);
- method public org.w3c.dom.DOMImplementationList getDOMImplementationList(String);
- }
-
- public interface DOMLocator {
- method public int getByteOffset();
- method public int getColumnNumber();
- method public int getLineNumber();
- method public org.w3c.dom.Node getRelatedNode();
- method public String getUri();
- method public int getUtf16Offset();
- }
-
- public interface DOMStringList {
- method public boolean contains(String);
- method public int getLength();
- method public String item(int);
- }
-
- public interface Document extends org.w3c.dom.Node {
- method public org.w3c.dom.Node adoptNode(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Attr createAttribute(String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Attr createAttributeNS(String, String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.CDATASection createCDATASection(String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Comment createComment(String);
- method public org.w3c.dom.DocumentFragment createDocumentFragment();
- method public org.w3c.dom.Element createElement(String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Element createElementNS(String, String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.EntityReference createEntityReference(String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.ProcessingInstruction createProcessingInstruction(String, String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Text createTextNode(String);
- method public org.w3c.dom.DocumentType getDoctype();
- method public org.w3c.dom.Element getDocumentElement();
- method public String getDocumentURI();
- method public org.w3c.dom.DOMConfiguration getDomConfig();
- method public org.w3c.dom.Element getElementById(String);
- method public org.w3c.dom.NodeList getElementsByTagName(String);
- method public org.w3c.dom.NodeList getElementsByTagNameNS(String, String);
- method public org.w3c.dom.DOMImplementation getImplementation();
- method public String getInputEncoding();
- method public boolean getStrictErrorChecking();
- method public String getXmlEncoding();
- method public boolean getXmlStandalone();
- method public String getXmlVersion();
- method public org.w3c.dom.Node importNode(org.w3c.dom.Node, boolean) throws org.w3c.dom.DOMException;
- method public void normalizeDocument();
- method public org.w3c.dom.Node renameNode(org.w3c.dom.Node, String, String) throws org.w3c.dom.DOMException;
- method public void setDocumentURI(String);
- method public void setStrictErrorChecking(boolean);
- method public void setXmlStandalone(boolean) throws org.w3c.dom.DOMException;
- method public void setXmlVersion(String) throws org.w3c.dom.DOMException;
- }
-
- public interface DocumentFragment extends org.w3c.dom.Node {
- }
-
- public interface DocumentType extends org.w3c.dom.Node {
- method public org.w3c.dom.NamedNodeMap getEntities();
- method public String getInternalSubset();
- method public String getName();
- method public org.w3c.dom.NamedNodeMap getNotations();
- method public String getPublicId();
- method public String getSystemId();
- }
-
- public interface Element extends org.w3c.dom.Node {
- method public String getAttribute(String);
- method public String getAttributeNS(String, String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Attr getAttributeNode(String);
- method public org.w3c.dom.Attr getAttributeNodeNS(String, String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.NodeList getElementsByTagName(String);
- method public org.w3c.dom.NodeList getElementsByTagNameNS(String, String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.TypeInfo getSchemaTypeInfo();
- method public String getTagName();
- method public boolean hasAttribute(String);
- method public boolean hasAttributeNS(String, String) throws org.w3c.dom.DOMException;
- method public void removeAttribute(String) throws org.w3c.dom.DOMException;
- method public void removeAttributeNS(String, String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr) throws org.w3c.dom.DOMException;
- method public void setAttribute(String, String) throws org.w3c.dom.DOMException;
- method public void setAttributeNS(String, String, String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr) throws org.w3c.dom.DOMException;
- method public void setIdAttribute(String, boolean) throws org.w3c.dom.DOMException;
- method public void setIdAttributeNS(String, String, boolean) throws org.w3c.dom.DOMException;
- method public void setIdAttributeNode(org.w3c.dom.Attr, boolean) throws org.w3c.dom.DOMException;
- }
-
- public interface Entity extends org.w3c.dom.Node {
- method public String getInputEncoding();
- method public String getNotationName();
- method public String getPublicId();
- method public String getSystemId();
- method public String getXmlEncoding();
- method public String getXmlVersion();
- }
-
- public interface EntityReference extends org.w3c.dom.Node {
- }
-
- public interface NameList {
- method public boolean contains(String);
- method public boolean containsNS(String, String);
- method public int getLength();
- method public String getName(int);
- method public String getNamespaceURI(int);
- }
-
- public interface NamedNodeMap {
- method public int getLength();
- method public org.w3c.dom.Node getNamedItem(String);
- method public org.w3c.dom.Node getNamedItemNS(String, String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Node item(int);
- method public org.w3c.dom.Node removeNamedItem(String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Node removeNamedItemNS(String, String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Node setNamedItem(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Node setNamedItemNS(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
- }
-
- public interface Node {
- method public org.w3c.dom.Node appendChild(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Node cloneNode(boolean);
- method public short compareDocumentPosition(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.NamedNodeMap getAttributes();
- method public String getBaseURI();
- method public org.w3c.dom.NodeList getChildNodes();
- method public Object getFeature(String, String);
- method public org.w3c.dom.Node getFirstChild();
- method public org.w3c.dom.Node getLastChild();
- method public String getLocalName();
- method public String getNamespaceURI();
- method public org.w3c.dom.Node getNextSibling();
- method public String getNodeName();
- method public short getNodeType();
- method public String getNodeValue() throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Document getOwnerDocument();
- method public org.w3c.dom.Node getParentNode();
- method public String getPrefix();
- method public org.w3c.dom.Node getPreviousSibling();
- method public String getTextContent() throws org.w3c.dom.DOMException;
- method public Object getUserData(String);
- method public boolean hasAttributes();
- method public boolean hasChildNodes();
- method public org.w3c.dom.Node insertBefore(org.w3c.dom.Node, org.w3c.dom.Node) throws org.w3c.dom.DOMException;
- method public boolean isDefaultNamespace(String);
- method public boolean isEqualNode(org.w3c.dom.Node);
- method public boolean isSameNode(org.w3c.dom.Node);
- method public boolean isSupported(String, String);
- method public String lookupNamespaceURI(String);
- method public String lookupPrefix(String);
- method public void normalize();
- method public org.w3c.dom.Node removeChild(org.w3c.dom.Node) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Node replaceChild(org.w3c.dom.Node, org.w3c.dom.Node) throws org.w3c.dom.DOMException;
- method public void setNodeValue(String) throws org.w3c.dom.DOMException;
- method public void setPrefix(String) throws org.w3c.dom.DOMException;
- method public void setTextContent(String) throws org.w3c.dom.DOMException;
- method public Object setUserData(String, Object, org.w3c.dom.UserDataHandler);
- field public static final short ATTRIBUTE_NODE = 2; // 0x2
- field public static final short CDATA_SECTION_NODE = 4; // 0x4
- field public static final short COMMENT_NODE = 8; // 0x8
- field public static final short DOCUMENT_FRAGMENT_NODE = 11; // 0xb
- field public static final short DOCUMENT_NODE = 9; // 0x9
- field public static final short DOCUMENT_POSITION_CONTAINED_BY = 16; // 0x10
- field public static final short DOCUMENT_POSITION_CONTAINS = 8; // 0x8
- field public static final short DOCUMENT_POSITION_DISCONNECTED = 1; // 0x1
- field public static final short DOCUMENT_POSITION_FOLLOWING = 4; // 0x4
- field public static final short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32; // 0x20
- field public static final short DOCUMENT_POSITION_PRECEDING = 2; // 0x2
- field public static final short DOCUMENT_TYPE_NODE = 10; // 0xa
- field public static final short ELEMENT_NODE = 1; // 0x1
- field public static final short ENTITY_NODE = 6; // 0x6
- field public static final short ENTITY_REFERENCE_NODE = 5; // 0x5
- field public static final short NOTATION_NODE = 12; // 0xc
- field public static final short PROCESSING_INSTRUCTION_NODE = 7; // 0x7
- field public static final short TEXT_NODE = 3; // 0x3
- }
-
- public interface NodeList {
- method public int getLength();
- method public org.w3c.dom.Node item(int);
- }
-
- public interface Notation extends org.w3c.dom.Node {
- method public String getPublicId();
- method public String getSystemId();
- }
-
- public interface ProcessingInstruction extends org.w3c.dom.Node {
- method public String getData();
- method public String getTarget();
- method public void setData(String) throws org.w3c.dom.DOMException;
- }
-
- public interface Text extends org.w3c.dom.CharacterData {
- method public String getWholeText();
- method public boolean isElementContentWhitespace();
- method public org.w3c.dom.Text replaceWholeText(String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.Text splitText(int) throws org.w3c.dom.DOMException;
- }
-
- public interface TypeInfo {
- method public String getTypeName();
- method public String getTypeNamespace();
- method public boolean isDerivedFrom(String, String, int);
- field public static final int DERIVATION_EXTENSION = 2; // 0x2
- field public static final int DERIVATION_LIST = 8; // 0x8
- field public static final int DERIVATION_RESTRICTION = 1; // 0x1
- field public static final int DERIVATION_UNION = 4; // 0x4
- }
-
- public interface UserDataHandler {
- method public void handle(short, String, Object, org.w3c.dom.Node, org.w3c.dom.Node);
- field public static final short NODE_ADOPTED = 5; // 0x5
- field public static final short NODE_CLONED = 1; // 0x1
- field public static final short NODE_DELETED = 3; // 0x3
- field public static final short NODE_IMPORTED = 2; // 0x2
- field public static final short NODE_RENAMED = 4; // 0x4
- }
-
-}
-
-package org.w3c.dom.ls {
-
- public interface DOMImplementationLS {
- method public org.w3c.dom.ls.LSInput createLSInput();
- method public org.w3c.dom.ls.LSOutput createLSOutput();
- method public org.w3c.dom.ls.LSParser createLSParser(short, String) throws org.w3c.dom.DOMException;
- method public org.w3c.dom.ls.LSSerializer createLSSerializer();
- field public static final short MODE_ASYNCHRONOUS = 2; // 0x2
- field public static final short MODE_SYNCHRONOUS = 1; // 0x1
- }
-
- public class LSException extends java.lang.RuntimeException {
- ctor public LSException(short, String);
- field public static final short PARSE_ERR = 81; // 0x51
- field public static final short SERIALIZE_ERR = 82; // 0x52
- field public short code;
- }
-
- public interface LSInput {
- method public String getBaseURI();
- method public java.io.InputStream getByteStream();
- method public boolean getCertifiedText();
- method public java.io.Reader getCharacterStream();
- method public String getEncoding();
- method public String getPublicId();
- method public String getStringData();
- method public String getSystemId();
- method public void setBaseURI(String);
- method public void setByteStream(java.io.InputStream);
- method public void setCertifiedText(boolean);
- method public void setCharacterStream(java.io.Reader);
- method public void setEncoding(String);
- method public void setPublicId(String);
- method public void setStringData(String);
- method public void setSystemId(String);
- }
-
- public interface LSOutput {
- method public java.io.OutputStream getByteStream();
- method public java.io.Writer getCharacterStream();
- method public String getEncoding();
- method public String getSystemId();
- method public void setByteStream(java.io.OutputStream);
- method public void setCharacterStream(java.io.Writer);
- method public void setEncoding(String);
- method public void setSystemId(String);
- }
-
- public interface LSParser {
- method public void abort();
- method public boolean getAsync();
- method public boolean getBusy();
- method public org.w3c.dom.DOMConfiguration getDomConfig();
- method public org.w3c.dom.ls.LSParserFilter getFilter();
- method public org.w3c.dom.Document parse(org.w3c.dom.ls.LSInput) throws org.w3c.dom.DOMException, org.w3c.dom.ls.LSException;
- method public org.w3c.dom.Document parseURI(String) throws org.w3c.dom.DOMException, org.w3c.dom.ls.LSException;
- method public org.w3c.dom.Node parseWithContext(org.w3c.dom.ls.LSInput, org.w3c.dom.Node, short) throws org.w3c.dom.DOMException, org.w3c.dom.ls.LSException;
- method public void setFilter(org.w3c.dom.ls.LSParserFilter);
- field public static final short ACTION_APPEND_AS_CHILDREN = 1; // 0x1
- field public static final short ACTION_INSERT_AFTER = 4; // 0x4
- field public static final short ACTION_INSERT_BEFORE = 3; // 0x3
- field public static final short ACTION_REPLACE = 5; // 0x5
- field public static final short ACTION_REPLACE_CHILDREN = 2; // 0x2
- }
-
- public interface LSParserFilter {
- method public short acceptNode(org.w3c.dom.Node);
- method public int getWhatToShow();
- method public short startElement(org.w3c.dom.Element);
- field public static final short FILTER_ACCEPT = 1; // 0x1
- field public static final short FILTER_INTERRUPT = 4; // 0x4
- field public static final short FILTER_REJECT = 2; // 0x2
- field public static final short FILTER_SKIP = 3; // 0x3
- }
-
- public interface LSResourceResolver {
- method public org.w3c.dom.ls.LSInput resolveResource(String, String, String, String, String);
- }
-
- public interface LSSerializer {
- method public org.w3c.dom.DOMConfiguration getDomConfig();
- method public String getNewLine();
- method public void setNewLine(String);
- method public boolean write(org.w3c.dom.Node, org.w3c.dom.ls.LSOutput) throws org.w3c.dom.ls.LSException;
- method public String writeToString(org.w3c.dom.Node) throws org.w3c.dom.DOMException, org.w3c.dom.ls.LSException;
- method public boolean writeToURI(org.w3c.dom.Node, String) throws org.w3c.dom.ls.LSException;
- }
-
-}
-
-package org.xml.sax {
-
- @Deprecated public interface AttributeList {
- method @Deprecated public int getLength();
- method @Deprecated public String getName(int);
- method @Deprecated public String getType(int);
- method @Deprecated public String getType(String);
- method @Deprecated public String getValue(int);
- method @Deprecated public String getValue(String);
- }
-
- public interface Attributes {
- method public int getIndex(String, String);
- method public int getIndex(String);
- method public int getLength();
- method public String getLocalName(int);
- method public String getQName(int);
- method public String getType(int);
- method public String getType(String, String);
- method public String getType(String);
- method public String getURI(int);
- method public String getValue(int);
- method public String getValue(String, String);
- method public String getValue(String);
- }
-
- public interface ContentHandler {
- method public void characters(char[], int, int) throws org.xml.sax.SAXException;
- method public void endDocument() throws org.xml.sax.SAXException;
- method public void endElement(String, String, String) throws org.xml.sax.SAXException;
- method public void endPrefixMapping(String) throws org.xml.sax.SAXException;
- method public void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
- method public void processingInstruction(String, String) throws org.xml.sax.SAXException;
- method public void setDocumentLocator(org.xml.sax.Locator);
- method public void skippedEntity(String) throws org.xml.sax.SAXException;
- method public void startDocument() throws org.xml.sax.SAXException;
- method public void startElement(String, String, String, org.xml.sax.Attributes) throws org.xml.sax.SAXException;
- method public void startPrefixMapping(String, String) throws org.xml.sax.SAXException;
- }
-
- public interface DTDHandler {
- method public void notationDecl(String, String, String) throws org.xml.sax.SAXException;
- method public void unparsedEntityDecl(String, String, String, String) throws org.xml.sax.SAXException;
- }
-
- @Deprecated public interface DocumentHandler {
- method @Deprecated public void characters(char[], int, int) throws org.xml.sax.SAXException;
- method @Deprecated public void endDocument() throws org.xml.sax.SAXException;
- method @Deprecated public void endElement(String) throws org.xml.sax.SAXException;
- method @Deprecated public void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
- method @Deprecated public void processingInstruction(String, String) throws org.xml.sax.SAXException;
- method @Deprecated public void setDocumentLocator(org.xml.sax.Locator);
- method @Deprecated public void startDocument() throws org.xml.sax.SAXException;
- method @Deprecated public void startElement(String, org.xml.sax.AttributeList) throws org.xml.sax.SAXException;
- }
-
- public interface EntityResolver {
- method public org.xml.sax.InputSource resolveEntity(String, String) throws java.io.IOException, org.xml.sax.SAXException;
- }
-
- public interface ErrorHandler {
- method public void error(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
- method public void fatalError(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
- method public void warning(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
- }
-
- @Deprecated public class HandlerBase implements org.xml.sax.DTDHandler org.xml.sax.DocumentHandler org.xml.sax.EntityResolver org.xml.sax.ErrorHandler {
- ctor @Deprecated public HandlerBase();
- method @Deprecated public void characters(char[], int, int) throws org.xml.sax.SAXException;
- method @Deprecated public void endDocument() throws org.xml.sax.SAXException;
- method @Deprecated public void endElement(String) throws org.xml.sax.SAXException;
- method @Deprecated public void error(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
- method @Deprecated public void fatalError(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
- method @Deprecated public void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
- method @Deprecated public void notationDecl(String, String, String);
- method @Deprecated public void processingInstruction(String, String) throws org.xml.sax.SAXException;
- method @Deprecated public org.xml.sax.InputSource resolveEntity(String, String) throws org.xml.sax.SAXException;
- method @Deprecated public void setDocumentLocator(org.xml.sax.Locator);
- method @Deprecated public void startDocument() throws org.xml.sax.SAXException;
- method @Deprecated public void startElement(String, org.xml.sax.AttributeList) throws org.xml.sax.SAXException;
- method @Deprecated public void unparsedEntityDecl(String, String, String, String);
- method @Deprecated public void warning(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
- }
-
- public class InputSource {
- ctor public InputSource();
- ctor public InputSource(String);
- ctor public InputSource(java.io.InputStream);
- ctor public InputSource(java.io.Reader);
- method public java.io.InputStream getByteStream();
- method public java.io.Reader getCharacterStream();
- method public String getEncoding();
- method public String getPublicId();
- method public String getSystemId();
- method public void setByteStream(java.io.InputStream);
- method public void setCharacterStream(java.io.Reader);
- method public void setEncoding(String);
- method public void setPublicId(String);
- method public void setSystemId(String);
- }
-
- public interface Locator {
- method public int getColumnNumber();
- method public int getLineNumber();
- method public String getPublicId();
- method public String getSystemId();
- }
-
- @Deprecated public interface Parser {
- method @Deprecated public void parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
- method @Deprecated public void parse(String) throws java.io.IOException, org.xml.sax.SAXException;
- method @Deprecated public void setDTDHandler(org.xml.sax.DTDHandler);
- method @Deprecated public void setDocumentHandler(org.xml.sax.DocumentHandler);
- method @Deprecated public void setEntityResolver(org.xml.sax.EntityResolver);
- method @Deprecated public void setErrorHandler(org.xml.sax.ErrorHandler);
- method @Deprecated public void setLocale(java.util.Locale) throws org.xml.sax.SAXException;
- }
-
- public class SAXException extends java.lang.Exception {
- ctor public SAXException();
- ctor public SAXException(String);
- ctor public SAXException(Exception);
- ctor public SAXException(String, Exception);
- method public Exception getException();
- }
-
- public class SAXNotRecognizedException extends org.xml.sax.SAXException {
- ctor public SAXNotRecognizedException();
- ctor public SAXNotRecognizedException(String);
- }
-
- public class SAXNotSupportedException extends org.xml.sax.SAXException {
- ctor public SAXNotSupportedException();
- ctor public SAXNotSupportedException(String);
- }
-
- public class SAXParseException extends org.xml.sax.SAXException {
- ctor public SAXParseException(String, org.xml.sax.Locator);
- ctor public SAXParseException(String, org.xml.sax.Locator, Exception);
- ctor public SAXParseException(String, String, String, int, int);
- ctor public SAXParseException(String, String, String, int, int, Exception);
- method public int getColumnNumber();
- method public int getLineNumber();
- method public String getPublicId();
- method public String getSystemId();
- }
-
- public interface XMLFilter extends org.xml.sax.XMLReader {
- method public org.xml.sax.XMLReader getParent();
- method public void setParent(org.xml.sax.XMLReader);
- }
-
- public interface XMLReader {
- method public org.xml.sax.ContentHandler getContentHandler();
- method public org.xml.sax.DTDHandler getDTDHandler();
- method public org.xml.sax.EntityResolver getEntityResolver();
- method public org.xml.sax.ErrorHandler getErrorHandler();
- method public boolean getFeature(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public Object getProperty(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public void parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
- method public void parse(String) throws java.io.IOException, org.xml.sax.SAXException;
- method public void setContentHandler(org.xml.sax.ContentHandler);
- method public void setDTDHandler(org.xml.sax.DTDHandler);
- method public void setEntityResolver(org.xml.sax.EntityResolver);
- method public void setErrorHandler(org.xml.sax.ErrorHandler);
- method public void setFeature(String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public void setProperty(String, Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- }
-
-}
-
-package org.xml.sax.ext {
-
- public interface Attributes2 extends org.xml.sax.Attributes {
- method public boolean isDeclared(int);
- method public boolean isDeclared(String);
- method public boolean isDeclared(String, String);
- method public boolean isSpecified(int);
- method public boolean isSpecified(String, String);
- method public boolean isSpecified(String);
- }
-
- public class Attributes2Impl extends org.xml.sax.helpers.AttributesImpl implements org.xml.sax.ext.Attributes2 {
- ctor public Attributes2Impl();
- ctor public Attributes2Impl(org.xml.sax.Attributes);
- method public boolean isDeclared(int);
- method public boolean isDeclared(String, String);
- method public boolean isDeclared(String);
- method public boolean isSpecified(int);
- method public boolean isSpecified(String, String);
- method public boolean isSpecified(String);
- method public void setDeclared(int, boolean);
- method public void setSpecified(int, boolean);
- }
-
- public interface DeclHandler {
- method public void attributeDecl(String, String, String, String, String) throws org.xml.sax.SAXException;
- method public void elementDecl(String, String) throws org.xml.sax.SAXException;
- method public void externalEntityDecl(String, String, String) throws org.xml.sax.SAXException;
- method public void internalEntityDecl(String, String) throws org.xml.sax.SAXException;
- }
-
- public class DefaultHandler2 extends org.xml.sax.helpers.DefaultHandler implements org.xml.sax.ext.DeclHandler org.xml.sax.ext.EntityResolver2 org.xml.sax.ext.LexicalHandler {
- ctor public DefaultHandler2();
- method public void attributeDecl(String, String, String, String, String) throws org.xml.sax.SAXException;
- method public void comment(char[], int, int) throws org.xml.sax.SAXException;
- method public void elementDecl(String, String) throws org.xml.sax.SAXException;
- method public void endCDATA() throws org.xml.sax.SAXException;
- method public void endDTD() throws org.xml.sax.SAXException;
- method public void endEntity(String) throws org.xml.sax.SAXException;
- method public void externalEntityDecl(String, String, String) throws org.xml.sax.SAXException;
- method public org.xml.sax.InputSource getExternalSubset(String, String) throws java.io.IOException, org.xml.sax.SAXException;
- method public void internalEntityDecl(String, String) throws org.xml.sax.SAXException;
- method public org.xml.sax.InputSource resolveEntity(String, String, String, String) throws java.io.IOException, org.xml.sax.SAXException;
- method public void startCDATA() throws org.xml.sax.SAXException;
- method public void startDTD(String, String, String) throws org.xml.sax.SAXException;
- method public void startEntity(String) throws org.xml.sax.SAXException;
- }
-
- public interface EntityResolver2 extends org.xml.sax.EntityResolver {
- method public org.xml.sax.InputSource getExternalSubset(String, String) throws java.io.IOException, org.xml.sax.SAXException;
- method public org.xml.sax.InputSource resolveEntity(String, String, String, String) throws java.io.IOException, org.xml.sax.SAXException;
- }
-
- public interface LexicalHandler {
- method public void comment(char[], int, int) throws org.xml.sax.SAXException;
- method public void endCDATA() throws org.xml.sax.SAXException;
- method public void endDTD() throws org.xml.sax.SAXException;
- method public void endEntity(String) throws org.xml.sax.SAXException;
- method public void startCDATA() throws org.xml.sax.SAXException;
- method public void startDTD(String, String, String) throws org.xml.sax.SAXException;
- method public void startEntity(String) throws org.xml.sax.SAXException;
- }
-
- public interface Locator2 extends org.xml.sax.Locator {
- method public String getEncoding();
- method public String getXMLVersion();
- }
-
- public class Locator2Impl extends org.xml.sax.helpers.LocatorImpl implements org.xml.sax.ext.Locator2 {
- ctor public Locator2Impl();
- ctor public Locator2Impl(org.xml.sax.Locator);
- method public String getEncoding();
- method public String getXMLVersion();
- method public void setEncoding(String);
- method public void setXMLVersion(String);
- }
-
-}
-
-package org.xml.sax.helpers {
-
- @Deprecated public class AttributeListImpl implements org.xml.sax.AttributeList {
- ctor @Deprecated public AttributeListImpl();
- ctor @Deprecated public AttributeListImpl(org.xml.sax.AttributeList);
- method @Deprecated public void addAttribute(String, String, String);
- method @Deprecated public void clear();
- method @Deprecated public int getLength();
- method @Deprecated public String getName(int);
- method @Deprecated public String getType(int);
- method @Deprecated public String getType(String);
- method @Deprecated public String getValue(int);
- method @Deprecated public String getValue(String);
- method @Deprecated public void removeAttribute(String);
- method @Deprecated public void setAttributeList(org.xml.sax.AttributeList);
- }
-
- public class AttributesImpl implements org.xml.sax.Attributes {
- ctor public AttributesImpl();
- ctor public AttributesImpl(org.xml.sax.Attributes);
- method public void addAttribute(String, String, String, String, String);
- method public void clear();
- method public int getIndex(String, String);
- method public int getIndex(String);
- method public int getLength();
- method public String getLocalName(int);
- method public String getQName(int);
- method public String getType(int);
- method public String getType(String, String);
- method public String getType(String);
- method public String getURI(int);
- method public String getValue(int);
- method public String getValue(String, String);
- method public String getValue(String);
- method public void removeAttribute(int);
- method public void setAttribute(int, String, String, String, String, String);
- method public void setAttributes(org.xml.sax.Attributes);
- method public void setLocalName(int, String);
- method public void setQName(int, String);
- method public void setType(int, String);
- method public void setURI(int, String);
- method public void setValue(int, String);
- }
-
- public class DefaultHandler implements org.xml.sax.ContentHandler org.xml.sax.DTDHandler org.xml.sax.EntityResolver org.xml.sax.ErrorHandler {
- ctor public DefaultHandler();
- method public void characters(char[], int, int) throws org.xml.sax.SAXException;
- method public void endDocument() throws org.xml.sax.SAXException;
- method public void endElement(String, String, String) throws org.xml.sax.SAXException;
- method public void endPrefixMapping(String) throws org.xml.sax.SAXException;
- method public void error(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
- method public void fatalError(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
- method public void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
- method public void notationDecl(String, String, String) throws org.xml.sax.SAXException;
- method public void processingInstruction(String, String) throws org.xml.sax.SAXException;
- method public org.xml.sax.InputSource resolveEntity(String, String) throws java.io.IOException, org.xml.sax.SAXException;
- method public void setDocumentLocator(org.xml.sax.Locator);
- method public void skippedEntity(String) throws org.xml.sax.SAXException;
- method public void startDocument() throws org.xml.sax.SAXException;
- method public void startElement(String, String, String, org.xml.sax.Attributes) throws org.xml.sax.SAXException;
- method public void startPrefixMapping(String, String) throws org.xml.sax.SAXException;
- method public void unparsedEntityDecl(String, String, String, String) throws org.xml.sax.SAXException;
- method public void warning(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
- }
-
- public class LocatorImpl implements org.xml.sax.Locator {
- ctor public LocatorImpl();
- ctor public LocatorImpl(org.xml.sax.Locator);
- method public int getColumnNumber();
- method public int getLineNumber();
- method public String getPublicId();
- method public String getSystemId();
- method public void setColumnNumber(int);
- method public void setLineNumber(int);
- method public void setPublicId(String);
- method public void setSystemId(String);
- }
-
- public class NamespaceSupport {
- ctor public NamespaceSupport();
- method public boolean declarePrefix(String, String);
- method public java.util.Enumeration getDeclaredPrefixes();
- method public String getPrefix(String);
- method public java.util.Enumeration getPrefixes();
- method public java.util.Enumeration getPrefixes(String);
- method public String getURI(String);
- method public boolean isNamespaceDeclUris();
- method public void popContext();
- method public String[] processName(String, String[], boolean);
- method public void pushContext();
- method public void reset();
- method public void setNamespaceDeclUris(boolean);
- field public static final String NSDECL = "http://www.w3.org/xmlns/2000/";
- field public static final String XMLNS = "http://www.w3.org/XML/1998/namespace";
- }
-
- public class ParserAdapter implements org.xml.sax.DocumentHandler org.xml.sax.XMLReader {
- ctor public ParserAdapter() throws org.xml.sax.SAXException;
- ctor public ParserAdapter(org.xml.sax.Parser);
- method public void characters(char[], int, int) throws org.xml.sax.SAXException;
- method public void endDocument() throws org.xml.sax.SAXException;
- method public void endElement(String) throws org.xml.sax.SAXException;
- method public org.xml.sax.ContentHandler getContentHandler();
- method public org.xml.sax.DTDHandler getDTDHandler();
- method public org.xml.sax.EntityResolver getEntityResolver();
- method public org.xml.sax.ErrorHandler getErrorHandler();
- method public boolean getFeature(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public Object getProperty(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
- method public void parse(String) throws java.io.IOException, org.xml.sax.SAXException;
- method public void parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
- method public void processingInstruction(String, String) throws org.xml.sax.SAXException;
- method public void setContentHandler(org.xml.sax.ContentHandler);
- method public void setDTDHandler(org.xml.sax.DTDHandler);
- method public void setDocumentLocator(org.xml.sax.Locator);
- method public void setEntityResolver(org.xml.sax.EntityResolver);
- method public void setErrorHandler(org.xml.sax.ErrorHandler);
- method public void setFeature(String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public void setProperty(String, Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public void startDocument() throws org.xml.sax.SAXException;
- method public void startElement(String, org.xml.sax.AttributeList) throws org.xml.sax.SAXException;
- }
-
- @Deprecated public class ParserFactory {
- method @Deprecated public static org.xml.sax.Parser makeParser() throws java.lang.ClassCastException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.NullPointerException;
- method @Deprecated public static org.xml.sax.Parser makeParser(String) throws java.lang.ClassCastException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
- }
-
- public class XMLFilterImpl implements org.xml.sax.ContentHandler org.xml.sax.DTDHandler org.xml.sax.EntityResolver org.xml.sax.ErrorHandler org.xml.sax.XMLFilter {
- ctor public XMLFilterImpl();
- ctor public XMLFilterImpl(org.xml.sax.XMLReader);
- method public void characters(char[], int, int) throws org.xml.sax.SAXException;
- method public void endDocument() throws org.xml.sax.SAXException;
- method public void endElement(String, String, String) throws org.xml.sax.SAXException;
- method public void endPrefixMapping(String) throws org.xml.sax.SAXException;
- method public void error(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
- method public void fatalError(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
- method public org.xml.sax.ContentHandler getContentHandler();
- method public org.xml.sax.DTDHandler getDTDHandler();
- method public org.xml.sax.EntityResolver getEntityResolver();
- method public org.xml.sax.ErrorHandler getErrorHandler();
- method public boolean getFeature(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public org.xml.sax.XMLReader getParent();
- method public Object getProperty(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
- method public void notationDecl(String, String, String) throws org.xml.sax.SAXException;
- method public void parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
- method public void parse(String) throws java.io.IOException, org.xml.sax.SAXException;
- method public void processingInstruction(String, String) throws org.xml.sax.SAXException;
- method public org.xml.sax.InputSource resolveEntity(String, String) throws java.io.IOException, org.xml.sax.SAXException;
- method public void setContentHandler(org.xml.sax.ContentHandler);
- method public void setDTDHandler(org.xml.sax.DTDHandler);
- method public void setDocumentLocator(org.xml.sax.Locator);
- method public void setEntityResolver(org.xml.sax.EntityResolver);
- method public void setErrorHandler(org.xml.sax.ErrorHandler);
- method public void setFeature(String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public void setParent(org.xml.sax.XMLReader);
- method public void setProperty(String, Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public void skippedEntity(String) throws org.xml.sax.SAXException;
- method public void startDocument() throws org.xml.sax.SAXException;
- method public void startElement(String, String, String, org.xml.sax.Attributes) throws org.xml.sax.SAXException;
- method public void startPrefixMapping(String, String) throws org.xml.sax.SAXException;
- method public void unparsedEntityDecl(String, String, String, String) throws org.xml.sax.SAXException;
- method public void warning(org.xml.sax.SAXParseException) throws org.xml.sax.SAXException;
- }
-
- public class XMLReaderAdapter implements org.xml.sax.ContentHandler org.xml.sax.Parser {
- ctor public XMLReaderAdapter() throws org.xml.sax.SAXException;
- ctor public XMLReaderAdapter(org.xml.sax.XMLReader);
- method public void characters(char[], int, int) throws org.xml.sax.SAXException;
- method public void endDocument() throws org.xml.sax.SAXException;
- method public void endElement(String, String, String) throws org.xml.sax.SAXException;
- method public void endPrefixMapping(String);
- method public void ignorableWhitespace(char[], int, int) throws org.xml.sax.SAXException;
- method public void parse(String) throws java.io.IOException, org.xml.sax.SAXException;
- method public void parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
- method public void processingInstruction(String, String) throws org.xml.sax.SAXException;
- method public void setDTDHandler(org.xml.sax.DTDHandler);
- method public void setDocumentHandler(org.xml.sax.DocumentHandler);
- method public void setDocumentLocator(org.xml.sax.Locator);
- method public void setEntityResolver(org.xml.sax.EntityResolver);
- method public void setErrorHandler(org.xml.sax.ErrorHandler);
- method public void setLocale(java.util.Locale) throws org.xml.sax.SAXException;
- method public void skippedEntity(String) throws org.xml.sax.SAXException;
- method public void startDocument() throws org.xml.sax.SAXException;
- method public void startElement(String, String, String, org.xml.sax.Attributes) throws org.xml.sax.SAXException;
- method public void startPrefixMapping(String, String);
- }
-
- public final class XMLReaderFactory {
- method public static org.xml.sax.XMLReader createXMLReader() throws org.xml.sax.SAXException;
- method public static org.xml.sax.XMLReader createXMLReader(String) throws org.xml.sax.SAXException;
- }
-
-}
-
-package org.xmlpull.v1 {
-
- public interface XmlPullParser {
- method public void defineEntityReplacementText(String, String) throws org.xmlpull.v1.XmlPullParserException;
- method public int getAttributeCount();
- method public String getAttributeName(int);
- method public String getAttributeNamespace(int);
- method public String getAttributePrefix(int);
- method public String getAttributeType(int);
- method public String getAttributeValue(int);
- method public String getAttributeValue(String, String);
- method public int getColumnNumber();
- method public int getDepth();
- method public int getEventType() throws org.xmlpull.v1.XmlPullParserException;
- method public boolean getFeature(String);
- method public String getInputEncoding();
- method public int getLineNumber();
- method public String getName();
- method public String getNamespace(String);
- method public String getNamespace();
- method public int getNamespaceCount(int) throws org.xmlpull.v1.XmlPullParserException;
- method public String getNamespacePrefix(int) throws org.xmlpull.v1.XmlPullParserException;
- method public String getNamespaceUri(int) throws org.xmlpull.v1.XmlPullParserException;
- method public String getPositionDescription();
- method public String getPrefix();
- method public Object getProperty(String);
- method public String getText();
- method public char[] getTextCharacters(int[]);
- method public boolean isAttributeDefault(int);
- method public boolean isEmptyElementTag() throws org.xmlpull.v1.XmlPullParserException;
- method public boolean isWhitespace() throws org.xmlpull.v1.XmlPullParserException;
- method public int next() throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public int nextTag() throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public String nextText() throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public int nextToken() throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public void require(int, String, String) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public void setFeature(String, boolean) throws org.xmlpull.v1.XmlPullParserException;
- method public void setInput(java.io.Reader) throws org.xmlpull.v1.XmlPullParserException;
- method public void setInput(java.io.InputStream, String) throws org.xmlpull.v1.XmlPullParserException;
- method public void setProperty(String, Object) throws org.xmlpull.v1.XmlPullParserException;
- field public static final int CDSECT = 5; // 0x5
- field public static final int COMMENT = 9; // 0x9
- field public static final int DOCDECL = 10; // 0xa
- field public static final int END_DOCUMENT = 1; // 0x1
- field public static final int END_TAG = 3; // 0x3
- field public static final int ENTITY_REF = 6; // 0x6
- field public static final String FEATURE_PROCESS_DOCDECL = "http://xmlpull.org/v1/doc/features.html#process-docdecl";
- field public static final String FEATURE_PROCESS_NAMESPACES = "http://xmlpull.org/v1/doc/features.html#process-namespaces";
- field public static final String FEATURE_REPORT_NAMESPACE_ATTRIBUTES = "http://xmlpull.org/v1/doc/features.html#report-namespace-prefixes";
- field public static final String FEATURE_VALIDATION = "http://xmlpull.org/v1/doc/features.html#validation";
- field public static final int IGNORABLE_WHITESPACE = 7; // 0x7
- field public static final String NO_NAMESPACE = "";
- field public static final int PROCESSING_INSTRUCTION = 8; // 0x8
- field public static final int START_DOCUMENT = 0; // 0x0
- field public static final int START_TAG = 2; // 0x2
- field public static final int TEXT = 4; // 0x4
- field public static final String[] TYPES;
- }
-
- public class XmlPullParserException extends java.lang.Exception {
- ctor public XmlPullParserException(String);
- ctor public XmlPullParserException(String, org.xmlpull.v1.XmlPullParser, Throwable);
- method public int getColumnNumber();
- method public Throwable getDetail();
- method public int getLineNumber();
- field protected int column;
- field protected Throwable detail;
- field protected int row;
- }
-
- public class XmlPullParserFactory {
- ctor protected XmlPullParserFactory();
- method public boolean getFeature(String);
- method public boolean isNamespaceAware();
- method public boolean isValidating();
- method public static org.xmlpull.v1.XmlPullParserFactory newInstance() throws org.xmlpull.v1.XmlPullParserException;
- method public static org.xmlpull.v1.XmlPullParserFactory newInstance(String, Class) throws org.xmlpull.v1.XmlPullParserException;
- method public org.xmlpull.v1.XmlPullParser newPullParser() throws org.xmlpull.v1.XmlPullParserException;
- method public org.xmlpull.v1.XmlSerializer newSerializer() throws org.xmlpull.v1.XmlPullParserException;
- method public void setFeature(String, boolean) throws org.xmlpull.v1.XmlPullParserException;
- method public void setNamespaceAware(boolean);
- method public void setValidating(boolean);
- field public static final String PROPERTY_NAME = "org.xmlpull.v1.XmlPullParserFactory";
- field protected String classNamesLocation;
- field protected java.util.HashMap<java.lang.String,java.lang.Boolean> features;
- field protected java.util.ArrayList parserClasses;
- field protected java.util.ArrayList serializerClasses;
- }
-
- public interface XmlSerializer {
- method public org.xmlpull.v1.XmlSerializer attribute(String, String, String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public void cdsect(String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public void comment(String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public void docdecl(String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public void endDocument() throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public org.xmlpull.v1.XmlSerializer endTag(String, String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public void entityRef(String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public void flush() throws java.io.IOException;
- method public int getDepth();
- method public boolean getFeature(String);
- method public String getName();
- method public String getNamespace();
- method public String getPrefix(String, boolean) throws java.lang.IllegalArgumentException;
- method public Object getProperty(String);
- method public void ignorableWhitespace(String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public void processingInstruction(String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public void setFeature(String, boolean) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public void setOutput(java.io.OutputStream, String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public void setOutput(java.io.Writer) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public void setPrefix(String, String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public void setProperty(String, Object) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public void startDocument(String, Boolean) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public org.xmlpull.v1.XmlSerializer startTag(String, String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public org.xmlpull.v1.XmlSerializer text(String) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- method public org.xmlpull.v1.XmlSerializer text(char[], int, int) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException;
- }
-
-}
-
-package org.xmlpull.v1.sax2 {
-
- public class Driver implements org.xml.sax.Attributes org.xml.sax.Locator org.xml.sax.XMLReader {
- ctor public Driver() throws org.xmlpull.v1.XmlPullParserException;
- ctor public Driver(org.xmlpull.v1.XmlPullParser) throws org.xmlpull.v1.XmlPullParserException;
- method public int getColumnNumber();
- method public org.xml.sax.ContentHandler getContentHandler();
- method public org.xml.sax.DTDHandler getDTDHandler();
- method public org.xml.sax.EntityResolver getEntityResolver();
- method public org.xml.sax.ErrorHandler getErrorHandler();
- method public boolean getFeature(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public int getIndex(String, String);
- method public int getIndex(String);
- method public int getLength();
- method public int getLineNumber();
- method public String getLocalName(int);
- method public Object getProperty(String) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public String getPublicId();
- method public String getQName(int);
- method public String getSystemId();
- method public String getType(int);
- method public String getType(String, String);
- method public String getType(String);
- method public String getURI(int);
- method public String getValue(int);
- method public String getValue(String, String);
- method public String getValue(String);
- method public void parse(org.xml.sax.InputSource) throws java.io.IOException, org.xml.sax.SAXException;
- method public void parse(String) throws java.io.IOException, org.xml.sax.SAXException;
- method public void parseSubTree(org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xml.sax.SAXException;
- method public void setContentHandler(org.xml.sax.ContentHandler);
- method public void setDTDHandler(org.xml.sax.DTDHandler);
- method public void setEntityResolver(org.xml.sax.EntityResolver);
- method public void setErrorHandler(org.xml.sax.ErrorHandler);
- method public void setFeature(String, boolean) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method public void setProperty(String, Object) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException;
- method protected void startElement(String, String, String) throws org.xml.sax.SAXException;
- field protected static final String APACHE_DYNAMIC_VALIDATION_FEATURE = "http://apache.org/xml/features/validation/dynamic";
- field protected static final String APACHE_SCHEMA_VALIDATION_FEATURE = "http://apache.org/xml/features/validation/schema";
- field protected static final String DECLARATION_HANDLER_PROPERTY = "http://xml.org/sax/properties/declaration-handler";
- field protected static final String LEXICAL_HANDLER_PROPERTY = "http://xml.org/sax/properties/lexical-handler";
- field protected static final String NAMESPACES_FEATURE = "http://xml.org/sax/features/namespaces";
- field protected static final String NAMESPACE_PREFIXES_FEATURE = "http://xml.org/sax/features/namespace-prefixes";
- field protected static final String VALIDATION_FEATURE = "http://xml.org/sax/features/validation";
- field protected org.xml.sax.ContentHandler contentHandler;
- field protected org.xml.sax.ErrorHandler errorHandler;
- field protected org.xmlpull.v1.XmlPullParser pp;
- field protected String systemId;
- }
-
-}
-
diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt
index 8e99d3c..f22b0f4 100644
--- a/core/api/module-lib-current.txt
+++ b/core/api/module-lib-current.txt
@@ -80,8 +80,15 @@
public class MediaMetadataRetriever implements java.lang.AutoCloseable {
field public static final int METADATA_KEY_VIDEO_CODEC_MIME_TYPE = 40; // 0x28
- field public static final int METADATA_KEY_XMP_LENGTH = 42; // 0x2a
- field public static final int METADATA_KEY_XMP_OFFSET = 41; // 0x29
+ }
+
+ public class MediaServiceManager {
+ method @NonNull public android.media.MediaServiceManager.ServiceRegisterer getMediaSessionServiceRegisterer();
+ method @NonNull public android.media.MediaServiceManager.ServiceRegisterer getMediaTranscodingServiceRegisterer();
+ }
+
+ public static final class MediaServiceManager.ServiceRegisterer {
+ method @Nullable public android.os.IBinder get();
}
}
@@ -107,14 +114,14 @@
method public void dispatchVolumeKeyEventAsSystemService(@NonNull android.view.KeyEvent, int);
method public void dispatchVolumeKeyEventToSessionAsSystemService(@NonNull android.view.KeyEvent, @NonNull android.media.session.MediaSession.Token);
method @NonNull public java.util.List<android.media.session.MediaController> getActiveSessionsForUser(@Nullable android.content.ComponentName, int);
- method public void registerRemoteVolumeControllerCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.session.MediaSessionManager.RemoteVolumeControllerCallback);
- method public void unregisterRemoteVolumeControllerCallback(@NonNull android.media.session.MediaSessionManager.RemoteVolumeControllerCallback);
+ method public void registerRemoteSessionCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.session.MediaSessionManager.RemoteSessionCallback);
+ method public void unregisterRemoteSessionCallback(@NonNull android.media.session.MediaSessionManager.RemoteSessionCallback);
field public static final int RESULT_MEDIA_KEY_HANDLED = 1; // 0x1
field public static final int RESULT_MEDIA_KEY_NOT_HANDLED = 0; // 0x0
}
- public static interface MediaSessionManager.RemoteVolumeControllerCallback {
- method public void onSessionChanged(@Nullable android.media.session.MediaSession.Token);
+ public static interface MediaSessionManager.RemoteSessionCallback {
+ method public void onDefaultRemoteSessionChanged(@Nullable android.media.session.MediaSession.Token);
method public void onVolumeChanged(@NonNull android.media.session.MediaSession.Token, int);
}
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 85da7c3..f89f96f 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -51,6 +51,7 @@
field public static final String BIND_TELEPHONY_DATA_SERVICE = "android.permission.BIND_TELEPHONY_DATA_SERVICE";
field public static final String BIND_TELEPHONY_NETWORK_SERVICE = "android.permission.BIND_TELEPHONY_NETWORK_SERVICE";
field public static final String BIND_TEXTCLASSIFIER_SERVICE = "android.permission.BIND_TEXTCLASSIFIER_SERVICE";
+ field public static final String BIND_TIME_ZONE_PROVIDER_SERVICE = "android.permission.BIND_TIME_ZONE_PROVIDER_SERVICE";
field public static final String BIND_TRUST_AGENT = "android.permission.BIND_TRUST_AGENT";
field public static final String BIND_TV_REMOTE_SERVICE = "android.permission.BIND_TV_REMOTE_SERVICE";
field public static final String BRICK = "android.permission.BRICK";
@@ -99,7 +100,7 @@
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";
- field public static final String INSTALL_LOCATION_TIME_ZONE_PROVIDER = "android.permission.INSTALL_LOCATION_TIME_ZONE_PROVIDER";
+ field public static final String INSTALL_LOCATION_TIME_ZONE_PROVIDER_SERVICE = "android.permission.INSTALL_LOCATION_TIME_ZONE_PROVIDER_SERVICE";
field public static final String INSTALL_PACKAGE_UPDATES = "android.permission.INSTALL_PACKAGE_UPDATES";
field public static final String INSTALL_SELF_UPDATES = "android.permission.INSTALL_SELF_UPDATES";
field public static final String INTENT_FILTER_VERIFICATION_AGENT = "android.permission.INTENT_FILTER_VERIFICATION_AGENT";
@@ -1346,7 +1347,6 @@
public abstract class RoleControllerService extends android.app.Service {
ctor public RoleControllerService();
- method @NonNull public android.app.role.RolePrivileges getRolePrivileges(@NonNull String);
method @WorkerThread public abstract boolean onAddRoleHolder(@NonNull String, @NonNull String, int);
method @Nullable public final android.os.IBinder onBind(@Nullable android.content.Intent);
method @WorkerThread public abstract boolean onClearRoleHolders(@NonNull String, int);
@@ -1373,18 +1373,6 @@
field public static final int MANAGE_HOLDERS_FLAG_DONT_KILL_APP = 1; // 0x1
}
- public final class RolePrivileges implements android.os.Parcelable {
- ctor public RolePrivileges(@NonNull java.util.List<java.lang.String>, @NonNull java.util.List<java.lang.String>, @NonNull java.util.List<java.lang.String>, @NonNull java.util.List<java.lang.String>);
- method public int describeContents();
- method @NonNull public java.util.List<java.lang.String> getAppOpPermissions();
- method @NonNull public java.util.List<java.lang.String> getAppOps();
- method @NonNull public java.util.List<java.lang.String> getCapabilities();
- method @NonNull public java.util.List<java.lang.String> getPermissions();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field public static final String CAPABILITY_NOTIFICATION_LISTENER = "android.app.role.capability.NOTIFICATION_LISTENER";
- field @NonNull public static final android.os.Parcelable.Creator<android.app.role.RolePrivileges> CREATOR;
- }
-
}
package android.app.search {
@@ -3950,19 +3938,29 @@
method public void onLocationBatch(java.util.List<android.location.Location>);
}
- public final class GnssCapabilities {
+ public final class GnssCapabilities implements android.os.Parcelable {
method public boolean hasGeofencing();
method public boolean hasLowPowerMode();
method public boolean hasMeasurementCorrections();
method public boolean hasMeasurementCorrectionsExcessPathLength();
method public boolean hasMeasurementCorrectionsLosSats();
- method public boolean hasMeasurementCorrectionsReflectingPane();
- method public boolean hasMeasurements();
- method public boolean hasNavMessages();
+ method @Deprecated public boolean hasMeasurementCorrectionsReflectingPane();
+ method public boolean hasMeasurementCorrectionsReflectingPlane();
+ method @Deprecated public boolean hasNavMessages();
method @Deprecated public boolean hasSatelliteBlacklist();
method public boolean hasSatelliteBlocklist();
}
+ public static final class GnssCapabilities.Builder {
+ method @NonNull public android.location.GnssCapabilities.Builder setHasGeofencing(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasLowPowerMode(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrections(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsExcessPathLength(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsLosSats(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsReflectingPlane(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasSatelliteBlocklist(boolean);
+ }
+
public final class GnssMeasurementCorrections implements android.os.Parcelable {
method public int describeContents();
method @FloatRange(from=-1000.0F, to=10000.0f) public double getAltitudeMeters();
@@ -4593,68 +4591,6 @@
field @RequiresPermission(android.Manifest.permission.CAPTURE_AUDIO_OUTPUT) public static final int RADIO_TUNER = 1998; // 0x7ce
}
- public final class MediaTranscodeManager {
- method @NonNull public android.media.MediaTranscodeManager.TranscodingSession enqueueRequest(@NonNull android.media.MediaTranscodeManager.TranscodingRequest, @NonNull java.util.concurrent.Executor, @NonNull android.media.MediaTranscodeManager.OnTranscodingFinishedListener) throws java.io.FileNotFoundException, android.media.MediaTranscodingException.ServiceNotAvailableException;
- field public static final int PRIORITY_REALTIME = 1; // 0x1
- field public static final int TRANSCODING_TYPE_VIDEO = 1; // 0x1
- }
-
- @java.lang.FunctionalInterface public static interface MediaTranscodeManager.OnTranscodingFinishedListener {
- method public void onTranscodingFinished(@NonNull android.media.MediaTranscodeManager.TranscodingSession);
- }
-
- public static final class MediaTranscodeManager.TranscodingRequest {
- method public int getClientPid();
- method public int getClientUid();
- method @NonNull public android.net.Uri getDestinationUri();
- method public int getPriority();
- method @NonNull public android.net.Uri getSourceUri();
- method public int getType();
- method @Nullable public android.media.MediaFormat getVideoTrackFormat();
- }
-
- public static final class MediaTranscodeManager.TranscodingRequest.Builder {
- ctor public MediaTranscodeManager.TranscodingRequest.Builder();
- method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest build();
- method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setClientPid(int);
- method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setClientUid(int);
- method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setDestinationUri(@NonNull android.net.Uri);
- method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setPriority(int);
- method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setSourceUri(@NonNull android.net.Uri);
- method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setType(int);
- method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setVideoTrackFormat(@NonNull android.media.MediaFormat);
- }
-
- public static class MediaTranscodeManager.TranscodingRequest.MediaFormatResolver {
- ctor public MediaTranscodeManager.TranscodingRequest.MediaFormatResolver();
- method @Nullable public android.media.MediaFormat resolveVideoFormat();
- method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.MediaFormatResolver setClientCapabilities(@NonNull android.media.ApplicationMediaCapabilities);
- method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.MediaFormatResolver setSourceVideoFormatHint(@NonNull android.media.MediaFormat);
- method public boolean shouldTranscode();
- }
-
- public static final class MediaTranscodeManager.TranscodingSession {
- method public void cancel();
- method @IntRange(from=0, to=100) public int getProgress();
- method public int getResult();
- method public int getSessionId();
- method public int getStatus();
- method public void setOnProgressUpdateListener(@NonNull java.util.concurrent.Executor, @Nullable android.media.MediaTranscodeManager.TranscodingSession.OnProgressUpdateListener);
- method public void setOnProgressUpdateListener(int, @NonNull java.util.concurrent.Executor, @Nullable android.media.MediaTranscodeManager.TranscodingSession.OnProgressUpdateListener);
- field public static final int RESULT_CANCELED = 4; // 0x4
- field public static final int RESULT_ERROR = 3; // 0x3
- field public static final int RESULT_NONE = 1; // 0x1
- field public static final int RESULT_SUCCESS = 2; // 0x2
- field public static final int STATUS_FINISHED = 3; // 0x3
- field public static final int STATUS_PAUSED = 4; // 0x4
- field public static final int STATUS_PENDING = 1; // 0x1
- field public static final int STATUS_RUNNING = 2; // 0x2
- }
-
- @java.lang.FunctionalInterface public static interface MediaTranscodeManager.TranscodingSession.OnProgressUpdateListener {
- method public void onProgressUpdate(@NonNull android.media.MediaTranscodeManager.TranscodingSession, @IntRange(from=0, to=100) int);
- }
-
public class PlayerProxy {
method public void pause();
method public void setPan(float);
@@ -6712,6 +6648,10 @@
method @Deprecated public void onUpstreamChanged(@Nullable android.net.Network);
}
+ public class DnsResolverServiceManager {
+ method @NonNull @RequiresPermission(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) public static android.os.IBinder getService(@NonNull android.content.Context);
+ }
+
public class EthernetManager {
method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public android.net.EthernetManager.TetheredInterfaceRequest requestTetheredInterface(@NonNull java.util.concurrent.Executor, @NonNull android.net.EthernetManager.TetheredInterfaceCallback);
}
@@ -7670,12 +7610,14 @@
method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public android.os.connectivity.WifiBatteryStats getWifiBatteryStats();
method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportFullWifiLockAcquiredFromSource(@NonNull android.os.WorkSource);
method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportFullWifiLockReleasedFromSource(@NonNull android.os.WorkSource);
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportMobileRadioPowerState(boolean, int) throws java.lang.RuntimeException;
method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiBatchedScanStartedFromSource(@NonNull android.os.WorkSource, @IntRange(from=0) int);
method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiBatchedScanStoppedFromSource(@NonNull android.os.WorkSource);
method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiMulticastDisabled(@NonNull android.os.WorkSource);
method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiMulticastEnabled(@NonNull android.os.WorkSource);
method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiOff();
method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiOn();
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiRadioPowerState(boolean, int) throws java.lang.RuntimeException;
method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiRssiChanged(@IntRange(from=0xffffff81, to=0) int);
method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiScanStartedFromSource(@NonNull android.os.WorkSource);
method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiScanStoppedFromSource(@NonNull android.os.WorkSource);
@@ -8062,7 +8004,7 @@
method @RequiresPermission(anyOf={android.Manifest.permission.RECOVERY, android.Manifest.permission.REBOOT}) public static void prepareForUnattendedUpdate(@NonNull android.content.Context, @NonNull String, @Nullable android.content.IntentSender) throws java.io.IOException;
method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void processPackage(android.content.Context, java.io.File, android.os.RecoverySystem.ProgressListener, android.os.Handler) throws java.io.IOException;
method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void processPackage(android.content.Context, java.io.File, android.os.RecoverySystem.ProgressListener) throws java.io.IOException;
- method @RequiresPermission(anyOf={android.Manifest.permission.RECOVERY, android.Manifest.permission.REBOOT}) public static void rebootAndApply(@NonNull android.content.Context, @NonNull String, @NonNull String) throws java.io.IOException;
+ method @Deprecated @RequiresPermission(android.Manifest.permission.RECOVERY) public static void rebootAndApply(@NonNull android.content.Context, @NonNull String, @NonNull String) throws java.io.IOException;
method @RequiresPermission(anyOf={android.Manifest.permission.RECOVERY, android.Manifest.permission.REBOOT}) public static void rebootAndApply(@NonNull android.content.Context, @NonNull String, boolean) throws java.io.IOException;
method @RequiresPermission(allOf={android.Manifest.permission.RECOVERY, android.Manifest.permission.REBOOT}) public static void rebootWipeAb(android.content.Context, java.io.File, String) throws java.io.IOException;
method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void scheduleUpdateOnBoot(android.content.Context, java.io.File) throws java.io.IOException;
@@ -9832,7 +9774,6 @@
method public final void reportPermanentFailure(@NonNull Throwable);
method public final void reportSuggestion(@NonNull android.service.timezone.TimeZoneProviderSuggestion);
method public final void reportUncertain();
- field public static final String BIND_PERMISSION = "android.permission.INSTALL_LOCATION_TIME_ZONE_PROVIDER";
field public static final String PRIMARY_LOCATION_TIME_ZONE_PROVIDER_SERVICE_INTERFACE = "android.service.timezone.PrimaryLocationTimeZoneProviderService";
field public static final String SECONDARY_LOCATION_TIME_ZONE_PROVIDER_SERVICE_INTERFACE = "android.service.timezone.SecondaryLocationTimeZoneProviderService";
}
@@ -11527,6 +11468,7 @@
method public int getPduSessionId();
method public int getProtocolType();
method public long getRetryDurationMillis();
+ method @Nullable public android.telephony.data.SliceInfo getSliceInfo();
method @Deprecated public int getSuggestedRetryTime();
method public void writeToParcel(android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.data.DataCallResponse> CREATOR;
@@ -11561,6 +11503,7 @@
method @NonNull public android.telephony.data.DataCallResponse.Builder setPduSessionId(int);
method @NonNull public android.telephony.data.DataCallResponse.Builder setProtocolType(int);
method @NonNull public android.telephony.data.DataCallResponse.Builder setRetryDurationMillis(long);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setSliceInfo(@Nullable android.telephony.data.SliceInfo);
method @Deprecated @NonNull public android.telephony.data.DataCallResponse.Builder setSuggestedRetryTime(int);
}
@@ -11633,7 +11576,7 @@
method public void setDataProfile(@NonNull java.util.List<android.telephony.data.DataProfile>, boolean, @NonNull android.telephony.data.DataServiceCallback);
method public void setInitialAttachApn(@NonNull android.telephony.data.DataProfile, boolean, @NonNull android.telephony.data.DataServiceCallback);
method public void setupDataCall(int, @NonNull android.telephony.data.DataProfile, boolean, boolean, int, @Nullable android.net.LinkProperties, @NonNull android.telephony.data.DataServiceCallback);
- method public void setupDataCall(int, @NonNull android.telephony.data.DataProfile, boolean, boolean, int, @Nullable android.net.LinkProperties, @IntRange(from=0, to=15) int, @NonNull android.telephony.data.DataServiceCallback);
+ method public void setupDataCall(int, @NonNull android.telephony.data.DataProfile, boolean, boolean, int, @Nullable android.net.LinkProperties, @IntRange(from=0, to=15) int, @Nullable android.telephony.data.SliceInfo, @NonNull android.telephony.data.DataServiceCallback);
method public void startHandover(int, @NonNull android.telephony.data.DataServiceCallback);
}
@@ -11668,6 +11611,32 @@
method public final void updateQualifiedNetworkTypes(int, @NonNull java.util.List<java.lang.Integer>);
}
+ public final class SliceInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @IntRange(from=android.telephony.data.SliceInfo.MIN_SLICE_DIFFERENTIATOR, to=android.telephony.data.SliceInfo.MAX_SLICE_DIFFERENTIATOR) public int getMappedHplmnSliceDifferentiator();
+ method public int getMappedHplmnSliceServiceType();
+ method @IntRange(from=android.telephony.data.SliceInfo.MIN_SLICE_DIFFERENTIATOR, to=android.telephony.data.SliceInfo.MAX_SLICE_DIFFERENTIATOR) public int getSliceDifferentiator();
+ method public int getSliceServiceType();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.data.SliceInfo> CREATOR;
+ field public static final int MAX_SLICE_DIFFERENTIATOR = 16777214; // 0xfffffe
+ field public static final int MIN_SLICE_DIFFERENTIATOR = -1; // 0xffffffff
+ field public static final int SLICE_DIFFERENTIATOR_NO_SLICE = -1; // 0xffffffff
+ field public static final int SLICE_SERVICE_TYPE_EMBB = 1; // 0x1
+ field public static final int SLICE_SERVICE_TYPE_MIOT = 3; // 0x3
+ field public static final int SLICE_SERVICE_TYPE_NONE = 0; // 0x0
+ field public static final int SLICE_SERVICE_TYPE_URLLC = 2; // 0x2
+ }
+
+ public static final class SliceInfo.Builder {
+ ctor public SliceInfo.Builder();
+ method @NonNull public android.telephony.data.SliceInfo build();
+ method @NonNull public android.telephony.data.SliceInfo.Builder setMappedHplmnSliceDifferentiator(@IntRange(from=android.telephony.data.SliceInfo.MIN_SLICE_DIFFERENTIATOR, to=android.telephony.data.SliceInfo.MAX_SLICE_DIFFERENTIATOR) int);
+ method @NonNull public android.telephony.data.SliceInfo.Builder setMappedHplmnSliceServiceType(int);
+ method @NonNull public android.telephony.data.SliceInfo.Builder setSliceDifferentiator(@IntRange(from=android.telephony.data.SliceInfo.MIN_SLICE_DIFFERENTIATOR, to=android.telephony.data.SliceInfo.MAX_SLICE_DIFFERENTIATOR) int);
+ method @NonNull public android.telephony.data.SliceInfo.Builder setSliceServiceType(int);
+ }
+
}
package android.telephony.euicc {
@@ -12113,9 +12082,11 @@
field public static final String EXTRA_CNA = "cna";
field public static final String EXTRA_CNAP = "cnap";
field public static final String EXTRA_CODEC = "Codec";
+ field public static final String EXTRA_CONFERENCE = "android.telephony.ims.extra.CONFERENCE";
field public static final String EXTRA_DIALSTRING = "dialstring";
field public static final String EXTRA_DISPLAY_TEXT = "DisplayText";
field public static final String EXTRA_EMERGENCY_CALL = "e_call";
+ field public static final String EXTRA_EXTENDING_TO_CONFERENCE_SUPPORTED = "android.telephony.ims.extra.EXTENDING_TO_CONFERENCE_SUPPORTED";
field public static final String EXTRA_FORWARDED_NUMBER = "android.telephony.ims.extra.FORWARDED_NUMBER";
field public static final String EXTRA_IS_CALL_PULL = "CallPull";
field public static final String EXTRA_LOCATION = "android.telephony.ims.extra.LOCATION";
@@ -12153,7 +12124,9 @@
method public void callSessionHoldFailed(android.telephony.ims.ImsReasonInfo);
method public void callSessionHoldReceived(android.telephony.ims.ImsCallProfile);
method public void callSessionInitiated(android.telephony.ims.ImsCallProfile);
- method public void callSessionInitiatedFailed(android.telephony.ims.ImsReasonInfo);
+ method @Deprecated public void callSessionInitiatedFailed(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionInitiating(@NonNull android.telephony.ims.ImsCallProfile);
+ method public void callSessionInitiatingFailed(@NonNull android.telephony.ims.ImsReasonInfo);
method public void callSessionInviteParticipantsRequestDelivered();
method public void callSessionInviteParticipantsRequestFailed(android.telephony.ims.ImsReasonInfo);
method @Deprecated public void callSessionMayHandover(int, int);
diff --git a/core/java/android/accessibilityservice/AccessibilityGestureEvent.java b/core/java/android/accessibilityservice/AccessibilityGestureEvent.java
index d4713cb..4b2d741 100644
--- a/core/java/android/accessibilityservice/AccessibilityGestureEvent.java
+++ b/core/java/android/accessibilityservice/AccessibilityGestureEvent.java
@@ -204,7 +204,7 @@
@Override
public String toString() {
StringBuilder stringBuilder = new StringBuilder("AccessibilityGestureEvent[");
- stringBuilder.append("gestureId: ").append(eventTypeToString(mGestureId));
+ stringBuilder.append("gestureId: ").append(gestureIdToString(mGestureId));
stringBuilder.append(", ");
stringBuilder.append("displayId: ").append(mDisplayId);
stringBuilder.append(", ");
@@ -222,8 +222,12 @@
return stringBuilder.toString();
}
- private static String eventTypeToString(int eventType) {
- switch (eventType) {
+ /**
+ * Returns a string representation of the specified gesture id.
+ */
+ @NonNull
+ public static String gestureIdToString(int id) {
+ switch (id) {
case GESTURE_UNKNOWN: return "GESTURE_UNKNOWN";
case GESTURE_PASSTHROUGH: return "GESTURE_PASSTHROUGH";
case GESTURE_TOUCH_EXPLORATION: return "GESTURE_TOUCH_EXPLORATION";
@@ -278,7 +282,7 @@
case GESTURE_4_FINGER_SWIPE_LEFT: return "GESTURE_4_FINGER_SWIPE_LEFT";
case GESTURE_4_FINGER_SWIPE_RIGHT: return "GESTURE_4_FINGER_SWIPE_RIGHT";
case GESTURE_4_FINGER_SWIPE_UP: return "GESTURE_4_FINGER_SWIPE_UP";
- default: return Integer.toHexString(eventType);
+ default: return Integer.toHexString(id);
}
}
diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java
index 8e50184..1fa7fa2 100644
--- a/core/java/android/accessibilityservice/AccessibilityService.java
+++ b/core/java/android/accessibilityservice/AccessibilityService.java
@@ -2120,6 +2120,10 @@
/**
* Sets the strokeWidth and color of the accessibility focus rectangle.
+ * <p>
+ * <strong>Note:</strong> This setting persists until this or another active
+ * AccessibilityService changes it or the device reboots.
+ * </p>
*
* @param strokeWidth The stroke width of the rectangle in pixels.
* Setting this value to zero results in no focus rectangle being drawn.
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 294a363..55df824 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -890,6 +890,9 @@
@UnsupportedAppUsage
final FragmentController mFragments = FragmentController.createController(new HostCallbacks());
+ /** The options for scene transition. */
+ ActivityOptions mPendingOptions;
+
private static final class ManagedCursor {
ManagedCursor(Cursor cursor) {
mCursor = cursor;
@@ -7258,7 +7261,7 @@
}
/**
- * Retrieve the ActivityOptions passed in from the launching activity or passed back
+ * Takes the ActivityOptions passed in from the launching activity or passed back
* from an activity launched by this activity in its call to {@link
* #convertToTranslucent(TranslucentConversionListener, ActivityOptions)}
*
@@ -7267,7 +7270,10 @@
*/
@UnsupportedAppUsage
ActivityOptions getActivityOptions() {
- return ActivityOptions.fromBundle(ActivityClient.getInstance().getActivityOptions(mToken));
+ final ActivityOptions options = mPendingOptions;
+ // The option only applies once.
+ mPendingOptions = null;
+ return options;
}
/**
diff --git a/core/java/android/app/ActivityClient.java b/core/java/android/app/ActivityClient.java
index 64d795c..d465b22 100644
--- a/core/java/android/app/ActivityClient.java
+++ b/core/java/android/app/ActivityClient.java
@@ -237,14 +237,6 @@
}
}
- Bundle getActivityOptions(IBinder token) {
- try {
- return getActivityClientController().getActivityOptions(token);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
public void setRequestedOrientation(IBinder token, int requestedOrientation) {
try {
getActivityClientController().setRequestedOrientation(token, requestedOrientation);
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 6d564a3..2fe1711 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -90,6 +90,7 @@
import android.hardware.display.DisplayManagerGlobal;
import android.inputmethodservice.InputMethodService;
import android.media.MediaFrameworkInitializer;
+import android.media.MediaFrameworkPlatformInitializer;
import android.media.MediaServiceManager;
import android.net.ConnectivityManager;
import android.net.IConnectivityManager;
@@ -492,6 +493,11 @@
Bundle mCoreSettings = null;
+ /**
+ * The lock word for the {@link #mCoreSettings}.
+ */
+ private final Object mCoreSettingsLock = new Object();
+
boolean mHasImeComponent = false;
/** Activity client record, used for bookkeeping for the real {@link Activity} instance. */
@@ -561,6 +567,9 @@
@UnsupportedAppUsage
boolean mPreserveWindow;
+ /** The options for scene transition. */
+ ActivityOptions mActivityOptions;
+
/**
* If non-null, the activity is launching with a specified rotation, the adjustments should
* be consumed before activity creation.
@@ -581,8 +590,8 @@
ActivityInfo info, Configuration overrideConfig, CompatibilityInfo compatInfo,
String referrer, IVoiceInteractor voiceInteractor, Bundle state,
PersistableBundle persistentState, List<ResultInfo> pendingResults,
- List<ReferrerIntent> pendingNewIntents, boolean isForward,
- ProfilerInfo profilerInfo, ClientTransactionHandler client,
+ List<ReferrerIntent> pendingNewIntents, ActivityOptions activityOptions,
+ boolean isForward, ProfilerInfo profilerInfo, ClientTransactionHandler client,
IBinder assistToken, FixedRotationAdjustments fixedRotationAdjustments) {
this.token = token;
this.assistToken = assistToken;
@@ -601,6 +610,7 @@
this.overrideConfig = overrideConfig;
this.packageInfo = client.getPackageInfoNoCheck(activityInfo.applicationInfo,
compatInfo);
+ mActivityOptions = activityOptions;
mPendingFixedRotationAdjustments = fixedRotationAdjustments;
init();
}
@@ -3463,6 +3473,10 @@
activity.setTheme(theme);
}
+ if (r.mActivityOptions != null) {
+ activity.mPendingOptions = r.mActivityOptions;
+ r.mActivityOptions = null;
+ }
activity.mCalled = false;
if (r.isPersistable()) {
mInstrumentation.callActivityOnCreate(activity, r.state, r.persistentState);
@@ -3503,7 +3517,7 @@
@Override
public void handleStartActivity(ActivityClientRecord r,
- PendingTransactionActions pendingActions) {
+ PendingTransactionActions pendingActions, ActivityOptions activityOptions) {
final Activity activity = r.activity;
if (!r.stopped) {
throw new IllegalStateException("Can't start activity that is not stopped.");
@@ -3514,6 +3528,9 @@
}
unscheduleGcIdler();
+ if (activityOptions != null) {
+ activity.mPendingOptions = activityOptions;
+ }
// Start
activity.performStart("handleStartActivity");
@@ -4955,7 +4972,7 @@
}
private void handleSetCoreSettings(Bundle coreSettings) {
- synchronized (mResourcesManager) {
+ synchronized (mCoreSettingsLock) {
mCoreSettings = coreSettings;
}
onCoreSettingsChange();
@@ -4971,6 +4988,8 @@
private boolean updateDebugViewAttributeState() {
boolean previousState = View.sDebugViewAttributes;
+ // mCoreSettings is only updated from the main thread, while this function is only called
+ // from main thread as well, so no need to lock here.
View.sDebugViewAttributesApplicationPackage = mCoreSettings.getString(
Settings.Global.DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE, "");
String currentPackage = (mBoundApplication != null && mBoundApplication.appInfo != null)
@@ -6267,6 +6286,8 @@
}
}
+ // mCoreSettings is only updated from the main thread, while this function is only called
+ // from main thread as well, so no need to lock here.
GraphicsEnvironment.getInstance().setup(context, mCoreSettings);
Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
}
@@ -6448,6 +6469,8 @@
}
updateDefaultDensity();
+ // mCoreSettings is only updated from the main thread, while this function is only called
+ // from main thread as well, so no need to lock here.
final String use24HourSetting = mCoreSettings.getString(Settings.System.TIME_12_24);
Boolean is24Hr = null;
if (use24HourSetting != null) {
@@ -7468,12 +7491,17 @@
}
}
- public Bundle getCoreSettings() {
- return mCoreSettings;
+ /**
+ * Caller should NEVER mutate the Bundle returned from here
+ */
+ Bundle getCoreSettings() {
+ synchronized (mCoreSettingsLock) {
+ return mCoreSettings;
+ }
}
public int getIntCoreSetting(String key, int defaultValue) {
- synchronized (mResourcesManager) {
+ synchronized (mCoreSettingsLock) {
if (mCoreSettings != null) {
return mCoreSettings.getInt(key, defaultValue);
}
@@ -7485,7 +7513,7 @@
* Get the string value of the given key from core settings.
*/
public String getStringCoreSetting(String key, String defaultValue) {
- synchronized (mResourcesManager) {
+ synchronized (mCoreSettingsLock) {
if (mCoreSettings != null) {
return mCoreSettings.getString(key, defaultValue);
}
@@ -7494,7 +7522,7 @@
}
float getFloatCoreSetting(String key, float defaultValue) {
- synchronized (mResourcesManager) {
+ synchronized (mCoreSettingsLock) {
if (mCoreSettings != null) {
return mCoreSettings.getFloat(key, defaultValue);
}
@@ -7701,6 +7729,7 @@
public static void initializeMainlineModules() {
TelephonyFrameworkInitializer.setTelephonyServiceManager(new TelephonyServiceManager());
StatsFrameworkInitializer.setStatsServiceManager(new StatsServiceManager());
+ MediaFrameworkPlatformInitializer.setMediaServiceManager(new MediaServiceManager());
MediaFrameworkInitializer.setMediaServiceManager(new MediaServiceManager());
}
diff --git a/core/java/android/app/ClientTransactionHandler.java b/core/java/android/app/ClientTransactionHandler.java
index ac50676..0e1c827 100644
--- a/core/java/android/app/ClientTransactionHandler.java
+++ b/core/java/android/app/ClientTransactionHandler.java
@@ -164,7 +164,7 @@
/** Perform activity start. */
public abstract void handleStartActivity(@NonNull ActivityClientRecord r,
- PendingTransactionActions pendingActions);
+ PendingTransactionActions pendingActions, ActivityOptions activityOptions);
/** Get package info. */
public abstract LoadedApk getPackageInfoNoCheck(ApplicationInfo ai,
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 124cf71..700d8ff 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -2468,8 +2468,9 @@
return context;
}
+ @NonNull
@Override
- public @NonNull WindowContext createWindowContext(int type, Bundle options) {
+ public WindowContext createWindowContext(int type, @NonNull Bundle options) {
if (getDisplay() == null) {
throw new UnsupportedOperationException("WindowContext can only be created from "
+ "other visual contexts, such as Activity or one created with "
@@ -2478,13 +2479,26 @@
return new WindowContext(this, type, options);
}
- ContextImpl createBaseWindowContext(IBinder token) {
+ @NonNull
+ @Override
+ public WindowContext createWindowContext(@NonNull Display display, int type,
+ @NonNull Bundle options) {
+ if (display == null) {
+ throw new IllegalArgumentException("Display must not be null");
+ }
+ return new WindowContext(this, display, type, options);
+ }
+
+ ContextImpl createBaseWindowContext(IBinder token, Display display) {
ContextImpl context = new ContextImpl(this, mMainThread, mPackageInfo, mAttributionTag,
mSplitName, token, mUser, mFlags, mClassLoader, null);
// Window contexts receive configurations directly from the server and as such do not
// need to override their display in ResourcesManager.
context.mForceDisplayOverrideInResources = false;
context.mContextType = CONTEXT_TYPE_WINDOW_CONTEXT;
+ if (display != null) {
+ context.mDisplay = display;
+ }
return context;
}
diff --git a/core/java/android/app/IActivityClientController.aidl b/core/java/android/app/IActivityClientController.aidl
index e528f94..ebf1027 100644
--- a/core/java/android/app/IActivityClientController.aidl
+++ b/core/java/android/app/IActivityClientController.aidl
@@ -60,7 +60,6 @@
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);
int getRequestedOrientation(in IBinder token);
diff --git a/core/java/android/app/IActivityTaskManager.aidl b/core/java/android/app/IActivityTaskManager.aidl
index 1ac0a65..523c155 100644
--- a/core/java/android/app/IActivityTaskManager.aidl
+++ b/core/java/android/app/IActivityTaskManager.aidl
@@ -191,7 +191,7 @@
*/
IBinder requestStartActivityPermissionToken(in IBinder delegatorToken);
- void releaseSomeActivities(in IApplicationThread app);
+ oneway void releaseSomeActivities(in IApplicationThread app);
Bitmap getTaskDescriptionIcon(in String filename, int userId);
void registerTaskStackListener(in ITaskStackListener listener);
void unregisterTaskStackListener(in ITaskStackListener listener);
diff --git a/core/java/android/app/INotificationManager.aidl b/core/java/android/app/INotificationManager.aidl
index a8ce73d..697a377 100644
--- a/core/java/android/app/INotificationManager.aidl
+++ b/core/java/android/app/INotificationManager.aidl
@@ -35,6 +35,7 @@
import android.service.notification.IConditionListener;
import android.service.notification.IConditionProvider;
import android.service.notification.INotificationListener;
+import android.service.notification.NotificationListenerFilter;
import android.service.notification.StatusBarNotification;
import android.app.AutomaticZenRule;
import android.service.notification.ZenModeConfig;
@@ -224,4 +225,7 @@
boolean getPrivateNotificationsAllowed();
long pullStats(long startNs, int report, boolean doAgg, out List<ParcelFileDescriptor> stats);
+
+ NotificationListenerFilter getListenerFilter(in ComponentName cn, int userId);
+ void setListenerFilter(in ComponentName cn, int userId, in NotificationListenerFilter nlf);
}
diff --git a/core/java/android/app/LoadedApk.java b/core/java/android/app/LoadedApk.java
index 99785e1..50853a3 100644
--- a/core/java/android/app/LoadedApk.java
+++ b/core/java/android/app/LoadedApk.java
@@ -729,6 +729,23 @@
}
}
+ private StrictMode.VmPolicy allowVmViolations() {
+ if (mActivityThread == null) {
+ // When LoadedApk is used without an ActivityThread (usually in a
+ // zygote context), don't call into StrictMode, as it initializes
+ // the binder subsystem, which we don't want.
+ return null;
+ }
+
+ return StrictMode.allowVmViolations();
+ }
+
+ private void setVmPolicy(StrictMode.VmPolicy policy) {
+ if (mActivityThread != null && policy != null) {
+ StrictMode.setVmPolicy(policy);
+ }
+ }
+
private void createOrUpdateClassLoaderLocked(List<String> addedPaths) {
if (mPackageName.equals("android")) {
// Note: This branch is taken for system server and we don't need to setup
@@ -984,13 +1001,20 @@
// Temporarily disable logging of disk reads on the Looper thread as this is necessary -
// and the loader will access the directory anyway if we don't check it.
- StrictMode.ThreadPolicy oldPolicy = allowThreadDiskReads();
+ StrictMode.ThreadPolicy oldThreadPolicy = allowThreadDiskReads();
+
+ // Also disable logging of access to /data/user before CE storage is unlocked. The check
+ // below will return false (because the directory name we pass will not match the
+ // encrypted one), but that's correct.
+ StrictMode.VmPolicy oldVmPolicy = allowVmViolations();
+
try {
// We are constructing a classloader for a different package. It is likely,
// but not certain, that we can't acccess its app data dir - so check.
return new File(mDataDir).canExecute();
} finally {
- setThreadPolicy(oldPolicy);
+ setThreadPolicy(oldThreadPolicy);
+ setVmPolicy(oldVmPolicy);
}
}
diff --git a/core/java/android/app/LocalActivityManager.java b/core/java/android/app/LocalActivityManager.java
index 2e7c9f1..74e6125 100644
--- a/core/java/android/app/LocalActivityManager.java
+++ b/core/java/android/app/LocalActivityManager.java
@@ -178,7 +178,8 @@
pendingActions = null;
}
- mActivityThread.handleStartActivity(clientRecord, pendingActions);
+ mActivityThread.handleStartActivity(clientRecord, pendingActions,
+ null /* activityOptions */);
r.curState = STARTED;
if (desiredState == RESUMED) {
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index c528588..8242e4d 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -37,6 +37,7 @@
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
+import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.LocusId;
@@ -5146,6 +5147,11 @@
contentView.setViewVisibility(R.id.right_icon, View.VISIBLE);
contentView.setImageViewIcon(R.id.right_icon, mN.mLargeIcon);
processLargeLegacyIcon(mN.mLargeIcon, contentView, p);
+ } else {
+ // The "reset" doesn't clear the drawable, so we do it here. This clear is
+ // important because the presence of a drawable in this view (regardless of the
+ // visibility) is used by NotificationGroupingUtil to set the visibility.
+ contentView.setImageViewIcon(R.id.right_icon, null);
}
return showLargeIcon;
}
@@ -5525,9 +5531,17 @@
return result;
}
+ // This code is executed on behalf of other apps' notifications, sometimes even by 3p apps,
+ // a use case that is not supported by the Compat Framework library. Workarounds to resolve
+ // the change's state in NotificationManagerService were very complex. While it's possible
+ // apps can detect the change, it's most likely that the changes will simply result in
+ // visual regressions.
+ @SuppressWarnings("AndroidFrameworkCompatChange")
private boolean bigContentViewRequired() {
+ if (mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.S) {
+ return true;
+ }
// If the big content view has no content, we can exempt the app from having to show it.
- // TODO(b/173550917): add an UNDO style then force this requirement on apps targeting S
boolean exempt = mN.contentView != null && mN.bigContentView == null
&& mStyle == null && mActions.size() == 0
&& mN.extras.getCharSequence(EXTRA_TITLE) == null
@@ -11198,4 +11212,33 @@
return this;
}
}
+
+ /**
+ * A class to centrally access various developer flags related to notifications.
+ * This class is a non-final wrapper around Settings.Global which allows mocking for unit tests.
+ * TODO(b/176239013): Try to remove this before shipping S
+ * @hide
+ */
+ public static class DevFlags {
+ private static final boolean DEFAULT_BACKPORT_S_NOTIF_RULES = false;
+
+ /**
+ * Used by unit tests to force that this class returns its default values, which is required
+ * in cases where the ContentResolver instance is a mock.
+ * @hide
+ */
+ public static boolean sForceDefaults;
+
+ /**
+ * @return if the S notification rules should be backported to apps not yet targeting S
+ * @hide
+ */
+ public static boolean shouldBackportSNotifRules(@NonNull ContentResolver contentResolver) {
+ if (sForceDefaults) {
+ return DEFAULT_BACKPORT_S_NOTIF_RULES;
+ }
+ return Settings.Global.getInt(contentResolver, Settings.Global.BACKPORT_S_NOTIF_RULES,
+ DEFAULT_BACKPORT_S_NOTIF_RULES ? 1 : 0) == 1;
+ }
+ }
}
diff --git a/core/java/android/app/PendingIntent.java b/core/java/android/app/PendingIntent.java
index 9dbf1ff6..b8b9d9f 100644
--- a/core/java/android/app/PendingIntent.java
+++ b/core/java/android/app/PendingIntent.java
@@ -352,7 +352,9 @@
if (Compatibility.isChangeEnabled(PENDING_INTENT_EXPLICIT_MUTABILITY_REQUIRED)
&& !flagImmutableSet && !flagMutableSet) {
- Log.e(TAG, msg);
+ Log.wtf(TAG, msg);
+ throw new IllegalArgumentException(
+ "Please specify an explicit mutability flag (FLAG_IMMUTABLE or FLAG_MUTABLE)");
}
}
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index 4afbfbf..ae1c894 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -104,8 +104,8 @@
import android.location.LocationManager;
import android.media.AudioManager;
import android.media.MediaFrameworkInitializer;
+import android.media.MediaFrameworkPlatformInitializer;
import android.media.MediaRouter;
-import android.media.MediaTranscodeManager;
import android.media.midi.IMidiManager;
import android.media.midi.MidiManager;
import android.media.musicrecognition.IMusicRecognitionManager;
@@ -312,15 +312,6 @@
return new AudioManager(ctx);
}});
- registerService(Context.MEDIA_TRANSCODING_SERVICE, MediaTranscodeManager.class,
- new CachedServiceFetcher<MediaTranscodeManager>() {
- @Override
- public MediaTranscodeManager createService(ContextImpl ctx)
- throws ServiceNotFoundException {
- return new MediaTranscodeManager(ctx);
- }
- });
-
registerService(Context.MEDIA_ROUTER_SERVICE, MediaRouter.class,
new CachedServiceFetcher<MediaRouter>() {
@Override
@@ -1401,6 +1392,7 @@
WifiFrameworkInitializer.registerServiceWrappers();
StatsFrameworkInitializer.registerServiceWrappers();
RollbackManagerFrameworkInitializer.initialize();
+ MediaFrameworkPlatformInitializer.registerServiceWrappers();
MediaFrameworkInitializer.registerServiceWrappers();
} finally {
// If any of the above code throws, we're in a pretty bad shape and the process
@@ -1727,7 +1719,7 @@
synchronized (cache) {
// Return it if we already have a cached instance.
T service = (T) cache[mCacheIndex];
- if (service != null || gates[mCacheIndex] == ContextImpl.STATE_NOT_FOUND) {
+ if (service != null) {
ret = service;
break; // exit the for (;;)
}
@@ -1737,7 +1729,9 @@
// Grr... if gate is STATE_READY, then this means we initialized the service
// once but someone cleared it.
// We start over from STATE_UNINITIALIZED.
- if (gates[mCacheIndex] == ContextImpl.STATE_READY) {
+ // Similarly, if the previous attempt returned null, we'll retry again.
+ if (gates[mCacheIndex] == ContextImpl.STATE_READY
+ || gates[mCacheIndex] == ContextImpl.STATE_NOT_FOUND) {
gates[mCacheIndex] = ContextImpl.STATE_UNINITIALIZED;
}
diff --git a/core/java/android/app/WindowContext.java b/core/java/android/app/WindowContext.java
index 5f72bac..14ed414 100644
--- a/core/java/android/app/WindowContext.java
+++ b/core/java/android/app/WindowContext.java
@@ -26,6 +26,7 @@
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
+import android.view.Display;
import android.view.IWindowManager;
import android.view.WindowManagerGlobal;
import android.view.WindowManagerImpl;
@@ -59,13 +60,27 @@
* @hide
*/
public WindowContext(@NonNull Context base, int type, @Nullable Bundle options) {
+ this(base, null /* display */, type, options);
+ }
+
+ /**
+ * Default constructor. Will generate a {@link WindowTokenClient} and attach this context to
+ * the token.
+ *
+ * @param base Base {@link Context} for this new instance.
+ * @param display the {@link Display} to override.
+ * @param type Window type to be used with this context.
+ * @hide
+ */
+ public WindowContext(@NonNull Context base, @Nullable Display display, int type,
+ @Nullable Bundle options) {
// Correct base context will be built once the token is resolved, so passing 'null' here.
super(null /* base */);
mWms = WindowManagerGlobal.getWindowManagerService();
mToken = new WindowTokenClient();
- final ContextImpl contextImpl = createBaseWindowContext(base, mToken);
+ final ContextImpl contextImpl = createBaseWindowContext(base, mToken, display);
attachBaseContext(contextImpl);
contextImpl.setOuterContext(this);
@@ -93,9 +108,10 @@
Reference.reachabilityFence(this);
}
- private static ContextImpl createBaseWindowContext(Context outer, IBinder token) {
+ private static ContextImpl createBaseWindowContext(Context outer, IBinder token,
+ Display display) {
final ContextImpl contextImpl = ContextImpl.getImpl(outer);
- return contextImpl.createBaseWindowContext(token);
+ return contextImpl.createBaseWindowContext(token, display);
}
@Override
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 02c12b9..4d0b90b 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -54,7 +54,6 @@
import android.content.pm.ParceledListSlice;
import android.content.pm.UserInfo;
import android.graphics.Bitmap;
-import android.net.NetworkUtils;
import android.net.PrivateDnsConnectivityChecker;
import android.net.ProxyInfo;
import android.net.Uri;
@@ -92,6 +91,7 @@
import android.util.Log;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.net.NetworkUtilsInternal;
import com.android.internal.os.BackgroundThread;
import com.android.internal.util.Preconditions;
import com.android.org.conscrypt.TrustedCertificateStore;
@@ -3886,6 +3886,51 @@
}
/**
+ * Called by profile owner of a managed profile to determine whether the current device password
+ * meets policy requirements set explicitly device-wide.
+ * <p> This API is similar to {@link #isActivePasswordSufficient()}, with two notable
+ * differences:
+ * <ul>
+ * <li>this API always targets the device password. As a result it should always be called on
+ * the {@link #getParentProfileInstance(ComponentName)} instance.</li>
+ * <li>password policy requirement set on the managed profile is not taken into consideration
+ * by this API, even if the device currently does not have a separate work challenge set.</li>
+ * </ul>
+ *
+ * <p>This API is designed to facilite progressive password enrollment flows when the DPC
+ * imposes both device and profile password policies. DPC applies profile password policy by
+ * calling {@link #setPasswordQuality(ComponentName, int)} or
+ * {@link #setRequiredPasswordComplexity} on the regular {@link DevicePolicyManager} instance,
+ * while it applies device-wide policy by calling {@link #setRequiredPasswordComplexity} on the
+ * {@link #getParentProfileInstance(ComponentName)} instance. The DPC can utilize this check to
+ * guide the user to set a device password first taking into consideration the device-wide
+ * policy only, and then prompt the user to either upgrade it to be fully compliant, or enroll a
+ * separate work challenge to satisfy the profile password policy only.
+ *
+ * <p>The device user must be unlocked (@link {@link UserManager#isUserUnlocked(UserHandle)})
+ * to perform this check.
+ *
+ * @return {@code true} if the device password meets explicit requirement set on it,
+ * {@code false} otherwise.
+ * @throws SecurityException if the calling application is not a profile owner of a managed
+ * profile, or if this API is not called on the parent DevicePolicyManager instance.
+ * @throws IllegalStateException if the user isn't unlocked
+ */
+ public boolean isActivePasswordSufficientForDeviceRequirement() {
+ if (!mParentInstance) {
+ throw new SecurityException("only callable on the parent instance");
+ }
+ if (mService != null) {
+ try {
+ return mService.isActivePasswordSufficientForDeviceRequirement();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+ return false;
+ }
+
+ /**
* Returns how complex the current user's screen lock is.
*
* <p>Note that when called from a profile which uses an unified challenge with its parent, the
@@ -11985,7 +12030,7 @@
return PRIVATE_DNS_SET_ERROR_FAILURE_SETTING;
}
- if (NetworkUtils.isWeaklyValidatedHostname(privateDnsHost)) {
+ if (NetworkUtilsInternal.isWeaklyValidatedHostname(privateDnsHost)) {
if (!PrivateDnsConnectivityChecker.canConnectToPrivateDnsServer(privateDnsHost)) {
return PRIVATE_DNS_SET_ERROR_HOST_NOT_SERVING;
}
diff --git a/core/java/android/app/admin/DevicePolicyManagerInternal.java b/core/java/android/app/admin/DevicePolicyManagerInternal.java
index a0d2977..ce2fd4f 100644
--- a/core/java/android/app/admin/DevicePolicyManagerInternal.java
+++ b/core/java/android/app/admin/DevicePolicyManagerInternal.java
@@ -231,13 +231,7 @@
* Returns the profile owner component for the given user, or {@code null} if there is not one.
*/
@Nullable
- public abstract ComponentName getProfileOwnerAsUser(@UserIdInt int userId);
-
- /**
- * Returns the user id of the device owner, or {@link UserHandle#USER_NULL} if there is not one.
- */
- @UserIdInt
- public abstract int getDeviceOwnerUserId();
+ public abstract ComponentName getProfileOwnerAsUser(int userHandle);
/**
* Returns whether the given package is a device owner or a profile owner in the calling user.
diff --git a/core/java/android/app/admin/IDevicePolicyManager.aidl b/core/java/android/app/admin/IDevicePolicyManager.aidl
index bcc90f7..4b87bb9 100644
--- a/core/java/android/app/admin/IDevicePolicyManager.aidl
+++ b/core/java/android/app/admin/IDevicePolicyManager.aidl
@@ -84,6 +84,7 @@
long getPasswordExpiration(in ComponentName who, int userHandle, boolean parent);
boolean isActivePasswordSufficient(int userHandle, boolean parent);
+ boolean isActivePasswordSufficientForDeviceRequirement();
boolean isProfileActivePasswordSufficientForParent(int userHandle);
boolean isPasswordSufficientAfterProfileUnification(int userHandle, int profileUser);
int getPasswordComplexity(boolean parent);
diff --git a/core/java/android/app/people/OWNERS b/core/java/android/app/people/OWNERS
new file mode 100644
index 0000000..7371a88
--- /dev/null
+++ b/core/java/android/app/people/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 978868
+
+danningc@google.com
+juliacr@google.com
\ No newline at end of file
diff --git a/core/java/android/app/role/IRoleController.aidl b/core/java/android/app/role/IRoleController.aidl
index fbf79a4..8a43d7f 100644
--- a/core/java/android/app/role/IRoleController.aidl
+++ b/core/java/android/app/role/IRoleController.aidl
@@ -16,9 +16,7 @@
package android.app.role;
-import android.app.role.RolePrivileges;
import android.os.RemoteCallback;
-import com.android.internal.infra.AndroidFuture;
/**
* @hide
@@ -42,6 +40,4 @@
in RemoteCallback callback);
void isRoleVisible(in String roleName, in RemoteCallback callback);
-
- void getRolePrivileges(in String roleName, in AndroidFuture<RolePrivileges> callback);
}
diff --git a/core/java/android/app/role/RoleControllerService.java b/core/java/android/app/role/RoleControllerService.java
index 4c6aa8d..d92c956 100644
--- a/core/java/android/app/role/RoleControllerService.java
+++ b/core/java/android/app/role/RoleControllerService.java
@@ -16,8 +16,6 @@
package android.app.role;
-import static java.util.Collections.emptyList;
-
import android.Manifest;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -34,7 +32,6 @@
import android.os.RemoteCallback;
import android.os.UserHandle;
-import com.android.internal.infra.AndroidFuture;
import com.android.internal.util.Preconditions;
import com.android.internal.util.function.pooled.PooledLambda;
@@ -180,20 +177,6 @@
boolean visible = onIsRoleVisible(roleName);
callback.sendResult(visible ? Bundle.EMPTY : null);
}
-
- @Override
- public void getRolePrivileges(String roleName, AndroidFuture<RolePrivileges> callback) {
- enforceCallingPermission(Manifest.permission.MANAGE_ROLE_HOLDERS, null);
-
- Preconditions.checkStringNotEmpty(roleName, "roleName cannot be null or empty");
- Objects.requireNonNull(callback, "callback cannot be null");
-
- try {
- callback.complete(RoleControllerService.this.getRolePrivileges(roleName));
- } catch (Throwable t) {
- callback.completeExceptionally(t);
- }
- }
};
}
@@ -319,14 +302,4 @@
* @return whether the role should be visible to user
*/
public abstract boolean onIsRoleVisible(@NonNull String roleName);
-
- /**
- * Queries the {@link RolePrivileges privileges} that the given role grants.
- *
- * @param roleName name of the role to quey for
- * @return the {@link RolePrivileges} for the role
- */
- public @NonNull RolePrivileges getRolePrivileges(@NonNull String roleName) {
- return new RolePrivileges(emptyList(), emptyList(), emptyList(), emptyList());
- }
}
diff --git a/core/java/android/app/role/RolePrivileges.java b/core/java/android/app/role/RolePrivileges.java
deleted file mode 100644
index 5fc0b0a08..0000000
--- a/core/java/android/app/role/RolePrivileges.java
+++ /dev/null
@@ -1,221 +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 android.app.role;
-
-import android.annotation.NonNull;
-import android.annotation.SystemApi;
-import android.os.Parcelable;
-
-import com.android.internal.util.DataClass;
-
-import java.util.List;
-
-/**
- * Describes a set of privileges granted by a {@link RoleManager role}
- *
- * @hide
- */
-@SystemApi
-@DataClass
-public final class RolePrivileges implements Parcelable {
-
- /**
- * An identifier of a role holder app being granted the
- * {@link android.service.notification.NotificationListenerService Notification Access}
- * privilege.
- */
- public static final String CAPABILITY_NOTIFICATION_LISTENER =
- "android.app.role.capability.NOTIFICATION_LISTENER";
-
- /**
- * Permissions granted to the role holder(s).
- */
- private @NonNull List<String> mPermissions;
- /**
- * Appop permissions granted to the role holder(s).
- */
- private @NonNull List<String> mAppOpPermissions;
- /**
- * Appops granted to the role holder(s).
- */
- private @NonNull List<String> mAppOps;
- /**
- * Special access granted to the role holder(s).
- *
- * @see #CAPABILITY_NOTIFICATION_LISTENER
- */
- private @NonNull List<String> mCapabilities;
-
-
-
- // Code below generated by codegen v1.0.22.
- //
- // DO NOT MODIFY!
- // CHECKSTYLE:OFF Generated code
- //
- // To regenerate run:
- // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/app/role/RolePrivileges.java
- //
- // To exclude the generated code from IntelliJ auto-formatting enable (one-time):
- // Settings > Editor > Code Style > Formatter Control
- //@formatter:off
-
-
- /**
- * Creates a new RolePrivileges.
- *
- * @param permissions
- * Permissions granted to the role holder(s).
- * @param appOpPermissions
- * Appop permissions granted to the role holder(s).
- * @param appOps
- * Appops granted to the role holder(s).
- * @param capabilities
- * Special access granted to the role holder(s).
- */
- @DataClass.Generated.Member
- public RolePrivileges(
- @NonNull List<String> permissions,
- @NonNull List<String> appOpPermissions,
- @NonNull List<String> appOps,
- @NonNull List<String> capabilities) {
- this.mPermissions = permissions;
- com.android.internal.util.AnnotationValidations.validate(
- NonNull.class, null, mPermissions);
- this.mAppOpPermissions = appOpPermissions;
- com.android.internal.util.AnnotationValidations.validate(
- NonNull.class, null, mAppOpPermissions);
- this.mAppOps = appOps;
- com.android.internal.util.AnnotationValidations.validate(
- NonNull.class, null, mAppOps);
- this.mCapabilities = capabilities;
- com.android.internal.util.AnnotationValidations.validate(
- NonNull.class, null, mCapabilities);
-
- // onConstructed(); // You can define this method to get a callback
- }
-
- /**
- * Permissions granted to the role holder(s).
- */
- @DataClass.Generated.Member
- public @NonNull List<String> getPermissions() {
- return mPermissions;
- }
-
- /**
- * Appop permissions granted to the role holder(s).
- */
- @DataClass.Generated.Member
- public @NonNull List<String> getAppOpPermissions() {
- return mAppOpPermissions;
- }
-
- /**
- * Appops granted to the role holder(s).
- */
- @DataClass.Generated.Member
- public @NonNull List<String> getAppOps() {
- return mAppOps;
- }
-
- /**
- * Special access granted to the role holder(s).
- *
- * @see #CAPABILITY_NOTIFICATION_LISTENER
- */
- @DataClass.Generated.Member
- public @NonNull List<String> getCapabilities() {
- return mCapabilities;
- }
-
- @Override
- @DataClass.Generated.Member
- public void writeToParcel(@NonNull android.os.Parcel dest, int flags) {
- // You can override field parcelling by defining methods like:
- // void parcelFieldName(Parcel dest, int flags) { ... }
-
- dest.writeStringList(mPermissions);
- dest.writeStringList(mAppOpPermissions);
- dest.writeStringList(mAppOps);
- dest.writeStringList(mCapabilities);
- }
-
- @Override
- @DataClass.Generated.Member
- public int describeContents() { return 0; }
-
- /** @hide */
- @SuppressWarnings({"unchecked", "RedundantCast"})
- @DataClass.Generated.Member
- /* package-private */ RolePrivileges(@NonNull android.os.Parcel in) {
- // You can override field unparcelling by defining methods like:
- // static FieldType unparcelFieldName(Parcel in) { ... }
-
- List<String> permissions = new java.util.ArrayList<>();
- in.readStringList(permissions);
- List<String> appOpPermissions = new java.util.ArrayList<>();
- in.readStringList(appOpPermissions);
- List<String> appOps = new java.util.ArrayList<>();
- in.readStringList(appOps);
- List<String> capabilities = new java.util.ArrayList<>();
- in.readStringList(capabilities);
-
- this.mPermissions = permissions;
- com.android.internal.util.AnnotationValidations.validate(
- NonNull.class, null, mPermissions);
- this.mAppOpPermissions = appOpPermissions;
- com.android.internal.util.AnnotationValidations.validate(
- NonNull.class, null, mAppOpPermissions);
- this.mAppOps = appOps;
- com.android.internal.util.AnnotationValidations.validate(
- NonNull.class, null, mAppOps);
- this.mCapabilities = capabilities;
- com.android.internal.util.AnnotationValidations.validate(
- NonNull.class, null, mCapabilities);
-
- // onConstructed(); // You can define this method to get a callback
- }
-
- @DataClass.Generated.Member
- public static final @NonNull Parcelable.Creator<RolePrivileges> CREATOR
- = new Parcelable.Creator<RolePrivileges>() {
- @Override
- public RolePrivileges[] newArray(int size) {
- return new RolePrivileges[size];
- }
-
- @Override
- public RolePrivileges createFromParcel(@NonNull android.os.Parcel in) {
- return new RolePrivileges(in);
- }
- };
-
- @DataClass.Generated(
- time = 1607546429137L,
- codegenVersion = "1.0.22",
- sourceFile = "frameworks/base/core/java/android/app/role/RolePrivileges.java",
- inputSignatures = "public static final java.lang.String CAPABILITY_NOTIFICATION_LISTENER\nprivate @android.annotation.NonNull java.util.List<java.lang.String> mPermissions\nprivate @android.annotation.NonNull java.util.List<java.lang.String> mAppOpPermissions\nprivate @android.annotation.NonNull java.util.List<java.lang.String> mAppOps\nprivate @android.annotation.NonNull java.util.List<java.lang.String> mCapabilities\nclass RolePrivileges extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass")
- @Deprecated
- private void __metadata() {}
-
-
- //@formatter:on
- // End of generated code
-
-}
diff --git a/core/java/android/app/servertransaction/LaunchActivityItem.java b/core/java/android/app/servertransaction/LaunchActivityItem.java
index 3758cb4..73a9cec 100644
--- a/core/java/android/app/servertransaction/LaunchActivityItem.java
+++ b/core/java/android/app/servertransaction/LaunchActivityItem.java
@@ -21,6 +21,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.ActivityClient;
+import android.app.ActivityOptions;
import android.app.ActivityThread.ActivityClientRecord;
import android.app.ClientTransactionHandler;
import android.app.IActivityClientController;
@@ -66,6 +67,7 @@
private PersistableBundle mPersistentState;
private List<ResultInfo> mPendingResults;
private List<ReferrerIntent> mPendingNewIntents;
+ private ActivityOptions mActivityOptions;
private boolean mIsForward;
private ProfilerInfo mProfilerInfo;
private IBinder mAssistToken;
@@ -92,8 +94,8 @@
Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "activityStart");
ActivityClientRecord r = new ActivityClientRecord(token, mIntent, mIdent, mInfo,
mOverrideConfig, mCompatInfo, mReferrer, mVoiceInteractor, mState, mPersistentState,
- mPendingResults, mPendingNewIntents, mIsForward,
- mProfilerInfo, client, mAssistToken, mFixedRotationAdjustments);
+ mPendingResults, mPendingNewIntents, mActivityOptions, mIsForward, mProfilerInfo,
+ client, mAssistToken, mFixedRotationAdjustments);
client.handleLaunchActivity(r, pendingActions, null /* customIntent */);
Trace.traceEnd(TRACE_TAG_ACTIVITY_MANAGER);
}
@@ -114,8 +116,9 @@
Configuration curConfig, Configuration overrideConfig, CompatibilityInfo compatInfo,
String referrer, IVoiceInteractor voiceInteractor, int procState, Bundle state,
PersistableBundle persistentState, List<ResultInfo> pendingResults,
- List<ReferrerIntent> pendingNewIntents, boolean isForward, ProfilerInfo profilerInfo,
- IBinder assistToken, IActivityClientController activityClientController,
+ List<ReferrerIntent> pendingNewIntents, ActivityOptions activityOptions,
+ boolean isForward, ProfilerInfo profilerInfo, IBinder assistToken,
+ IActivityClientController activityClientController,
FixedRotationAdjustments fixedRotationAdjustments) {
LaunchActivityItem instance = ObjectPool.obtain(LaunchActivityItem.class);
if (instance == null) {
@@ -123,8 +126,8 @@
}
setValues(instance, intent, ident, info, curConfig, overrideConfig, compatInfo, referrer,
voiceInteractor, procState, state, persistentState, pendingResults,
- pendingNewIntents, isForward, profilerInfo, assistToken, activityClientController,
- fixedRotationAdjustments);
+ pendingNewIntents, activityOptions, isForward, profilerInfo, assistToken,
+ activityClientController, fixedRotationAdjustments);
return instance;
}
@@ -132,7 +135,7 @@
@Override
public void recycle() {
setValues(this, null, 0, null, null, null, null, null, null, 0, null, null, null, null,
- false, null, null, null, null);
+ null, false, null, null, null, null);
ObjectPool.recycle(this);
}
@@ -155,6 +158,7 @@
dest.writePersistableBundle(mPersistentState);
dest.writeTypedList(mPendingResults, flags);
dest.writeTypedList(mPendingNewIntents, flags);
+ dest.writeBundle(mActivityOptions != null ? mActivityOptions.toBundle() : null);
dest.writeBoolean(mIsForward);
dest.writeTypedObject(mProfilerInfo, flags);
dest.writeStrongBinder(mAssistToken);
@@ -172,7 +176,8 @@
in.readBundle(getClass().getClassLoader()),
in.readPersistableBundle(getClass().getClassLoader()),
in.createTypedArrayList(ResultInfo.CREATOR),
- in.createTypedArrayList(ReferrerIntent.CREATOR), in.readBoolean(),
+ in.createTypedArrayList(ReferrerIntent.CREATOR),
+ ActivityOptions.fromBundle(in.readBundle()), in.readBoolean(),
in.readTypedObject(ProfilerInfo.CREATOR),
in.readStrongBinder(),
IActivityClientController.Stub.asInterface(in.readStrongBinder()),
@@ -210,6 +215,7 @@
&& areBundlesEqualRoughly(mPersistentState, other.mPersistentState)
&& Objects.equals(mPendingResults, other.mPendingResults)
&& Objects.equals(mPendingNewIntents, other.mPendingNewIntents)
+ && (mActivityOptions == null) == (other.mActivityOptions == null)
&& mIsForward == other.mIsForward
&& Objects.equals(mProfilerInfo, other.mProfilerInfo)
&& Objects.equals(mAssistToken, other.mAssistToken)
@@ -230,6 +236,7 @@
result = 31 * result + getRoughBundleHashCode(mPersistentState);
result = 31 * result + Objects.hashCode(mPendingResults);
result = 31 * result + Objects.hashCode(mPendingNewIntents);
+ result = 31 * result + (mActivityOptions != null ? 1 : 0);
result = 31 * result + (mIsForward ? 1 : 0);
result = 31 * result + Objects.hashCode(mProfilerInfo);
result = 31 * result + Objects.hashCode(mAssistToken);
@@ -268,9 +275,9 @@
+ ",curConfig=" + mCurConfig + ",overrideConfig=" + mOverrideConfig
+ ",referrer=" + mReferrer + ",procState=" + mProcState + ",state=" + mState
+ ",persistentState=" + mPersistentState + ",pendingResults=" + mPendingResults
- + ",pendingNewIntents=" + mPendingNewIntents + ",profilerInfo=" + mProfilerInfo
- + ",assistToken=" + mAssistToken + ",rotationAdj=" + mFixedRotationAdjustments
- + "}";
+ + ",pendingNewIntents=" + mPendingNewIntents + ",options=" + mActivityOptions
+ + ",profilerInfo=" + mProfilerInfo + ",assistToken=" + mAssistToken
+ + ",rotationAdj=" + mFixedRotationAdjustments + "}";
}
// Using the same method to set and clear values to make sure we don't forget anything
@@ -279,8 +286,8 @@
CompatibilityInfo compatInfo, String referrer, IVoiceInteractor voiceInteractor,
int procState, Bundle state, PersistableBundle persistentState,
List<ResultInfo> pendingResults, List<ReferrerIntent> pendingNewIntents,
- boolean isForward, ProfilerInfo profilerInfo, IBinder assistToken,
- IActivityClientController activityClientController,
+ ActivityOptions activityOptions, boolean isForward, ProfilerInfo profilerInfo,
+ IBinder assistToken, IActivityClientController activityClientController,
FixedRotationAdjustments fixedRotationAdjustments) {
instance.mIntent = intent;
instance.mIdent = ident;
@@ -295,6 +302,7 @@
instance.mPersistentState = persistentState;
instance.mPendingResults = pendingResults;
instance.mPendingNewIntents = pendingNewIntents;
+ instance.mActivityOptions = activityOptions;
instance.mIsForward = isForward;
instance.mProfilerInfo = profilerInfo;
instance.mAssistToken = assistToken;
diff --git a/core/java/android/app/servertransaction/StartActivityItem.java b/core/java/android/app/servertransaction/StartActivityItem.java
index 483f9de..15f65f6 100644
--- a/core/java/android/app/servertransaction/StartActivityItem.java
+++ b/core/java/android/app/servertransaction/StartActivityItem.java
@@ -20,6 +20,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.app.ActivityOptions;
import android.app.ActivityThread.ActivityClientRecord;
import android.app.ClientTransactionHandler;
import android.os.Parcel;
@@ -33,11 +34,13 @@
private static final String TAG = "StartActivityItem";
+ private ActivityOptions mActivityOptions;
+
@Override
public void execute(ClientTransactionHandler client, ActivityClientRecord r,
PendingTransactionActions pendingActions) {
Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "startActivityItem");
- client.handleStartActivity(r, pendingActions);
+ client.handleStartActivity(r, pendingActions, mActivityOptions);
Trace.traceEnd(TRACE_TAG_ACTIVITY_MANAGER);
}
@@ -52,11 +55,12 @@
private StartActivityItem() {}
/** Obtain an instance initialized with provided params. */
- public static StartActivityItem obtain() {
+ public static StartActivityItem obtain(ActivityOptions activityOptions) {
StartActivityItem instance = ObjectPool.obtain(StartActivityItem.class);
if (instance == null) {
instance = new StartActivityItem();
}
+ instance.mActivityOptions = activityOptions;
return instance;
}
@@ -64,6 +68,7 @@
@Override
public void recycle() {
super.recycle();
+ mActivityOptions = null;
ObjectPool.recycle(this);
}
@@ -73,12 +78,12 @@
/** Write to Parcel. */
@Override
public void writeToParcel(Parcel dest, int flags) {
- // Empty
+ dest.writeBundle(mActivityOptions != null ? mActivityOptions.toBundle() : null);
}
/** Read from Parcel. */
private StartActivityItem(Parcel in) {
- // Empty
+ mActivityOptions = ActivityOptions.fromBundle(in.readBundle());
}
public static final @NonNull Creator<StartActivityItem> CREATOR =
@@ -100,17 +105,20 @@
if (o == null || getClass() != o.getClass()) {
return false;
}
- return true;
+ final StartActivityItem other = (StartActivityItem) o;
+ return (mActivityOptions == null) == (other.mActivityOptions == null);
}
@Override
public int hashCode() {
- return 17;
+ int result = 17;
+ result = 31 * result + (mActivityOptions != null ? 1 : 0);
+ return result;
}
@Override
public String toString() {
- return "StartActivityItem{}";
+ return "StartActivityItem{options=" + mActivityOptions + "}";
}
}
diff --git a/core/java/android/app/servertransaction/TransactionExecutor.java b/core/java/android/app/servertransaction/TransactionExecutor.java
index 3dcf2cb..25ff8a7 100644
--- a/core/java/android/app/servertransaction/TransactionExecutor.java
+++ b/core/java/android/app/servertransaction/TransactionExecutor.java
@@ -218,7 +218,8 @@
null /* customIntent */);
break;
case ON_START:
- mTransactionHandler.handleStartActivity(r, mPendingActions);
+ mTransactionHandler.handleStartActivity(r, mPendingActions,
+ null /* activityOptions */);
break;
case ON_RESUME:
mTransactionHandler.handleResumeActivity(r, false /* finalStateRequest */,
diff --git a/core/java/android/app/servertransaction/TransactionExecutorHelper.java b/core/java/android/app/servertransaction/TransactionExecutorHelper.java
index 56bf59b..92f7dee 100644
--- a/core/java/android/app/servertransaction/TransactionExecutorHelper.java
+++ b/core/java/android/app/servertransaction/TransactionExecutorHelper.java
@@ -186,7 +186,7 @@
switch (prevState) {
// TODO(lifecycler): Extend to support all possible states.
case ON_START:
- lifecycleItem = StartActivityItem.obtain();
+ lifecycleItem = StartActivityItem.obtain(null /* activityOptions */);
break;
case ON_PAUSE:
lifecycleItem = PauseActivityItem.obtain();
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index 1713a0c..406fe8d 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -2967,6 +2967,16 @@
}
});
}
+ synchronized (mBluetoothConnectionCallbackExecutorMap) {
+ if (!mBluetoothConnectionCallbackExecutorMap.isEmpty()) {
+ try {
+ mService.registerBluetoothConnectionCallback(mConnectionCallback);
+ } catch (RemoteException e) {
+ Log.e(TAG, "onBluetoothServiceUp: Failed to register bluetooth"
+ + "connection callback", e);
+ }
+ }
+ }
}
public void onBluetoothServiceDown() {
@@ -3616,25 +3626,25 @@
return false;
}
- // If the callback map is empty, we register the service-to-app callback
- if (mBluetoothConnectionCallbackExecutorMap.isEmpty()) {
- try {
- mServiceLock.readLock().lock();
- if (mService != null) {
- if (!mService.registerBluetoothConnectionCallback(mConnectionCallback)) {
- return false;
- }
- }
- } catch (RemoteException e) {
- Log.e(TAG, "", e);
- mBluetoothConnectionCallbackExecutorMap.remove(callback);
- } finally {
- mServiceLock.readLock().unlock();
- }
- }
-
- // Adds the passed in callback to our map of callbacks to executors
synchronized (mBluetoothConnectionCallbackExecutorMap) {
+ // If the callback map is empty, we register the service-to-app callback
+ if (mBluetoothConnectionCallbackExecutorMap.isEmpty()) {
+ try {
+ mServiceLock.readLock().lock();
+ if (mService != null) {
+ if (!mService.registerBluetoothConnectionCallback(mConnectionCallback)) {
+ return false;
+ }
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "", e);
+ mBluetoothConnectionCallbackExecutorMap.remove(callback);
+ } finally {
+ mServiceLock.readLock().unlock();
+ }
+ }
+
+ // Adds the passed in callback to our map of callbacks to executors
if (mBluetoothConnectionCallbackExecutorMap.containsKey(callback)) {
throw new IllegalArgumentException("This callback has already been registered");
}
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index ac576a8..abe7fda 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -5989,22 +5989,22 @@
* Creating a window context is an expensive operation. Misuse of this API may lead to a huge
* performance drop. The best practice is to use the same window context when possible.
* An approach is to create one window context with specific window type and display and
- * use it everywhere it's needed..
+ * use it everywhere it's needed.
* </p>
*
* @param type Window type in {@link WindowManager.LayoutParams}
- * @param options Bundle used to pass window-related options.
- * @return A {@link Context} that can be used to create windows.
- * @throws UnsupportedOperationException if this is called on a non-UI context, such as
- * {@link android.app.Application Application} or {@link android.app.Service Service}.
+ * @param options A bundle used to pass window-related options
+ * @return A {@link Context} that can be used to create
+ * non-{@link android.app.Activity activity} windows.
*
* @see #getSystemService(String)
* @see #getSystemService(Class)
* @see #WINDOW_SERVICE
* @see #LAYOUT_INFLATER_SERVICE
* @see #WALLPAPER_SERVICE
- * @throws UnsupportedOperationException if this {@link Context} does not attach to a display or
- * the current number of window contexts without adding any view by
+ * @throws UnsupportedOperationException if this {@link Context} does not attach to a display,
+ * such as {@link android.app.Application Application} or {@link android.app.Service Service},
+ * or the current number of window contexts without adding any view by
* {@link WindowManager#addView} <b>exceeds five</b>.
*/
@UiContext
@@ -6014,6 +6014,32 @@
}
/**
+ * A special version of {@link #createWindowContext(int, Bundle)} which also takes
+ * {@link Display}. The only difference between this API and
+ * {@link #createWindowContext(int, Bundle)} is that this API can create window context from
+ * any context even if the context which is not associated to a {@link Display} instance.
+ *
+ * @param display The {@link Display} to associate with
+ * @param type Window type in {@link WindowManager.LayoutParams}
+ * @param options A bundle used to pass window-related options.
+ * @return A {@link Context} that can be used to create
+ * non-{@link android.app.Activity activity} windows.
+ * @throws IllegalArgumentException if the {@link Display} is {@code null}.
+ *
+ * @see #getSystemService(String)
+ * @see #getSystemService(Class)
+ * @see #WINDOW_SERVICE
+ * @see #LAYOUT_INFLATER_SERVICE
+ * @see #WALLPAPER_SERVICE
+ */
+ @UiContext
+ @NonNull
+ public Context createWindowContext(@NonNull Display display, @WindowType int type,
+ @Nullable Bundle options) {
+ throw new RuntimeException("Not implemented. Must override in a subclass.");
+ }
+
+ /**
* Return a new Context object for the current Context but attribute to a different tag.
* In complex apps attribution tagging can be used to distinguish between separate logical
* parts.
diff --git a/core/java/android/content/ContextWrapper.java b/core/java/android/content/ContextWrapper.java
index 56da3cb..e450c08 100644
--- a/core/java/android/content/ContextWrapper.java
+++ b/core/java/android/content/ContextWrapper.java
@@ -988,6 +988,13 @@
}
@Override
+ @NonNull
+ public Context createWindowContext(@NonNull Display display, @WindowType int type,
+ @Nullable Bundle options) {
+ return mBase.createWindowContext(display, type, options);
+ }
+
+ @Override
public @NonNull Context createAttributionContext(@Nullable String attributionTag) {
return mBase.createAttributionContext(attributionTag);
}
diff --git a/core/java/android/app/role/RolePrivileges.aidl b/core/java/android/content/pm/Attribution.aidl
similarity index 91%
rename from core/java/android/app/role/RolePrivileges.aidl
rename to core/java/android/content/pm/Attribution.aidl
index 1561ad4..909fdb5 100644
--- a/core/java/android/app/role/RolePrivileges.aidl
+++ b/core/java/android/content/pm/Attribution.aidl
@@ -14,7 +14,6 @@
* limitations under the License.
*/
+package android.content.pm;
-package android.app.role;
-
-parcelable RolePrivileges;
+parcelable Attribution;
diff --git a/core/java/android/content/pm/Attribution.java b/core/java/android/content/pm/Attribution.java
new file mode 100644
index 0000000..989a5b9
--- /dev/null
+++ b/core/java/android/content/pm/Attribution.java
@@ -0,0 +1,160 @@
+/*
+ * 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.content.pm;
+
+import android.annotation.IdRes;
+import android.annotation.NonNull;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import com.android.internal.util.DataClass;
+
+/**
+ * Information about an attribution declared by a package. This corresponds to the information
+ * collected from the AndroidManifest.xml's <attribution> tags.
+ */
+@DataClass(genHiddenConstructor = true)
+public final class Attribution implements Parcelable {
+
+ /**
+ * The tag of this attribution. From the <manifest> tag's "tag" attribute
+ */
+ private @NonNull String mTag;
+
+ /**
+ * The resource ID of the label of the attribution From the <manifest> tag's "label"
+ * attribute
+ */
+ private final @IdRes int mLabel;
+
+
+
+ // Code below generated by codegen v1.0.22.
+ //
+ // DO NOT MODIFY!
+ // CHECKSTYLE:OFF Generated code
+ //
+ // To regenerate run:
+ // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/content/pm/Attribution.java
+ //
+ // To exclude the generated code from IntelliJ auto-formatting enable (one-time):
+ // Settings > Editor > Code Style > Formatter Control
+ //@formatter:off
+
+
+ /**
+ * Creates a new Attribution.
+ *
+ * @param tag
+ * The tag of this attribution. From the <manifest> tag's "tag" attribute
+ * @param label
+ * The resource ID of the label of the attribution From the <manifest> tag's "label"
+ * attribute
+ * @hide
+ */
+ @DataClass.Generated.Member
+ public Attribution(
+ @NonNull String tag,
+ @IdRes int label) {
+ this.mTag = tag;
+ com.android.internal.util.AnnotationValidations.validate(
+ NonNull.class, null, mTag);
+ this.mLabel = label;
+ com.android.internal.util.AnnotationValidations.validate(
+ IdRes.class, null, mLabel);
+
+ // onConstructed(); // You can define this method to get a callback
+ }
+
+ /**
+ * The tag of this attribution. From the <manifest> tag's "tag" attribute
+ */
+ @DataClass.Generated.Member
+ public @NonNull String getTag() {
+ return mTag;
+ }
+
+ /**
+ * The resource ID of the label of the attribution From the <manifest> tag's "label"
+ * attribute
+ */
+ @DataClass.Generated.Member
+ public @IdRes int getLabel() {
+ return mLabel;
+ }
+
+ @Override
+ @DataClass.Generated.Member
+ public void writeToParcel(@NonNull Parcel dest, int flags) {
+ // You can override field parcelling by defining methods like:
+ // void parcelFieldName(Parcel dest, int flags) { ... }
+
+ dest.writeString(mTag);
+ dest.writeInt(mLabel);
+ }
+
+ @Override
+ @DataClass.Generated.Member
+ public int describeContents() { return 0; }
+
+ /** @hide */
+ @SuppressWarnings({"unchecked", "RedundantCast"})
+ @DataClass.Generated.Member
+ /* package-private */ Attribution(@NonNull Parcel in) {
+ // You can override field unparcelling by defining methods like:
+ // static FieldType unparcelFieldName(Parcel in) { ... }
+
+ String tag = in.readString();
+ int label = in.readInt();
+
+ this.mTag = tag;
+ com.android.internal.util.AnnotationValidations.validate(
+ NonNull.class, null, mTag);
+ this.mLabel = label;
+ com.android.internal.util.AnnotationValidations.validate(
+ IdRes.class, null, mLabel);
+
+ // onConstructed(); // You can define this method to get a callback
+ }
+
+ @DataClass.Generated.Member
+ public static final @NonNull Parcelable.Creator<Attribution> CREATOR
+ = new Parcelable.Creator<Attribution>() {
+ @Override
+ public Attribution[] newArray(int size) {
+ return new Attribution[size];
+ }
+
+ @Override
+ public Attribution createFromParcel(@NonNull Parcel in) {
+ return new Attribution(in);
+ }
+ };
+
+ @DataClass.Generated(
+ time = 1608139558081L,
+ codegenVersion = "1.0.22",
+ sourceFile = "frameworks/base/core/java/android/content/pm/Attribution.java",
+ inputSignatures = "private @android.annotation.NonNull java.lang.String mTag\nprivate final @android.annotation.IdRes int mLabel\nclass Attribution extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genHiddenConstructor=true)")
+ @Deprecated
+ private void __metadata() {}
+
+
+ //@formatter:on
+ // End of generated code
+
+}
diff --git a/core/java/android/content/pm/PackageInfo.java b/core/java/android/content/pm/PackageInfo.java
index d7abb68..f991306 100644
--- a/core/java/android/content/pm/PackageInfo.java
+++ b/core/java/android/content/pm/PackageInfo.java
@@ -218,6 +218,14 @@
public int[] requestedPermissionsFlags;
/**
+ * Array of all {@link android.R.styleable#AndroidManifestAttribution
+ * <attribution>} tags included under <manifest>, or null if there were none. This
+ * is only filled if the flag {@link PackageManager#GET_ATTRIBUTIONS} was set.
+ */
+ @SuppressWarnings("ArrayReturn")
+ public @Nullable Attribution[] attributions;
+
+ /**
* Flag for {@link #requestedPermissionsFlags}: the requested permission
* is required for the application to run; the user can not optionally
* disable it. Currently all permissions are required.
@@ -471,6 +479,7 @@
dest.writeTypedArray(configPreferences, parcelableFlags);
dest.writeTypedArray(reqFeatures, parcelableFlags);
dest.writeTypedArray(featureGroups, parcelableFlags);
+ dest.writeTypedArray(attributions, parcelableFlags);
dest.writeInt(installLocation);
dest.writeInt(isStub ? 1 : 0);
dest.writeInt(coreApp ? 1 : 0);
@@ -536,6 +545,7 @@
configPreferences = source.createTypedArray(ConfigurationInfo.CREATOR);
reqFeatures = source.createTypedArray(FeatureInfo.CREATOR);
featureGroups = source.createTypedArray(FeatureGroupInfo.CREATOR);
+ attributions = source.createTypedArray(Attribution.CREATOR);
installLocation = source.readInt();
isStub = source.readInt() != 0;
coreApp = source.readInt() != 0;
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index bd27099..e074eab 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -449,6 +449,7 @@
GET_DISABLED_UNTIL_USED_COMPONENTS,
GET_UNINSTALLED_PACKAGES,
MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS,
+ GET_ATTRIBUTIONS,
})
@Retention(RetentionPolicy.SOURCE)
public @interface PackageInfoFlags {}
@@ -842,6 +843,11 @@
*/
public static final int MATCH_DIRECT_BOOT_AUTO = 0x10000000;
+ /**
+ * {@link PackageInfo} flag: return all attributions declared in the package manifest
+ */
+ public static final int GET_ATTRIBUTIONS = 0x80000000;
+
/** @hide */
@Deprecated
public static final int MATCH_DEBUG_TRIAGED_MISSING = MATCH_DIRECT_BOOT_AUTO;
diff --git a/core/java/android/content/pm/parsing/PackageInfoWithoutStateUtils.java b/core/java/android/content/pm/parsing/PackageInfoWithoutStateUtils.java
index ddf3d90..056af77 100644
--- a/core/java/android/content/pm/parsing/PackageInfoWithoutStateUtils.java
+++ b/core/java/android/content/pm/parsing/PackageInfoWithoutStateUtils.java
@@ -22,6 +22,7 @@
import android.apex.ApexInfo;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
+import android.content.pm.Attribution;
import android.content.pm.ComponentInfo;
import android.content.pm.ConfigurationInfo;
import android.content.pm.FallbackCategoryProvider;
@@ -42,6 +43,7 @@
import android.content.pm.SigningInfo;
import android.content.pm.parsing.component.ComponentParseUtils;
import android.content.pm.parsing.component.ParsedActivity;
+import android.content.pm.parsing.component.ParsedAttribution;
import android.content.pm.parsing.component.ParsedComponent;
import android.content.pm.parsing.component.ParsedInstrumentation;
import android.content.pm.parsing.component.ParsedMainComponent;
@@ -276,6 +278,15 @@
}
}
}
+ if ((flags & PackageManager.GET_ATTRIBUTIONS) != 0) {
+ int size = ArrayUtils.size(pkg.getAttributions());
+ if (size > 0) {
+ pi.attributions = new Attribution[size];
+ for (int i = 0; i < size; i++) {
+ pi.attributions[i] = generateAttribution(pkg.getAttributions().get(i));
+ }
+ }
+ }
if (apexInfo != null) {
File apexFile = new File(apexInfo.modulePath);
@@ -669,6 +680,12 @@
return pgi;
}
+ @Nullable
+ public static Attribution generateAttribution(ParsedAttribution pa) {
+ if (pa == null) return null;
+ return new Attribution(pa.tag, pa.label);
+ }
+
private static void assignSharedFieldsForComponentInfo(@NonNull ComponentInfo componentInfo,
@NonNull ParsedMainComponent mainComponent) {
assignSharedFieldsForPackageItemInfo(componentInfo, mainComponent);
diff --git a/core/java/android/content/pm/parsing/component/ParsedAttribution.java b/core/java/android/content/pm/parsing/component/ParsedAttribution.java
index 02b3c7d..3a4aae1 100644
--- a/core/java/android/content/pm/parsing/component/ParsedAttribution.java
+++ b/core/java/android/content/pm/parsing/component/ParsedAttribution.java
@@ -100,7 +100,7 @@
- // Code below generated by codegen v1.0.14.
+ // Code below generated by codegen v1.0.22.
//
// DO NOT MODIFY!
// CHECKSTYLE:OFF Generated code
@@ -215,8 +215,8 @@
};
@DataClass.Generated(
- time = 1583436566499L,
- codegenVersion = "1.0.14",
+ time = 1607463855175L,
+ codegenVersion = "1.0.22",
sourceFile = "frameworks/base/core/java/android/content/pm/parsing/component/ParsedAttribution.java",
inputSignatures = "public static final int MAX_ATTRIBUTION_TAG_LEN\nprivate static final int MAX_NUM_ATTRIBUTIONS\npublic final @android.annotation.NonNull java.lang.String tag\npublic final @android.annotation.StringRes int label\npublic final @android.annotation.NonNull java.util.List<java.lang.String> inheritFrom\npublic static boolean isCombinationValid(java.util.List<android.content.pm.parsing.component.ParsedAttribution>)\nclass ParsedAttribution extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genAidl=false)")
@Deprecated
diff --git a/core/java/android/hardware/camera2/marshal/MarshalHelpers.java b/core/java/android/hardware/camera2/marshal/MarshalHelpers.java
index 35ecc2a..3a4e111 100644
--- a/core/java/android/hardware/camera2/marshal/MarshalHelpers.java
+++ b/core/java/android/hardware/camera2/marshal/MarshalHelpers.java
@@ -95,6 +95,40 @@
}
/**
+ * Checks whether or not {@code klass} is one of the unboxed primitive classes.
+ *
+ * <p>The following types (whether boxed or unboxed) are considered primitive:
+ * <ul>
+ * <li>byte
+ * <li>int
+ * <li>float
+ * <li>double
+ * </ul>
+ * </p>
+ *
+ * @param klass a {@link Class} instance; using {@code null} will return {@code false}
+ * @return {@code true} if primitive, {@code false} otherwise
+ */
+ public static boolean isUnwrappedPrimitiveClass(Class<?> klass) {
+ if (klass == null) {
+ return false;
+ }
+
+ if (klass == byte.class) {
+ return true;
+ } else if (klass == int.class) {
+ return true;
+ } else if (klass == float.class) {
+ return true;
+ } else if (klass == long.class) {
+ return true;
+ } else if (klass == double.class) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
* Checks whether or not {@code klass} is one of the metadata-primitive classes.
*
* <p>The following types (whether boxed or unboxed) are considered primitive:
@@ -219,6 +253,32 @@
}
/**
+ * Get the unboxed primitive type corresponding to nativeType
+ *
+ * @param nativeType the native type (RATIONAL not included)
+ *
+ * @return the native type class
+ *
+ * @throws UnsupportedOperationException if the native type was invalid
+ */
+ public static Class<?> getPrimitiveTypeClass(int nativeType) {
+ switch (nativeType) {
+ case TYPE_BYTE:
+ return byte.class;
+ case TYPE_INT32:
+ return int.class;
+ case TYPE_FLOAT:
+ return float.class;
+ case TYPE_INT64:
+ return long.class;
+ case TYPE_DOUBLE:
+ return double.class;
+ }
+
+ throw new UnsupportedOperationException("Unknown nativeType " + nativeType);
+ }
+
+ /**
* Ensure that the expected and actual native types are equal.
*
* @param expectedNativeType the expected native type
diff --git a/core/java/android/hardware/camera2/marshal/impl/MarshalQueryableArray.java b/core/java/android/hardware/camera2/marshal/impl/MarshalQueryableArray.java
index ebc74f0..6cf5d60 100644
--- a/core/java/android/hardware/camera2/marshal/impl/MarshalQueryableArray.java
+++ b/core/java/android/hardware/camera2/marshal/impl/MarshalQueryableArray.java
@@ -21,6 +21,9 @@
import android.hardware.camera2.utils.TypeReference;
import android.util.Log;
+import static android.hardware.camera2.marshal.MarshalHelpers.isUnwrappedPrimitiveClass;
+import static android.hardware.camera2.marshal.MarshalHelpers.getPrimitiveTypeClass;
+
import java.lang.reflect.Array;
import java.nio.ByteBuffer;
import java.util.ArrayList;
@@ -41,6 +44,62 @@
private static final String TAG = MarshalQueryableArray.class.getSimpleName();
private static final boolean DEBUG = false;
+ private static interface PrimitiveArrayFiller {
+ public void fillPosition(Object arr, int index, ByteBuffer buffer);
+ static PrimitiveArrayFiller getPrimitiveArrayFiller(Class<?> componentType) {
+ if (componentType == int.class) {
+ return new PrimitiveArrayFiller() {
+ @Override
+ public void fillPosition(Object arr, int index, ByteBuffer buffer) {
+ int i = buffer.getInt();
+ Array.setInt(arr, index, i);
+ }
+ };
+ } else if (componentType == float.class) {
+ return new PrimitiveArrayFiller() {
+ @Override
+ public void fillPosition(Object arr, int index, ByteBuffer buffer) {
+ float i = buffer.getFloat();
+ Array.setFloat(arr, index, i);
+ }
+ };
+ } else if (componentType == long.class) {
+ return new PrimitiveArrayFiller() {
+ @Override
+ public void fillPosition(Object arr, int index, ByteBuffer buffer) {
+ long i = buffer.getLong();
+ Array.setLong(arr, index, i);
+ }
+ };
+ } else if (componentType == double.class) {
+ return new PrimitiveArrayFiller() {
+ @Override
+ public void fillPosition(Object arr, int index, ByteBuffer buffer) {
+ double i = buffer.getDouble();
+ Array.setDouble(arr, index, i);
+ }
+ };
+ } else if (componentType == byte.class) {
+ return new PrimitiveArrayFiller() {
+ @Override
+ public void fillPosition(Object arr, int index, ByteBuffer buffer) {
+ byte i = buffer.get();
+ Array.setByte(arr, index, i);
+ }
+ };
+ }
+ throw new UnsupportedOperationException("PrimitiveArrayFiller of type "
+ + componentType.getName() + " not supported");
+ }
+ };
+
+ static void unmarshalPrimitiveArray(Object arr, int size, ByteBuffer buffer,
+ PrimitiveArrayFiller filler) {
+ for (int i = 0; i < size; i++) {
+ filler.fillPosition(arr, i, buffer);
+ }
+ }
+
private class MarshalerArray extends Marshaler<T> {
private final Class<T> mClass;
private final Marshaler<?> mComponentMarshaler;
@@ -89,9 +148,15 @@
}
array = Array.newInstance(mComponentClass, arraySize);
- for (int i = 0; i < arraySize; ++i) {
- Object elem = mComponentMarshaler.unmarshal(buffer);
- Array.set(array, i, elem);
+ if (isUnwrappedPrimitiveClass(mComponentClass) &&
+ mComponentClass == getPrimitiveTypeClass(mNativeType)) {
+ unmarshalPrimitiveArray(array, arraySize, buffer,
+ PrimitiveArrayFiller.getPrimitiveArrayFiller(mComponentClass));
+ } else {
+ for (int i = 0; i < arraySize; ++i) {
+ Object elem = mComponentMarshaler.unmarshal(buffer);
+ Array.set(array, i, elem);
+ }
}
} else {
// Dynamic size, use an array list.
diff --git a/core/java/android/hardware/input/InputManager.java b/core/java/android/hardware/input/InputManager.java
index 300d99b..9d20f6d 100644
--- a/core/java/android/hardware/input/InputManager.java
+++ b/core/java/android/hardware/input/InputManager.java
@@ -195,7 +195,7 @@
*/
@BlockUntrustedTouchesMode
public static final int DEFAULT_BLOCK_UNTRUSTED_TOUCHES_MODE =
- BlockUntrustedTouchesMode.PERMISSIVE;
+ BlockUntrustedTouchesMode.BLOCK;
/**
* Prevent touches from being consumed by apps if these touches passed through a non-trusted
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 6831eca..df9a7c2 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -1700,8 +1700,12 @@
if (config.orientation != Configuration.ORIENTATION_LANDSCAPE) {
return false;
}
- if (mInputEditorInfo != null
- && (mInputEditorInfo.imeOptions & EditorInfo.IME_FLAG_NO_FULLSCREEN) != 0) {
+ if ((mInputEditorInfo != null
+ && (mInputEditorInfo.imeOptions & EditorInfo.IME_FLAG_NO_FULLSCREEN) != 0)
+ // If app window has portrait orientation, regardless of what display orientation
+ // is, IME shouldn't use fullscreen-mode.
+ || (mInputEditorInfo.internalImeOptions
+ & EditorInfo.IME_FLAG_APP_WINDOW_PORTRAIT) != 0) {
return false;
}
return true;
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index 09c3050..f756cda 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -61,6 +61,7 @@
import android.util.Log;
import android.util.SparseIntArray;
+import com.android.connectivity.aidl.INetworkAgent;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.Preconditions;
import com.android.internal.util.Protocol;
@@ -3287,9 +3288,9 @@
@RequiresPermission(anyOf = {
NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK,
android.Manifest.permission.NETWORK_FACTORY})
- public Network registerNetworkAgent(Messenger messenger, NetworkInfo ni, LinkProperties lp,
+ public Network registerNetworkAgent(INetworkAgent na, NetworkInfo ni, LinkProperties lp,
NetworkCapabilities nc, int score, NetworkAgentConfig config) {
- return registerNetworkAgent(messenger, ni, lp, nc, score, config, NetworkProvider.ID_NONE);
+ return registerNetworkAgent(na, ni, lp, nc, score, config, NetworkProvider.ID_NONE);
}
/**
@@ -3300,10 +3301,10 @@
@RequiresPermission(anyOf = {
NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK,
android.Manifest.permission.NETWORK_FACTORY})
- public Network registerNetworkAgent(Messenger messenger, NetworkInfo ni, LinkProperties lp,
+ public Network registerNetworkAgent(INetworkAgent na, NetworkInfo ni, LinkProperties lp,
NetworkCapabilities nc, int score, NetworkAgentConfig config, int providerId) {
try {
- return mService.registerNetworkAgent(messenger, ni, lp, nc, score, config, providerId);
+ return mService.registerNetworkAgent(na, ni, lp, nc, score, config, providerId);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
diff --git a/core/java/android/net/DnsResolverServiceManager.java b/core/java/android/net/DnsResolverServiceManager.java
new file mode 100644
index 0000000..1597322
--- /dev/null
+++ b/core/java/android/net/DnsResolverServiceManager.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 android.net;
+
+import android.annotation.NonNull;
+import android.annotation.RequiresPermission;
+import android.annotation.SystemApi;
+import android.content.Context;
+import android.os.IBinder;
+import android.os.ServiceManager;
+
+import java.util.Objects;
+
+/**
+ * Provides a way to obtain the DnsResolver binder objects.
+ *
+ * @hide
+ */
+@SystemApi
+public class DnsResolverServiceManager {
+ /**
+ * Name to retrieve a {@link android.net.IDnsResolver} IBinder.
+ */
+ private static final String DNS_RESOLVER_SERVICE = "dnsresolver";
+
+ private DnsResolverServiceManager() {}
+
+ /**
+ * Get an {@link IBinder} representing the DnsResolver stable AIDL interface
+ *
+ * @param context the context for permission check.
+ * @return {@link android.net.IDnsResolver} IBinder.
+ */
+ @NonNull
+ @RequiresPermission(NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK)
+ public static IBinder getService(@NonNull final Context context) {
+ Objects.requireNonNull(context);
+ context.enforceCallingOrSelfPermission(NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK,
+ "DnsResolverServiceManager");
+ try {
+ return ServiceManager.getServiceOrThrow(DNS_RESOLVER_SERVICE);
+ } catch (ServiceManager.ServiceNotFoundException e) {
+ // Catch ServiceManager#ServiceNotFoundException and rethrow IllegalStateException
+ // because ServiceManager#ServiceNotFoundException is @hide so that it can't be listed
+ // on the system api. Thus, rethrow IllegalStateException if dns resolver service cannot
+ // be found.
+ throw new IllegalStateException("Cannot find dns resolver service.");
+ }
+ }
+}
diff --git a/core/java/android/net/EthernetManager.java b/core/java/android/net/EthernetManager.java
index 84a8e1c3..7cd63ef 100644
--- a/core/java/android/net/EthernetManager.java
+++ b/core/java/android/net/EthernetManager.java
@@ -24,10 +24,11 @@
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.os.Build;
-import android.os.Handler;
-import android.os.Message;
import android.os.RemoteException;
+import com.android.internal.annotations.GuardedBy;
+import com.android.internal.os.BackgroundThread;
+
import java.util.ArrayList;
import java.util.Objects;
import java.util.concurrent.Executor;
@@ -41,31 +42,35 @@
@SystemService(Context.ETHERNET_SERVICE)
public class EthernetManager {
private static final String TAG = "EthernetManager";
- private static final int MSG_AVAILABILITY_CHANGED = 1000;
- private final Context mContext;
private final IEthernetManager mService;
- private final Handler mHandler = new Handler(ConnectivityThread.getInstanceLooper()) {
- @Override
- public void handleMessage(Message msg) {
- if (msg.what == MSG_AVAILABILITY_CHANGED) {
- boolean isAvailable = (msg.arg1 == 1);
- for (Listener listener : mListeners) {
- listener.onAvailabilityChanged((String) msg.obj, isAvailable);
- }
- }
- }
- };
- private final ArrayList<Listener> mListeners = new ArrayList<>();
+ @GuardedBy("mListeners")
+ private final ArrayList<ListenerInfo> mListeners = new ArrayList<>();
private final IEthernetServiceListener.Stub mServiceListener =
new IEthernetServiceListener.Stub() {
@Override
public void onAvailabilityChanged(String iface, boolean isAvailable) {
- mHandler.obtainMessage(
- MSG_AVAILABILITY_CHANGED, isAvailable ? 1 : 0, 0, iface).sendToTarget();
+ synchronized (mListeners) {
+ for (ListenerInfo li : mListeners) {
+ li.executor.execute(() ->
+ li.listener.onAvailabilityChanged(iface, isAvailable));
+ }
+ }
}
};
+ private static class ListenerInfo {
+ @NonNull
+ public final Executor executor;
+ @NonNull
+ public final Listener listener;
+
+ private ListenerInfo(@NonNull Executor executor, @NonNull Listener listener) {
+ this.executor = executor;
+ this.listener = listener;
+ }
+ }
+
/**
* A listener interface to receive notification on changes in Ethernet.
* @hide
@@ -89,7 +94,6 @@
* @hide
*/
public EthernetManager(Context context, IEthernetManager service) {
- mContext = context;
mService = service;
}
@@ -146,21 +150,38 @@
/**
* Adds a listener.
+ *
+ * Consider using {@link #addListener(Listener, Executor)} instead: this method uses a default
+ * executor that may have higher latency than a provided executor.
* @param listener A {@link Listener} to add.
* @throws IllegalArgumentException If the listener is null.
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public void addListener(Listener listener) {
- if (listener == null) {
- throw new IllegalArgumentException("listener must not be null");
+ public void addListener(@NonNull Listener listener) {
+ addListener(listener, BackgroundThread.getExecutor());
+ }
+
+ /**
+ * Adds a listener.
+ * @param listener A {@link Listener} to add.
+ * @param executor Executor to run callbacks on.
+ * @throws IllegalArgumentException If the listener or executor is null.
+ * @hide
+ */
+ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
+ public void addListener(@NonNull Listener listener, @NonNull Executor executor) {
+ if (listener == null || executor == null) {
+ throw new NullPointerException("listener and executor must not be null");
}
- mListeners.add(listener);
- if (mListeners.size() == 1) {
- try {
- mService.addListener(mServiceListener);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
+ synchronized (mListeners) {
+ mListeners.add(new ListenerInfo(executor, listener));
+ if (mListeners.size() == 1) {
+ try {
+ mService.addListener(mServiceListener);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
}
}
@@ -185,16 +206,18 @@
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public void removeListener(Listener listener) {
+ public void removeListener(@NonNull Listener listener) {
if (listener == null) {
throw new IllegalArgumentException("listener must not be null");
}
- mListeners.remove(listener);
- if (mListeners.isEmpty()) {
- try {
- mService.removeListener(mServiceListener);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
+ synchronized (mListeners) {
+ mListeners.removeIf(l -> l.listener == listener);
+ if (mListeners.isEmpty()) {
+ try {
+ mService.removeListener(mServiceListener);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
}
}
diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl
index fb01283..cbb1197 100644
--- a/core/java/android/net/IConnectivityManager.aidl
+++ b/core/java/android/net/IConnectivityManager.aidl
@@ -31,11 +31,13 @@
import android.net.ProxyInfo;
import android.os.Bundle;
import android.os.IBinder;
+import android.os.INetworkActivityListener;
import android.os.Messenger;
import android.os.ParcelFileDescriptor;
import android.os.PersistableBundle;
import android.os.ResultReceiver;
+import com.android.connectivity.aidl.INetworkAgent;
import com.android.internal.net.LegacyVpnInfo;
import com.android.internal.net.VpnConfig;
import com.android.internal.net.VpnInfo;
@@ -163,7 +165,7 @@
void declareNetworkRequestUnfulfillable(in NetworkRequest request);
- Network registerNetworkAgent(in Messenger messenger, in NetworkInfo ni, in LinkProperties lp,
+ Network registerNetworkAgent(in INetworkAgent na, in NetworkInfo ni, in LinkProperties lp,
in NetworkCapabilities nc, int score, in NetworkAgentConfig config,
in int factorySerialNumber);
@@ -233,4 +235,10 @@
in PersistableBundle extras);
void systemReady();
+
+ void registerNetworkActivityListener(in INetworkActivityListener l);
+
+ void unregisterNetworkActivityListener(in INetworkActivityListener l);
+
+ boolean isDefaultNetworkActive();
}
diff --git a/core/java/android/net/INetworkManagementEventObserver.aidl b/core/java/android/net/INetworkManagementEventObserver.aidl
index f0fe92e..37813ce 100644
--- a/core/java/android/net/INetworkManagementEventObserver.aidl
+++ b/core/java/android/net/INetworkManagementEventObserver.aidl
@@ -85,11 +85,14 @@
/**
* Interface data activity status is changed.
*
- * @param iface The interface.
+ * @param networkType The legacy network type of the data activity change.
* @param active True if the interface is actively transmitting data, false if it is idle.
* @param tsNanos Elapsed realtime in nanos when the state of the network interface changed.
+ * @param uid Uid of this event. It represents the uid that was responsible for waking the
+ * radio. For those events that are reported by system itself, not from specific uid,
+ * use -1 for the events which means no uid.
*/
- void interfaceClassDataActivityChanged(String label, boolean active, long tsNanos);
+ void interfaceClassDataActivityChanged(int networkType, boolean active, long tsNanos, int uid);
/**
* Information about available DNS servers has been received.
diff --git a/core/java/android/net/INetworkPolicyManager.aidl b/core/java/android/net/INetworkPolicyManager.aidl
index e486052..792e5b4 100644
--- a/core/java/android/net/INetworkPolicyManager.aidl
+++ b/core/java/android/net/INetworkPolicyManager.aidl
@@ -17,6 +17,7 @@
package android.net;
import android.net.INetworkPolicyListener;
+import android.net.Network;
import android.net.NetworkPolicy;
import android.net.NetworkQuotaInfo;
import android.net.NetworkState;
@@ -67,6 +68,8 @@
void setDeviceIdleMode(boolean enabled);
void setWifiMeteredOverride(String networkId, int meteredOverride);
+ int getMultipathPreference(in Network network);
+
@UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
NetworkQuotaInfo getNetworkQuotaInfo(in NetworkState state);
diff --git a/wifi/aidl-export/android/net/wifi/CoexUnsafeChannel.aidl b/core/java/android/net/NattKeepalivePacketData.aidl
similarity index 77%
copy from wifi/aidl-export/android/net/wifi/CoexUnsafeChannel.aidl
copy to core/java/android/net/NattKeepalivePacketData.aidl
index cb359e9..af644b5 100644
--- a/wifi/aidl-export/android/net/wifi/CoexUnsafeChannel.aidl
+++ b/core/java/android/net/NattKeepalivePacketData.aidl
@@ -10,10 +10,9 @@
* 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
+ * See the License for the specific language governing perNmissions and
* limitations under the License.
*/
+package android.net;
-package android.net.wifi;
-
-parcelable CoexUnsafeChannel;
+@JavaOnlyStableParcelable parcelable NattKeepalivePacketData;
diff --git a/core/java/android/net/NetworkAgent.java b/core/java/android/net/NetworkAgent.java
index 6780167..4166c2c 100644
--- a/core/java/android/net/NetworkAgent.java
+++ b/core/java/android/net/NetworkAgent.java
@@ -29,11 +29,12 @@
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
-import android.os.Messenger;
+import android.os.RemoteException;
import android.util.Log;
+import com.android.connectivity.aidl.INetworkAgent;
+import com.android.connectivity.aidl.INetworkAgentRegistry;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.util.AsyncChannel;
import com.android.internal.util.Protocol;
import java.lang.annotation.Retention;
@@ -94,12 +95,18 @@
@Nullable
private volatile Network mNetwork;
+ @Nullable
+ private volatile INetworkAgentRegistry mRegistry;
+
+ private interface RegistryAction {
+ void execute(@NonNull INetworkAgentRegistry registry) throws RemoteException;
+ }
+
private final Handler mHandler;
- private volatile AsyncChannel mAsyncChannel;
private final String LOG_TAG;
private static final boolean DBG = true;
private static final boolean VDBG = false;
- private final ArrayList<Message> mPreConnectedQueue = new ArrayList<Message>();
+ private final ArrayList<RegistryAction> mPreConnectedQueue = new ArrayList<>();
private volatile long mLastBwRefreshTime = 0;
private static final long BW_REFRESH_MIN_WIN_MS = 500;
private boolean mBandwidthUpdateScheduled = false;
@@ -329,6 +336,17 @@
*/
public static final int CMD_REMOVE_KEEPALIVE_PACKET_FILTER = BASE + 17;
+ /**
+ * Sent by ConnectivityService to the NetworkAgent to complete the bidirectional connection.
+ * obj = INetworkAgentRegistry
+ */
+ private static final int EVENT_AGENT_CONNECTED = BASE + 18;
+
+ /**
+ * Sent by ConnectivityService to the NetworkAgent to inform the agent that it was disconnected.
+ */
+ private static final int EVENT_AGENT_DISCONNECTED = BASE + 19;
+
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.
@@ -402,36 +420,33 @@
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
- case AsyncChannel.CMD_CHANNEL_FULL_CONNECTION: {
- if (mAsyncChannel != null) {
+ case EVENT_AGENT_CONNECTED: {
+ if (mRegistry != null) {
log("Received new connection while already connected!");
} else {
if (VDBG) log("NetworkAgent fully connected");
- AsyncChannel ac = new AsyncChannel();
- ac.connected(null, this, msg.replyTo);
- ac.replyToMessage(msg, AsyncChannel.CMD_CHANNEL_FULLY_CONNECTED,
- AsyncChannel.STATUS_SUCCESSFUL);
synchronized (mPreConnectedQueue) {
- mAsyncChannel = ac;
- for (Message m : mPreConnectedQueue) {
- ac.sendMessage(m);
+ final INetworkAgentRegistry registry = (INetworkAgentRegistry) msg.obj;
+ mRegistry = registry;
+ for (RegistryAction a : mPreConnectedQueue) {
+ try {
+ a.execute(registry);
+ } catch (RemoteException e) {
+ Log.wtf(LOG_TAG, "Communication error with registry", e);
+ // Fall through
+ }
}
mPreConnectedQueue.clear();
}
}
break;
}
- case AsyncChannel.CMD_CHANNEL_DISCONNECT: {
- if (VDBG) log("CMD_CHANNEL_DISCONNECT");
- if (mAsyncChannel != null) mAsyncChannel.disconnect();
- break;
- }
- case AsyncChannel.CMD_CHANNEL_DISCONNECTED: {
+ case EVENT_AGENT_DISCONNECTED: {
if (DBG) log("NetworkAgent channel lost");
// let the client know CS is done with us.
onNetworkUnwanted();
synchronized (mPreConnectedQueue) {
- mAsyncChannel = null;
+ mRegistry = null;
}
break;
}
@@ -494,15 +509,7 @@
}
case CMD_SET_SIGNAL_STRENGTH_THRESHOLDS: {
- ArrayList<Integer> thresholds =
- ((Bundle) msg.obj).getIntegerArrayList("thresholds");
- // TODO: Change signal strength thresholds API to use an ArrayList<Integer>
- // rather than convert to int[].
- int[] intThresholds = new int[(thresholds != null) ? thresholds.size() : 0];
- for (int i = 0; i < intThresholds.length; i++) {
- intThresholds[i] = thresholds.get(i);
- }
- onSignalStrengthThresholdsUpdated(intThresholds);
+ onSignalStrengthThresholdsUpdated((int[]) msg.obj);
break;
}
case CMD_PREVENT_AUTOMATIC_RECONNECT: {
@@ -541,7 +548,7 @@
}
final ConnectivityManager cm = (ConnectivityManager) mInitialConfiguration.context
.getSystemService(Context.CONNECTIVITY_SERVICE);
- mNetwork = cm.registerNetworkAgent(new Messenger(mHandler),
+ mNetwork = cm.registerNetworkAgent(new NetworkAgentBinder(mHandler),
new NetworkInfo(mInitialConfiguration.info),
mInitialConfiguration.properties, mInitialConfiguration.capabilities,
mInitialConfiguration.score, mInitialConfiguration.config, providerId);
@@ -550,6 +557,95 @@
return mNetwork;
}
+ private static class NetworkAgentBinder extends INetworkAgent.Stub {
+ private final Handler mHandler;
+
+ private NetworkAgentBinder(Handler handler) {
+ mHandler = handler;
+ }
+
+ @Override
+ public void onRegistered(@NonNull INetworkAgentRegistry registry) {
+ mHandler.sendMessage(mHandler.obtainMessage(EVENT_AGENT_CONNECTED, registry));
+ }
+
+ @Override
+ public void onDisconnected() {
+ mHandler.sendMessage(mHandler.obtainMessage(EVENT_AGENT_DISCONNECTED));
+ }
+
+ @Override
+ public void onBandwidthUpdateRequested() {
+ mHandler.sendMessage(mHandler.obtainMessage(CMD_REQUEST_BANDWIDTH_UPDATE));
+ }
+
+ @Override
+ public void onValidationStatusChanged(
+ int validationStatus, @Nullable String captivePortalUrl) {
+ // TODO: consider using a parcelable as argument when the interface is structured
+ Bundle redirectUrlBundle = new Bundle();
+ redirectUrlBundle.putString(NetworkAgent.REDIRECT_URL_KEY, captivePortalUrl);
+ mHandler.sendMessage(mHandler.obtainMessage(CMD_REPORT_NETWORK_STATUS,
+ validationStatus, 0, redirectUrlBundle));
+ }
+
+ @Override
+ public void onSaveAcceptUnvalidated(boolean acceptUnvalidated) {
+ mHandler.sendMessage(mHandler.obtainMessage(CMD_SAVE_ACCEPT_UNVALIDATED,
+ acceptUnvalidated ? 1 : 0, 0));
+ }
+
+ @Override
+ public void onStartNattSocketKeepalive(int slot, int intervalDurationMs,
+ @NonNull NattKeepalivePacketData packetData) {
+ mHandler.sendMessage(mHandler.obtainMessage(CMD_START_SOCKET_KEEPALIVE,
+ slot, intervalDurationMs, packetData));
+ }
+
+ @Override
+ public void onStartTcpSocketKeepalive(int slot, int intervalDurationMs,
+ @NonNull TcpKeepalivePacketData packetData) {
+ mHandler.sendMessage(mHandler.obtainMessage(CMD_START_SOCKET_KEEPALIVE,
+ slot, intervalDurationMs, packetData));
+ }
+
+ @Override
+ public void onStopSocketKeepalive(int slot) {
+ mHandler.sendMessage(mHandler.obtainMessage(CMD_STOP_SOCKET_KEEPALIVE, slot, 0));
+ }
+
+ @Override
+ public void onSignalStrengthThresholdsUpdated(@NonNull int[] thresholds) {
+ mHandler.sendMessage(mHandler.obtainMessage(
+ CMD_SET_SIGNAL_STRENGTH_THRESHOLDS, thresholds));
+ }
+
+ @Override
+ public void onPreventAutomaticReconnect() {
+ mHandler.sendMessage(mHandler.obtainMessage(CMD_PREVENT_AUTOMATIC_RECONNECT));
+ }
+
+ @Override
+ public void onAddNattKeepalivePacketFilter(int slot,
+ @NonNull NattKeepalivePacketData packetData) {
+ mHandler.sendMessage(mHandler.obtainMessage(CMD_ADD_KEEPALIVE_PACKET_FILTER,
+ slot, 0, packetData));
+ }
+
+ @Override
+ public void onAddTcpKeepalivePacketFilter(int slot,
+ @NonNull TcpKeepalivePacketData packetData) {
+ mHandler.sendMessage(mHandler.obtainMessage(CMD_ADD_KEEPALIVE_PACKET_FILTER,
+ slot, 0, packetData));
+ }
+
+ @Override
+ public void onRemoveKeepalivePacketFilter(int slot) {
+ mHandler.sendMessage(mHandler.obtainMessage(CMD_REMOVE_KEEPALIVE_PACKET_FILTER,
+ slot, 0));
+ }
+ }
+
/**
* Register this network agent with a testing harness.
*
@@ -559,13 +655,13 @@
*
* @hide
*/
- public Messenger registerForTest(final Network network) {
+ public INetworkAgent registerForTest(final Network network) {
log("Registering NetworkAgent for test");
synchronized (mRegisterLock) {
mNetwork = network;
mInitialConfiguration = null;
}
- return new Messenger(mHandler);
+ return new NetworkAgentBinder(mHandler);
}
/**
@@ -589,29 +685,17 @@
return mNetwork;
}
- private void queueOrSendMessage(int what, Object obj) {
- queueOrSendMessage(what, 0, 0, obj);
- }
-
- private void queueOrSendMessage(int what, int arg1, int arg2) {
- queueOrSendMessage(what, arg1, arg2, null);
- }
-
- private void queueOrSendMessage(int what, int arg1, int arg2, Object obj) {
- Message msg = Message.obtain();
- msg.what = what;
- msg.arg1 = arg1;
- msg.arg2 = arg2;
- msg.obj = obj;
- queueOrSendMessage(msg);
- }
-
- private void queueOrSendMessage(Message msg) {
+ private void queueOrSendMessage(@NonNull RegistryAction action) {
synchronized (mPreConnectedQueue) {
- if (mAsyncChannel != null) {
- mAsyncChannel.sendMessage(msg);
+ if (mRegistry != null) {
+ try {
+ action.execute(mRegistry);
+ } catch (RemoteException e) {
+ Log.wtf(LOG_TAG, "Error executing registry action", e);
+ // Fall through: the channel is asynchronous and does not report errors back
+ }
} else {
- mPreConnectedQueue.add(msg);
+ mPreConnectedQueue.add(action);
}
}
}
@@ -622,7 +706,8 @@
*/
public final void sendLinkProperties(@NonNull LinkProperties linkProperties) {
Objects.requireNonNull(linkProperties);
- queueOrSendMessage(EVENT_NETWORK_PROPERTIES_CHANGED, new LinkProperties(linkProperties));
+ final LinkProperties lp = new LinkProperties(linkProperties);
+ queueOrSendMessage(reg -> reg.sendLinkProperties(lp));
}
/**
@@ -647,9 +732,7 @@
public final void setUnderlyingNetworks(@Nullable List<Network> underlyingNetworks) {
final ArrayList<Network> underlyingArray = (underlyingNetworks != null)
? new ArrayList<>(underlyingNetworks) : null;
- final Bundle bundle = new Bundle();
- bundle.putParcelableArrayList(UNDERLYING_NETWORKS_KEY, underlyingArray);
- queueOrSendMessage(EVENT_UNDERLYING_NETWORKS_CHANGED, bundle);
+ queueOrSendMessage(reg -> reg.sendUnderlyingNetworks(underlyingArray));
}
/**
@@ -659,7 +742,7 @@
public void markConnected() {
mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.CONNECTED, null /* reason */,
mNetworkInfo.getExtraInfo());
- queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, mNetworkInfo);
+ queueOrSendNetworkInfo(mNetworkInfo);
}
/**
@@ -672,7 +755,7 @@
// When unregistering an agent nobody should use the extrainfo (or reason) any more.
mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.DISCONNECTED, null /* reason */,
null /* extraInfo */);
- queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, mNetworkInfo);
+ queueOrSendNetworkInfo(mNetworkInfo);
}
/**
@@ -689,7 +772,7 @@
@Deprecated
public void setLegacySubtype(final int legacySubtype, @NonNull final String legacySubtypeName) {
mNetworkInfo.setSubtype(legacySubtype, legacySubtypeName);
- queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, mNetworkInfo);
+ queueOrSendNetworkInfo(mNetworkInfo);
}
/**
@@ -711,7 +794,7 @@
@Deprecated
public void setLegacyExtraInfo(@Nullable final String extraInfo) {
mNetworkInfo.setExtraInfo(extraInfo);
- queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, mNetworkInfo);
+ queueOrSendNetworkInfo(mNetworkInfo);
}
/**
@@ -720,7 +803,11 @@
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public final void sendNetworkInfo(NetworkInfo networkInfo) {
- queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, new NetworkInfo(networkInfo));
+ queueOrSendNetworkInfo(new NetworkInfo(networkInfo));
+ }
+
+ private void queueOrSendNetworkInfo(NetworkInfo networkInfo) {
+ queueOrSendMessage(reg -> reg.sendNetworkInfo(networkInfo));
}
/**
@@ -731,8 +818,8 @@
Objects.requireNonNull(networkCapabilities);
mBandwidthUpdatePending.set(false);
mLastBwRefreshTime = System.currentTimeMillis();
- queueOrSendMessage(EVENT_NETWORK_CAPABILITIES_CHANGED,
- new NetworkCapabilities(networkCapabilities));
+ final NetworkCapabilities nc = new NetworkCapabilities(networkCapabilities);
+ queueOrSendMessage(reg -> reg.sendNetworkCapabilities(nc));
}
/**
@@ -744,7 +831,7 @@
if (score < 0) {
throw new IllegalArgumentException("Score must be >= 0");
}
- queueOrSendMessage(EVENT_NETWORK_SCORE_CHANGED, score, 0);
+ queueOrSendMessage(reg -> reg.sendScore(score));
}
/**
@@ -784,9 +871,8 @@
* @hide should move to NetworkAgentConfig.
*/
public void explicitlySelected(boolean explicitlySelected, boolean acceptUnvalidated) {
- queueOrSendMessage(EVENT_SET_EXPLICITLY_SELECTED,
- explicitlySelected ? 1 : 0,
- acceptUnvalidated ? 1 : 0);
+ queueOrSendMessage(reg -> reg.sendExplicitlySelected(
+ explicitlySelected, acceptUnvalidated));
}
/**
@@ -909,7 +995,7 @@
*/
public final void sendSocketKeepaliveEvent(int slot,
@SocketKeepalive.KeepaliveEvent int event) {
- queueOrSendMessage(EVENT_SOCKET_KEEPALIVE, slot, event);
+ queueOrSendMessage(reg -> reg.sendSocketKeepaliveEvent(slot, event));
}
/** @hide TODO delete once callers have moved to sendSocketKeepaliveEvent */
public void onSocketKeepaliveEvent(int slot, int reason) {
diff --git a/core/java/android/net/NetworkPolicyManager.java b/core/java/android/net/NetworkPolicyManager.java
index f05f033..36348b3 100644
--- a/core/java/android/net/NetworkPolicyManager.java
+++ b/core/java/android/net/NetworkPolicyManager.java
@@ -122,17 +122,26 @@
* @hide
*/
public static final int RULE_REJECT_ALL = 1 << 6;
+ /**
+ * Reject traffic on all networks for restricted networking mode.
+ */
+ public static final int RULE_REJECT_RESTRICTED_MODE = 1 << 10;
/**
* Mask used to get the {@code RULE_xxx_METERED} rules
* @hide
*/
- public static final int MASK_METERED_NETWORKS = 0b00001111;
+ public static final int MASK_METERED_NETWORKS = 0b000000001111;
/**
* Mask used to get the {@code RULE_xxx_ALL} rules
* @hide
*/
- public static final int MASK_ALL_NETWORKS = 0b11110000;
+ public static final int MASK_ALL_NETWORKS = 0b000011110000;
+ /**
+ * Mask used to get the {@code RULE_xxx_RESTRICTED_MODE} rules
+ * @hide
+ */
+ public static final int MASK_RESTRICTED_MODE_NETWORKS = 0b111100000000;
/** @hide */
public static final int FIREWALL_RULE_DEFAULT = 0;
@@ -432,6 +441,17 @@
}
}
+ /**
+ * Get multipath preference for the given network.
+ */
+ public int getMultipathPreference(Network network) {
+ try {
+ return mService.getMultipathPreference(network);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
/** {@hide} */
@Deprecated
public static Iterator<Pair<ZonedDateTime, ZonedDateTime>> cycleIterator(NetworkPolicy policy) {
diff --git a/core/java/android/net/NetworkStatsHistory.java b/core/java/android/net/NetworkStatsHistory.java
index fba7561..bf25602 100644
--- a/core/java/android/net/NetworkStatsHistory.java
+++ b/core/java/android/net/NetworkStatsHistory.java
@@ -26,9 +26,9 @@
import static android.net.NetworkStatsHistory.Entry.UNKNOWN;
import static android.net.NetworkStatsHistory.ParcelUtils.readLongArray;
import static android.net.NetworkStatsHistory.ParcelUtils.writeLongArray;
-import static android.net.NetworkUtils.multiplySafeByRational;
import static android.text.format.DateUtils.SECOND_IN_MILLIS;
+import static com.android.internal.net.NetworkUtilsInternal.multiplySafeByRational;
import static com.android.internal.util.ArrayUtils.total;
import android.compat.annotation.UnsupportedAppUsage;
diff --git a/core/java/android/net/NetworkUtils.java b/core/java/android/net/NetworkUtils.java
index d84ee2a..b5962c5 100644
--- a/core/java/android/net/NetworkUtils.java
+++ b/core/java/android/net/NetworkUtils.java
@@ -16,14 +16,9 @@
package android.net;
-import static android.system.OsConstants.AF_INET;
-import static android.system.OsConstants.AF_INET6;
-
-import android.annotation.NonNull;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
import android.system.ErrnoException;
-import android.system.Os;
import android.util.Log;
import android.util.Pair;
@@ -155,14 +150,6 @@
public static native Network getDnsNetwork() throws ErrnoException;
/**
- * Allow/Disallow creating AF_INET/AF_INET6 sockets and DNS lookups for current process.
- *
- * @param allowNetworking whether to allow or disallow creating AF_INET/AF_INET6 sockets
- * and DNS lookups.
- */
- public static native void setAllowNetworkingForProcess(boolean allowNetworking);
-
- /**
* Get the tcp repair window associated with the {@code fd}.
*
* @param fd the tcp socket's {@link FileDescriptor}.
@@ -437,60 +424,4 @@
return routedIPCount;
}
- private static final int[] ADDRESS_FAMILIES = new int[] {AF_INET, AF_INET6};
-
- /**
- * Returns true if the hostname is weakly validated.
- * @param hostname Name of host to validate.
- * @return True if it's a valid-ish hostname.
- *
- * @hide
- */
- public static boolean isWeaklyValidatedHostname(@NonNull String hostname) {
- // TODO(b/34953048): Use a validation method that permits more accurate,
- // but still inexpensive, checking of likely valid DNS hostnames.
- final String weakHostnameRegex = "^[a-zA-Z0-9_.-]+$";
- if (!hostname.matches(weakHostnameRegex)) {
- return false;
- }
-
- for (int address_family : ADDRESS_FAMILIES) {
- if (Os.inet_pton(address_family, hostname) != null) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Safely multiple a value by a rational.
- * <p>
- * Internally it uses integer-based math whenever possible, but switches
- * over to double-based math if values would overflow.
- * @hide
- */
- public static long multiplySafeByRational(long value, long num, long den) {
- if (den == 0) {
- throw new ArithmeticException("Invalid Denominator");
- }
- long x = value;
- long y = num;
-
- // Logic shamelessly borrowed from Math.multiplyExact()
- long r = x * y;
- long ax = Math.abs(x);
- long ay = Math.abs(y);
- if (((ax | ay) >>> 31 != 0)) {
- // Some bits greater than 2^31 that might cause overflow
- // Check the result using the divide operator
- // and check for the special case of Long.MIN_VALUE * -1
- if (((y != 0) && (r / y != x)) ||
- (x == Long.MIN_VALUE && y == -1)) {
- // Use double math to avoid overflowing
- return (long) (((double) num / den) * value);
- }
- }
- return r / den;
- }
}
diff --git a/core/java/android/net/Proxy.java b/core/java/android/net/Proxy.java
index 20ccc07..03b07e0 100644
--- a/core/java/android/net/Proxy.java
+++ b/core/java/android/net/Proxy.java
@@ -24,6 +24,8 @@
import android.text.TextUtils;
import android.util.Log;
+import com.android.net.module.util.ProxyUtils;
+
import java.net.InetSocketAddress;
import java.net.ProxySelector;
import java.net.URI;
@@ -251,7 +253,7 @@
if (p != null) {
host = p.getHost();
port = Integer.toString(p.getPort());
- exclList = p.getExclusionListAsString();
+ exclList = ProxyUtils.exclusionListAsString(p.getExclusionList());
pacFileUrl = p.getPacFileUrl();
}
setHttpProxySystemProperty(host, port, exclList, pacFileUrl);
diff --git a/wifi/aidl-export/android/net/wifi/CoexUnsafeChannel.aidl b/core/java/android/net/TcpKeepalivePacketData.aidl
similarity index 77%
copy from wifi/aidl-export/android/net/wifi/CoexUnsafeChannel.aidl
copy to core/java/android/net/TcpKeepalivePacketData.aidl
index cb359e9..fdc7af9 100644
--- a/wifi/aidl-export/android/net/wifi/CoexUnsafeChannel.aidl
+++ b/core/java/android/net/TcpKeepalivePacketData.aidl
@@ -10,10 +10,9 @@
* 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
+ * See the License for the specific language governing perNmissions and
* limitations under the License.
*/
+package android.net;
-package android.net.wifi;
-
-parcelable CoexUnsafeChannel;
+@JavaOnlyStableParcelable parcelable TcpKeepalivePacketData;
diff --git a/core/java/android/net/vcn/VcnConfig.java b/core/java/android/net/vcn/VcnConfig.java
index 148acf1..d4a3fa7 100644
--- a/core/java/android/net/vcn/VcnConfig.java
+++ b/core/java/android/net/vcn/VcnConfig.java
@@ -15,30 +15,104 @@
*/
package android.net.vcn;
+import static com.android.internal.annotations.VisibleForTesting.Visibility;
+
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.os.Parcel;
import android.os.Parcelable;
+import android.os.PersistableBundle;
+import android.util.ArraySet;
+
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.util.Preconditions;
+import com.android.server.vcn.util.PersistableBundleUtils;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Objects;
+import java.util.Set;
/**
* This class represents a configuration for a Virtual Carrier Network.
*
+ * <p>Each {@link VcnGatewayConnectionConfig} instance added represents a connection that will be
+ * brought up on demand based on active {@link NetworkRequest}(s).
+ *
+ * @see VcnManager for more information on the Virtual Carrier Network feature
* @hide
*/
public final class VcnConfig implements Parcelable {
@NonNull private static final String TAG = VcnConfig.class.getSimpleName();
- private VcnConfig() {
+ private static final String GATEWAY_CONNECTION_CONFIGS_KEY = "mGatewayConnectionConfigs";
+ @NonNull private final Set<VcnGatewayConnectionConfig> mGatewayConnectionConfigs;
+
+ private VcnConfig(@NonNull Set<VcnGatewayConnectionConfig> tunnelConfigs) {
+ mGatewayConnectionConfigs = Collections.unmodifiableSet(tunnelConfigs);
+
validate();
}
- // TODO: Implement getters, validators, etc
/**
- * Validates this configuration.
+ * Deserializes a VcnConfig from a PersistableBundle.
*
* @hide
*/
+ @VisibleForTesting(visibility = Visibility.PRIVATE)
+ public VcnConfig(@NonNull PersistableBundle in) {
+ final PersistableBundle gatewayConnectionConfigsBundle =
+ in.getPersistableBundle(GATEWAY_CONNECTION_CONFIGS_KEY);
+ mGatewayConnectionConfigs =
+ new ArraySet<>(
+ PersistableBundleUtils.toList(
+ gatewayConnectionConfigsBundle, VcnGatewayConnectionConfig::new));
+
+ validate();
+ }
+
private void validate() {
- // TODO: implement validation logic
+ Preconditions.checkCollectionNotEmpty(
+ mGatewayConnectionConfigs, "gatewayConnectionConfigs");
+ }
+
+ /** Retrieves the set of configured tunnels. */
+ @NonNull
+ public Set<VcnGatewayConnectionConfig> getGatewayConnectionConfigs() {
+ return Collections.unmodifiableSet(mGatewayConnectionConfigs);
+ }
+
+ /**
+ * Serializes this object to a PersistableBundle.
+ *
+ * @hide
+ */
+ @NonNull
+ public PersistableBundle toPersistableBundle() {
+ final PersistableBundle result = new PersistableBundle();
+
+ final PersistableBundle gatewayConnectionConfigsBundle =
+ PersistableBundleUtils.fromList(
+ new ArrayList<>(mGatewayConnectionConfigs),
+ VcnGatewayConnectionConfig::toPersistableBundle);
+ result.putPersistableBundle(GATEWAY_CONNECTION_CONFIGS_KEY, gatewayConnectionConfigsBundle);
+
+ return result;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mGatewayConnectionConfigs);
+ }
+
+ @Override
+ public boolean equals(@Nullable Object other) {
+ if (!(other instanceof VcnConfig)) {
+ return false;
+ }
+
+ final VcnConfig rhs = (VcnConfig) other;
+ return mGatewayConnectionConfigs.equals(rhs.mGatewayConnectionConfigs);
}
// Parcelable methods
@@ -49,15 +123,16 @@
}
@Override
- public void writeToParcel(Parcel out, int flags) {}
+ public void writeToParcel(Parcel out, int flags) {
+ out.writeParcelable(toPersistableBundle(), flags);
+ }
@NonNull
public static final Parcelable.Creator<VcnConfig> CREATOR =
new Parcelable.Creator<VcnConfig>() {
@NonNull
public VcnConfig createFromParcel(Parcel in) {
- // TODO: Ensure all methods are pulled from the parcels
- return new VcnConfig();
+ return new VcnConfig((PersistableBundle) in.readParcelable(null));
}
@NonNull
@@ -68,7 +143,23 @@
/** This class is used to incrementally build {@link VcnConfig} objects. */
public static class Builder {
- // TODO: Implement this builder
+ @NonNull
+ private final Set<VcnGatewayConnectionConfig> mGatewayConnectionConfigs = new ArraySet<>();
+
+ /**
+ * Adds a configuration for an individual gateway connection.
+ *
+ * @param gatewayConnectionConfig the configuration for an individual gateway connection
+ * @return this {@link Builder} instance, for chaining
+ */
+ @NonNull
+ public Builder addGatewayConnectionConfig(
+ @NonNull VcnGatewayConnectionConfig gatewayConnectionConfig) {
+ Objects.requireNonNull(gatewayConnectionConfig, "gatewayConnectionConfig was null");
+
+ mGatewayConnectionConfigs.add(gatewayConnectionConfig);
+ return this;
+ }
/**
* Builds and validates the VcnConfig.
@@ -77,7 +168,7 @@
*/
@NonNull
public VcnConfig build() {
- return new VcnConfig();
+ return new VcnConfig(mGatewayConnectionConfigs);
}
}
}
diff --git a/core/java/android/net/vcn/VcnGatewayConnectionConfig.java b/core/java/android/net/vcn/VcnGatewayConnectionConfig.java
index 8160edc..039360a 100644
--- a/core/java/android/net/vcn/VcnGatewayConnectionConfig.java
+++ b/core/java/android/net/vcn/VcnGatewayConnectionConfig.java
@@ -15,7 +15,27 @@
*/
package android.net.vcn;
+import static android.net.NetworkCapabilities.NetCapability;
+
+import static com.android.internal.annotations.VisibleForTesting.Visibility;
+
+import android.annotation.IntRange;
import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.net.NetworkCapabilities;
+import android.os.PersistableBundle;
+import android.util.ArraySet;
+
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.util.Preconditions;
+import com.android.server.vcn.util.PersistableBundleUtils;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
/**
* This class represents a configuration for a connection to a Virtual Carrier Network gateway.
@@ -49,38 +69,399 @@
* <li>{@link android.net.NetworkCapabilities.NET_CAPABILITY_MCX}
* </ul>
*
+ * <p>The meteredness and roaming of the VCN {@link Network} will be determined by that of the
+ * underlying Network(s).
+ *
* @hide
*/
public final class VcnGatewayConnectionConfig {
- private VcnGatewayConnectionConfig() {
+ // TODO: Use MIN_MTU_V6 once it is public, @hide
+ @VisibleForTesting(visibility = Visibility.PRIVATE)
+ static final int MIN_MTU_V6 = 1280;
+
+ private static final Set<Integer> ALLOWED_CAPABILITIES;
+
+ static {
+ Set<Integer> allowedCaps = new ArraySet<>();
+ allowedCaps.add(NetworkCapabilities.NET_CAPABILITY_MMS);
+ allowedCaps.add(NetworkCapabilities.NET_CAPABILITY_SUPL);
+ allowedCaps.add(NetworkCapabilities.NET_CAPABILITY_DUN);
+ allowedCaps.add(NetworkCapabilities.NET_CAPABILITY_FOTA);
+ allowedCaps.add(NetworkCapabilities.NET_CAPABILITY_IMS);
+ allowedCaps.add(NetworkCapabilities.NET_CAPABILITY_CBS);
+ allowedCaps.add(NetworkCapabilities.NET_CAPABILITY_IA);
+ allowedCaps.add(NetworkCapabilities.NET_CAPABILITY_RCS);
+ allowedCaps.add(NetworkCapabilities.NET_CAPABILITY_XCAP);
+ allowedCaps.add(NetworkCapabilities.NET_CAPABILITY_EIMS);
+ allowedCaps.add(NetworkCapabilities.NET_CAPABILITY_INTERNET);
+ allowedCaps.add(NetworkCapabilities.NET_CAPABILITY_MCX);
+
+ ALLOWED_CAPABILITIES = Collections.unmodifiableSet(allowedCaps);
+ }
+
+ private static final int DEFAULT_MAX_MTU = 1500;
+
+ /**
+ * The maximum number of retry intervals that may be specified.
+ *
+ * <p>Limited to ensure an upper bound on config sizes.
+ */
+ private static final int MAX_RETRY_INTERVAL_COUNT = 10;
+
+ /**
+ * The minimum allowable repeating retry interval
+ *
+ * <p>To ensure the device is not constantly being woken up, this retry interval MUST be greater
+ * than this value.
+ *
+ * @see {@link Builder#setRetryInterval()}
+ */
+ private static final long MINIMUM_REPEATING_RETRY_INTERVAL_MS = TimeUnit.MINUTES.toMillis(15);
+
+ private static final long[] DEFAULT_RETRY_INTERVALS_MS =
+ new long[] {
+ TimeUnit.SECONDS.toMillis(1),
+ TimeUnit.SECONDS.toMillis(2),
+ TimeUnit.SECONDS.toMillis(5),
+ TimeUnit.SECONDS.toMillis(30),
+ TimeUnit.MINUTES.toMillis(1),
+ TimeUnit.MINUTES.toMillis(5),
+ TimeUnit.MINUTES.toMillis(15)
+ };
+
+ private static final String EXPOSED_CAPABILITIES_KEY = "mExposedCapabilities";
+ @NonNull private final Set<Integer> mExposedCapabilities;
+
+ private static final String UNDERLYING_CAPABILITIES_KEY = "mUnderlyingCapabilities";
+ @NonNull private final Set<Integer> mUnderlyingCapabilities;
+
+ // TODO: Add Ike/ChildSessionParams as a subclass - maybe VcnIkeGatewayConnectionConfig
+
+ private static final String MAX_MTU_KEY = "mMaxMtu";
+ private final int mMaxMtu;
+
+ private static final String RETRY_INTERVAL_MS_KEY = "mRetryIntervalsMs";
+ @NonNull private final long[] mRetryIntervalsMs;
+
+ @VisibleForTesting(visibility = Visibility.PRIVATE)
+ public VcnGatewayConnectionConfig(
+ @NonNull Set<Integer> exposedCapabilities,
+ @NonNull Set<Integer> underlyingCapabilities,
+ @NonNull long[] retryIntervalsMs,
+ @IntRange(from = MIN_MTU_V6) int maxMtu) {
+ mExposedCapabilities = exposedCapabilities;
+ mUnderlyingCapabilities = underlyingCapabilities;
+ mRetryIntervalsMs = retryIntervalsMs;
+ mMaxMtu = maxMtu;
+
validate();
}
- // TODO: Implement getters, validators, etc
+ /** @hide */
+ @VisibleForTesting(visibility = Visibility.PRIVATE)
+ public VcnGatewayConnectionConfig(@NonNull PersistableBundle in) {
+ final PersistableBundle exposedCapsBundle =
+ in.getPersistableBundle(EXPOSED_CAPABILITIES_KEY);
+ final PersistableBundle underlyingCapsBundle =
+ in.getPersistableBundle(UNDERLYING_CAPABILITIES_KEY);
+
+ mExposedCapabilities = new ArraySet<>(PersistableBundleUtils.toList(
+ exposedCapsBundle, PersistableBundleUtils.INTEGER_DESERIALIZER));
+ mUnderlyingCapabilities = new ArraySet<>(PersistableBundleUtils.toList(
+ underlyingCapsBundle, PersistableBundleUtils.INTEGER_DESERIALIZER));
+ mRetryIntervalsMs = in.getLongArray(RETRY_INTERVAL_MS_KEY);
+ mMaxMtu = in.getInt(MAX_MTU_KEY);
+
+ validate();
+ }
+
+ private void validate() {
+ Preconditions.checkArgument(
+ mExposedCapabilities != null && !mExposedCapabilities.isEmpty(),
+ "exposedCapsBundle was null or empty");
+ for (Integer cap : getAllExposedCapabilities()) {
+ checkValidCapability(cap);
+ }
+
+ Preconditions.checkArgument(
+ mUnderlyingCapabilities != null && !mUnderlyingCapabilities.isEmpty(),
+ "underlyingCapabilities was null or empty");
+ for (Integer cap : getAllUnderlyingCapabilities()) {
+ checkValidCapability(cap);
+ }
+
+ Objects.requireNonNull(mRetryIntervalsMs, "retryIntervalsMs was null");
+ validateRetryInterval(mRetryIntervalsMs);
+
+ Preconditions.checkArgument(
+ mMaxMtu >= MIN_MTU_V6, "maxMtu must be at least IPv6 min MTU (1280)");
+ }
+
+ private static void checkValidCapability(int capability) {
+ Preconditions.checkArgument(
+ ALLOWED_CAPABILITIES.contains(capability),
+ "NetworkCapability " + capability + "out of range");
+ }
+
+ private static void validateRetryInterval(@Nullable long[] retryIntervalsMs) {
+ Preconditions.checkArgument(
+ retryIntervalsMs != null
+ && retryIntervalsMs.length > 0
+ && retryIntervalsMs.length <= MAX_RETRY_INTERVAL_COUNT,
+ "retryIntervalsMs was null, empty or exceed max interval count");
+
+ final long repeatingInterval = retryIntervalsMs[retryIntervalsMs.length - 1];
+ if (repeatingInterval < MINIMUM_REPEATING_RETRY_INTERVAL_MS) {
+ throw new IllegalArgumentException(
+ "Repeating retry interval was too short, must be a minimum of 15 minutes: "
+ + repeatingInterval);
+ }
+ }
/**
- * Validates this configuration
+ * Returns all exposed capabilities.
*
* @hide
*/
- private void validate() {
- // TODO: implement validation logic
+ @NonNull
+ public Set<Integer> getAllExposedCapabilities() {
+ return Collections.unmodifiableSet(mExposedCapabilities);
}
- // Parcelable methods
+ /**
+ * Checks if this config is configured to support/expose a specific capability.
+ *
+ * @param capability the capability to check for
+ */
+ public boolean hasExposedCapability(@NetCapability int capability) {
+ checkValidCapability(capability);
- /** This class is used to incrementally build {@link VcnGatewayConnectionConfig} objects */
+ return mExposedCapabilities.contains(capability);
+ }
+
+ /**
+ * Returns all capabilities required of underlying networks.
+ *
+ * @hide
+ */
+ @NonNull
+ public Set<Integer> getAllUnderlyingCapabilities() {
+ return Collections.unmodifiableSet(mUnderlyingCapabilities);
+ }
+
+ /**
+ * Checks if this config requires an underlying network to have the specified capability.
+ *
+ * @param capability the capability to check for
+ */
+ public boolean requiresUnderlyingCapability(@NetCapability int capability) {
+ checkValidCapability(capability);
+
+ return mUnderlyingCapabilities.contains(capability);
+ }
+
+ /** Retrieves the configured retry intervals. */
+ @NonNull
+ public long[] getRetryIntervalsMs() {
+ return Arrays.copyOf(mRetryIntervalsMs, mRetryIntervalsMs.length);
+ }
+
+ /** Retrieves the maximum MTU allowed for this Gateway Connection. */
+ @IntRange(from = MIN_MTU_V6)
+ public int getMaxMtu() {
+ return mMaxMtu;
+ }
+
+ /**
+ * Converts this config to a PersistableBundle.
+ *
+ * @hide
+ */
+ @NonNull
+ @VisibleForTesting(visibility = Visibility.PROTECTED)
+ public PersistableBundle toPersistableBundle() {
+ final PersistableBundle result = new PersistableBundle();
+
+ final PersistableBundle exposedCapsBundle =
+ PersistableBundleUtils.fromList(
+ new ArrayList<>(mExposedCapabilities),
+ PersistableBundleUtils.INTEGER_SERIALIZER);
+ final PersistableBundle underlyingCapsBundle =
+ PersistableBundleUtils.fromList(
+ new ArrayList<>(mUnderlyingCapabilities),
+ PersistableBundleUtils.INTEGER_SERIALIZER);
+
+ result.putPersistableBundle(EXPOSED_CAPABILITIES_KEY, exposedCapsBundle);
+ result.putPersistableBundle(UNDERLYING_CAPABILITIES_KEY, underlyingCapsBundle);
+ result.putLongArray(RETRY_INTERVAL_MS_KEY, mRetryIntervalsMs);
+ result.putInt(MAX_MTU_KEY, mMaxMtu);
+
+ return result;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ mExposedCapabilities,
+ mUnderlyingCapabilities,
+ Arrays.hashCode(mRetryIntervalsMs),
+ mMaxMtu);
+ }
+
+ @Override
+ public boolean equals(@Nullable Object other) {
+ if (!(other instanceof VcnGatewayConnectionConfig)) {
+ return false;
+ }
+
+ final VcnGatewayConnectionConfig rhs = (VcnGatewayConnectionConfig) other;
+ return mExposedCapabilities.equals(rhs.mExposedCapabilities)
+ && mUnderlyingCapabilities.equals(rhs.mUnderlyingCapabilities)
+ && Arrays.equals(mRetryIntervalsMs, rhs.mRetryIntervalsMs)
+ && mMaxMtu == rhs.mMaxMtu;
+ }
+
+ /** This class is used to incrementally build {@link VcnGatewayConnectionConfig} objects. */
public static class Builder {
- // TODO: Implement this builder
+ @NonNull private final Set<Integer> mExposedCapabilities = new ArraySet();
+ @NonNull private final Set<Integer> mUnderlyingCapabilities = new ArraySet();
+ @NonNull private long[] mRetryIntervalsMs = DEFAULT_RETRY_INTERVALS_MS;
+ private int mMaxMtu = DEFAULT_MAX_MTU;
+
+ // TODO: (b/175829816) Consider VCN-exposed capabilities that may be transport dependent.
+ // Consider the case where the VCN might only expose MMS on WiFi, but defer to MMS
+ // when on Cell.
/**
- * Builds and validates the VcnGatewayConnectionConfig
+ * Add a capability that this VCN Gateway Connection will support.
+ *
+ * @param exposedCapability the app-facing capability to be exposed by this VCN Gateway
+ * Connection (i.e., the capabilities that this VCN Gateway Connection will support).
+ * @return this {@link Builder} instance, for chaining
+ * @see VcnGatewayConnectionConfig for a list of capabilities may be exposed by a Gateway
+ * Connection
+ */
+ public Builder addExposedCapability(@NetCapability int exposedCapability) {
+ checkValidCapability(exposedCapability);
+
+ mExposedCapabilities.add(exposedCapability);
+ return this;
+ }
+
+ /**
+ * Remove a capability that this VCN Gateway Connection will support.
+ *
+ * @param exposedCapability the app-facing capability to not be exposed by this VCN Gateway
+ * Connection (i.e., the capabilities that this VCN Gateway Connection will support)
+ * @return this {@link Builder} instance, for chaining
+ * @see VcnGatewayConnectionConfig for a list of capabilities may be exposed by a Gateway
+ * Connection
+ */
+ public Builder removeExposedCapability(@NetCapability int exposedCapability) {
+ checkValidCapability(exposedCapability);
+
+ mExposedCapabilities.remove(exposedCapability);
+ return this;
+ }
+
+ /**
+ * Require a capability for Networks underlying this VCN Gateway Connection.
+ *
+ * @param underlyingCapability the capability that a network MUST have in order to be an
+ * underlying network for this VCN Gateway Connection.
+ * @return this {@link Builder} instance, for chaining
+ * @see VcnGatewayConnectionConfig for a list of capabilities may be required of underlying
+ * networks
+ */
+ public Builder addRequiredUnderlyingCapability(@NetCapability int underlyingCapability) {
+ checkValidCapability(underlyingCapability);
+
+ mUnderlyingCapabilities.add(underlyingCapability);
+ return this;
+ }
+
+ /**
+ * Remove a requirement of a capability for Networks underlying this VCN Gateway Connection.
+ *
+ * <p>Calling this method will allow Networks that do NOT have this capability to be
+ * selected as an underlying network for this VCN Gateway Connection. However, underlying
+ * networks MAY still have the removed capability.
+ *
+ * @param underlyingCapability the capability that a network DOES NOT need to have in order
+ * to be an underlying network for this VCN Gateway Connection.
+ * @return this {@link Builder} instance, for chaining
+ * @see VcnGatewayConnectionConfig for a list of capabilities may be required of underlying
+ * networks
+ */
+ public Builder removeRequiredUnderlyingCapability(@NetCapability int underlyingCapability) {
+ checkValidCapability(underlyingCapability);
+
+ mUnderlyingCapabilities.remove(underlyingCapability);
+ return this;
+ }
+
+ /**
+ * Set the retry interval between VCN establishment attempts upon successive failures.
+ *
+ * <p>The last retry interval will be repeated until safe mode is entered, or a connection
+ * is successfully established, at which point the retry timers will be reset. For power
+ * reasons, the last (repeated) retry interval MUST be at least 15 minutes.
+ *
+ * <p>Retry intervals MAY be subject to system power saving modes. That is to say that if
+ * the system enters a power saving mode, the retry may not occur until the device leaves
+ * the specified power saving mode. Intervals are sequential, and intervals will NOT be
+ * skipped if system power saving results in delaying retries (even if it exceed multiple
+ * retry intervals).
+ *
+ * <p>Each Gateway Connection will retry according to the retry intervals configured, but if
+ * safe mode is enabled, all Gateway Connection(s) will be disabled.
+ *
+ * @param retryIntervalsMs an array of between 1 and 10 millisecond intervals after which
+ * the VCN will attempt to retry a session initiation. The last (repeating) retry
+ * interval must be at least 15 minutes. Defaults to: {@code [1s, 2s, 5s, 30s, 1m, 5m,
+ * 15m]}
+ * @return this {@link Builder} instance, for chaining
+ * @see VcnManager for additional discussion on fail-safe mode
+ */
+ @NonNull
+ public Builder setRetryInterval(@NonNull long[] retryIntervalsMs) {
+ validateRetryInterval(retryIntervalsMs);
+
+ mRetryIntervalsMs = retryIntervalsMs;
+ return this;
+ }
+
+ /**
+ * Sets the maximum MTU allowed for this VCN Gateway Connection.
+ *
+ * <p>This MTU is applied to the VCN Gateway Connection exposed Networks, and represents the
+ * MTU of the virtualized network.
+ *
+ * <p>The system may reduce the MTU below the maximum specified based on signals such as the
+ * MTU of the underlying networks (and adjusted for Gateway Connection overhead).
+ *
+ * @param maxMtu the maximum MTU allowed for this Gateway Connection. Must be greater than
+ * the IPv6 minimum MTU of 1280. Defaults to 1500.
+ * @return this {@link Builder} instance, for chaining
+ */
+ @NonNull
+ public Builder setMaxMtu(@IntRange(from = MIN_MTU_V6) int maxMtu) {
+ Preconditions.checkArgument(
+ maxMtu >= MIN_MTU_V6, "maxMtu must be at least IPv6 min MTU (1280)");
+
+ mMaxMtu = maxMtu;
+ return this;
+ }
+
+ /**
+ * Builds and validates the VcnGatewayConnectionConfig.
*
* @return an immutable VcnGatewayConnectionConfig instance
*/
@NonNull
public VcnGatewayConnectionConfig build() {
- return new VcnGatewayConnectionConfig();
+ return new VcnGatewayConnectionConfig(
+ mExposedCapabilities, mUnderlyingCapabilities, mRetryIntervalsMs, mMaxMtu);
}
}
}
diff --git a/core/java/android/net/vcn/VcnManager.java b/core/java/android/net/vcn/VcnManager.java
index 6769b9e..19c183f 100644
--- a/core/java/android/net/vcn/VcnManager.java
+++ b/core/java/android/net/vcn/VcnManager.java
@@ -23,10 +23,37 @@
import android.content.Context;
import android.os.ParcelUuid;
import android.os.RemoteException;
+import android.os.ServiceSpecificException;
+
+import java.io.IOException;
/**
* VcnManager publishes APIs for applications to configure and manage Virtual Carrier Networks.
*
+ * <p>A VCN creates a virtualization layer to allow MVNOs to aggregate heterogeneous physical
+ * networks, unifying them as a single carrier network. This enables infrastructure flexibility on
+ * the part of MVNOs without impacting user connectivity, abstracting the physical network
+ * technologies as an implementation detail of their public network.
+ *
+ * <p>Each VCN virtualizes an Carrier's network by building tunnels to a carrier's core network over
+ * carrier-managed physical links and supports a IP mobility layer to ensure seamless transitions
+ * between the underlying networks. Each VCN is configured based on a Subscription Group (see {@link
+ * android.telephony.SubscriptionManager}) and aggregates all networks that are brought up based on
+ * a profile or suggestion in the specified Subscription Group.
+ *
+ * <p>The VCN can be configured to expose one or more {@link android.net.Network}(s), each with
+ * different capabilities, allowing for APN virtualization.
+ *
+ * <p>If a tunnel fails to connect, or otherwise encounters a fatal error, the VCN will attempt to
+ * reestablish the connection. If the tunnel still has not reconnected after a system-determined
+ * timeout, the VCN Safe Mode (see below) will be entered.
+ *
+ * <p>The VCN Safe Mode ensures that users (and carriers) have a fallback to restore system
+ * connectivity to update profiles, diagnose issues, contact support, or perform other remediation
+ * tasks. In Safe Mode, the system will allow underlying cellular networks to be used as default.
+ * Additionally, during Safe Mode, the VCN will continue to retry the connections, and will
+ * automatically exit Safe Mode if all active tunnels connect successfully.
+ *
* @hide
*/
@SystemService(Context.VCN_MANAGEMENT_SERVICE)
@@ -63,15 +90,20 @@
* @param config the configuration parameters for the VCN
* @throws SecurityException if the caller does not have carrier privileges, or is not running
* as the primary user
+ * @throws IOException if the configuration failed to be persisted. A caller encountering this
+ * exception should attempt to retry (possibly after a delay).
* @hide
*/
@RequiresPermission("carrier privileges") // TODO (b/72967236): Define a system-wide constant
- public void setVcnConfig(@NonNull ParcelUuid subscriptionGroup, @NonNull VcnConfig config) {
+ public void setVcnConfig(@NonNull ParcelUuid subscriptionGroup, @NonNull VcnConfig config)
+ throws IOException {
requireNonNull(subscriptionGroup, "subscriptionGroup was null");
requireNonNull(config, "config was null");
try {
mService.setVcnConfig(subscriptionGroup, config);
+ } catch (ServiceSpecificException e) {
+ throw new IOException(e);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -88,14 +120,18 @@
* @param subscriptionGroup the subscription group that the configuration should be applied to
* @throws SecurityException if the caller does not have carrier privileges, or is not running
* as the primary user
+ * @throws IOException if the configuration failed to be cleared. A caller encountering this
+ * exception should attempt to retry (possibly after a delay).
* @hide
*/
@RequiresPermission("carrier privileges") // TODO (b/72967236): Define a system-wide constant
- public void clearVcnConfig(@NonNull ParcelUuid subscriptionGroup) {
+ public void clearVcnConfig(@NonNull ParcelUuid subscriptionGroup) throws IOException {
requireNonNull(subscriptionGroup, "subscriptionGroup was null");
try {
mService.clearVcnConfig(subscriptionGroup);
+ } catch (ServiceSpecificException e) {
+ throw new IOException(e);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
diff --git a/core/java/android/os/BatteryStatsManager.java b/core/java/android/os/BatteryStatsManager.java
index f344208..f21a812 100644
--- a/core/java/android/os/BatteryStatsManager.java
+++ b/core/java/android/os/BatteryStatsManager.java
@@ -26,6 +26,7 @@
import android.content.Context;
import android.os.connectivity.CellularBatteryStats;
import android.os.connectivity.WifiBatteryStats;
+import android.telephony.DataConnectionRealTimeInfo;
import com.android.internal.app.IBatteryStats;
@@ -405,4 +406,50 @@
e.rethrowFromSystemServer();
}
}
+
+ /**
+ * Indicates that the radio power state has changed.
+ *
+ * @param isActive indicates if the mobile radio is powered.
+ * @param uid Uid of this event. For the active state it represents the uid that was responsible
+ * for waking the radio, or -1 if the system was responsible for waking the radio.
+ * For inactive state, the UID should always be -1.
+ * @throws RuntimeException if there are binder remote-invocation errors.
+ */
+ @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS)
+ public void reportMobileRadioPowerState(boolean isActive, int uid) throws RuntimeException {
+ try {
+ mBatteryStats.noteMobileRadioPowerState(getDataConnectionPowerState(isActive),
+ SystemClock.elapsedRealtimeNanos(), uid);
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Indicates that the wifi power state has changed.
+ *
+ * @param isActive indicates if the wifi radio is powered.
+ * @param uid Uid of this event. For the active state it represents the uid that was responsible
+ * for waking the radio, or -1 if the system was responsible for waking the radio.
+ * For inactive state, the UID should always be -1.
+ * @throws RuntimeException if there are binder remote-invocation errors.
+ */
+ @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS)
+ public void reportWifiRadioPowerState(boolean isActive, int uid) throws RuntimeException {
+ try {
+ mBatteryStats.noteWifiRadioPowerState(getDataConnectionPowerState(isActive),
+ SystemClock.elapsedRealtimeNanos(), uid);
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ private static int getDataConnectionPowerState(boolean isActive) {
+ // TODO: DataConnectionRealTimeInfo is under telephony package but the constants are used
+ // for both Wifi and mobile. It would make more sense to separate the constants to a generic
+ // class or move it to generic package.
+ return isActive ? DataConnectionRealTimeInfo.DC_POWER_STATE_HIGH
+ : DataConnectionRealTimeInfo.DC_POWER_STATE_LOW;
+ }
}
diff --git a/core/java/android/os/Debug.java b/core/java/android/os/Debug.java
index e2e1bbe..9584bc7 100644
--- a/core/java/android/os/Debug.java
+++ b/core/java/android/os/Debug.java
@@ -2582,6 +2582,13 @@
public static native long getIonMappedSizeKb();
/**
+ * Return memory size in kilobytes used by GPU.
+ *
+ * @hide
+ */
+ public static native long getGpuTotalUsageKb();
+
+ /**
* Return whether virtually-mapped kernel stacks are enabled (CONFIG_VMAP_STACK).
* Note: caller needs config_gz read sepolicy permission
*
diff --git a/core/java/android/os/INetworkManagementService.aidl b/core/java/android/os/INetworkManagementService.aidl
index 25d84ba..33dedda 100644
--- a/core/java/android/os/INetworkManagementService.aidl
+++ b/core/java/android/os/INetworkManagementService.aidl
@@ -282,8 +282,8 @@
/**
* Control network activity of a UID over interfaces with a quota limit.
*/
- void setUidMeteredNetworkDenylist(int uid, boolean enable);
- void setUidMeteredNetworkAllowlist(int uid, boolean enable);
+ void setUidOnMeteredNetworkDenylist(int uid, boolean enable);
+ void setUidOnMeteredNetworkAllowlist(int uid, boolean enable);
boolean setDataSaverModeEnabled(boolean enable);
void setUidCleartextNetworkPolicy(int uid, int policy);
diff --git a/core/java/android/os/IRecoverySystem.aidl b/core/java/android/os/IRecoverySystem.aidl
index 5f8b932..2052883 100644
--- a/core/java/android/os/IRecoverySystem.aidl
+++ b/core/java/android/os/IRecoverySystem.aidl
@@ -30,5 +30,6 @@
boolean requestLskf(in String packageName, in IntentSender sender);
boolean clearLskf(in String packageName);
boolean isLskfCaptured(in String packageName);
+ boolean rebootWithLskfAssumeSlotSwitch(in String packageName, in String reason);
boolean rebootWithLskf(in String packageName, in String reason, in boolean slotSwitch);
}
diff --git a/core/java/android/os/OWNERS b/core/java/android/os/OWNERS
index 49451d9..e3ad4e6 100644
--- a/core/java/android/os/OWNERS
+++ b/core/java/android/os/OWNERS
@@ -23,6 +23,34 @@
per-file BatteryUsageStats* = file:/BATTERY_STATS_OWNERS
per-file PowerComponents.java = file:/BATTERY_STATS_OWNERS
+# Binder
+per-file BadParcelableException.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file Binder.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file BinderProxy.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file DeadObjectException.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file IBinder.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file Parcel.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file ParcelFileDescriptor.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file ParcelFormatException.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file Parcelable.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file ParcelableException.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file ParcelableHolder.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file ParcelableParcel.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file RemoteException.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file ServiceManager.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file ServiceManagerNative.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file ServiceSpecificException.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file TransactionTooLargeException.java = file:platform/frameworks/native:/libs/binder/OWNERS
+
+# HwBinder
+per-file HwBinder.java = file:platform/system/libhwbinder:/OWNERS
+per-file HwBlob.java = file:platform/system/libhwbinder:/OWNERS
+per-file HwParcel.java = file:platform/system/libhwbinder:/OWNERS
+per-file HwParcel.java = file:platform/system/libhwbinder:/OWNERS
+per-file HwRemoteBinder.java = file:platform/system/libhwbinder:/OWNERS
+per-file IHwBinder.java = file:platform/system/libhwbinder:/OWNERS
+per-file IHwInterface.java = file:platform/system/libhwbinder:/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
diff --git a/core/java/android/os/ParcelableHolder.java b/core/java/android/os/ParcelableHolder.java
index 1be367c..368ee2d 100644
--- a/core/java/android/os/ParcelableHolder.java
+++ b/core/java/android/os/ParcelableHolder.java
@@ -63,6 +63,8 @@
* op.y = ...;
* ap.extension.setParcelable(op);}</pre>
*
+ * <p class="note">ParcelableHolder is <strong>not</strong> thread-safe.</p>
+ *
* @hide
*/
@SystemApi
@@ -120,6 +122,7 @@
/**
* Write a parcelable into ParcelableHolder, the previous parcelable will be removed.
+ * (@link #setParcelable} and (@link #getParcelable} are not thread-safe.
* @throws BadParcelableException if the parcelable's stability is more unstable
* ParcelableHolder.
*/
@@ -139,6 +142,8 @@
}
/**
+ * Read a parcelable from ParcelableHolder.
+ * (@link #setParcelable} and (@link #getParcelable} are not thread-safe.
* @return the parcelable that was written by {@link #setParcelable} or {@link #readFromParcel},
* or {@code null} if the parcelable has not been written.
* @throws BadParcelableException if T is different from the type written by
diff --git a/core/java/android/os/RecoverySystem.java b/core/java/android/os/RecoverySystem.java
index 5f3cfa3..93c1690 100644
--- a/core/java/android/os/RecoverySystem.java
+++ b/core/java/android/os/RecoverySystem.java
@@ -687,8 +687,8 @@
}
/**
- * Request that the device reboot and apply the update that has been prepared. Callers are
- * recommended to use {@link #rebootAndApply(Context, String, boolean)} instead.
+ * Request that the device reboot and apply the update that has been prepared. This API is
+ * deprecated, and is expected to be used by OTA only on devices running Android 11.
*
* @param context the Context to use.
* @param updateToken this parameter is deprecated and won't be used. See details in
@@ -699,18 +699,18 @@
* unattended reboot or if the {@code updateToken} did not match the previously
* given token
* @hide
+ * @deprecated Use {@link #rebootAndApply(Context, String, boolean)} instead
*/
@SystemApi
- @RequiresPermission(anyOf = {android.Manifest.permission.RECOVERY,
- android.Manifest.permission.REBOOT})
+ @RequiresPermission(android.Manifest.permission.RECOVERY)
public static void rebootAndApply(@NonNull Context context, @NonNull String updateToken,
@NonNull String reason) throws IOException {
if (updateToken == null) {
throw new NullPointerException("updateToken == null");
}
RecoverySystem rs = (RecoverySystem) context.getSystemService(Context.RECOVERY_SERVICE);
- // OTA is the sole user before S, and a slot switch is required for ota update.
- if (!rs.rebootWithLskf(context.getPackageName(), reason, true)) {
+ // OTA is the sole user, who expects a slot switch.
+ if (!rs.rebootWithLskfAssumeSlotSwitch(context.getPackageName(), reason)) {
throw new IOException("system not prepared to apply update");
}
}
@@ -738,7 +738,7 @@
*
* @param context the Context to use.
* @param reason the reboot reason to give to the {@link PowerManager}
- * @param slotSwitch true if the caller intends to switch the slot on an A/B device.
+ * @param slotSwitch true if the caller expects the slot to be switched on A/B devices.
* @throws IOException if the reboot couldn't proceed because the device wasn't ready for an
* unattended reboot.
* @hide
@@ -1395,6 +1395,21 @@
}
}
+
+ /**
+ * Calls the recovery system service to reboot and apply update. This is the legacy API and
+ * expects a slot switch for A/B devices.
+ *
+ */
+ private boolean rebootWithLskfAssumeSlotSwitch(String packageName, String reason)
+ throws IOException {
+ try {
+ return mService.rebootWithLskfAssumeSlotSwitch(packageName, reason);
+ } catch (RemoteException e) {
+ throw new IOException("could not reboot for update");
+ }
+ }
+
/**
* Internally, recovery treats each line of the command file as a separate
* argv, so we only need to protect against newlines and nulls.
diff --git a/core/java/android/os/TransactionTooLargeException.java b/core/java/android/os/TransactionTooLargeException.java
index 10abf26..4d5b2a1 100644
--- a/core/java/android/os/TransactionTooLargeException.java
+++ b/core/java/android/os/TransactionTooLargeException.java
@@ -23,9 +23,11 @@
* During a remote procedure call, the arguments and the return value of the call
* are transferred as {@link Parcel} objects stored in the Binder transaction buffer.
* If the arguments or the return value are too large to fit in the transaction buffer,
- * then the call will fail and {@link TransactionTooLargeException} will be thrown.
+ * then the call will fail. {@link TransactionTooLargeException} is thrown as a
+ * heuristic when a transaction is large, and it fails, since these are the transactions
+ * which are most likely to overfill the transaction buffer.
* </p><p>
- * The Binder transaction buffer has a limited fixed size, currently 1Mb, which
+ * The Binder transaction buffer has a limited fixed size, currently 1MB, which
* is shared by all transactions in progress for the process. Consequently this
* exception can be thrown when there are many transactions in progress even when
* most of the individual transactions are of moderate size.
diff --git a/core/java/android/os/image/OWNERS b/core/java/android/os/image/OWNERS
index 389b55b..08a51ff 100644
--- a/core/java/android/os/image/OWNERS
+++ b/core/java/android/os/image/OWNERS
@@ -1 +1,3 @@
+include /packages/DynamicSystemInstallationService/OWNERS
+
andrewhsieh@google.com
diff --git a/core/java/android/os/incremental/OWNERS b/core/java/android/os/incremental/OWNERS
new file mode 100644
index 0000000..3795493
--- /dev/null
+++ b/core/java/android/os/incremental/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 554432
+alexbuy@google.com
+schfan@google.com
+toddke@google.com
+zyy@google.com
diff --git a/core/java/android/provider/BaseColumns.java b/core/java/android/provider/BaseColumns.java
index b216e2b..667bb29 100644
--- a/core/java/android/provider/BaseColumns.java
+++ b/core/java/android/provider/BaseColumns.java
@@ -19,12 +19,16 @@
public interface BaseColumns {
/**
* The unique ID for a row.
+ *
+ * <p>Type: INTEGER (long)</p>
*/
// @Column(Cursor.FIELD_TYPE_INTEGER)
public static final String _ID = "_id";
/**
* The count of rows in a directory.
+ *
+ * <p>Type: INTEGER</p>
*/
// @Column(Cursor.FIELD_TYPE_INTEGER)
public static final String _COUNT = "_count";
diff --git a/core/java/android/provider/CalendarContract.java b/core/java/android/provider/CalendarContract.java
index 1ee2f19..92a1883 100644
--- a/core/java/android/provider/CalendarContract.java
+++ b/core/java/android/provider/CalendarContract.java
@@ -40,6 +40,7 @@
import android.net.Uri;
import android.os.Build;
import android.os.RemoteException;
+import android.os.StrictMode;
import android.text.format.DateUtils;
import android.text.format.TimeMigrationUtils;
import android.util.Log;
@@ -2619,8 +2620,14 @@
intent.setData(ContentUris.withAppendedId(CalendarContract.CONTENT_URI, alarmTime));
intent.putExtra(ALARM_TIME, alarmTime);
intent.setFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
+
+ // Disable strict mode VM policy violations temporarily for intents that contain a
+ // content URI but don't have FLAG_GRANT_READ_URI_PERMISSION.
+ StrictMode.VmPolicy oldVmPolicy = StrictMode.allowVmViolations();
PendingIntent pi = PendingIntent.getBroadcast(context, 0, intent,
PendingIntent.FLAG_IMMUTABLE);
+ StrictMode.setVmPolicy(oldVmPolicy);
+
manager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, alarmTime, pi);
}
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index b2b8db1..376d942 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -4313,13 +4313,23 @@
* <P>
* Type: INTEGER (A bitmask of CARRIER_PRESENCE_* fields)
* </P>
+ *
+ * @deprecated The contacts database will only show presence
+ * information on devices where
+ * {@link android.telephony.CarrierConfigManager#KEY_USE_RCS_PRESENCE_BOOL} is true,
+ * otherwise use {@link android.telephony.ims.RcsUceAdapter}.
*/
+ @Deprecated
public static final String CARRIER_PRESENCE = "carrier_presence";
/**
* Indicates that the entry is Video Telephony (VT) capable on the
* current carrier. An allowed bitmask of {@link #CARRIER_PRESENCE}.
+ *
+ * @deprecated Same as {@link DataColumns#CARRIER_PRESENCE}.
+ *
*/
+ @Deprecated
public static final int CARRIER_PRESENCE_VT_CAPABLE = 0x01;
/**
diff --git a/core/java/android/provider/OWNERS b/core/java/android/provider/OWNERS
index b02102b..cb1509a 100644
--- a/core/java/android/provider/OWNERS
+++ b/core/java/android/provider/OWNERS
@@ -10,6 +10,7 @@
per-file *Downloads* = file:platform/packages/providers/DownloadProvider:/OWNERS
per-file *DeviceConfig* = file:/packages/SettingsProvider/OWNERS
+per-file *Settings* = file:/packages/SettingsProvider/OWNERS
per-file *Documents* = file:/core/java/android/os/storage/OWNERS
per-file *Documents* = file:platform/packages/apps/DocumentsUI:/OWNERS
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 2dbd3ed..4632621 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -9109,8 +9109,8 @@
* Controls magnification mode when magnification is enabled via a system-wide triple tap
* gesture or the accessibility shortcut.
*
- * @see#ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN
- * @see#ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW
+ * @see #ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN
+ * @see #ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW
* @hide
*/
@TestApi
@@ -9143,9 +9143,9 @@
* Controls magnification capability. Accessibility magnification is capable of at least one
* of the magnification modes.
*
- * @see#ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN
- * @see#ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW
- * @see#ACCESSIBILITY_MAGNIFICATION_MODE_ALL
+ * @see #ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN
+ * @see #ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW
+ * @see #ACCESSIBILITY_MAGNIFICATION_MODE_ALL
* @hide
*/
@TestApi
@@ -9154,7 +9154,7 @@
/**
* Whether to show the window magnification prompt dialog when the user uses full-screen
- * magnification first time after database is upgraded .
+ * magnification first time after database is upgraded.
*
* @hide
*/
@@ -9162,6 +9162,38 @@
"accessibility_show_window_magnification_prompt";
/**
+ * Controls the accessibility button mode. System will force-set the value to {@link
+ * #ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU} if {@link #NAVIGATION_MODE} is fully
+ * gestural.
+ * <ul>
+ * <li> 0 = button in navigation bar </li>
+ * <li> 1 = button floating on the display </li>
+ * </ul>
+ *
+ * @see #ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR
+ * @see #ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU
+ * @hide
+ */
+ public static final String ACCESSIBILITY_BUTTON_MODE =
+ "accessibility_button_mode";
+
+ /**
+ * Accessibility button mode value that specifying the accessibility service or feature to
+ * be toggled via the button in the navigation bar.
+ *
+ * @hide
+ */
+ public static final int ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR = 0x0;
+
+ /**
+ * Accessibility button mode value that specifying the accessibility service or feature to
+ * be toggled via the button floating on the display.
+ *
+ * @hide
+ */
+ public static final int ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU = 0x1;
+
+ /**
* Whether the Adaptive connectivity option is enabled.
*
* @hide
@@ -14541,6 +14573,20 @@
public static final String SHOW_NEW_NOTIF_DISMISS = "show_new_notif_dismiss";
/**
+ * Whether to enforce the new notification rules (aka rules that are only applied to
+ * notifications from apps targeting S) on all notifications.
+ * - Collapsed custom view notifications will get the new 76dp height instead of 106dp.
+ * - Custom view notifications will be partially decorated.
+ * - Large icons will be given an aspect ratio of up to 16:9.
+ *
+ * Values are:
+ * 0: Disabled (Only apps targeting S will receive the new rules)
+ * 1: Enabled (All apps will receive the new rules)
+ * @hide
+ */
+ public static final String BACKPORT_S_NOTIF_RULES = "backport_s_notif_rules";
+
+ /**
* Block untrusted touches mode.
*
* Can be one of:
@@ -14581,6 +14627,17 @@
*/
public static final String MAXIMUM_OBSCURING_OPACITY_FOR_TOUCH =
"maximum_obscuring_opacity_for_touch";
+
+ /**
+ * Used to enable / disable the Restricted Networking Mode in which network access is
+ * restricted to apps holding the CONNECTIVITY_USE_RESTRICTED_NETWORKS permission.
+ *
+ * Values are:
+ * 0: disabled
+ * 1: enabled
+ * @hide
+ */
+ public static final String RESTRICTED_NETWORKING_MODE = "restricted_networking_mode";
}
/**
diff --git a/core/java/android/security/ConfirmationPrompt.java b/core/java/android/security/ConfirmationPrompt.java
index f67af85..2329037 100644
--- a/core/java/android/security/ConfirmationPrompt.java
+++ b/core/java/android/security/ConfirmationPrompt.java
@@ -21,6 +21,7 @@
import android.content.Context;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
+import android.security.keystore.AndroidKeyStoreProvider;
import android.text.TextUtils;
import android.util.Log;
@@ -36,15 +37,15 @@
* compromised. Implementing confirmation prompts with these guarantees requires dedicated
* hardware-support and may not always be available.
*
- * <p>Confirmation prompts are typically used with an external entitity - the <i>Relying Party</i> -
+ * <p>Confirmation prompts are typically used with an external entity - the <i>Relying Party</i> -
* in the following way. The setup steps are as follows:
* <ul>
* <li> Before first use, the application generates a key-pair with the
* {@link android.security.keystore.KeyGenParameterSpec.Builder#setUserConfirmationRequired
- * CONFIRMATION tag} set. Device attestation,
- * e.g. {@link java.security.KeyStore#getCertificateChain getCertificateChain()}, is used to
- * generate a certificate chain that includes the public key (<code>Kpub</code> in the following)
- * of the newly generated key.
+ * CONFIRMATION tag} set. AndroidKeyStore key attestation, e.g.,
+ * {@link android.security.keystore.KeyGenParameterSpec.Builder#setAttestationChallenge(byte[])}
+ * is used to generate a certificate chain that includes the public key (<code>Kpub</code> in the
+ * following) of the newly generated key.
* <li> The application sends <code>Kpub</code> and the certificate chain resulting from device
* attestation to the <i>Relying Party</i>.
* <li> The <i>Relying Party</i> validates the certificate chain which involves checking the root
@@ -78,9 +79,10 @@
* previously created nonce. If all checks passes, the transaction is executed.
* </ul>
*
- * <p>A common way of implementing the "<code>promptText</code> is what is expected" check in the
- * last bullet, is to have the <i>Relying Party</i> generate <code>promptText</code> and store it
- * along the nonce in the <code>extraData</code> blob.
+ * <p>Note: It is vital to check the <code>promptText</code> because this is the only part that
+ * the user has approved. To avoid writing parsers for all of the possible locales, it is
+ * recommended that the <i>Relying Party</i> uses the same string generator as used on the device
+ * and performs a simple string comparison.
*/
public class ConfirmationPrompt {
private static final String TAG = "ConfirmationPrompt";
@@ -92,6 +94,14 @@
private Context mContext;
private final KeyStore mKeyStore = KeyStore.getInstance();
+ private AndroidProtectedConfirmation mProtectedConfirmation;
+
+ private AndroidProtectedConfirmation getService() {
+ if (mProtectedConfirmation == null) {
+ mProtectedConfirmation = new AndroidProtectedConfirmation();
+ }
+ return mProtectedConfirmation;
+ }
private void doCallback(int responseCode, byte[] dataThatWasConfirmed,
ConfirmationCallback callback) {
@@ -119,6 +129,32 @@
}
}
+ private void doCallback2(int responseCode, byte[] dataThatWasConfirmed,
+ ConfirmationCallback callback) {
+ switch (responseCode) {
+ case AndroidProtectedConfirmation.ERROR_OK:
+ callback.onConfirmed(dataThatWasConfirmed);
+ break;
+
+ case AndroidProtectedConfirmation.ERROR_CANCELED:
+ callback.onDismissed();
+ break;
+
+ case AndroidProtectedConfirmation.ERROR_ABORTED:
+ callback.onCanceled();
+ break;
+
+ case AndroidProtectedConfirmation.ERROR_SYSTEM_ERROR:
+ callback.onError(new Exception("System error returned by ConfirmationUI."));
+ break;
+
+ default:
+ callback.onError(new Exception("Unexpected responseCode=" + responseCode
+ + " from onConfirmtionPromptCompleted() callback."));
+ break;
+ }
+ }
+
private final android.os.IBinder mCallbackBinder =
new android.security.IConfirmationPromptCallback.Stub() {
@Override
@@ -144,6 +180,29 @@
}
};
+ private final android.security.apc.IConfirmationCallback mConfirmationCallback =
+ new android.security.apc.IConfirmationCallback.Stub() {
+ @Override
+ public void onCompleted(int result, byte[] dataThatWasConfirmed)
+ throws android.os.RemoteException {
+ if (mCallback != null) {
+ ConfirmationCallback callback = mCallback;
+ Executor executor = mExecutor;
+ mCallback = null;
+ mExecutor = null;
+ if (executor == null) {
+ doCallback2(result, dataThatWasConfirmed, callback);
+ } else {
+ executor.execute(new Runnable() {
+ @Override public void run() {
+ doCallback2(result, dataThatWasConfirmed, callback);
+ }
+ });
+ }
+ }
+ }
+ };
+
/**
* A builder that collects arguments, to be shown on the system-provided confirmation prompt.
*/
@@ -211,6 +270,9 @@
private static final int UI_OPTION_ACCESSIBILITY_MAGNIFIED_FLAG = 1 << 1;
private int getUiOptionsAsFlags() {
+ if (AndroidKeyStoreProvider.isKeystore2Enabled()) {
+ return getUiOptionsAsFlags2();
+ }
int uiOptionsAsFlags = 0;
ContentResolver contentResolver = mContext.getContentResolver();
int inversionEnabled = Settings.Secure.getInt(contentResolver,
@@ -226,6 +288,22 @@
return uiOptionsAsFlags;
}
+ private int getUiOptionsAsFlags2() {
+ int uiOptionsAsFlags = 0;
+ ContentResolver contentResolver = mContext.getContentResolver();
+ int inversionEnabled = Settings.Secure.getInt(contentResolver,
+ Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, 0);
+ if (inversionEnabled == 1) {
+ uiOptionsAsFlags |= AndroidProtectedConfirmation.FLAG_UI_OPTION_INVERTED;
+ }
+ float fontScale = Settings.System.getFloat(contentResolver,
+ Settings.System.FONT_SCALE, (float) 1.0);
+ if (fontScale > 1.0) {
+ uiOptionsAsFlags |= AndroidProtectedConfirmation.FLAG_UI_OPTION_MAGNIFIED;
+ }
+ return uiOptionsAsFlags;
+ }
+
private static boolean isAccessibilityServiceRunning(Context context) {
boolean serviceRunning = false;
try {
@@ -270,29 +348,53 @@
mCallback = callback;
mExecutor = executor;
- int uiOptionsAsFlags = getUiOptionsAsFlags();
String locale = Locale.getDefault().toLanguageTag();
- int responseCode = mKeyStore.presentConfirmationPrompt(
- mCallbackBinder, mPromptText.toString(), mExtraData, locale, uiOptionsAsFlags);
- switch (responseCode) {
- case KeyStore.CONFIRMATIONUI_OK:
- return;
+ if (AndroidKeyStoreProvider.isKeystore2Enabled()) {
+ int uiOptionsAsFlags = getUiOptionsAsFlags2();
+ int responseCode = getService().presentConfirmationPrompt(
+ mConfirmationCallback, mPromptText.toString(), mExtraData, locale,
+ uiOptionsAsFlags);
+ switch (responseCode) {
+ case AndroidProtectedConfirmation.ERROR_OK:
+ return;
- case KeyStore.CONFIRMATIONUI_OPERATION_PENDING:
- throw new ConfirmationAlreadyPresentingException();
+ case AndroidProtectedConfirmation.ERROR_OPERATION_PENDING:
+ throw new ConfirmationAlreadyPresentingException();
- case KeyStore.CONFIRMATIONUI_UNIMPLEMENTED:
- throw new ConfirmationNotAvailableException();
+ case AndroidProtectedConfirmation.ERROR_UNIMPLEMENTED:
+ throw new ConfirmationNotAvailableException();
- case KeyStore.CONFIRMATIONUI_UIERROR:
- throw new IllegalArgumentException();
+ default:
+ // Unexpected error code.
+ Log.w(TAG,
+ "Unexpected responseCode=" + responseCode
+ + " from presentConfirmationPrompt() call.");
+ throw new IllegalArgumentException();
+ }
+ } else {
+ int uiOptionsAsFlags = getUiOptionsAsFlags();
+ int responseCode = mKeyStore.presentConfirmationPrompt(
+ mCallbackBinder, mPromptText.toString(), mExtraData, locale, uiOptionsAsFlags);
+ switch (responseCode) {
+ case KeyStore.CONFIRMATIONUI_OK:
+ return;
- default:
- // Unexpected error code.
- Log.w(TAG,
- "Unexpected responseCode=" + responseCode
- + " from presentConfirmationPrompt() call.");
- throw new IllegalArgumentException();
+ case KeyStore.CONFIRMATIONUI_OPERATION_PENDING:
+ throw new ConfirmationAlreadyPresentingException();
+
+ case KeyStore.CONFIRMATIONUI_UNIMPLEMENTED:
+ throw new ConfirmationNotAvailableException();
+
+ case KeyStore.CONFIRMATIONUI_UIERROR:
+ throw new IllegalArgumentException();
+
+ default:
+ // Unexpected error code.
+ Log.w(TAG,
+ "Unexpected responseCode=" + responseCode
+ + " from presentConfirmationPrompt() call.");
+ throw new IllegalArgumentException();
+ }
}
}
@@ -306,17 +408,33 @@
* @throws IllegalStateException if no prompt is currently being presented.
*/
public void cancelPrompt() {
- int responseCode = mKeyStore.cancelConfirmationPrompt(mCallbackBinder);
- if (responseCode == KeyStore.CONFIRMATIONUI_OK) {
- return;
- } else if (responseCode == KeyStore.CONFIRMATIONUI_OPERATION_PENDING) {
- throw new IllegalStateException();
+ if (AndroidKeyStoreProvider.isKeystore2Enabled()) {
+ int responseCode =
+ getService().cancelConfirmationPrompt(mConfirmationCallback);
+ if (responseCode == AndroidProtectedConfirmation.ERROR_OK) {
+ return;
+ } else if (responseCode == AndroidProtectedConfirmation.ERROR_OPERATION_PENDING) {
+ throw new IllegalStateException();
+ } else {
+ // Unexpected error code.
+ Log.w(TAG,
+ "Unexpected responseCode=" + responseCode
+ + " from cancelConfirmationPrompt() call.");
+ throw new IllegalStateException();
+ }
} else {
- // Unexpected error code.
- Log.w(TAG,
- "Unexpected responseCode=" + responseCode
- + " from cancelConfirmationPrompt() call.");
- throw new IllegalStateException();
+ int responseCode = mKeyStore.cancelConfirmationPrompt(mCallbackBinder);
+ if (responseCode == KeyStore.CONFIRMATIONUI_OK) {
+ return;
+ } else if (responseCode == KeyStore.CONFIRMATIONUI_OPERATION_PENDING) {
+ throw new IllegalStateException();
+ } else {
+ // Unexpected error code.
+ Log.w(TAG,
+ "Unexpected responseCode=" + responseCode
+ + " from cancelConfirmationPrompt() call.");
+ throw new IllegalStateException();
+ }
}
}
@@ -330,6 +448,9 @@
if (isAccessibilityServiceRunning(context)) {
return false;
}
+ if (AndroidKeyStoreProvider.isKeystore2Enabled()) {
+ return new AndroidProtectedConfirmation().isConfirmationPromptSupported();
+ }
return KeyStore.getInstance().isConfirmationPromptSupported();
}
}
diff --git a/core/java/android/service/attestation/OWNERS b/core/java/android/service/attestation/OWNERS
new file mode 100644
index 0000000..b9e7b99
--- /dev/null
+++ b/core/java/android/service/attestation/OWNERS
@@ -0,0 +1,2 @@
+chaviw@google.com
+ogunwale@google.com
diff --git a/core/java/android/service/autofill/Dataset.java b/core/java/android/service/autofill/Dataset.java
index 8ae1b6b..4679c56 100644
--- a/core/java/android/service/autofill/Dataset.java
+++ b/core/java/android/service/autofill/Dataset.java
@@ -406,6 +406,8 @@
* authentication.
*
* @throws IllegalStateException if {@link #build()} was already called.
+ * @throws IllegalArgumentException if the provided content
+ * {@link ClipData.Item#getIntent() contains an intent}
*
* @return this builder.
*
@@ -416,6 +418,12 @@
@SuppressLint("MissingGetterMatchingBuilder")
public @NonNull Builder setContent(@NonNull AutofillId id, @Nullable ClipData content) {
throwIfDestroyed();
+ if (content != null) {
+ for (int i = 0; i < content.getItemCount(); i++) {
+ Preconditions.checkArgument(content.getItemAt(i).getIntent() == null,
+ "Content items cannot contain an Intent: content=" + content);
+ }
+ }
setLifeTheUniverseAndEverything(id, null, null, null, null);
mFieldContent = content;
return this;
diff --git a/wifi/aidl-export/android/net/wifi/CoexUnsafeChannel.aidl b/core/java/android/service/notification/NotificationListenerFilter.aidl
similarity index 87%
rename from wifi/aidl-export/android/net/wifi/CoexUnsafeChannel.aidl
rename to core/java/android/service/notification/NotificationListenerFilter.aidl
index cb359e9..c186b74 100644
--- a/wifi/aidl-export/android/net/wifi/CoexUnsafeChannel.aidl
+++ b/core/java/android/service/notification/NotificationListenerFilter.aidl
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2020, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,6 +14,7 @@
* limitations under the License.
*/
-package android.net.wifi;
+package android.service.notification;
-parcelable CoexUnsafeChannel;
+parcelable NotificationListenerFilter;
+
diff --git a/core/java/android/service/notification/NotificationListenerFilter.java b/core/java/android/service/notification/NotificationListenerFilter.java
new file mode 100644
index 0000000..c945c2d
--- /dev/null
+++ b/core/java/android/service/notification/NotificationListenerFilter.java
@@ -0,0 +1,102 @@
+/**
+ * Copyright (c) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, 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.service.notification;
+
+import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_ALERTING;
+import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_CONVERSATIONS;
+import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_SILENT;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.ArraySet;
+
+/**
+ * Specifies a filter for what types of notifications should be bridged to notification listeners.
+ * Each requested listener will have their own filter instance.
+ * @hide
+ */
+public class NotificationListenerFilter implements Parcelable {
+ private int mAllowedNotificationTypes;
+ private ArraySet<String> mDisallowedPackages;
+
+ public NotificationListenerFilter() {
+ mAllowedNotificationTypes = FLAG_FILTER_TYPE_CONVERSATIONS
+ | FLAG_FILTER_TYPE_ALERTING
+ | FLAG_FILTER_TYPE_SILENT;
+ mDisallowedPackages = new ArraySet<>();
+ }
+
+ public NotificationListenerFilter(int types, ArraySet<String> pkgs) {
+ mAllowedNotificationTypes = types;
+ mDisallowedPackages = pkgs;
+ }
+
+ /**
+ * @hide
+ */
+ protected NotificationListenerFilter(Parcel in) {
+ mAllowedNotificationTypes = in.readInt();
+ mDisallowedPackages = (ArraySet<String>) in.readArraySet(String.class.getClassLoader());
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(mAllowedNotificationTypes);
+ dest.writeArraySet(mDisallowedPackages);
+ }
+
+ public static final Creator<NotificationListenerFilter> CREATOR =
+ new Creator<NotificationListenerFilter>() {
+ @Override
+ public NotificationListenerFilter createFromParcel(Parcel in) {
+ return new NotificationListenerFilter(in);
+ }
+
+ @Override
+ public NotificationListenerFilter[] newArray(int size) {
+ return new NotificationListenerFilter[size];
+ }
+ };
+
+ public boolean isTypeAllowed(int type) {
+ return (mAllowedNotificationTypes & type) != 0;
+ }
+
+ public boolean isPackageAllowed(String pkg) {
+ return !mDisallowedPackages.contains(pkg);
+ }
+
+ public int getTypes() {
+ return mAllowedNotificationTypes;
+ }
+
+ public ArraySet<String> getDisallowedPackages() {
+ return mDisallowedPackages;
+ }
+
+ public void setTypes(int types) {
+ mAllowedNotificationTypes = types;
+ }
+
+ public void setDisallowedPackages(ArraySet<String> pkgs) {
+ mDisallowedPackages = pkgs;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+}
diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java
index 440eeb1..ccde0bc 100644
--- a/core/java/android/service/notification/NotificationListenerService.java
+++ b/core/java/android/service/notification/NotificationListenerService.java
@@ -242,6 +242,23 @@
public @interface NotificationCancelReason{};
/**
+ * A flag value indicating that this notification listener can see conversation type
+ * notifications.
+ * @hide
+ */
+ public static final int FLAG_FILTER_TYPE_CONVERSATIONS = 1;
+ /**
+ * A flag value indicating that this notification listener can see altering type notifications.
+ * @hide
+ */
+ public static final int FLAG_FILTER_TYPE_ALERTING = 2;
+ /**
+ * A flag value indicating that this notification listener can see silent type notifications.
+ * @hide
+ */
+ public static final int FLAG_FILTER_TYPE_SILENT = 4;
+
+ /**
* The full trim of the StatusBarNotification including all its features.
*
* @hide
diff --git a/core/java/android/service/timezone/TimeZoneProviderService.java b/core/java/android/service/timezone/TimeZoneProviderService.java
index 9533a8f..f2bf176 100644
--- a/core/java/android/service/timezone/TimeZoneProviderService.java
+++ b/core/java/android/service/timezone/TimeZoneProviderService.java
@@ -53,7 +53,7 @@
* <p>Provider discovery:
*
* <p>You must declare the service in your manifest file with the
- * {@link android.Manifest.permission#INSTALL_LOCATION_TIME_ZONE_PROVIDER} permission,
+ * {@link android.Manifest.permission#BIND_TIME_ZONE_PROVIDER_SERVICE} permission,
* and include an intent filter with the necessary action indicating what type of provider it is.
*
* <p>Device configuration can influence how {@link TimeZoneProviderService}s are discovered.
@@ -66,18 +66,29 @@
*
* <p>Provider types:
*
- * <p>Android currently supports up to two location-derived time zone providers. These are called
- * the "primary" and "secondary" location time zone provider, configured using {@link
- * #PRIMARY_LOCATION_TIME_ZONE_PROVIDER_SERVICE_INTERFACE} and {@link
- * #SECONDARY_LOCATION_TIME_ZONE_PROVIDER_SERVICE_INTERFACE} respectively. The primary location time
- * zone provider is started first and will be used until becomes uncertain or fails, at which point
- * the secondary provider will be started.
+ * <p>Android supports up to two <em>location-derived</em> time zone providers. These are called the
+ * "primary" and "secondary" location time zone provider. The primary location time zone provider is
+ * started first and will be used until it becomes uncertain or fails, at which point the secondary
+ * provider will be started.
*
- * For example:
+ * <p>Location-derived time zone providers are configured using {@link
+ * #PRIMARY_LOCATION_TIME_ZONE_PROVIDER_SERVICE_INTERFACE} and {@link
+ * #SECONDARY_LOCATION_TIME_ZONE_PROVIDER_SERVICE_INTERFACE} intent-filter actions respectively.
+ * Besides declaring the android:permission attribute mentioned above, the application supplying a
+ * location provider must be granted the {@link
+ * android.Manifest.permission#INSTALL_LOCATION_TIME_ZONE_PROVIDER_SERVICE} permission to be
+ * accepted by the system server.
+ *
+ * <p>For example:
* <pre>
+ * <uses-permission
+ * android:name="android.permission.INSTALL_LOCATION_TIME_ZONE_PROVIDER_SERVICE"/>
+ *
+ * ...
+ *
* <service android:name=".FooTimeZoneProviderService"
* android:exported="true"
- * android:permission="android.permission.INSTALL_LOCATION_TIME_ZONE_PROVIDER">
+ * android:permission="android.permission.BIND_TIME_ZONE_PROVIDER_SERVICE">
* <intent-filter>
* <action
* android:name="android.service.timezone.SecondaryLocationTimeZoneProviderService"
@@ -88,7 +99,6 @@
* </service>
* </pre>
*
- *
* <p>Threading:
*
* <p>Calls to {@code report} methods can be made on on any thread and will be passed asynchronously
@@ -120,14 +130,6 @@
public static final String SECONDARY_LOCATION_TIME_ZONE_PROVIDER_SERVICE_INTERFACE =
"android.service.timezone.SecondaryLocationTimeZoneProviderService";
- /**
- * The permission that a service must require to ensure that only Android system can bind to it.
- * If this permission is not enforced in the AndroidManifest of the service, the system will
- * skip that service.
- */
- public static final String BIND_PERMISSION =
- "android.permission.INSTALL_LOCATION_TIME_ZONE_PROVIDER";
-
private final TimeZoneProviderServiceWrapper mWrapper = new TimeZoneProviderServiceWrapper();
/** Set by {@link #mHandler} thread. */
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java
index 3763711..507dc7a 100644
--- a/core/java/android/service/wallpaper/WallpaperService.java
+++ b/core/java/android/service/wallpaper/WallpaperService.java
@@ -881,8 +881,7 @@
if (mSession.addToDisplay(mWindow, mLayout, View.VISIBLE,
mDisplay.getDisplayId(), mInsetsState, mWinFrames.frame,
- mWinFrames.displayCutout, inputChannel, mInsetsState,
- mTempControls) < 0) {
+ inputChannel, mInsetsState, mTempControls) < 0) {
Log.w(TAG, "Failed to add window while updating wallpaper surface.");
return;
}
@@ -924,13 +923,13 @@
int w = mWinFrames.frame.width();
int h = mWinFrames.frame.height();
- final DisplayCutout rawCutout = mWinFrames.displayCutout.get();
+ final DisplayCutout rawCutout = mInsetsState.getDisplayCutout();
final Configuration config = getResources().getConfiguration();
final Rect visibleFrame = new Rect(mWinFrames.frame);
visibleFrame.intersect(mInsetsState.getDisplayFrame());
WindowInsets windowInsets = mInsetsState.calculateInsets(visibleFrame,
null /* ignoringVisibilityState */, config.isScreenRound(),
- false /* alwaysConsumeSystemBars */, rawCutout, mLayout.softInputMode,
+ false /* alwaysConsumeSystemBars */, mLayout.softInputMode,
mLayout.flags, SYSTEM_UI_FLAG_VISIBLE, mLayout.type,
config.windowConfiguration.getWindowingMode(), null /* typeSideMap */);
diff --git a/core/java/android/util/Patterns.java b/core/java/android/util/Patterns.java
index 7ad16ff..ece069f 100644
--- a/core/java/android/util/Patterns.java
+++ b/core/java/android/util/Patterns.java
@@ -248,6 +248,13 @@
+ "[0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]"
+ "[0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}"
+ "|[1-9][0-9]|[0-9]))";
+
+ /**
+ * Kept for backward compatibility reasons. It does not match IPv6 addresses.
+ *
+ * @deprecated Please use {@link android.net.InetAddresses#isNumericAddress(String)} instead.
+ */
+ @Deprecated
public static final Pattern IP_ADDRESS = Pattern.compile(IP_ADDRESS_STRING);
/**
diff --git a/core/java/android/view/AccessibilityInteractionController.java b/core/java/android/view/AccessibilityInteractionController.java
index 2e90619..9473845 100644
--- a/core/java/android/view/AccessibilityInteractionController.java
+++ b/core/java/android/view/AccessibilityInteractionController.java
@@ -113,8 +113,6 @@
private AddNodeInfosForViewId mAddNodeInfosForViewId;
- private List<Message> mPendingFindNodeByIdMessages;
-
@GuardedBy("mLock")
private int mNumActiveRequestPreparers;
@GuardedBy("mLock")
@@ -130,7 +128,6 @@
mViewRootImpl = viewRootImpl;
mPrefetcher = new AccessibilityNodePrefetcher();
mA11yManager = mViewRootImpl.mContext.getSystemService(AccessibilityManager.class);
- mPendingFindNodeByIdMessages = new ArrayList<>();
}
private void scheduleMessage(Message message, int interrogatingPid, long interrogatingTid,
@@ -180,7 +177,6 @@
args.arg4 = arguments;
message.obj = args;
- mPendingFindNodeByIdMessages.add(message);
scheduleMessage(message, interrogatingPid, interrogatingTid, CONSIDER_REQUEST_PREPARERS);
}
@@ -319,8 +315,6 @@
}
private void findAccessibilityNodeInfoByAccessibilityIdUiThread(Message message) {
- mPendingFindNodeByIdMessages.remove(message);
-
final int flags = message.arg1;
SomeArgs args = (SomeArgs) message.obj;
@@ -335,58 +329,22 @@
args.recycle();
- View rootView = null;
- AccessibilityNodeInfo rootNode = null;
+ List<AccessibilityNodeInfo> infos = mTempAccessibilityNodeInfoList;
+ infos.clear();
try {
if (mViewRootImpl.mView == null || mViewRootImpl.mAttachInfo == null) {
return;
}
mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = flags;
- rootView = findViewByAccessibilityId(accessibilityViewId);
- if (rootView != null && isShown(rootView)) {
- rootNode = populateAccessibilityNodeInfoForView(
- rootView, arguments, virtualDescendantId);
+ final View root = findViewByAccessibilityId(accessibilityViewId);
+ if (root != null && isShown(root)) {
+ mPrefetcher.prefetchAccessibilityNodeInfos(
+ root, virtualDescendantId, flags, infos, arguments);
}
} finally {
- updateInfoForViewportAndReturnFindNodeResult(
- rootNode == null ? null : AccessibilityNodeInfo.obtain(rootNode),
- callback, interactionId, spec, interactiveRegion);
+ updateInfosForViewportAndReturnFindNodeResult(
+ infos, callback, interactionId, spec, interactiveRegion);
}
- List<AccessibilityNodeInfo> infos = mTempAccessibilityNodeInfoList;
- infos.clear();
- mPrefetcher.prefetchAccessibilityNodeInfos(
- rootView, rootNode == null ? null : AccessibilityNodeInfo.obtain(rootNode),
- virtualDescendantId, flags, infos);
- mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0;
- updateInfosForViewPort(infos, spec, interactiveRegion);
- returnPrefetchResult(interactionId, infos, callback);
- returnPendingFindAccessibilityNodeInfosInPrefetch(infos);
- }
-
- private AccessibilityNodeInfo populateAccessibilityNodeInfoForView(
- View view, Bundle arguments, int virtualViewId) {
- AccessibilityNodeProvider provider = view.getAccessibilityNodeProvider();
- // Determine if we'll be populating extra data
- final String extraDataRequested = (arguments == null) ? null
- : arguments.getString(EXTRA_DATA_REQUESTED_KEY);
- AccessibilityNodeInfo root = null;
- if (provider == null) {
- root = view.createAccessibilityNodeInfo();
- if (root != null) {
- if (extraDataRequested != null) {
- view.addExtraDataToAccessibilityNodeInfo(root, extraDataRequested, arguments);
- }
- }
- } else {
- root = provider.createAccessibilityNodeInfo(virtualViewId);
- if (root != null) {
- if (extraDataRequested != null) {
- provider.addExtraDataToAccessibilityNodeInfo(
- virtualViewId, root, extraDataRequested, arguments);
- }
- }
- }
- return root;
}
public void findAccessibilityNodeInfosByViewIdClientThread(long accessibilityNodeId,
@@ -444,7 +402,6 @@
mAddNodeInfosForViewId.reset();
}
} finally {
- mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0;
updateInfosForViewportAndReturnFindNodeResult(
infos, callback, interactionId, spec, interactiveRegion);
}
@@ -527,7 +484,6 @@
}
}
} finally {
- mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0;
updateInfosForViewportAndReturnFindNodeResult(
infos, callback, interactionId, spec, interactiveRegion);
}
@@ -619,7 +575,6 @@
}
}
} finally {
- mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0;
updateInfoForViewportAndReturnFindNodeResult(
focused, callback, interactionId, spec, interactiveRegion);
}
@@ -674,7 +629,6 @@
}
}
} finally {
- mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0;
updateInfoForViewportAndReturnFindNodeResult(
next, callback, interactionId, spec, interactiveRegion);
}
@@ -831,6 +785,33 @@
}
}
+ private void applyAppScaleAndMagnificationSpecIfNeeded(List<AccessibilityNodeInfo> infos,
+ MagnificationSpec spec) {
+ if (infos == null) {
+ return;
+ }
+ final float applicationScale = mViewRootImpl.mAttachInfo.mApplicationScale;
+ if (shouldApplyAppScaleAndMagnificationSpec(applicationScale, spec)) {
+ final int infoCount = infos.size();
+ for (int i = 0; i < infoCount; i++) {
+ AccessibilityNodeInfo info = infos.get(i);
+ applyAppScaleAndMagnificationSpecIfNeeded(info, spec);
+ }
+ }
+ }
+
+ private void adjustIsVisibleToUserIfNeeded(List<AccessibilityNodeInfo> infos,
+ Region interactiveRegion) {
+ if (interactiveRegion == null || infos == null) {
+ return;
+ }
+ final int infoCount = infos.size();
+ for (int i = 0; i < infoCount; i++) {
+ AccessibilityNodeInfo info = infos.get(i);
+ adjustIsVisibleToUserIfNeeded(info, interactiveRegion);
+ }
+ }
+
private void adjustIsVisibleToUserIfNeeded(AccessibilityNodeInfo info,
Region interactiveRegion) {
if (interactiveRegion == null || info == null) {
@@ -851,6 +832,17 @@
return false;
}
+ private void adjustBoundsInScreenIfNeeded(List<AccessibilityNodeInfo> infos) {
+ if (infos == null || shouldBypassAdjustBoundsInScreen()) {
+ return;
+ }
+ final int infoCount = infos.size();
+ for (int i = 0; i < infoCount; i++) {
+ final AccessibilityNodeInfo info = infos.get(i);
+ adjustBoundsInScreenIfNeeded(info);
+ }
+ }
+
private void adjustBoundsInScreenIfNeeded(AccessibilityNodeInfo info) {
if (info == null || shouldBypassAdjustBoundsInScreen()) {
return;
@@ -898,6 +890,17 @@
return screenMatrix == null || screenMatrix.isIdentity();
}
+ private void associateLeashedParentIfNeeded(List<AccessibilityNodeInfo> infos) {
+ if (infos == null || shouldBypassAssociateLeashedParent()) {
+ return;
+ }
+ final int infoCount = infos.size();
+ for (int i = 0; i < infoCount; i++) {
+ final AccessibilityNodeInfo info = infos.get(i);
+ associateLeashedParentIfNeeded(info);
+ }
+ }
+
private void associateLeashedParentIfNeeded(AccessibilityNodeInfo info) {
if (info == null || shouldBypassAssociateLeashedParent()) {
return;
@@ -971,46 +974,18 @@
return (appScale != 1.0f || (spec != null && !spec.isNop()));
}
- private void updateInfosForViewPort(List<AccessibilityNodeInfo> infos, MagnificationSpec spec,
- Region interactiveRegion) {
- for (int i = 0; i < infos.size(); i++) {
- updateInfoForViewPort(infos.get(i), spec, interactiveRegion);
- }
- }
-
- private void updateInfoForViewPort(AccessibilityNodeInfo info, MagnificationSpec spec,
- Region interactiveRegion) {
- associateLeashedParentIfNeeded(info);
- applyScreenMatrixIfNeeded(info);
- adjustBoundsInScreenIfNeeded(info);
- // To avoid applyAppScaleAndMagnificationSpecIfNeeded changing the bounds of node,
- // then impact the visibility result, we need to adjust visibility before apply scale.
- adjustIsVisibleToUserIfNeeded(info, interactiveRegion);
- applyAppScaleAndMagnificationSpecIfNeeded(info, spec);
- }
-
private void updateInfosForViewportAndReturnFindNodeResult(List<AccessibilityNodeInfo> infos,
IAccessibilityInteractionConnectionCallback callback, int interactionId,
MagnificationSpec spec, Region interactiveRegion) {
- if (infos != null) {
- updateInfosForViewPort(infos, spec, interactiveRegion);
- }
- returnFindNodesResult(infos, callback, interactionId);
- }
-
- private void returnFindNodeResult(AccessibilityNodeInfo info,
- IAccessibilityInteractionConnectionCallback callback,
- int interactionId) {
try {
- callback.setFindAccessibilityNodeInfoResult(info, interactionId);
- } catch (RemoteException re) {
- /* ignore - the other side will time out */
- }
- }
-
- private void returnFindNodesResult(List<AccessibilityNodeInfo> infos,
- IAccessibilityInteractionConnectionCallback callback, int interactionId) {
- try {
+ mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0;
+ associateLeashedParentIfNeeded(infos);
+ applyScreenMatrixIfNeeded(infos);
+ adjustBoundsInScreenIfNeeded(infos);
+ // To avoid applyAppScaleAndMagnificationSpecIfNeeded changing the bounds of node,
+ // then impact the visibility result, we need to adjust visibility before apply scale.
+ adjustIsVisibleToUserIfNeeded(infos, interactiveRegion);
+ applyAppScaleAndMagnificationSpecIfNeeded(infos, spec);
callback.setFindAccessibilityNodeInfosResult(infos, interactionId);
if (infos != null) {
infos.clear();
@@ -1020,49 +995,22 @@
}
}
- private void returnPendingFindAccessibilityNodeInfosInPrefetch(
- List<AccessibilityNodeInfo> infos) {
- for (Message pendingMessage : mPendingFindNodeByIdMessages) {
- SomeArgs args = (SomeArgs) pendingMessage.obj;
- final int accessibilityViewId = args.argi1;
- final int virtualDescendantId = args.argi2;
- final int interactionId = args.argi3;
- final IAccessibilityInteractionConnectionCallback callback =
- (IAccessibilityInteractionConnectionCallback) args.arg1;
- final long nodeId =
- AccessibilityNodeInfo.makeNodeId(accessibilityViewId, virtualDescendantId);
- for (int i = 0; i < infos.size(); i++) {
- AccessibilityNodeInfo info = infos.get(i);
- if (info.getSourceNodeId() == nodeId) {
- returnFindNodeResult(
- AccessibilityNodeInfo.obtain(info), callback, interactionId);
- mHandler.removeMessages(
- PrivateHandler.MSG_FIND_ACCESSIBILITY_NODE_INFO_BY_ACCESSIBILITY_ID,
- pendingMessage.obj);
- args.recycle();
- break;
- }
- }
- }
- mPendingFindNodeByIdMessages.clear();
- }
-
- private void returnPrefetchResult(int interactionId, List<AccessibilityNodeInfo> infos,
- IAccessibilityInteractionConnectionCallback callback) {
- if (infos.size() > 0) {
- try {
- callback.setPrefetchAccessibilityNodeInfoResult(infos, interactionId);
- } catch (RemoteException re) {
- /* ignore - other side isn't too bothered if this doesn't arrive */
- }
- }
- }
-
private void updateInfoForViewportAndReturnFindNodeResult(AccessibilityNodeInfo info,
IAccessibilityInteractionConnectionCallback callback, int interactionId,
MagnificationSpec spec, Region interactiveRegion) {
- updateInfoForViewPort(info, spec, interactiveRegion);
- returnFindNodeResult(info, callback, interactionId);
+ try {
+ mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0;
+ associateLeashedParentIfNeeded(info);
+ applyScreenMatrixIfNeeded(info);
+ adjustBoundsInScreenIfNeeded(info);
+ // To avoid applyAppScaleAndMagnificationSpecIfNeeded changing the bounds of node,
+ // then impact the visibility result, we need to adjust visibility before apply scale.
+ adjustIsVisibleToUserIfNeeded(info, interactiveRegion);
+ applyAppScaleAndMagnificationSpecIfNeeded(info, spec);
+ callback.setFindAccessibilityNodeInfoResult(info, interactionId);
+ } catch (RemoteException re) {
+ /* ignore - the other side will time out */
+ }
}
private boolean handleClickableSpanActionUiThread(
@@ -1105,11 +1053,20 @@
private final ArrayList<View> mTempViewList = new ArrayList<View>();
- public void prefetchAccessibilityNodeInfos(View view, AccessibilityNodeInfo root,
- int virtualViewId, int fetchFlags, List<AccessibilityNodeInfo> outInfos) {
- if (root != null) {
- AccessibilityNodeProvider provider = view.getAccessibilityNodeProvider();
- if (provider == null) {
+ public void prefetchAccessibilityNodeInfos(View view, int virtualViewId, int fetchFlags,
+ List<AccessibilityNodeInfo> outInfos, Bundle arguments) {
+ AccessibilityNodeProvider provider = view.getAccessibilityNodeProvider();
+ // Determine if we'll be populating extra data
+ final String extraDataRequested = (arguments == null) ? null
+ : arguments.getString(EXTRA_DATA_REQUESTED_KEY);
+ if (provider == null) {
+ AccessibilityNodeInfo root = view.createAccessibilityNodeInfo();
+ if (root != null) {
+ if (extraDataRequested != null) {
+ view.addExtraDataToAccessibilityNodeInfo(
+ root, extraDataRequested, arguments);
+ }
+ outInfos.add(root);
if ((fetchFlags & AccessibilityNodeInfo.FLAG_PREFETCH_PREDECESSORS) != 0) {
prefetchPredecessorsOfRealNode(view, outInfos);
}
@@ -1119,7 +1076,16 @@
if ((fetchFlags & AccessibilityNodeInfo.FLAG_PREFETCH_DESCENDANTS) != 0) {
prefetchDescendantsOfRealNode(view, outInfos);
}
- } else {
+ }
+ } else {
+ final AccessibilityNodeInfo root =
+ provider.createAccessibilityNodeInfo(virtualViewId);
+ if (root != null) {
+ if (extraDataRequested != null) {
+ provider.addExtraDataToAccessibilityNodeInfo(
+ virtualViewId, root, extraDataRequested, arguments);
+ }
+ outInfos.add(root);
if ((fetchFlags & AccessibilityNodeInfo.FLAG_PREFETCH_PREDECESSORS) != 0) {
prefetchPredecessorsOfVirtualNode(root, view, provider, outInfos);
}
@@ -1130,19 +1096,13 @@
prefetchDescendantsOfVirtualNode(root, provider, outInfos);
}
}
- if (ENFORCE_NODE_TREE_CONSISTENT) {
- enforceNodeTreeConsistent(root, outInfos);
- }
+ }
+ if (ENFORCE_NODE_TREE_CONSISTENT) {
+ enforceNodeTreeConsistent(outInfos);
}
}
- private boolean shouldStopPrefetching(List prefetchededInfos) {
- return mHandler.hasUserInteractiveMessagesWaiting()
- || prefetchededInfos.size() >= MAX_ACCESSIBILITY_NODE_INFO_BATCH_SIZE;
- }
-
- private void enforceNodeTreeConsistent(
- AccessibilityNodeInfo root, List<AccessibilityNodeInfo> nodes) {
+ private void enforceNodeTreeConsistent(List<AccessibilityNodeInfo> nodes) {
LongSparseArray<AccessibilityNodeInfo> nodeMap =
new LongSparseArray<AccessibilityNodeInfo>();
final int nodeCount = nodes.size();
@@ -1153,6 +1113,7 @@
// If the nodes are a tree it does not matter from
// which node we start to search for the root.
+ AccessibilityNodeInfo root = nodeMap.valueAt(0);
AccessibilityNodeInfo parent = root;
while (parent != null) {
root = parent;
@@ -1219,11 +1180,9 @@
private void prefetchPredecessorsOfRealNode(View view,
List<AccessibilityNodeInfo> outInfos) {
- if (shouldStopPrefetching(outInfos)) {
- return;
- }
ViewParent parent = view.getParentForAccessibility();
- while (parent instanceof View && !shouldStopPrefetching(outInfos)) {
+ while (parent instanceof View
+ && outInfos.size() < MAX_ACCESSIBILITY_NODE_INFO_BATCH_SIZE) {
View parentView = (View) parent;
AccessibilityNodeInfo info = parentView.createAccessibilityNodeInfo();
if (info != null) {
@@ -1235,9 +1194,6 @@
private void prefetchSiblingsOfRealNode(View current,
List<AccessibilityNodeInfo> outInfos) {
- if (shouldStopPrefetching(outInfos)) {
- return;
- }
ViewParent parent = current.getParentForAccessibility();
if (parent instanceof ViewGroup) {
ViewGroup parentGroup = (ViewGroup) parent;
@@ -1247,7 +1203,7 @@
parentGroup.addChildrenForAccessibility(children);
final int childCount = children.size();
for (int i = 0; i < childCount; i++) {
- if (shouldStopPrefetching(outInfos)) {
+ if (outInfos.size() >= MAX_ACCESSIBILITY_NODE_INFO_BATCH_SIZE) {
return;
}
View child = children.get(i);
@@ -1275,7 +1231,7 @@
private void prefetchDescendantsOfRealNode(View root,
List<AccessibilityNodeInfo> outInfos) {
- if (shouldStopPrefetching(outInfos) || !(root instanceof ViewGroup)) {
+ if (!(root instanceof ViewGroup)) {
return;
}
HashMap<View, AccessibilityNodeInfo> addedChildren =
@@ -1286,7 +1242,7 @@
root.addChildrenForAccessibility(children);
final int childCount = children.size();
for (int i = 0; i < childCount; i++) {
- if (shouldStopPrefetching(outInfos)) {
+ if (outInfos.size() >= MAX_ACCESSIBILITY_NODE_INFO_BATCH_SIZE) {
return;
}
View child = children.get(i);
@@ -1311,7 +1267,7 @@
} finally {
children.clear();
}
- if (!shouldStopPrefetching(outInfos)) {
+ if (outInfos.size() < MAX_ACCESSIBILITY_NODE_INFO_BATCH_SIZE) {
for (Map.Entry<View, AccessibilityNodeInfo> entry : addedChildren.entrySet()) {
View addedChild = entry.getKey();
AccessibilityNodeInfo virtualRoot = entry.getValue();
@@ -1333,7 +1289,7 @@
long parentNodeId = root.getParentNodeId();
int accessibilityViewId = AccessibilityNodeInfo.getAccessibilityViewId(parentNodeId);
while (accessibilityViewId != AccessibilityNodeInfo.UNDEFINED_ITEM_ID) {
- if (shouldStopPrefetching(outInfos)) {
+ if (outInfos.size() >= MAX_ACCESSIBILITY_NODE_INFO_BATCH_SIZE) {
return;
}
final int virtualDescendantId =
@@ -1378,7 +1334,7 @@
if (parent != null) {
final int childCount = parent.getChildCount();
for (int i = 0; i < childCount; i++) {
- if (shouldStopPrefetching(outInfos)) {
+ if (outInfos.size() >= MAX_ACCESSIBILITY_NODE_INFO_BATCH_SIZE) {
return;
}
final long childNodeId = parent.getChildId(i);
@@ -1403,7 +1359,7 @@
final int initialOutInfosSize = outInfos.size();
final int childCount = root.getChildCount();
for (int i = 0; i < childCount; i++) {
- if (shouldStopPrefetching(outInfos)) {
+ if (outInfos.size() >= MAX_ACCESSIBILITY_NODE_INFO_BATCH_SIZE) {
return;
}
final long childNodeId = root.getChildId(i);
@@ -1413,7 +1369,7 @@
outInfos.add(child);
}
}
- if (!shouldStopPrefetching(outInfos)) {
+ if (outInfos.size() < MAX_ACCESSIBILITY_NODE_INFO_BATCH_SIZE) {
final int addedChildCount = outInfos.size() - initialOutInfosSize;
for (int i = 0; i < addedChildCount; i++) {
AccessibilityNodeInfo child = outInfos.get(initialOutInfosSize + i);
@@ -1522,10 +1478,6 @@
boolean hasAccessibilityCallback(Message message) {
return message.what < FIRST_NO_ACCESSIBILITY_CALLBACK_MSG ? true : false;
}
-
- boolean hasUserInteractiveMessagesWaiting() {
- return hasMessagesOrCallbacks();
- }
}
private final class AddNodeInfosForViewId implements Predicate<View> {
diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java
index 9991367..a2dab70 100644
--- a/core/java/android/view/Display.java
+++ b/core/java/android/view/Display.java
@@ -687,6 +687,19 @@
}
/**
+ * Gets the default brightness configured for the display.
+ *
+ * @return Default brightness between 0.0-1.0
+ * @hide
+ */
+ public float getBrightnessDefault() {
+ synchronized (this) {
+ updateDisplayInfoLocked();
+ return mDisplayInfo.brightnessDefault;
+ }
+ }
+
+ /**
* Gets the size of the display, in pixels.
* Value returned by this method does not necessarily represent the actual raw size
* (native resolution) of the display.
diff --git a/core/java/android/view/DisplayCutout.java b/core/java/android/view/DisplayCutout.java
index 3f2dd4d..525ac53 100644
--- a/core/java/android/view/DisplayCutout.java
+++ b/core/java/android/view/DisplayCutout.java
@@ -196,6 +196,12 @@
return rects;
}
+ private void scale(float scale) {
+ for (int i = 0; i < BOUNDS_POSITION_LENGTH; ++i) {
+ mRects[i].scale(scale);
+ }
+ }
+
@Override
public int hashCode() {
int result = 0;
@@ -871,6 +877,16 @@
mInner = cutout;
}
+ public void scale(float scale) {
+ final Rect safeInsets = mInner.getSafeInsets();
+ safeInsets.scale(scale);
+ final Bounds bounds = new Bounds(mInner.mBounds.mRects, true);
+ bounds.scale(scale);
+ final Rect waterfallInsets = mInner.mWaterfallInsets.toRect();
+ waterfallInsets.scale(scale);
+ mInner = new DisplayCutout(safeInsets, Insets.of(waterfallInsets), bounds);
+ }
+
@Override
public int hashCode() {
return mInner.hashCode();
diff --git a/core/java/android/view/DisplayInfo.java b/core/java/android/view/DisplayInfo.java
index 0ac0305..fc42cd0 100644
--- a/core/java/android/view/DisplayInfo.java
+++ b/core/java/android/view/DisplayInfo.java
@@ -275,6 +275,27 @@
// TODO (b/114338689): Remove the flag and use IWindowManager#getRemoveContentMode
public int removeMode = Display.REMOVE_MODE_MOVE_CONTENT_TO_PRIMARY;
+ /**
+ * @hide
+ * The current minimum brightness constraint of the display. Value between 0.0 and 1.0,
+ * derived from the config constraints of the display device of this logical display.
+ */
+ public float brightnessMinimum;
+
+ /**
+ * @hide
+ * The current maximum brightness constraint of the display. Value between 0.0 and 1.0,
+ * derived from the config constraints of the display device of this logical display.
+ */
+ public float brightnessMaximum;
+
+ /**
+ * @hide
+ * The current default brightness of the display. Value between 0.0 and 1.0,
+ * derived from the configuration of the display device of this logical display.
+ */
+ public float brightnessDefault;
+
public static final @android.annotation.NonNull Creator<DisplayInfo> CREATOR = new Creator<DisplayInfo>() {
@Override
public DisplayInfo createFromParcel(Parcel source) {
@@ -339,7 +360,10 @@
&& ownerUid == other.ownerUid
&& Objects.equals(ownerPackageName, other.ownerPackageName)
&& removeMode == other.removeMode
- && refreshRateOverride == other.refreshRateOverride;
+ && refreshRateOverride == other.refreshRateOverride
+ && brightnessMinimum == other.brightnessMinimum
+ && brightnessMaximum == other.brightnessMaximum
+ && brightnessDefault == other.brightnessDefault;
}
@Override
@@ -384,6 +408,9 @@
ownerPackageName = other.ownerPackageName;
removeMode = other.removeMode;
refreshRateOverride = other.refreshRateOverride;
+ brightnessMinimum = other.brightnessMinimum;
+ brightnessMaximum = other.brightnessMaximum;
+ brightnessDefault = other.brightnessDefault;
}
public void readFromParcel(Parcel source) {
@@ -430,6 +457,9 @@
uniqueId = source.readString8();
removeMode = source.readInt();
refreshRateOverride = source.readFloat();
+ brightnessMinimum = source.readFloat();
+ brightnessMaximum = source.readFloat();
+ brightnessDefault = source.readFloat();
}
@Override
@@ -475,6 +505,9 @@
dest.writeString8(uniqueId);
dest.writeInt(removeMode);
dest.writeFloat(refreshRateOverride);
+ dest.writeFloat(brightnessMinimum);
+ dest.writeFloat(brightnessMaximum);
+ dest.writeFloat(brightnessDefault);
}
@Override
@@ -698,7 +731,12 @@
sb.append(removeMode);
sb.append(", refreshRateOverride ");
sb.append(refreshRateOverride);
-
+ sb.append(", brightnessMinimum ");
+ sb.append(brightnessMinimum);
+ sb.append(", brightnessMaximum ");
+ sb.append(brightnessMaximum);
+ sb.append(", brightnessDefault ");
+ sb.append(brightnessDefault);
sb.append("}");
return sb.toString();
}
diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl
index 025a977..68a6de8 100644
--- a/core/java/android/view/IWindowManager.aidl
+++ b/core/java/android/view/IWindowManager.aidl
@@ -728,7 +728,7 @@
* @return {@code true} if system bars are always comsumed.
*/
boolean getWindowInsets(in WindowManager.LayoutParams attrs, int displayId,
- out DisplayCutout.ParcelableWrapper outDisplayCutout, out InsetsState outInsetsState);
+ out InsetsState outInsetsState);
/**
* Called to show global actions.
diff --git a/core/java/android/view/IWindowSession.aidl b/core/java/android/view/IWindowSession.aidl
index cfdaf8c..85498cb 100644
--- a/core/java/android/view/IWindowSession.aidl
+++ b/core/java/android/view/IWindowSession.aidl
@@ -47,13 +47,11 @@
interface IWindowSession {
int addToDisplay(IWindow window, in WindowManager.LayoutParams attrs,
in int viewVisibility, in int layerStackId, in InsetsState requestedVisibility,
- out Rect outFrame, out DisplayCutout.ParcelableWrapper displayCutout,
- out InputChannel outInputChannel, out InsetsState insetsState,
+ out Rect outFrame, out InputChannel outInputChannel, out InsetsState insetsState,
out InsetsSourceControl[] activeControls);
int addToDisplayAsUser(IWindow window, in WindowManager.LayoutParams attrs,
in int viewVisibility, in int layerStackId, in int userId,
- in InsetsState requestedVisibility, out Rect outFrame,
- out DisplayCutout.ParcelableWrapper displayCutout, out InputChannel outInputChannel,
+ in InsetsState requestedVisibility, out Rect outFrame, out InputChannel outInputChannel,
out InsetsState insetsState, out InsetsSourceControl[] activeControls);
int addToDisplayWithoutInputChannel(IWindow window, in WindowManager.LayoutParams attrs,
in int viewVisibility, in int layerStackId, out InsetsState insetsState);
diff --git a/core/java/android/view/InsetsAnimationControlImpl.java b/core/java/android/view/InsetsAnimationControlImpl.java
index 75dc0c4..a89c540 100644
--- a/core/java/android/view/InsetsAnimationControlImpl.java
+++ b/core/java/android/view/InsetsAnimationControlImpl.java
@@ -334,8 +334,7 @@
private Insets getInsetsFromState(InsetsState state, Rect frame,
@Nullable @InternalInsetsSide SparseIntArray typeSideMap) {
return state.calculateInsets(frame, null /* ignoringVisibilityState */,
- false /* isScreenRound */,
- false /* alwaysConsumeSystemBars */, null /* displayCutout */,
+ false /* isScreenRound */, false /* alwaysConsumeSystemBars */,
LayoutParams.SOFT_INPUT_ADJUST_RESIZE /* legacySoftInputMode*/,
0 /* legacyWindowFlags */, 0 /* legacySystemUiFlags */, TYPE_APPLICATION,
WINDOWING_MODE_UNDEFINED, typeSideMap).getInsets(mTypes);
diff --git a/core/java/android/view/InsetsController.java b/core/java/android/view/InsetsController.java
index 80437be..2d26c64 100644
--- a/core/java/android/view/InsetsController.java
+++ b/core/java/android/view/InsetsController.java
@@ -522,7 +522,6 @@
private int mLastLegacyWindowFlags;
private int mLastLegacySystemUiFlags;
private int mLastWindowingMode;
- private DisplayCutout mLastDisplayCutout;
private boolean mStartingAnimation;
private int mCaptionInsetsHeight = 0;
private boolean mAnimationsDisabled;
@@ -589,9 +588,8 @@
WindowInsets insets = state.calculateInsets(mFrame, mState /* ignoringVisibilityState*/,
mLastInsets.isRound(), mLastInsets.shouldAlwaysConsumeSystemBars(),
- mLastDisplayCutout, mLastLegacySoftInputMode, mLastLegacyWindowFlags,
- mLastLegacySystemUiFlags, mWindowType, mLastWindowingMode,
- null /* typeSideMap */);
+ mLastLegacySoftInputMode, mLastLegacyWindowFlags, mLastLegacySystemUiFlags,
+ mWindowType, mLastWindowingMode, null /* typeSideMap */);
mHost.dispatchWindowInsetsAnimationProgress(insets, mUnmodifiableTmpRunningAnims);
if (DEBUG) {
for (WindowInsetsAnimation anim : mUnmodifiableTmpRunningAnims) {
@@ -654,6 +652,7 @@
private void updateState(InsetsState newState) {
mState.setDisplayFrame(newState.getDisplayFrame());
+ mState.setDisplayCutout(newState.getDisplayCutout());
@InsetsType int disabledUserAnimationTypes = 0;
@InsetsType int[] cancelledUserAnimationTypes = {0};
for (@InternalInsetsType int type = 0; type < InsetsState.SIZE; type++) {
@@ -725,18 +724,16 @@
*/
@VisibleForTesting
public WindowInsets calculateInsets(boolean isScreenRound, boolean alwaysConsumeSystemBars,
- DisplayCutout cutout, int windowType, int windowingMode,
- int legacySoftInputMode, int legacyWindowFlags, int legacySystemUiFlags) {
+ int windowType, int windowingMode, int legacySoftInputMode, int legacyWindowFlags,
+ int legacySystemUiFlags) {
mWindowType = windowType;
mLastWindowingMode = windowingMode;
mLastLegacySoftInputMode = legacySoftInputMode;
mLastLegacyWindowFlags = legacyWindowFlags;
mLastLegacySystemUiFlags = legacySystemUiFlags;
- mLastDisplayCutout = cutout;
mLastInsets = mState.calculateInsets(mFrame, null /* ignoringVisibilityState*/,
- isScreenRound, alwaysConsumeSystemBars, cutout,
- legacySoftInputMode, legacyWindowFlags, legacySystemUiFlags,
- windowType, windowingMode, null /* typeSideMap */);
+ isScreenRound, alwaysConsumeSystemBars, legacySoftInputMode, legacyWindowFlags,
+ legacySystemUiFlags, windowType, windowingMode, null /* typeSideMap */);
return mLastInsets;
}
@@ -1334,6 +1331,23 @@
@VisibleForTesting
public void applyAnimation(@InsetsType final int types, boolean show, boolean fromIme) {
+ // TODO(b/166736352): We should only skip the animation of specific types, not all types.
+ boolean skipAnim = false;
+ if ((types & ime()) != 0) {
+ final InsetsSourceConsumer consumer = mSourceConsumers.get(ITYPE_IME);
+ final InsetsSourceControl imeControl = consumer != null ? consumer.getControl() : null;
+ // Skip showing animation once that made by system for some reason.
+ // (e.g. starting window with IME snapshot)
+ if (imeControl != null && show) {
+ skipAnim = imeControl.getAndClearSkipAnimationOnce();
+ }
+ }
+ applyAnimation(types, show, fromIme, skipAnim);
+ }
+
+ @VisibleForTesting
+ public void applyAnimation(@InsetsType final int types, boolean show, boolean fromIme,
+ boolean skipAnim) {
if (types == 0) {
// nothing to animate.
if (DEBUG) Log.d(TAG, "applyAnimation, nothing to animate");
@@ -1342,7 +1356,7 @@
boolean hasAnimationCallbacks = mHost.hasAnimationCallbacks();
final InternalAnimationControlListener listener = new InternalAnimationControlListener(
- show, hasAnimationCallbacks, types, mAnimationsDisabled,
+ show, hasAnimationCallbacks, types, skipAnim || mAnimationsDisabled,
mHost.dipToPx(InternalAnimationControlListener.FLOATING_IME_BOTTOM_INSET));
// Show/hide animations always need to be relative to the display frame, in order that shown
diff --git a/core/java/android/view/InsetsSourceControl.java b/core/java/android/view/InsetsSourceControl.java
index 5ddbd02..c717c2a 100644
--- a/core/java/android/view/InsetsSourceControl.java
+++ b/core/java/android/view/InsetsSourceControl.java
@@ -41,6 +41,7 @@
private final @InternalInsetsType int mType;
private final @Nullable SurfaceControl mLeash;
private final Point mSurfacePosition;
+ private boolean mSkipAnimationOnce;
public InsetsSourceControl(@InternalInsetsType int type, @Nullable SurfaceControl leash,
Point surfacePosition) {
@@ -57,6 +58,7 @@
mLeash = null;
}
mSurfacePosition = new Point(other.mSurfacePosition);
+ mSkipAnimationOnce = other.getAndClearSkipAnimationOnce();
}
public int getType() {
@@ -77,6 +79,7 @@
mType = in.readInt();
mLeash = in.readParcelable(null /* loader */);
mSurfacePosition = in.readParcelable(null /* loader */);
+ mSkipAnimationOnce = in.readBoolean();
}
public boolean setSurfacePosition(int left, int top) {
@@ -87,10 +90,27 @@
return true;
}
+ public void setSkipAnimationOnce(boolean skipAnimation) {
+ mSkipAnimationOnce = skipAnimation;
+ }
+
public Point getSurfacePosition() {
return mSurfacePosition;
}
+ /**
+ * Get the state whether the current control needs to skip animation or not.
+ *
+ * Note that this is a one-time check that the state is only valid and can be called when
+ * {@link InsetsController#applyAnimation} to check if the current control can skip animation
+ * at this time, and then will clear the state value.
+ */
+ public boolean getAndClearSkipAnimationOnce() {
+ final boolean result = mSkipAnimationOnce;
+ mSkipAnimationOnce = false;
+ return result;
+ }
+
@Override
public int describeContents() {
return 0;
@@ -101,6 +121,7 @@
dest.writeInt(mType);
dest.writeParcelable(mLeash, 0 /* flags*/);
dest.writeParcelable(mSurfacePosition, 0 /* flags*/);
+ dest.writeBoolean(mSkipAnimationOnce);
}
public void release(Consumer<SurfaceControl> surfaceReleaseConsumer) {
@@ -114,6 +135,7 @@
pw.print("InsetsSourceControl type="); pw.print(InsetsState.typeToString(mType));
pw.print(" mLeash="); pw.print(mLeash);
pw.print(" mSurfacePosition="); pw.print(mSurfacePosition);
+ pw.print(" mSkipAnimationOnce="); pw.print(mSkipAnimationOnce);
pw.println();
}
diff --git a/core/java/android/view/InsetsState.java b/core/java/android/view/InsetsState.java
index b66dd29e..bf377b0 100644
--- a/core/java/android/view/InsetsState.java
+++ b/core/java/android/view/InsetsState.java
@@ -16,6 +16,7 @@
package android.view;
+import static android.view.InsetsStateProto.DISPLAY_CUTOUT;
import static android.view.InsetsStateProto.DISPLAY_FRAME;
import static android.view.InsetsStateProto.SOURCES;
import static android.view.View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
@@ -165,6 +166,10 @@
*/
private final Rect mDisplayFrame = new Rect();
+ /** The area cut from the display. */
+ private final DisplayCutout.ParcelableWrapper mDisplayCutout =
+ new DisplayCutout.ParcelableWrapper();
+
public InsetsState() {
}
@@ -186,7 +191,7 @@
* @return The calculated insets.
*/
public WindowInsets calculateInsets(Rect frame, @Nullable InsetsState ignoringVisibilityState,
- boolean isScreenRound, boolean alwaysConsumeSystemBars, DisplayCutout cutout,
+ boolean isScreenRound, boolean alwaysConsumeSystemBars,
int legacySoftInputMode, int legacyWindowFlags, int legacySystemUiFlags,
int windowType, @WindowConfiguration.WindowingMode int windowingMode,
@Nullable @InternalInsetsSide SparseIntArray typeSideMap) {
@@ -236,10 +241,31 @@
}
return new WindowInsets(typeInsetsMap, typeMaxInsetsMap, typeVisibilityMap, isScreenRound,
- alwaysConsumeSystemBars, cutout, compatInsetsTypes,
+ alwaysConsumeSystemBars, calculateRelativeCutout(frame), compatInsetsTypes,
(legacySystemUiFlags & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0);
}
+ private DisplayCutout calculateRelativeCutout(Rect frame) {
+ final DisplayCutout raw = mDisplayCutout.get();
+ if (mDisplayFrame.equals(frame)) {
+ return raw;
+ }
+ if (frame == null) {
+ return DisplayCutout.NO_CUTOUT;
+ }
+ final int insetLeft = frame.left - mDisplayFrame.left;
+ final int insetTop = frame.top - mDisplayFrame.top;
+ final int insetRight = mDisplayFrame.right - frame.right;
+ final int insetBottom = mDisplayFrame.bottom - frame.bottom;
+ if (insetLeft >= raw.getSafeInsetLeft()
+ && insetTop >= raw.getSafeInsetTop()
+ && insetRight >= raw.getSafeInsetRight()
+ && insetBottom >= raw.getSafeInsetBottom()) {
+ return DisplayCutout.NO_CUTOUT;
+ }
+ return raw.inset(insetLeft, insetTop, insetRight, insetBottom);
+ }
+
public Rect calculateInsets(Rect frame, @InsetsType int types, boolean ignoreVisibility) {
Insets insets = Insets.NONE;
for (int type = FIRST_TYPE; type <= LAST_TYPE; type++) {
@@ -392,15 +418,6 @@
return mSources[type];
}
- public boolean hasSources() {
- for (int i = 0; i < SIZE; i++) {
- if (mSources[i] != null) {
- return true;
- }
- }
- return false;
- }
-
/**
* Returns the source visibility or the default visibility if the source doesn't exist. This is
* useful if when treating this object as a request.
@@ -422,6 +439,14 @@
return mDisplayFrame;
}
+ public void setDisplayCutout(DisplayCutout cutout) {
+ mDisplayCutout.set(cutout);
+ }
+
+ public DisplayCutout getDisplayCutout() {
+ return mDisplayCutout.get();
+ }
+
/**
* Modifies the state of this class to exclude a certain type to make it ready for dispatching
* to the client.
@@ -452,6 +477,7 @@
*/
public void scale(float scale) {
mDisplayFrame.scale(scale);
+ mDisplayCutout.scale(scale);
for (int i = 0; i < SIZE; i++) {
final InsetsSource source = mSources[i];
if (source != null) {
@@ -470,6 +496,7 @@
public void set(InsetsState other, boolean copySources) {
mDisplayFrame.set(other.mDisplayFrame);
+ mDisplayCutout.set(other.mDisplayCutout);
if (copySources) {
for (int i = 0; i < SIZE; i++) {
InsetsSource source = other.mSources[i];
@@ -592,6 +619,7 @@
source.dumpDebug(proto, SOURCES);
}
mDisplayFrame.dumpDebug(proto, DISPLAY_FRAME);
+ mDisplayCutout.get().dumpDebug(proto, DISPLAY_CUTOUT);
proto.end(token);
}
@@ -669,7 +697,8 @@
InsetsState state = (InsetsState) o;
- if (!mDisplayFrame.equals(state.mDisplayFrame)) {
+ if (!mDisplayFrame.equals(state.mDisplayFrame)
+ || !mDisplayCutout.equals(state.mDisplayCutout)) {
return false;
}
for (int i = 0; i < SIZE; i++) {
@@ -681,7 +710,7 @@
if (source == null && otherSource == null) {
continue;
}
- if (source != null && otherSource == null || source == null && otherSource != null) {
+ if (source == null || otherSource == null) {
return false;
}
if (!otherSource.equals(source, excludeInvisibleImeFrames)) {
@@ -693,7 +722,7 @@
@Override
public int hashCode() {
- return Objects.hash(mDisplayFrame, Arrays.hashCode(mSources));
+ return Objects.hash(mDisplayFrame, mDisplayCutout, Arrays.hashCode(mSources));
}
public InsetsState(Parcel in) {
@@ -707,7 +736,8 @@
@Override
public void writeToParcel(Parcel dest, int flags) {
- dest.writeParcelable(mDisplayFrame, flags);
+ mDisplayFrame.writeToParcel(dest, flags);
+ mDisplayCutout.writeToParcel(dest, flags);
dest.writeParcelableArray(mSources, 0);
}
@@ -723,7 +753,8 @@
};
public void readFromParcel(Parcel in) {
- mDisplayFrame.set(in.readParcelable(null /* loader */));
+ mDisplayFrame.set(Rect.CREATOR.createFromParcel(in));
+ mDisplayCutout.set(DisplayCutout.ParcelableWrapper.CREATOR.createFromParcel(in));
mSources = in.readParcelableArray(null, InsetsSource.class);
}
@@ -738,6 +769,7 @@
}
return "InsetsState: {"
+ "mDisplayFrame=" + mDisplayFrame
+ + ", mDisplayCutout=" + mDisplayCutout
+ ", mSources= { " + joiner
+ " }";
}
diff --git a/core/java/android/view/OWNERS b/core/java/android/view/OWNERS
index bae6ee8..e66b17a 100644
--- a/core/java/android/view/OWNERS
+++ b/core/java/android/view/OWNERS
@@ -33,6 +33,9 @@
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
+# Notifications
+per-file Notification*.java = file:/services/core/java/com/android/server/notification/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
diff --git a/core/java/android/view/SurfaceControlViewHost.java b/core/java/android/view/SurfaceControlViewHost.java
index 4d1faf7..f019648 100644
--- a/core/java/android/view/SurfaceControlViewHost.java
+++ b/core/java/android/view/SurfaceControlViewHost.java
@@ -115,6 +115,7 @@
public void writeToParcel(@NonNull Parcel out, int flags) {
mSurfaceControl.writeToParcel(out, flags);
out.writeStrongBinder(mAccessibilityEmbeddedConnection.asBinder());
+ out.writeStrongBinder(mInputToken);
}
/**
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index b5185ae..36124e8 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -240,7 +240,7 @@
private static boolean useBlastAdapter(Context context) {
ContentResolver contentResolver = context.getContentResolver();
return Settings.Global.getInt(contentResolver,
- Settings.Global.DEVELOPMENT_USE_BLAST_ADAPTER_SV, 1 /* default */) == 1;
+ Settings.Global.DEVELOPMENT_USE_BLAST_ADAPTER_SV, 0 /* default */) == 1;
}
private final boolean mUseBlastAdapter;
@@ -457,18 +457,8 @@
Log.d(TAG, System.identityHashCode(this)
+ " updateSurfaceAlpha RT: set alpha=" + alpha);
}
- if (useBLAST) {
- synchronized (viewRoot.getBlastTransactionLock()) {
- viewRoot.getBLASTSyncTransaction()
- .setAlpha(mSurfaceControl, alpha);
- }
- } else {
- Transaction t = new SurfaceControl.Transaction();
- t.setAlpha(mSurfaceControl, alpha);
- t.deferTransactionUntil(mSurfaceControl,
- viewRoot.getSurfaceControl(), frame);
- t.apply();
- }
+ mRtTransaction.setAlpha(mSurfaceControl, alpha);
+ applyRtTransaction(frame);
}
// It's possible that mSurfaceControl is released in the UI thread before
// the transaction completes. If that happens, an exception is thrown, which
@@ -818,17 +808,8 @@
return;
}
- if (useBLAST) {
- synchronized (viewRoot.getBlastTransactionLock()) {
- updateRelativeZ(viewRoot.getBLASTSyncTransaction());
- }
- } else {
- final SurfaceControl.Transaction t = new SurfaceControl.Transaction();
- updateRelativeZ(t);
- t.deferTransactionUntil(mSurfaceControl,
- viewRoot.getSurfaceControl(), frame);
- t.apply();
- }
+ updateRelativeZ(mRtTransaction);
+ applyRtTransaction(frame);
}
// It's possible that mSurfaceControl is released in the UI thread before
// the transaction completes. If that happens, an exception is thrown, which
@@ -927,7 +908,7 @@
}
private boolean performSurfaceTransaction(ViewRootImpl viewRoot, Translator translator,
- boolean creating, boolean sizeChanged, boolean needBLASTSync) {
+ boolean creating, boolean sizeChanged) {
boolean realSizeChanged = false;
mSurfaceLock.lock();
@@ -990,8 +971,6 @@
mTmpTransaction.setWindowCrop(mSurfaceControl, mSurfaceWidth,
mSurfaceHeight);
}
- } else if (needBLASTSync) {
- viewRoot.setUseBLASTSyncTransaction();
}
mTmpTransaction.setCornerRadius(mSurfaceControl, mCornerRadius);
if (sizeChanged && !creating) {
@@ -1109,11 +1088,8 @@
return;
}
- final boolean needBLASTSync =
- (layoutSizeChanged || positionChanged || visibleChanged) &&
- useBLASTSync(viewRoot);
final boolean realSizeChanged = performSurfaceTransaction(viewRoot,
- translator, creating, sizeChanged, needBLASTSync);
+ translator, creating, sizeChanged);
final boolean redrawNeeded = sizeChanged || creating ||
(mVisible && !mDrawFinished);
@@ -1351,13 +1327,7 @@
}
private void applySurfaceTransforms(SurfaceControl surface, SurfaceControl.Transaction t,
- Rect position, long frameNumber) {
- final ViewRootImpl viewRoot = getViewRootImpl();
- if (frameNumber > 0 && viewRoot != null && !useBLASTSync(viewRoot)) {
- t.deferTransactionUntil(surface, viewRoot.getSurfaceControl(),
- frameNumber);
- }
-
+ Rect position) {
onSetSurfacePositionAndScaleRT(t, surface,
position.left /*positionLeft*/,
position.top /*positionTop*/,
@@ -1378,24 +1348,29 @@
return mRTLastReportedPosition;
}
- private void setParentSpaceRectangle(Transaction t, Rect position, long frameNumber) {
- final ViewRootImpl viewRoot = getViewRootImpl();
- applySurfaceTransforms(mSurfaceControl, t, position, frameNumber);
- applyChildSurfaceTransaction_renderWorker(t, viewRoot.mSurface, frameNumber);
- }
-
private void setParentSpaceRectangle(Rect position, long frameNumber) {
final ViewRootImpl viewRoot = getViewRootImpl();
- final boolean useBLAST = useBLASTSync(viewRoot);
+ applySurfaceTransforms(mSurfaceControl, mRtTransaction, position);
+ applyChildSurfaceTransaction_renderWorker(mRtTransaction, viewRoot.mSurface, frameNumber);
+ applyRtTransaction(frameNumber);
+ }
+ private void applyRtTransaction(long frameNumber) {
+ final ViewRootImpl viewRoot = getViewRootImpl();
+ boolean useBLAST = viewRoot != null && useBLASTSync(viewRoot);
if (useBLAST) {
- synchronized (viewRoot.getBlastTransactionLock()) {
- setParentSpaceRectangle(viewRoot.getBLASTSyncTransaction(), position, frameNumber);
- }
- } else {
- setParentSpaceRectangle(mRtTransaction, position, frameNumber);
- mRtTransaction.apply();
+ // If we are using BLAST, merge the transaction with the viewroot buffer transaction.
+ viewRoot.mergeWithNextTransaction(mRtTransaction, frameNumber);
+ return;
}
+
+ // Otherwise if the if the ViewRoot is not null, use deferred transaction instead.
+ if (frameNumber > 0 && viewRoot != null && viewRoot.mSurface.isValid()
+ && mSurfaceControl != null) {
+ mRtTransaction.deferTransactionUntil(mSurfaceControl,
+ viewRoot.getSurfaceControl(), frameNumber);
+ }
+ mRtTransaction.apply();
}
private Rect mRTLastReportedPosition = new Rect();
@@ -1444,8 +1419,6 @@
@Override
public void positionLost(long frameNumber) {
- final ViewRootImpl viewRoot = getViewRootImpl();
- boolean useBLAST = viewRoot != null && useBLASTSync(viewRoot);
if (DEBUG) {
Log.d(TAG, String.format("%d windowPositionLost, frameNr = %d",
System.identityHashCode(this), frameNumber));
@@ -1461,30 +1434,20 @@
* need to hold the lock here.
*/
synchronized (mSurfaceControlLock) {
- if (useBLAST) {
- synchronized (viewRoot.getBlastTransactionLock()) {
- viewRoot.getBLASTSyncTransaction().hide(mSurfaceControl);
- if (mRtReleaseSurfaces) {
- mRtReleaseSurfaces = false;
- releaseSurfaces(viewRoot.getBLASTSyncTransaction());
- }
- }
- } else {
- if (frameNumber > 0 && viewRoot != null && viewRoot.mSurface.isValid()) {
- mRtTransaction.deferTransactionUntil(mSurfaceControl,
- viewRoot.getSurfaceControl(), frameNumber);
- }
- mRtTransaction.hide(mSurfaceControl);
- if (mRtReleaseSurfaces) {
- mRtReleaseSurfaces = false;
- releaseSurfaces(mRtTransaction);
- }
- // If we aren't using BLAST, we apply the transaction locally, otherwise we let
- // the ViewRoot apply it for us.
- // If the ViewRoot is null, we behave as if we aren't using BLAST so we need to
- // apply the transaction.
- mRtTransaction.apply();
+ final ViewRootImpl viewRoot = getViewRootImpl();
+ boolean deferTransaction = frameNumber > 0 && viewRoot != null
+ && viewRoot.mSurface.isValid() && !useBLASTSync(viewRoot);
+ if (deferTransaction) {
+ mRtTransaction.deferTransactionUntil(mSurfaceControl,
+ viewRoot.getSurfaceControl(), frameNumber);
}
+
+ mRtTransaction.hide(mSurfaceControl);
+ if (mRtReleaseSurfaces) {
+ mRtReleaseSurfaces = false;
+ releaseSurfaces(mRtTransaction);
+ }
+ applyRtTransaction(frameNumber);
mRtHandlingPositionUpdates = false;
}
}
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 1d1c87d..24b71ab 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -29071,9 +29071,6 @@
*/
final Rect mCaptionInsets = new Rect();
- final DisplayCutout.ParcelableWrapper mDisplayCutout =
- new DisplayCutout.ParcelableWrapper(DisplayCutout.NO_CUTOUT);
-
/**
* In multi-window we force show the system bars. Because we don't want that the surface
* size changes in this mode, we instead have a flag whether the system bars sizes should
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 52ce5e7..24989b6 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -42,7 +42,6 @@
import static android.view.ViewRootImplProto.IS_ANIMATING;
import static android.view.ViewRootImplProto.IS_DRAWING;
import static android.view.ViewRootImplProto.LAST_WINDOW_INSETS;
-import static android.view.ViewRootImplProto.PENDING_DISPLAY_CUTOUT;
import static android.view.ViewRootImplProto.REMOVED;
import static android.view.ViewRootImplProto.SCROLL_Y;
import static android.view.ViewRootImplProto.SOFT_INPUT_MODE;
@@ -239,6 +238,7 @@
private static final boolean DEBUG_KEEP_SCREEN_ON = false || LOCAL_LOGV;
private static final boolean DEBUG_CONTENT_CAPTURE = false || LOCAL_LOGV;
private static final boolean DEBUG_SCROLL_CAPTURE = false || LOCAL_LOGV;
+ private static final boolean DEBUG_BLAST = false || LOCAL_LOGV;
/**
* Set to false if we do not want to use the multi threaded renderer even though
@@ -572,8 +572,6 @@
final Rect mWinFrame; // frame given by window manager.
final Rect mPendingBackDropFrame = new Rect();
- final DisplayCutout.ParcelableWrapper mPendingDisplayCutout =
- new DisplayCutout.ParcelableWrapper(DisplayCutout.NO_CUTOUT);
boolean mPendingAlwaysConsumeSystemBars;
private final InsetsState mTempInsets = new InsetsState();
private final InsetsSourceControl[] mTempControls = new InsetsSourceControl[SIZE];
@@ -697,30 +695,34 @@
int localChanges;
}
- // If set, ViewRootImpl will request a callback from HWRender when it's ready to render the next
- // frame. This will allow VRI to call BLASTBufferQueue::setNextTransaction with
- // mRtBLASTSyncTransaction, so the next frame submitted will be added to the
- // mRtBLASTSyncTransaction instead of getting applied.
- private boolean mNextDrawUseBLASTSyncTransaction;
-
- // This is used to signal if the mRtBLASTSyncTransaction should be applied/merged. When true,
- // it indicates mRtBLASTSyncTransaction was sent to BLASTBufferQueue::setNextTransaction.
- // Therefore, in onFrameComplete, if mRtNextFrameReportConsumeWithBlast is true, that means
- // mRtBLASTSyncTransaction now contains the next buffer frame to be applied.
- private boolean mRtNextFrameReportedConsumeWithBlast;
-
- // Be very careful with the threading here. This is used from a thread pool generated by the
- // render thread. Therefore, it needs to be locked when updating from the thread pool since
- // multiple threads can be accessing it. It does not need to be locked when applied or merged
- // since that can only happen from the frame complete callback after the other callbacks have
- // been invoked.
+ /**
+ * This is only used when the UI thread is paused due to {@link #mNextDrawUseBlastSync} being
+ * set. Specifically, it's only used when calling
+ * {@link BLASTBufferQueue#setNextTransaction(Transaction)} and then merged with
+ * {@link #mSurfaceChangedTransaction}. It doesn't need to be thread safe since it's only
+ * accessed when the UI thread is paused.
+ */
private final SurfaceControl.Transaction mRtBLASTSyncTransaction =
new SurfaceControl.Transaction();
- // Keeps track of whether the WM requested us to use BLAST Sync when calling relayout.
- // We use this to make sure we don't send the WM transactions from an internal BLAST sync
- // (e.g. SurfaceView)
- private boolean mSendNextFrameToWm = false;
+ /**
+ * Keeps track of whether the WM requested to use BLAST Sync when calling relayout. When set,
+ * we pause the UI thread to ensure we don't get overlapping requests. We then send a
+ * transaction to {@link BLASTBufferQueue#setNextTransaction(Transaction)}, which is then sent
+ * back to WM to synchronize.
+ *
+ * This flag is set to false only after the synchronized transaction that contains the buffer
+ * has been sent to SurfaceFlinger.
+ */
+ private boolean mNextDrawUseBlastSync = false;
+
+ /**
+ * Keeps track of whether a traverse was triggered while the UI thread was paused. This can
+ * occur when the client is waiting on another process to submit the transaction that
+ * contains the buffer. The UI thread needs to wait on the callback before it can submit
+ * another buffer.
+ */
+ private boolean mRequestedTraverseWhilePaused = false;
private HashSet<ScrollCaptureCallback> mRootScrollCaptureCallbacks;
@@ -1056,8 +1058,7 @@
res = mWindowSession.addToDisplayAsUser(mWindow, mWindowAttributes,
getHostVisibility(), mDisplay.getDisplayId(), userId,
mInsetsController.getRequestedVisibility(), mTmpFrames.frame,
- mAttachInfo.mDisplayCutout, inputChannel,
- mTempInsets, mTempControls);
+ inputChannel, mTempInsets, mTempControls);
if (mTranslator != null) {
mTranslator.translateRectInScreenToAppWindow(mTmpFrames.frame);
mTranslator.translateInsetsStateInScreenToAppWindow(mTempInsets);
@@ -1078,7 +1079,6 @@
}
}
- mPendingDisplayCutout.set(mAttachInfo.mDisplayCutout);
mAttachInfo.mAlwaysConsumeSystemBars =
(res & WindowManagerGlobal.ADD_FLAG_ALWAYS_CONSUME_SYSTEM_BARS) != 0;
mPendingAlwaysConsumeSystemBars = mAttachInfo.mAlwaysConsumeSystemBars;
@@ -1499,15 +1499,13 @@
final boolean forceNextWindowRelayout = args.argi1 != 0;
final int displayId = args.argi3;
final Rect backdropFrame = frames.backdropFrame;
- final DisplayCutout displayCutout = frames.displayCutout.get();
final boolean frameChanged = !mWinFrame.equals(frames.frame);
- final boolean cutoutChanged = !mPendingDisplayCutout.get().equals(displayCutout);
final boolean backdropFrameChanged = !mPendingBackDropFrame.equals(backdropFrame);
final boolean configChanged = !mLastReportedMergedConfiguration.equals(mergedConfiguration);
final boolean displayChanged = mDisplay.getDisplayId() != displayId;
- if (msg == MSG_RESIZED && !frameChanged && !cutoutChanged && !backdropFrameChanged
- && !configChanged && !displayChanged && !forceNextWindowRelayout) {
+ if (msg == MSG_RESIZED && !frameChanged && !backdropFrameChanged && !configChanged
+ && !displayChanged && !forceNextWindowRelayout) {
return;
}
@@ -1522,16 +1520,15 @@
setFrame(frames.frame);
mTmpFrames.displayFrame.set(frames.displayFrame);
- mPendingDisplayCutout.set(displayCutout);
mPendingBackDropFrame.set(backdropFrame);
mForceNextWindowRelayout = forceNextWindowRelayout;
mPendingAlwaysConsumeSystemBars = args.argi2 != 0;
- if (msg == MSG_RESIZED_REPORT) {
+ if (msg == MSG_RESIZED_REPORT && !mNextDrawUseBlastSync) {
reportNextDraw();
}
- if (mView != null && (frameChanged || cutoutChanged || configChanged)) {
+ if (mView != null && (frameChanged || configChanged)) {
forceLayout(mView);
}
requestLayout();
@@ -2331,8 +2328,7 @@
final Configuration config = mContext.getResources().getConfiguration();
mLastWindowInsets = mInsetsController.calculateInsets(
config.isScreenRound(), mAttachInfo.mAlwaysConsumeSystemBars,
- mPendingDisplayCutout.get(), mWindowAttributes.type,
- config.windowConfiguration.getWindowingMode(),
+ mWindowAttributes.type, config.windowConfiguration.getWindowingMode(),
mWindowAttributes.softInputMode, mWindowAttributes.flags,
(mWindowAttributes.systemUiVisibility
| mWindowAttributes.subtreeSystemUiVisibility));
@@ -2405,8 +2401,26 @@
host.debug();
}
- if (host == null || !mAdded)
+ if (host == null || !mAdded) {
return;
+ }
+
+ // This is to ensure we don't end up queueing new frames while waiting on a previous frame
+ // to get latched. This can happen when there's been a sync request for this window. The
+ // frame could be in a transaction that's passed to different processes to ensure
+ // synchronization. It continues to block until ViewRootImpl receives a callback that the
+ // transaction containing the buffer has been sent to SurfaceFlinger. Once we receive, that
+ // signal, we know it's safe to start queuing new buffers.
+ //
+ // When the callback is invoked, it will trigger a traversal request if
+ // mRequestedTraverseWhilePaused is set so there's no need to attempt a retry here.
+ if (mNextDrawUseBlastSync) {
+ if (DEBUG_BLAST) {
+ Log.w(mTag, "Can't perform draw while waiting for a transaction complete");
+ }
+ mRequestedTraverseWhilePaused = true;
+ return;
+ }
mIsInTraversal = true;
mWillDrawSoon = true;
@@ -2514,8 +2528,6 @@
// Execute enqueued actions on every traversal in case a detached view enqueued an action
getRunQueue().executeActions(mAttachInfo.mHandler);
- boolean cutoutChanged = false;
-
boolean layoutRequested = mLayoutRequested && (!mStopped || mReportNextDraw);
if (layoutRequested) {
@@ -2527,9 +2539,6 @@
mAttachInfo.mInTouchMode = !mAddedTouchMode;
ensureTouchModeLocally(mAddedTouchMode);
} else {
- if (!mPendingDisplayCutout.equals(mAttachInfo.mDisplayCutout)) {
- cutoutChanged = true;
- }
if (lp.width == ViewGroup.LayoutParams.WRAP_CONTENT
|| lp.height == ViewGroup.LayoutParams.WRAP_CONTENT) {
windowSizeMayChange = true;
@@ -2655,7 +2664,7 @@
}
}
- if (mFirst || windowShouldResize || viewVisibilityChanged || cutoutChanged || params != null
+ if (mFirst || windowShouldResize || viewVisibilityChanged || params != null
|| mForceNextWindowRelayout) {
mForceNextWindowRelayout = false;
@@ -2695,7 +2704,6 @@
relayoutResult = relayoutWindow(params, viewVisibility, insetsPending);
if (DEBUG_LAYOUT) Log.v(mTag, "relayout: frame=" + frame.toShortString()
- + " cutout=" + mPendingDisplayCutout.get().toString()
+ " surface=" + mSurface);
// If the pending {@link MergedConfiguration} handed back from
@@ -2711,7 +2719,6 @@
updatedConfiguration = true;
}
- cutoutChanged = !mPendingDisplayCutout.equals(mAttachInfo.mDisplayCutout);
surfaceSizeChanged = false;
if (!mLastSurfaceSize.equals(mSurfaceSize)) {
surfaceSizeChanged = true;
@@ -2735,14 +2742,6 @@
mSurfaceSequenceId++;
}
- if (cutoutChanged) {
- mAttachInfo.mDisplayCutout.set(mPendingDisplayCutout);
- if (DEBUG_LAYOUT) {
- Log.v(mTag, "DisplayCutout changing to: " + mAttachInfo.mDisplayCutout);
- }
- // Need to relayout with content insets.
- dispatchApplyInsets = true;
- }
if (alwaysConsumeSystemBarsChanged) {
mAttachInfo.mAlwaysConsumeSystemBars = mPendingAlwaysConsumeSystemBars;
dispatchApplyInsets = true;
@@ -3148,9 +3147,11 @@
reportNextDraw();
}
if ((relayoutResult & WindowManagerGlobal.RELAYOUT_RES_BLAST_SYNC) != 0) {
+ if (DEBUG_BLAST) {
+ Log.d(mTag, "Relayout called with blastSync");
+ }
reportNextDraw();
- setUseBLASTSyncTransaction();
- mSendNextFrameToWm = true;
+ mNextDrawUseBlastSync = true;
}
boolean cancelDraw = mAttachInfo.mTreeObserver.dispatchOnPreDraw() || !isViewVisible;
@@ -3813,6 +3814,9 @@
mDrawsNeededToReport--;
if (mDrawsNeededToReport == 0) {
reportDrawFinished();
+ } else if (DEBUG_BLAST) {
+ Log.d(mTag, "pendingDrawFinished. Waiting on draw reported mDrawsNeededToReport="
+ + mDrawsNeededToReport);
}
}
@@ -3822,6 +3826,9 @@
private void reportDrawFinished() {
try {
+ if (DEBUG_BLAST) {
+ Log.d(mTag, "reportDrawFinished");
+ }
mDrawsNeededToReport = 0;
mWindowSession.finishDrawing(mWindow, mSurfaceChangedTransaction);
} catch (RemoteException e) {
@@ -3835,16 +3842,19 @@
private HardwareRenderer.FrameCompleteCallback createFrameCompleteCallback(Handler handler,
boolean reportNextDraw, ArrayList<Runnable> commitCallbacks) {
return frameNr -> {
- mBlurRegionAggregator.dispatchBlurTransactionIfNeeded(frameNr);
+ if (DEBUG_BLAST) {
+ Log.d(mTag, "Received frameCompleteCallback frameNum=" + frameNr);
+ }
- // Use a new transaction here since mRtBLASTSyncTransaction can only be accessed by
- // the render thread and mSurfaceChangedTransaction can only be accessed by the UI
- // thread. The temporary transaction is used so mRtBLASTSyncTransaction can be merged
- // with mSurfaceChangedTransaction without synchronization issues.
- final Transaction t = new Transaction();
- finishBLASTSyncOnRT(!mSendNextFrameToWm, t);
handler.postAtFrontOfQueue(() -> {
- mSurfaceChangedTransaction.merge(t);
+ if (mNextDrawUseBlastSync) {
+ // We don't need to synchronize mRtBLASTSyncTransaction here since we're
+ // guaranteed that this is called after onFrameDraw and mNextDrawUseBlastSync
+ // is only true when the UI thread is paused. Therefore, no one should be
+ // modifying this object until the next vsync.
+ mSurfaceChangedTransaction.merge(mRtBLASTSyncTransaction);
+ }
+
if (reportNextDraw) {
// TODO: Use the frame number
pendingDrawFinished();
@@ -3866,10 +3876,16 @@
ArrayList<Runnable> commitCallbacks = mAttachInfo.mTreeObserver
.captureFrameCommitCallbacks();
final boolean needFrameCompleteCallback =
- mNextDrawUseBLASTSyncTransaction || mReportNextDraw
- || (commitCallbacks != null && commitCallbacks.size() > 0)
- || mBlurRegionAggregator.hasRegions();
+ mNextDrawUseBlastSync || mReportNextDraw
+ || (commitCallbacks != null && commitCallbacks.size() > 0);
if (needFrameCompleteCallback) {
+ if (DEBUG_BLAST) {
+ Log.d(mTag, "Creating frameCompleteCallback"
+ + " mNextDrawUseBlastSync=" + mNextDrawUseBlastSync
+ + " mReportNextDraw=" + mReportNextDraw
+ + " commitCallbacks size="
+ + (commitCallbacks == null ? 0 : commitCallbacks.size()));
+ }
mAttachInfo.mThreadedRenderer.setFrameCompleteCallback(
createFrameCompleteCallback(mAttachInfo.mHandler, mReportNextDraw,
commitCallbacks));
@@ -3878,41 +3894,70 @@
return false;
}
- /**
- * The callback will run on a worker thread pool from the render thread.
- */
- private HardwareRenderer.FrameDrawingCallback createFrameDrawingCallback() {
- return frame -> {
- mRtNextFrameReportedConsumeWithBlast = true;
- if (mBlastBufferQueue != null) {
+ private void addFrameCallbackIfNeeded() {
+ boolean nextDrawUseBlastSync = mNextDrawUseBlastSync;
+ boolean hasBlur = mBlurRegionAggregator.hasRegions();
+ boolean reportNextDraw = mReportNextDraw;
+
+ if (!nextDrawUseBlastSync && !reportNextDraw && !hasBlur) {
+ return;
+ }
+
+ if (DEBUG_BLAST) {
+ Log.d(mTag, "Creating frameDrawingCallback"
+ + " nextDrawUseBlastSync=" + nextDrawUseBlastSync
+ + " reportNextDraw=" + reportNextDraw
+ + " hasBlur=" + hasBlur);
+ }
+
+ // The callback will run on a worker thread pool from the render thread.
+ HardwareRenderer.FrameDrawingCallback frameDrawingCallback = frame -> {
+ if (DEBUG_BLAST) {
+ Log.d(mTag, "Received frameDrawingCallback frameNum=" + frame + "."
+ + " Creating transactionCompleteCallback=" + nextDrawUseBlastSync);
+ }
+
+ if (hasBlur) {
+ mBlurRegionAggregator.dispatchBlurTransactionIfNeeded(frame);
+ }
+
+ if (mBlastBufferQueue == null) {
+ return;
+ }
+
+ if (nextDrawUseBlastSync) {
+ // Frame callbacks will always occur after submitting draw requests and before
+ // the draw actually occurs. This will ensure that we set the next transaction
+ // for the frame that's about to get drawn and not on a previous frame that.
+
// We don't need to synchronize mRtBLASTSyncTransaction here since it's not
// being modified and only sent to BlastBufferQueue.
mBlastBufferQueue.setNextTransaction(mRtBLASTSyncTransaction);
+
+ mBlastBufferQueue.setTransactionCompleteCallback(frame, frameNumber -> {
+ if (DEBUG_BLAST) {
+ Log.d(mTag, "Received transactionCompleteCallback frameNum=" + frame);
+ }
+ mHandler.postAtFrontOfQueue(() -> {
+ mNextDrawUseBlastSync = false;
+ if (DEBUG_BLAST) {
+ Log.d(mTag, "Scheduling a traversal=" + mRequestedTraverseWhilePaused
+ + " due to a previous skipped traversal.");
+ }
+ if (mRequestedTraverseWhilePaused) {
+ mRequestedTraverseWhilePaused = false;
+ scheduleTraversals();
+ }
+ });
+ });
+ } else if (reportNextDraw) {
+ // If we need to report next draw, wait for adapter to flush its shadow queue
+ // by processing previously queued buffers so that we can submit the
+ // transaction a timely manner.
+ mBlastBufferQueue.flushShadowQueue();
}
};
- }
-
- private void addFrameCallbackIfNeeded() {
- // Frame callbacks will always occur after submitting draw requests and before
- // the draw actually occurs. This will ensure that we set the next transaction
- // for the frame that's about to get drawn and not on a previous frame that.
- //
- // This is thread safe since mRtNextFrameReportConsumeWithBlast will only be
- // modified in onFrameDraw and then again in onFrameComplete. This is to ensure the
- // next frame completed should be reported with the blast sync transaction.
- if (mNextDrawUseBLASTSyncTransaction) {
- registerRtFrameCallback(createFrameDrawingCallback());
- mNextDrawUseBLASTSyncTransaction = false;
- } else if (mReportNextDraw) {
- registerRtFrameCallback(frame -> {
- if (mBlastBufferQueue != null) {
- // If we need to report next draw, wait for adapter to flush its shadow queue
- // by processing previously queued buffers so that we can submit the
- // transaction a timely manner.
- mBlastBufferQueue.flushShadowQueue();
- }
- });
- }
+ registerRtFrameCallback(frameDrawingCallback);
}
private void performDraw() {
@@ -3923,7 +3968,7 @@
}
final boolean fullRedrawNeeded =
- mFullRedrawNeeded || mReportNextDraw || mNextDrawUseBLASTSyncTransaction;
+ mFullRedrawNeeded || mReportNextDraw || mNextDrawUseBlastSync;
mFullRedrawNeeded = false;
mIsDrawing = true;
@@ -7518,7 +7563,6 @@
insetsPending ? WindowManagerGlobal.RELAYOUT_INSETS_PENDING : 0, frameNumber,
mTmpFrames, mPendingMergedConfiguration, mSurfaceControl, mTempInsets,
mTempControls, mSurfaceSize);
- mPendingDisplayCutout.set(mTmpFrames.displayCutout);
mPendingBackDropFrame.set(mTmpFrames.backdropFrame);
if (mSurfaceControl.isValid()) {
if (!useBLAST()) {
@@ -7679,7 +7723,6 @@
proto.write(IS_DRAWING, mIsDrawing);
proto.write(ADDED, mAdded);
mWinFrame.dumpDebug(proto, WIN_FRAME);
- mPendingDisplayCutout.get().dumpDebug(proto, PENDING_DISPLAY_CUTOUT);
proto.write(LAST_WINDOW_INSETS, Objects.toString(mLastWindowInsets));
proto.write(SOFT_INPUT_MODE, InputMethodDebug.softInputModeToString(mSoftInputMode));
proto.write(SCROLL_Y, mScrollY);
@@ -9946,43 +9989,6 @@
}
}
- void setUseBLASTSyncTransaction() {
- mNextDrawUseBLASTSyncTransaction = true;
- }
-
- /**
- * This should only be called from the render thread.
- */
- private void finishBLASTSyncOnRT(boolean apply, Transaction t) {
- // This is safe to modify on the render thread since the only other place it's modified
- // is on the UI thread when the render thread is paused.
- mSendNextFrameToWm = false;
- if (mRtNextFrameReportedConsumeWithBlast) {
- mRtNextFrameReportedConsumeWithBlast = false;
-
- // We don't need to synchronize mRtBLASTSyncTransaction here we're guaranteed that this
- // is called after all onFrameDraw and after callbacks to PositionUpdateListener.
- // Therefore, no one should be modifying this object until the next vsync.
- if (apply) {
- mRtBLASTSyncTransaction.apply();
- } else {
- t.merge(mRtBLASTSyncTransaction);
- }
-
- // There's potential for the frame callback to get called even if nothing was drawn.
- // When that occurs, we remove the transaction sent to BBQ since the draw we were
- // waiting on will not happen. We can apply the transaction here but it will not contain
- // a buffer since nothing new was drawn.
- //
- // This is mainly for the case when the SurfaceView has changed and wants to synchronize
- // with the main window. If the main window doesn't need to draw anything, we can just
- // apply the transaction without the new buffer from the main window.
- if (mBlastBufferQueue != null) {
- mBlastBufferQueue.setNextTransaction(null);
- }
- }
- }
-
/**
* Sends a list of blur regions to SurfaceFlinger, tagged with a frame.
*
@@ -9994,14 +10000,14 @@
if (!surfaceControl.isValid()) {
return;
}
- if (useBLAST()) {
- synchronized (getBlastTransactionLock()) {
- getBLASTSyncTransaction().setBlurRegions(surfaceControl, regionCopy);
- }
+
+ SurfaceControl.Transaction transaction = new SurfaceControl.Transaction();
+ transaction.setBlurRegions(surfaceControl, regionCopy);
+
+ if (useBLAST() && mBlastBufferQueue != null) {
+ mBlastBufferQueue.mergeWithNextTransaction(transaction, frameNumber);
} else {
- SurfaceControl.Transaction transaction = new SurfaceControl.Transaction();
- transaction.setBlurRegions(surfaceControl, regionCopy);
- transaction.deferTransactionUntil(surfaceControl, getSurfaceControl(), frameNumber);
+ transaction.deferTransactionUntil(surfaceControl, surfaceControl, frameNumber);
transaction.apply();
}
}
@@ -10013,14 +10019,6 @@
return mBlurRegionAggregator.createBackgroundBlurDrawable(mContext);
}
- SurfaceControl.Transaction getBLASTSyncTransaction() {
- return mRtBLASTSyncTransaction;
- }
-
- Object getBlastTransactionLock() {
- return mRtBLASTSyncTransaction;
- }
-
@Override
public void onDescendantUnbufferedRequested() {
mUnbufferedInputSource = mView.mUnbufferedInputSource;
@@ -10041,4 +10039,14 @@
int getSurfaceSequenceId() {
return mSurfaceSequenceId;
}
+
+ /**
+ * Merges the transaction passed in with the next transaction in BLASTBufferQueue. This ensures
+ * you can add transactions to the upcoming frame.
+ */
+ void mergeWithNextTransaction(Transaction t, long frameNumber) {
+ if (mBlastBufferQueue != null) {
+ mBlastBufferQueue.mergeWithNextTransaction(t, frameNumber);
+ }
+ }
}
diff --git a/core/java/android/view/WindowManagerImpl.java b/core/java/android/view/WindowManagerImpl.java
index 3384bbe..391e55a 100644
--- a/core/java/android/view/WindowManagerImpl.java
+++ b/core/java/android/view/WindowManagerImpl.java
@@ -262,18 +262,15 @@
private WindowInsets getWindowInsetsFromServer(WindowManager.LayoutParams attrs, Rect bounds) {
try {
- final DisplayCutout.ParcelableWrapper displayCutout =
- new DisplayCutout.ParcelableWrapper();
final InsetsState insetsState = new InsetsState();
final boolean alwaysConsumeSystemBars = WindowManagerGlobal.getWindowManagerService()
- .getWindowInsets(attrs, mContext.getDisplayId(), displayCutout, insetsState);
+ .getWindowInsets(attrs, mContext.getDisplayId(), insetsState);
final Configuration config = mContext.getResources().getConfiguration();
final boolean isScreenRound = config.isScreenRound();
final int windowingMode = config.windowConfiguration.getWindowingMode();
return insetsState.calculateInsets(bounds, null /* ignoringVisibilityState*/,
- isScreenRound, alwaysConsumeSystemBars, displayCutout.get(),
- SOFT_INPUT_ADJUST_NOTHING, attrs.flags, SYSTEM_UI_FLAG_VISIBLE, attrs.type,
- windowingMode, null /* typeSideMap */);
+ isScreenRound, alwaysConsumeSystemBars, SOFT_INPUT_ADJUST_NOTHING, attrs.flags,
+ SYSTEM_UI_FLAG_VISIBLE, attrs.type, windowingMode, null /* typeSideMap */);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
diff --git a/core/java/android/view/WindowlessWindowManager.java b/core/java/android/view/WindowlessWindowManager.java
index 149338c..dd56c15 100644
--- a/core/java/android/view/WindowlessWindowManager.java
+++ b/core/java/android/view/WindowlessWindowManager.java
@@ -136,8 +136,8 @@
@Override
public int addToDisplay(IWindow window, WindowManager.LayoutParams attrs,
int viewVisibility, int displayId, InsetsState requestedVisibility, Rect outFrame,
- DisplayCutout.ParcelableWrapper outDisplayCutout, InputChannel outInputChannel,
- InsetsState outInsetsState, InsetsSourceControl[] outActiveControls) {
+ InputChannel outInputChannel, InsetsState outInsetsState,
+ InsetsSourceControl[] outActiveControls) {
final SurfaceControl.Builder b = new SurfaceControl.Builder(mSurfaceSession)
.setFormat(attrs.format)
.setBufferSize(getSurfaceWidth(attrs), getSurfaceHeight(attrs))
@@ -171,11 +171,10 @@
@Override
public int addToDisplayAsUser(IWindow window, WindowManager.LayoutParams attrs,
int viewVisibility, int displayId, int userId, InsetsState requestedVisibility,
- Rect outFrame, DisplayCutout.ParcelableWrapper outDisplayCutout,
- InputChannel outInputChannel, InsetsState outInsetsState,
+ Rect outFrame, InputChannel outInputChannel, InsetsState outInsetsState,
InsetsSourceControl[] outActiveControls) {
return addToDisplay(window, attrs, viewVisibility, displayId, requestedVisibility,
- outFrame, outDisplayCutout, outInputChannel, outInsetsState, outActiveControls);
+ outFrame, outInputChannel, outInsetsState, outActiveControls);
}
@Override
diff --git a/core/java/android/view/accessibility/AccessibilityInteractionClient.java b/core/java/android/view/accessibility/AccessibilityInteractionClient.java
index aff0b35..f63749b 100644
--- a/core/java/android/view/accessibility/AccessibilityInteractionClient.java
+++ b/core/java/android/view/accessibility/AccessibilityInteractionClient.java
@@ -23,9 +23,7 @@
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
-import android.os.Handler;
import android.os.IBinder;
-import android.os.Looper;
import android.os.Message;
import android.os.Process;
import android.os.RemoteException;
@@ -125,12 +123,6 @@
private Message mSameThreadMessage;
- private int mInteractionIdWaitingForPrefetchResult;
- private int mConnectionIdWaitingForPrefetchResult;
- private String[] mPackageNamesForNextPrefetchResult;
- private final Handler mMainHandler;
- private Runnable mPrefetchResultRunnable;
-
/**
* @return The client for the current thread.
*/
@@ -205,7 +197,6 @@
private AccessibilityInteractionClient() {
/* reducing constructor visibility */
- mMainHandler = new Handler(Looper.getMainLooper());
}
/**
@@ -460,16 +451,16 @@
Binder.restoreCallingIdentity(identityToken);
}
if (packageNames != null) {
- AccessibilityNodeInfo info =
- getFindAccessibilityNodeInfoResultAndClear(interactionId);
- if ((prefetchFlags & AccessibilityNodeInfo.FLAG_PREFETCH_MASK) != 0
- && info != null) {
- setInteractionWaitingForPrefetchResult(interactionId, connectionId,
- packageNames);
- }
- finalizeAndCacheAccessibilityNodeInfo(info, connectionId,
+ List<AccessibilityNodeInfo> infos = getFindAccessibilityNodeInfosResultAndClear(
+ interactionId);
+ finalizeAndCacheAccessibilityNodeInfos(infos, connectionId,
bypassCache, packageNames);
- return info;
+ if (infos != null && !infos.isEmpty()) {
+ for (int i = 1; i < infos.size(); i++) {
+ infos.get(i).recycle();
+ }
+ return infos.get(0);
+ }
}
} else {
if (DEBUG) {
@@ -483,15 +474,6 @@
return null;
}
- private void setInteractionWaitingForPrefetchResult(int interactionId, int connectionId,
- String[] packageNames) {
- synchronized (mInstanceLock) {
- mInteractionIdWaitingForPrefetchResult = interactionId;
- mConnectionIdWaitingForPrefetchResult = connectionId;
- mPackageNamesForNextPrefetchResult = packageNames;
- }
- }
-
private static String idToString(int accessibilityWindowId, long accessibilityNodeId) {
return accessibilityWindowId + "/"
+ AccessibilityNodeInfo.idToString(accessibilityNodeId);
@@ -847,26 +829,6 @@
}
/**
- * {@inheritDoc}
- */
- @Override
- public void setPrefetchAccessibilityNodeInfoResult(List<AccessibilityNodeInfo> infos,
- int interactionId) {
- synchronized (mInstanceLock) {
- if (mPrefetchResultRunnable != null) {
- mMainHandler.removeCallbacks(mPrefetchResultRunnable);
- mPrefetchResultRunnable = null;
- }
- if (!infos.isEmpty() && mInteractionIdWaitingForPrefetchResult == interactionId) {
- mPrefetchResultRunnable = () -> finalizeAndCacheAccessibilityNodeInfos(
- infos, mConnectionIdWaitingForPrefetchResult, false,
- mPackageNamesForNextPrefetchResult);
- mMainHandler.post(mPrefetchResultRunnable);
- }
- }
- }
-
- /**
* Gets the result of a request to perform an accessibility action.
*
* @param interactionId The interaction id to match the result with the request.
diff --git a/core/java/android/view/accessibility/IAccessibilityInteractionConnectionCallback.aidl b/core/java/android/view/accessibility/IAccessibilityInteractionConnectionCallback.aidl
index 231e75a..049bb31 100644
--- a/core/java/android/view/accessibility/IAccessibilityInteractionConnectionCallback.aidl
+++ b/core/java/android/view/accessibility/IAccessibilityInteractionConnectionCallback.aidl
@@ -47,15 +47,6 @@
int interactionId);
/**
- * Sets the result of a prefetch request that returns {@link AccessibilityNodeInfo}s.
- *
- * @param root The {@link AccessibilityNodeInfo} for which the prefetching is based off of.
- * @param infos The result {@link AccessibilityNodeInfo}s.
- */
- void setPrefetchAccessibilityNodeInfoResult(
- in List<AccessibilityNodeInfo> infos, int interactionId);
-
- /**
* Sets the result of a request to perform an accessibility action.
*
* @param Whether the action was performed.
diff --git a/core/java/android/view/inputmethod/EditorInfo.java b/core/java/android/view/inputmethod/EditorInfo.java
index 7dbf693..1cf25a7 100644
--- a/core/java/android/view/inputmethod/EditorInfo.java
+++ b/core/java/android/view/inputmethod/EditorInfo.java
@@ -28,6 +28,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
+import android.content.res.Configuration;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import android.os.LocaleList;
@@ -293,6 +294,13 @@
public static final int IME_FLAG_FORCE_ASCII = 0x80000000;
/**
+ * Flag of {@link #internalImeOptions}: flag is set when app window containing this
+ * {@link EditorInfo} is using {@link Configuration#ORIENTATION_PORTRAIT} mode.
+ * @hide
+ */
+ public static final int IME_FLAG_APP_WINDOW_PORTRAIT = 0x80000000;
+
+ /**
* Generic unspecified type for {@link #imeOptions}.
*/
public static final int IME_NULL = 0x00000000;
@@ -312,6 +320,7 @@
* 1 1 IME_ACTION_NEXT
* 11 IME_ACTION_DONE
* 111 IME_ACTION_PREVIOUS
+ * 1 IME_FLAG_APP_WINDOW_PORTRAIT
* 1 IME_FLAG_NO_PERSONALIZED_LEARNING
* 1 IME_FLAG_NO_FULLSCREEN
* 1 IME_FLAG_NAVIGATE_PREVIOUS
@@ -343,6 +352,20 @@
public String privateImeOptions = null;
/**
+ * Masks for {@link internalImeOptions}
+ *
+ * <pre>
+ * 1 IME_FLAG_APP_WINDOW_PORTRAIT
+ * |-------|-------|-------|-------|</pre>
+ */
+
+ /**
+ * Same as {@link android.R.attr#imeOptions} but for framework's internal-use only.
+ * @hide
+ */
+ public int internalImeOptions = IME_NULL;
+
+ /**
* In some cases an IME may be able to display an arbitrary label for
* a command the user can perform, which you can specify here. This is
* typically used as the label for the action to use in-line as a replacement
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index 6526b8c..0a4b784 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -1361,7 +1361,9 @@
// We intentionally do not use UserHandle.getCallingUserId() here because for system
// services InputMethodManagerInternal.getInputMethodListAsUser() should be used
// instead.
- return mService.getInputMethodList(UserHandle.myUserId());
+ final Completable.InputMethodInfoList value = Completable.createInputMethodInfoList();
+ mService.getInputMethodList(UserHandle.myUserId(), ResultCallbacks.of(value));
+ return Completable.getResult(value);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -1377,7 +1379,9 @@
@RequiresPermission(INTERACT_ACROSS_USERS_FULL)
public List<InputMethodInfo> getInputMethodListAsUser(@UserIdInt int userId) {
try {
- return mService.getInputMethodList(userId);
+ final Completable.InputMethodInfoList value = Completable.createInputMethodInfoList();
+ mService.getInputMethodList(userId, ResultCallbacks.of(value));
+ return Completable.getResult(value);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -1395,7 +1399,9 @@
// We intentionally do not use UserHandle.getCallingUserId() here because for system
// services InputMethodManagerInternal.getEnabledInputMethodListAsUser() should be used
// instead.
- return mService.getEnabledInputMethodList(UserHandle.myUserId());
+ final Completable.InputMethodInfoList value = Completable.createInputMethodInfoList();
+ mService.getEnabledInputMethodList(UserHandle.myUserId(), ResultCallbacks.of(value));
+ return Completable.getResult(value);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -1411,7 +1417,9 @@
@RequiresPermission(INTERACT_ACROSS_USERS_FULL)
public List<InputMethodInfo> getEnabledInputMethodListAsUser(@UserIdInt int userId) {
try {
- return mService.getEnabledInputMethodList(userId);
+ final Completable.InputMethodInfoList value = Completable.createInputMethodInfoList();
+ mService.getEnabledInputMethodList(userId, ResultCallbacks.of(value));
+ return Completable.getResult(value);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -1430,8 +1438,13 @@
public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(InputMethodInfo imi,
boolean allowsImplicitlySelectedSubtypes) {
try {
- return mService.getEnabledInputMethodSubtypeList(
- imi == null ? null : imi.getId(), allowsImplicitlySelectedSubtypes);
+ final Completable.InputMethodSubtypeList value =
+ Completable.createInputMethodSubtypeList();
+ mService.getEnabledInputMethodSubtypeList(
+ imi == null ? null : imi.getId(),
+ allowsImplicitlySelectedSubtypes,
+ ResultCallbacks.of(value));
+ return Completable.getResult(value);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -2970,7 +2983,9 @@
*/
public InputMethodSubtype getCurrentInputMethodSubtype() {
try {
- return mService.getCurrentInputMethodSubtype();
+ final Completable.InputMethodSubtype value = Completable.createInputMethodSubtype();
+ mService.getCurrentInputMethodSubtype(ResultCallbacks.of(value));
+ return Completable.getResult(value);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -3019,7 +3034,11 @@
}
final List<InputMethodSubtype> enabledSubtypes;
try {
- enabledSubtypes = mService.getEnabledInputMethodSubtypeList(imeId, true);
+ final Completable.InputMethodSubtypeList value =
+ Completable.createInputMethodSubtypeList();
+ mService.getEnabledInputMethodSubtypeList(
+ imeId, true, ResultCallbacks.of(value));
+ enabledSubtypes = Completable.getResult(value);
} catch (RemoteException e) {
return false;
}
@@ -3087,7 +3106,9 @@
@UnsupportedAppUsage
public int getInputMethodWindowVisibleHeight() {
try {
- return mService.getInputMethodWindowVisibleHeight();
+ final Completable.Int value = Completable.createInt();
+ mService.getInputMethodWindowVisibleHeight(ResultCallbacks.of(value));
+ return Completable.getIntResult(value);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -3214,7 +3235,9 @@
public InputMethodSubtype getLastInputMethodSubtype() {
try {
- return mService.getLastInputMethodSubtype();
+ final Completable.InputMethodSubtype value = Completable.createInputMethodSubtype();
+ mService.getLastInputMethodSubtype(ResultCallbacks.of(value));
+ return Completable.getResult(value);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 12c91fa..977a0e8 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -17,6 +17,7 @@
package android.widget;
import static android.Manifest.permission.INTERACT_ACROSS_USERS_FULL;
+import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
import static android.view.ContentInfo.FLAG_CONVERT_TO_PLAIN_TEXT;
import static android.view.ContentInfo.SOURCE_AUTOFILL;
import static android.view.ContentInfo.SOURCE_CLIPBOARD;
@@ -8738,6 +8739,9 @@
outAttrs.imeOptions |= EditorInfo.IME_FLAG_NO_ENTER_ACTION;
}
}
+ if (getResources().getConfiguration().orientation == ORIENTATION_PORTRAIT) {
+ outAttrs.internalImeOptions |= EditorInfo.IME_FLAG_APP_WINDOW_PORTRAIT;
+ }
if (isMultilineInputType(outAttrs.inputType)) {
// Multi-line text editors should always show an enter key.
outAttrs.imeOptions |= EditorInfo.IME_FLAG_NO_ENTER_ACTION;
diff --git a/core/java/android/window/ClientWindowFrames.java b/core/java/android/window/ClientWindowFrames.java
index 5d7025b..e22a5eb 100644
--- a/core/java/android/window/ClientWindowFrames.java
+++ b/core/java/android/window/ClientWindowFrames.java
@@ -20,7 +20,6 @@
import android.graphics.Rect;
import android.os.Parcel;
import android.os.Parcelable;
-import android.view.DisplayCutout;
/**
* The window frame container class used by client side for layout.
@@ -39,28 +38,22 @@
/** The background area while the window is resizing. */
public final @NonNull Rect backdropFrame;
- /** The area cut from the display. */
- public final @NonNull DisplayCutout.ParcelableWrapper displayCutout;
-
public ClientWindowFrames() {
frame = new Rect();
displayFrame = new Rect();
backdropFrame = new Rect();
- displayCutout = new DisplayCutout.ParcelableWrapper();
}
public ClientWindowFrames(ClientWindowFrames other) {
frame = new Rect(other.frame);
displayFrame = new Rect(other.displayFrame);
backdropFrame = new Rect(other.backdropFrame);
- displayCutout = new DisplayCutout.ParcelableWrapper(other.displayCutout.get());
}
private ClientWindowFrames(Parcel in) {
frame = Rect.CREATOR.createFromParcel(in);
displayFrame = Rect.CREATOR.createFromParcel(in);
backdropFrame = Rect.CREATOR.createFromParcel(in);
- displayCutout = DisplayCutout.ParcelableWrapper.CREATOR.createFromParcel(in);
}
/** Needed for AIDL out parameters. */
@@ -68,7 +61,6 @@
frame.set(Rect.CREATOR.createFromParcel(in));
displayFrame.set(Rect.CREATOR.createFromParcel(in));
backdropFrame.set(Rect.CREATOR.createFromParcel(in));
- displayCutout.set(DisplayCutout.ParcelableWrapper.CREATOR.createFromParcel(in));
}
@Override
@@ -76,7 +68,6 @@
frame.writeToParcel(dest, flags);
displayFrame.writeToParcel(dest, flags);
backdropFrame.writeToParcel(dest, flags);
- displayCutout.writeToParcel(dest, flags);
}
@Override
@@ -84,8 +75,7 @@
final StringBuilder sb = new StringBuilder(32);
return "ClientWindowFrames{frame=" + frame.toShortString(sb)
+ " display=" + displayFrame.toShortString(sb)
- + " backdrop=" + backdropFrame.toShortString(sb)
- + " cutout=" + displayCutout + "}";
+ + " backdrop=" + backdropFrame.toShortString(sb) + "}";
}
@Override
diff --git a/core/java/android/window/DisplayAreaOrganizer.java b/core/java/android/window/DisplayAreaOrganizer.java
index 8a1d4a0..1254647 100644
--- a/core/java/android/window/DisplayAreaOrganizer.java
+++ b/core/java/android/window/DisplayAreaOrganizer.java
@@ -164,15 +164,19 @@
}
/**
- * Creates a persistent task display area. It will be added to be the top most task display area
- * in the root.
+ * Creates a persistent {@link com.android.server.wm.TaskDisplayArea}.
*
* The new created TDA is organized by the organizer, and will be deleted on calling
* {@link #deleteTaskDisplayArea(WindowContainerToken)} or {@link #unregisterOrganizer()}.
*
- * @param displayId the display to create the new task display area in.
- * @param rootFeatureId the root display area to create the new task display area in. Caller can
- * use {@link #FEATURE_ROOT} as the root of the logical display.
+ * @param displayId the display to create the new TDA in.
+ * @param parentFeatureId the parent to create the new TDA in. If it is a
+ * {@link com.android.server.wm.RootDisplayArea}, the new TDA will be
+ * placed as the topmost TDA. If it is another TDA, the new TDA will be
+ * placed as the topmost child.
+ * Caller can use {@link #FEATURE_ROOT} as the root of the logical
+ * display, or {@link #FEATURE_DEFAULT_TASK_CONTAINER} as the default
+ * TDA.
* @param name the name for the new task display area.
* @return the new created task display area.
* @throws IllegalArgumentException if failed to create a new task display area.
@@ -181,11 +185,11 @@
@RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_TASKS)
@CallSuper
@NonNull
- public DisplayAreaAppearedInfo createTaskDisplayArea(int displayId, int rootFeatureId,
+ public DisplayAreaAppearedInfo createTaskDisplayArea(int displayId, int parentFeatureId,
@NonNull String name) {
try {
return getController().createTaskDisplayArea(
- mInterface, displayId, rootFeatureId, name);
+ mInterface, displayId, parentFeatureId, name);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
diff --git a/core/java/android/window/IDisplayAreaOrganizerController.aidl b/core/java/android/window/IDisplayAreaOrganizerController.aidl
index 26fa434..6c097bb 100644
--- a/core/java/android/window/IDisplayAreaOrganizerController.aidl
+++ b/core/java/android/window/IDisplayAreaOrganizerController.aidl
@@ -40,21 +40,25 @@
void unregisterOrganizer(in IDisplayAreaOrganizer organizer);
/**
- * Creates a persistent task display area. It will be added to be the top most task display area
- * in the root.
+ * Creates a persistent {@link com.android.server.wm.TaskDisplayArea}.
*
* The new created TDA is organized by the organizer, and will be deleted on calling
* {@link #deleteTaskDisplayArea(WindowContainerToken)} or {@link #unregisterOrganizer()}.
*
- * @param displayId the display to create the new task display area in.
- * @param rootFeatureId the root display area to create the new task display area in. Caller can
- * use {@link #FEATURE_ROOT} as the root of the logical display.
+ * @param displayId the display to create the new TDA in.
+ * @param parentFeatureId the parent to create the new TDA in. If it is a
+ * {@link com.android.server.wm.RootDisplayArea}, the new TDA will be
+ * placed as the topmost TDA. If it is another TDA, the new TDA will be
+ * placed as the topmost child.
+ * Caller can use {@link #FEATURE_ROOT} as the root of the logical
+ * display, or {@link #FEATURE_DEFAULT_TASK_CONTAINER} as the default
+ * TDA.
* @param name the name for the new task display area.
* @return the new created task display area.
* @throws IllegalArgumentException if failed to create a new task display area.
*/
DisplayAreaAppearedInfo createTaskDisplayArea(in IDisplayAreaOrganizer organizer, int displayId,
- int rootFeatureId, in String name);
+ int parentFeatureId, in String name);
/**
* Deletes a persistent task display area. It can only be one that created by an organizer.
diff --git a/core/java/android/window/TaskSnapshot.java b/core/java/android/window/TaskSnapshot.java
index 9834aad..dc07e44 100644
--- a/core/java/android/window/TaskSnapshot.java
+++ b/core/java/android/window/TaskSnapshot.java
@@ -60,6 +60,7 @@
private final @WindowInsetsController.Appearance
int mAppearance;
private final boolean mIsTranslucent;
+ private final boolean mHasImeSurface;
// Must be one of the named color spaces, otherwise, always use SRGB color space.
private final ColorSpace mColorSpace;
@@ -68,7 +69,7 @@
@NonNull ColorSpace colorSpace, int orientation, int rotation, Point taskSize,
Rect contentInsets, boolean isLowResolution, boolean isRealSnapshot,
int windowingMode, @WindowInsetsController.Appearance int appearance,
- boolean isTranslucent) {
+ boolean isTranslucent, boolean hasImeSurface) {
mId = id;
mTopActivityComponent = topActivityComponent;
mSnapshot = snapshot;
@@ -83,6 +84,7 @@
mWindowingMode = windowingMode;
mAppearance = appearance;
mIsTranslucent = isTranslucent;
+ mHasImeSurface = hasImeSurface;
}
private TaskSnapshot(Parcel source) {
@@ -102,6 +104,7 @@
mWindowingMode = source.readInt();
mAppearance = source.readInt();
mIsTranslucent = source.readBoolean();
+ mHasImeSurface = source.readBoolean();
}
/**
@@ -201,6 +204,13 @@
}
/**
+ * @return Whether or not the snapshot has the IME surface.
+ */
+ public boolean hasImeSurface() {
+ return mHasImeSurface;
+ }
+
+ /**
* @return The windowing mode of the task when this snapshot was taken.
*/
public int getWindowingMode() {
@@ -237,6 +247,7 @@
dest.writeInt(mWindowingMode);
dest.writeInt(mAppearance);
dest.writeBoolean(mIsTranslucent);
+ dest.writeBoolean(mHasImeSurface);
}
@Override
@@ -256,7 +267,8 @@
+ " mIsRealSnapshot=" + mIsRealSnapshot
+ " mWindowingMode=" + mWindowingMode
+ " mAppearance=" + mAppearance
- + " mIsTranslucent=" + mIsTranslucent;
+ + " mIsTranslucent=" + mIsTranslucent
+ + " mHasImeSurface=" + mHasImeSurface;
}
public static final @NonNull Creator<TaskSnapshot> CREATOR = new Creator<TaskSnapshot>() {
@@ -283,6 +295,7 @@
private @WindowInsetsController.Appearance
int mAppearance;
private boolean mIsTranslucent;
+ private boolean mHasImeSurface;
private int mPixelFormat;
public Builder setId(long id) {
@@ -290,8 +303,7 @@
return this;
}
- public Builder setTopActivityComponent(
- ComponentName name) {
+ public Builder setTopActivityComponent(ComponentName name) {
mTopActivity = name;
return this;
}
@@ -329,8 +341,7 @@
return this;
}
- public Builder setIsRealSnapshot(
- boolean realSnapshot) {
+ public Builder setIsRealSnapshot(boolean realSnapshot) {
mIsRealSnapshot = realSnapshot;
return this;
}
@@ -340,18 +351,24 @@
return this;
}
- public Builder setAppearance(
- @WindowInsetsController.Appearance int appearance) {
+ public Builder setAppearance(@WindowInsetsController.Appearance int appearance) {
mAppearance = appearance;
return this;
}
- public Builder setIsTranslucent(
- boolean isTranslucent) {
+ public Builder setIsTranslucent(boolean isTranslucent) {
mIsTranslucent = isTranslucent;
return this;
}
+ /**
+ * Sets the IME visibility when taking the snapshot of the task.
+ */
+ public Builder setHasImeSurface(boolean hasImeSurface) {
+ mHasImeSurface = hasImeSurface;
+ return this;
+ }
+
public int getPixelFormat() {
return mPixelFormat;
}
@@ -378,7 +395,8 @@
mIsRealSnapshot,
mWindowingMode,
mAppearance,
- mIsTranslucent);
+ mIsTranslucent,
+ mHasImeSurface);
}
}
diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java
index e064137..666ee6e 100644
--- a/core/java/com/android/internal/app/ChooserActivity.java
+++ b/core/java/com/android/internal/app/ChooserActivity.java
@@ -182,7 +182,7 @@
* To be used for shared element transition into this activity.
* @hide
*/
- public static final String FIRST_IMAGE_PREVIEW_TRANSITION_NAME = "chooser_preview_image_1";
+ public static final String FIRST_IMAGE_PREVIEW_TRANSITION_NAME = "screenshot_preview_image";
private static final String PREF_NUM_SHEET_EXPANSIONS = "pref_num_sheet_expansions";
diff --git a/core/java/com/android/internal/app/ChooserFlags.java b/core/java/com/android/internal/app/ChooserFlags.java
index 3e26679..1a93f1b 100644
--- a/core/java/com/android/internal/app/ChooserFlags.java
+++ b/core/java/com/android/internal/app/ChooserFlags.java
@@ -33,7 +33,7 @@
*/
public static final boolean USE_SERVICE_TARGETS_FOR_DIRECT_TARGETS =
DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SYSTEMUI,
- SystemUiDeviceConfigFlags.SHARE_USE_SERVICE_TARGETS, true);
+ SystemUiDeviceConfigFlags.SHARE_USE_SERVICE_TARGETS, false);
/**
* Whether to use {@link AppPredictionManager} to query for direct share targets (as opposed to
diff --git a/core/java/com/android/internal/app/NetInitiatedActivity.java b/core/java/com/android/internal/app/NetInitiatedActivity.java
index 56ec87c..375e503 100644
--- a/core/java/com/android/internal/app/NetInitiatedActivity.java
+++ b/core/java/com/android/internal/app/NetInitiatedActivity.java
@@ -17,18 +17,14 @@
package com.android.internal.app;
import android.app.AlertDialog;
-import android.compat.annotation.UnsupportedAppUsage;
-import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
-import android.content.IntentFilter;
import android.location.LocationManagerInternal;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
-import android.widget.Toast;
import com.android.internal.R;
import com.android.internal.location.GpsNetInitiatedHandler;
@@ -43,7 +39,6 @@
private static final String TAG = "NetInitiatedActivity";
private static final boolean DEBUG = true;
- private static final boolean VERBOSE = false;
private static final int POSITIVE_BUTTON = AlertDialog.BUTTON_POSITIVE;
private static final int NEGATIVE_BUTTON = AlertDialog.BUTTON_NEGATIVE;
@@ -55,17 +50,6 @@
private int default_response = -1;
private int default_response_timeout = 6;
- /** Used to detect when NI request is received */
- private BroadcastReceiver mNetInitiatedReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- if (DEBUG) Log.d(TAG, "NetInitiatedReceiver onReceive: " + intent.getAction());
- if (intent.getAction() == GpsNetInitiatedHandler.ACTION_NI_VERIFY) {
- handleNIVerify(intent);
- }
- }
- };
-
private final Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
switch (msg.what) {
@@ -109,14 +93,12 @@
protected void onResume() {
super.onResume();
if (DEBUG) Log.d(TAG, "onResume");
- registerReceiver(mNetInitiatedReceiver, new IntentFilter(GpsNetInitiatedHandler.ACTION_NI_VERIFY));
}
@Override
protected void onPause() {
super.onPause();
if (DEBUG) Log.d(TAG, "onPause");
- unregisterReceiver(mNetInitiatedReceiver);
}
/**
@@ -141,17 +123,4 @@
LocationManagerInternal lm = LocalServices.getService(LocationManagerInternal.class);
lm.sendNiResponse(notificationId, response);
}
-
- @UnsupportedAppUsage
- private void handleNIVerify(Intent intent) {
- int notifId = intent.getIntExtra(GpsNetInitiatedHandler.NI_INTENT_KEY_NOTIF_ID, -1);
- notificationId = notifId;
-
- if (DEBUG) Log.d(TAG, "handleNIVerify action: " + intent.getAction());
- }
-
- private void showNIError() {
- Toast.makeText(this, "NI error" /* com.android.internal.R.string.usb_storage_error_message */,
- Toast.LENGTH_LONG).show();
- }
}
diff --git a/core/java/com/android/internal/app/OWNERS b/core/java/com/android/internal/app/OWNERS
index 382b49e..c5a956a 100644
--- a/core/java/com/android/internal/app/OWNERS
+++ b/core/java/com/android/internal/app/OWNERS
@@ -2,3 +2,4 @@
per-file *Resolver* = file:/packages/SystemUI/OWNERS
per-file *Chooser* = file:/packages/SystemUI/OWNERS
per-file SimpleIconFactory.java = file:/packages/SystemUI/OWNERS
+per-file NetInitiatedActivity.java = file:/location/java/android/location/OWNERS
diff --git a/core/java/com/android/internal/inputmethod/CallbackUtils.java b/core/java/com/android/internal/inputmethod/CallbackUtils.java
index a77583f..248feb8 100644
--- a/core/java/com/android/internal/inputmethod/CallbackUtils.java
+++ b/core/java/com/android/internal/inputmethod/CallbackUtils.java
@@ -19,10 +19,14 @@
import android.annotation.AnyThread;
import android.annotation.NonNull;
import android.os.RemoteException;
+import android.view.inputmethod.InputMethodInfo;
+import android.view.inputmethod.InputMethodSubtype;
import com.android.internal.view.InputBindResult;
+import java.util.List;
import java.util.function.BooleanSupplier;
+import java.util.function.IntSupplier;
import java.util.function.Supplier;
/**
@@ -67,7 +71,7 @@
/**
* A utility method using given {@link IBooleanResultCallback} to callback the result.
*
- * @param callback {@link IInputBindResultResultCallback} to be called back.
+ * @param callback {@link IBooleanResultCallback} to be called back.
* @param resultSupplier the supplier from which the result is provided.
*/
public static void onResult(@NonNull IBooleanResultCallback callback,
@@ -89,4 +93,111 @@
callback.onResult(result);
} catch (RemoteException ignored) { }
}
+
+ /**
+ * A utility method using given {@link IInputMethodSubtypeResultCallback} to callback the
+ * result.
+ *
+ * @param callback {@link IInputMethodSubtypeResultCallback} to be called back.
+ * @param resultSupplier the supplier from which the result is provided.
+ */
+ public static void onResult(@NonNull IInputMethodSubtypeResultCallback callback,
+ @NonNull Supplier<InputMethodSubtype> resultSupplier) {
+ InputMethodSubtype result = null;
+ Throwable exception = null;
+
+ try {
+ result = resultSupplier.get();
+ } catch (Throwable throwable) {
+ exception = throwable;
+ }
+
+ try {
+ if (exception != null) {
+ callback.onError(ThrowableHolder.of(exception));
+ return;
+ }
+ callback.onResult(result);
+ } catch (RemoteException ignored) { }
+ }
+
+ /**
+ * A utility method using given {@link IInputMethodSubtypeListResultCallback} to callback the
+ * result.
+ *
+ * @param callback {@link IInputMethodSubtypeListResultCallback} to be called back.
+ * @param resultSupplier the supplier from which the result is provided.
+ */
+ public static void onResult(@NonNull IInputMethodSubtypeListResultCallback callback,
+ @NonNull Supplier<List<InputMethodSubtype>> resultSupplier) {
+ List<InputMethodSubtype> result = null;
+ Throwable exception = null;
+
+ try {
+ result = resultSupplier.get();
+ } catch (Throwable throwable) {
+ exception = throwable;
+ }
+
+ try {
+ if (exception != null) {
+ callback.onError(ThrowableHolder.of(exception));
+ return;
+ }
+ callback.onResult(result);
+ } catch (RemoteException ignored) { }
+ }
+
+ /**
+ * A utility method using given {@link IInputMethodInfoListResultCallback} to callback the
+ * result.
+ *
+ * @param callback {@link IInputMethodInfoListResultCallback} to be called back.
+ * @param resultSupplier the supplier from which the result is provided.
+ */
+ public static void onResult(@NonNull IInputMethodInfoListResultCallback callback,
+ @NonNull Supplier<List<InputMethodInfo>> resultSupplier) {
+ List<InputMethodInfo> result = null;
+ Throwable exception = null;
+
+ try {
+ result = resultSupplier.get();
+ } catch (Throwable throwable) {
+ exception = throwable;
+ }
+
+ try {
+ if (exception != null) {
+ callback.onError(ThrowableHolder.of(exception));
+ return;
+ }
+ callback.onResult(result);
+ } catch (RemoteException ignored) { }
+ }
+
+ /**
+ * A utility method using given {@link IIntResultCallback} to callback the result.
+ *
+ * @param callback {@link IIntResultCallback} to be called back.
+ * @param resultSupplier the supplier from which the result is provided.
+ */
+ public static void onResult(@NonNull IIntResultCallback callback,
+ @NonNull IntSupplier resultSupplier) {
+ int result = 0;
+ Throwable exception = null;
+
+ try {
+ result = resultSupplier.getAsInt();
+ } 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 bd8c23e..1913fcd 100644
--- a/core/java/com/android/internal/inputmethod/Completable.java
+++ b/core/java/com/android/internal/inputmethod/Completable.java
@@ -23,10 +23,12 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.util.Log;
+import android.view.inputmethod.InputMethodSubtype;
import com.android.internal.annotations.GuardedBy;
import java.lang.annotation.Retention;
+import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -373,6 +375,27 @@
}
/**
+ * @return an instance of {@link Completable.InputMethodSubtype}.
+ */
+ public static Completable.InputMethodSubtype createInputMethodSubtype() {
+ return new Completable.InputMethodSubtype();
+ }
+
+ /**
+ * @return an instance of {@link Completable.InputMethodSubtypeList}.
+ */
+ public static Completable.InputMethodSubtypeList createInputMethodSubtypeList() {
+ return new Completable.InputMethodSubtypeList();
+ }
+
+ /**
+ * @return an instance of {@link Completable.InputMethodInfoList}.
+ */
+ public static Completable.InputMethodInfoList createInputMethodInfoList() {
+ return new Completable.InputMethodInfoList();
+ }
+
+ /**
* Completable object of {@link java.lang.Boolean}.
*/
public static final class Boolean extends Values<java.lang.Boolean> { }
@@ -401,6 +424,24 @@
extends Values<com.android.internal.view.InputBindResult> { }
/**
+ * Completable object of {@link android.view.inputmethod.InputMethodSubtype}.
+ */
+ public static final class InputMethodSubtype
+ extends Values<android.view.inputmethod.InputMethodSubtype> { }
+
+ /**
+ * Completable object of {@link List<android.view.inputmethod.InputMethodSubtype>}.
+ */
+ public static final class InputMethodSubtypeList
+ extends Values<List<android.view.inputmethod.InputMethodSubtype>> { }
+
+ /**
+ * Completable object of {@link List<android.view.inputmethod.InputMethodInfo>}.
+ */
+ public static final class InputMethodInfoList
+ extends Values<List<android.view.inputmethod.InputMethodInfo>> { }
+
+ /**
* Await the result by the {@link Completable.Values}.
*
* @return the result once {@link ValueBase#onComplete()}
@@ -413,6 +454,17 @@
}
/**
+ * Await the int result by the {@link Completable.Int}.
+ *
+ * @return the result once {@link ValueBase#onComplete()}
+ */
+ @AnyThread
+ public static int getIntResult(@NonNull Completable.Int value) {
+ value.await();
+ return value.getValue();
+ }
+
+ /**
* Await the result by the {@link Completable.Int}, and log it if there is no result after
* given timeout.
*
diff --git a/wifi/java/android/net/wifi/IScoreUpdateObserver.aidl b/core/java/com/android/internal/inputmethod/IInputMethodInfoListResultCallback.aidl
similarity index 66%
rename from wifi/java/android/net/wifi/IScoreUpdateObserver.aidl
rename to core/java/com/android/internal/inputmethod/IInputMethodInfoListResultCallback.aidl
index 775fed7..0dfd5da 100644
--- a/wifi/java/android/net/wifi/IScoreUpdateObserver.aidl
+++ b/core/java/com/android/internal/inputmethod/IInputMethodInfoListResultCallback.aidl
@@ -14,16 +14,12 @@
* limitations under the License.
*/
-package android.net.wifi;
+package com.android.internal.inputmethod;
-/**
- * Interface for Wi-Fi score callback.
- *
- * @hide
- */
-oneway interface IScoreUpdateObserver
-{
- void notifyScoreUpdate(int sessionId, int score);
+import android.view.inputmethod.InputMethodInfo;
+import com.android.internal.inputmethod.ThrowableHolder;
- void triggerUpdateOfWifiUsabilityStats(int sessionId);
-}
+oneway interface IInputMethodInfoListResultCallback {
+ void onResult(in List<InputMethodInfo> result);
+ void onError(in ThrowableHolder exception);
+}
\ No newline at end of file
diff --git a/wifi/java/android/net/wifi/IScoreUpdateObserver.aidl b/core/java/com/android/internal/inputmethod/IInputMethodSubtypeListResultCallback.aidl
similarity index 66%
copy from wifi/java/android/net/wifi/IScoreUpdateObserver.aidl
copy to core/java/com/android/internal/inputmethod/IInputMethodSubtypeListResultCallback.aidl
index 775fed7..619c87e 100644
--- a/wifi/java/android/net/wifi/IScoreUpdateObserver.aidl
+++ b/core/java/com/android/internal/inputmethod/IInputMethodSubtypeListResultCallback.aidl
@@ -14,16 +14,12 @@
* limitations under the License.
*/
-package android.net.wifi;
+package com.android.internal.inputmethod;
-/**
- * Interface for Wi-Fi score callback.
- *
- * @hide
- */
-oneway interface IScoreUpdateObserver
-{
- void notifyScoreUpdate(int sessionId, int score);
+import android.view.inputmethod.InputMethodSubtype;
+import com.android.internal.inputmethod.ThrowableHolder;
- void triggerUpdateOfWifiUsabilityStats(int sessionId);
-}
+oneway interface IInputMethodSubtypeListResultCallback {
+ void onResult(in List<InputMethodSubtype> result);
+ void onError(in ThrowableHolder exception);
+}
\ No newline at end of file
diff --git a/wifi/java/android/net/wifi/IScoreUpdateObserver.aidl b/core/java/com/android/internal/inputmethod/IInputMethodSubtypeResultCallback.aidl
similarity index 66%
copy from wifi/java/android/net/wifi/IScoreUpdateObserver.aidl
copy to core/java/com/android/internal/inputmethod/IInputMethodSubtypeResultCallback.aidl
index 775fed7..66c0902 100644
--- a/wifi/java/android/net/wifi/IScoreUpdateObserver.aidl
+++ b/core/java/com/android/internal/inputmethod/IInputMethodSubtypeResultCallback.aidl
@@ -14,16 +14,12 @@
* limitations under the License.
*/
-package android.net.wifi;
+package com.android.internal.inputmethod;
-/**
- * Interface for Wi-Fi score callback.
- *
- * @hide
- */
-oneway interface IScoreUpdateObserver
-{
- void notifyScoreUpdate(int sessionId, int score);
+import android.view.inputmethod.InputMethodSubtype;
+import com.android.internal.inputmethod.ThrowableHolder;
- void triggerUpdateOfWifiUsabilityStats(int sessionId);
-}
+oneway interface IInputMethodSubtypeResultCallback {
+ void onResult(in InputMethodSubtype result);
+ void onError(in ThrowableHolder exception);
+}
\ No newline at end of file
diff --git a/core/java/com/android/internal/inputmethod/IIntResultCallback.aidl b/core/java/com/android/internal/inputmethod/IIntResultCallback.aidl
index bc5ed0d..ceda66c 100644
--- a/core/java/com/android/internal/inputmethod/IIntResultCallback.aidl
+++ b/core/java/com/android/internal/inputmethod/IIntResultCallback.aidl
@@ -16,6 +16,9 @@
package com.android.internal.inputmethod;
+import com.android.internal.inputmethod.ThrowableHolder;
+
oneway interface IIntResultCallback {
void onResult(int result);
+ void onError(in ThrowableHolder exception);
}
diff --git a/core/java/com/android/internal/inputmethod/InputMethodDebug.java b/core/java/com/android/internal/inputmethod/InputMethodDebug.java
index 3bcba75..c353de8 100644
--- a/core/java/com/android/internal/inputmethod/InputMethodDebug.java
+++ b/core/java/com/android/internal/inputmethod/InputMethodDebug.java
@@ -226,6 +226,8 @@
return "HIDE_RECENTS_ANIMATION";
case SoftInputShowHideReason.HIDE_SAME_WINDOW_FOCUSED_WITHOUT_EDITOR:
return "HIDE_SAME_WINDOW_FOCUSED_WITHOUT_EDITOR";
+ case SoftInputShowHideReason.HIDE_REMOVE_CLIENT:
+ return "HIDE_REMOVE_CLIENT";
default:
return "Unknown=" + reason;
}
diff --git a/core/java/com/android/internal/inputmethod/ResultCallbacks.java b/core/java/com/android/internal/inputmethod/ResultCallbacks.java
index b07c5f8..6ce851b 100644
--- a/core/java/com/android/internal/inputmethod/ResultCallbacks.java
+++ b/core/java/com/android/internal/inputmethod/ResultCallbacks.java
@@ -20,10 +20,13 @@
import android.annotation.BinderThread;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.view.inputmethod.InputMethodInfo;
+import android.view.inputmethod.InputMethodSubtype;
import com.android.internal.view.InputBindResult;
import java.lang.ref.WeakReference;
+import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
/**
@@ -73,6 +76,16 @@
}
value.onComplete(result);
}
+
+ @BinderThread
+ @Override
+ public void onError(ThrowableHolder throwableHolder) {
+ final Completable.Int value = unwrap(atomicRef);
+ if (value == null) {
+ return;
+ }
+ value.onError(throwableHolder);
+ }
};
}
@@ -228,4 +241,115 @@
}
};
}
+
+ /**
+ * Creates {@link IInputMethodSubtypeResultCallback.Stub} that is to set
+ * {@link Completable.InputMethodSubtype} when receiving the result.
+ *
+ * @param value {@link Completable.InputMethodSubtype} to be set when receiving the result.
+ * @return {@link IInputMethodSubtypeResultCallback.Stub} that can be passed as a binder
+ * IPC parameter.
+ */
+ @AnyThread
+ public static IInputMethodSubtypeResultCallback.Stub of(
+ @NonNull Completable.InputMethodSubtype value) {
+ final AtomicReference<WeakReference<Completable.InputMethodSubtype>>
+ atomicRef = new AtomicReference<>(new WeakReference<>(value));
+
+ return new IInputMethodSubtypeResultCallback.Stub() {
+ @BinderThread
+ @Override
+ public void onResult(InputMethodSubtype result) {
+ final Completable.InputMethodSubtype value = unwrap(atomicRef);
+ if (value == null) {
+ return;
+ }
+ value.onComplete(result);
+ }
+
+ @BinderThread
+ @Override
+ public void onError(ThrowableHolder throwableHolder) {
+ final Completable.InputMethodSubtype value = unwrap(atomicRef);
+ if (value == null) {
+ return;
+ }
+ value.onError(throwableHolder);
+ }
+ };
+ }
+
+ /**
+ * Creates {@link IInputMethodSubtypeListResultCallback.Stub} that is to set
+ * {@link Completable.InputMethodSubtypeList} when receiving the result.
+ *
+ * @param value {@link Completable.InputMethodSubtypeList} to be set when receiving the result.
+ * @return {@link IInputMethodSubtypeListResultCallback.Stub} that can be passed as a binder
+ * IPC parameter.
+ */
+ @AnyThread
+ public static IInputMethodSubtypeListResultCallback.Stub of(
+ @NonNull Completable.InputMethodSubtypeList value) {
+ final AtomicReference<WeakReference<Completable.InputMethodSubtypeList>>
+ atomicRef = new AtomicReference<>(new WeakReference<>(value));
+
+ return new IInputMethodSubtypeListResultCallback.Stub() {
+ @BinderThread
+ @Override
+ public void onResult(List<InputMethodSubtype> result) {
+ final Completable.InputMethodSubtypeList value = unwrap(atomicRef);
+ if (value == null) {
+ return;
+ }
+ value.onComplete(result);
+ }
+
+ @BinderThread
+ @Override
+ public void onError(ThrowableHolder throwableHolder) {
+ final Completable.InputMethodSubtypeList value = unwrap(atomicRef);
+ if (value == null) {
+ return;
+ }
+ value.onError(throwableHolder);
+ }
+ };
+ }
+
+ /**
+ * Creates {@link IInputMethodInfoListResultCallback.Stub} that is to set
+ * {@link Completable.InputMethodInfoList} when receiving the result.
+ *
+ * @param value {@link Completable.InputMethodInfoList} to be set when receiving the result.
+ * @return {@link IInputMethodInfoListResultCallback.Stub} that can be passed as a binder
+ * IPC parameter.
+ */
+ @AnyThread
+ public static IInputMethodInfoListResultCallback.Stub of(
+ @NonNull Completable.InputMethodInfoList value) {
+ final AtomicReference<WeakReference<Completable.InputMethodInfoList>>
+ atomicRef = new AtomicReference<>(new WeakReference<>(value));
+
+ return new IInputMethodInfoListResultCallback.Stub() {
+ @BinderThread
+ @Override
+ public void onResult(List<InputMethodInfo> result) {
+ final Completable.InputMethodInfoList value = unwrap(atomicRef);
+ if (value == null) {
+ return;
+ }
+ value.onComplete(result);
+ }
+
+ @BinderThread
+ @Override
+ public void onError(ThrowableHolder throwableHolder) {
+ final Completable.InputMethodInfoList value = unwrap(atomicRef);
+ if (value == null) {
+ return;
+ }
+ value.onError(throwableHolder);
+ }
+ };
+ }
}
diff --git a/core/java/com/android/internal/net/NetworkUtilsInternal.java b/core/java/com/android/internal/net/NetworkUtilsInternal.java
new file mode 100644
index 0000000..571d7e7
--- /dev/null
+++ b/core/java/com/android/internal/net/NetworkUtilsInternal.java
@@ -0,0 +1,92 @@
+/*
+ * 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.net;
+
+import static android.system.OsConstants.AF_INET;
+import static android.system.OsConstants.AF_INET6;
+
+import android.annotation.NonNull;
+import android.system.Os;
+
+/** @hide */
+public class NetworkUtilsInternal {
+
+ private static final int[] ADDRESS_FAMILIES = new int[] {AF_INET, AF_INET6};
+
+ /**
+ * Allow/Disallow creating AF_INET/AF_INET6 sockets and DNS lookups for current process.
+ *
+ * @param allowNetworking whether to allow or disallow creating AF_INET/AF_INET6 sockets
+ * and DNS lookups.
+ */
+ public static native void setAllowNetworkingForProcess(boolean allowNetworking);
+
+ /**
+ * Returns true if the hostname is weakly validated.
+ * @param hostname Name of host to validate.
+ * @return True if it's a valid-ish hostname.
+ *
+ * @hide
+ */
+ public static boolean isWeaklyValidatedHostname(@NonNull String hostname) {
+ // TODO(b/34953048): Use a validation method that permits more accurate,
+ // but still inexpensive, checking of likely valid DNS hostnames.
+ final String weakHostnameRegex = "^[a-zA-Z0-9_.-]+$";
+ if (!hostname.matches(weakHostnameRegex)) {
+ return false;
+ }
+
+ for (int address_family : ADDRESS_FAMILIES) {
+ if (Os.inet_pton(address_family, hostname) != null) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Safely multiple a value by a rational.
+ * <p>
+ * Internally it uses integer-based math whenever possible, but switches
+ * over to double-based math if values would overflow.
+ * @hide
+ */
+ public static long multiplySafeByRational(long value, long num, long den) {
+ if (den == 0) {
+ throw new ArithmeticException("Invalid Denominator");
+ }
+ long x = value;
+ long y = num;
+
+ // Logic shamelessly borrowed from Math.multiplyExact()
+ long r = x * y;
+ long ax = Math.abs(x);
+ long ay = Math.abs(y);
+ if (((ax | ay) >>> 31 != 0)) {
+ // Some bits greater than 2^31 that might cause overflow
+ // Check the result using the divide operator
+ // and check for the special case of Long.MIN_VALUE * -1
+ if (((y != 0) && (r / y != x))
+ || (x == Long.MIN_VALUE && y == -1)) {
+ // Use double math to avoid overflowing
+ return (long) (((double) num / den) * value);
+ }
+ }
+ return r / den;
+ }
+}
diff --git a/core/java/com/android/internal/net/VpnProfile.java b/core/java/com/android/internal/net/VpnProfile.java
index a17f5f5..b7170d8 100644
--- a/core/java/com/android/internal/net/VpnProfile.java
+++ b/core/java/com/android/internal/net/VpnProfile.java
@@ -28,6 +28,7 @@
import android.text.TextUtils;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.net.module.util.ProxyUtils;
import java.net.InetAddress;
import java.nio.charset.StandardCharsets;
@@ -285,10 +286,12 @@
String exclList = (values.length > 17) ? values[17] : "";
String pacFileUrl = (values.length > 18) ? values[18] : "";
if (!host.isEmpty() || !port.isEmpty() || !exclList.isEmpty()) {
- profile.proxy = new ProxyInfo(host, port.isEmpty() ?
- 0 : Integer.parseInt(port), exclList);
+ profile.proxy =
+ ProxyInfo.buildDirectProxy(host, port.isEmpty() ?
+ 0 : Integer.parseInt(port),
+ ProxyUtils.exclusionStringAsList(exclList));
} else if (!pacFileUrl.isEmpty()) {
- profile.proxy = new ProxyInfo(Uri.parse(pacFileUrl));
+ profile.proxy = ProxyInfo.buildPacProxy(Uri.parse(pacFileUrl));
}
} // else profile.proxy = null
@@ -337,8 +340,8 @@
builder.append(VALUE_DELIMITER).append(proxy.getPort());
builder.append(VALUE_DELIMITER)
.append(
- proxy.getExclusionListAsString() != null
- ? proxy.getExclusionListAsString()
+ ProxyUtils.exclusionListAsString(proxy.getExclusionList()) != null
+ ? ProxyUtils.exclusionListAsString(proxy.getExclusionList())
: "");
builder.append(VALUE_DELIMITER).append(proxy.getPacFileUrl().toString());
} else {
diff --git a/core/java/com/android/internal/os/KernelWakelockReader.java b/core/java/com/android/internal/os/KernelWakelockReader.java
index e595db3..e644274 100644
--- a/core/java/com/android/internal/os/KernelWakelockReader.java
+++ b/core/java/com/android/internal/os/KernelWakelockReader.java
@@ -78,13 +78,16 @@
boolean useSystemSuspend = (new File(sSysClassWakeupDir)).exists();
if (useSystemSuspend) {
- // Get both kernel and native wakelock stats from SystemSuspend
- updateVersion(staleStats);
- if (getWakelockStatsFromSystemSuspend(staleStats) == null) {
- Slog.w(TAG, "Failed to get wakelock stats from SystemSuspend");
- return null;
+ // static read/write lock protection for sKernelWakelockUpdateVersion
+ synchronized (KernelWakelockReader.class) {
+ // Get both kernel and native wakelock stats from SystemSuspend
+ updateVersion(staleStats);
+ if (getWakelockStatsFromSystemSuspend(staleStats) == null) {
+ Slog.w(TAG, "Failed to get wakelock stats from SystemSuspend");
+ return null;
+ }
+ return removeOldStats(staleStats);
}
- return removeOldStats(staleStats);
} else {
Arrays.fill(mKernelWakelockBuffer, (byte) 0);
int len = 0;
@@ -141,14 +144,17 @@
}
}
- updateVersion(staleStats);
- // Get native wakelock stats from SystemSuspend
- if (getWakelockStatsFromSystemSuspend(staleStats) == null) {
- Slog.w(TAG, "Failed to get Native wakelock stats from SystemSuspend");
+ // static read/write lock protection for sKernelWakelockUpdateVersion
+ synchronized (KernelWakelockReader.class) {
+ updateVersion(staleStats);
+ // Get native wakelock stats from SystemSuspend
+ if (getWakelockStatsFromSystemSuspend(staleStats) == null) {
+ Slog.w(TAG, "Failed to get Native wakelock stats from SystemSuspend");
+ }
+ // Get kernel wakelock stats
+ parseProcWakelocks(mKernelWakelockBuffer, len, wakeup_sources, staleStats);
+ return removeOldStats(staleStats);
}
- // Get kernel wakelock stats
- parseProcWakelocks(mKernelWakelockBuffer, len, wakeup_sources, staleStats);
- return removeOldStats(staleStats);
}
}
@@ -184,7 +190,6 @@
try {
wlStats = mSuspendControlService.getWakeLockStats();
- Slog.i(TAG, "Number of wakelock obtained from SystemSuspend: " + wlStats.length);
updateWakelockStats(wlStats, staleStats);
} catch (RemoteException e) {
Slog.wtf(TAG, "Failed to obtain wakelock stats from ISuspendControlService", e);
diff --git a/core/java/com/android/internal/os/Zygote.java b/core/java/com/android/internal/os/Zygote.java
index 5e20cd0..fda87be 100644
--- a/core/java/com/android/internal/os/Zygote.java
+++ b/core/java/com/android/internal/os/Zygote.java
@@ -24,7 +24,6 @@
import android.net.Credentials;
import android.net.LocalServerSocket;
import android.net.LocalSocket;
-import android.net.NetworkUtils;
import android.os.FactoryTest;
import android.os.IVold;
import android.os.Process;
@@ -35,6 +34,8 @@
import android.system.Os;
import android.util.Log;
+import com.android.internal.net.NetworkUtilsInternal;
+
import dalvik.annotation.optimization.FastNative;
import dalvik.system.ZygoteHooks;
@@ -340,7 +341,7 @@
// If no GIDs were specified, don't make any permissions changes based on groups.
if (gids != null && gids.length > 0) {
- NetworkUtils.setAllowNetworkingForProcess(containsInetGid(gids));
+ NetworkUtilsInternal.setAllowNetworkingForProcess(containsInetGid(gids));
}
}
diff --git a/core/java/com/android/internal/util/FastDataOutput.java b/core/java/com/android/internal/util/FastDataOutput.java
index 83d26e1..cf5b296 100644
--- a/core/java/com/android/internal/util/FastDataOutput.java
+++ b/core/java/com/android/internal/util/FastDataOutput.java
@@ -115,8 +115,7 @@
// Magnitude of this returned value indicates the number of bytes
// required to encode the string; sign indicates success/failure
- int len = CharsetUtils.toModifiedUtf8Bytes(s, mBufferPtr, mBufferPos + 2,
- mBufferCap - mBufferPos - 2);
+ int len = CharsetUtils.toModifiedUtf8Bytes(s, mBufferPtr, mBufferPos + 2, mBufferCap);
if (Math.abs(len) > MAX_UNSIGNED_SHORT) {
throw new IOException("Modified UTF-8 length too large: " + len);
}
diff --git a/core/java/com/android/internal/util/OWNERS b/core/java/com/android/internal/util/OWNERS
index 8b9acd3..a045451 100644
--- a/core/java/com/android/internal/util/OWNERS
+++ b/core/java/com/android/internal/util/OWNERS
@@ -2,3 +2,4 @@
per-file MessageUtils*, Protocol*, RingBuffer*, TokenBucket* = jchalard@google.com, lorenzo@google.com, satk@google.com
per-file Protocol* = etancohen@google.com, lorenzo@google.com
per-file State* = jchalard@google.com, lorenzo@google.com, satk@google.com
+per-file DataClass* = eugenesusla@google.com
\ No newline at end of file
diff --git a/core/java/com/android/internal/view/IInputMethodManager.aidl b/core/java/com/android/internal/view/IInputMethodManager.aidl
index 455e489..1fadfc5 100644
--- a/core/java/com/android/internal/view/IInputMethodManager.aidl
+++ b/core/java/com/android/internal/view/IInputMethodManager.aidl
@@ -26,6 +26,10 @@
import com.android.internal.view.IInputMethodClient;
import com.android.internal.inputmethod.IBooleanResultCallback;
import com.android.internal.inputmethod.IInputBindResultResultCallback;
+import com.android.internal.inputmethod.IInputMethodInfoListResultCallback;
+import com.android.internal.inputmethod.IInputMethodSubtypeResultCallback;
+import com.android.internal.inputmethod.IInputMethodSubtypeListResultCallback;
+import com.android.internal.inputmethod.IIntResultCallback;
/**
* Public interface to the global input method manager, used by all client
@@ -36,12 +40,13 @@
int untrustedDisplayId);
// TODO: Use ParceledListSlice instead
- List<InputMethodInfo> getInputMethodList(int userId);
+ void getInputMethodList(int userId, in IInputMethodInfoListResultCallback resultCallback);
// TODO: Use ParceledListSlice instead
- List<InputMethodInfo> getEnabledInputMethodList(int userId);
- List<InputMethodSubtype> getEnabledInputMethodSubtypeList(in String imiId,
- boolean allowsImplicitlySelectedSubtypes);
- InputMethodSubtype getLastInputMethodSubtype();
+ void getEnabledInputMethodList(int userId,
+ in IInputMethodInfoListResultCallback resultCallback);
+ void getEnabledInputMethodSubtypeList(in String imiId, boolean allowsImplicitlySelectedSubtypes,
+ in IInputMethodSubtypeListResultCallback resultCallback);
+ void getLastInputMethodSubtype(in IInputMethodSubtypeResultCallback resultCallback);
void showSoftInput(in IInputMethodClient client, IBinder windowToken, int flags,
in ResultReceiver resultReceiver, in IBooleanResultCallback resultCallback);
@@ -66,11 +71,11 @@
int displayId);
void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId);
void isInputMethodPickerShownForTest(in IBooleanResultCallback resultCallback);
- InputMethodSubtype getCurrentInputMethodSubtype();
+ void getCurrentInputMethodSubtype(in IInputMethodSubtypeResultCallback resultCallback);
void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes);
// This is kept due to @UnsupportedAppUsage.
// TODO(Bug 113914148): Consider removing this.
- int getInputMethodWindowVisibleHeight();
+ void getInputMethodWindowVisibleHeight(IIntResultCallback resultCallback);
void reportActivityView(in IInputMethodClient parentClient, int childDisplayId,
in float[] matrixValues);
diff --git a/core/java/com/android/server/net/BaseNetworkObserver.java b/core/java/com/android/server/net/BaseNetworkObserver.java
index 2a9c0b4..93f89b5 100644
--- a/core/java/com/android/server/net/BaseNetworkObserver.java
+++ b/core/java/com/android/server/net/BaseNetworkObserver.java
@@ -64,7 +64,8 @@
}
@Override
- public void interfaceClassDataActivityChanged(String label, boolean active, long tsNanos) {
+ public void interfaceClassDataActivityChanged(int networkType, boolean active, long tsNanos,
+ int uid) {
// default no-op
}
diff --git a/core/jni/Android.bp b/core/jni/Android.bp
index 8c83d7c..c05e7a2 100644
--- a/core/jni/Android.bp
+++ b/core/jni/Android.bp
@@ -181,6 +181,7 @@
"android_content_res_Configuration.cpp",
"android_security_Scrypt.cpp",
"com_android_internal_content_om_OverlayConfig.cpp",
+ "com_android_internal_net_NetworkUtilsInternal.cpp",
"com_android_internal_os_ClassLoaderFactory.cpp",
"com_android_internal_os_FuseAppLoop.cpp",
"com_android_internal_os_KernelCpuUidBpfMapReader.cpp",
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 14e74a8..cefa88c 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -187,6 +187,7 @@
extern int register_android_security_Scrypt(JNIEnv *env);
extern int register_com_android_internal_content_NativeLibraryHelper(JNIEnv *env);
extern int register_com_android_internal_content_om_OverlayConfig(JNIEnv *env);
+extern int register_com_android_internal_net_NetworkUtilsInternal(JNIEnv* env);
extern int register_com_android_internal_os_ClassLoaderFactory(JNIEnv* env);
extern int register_com_android_internal_os_FuseAppLoop(JNIEnv* env);
extern int register_com_android_internal_os_KernelCpuUidBpfMapReader(JNIEnv *env);
@@ -1522,6 +1523,7 @@
REG_JNI(register_android_os_SharedMemory),
REG_JNI(register_android_os_incremental_IncrementalManager),
REG_JNI(register_com_android_internal_content_om_OverlayConfig),
+ REG_JNI(register_com_android_internal_net_NetworkUtilsInternal),
REG_JNI(register_com_android_internal_os_ClassLoaderFactory),
REG_JNI(register_com_android_internal_os_Zygote),
REG_JNI(register_com_android_internal_os_ZygoteInit),
diff --git a/core/jni/OWNERS b/core/jni/OWNERS
index 54b0340..2279d57 100644
--- a/core/jni/OWNERS
+++ b/core/jni/OWNERS
@@ -27,6 +27,18 @@
per-file android_util_XmlBlock* = file:/core/java/android/content/res/OWNERS
per-file com_android_internal_content_om_OverlayConfig* = file:/core/java/android/content/res/OWNERS
+# Binder related things
+per-file android_os_Parcel* = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file android_os_ServiceManager* = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file android_util_Binder* = file:platform/frameworks/native:/libs/binder/OWNERS
+
+# HwBinder related things
+per-file android_os_HwBinder* = file:platform/system/libhwbinder:/OWNERS
+per-file android_os_HwBlob* = file:platform/system/libhwbinder:/OWNERS
+per-file android_os_HwParcel* = file:platform/system/libhwbinder:/OWNERS
+per-file android_os_HwRemoteBinder* = file:platform/system/libhwbinder:/OWNERS
+per-file EphemeralStorage* = file:platform/system/libhwbinder:/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
diff --git a/core/jni/android_graphics_BLASTBufferQueue.cpp b/core/jni/android_graphics_BLASTBufferQueue.cpp
index 3e87cb5..8d3faf4 100644
--- a/core/jni/android_graphics_BLASTBufferQueue.cpp
+++ b/core/jni/android_graphics_BLASTBufferQueue.cpp
@@ -26,9 +26,47 @@
#include <gui/BLASTBufferQueue.h>
#include <gui/Surface.h>
#include <gui/SurfaceComposerClient.h>
+#include "core_jni_helpers.h"
namespace android {
+struct {
+ jmethodID onTransactionComplete;
+} gTransactionCompleteCallback;
+
+class TransactionCompleteCallbackWrapper : public LightRefBase<TransactionCompleteCallbackWrapper> {
+public:
+ explicit TransactionCompleteCallbackWrapper(JNIEnv* env, jobject jobject) {
+ env->GetJavaVM(&mVm);
+ mTransactionCompleteObject = env->NewGlobalRef(jobject);
+ LOG_ALWAYS_FATAL_IF(!mTransactionCompleteObject, "Failed to make global ref");
+ }
+
+ ~TransactionCompleteCallbackWrapper() {
+ if (mTransactionCompleteObject) {
+ getenv()->DeleteGlobalRef(mTransactionCompleteObject);
+ mTransactionCompleteObject = nullptr;
+ }
+ }
+
+ void onTransactionComplete(int64_t frameNr) {
+ if (mTransactionCompleteObject) {
+ getenv()->CallVoidMethod(mTransactionCompleteObject,
+ gTransactionCompleteCallback.onTransactionComplete, frameNr);
+ }
+ }
+
+private:
+ JavaVM* mVm;
+ jobject mTransactionCompleteObject;
+
+ JNIEnv* getenv() {
+ JNIEnv* env;
+ mVm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6);
+ return env;
+ }
+};
+
static jlong nativeCreate(JNIEnv* env, jclass clazz, jstring jName, jlong surfaceControl,
jlong width, jlong height, jboolean enableTripleBuffering) {
String8 str8;
@@ -76,20 +114,53 @@
queue->flushShadowQueue();
}
+static void nativeMergeWithNextTransaction(JNIEnv*, jclass clazz, jlong ptr, jlong transactionPtr,
+ jlong framenumber) {
+ sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr);
+ auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionPtr);
+ queue->mergeWithNextTransaction(transaction, framenumber);
+}
+
+static void nativeSetTransactionCompleteCallback(JNIEnv* env, jclass clazz, jlong ptr,
+ jlong frameNumber,
+ jobject transactionCompleteCallback) {
+ sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr);
+ if (transactionCompleteCallback == nullptr) {
+ queue->setTransactionCompleteCallback(frameNumber, nullptr);
+ } else {
+ sp<TransactionCompleteCallbackWrapper> wrapper =
+ new TransactionCompleteCallbackWrapper{env, transactionCompleteCallback};
+ queue->setTransactionCompleteCallback(frameNumber, [wrapper](int64_t frameNr) {
+ wrapper->onTransactionComplete(frameNr);
+ });
+ }
+}
+
static const JNINativeMethod gMethods[] = {
/* name, signature, funcPtr */
+ // clang-format off
{"nativeCreate", "(Ljava/lang/String;JJJZ)J", (void*)nativeCreate},
{"nativeGetSurface", "(JZ)Landroid/view/Surface;", (void*)nativeGetSurface},
{"nativeDestroy", "(J)V", (void*)nativeDestroy},
{"nativeSetNextTransaction", "(JJ)V", (void*)nativeSetNextTransaction},
{"nativeUpdate", "(JJJJ)V", (void*)nativeUpdate},
- {"nativeFlushShadowQueue", "(J)V", (void*)nativeFlushShadowQueue}};
+ {"nativeFlushShadowQueue", "(J)V", (void*)nativeFlushShadowQueue},
+ {"nativeMergeWithNextTransaction", "(JJJ)V", (void*)nativeMergeWithNextTransaction},
+ {"nativeSetTransactionCompleteCallback",
+ "(JJLandroid/graphics/BLASTBufferQueue$TransactionCompleteCallback;)V",
+ (void*)nativeSetTransactionCompleteCallback}
+ // clang-format on
+};
int register_android_graphics_BLASTBufferQueue(JNIEnv* env) {
int res = jniRegisterNativeMethods(env, "android/graphics/BLASTBufferQueue",
gMethods, NELEM(gMethods));
LOG_ALWAYS_FATAL_IF(res < 0, "Unable to register native methods.");
+ jclass transactionCompleteClass =
+ FindClassOrDie(env, "android/graphics/BLASTBufferQueue$TransactionCompleteCallback");
+ gTransactionCompleteCallback.onTransactionComplete =
+ GetMethodIDOrDie(env, transactionCompleteClass, "onTransactionComplete", "(J)V");
return 0;
}
diff --git a/core/jni/android_media_AudioSystem.cpp b/core/jni/android_media_AudioSystem.cpp
index 5cffbef..302ac3c 100644
--- a/core/jni/android_media_AudioSystem.cpp
+++ b/core/jni/android_media_AudioSystem.cpp
@@ -171,6 +171,7 @@
static struct {
jmethodID postDynPolicyEventFromNative;
jmethodID postRecordConfigEventFromNative;
+ jmethodID postRoutingUpdatedFromNative;
} gAudioPolicyEventHandlerMethods;
static struct { jmethodID add; } gListMethods;
@@ -539,6 +540,21 @@
env->DeleteLocalRef(jEffects);
}
+static void
+android_media_AudioSystem_routing_callback()
+{
+ JNIEnv *env = AndroidRuntime::getJNIEnv();
+ if (env == NULL) {
+ return;
+ }
+
+ // callback into java
+ jclass clazz = env->FindClass(kClassPathName);
+ env->CallStaticVoidMethod(clazz,
+ gAudioPolicyEventHandlerMethods.postRoutingUpdatedFromNative);
+ env->DeleteLocalRef(clazz);
+}
+
static jint
android_media_AudioSystem_setDeviceConnectionState(JNIEnv *env, jobject thiz, jint device, jint state, jstring device_address, jstring device_name,
jint codec)
@@ -1894,6 +1910,12 @@
AudioSystem::setRecordConfigCallback(android_media_AudioSystem_recording_callback);
}
+static void
+android_media_AudioSystem_registerRoutingCallback(JNIEnv *env, jobject thiz)
+{
+ AudioSystem::setRoutingCallback(android_media_AudioSystem_routing_callback);
+}
+
static jint convertAudioMixToNative(JNIEnv *env,
AudioMix *nAudioMix,
@@ -2579,6 +2601,8 @@
(void *)android_media_AudioSystem_registerDynPolicyCallback},
{"native_register_recording_callback", "()V",
(void *)android_media_AudioSystem_registerRecordingCallback},
+ {"native_register_routing_callback", "()V",
+ (void *)android_media_AudioSystem_registerRoutingCallback},
{"systemReady", "()I", (void *)android_media_AudioSystem_systemReady},
{"getStreamVolumeDB", "(III)F", (void *)android_media_AudioSystem_getStreamVolumeDB},
{"native_get_offload_support", "(IIIII)I",
@@ -2762,6 +2786,9 @@
gAudioPolicyEventHandlerMethods.postRecordConfigEventFromNative =
GetStaticMethodIDOrDie(env, env->FindClass(kClassPathName),
"recordingCallbackFromNative", "(IIIIIIZ[I[Landroid/media/audiofx/AudioEffect$Descriptor;[Landroid/media/audiofx/AudioEffect$Descriptor;I)V");
+ gAudioPolicyEventHandlerMethods.postRoutingUpdatedFromNative =
+ GetStaticMethodIDOrDie(env, env->FindClass(kClassPathName),
+ "routingCallbackFromNative", "()V");
jclass audioMixClass = FindClassOrDie(env, "android/media/audiopolicy/AudioMix");
gAudioMixClass = MakeGlobalRefOrDie(env, audioMixClass);
diff --git a/core/jni/android_net_NetUtils.cpp b/core/jni/android_net_NetUtils.cpp
index 8d4c4e5..2155246 100644
--- a/core/jni/android_net_NetUtils.cpp
+++ b/core/jni/android_net_NetUtils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2008, The Android Open Source Project
+ * 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.
@@ -28,7 +28,6 @@
#include <netinet/udp.h>
#include <DnsProxydProtocol.h> // NETID_USE_LOCAL_NAMESERVERS
-#include <android_runtime/AndroidRuntime.h>
#include <cutils/properties.h>
#include <nativehelper/JNIPlatformHelp.h>
#include <nativehelper/ScopedLocalRef.h>
@@ -226,11 +225,6 @@
class_Network, ctor, dnsNetId & ~NETID_USE_LOCAL_NAMESERVERS, privateDnsBypass);
}
-static void android_net_utils_setAllowNetworkingForProcess(JNIEnv *env, jobject thiz,
- jboolean hasConnectivity) {
- setAllowNetworkingForProcess(hasConnectivity == JNI_TRUE);
-}
-
static jobject android_net_utils_getTcpRepairWindow(JNIEnv *env, jobject thiz, jobject javaFd) {
if (javaFd == NULL) {
jniThrowNullPointerException(env, NULL);
@@ -288,7 +282,6 @@
{ "resNetworkResult", "(Ljava/io/FileDescriptor;)Landroid/net/DnsResolver$DnsResponse;", (void*) android_net_utils_resNetworkResult },
{ "resNetworkCancel", "(Ljava/io/FileDescriptor;)V", (void*) android_net_utils_resNetworkCancel },
{ "getDnsNetwork", "()Landroid/net/Network;", (void*) android_net_utils_getDnsNetwork },
- { "setAllowNetworkingForProcess", "(Z)V", (void *)android_net_utils_setAllowNetworkingForProcess },
};
// clang-format on
diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp
index bf79a44..bb51c57 100644
--- a/core/jni/android_os_Debug.cpp
+++ b/core/jni/android_os_Debug.cpp
@@ -847,6 +847,17 @@
return ionPss;
}
+static jlong android_os_Debug_getGpuTotalUsageKb(JNIEnv* env, jobject clazz) {
+ jlong sizeKb = -1;
+ uint64_t size;
+
+ if (meminfo::ReadGpuTotalUsageKb(&size)) {
+ sizeKb = size;
+ }
+
+ return sizeKb;
+}
+
static jboolean android_os_Debug_isVmapStack(JNIEnv *env, jobject clazz)
{
static enum {
@@ -915,6 +926,8 @@
(void*)android_os_Debug_getIonPoolsSizeKb },
{ "getIonMappedSizeKb", "()J",
(void*)android_os_Debug_getIonMappedSizeKb },
+ { "getGpuTotalUsageKb", "()J",
+ (void*)android_os_Debug_getGpuTotalUsageKb },
{ "isVmapStack", "()Z",
(void*)android_os_Debug_isVmapStack },
};
diff --git a/core/jni/com_android_internal_net_NetworkUtilsInternal.cpp b/core/jni/com_android_internal_net_NetworkUtilsInternal.cpp
new file mode 100644
index 0000000..10fc18d
--- /dev/null
+++ b/core/jni/com_android_internal_net_NetworkUtilsInternal.cpp
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+#include "NetdClient.h"
+#include "core_jni_helpers.h"
+#include "jni.h"
+
+namespace android {
+static void android_net_utils_setAllowNetworkingForProcess(JNIEnv *env, jobject thiz,
+ jboolean hasConnectivity) {
+ setAllowNetworkingForProcess(hasConnectivity == JNI_TRUE);
+}
+
+static const JNINativeMethod gNetworkUtilMethods[] = {
+ {"setAllowNetworkingForProcess", "(Z)V",
+ (void *)android_net_utils_setAllowNetworkingForProcess},
+};
+
+int register_com_android_internal_net_NetworkUtilsInternal(JNIEnv *env) {
+ return RegisterMethodsOrDie(env, "com/android/internal/net/NetworkUtilsInternal",
+ gNetworkUtilMethods, NELEM(gNetworkUtilMethods));
+}
+
+} // namespace android
diff --git a/core/proto/android/providers/settings/secure.proto b/core/proto/android/providers/settings/secure.proto
index 6f4085d..2ba39cb 100644
--- a/core/proto/android/providers/settings/secure.proto
+++ b/core/proto/android/providers/settings/secure.proto
@@ -79,6 +79,8 @@
optional SettingProto accessibility_magnification_mode = 34 [ (android.privacy).dest = DEST_AUTOMATIC ];
optional SettingProto button_targets = 35 [ (android.privacy).dest = DEST_AUTOMATIC ];
optional SettingProto accessibility_magnification_capability = 36 [ (android.privacy).dest = DEST_AUTOMATIC ];
+ // Settings for accessibility button mode (navigation bar or floating action menu).
+ optional SettingProto accessibility_button_mode = 37 [ (android.privacy).dest = DEST_AUTOMATIC ];
}
optional Accessibility accessibility = 2;
diff --git a/core/proto/android/server/windowmanagerservice.proto b/core/proto/android/server/windowmanagerservice.proto
index c4c007d..610e0e0 100644
--- a/core/proto/android/server/windowmanagerservice.proto
+++ b/core/proto/android/server/windowmanagerservice.proto
@@ -509,7 +509,7 @@
optional .android.graphics.RectProto overscan_frame = 7 [deprecated=true];
optional .android.graphics.RectProto parent_frame = 8;
optional .android.graphics.RectProto visible_frame = 9 [deprecated=true];
- optional .android.view.DisplayCutoutProto cutout = 10;
+ optional .android.view.DisplayCutoutProto cutout = 10 [deprecated=true];
optional .android.graphics.RectProto content_insets = 11 [deprecated=true];
optional .android.graphics.RectProto overscan_insets = 12 [deprecated=true];
optional .android.graphics.RectProto visible_insets = 13 [deprecated=true];
diff --git a/core/proto/android/view/insetsstate.proto b/core/proto/android/view/insetsstate.proto
index 9e9933d..1cab982 100644
--- a/core/proto/android/view/insetsstate.proto
+++ b/core/proto/android/view/insetsstate.proto
@@ -16,8 +16,9 @@
syntax = "proto2";
-import "frameworks/base/core/proto/android/view/insetssource.proto";
import "frameworks/base/core/proto/android/graphics/rect.proto";
+import "frameworks/base/core/proto/android/view/displaycutout.proto";
+import "frameworks/base/core/proto/android/view/insetssource.proto";
package android.view;
@@ -29,4 +30,5 @@
message InsetsStateProto {
repeated InsetsSourceProto sources = 1;
optional .android.graphics.RectProto display_frame = 2;
-}
\ No newline at end of file
+ optional DisplayCutoutProto display_cutout = 3;
+}
diff --git a/core/proto/android/view/viewrootimpl.proto b/core/proto/android/view/viewrootimpl.proto
index 0abe5e06..181b2bb 100644
--- a/core/proto/android/view/viewrootimpl.proto
+++ b/core/proto/android/view/viewrootimpl.proto
@@ -38,7 +38,7 @@
optional bool is_drawing = 8;
optional bool added = 9;
optional .android.graphics.RectProto win_frame = 10;
- optional DisplayCutoutProto pending_display_cutout = 11;
+ optional DisplayCutoutProto pending_display_cutout = 11 [deprecated=true];
optional string last_window_insets = 12;
optional string soft_input_mode = 13;
optional int32 scroll_y = 14;
diff --git a/core/res/Android.bp b/core/res/Android.bp
index f94a2b0..9ee5e5e1 100644
--- a/core/res/Android.bp
+++ b/core/res/Android.bp
@@ -19,6 +19,13 @@
sdk_version: "core_platform",
certificate: "platform",
+ // Disable dexpreopt and verify_uses_libraries check as the app
+ // contains no Java code to be dexpreopted.
+ enforce_uses_libs: false,
+ dex_preopt: {
+ enabled: false,
+ },
+
// Soong special-cases framework-res to install this alongside
// the libraries at /system/framework/framework-res.apk.
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 62a8ae5..8682fea 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -393,6 +393,7 @@
<protected-broadcast android:name="android.net.wifi.action.PASSPOINT_OSU_PROVIDERS_LIST" />
<protected-broadcast android:name="android.net.wifi.action.PASSPOINT_SUBSCRIPTION_REMEDIATION" />
<protected-broadcast android:name="android.net.wifi.action.PASSPOINT_LAUNCH_OSU_VIEW" />
+ <protected-broadcast android:name="android.net.wifi.action.REFRESH_USER_PROVISIONING" />
<protected-broadcast android:name="android.net.wifi.action.WIFI_NETWORK_SUGGESTION_POST_CONNECTION" />
<protected-broadcast android:name="android.net.wifi.action.WIFI_SCAN_AVAILABILITY_CHANGED" />
<protected-broadcast android:name="android.net.wifi.supplicant.CONNECTION_CHANGE" />
@@ -1590,13 +1591,31 @@
<permission android:name="android.permission.INSTALL_LOCATION_PROVIDER"
android:protectionLevel="signature|privileged" />
- <!-- @SystemApi @hide Allows an application to install a LocationTimeZoneProvider into the
- LocationTimeZoneProviderManager.
+ <!-- @SystemApi @hide Allows an application to provide location-based time zone suggestions to
+ the system server. This is needed because the system server discovers time zone providers
+ by exposed intent actions and metadata, without it any app could potentially register
+ itself as time zone provider. The system server checks for this permission.
<p>Not for use by third-party applications.
-->
- <permission android:name="android.permission.INSTALL_LOCATION_TIME_ZONE_PROVIDER"
+ <permission android:name="android.permission.INSTALL_LOCATION_TIME_ZONE_PROVIDER_SERVICE"
android:protectionLevel="signature|privileged" />
+ <!-- The system server uses this permission to install a default secondary location time zone
+ provider.
+ -->
+ <uses-permission android:name="android.permission.INSTALL_LOCATION_TIME_ZONE_PROVIDER_SERVICE"/>
+
+ <!-- @SystemApi @hide Allows an application to bind to a android.service.TimeZoneProviderService
+ for the purpose of detecting the device's time zone. This prevents arbitrary clients
+ connecting to the time zone provider service. The system server checks that the provider's
+ intent service explicitly sets this permission via the android:permission attribute of the
+ service.
+ This is only expected to be possessed by the system server outside of tests.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.BIND_TIME_ZONE_PROVIDER_SERVICE"
+ android:protectionLevel="signature" />
+
<!-- @SystemApi @hide Allows HDMI-CEC service to access device and configuration files.
This should only be used by HDMI-CEC service.
-->
@@ -5784,6 +5803,8 @@
<!-- AOSP configures a default secondary LocationTimeZoneProvider that uses an on-device
data set from the com.android.geotz APEX. -->
<service android:name="com.android.timezone.geotz.provider.OfflineLocationTimeZoneProviderService"
+ android:enabled="@bool/config_enableSecondaryLocationTimeZoneProvider"
+ android:permission="android.permission.BIND_TIME_ZONE_PROVIDER_SERVICE"
android:exported="false">
<intent-filter>
<action android:name="android.service.timezone.SecondaryLocationTimeZoneProviderService" />
diff --git a/core/res/res/layout/notification_template_material_big_base.xml b/core/res/res/layout/notification_template_material_big_base.xml
index 36903fff..de537b2 100644
--- a/core/res/res/layout/notification_template_material_big_base.xml
+++ b/core/res/res/layout/notification_template_material_big_base.xml
@@ -56,7 +56,7 @@
<include layout="@layout/notification_template_part_line1" />
- <include layout="@layout/notification_template_text" />
+ <include layout="@layout/notification_template_text_multiline" />
<include
android:layout_width="match_parent"
diff --git a/core/res/res/layout/notification_template_material_big_picture.xml b/core/res/res/layout/notification_template_material_big_picture.xml
index 38853c6..25d396f 100644
--- a/core/res/res/layout/notification_template_material_big_picture.xml
+++ b/core/res/res/layout/notification_template_material_big_picture.xml
@@ -59,7 +59,7 @@
android:layout_marginTop="@dimen/notification_progress_margin_top"
/>
- <include layout="@layout/notification_template_text" />
+ <include layout="@layout/notification_template_text_multiline" />
</LinearLayout>
<ImageView
diff --git a/core/res/res/layout/notification_template_text_multiline.xml b/core/res/res/layout/notification_template_text_multiline.xml
new file mode 100644
index 0000000..d632ac9
--- /dev/null
+++ b/core/res/res/layout/notification_template_text_multiline.xml
@@ -0,0 +1,30 @@
+<?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
+ -->
+<com.android.internal.widget.ImageFloatingTextView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/Widget.DeviceDefault.Notification.Text"
+ android:id="@+id/text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:layout_marginTop="@dimen/notification_text_margin_top"
+ android:minHeight="@dimen/notification_text_height"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal"
+ android:gravity="top"
+ android:maxLines="2"
+ android:textAlignment="viewStart"
+ />
diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml
index 9f92d72..cef5e1c 100644
--- a/core/res/res/values-af/strings.xml
+++ b/core/res/res/values-af/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofoon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"wys tans bo-oor ander programme op jou skerm"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Gee terugvoer"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Hierdie kennisgewing is na Verstek bevorder. Tik om terugvoer te gee."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Hierdie kennisgewing is gedegradeer na Stil. Tik om terugvoer te gee."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Hierdie kennisgewing is hoër gegradeer. Tik om terugvoer te gee."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Hierdie kennisgewing is laer gegradeer. Tik om terugvoer te gee."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Roetinemodus-inligtingkennisgewing"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Battery kan afloop voordat dit normaalweg gelaai word"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Batterybespaarder is geaktiveer om batterylewe te verleng"</string>
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index bc40003..0d3939b 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"ማይክሮፎን"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"በማያዎ ላይ በሌሎች መተግበሪያዎች ላይ በማሳየት ላይ"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"ግብረመልስ ይስጡ"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"ይህ ማሳወቂያ ወደ ነባሪ ከፍ ተደርጓል። ግብረመልስ ለመስጠት መታ ያድርጉ።"</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"ይህ ማሳወቂያ ወደ ዝምታ ዝቅ ብሏል። ግብረመልስ ለመስጠት መታ ያድርጉ።"</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"ይህ ማሳወቂያ ከፍተኛ ደረጃ ተሰጥቶታል። ግብረመልስ ለመስጠት መታ ያድርጉ።"</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"ይህ ማሳወቂያ ዝቅተኛ ደረጃ ተሰጥቶታል። ግብረመልስ ለመስጠት መታ ያድርጉ።"</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"የዕለት ተዕለት ሁነታ መረጃ ማሳወቂያዎች"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"ባትሪ ከተለመደው ኃይል መሙላት በፊት ሊያልቅ ይችላል"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"የባትሪ ቆጣቢ የባትሪ ዕድሜን ለማራዘም ገብሯል።"</string>
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index 5a18497..3a4518e 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -2141,6 +2141,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"ميكروفون"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"العرض فوق التطبيقات الأخرى على شاشتك"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"تقديم تعليقات"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"تمت ترقية هذا الإشعار إلى الإعداد التلقائي. انقر لإرسال ملاحظات وآراء."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"تم خفض ترتيب هذا الإشعار إلى الوضع \"صامت\". انقر لإرسال ملاحظات وآراء."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"تمت زيادة ترتيب هذا الإشعار. انقر لإرسال ملاحظات وآراء."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"تم خفض ترتيب هذا الإشعار. انقر لإرسال ملاحظات وآراء."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"إشعار معلومات \"وضع سلسلة الإجراءات\""</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"قد تنفد طاقة البطارية قبل الشحن المعتاد"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"تم تفعيل \"توفير شحن البطارية\" لإطالة عمرها."</string>
diff --git a/core/res/res/values-as/strings.xml b/core/res/res/values-as/strings.xml
index e087332..0721f8e 100644
--- a/core/res/res/values-as/strings.xml
+++ b/core/res/res/values-as/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"মাইক্ৰ\'ফ\'ন"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"স্ক্ৰীণত অইন এপৰ ওপৰত দেখুৱাওক"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"মতামত দিয়ক"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"এই জাননীটোৰ গুৰুত্ব ডিফ’ল্টলৈ বৃদ্ধি কৰা হৈছে। মতামত দিবলৈ টিপক।"</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"এই জাননীটোৰ গুৰুত্ব নীৰৱলৈ হ্ৰাস কৰা হৈছে। মতামত দিবলৈ টিপক।"</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"এই জাননীটোৰ স্থান ওপৰলৈ কৰা হৈছে। মতামত দিবলৈ টিপক।"</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"এই জাননীটোৰ স্থান তললৈ কৰা হৈছে। মতামত দিবলৈ টিপক।"</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"ৰুটিন ম’ডৰ তথ্য জাননী"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"চ্চাৰ্জ কৰাৰ সচৰাচৰ সময়ৰ আগতেই বেটাৰি শেষ হ’ব পাৰে"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"বেটাৰিৰ খৰচ কমাবলৈ বেটাৰি সঞ্চয়কাৰী অন কৰা হৈছে"</string>
diff --git a/core/res/res/values-az/strings.xml b/core/res/res/values-az/strings.xml
index 2e36aab..a223715 100644
--- a/core/res/res/values-az/strings.xml
+++ b/core/res/res/values-az/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"ekrandakı digər tətbiqlərdə göstərin"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Rəy bildirin"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Bu bildiriş Defolt ayara keçirilib. Rəy bildirmək üçün toxunun."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Bu bildiriş Səssiz rejimə keçirilib. Rəy bildirmək üçün toxunun."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Bu bildiriş yuxarı sıraya keçirilib. Rəy bildirmək üçün toxunun."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Bu bildiriş aşağı sıraya keçirilib. Rəy bildirmək üçün toxunun."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Rejim üçün məlumat bildirişi"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Batareya həmişəki vaxtdan əvvəl bitə bilər"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Enerjiyə Qənaət rejimi batareya istifadəsinin müddətini artırmaq üçün aktiv edilir"</string>
diff --git a/core/res/res/values-b+sr+Latn/strings.xml b/core/res/res/values-b+sr+Latn/strings.xml
index 77220b2..aa7f658 100644
--- a/core/res/res/values-b+sr+Latn/strings.xml
+++ b/core/res/res/values-b+sr+Latn/strings.xml
@@ -2042,6 +2042,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"prikazuje se na ekranu dok koristite druge aplikacije"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Pošaljite povratne informacije"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Ovo obaveštenje je unapređeno u Podrazumevano. Dodirnite da biste naveli povratne informacije."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Ovo obaveštenje je degradirano u Nečujno. Dodirnite da biste naveli povratne informacije."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Ovo obaveštenje je rangirano više. Dodirnite da biste naveli povratne informacije."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Ovo obaveštenje je rangirano niže. Dodirnite da biste naveli povratne informacije."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Obaveštenje o informacijama Rutinskog režima"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Baterija će se možda isprazniti pre uobičajenog punjenja"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Ušteda baterije je aktivirana da bi se produžilo trajanje baterije"</string>
diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml
index 8c06ad6..8cc58a1 100644
--- a/core/res/res/values-be/strings.xml
+++ b/core/res/res/values-be/strings.xml
@@ -2075,6 +2075,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Мікрафон"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"паказваецца паверх іншых праграм на экране"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Даць водгук"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Гэта апавяшчэнне пазначана сістэмай як стандартнае. Націсніце тут і дайце водгук."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Гэта апавяшчэнне пераведзена ў рэжым \"Без гуку\". Націсніце тут і дайце водгук."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Гэта апавяшчэнне ацэнена як важнае. Націсніце тут і дайце водгук."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Гэта апавяшчэнне ацэнена як няважнае. Націсніце тут і дайце водгук."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Апавяшчэнне з інфармацыяй пра ўсталяваны рэжым"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Акумулятар можа разрадзіцца хутчэй, чым прыйдзе час звычайнай зарадкі"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Каб павялічыць тэрмін работы акумулятара, уключаны рэжым эканоміі зараду"</string>
diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml
index c648398..ec29f3e 100644
--- a/core/res/res/values-bg/strings.xml
+++ b/core/res/res/values-bg/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Микрофон"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"се показва върху други приложения на екрана"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Предоставяне на отзиви"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Това известие бе повишено до основно. Докоснете, за да изпратите отзиви."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Това известие бе понижено до беззвучно. Докоснете, за да изпратите отзиви."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Това известие бе класирано по-високо. Докоснете, за да изпратите отзиви."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Това известие бе класирано по-ниско. Докоснете, за да изпратите отзиви."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Известие с информация за режима на поредица"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Батерията може да се изтощи преди обичайното зареждане"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Режимът за запазване на батерията е активиран с цел удължаване на живота на батерията"</string>
diff --git a/core/res/res/values-bn/strings.xml b/core/res/res/values-bn/strings.xml
index 98ba23c..0fea936 100644
--- a/core/res/res/values-bn/strings.xml
+++ b/core/res/res/values-bn/strings.xml
@@ -2009,6 +2009,14 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"মাইক্রোফোন"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"স্ক্রিনে অন্যান্য অ্যাপের উপরে দেখানো হচ্ছে"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"মতামত জানান"</string>
+ <!-- no translation found for notification_feedback_indicator_alerted (6552871804121942099) -->
+ <skip />
+ <!-- no translation found for notification_feedback_indicator_silenced (3799442124723177262) -->
+ <skip />
+ <!-- no translation found for notification_feedback_indicator_promoted (9030204303764698640) -->
+ <skip />
+ <!-- no translation found for notification_feedback_indicator_demoted (8880309924296450875) -->
+ <skip />
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"রুটিন মোডের তথ্য সংক্রান্ত বিজ্ঞপ্তি"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"সাধারণত যখন চার্জ দেন, তার আগে চার্জ শেষ হয়ে যেতে পারে"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"ডিভাইস বেশিক্ষণ চালু রাখতে ব্যাটারি সেভার চালু করা হয়েছে"</string>
diff --git a/core/res/res/values-bs/strings.xml b/core/res/res/values-bs/strings.xml
index 53a03a7..64b785a 100644
--- a/core/res/res/values-bs/strings.xml
+++ b/core/res/res/values-bs/strings.xml
@@ -2042,6 +2042,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"prikazivanje preko drugih aplikacija na ekranu"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Pružanje povratnih informacija"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Značaj ovog obavještenja je povećan na Zadano. Dodirnite da pošaljete povratne informacije."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Značaj ovog obavještenja je umanjen na Nečujno. Dodirnite da pošaljete povratne informacije."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Značaj ovog obavještenja je povećan. Dodirnite da pošaljete povratne informacije."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Značaj ovog obavještenja je umanjen. Dodirnite da pošaljete povratne informacije."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Obavještenje za informacije Rutinskog načina"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Moguće je da će se baterija isprazniti prije uobičajenog punjenja"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Ušteda baterije je aktivirana da bi se produžio vijek trajanja baterije"</string>
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index 5ce2ff2..17a5039 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Micròfon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"es mostra sobre altres aplicacions a la pantalla"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Envia suggeriments"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"El sistema ha augmentat a Predeterminat el nivell d\'aquesta notificació. Toca per proporcionar suggeriments."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"El nivell d\'aquesta notificació s\'ha disminuït a Silenci. Toca per proporcionar suggeriments."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Aquesta notificació s\'ha classificat amb un nivell superior. Toca per proporcionar suggeriments."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Aquesta notificació s\'ha classificat amb un nivell inferior. Toca per proporcionar suggeriments."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Notificació d\'informació del mode de rutina"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"És possible que la bateria s\'esgoti abans de la càrrega habitual"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"S\'ha activat l\'estalvi de bateria per prolongar-ne la durada"</string>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index 6840e2d..e51ec22 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -2075,6 +2075,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"zobrazení přes ostatní aplikace na obrazovce"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Odeslat zpětnou vazbu"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"U tohoto oznámení byla zvýšena priorita na Výchozí. Po klepnutí můžete zadat zpětnou vazbu."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Toto oznámení bylo ztlumeno. Po klepnutí můžete zadat zpětnou vazbu."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"U tohoto oznámení byla zvýšena priorita. Po klepnutí můžete zadat zpětnou vazbu."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"U tohoto oznámení byla snížena priorita. Po klepnutí můžete zadat zpětnou vazbu."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Informační oznámení režimu sledu činností"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Baterie se možná vybije před obvyklým časem nabití"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Byl aktivován spořič baterie za účelem prodloužení výdrže"</string>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index d7ff335..19add07 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -2011,6 +2011,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"vises over andre apps på din skærm"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Giv feedback"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Denne notifikation blev angivet som Standard. Tryk for at give feedback."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Denne notifikation blev angivet som Lydløs. Tryk for at give feedback."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Denne notifikation blev placeret højere. Tryk for at give feedback."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Denne notifikation blev placeret lavere. Tryk for at give feedback."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Notifikation med oplysninger om rutinetilstand"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Enheden løber muligvis tør for batteri, inden du normalt oplader den"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Batterisparefunktion er aktiveret for at forlænge batteritiden"</string>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index 8038fc9..410b597 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"wird über anderen Apps auf dem Bildschirm angezeigt"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Feedback geben"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Diese Benachrichtigung wurde auf „Standard“ hochgestuft. Tippe, um Feedback zu geben."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Diese Benachrichtigung wurde auf „Lautlos“ herabgestuft. Tippe, um Feedback zu geben."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Diese Benachrichtigung wurde hochgestuft. Tippe, um Feedback zu geben."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Diese Benachrichtigung wurde herabgestuft. Tippe, um Feedback zu geben."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Infomitteilung zum Ablaufmodus"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Dein Akku könnte vor der gewöhnlichen Ladezeit leer sein"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Energiesparmodus aktiviert, um die Akkulaufzeit zu verlängern"</string>
diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml
index aa2ee69..7427216 100644
--- a/core/res/res/values-el/strings.xml
+++ b/core/res/res/values-el/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Μικρόφωνο"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"εμφανίζεται πάνω σε άλλες εφαρμογές στην οθόνη σας"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Υποβολή σχολίων"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Αυτή η ειδοποίηση προωθήθηκε στις Προεπιλεγμένες. Πατήστε για να υποβάλετε σχόλια."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Αυτή η ειδοποίηση υποβιβάστηκε στις Αθόρυβες. Πατήστε για να υποβάλετε σχόλια."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Αυτή η ειδοποίηση κατατάχθηκε ψηλότερα. Πατήστε για να υποβάλετε σχόλια."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Αυτή η ειδοποίηση κατατάχθηκε χαμηλότερα. Πατήστε για να υποβάλετε σχόλια."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Ειδοποίηση πληροφοριών λειτουργίας Ρουτίνας"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Η μπαταρία μπορεί να εξαντληθεί πριν από τη συνηθισμένη φόρτιση"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Η Εξοικονόμηση μπαταρίας ενεργοποιήθηκε για την επέκταση της διάρκειας ζωής της μπαταρίας"</string>
diff --git a/core/res/res/values-en-rAU/strings.xml b/core/res/res/values-en-rAU/strings.xml
index de5dba2..ae324be 100644
--- a/core/res/res/values-en-rAU/strings.xml
+++ b/core/res/res/values-en-rAU/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Microphone"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"displaying over other apps on your screen"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Provide feedback"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"This notification was promoted to default. Tap to provide feedback."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"This notification was demoted to silent. Tap to provide feedback."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"This notification was ranked higher. Tap to provide feedback."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"This notification was ranked lower. Tap to provide feedback."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Routine Mode info notification"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Battery may run out before usual charge"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Battery Saver activated to extend battery life"</string>
diff --git a/core/res/res/values-en-rCA/strings.xml b/core/res/res/values-en-rCA/strings.xml
index 7bd62aa..630a243 100644
--- a/core/res/res/values-en-rCA/strings.xml
+++ b/core/res/res/values-en-rCA/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Microphone"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"displaying over other apps on your screen"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Provide feedback"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"This notification was promoted to default. Tap to provide feedback."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"This notification was demoted to silent. Tap to provide feedback."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"This notification was ranked higher. Tap to provide feedback."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"This notification was ranked lower. Tap to provide feedback."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Routine Mode info notification"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Battery may run out before usual charge"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Battery Saver activated to extend battery life"</string>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index b21b67d..1a8f5c0 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Microphone"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"displaying over other apps on your screen"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Provide feedback"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"This notification was promoted to default. Tap to provide feedback."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"This notification was demoted to silent. Tap to provide feedback."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"This notification was ranked higher. Tap to provide feedback."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"This notification was ranked lower. Tap to provide feedback."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Routine Mode info notification"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Battery may run out before usual charge"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Battery Saver activated to extend battery life"</string>
diff --git a/core/res/res/values-en-rIN/strings.xml b/core/res/res/values-en-rIN/strings.xml
index 69acec6..6503267 100644
--- a/core/res/res/values-en-rIN/strings.xml
+++ b/core/res/res/values-en-rIN/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Microphone"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"displaying over other apps on your screen"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Provide feedback"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"This notification was promoted to default. Tap to provide feedback."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"This notification was demoted to silent. Tap to provide feedback."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"This notification was ranked higher. Tap to provide feedback."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"This notification was ranked lower. Tap to provide feedback."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Routine Mode info notification"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Battery may run out before usual charge"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Battery Saver activated to extend battery life"</string>
diff --git a/core/res/res/values-en-rXC/strings.xml b/core/res/res/values-en-rXC/strings.xml
index ae57206..0d0b204 100644
--- a/core/res/res/values-en-rXC/strings.xml
+++ b/core/res/res/values-en-rXC/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Microphone"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"displaying over other apps on your screen"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Provide Feedback"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"This notification was promoted to Default. Tap to provide feedback."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"This notification was demoted to Silent. Tap to provide feedback."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"This notification was ranked higher. Tap to provide feedback."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"This notification was ranked lower. Tap to provide feedback."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Routine Mode info notification"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Battery may run out before usual charge"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Battery Saver activated to extend battery life"</string>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index f5bd810..1128479 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Micrófono"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"se superpone a otras apps en tu pantalla"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Enviar comentarios"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Esta notificación ascendió a Predeterminada. Presiona para enviar comentarios."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Esta notificación descendió de a Silenciada. Presiona para enviar comentarios."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Esta notificación recibió una clasificación superior. Presiona para enviar comentarios."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Esta notificación recibió una clasificación inferior. Presiona para enviar comentarios."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Notificación de información del modo de Rutinas"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Es posible que la batería se agote antes de la carga habitual"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Se activó el Ahorro de batería para extender la duración de la batería"</string>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index e234efbf..f23cb1a 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -2009,6 +2009,14 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Micrófono"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"se muestra sobre otras aplicaciones que haya en la pantalla"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Enviar comentarios"</string>
+ <!-- no translation found for notification_feedback_indicator_alerted (6552871804121942099) -->
+ <skip />
+ <!-- no translation found for notification_feedback_indicator_silenced (3799442124723177262) -->
+ <skip />
+ <!-- no translation found for notification_feedback_indicator_promoted (9030204303764698640) -->
+ <skip />
+ <!-- no translation found for notification_feedback_indicator_demoted (8880309924296450875) -->
+ <skip />
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Notificación sobre el modo rutina"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Quizás se agote la batería antes de lo habitual"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Se ha activado el modo Ahorro de batería para aumentar la duración de la batería"</string>
diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml
index 543b5a1..d585452 100644
--- a/core/res/res/values-et/strings.xml
+++ b/core/res/res/values-et/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"teie ekraanil muude rakenduste peal kuvamine"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Andke tagasisidet"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Sellele märguandele määrati prioriteet Vaikimisi. Puudutage tagasiside andmiseks."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Sellele märguandele määrati prioriteet Vaikne. Puudutage tagasiside andmiseks."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Sellele märguandele määrati kõrgem prioriteet. Puudutage tagasiside andmiseks."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Sellele märguandele määrati madalam prioriteet. Puudutage tagasiside andmiseks."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Rutiinirežiimi teabe märguanne"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Aku võib enne tavapärast laadimist tühjaks saada"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Akusäästja aktiveeriti aku tööea pikendamiseks"</string>
diff --git a/core/res/res/values-eu/strings.xml b/core/res/res/values-eu/strings.xml
index c552e8f..9bc37c1 100644
--- a/core/res/res/values-eu/strings.xml
+++ b/core/res/res/values-eu/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofonoa"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"pantailako beste aplikazioen gainean bistaratzen"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Eman iritzia"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Lehenetsi gisa ezarri da jakinarazpena. Sakatu hau iritzia emateko."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Isilarazi da jakinarazpena. Sakatu hau iritzia emateko."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Mailaz igo da jakinarazpena. Sakatu hau iritzia emateko."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Mailaz jaitsi da jakinarazpena. Sakatu hau iritzia emateko."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Ohitura moduaren informazio-jakinarazpena"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Baliteke bateria ohi baino lehenago agortzea"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Bateria-aurrezlea aktibatuta dago bateriaren iraupena luzatzeko"</string>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index 3d523fd..4c75ac5 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -1889,7 +1889,7 @@
<string name="language_selection_title" msgid="52674936078683285">"افزودن زبان"</string>
<string name="country_selection_title" msgid="5221495687299014379">"اولویتهای منطقه"</string>
<string name="search_language_hint" msgid="7004225294308793583">"نام زبان را تایپ کنید"</string>
- <string name="language_picker_section_suggested" msgid="6556199184638990447">"پیشنهادشده"</string>
+ <string name="language_picker_section_suggested" msgid="6556199184638990447">"پیشنهادی"</string>
<string name="language_picker_section_all" msgid="1985809075777564284">"همه زبانها"</string>
<string name="region_picker_section_all" msgid="756441309928774155">"همه منطقهها"</string>
<string name="locale_search_menu" msgid="6258090710176422934">"جستجو"</string>
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"میکروفون"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"نمایش روی برنامههای دیگر در صفحهنمایش"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"ارائه بازخورد"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"این اعلان به «پیشفرض» ارتقا داده شد. برای ارائه بازخورد، ضربه بزنید."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"این اعلان به «بیصدا» تنزل داده شد. برای ارائه بازخورد، ضربه بزنید."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"این اعلان در رتبه بالاتری قرار گرفت. برای ارائه بازخورد، ضربه بزنید."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"این اعلان در رتبه پایینتری قرار گرفت. برای ارائه بازخورد، ضربه بزنید."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"اعلان اطلاعات حالت روال معمول"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"ممکن است شارژ باتری قبل از شارژ معمول تمام شود"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"جهت افزایش عمر باتری، «بهینهسازی باتری» فعال شد"</string>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index 81546d9..93b5ff1 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofoni"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"näkyy näytöllä muiden sovellusten päällä"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Anna palautetta"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Järjestelmä valitsi tämän ilmoituksen oletusarvoiseksi. Lähetä palautetta napauttamalla."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Tämä ilmoitus hiljennettiin. Lähetä palautetta napauttamalla."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Tämän ilmoituksen tasoa nostettiin. Lähetä palautetta napauttamalla."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Tämän ilmoituksen tasoa laskettiin. Lähetä palautetta napauttamalla."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Ohjelmatilan tietoilmoitus"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Akku saattaa loppua ennen normaalia latausaikaa"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Virransäästö otettu käyttöön akunkeston pidentämiseksi"</string>
diff --git a/core/res/res/values-fr-rCA/strings.xml b/core/res/res/values-fr-rCA/strings.xml
index 55e916e..d3329d3 100644
--- a/core/res/res/values-fr-rCA/strings.xml
+++ b/core/res/res/values-fr-rCA/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Microphone"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"superpose du contenu par-dessus d\'autres applications à l\'écran"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Envoyer des commentaires"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"La notification a été automatiquement élevée à la catégorie Par défaut. Touchez pour envoyer des commentaires."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Cette notification a été rétrogradée à Silencieuse. Touchez pour envoyer des commentaires."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Cette notification a été élevée d\'un niveau. Touchez pour envoyer des commentaires."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Cette notification a été abaissée d\'un niveau. Touchez pour envoyer des commentaires."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Notification d\'information du mode Routine"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"La pile pourrait s\'épuiser avant la charge habituelle"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Le mode Économiseur de pile est activé afin de prolonger l\'autonomie"</string>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index 3a0d0cd..6c07066 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Micro"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"se superpose aux autres applications sur l\'écran"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Envoyer des commentaires"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Cette notification a été élevée à la catégorie \"Par défaut\". Appuyez ici pour donner votre avis."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Cette notification a été abaissée à la catégorie \"Silencieux\". Appuyez ici pour donner votre avis."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Cette notification a été élevée d\'un niveau. Appuyez ici pour donner votre avis."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Cette notification a été abaissée d\'un niveau. Appuyez ici pour donner votre avis."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Notification d\'information du mode Routine"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Vous risquez d\'être à court de batterie plus tôt que prévu"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Économiseur de batterie activé pour prolonger l\'autonomie"</string>
diff --git a/core/res/res/values-gl/strings.xml b/core/res/res/values-gl/strings.xml
index 8c21193..cab106a 100644
--- a/core/res/res/values-gl/strings.xml
+++ b/core/res/res/values-gl/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Micrófono"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"mostrando outras aplicacións na pantalla"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Enviar comentarios"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"O nivel desta notificación subiu a Predeterminado. Toca para compartir a túa opinión."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"O nivel desta notificación diminuíu a Silenciosa. Toca para compartir a túa opinión."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Esta notificación clasificouse nun nivel superior. Toca para compartir a túa opinión."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Esta notificación clasificouse nun nivel inferior. Toca para compartir a túa opinión."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Notificación da información do modo de rutina"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"A batería pode esgotarse antes do habitual"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Para ampliar a duración da batería activouse a función Aforro de batería"</string>
diff --git a/core/res/res/values-gu/strings.xml b/core/res/res/values-gu/strings.xml
index 48edb0c..a3c1ec4 100644
--- a/core/res/res/values-gu/strings.xml
+++ b/core/res/res/values-gu/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"માઇક્રોફોન"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"આ તમારી સ્ક્રીન પર અન્ય ઍપની ઉપર દેખાશે"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"પ્રતિસાદ આપો"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"આ નોટિફિકેશનને ડિફૉલ્ટ તરીકે બઢતી આપવામાં આવી. પ્રતિસાદ આપવા માટે ટૅપ કરો."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"નોટિફિકેશનને સાઇલન્ટ પર અવનત કરવામાં આવ્યું. પ્રતિસાદ આપવા માટે ટૅપ કરો."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"આ નોટિફિકેશનને ઉપલી રેંક આપવામાં આવી. પ્રતિસાદ આપવા માટે ટૅપ કરો."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"આ નોટિફિકેશનને નીચલી રેંક આપવામાં આવી. પ્રતિસાદ આપવા માટે ટૅપ કરો."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"રૂટિન મોડની માહિતીનું નોટિફિકેશન"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"સામાન્ય રીતે ચાર્જ કરવાના સમય પહેલાં બૅટરી સમાપ્ત થઈ શકે છે"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"બૅટરી આવરદા વધારવા માટે બૅટરી સેવર ચાલુ કર્યું"</string>
diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml
index e63e502..7fb27f1 100644
--- a/core/res/res/values-hi/strings.xml
+++ b/core/res/res/values-hi/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"माइक्रोफ़ोन"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"आपकी स्क्रीन पर, इस्तेमाल हो रहे दूसरे ऐप्लिकेशन के ऊपर दिखाया जा रहा है"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"सुझाव दें या शिकायत करें"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"यह सूचना अब आपको, डिफ़ॉल्ट रूप से आवाज़ या वाइब्रेशन के साथ मिलेगी. सुझाव/शिकायत/राय देने के लिए टैप करें."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"इस सूचना के मिलने पर होने वाली आवाज़ बंद कर दी गई है. सुझाव/शिकायत/राय देने के लिए टैप करें."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"इस सूचना को रैंकिंग में ऊपर किया गया था. सुझाव/शिकायत/राय देने के लिए टैप करें."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"इस सूचना को रैंकिंग में नीचे किया गया था. सुझाव/शिकायत/राय देने के लिए टैप करें."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"रूटीन मोड जानकारी की सूचना"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"बैटरी आम तौर पर जितने समय चलती है, उससे पहले खत्म हो सकती है"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"बैटरी लाइफ़ बढ़ाने के लिए \'बैटरी सेवर\' चालू हो गया है"</string>
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index 45c89a6..af282c0 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -2042,6 +2042,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"prikazuje se preko drugih aplikacija na zaslonu"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Slanje povratnih informacija"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Obavijest je promovirana u zadanu. Dodirnite da biste poslali povratne informacije."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Obavijest je degradirana u bešumnu. Dodirnite da biste poslali povratne informacije."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Obavijest je više rangirana. Dodirnite da biste poslali povratne informacije."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Obavijest je niže rangirana. Dodirnite da biste poslali povratne informacije."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Obavještavanje o informacijama u Rutinskom načinu rada"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Baterija se može isprazniti prije uobičajenog vremena punjenja"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Štednja baterije aktivirana je kako bi se produljilo trajanje baterije"</string>
diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml
index 9525801..551043e 100644
--- a/core/res/res/values-hu/strings.xml
+++ b/core/res/res/values-hu/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"megjelenítés a képernyőn lévő egyéb alkalmazások előtt"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Visszajelzés küldése"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Ezt az értesítést alapértelmezettre állította a rendszer. Visszajelzés küldéséhez koppintson ide."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Ezt az értesítést némára állította a rendszer. Visszajelzés küldéséhez koppintson ide."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Ezt az értesítést előrébb sorolta a rendszer. Visszajelzés küldéséhez koppintson ide."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Ezt az értesítést hátrébb sorolta a rendszer. Visszajelzés küldéséhez koppintson ide."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Információs értesítés a rutinmódról"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Előfordulhat, hogy az akkumulátor lemerül a szokásos töltési időszak előtt"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Akkumulátorkímélő mód aktiválva az akkumulátor üzemidejének növelése érdekében"</string>
diff --git a/core/res/res/values-hy/strings.xml b/core/res/res/values-hy/strings.xml
index b28e5fd..f08c7f9 100644
--- a/core/res/res/values-hy/strings.xml
+++ b/core/res/res/values-hy/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Խոսափող"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"ցուցադրվում է մյուս հավելվածների վրայից"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Կարծիք հայտնել"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Այս ծանուցման կարևորության մակարդակը բարձրացվել է և դարձել կանխադրված։ Հպեք՝ կարծիք հայտնելու համար։"</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Այս ծանուցման կարևորության մակարդակը իջեցվել է և դարձել անձայն։ Հպեք՝ կարծիք հայտնելու համար։"</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Այս ծանուցման կարևորության մակարդակը բարձրացվել է։ Հպեք՝ կարծիք հայտնելու համար։"</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Այս ծանուցման կարևորության մակարդակն իջեցվել է։ Հպեք՝ կարծիք հայտնելու համար։"</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Ծանուցում լիցքավորման մասին"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Մարտկոցը կարող է սովորականից շուտ սպառվել"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Մարտկոցի կյանքը երկարացնելու համար ակտիվացվել է մարտկոցի տնտեսման ռեժիմը"</string>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index e6b4977..a7a7cb8 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"ditampilkan di atas aplikasi lain di layar"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Beri Masukan"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Notifikasi ini dipromosikan menjadi Default. Ketuk untuk memberikan masukan."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Notifikasi ini didemosikan menjadi Senyap. Ketuk untuk memberikan masukan."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Notifikasi ini diberi peringkat lebih tinggi. Ketuk untuk memberikan masukan."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Notifikasi ini diberi peringkat lebih rendah. Ketuk untuk memberikan masukan."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Notifikasi info Mode Rutinitas"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Baterai mungkin habis sebelum pengisian daya biasanya"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Penghemat Baterai diaktifkan untuk memperpanjang masa pakai baterai"</string>
diff --git a/core/res/res/values-is/strings.xml b/core/res/res/values-is/strings.xml
index 867fca8..2ca613c 100644
--- a/core/res/res/values-is/strings.xml
+++ b/core/res/res/values-is/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Hljóðnemi"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"birt yfir öðrum forritum á skjánum"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Senda ábendingar"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Stig þessarar tilkynningar var hækkað í sjálfgefið. Ýttu til að senda ábendingu."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Þessi tilkynning var gerð þögul. Ýttu til að senda ábendingu."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Þessi tilkynning fékk hærri stöðu. Ýttu til að senda ábendingu."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Þessi tilkynning fékk lægri stöðu. Ýttu til að senda ábendingu."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Upplýsingatilkynning aðgerðastillingar"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Rafhlaðan kann að tæmast áður en hún kemst í hleðslu"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Kveikt á rafhlöðusparnaði til að lengja endingu rafhlöðunnar"</string>
diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml
index 6f2e158..4f7eea8 100644
--- a/core/res/res/values-it/strings.xml
+++ b/core/res/res/values-it/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Microfono"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"si sovrappone ad altre app sullo schermo"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Fornisci feedback"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Questa notifica è stata promossa a Predefinita. Tocca per dare un feedback."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Questa notifica è stata retrocessa a Silenziosa. Tocca per dare un feedback."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Questa notifica è stata posizionata più in alto. Tocca per dare un feedback."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Questa notifica è stata posizionata più in basso. Tocca per dare un feedback."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Notifica di informazioni sulla modalità Routine"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"La batteria potrebbe esaurirsi prima della ricarica abituale"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Risparmio energetico attivo per far durare di più la batteria"</string>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index 2846508..5672f46 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -2075,6 +2075,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"מיקרופון"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"תצוגה מעל אפליקציות אחרות במסך"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"שליחת משוב"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"ההתראה הזו שודרגה ל\'ברירת מחדל\'. יש להקיש כדי לשלוח משוב."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"ההתראה הזו הורדה בדרגה ל\'שקטה\'. יש להקיש כדי לשלוח משוב."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"דירוג ההתראה הזו הוגבה. יש להקיש כדי לשלוח משוב."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"דירוג ההתראה הזו הונמך. יש להקיש כדי לשלוח משוב."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"התראת מידע לגבי מצב שגרתי"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"הסוללה עלולה להתרוקן לפני המועד הרגיל של הטעינה"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"תכונת החיסכון בסוללה הופעלה כדי להאריך את חיי הסוללה"</string>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index c6e8a14..658237d 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"マイク"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"画面の他のアプリの上に重ねて表示"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"フィードバックを送信"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"この通知の重要度がデフォルトに上がりました。タップしてフィードバックをお送りください。"</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"この通知の重要度がサイレントに下がりました。タップしてフィードバックをお送りください。"</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"この通知の重要度が上がりました。タップしてフィードバックをお送りください。"</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"この通知の重要度が下がりました。タップしてフィードバックをお送りください。"</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"ルーティン モード情報の通知"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"通常の充電を行う前に電池が切れる可能性があります"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"電池を長持ちさせるため、バッテリー セーバーが有効になりました"</string>
diff --git a/core/res/res/values-ka/strings.xml b/core/res/res/values-ka/strings.xml
index 912930f..6d9c12b 100644
--- a/core/res/res/values-ka/strings.xml
+++ b/core/res/res/values-ka/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"მიკროფონი"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"სხვა აპების გადაფარვით ჩანს თქვენს ეკრანზე"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"გამოხმაურება"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"ეს შეტყობინება დაწინაურდა და გახდა „ნაგულისხმევი“. შეეხეთ გამოხმაურების მოსაწოდებლად."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"ეს შეტყობინება ჩამოქვეითდა და გახდა „ჩუმი“. შეეხეთ გამოხმაურების მოსაწოდებლად."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"ეს შეტყობინება დაწინაურდა. შეეხეთ გამოხმაურების მოსაწოდებლად."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"ეს შეტყობინება ჩამოქვეითდა. შეეხეთ გამოხმაურების მოსაწოდებლად."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"რუტინის რეჟიმის საინფორმაციო შეტყობინება"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"ბატარეა შეიძლება დაჯდეს დატენის ჩვეულ დრომდე"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"ბატარეის დამზოგი გააქტიურდა ბატარეის მუშაობის გასახანგრძლივლებლად"</string>
diff --git a/core/res/res/values-kk/strings.xml b/core/res/res/values-kk/strings.xml
index d615538..d57aca5 100644
--- a/core/res/res/values-kk/strings.xml
+++ b/core/res/res/values-kk/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Микрофон"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"экранда басқа қолданбалардың үстінен көрсету"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Пікір білдіру"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Бұл хабарландырудың маңыздылық деңгейі \"Әдепкі\" санатына көтерілді. Пікір қалдыру үшін түртіңіз."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Бұл хабарландырудың маңыздылық деңгейі \"Үнсіз\" санатына төмендетілді. Пікір қалдыру үшін түртіңіз."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Бұл хабарландырудың маңыздылық деңгейі көтерілді. Пікір қалдыру үшін түртіңіз."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Бұл хабарландырудың маңыздылық деңгейі төмендетілді. Пікір қалдыру үшін түртіңіз."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Режим туралы хабарландыру"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Батарея заряды азаюы мүмкін"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Батарея ұзаққа жетуі үшін, Battery Saver іске қосылды"</string>
diff --git a/core/res/res/values-km/strings.xml b/core/res/res/values-km/strings.xml
index 075a652..362b7c0 100644
--- a/core/res/res/values-km/strings.xml
+++ b/core/res/res/values-km/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"មីក្រូហ្វូន"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"កំពុងបង្ហាញពីលើកម្មវិធីផ្សេងទៀតនៅលើអេក្រង់របស់អ្នក"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"ផ្ដល់មតិកែលម្អ"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"ការជូនដំណឹងនេះត្រូវបានដំឡើងតំណែងទៅលំនាំដើម។ សូមចុចដើម្បីផ្ដល់មតិកែលម្អ។"</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"ការជូនដំណឹងនេះត្រូវបានបន្ទាបតំណែងទៅស្ងាត់។ សូមចុចដើម្បីផ្ដល់មតិកែលម្អ។"</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"ការជូនដំណឹងនេះត្រូវបានចាត់ថ្នាក់ខ្ពស់ជាងមុន។ សូមចុចដើម្បីផ្ដល់មតិកែលម្អ។"</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"ការជូនដំណឹងនេះត្រូវបានចាត់ថ្នាក់ទាបជាងមុន។ សូមចុចដើម្បីផ្ដល់មតិកែលម្អ។"</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"ការជូនដំណឹងព័ត៌មានរបស់មុខងារទម្លាប់"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"ថ្មអាចនឹងអស់ មុនពេលសាកថ្មធម្មតា"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"បានបើកដំណើរការមុខងារសន្សំថ្ម ដើម្បីបង្កើនកម្រិតថាមពលថ្ម"</string>
diff --git a/core/res/res/values-kn/strings.xml b/core/res/res/values-kn/strings.xml
index 61ed9b3..937645e 100644
--- a/core/res/res/values-kn/strings.xml
+++ b/core/res/res/values-kn/strings.xml
@@ -353,10 +353,8 @@
<string name="permdesc_receiveMms" msgid="958102423732219710">"MMS ಸಂದೇಶಗಳನ್ನು ಸ್ವೀಕರಿಸಲು ಮತ್ತು ಪ್ರಕ್ರಿಯೆಗೊಳಿಸಲು ಅಪ್ಲಿಕೇಶನ್ಗೆ ಅವಕಾಶ ಮಾಡಿಕೊಡುತ್ತದೆ. ಇದರರ್ಥ, ನಿಮ್ಮ ಸಾಧನಕ್ಕೆ ಕಳುಹಿಸಲಾಗಿರುವ ಸಂದೇಶಗಳನ್ನು ನಿಮಗೆ ತೋರಿಸದೆಯೇ, ಅಪ್ಲಿಕೇಶನ್ ಅವುಗಳನ್ನು ಮಾನಿಟರ್ ಮಾಡಬಹುದು ಅಥವಾ ಅಳಿಸಬಹುದು."</string>
<string name="permlab_bindCellBroadcastService" msgid="586746677002040651">"ಸೆಲ್ ಪ್ರಸಾರ ಸಂದೇಶಗಳನ್ನು ಫಾರ್ವರ್ಡ್ ಮಾಡಿ"</string>
<string name="permdesc_bindCellBroadcastService" msgid="6540910200973641606">"ಸೆಲ್ ಪ್ರಸಾರವು ಸಂದೇಶಗಳನ್ನು ಸ್ವೀಕರಿಸಿದ ರೀತಿಯಲ್ಲಿಯೇ ಫಾರ್ವರ್ಡ್ ಮಾಡಲು, ಸೆಲ್ ಪ್ರಸಾರ ಮಾಡ್ಯುಲ್ ಅನ್ನು ಪ್ರತಿಬಂಧಿಸಲು ಆ್ಯಪ್ಗೆ ಅನುಮತಿಸುತ್ತದೆ. ಕೆಲವು ಸ್ಥಳಗಳಲ್ಲಿ ತುರ್ತು ಸ್ಥಿತಿಗಳ ಕುರಿತು ನಿಮಗೆ ಎಚ್ಚರಿಸಲು ಸೆಲ್ ಪ್ರಸಾರದ ಎಚ್ಚರಿಕೆಗಳನ್ನು ಕಳುಹಿಸಲಾಗುತ್ತದೆ. ತುರ್ತು ಸೆಲ್ ಪ್ರಸಾರವನ್ನು ಸ್ವೀಕರಿಸಿದಾಗ ನಿಮ್ಮ ಸಾಧನದ ಕಾರ್ಯಾಚರಣೆ ಅಥವಾ ಕಾರ್ಯಕ್ಷಮತೆಗೆ ದುರುದ್ದೇಶಪೂರಿತ ಆ್ಯಪ್ಗಳು ಹಸ್ತಕ್ಷೇಪ ಮಾಡಬಹುದು."</string>
- <!-- no translation found for permlab_manageOngoingCalls (281244770664231782) -->
- <skip />
- <!-- no translation found for permdesc_manageOngoingCalls (7003138133829915265) -->
- <skip />
+ <string name="permlab_manageOngoingCalls" msgid="281244770664231782">"ಚಾಲ್ತಿಯಲ್ಲಿರುವ ಕರೆಗಳನ್ನು ನಿರ್ವಹಿಸಿ"</string>
+ <string name="permdesc_manageOngoingCalls" msgid="7003138133829915265">"ನಿಮ್ಮ ಸಾಧನದಲ್ಲಿನ ಚಾಲ್ತಿಯಲ್ಲಿರುವ ಕರೆಗಳ ಕುರಿತಾದ ವಿವರಗಳನ್ನು ನೋಡಲು ಮತ್ತು ಆ ಕರೆಗಳನ್ನು ನಿಯಂತ್ರಿಸಲು ಆ್ಯಪ್ ಒಂದಕ್ಕೆ ಅನುಮತಿಸುತ್ತದೆ."</string>
<string name="permlab_readCellBroadcasts" msgid="5869884450872137693">"ಸೆಲ್ ಪ್ರಸಾರದ ಸಂದೇಶಗಳನ್ನು ಓದಿರಿ"</string>
<string name="permdesc_readCellBroadcasts" msgid="672513437331980168">"ನಿಮ್ಮ ಸಾಧನದಿಂದ ಸ್ವೀಕರಿಸಿದ ಸೆಲ್ ಪ್ರಸಾರ ಸಂದೇಶಗಳನ್ನು ರೀಡ್ ಮಾಡಲು ಅಪ್ಲಿಕೇಶನ್ಗೆ ಅನುಮತಿಸುತ್ತದೆ. ಸೆಲ್ ಪ್ರಸಾರ ಎಚ್ಚರಿಕೆಗಳನ್ನು ತುರ್ತು ಸಂದರ್ಭಗಳಲ್ಲಿ ನಿಮಗೆ ಎಚ್ಚರಿಸುವ ಸಲುವಾಗಿ ಕೆಲವು ಸ್ಥಳಗಳಲ್ಲಿ ವಿತರಿಸಲಾಗುತ್ತದೆ. ದುರುದ್ದೇಶಪೂರಿತ ಅಪ್ಲಿಕೇಶನ್ಗಳು ತುರ್ತು ಸೆಲ್ ಪ್ರಸಾರವನ್ನು ಸ್ವೀಕರಿಸುವಾಗ, ನಿಮ್ಮ ಸಾಧನದ ಕಾರ್ಯಕ್ಷಮತೆ ಇಲ್ಲವೇ ಕಾರ್ಯಾಚರಣೆಯಲ್ಲಿ ಹಸ್ತಕ್ಷೇಪ ಮಾಡಬಹುದು."</string>
<string name="permlab_subscribedFeedsRead" msgid="217624769238425461">"ಚಂದಾದಾರ ಫೀಡ್ಗಳನ್ನು ಓದಿ"</string>
@@ -2011,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"ಮೈಕ್ರೋಫೋನ್"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"ನಿಮ್ಮ ಸ್ಕ್ರೀನ್ನಲ್ಲಿ ಇತರ ಅಪ್ಲಿಕೇಶನ್ಗಳ ಮೂಲಕ ಪ್ರದರ್ಶಿಸಲಾಗುತ್ತಿದೆ"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"ಪ್ರತಿಕ್ರಿಯೆ ಒದಗಿಸಿ"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"ಈ ಅಧಿಸೂಚನೆಯು ಡೀಫಾಲ್ಟ್ಗೆ ಬಡ್ತಿ ಹೊಂದಿದೆ. ಪ್ರತಿಕ್ರಿಯೆ ನೀಡಲು ಟ್ಯಾಪ್ ಮಾಡಿ."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"ಈ ಅಧಿಸೂಚನೆಗೆ ಸೈಲೆಂಟ್ಗೆ ಹಿಂಬಡ್ತಿ ನೀಡಲಾಗಿದೆ. ಪ್ರತಿಕ್ರಿಯೆ ನೀಡಲು ಟ್ಯಾಪ್ ಮಾಡಿ."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"ಈ ಅಧಿಸೂಚನೆಗೆ ಮೇಲಿನ ಸ್ಥಾನವನ್ನು ನೀಡಲಾಗಿದೆ. ಪ್ರತಿಕ್ರಿಯೆ ನೀಡಲು ಟ್ಯಾಪ್ ಮಾಡಿ."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"ಈ ಅಧಿಸೂಚನೆಗೆ ಕೆಳಗಿನ ಸ್ಥಾನವನ್ನು ನೀಡಲಾಗಿದೆ. ಪ್ರತಿಕ್ರಿಯೆ ನೀಡಲು ಟ್ಯಾಪ್ ಮಾಡಿ."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"ದೈನಂದಿನ ಸ್ಥಿತಿಯ ಮಾಹಿತಿಯ ಅಧಿಸೂಚನೆ"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"ಚಾರ್ಜ್ಗೆ ಮೊದಲೆ ಬ್ಯಾಟರಿ ಮುಗಿದು ಬಿಡಬಹುದು"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"ಬ್ಯಾಟರಿ ಅವಧಿ ಹೆಚ್ಚಿಸಲು ಬ್ಯಾಟರಿ ಸೇವರ್ ಸಕ್ರಿಯಗೊಳಿಸಲಾಗಿದೆ"</string>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index b20a427..31837a3 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"마이크"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"화면에서 다른 앱 위에 표시"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"의견 보내기"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"이 알림의 중요도가 기본으로 상향되었습니다. 의견을 보내려면 탭하세요."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"이 알림의 중요도가 무음으로 하향되었습니다. 의견을 보내려면 탭하세요."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"이전에 이 알림의 중요도는 더 높았습니다. 의견을 보내려면 탭하세요."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"이전에 이 알림의 중요도는 더 낮았습니다. 의견을 보내려면 탭하세요."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"루틴 모드 정보 알림"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"평소에 충전하는 시간 전에 배터리가 소진될 수 있습니다."</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"배터리 수명을 연장하기 위해 배터리 세이버가 활성화되었습니다."</string>
diff --git a/core/res/res/values-ky/strings.xml b/core/res/res/values-ky/strings.xml
index 1e8b38b..4211bed 100644
--- a/core/res/res/values-ky/strings.xml
+++ b/core/res/res/values-ky/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Микрофон"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"экрандагы башка терезелердин үстүнөн көрсөтүлүүдө"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Пикир билдирүү"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Бул билдирменин маанилүүлүгү Демейки болуп жогорулатылды. Пикир билдирүү үчүн таптап коюңуз."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Бул билдирменин маанилүүлүгү Үнсүз болуп төмөндөтүлдү. Пикир билдирүү үчүн таптап коюңуз."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Бул билдирменин маанилүүлүгү жогорулатылды. Пикир билдирүү үчүн таптап коюңуз."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Бул билдирменин маанилүүлүгү төмөндөтүлдү. Пикир билдирүү үчүн таптап коюңуз."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Режимдин адаттагы билдирмеси"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Батарея кубаттоого чейин отуруп калышы мүмкүн"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Батареянын отуруп калбашы үчүн Батареяны үнөмдөгүч режими иштетилди"</string>
diff --git a/core/res/res/values-lo/strings.xml b/core/res/res/values-lo/strings.xml
index c60d594..0646254 100644
--- a/core/res/res/values-lo/strings.xml
+++ b/core/res/res/values-lo/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"ໄມໂຄຣໂຟນ"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"ສະແດງຜົນບັງແອັບອື່ນຢູ່ໜ້າຈໍຂອງທ່ານ"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"ສົ່ງຄຳຕິຊົມ"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"ການຕັ້ງຄ່ານີ້ຖືກເລື່ອນລະດັບເປັນຄ່າເລີ່ມຕົ້ນແລ້ວ. ແຕະເພື່ອສົ່ງຄຳຕິຊົມ."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"ການແຈ້ງເຕືອນນີ້ຖືກຫຼຸດລະດັບເປັນປິດສຽງແລ້ວ. ແຕະເພື່ອສົ່ງຄຳຕິຊົມ."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"ການແຈ້ງເຕືອນນີ້ຖືກເລື່ອນລະດັບຂຶ້ນແລ້ວ. ແຕະເພື່ອສົ່ງຄຳຕິຊົມ."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"ການແຈ້ງເຕືອນນີ້ຖືກຫຼຸດລະດັບລົງແລ້ວ. ແຕະເພື່ອສົ່ງຄຳຕິຊົມ."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"ການແຈ້ງເຕືອນຂໍ້ມູນໂໝດກິດຈະວັດປະຈຳວັນ"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"ແບັດເຕີຣີອາດໝົດກ່ອນການສາກຕາມປົກກະຕິ"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"ເປີດຕົວປະຢັດແບັດເຕີຣີເພື່ອຂະຫຍາຍອາຍຸແບັດເຕີຣີ"</string>
diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml
index 39cbbe1..d83506e 100644
--- a/core/res/res/values-lt/strings.xml
+++ b/core/res/res/values-lt/strings.xml
@@ -2075,6 +2075,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofonas"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"rodo virš kitų programų jūsų ekrane"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Pateikti atsiliepimą"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Šio pranešimo svarba padidinta iki numatytojo lygio. Palieskite, kad pateiktumėte atsiliepimą."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Šio pranešimo svarba sumažinta iki begarsio lygio. Palieskite, kad pateiktumėte atsiliepimą."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Šio pranešimo svarba padidinta. Palieskite, kad pateiktumėte atsiliepimą."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Šio pranešimo svarba sumažinta. Palieskite, kad pateiktumėte atsiliepimą."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Veiksmų sekos režimo informacijos pranešimas"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Akumuliatoriaus energija gali išsekti prieš įprastą įkrovimą"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Akumuliatoriaus tausojimo priemonė suaktyvinta, kad akumuliatorius veiktų ilgiau"</string>
diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml
index edc8728..68609ce 100644
--- a/core/res/res/values-lv/strings.xml
+++ b/core/res/res/values-lv/strings.xml
@@ -2042,6 +2042,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofons"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"rāda pāri citām lietotnēm jūsu ekrānā"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Sniegt atsauksmes"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Šī paziņojuma svarīgums tika paaugstināts līdz noklusējumam. Lai sniegtu atsauksmes, pieskarieties."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Šī paziņojuma svarīgums tika pazemināts, un paziņojums tiks rādīts bez skaņas. Lai sniegtu atsauksmes, pieskarieties."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Šī paziņojuma rangs tika paaugstināts. Lai sniegtu atsauksmes, pieskarieties."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Šī paziņojuma rangs tika pazemināts. Lai sniegtu atsauksmes, pieskarieties."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Informatīvs paziņojums par akumulatoru"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Akumulators var izlādēties pirms parastā uzlādes laika"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Aktivizēts akumulatora enerģijas taupīšanas režīms, lai palielinātu akumulatora darbības ilgumu"</string>
diff --git a/core/res/res/values-mk/strings.xml b/core/res/res/values-mk/strings.xml
index 63375f5..c41b56c 100644
--- a/core/res/res/values-mk/strings.xml
+++ b/core/res/res/values-mk/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Микрофон"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"се прикажува преку други апликации на вашиот екран"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Испратете повратни информации"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Приоритетноста на известувањево е зголемена на „Стандардно“. Допрете за да дадете повратни информации."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Приоритетноста на известувањево е намалена на „Тивко“. Допрете за да дадете повратни информации."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Известувањево е рангирано повисоко. Допрете за да дадете повратни информации."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Известувањево е рангирано пониско. Допрете за да дадете повратни информации."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Известување за информации за режимот за рутини"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Батеријата може да се потроши пред вообичаеното време за полнење"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Активиран е „Штедачот на батерија“ за да се продолжи траењето на батеријата"</string>
diff --git a/core/res/res/values-ml/strings.xml b/core/res/res/values-ml/strings.xml
index a027b4c..e7a1628 100644
--- a/core/res/res/values-ml/strings.xml
+++ b/core/res/res/values-ml/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"മൈക്രോഫോൺ"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"നിങ്ങളുടെ സ്ക്രീനിലെ മറ്റ് ആപ്പുകൾക്ക് മുകളിൽ പ്രദർശിപ്പിക്കുന്നു"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"ഫീഡ്ബാക്ക് നൽകുക"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"ഈ അറിയിപ്പിനെ ഡിഫോൾട്ടാക്കി പ്രമോട്ട് ചെയ്തു. ഫീഡ്ബാക്ക് നൽകാൻ ടാപ്പ് ചെയ്യുക."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"ഈ അറിയിപ്പിനെ നിശബ്ദമാക്കി തരം താഴ്ത്തി. ഫീഡ്ബാക്ക് നൽകാൻ ടാപ്പ് ചെയ്യുക."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"ഈ അറിയിപ്പിന് ഉയർന്ന റാങ്ക് നൽകി. ഫീഡ്ബാക്ക് നൽകാൻ ടാപ്പ് ചെയ്യുക."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"ഈ അറിയിപ്പിന് താഴ്ന്ന റാങ്ക് നൽകി. ഫീഡ്ബാക്ക് നൽകാൻ ടാപ്പ് ചെയ്യുക."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"ദിനചര്യ മോഡ് വിവരത്തെ കുറിച്ചുള്ള അറിയിപ്പ്"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"സാധാരണയുള്ളതിലും നേരത്തെ ബാറ്ററിയുടെ ചാർജ് തീർന്നേക്കാം"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"ബാറ്ററി ലൈഫ് വര്ദ്ധിപ്പിക്കാൻ, ബാറ്ററി ലാഭിക്കൽ സജീവമാക്കി"</string>
diff --git a/core/res/res/values-mn/strings.xml b/core/res/res/values-mn/strings.xml
index 366a5b7..2966035 100644
--- a/core/res/res/values-mn/strings.xml
+++ b/core/res/res/values-mn/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Микрофон"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"таны дэлгэцэд бусад аппын дээр харуулж байна"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Санал хүсэлт өгөх"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Энэ мэдэгдлийг Өгөгдмөл болгож дэвшүүлсэн байна. Санал хүсэлт өгөхийн тулд товшино уу."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Энэ мэдэгдлийг Чимээгүй болгож зэргийг нь бууруулсан байна. Санал хүсэлт өгөхийн тулд товшино уу."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Энэ мэдэгдлийг дээгүүр зэрэглэсэн байна. Санал хүсэлт өгөхийн тулд товшино уу."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Энэ мэдэгдлийг доогуур зэрэглэсэн байна. Санал хүсэлт өгөхийн тулд товшино уу."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Хэвшлийн горимын мэдээллийн мэдэгдэл"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Батарей ихэвчлэн цэнэглэдэг хугацаанаас өмнө дуусаж болзошгүй"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Батарейн ажиллах хугацааг уртасгахын тулд Батарей хэмнэгчийг идэвхжүүллээ"</string>
diff --git a/core/res/res/values-mr/strings.xml b/core/res/res/values-mr/strings.xml
index 197797f..14615fb 100644
--- a/core/res/res/values-mr/strings.xml
+++ b/core/res/res/values-mr/strings.xml
@@ -353,10 +353,8 @@
<string name="permdesc_receiveMms" msgid="958102423732219710">"MMS मेसेज प्राप्त करण्यास आणि त्यावर प्रक्रिया करण्यास अॅप ला अनुमती देते. म्हणजेच अॅप आपल्या डिव्हाइसवर पाठविलेले मेसेज तुम्हाला न दर्शवता त्यांचे परीक्षण करू किंवा ते हटवू शकतो."</string>
<string name="permlab_bindCellBroadcastService" msgid="586746677002040651">"सेल प्रसारण मेसेज फॉरवर्ड करा"</string>
<string name="permdesc_bindCellBroadcastService" msgid="6540910200973641606">"सेल प्रसारण मेसेज मिळाल्यानंतर ते फॉरवर्ड करण्यासाठी ॲपला सेल प्रसारण मॉड्यूलमध्ये प्रतिबद्ध करण्याची अनुमती देते. काही स्थानांमध्ये तुम्हाला आणीबाणीच्या परिस्थीतींची चेतावणी देण्यासाठी सेल प्रसारण सूचना वितरित केल्या जातात. दुर्भावनापूर्ण अॅप्स आणीबाणी सेल प्रसारण मिळवतात तेव्हा ती तुमच्या डिव्हाइसच्या परफॉर्मन्समध्ये किंवा कामामध्ये कदाचित व्यत्यय आणू शकतात."</string>
- <!-- no translation found for permlab_manageOngoingCalls (281244770664231782) -->
- <skip />
- <!-- no translation found for permdesc_manageOngoingCalls (7003138133829915265) -->
- <skip />
+ <string name="permlab_manageOngoingCalls" msgid="281244770664231782">"सुरू असलेले कॉल व्यवस्थापित करा"</string>
+ <string name="permdesc_manageOngoingCalls" msgid="7003138133829915265">"ॲपला तुमच्या डिव्हाइसवर सुरू असलेल्या कॉलचे तपशील पाहण्याची आणि या कॉलना नियंत्रित करण्याची अनुमती द्या."</string>
<string name="permlab_readCellBroadcasts" msgid="5869884450872137693">"सेल प्रसारण मेसेज वाचा"</string>
<string name="permdesc_readCellBroadcasts" msgid="672513437331980168">"आपल्या डिव्हाइसद्वारे प्राप्त केलेले सेल प्रसारण मेसेज वाचण्यासाठी अॅप ला अनुमती देते. काही स्थानांमध्ये तुम्हाला आणीबाणीच्या परिस्थितीची चेतावणी देण्यासाठी सेल प्रसारण सूचना वितरीत केल्या जातात. आणीबाणी सेल प्रसारण प्राप्त होते तेव्हा आपल्या डिव्हाइसच्या कार्यप्रदर्शनात किंवा कार्यात दुर्भावनापूर्ण अॅप्स व्यत्यय आणू शकतात."</string>
<string name="permlab_subscribedFeedsRead" msgid="217624769238425461">"सदस्यता घेतलेली फीड वाचा"</string>
@@ -2011,6 +2009,14 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"मायक्रोफोन"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"तुमच्या स्क्रीनवर इतर ॲप्सवर डिस्प्ले करत आहे"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"फीडबॅक द्या"</string>
+ <!-- no translation found for notification_feedback_indicator_alerted (6552871804121942099) -->
+ <skip />
+ <!-- no translation found for notification_feedback_indicator_silenced (3799442124723177262) -->
+ <skip />
+ <!-- no translation found for notification_feedback_indicator_promoted (9030204303764698640) -->
+ <skip />
+ <!-- no translation found for notification_feedback_indicator_demoted (8880309924296450875) -->
+ <skip />
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"दिनक्रम मोडची माहिती सूचना"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"चार्जिंगची सामान्य पातळी गाठेपर्यंत कदाचित बॅटरी संपू शकते"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"बॅटरी लाइफ वाढवण्यासाठी बॅटरी सेव्हर सुरू केला आहे"</string>
diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml
index 705ab6b..f45f32e25 100644
--- a/core/res/res/values-ms/strings.xml
+++ b/core/res/res/values-ms/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"dipaparkan di atas apl lain pada skrin anda"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Berikan Maklum Balas"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Pemberitahuan ini telah dinaik taraf menjadi Lalai. Ketik untuk memberikan maklum balas."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Pemberitahuan ini telah diturun taraf kepada Senyap. Ketik untuk memberikan maklum balas."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Pemberitahuan ini berada di kedudukan lebih tinggi. Ketik untuk memberikan maklum balas."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Pemberitahuan ini berada di kedudukan lebih rendah. Ketik untuk memberikan maklum balas."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Pemberitahuan maklumat Mod Rutin"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Bateri mungkin habis sebelum pengecasan biasa"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Penjimat Bateri diaktifkan untuk memanjangkan hayat bateri"</string>
diff --git a/core/res/res/values-my/strings.xml b/core/res/res/values-my/strings.xml
index 96d4417..0cc4d8e 100644
--- a/core/res/res/values-my/strings.xml
+++ b/core/res/res/values-my/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"မိုက်ခရိုဖုန်း"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"သင့်မျက်နှာပြင်ပေါ်ရှိ အခြားအက်ပ်များပေါ်တွင် ပြသခြင်း"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"အကြံပြုချက် ပေးရန်"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"ဤအကြောင်းကြားချက်ကို \'မူရင်း\' သို့ ချိန်ညှိထားသည်။ အကြံပြုချက်ပေးရန် တို့ပါ။"</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"ဤအကြောင်းကြားချက်ကို \'အသံတိတ်ခြင်း\' သို့ ပြန်ချိန်ညှိထားသည်။ အကြံပြုချက်ပေးရန် တို့ပါ။"</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"ဤအကြောင်းကြားချက်ကို အဆင့်တိုးထားသည်။ အကြံပြုချက်ပေးရန် တို့ပါ။"</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"ဤအကြောင်းကြားချက်ကို အဆင့်လျှော့ထားသည်။ အကြံပြုချက်ပေးရန် တို့ပါ။"</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"ပုံမှန်မုဒ်အတွက် အချက်အလက်ပြသည့် အကြောင်းကြားချက်"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"ပုံမှန်အားသွင်းမှုမပြုလုပ်မီ ဘက်ထရီကုန်သွားနိုင်သည်"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"ဘက်ထရီသက်တမ်းကို တိုးမြှင့်ရန် \'ဘက်ထရီအားထိန်း\' စတင်ပြီးပါပြီ"</string>
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index c85626f..601c6fb 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"vises over andre apper på skjermen"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Gi tilbakemelding"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Dette varselet ble oppgradert til standard. Trykk for å gi tilbakemelding."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Dette varselet ble nedgradert til lydløst. Trykk for å gi tilbakemelding."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Dette varselet ble rangert høyere. Trykk for å gi tilbakemelding."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Dette varselet ble rangert lavere. Trykk for å gi tilbakemelding."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Varsel med informasjon om rutinemodus"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Batteriet kan gå tomt før den vanlige ladingen"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Batterisparing er aktivert for å forlenge batterilevetiden"</string>
diff --git a/core/res/res/values-ne/strings.xml b/core/res/res/values-ne/strings.xml
index d1ae9ab..90d4d84 100644
--- a/core/res/res/values-ne/strings.xml
+++ b/core/res/res/values-ne/strings.xml
@@ -353,10 +353,8 @@
<string name="permdesc_receiveMms" msgid="958102423732219710">"एपलाई MMS सन्देशहरू प्राप्त गर्न र प्रकृया गर्न अनुमति दिन्छ। यसको मतलब अनुप्रयोगले तपाईंको उपकरणमा पठाइएको सन्देशहरू तपाईंलाई नदेखाईनै मोनिटर गर्न वा मेटाउन सक्दछ।"</string>
<string name="permlab_bindCellBroadcastService" msgid="586746677002040651">"मोबाइल प्रसारणसम्बन्धी सन्देशहरू फर्वार्ड गर्नुहोस्"</string>
<string name="permdesc_bindCellBroadcastService" msgid="6540910200973641606">"मोबाइल प्रसारणसम्बन्धी सन्देशहरू प्राप्त हुनासाथै तिनीहरूलाई फर्वार्ड गर्नका लागि यसले एपलाई मोबाइल प्रसारण मोड्युलमा जोडिने अनुमति दिन्छ। तपाईंलाई कतिपय स्थानमा आपत्कालीन अवस्थाका बारेमा जानकारी दिनका लागि मोबाइल प्रसारणसम्बन्धी अलर्टहरू पठाइन्छ। हानिकारक एपहरूले आपत्कालीन मोबाइल प्रसारण प्राप्त हुँदा तपाईंको यन्त्रलाई कार्य सम्पादन गर्ने वा सञ्चालित हुने क्रममा हस्तक्षेप गर्न सक्छन्।"</string>
- <!-- no translation found for permlab_manageOngoingCalls (281244770664231782) -->
- <skip />
- <!-- no translation found for permdesc_manageOngoingCalls (7003138133829915265) -->
- <skip />
+ <string name="permlab_manageOngoingCalls" msgid="281244770664231782">"जारी रहेका कलहरू व्यवस्थापन गर्न"</string>
+ <string name="permdesc_manageOngoingCalls" msgid="7003138133829915265">"तपाईं यो एपलाई अनुमति दिनुभयो यस एपले तपाईंको यन्त्रमा जारी रहेका कलसम्बन्धी विवरण हेर्न र ती कलहरू नियन्त्रण गर्न सक्छ।"</string>
<string name="permlab_readCellBroadcasts" msgid="5869884450872137693">"सेल प्रसारित सन्देशहरू पढ्नुहोस्"</string>
<string name="permdesc_readCellBroadcasts" msgid="672513437331980168">"तपाईंको उपकरणद्वारा प्राप्त सेल प्रसारण सन्देशहरू एपलाई पढ्न अनुमति दिन्छ। सेल प्रसारण चेतावनीहरू केही स्थानहरूमा तपाईंलाई आपत्कालीन गतिविधिहरूको बारेमा सचेत गराउन गरिएका छन्। खराब एपहरूले एउटा आपत्कालीन सेल प्रसारण प्राप्त गर्दछ जब तपाईंको उपकरणको प्रदर्शन वा अपरेशनको साथ हस्तक्षेप गर्न सक्दछन्।"</string>
<string name="permlab_subscribedFeedsRead" msgid="217624769238425461">"सदस्य बनाइका फिडहरू पढ्नुहोस्"</string>
@@ -2011,6 +2009,14 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"माइक्रोफोन"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"तपाईंको स्क्रिनका अन्य एपहरूमा प्रदर्शन गरिँदै छ"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"प्रतिक्रिया दिनुहोस्"</string>
+ <!-- no translation found for notification_feedback_indicator_alerted (6552871804121942099) -->
+ <skip />
+ <!-- no translation found for notification_feedback_indicator_silenced (3799442124723177262) -->
+ <skip />
+ <!-- no translation found for notification_feedback_indicator_promoted (9030204303764698640) -->
+ <skip />
+ <!-- no translation found for notification_feedback_indicator_demoted (8880309924296450875) -->
+ <skip />
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"दिनचर्या मोडको जानकारीमूलक सूचना"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"प्रायः चार्ज गर्ने समय हुनुभन्दा पहिले नै ब्याट्री सकिन सक्छ"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"ब्याट्रीको आयु बढाउन ब्याट्री सेभर सक्रिय गरियो"</string>
diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml
index 9d470b8..37eb025 100644
--- a/core/res/res/values-nl/strings.xml
+++ b/core/res/res/values-nl/strings.xml
@@ -965,7 +965,7 @@
<string name="permdesc_readHistoryBookmarks" msgid="2323799501008967852">"Hiermee kan de app de geschiedenis lezen van alle URL\'s die in de systeemeigen browser zijn bezocht, en alle bookmarks in de systeemeigen browser. Let op: deze rechten kunnen niet worden geforceerd door andere browsers of andere apps met internetmogelijkheden."</string>
<string name="permlab_writeHistoryBookmarks" msgid="6090259925187986937">"webbookmarks en -geschiedenis schrijven"</string>
<string name="permdesc_writeHistoryBookmarks" product="tablet" msgid="573341025292489065">"Hiermee kan de app de webgeschiedenis wijzigen in de systeemeigen browser en de bookmarks die zijn opgeslagen op je tablet. Deze rechten kunnen niet worden geforceerd door andere browsers of andere apps met internetmogelijkheden."</string>
- <string name="permdesc_writeHistoryBookmarks" product="tv" msgid="88642768580408561">"Hiermee kan de app de browsergeschiedenis of opgeslagen bookmarks bewerken op je Android TV-apparaat. Hierdoor kan de app mogelijk browsergegevens wissen of aanpassen. Opmerking: Dit recht kan niet worden afgedwongen door andere browsers of andere apps met internetmogelijkheden."</string>
+ <string name="permdesc_writeHistoryBookmarks" product="tv" msgid="88642768580408561">"Hiermee kan de app de browsergeschiedenis of opgeslagen bookmarks bewerken op je Android TV-apparaat. Hierdoor kan de app mogelijk browsegegevens wissen of aanpassen. Opmerking: Dit recht kan niet worden afgedwongen door andere browsers of andere apps met internetmogelijkheden."</string>
<string name="permdesc_writeHistoryBookmarks" product="default" msgid="2245203087160913652">"Hiermee kan de app de webgeschiedenis wijzigen in de systeemeigen browser en de bookmarks die zijn opgeslagen op je telefoon. Deze rechten kunnen niet worden geforceerd door andere browsers of andere apps met internetmogelijkheden."</string>
<string name="permlab_setAlarm" msgid="1158001610254173567">"een wekker instellen"</string>
<string name="permdesc_setAlarm" msgid="2185033720060109640">"Hiermee kan de app een wekker instellen in een geïnstalleerde wekker-app. Deze functie wordt door sommige wekker-apps niet geïmplementeerd."</string>
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Microfoon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"wordt weergegeven vóór andere apps op je scherm"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Feedback geven"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Deze melding is opgeschaald naar Standaard. Tik om feedback te geven."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Deze melding is verlaagd naar Stil. Tik om feedback te geven."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Deze melding is hoger geclassificeerd. Tik om feedback te geven."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Deze melding is lager geclassificeerd. Tik om feedback te geven."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Informatiemelding voor routinemodus"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"De batterij raakt mogelijk leeg voordat deze normaal gesproken wordt opgeladen"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Batterijbesparing is geactiveerd om de batterijduur te verlengen"</string>
diff --git a/core/res/res/values-or/strings.xml b/core/res/res/values-or/strings.xml
index df72172..b5935e97 100644
--- a/core/res/res/values-or/strings.xml
+++ b/core/res/res/values-or/strings.xml
@@ -353,10 +353,8 @@
<string name="permdesc_receiveMms" msgid="958102423732219710">"MMS ମେସେଜ୍ ପ୍ରାପ୍ତ କରିବାକୁ ତଥା ପ୍ରକ୍ରିୟା କରାଇବାକୁ ଆପ୍ଟିକୁ ଅନୁମତି ଦିଏ। ଏହାର ଅର୍ଥ, ଆପଣଙ୍କ ଡିଭାଇସ୍କୁ ପଠାଯାଇଥିବା ମେସେଜ୍ ଆପଣଙ୍କୁ ନଦେଖାଇ ଆପ୍ଟି ମନିଟର୍ କିମ୍ବା ଡିଲିଟ୍ କରିପାରେ।"</string>
<string name="permlab_bindCellBroadcastService" msgid="586746677002040651">"ସେଲ୍ ପ୍ରସାରଣ ମେସେଜ୍ ଫର୍ୱାର୍ଡ କରନ୍ତୁ"</string>
<string name="permdesc_bindCellBroadcastService" msgid="6540910200973641606">"ସେଲ୍ ପ୍ରସାରଣ ମେସେଜ୍ ପ୍ରାପ୍ତ ହେବା ପରେ ସେଗୁଡ଼ିକୁ ଫର୍ୱାର୍ଡ କରିବା ପାଇଁ ଆପ୍କୁ ସେଲ୍ ପ୍ରସାରଣ ମଡ୍ୟୁଲ୍ ସହିତ ସଂଯୁକ୍ତ କରିବାକୁ ଅନୁମତି ଦିଏ। ଜରୁରୀକାଳୀନ ପରିସ୍ଥିତିରେ ଆପଣଙ୍କୁ ଚେତାବନୀ ଦେବା ପାଇଁ କିଛି ଲୋକେସନ୍ରେ ସେଲ୍ ପ୍ରସାରଣ ଆଲର୍ଟ ବିତରଣ କରାଯାଇଥାଏ। ଏକ ଜରୁରୀକାଳୀନ ସେଲ୍ ପ୍ରସାରଣ ପ୍ରାପ୍ତ ହେବା ସମୟରେ କିଛି କ୍ଷତିକାରକ ଆପ୍ସ ହୁଏତ ଆପଣଙ୍କର ଡିଭାଇସ୍ର କାର୍ଯ୍ୟଦକ୍ଷତା କିମ୍ବା କାର୍ଯ୍ୟ ପ୍ରକ୍ରିୟାରେ ହସ୍ତକ୍ଷେପ କରିପାରେ।"</string>
- <!-- no translation found for permlab_manageOngoingCalls (281244770664231782) -->
- <skip />
- <!-- no translation found for permdesc_manageOngoingCalls (7003138133829915265) -->
- <skip />
+ <string name="permlab_manageOngoingCalls" msgid="281244770664231782">"ଚାଲୁଥିବା କଲଗୁଡ଼ିକୁ ପରିଚାଳନା କରନ୍ତୁ"</string>
+ <string name="permdesc_manageOngoingCalls" msgid="7003138133829915265">"ଏକ ଆପକୁ ଆପଣଙ୍କ ଡିଭାଇସରେ ଚାଲୁଥିବା କଲଗୁଡ଼ିକର ବିବରଣୀ ଦେଖିବା ଓ ଏହି କଲଗୁଡ଼ିକୁ ନିୟନ୍ତ୍ରଣ କରିବା ପାଇଁ ଅନୁମତି ଦେଇଥାଏ।"</string>
<string name="permlab_readCellBroadcasts" msgid="5869884450872137693">"ସେଲ୍ ବ୍ରଡ୍କାଷ୍ଟ ମେସେଜ୍ ପଢ଼ନ୍ତୁ"</string>
<string name="permdesc_readCellBroadcasts" msgid="672513437331980168">"ଆପଣଙ୍କ ଡିଭାଇସ୍ରେ ପ୍ରାପ୍ତ ହୋଇଥିବା ସେଲ୍ ବ୍ରଡ୍କାଷ୍ଟ ମେସେଜ୍ ପଢିବାକୁ ଆପ୍କୁ ଅନୁମତି ଦିଏ। ଜରୁରୀକାଳୀନ ଅବସ୍ଥା ବିଷୟରେ ଆପଣଙ୍କୁ ସତର୍କ କରାଇବାକୁ କିଛି ଲୋକେଶନ୍ରେ ସେଲ୍ ବ୍ରଡ୍କାଷ୍ଟ ସତର୍କ ଡେଲିଭର୍ କରାଯାଇଥାଏ। ଏକ ଜରୁରୀକାଳୀନ ସେଲ୍ ବ୍ରଡ୍କାଷ୍ଟ ପ୍ରାପ୍ତ ହେବାପରେ ହାନୀକାରକ ଆପ୍ ଆପଣଙ୍କ ଡିଭାଇସ୍ର କାର୍ଯ୍ୟକ୍ଷମତା କିମ୍ବା ସଞ୍ଚାଳନାରେ ବାଧା ପହଞ୍ଚାଇପାରନ୍ତି।"</string>
<string name="permlab_subscribedFeedsRead" msgid="217624769238425461">"ସବସ୍କ୍ରାଇବ୍ ହୋଇଥିବା ଫୀଡ୍କୁ ପଢ଼ନ୍ତୁ"</string>
@@ -2011,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"ମାଇକ୍ରୋଫୋନ୍"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"ଆପଣଙ୍କ ସ୍କ୍ରୀନ୍ ଉପରେ ଥିବା ଅନ୍ୟ ଆପ୍ ଉପରେ ଦେଖାଦେବ"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"ମତାମତ ଦିଅନ୍ତୁ"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"ଏହି ବିଜ୍ଞପ୍ତିକୁ ଡିଫଲ୍ଟ ଭାବେ ପ୍ରମୋଟ୍ କରାଯାଇଛି। ମତାମତ ପ୍ରଦାନ କରିବାକୁ ଟାପ୍ କରନ୍ତୁ।"</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"ଏହି ବିଜ୍ଞପ୍ତିକୁ ନୀରବ ଭାବେ ଡିମୋଟ୍ କରାଯାଇଛି। ମତାମତ ପ୍ରଦାନ କରିବାକୁ ଟାପ୍ କରନ୍ତୁ।"</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"ଏହି ବିଜ୍ଞପ୍ତିର ରେଙ୍କ ଉପରକୁ କରାଯାଇଛି। ମତାମତ ପ୍ରଦାନ କରିବାକୁ ଟାପ୍ କରନ୍ତୁ।"</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"ଏହି ବିଜ୍ଞପ୍ତିର ରେଙ୍କ ତଳକୁ କରାଯାଇଛି। ମତାମତ ପ୍ରଦାନ କରିବାକୁ ଟାପ୍ କରନ୍ତୁ।"</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"ନିୟମିତ ମୋଡ୍ ସୂଚନା ବିଜ୍ଞପ୍ତି"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"ସାଧାରଣ ଭାବରେ ଚାର୍ଜ୍ କରିବା ପୂର୍ବରୁ ବ୍ୟାଟେରୀ ସରିଯାଇପାରେ"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"ବ୍ୟାଟେରୀର ସମୟକୁ ବଢ଼ାଇବା ପାଇଁ ବ୍ୟଟେରୀ ସେଭର୍କୁ କାର୍ଯ୍ୟକାରୀ କରାଯାଇଛି"</string>
diff --git a/core/res/res/values-pa/strings.xml b/core/res/res/values-pa/strings.xml
index 9736e57..1f53964 100644
--- a/core/res/res/values-pa/strings.xml
+++ b/core/res/res/values-pa/strings.xml
@@ -353,10 +353,8 @@
<string name="permdesc_receiveMms" msgid="958102423732219710">"ਐਪ ਨੂੰ MMS ਸੁਨੇਹੇ ਪ੍ਰਾਪਤ ਕਰਨ ਅਤੇ ਉਹਨਾਂ ਦੀ ਪ੍ਰਕਿਰਿਆ ਕਰਨ ਦੀ ਆਗਿਆ ਦਿੰਦਾ ਹੈ। ਇਸਦਾ ਮਤਲਬ ਹੈ ਕਿ ਐਪ ਤੁਹਾਡੇ ਡੀਵਾਈਸ ਤੇ ਭੇਜੇ ਗਏ ਸੁਨੇਹਿਆਂ ਨੂੰ ਤੁਹਾਨੂੰ ਦਿਖਾਏ ਬਿਨਾਂ ਨਿਰੀਖਣ ਕਰ ਸਕਦੀ ਹੈ ਜਾਂ ਮਿਟਾ ਸਕਦੀ ਹੈ।"</string>
<string name="permlab_bindCellBroadcastService" msgid="586746677002040651">"ਸੈੱਲ ਪ੍ਰਸਾਰਨ ਸੁਨੇਹਿਆਂ ਨੂੰ ਅੱਗੇ ਭੇਜੋ"</string>
<string name="permdesc_bindCellBroadcastService" msgid="6540910200973641606">"ਐਪ ਨੂੰ ਸੈੱਲ ਪ੍ਰਸਾਰਨ ਸੁਨੇਹਿਆਂ ਦੇ ਪ੍ਰਾਪਤ ਹੁੰਦੇ ਹੀ ਉਹਨਾਂ ਨੂੰ ਅੱਗੇ ਭੇਜਣ ਲਈ ਸੈੱਲ ਪ੍ਰਸਾਰਨ ਮਾਡਿਊਲ ਨਾਲ ਜੋੜਨ ਦੀ ਇਜਾਜ਼ਤ ਦਿੱਤੀ ਜਾਂਦੀ ਹੈ। ਸੈੱਲ ਪ੍ਰਸਾਰਨ ਸੁਚੇਤਨਾਵਾਂ ਤੁਹਾਨੂੰ ਸੰਕਟਕਾਲੀ ਸਥਿਤੀਆਂ ਦੀ ਚਿਤਾਵਨੀ ਦੇਣ ਲਈ ਕੁਝ ਟਿਕਾਣਿਆਂ \'ਤੇ ਪ੍ਰਦਾਨ ਕੀਤੀਆਂ ਜਾਂਦੀਆਂ ਹਨ। ਭੈੜੀਆਂ ਐਪਾਂ ਤੁਹਾਡੇ ਡੀਵਾਈਸ ਦੀ ਕਾਰਗੁਜ਼ਾਰੀ ਜਾਂ ਓਪਰੇਸ਼ਨ ਵਿੱਚ ਵਿਘਨ ਪਾ ਸਕਦੀਆਂ ਹਨ ਜਦੋਂ ਇੱਕ ਸੰਕਟਕਾਲੀ ਸੈੱਲ ਪ੍ਰਸਾਰਨ ਪ੍ਰਾਪਤ ਕੀਤਾ ਜਾਂਦਾ ਹੈ।"</string>
- <!-- no translation found for permlab_manageOngoingCalls (281244770664231782) -->
- <skip />
- <!-- no translation found for permdesc_manageOngoingCalls (7003138133829915265) -->
- <skip />
+ <string name="permlab_manageOngoingCalls" msgid="281244770664231782">"ਜਾਰੀ ਕਾਲਾਂ ਦਾ ਪ੍ਰਬੰਧਨ ਕਰੋ"</string>
+ <string name="permdesc_manageOngoingCalls" msgid="7003138133829915265">"ਐਪ ਨੂੰ ਆਪਣੇ ਡੀਵਾਈਸ \'ਤੇ ਜਾਰੀ ਕਾਲਾਂ ਬਾਰੇ ਵੇਰਵੇ ਦੇਖਣ ਅਤੇ ਇਹਨਾਂ ਕਾਲਾਂ ਨੂੰ ਕੰਟਰੋਲ ਕਰਨ ਦਿਓ।"</string>
<string name="permlab_readCellBroadcasts" msgid="5869884450872137693">"ਸੈਲ ਪ੍ਰਸਾਰਨ ਸੁਨੇਹੇ ਪੜ੍ਹੋ"</string>
<string name="permdesc_readCellBroadcasts" msgid="672513437331980168">"ਐਪ ਨੂੰ ਤੁਹਾਡੀ ਡੀਵਾਈਸ ਵੱਲੋਂ ਪ੍ਰਾਪਤ ਕੀਤੇ ਸੈੱਲ ਪ੍ਰਸਾਰਣ ਸੁਨੇਹੇ ਪੜ੍ਹਨ ਦੀ ਆਗਿਆ ਦਿੰਦਾ ਹੈ। ਸੈੱਲ ਪ੍ਰਸਾਰਣ ਚਿਤਾਵਨੀਆਂ ਤੁਹਾਨੂੰ ਸੰਕਟਕਾਲੀਨ ਸਥਿਤੀਆਂ ਦੀ ਚਿਤਾਵਨੀ ਦੇਣ ਲਈ ਕੁਝ ਨਿਰਧਾਰਤ ਟਿਕਾਣਿਆਂ ਤੇ ਪ੍ਰਦਾਨ ਕੀਤੀਆਂ ਜਾਂਦੀਆਂ ਹਨ। ਖਰਾਬ ਐਪਾਂ ਤੁਹਾਡੇ ਡੀਵਾਈਸ ਦੇ ਪ੍ਰਦਰਸ਼ਨ ਜਾਂ ਓਪਰੇਸ਼ਨ ਵਿੱਚ ਵਿਘਨ ਪਾ ਸਕਦੀਆਂ ਹਨ ਜਦੋਂ ਇੱਕ ਸੰਕਟਕਾਲੀਨ ਸੈੱਲ ਪ੍ਰਸਾਰਣ ਪ੍ਰਾਪਤ ਕੀਤਾ ਜਾਂਦਾ ਹੈ।"</string>
<string name="permlab_subscribedFeedsRead" msgid="217624769238425461">"ਸਬਸਕ੍ਰਾਈਬ ਕੀਤੇ ਫੀਡਸ ਪੜ੍ਹੋ"</string>
@@ -2011,6 +2009,14 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"ਮਾਈਕ੍ਰੋਫ਼ੋਨ"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"ਤੁਹਾਡੀ ਸਕ੍ਰੀਨ \'ਤੇ ਹੋਰਾਂ ਐਪਾਂ ਉੱਪਰ ਦਿਖਾਇਆ ਜਾ ਰਿਹਾ ਹੈ"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"ਵਿਚਾਰ ਦਿਓ"</string>
+ <!-- no translation found for notification_feedback_indicator_alerted (6552871804121942099) -->
+ <skip />
+ <!-- no translation found for notification_feedback_indicator_silenced (3799442124723177262) -->
+ <skip />
+ <!-- no translation found for notification_feedback_indicator_promoted (9030204303764698640) -->
+ <skip />
+ <!-- no translation found for notification_feedback_indicator_demoted (8880309924296450875) -->
+ <skip />
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"ਨਿਯਮਬੱਧ ਮੋਡ ਦੀ ਜਾਣਕਾਰੀ ਵਾਲੀ ਸੂਚਨਾ"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"ਬੈਟਰੀ ਚਾਰਜ ਕਰਨ ਦੇ ਮਿੱਥੇ ਸਮੇਂ ਤੋਂ ਪਹਿਲਾਂ ਸ਼ਾਇਦ ਬੈਟਰੀ ਖਤਮ ਹੋ ਜਾਵੇ"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"ਬੈਟਰੀ ਲਾਈਫ਼ ਵਧਾਉਣ ਲਈ ਬੈਟਰੀ ਸੇਵਰ ਚਾਲੂ ਕੀਤਾ ਗਿਆ"</string>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index 2feb6af..02d29cb 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -2075,6 +2075,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"wyświetla się nad innymi aplikacjami na ekranie"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Prześlij opinię"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"To powiadomienie zostało zmienione na Domyślne. Kliknij, by przesłać opinię."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"To powiadomienie zostało zmienione na Ciche. Kliknij, by przesłać opinię."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Podniesiono ważność tego powiadomienia. Kliknij, by przesłać opinię."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Obniżono ważność tego powiadomienia. Kliknij, by przesłać opinię."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Powiadomienie z informacją o trybie rutynowym"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Bateria może się wyczerpać przed zwykłą porą ładowania"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Włączono Oszczędzanie baterii, by wydłużyć czas pracy na baterii"</string>
diff --git a/core/res/res/values-pt-rBR/strings.xml b/core/res/res/values-pt-rBR/strings.xml
index d9050bf..e4092fd 100644
--- a/core/res/res/values-pt-rBR/strings.xml
+++ b/core/res/res/values-pt-rBR/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Microfone"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"exibindo sobre outros apps na sua tela"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Enviar feedback"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Esta notificação foi promovida a Padrão. Toque para enviar seu feedback."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Esta notificação foi rebaixada a Silenciosa. Toque para enviar seu feedback."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Esta notificação foi classificada com maior prioridade. Toque para enviar seu feedback."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Esta notificação foi classificada com menor prioridade. Toque para enviar seu feedback."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Notificação de informação do modo rotina"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"A bateria pode acabar antes da recarga normal"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"A Economia de bateria foi ativada para aumentar a duração da carga"</string>
diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml
index 3de02ab..d5c3c02 100644
--- a/core/res/res/values-pt-rPT/strings.xml
+++ b/core/res/res/values-pt-rPT/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Microfone"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"sobrepõe-se a outras aplicações no ecrã"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Fornecer feedback"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Esta notificação foi promovida para Predefinida. Toque para fornecer feedback."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Esta notificação foi despromovida para Silenciosa. Toque para fornecer feedback."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Esta notificação passou para uma classificação superior. Toque para fornecer feedback."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Esta notificação passou para uma classificação inferior. Toque para fornecer feedback."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Notificação de informações do Modo rotina"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Pode ficar sem bateria antes do carregamento habitual"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Poupança de bateria ativada para prolongar a duração da bateria"</string>
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index d9050bf..e4092fd 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Microfone"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"exibindo sobre outros apps na sua tela"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Enviar feedback"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Esta notificação foi promovida a Padrão. Toque para enviar seu feedback."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Esta notificação foi rebaixada a Silenciosa. Toque para enviar seu feedback."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Esta notificação foi classificada com maior prioridade. Toque para enviar seu feedback."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Esta notificação foi classificada com menor prioridade. Toque para enviar seu feedback."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Notificação de informação do modo rotina"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"A bateria pode acabar antes da recarga normal"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"A Economia de bateria foi ativada para aumentar a duração da carga"</string>
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index e73d96c..b2d2d24 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -2042,6 +2042,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Microfon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"se afișează peste alte aplicații de pe ecran"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Oferiți feedback"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Notificarea a fost promovată la Prestabilită. Atingeți pentru a oferi feedback."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Notificarea a fost mutată în jos la Silențioasă. Atingeți pentru a oferi feedback."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Notificarea a fost mutată la un nivel superior. Atingeți pentru a oferi feedback."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Notificarea a fost mutată la un nivel inferior. Atingeți pentru a oferi feedback."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Notificare pentru informații despre modul Rutină"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Bateria se poate descărca înainte de încărcarea obișnuită"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Economisirea bateriei este activată pentru a prelungi durata de funcționare a bateriei"</string>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index 7ca863a..a4d249a 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -2075,6 +2075,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Микрофон"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"показ поверх других окон"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Отправить отзыв"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Уровень важности этого уведомления был повышен до \"По умолчанию\". Нажмите, чтобы отправить отзыв."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Уровень важности этого уведомления был понижен до \"Без звука\". Нажмите, чтобы отправить отзыв."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Уровень важности этого уведомления был повышен. Нажмите, чтобы отправить отзыв."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Уровень важности этого уведомления был понижен. Нажмите, чтобы отправить отзыв."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Уведомление о батарее"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Батарея может разрядиться"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Чтобы увеличить время работы от батареи, был включен режим энергосбережения."</string>
diff --git a/core/res/res/values-si/strings.xml b/core/res/res/values-si/strings.xml
index 6c1c777..4277a0d 100644
--- a/core/res/res/values-si/strings.xml
+++ b/core/res/res/values-si/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"මයික්රෆෝනය"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"ඔබගේ තිරය මත වෙනත් යෙදුම්වලට උඩින් සංදර්ශනය කරමින්"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"ප්රතිපෝෂණ සපයන්න"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"මෙම දැනුම් දීම පෙරනිමි වෙත ප්රවර්ධනය කරන ලදී. ප්රතිපෝෂණය ලබා දීමට තට්ටු කරන්න."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"මෙම දැනුම්දීම නිහඬ වෙත පහත දමන ලදී. ප්රතිපෝෂණය ලබා දීමට තට්ටු කරන්න."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"මෙම දැනුම්දීම ඉහළට ශ්රේණිගත කරන ලදී. ප්රතිපෝෂණය ලබා දීමට තට්ටු කරන්න."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"මෙම දැනුම්දීම පහළට ශ්රේණිගත කරන ලදී. ප්රතිපෝෂණය ලබා දීමට තට්ටු කරන්න."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"දිනචරියා ප්රකාර තතු දැනුම්දීම"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"බැටරිය සුපුරුදු ආරෝපණයට පෙර ඉවර විය හැක"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"බැටරි සුරැකුම බැටරි ආයු කාලය දීර්ඝ කිරීමට සක්රිය කෙරිණි"</string>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index cfffb86..5f6d557 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -2075,6 +2075,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofón"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"sa zobrazuje cez ďalšie aplikácie na obrazovke"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Poskytnúť spätnú väzbu"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Toto upozornenie bolo povýšené na Predvolené. Klepnutím nám poskytnite spätnú väzbu."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Toto upozornenie bolo znížené na Tiché. Klepnutím nám poskytnite spätnú väzbu."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Toto upozornenie bolo preradené vyššie. Klepnutím nám poskytnite spätnú väzbu."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Toto upozornenie bolo preradené nižšie. Klepnutím nám poskytnite spätnú väzbu."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Upozornenie s informáciami o rutinnom režime"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Batéria sa môže vybiť pred obvyklým nabitím"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Bol aktivovaný šetrič batérie na predĺženie výdrže batérie"</string>
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index 2a027b2..0d77c61 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -2075,6 +2075,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"prekriva druge aplikacije na zaslonu"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Pošlji povratne informacije"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"To obvestilo je bilo uvrščeno višje – med privzeta obvestila. Dotaknite se, če želite poslati povratne informacije."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"To obvestilo je bilo uvrščeno nižje – med obvestila brez zvoka. Dotaknite se, če želite poslati povratne informacije."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"To obvestilo je bilo uvrščeno višje. Dotaknite se, če želite poslati povratne informacije."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"To obvestilo je bilo uvrščeno nižje. Dotaknite se, če želite poslati povratne informacije."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Rutinsko informativno obvestilo o načinu delovanja"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Baterija se bo morda izpraznila, preden jo običajno priključite na polnjenje"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Vklopilo se je varčevanje z energijo baterije za podaljšanje časa delovanja baterije"</string>
diff --git a/core/res/res/values-sq/strings.xml b/core/res/res/values-sq/strings.xml
index 18a1f98..4f0407b 100644
--- a/core/res/res/values-sq/strings.xml
+++ b/core/res/res/values-sq/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofoni"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"po shfaqet mbi aplikacionet e tjera në ekranin tënd"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Jep komentet"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Ky njoftim është promovuar si parazgjedhje. Trokit për të dhënë komente."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Ky njoftim është ulur në nivel si në heshtje. Trokit për të dhënë komente."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Ky njoftim është renditur më lart. Trokit për të dhënë komente."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Ky njoftim është renditur më poshtë. Trokit për të dhënë komente."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Njoftimi i informacionit të \"Modalitetit rutinë\""</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Bateria mund të mbarojë përpara ngarkimit të zakonshëm"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"\"Kursyesi i baterisë\" u aktivizua për të zgjatur jetëgjatësinë e baterisë"</string>
diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml
index fe12013..e944e8b 100644
--- a/core/res/res/values-sr/strings.xml
+++ b/core/res/res/values-sr/strings.xml
@@ -2042,6 +2042,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Микрофон"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"приказује се на екрану док користите друге апликације"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Пошаљите повратне информације"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Ово обавештење је унапређено у Подразумевано. Додирните да бисте навели повратне информације."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Ово обавештење је деградирано у Нечујно. Додирните да бисте навели повратне информације."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Ово обавештење је рангирано више. Додирните да бисте навели повратне информације."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Ово обавештење је рангирано ниже. Додирните да бисте навели повратне информације."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Обавештење о информацијама Рутинског режима"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Батерија ће се можда испразнити пре уобичајеног пуњења"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Уштеда батерије је активирана да би се продужило трајање батерије"</string>
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index 60b14ff..2acc051 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"visar över andra appar på mobilen"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Lämna feedback"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Den här aviseringen har ändrats till Standard. Tryck för att lämna feedback."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Den här aviseringen har ändrats till Tyst. Tryck för att lämna feedback."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Den här aviseringen har fått högre rankning. Tryck för att lämna feedback."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Den här aviseringen har fått lägre rankning. Tryck för att lämna feedback."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Avisering om rutinläge"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Batteriet kan ta slut innan du brukar ladda det"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Batterisparläget har aktiverats för att utöka batteritiden"</string>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index 2f342b1..079d71c 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Maikrofoni"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"inachomoza kwenye programu zingine katika skrini yako"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Toa Maoni"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Arifa hii ilipandishwa hadhi kuwa Chaguomsingi. Gusa ili utoe maoni."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Arifa hii ilishushwa hadhi kuwa Kimya. Gusa ili utoe maoni."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Arifa hii imeorodheshwa katika nafasi ya juu. Gusa ili utoe maoni."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Arifa hii imeorodheshwa katika nafasi ya chini. Gusa ili utoe maoni."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Arifa ya maelezo ya Hali ya Kawaida"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Huenda betri itakwisha chaji mapema"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Imewasha Kiokoa Betri ili kurefusha muda wa matumizi ya betri"</string>
diff --git a/core/res/res/values-ta/strings.xml b/core/res/res/values-ta/strings.xml
index 0fe5962..1342dbe 100644
--- a/core/res/res/values-ta/strings.xml
+++ b/core/res/res/values-ta/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"மைக்ரோஃபோன்"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"உங்கள் திரையில் உள்ள பிற ஆப்ஸின் மேல் காட்டுகிறது"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"கருத்து தெரிவியுங்கள்"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"இந்த அறிவிப்பின் முக்கியத்துவம் இயல்புநிலைக்கு உயர்த்தி அமைக்கப்பட்டது. கருத்து தெரிவிக்க தட்டவும்."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"இந்த அறிவிப்பின் முக்கியத்துவம் நிசப்த நிலைக்குக் குறைத்து அமைக்கப்பட்டது. கருத்து தெரிவிக்க தட்டவும்."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"இந்த அறிவிப்பின் முக்கியத்துவம் உயர்த்தப்பட்டது. கருத்து தெரிவிக்க தட்டவும்."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"இந்த அறிவிப்பின் முக்கியத்துவம் குறைக்கப்பட்டது. கருத்து தெரிவிக்க தட்டவும்."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"வழக்கமான பேட்டரி சேமிப்பானுக்கான விவர அறிவிப்பு"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"வழக்கமாகச் சார்ஜ் செய்வதற்கு முன்பே பேட்டரி தீர்ந்துபோகக்கூடும்"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"பேட்டரி நிலையை நீட்டிக்க பேட்டரி சேமிப்பான் இயக்கப்பட்டுள்ளது"</string>
diff --git a/core/res/res/values-te/strings.xml b/core/res/res/values-te/strings.xml
index 4602abb8..0f5d000 100644
--- a/core/res/res/values-te/strings.xml
+++ b/core/res/res/values-te/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"మైక్రోఫోన్"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"మీ స్క్రీన్పై ఇతర యాప్ల ద్వారా ప్రదర్శించబడుతోంది"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"ఫీడ్బ్యాక్ను అందించండి"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"ఈ నోటిఫికేషన్, ఆటోమేటిక్ సెట్టింగ్కు ప్రమోట్ చేయబడింది. ఫీడ్బ్యాక్ను అందించడానికి ట్యాప్ చేయండి."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"ఈ నోటిఫికేషన్ స్థాయి నిశ్శబ్దంగా ఉండేలా తగ్గించబడింది. ఫీడ్బ్యాక్ను అందించడానికి ట్యాప్ చేయండి."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"ఈ నోటిఫికేషన్కు ఎక్కువ ర్యాంక్ ఇవ్వబడింది. ఫీడ్బ్యాక్ను అందించడానికి ట్యాప్ చేయండి."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"ఈ నోటిఫికేషన్కు తక్కువ ర్యాంక్ ఇవ్వబడింది. ఫీడ్బ్యాక్ను అందించడానికి ట్యాప్ చేయండి."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"రొటీన్ మోడ్ సమాచార నోటిఫికేషన్"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"మామూలుగా ఛార్జ్ చేసేలోపు బ్యాటరీ ఖాళీ కావచ్చు"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"బ్యాటరీ జీవితకాలాన్ని పెంచడానికి బ్యాటరీ సేవర్ యాక్టివేట్ చేయబడింది"</string>
diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml
index abda062..abf116c 100644
--- a/core/res/res/values-th/strings.xml
+++ b/core/res/res/values-th/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"ไมโครโฟน"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"แสดงทับแอปอื่นๆ บนหน้าจอ"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"แสดงความคิดเห็น"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"การแจ้งเตือนนี้มีการเพิ่มระดับเป็นแบบค่าเริ่มต้น แตะเพื่อแสดงความคิดเห็น"</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"การแจ้งเตือนนี้มีการลดระดับเป็นแบบปิดเสียง แตะเพื่อแสดงความคิดเห็น"</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"การแจ้งเตือนนี้มีการเพิ่มระดับ แตะเพื่อแสดงความคิดเห็น"</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"การแจ้งเตือนนี้มีการลดระดับ แตะเพื่อแสดงความคิดเห็น"</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"การแจ้งเตือนข้อมูลโหมดกิจวัตร"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"แบตเตอรี่อาจหมดก่อนการชาร์จปกติ"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"เปิดใช้งานโหมดประหยัดแบตเตอรี่แล้วเพื่อยืดอายุการใช้งานแบตเตอรี่"</string>
diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml
index 286d28d..09ace93 100644
--- a/core/res/res/values-tl/strings.xml
+++ b/core/res/res/values-tl/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikropono"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"ipinapakita sa ibabaw ng ibang app sa iyong screen"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Magbigay ng Feedback"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Na-promote sa Default ang notification na ito. I-tap para magbigay ng feedback."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Na-demote sa Naka-silent ang notification na ito. I-tap para magbigay ng feedback."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Itinaas ang ranggo ng notification na ito. I-tap para magbigay ng feedback."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Ibinaba ang ranggo ng notification na ito. I-tap para magbigay ng feedback."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Notification ng impormasyon ng Routine Mode"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Maaaring maubos ang baterya bago ang karaniwang pag-charge"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Na-activate ang Pantipid ng Baterya para patagalin ang buhay ng baterya"</string>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index 324101d..258b424 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"ekranınızdaki diğer uygulamaların üzerinde görüntüleniyor"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Geri Bildirim Gönder"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Bu bildirim, Varsayılana yükseltildi. Geri bildirimde bulunmak için dokunun."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Bu bildirim Sessize düşürüldü. Geri bildirimde bulunmak için dokunun."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Bu bildirimin önem derecesi yükseltildi. Geri bildirimde bulunmak için dokunun."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Bu bildirimin önem derecesi düşürüldü. Geri bildirimde bulunmak için dokunun."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Rutin Modu bilgi bildirimi"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Pil normal şarjdan önce bitebilir"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Pilin ömrünü uzatmak için Pil Tasarrufu etkinleştirildi"</string>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index ba124a6..f264fbb 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -2075,6 +2075,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Мікрофон"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"показ поверх інших додатків на екрані"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Надати відгук"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Важливість цього сповіщення підвищено до рівня \"За умовчанням\". Натисніть, щоб надіслати відгук."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Важливість цього сповіщення знижено до рівня \"Без звуку\". Натисніть, щоб надіслати відгук."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Важливість цього сповіщення підвищено. Натисніть, щоб надіслати відгук."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Важливість цього сповіщення знижено. Натисніть, щоб надіслати відгук."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Сповіщення про послідовнсть дій"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Акумулятор може розрядитися раніше ніж зазвичай"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Режим енергозбереження активовано для збільшення часу роботи акумулятора"</string>
diff --git a/core/res/res/values-ur/strings.xml b/core/res/res/values-ur/strings.xml
index 6eabc7b..04498c1 100644
--- a/core/res/res/values-ur/strings.xml
+++ b/core/res/res/values-ur/strings.xml
@@ -353,10 +353,8 @@
<string name="permdesc_receiveMms" msgid="958102423732219710">"ایپ کو MMS پیغامات حاصل اور ان پر کارروائی کرنے کی اجازت دیتا ہے۔ اس کا مطلب ہے کہ ایپ آپ کے آلے پر مرسلہ پیغامات آپ کو دکھائے بغیر ان پر نگاہ رکھ یا انہیں حذف کرسکتی ہے۔"</string>
<string name="permlab_bindCellBroadcastService" msgid="586746677002040651">"سیل کے نشریاتی پیغامات فارورڈ کریں"</string>
<string name="permdesc_bindCellBroadcastService" msgid="6540910200973641606">"سیل کی نشریاتی پیغامات کے موصول ہوتے ہی فارورڈ کرنے کے لیے ایپ کو سیل کے نشریاتی ماڈیول میں پابندی لگانے کی اجازت دیں۔ سیل کی نشریاتی الرٹس آپ کو ہنگامی حالات سے مطلع کرنے کیلئے کچھ مقامات میں مہیا کی جاتی ہیں۔ نقصان دہ ایپس کوئی ہنگامی سیل براڈ کاسٹ موصول ہونے پر آپ کے آلے کی کارکردگی یا عمل میں مداخلت کر سکتی ہیں۔"</string>
- <!-- no translation found for permlab_manageOngoingCalls (281244770664231782) -->
- <skip />
- <!-- no translation found for permdesc_manageOngoingCalls (7003138133829915265) -->
- <skip />
+ <string name="permlab_manageOngoingCalls" msgid="281244770664231782">"جاری کالز کا نظم کریں"</string>
+ <string name="permdesc_manageOngoingCalls" msgid="7003138133829915265">"اس سے ایپ کو آپ کے آلے پر جاری کالز کے بارے میں تفصیلات دیکھنے اور ان کالز کو کنٹرول کرنے کی اجازت ملتی ہے۔"</string>
<string name="permlab_readCellBroadcasts" msgid="5869884450872137693">"سیل کے نشریاتی پیغامات پڑھیں"</string>
<string name="permdesc_readCellBroadcasts" msgid="672513437331980168">"ایپ کو آپ کے آلے کو موصولہ سیل کے نشریاتی پیغامات پڑھنے کی اجازت دیتا ہے۔ سیل کی نشریاتی الرٹس آپ کو ہنگامی حالات سے مطلع کرنے کیلئے کچھ مقامات میں مہیا کی جاتی ہیں۔ نقصان دہ ایپس کوئی ہنگامی سیل کا نشریہ موصول ہونے پر آپ کے آلے کی کارکردگی یا عمل میں خلل ڈال سکتی ہیں۔"</string>
<string name="permlab_subscribedFeedsRead" msgid="217624769238425461">"سبسکرائب کردہ فیڈز پڑھیں"</string>
@@ -2011,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"مائیکروفون"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"آپ کی اسکرین پر دیگر ایپس پر دکھایا جا رہا ہے"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"تاثرات فراہم کریں"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"اس اطلاع کو ڈیفالٹ پر پروموٹ کیا گيا۔ تاثرات فراہم کرنے کے ليے تھپتھپائیں۔"</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"اس اطلاع کو خاموش پر ڈیموٹ کیا گيا۔ تاثرات فراہم کرنے کے ليے تھپتھپائیں۔"</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"اس اطلاع کو اعلی درجہ دیا گیا۔ تاثرات فراہم کرنے کے ليے تھپتھپائیں۔"</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"اس اطلاع کو کم درجہ دیا گیا۔ تاثرات فراہم کرنے کے ليے تھپتھپائیں۔"</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"روٹین موڈ معلومات کی اطلاع"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"معمول چارج سے پہلے بیٹری ختم ہو سکتی ہے"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"بیٹری لائف کو بڑھانے کے لیے بیٹری سیور کو فعال کر دیا گیا ہے"</string>
diff --git a/core/res/res/values-uz/strings.xml b/core/res/res/values-uz/strings.xml
index 00f2215..11e20a9 100644
--- a/core/res/res/values-uz/strings.xml
+++ b/core/res/res/values-uz/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Mikrofon"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"ekranda boshqa ilovalar ustidan ochiladi"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Fikr-mulohaza yuborish"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Bu bildirishnoma standart sifatida balandlatildi. Fikr-mulohaza bildirish uchun bosing."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Bu bildirishnoma Ovozsiz sifatida pastlatildi Fikr-mulohaza bildirish uchun bosing."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Bu bildirishnomaga baland baho berilgan. Fikr-mulohaza bildirish uchun bosing."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Bu bildirishnomaga past baho berilgan. Fikr-mulohaza bildirish uchun bosing."</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 quvvatini uzoqroq vaqtga yetkazish uchun quvvat tejash rejimi yoqildi"</string>
diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml
index 702f693..bfc509a 100644
--- a/core/res/res/values-vi/strings.xml
+++ b/core/res/res/values-vi/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Micrô"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"hiển thị qua các ứng dụng khác trên màn hình của bạn"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Gửi ý kiến phản hồi"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Hệ thống đã nâng mức ưu tiên của thông báo này lên thành Mặc định. Hãy nhấn để chia sẻ ý kiến phản hồi."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Hệ thống đã hạ mức ưu tiên của thông báo này xuống thành Im lặng. Hãy nhấn để chia sẻ ý kiến phản hồi."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Hệ thống đã nâng mức ưu tiên của thông báo này. Hãy nhấn để chia sẻ ý kiến phản hồi."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Hệ thống đã hạ mức ưu tiên của thông báo này. Hãy nhấn để chia sẻ ý kiến phản hồi."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Thông báo cung cấp thông tin về chế độ sạc thông thường"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Pin có thể hết trước khi sạc bình thường"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Trình tiết kiệm pin được kích hoạt để kéo dài thời lượng pin"</string>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index c8d8f11..85a7dae 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"麦克风"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"显示在屏幕上其他应用的上层"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"提供反馈"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"系统已将此通知的重要性提升为“默认”。点按即可提供反馈。"</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"系统已将此通知的重要性降低为“静音”。点按即可提供反馈。"</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"系统已提升此通知的重要性。点按即可提供反馈。"</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"系统已降低此通知的重要性。点按即可提供反馈。"</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"日常安排模式信息通知"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"电池电量可能会在您平时的充电时间之前耗尽"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"已启用省电模式以延长电池续航时间"</string>
diff --git a/core/res/res/values-zh-rHK/strings.xml b/core/res/res/values-zh-rHK/strings.xml
index 33196c82..6d06e68 100644
--- a/core/res/res/values-zh-rHK/strings.xml
+++ b/core/res/res/values-zh-rHK/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"麥克風"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"顯示在畫面上的其他應用程式上層"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"提供意見"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"此通知的重要性已提升為「預設」。輕按即可提供意見。"</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"此通知的重要性已降低為「靜音」。輕按即可提供意見。"</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"此通知的重要性已提升。輕按即可提供意見。"</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"此通知的重要性已降級。輕按即可提供意見。"</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"「日常安排模式」資料通知"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"電量可能會在日常充電前耗盡"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"「省電模式」已啟用,以便延長電池壽命"</string>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index 1194b49..5ba35c7 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"麥克風"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"顯示在畫面上的其他應用程式上層"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"提供意見"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"這則通知的重要性已提升為「預設」。輕觸即可提供意見。"</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"這則通知的重要性已降低為「靜音」。輕觸即可提供意見。"</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"這則通知的重要性順序已調高。輕觸即可提供意見。"</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"這則通知的重要性順序已調降。輕觸即可提供意見。"</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"日常安排模式資訊通知"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"電池電力可能會在你平常的充電時間前耗盡"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"已啟用省電模式以延長電池續航力"</string>
diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml
index 67eb874..b391b4d 100644
--- a/core/res/res/values-zu/strings.xml
+++ b/core/res/res/values-zu/strings.xml
@@ -2009,6 +2009,10 @@
<string name="notification_appops_microphone_active" msgid="581333393214739332">"Imakrofoni"</string>
<string name="notification_appops_overlay_active" msgid="5571732753262836481">"iboniswa ngaphezulu kwezinye izinhlelo zokusebenza kusikrini sakho"</string>
<string name="notification_feedback_indicator" msgid="663476517711323016">"Nikeza impendulo"</string>
+ <string name="notification_feedback_indicator_alerted" msgid="6552871804121942099">"Lesi saziso siphromothelwe Kokuzenzakalelayo. Thepha ukuze unikeze impendulo."</string>
+ <string name="notification_feedback_indicator_silenced" msgid="3799442124723177262">"Lesi saziso sehliselwe esikhundleni Sokuthula. Thepha ukuze unikeze impendulo."</string>
+ <string name="notification_feedback_indicator_promoted" msgid="9030204303764698640">"Lesi saziso sibekwe ezingeni eliphakeme. Thepha ukuze unikeze impendulo."</string>
+ <string name="notification_feedback_indicator_demoted" msgid="8880309924296450875">"Lesi saziso sibekwe ezingeni eliphansi. Thepha ukuze unikeze impendulo."</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Isaziso solwazi lwe-Routine Mode"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Ibhethri lingaphela ngaphambi kokushaja okuvamile"</string>
<string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Isilondolozi sebhethri siyasebenza ngaphandle kwempilo yebhethri"</string>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 4313d4a..0958434 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -3064,7 +3064,7 @@
<!-- dimension definitions go here -->
</public-group>
- <public-group type="bool" first-id="0x01110006">
+ <public-group type="bool" first-id="0x01110007">
<!-- boolean definitions go here -->
</public-group>
diff --git a/core/tests/coretests/src/android/app/appsearch/external/app/SearchSpecTest.java b/core/tests/coretests/src/android/app/appsearch/external/app/SearchSpecTest.java
index 9fd480d..b3caecc 100644
--- a/core/tests/coretests/src/android/app/appsearch/external/app/SearchSpecTest.java
+++ b/core/tests/coretests/src/android/app/appsearch/external/app/SearchSpecTest.java
@@ -22,6 +22,9 @@
import org.junit.Test;
+import java.util.List;
+import java.util.Map;
+
public class SearchSpecTest {
@Test
public void testGetBundle() {
@@ -53,4 +56,21 @@
assertThat(bundle.getInt(SearchSpec.RANKING_STRATEGY_FIELD))
.isEqualTo(SearchSpec.RANKING_STRATEGY_DOCUMENT_SCORE);
}
+
+ @Test
+ public void testGetProjectionTypePropertyMasks() {
+ SearchSpec searchSpec =
+ new SearchSpec.Builder()
+ .setTermMatch(SearchSpec.TERM_MATCH_PREFIX)
+ .addProjectionTypePropertyPaths("TypeA", "field1", "field2.subfield2")
+ .addProjectionTypePropertyPaths("TypeB", "field7")
+ .addProjectionTypePropertyPaths("TypeC")
+ .build();
+
+ Map<String, List<String>> typePropertyPathMap = searchSpec.getProjectionTypePropertyPaths();
+ assertThat(typePropertyPathMap.keySet()).containsExactly("TypeA", "TypeB", "TypeC");
+ assertThat(typePropertyPathMap.get("TypeA")).containsExactly("field1", "field2.subfield2");
+ assertThat(typePropertyPathMap.get("TypeB")).containsExactly("field7");
+ assertThat(typePropertyPathMap.get("TypeC")).isEmpty();
+ }
}
diff --git a/core/tests/coretests/src/android/app/appsearch/external/app/SetSchemaRequestTest.java b/core/tests/coretests/src/android/app/appsearch/external/app/SetSchemaRequestTest.java
index 879aa09..133efce 100644
--- a/core/tests/coretests/src/android/app/appsearch/external/app/SetSchemaRequestTest.java
+++ b/core/tests/coretests/src/android/app/appsearch/external/app/SetSchemaRequestTest.java
@@ -16,9 +16,6 @@
package android.app.appsearch;
-import static android.app.appsearch.AppSearchSchema.PropertyConfig.INDEXING_TYPE_PREFIXES;
-import static android.app.appsearch.AppSearchSchema.PropertyConfig.TOKENIZER_TYPE_PLAIN;
-
import static com.google.common.truth.Truth.assertThat;
import static org.testng.Assert.expectThrows;
@@ -27,12 +24,22 @@
import org.junit.Test;
+import java.util.Collection;
import java.util.Collections;
+import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class SetSchemaRequestTest {
+ private static Collection<String> getSchemaTypesFromSetSchemaRequest(SetSchemaRequest request) {
+ HashSet<String> schemaTypes = new HashSet<>();
+ for (AppSearchSchema schema : request.getSchemas()) {
+ schemaTypes.add(schema.getSchemaType());
+ }
+ return schemaTypes;
+ }
+
@Test
public void testInvalidSchemaReferences_fromSystemUiVisibility() {
IllegalArgumentException expected =
@@ -57,7 +64,7 @@
/*visible=*/ true,
new PackageIdentifier(
"com.foo.package",
- /*certificate=*/ new byte[] {}))
+ /*sha256Certificate=*/ new byte[] {}))
.build());
assertThat(expected).hasMessageThat().contains("referenced, but were not added");
}
@@ -68,14 +75,14 @@
// By default, the schema is visible.
SetSchemaRequest request = new SetSchemaRequest.Builder().addSchema(schema).build();
- assertThat(request.getSchemasNotPlatformSurfaceable()).isEmpty();
+ assertThat(request.getSchemasNotVisibleToSystemUi()).isEmpty();
request =
new SetSchemaRequest.Builder()
.addSchema(schema)
.setSchemaTypeVisibilityForSystemUi("Schema", true)
.build();
- assertThat(request.getSchemasNotPlatformSurfaceable()).isEmpty();
+ assertThat(request.getSchemasNotVisibleToSystemUi()).isEmpty();
}
@Test
@@ -86,7 +93,7 @@
.addSchema(schema)
.setSchemaTypeVisibilityForSystemUi("Schema", false)
.build();
- assertThat(request.getSchemasNotPlatformSurfaceable()).containsExactly("Schema");
+ assertThat(request.getSchemasNotVisibleToSystemUi()).containsExactly("Schema");
}
@Test
@@ -95,12 +102,12 @@
// By default, the schema is not visible.
SetSchemaRequest request = new SetSchemaRequest.Builder().addSchema(schema).build();
- assertThat(request.getSchemasPackageAccessible()).isEmpty();
+ assertThat(request.getSchemasVisibleToPackages()).isEmpty();
PackageIdentifier packageIdentifier =
new PackageIdentifier("com.package.foo", new byte[] {100});
- Map<String, Set<PackageIdentifier>> expectedPackageVisibleMap = new ArrayMap<>();
- expectedPackageVisibleMap.put("Schema", Collections.singleton(packageIdentifier));
+ Map<String, Set<PackageIdentifier>> expectedVisibleToPackagesMap = new ArrayMap<>();
+ expectedVisibleToPackagesMap.put("Schema", Collections.singleton(packageIdentifier));
request =
new SetSchemaRequest.Builder()
@@ -108,8 +115,8 @@
.setSchemaTypeVisibilityForPackage(
"Schema", /*visible=*/ true, packageIdentifier)
.build();
- assertThat(request.getSchemasPackageAccessible())
- .containsExactlyEntriesIn(expectedPackageVisibleMap);
+ assertThat(request.getSchemasVisibleToPackages())
+ .containsExactlyEntriesIn(expectedVisibleToPackagesMap);
}
@Test
@@ -123,9 +130,9 @@
"Schema",
/*visible=*/ false,
new PackageIdentifier(
- "com.package.foo", /*certificate=*/ new byte[] {}))
+ "com.package.foo", /*sha256Certificate=*/ new byte[] {}))
.build();
- assertThat(request.getSchemasPackageAccessible()).isEmpty();
+ assertThat(request.getSchemasVisibleToPackages()).isEmpty();
}
@Test
@@ -134,8 +141,8 @@
PackageIdentifier packageIdentifier =
new PackageIdentifier("com.package.foo", new byte[] {100});
- Map<String, Set<PackageIdentifier>> expectedPackageVisibleMap = new ArrayMap<>();
- expectedPackageVisibleMap.put("Schema", Collections.singleton(packageIdentifier));
+ Map<String, Set<PackageIdentifier>> expectedVisibleToPackagesMap = new ArrayMap<>();
+ expectedVisibleToPackagesMap.put("Schema", Collections.singleton(packageIdentifier));
SetSchemaRequest request =
new SetSchemaRequest.Builder()
@@ -147,8 +154,8 @@
.setSchemaTypeVisibilityForPackage(
"Schema", /*visible=*/ true, packageIdentifier)
.build();
- assertThat(request.getSchemasPackageAccessible())
- .containsExactlyEntriesIn(expectedPackageVisibleMap);
+ assertThat(request.getSchemasVisibleToPackages())
+ .containsExactlyEntriesIn(expectedVisibleToPackagesMap);
}
@Test
@@ -163,16 +170,16 @@
"Schema",
/*visible=*/ true,
new PackageIdentifier(
- "com.package.foo", /*certificate=*/ new byte[] {100}))
+ "com.package.foo", /*sha256Certificate=*/ new byte[] {100}))
// Then make it not visible
.setSchemaTypeVisibilityForPackage(
"Schema",
/*visible=*/ false,
new PackageIdentifier(
- "com.package.foo", /*certificate=*/ new byte[] {100}))
+ "com.package.foo", /*sha256Certificate=*/ new byte[] {100}))
.build();
// Nothing should be visible.
- assertThat(request.getSchemasPackageAccessible()).isEmpty();
+ assertThat(request.getSchemasVisibleToPackages()).isEmpty();
}
}
diff --git a/core/tests/coretests/src/android/app/assist/OWNERS b/core/tests/coretests/src/android/app/assist/OWNERS
new file mode 100644
index 0000000..43ad108
--- /dev/null
+++ b/core/tests/coretests/src/android/app/assist/OWNERS
@@ -0,0 +1 @@
+file:/core/java/android/app/assist/OWNERS
diff --git a/core/tests/coretests/src/android/app/servertransaction/ObjectPoolTests.java b/core/tests/coretests/src/android/app/servertransaction/ObjectPoolTests.java
index b2b34d6..50b52eb 100644
--- a/core/tests/coretests/src/android/app/servertransaction/ObjectPoolTests.java
+++ b/core/tests/coretests/src/android/app/servertransaction/ObjectPoolTests.java
@@ -23,9 +23,11 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
+import android.app.ActivityOptions;
import android.app.servertransaction.TestUtils.LaunchActivityItemBuilder;
import android.content.Intent;
import android.content.pm.ActivityInfo;
@@ -247,6 +249,22 @@
}
@Test
+ public void testRecycleStartActivityItem() {
+ StartActivityItem emptyItem = StartActivityItem.obtain(null /* activityOptions */);
+ StartActivityItem item = StartActivityItem.obtain(ActivityOptions.makeBasic());
+ assertNotSame(item, emptyItem);
+ assertNotEquals(item, emptyItem);
+
+ item.recycle();
+ assertEquals(item, emptyItem);
+
+ StartActivityItem item2 = StartActivityItem.obtain(
+ ActivityOptions.makeBasic().setLaunchDisplayId(10));
+ assertSame(item, item2);
+ assertNotEquals(item2, emptyItem);
+ }
+
+ @Test
public void testRecycleStopItem() {
StopActivityItem emptyItem = StopActivityItem.obtain(0);
StopActivityItem item = StopActivityItem.obtain(4);
diff --git a/core/tests/coretests/src/android/app/servertransaction/TestUtils.java b/core/tests/coretests/src/android/app/servertransaction/TestUtils.java
index 7e9933c..02e75dd 100644
--- a/core/tests/coretests/src/android/app/servertransaction/TestUtils.java
+++ b/core/tests/coretests/src/android/app/servertransaction/TestUtils.java
@@ -18,6 +18,7 @@
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
+import android.app.ActivityOptions;
import android.app.ProfilerInfo;
import android.app.ResultInfo;
import android.content.Intent;
@@ -104,6 +105,7 @@
private PersistableBundle mPersistentState;
private List<ResultInfo> mPendingResults;
private List<ReferrerIntent> mPendingNewIntents;
+ private ActivityOptions mActivityOptions;
private boolean mIsForward;
private ProfilerInfo mProfilerInfo;
private IBinder mAssistToken;
@@ -174,6 +176,11 @@
return this;
}
+ LaunchActivityItemBuilder setActivityOptions(ActivityOptions activityOptions) {
+ mActivityOptions = activityOptions;
+ return this;
+ }
+
LaunchActivityItemBuilder setIsForward(boolean isForward) {
mIsForward = isForward;
return this;
@@ -198,8 +205,8 @@
return LaunchActivityItem.obtain(mIntent, mIdent, mInfo,
mCurConfig, mOverrideConfig, mCompatInfo, mReferrer, mVoiceInteractor,
mProcState, mState, mPersistentState, mPendingResults, mPendingNewIntents,
- mIsForward, mProfilerInfo, mAssistToken, null /* activityClientController */,
- mFixedRotationAdjustments);
+ mActivityOptions, mIsForward, mProfilerInfo, mAssistToken,
+ null /* activityClientController */, mFixedRotationAdjustments);
}
}
}
diff --git a/core/tests/coretests/src/android/app/servertransaction/TransactionParcelTests.java b/core/tests/coretests/src/android/app/servertransaction/TransactionParcelTests.java
index e1c7146..5705dd5 100644
--- a/core/tests/coretests/src/android/app/servertransaction/TransactionParcelTests.java
+++ b/core/tests/coretests/src/android/app/servertransaction/TransactionParcelTests.java
@@ -24,6 +24,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import android.app.ActivityOptions;
import android.app.ContentProviderHolder;
import android.app.IApplicationThread;
import android.app.IInstrumentationWatcher;
@@ -200,9 +201,10 @@
.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();
+ .setPendingResults(resultInfoList()).setActivityOptions(ActivityOptions.makeBasic())
+ .setPendingNewIntents(referrerIntentList()).setIsForward(true)
+ .setAssistToken(new Binder()).setFixedRotationAdjustments(fixedRotationAdjustments)
+ .build();
writeAndPrepareForReading(item);
@@ -273,7 +275,7 @@
@Test
public void testStart() {
// Write to parcel
- StartActivityItem item = StartActivityItem.obtain();
+ StartActivityItem item = StartActivityItem.obtain(ActivityOptions.makeBasic());
writeAndPrepareForReading(item);
// Read from parcel and assert
diff --git a/core/tests/coretests/src/android/service/notification/NotificationListenerFilterTest.java b/core/tests/coretests/src/android/service/notification/NotificationListenerFilterTest.java
new file mode 100644
index 0000000..a43b238
--- /dev/null
+++ b/core/tests/coretests/src/android/service/notification/NotificationListenerFilterTest.java
@@ -0,0 +1,124 @@
+/*
+ * 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.service.notification;
+
+import static android.app.NotificationManager.IMPORTANCE_DEFAULT;
+import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_ALERTING;
+import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_CONVERSATIONS;
+import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_SILENT;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.app.NotificationChannel;
+import android.os.Parcel;
+import android.util.ArraySet;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class NotificationListenerFilterTest {
+
+ @Test
+ public void testEmptyConstructor() {
+ NotificationListenerFilter nlf = new NotificationListenerFilter();
+ assertThat(nlf.isTypeAllowed(FLAG_FILTER_TYPE_CONVERSATIONS)).isTrue();
+ assertThat(nlf.isTypeAllowed(FLAG_FILTER_TYPE_ALERTING)).isTrue();
+ assertThat(nlf.isTypeAllowed(FLAG_FILTER_TYPE_SILENT)).isTrue();
+ assertThat(nlf.getTypes()).isEqualTo(FLAG_FILTER_TYPE_CONVERSATIONS
+ | FLAG_FILTER_TYPE_ALERTING
+ | FLAG_FILTER_TYPE_SILENT);
+
+ assertThat(nlf.getDisallowedPackages()).isEmpty();
+ assertThat(nlf.isPackageAllowed("pkg1")).isTrue();
+ }
+
+
+ @Test
+ public void testConstructor() {
+ ArraySet<String> pkgs = new ArraySet<>(new String[] {"pkg1", "pkg2"});
+ NotificationListenerFilter nlf =
+ new NotificationListenerFilter(FLAG_FILTER_TYPE_ALERTING, pkgs);
+ assertThat(nlf.isTypeAllowed(FLAG_FILTER_TYPE_CONVERSATIONS)).isFalse();
+ assertThat(nlf.isTypeAllowed(FLAG_FILTER_TYPE_ALERTING)).isTrue();
+ assertThat(nlf.isTypeAllowed(FLAG_FILTER_TYPE_SILENT)).isFalse();
+ assertThat(nlf.getTypes()).isEqualTo(FLAG_FILTER_TYPE_ALERTING);
+
+ assertThat(nlf.getDisallowedPackages()).contains("pkg1");
+ assertThat(nlf.getDisallowedPackages()).contains("pkg2");
+ assertThat(nlf.isPackageAllowed("pkg1")).isFalse();
+ assertThat(nlf.isPackageAllowed("pkg2")).isFalse();
+ }
+
+ @Test
+ public void testSetDisallowedPackages() {
+ NotificationListenerFilter nlf = new NotificationListenerFilter();
+
+ ArraySet<String> pkgs = new ArraySet<>(new String[] {"pkg1"});
+ nlf.setDisallowedPackages(pkgs);
+
+ assertThat(nlf.isPackageAllowed("pkg1")).isFalse();
+ }
+
+ @Test
+ public void testSetTypes() {
+ NotificationListenerFilter nlf = new NotificationListenerFilter();
+
+ nlf.setTypes(FLAG_FILTER_TYPE_ALERTING | FLAG_FILTER_TYPE_SILENT);
+
+ assertThat(nlf.isTypeAllowed(FLAG_FILTER_TYPE_CONVERSATIONS)).isFalse();
+ assertThat(nlf.isTypeAllowed(FLAG_FILTER_TYPE_ALERTING)).isTrue();
+ assertThat(nlf.isTypeAllowed(FLAG_FILTER_TYPE_SILENT)).isTrue();
+ assertThat(nlf.getTypes()).isEqualTo(FLAG_FILTER_TYPE_ALERTING
+ | FLAG_FILTER_TYPE_SILENT);
+ }
+
+ @Test
+ public void testDescribeContents() {
+ final int expected = 0;
+ ArraySet<String> pkgs = new ArraySet<>(new String[] {"pkg1", "pkg2"});
+ NotificationListenerFilter nlf =
+ new NotificationListenerFilter(FLAG_FILTER_TYPE_ALERTING, pkgs);
+ assertThat(nlf.describeContents()).isEqualTo(expected);
+ }
+
+ @Test
+ public void testParceling() {
+ ArraySet<String> pkgs = new ArraySet<>(new String[] {"pkg1", "pkg2"});
+ NotificationListenerFilter nlf =
+ new NotificationListenerFilter(FLAG_FILTER_TYPE_ALERTING, pkgs);
+
+ Parcel parcel = Parcel.obtain();
+ nlf.writeToParcel(parcel, 0);
+ parcel.setDataPosition(0);
+ NotificationListenerFilter nlf1 =
+ NotificationListenerFilter.CREATOR.createFromParcel(parcel);
+ assertThat(nlf1.isTypeAllowed(FLAG_FILTER_TYPE_CONVERSATIONS)).isFalse();
+ assertThat(nlf1.isTypeAllowed(FLAG_FILTER_TYPE_ALERTING)).isTrue();
+ assertThat(nlf1.isTypeAllowed(FLAG_FILTER_TYPE_SILENT)).isFalse();
+ assertThat(nlf1.getTypes()).isEqualTo(FLAG_FILTER_TYPE_ALERTING);
+
+ assertThat(nlf1.getDisallowedPackages()).contains("pkg1");
+ assertThat(nlf1.getDisallowedPackages()).contains("pkg2");
+ assertThat(nlf1.isPackageAllowed("pkg1")).isFalse();
+ assertThat(nlf1.isPackageAllowed("pkg2")).isFalse();
+ }
+}
diff --git a/core/tests/coretests/src/android/service/notification/OWNERS b/core/tests/coretests/src/android/service/notification/OWNERS
new file mode 100644
index 0000000..1502b60
--- /dev/null
+++ b/core/tests/coretests/src/android/service/notification/OWNERS
@@ -0,0 +1,2 @@
+include platform/frameworks/base:/services/core/java/com/android/server/notification/OWNERS
+
diff --git a/core/tests/coretests/src/android/view/ImeInsetsSourceConsumerTest.java b/core/tests/coretests/src/android/view/ImeInsetsSourceConsumerTest.java
index db838e8..7a2e6b7 100644
--- a/core/tests/coretests/src/android/view/ImeInsetsSourceConsumerTest.java
+++ b/core/tests/coretests/src/android/view/ImeInsetsSourceConsumerTest.java
@@ -78,11 +78,11 @@
mController = Mockito.spy(new InsetsController(
new ViewRootInsetsControllerHost(viewRootImpl)));
final Rect rect = new Rect(5, 5, 5, 5);
+ mController.getState().setDisplayCutout(new DisplayCutout(
+ Insets.of(10, 10, 10, 10), rect, rect, rect, rect));
mController.calculateInsets(
false,
false,
- new DisplayCutout(
- Insets.of(10, 10, 10, 10), rect, rect, rect, rect),
TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED,
SOFT_INPUT_ADJUST_RESIZE, 0, 0);
mImeConsumer = (ImeInsetsSourceConsumer) mController.getSourceConsumer(ITYPE_IME);
@@ -128,4 +128,26 @@
eq(WindowInsets.Type.ime()), eq(false) /* show */, eq(true) /* fromIme */);
});
}
+
+ @Test
+ public void testImeGetAndClearSkipAnimationOnce() {
+ InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> {
+ // Request IME visible before control is available.
+ mImeConsumer.onWindowFocusGained();
+ mImeConsumer.applyImeVisibility(true /* setVisible */);
+
+ // set control and verify visibility is applied.
+ InsetsSourceControl control = Mockito.spy(
+ new InsetsSourceControl(ITYPE_IME, mLeash, new Point()));
+ // Simulate IME source control set this flag when the target has starting window.
+ control.setSkipAnimationOnce(true);
+ mController.onControlsChanged(new InsetsSourceControl[] { control });
+ // Verify IME show animation should be triggered when control becomes available and
+ // the animation will be skipped by getAndClearSkipAnimationOnce invoked.
+ verify(control).getAndClearSkipAnimationOnce();
+ verify(mController).applyAnimation(
+ eq(WindowInsets.Type.ime()), eq(true) /* show */, eq(false) /* fromIme */,
+ eq(true) /* skipAnim */);
+ });
+ }
}
diff --git a/core/tests/coretests/src/android/view/InsetsControllerTest.java b/core/tests/coretests/src/android/view/InsetsControllerTest.java
index 7b84f68c..af13cc0 100644
--- a/core/tests/coretests/src/android/view/InsetsControllerTest.java
+++ b/core/tests/coretests/src/android/view/InsetsControllerTest.java
@@ -151,11 +151,11 @@
new Rect(0, 90, 100, 100));
mController.getState().getSource(ITYPE_IME).setFrame(new Rect(0, 50, 100, 100));
mController.getState().setDisplayFrame(new Rect(0, 0, 100, 100));
+ mController.getState().setDisplayCutout(new DisplayCutout(
+ Insets.of(10, 10, 10, 10), rect, rect, rect, rect));
mController.calculateInsets(
false,
false,
- new DisplayCutout(
- Insets.of(10, 10, 10, 10), rect, rect, rect, rect),
TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED,
SOFT_INPUT_ADJUST_RESIZE, 0, 0);
mController.onFrameChanged(new Rect(0, 0, 100, 100));
diff --git a/core/tests/coretests/src/android/view/InsetsStateTest.java b/core/tests/coretests/src/android/view/InsetsStateTest.java
index 8a000a0..9705284 100644
--- a/core/tests/coretests/src/android/view/InsetsStateTest.java
+++ b/core/tests/coretests/src/android/view/InsetsStateTest.java
@@ -37,6 +37,7 @@
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING;
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN;
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
+import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_UNSPECIFIED;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ERROR;
import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
@@ -82,8 +83,8 @@
mState.getSource(ITYPE_IME).setVisible(true);
SparseIntArray typeSideMap = new SparseIntArray();
WindowInsets insets = mState.calculateInsets(new Rect(0, 0, 100, 300), null, false,
- false, DisplayCutout.NO_CUTOUT, SOFT_INPUT_ADJUST_RESIZE, 0, 0,
- TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED, typeSideMap);
+ false, SOFT_INPUT_ADJUST_RESIZE, 0, 0, TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED,
+ typeSideMap);
assertEquals(Insets.of(0, 100, 0, 100), insets.getSystemWindowInsets());
assertEquals(Insets.of(0, 100, 0, 100), insets.getInsets(Type.all()));
assertEquals(ISIDE_TOP, typeSideMap.get(ITYPE_STATUS_BAR));
@@ -99,8 +100,8 @@
mState.getSource(ITYPE_IME).setFrame(new Rect(0, 100, 100, 300));
mState.getSource(ITYPE_IME).setVisible(true);
WindowInsets insets = mState.calculateInsets(new Rect(0, 0, 100, 300), null, false,
- false, DisplayCutout.NO_CUTOUT, SOFT_INPUT_ADJUST_RESIZE, 0, 0,
- TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED, null);
+ false, SOFT_INPUT_ADJUST_RESIZE, 0, 0, TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED,
+ null);
assertEquals(100, insets.getStableInsetBottom());
assertEquals(Insets.of(0, 0, 0, 100), insets.getInsetsIgnoringVisibility(systemBars()));
assertEquals(Insets.of(0, 0, 0, 200), insets.getSystemWindowInsets());
@@ -116,8 +117,7 @@
mState.getSource(ITYPE_NAVIGATION_BAR).setFrame(new Rect(80, 0, 100, 300));
mState.getSource(ITYPE_NAVIGATION_BAR).setVisible(true);
WindowInsets insets = mState.calculateInsets(new Rect(0, 0, 100, 300), null, false,
- false, DisplayCutout.NO_CUTOUT, 0, 0, 0, TYPE_APPLICATION,
- WINDOWING_MODE_UNDEFINED, null);
+ false, 0, 0, 0, TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED, null);
assertEquals(Insets.of(0, 100, 20, 0), insets.getSystemWindowInsets());
assertEquals(Insets.of(0, 100, 0, 0), insets.getInsets(statusBars()));
assertEquals(Insets.of(0, 0, 20, 0), insets.getInsets(navigationBars()));
@@ -130,8 +130,7 @@
mState.getSource(ITYPE_EXTRA_NAVIGATION_BAR).setFrame(new Rect(80, 0, 100, 300));
mState.getSource(ITYPE_EXTRA_NAVIGATION_BAR).setVisible(true);
WindowInsets insets = mState.calculateInsets(new Rect(0, 0, 100, 300), null, false,
- false, DisplayCutout.NO_CUTOUT, 0, 0, 0, TYPE_APPLICATION,
- WINDOWING_MODE_UNDEFINED, null);
+ false, 0, 0, 0, TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED, null);
// ITYPE_CLIMATE_BAR is a type of status bar and ITYPE_EXTRA_NAVIGATION_BAR is a type
// of navigation bar.
assertEquals(Insets.of(0, 100, 20, 0), insets.getSystemWindowInsets());
@@ -146,8 +145,8 @@
mState.getSource(ITYPE_IME).setFrame(new Rect(0, 200, 100, 300));
mState.getSource(ITYPE_IME).setVisible(true);
WindowInsets insets = mState.calculateInsets(new Rect(0, 0, 100, 300), null, false,
- false, DisplayCutout.NO_CUTOUT, SOFT_INPUT_ADJUST_NOTHING, 0, 0,
- TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED, null);
+ false, SOFT_INPUT_ADJUST_NOTHING, 0, 0, TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED,
+ null);
assertEquals(0, insets.getSystemWindowInsetBottom());
assertEquals(100, insets.getInsets(ime()).bottom);
assertTrue(insets.isVisible(ime()));
@@ -160,12 +159,12 @@
mState.getSource(ITYPE_IME).setFrame(new Rect(0, 200, 100, 300));
mState.getSource(ITYPE_IME).setVisible(true);
WindowInsets insets = mState.calculateInsets(new Rect(0, 0, 100, 300), null, false,
- false, DisplayCutout.NO_CUTOUT, SOFT_INPUT_ADJUST_NOTHING, 0,
- SYSTEM_UI_FLAG_LAYOUT_STABLE, TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED, null);
+ false, SOFT_INPUT_ADJUST_NOTHING, 0, SYSTEM_UI_FLAG_LAYOUT_STABLE, TYPE_APPLICATION,
+ WINDOWING_MODE_UNDEFINED, null);
assertEquals(100, insets.getSystemWindowInsetTop());
insets = mState.calculateInsets(new Rect(0, 0, 100, 300), null, false, false,
- DisplayCutout.NO_CUTOUT, SOFT_INPUT_ADJUST_NOTHING, 0,
- 0 /* legacySystemUiFlags */, TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED, null);
+ SOFT_INPUT_ADJUST_NOTHING, 0, 0 /* legacySystemUiFlags */, TYPE_APPLICATION,
+ WINDOWING_MODE_UNDEFINED, null);
assertEquals(0, insets.getSystemWindowInsetTop());
}
@@ -174,12 +173,12 @@
mState.getSource(ITYPE_STATUS_BAR).setFrame(new Rect(0, 0, 100, 100));
mState.getSource(ITYPE_STATUS_BAR).setVisible(false);
WindowInsets insets = mState.calculateInsets(new Rect(0, 0, 100, 300), null, false,
- false, DisplayCutout.NO_CUTOUT, SOFT_INPUT_ADJUST_NOTHING, FLAG_FULLSCREEN,
- SYSTEM_UI_FLAG_LAYOUT_STABLE, TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED, null);
+ false, SOFT_INPUT_ADJUST_NOTHING, FLAG_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_STABLE,
+ TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED, null);
assertEquals(0, insets.getSystemWindowInsetTop());
insets = mState.calculateInsets(new Rect(0, 0, 100, 300), null, false, false,
- DisplayCutout.NO_CUTOUT, SOFT_INPUT_ADJUST_NOTHING, 0,
- 0 /* legacySystemUiFlags */, TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED, null);
+ SOFT_INPUT_ADJUST_NOTHING, 0, 0 /* legacySystemUiFlags */, TYPE_APPLICATION,
+ WINDOWING_MODE_UNDEFINED, null);
assertEquals(0, insets.getSystemWindowInsetTop());
}
@@ -188,19 +187,19 @@
mState.getSource(ITYPE_STATUS_BAR).setFrame(new Rect(0, 0, 100, 100));
mState.getSource(ITYPE_STATUS_BAR).setVisible(true);
WindowInsets insets = mState.calculateInsets(new Rect(0, 0, 100, 300), null, false,
- false, DisplayCutout.NO_CUTOUT, SOFT_INPUT_ADJUST_NOTHING, FLAG_LAYOUT_NO_LIMITS,
+ false, SOFT_INPUT_ADJUST_NOTHING, FLAG_LAYOUT_NO_LIMITS,
0 /* legacySystemUiFlags */, TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED, null);
assertEquals(0, insets.getSystemWindowInsetTop());
insets = mState.calculateInsets(new Rect(0, 0, 100, 300), null, false,
- false, DisplayCutout.NO_CUTOUT, SOFT_INPUT_ADJUST_NOTHING, FLAG_LAYOUT_NO_LIMITS,
+ false, SOFT_INPUT_ADJUST_NOTHING, FLAG_LAYOUT_NO_LIMITS,
0 /* legacySystemUiFlags */, TYPE_SYSTEM_ERROR, WINDOWING_MODE_UNDEFINED, null);
assertEquals(100, insets.getSystemWindowInsetTop());
insets = mState.calculateInsets(new Rect(0, 0, 100, 300), null, false,
- false, DisplayCutout.NO_CUTOUT, SOFT_INPUT_ADJUST_NOTHING, FLAG_LAYOUT_NO_LIMITS,
+ false, SOFT_INPUT_ADJUST_NOTHING, FLAG_LAYOUT_NO_LIMITS,
0 /* legacySystemUiFlags */, TYPE_WALLPAPER, WINDOWING_MODE_UNDEFINED, null);
assertEquals(100, insets.getSystemWindowInsetTop());
insets = mState.calculateInsets(new Rect(0, 0, 100, 300), null, false,
- false, DisplayCutout.NO_CUTOUT, SOFT_INPUT_ADJUST_NOTHING, FLAG_LAYOUT_NO_LIMITS,
+ false, SOFT_INPUT_ADJUST_NOTHING, FLAG_LAYOUT_NO_LIMITS,
0 /* legacySystemUiFlags */, TYPE_APPLICATION, WINDOWING_MODE_FREEFORM, null);
assertEquals(100, insets.getSystemWindowInsetTop());
}
@@ -235,8 +234,7 @@
mState.getSource(ITYPE_EXTRA_NAVIGATION_BAR).setFrame(new Rect(80, 0, 100, 300));
mState.getSource(ITYPE_EXTRA_NAVIGATION_BAR).setVisible(true);
WindowInsets insets = mState.calculateInsets(new Rect(0, 0, 100, 300), null, false,
- false, DisplayCutout.NO_CUTOUT, 0, 0, 0, TYPE_APPLICATION,
- WINDOWING_MODE_UNDEFINED, null);
+ false, 0, 0, 0, TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED, null);
assertEquals(Insets.of(0, 100, 20, 0), insets.getSystemWindowInsets());
assertEquals(Insets.of(0, 100, 0, 0), insets.getInsets(statusBars()));
assertEquals(Insets.of(0, 0, 20, 0), insets.getInsets(navigationBars()));
@@ -249,8 +247,7 @@
mState.getSource(ITYPE_NAVIGATION_BAR).setFrame(new Rect(80, 0, 100, 300));
mState.getSource(ITYPE_NAVIGATION_BAR).setVisible(true);
WindowInsets insets = mState.calculateInsets(new Rect(0, 0, 100, 300), null, false,
- false, DisplayCutout.NO_CUTOUT, 0, 0, 0, TYPE_APPLICATION,
- WINDOWING_MODE_UNDEFINED, null);
+ false, 0, 0, 0, TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED, null);
assertEquals(Insets.of(0, 100, 20, 0), insets.getSystemWindowInsets());
assertEquals(Insets.of(0, 100, 0, 0), insets.getInsets(statusBars()));
assertEquals(Insets.of(0, 0, 20, 0), insets.getInsets(navigationBars()));
@@ -264,8 +261,7 @@
mState.getSource(ITYPE_IME).setVisible(true);
mState.removeSource(ITYPE_IME);
WindowInsets insets = mState.calculateInsets(new Rect(0, 0, 100, 300), null, false, false,
- DisplayCutout.NO_CUTOUT, SOFT_INPUT_ADJUST_RESIZE, 0, 0, TYPE_APPLICATION,
- WINDOWING_MODE_UNDEFINED, null);
+ SOFT_INPUT_ADJUST_RESIZE, 0, 0, TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED, null);
assertEquals(0, insets.getSystemWindowInsetBottom());
}
@@ -406,6 +402,31 @@
mState.calculateUncontrollableInsetsFromFrame(new Rect(50, 0, 150, 300)));
}
+ @Test
+ public void testCalculateRelativeCutout() {
+ mState.setDisplayFrame(new Rect(0, 0, 200, 300));
+ mState.setDisplayCutout(new DisplayCutout(Insets.of(1, 2, 3, 4),
+ new Rect(0, 0, 1, 2),
+ new Rect(0, 0, 1, 2),
+ new Rect(197, 296, 200, 300),
+ new Rect(197, 296, 200, 300)));
+ DisplayCutout cutout = mState.calculateInsets(new Rect(1, 1, 199, 300), null, false, false,
+ SOFT_INPUT_ADJUST_UNSPECIFIED, 0, 0, TYPE_APPLICATION, WINDOWING_MODE_UNDEFINED,
+ new SparseIntArray()).getDisplayCutout();
+ assertEquals(0, cutout.getSafeInsetLeft());
+ assertEquals(1, cutout.getSafeInsetTop());
+ assertEquals(2, cutout.getSafeInsetRight());
+ assertEquals(4, cutout.getSafeInsetBottom());
+ assertEquals(new Rect(-1, -1, 0, 1),
+ cutout.getBoundingRectLeft());
+ assertEquals(new Rect(-1, -1, 0, 1),
+ cutout.getBoundingRectTop());
+ assertEquals(new Rect(196, 295, 199, 299),
+ cutout.getBoundingRectRight());
+ assertEquals(new Rect(196, 295, 199, 299),
+ cutout.getBoundingRectBottom());
+ }
+
private void assertEqualsAndHashCode() {
assertEquals(mState, mState2);
assertEquals(mState.hashCode(), mState2.hashCode());
diff --git a/core/tests/coretests/src/android/view/accessibility/AccessibilityInteractionClientTest.java b/core/tests/coretests/src/android/view/accessibility/AccessibilityInteractionClientTest.java
index 7e1e7f4..ab24f89 100644
--- a/core/tests/coretests/src/android/view/accessibility/AccessibilityInteractionClientTest.java
+++ b/core/tests/coretests/src/android/view/accessibility/AccessibilityInteractionClientTest.java
@@ -33,6 +33,9 @@
import org.junit.runner.RunWith;
import org.mockito.Mock;
+import java.util.Arrays;
+import java.util.List;
+
/**
* Tests for AccessibilityInteractionClient
*/
@@ -62,7 +65,7 @@
final long accessibilityNodeId = 0x4321L;
AccessibilityNodeInfo nodeFromConnection = AccessibilityNodeInfo.obtain();
nodeFromConnection.setSourceNodeId(accessibilityNodeId, windowId);
- mMockConnection.mInfoToReturn = nodeFromConnection;
+ mMockConnection.mInfosToReturn = Arrays.asList(nodeFromConnection);
AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();
AccessibilityNodeInfo node = client.findAccessibilityNodeInfoByAccessibilityId(
MOCK_CONNECTION_ID, windowId, accessibilityNodeId, true, 0, null);
@@ -72,7 +75,7 @@
}
private static class MockConnection extends AccessibilityServiceConnectionImpl {
- AccessibilityNodeInfo mInfoToReturn;
+ List<AccessibilityNodeInfo> mInfosToReturn;
@Override
public String[] findAccessibilityNodeInfoByAccessibilityId(int accessibilityWindowId,
@@ -80,7 +83,7 @@
IAccessibilityInteractionConnectionCallback callback, int flags, long threadId,
Bundle arguments) {
try {
- callback.setFindAccessibilityNodeInfoResult(mInfoToReturn, interactionId);
+ callback.setFindAccessibilityNodeInfosResult(mInfosToReturn, interactionId);
} catch (RemoteException e) {
throw new RuntimeException(e);
}
diff --git a/core/tests/coretests/src/android/widget/TextViewTest.java b/core/tests/coretests/src/android/widget/TextViewTest.java
index 40ecf9a..66fdfff 100644
--- a/core/tests/coretests/src/android/widget/TextViewTest.java
+++ b/core/tests/coretests/src/android/widget/TextViewTest.java
@@ -16,6 +16,9 @@
package android.widget;
+import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
+import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
+
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotNull;
@@ -30,6 +33,7 @@
import android.text.Layout;
import android.text.PrecomputedText;
import android.view.View;
+import android.view.inputmethod.EditorInfo;
import android.widget.TextView.BufferType;
import androidx.test.InstrumentationRegistry;
@@ -254,6 +258,24 @@
assertEquals("", mTextView.getTransformed().toString());
}
+ @Test
+ @UiThreadTest
+ public void testPortraitDoesntSupportFullscreenIme() {
+ mActivity.setRequestedOrientation(SCREEN_ORIENTATION_PORTRAIT);
+ mTextView = new NullSetTextTextView(mActivity);
+ mTextView.requestFocus();
+ assertEquals("IME_FLAG_NO_FULLSCREEN should be set",
+ mTextView.getImeOptions(),
+ mTextView.getImeOptions() & EditorInfo.IME_FLAG_NO_FULLSCREEN);
+
+ mTextView.clearFocus();
+ mActivity.setRequestedOrientation(SCREEN_ORIENTATION_LANDSCAPE);
+ mTextView = new NullSetTextTextView(mActivity);
+ mTextView.requestFocus();
+ assertEquals("IME_FLAG_NO_FULLSCREEN should not be set",
+ 0, mTextView.getImeOptions() & EditorInfo.IME_FLAG_NO_FULLSCREEN);
+ }
+
private String createLongText() {
int size = 600 * 1000;
final StringBuilder builder = new StringBuilder(size);
diff --git a/core/tests/coretests/src/com/android/internal/inputmethod/InputMethodDebugTest.java b/core/tests/coretests/src/com/android/internal/inputmethod/InputMethodDebugTest.java
index 222e494..32bfdcb 100644
--- a/core/tests/coretests/src/com/android/internal/inputmethod/InputMethodDebugTest.java
+++ b/core/tests/coretests/src/com/android/internal/inputmethod/InputMethodDebugTest.java
@@ -65,4 +65,12 @@
InputMethodDebug.startInputFlagsToString(
StartInputFlags.VIEW_HAS_FOCUS | StartInputFlags.INITIAL_CONNECTION));
}
+
+ @Test
+ public void testSoftInputDisplayReasonToString() {
+ // TODO: add more tests
+ assertEquals("HIDE_REMOVE_CLIENT",
+ InputMethodDebug.softInputDisplayReasonToString(
+ SoftInputShowHideReason.HIDE_REMOVE_CLIENT));
+ }
}
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
index 67f4c8a..bd41542 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
@@ -38,6 +38,7 @@
BatteryStatsTimeBaseTest.class,
BatteryStatsTimerTest.class,
BatteryStatsUidTest.class,
+ BatteryUsageStatsTest.class,
BatteryStatsUserLifecycleTests.class,
BluetoothPowerCalculatorTest.class,
BstatsCpuTimesValidationTest.class,
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsTest.java
new file mode 100644
index 0000000..96e9c4a
--- /dev/null
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsTest.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.internal.os;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.junit.Assert.fail;
+
+import android.os.BatteryConsumer;
+import android.os.BatteryUsageStats;
+import android.os.Parcel;
+import android.os.SystemBatteryConsumer;
+import android.os.UidBatteryConsumer;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.List;
+
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class BatteryUsageStatsTest {
+
+ @Test
+ public void testBuilder() {
+ BatteryUsageStats batteryUsageStats = buildBatteryUsageStats();
+ validateBatteryUsageStats(batteryUsageStats);
+ }
+
+ @Test
+ public void testParcelability() {
+ final BatteryUsageStats outBatteryUsageStats = buildBatteryUsageStats();
+ final Parcel outParcel = Parcel.obtain();
+ outParcel.writeParcelable(outBatteryUsageStats, 0);
+ final byte[] bytes = outParcel.marshall();
+ outParcel.recycle();
+
+ final Parcel inParcel = Parcel.obtain();
+ inParcel.unmarshall(bytes, 0, bytes.length);
+ inParcel.setDataPosition(0);
+ final BatteryUsageStats inBatteryUsageStats =
+ inParcel.readParcelable(getClass().getClassLoader());
+ assertThat(inBatteryUsageStats).isNotNull();
+ validateBatteryUsageStats(inBatteryUsageStats);
+ }
+
+ private BatteryUsageStats buildBatteryUsageStats() {
+ final MockClocks clocks = new MockClocks();
+ final MockBatteryStatsImpl batteryStats = new MockBatteryStatsImpl(clocks);
+ final BatteryStatsImpl.Uid batteryStatsUid = batteryStats.getUidStatsLocked(2000);
+
+ final BatteryUsageStats.Builder builder = new BatteryUsageStats.Builder(1, 1, true);
+ builder.setConsumedPower(100);
+ builder.setDischargePercentage(20);
+
+ final UidBatteryConsumer.Builder uidBatteryConsumerBuilder =
+ builder.getOrCreateUidBatteryConsumerBuilder(batteryStatsUid);
+ uidBatteryConsumerBuilder.setPackageWithHighestDrain("foo");
+ uidBatteryConsumerBuilder.setConsumedPower(200);
+ uidBatteryConsumerBuilder.setConsumedPower(BatteryConsumer.POWER_COMPONENT_USAGE, 300);
+ uidBatteryConsumerBuilder.setConsumedPower(BatteryConsumer.POWER_COMPONENT_CPU, 400);
+ uidBatteryConsumerBuilder.setConsumedPowerForCustomComponent(
+ BatteryConsumer.FIRST_CUSTOM_POWER_COMPONENT_ID, 500);
+ uidBatteryConsumerBuilder.setConsumedPowerForCustomComponent(
+ BatteryConsumer.FIRST_MODELED_POWER_COMPONENT_ID
+ + BatteryConsumer.POWER_COMPONENT_CPU, 510);
+ uidBatteryConsumerBuilder.setUsageDurationMillis(BatteryConsumer.TIME_COMPONENT_CPU, 600);
+ uidBatteryConsumerBuilder.setUsageDurationMillis(
+ BatteryConsumer.TIME_COMPONENT_CPU_FOREGROUND, 700);
+ uidBatteryConsumerBuilder.setUsageDurationForCustomComponentMillis(
+ BatteryConsumer.FIRST_CUSTOM_TIME_COMPONENT_ID, 800);
+
+ final SystemBatteryConsumer.Builder systemBatteryConsumerBuilder =
+ builder.getOrCreateSystemBatteryConsumerBuilder(
+ SystemBatteryConsumer.DRAIN_TYPE_CAMERA);
+ systemBatteryConsumerBuilder.setConsumedPower(10000);
+ systemBatteryConsumerBuilder.setConsumedPower(BatteryConsumer.POWER_COMPONENT_CPU, 10100);
+ systemBatteryConsumerBuilder.setConsumedPowerForCustomComponent(
+ BatteryConsumer.FIRST_CUSTOM_POWER_COMPONENT_ID, 10200);
+ systemBatteryConsumerBuilder.setConsumedPowerForCustomComponent(
+ BatteryConsumer.FIRST_MODELED_POWER_COMPONENT_ID
+ + BatteryConsumer.POWER_COMPONENT_CPU, 10210);
+ systemBatteryConsumerBuilder.setUsageDurationMillis(
+ BatteryConsumer.TIME_COMPONENT_CPU, 10300);
+ systemBatteryConsumerBuilder.setUsageDurationForCustomComponentMillis(
+ BatteryConsumer.FIRST_CUSTOM_TIME_COMPONENT_ID, 10400);
+
+ return builder.build();
+ }
+
+ public void validateBatteryUsageStats(BatteryUsageStats batteryUsageStats) {
+ assertThat(batteryUsageStats.getConsumedPower()).isEqualTo(100);
+ assertThat(batteryUsageStats.getDischargePercentage()).isEqualTo(20);
+
+ final List<UidBatteryConsumer> uidBatteryConsumers =
+ batteryUsageStats.getUidBatteryConsumers();
+ for (UidBatteryConsumer uidBatteryConsumer : uidBatteryConsumers) {
+ if (uidBatteryConsumer.getUid() == 2000) {
+ assertThat(uidBatteryConsumer.getPackageWithHighestDrain()).isEqualTo("foo");
+ assertThat(uidBatteryConsumer.getConsumedPower()).isEqualTo(200);
+ assertThat(uidBatteryConsumer.getConsumedPower(
+ BatteryConsumer.POWER_COMPONENT_USAGE)).isEqualTo(300);
+ assertThat(uidBatteryConsumer.getConsumedPower(
+ BatteryConsumer.POWER_COMPONENT_CPU)).isEqualTo(400);
+ assertThat(uidBatteryConsumer.getConsumedPowerForCustomComponent(
+ BatteryConsumer.FIRST_CUSTOM_POWER_COMPONENT_ID)).isEqualTo(500);
+ assertThat(uidBatteryConsumer.getConsumedPowerForCustomComponent(
+ BatteryConsumer.FIRST_MODELED_POWER_COMPONENT_ID
+ + BatteryConsumer.POWER_COMPONENT_CPU)).isEqualTo(510);
+ assertThat(uidBatteryConsumer.getUsageDurationMillis(
+ BatteryConsumer.TIME_COMPONENT_CPU)).isEqualTo(600);
+ assertThat(uidBatteryConsumer.getUsageDurationMillis(
+ BatteryConsumer.TIME_COMPONENT_CPU_FOREGROUND)).isEqualTo(700);
+ assertThat(uidBatteryConsumer.getUsageDurationForCustomComponentMillis(
+ BatteryConsumer.FIRST_CUSTOM_TIME_COMPONENT_ID)).isEqualTo(800);
+ } else {
+ fail("Unexpected UID " + uidBatteryConsumer.getUid());
+ }
+ }
+
+ final List<SystemBatteryConsumer> systemBatteryConsumers =
+ batteryUsageStats.getSystemBatteryConsumers();
+ for (SystemBatteryConsumer systemBatteryConsumer : systemBatteryConsumers) {
+ if (systemBatteryConsumer.getDrainType() == SystemBatteryConsumer.DRAIN_TYPE_CAMERA) {
+ assertThat(systemBatteryConsumer.getConsumedPower()).isEqualTo(10000);
+ assertThat(systemBatteryConsumer.getConsumedPower(
+ BatteryConsumer.POWER_COMPONENT_CPU)).isEqualTo(10100);
+ assertThat(systemBatteryConsumer.getConsumedPowerForCustomComponent(
+ BatteryConsumer.FIRST_CUSTOM_POWER_COMPONENT_ID)).isEqualTo(10200);
+ assertThat(systemBatteryConsumer.getConsumedPowerForCustomComponent(
+ BatteryConsumer.FIRST_MODELED_POWER_COMPONENT_ID
+ + BatteryConsumer.POWER_COMPONENT_CPU)).isEqualTo(10210);
+ assertThat(systemBatteryConsumer.getUsageDurationMillis(
+ BatteryConsumer.TIME_COMPONENT_CPU)).isEqualTo(10300);
+ assertThat(systemBatteryConsumer.getUsageDurationForCustomComponentMillis(
+ BatteryConsumer.FIRST_CUSTOM_TIME_COMPONENT_ID)).isEqualTo(10400);
+ } else {
+ fail("Unexpected drain type " + systemBatteryConsumer.getDrainType());
+ }
+ }
+ }
+}
diff --git a/core/tests/mockingcoretests/src/android/app/activity/ActivityThreadClientTest.java b/core/tests/mockingcoretests/src/android/app/activity/ActivityThreadClientTest.java
index a74f580..d2b20b4 100644
--- a/core/tests/mockingcoretests/src/android/app/activity/ActivityThreadClientTest.java
+++ b/core/tests/mockingcoretests/src/android/app/activity/ActivityThreadClientTest.java
@@ -242,7 +242,7 @@
}
private void startActivity(ActivityClientRecord r) {
- mThread.handleStartActivity(r, null /* pendingActions */);
+ mThread.handleStartActivity(r, null /* pendingActions */, null /* activityOptions */);
}
private void resumeActivity(ActivityClientRecord r) {
@@ -295,8 +295,9 @@
0 /* ident */, info, new Configuration(),
CompatibilityInfo.DEFAULT_COMPATIBILITY_INFO, null /* referrer */,
null /* voiceInteractor */, null /* state */, null /* persistentState */,
- null /* pendingResults */, null /* pendingNewIntents */, true /* isForward */,
- null /* profilerInfo */, mThread /* client */, null /* asssitToken */,
+ null /* pendingResults */, null /* pendingNewIntents */,
+ null /* activityOptions */, true /* isForward */, null /* profilerInfo */,
+ mThread /* client */, null /* asssitToken */,
null /* fixedRotationAdjustments */);
}
diff --git a/data/etc/privapp-permissions-platform.xml b/data/etc/privapp-permissions-platform.xml
index 2e12795..91e6455 100644
--- a/data/etc/privapp-permissions-platform.xml
+++ b/data/etc/privapp-permissions-platform.xml
@@ -350,6 +350,8 @@
<permission name="android.permission.MOUNT_FORMAT_FILESYSTEMS"/>
<permission name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<permission name="android.permission.MOVE_PACKAGE"/>
+ <!-- Needed for test only -->
+ <permission name="android.permission.NETWORK_AIRPLANE_MODE"/>
<permission name="android.permission.OBSERVE_APP_USAGE"/>
<permission name="android.permission.NETWORK_SCAN"/>
<permission name="android.permission.PACKAGE_USAGE_STATS" />
diff --git a/data/keyboards/Vendor_0957_Product_0001.idc b/data/keyboards/Vendor_0957_Product_0001.idc
new file mode 100644
index 0000000..e1f4346
--- /dev/null
+++ b/data/keyboards/Vendor_0957_Product_0001.idc
@@ -0,0 +1,23 @@
+# Copyright (C) 2021 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.
+
+#
+# Input Device Configuration file for Google Reference RCU Remote.
+#
+#
+
+# Basic Parameters
+keyboard.layout = Vendor_0957_Product_0001
+keyboard.characterMap = Vendor_0957_Product_0001
+audio.mic = 1
\ No newline at end of file
diff --git a/data/keyboards/Vendor_0957_Product_0001.kl b/data/keyboards/Vendor_0957_Product_0001.kl
new file mode 100644
index 0000000..e9f4f28
--- /dev/null
+++ b/data/keyboards/Vendor_0957_Product_0001.kl
@@ -0,0 +1,72 @@
+# Copyright (C) 2021 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.
+
+#
+# Key Layout file for Google Reference RCU Remote.
+#
+
+key 116 POWER WAKE
+key 217 ASSIST WAKE
+
+key 103 DPAD_UP
+key 108 DPAD_DOWN
+key 105 DPAD_LEFT
+key 106 DPAD_RIGHT
+key 353 DPAD_CENTER
+
+key 158 BACK
+key 172 HOME WAKE
+
+key 113 VOLUME_MUTE
+key 114 VOLUME_DOWN
+key 115 VOLUME_UP
+
+key 2 1
+key 3 2
+key 4 3
+key 5 4
+key 6 5
+key 7 6
+key 8 7
+key 9 8
+key 10 9
+key 11 0
+
+# custom keys
+key usage 0x000c01BB TV_INPUT
+key usage 0x000c022A BOOKMARK
+key usage 0x000c0096 SETTINGS
+key usage 0x000c0097 NOTIFICATION
+key usage 0x000c008D GUIDE
+key usage 0x000c0089 TV
+key usage 0x000c009C CHANNEL_UP
+key usage 0x000c009D CHANNEL_DOWN
+key usage 0x000c00CD MEDIA_PLAY_PAUSE
+key usage 0x000c00B4 MEDIA_SKIP_BACKWARD
+key usage 0x000c00B3 MEDIA_SKIP_FORWARD
+key usage 0x000c0226 MEDIA_STOP
+
+key usage 0x000c0077 BUTTON_3 WAKE #YouTube
+key usage 0x000c0078 BUTTON_4 WAKE #Netflix
+key usage 0x000c0079 BUTTON_6 WAKE #Disney+
+key usage 0x000c007A BUTTON_7 WAKE #HBOmax
+
+key usage 0x000c01BD INFO
+key usage 0x000c0061 CAPTIONS
+key usage 0x000c0185 TV_TELETEXT
+
+key usage 0x000c0069 PROG_RED
+key usage 0x000c006A PROG_GREEN
+key usage 0x000c006B PROG_BLUE
+key usage 0x000c006C PROG_YELLOW
\ No newline at end of file
diff --git a/data/keyboards/keyboards.mk b/data/keyboards/keyboards.mk
index 68cbd29..c7ce8cd 100644
--- a/data/keyboards/keyboards.mk
+++ b/data/keyboards/keyboards.mk
@@ -14,13 +14,9 @@
# Warning: this is actually a product definition, to be inherited from
-include $(LOCAL_PATH)/common.mk
+PRODUCT_COPY_FILES := \
+ $(call find-copy-subdir-files,*.kl,$(LOCAL_PATH),system/usr/keylayout) \
+ $(call find-copy-subdir-files,*.kcm,$(LOCAL_PATH),system/usr/keychars) \
+ $(call find-copy-subdir-files,*.idc,$(LOCAL_PATH),system/usr/idc)
-PRODUCT_COPY_FILES := $(foreach file,$(framework_keylayouts),\
- $(file):system/usr/keylayout/$(notdir $(file)))
-PRODUCT_COPY_FILES += $(foreach file,$(framework_keycharmaps),\
- $(file):system/usr/keychars/$(notdir $(file)))
-
-PRODUCT_COPY_FILES += $(foreach file,$(framework_keyconfigs),\
- $(file):system/usr/idc/$(notdir $(file)))
diff --git a/graphics/OWNERS b/graphics/OWNERS
index a6d1bc3..5851cbb 100644
--- a/graphics/OWNERS
+++ b/graphics/OWNERS
@@ -1 +1 @@
-include /core/java/android/graphics/OWNERS
+include /graphics/java/android/graphics/OWNERS
\ No newline at end of file
diff --git a/graphics/java/android/graphics/BLASTBufferQueue.java b/graphics/java/android/graphics/BLASTBufferQueue.java
index 4309ab2..4914336 100644
--- a/graphics/java/android/graphics/BLASTBufferQueue.java
+++ b/graphics/java/android/graphics/BLASTBufferQueue.java
@@ -34,6 +34,21 @@
private static native void nativeSetNextTransaction(long ptr, long transactionPtr);
private static native void nativeUpdate(long ptr, long surfaceControl, long width, long height);
private static native void nativeFlushShadowQueue(long ptr);
+ private static native void nativeMergeWithNextTransaction(long ptr, long transactionPtr,
+ long frameNumber);
+ private static native void nativeSetTransactionCompleteCallback(long ptr, long frameNumber,
+ TransactionCompleteCallback callback);
+
+ /**
+ * Callback sent to {@link #setTransactionCompleteCallback(long, TransactionCompleteCallback)}
+ */
+ public interface TransactionCompleteCallback {
+ /**
+ * Invoked when the transaction has completed.
+ * @param frameNumber The frame number of the buffer that was in that transaction
+ */
+ void onTransactionComplete(long frameNumber);
+ }
/** Create a new connection with the surface flinger. */
public BLASTBufferQueue(String name, SurfaceControl sc, int width, int height,
@@ -74,6 +89,16 @@
nativeUpdate(mNativeObject, sc.mNativeObject, width, height);
}
+ /**
+ * Set a callback when the transaction with the frame number has been completed.
+ * @param frameNumber The frame number to get the transaction complete callback for
+ * @param completeCallback The callback that should be invoked.
+ */
+ public void setTransactionCompleteCallback(long frameNumber,
+ @Nullable TransactionCompleteCallback completeCallback) {
+ nativeSetTransactionCompleteCallback(mNativeObject, frameNumber, completeCallback);
+ }
+
@Override
protected void finalize() throws Throwable {
try {
@@ -88,4 +113,14 @@
public void flushShadowQueue() {
nativeFlushShadowQueue(mNativeObject);
}
+
+ /**
+ * Merge the transaction passed in to the next transaction in BlastBufferQueue. The next
+ * transaction will be applied or merged when the next frame with specified frame number
+ * is available.
+ */
+ public void mergeWithNextTransaction(SurfaceControl.Transaction t, long frameNumber) {
+ nativeMergeWithNextTransaction(mNativeObject, t.mNativeObject, frameNumber);
+ }
+
}
diff --git a/graphics/java/android/graphics/drawable/Icon.java b/graphics/java/android/graphics/drawable/Icon.java
index dcd4f33..8da8056 100644
--- a/graphics/java/android/graphics/drawable/Icon.java
+++ b/graphics/java/android/graphics/drawable/Icon.java
@@ -21,7 +21,6 @@
import android.annotation.ColorInt;
import android.annotation.DrawableRes;
-import android.annotation.IdRes;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.compat.annotation.UnsupportedAppUsage;
@@ -248,7 +247,7 @@
* Note: This resource may not be available if the application changes at all, and it is
* up to the caller to ensure safety if this resource is re-used and/or persisted.
*/
- @IdRes
+ @DrawableRes
public int getResId() {
if (mType != TYPE_RESOURCE) {
throw new IllegalStateException("called getResId() on " + this);
diff --git a/keystore/java/android/security/AndroidProtectedConfirmation.java b/keystore/java/android/security/AndroidProtectedConfirmation.java
new file mode 100644
index 0000000..dfe485a
--- /dev/null
+++ b/keystore/java/android/security/AndroidProtectedConfirmation.java
@@ -0,0 +1,118 @@
+/*
+ * 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.security;
+
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import android.os.ServiceSpecificException;
+import android.security.apc.IConfirmationCallback;
+import android.security.apc.IProtectedConfirmation;
+import android.security.apc.ResponseCode;
+import android.util.Log;
+
+/**
+ * @hide
+ */
+public class AndroidProtectedConfirmation {
+ private static final String TAG = "AndroidProtectedConfirmation";
+
+ public static final int ERROR_OK = ResponseCode.OK;
+ public static final int ERROR_CANCELED = ResponseCode.CANCELLED;
+ public static final int ERROR_ABORTED = ResponseCode.ABORTED;
+ public static final int ERROR_OPERATION_PENDING = ResponseCode.OPERATION_PENDING;
+ public static final int ERROR_IGNORED = ResponseCode.IGNORED;
+ public static final int ERROR_SYSTEM_ERROR = ResponseCode.SYSTEM_ERROR;
+ public static final int ERROR_UNIMPLEMENTED = ResponseCode.UNIMPLEMENTED;
+
+ public static final int FLAG_UI_OPTION_INVERTED =
+ IProtectedConfirmation.FLAG_UI_OPTION_INVERTED;
+ public static final int FLAG_UI_OPTION_MAGNIFIED =
+ IProtectedConfirmation.FLAG_UI_OPTION_MAGNIFIED;
+
+ private IProtectedConfirmation mProtectedConfirmation;
+
+ public AndroidProtectedConfirmation() {
+ mProtectedConfirmation = null;
+ }
+
+ private synchronized IProtectedConfirmation getService() {
+ if (mProtectedConfirmation == null) {
+ mProtectedConfirmation = IProtectedConfirmation.Stub.asInterface(ServiceManager
+ .getService("android.security.apc"));
+ }
+ return mProtectedConfirmation;
+ }
+
+ /**
+ * Requests keystore call into the confirmationui HAL to display a prompt.
+ *
+ * @param listener the binder to use for callbacks.
+ * @param promptText the prompt to display.
+ * @param extraData extra data / nonce from application.
+ * @param locale the locale as a BCP 47 language tag.
+ * @param uiOptionsAsFlags the UI options to use, as flags.
+ * @return one of the {@code CONFIRMATIONUI_*} constants, for
+ * example {@code KeyStore.CONFIRMATIONUI_OK}.
+ */
+ public int presentConfirmationPrompt(IConfirmationCallback listener, String promptText,
+ byte[] extraData, String locale, int uiOptionsAsFlags) {
+ try {
+ getService().presentPrompt(listener, promptText, extraData, locale,
+ uiOptionsAsFlags);
+ return ERROR_OK;
+ } catch (RemoteException e) {
+ Log.w(TAG, "Cannot connect to keystore", e);
+ return ERROR_SYSTEM_ERROR;
+ } catch (ServiceSpecificException e) {
+ return e.errorCode;
+ }
+ }
+
+ /**
+ * Requests keystore call into the confirmationui HAL to cancel displaying a prompt.
+ *
+ * @param listener the binder passed to the {@link #presentConfirmationPrompt} method.
+ * @return one of the {@code CONFIRMATIONUI_*} constants, for
+ * example {@code KeyStore.CONFIRMATIONUI_OK}.
+ */
+ public int cancelConfirmationPrompt(IConfirmationCallback listener) {
+ try {
+ getService().cancelPrompt(listener);
+ return ERROR_OK;
+ } catch (RemoteException e) {
+ Log.w(TAG, "Cannot connect to keystore", e);
+ return ERROR_SYSTEM_ERROR;
+ } catch (ServiceSpecificException e) {
+ return e.errorCode;
+ }
+ }
+
+ /**
+ * Requests keystore to check if the confirmationui HAL is available.
+ *
+ * @return whether the confirmationUI HAL is available.
+ */
+ public boolean isConfirmationPromptSupported() {
+ try {
+ return getService().isSupported();
+ } catch (RemoteException e) {
+ Log.w(TAG, "Cannot connect to keystore", e);
+ return false;
+ }
+ }
+
+}
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStore3DESCipherSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStore3DESCipherSpi.java
index 0775a1a..56f7ea8 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStore3DESCipherSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStore3DESCipherSpi.java
@@ -41,7 +41,7 @@
*
* @hide
*/
-public class AndroidKeyStore3DESCipherSpi extends AndroidKeyStoreCipherSpiBase {
+public abstract class AndroidKeyStore3DESCipherSpi extends AndroidKeyStoreCipherSpiBase {
private static final int BLOCK_SIZE_BYTES = 8;
@@ -73,12 +73,22 @@
public NoPadding() {
super(KeymasterDefs.KM_PAD_NONE);
}
+
+ @Override
+ protected final String getTransform() {
+ return "DESede/ECB/NoPadding";
+ }
}
public static class PKCS7Padding extends ECB {
public PKCS7Padding() {
super(KeymasterDefs.KM_PAD_PKCS7);
}
+
+ @Override
+ protected final String getTransform() {
+ return "DESede/ECB/PKCS7Padding";
+ }
}
}
@@ -91,12 +101,23 @@
public NoPadding() {
super(KeymasterDefs.KM_PAD_NONE);
}
+
+ @Override
+ protected final String getTransform() {
+ return "DESede/CBC/NoPadding";
+ }
+
}
public static class PKCS7Padding extends CBC {
public PKCS7Padding() {
super(KeymasterDefs.KM_PAD_PKCS7);
}
+
+ @Override
+ protected final String getTransform() {
+ return "DESede/CBC/PKCS7Padding";
+ }
}
}
@@ -288,7 +309,7 @@
if (parameters != null) {
for (KeyParameter p : parameters) {
if (p.tag == KeymasterDefs.KM_TAG_NONCE) {
- returnedIv = p.blob;
+ returnedIv = p.value.getBlob();
break;
}
}
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreAuthenticatedAESCipherSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreAuthenticatedAESCipherSpi.java
index bc56f01..64da837 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreAuthenticatedAESCipherSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreAuthenticatedAESCipherSpi.java
@@ -64,6 +64,11 @@
}
@Override
+ protected final String getTransform() {
+ return "AES/GCM/NoPadding";
+ }
+
+ @Override
protected final void resetAll() {
mTagLengthBits = DEFAULT_TAG_LENGTH_BITS;
super.resetAll();
@@ -325,7 +330,7 @@
if (parameters != null) {
for (KeyParameter p : parameters) {
if (p.tag == KeymasterDefs.KM_TAG_NONCE) {
- returnedIv = p.blob;
+ returnedIv = p.value.getBlob();
break;
}
}
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreBCWorkaroundProvider.java b/keystore/java/android/security/keystore2/AndroidKeyStoreBCWorkaroundProvider.java
index dd943d4..9ad6f3a 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreBCWorkaroundProvider.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreBCWorkaroundProvider.java
@@ -254,13 +254,13 @@
private void putAsymmetricCipherImpl(String transformation, String implClass) {
put("Cipher." + transformation, implClass);
put("Cipher." + transformation + " SupportedKeyClasses",
- KEYSTORE_PRIVATE_KEY_CLASS_NAME + "|" + KEYSTORE_PUBLIC_KEY_CLASS_NAME);
+ KEYSTORE_PRIVATE_KEY_CLASS_NAME);
}
private void putSignatureImpl(String algorithm, String implClass) {
put("Signature." + algorithm, implClass);
put("Signature." + algorithm + " SupportedKeyClasses",
- KEYSTORE_PRIVATE_KEY_CLASS_NAME + "|" + KEYSTORE_PUBLIC_KEY_CLASS_NAME);
+ KEYSTORE_PRIVATE_KEY_CLASS_NAME);
}
public static String[] getSupportedEcdsaSignatureDigests() {
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java b/keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java
index a3b04ab..2ee952c 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java
@@ -43,6 +43,7 @@
import java.security.SecureRandom;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.InvalidKeySpecException;
+import java.security.spec.MGF1ParameterSpec;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.ArrayList;
@@ -57,6 +58,8 @@
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.ShortBufferException;
+import javax.crypto.spec.OAEPParameterSpec;
+import javax.crypto.spec.PSource;
import javax.crypto.spec.SecretKeySpec;
/**
@@ -99,6 +102,8 @@
*/
private Exception mCachedException;
+ private Cipher mCipher;
+
AndroidKeyStoreCipherSpiBase() {
mOperation = null;
mEncrypting = false;
@@ -110,6 +115,7 @@
mAdditionalAuthenticationDataStreamer = null;
mAdditionalAuthenticationDataStreamerClosed = false;
mCachedException = null;
+ mCipher = null;
}
@Override
@@ -117,6 +123,45 @@
throws InvalidKeyException {
resetAll();
+ if (!(key instanceof AndroidKeyStorePrivateKey
+ || key instanceof AndroidKeyStoreSecretKey)) {
+ try {
+ mCipher = Cipher.getInstance(getTransform());
+ String transform = getTransform();
+
+ if ("RSA/ECB/OAEPWithSHA-224AndMGF1Padding".equals(transform)) {
+ OAEPParameterSpec spec =
+ new OAEPParameterSpec("SHA-224", "MGF1",
+ new MGF1ParameterSpec("SHA1"), PSource.PSpecified.DEFAULT);
+ mCipher.init(opmode, key, spec, random);
+ } else if ("RSA/ECB/OAEPWithSHA-256AndMGF1Padding".equals(transform)) {
+ OAEPParameterSpec spec =
+ new OAEPParameterSpec("SHA-256", "MGF1",
+ new MGF1ParameterSpec("SHA1"), PSource.PSpecified.DEFAULT);
+ mCipher.init(opmode, key, spec, random);
+
+ } else if ("RSA/ECB/OAEPWithSHA-384AndMGF1Padding".equals(transform)) {
+ OAEPParameterSpec spec =
+ new OAEPParameterSpec("SHA-384", "MGF1",
+ new MGF1ParameterSpec("SHA1"), PSource.PSpecified.DEFAULT);
+ mCipher.init(opmode, key, spec, random);
+
+ } else if ("RSA/ECB/OAEPWithSHA-512AndMGF1Padding".equals(transform)) {
+ OAEPParameterSpec spec =
+ new OAEPParameterSpec("SHA-512", "MGF1",
+ new MGF1ParameterSpec("SHA1"), PSource.PSpecified.DEFAULT);
+ mCipher.init(opmode, key, spec, random);
+ } else {
+ mCipher.init(opmode, key, random);
+ }
+ return;
+ } catch (NoSuchAlgorithmException
+ | NoSuchPaddingException
+ | InvalidAlgorithmParameterException e) {
+ throw new InvalidKeyException(e);
+ }
+ }
+
boolean success = false;
try {
init(opmode, key, random);
@@ -139,6 +184,17 @@
SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException {
resetAll();
+ if (!(key instanceof AndroidKeyStorePrivateKey
+ || key instanceof AndroidKeyStoreSecretKey)) {
+ try {
+ mCipher = Cipher.getInstance(getTransform());
+ mCipher.init(opmode, key, params, random);
+ return;
+ } catch (NoSuchAlgorithmException | NoSuchPaddingException e) {
+ throw new InvalidKeyException(e);
+ }
+ }
+
boolean success = false;
try {
init(opmode, key, random);
@@ -157,6 +213,17 @@
SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException {
resetAll();
+ if (!(key instanceof AndroidKeyStorePrivateKey
+ || key instanceof AndroidKeyStoreSecretKey)) {
+ try {
+ mCipher = Cipher.getInstance(getTransform());
+ mCipher.init(opmode, key, params, random);
+ return;
+ } catch (NoSuchAlgorithmException | NoSuchPaddingException e) {
+ throw new InvalidKeyException(e);
+ }
+ }
+
boolean success = false;
try {
init(opmode, key, random);
@@ -214,6 +281,7 @@
mAdditionalAuthenticationDataStreamer = null;
mAdditionalAuthenticationDataStreamerClosed = false;
mCachedException = null;
+ mCipher = null;
}
/**
@@ -320,6 +388,10 @@
@Override
protected final byte[] engineUpdate(byte[] input, int inputOffset, int inputLen) {
+ if (mCipher != null) {
+ return mCipher.update(input, inputOffset, inputLen);
+ }
+
if (mCachedException != null) {
return null;
}
@@ -371,6 +443,9 @@
@Override
protected final int engineUpdate(byte[] input, int inputOffset, int inputLen, byte[] output,
int outputOffset) throws ShortBufferException {
+ if (mCipher != null) {
+ return mCipher.update(input, inputOffset, inputLen, output);
+ }
byte[] outputCopy = engineUpdate(input, inputOffset, inputLen);
if (outputCopy == null) {
return 0;
@@ -387,6 +462,10 @@
@Override
protected final int engineUpdate(ByteBuffer input, ByteBuffer output)
throws ShortBufferException {
+ if (mCipher != null) {
+ return mCipher.update(input, output);
+ }
+
if (input == null) {
throw new NullPointerException("input == null");
}
@@ -423,6 +502,11 @@
@Override
protected final void engineUpdateAAD(byte[] input, int inputOffset, int inputLen) {
+ if (mCipher != null) {
+ mCipher.updateAAD(input, inputOffset, inputLen);
+ return;
+ }
+
if (mCachedException != null) {
return;
}
@@ -459,6 +543,11 @@
@Override
protected final void engineUpdateAAD(ByteBuffer src) {
+ if (mCipher != null) {
+ mCipher.updateAAD(src);
+ return;
+ }
+
if (src == null) {
throw new IllegalArgumentException("src == null");
}
@@ -486,6 +575,10 @@
@Override
protected final byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen)
throws IllegalBlockSizeException, BadPaddingException {
+ if (mCipher != null) {
+ return mCipher.doFinal(input, inputOffset, inputLen);
+ }
+
if (mCachedException != null) {
throw (IllegalBlockSizeException)
new IllegalBlockSizeException().initCause(mCachedException);
@@ -522,6 +615,10 @@
protected final int engineDoFinal(byte[] input, int inputOffset, int inputLen, byte[] output,
int outputOffset) throws ShortBufferException, IllegalBlockSizeException,
BadPaddingException {
+ if (mCipher != null) {
+ return mCipher.doFinal(input, inputOffset, inputLen, output);
+ }
+
byte[] outputCopy = engineDoFinal(input, inputOffset, inputLen);
if (outputCopy == null) {
return 0;
@@ -538,6 +635,10 @@
@Override
protected final int engineDoFinal(ByteBuffer input, ByteBuffer output)
throws ShortBufferException, IllegalBlockSizeException, BadPaddingException {
+ if (mCipher != null) {
+ return mCipher.doFinal(input, output);
+ }
+
if (input == null) {
throw new NullPointerException("input == null");
}
@@ -575,6 +676,10 @@
@Override
protected final byte[] engineWrap(Key key)
throws IllegalBlockSizeException, InvalidKeyException {
+ if (mCipher != null) {
+ return mCipher.wrap(key);
+ }
+
if (mKey == null) {
throw new IllegalStateException("Not initilized");
}
@@ -656,6 +761,10 @@
@Override
protected final Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm,
int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException {
+ if (mCipher != null) {
+ return mCipher.unwrap(wrappedKey, wrappedKeyAlgorithm, wrappedKeyType);
+ }
+
if (mKey == null) {
throw new IllegalStateException("Not initilized");
}
@@ -902,4 +1011,6 @@
*/
protected abstract void loadAlgorithmSpecificParametersFromBeginResult(
KeyParameter[] parameters);
+
+ protected abstract String getTransform();
}
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java
index d1ef1df..8289671 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java
@@ -44,6 +44,11 @@
}
@Override
+ protected String getAlgorithm() {
+ return "NONEwithECDSA";
+ }
+
+ @Override
protected KeyStoreCryptoOperationStreamer createMainDataStreamer(
KeyStoreOperation operation) {
return new TruncateToFieldSizeMessageStreamer(
@@ -113,30 +118,50 @@
public SHA1() {
super(KeymasterDefs.KM_DIGEST_SHA1);
}
+ @Override
+ protected String getAlgorithm() {
+ return "SHA1withECDSA";
+ }
}
public final static class SHA224 extends AndroidKeyStoreECDSASignatureSpi {
public SHA224() {
super(KeymasterDefs.KM_DIGEST_SHA_2_224);
}
+ @Override
+ protected String getAlgorithm() {
+ return "SHA224withECDSA";
+ }
}
public final static class SHA256 extends AndroidKeyStoreECDSASignatureSpi {
public SHA256() {
super(KeymasterDefs.KM_DIGEST_SHA_2_256);
}
+ @Override
+ protected String getAlgorithm() {
+ return "SHA256withECDSA";
+ }
}
public final static class SHA384 extends AndroidKeyStoreECDSASignatureSpi {
public SHA384() {
super(KeymasterDefs.KM_DIGEST_SHA_2_384);
}
+ @Override
+ protected String getAlgorithm() {
+ return "SHA384withECDSA";
+ }
}
public final static class SHA512 extends AndroidKeyStoreECDSASignatureSpi {
public SHA512() {
super(KeymasterDefs.KM_DIGEST_SHA_2_512);
}
+ @Override
+ protected String getAlgorithm() {
+ return "SHA512withECDSA";
+ }
}
private final int mKeymasterDigest;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreProvider.java b/keystore/java/android/security/keystore2/AndroidKeyStoreProvider.java
index b2e32a3..403da18 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreProvider.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreProvider.java
@@ -31,9 +31,7 @@
import android.system.keystore2.KeyMetadata;
import android.system.keystore2.ResponseCode;
-import java.security.KeyFactory;
import java.security.KeyPair;
-import java.security.NoSuchAlgorithmException;
import java.security.Provider;
import java.security.ProviderException;
import java.security.PublicKey;
@@ -42,8 +40,6 @@
import java.security.UnrecoverableKeyException;
import java.security.interfaces.ECPublicKey;
import java.security.interfaces.RSAPublicKey;
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.X509EncodedKeySpec;
import javax.crypto.Cipher;
import javax.crypto.Mac;
@@ -237,28 +233,11 @@
throw new UnrecoverableKeyException("Failed to obtain X.509 form of public key."
+ " Keystore has no public certificate stored.");
}
- final byte[] x509EncodedPublicKey = metadata.certificate;
+ final byte[] x509PublicCert = metadata.certificate;
- String jcaKeyAlgorithm;
- try {
- jcaKeyAlgorithm = KeyProperties.KeyAlgorithm.fromKeymasterAsymmetricKeyAlgorithm(
- algorithm);
- } catch (IllegalArgumentException e) {
- throw (UnrecoverableKeyException)
- new UnrecoverableKeyException("Failed to load private key")
- .initCause(e);
- }
+ PublicKey publicKey = AndroidKeyStoreSpi.toCertificate(x509PublicCert).getPublicKey();
- PublicKey publicKey;
- try {
- KeyFactory keyFactory = KeyFactory.getInstance(jcaKeyAlgorithm);
- publicKey = keyFactory.generatePublic(new X509EncodedKeySpec(x509EncodedPublicKey));
- } catch (NoSuchAlgorithmException e) {
- throw new ProviderException(
- "Failed to obtain " + jcaKeyAlgorithm + " KeyFactory", e);
- } catch (InvalidKeySpecException e) {
- throw new ProviderException("Invalid X.509 encoding of public key", e);
- }
+ String jcaKeyAlgorithm = publicKey.getAlgorithm();
KeyStoreSecurityLevel securityLevel = iSecurityLevel;
if (KeyProperties.KEY_ALGORITHM_EC.equalsIgnoreCase(jcaKeyAlgorithm)) {
@@ -358,7 +337,7 @@
KeyDescriptor descriptor = new KeyDescriptor();
if (namespace == KeyProperties.NAMESPACE_APPLICATION) {
- descriptor.nspace = 0; // ignored;
+ descriptor.nspace = KeyProperties.NAMESPACE_APPLICATION; // ignored;
descriptor.domain = Domain.APP;
} else {
descriptor.nspace = namespace;
@@ -387,10 +366,10 @@
for (Authorization a : response.metadata.authorizations) {
switch (a.keyParameter.tag) {
case KeymasterDefs.KM_TAG_ALGORITHM:
- keymasterAlgorithm = a.keyParameter.integer;
+ keymasterAlgorithm = a.keyParameter.value.getAlgorithm();
break;
case KeymasterDefs.KM_TAG_DIGEST:
- if (keymasterDigest == -1) keymasterDigest = a.keyParameter.integer;
+ if (keymasterDigest == -1) keymasterDigest = a.keyParameter.value.getDigest();
break;
}
}
@@ -407,7 +386,7 @@
keymasterAlgorithm == KeymasterDefs.KM_ALGORITHM_EC) {
return makeAndroidKeyStorePublicKeyFromKeyEntryResponse(descriptor, response.metadata,
new KeyStoreSecurityLevel(response.iSecurityLevel),
- keymasterAlgorithm);
+ keymasterAlgorithm).getPrivateKey();
} else {
throw new UnrecoverableKeyException("Key algorithm unknown");
}
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreRSACipherSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreRSACipherSpi.java
index 951f918..6ff9432 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreRSACipherSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreRSACipherSpi.java
@@ -158,7 +158,7 @@
}
/**
- * RSA cipher with OAEP encryption padding. Only SHA-1 based MGF1 is supported as MGF.
+ * RSA cipher with OAEP encryption padding.
*/
abstract static class OAEPWithMGF1Padding extends AndroidKeyStoreRSACipherSpi {
@@ -316,6 +316,25 @@
protected final int getAdditionalEntropyAmountForFinish() {
return (isEncrypting()) ? mDigestOutputSizeBytes : 0;
}
+
+ @Override
+ protected final String getTransform() {
+ switch (mKeymasterDigest) {
+ case KeymasterDefs.KM_DIGEST_SHA1:
+ return "RSA/ECB/OAEPWithSHA-1AndMGF1Padding";
+ case KeymasterDefs.KM_DIGEST_SHA_2_224:
+ return "RSA/ECB/OAEPWithSHA-224AndMGF1Padding";
+ case KeymasterDefs.KM_DIGEST_SHA_2_256:
+ return "RSA/ECB/OAEPWithSHA-256AndMGF1Padding";
+ case KeymasterDefs.KM_DIGEST_SHA_2_384:
+ return "RSA/ECB/OAEPWithSHA-384AndMGF1Padding";
+ case KeymasterDefs.KM_DIGEST_SHA_2_512:
+ return "RSA/ECB/OAEPWithSHA-512AndMGF1Padding";
+ default:
+ return "RSA/ECB/OAEPPadding";
+ }
+ }
+
}
public static class OAEPWithSHA1AndMGF1Padding extends OAEPWithMGF1Padding {
@@ -358,6 +377,11 @@
}
@Override
+ protected String getTransform() {
+ return "RSA/ECB/" + KeyProperties.EncryptionPadding.fromKeymaster(mKeymasterPadding);
+ }
+
+ @Override
protected final void initKey(int opmode, Key key) throws InvalidKeyException {
if (key == null) {
throw new InvalidKeyException("Unsupported key: null");
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java
index ab75591..931c2f8 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java
@@ -48,42 +48,70 @@
public NONEWithPKCS1Padding() {
super(KeymasterDefs.KM_DIGEST_NONE);
}
+ @Override
+ protected String getAlgorithm() {
+ return "NONEwithRSA";
+ }
}
public static final class MD5WithPKCS1Padding extends PKCS1Padding {
public MD5WithPKCS1Padding() {
super(KeymasterDefs.KM_DIGEST_MD5);
}
+ @Override
+ protected String getAlgorithm() {
+ return "MD5withRSA";
+ }
}
public static final class SHA1WithPKCS1Padding extends PKCS1Padding {
public SHA1WithPKCS1Padding() {
super(KeymasterDefs.KM_DIGEST_SHA1);
}
+ @Override
+ protected String getAlgorithm() {
+ return "SHA1withRSA";
+ }
}
public static final class SHA224WithPKCS1Padding extends PKCS1Padding {
public SHA224WithPKCS1Padding() {
super(KeymasterDefs.KM_DIGEST_SHA_2_224);
}
+ @Override
+ protected String getAlgorithm() {
+ return "SHA224withRSA";
+ }
}
public static final class SHA256WithPKCS1Padding extends PKCS1Padding {
public SHA256WithPKCS1Padding() {
super(KeymasterDefs.KM_DIGEST_SHA_2_256);
}
+ @Override
+ protected String getAlgorithm() {
+ return "SHA256withRSA";
+ }
}
public static final class SHA384WithPKCS1Padding extends PKCS1Padding {
public SHA384WithPKCS1Padding() {
super(KeymasterDefs.KM_DIGEST_SHA_2_384);
}
+ @Override
+ protected String getAlgorithm() {
+ return "SHA384withRSA";
+ }
}
public static final class SHA512WithPKCS1Padding extends PKCS1Padding {
public SHA512WithPKCS1Padding() {
super(KeymasterDefs.KM_DIGEST_SHA_2_512);
}
+ @Override
+ protected String getAlgorithm() {
+ return "SHA512withRSA";
+ }
}
abstract static class PSSPadding extends AndroidKeyStoreRSASignatureSpi {
@@ -103,30 +131,50 @@
public SHA1WithPSSPadding() {
super(KeymasterDefs.KM_DIGEST_SHA1);
}
+ @Override
+ protected String getAlgorithm() {
+ return "SHA1withRSA/PSS";
+ }
}
public static final class SHA224WithPSSPadding extends PSSPadding {
public SHA224WithPSSPadding() {
super(KeymasterDefs.KM_DIGEST_SHA_2_224);
}
+ @Override
+ protected String getAlgorithm() {
+ return "SHA224withRSA/PSS";
+ }
}
public static final class SHA256WithPSSPadding extends PSSPadding {
public SHA256WithPSSPadding() {
super(KeymasterDefs.KM_DIGEST_SHA_2_256);
}
+ @Override
+ protected String getAlgorithm() {
+ return "SHA256withRSA/PSS";
+ }
}
public static final class SHA384WithPSSPadding extends PSSPadding {
public SHA384WithPSSPadding() {
super(KeymasterDefs.KM_DIGEST_SHA_2_384);
}
+ @Override
+ protected String getAlgorithm() {
+ return "SHA384withRSA/PSS";
+ }
}
public static final class SHA512WithPSSPadding extends PSSPadding {
public SHA512WithPSSPadding() {
super(KeymasterDefs.KM_DIGEST_SHA_2_512);
}
+ @Override
+ protected String getAlgorithm() {
+ return "SHA512withRSA/PSS";
+ }
}
private final int mKeymasterDigest;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreSecretKeyFactorySpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreSecretKeyFactorySpi.java
index 9d3b970..74503e1 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreSecretKeyFactorySpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreSecretKeyFactorySpi.java
@@ -102,7 +102,8 @@
insideSecureHardware =
KeyStore2ParameterUtils.isSecureHardware(a.securityLevel);
securityLevel = a.securityLevel;
- origin = KeyProperties.Origin.fromKeymaster(a.keyParameter.integer);
+ origin = KeyProperties.Origin.fromKeymaster(
+ a.keyParameter.value.getOrigin());
break;
case KeymasterDefs.KM_TAG_KEY_SIZE:
long keySizeUnsigned = KeyStore2ParameterUtils.getUnsignedInt(a);
@@ -113,45 +114,51 @@
keySize = (int) keySizeUnsigned;
break;
case KeymasterDefs.KM_TAG_PURPOSE:
- purposes |= KeyProperties.Purpose.fromKeymaster(a.keyParameter.integer);
+ purposes |= KeyProperties.Purpose.fromKeymaster(
+ a.keyParameter.value.getKeyPurpose());
break;
case KeymasterDefs.KM_TAG_PADDING:
+ int paddingMode = a.keyParameter.value.getPaddingMode();
try {
- if (a.keyParameter.integer == KeymasterDefs.KM_PAD_RSA_PKCS1_1_5_SIGN
- || a.keyParameter.integer == KeymasterDefs.KM_PAD_RSA_PSS) {
+ if (paddingMode == KeymasterDefs.KM_PAD_RSA_PKCS1_1_5_SIGN
+ || paddingMode == KeymasterDefs.KM_PAD_RSA_PSS) {
@KeyProperties.SignaturePaddingEnum String padding =
KeyProperties.SignaturePadding.fromKeymaster(
- a.keyParameter.integer);
+ paddingMode);
signaturePaddingsList.add(padding);
} else {
@KeyProperties.EncryptionPaddingEnum String jcaPadding =
KeyProperties.EncryptionPadding.fromKeymaster(
- a.keyParameter.integer);
+ paddingMode);
encryptionPaddingsList.add(jcaPadding);
}
} catch (IllegalArgumentException e) {
throw new ProviderException("Unsupported padding: "
- + a.keyParameter.integer);
+ + paddingMode);
}
break;
case KeymasterDefs.KM_TAG_DIGEST:
- digestsList.add(KeyProperties.Digest.fromKeymaster(a.keyParameter.integer));
+ digestsList.add(KeyProperties.Digest.fromKeymaster(
+ a.keyParameter.value.getDigest()));
break;
case KeymasterDefs.KM_TAG_BLOCK_MODE:
blockModesList.add(
- KeyProperties.BlockMode.fromKeymaster(a.keyParameter.integer)
+ KeyProperties.BlockMode.fromKeymaster(
+ a.keyParameter.value.getBlockMode())
);
break;
case KeymasterDefs.KM_TAG_USER_AUTH_TYPE:
+ int authenticatorType = a.keyParameter.value.getHardwareAuthenticatorType();
if (KeyStore2ParameterUtils.isSecureHardware(a.securityLevel)) {
- keymasterHwEnforcedUserAuthenticators = a.keyParameter.integer;
+ keymasterHwEnforcedUserAuthenticators = authenticatorType;
} else {
- keymasterSwEnforcedUserAuthenticators = a.keyParameter.integer;
+ keymasterSwEnforcedUserAuthenticators = authenticatorType;
}
break;
case KeymasterDefs.KM_TAG_USER_SECURE_ID:
keymasterSecureUserIds.add(
- KeymasterArguments.toUint64(a.keyParameter.longInteger));
+ KeymasterArguments.toUint64(
+ a.keyParameter.value.getLongInteger()));
break;
case KeymasterDefs.KM_TAG_ACTIVE_DATETIME:
keyValidityStart = KeyStore2ParameterUtils.getDate(a);
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreSignatureSpiBase.java b/keystore/java/android/security/keystore2/AndroidKeyStoreSignatureSpiBase.java
index 9b4f01e..96da1e00 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreSignatureSpiBase.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreSignatureSpiBase.java
@@ -30,10 +30,12 @@
import java.nio.ByteBuffer;
import java.security.InvalidKeyException;
import java.security.InvalidParameterException;
+import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.ProviderException;
import java.security.PublicKey;
import java.security.SecureRandom;
+import java.security.Signature;
import java.security.SignatureException;
import java.security.SignatureSpi;
import java.util.ArrayList;
@@ -76,6 +78,13 @@
*/
private Exception mCachedException;
+ /**
+ * This signature object is used for public key operations, i.e, signatrue verification.
+ * The Android Keystore backend does not perform public key operations and defers to the
+ * Highest priority provider.
+ */
+ private Signature mSignature;
+
AndroidKeyStoreSignatureSpiBase() {
mOperation = null;
mOperationChallenge = 0;
@@ -84,6 +93,7 @@
appRandom = null;
mMessageStreamer = null;
mCachedException = null;
+ mSignature = null;
}
@Override
@@ -123,27 +133,13 @@
protected final void engineInitVerify(PublicKey publicKey) throws InvalidKeyException {
resetAll();
- boolean success = false;
try {
- if (publicKey == null) {
- throw new InvalidKeyException("Unsupported key: null");
- }
- AndroidKeyStoreKey keystoreKey;
- if (publicKey instanceof AndroidKeyStorePublicKey) {
- keystoreKey = (AndroidKeyStorePublicKey) publicKey;
- } else {
- throw new InvalidKeyException("Unsupported public key type: " + publicKey);
- }
- mSigning = false;
- initKey(keystoreKey);
- appRandom = null;
- ensureKeystoreOperationInitialized();
- success = true;
- } finally {
- if (!success) {
- resetAll();
- }
+ mSignature = Signature.getInstance(getAlgorithm());
+ } catch (NoSuchAlgorithmException e) {
+ throw new InvalidKeyException(e);
}
+
+ mSignature.initVerify(publicKey);
}
/**
@@ -251,6 +247,11 @@
@Override
protected final void engineUpdate(byte[] b, int off, int len) throws SignatureException {
+ if (mSignature != null) {
+ mSignature.update(b, off, len);
+ return;
+ }
+
if (mCachedException != null) {
throw new SignatureException(mCachedException);
}
@@ -337,39 +338,10 @@
@Override
protected final boolean engineVerify(byte[] signature) throws SignatureException {
- if (mCachedException != null) {
- throw new SignatureException(mCachedException);
+ if (mSignature != null) {
+ return mSignature.verify(signature);
}
-
- try {
- ensureKeystoreOperationInitialized();
- } catch (InvalidKeyException e) {
- throw new SignatureException(e);
- }
-
- boolean verified;
- try {
- byte[] output = mMessageStreamer.doFinal(
- EmptyArray.BYTE, 0, 0,
- signature);
- if (output.length != 0) {
- throw new ProviderException(
- "Signature verification unexpected produced output: " + output.length
- + " bytes");
- }
- verified = true;
- } catch (KeyStoreException e) {
- switch (e.getErrorCode()) {
- case KeymasterDefs.KM_ERROR_VERIFICATION_FAILED:
- verified = false;
- break;
- default:
- throw new SignatureException(e);
- }
- }
-
- resetWhilePreservingInitState();
- return verified;
+ throw new IllegalStateException("Not initialised.");
}
@Override
@@ -392,6 +364,13 @@
}
/**
+ * Implementations need to report the algorithm they implement so that we can delegate to the
+ * highest priority provider.
+ * @return Algorithm string.
+ */
+ protected abstract String getAlgorithm();
+
+ /**
* Returns {@code true} if this signature is initialized for signing, {@code false} if this
* signature is initialized for verification.
*/
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
index c42c7b2..5e7f648 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
@@ -219,7 +219,7 @@
return null;
}
- private static X509Certificate toCertificate(byte[] bytes) {
+ static X509Certificate toCertificate(byte[] bytes) {
try {
final CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
return (X509Certificate) certFactory.generateCertificate(
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreUnauthenticatedAESCipherSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreUnauthenticatedAESCipherSpi.java
index 4d4b0d8..5c048a1 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreUnauthenticatedAESCipherSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreUnauthenticatedAESCipherSpi.java
@@ -42,7 +42,7 @@
*
* @hide
*/
-class AndroidKeyStoreUnauthenticatedAESCipherSpi extends AndroidKeyStoreCipherSpiBase {
+abstract class AndroidKeyStoreUnauthenticatedAESCipherSpi extends AndroidKeyStoreCipherSpiBase {
abstract static class ECB extends AndroidKeyStoreUnauthenticatedAESCipherSpi {
protected ECB(int keymasterPadding) {
@@ -53,12 +53,22 @@
public NoPadding() {
super(KeymasterDefs.KM_PAD_NONE);
}
+
+ @Override
+ protected final String getTransform() {
+ return "AES/ECB/NoPadding";
+ }
}
public static class PKCS7Padding extends ECB {
public PKCS7Padding() {
super(KeymasterDefs.KM_PAD_PKCS7);
}
+
+ @Override
+ protected final String getTransform() {
+ return "AES/ECB/PKCS7Padding";
+ }
}
}
@@ -71,12 +81,22 @@
public NoPadding() {
super(KeymasterDefs.KM_PAD_NONE);
}
+
+ @Override
+ protected final String getTransform() {
+ return "AES/CBC/NoPadding";
+ }
}
public static class PKCS7Padding extends CBC {
public PKCS7Padding() {
super(KeymasterDefs.KM_PAD_PKCS7);
}
+
+ @Override
+ protected final String getTransform() {
+ return "AES/CBC/PKCS7Padding";
+ }
}
}
@@ -89,6 +109,11 @@
public NoPadding() {
super(KeymasterDefs.KM_PAD_NONE);
}
+
+ @Override
+ protected final String getTransform() {
+ return "AES/CTR/NoPadding";
+ }
}
}
@@ -275,7 +300,7 @@
if (parameters != null) {
for (KeyParameter p : parameters) {
if (p.tag == KeymasterDefs.KM_TAG_NONCE) {
- returnedIv = p.blob;
+ returnedIv = p.value.getBlob();
break;
}
}
diff --git a/keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java b/keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java
index 18c786a..4c8ab8d 100644
--- a/keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java
+++ b/keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java
@@ -19,7 +19,9 @@
import android.annotation.NonNull;
import android.hardware.biometrics.BiometricManager;
import android.hardware.security.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameterValue;
import android.hardware.security.keymint.SecurityLevel;
+import android.hardware.security.keymint.Tag;
import android.security.GateKeeper;
import android.security.keymaster.KeymasterDefs;
import android.security.keystore.KeyProperties;
@@ -50,7 +52,7 @@
}
KeyParameter p = new KeyParameter();
p.tag = tag;
- p.boolValue = true;
+ p.value = KeyParameterValue.boolValue(true);
return p;
}
@@ -62,14 +64,40 @@
* @hide
*/
static @NonNull KeyParameter makeEnum(int tag, int v) {
- int type = KeymasterDefs.getTagType(tag);
- if (type != KeymasterDefs.KM_ENUM && type != KeymasterDefs.KM_ENUM_REP) {
- throw new IllegalArgumentException("Not an enum or repeatable enum tag: " + tag);
+ KeyParameter kp = new KeyParameter();
+ kp.tag = tag;
+ switch (tag) {
+ case Tag.PURPOSE:
+ kp.value = KeyParameterValue.keyPurpose(v);
+ break;
+ case Tag.ALGORITHM:
+ kp.value = KeyParameterValue.algorithm(v);
+ break;
+ case Tag.BLOCK_MODE:
+ kp.value = KeyParameterValue.blockMode(v);
+ break;
+ case Tag.DIGEST:
+ kp.value = KeyParameterValue.digest(v);
+ break;
+ case Tag.EC_CURVE:
+ kp.value = KeyParameterValue.ecCurve(v);
+ break;
+ case Tag.ORIGIN:
+ kp.value = KeyParameterValue.origin(v);
+ break;
+ case Tag.PADDING:
+ kp.value = KeyParameterValue.paddingMode(v);
+ break;
+ case Tag.USER_AUTH_TYPE:
+ kp.value = KeyParameterValue.hardwareAuthenticatorType(v);
+ break;
+ case Tag.HARDWARE_TYPE:
+ kp.value = KeyParameterValue.securityLevel(v);
+ break;
+ default:
+ throw new IllegalArgumentException("Not an enum or repeatable enum tag: " + tag);
}
- KeyParameter p = new KeyParameter();
- p.tag = tag;
- p.integer = v;
- return p;
+ return kp;
}
/**
@@ -86,7 +114,7 @@
}
KeyParameter p = new KeyParameter();
p.tag = tag;
- p.integer = v;
+ p.value = KeyParameterValue.integer(v);
return p;
}
@@ -104,7 +132,7 @@
}
KeyParameter p = new KeyParameter();
p.tag = tag;
- p.longInteger = v;
+ p.value = KeyParameterValue.longInteger(v);
return p;
}
@@ -121,7 +149,7 @@
}
KeyParameter p = new KeyParameter();
p.tag = tag;
- p.blob = b;
+ p.value = KeyParameterValue.blob(b);
return p;
}
@@ -138,9 +166,10 @@
}
KeyParameter p = new KeyParameter();
p.tag = tag;
- p.longInteger = date.getTime();
- if (p.longInteger < 0) {
- throw new IllegalArgumentException("Date tag value out of range: " + p.longInteger);
+ p.value = KeyParameterValue.dateTime(date.getTime());
+ if (p.value.getDateTime() < 0) {
+ throw new IllegalArgumentException("Date tag value out of range: "
+ + p.value.getDateTime());
}
return p;
}
@@ -160,24 +189,24 @@
throw new IllegalArgumentException("Not an int tag: " + param.keyParameter.tag);
}
// KM_UINT is 32 bits wide so we must suppress sign extension.
- return ((long) param.keyParameter.integer) & 0xffffffffL;
+ return ((long) param.keyParameter.value.getInteger()) & 0xffffffffL;
}
static @NonNull Date getDate(@NonNull Authorization param) {
if (KeymasterDefs.getTagType(param.keyParameter.tag) != KeymasterDefs.KM_DATE) {
throw new IllegalArgumentException("Not a date tag: " + param.keyParameter.tag);
}
- if (param.keyParameter.longInteger < 0) {
+ if (param.keyParameter.value.getDateTime() < 0) {
throw new IllegalArgumentException("Date Value too large: "
- + param.keyParameter.longInteger);
+ + param.keyParameter.value.getDateTime());
}
- return new Date(param.keyParameter.longInteger);
+ return new Date(param.keyParameter.value.getDateTime());
}
static void forEachSetFlag(int flags, Consumer<Integer> consumer) {
int offset = 0;
while (flags != 0) {
- if ((flags & 1) == 0) {
+ if ((flags & 1) == 1) {
consumer.accept(1 << offset);
}
offset += 1;
diff --git a/keystore/java/android/security/keystore2/KeyStoreCryptoOperationUtils.java b/keystore/java/android/security/keystore2/KeyStoreCryptoOperationUtils.java
index 3b11854..f87a3d2 100644
--- a/keystore/java/android/security/keystore2/KeyStoreCryptoOperationUtils.java
+++ b/keystore/java/android/security/keystore2/KeyStoreCryptoOperationUtils.java
@@ -57,7 +57,7 @@
for (Authorization p : key.getAuthorizations()) {
switch(p.keyParameter.tag) {
case KeymasterDefs.KM_TAG_USER_SECURE_ID:
- keySids.add(p.keyParameter.longInteger);
+ keySids.add(p.keyParameter.value.getLongInteger());
break;
default:
break;
diff --git a/libs/WindowManager/Shell/res/values-iw/strings.xml b/libs/WindowManager/Shell/res/values-iw/strings.xml
index 82ba220..20114a7 100644
--- a/libs/WindowManager/Shell/res/values-iw/strings.xml
+++ b/libs/WindowManager/Shell/res/values-iw/strings.xml
@@ -23,7 +23,7 @@
<string name="pip_menu_title" msgid="5393619322111827096">"תפריט"</string>
<string name="pip_notification_title" msgid="1347104727641353453">"<xliff:g id="NAME">%s</xliff:g> במצב תמונה בתוך תמונה"</string>
<string name="pip_notification_message" msgid="8854051911700302620">"אם אינך רוצה שהתכונה הזו תשמש את <xliff:g id="NAME">%s</xliff:g>, יש להקיש כדי לפתוח את ההגדרות ולכבות את התכונה."</string>
- <string name="pip_play" msgid="3496151081459417097">"הפעל"</string>
+ <string name="pip_play" msgid="3496151081459417097">"הפעלה"</string>
<string name="pip_pause" msgid="690688849510295232">"השהה"</string>
<string name="pip_skip_to_next" msgid="8403429188794867653">"אפשר לדלג אל הבא"</string>
<string name="pip_skip_to_prev" msgid="7172158111196394092">"אפשר לדלג אל הקודם"</string>
diff --git a/libs/WindowManager/Shell/res/values-uz/strings.xml b/libs/WindowManager/Shell/res/values-uz/strings.xml
index 795eff8..74b135d 100644
--- a/libs/WindowManager/Shell/res/values-uz/strings.xml
+++ b/libs/WindowManager/Shell/res/values-uz/strings.xml
@@ -64,8 +64,8 @@
<string name="bubbles_user_education_manage_title" msgid="7042699946735628035">"Bulutchalardagi bildirishnomalar"</string>
<string name="bubbles_user_education_manage" msgid="3460756219946517198">"Bu ilova bulutchalarini faolsizlantirish uchun Boshqarish tugmasini bosing"</string>
<string name="bubbles_user_education_got_it" msgid="3382046149225428296">"OK"</string>
- <string name="bubble_overflow_empty_title" msgid="2397251267073294968">"Avvalgi bulutchalar topilmadi"</string>
- <string name="bubble_overflow_empty_subtitle" msgid="2627417924958633713">"Bu yerda oxirgi va yopilgan bulutcha shaklidagi bildirishnomalar chiqadi"</string>
+ <string name="bubble_overflow_empty_title" msgid="2397251267073294968">"Hech qanday bulutcha topilmadi"</string>
+ <string name="bubble_overflow_empty_subtitle" msgid="2627417924958633713">"Eng oxirgi va yopilgan bulutchali chatlar shu yerda chiqadi"</string>
<string name="notification_bubble_title" msgid="6082910224488253378">"Pufaklar"</string>
<string name="manage_bubbles_text" msgid="7730624269650594419">"Boshqarish"</string>
<string name="accessibility_bubble_dismissed" msgid="8367471990421247357">"Bulutcha yopildi."</string>
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 4bf01f7..7f33895 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
@@ -474,8 +474,10 @@
Bundle extras = new Bundle();
extras.putBinder(EXTRA_BUBBLE_CONTROLLER, ObjectWrapper.wrap(mController));
target.putExtras(extras);
+ // TODO(b/175352055) Please replace FLAG_MUTABLE_UNAUDITED below
+ // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
mPendingIntent = PendingIntent.getActivity(mContext, 0 /* requestCode */,
- target, PendingIntent.FLAG_UPDATE_CURRENT);
+ target, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED);
mSettingsIcon.setVisibility(GONE);
}
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 4b283e4..519ce36 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
@@ -64,9 +64,9 @@
import com.android.wm.shell.R;
import com.android.wm.shell.ShellTaskOrganizer;
import com.android.wm.shell.common.DisplayController;
+import com.android.wm.shell.legacysplitscreen.LegacySplitScreen;
import com.android.wm.shell.pip.phone.PipMotionHelper;
import com.android.wm.shell.pip.phone.PipUpdateThread;
-import com.android.wm.shell.legacysplitscreen.LegacySplitScreen;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -251,7 +251,7 @@
* If set to {@code true}, the entering animation will be skipped and we will wait for
* {@link #onFixedRotationFinished(int)} callback to actually enter PiP.
*/
- private boolean mShouldDeferEnteringPip;
+ private boolean mWaitForFixedRotation;
/**
* If set to {@code true}, no entering PiP transition would be kicked off and most likely
@@ -259,7 +259,7 @@
* auto PiP-able Activity to home.
* See also {@link #startSwipePipToHome(ComponentName, ActivityInfo, PictureInPictureParams)}.
*/
- private boolean mShouldIgnoreEnteringPipTransition;
+ private boolean mInSwipePipToHomeTransition;
public PipTaskOrganizer(Context context, @NonNull PipBoundsState pipBoundsState,
@NonNull PipBoundsAlgorithm boundsHandler,
@@ -304,7 +304,7 @@
}
public boolean isDeferringEnterPipAnimation() {
- return mState.isInPip() && mShouldDeferEnteringPip;
+ return mState.isInPip() && mWaitForFixedRotation;
}
/**
@@ -336,9 +336,12 @@
*/
public Rect startSwipePipToHome(ComponentName componentName, ActivityInfo activityInfo,
PictureInPictureParams pictureInPictureParams) {
- mShouldIgnoreEnteringPipTransition = true;
+ mInSwipePipToHomeTransition = true;
sendOnPipTransitionStarted(componentName, TRANSITION_DIRECTION_TO_PIP);
setBoundsStateForEntry(componentName, pictureInPictureParams, activityInfo);
+ // disable the conflicting transaction from fixed rotation, see also
+ // onFixedRotationStarted and onFixedRotationFinished
+ mWaitForFixedRotation = false;
return mPipBoundsAlgorithm.getEntryDestinationBounds();
}
@@ -348,7 +351,7 @@
*/
public void stopSwipePipToHome(ComponentName componentName, Rect destinationBounds) {
// do nothing if there is no startSwipePipToHome being called before
- if (mShouldIgnoreEnteringPipTransition) {
+ if (mInSwipePipToHomeTransition) {
mPipBoundsState.setBounds(destinationBounds);
}
}
@@ -502,7 +505,7 @@
mPipMenuController.attach(leash);
- if (mShouldIgnoreEnteringPipTransition) {
+ if (mInSwipePipToHomeTransition) {
final Rect destinationBounds = mPipBoundsState.getBounds();
// animation is finished in the Launcher and here we directly apply the final touch.
applyEnterPipSyncTransaction(destinationBounds, () -> {
@@ -510,11 +513,11 @@
finishResizeForMenu(destinationBounds);
sendOnPipTransitionFinished(TRANSITION_DIRECTION_TO_PIP);
});
- mShouldIgnoreEnteringPipTransition = false;
+ mInSwipePipToHomeTransition = false;
return;
}
- if (mShouldDeferEnteringPip) {
+ if (mWaitForFixedRotation) {
if (DEBUG) Log.d(TAG, "Defer entering PiP animation, fixed rotation is ongoing");
// if deferred, hide the surface till fixed rotation is completed
final SurfaceControl.Transaction tx =
@@ -666,8 +669,8 @@
Log.wtf(TAG, "Unrecognized token: " + token);
return;
}
- mShouldDeferEnteringPip = false;
- mShouldIgnoreEnteringPipTransition = false;
+ mWaitForFixedRotation = false;
+ mInSwipePipToHomeTransition = false;
mPictureInPictureParams = null;
mState = State.UNDEFINED;
mPipUiEventLoggerLogger.setTaskInfo(null);
@@ -694,17 +697,17 @@
@Override
public void onFixedRotationStarted(int displayId, int newRotation) {
- mShouldDeferEnteringPip = true;
+ mWaitForFixedRotation = true;
}
@Override
public void onFixedRotationFinished(int displayId) {
- if (mShouldDeferEnteringPip && mState.isInPip()) {
+ if (mWaitForFixedRotation && mState.isInPip()) {
final Rect destinationBounds = mPipBoundsAlgorithm.getEntryDestinationBounds();
// schedule a regular animation to ensure all the callbacks are still being sent
enterPipWithAlphaAnimation(destinationBounds, 0 /* durationMs */);
}
- mShouldDeferEnteringPip = false;
+ mWaitForFixedRotation = false;
}
/**
@@ -723,6 +726,12 @@
public void onMovementBoundsChanged(Rect destinationBoundsOut, boolean fromRotation,
boolean fromImeAdjustment, boolean fromShelfAdjustment,
WindowContainerTransaction wct) {
+ // note that this can be called when swiping pip to home is happening. For instance,
+ // swiping an app in landscape to portrait home. skip this entirely if that's the case.
+ if (mInSwipePipToHomeTransition && fromRotation) {
+ if (DEBUG) Log.d(TAG, "skip onMovementBoundsChanged due to swipe-pip-to-home");
+ return;
+ }
final PipAnimationController.PipTransitionAnimator animator =
mPipAnimationController.getCurrentAnimator();
if (animator == null || !animator.isRunning()
@@ -806,7 +815,7 @@
*/
public void scheduleAnimateResizePip(Rect toBounds, int duration,
Consumer<Rect> updateBoundsCallback) {
- if (mShouldDeferEnteringPip) {
+ if (mWaitForFixedRotation) {
Log.d(TAG, "skip scheduleAnimateResizePip, entering pip deferred");
return;
}
@@ -820,7 +829,7 @@
*/
public void scheduleAnimateResizePip(Rect fromBounds, Rect toBounds, int duration,
Consumer<Rect> updateBoundsCallback) {
- if (mShouldDeferEnteringPip) {
+ if (mWaitForFixedRotation) {
Log.d(TAG, "skip scheduleAnimateResizePip, entering pip deferred");
return;
}
@@ -922,7 +931,7 @@
if (mState.shouldBlockResizeRequest()) {
return;
}
- if (mShouldDeferEnteringPip) {
+ if (mWaitForFixedRotation) {
Log.d(TAG, "skip scheduleOffsetPip, entering pip deferred");
return;
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/TaskSnapshotWindow.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/TaskSnapshotWindow.java
index e66d85f..3198725 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/TaskSnapshotWindow.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/TaskSnapshotWindow.java
@@ -221,8 +221,7 @@
mainExecutor.execute(() -> {
try {
final int res = session.addToDisplay(window, layoutParams, View.GONE,
- displayId, mTmpInsetsState, tmpFrames.frame,
- tmpFrames.displayCutout, tmpInputChannel/* outInputChannel */,
+ displayId, mTmpInsetsState, tmpFrames.frame, tmpInputChannel,
mTmpInsetsState, mTempControls);
if (res < 0) {
Slog.w(TAG, "Failed to add snapshot starting window res=" + res);
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 e3ac3f0..5ab1c39 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
@@ -17,10 +17,11 @@
package com.android.wm.shell.flicker
import android.graphics.Region
-import com.android.server.wm.flicker.DOCKED_STACK_DIVIDER
+import android.view.Surface
import com.android.server.wm.flicker.dsl.EventLogAssertion
import com.android.server.wm.flicker.dsl.LayersAssertion
import com.android.server.wm.flicker.helpers.WindowUtils
+import com.android.wm.shell.flicker.FlickerTestBase.Companion.DOCKED_STACK_DIVIDER
@JvmOverloads
fun LayersAssertion.appPairsDividerIsVisible(
@@ -87,6 +88,36 @@
}
@JvmOverloads
+fun LayersAssertion.appPairsPrimaryBoundsIsVisible(
+ 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.SPLIT_DIVIDER)
+ this.hasVisibleRegion(primaryLayerName, getPrimaryRegion(dividerRegion, rotation))
+ }
+}
+
+@JvmOverloads
+fun LayersAssertion.appPairsSecondaryBoundsIsVisible(
+ 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.SPLIT_DIVIDER)
+ this.hasVisibleRegion(secondaryLayerName, getSecondaryRegion(dividerRegion, rotation))
+ }
+}
+
+@JvmOverloads
fun LayersAssertion.dockedStackPrimaryBoundsIsVisible(
rotation: Int,
primaryLayerName: String,
@@ -118,16 +149,27 @@
fun getPrimaryRegion(dividerRegion: Region, rotation: Int): Region {
val displayBounds = WindowUtils.getDisplayBounds(rotation)
- return Region(0, 0, displayBounds.getBounds().right,
- dividerRegion.getBounds().bottom - WindowUtils.dockedStackDividerInset)
+ return if (rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_180) {
+ Region(0, 0, displayBounds.getBounds().right,
+ dividerRegion.getBounds().bottom - WindowUtils.dockedStackDividerInset)
+ } else {
+ Region(0, 0, dividerRegion.getBounds().left,
+ dividerRegion.getBounds().right - 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)
+ return if (rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_180) {
+ Region(0,
+ dividerRegion.getBounds().bottom - WindowUtils.dockedStackDividerInset,
+ displayBounds.getBounds().right,
+ displayBounds.getBounds().bottom - WindowUtils.dockedStackDividerInset)
+ } else {
+ Region(dividerRegion.getBounds().right, 0,
+ displayBounds.getBounds().right,
+ displayBounds.getBounds().bottom - WindowUtils.dockedStackDividerInset)
+ }
}
fun EventLogAssertion.focusChanges(
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 379ec95..22b1eb7 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
@@ -16,29 +16,26 @@
package com.android.wm.shell.flicker.apppairs
-import android.platform.test.annotations.Presubmit
import android.os.SystemClock
-import android.util.Log
+import android.platform.test.annotations.Presubmit
import android.view.Surface
import androidx.test.filters.RequiresDevice
-import com.android.compatibility.common.util.SystemUtil
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.dsl.runWithFlicker
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
-import com.android.wm.shell.flicker.helpers.AppPairsHelper
-import com.android.wm.shell.flicker.helpers.AppPairsHelper.Companion.TEST_REPETITIONS
-import com.android.wm.shell.flicker.appPairsDividerIsInvisible
-import com.android.wm.shell.flicker.appPairsDividerIsVisible
+import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
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.appPairsDividerIsInvisible
+import com.android.wm.shell.flicker.appPairsDividerIsVisible
+import com.android.wm.shell.flicker.helpers.AppPairsHelper
+import com.android.wm.shell.flicker.helpers.AppPairsHelper.Companion.TEST_REPETITIONS
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.junit.runners.Parameterized
-import java.io.IOException
/**
* Test AppPairs launch.
@@ -64,15 +61,18 @@
primaryApp.launchViaIntent()
secondaryApp.launchViaIntent()
nonResizeableApp.launchViaIntent()
- updateTaskId()
+ updateTasksId()
}
}
teardown {
eachRun {
executeShellCommand(composePairsCommand(
primaryTaskId, secondaryTaskId, false /* pair */))
+ executeShellCommand(composePairsCommand(
+ primaryTaskId, nonResizeableTaskId, false /* pair */))
primaryApp.exit()
secondaryApp.exit()
+ nonResizeableApp.exit()
}
}
assertions {
@@ -184,12 +184,12 @@
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()
@@ -205,52 +205,23 @@
}
}
- private fun composePairsCommand(
- primaryApp: String,
- secondaryApp: String,
- pair: Boolean
- ): String = buildString {
- // dumpsys activity service SystemUIService WMShell {pair|unpair} ${TASK_ID_1} ${TASK_ID_2}
- append("dumpsys activity service SystemUIService WMShell ")
- if (pair) {
- append("pair ")
- } else {
- append("unpair ")
- }
- append(primaryApp + " " + secondaryApp)
- }
-
- private fun executeShellCommand(cmd: String) {
- try {
- SystemUtil.runShellCommand(instrumentation, cmd)
- } catch (e: IOException) {
- Log.d("AppPairsTest", "executeShellCommand error!" + e)
- }
- }
-
- private fun updateTaskId() {
- val primaryAppComponent = primaryApp.openAppIntent.component
- val secondaryAppComponent = secondaryApp.openAppIntent.component
- val nonResizeableAppComponent = nonResizeableApp.openAppIntent.component
+ fun updateTasksId() {
if (primaryAppComponent != null) {
- primaryTaskId = appPairsHelper.getTaskIdForActivity(
+ primaryTaskId = getTaskIdForActivity(
primaryAppComponent.packageName, primaryAppComponent.className).toString()
}
if (secondaryAppComponent != null) {
- secondaryTaskId = appPairsHelper.getTaskIdForActivity(
+ secondaryTaskId = getTaskIdForActivity(
secondaryAppComponent.packageName, secondaryAppComponent.className).toString()
}
if (nonResizeableAppComponent != null) {
- nonResizeableTaskId = appPairsHelper.getTaskIdForActivity(
- nonResizeableAppComponent.packageName,
- nonResizeableAppComponent.className).toString()
+ nonResizeableTaskId = 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 4d46f28..35db797 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
@@ -16,6 +16,9 @@
package com.android.wm.shell.flicker.apppairs
+import android.system.helpers.ActivityHelper
+import android.util.Log
+import com.android.compatibility.common.util.SystemUtil
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
@@ -23,21 +26,59 @@
import com.android.wm.shell.flicker.helpers.AppPairsHelper
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
import com.android.wm.shell.flicker.testapp.Components
+import java.io.IOException
abstract class AppPairsTestBase(
rotationName: String,
rotation: Int
) : NonRotationTestBase(rotationName, rotation) {
- protected val appPairsHelper = AppPairsHelper(instrumentation,
+ val activityHelper = ActivityHelper.getInstance()
+
+ val appPairsHelper = AppPairsHelper(instrumentation,
TEST_APP_SPLITSCREEN_PRIMARY_LABEL,
Components.SplitScreenActivity())
- protected val primaryApp = SplitScreenHelper(instrumentation,
+ val primaryApp = SplitScreenHelper(instrumentation,
TEST_APP_SPLITSCREEN_PRIMARY_LABEL,
Components.SplitScreenActivity())
- protected val secondaryApp = SplitScreenHelper(instrumentation,
+ val secondaryApp = SplitScreenHelper(instrumentation,
TEST_APP_SPLITSCREEN_SECONDARY_LABEL,
Components.SplitScreenSecondaryActivity())
- protected val nonResizeableApp = SplitScreenHelper(instrumentation,
+ val nonResizeableApp = SplitScreenHelper(instrumentation,
TEST_APP_NONRESIZEABLE_LABEL,
Components.NonResizeableActivity())
+
+ val primaryAppComponent = primaryApp.openAppIntent.component
+ val secondaryAppComponent = secondaryApp.openAppIntent.component
+ val nonResizeableAppComponent = nonResizeableApp.openAppIntent.component
+
+ var primaryTaskId = ""
+ var secondaryTaskId = ""
+ var nonResizeableTaskId = ""
+
+ fun composePairsCommand(
+ primaryApp: String,
+ secondaryApp: String,
+ pair: Boolean
+ ): String = buildString {
+ // dumpsys activity service SystemUIService WMShell {pair|unpair} ${TASK_ID_1} ${TASK_ID_2}
+ append("dumpsys activity service SystemUIService WMShell ")
+ if (pair) {
+ append("pair ")
+ } else {
+ append("unpair ")
+ }
+ append(primaryApp + " " + secondaryApp)
+ }
+
+ fun executeShellCommand(cmd: String) {
+ try {
+ SystemUtil.runShellCommand(instrumentation, cmd)
+ } catch (e: IOException) {
+ Log.d("AppPairsTest", "executeShellCommand error!" + e)
+ }
+ }
+
+ fun getTaskIdForActivity(pkgName: String, activityName: String): Int {
+ return activityHelper.getTaskIdForActivity(pkgName, activityName)
+ }
}
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/RotateTwoLaunchedAppTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/RotateTwoLaunchedAppTest.kt
new file mode 100644
index 0000000..d07e0dc
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/RotateTwoLaunchedAppTest.kt
@@ -0,0 +1,166 @@
+/*
+ * 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.apppairs
+
+import android.os.SystemClock
+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.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.appPairsDividerIsVisible
+import com.android.wm.shell.flicker.appPairsPrimaryBoundsIsVisible
+import com.android.wm.shell.flicker.appPairsSecondaryBoundsIsVisible
+import com.android.wm.shell.flicker.helpers.AppPairsHelper
+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 apps to app pairs and rotate.
+ * To run this test: `atest WMShellFlickerTests:RotateTwoLaunchedAppTest`
+ */
+@RequiresDevice
+@RunWith(Parameterized::class)
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+class RotateTwoLaunchedAppTest(
+ rotationName: String,
+ rotation: Int
+) : AppPairsTestBase(rotationName, rotation) {
+ private val appPairsRotationSetup: FlickerBuilder
+ get() = FlickerBuilder(instrumentation).apply {
+ val testSetupRotation = "testSetupRotation"
+ withTestName {
+ testSetupRotation
+ }
+ setup {
+ test {
+ uiDevice.wakeUpAndGoToHomeScreen()
+ primaryApp.launchViaIntent()
+ secondaryApp.launchViaIntent()
+ updateTasksId()
+ }
+ }
+ teardown {
+ eachRun {
+ executeShellCommand(composePairsCommand(
+ primaryTaskId, secondaryTaskId, false /* pair */))
+ primaryApp.exit()
+ secondaryApp.exit()
+ }
+ }
+ }
+
+ @Test
+ fun testRotateInAppPairsMode() {
+ val testTag = "testRotateInAppPairsMode"
+ runWithFlicker(appPairsRotationSetup) {
+ withTestName { testTag }
+ repeat {
+ SplitScreenHelper.TEST_REPETITIONS
+ }
+ transitions {
+ executeShellCommand(composePairsCommand(
+ primaryTaskId, secondaryTaskId, true /* pair */))
+ SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
+ setRotation(rotation)
+ }
+ assertions {
+ layersTrace {
+ navBarLayerRotatesAndScales(Surface.ROTATION_0, rotation)
+ statusBarLayerRotatesScales(Surface.ROTATION_0, rotation)
+ appPairsDividerIsVisible()
+ appPairsPrimaryBoundsIsVisible(
+ rotation, primaryApp.defaultWindowName, 172776659)
+ appPairsSecondaryBoundsIsVisible(
+ rotation, secondaryApp.defaultWindowName, 172776659)
+ }
+ windowManagerTrace {
+ navBarWindowIsAlwaysVisible()
+ statusBarWindowIsAlwaysVisible()
+ end {
+ showsAppWindow(primaryApp.defaultWindowName)
+ .and().showsAppWindow(secondaryApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
+ @Test
+ fun testRotateAndEnterAppPairsMode() {
+ val testTag = "testRotateAndEnterAppPairsMode"
+ runWithFlicker(appPairsRotationSetup) {
+ withTestName { testTag }
+ repeat {
+ SplitScreenHelper.TEST_REPETITIONS
+ }
+ transitions {
+ setRotation(rotation)
+ executeShellCommand(composePairsCommand(
+ primaryTaskId, secondaryTaskId, true /* pair */))
+ SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
+ }
+ assertions {
+ layersTrace {
+ navBarLayerRotatesAndScales(Surface.ROTATION_0, rotation)
+ statusBarLayerRotatesScales(Surface.ROTATION_0, rotation)
+ appPairsDividerIsVisible()
+ appPairsPrimaryBoundsIsVisible(
+ rotation, primaryApp.defaultWindowName, 172776659)
+ appPairsSecondaryBoundsIsVisible(
+ rotation, secondaryApp.defaultWindowName, 172776659)
+ }
+ windowManagerTrace {
+ navBarWindowIsAlwaysVisible()
+ statusBarWindowIsAlwaysVisible()
+ end {
+ showsAppWindow(primaryApp.defaultWindowName)
+ .and().showsAppWindow(secondaryApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
+ fun updateTasksId() {
+ if (primaryAppComponent != null) {
+ primaryTaskId = getTaskIdForActivity(
+ primaryAppComponent.packageName, primaryAppComponent.className).toString()
+ }
+ if (secondaryAppComponent != null) {
+ secondaryTaskId = getTaskIdForActivity(
+ secondaryAppComponent.packageName, secondaryAppComponent.className).toString()
+ }
+ }
+
+ 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/helpers/AppPairsHelper.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/AppPairsHelper.kt
index e2cda7a..d77396f 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/AppPairsHelper.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/AppPairsHelper.kt
@@ -18,7 +18,6 @@
import android.app.Instrumentation
import android.graphics.Region
-import android.system.helpers.ActivityHelper
import com.android.server.wm.flicker.helpers.WindowUtils
import com.android.wm.shell.flicker.testapp.Components
@@ -31,8 +30,6 @@
activityLabel,
componentsInfo
) {
- val activityHelper = ActivityHelper.getInstance()
-
fun getPrimaryBounds(dividerBounds: Region): android.graphics.Region {
val primaryAppBounds = Region(0, 0, dividerBounds.bounds.right,
dividerBounds.bounds.bottom + WindowUtils.dockedStackDividerInset)
@@ -47,10 +44,6 @@
return secondaryAppBounds
}
- fun getTaskIdForActivity(pkgName: String, activityName: String): Int {
- return activityHelper.getTaskIdForActivity(pkgName, activityName)
- }
-
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/helpers/ImeAppHelper.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/ImeAppHelper.kt
index d580104..c546a4d 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/ImeAppHelper.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/ImeAppHelper.kt
@@ -20,7 +20,6 @@
import androidx.test.uiautomator.By
import androidx.test.uiautomator.Until
import com.android.server.wm.flicker.helpers.FIND_TIMEOUT
-import com.android.server.wm.flicker.helpers.waitForIME
import com.android.wm.shell.flicker.TEST_APP_IME_ACTIVITY_LABEL
import com.android.wm.shell.flicker.testapp.Components
import org.junit.Assert
@@ -39,14 +38,9 @@
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 (!uiDevice.waitForIME()) {
- Assert.fail("IME did not appear")
- }
}
fun closeIME() {
uiDevice.pressBack()
- // Using only the AccessibilityInfo it is not possible to identify if the IME is active
- uiDevice.waitForIdle(1000)
}
}
\ No newline at end of file
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt
index 6b44ce6..866d654 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt
@@ -25,8 +25,10 @@
import com.android.server.wm.flicker.helpers.closePipWindow
import com.android.server.wm.flicker.helpers.hasPipWindow
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
+import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
import com.android.wm.shell.flicker.IME_WINDOW_NAME
import com.android.wm.shell.flicker.helpers.ImeAppHelper
+import com.android.wm.shell.flicker.testapp.Components
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -46,6 +48,8 @@
rotation: Int
) : PipTestBase(rotationName, rotation) {
private val keyboardApp = ImeAppHelper(instrumentation)
+ private val keyboardComponent = Components.ImeActivity().componentName
+ private val helper = WindowManagerStateHelper()
private val keyboardScenario: FlickerBuilder
get() = FlickerBuilder(instrumentation).apply {
@@ -64,6 +68,8 @@
// UiAutomator doesn't support to launch the multiple Activities in a task.
// So use launchActivity() for the Keyboard Activity.
keyboardApp.launchViaIntent()
+ helper.waitForAppTransitionIdle()
+ helper.waitForFullScreenApp(keyboardComponent)
}
}
teardown {
@@ -88,9 +94,11 @@
transitions {
// open the soft keyboard
keyboardApp.openIME()
+ helper.waitImeWindowShown()
// then close it again
keyboardApp.closeIME()
+ helper.waitImeWindowGone()
}
assertions {
windowManagerTrace {
@@ -112,11 +120,13 @@
transitions {
// open the soft keyboard
keyboardApp.openIME()
+ helper.waitImeWindowShown()
}
teardown {
eachRun {
// close the keyboard
keyboardApp.closeIME()
+ helper.waitImeWindowGone()
}
}
assertions {
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/TaskSnapshotWindowTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/TaskSnapshotWindowTest.java
index 94af329..414a0a7 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/TaskSnapshotWindowTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/TaskSnapshotWindowTest.java
@@ -96,7 +96,7 @@
ColorSpace.get(ColorSpace.Named.SRGB), ORIENTATION_PORTRAIT,
Surface.ROTATION_0, taskSize, contentInsets, false,
true /* isRealSnapshot */, WINDOWING_MODE_FULLSCREEN,
- 0 /* systemUiVisibility */, false /* isTranslucent */);
+ 0 /* systemUiVisibility */, false /* isTranslucent */, false /* hasImeSurface */);
}
private static TaskDescription createTaskDescription(int background, int statusBar,
diff --git a/libs/androidfw/AssetManager2.cpp b/libs/androidfw/AssetManager2.cpp
index a545b3d..bec80a7 100644
--- a/libs/androidfw/AssetManager2.cpp
+++ b/libs/androidfw/AssetManager2.cpp
@@ -670,7 +670,7 @@
}
auto entry_flags = type_spec->GetFlagsForEntryIndex(entry_idx);
- if (UNLIKELY(!entry_flags)) {
+ if (UNLIKELY(!entry_flags.has_value())) {
return base::unexpected(entry_flags.error());
}
type_flags |= entry_flags.value();
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 4010e4e..bce70e2 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -897,12 +897,12 @@
// Decode the UTF-16 length. This is not used if we're not
// converting to UTF-16 from UTF-8.
const base::expected<size_t, IOError> u16len = decodeLength(&str);
- if (UNLIKELY(!u16len)) {
+ if (UNLIKELY(!u16len.has_value())) {
return base::unexpected(u16len.error());
}
const base::expected<size_t, IOError> u8len = decodeLength(&str);
- if (UNLIKELY(!u8len)) {
+ if (UNLIKELY(!u8len.has_value())) {
return base::unexpected(u8len.error());
}
diff --git a/libs/androidfw/ResourceUtils.cpp b/libs/androidfw/ResourceUtils.cpp
index a34aa72..87fb2c0 100644
--- a/libs/androidfw/ResourceUtils.cpp
+++ b/libs/androidfw/ResourceUtils.cpp
@@ -56,7 +56,8 @@
.package_len = package_name.size(),
};
- if (base::expected<StringPiece, NullOrIOError> type_str = type_string_ref.string8()) {
+ if (base::expected<StringPiece, NullOrIOError> type_str = type_string_ref.string8();
+ type_str.ok()) {
name.type = type_str->data();
name.type_len = type_str->size();
} else if (UNLIKELY(IsIOError(type_str))) {
@@ -64,7 +65,8 @@
}
if (name.type == nullptr) {
- if (base::expected<StringPiece16, NullOrIOError> type16_str = type_string_ref.string16()) {
+ if (base::expected<StringPiece16, NullOrIOError> type16_str = type_string_ref.string16();
+ type16_str.ok()) {
name.type16 = type16_str->data();
name.type_len = type16_str->size();
} else if (!type16_str.has_value()) {
@@ -72,7 +74,8 @@
}
}
- if (base::expected<StringPiece, NullOrIOError> entry_str = entry_string_ref.string8()) {
+ if (base::expected<StringPiece, NullOrIOError> entry_str = entry_string_ref.string8();
+ entry_str.ok()) {
name.entry = entry_str->data();
name.entry_len = entry_str->size();
} else if (UNLIKELY(IsIOError(entry_str))) {
@@ -80,7 +83,8 @@
}
if (name.entry == nullptr) {
- if (base::expected<StringPiece16, NullOrIOError> entry16_str = entry_string_ref.string16()) {
+ if (base::expected<StringPiece16, NullOrIOError> entry16_str = entry_string_ref.string16();
+ entry16_str.ok()) {
name.entry16 = entry16_str->data();
name.entry_len = entry16_str->size();
} else if (!entry16_str.has_value()) {
diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp
index 9d82f63..615bf4d 100644
--- a/libs/hwui/Android.bp
+++ b/libs/hwui/Android.bp
@@ -181,6 +181,8 @@
api_lint: {
enabled: false,
},
+ // TODO: remove this
+ unsafe_ignore_missing_latest_api: true,
}
filegroup {
diff --git a/libs/hwui/DisplayListOps.in b/libs/hwui/DisplayListOps.in
index c6c4ba8..1b1be43 100644
--- a/libs/hwui/DisplayListOps.in
+++ b/libs/hwui/DisplayListOps.in
@@ -40,7 +40,6 @@
X(DrawDrawable)
X(DrawPicture)
X(DrawImage)
-X(DrawImageNine)
X(DrawImageRect)
X(DrawImageLattice)
X(DrawTextBlob)
diff --git a/libs/hwui/RecordingCanvas.cpp b/libs/hwui/RecordingCanvas.cpp
index a495ec4..6bf2e99 100644
--- a/libs/hwui/RecordingCanvas.cpp
+++ b/libs/hwui/RecordingCanvas.cpp
@@ -306,42 +306,29 @@
struct DrawImage final : Op {
static const auto kType = Type::DrawImage;
- DrawImage(sk_sp<const SkImage>&& image, SkScalar x, SkScalar y, const SkPaint* paint,
- BitmapPalette palette)
- : image(std::move(image)), x(x), y(y), palette(palette) {
+ DrawImage(sk_sp<const SkImage>&& image, SkScalar x, SkScalar y,
+ const SkSamplingOptions& sampling, const SkPaint* paint, BitmapPalette palette)
+ : image(std::move(image)), x(x), y(y), sampling(sampling), palette(palette) {
if (paint) {
this->paint = *paint;
}
}
sk_sp<const SkImage> image;
SkScalar x, y;
+ SkSamplingOptions sampling;
SkPaint paint;
BitmapPalette palette;
- void draw(SkCanvas* c, const SkMatrix&) const { c->drawImage(image.get(), x, y, &paint); }
-};
-struct DrawImageNine final : Op {
- static const auto kType = Type::DrawImageNine;
- DrawImageNine(sk_sp<const SkImage>&& image, const SkIRect& center, const SkRect& dst,
- const SkPaint* paint)
- : image(std::move(image)), center(center), dst(dst) {
- if (paint) {
- this->paint = *paint;
- }
- }
- sk_sp<const SkImage> image;
- SkIRect center;
- SkRect dst;
- SkPaint paint;
void draw(SkCanvas* c, const SkMatrix&) const {
- c->drawImageNine(image.get(), center, dst, &paint);
+ c->drawImage(image.get(), x, y, sampling, &paint);
}
};
struct DrawImageRect final : Op {
static const auto kType = Type::DrawImageRect;
DrawImageRect(sk_sp<const SkImage>&& image, const SkRect* src, const SkRect& dst,
- const SkPaint* paint, SkCanvas::SrcRectConstraint constraint,
- BitmapPalette palette)
- : image(std::move(image)), dst(dst), constraint(constraint), palette(palette) {
+ const SkSamplingOptions& sampling, const SkPaint* paint,
+ SkCanvas::SrcRectConstraint constraint, BitmapPalette palette)
+ : image(std::move(image)), dst(dst), sampling(sampling), constraint(constraint)
+ , palette(palette) {
this->src = src ? *src : SkRect::MakeIWH(this->image->width(), this->image->height());
if (paint) {
this->paint = *paint;
@@ -349,23 +336,26 @@
}
sk_sp<const SkImage> image;
SkRect src, dst;
+ SkSamplingOptions sampling;
SkPaint paint;
SkCanvas::SrcRectConstraint constraint;
BitmapPalette palette;
void draw(SkCanvas* c, const SkMatrix&) const {
- c->drawImageRect(image.get(), src, dst, &paint, constraint);
+ c->drawImageRect(image.get(), src, dst, sampling, &paint, constraint);
}
};
struct DrawImageLattice final : Op {
static const auto kType = Type::DrawImageLattice;
DrawImageLattice(sk_sp<const SkImage>&& image, int xs, int ys, int fs, const SkIRect& src,
- const SkRect& dst, const SkPaint* paint, BitmapPalette palette)
+ const SkRect& dst, SkFilterMode filter, const SkPaint* paint,
+ BitmapPalette palette)
: image(std::move(image))
, xs(xs)
, ys(ys)
, fs(fs)
, src(src)
, dst(dst)
+ , filter(filter)
, palette(palette) {
if (paint) {
this->paint = *paint;
@@ -375,6 +365,7 @@
int xs, ys, fs;
SkIRect src;
SkRect dst;
+ SkFilterMode filter;
SkPaint paint;
BitmapPalette palette;
void draw(SkCanvas* c, const SkMatrix&) const {
@@ -383,7 +374,8 @@
auto flags =
(0 == fs) ? nullptr : pod<SkCanvas::Lattice::RectType>(
this, (xs + ys) * sizeof(int) + fs * sizeof(SkColor));
- c->drawImageLattice(image.get(), {xdivs, ydivs, flags, xs, ys, &src, colors}, dst, &paint);
+ c->drawImageLattice(image.get(), {xdivs, ydivs, flags, xs, ys, &src, colors}, dst,
+ filter, &paint);
}
};
@@ -448,9 +440,10 @@
};
struct DrawAtlas final : Op {
static const auto kType = Type::DrawAtlas;
- DrawAtlas(const SkImage* atlas, int count, SkBlendMode xfermode, const SkRect* cull,
- const SkPaint* paint, bool has_colors)
- : atlas(sk_ref_sp(atlas)), count(count), xfermode(xfermode), has_colors(has_colors) {
+ DrawAtlas(const SkImage* atlas, int count, SkBlendMode mode, const SkSamplingOptions& sampling,
+ const SkRect* cull, const SkPaint* paint, bool has_colors)
+ : atlas(sk_ref_sp(atlas)), count(count), mode(mode), sampling(sampling)
+ , has_colors(has_colors) {
if (cull) {
this->cull = *cull;
}
@@ -460,7 +453,8 @@
}
sk_sp<const SkImage> atlas;
int count;
- SkBlendMode xfermode;
+ SkBlendMode mode;
+ SkSamplingOptions sampling;
SkRect cull = kUnset;
SkPaint paint;
bool has_colors;
@@ -469,7 +463,8 @@
auto texs = pod<SkRect>(this, count * sizeof(SkRSXform));
auto colors = has_colors ? pod<SkColor>(this, count * (sizeof(SkRSXform) + sizeof(SkRect)))
: nullptr;
- c->drawAtlas(atlas.get(), xforms, texs, colors, count, xfermode, maybe_unset(cull), &paint);
+ c->drawAtlas(atlas.get(), xforms, texs, colors, count, mode, sampling, maybe_unset(cull),
+ &paint);
}
};
struct DrawShadowRec final : Op {
@@ -630,20 +625,18 @@
this->push<DrawPicture>(0, picture, matrix, paint);
}
void DisplayListData::drawImage(sk_sp<const SkImage> image, SkScalar x, SkScalar y,
- const SkPaint* paint, BitmapPalette palette) {
- this->push<DrawImage>(0, std::move(image), x, y, paint, palette);
-}
-void DisplayListData::drawImageNine(sk_sp<const SkImage> image, const SkIRect& center,
- const SkRect& dst, const SkPaint* paint) {
- this->push<DrawImageNine>(0, std::move(image), center, dst, paint);
+ const SkSamplingOptions& sampling, const SkPaint* paint,
+ BitmapPalette palette) {
+ this->push<DrawImage>(0, std::move(image), x, y, sampling, paint, palette);
}
void DisplayListData::drawImageRect(sk_sp<const SkImage> image, const SkRect* src,
- const SkRect& dst, const SkPaint* paint,
- SkCanvas::SrcRectConstraint constraint, BitmapPalette palette) {
- this->push<DrawImageRect>(0, std::move(image), src, dst, paint, constraint, palette);
+ const SkRect& dst, const SkSamplingOptions& sampling,
+ const SkPaint* paint, SkCanvas::SrcRectConstraint constraint,
+ BitmapPalette palette) {
+ this->push<DrawImageRect>(0, std::move(image), src, dst, sampling, paint, constraint, palette);
}
void DisplayListData::drawImageLattice(sk_sp<const SkImage> image, const SkCanvas::Lattice& lattice,
- const SkRect& dst, const SkPaint* paint,
+ const SkRect& dst, SkFilterMode filter, const SkPaint* paint,
BitmapPalette palette) {
int xs = lattice.fXCount, ys = lattice.fYCount;
int fs = lattice.fRectTypes ? (xs + 1) * (ys + 1) : 0;
@@ -651,7 +644,7 @@
fs * sizeof(SkColor);
SkASSERT(lattice.fBounds);
void* pod = this->push<DrawImageLattice>(bytes, std::move(image), xs, ys, fs, *lattice.fBounds,
- dst, paint, palette);
+ dst, filter, paint, palette);
copy_v(pod, lattice.fXDivs, xs, lattice.fYDivs, ys, lattice.fColors, fs, lattice.fRectTypes,
fs);
}
@@ -671,18 +664,19 @@
void* pod = this->push<DrawPoints>(count * sizeof(SkPoint), mode, count, paint);
copy_v(pod, points, count);
}
-void DisplayListData::drawVertices(const SkVertices* vertices, SkBlendMode mode, const SkPaint& paint) {
- this->push<DrawVertices>(0, vertices, mode, paint);
+void DisplayListData::drawVertices(const SkVertices* vert, SkBlendMode mode, const SkPaint& paint) {
+ this->push<DrawVertices>(0, vert, mode, paint);
}
void DisplayListData::drawAtlas(const SkImage* atlas, const SkRSXform xforms[], const SkRect texs[],
const SkColor colors[], int count, SkBlendMode xfermode,
- const SkRect* cull, const SkPaint* paint) {
+ const SkSamplingOptions& sampling, const SkRect* cull,
+ const SkPaint* paint) {
size_t bytes = count * (sizeof(SkRSXform) + sizeof(SkRect));
if (colors) {
bytes += count * sizeof(SkColor);
}
- void* pod =
- this->push<DrawAtlas>(bytes, atlas, count, xfermode, cull, paint, colors != nullptr);
+ void* pod = this->push<DrawAtlas>(bytes, atlas, count, xfermode, sampling, cull, paint,
+ colors != nullptr);
copy_v(pod, xforms, count, texs, count, colors, colors ? count : 0);
}
void DisplayListData::drawShadowRec(const SkPath& path, const SkDrawShadowRec& rec) {
@@ -908,18 +902,20 @@
}
void RecordingCanvas::drawImage(const sk_sp<SkImage>& image, SkScalar x, SkScalar y,
- const SkPaint* paint, BitmapPalette palette) {
- fDL->drawImage(image, x, y, paint, palette);
+ const SkSamplingOptions& sampling, const SkPaint* paint,
+ BitmapPalette palette) {
+ fDL->drawImage(image, x, y, sampling, paint, palette);
}
void RecordingCanvas::drawImageRect(const sk_sp<SkImage>& image, const SkRect& src,
- const SkRect& dst, const SkPaint* paint,
- SrcRectConstraint constraint, BitmapPalette palette) {
- fDL->drawImageRect(image, &src, dst, paint, constraint, palette);
+ const SkRect& dst, const SkSamplingOptions& sampling,
+ const SkPaint* paint, SrcRectConstraint constraint,
+ BitmapPalette palette) {
+ fDL->drawImageRect(image, &src, dst, sampling, paint, constraint, palette);
}
void RecordingCanvas::drawImageLattice(const sk_sp<SkImage>& image, const Lattice& lattice,
- const SkRect& dst, const SkPaint* paint,
+ const SkRect& dst, SkFilterMode filter, const SkPaint* paint,
BitmapPalette palette) {
if (!image || dst.isEmpty()) {
return;
@@ -933,28 +929,29 @@
}
if (SkLatticeIter::Valid(image->width(), image->height(), latticePlusBounds)) {
- fDL->drawImageLattice(image, latticePlusBounds, dst, paint, palette);
+ fDL->drawImageLattice(image, latticePlusBounds, dst, filter, paint, palette);
} else {
- fDL->drawImageRect(image, nullptr, dst, paint, SrcRectConstraint::kFast_SrcRectConstraint,
- palette);
+ SkSamplingOptions sampling(filter, SkMipmapMode::kNone);
+ fDL->drawImageRect(image, nullptr, dst, sampling, paint, kFast_SrcRectConstraint, palette);
}
}
-void RecordingCanvas::onDrawImage(const SkImage* img, SkScalar x, SkScalar y,
- const SkPaint* paint) {
- fDL->drawImage(sk_ref_sp(img), x, y, paint, BitmapPalette::Unknown);
+void RecordingCanvas::onDrawImage2(const SkImage* img, SkScalar x, SkScalar y,
+ const SkSamplingOptions& sampling, const SkPaint* paint) {
+ fDL->drawImage(sk_ref_sp(img), x, y, sampling, paint, BitmapPalette::Unknown);
}
-void RecordingCanvas::onDrawImageNine(const SkImage* img, const SkIRect& center, const SkRect& dst,
- const SkPaint* paint) {
- fDL->drawImageNine(sk_ref_sp(img), center, dst, paint);
+
+void RecordingCanvas::onDrawImageRect2(const SkImage* img, const SkRect& src, const SkRect& dst,
+ const SkSamplingOptions& sampling, const SkPaint* paint,
+ SrcRectConstraint constraint) {
+ fDL->drawImageRect(sk_ref_sp(img), &src, dst, sampling, paint, constraint,
+ BitmapPalette::Unknown);
}
-void RecordingCanvas::onDrawImageRect(const SkImage* img, const SkRect* src, const SkRect& dst,
- const SkPaint* paint, SrcRectConstraint constraint) {
- fDL->drawImageRect(sk_ref_sp(img), src, dst, paint, constraint, BitmapPalette::Unknown);
-}
-void RecordingCanvas::onDrawImageLattice(const SkImage* img, const SkCanvas::Lattice& lattice,
- const SkRect& dst, const SkPaint* paint) {
- fDL->drawImageLattice(sk_ref_sp(img), lattice, dst, paint, BitmapPalette::Unknown);
+
+void RecordingCanvas::onDrawImageLattice2(const SkImage* img, const SkCanvas::Lattice& lattice,
+ const SkRect& dst, SkFilterMode filter,
+ const SkPaint* paint) {
+ fDL->drawImageLattice(sk_ref_sp(img), lattice, dst, filter, paint, BitmapPalette::Unknown);
}
void RecordingCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
@@ -970,10 +967,11 @@
SkBlendMode mode, const SkPaint& paint) {
fDL->drawVertices(vertices, mode, paint);
}
-void RecordingCanvas::onDrawAtlas(const SkImage* atlas, const SkRSXform xforms[],
- const SkRect texs[], const SkColor colors[], int count,
- SkBlendMode bmode, const SkRect* cull, const SkPaint* paint) {
- fDL->drawAtlas(atlas, xforms, texs, colors, count, bmode, cull, paint);
+void RecordingCanvas::onDrawAtlas2(const SkImage* atlas, const SkRSXform xforms[],
+ const SkRect texs[], const SkColor colors[], int count,
+ SkBlendMode bmode, const SkSamplingOptions& sampling,
+ const SkRect* cull, const SkPaint* paint) {
+ fDL->drawAtlas(atlas, xforms, texs, colors, count, bmode, sampling, cull, paint);
}
void RecordingCanvas::onDrawShadowRec(const SkPath& path, const SkDrawShadowRec& rec) {
fDL->drawShadowRec(path, rec);
diff --git a/libs/hwui/RecordingCanvas.h b/libs/hwui/RecordingCanvas.h
index 4851148..89e3df7 100644
--- a/libs/hwui/RecordingCanvas.h
+++ b/libs/hwui/RecordingCanvas.h
@@ -108,19 +108,20 @@
void drawTextBlob(const SkTextBlob*, SkScalar, SkScalar, const SkPaint&);
- void drawImage(sk_sp<const SkImage>, SkScalar, SkScalar, const SkPaint*, BitmapPalette palette);
+ void drawImage(sk_sp<const SkImage>, SkScalar, SkScalar, const SkSamplingOptions&,
+ const SkPaint*, BitmapPalette palette);
void drawImageNine(sk_sp<const SkImage>, const SkIRect&, const SkRect&, const SkPaint*);
- void drawImageRect(sk_sp<const SkImage>, const SkRect*, const SkRect&, const SkPaint*,
- SkCanvas::SrcRectConstraint, BitmapPalette palette);
+ void drawImageRect(sk_sp<const SkImage>, const SkRect*, const SkRect&, const SkSamplingOptions&,
+ const SkPaint*, SkCanvas::SrcRectConstraint, BitmapPalette palette);
void drawImageLattice(sk_sp<const SkImage>, const SkCanvas::Lattice&, const SkRect&,
- const SkPaint*, BitmapPalette);
+ SkFilterMode, const SkPaint*, BitmapPalette);
void drawPatch(const SkPoint[12], const SkColor[4], const SkPoint[4], SkBlendMode,
const SkPaint&);
void drawPoints(SkCanvas::PointMode, size_t, const SkPoint[], const SkPaint&);
void drawVertices(const SkVertices*, SkBlendMode, const SkPaint&);
void drawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[], int,
- SkBlendMode, const SkRect*, const SkPaint*);
+ SkBlendMode, const SkSamplingOptions&, const SkRect*, const SkPaint*);
void drawShadowRec(const SkPath&, const SkDrawShadowRec&);
void drawVectorDrawable(VectorDrawableRoot* tree);
void drawWebView(skiapipeline::FunctorDrawable*);
@@ -178,26 +179,27 @@
void onDrawTextBlob(const SkTextBlob*, SkScalar, SkScalar, const SkPaint&) override;
- void drawImage(const sk_sp<SkImage>& image, SkScalar left, SkScalar top, const SkPaint* paint,
- BitmapPalette pallete);
+ void drawImage(const sk_sp<SkImage>&, SkScalar left, SkScalar top, const SkSamplingOptions&,
+ const SkPaint* paint, BitmapPalette pallete);
void drawImageRect(const sk_sp<SkImage>& image, const SkRect& src, const SkRect& dst,
- const SkPaint* paint, SrcRectConstraint constraint, BitmapPalette palette);
+ const SkSamplingOptions&, const SkPaint*, SrcRectConstraint, BitmapPalette);
void drawImageLattice(const sk_sp<SkImage>& image, const Lattice& lattice, const SkRect& dst,
- const SkPaint* paint, BitmapPalette palette);
+ SkFilterMode, const SkPaint* paint, BitmapPalette palette);
- void onDrawImage(const SkImage*, SkScalar, SkScalar, const SkPaint*) override;
- void onDrawImageLattice(const SkImage*, const Lattice&, const SkRect&, const SkPaint*) override;
- void onDrawImageNine(const SkImage*, const SkIRect&, const SkRect&, const SkPaint*) override;
- void onDrawImageRect(const SkImage*, const SkRect*, const SkRect&, const SkPaint*,
- SrcRectConstraint) override;
+ void onDrawImage2(const SkImage*, SkScalar, SkScalar, const SkSamplingOptions&,
+ const SkPaint*) override;
+ void onDrawImageLattice2(const SkImage*, const Lattice&, const SkRect&, SkFilterMode,
+ const SkPaint*) override;
+ void onDrawImageRect2(const SkImage*, const SkRect&, const SkRect&, const SkSamplingOptions&,
+ const SkPaint*, SrcRectConstraint) override;
void onDrawPatch(const SkPoint[12], const SkColor[4], const SkPoint[4], SkBlendMode,
const SkPaint&) override;
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) override;
void onDrawVerticesObject(const SkVertices*, SkBlendMode, const SkPaint&) override;
- void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[], int,
- SkBlendMode, const SkRect*, const SkPaint*) override;
+ void onDrawAtlas2(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[], int,
+ SkBlendMode, const SkSamplingOptions&, const SkRect*, const SkPaint*) override;
void onDrawShadowRec(const SkPath&, const SkDrawShadowRec&) override;
void drawVectorDrawable(VectorDrawableRoot* tree);
diff --git a/libs/hwui/SkiaCanvas.h b/libs/hwui/SkiaCanvas.h
index 591ae5c..584321e 100644
--- a/libs/hwui/SkiaCanvas.h
+++ b/libs/hwui/SkiaCanvas.h
@@ -190,7 +190,6 @@
}
operator const SkPaint*() const { return mPtr; }
const SkPaint* operator->() const { assert(mPtr); return mPtr; }
- const SkPaint& operator*() const { assert(mPtr); return *mPtr; }
explicit operator bool() { return mPtr != nullptr; }
private:
const SkPaint* mPtr;
diff --git a/libs/hwui/pipeline/skia/DumpOpsCanvas.h b/libs/hwui/pipeline/skia/DumpOpsCanvas.h
index 0eb526a..26ff8bf 100644
--- a/libs/hwui/pipeline/skia/DumpOpsCanvas.h
+++ b/libs/hwui/pipeline/skia/DumpOpsCanvas.h
@@ -86,22 +86,18 @@
mOutput << mIdent << "drawTextBlob" << std::endl;
}
- void onDrawImage(const SkImage*, SkScalar dx, SkScalar dy, const SkPaint*) override {
+ void onDrawImage2(const SkImage*, SkScalar dx, SkScalar dy, const SkSamplingOptions&,
+ const SkPaint*) override {
mOutput << mIdent << "drawImage" << std::endl;
}
- void onDrawImageNine(const SkImage*, const SkIRect& center, const SkRect& dst,
- const SkPaint*) override {
- mOutput << mIdent << "drawImageNine" << std::endl;
- }
-
- void onDrawImageRect(const SkImage*, const SkRect*, const SkRect&, const SkPaint*,
- SrcRectConstraint) override {
+ void onDrawImageRect2(const SkImage*, const SkRect&, const SkRect&, const SkSamplingOptions&,
+ const SkPaint*, SrcRectConstraint) override {
mOutput << mIdent << "drawImageRect" << std::endl;
}
- void onDrawImageLattice(const SkImage*, const Lattice& lattice, const SkRect& dst,
- const SkPaint*) override {
+ void onDrawImageLattice2(const SkImage*, const Lattice& lattice, const SkRect& dst,
+ SkFilterMode, const SkPaint*) override {
mOutput << mIdent << "drawImageLattice" << std::endl;
}
diff --git a/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp b/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp
index bfbdc5c..c6c9e9d 100644
--- a/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp
+++ b/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp
@@ -19,8 +19,6 @@
#include <private/hwui/DrawGlInfo.h>
#include "FunctorDrawable.h"
#include "GrBackendSurface.h"
-#include "GrRenderTarget.h"
-#include "GrRenderTargetContext.h"
#include "RenderNode.h"
#include "SkAndroidFrameworkUtils.h"
#include "SkClipStack.h"
@@ -40,19 +38,13 @@
}
static void GetFboDetails(SkCanvas* canvas, GLuint* outFboID, SkISize* outFboSize) {
- GrRenderTargetContext* renderTargetContext =
- canvas->internal_private_accessTopLayerRenderTargetContext();
- LOG_ALWAYS_FATAL_IF(!renderTargetContext, "Failed to retrieve GrRenderTargetContext");
-
- GrRenderTarget* renderTarget = renderTargetContext->accessRenderTarget();
- LOG_ALWAYS_FATAL_IF(!renderTarget, "accessRenderTarget failed");
-
+ GrBackendRenderTarget renderTarget = canvas->topLayerBackendRenderTarget();
GrGLFramebufferInfo fboInfo;
- LOG_ALWAYS_FATAL_IF(!renderTarget->getBackendRenderTarget().getGLFramebufferInfo(&fboInfo),
+ LOG_ALWAYS_FATAL_IF(!renderTarget.getGLFramebufferInfo(&fboInfo),
"getGLFrameBufferInfo failed");
*outFboID = fboInfo.fFBOID;
- *outFboSize = SkISize::Make(renderTargetContext->width(), renderTargetContext->height());
+ *outFboSize = renderTarget.dimensions();
}
void GLFunctorDrawable::onDraw(SkCanvas* canvas) {
@@ -75,7 +67,7 @@
SkISize fboSize;
GetFboDetails(canvas, &fboID, &fboSize);
- SkIRect surfaceBounds = canvas->internal_private_getTopLayerBounds();
+ SkIRect surfaceBounds = canvas->topLayerBounds();
SkIRect clipBounds = canvas->getDeviceClipBounds();
SkM44 mat4(canvas->getLocalToDevice());
SkRegion clipRegion;
diff --git a/libs/hwui/pipeline/skia/SkiaRecordingCanvas.cpp b/libs/hwui/pipeline/skia/SkiaRecordingCanvas.cpp
index e292cbd..a436278 100644
--- a/libs/hwui/pipeline/skia/SkiaRecordingCanvas.cpp
+++ b/libs/hwui/pipeline/skia/SkiaRecordingCanvas.cpp
@@ -185,18 +185,21 @@
}
template <typename Proc>
-void applyLooper(SkDrawLooper* looper, const SkPaint& paint, Proc proc) {
+void applyLooper(SkDrawLooper* looper, const SkPaint* paint, Proc proc) {
if (looper) {
SkSTArenaAlloc<256> alloc;
SkDrawLooper::Context* ctx = looper->makeContext(&alloc);
if (ctx) {
SkDrawLooper::Context::Info info;
for (;;) {
- SkPaint p = paint;
+ SkPaint p;
+ if (paint) {
+ p = *paint;
+ }
if (!ctx->next(&info, &p)) {
break;
}
- proc(info.fTranslate.fX, info.fTranslate.fY, p);
+ proc(info.fTranslate.fX, info.fTranslate.fY, &p);
}
}
} else {
@@ -204,11 +207,22 @@
}
}
+static SkFilterMode Paint_to_filter(const SkPaint* paint) {
+ return paint && paint->getFilterQuality() != kNone_SkFilterQuality ? SkFilterMode::kLinear
+ : SkFilterMode::kNearest;
+}
+
+static SkSamplingOptions Paint_to_sampling(const SkPaint* paint) {
+ // Android only has 1-bit for "filter", so we don't try to cons-up mipmaps or cubics
+ return SkSamplingOptions(Paint_to_filter(paint), SkMipmapMode::kNone);
+}
+
void SkiaRecordingCanvas::drawBitmap(Bitmap& bitmap, float left, float top, const Paint* paint) {
sk_sp<SkImage> image = bitmap.makeImage();
- applyLooper(get_looper(paint), *filterBitmap(paint), [&](SkScalar x, SkScalar y, const SkPaint& p) {
- mRecorder.drawImage(image, left + x, top + y, &p, bitmap.palette());
+ applyLooper(get_looper(paint), filterBitmap(paint), [&](SkScalar x, SkScalar y,
+ const SkPaint* p) {
+ mRecorder.drawImage(image, left + x, top + y, Paint_to_sampling(p), p, bitmap.palette());
});
// if image->unique() is true, then mRecorder.drawImage failed for some reason. It also means
@@ -225,8 +239,9 @@
sk_sp<SkImage> image = bitmap.makeImage();
- applyLooper(get_looper(paint), *filterBitmap(paint), [&](SkScalar x, SkScalar y, const SkPaint& p) {
- mRecorder.drawImage(image, x, y, &p, bitmap.palette());
+ applyLooper(get_looper(paint), filterBitmap(paint), [&](SkScalar x, SkScalar y,
+ const SkPaint* p) {
+ mRecorder.drawImage(image, x, y, Paint_to_sampling(p), p, bitmap.palette());
});
if (!bitmap.isImmutable() && image.get() && !image->unique()) {
@@ -242,9 +257,10 @@
sk_sp<SkImage> image = bitmap.makeImage();
- applyLooper(get_looper(paint), *filterBitmap(paint), [&](SkScalar x, SkScalar y, const SkPaint& p) {
- mRecorder.drawImageRect(image, srcRect, dstRect.makeOffset(x, y), &p,
- SkCanvas::kFast_SrcRectConstraint, bitmap.palette());
+ applyLooper(get_looper(paint), filterBitmap(paint), [&](SkScalar x, SkScalar y,
+ const SkPaint* p) {
+ mRecorder.drawImageRect(image, srcRect, dstRect.makeOffset(x, y), Paint_to_sampling(p),
+ p, SkCanvas::kFast_SrcRectConstraint, bitmap.palette());
});
if (!bitmap.isImmutable() && image.get() && !image->unique() && !srcRect.isEmpty() &&
@@ -276,16 +292,12 @@
lattice.fBounds = nullptr;
SkRect dst = SkRect::MakeLTRB(dstLeft, dstTop, dstRight, dstBottom);
-
- PaintCoW filteredPaint(paint);
- // HWUI always draws 9-patches with bilinear filtering, regardless of what is set in the Paint.
- if (!filteredPaint || filteredPaint->getFilterQuality() != kLow_SkFilterQuality) {
- filteredPaint.writeable().setFilterQuality(kLow_SkFilterQuality);
- }
sk_sp<SkImage> image = bitmap.makeImage();
- applyLooper(get_looper(paint), *filterBitmap(paint), [&](SkScalar x, SkScalar y, const SkPaint& p) {
- mRecorder.drawImageLattice(image, lattice, dst.makeOffset(x, y), &p, bitmap.palette());
+ applyLooper(get_looper(paint), filterBitmap(paint), [&](SkScalar x, SkScalar y,
+ const SkPaint* p) {
+ mRecorder.drawImageLattice(image, lattice, dst.makeOffset(x, y), Paint_to_filter(p),
+ p, bitmap.palette());
});
if (!bitmap.isImmutable() && image.get() && !image->unique() && !dst.isEmpty()) {
diff --git a/libs/hwui/tests/common/CallCountingCanvas.h b/libs/hwui/tests/common/CallCountingCanvas.h
index 594afd0..d3c41191 100644
--- a/libs/hwui/tests/common/CallCountingCanvas.h
+++ b/libs/hwui/tests/common/CallCountingCanvas.h
@@ -108,33 +108,27 @@
}
int drawImageCount = 0;
- void onDrawImage(const SkImage* image, SkScalar dx, SkScalar dy,
+ void onDrawImage2(const SkImage* image, SkScalar dx, SkScalar dy, const SkSamplingOptions&,
const SkPaint* paint) override {
drawImageCount++;
}
int drawImageRectCount = 0;
- void onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
- const SkPaint* paint, SkCanvas::SrcRectConstraint constraint) override {
+ void onDrawImageRect2(const SkImage*, const SkRect&, const SkRect&, const SkSamplingOptions&,
+ const SkPaint*, SkCanvas::SrcRectConstraint) override {
drawImageRectCount++;
}
- int drawImageNineCount = 0;
- void onDrawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst,
- const SkPaint* paint) override {
- drawImageNineCount++;
- }
-
int drawImageLatticeCount = 0;
- void onDrawImageLattice(const SkImage* image, const SkCanvas::Lattice& lattice,
- const SkRect& dst, const SkPaint* paint) override {
+ void onDrawImageLattice2(const SkImage* image, const SkCanvas::Lattice& lattice,
+ const SkRect& dst, SkFilterMode, const SkPaint* paint) override {
drawImageLatticeCount++;
}
int drawAtlasCount = 0;
- void onDrawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect rect[],
- const SkColor colors[], int count, SkBlendMode mode, const SkRect* cull,
- const SkPaint* paint) override {
+ void onDrawAtlas2(const SkImage* atlas, const SkRSXform xform[], const SkRect rect[],
+ const SkColor colors[], int count, SkBlendMode mode, const SkSamplingOptions&,
+ const SkRect* cull, const SkPaint* paint) override {
drawAtlasCount++;
}
@@ -171,4 +165,4 @@
} /* namespace test */
} /* namespace uirenderer */
-} /* namespace android */
\ No newline at end of file
+} /* namespace android */
diff --git a/libs/hwui/tests/unit/FatalTestCanvas.h b/libs/hwui/tests/unit/FatalTestCanvas.h
index 76ae085..2a74afc 100644
--- a/libs/hwui/tests/unit/FatalTestCanvas.h
+++ b/libs/hwui/tests/unit/FatalTestCanvas.h
@@ -60,25 +60,23 @@
void onDrawVerticesObject(const SkVertices*, SkBlendMode, const SkPaint&) {
ADD_FAILURE() << "onDrawVertices not expected in this test";
}
- void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[], int count,
- SkBlendMode, const SkRect* cull, const SkPaint*) {
+ void onDrawAtlas2(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[], int count,
+ SkBlendMode, const SkSamplingOptions&, const SkRect* cull, const SkPaint*) {
ADD_FAILURE() << "onDrawAtlas not expected in this test";
}
void onDrawPath(const SkPath&, const SkPaint&) {
ADD_FAILURE() << "onDrawPath not expected in this test";
}
- void onDrawImage(const SkImage*, SkScalar dx, SkScalar dy, const SkPaint*) {
+ void onDrawImage2(const SkImage*, SkScalar dx, SkScalar dy, const SkSamplingOptions&,
+ const SkPaint*) {
ADD_FAILURE() << "onDrawImage not expected in this test";
}
- void onDrawImageRect(const SkImage*, const SkRect*, const SkRect&, const SkPaint*,
- SrcRectConstraint) {
+ void onDrawImageRect2(const SkImage*, const SkRect&, const SkRect&, const SkSamplingOptions&,
+ const SkPaint*, SrcRectConstraint) {
ADD_FAILURE() << "onDrawImageRect not expected in this test";
}
- void onDrawImageNine(const SkImage*, const SkIRect& center, const SkRect& dst, const SkPaint*) {
- ADD_FAILURE() << "onDrawImageNine not expected in this test";
- }
- void onDrawImageLattice(const SkImage*, const Lattice& lattice, const SkRect& dst,
- const SkPaint*) {
+ void onDrawImageLattice2(const SkImage*, const Lattice& lattice, const SkRect& dst,
+ SkFilterMode, const SkPaint*) {
ADD_FAILURE() << "onDrawImageLattice not expected in this test";
}
void onClipRRect(const SkRRect& rrect, SkClipOp, ClipEdgeStyle) {
diff --git a/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp b/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp
index 26bc659..423400e 100644
--- a/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp
+++ b/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp
@@ -938,7 +938,8 @@
void onDrawRect(const SkRect& rect, const SkPaint& paint) override {
EXPECT_EQ(0, mDrawCounter++);
}
- void onDrawImage(const SkImage*, SkScalar dx, SkScalar dy, const SkPaint*) override {
+ void onDrawImage2(const SkImage*, SkScalar dx, SkScalar dy, const SkSamplingOptions&,
+ const SkPaint*) override {
EXPECT_EQ(1, mDrawCounter++);
}
};
@@ -1047,7 +1048,7 @@
EXPECT_EQ(2, canvas.mDrawCounter);
}
-// Verify that layers are composed with kLow_SkFilterQuality filter quality.
+// Verify that layers are composed with linear filtering.
RENDERTHREAD_SKIA_PIPELINE_TEST(RenderNodeDrawable, layerComposeQuality) {
static const int CANVAS_WIDTH = 1;
static const int CANVAS_HEIGHT = 1;
@@ -1056,10 +1057,12 @@
class FrameTestCanvas : public TestCanvasBase {
public:
FrameTestCanvas() : TestCanvasBase(CANVAS_WIDTH, CANVAS_HEIGHT) {}
- void onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
- const SkPaint* paint, SrcRectConstraint constraint) override {
+ void onDrawImageRect2(const SkImage* image, const SkRect& src, const SkRect& dst,
+ const SkSamplingOptions& sampling, const SkPaint* paint,
+ SrcRectConstraint constraint) override {
mDrawCounter++;
- EXPECT_EQ(kLow_SkFilterQuality, paint->getFilterQuality());
+ EXPECT_FALSE(sampling.useCubic);
+ EXPECT_EQ(SkFilterMode::kLinear, sampling.filter);
}
};
@@ -1169,8 +1172,9 @@
class VectorDrawableTestCanvas : public TestCanvasBase {
public:
VectorDrawableTestCanvas() : TestCanvasBase(CANVAS_WIDTH, CANVAS_HEIGHT) {}
- void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
- const SkPaint* paint, SrcRectConstraint constraint) override {
+ void onDrawImageRect2(const SkImage*, const SkRect& src, const SkRect& dst,
+ const SkSamplingOptions&, const SkPaint* paint,
+ SrcRectConstraint constraint) override {
const int index = mDrawCounter++;
switch (index) {
case 0:
diff --git a/libs/hwui/tests/unit/SkiaPipelineTests.cpp b/libs/hwui/tests/unit/SkiaPipelineTests.cpp
index e7a889d..6dd57b1 100644
--- a/libs/hwui/tests/unit/SkiaPipelineTests.cpp
+++ b/libs/hwui/tests/unit/SkiaPipelineTests.cpp
@@ -302,7 +302,8 @@
class ClippedTestCanvas : public SkCanvas {
public:
ClippedTestCanvas() : SkCanvas(CANVAS_WIDTH, CANVAS_HEIGHT) {}
- void onDrawImage(const SkImage*, SkScalar dx, SkScalar dy, const SkPaint*) override {
+ void onDrawImage2(const SkImage*, SkScalar dx, SkScalar dy, const SkSamplingOptions&,
+ const SkPaint*) override {
EXPECT_EQ(0, mDrawCounter++);
EXPECT_EQ(SkRect::MakeLTRB(10, 20, 30, 40), TestUtils::getClipBounds(this));
EXPECT_TRUE(getTotalMatrix().isIdentity());
@@ -336,7 +337,8 @@
class ClippedTestCanvas : public SkCanvas {
public:
ClippedTestCanvas() : SkCanvas(CANVAS_WIDTH, CANVAS_HEIGHT) {}
- void onDrawImage(const SkImage*, SkScalar dx, SkScalar dy, const SkPaint*) override {
+ void onDrawImage2(const SkImage*, SkScalar dx, SkScalar dy, const SkSamplingOptions&,
+ const SkPaint*) override {
EXPECT_EQ(0, mDrawCounter++);
// Expect clip to be rotated.
EXPECT_EQ(SkRect::MakeLTRB(CANVAS_HEIGHT - dirty.fTop - dirty.height(), dirty.fLeft,
diff --git a/wifi/aidl-export/android/net/wifi/WpsInfo.aidl b/location/java/android/location/GnssCapabilities.aidl
similarity index 82%
rename from wifi/aidl-export/android/net/wifi/WpsInfo.aidl
rename to location/java/android/location/GnssCapabilities.aidl
index f5e4ebe..bdf3014 100644
--- a/wifi/aidl-export/android/net/wifi/WpsInfo.aidl
+++ b/location/java/android/location/GnssCapabilities.aidl
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2011, The Android Open Source Project
+/*
+ * 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.
@@ -14,6 +14,6 @@
* limitations under the License.
*/
-package android.net.wifi;
+package android.location;
-parcelable WpsInfo;
+parcelable GnssCapabilities;
\ No newline at end of file
diff --git a/location/java/android/location/GnssCapabilities.java b/location/java/android/location/GnssCapabilities.java
index bbb5bb8..89a3bd5 100644
--- a/location/java/android/location/GnssCapabilities.java
+++ b/location/java/android/location/GnssCapabilities.java
@@ -16,121 +16,207 @@
package android.location;
+import android.annotation.IntDef;
+import android.annotation.NonNull;
import android.annotation.SystemApi;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.util.Objects;
+import java.util.concurrent.Executor;
/**
- * A container of supported GNSS chipset capabilities.
+ * GNSS chipset capabilities.
*/
-public final class GnssCapabilities {
- /**
- * Bit mask indicating GNSS chipset supports low power mode.
- * @hide
- */
- public static final long LOW_POWER_MODE = 1L << 0;
+public final class GnssCapabilities implements Parcelable {
- /**
- * Bit mask indicating GNSS chipset supports blocklisting satellites.
- * @hide
- */
- public static final long SATELLITE_BLOCKLIST = 1L << 1;
-
- /**
- * Bit mask indicating GNSS chipset supports geofencing.
- * @hide
- */
- public static final long GEOFENCING = 1L << 2;
-
- /**
- * Bit mask indicating GNSS chipset supports measurements.
- * @hide
- */
- public static final long MEASUREMENTS = 1L << 3;
-
- /**
- * Bit mask indicating GNSS chipset supports navigation messages.
- * @hide
- */
- public static final long NAV_MESSAGES = 1L << 4;
-
- /**
- * Bit mask indicating GNSS chipset supports measurement corrections.
- * @hide
- */
- public static final long MEASUREMENT_CORRECTIONS = 1L << 5;
-
- /**
- * Bit mask indicating GNSS chipset supports line-of-sight satellite identification
- * measurement corrections.
- * @hide
- */
- public static final long MEASUREMENT_CORRECTIONS_LOS_SATS = 1L << 6;
-
- /**
- * Bit mask indicating GNSS chipset supports per satellite excess-path-length
- * measurement corrections.
- * @hide
- */
- public static final long MEASUREMENT_CORRECTIONS_EXCESS_PATH_LENGTH = 1L << 7;
-
- /**
- * Bit mask indicating GNSS chipset supports reflecting planes measurement corrections.
- * @hide
- */
- public static final long MEASUREMENT_CORRECTIONS_REFLECTING_PLANE = 1L << 8;
-
- /**
- * Bit mask indicating GNSS chipset supports GNSS antenna info.
- * @hide
- */
- public static final long ANTENNA_INFO = 1L << 9;
+ // IMPORTANT - must match the Capabilities enum in IGnssCallback.hal
+ /** @hide */
+ public static final int TOP_HAL_CAPABILITY_SCHEDULING = 1;
+ /** @hide */
+ public static final int TOP_HAL_CAPABILITY_MSB = 2;
+ /** @hide */
+ public static final int TOP_HAL_CAPABILITY_MSA = 4;
+ /** @hide */
+ public static final int TOP_HAL_CAPABILITY_SINGLE_SHOT = 8;
+ /** @hide */
+ public static final int TOP_HAL_CAPABILITY_ON_DEMAND_TIME = 16;
+ /** @hide */
+ public static final int TOP_HAL_CAPABILITY_GEOFENCING = 32;
+ /** @hide */
+ public static final int TOP_HAL_CAPABILITY_MEASUREMENTS = 64;
+ /** @hide */
+ public static final int TOP_HAL_CAPABILITY_NAV_MESSAGES = 128;
+ /** @hide */
+ public static final int TOP_HAL_CAPABILITY_LOW_POWER_MODE = 256;
+ /** @hide */
+ public static final int TOP_HAL_CAPABILITY_SATELLITE_BLOCKLIST = 512;
+ /** @hide */
+ public static final int TOP_HAL_CAPABILITY_MEASUREMENT_CORRECTIONS = 1024;
+ /** @hide */
+ public static final int TOP_HAL_CAPABILITY_ANTENNA_INFO = 2048;
/** @hide */
- public static final long INVALID_CAPABILITIES = -1;
+ @IntDef(flag = true, prefix = {"TOP_HAL_CAPABILITY_"}, value = {TOP_HAL_CAPABILITY_SCHEDULING,
+ TOP_HAL_CAPABILITY_MSB, TOP_HAL_CAPABILITY_MSA, TOP_HAL_CAPABILITY_SINGLE_SHOT,
+ TOP_HAL_CAPABILITY_ON_DEMAND_TIME, TOP_HAL_CAPABILITY_GEOFENCING,
+ TOP_HAL_CAPABILITY_MEASUREMENTS, TOP_HAL_CAPABILITY_NAV_MESSAGES,
+ TOP_HAL_CAPABILITY_LOW_POWER_MODE, TOP_HAL_CAPABILITY_SATELLITE_BLOCKLIST,
+ TOP_HAL_CAPABILITY_MEASUREMENT_CORRECTIONS, TOP_HAL_CAPABILITY_ANTENNA_INFO})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface TopHalCapabilityFlags {}
- /** A bitmask of supported GNSS capabilities. */
- private final long mGnssCapabilities;
+ // IMPORTANT - must match the Capabilities enum in IMeasurementCorrectionsCallback.hal
+ /** @hide */
+ public static final int SUB_HAL_MEASUREMENT_CORRECTIONS_CAPABILITY_LOS_SATS = 1;
+ /** @hide */
+ public static final int SUB_HAL_MEASUREMENT_CORRECTIONS_CAPABILITY_EXCESS_PATH_LENGTH = 2;
+ /** @hide */
+ public static final int SUB_HAL_MEASUREMENT_CORRECTIONS_CAPABILITY_REFLECTING_PLANE = 4;
/** @hide */
- public static GnssCapabilities of(long gnssCapabilities) {
- return new GnssCapabilities(gnssCapabilities);
- }
+ @IntDef(flag = true, prefix = {"SUB_HAL_MEASUREMENT_CORRECTIONS_CAPABILITY_"}, value = {
+ SUB_HAL_MEASUREMENT_CORRECTIONS_CAPABILITY_LOS_SATS,
+ SUB_HAL_MEASUREMENT_CORRECTIONS_CAPABILITY_EXCESS_PATH_LENGTH,
+ SUB_HAL_MEASUREMENT_CORRECTIONS_CAPABILITY_REFLECTING_PLANE})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface SubHalMeasurementCorrectionsCapabilityFlags {}
- private GnssCapabilities(long gnssCapabilities) {
- mGnssCapabilities = gnssCapabilities;
- }
+ // IMPORATANT - must match values in IGnssPowerIndicationCallback.aidl
+ /** @hide */
+ public static final int SUB_HAL_POWER_CAPABILITY_TOTAL = 1;
+ /** @hide */
+ public static final int SUB_HAL_POWER_CAPABILITY_SINGLEBAND_TRACKING = 2;
+ /** @hide */
+ public static final int SUB_HAL_POWER_CAPABILITY_MULTIBAND_TRACKING = 4;
+ /** @hide */
+ public static final int SUB_HAL_POWER_CAPABILITY_SINGLEBAND_ACQUISITION = 8;
+ /** @hide */
+ public static final int SUB_HAL_POWER_CAPABILITY_MULTIBAND_ACQUISITION = 16;
+ /** @hide */
+ public static final int SUB_HAL_POWER_CAPABILITY_OTHER_MODES = 32;
+
+ /** @hide */
+ @IntDef(flag = true, prefix = {"SUB_HAL_POWER_CAPABILITY_"}, value = {
+ SUB_HAL_POWER_CAPABILITY_TOTAL, SUB_HAL_POWER_CAPABILITY_SINGLEBAND_TRACKING,
+ SUB_HAL_POWER_CAPABILITY_MULTIBAND_TRACKING,
+ SUB_HAL_POWER_CAPABILITY_SINGLEBAND_ACQUISITION,
+ SUB_HAL_POWER_CAPABILITY_MULTIBAND_ACQUISITION,
+ SUB_HAL_POWER_CAPABILITY_OTHER_MODES})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface SubHalPowerCapabilityFlags {}
/**
- * Returns {@code true} if GNSS chipset supports low power mode, {@code false} otherwise.
+ * Returns an empty GnssCapabilities object.
*
* @hide
*/
- @SystemApi
- public boolean hasLowPowerMode() {
- return hasCapability(LOW_POWER_MODE);
+ public static GnssCapabilities empty() {
+ return new GnssCapabilities(0, 0, 0);
+ }
+
+ private final @TopHalCapabilityFlags int mTopFlags;
+ private final @SubHalMeasurementCorrectionsCapabilityFlags int mMeasurementCorrectionsFlags;
+ private final @SubHalPowerCapabilityFlags int mPowerFlags;
+
+ private GnssCapabilities(
+ @TopHalCapabilityFlags int topFlags,
+ @SubHalMeasurementCorrectionsCapabilityFlags int measurementCorrectionsFlags,
+ @SubHalPowerCapabilityFlags int powerFlags) {
+ mTopFlags = topFlags;
+ mMeasurementCorrectionsFlags = measurementCorrectionsFlags;
+ mPowerFlags = powerFlags;
}
/**
- * Returns {@code true} if GNSS chipset supports blocklisting satellites, {@code false}
- * otherwise.
+ * Returns a new GnssCapabilities object with top hal values set from the given flags.
*
* @hide
- * @deprecated use {@link #hasSatelliteBlocklist} instead.
*/
- @SystemApi
- @Deprecated
- public boolean hasSatelliteBlacklist() {
- return hasCapability(SATELLITE_BLOCKLIST);
+ public GnssCapabilities withTopHalFlags(@TopHalCapabilityFlags int flags) {
+ if (mTopFlags == flags) {
+ return this;
+ } else {
+ return new GnssCapabilities(flags, mMeasurementCorrectionsFlags, mPowerFlags);
+ }
}
/**
- * Returns {@code true} if GNSS chipset supports blocklisting satellites, {@code false}
+ * Returns a new GnssCapabilities object with gnss measurement corrections sub hal values set
+ * from the given flags.
+ *
+ * @hide
+ */
+ public GnssCapabilities withSubHalMeasurementCorrectionsFlags(
+ @SubHalMeasurementCorrectionsCapabilityFlags int flags) {
+ if (mMeasurementCorrectionsFlags == flags) {
+ return this;
+ } else {
+ return new GnssCapabilities(mTopFlags, flags, mPowerFlags);
+ }
+ }
+
+ /**
+ * Returns a new GnssCapabilities object with gnss measurement corrections sub hal values set
+ * from the given flags.
+ *
+ * @hide
+ */
+ public GnssCapabilities withSubHalPowerFlags(@SubHalPowerCapabilityFlags int flags) {
+ if (mPowerFlags == flags) {
+ return this;
+ } else {
+ return new GnssCapabilities(mTopFlags, mMeasurementCorrectionsFlags, flags);
+ }
+ }
+
+ /**
+ * Returns {@code true} if GNSS chipset supports scheduling, {@code false} otherwise.
+ *
+ * @hide
+ */
+ public boolean hasScheduling() {
+ return (mTopFlags & TOP_HAL_CAPABILITY_SCHEDULING) != 0;
+ }
+
+ /**
+ * Returns {@code true} if GNSS chipset supports Mobile Station Based assistance, {@code false}
* otherwise.
*
* @hide
*/
- @SystemApi
- public boolean hasSatelliteBlocklist() {
- return hasCapability(SATELLITE_BLOCKLIST);
+ public boolean hasMsb() {
+ return (mTopFlags & TOP_HAL_CAPABILITY_MSB) != 0;
+ }
+
+ /**
+ * Returns {@code true} if GNSS chipset supports Mobile Station Assisted assitance,
+ * {@code false} otherwise.
+ *
+ * @hide
+ */
+ public boolean hasMsa() {
+ return (mTopFlags & TOP_HAL_CAPABILITY_MSA) != 0;
+ }
+
+ /**
+ * Returns {@code true} if GNSS chipset supports single shot locating, {@code false} otherwise.
+ *
+ * @hide
+ */
+ public boolean hasSingleShot() {
+ return (mTopFlags & TOP_HAL_CAPABILITY_SINGLE_SHOT) != 0;
+ }
+
+ /**
+ * Returns {@code true} if GNSS chipset supports on demand time, {@code false} otherwise.
+ *
+ * @hide
+ */
+ public boolean hasOnDemandTime() {
+ return (mTopFlags & TOP_HAL_CAPABILITY_ON_DEMAND_TIME) != 0;
}
/**
@@ -140,27 +226,71 @@
*/
@SystemApi
public boolean hasGeofencing() {
- return hasCapability(GEOFENCING);
+ return (mTopFlags & TOP_HAL_CAPABILITY_GEOFENCING) != 0;
}
/**
* Returns {@code true} if GNSS chipset supports measurements, {@code false} otherwise.
*
- * @hide
+ * @see LocationManager#registerGnssMeasurementsCallback(Executor, GnssMeasurementsEvent.Callback)
*/
- @SystemApi
public boolean hasMeasurements() {
- return hasCapability(MEASUREMENTS);
+ return (mTopFlags & TOP_HAL_CAPABILITY_MEASUREMENTS) != 0;
}
/**
* Returns {@code true} if GNSS chipset supports navigation messages, {@code false} otherwise.
*
+ * @deprecated Use {@link #hasNavigationMessages()} instead.
+ *
+ * @hide
+ */
+ @Deprecated
+ @SystemApi
+ public boolean hasNavMessages() {
+ return hasNavigationMessages();
+ }
+
+ /**
+ * Returns {@code true} if GNSS chipset supports navigation messages, {@code false} otherwise.
+ *
+ * @see LocationManager#registerGnssNavigationMessageCallback(Executor, GnssNavigationMessage.Callback)
+ */
+ public boolean hasNavigationMessages() {
+ return (mTopFlags & TOP_HAL_CAPABILITY_NAV_MESSAGES) != 0;
+ }
+
+ /**
+ * Returns {@code true} if GNSS chipset supports low power mode, {@code false} otherwise.
+ *
* @hide
*/
@SystemApi
- public boolean hasNavMessages() {
- return hasCapability(NAV_MESSAGES);
+ public boolean hasLowPowerMode() {
+ return (mTopFlags & TOP_HAL_CAPABILITY_LOW_POWER_MODE) != 0;
+ }
+
+ /**
+ * Returns {@code true} if GNSS chipset supports satellite blocklists, {@code false} otherwise.
+ *
+ * @deprecated Use {@link #hasSatelliteBlocklist} instead.
+ *
+ * @hide
+ */
+ @SystemApi
+ @Deprecated
+ public boolean hasSatelliteBlacklist() {
+ return (mTopFlags & TOP_HAL_CAPABILITY_SATELLITE_BLOCKLIST) != 0;
+ }
+
+ /**
+ * Returns {@code true} if GNSS chipset supports satellite blocklists, {@code false} otherwise.
+ *
+ * @hide
+ */
+ @SystemApi
+ public boolean hasSatelliteBlocklist() {
+ return (mTopFlags & TOP_HAL_CAPABILITY_SATELLITE_BLOCKLIST) != 0;
}
/**
@@ -171,7 +301,26 @@
*/
@SystemApi
public boolean hasMeasurementCorrections() {
- return hasCapability(MEASUREMENT_CORRECTIONS);
+ return (mTopFlags & TOP_HAL_CAPABILITY_MEASUREMENT_CORRECTIONS) != 0;
+ }
+
+ /**
+ * Returns {@code true} if GNSS chipset supports antenna info, {@code false} otherwise.
+ *
+ * @deprecated Use {@link #hasAntennaInfo()} instead.
+ */
+ @Deprecated
+ public boolean hasGnssAntennaInfo() {
+ return hasAntennaInfo();
+ }
+
+ /**
+ * Returns {@code true} if GNSS chipset supports antenna info, {@code false} otherwise.
+ *
+ * @see LocationManager#registerAntennaInfoListener(Executor, GnssAntennaInfo.Listener)
+ */
+ public boolean hasAntennaInfo() {
+ return (mTopFlags & TOP_HAL_CAPABILITY_ANTENNA_INFO) != 0;
}
/**
@@ -182,7 +331,8 @@
*/
@SystemApi
public boolean hasMeasurementCorrectionsLosSats() {
- return hasCapability(MEASUREMENT_CORRECTIONS_LOS_SATS);
+ return (mMeasurementCorrectionsFlags & SUB_HAL_MEASUREMENT_CORRECTIONS_CAPABILITY_LOS_SATS)
+ != 0;
}
/**
@@ -193,28 +343,468 @@
*/
@SystemApi
public boolean hasMeasurementCorrectionsExcessPathLength() {
- return hasCapability(MEASUREMENT_CORRECTIONS_EXCESS_PATH_LENGTH);
+ return (mMeasurementCorrectionsFlags
+ & SUB_HAL_MEASUREMENT_CORRECTIONS_CAPABILITY_EXCESS_PATH_LENGTH) != 0;
}
/**
- * Returns {@code true} if GNSS chipset supports reflecting planes measurement corrections,
+ * Returns {@code true} if GNSS chipset supports reflecting plane measurement corrections,
* {@code false} otherwise.
*
+ * @deprecated Use {@link #hasMeasurementCorrectionsReflectingPlane()} instead.
+ *
* @hide
*/
@SystemApi
public boolean hasMeasurementCorrectionsReflectingPane() {
- return hasCapability(MEASUREMENT_CORRECTIONS_REFLECTING_PLANE);
+ return hasMeasurementCorrectionsReflectingPlane();
}
/**
- * Returns {@code true} if GNSS chipset supports antenna info, {@code false} otherwise.
+ * Returns {@code true} if GNSS chipset supports reflecting plane measurement corrections,
+ * {@code false} otherwise.
+ *
+ * @hide
*/
- public boolean hasGnssAntennaInfo() {
- return hasCapability(ANTENNA_INFO);
+ @SystemApi
+ public boolean hasMeasurementCorrectionsReflectingPlane() {
+ return (mMeasurementCorrectionsFlags
+ & SUB_HAL_MEASUREMENT_CORRECTIONS_CAPABILITY_REFLECTING_PLANE) != 0;
}
- private boolean hasCapability(long capability) {
- return (mGnssCapabilities & capability) == capability;
+ /**
+ * Returns {@code true} if GNSS chipset supports measuring power totals, {@code false}
+ * otherwise.
+ *
+ * @hide
+ */
+ public boolean hasPowerTotal() {
+ return (mPowerFlags & SUB_HAL_POWER_CAPABILITY_TOTAL) != 0;
+ }
+
+ /**
+ * Returns {@code true} if GNSS chipset supports measuring single-band tracking power,
+ * {@code false} otherwise.
+ *
+ * @hide
+ */
+ public boolean hasPowerSinglebandTracking() {
+ return (mPowerFlags & SUB_HAL_POWER_CAPABILITY_SINGLEBAND_TRACKING) != 0;
+ }
+
+ /**
+ * Returns {@code true} if GNSS chipset supports measuring multi-band tracking power,
+ * {@code false} otherwise.
+ *
+ * @hide
+ */
+ public boolean hasPowerMultibandTracking() {
+ return (mPowerFlags & SUB_HAL_POWER_CAPABILITY_MULTIBAND_TRACKING) != 0;
+ }
+
+ /**
+ * Returns {@code true} if GNSS chipset supports measuring single-band acquisition power,
+ * {@code false} otherwise.
+ *
+ * @hide
+ */
+ public boolean hasPowerSinglebandAcquisition() {
+ return (mPowerFlags & SUB_HAL_POWER_CAPABILITY_SINGLEBAND_ACQUISITION) != 0;
+ }
+
+ /**
+ * Returns {@code true} if GNSS chipset supports measuring multi-band acquisition power,
+ * {@code false} otherwise.
+ *
+ * @hide
+ */
+ public boolean hasPowerMultibandAcquisition() {
+ return (mPowerFlags & SUB_HAL_POWER_CAPABILITY_MULTIBAND_ACQUISITION) != 0;
+ }
+
+ /**
+ * Returns {@code true} if GNSS chipset supports measuring OEM defined mode power, {@code false}
+ * otherwise.
+ *
+ * @hide
+ */
+ public boolean hasPowerOtherModes() {
+ return (mPowerFlags & SUB_HAL_POWER_CAPABILITY_OTHER_MODES) != 0;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof GnssCapabilities)) {
+ return false;
+ }
+
+ GnssCapabilities that = (GnssCapabilities) o;
+ return mTopFlags == that.mTopFlags
+ && mMeasurementCorrectionsFlags == that.mMeasurementCorrectionsFlags
+ && mPowerFlags == that.mPowerFlags;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mTopFlags, mMeasurementCorrectionsFlags, mPowerFlags);
+ }
+
+ public static final @NonNull Creator<GnssCapabilities> CREATOR =
+ new Creator<GnssCapabilities>() {
+ @Override
+ public GnssCapabilities createFromParcel(Parcel in) {
+ return new GnssCapabilities(in.readInt(), in.readInt(), in.readInt());
+ }
+
+ @Override
+ public GnssCapabilities[] newArray(int size) {
+ return new GnssCapabilities[size];
+ }
+ };
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(@NonNull Parcel parcel, int flags) {
+ parcel.writeInt(mTopFlags);
+ parcel.writeInt(mMeasurementCorrectionsFlags);
+ parcel.writeInt(mPowerFlags);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("[");
+ if (hasScheduling()) {
+ builder.append("SCHEDULING ");
+ }
+ if (hasMsb()) {
+ builder.append("MSB ");
+ }
+ if (hasMsa()) {
+ builder.append("MSA ");
+ }
+ if (hasSingleShot()) {
+ builder.append("SINGLE_SHOT ");
+ }
+ if (hasOnDemandTime()) {
+ builder.append("ON_DEMAND_TIME ");
+ }
+ if (hasGeofencing()) {
+ builder.append("GEOFENCING ");
+ }
+ if (hasMeasurementCorrections()) {
+ builder.append("MEASUREMENTS ");
+ }
+ if (hasNavigationMessages()) {
+ builder.append("NAVIGATION_MESSAGES ");
+ }
+ if (hasLowPowerMode()) {
+ builder.append("LOW_POWER_MODE ");
+ }
+ if (hasSatelliteBlocklist()) {
+ builder.append("SATELLITE_BLOCKLIST ");
+ }
+ if (hasMeasurementCorrections()) {
+ builder.append("MEASUREMENT_CORRECTIONS ");
+ }
+ if (hasAntennaInfo()) {
+ builder.append("ANTENNA_INFO ");
+ }
+ if (hasMeasurementCorrectionsLosSats()) {
+ builder.append("LOS_SATS ");
+ }
+ if (hasMeasurementCorrectionsExcessPathLength()) {
+ builder.append("EXCESS_PATH_LENGTH ");
+ }
+ if (hasMeasurementCorrectionsReflectingPlane()) {
+ builder.append("REFLECTING_PLANE ");
+ }
+ if (hasPowerTotal()) {
+ builder.append("TOTAL_POWER ");
+ }
+ if (hasPowerSinglebandTracking()) {
+ builder.append("SINGLEBAND_TRACKING_POWER ");
+ }
+ if (hasPowerMultibandTracking()) {
+ builder.append("MULTIBAND_TRACKING_POWER ");
+ }
+ if (hasPowerSinglebandAcquisition()) {
+ builder.append("SINGLEBAND_ACQUISITION_POWER ");
+ }
+ if (hasPowerMultibandAcquisition()) {
+ builder.append("MULTIBAND_ACQUISITION_POWER ");
+ }
+ if (hasPowerOtherModes()) {
+ builder.append("OTHER_MODES_POWER ");
+ }
+ if (builder.length() > 1) {
+ builder.setLength(builder.length() - 1);
+ } else {
+ builder.append("NONE");
+ }
+ builder.append("]");
+ return builder.toString();
+ }
+
+ /**
+ * Builder for GnssCapabilities.
+ */
+ public static final class Builder {
+
+ private @TopHalCapabilityFlags int mTopFlags;
+ private @SubHalMeasurementCorrectionsCapabilityFlags int mMeasurementCorrectionsFlags;
+ private @SubHalPowerCapabilityFlags int mPowerFlags;
+
+ public Builder() {
+ mTopFlags = 0;
+ mMeasurementCorrectionsFlags = 0;
+ mPowerFlags = 0;
+ }
+
+ public Builder(@NonNull GnssCapabilities capabilities) {
+ mTopFlags = capabilities.mTopFlags;
+ mMeasurementCorrectionsFlags = capabilities.mMeasurementCorrectionsFlags;
+ mPowerFlags = capabilities.mPowerFlags;
+ }
+
+ /**
+ * Sets scheduling capability.
+ *
+ * @hide
+ */
+ public @NonNull Builder setHasScheduling(boolean capable) {
+ mTopFlags = setFlag(mTopFlags, TOP_HAL_CAPABILITY_SCHEDULING, capable);
+ return this;
+ }
+
+ /**
+ * Sets Mobile Station Based capability.
+ *
+ * @hide
+ */
+ public @NonNull Builder setHasMsb(boolean capable) {
+ mTopFlags = setFlag(mTopFlags, TOP_HAL_CAPABILITY_MSB, capable);
+ return this;
+ }
+
+ /**
+ * Sets Mobile Station Assisted capability.
+ *
+ * @hide
+ */
+ public @NonNull Builder setHasMsa(boolean capable) {
+ mTopFlags = setFlag(mTopFlags, TOP_HAL_CAPABILITY_MSA, capable);
+ return this;
+ }
+
+ /**
+ * Sets single shot locating capability.
+ *
+ * @hide
+ */
+ public @NonNull Builder setHasSingleShot(boolean capable) {
+ mTopFlags = setFlag(mTopFlags, TOP_HAL_CAPABILITY_SINGLE_SHOT, capable);
+ return this;
+ }
+
+ /**
+ * Sets on demand time capability.
+ *
+ * @hide
+ */
+ public @NonNull Builder setHasOnDemandTime(boolean capable) {
+ mTopFlags = setFlag(mTopFlags, TOP_HAL_CAPABILITY_ON_DEMAND_TIME, capable);
+ return this;
+ }
+
+ /**
+ * Sets geofencing capability.
+ *
+ * @hide
+ */
+ @SystemApi
+ public @NonNull Builder setHasGeofencing(boolean capable) {
+ mTopFlags = setFlag(mTopFlags, TOP_HAL_CAPABILITY_GEOFENCING, capable);
+ return this;
+ }
+
+ /**
+ * Sets measurements capability.
+ */
+ public @NonNull Builder setHasMeasurements(boolean capable) {
+ mTopFlags = setFlag(mTopFlags, TOP_HAL_CAPABILITY_MEASUREMENTS, capable);
+ return this;
+ }
+
+ /**
+ * Sets navigation messages capability.
+ */
+ public @NonNull Builder setHasNavigationMessages(boolean capable) {
+ mTopFlags = setFlag(mTopFlags, TOP_HAL_CAPABILITY_NAV_MESSAGES, capable);
+ return this;
+ }
+
+ /**
+ * Sets low power mode capability.
+ *
+ * @hide
+ */
+ @SystemApi
+ public @NonNull Builder setHasLowPowerMode(boolean capable) {
+ mTopFlags = setFlag(mTopFlags, TOP_HAL_CAPABILITY_LOW_POWER_MODE, capable);
+ return this;
+ }
+
+ /**
+ * Sets satellite blocklist capability.
+ *
+ * @hide
+ */
+ @SystemApi
+ public @NonNull Builder setHasSatelliteBlocklist(boolean capable) {
+ mTopFlags = setFlag(mTopFlags, TOP_HAL_CAPABILITY_SATELLITE_BLOCKLIST, capable);
+ return this;
+ }
+
+ /**
+ * Sets measurement corrections capability.
+ *
+ * @hide
+ */
+ @SystemApi
+ public @NonNull Builder setHasMeasurementCorrections(boolean capable) {
+ mTopFlags = setFlag(mTopFlags, TOP_HAL_CAPABILITY_MEASUREMENT_CORRECTIONS, capable);
+ return this;
+ }
+
+ /**
+ * Sets antenna info capability.
+ */
+ public @NonNull Builder setHasAntennaInfo(boolean capable) {
+ mTopFlags = setFlag(mTopFlags, TOP_HAL_CAPABILITY_ANTENNA_INFO, capable);
+ return this;
+ }
+
+ /**
+ * Sets measurement corrections line-of-sight satellites capabilitity.
+ *
+ * @hide
+ */
+ @SystemApi
+ public @NonNull Builder setHasMeasurementCorrectionsLosSats(boolean capable) {
+ mMeasurementCorrectionsFlags = setFlag(mMeasurementCorrectionsFlags,
+ SUB_HAL_MEASUREMENT_CORRECTIONS_CAPABILITY_LOS_SATS, capable);
+ return this;
+ }
+
+ /**
+ * Sets measurement corrections excess path length capabilitity.
+ *
+ * @hide
+ */
+ @SystemApi
+ public @NonNull Builder setHasMeasurementCorrectionsExcessPathLength(boolean capable) {
+ mMeasurementCorrectionsFlags = setFlag(mMeasurementCorrectionsFlags,
+ SUB_HAL_MEASUREMENT_CORRECTIONS_CAPABILITY_EXCESS_PATH_LENGTH, capable);
+ return this;
+ }
+
+ /**
+ * Sets measurement corrections reflecting plane capabilitity.
+ *
+ * @hide
+ */
+ @SystemApi
+ public @NonNull Builder setHasMeasurementCorrectionsReflectingPlane(boolean capable) {
+ mMeasurementCorrectionsFlags = setFlag(mMeasurementCorrectionsFlags,
+ SUB_HAL_MEASUREMENT_CORRECTIONS_CAPABILITY_REFLECTING_PLANE, capable);
+ return this;
+ }
+
+ /**
+ * Sets power totals capabilitity.
+ *
+ * @hide
+ */
+ public @NonNull Builder setHasPowerTotal(boolean capable) {
+ mPowerFlags = setFlag(mPowerFlags, SUB_HAL_POWER_CAPABILITY_TOTAL, capable);
+ return this;
+ }
+
+ /**
+ * Sets power single-band tracking capabilitity.
+ *
+ * @hide
+ */
+ public @NonNull Builder setHasPowerSinglebandTracking(boolean capable) {
+ mPowerFlags = setFlag(mPowerFlags, SUB_HAL_POWER_CAPABILITY_SINGLEBAND_TRACKING,
+ capable);
+ return this;
+ }
+
+ /**
+ * Sets power multi-band tracking capabilitity.
+ *
+ * @hide
+ */
+ public @NonNull Builder setHasPowerMultibandTracking(boolean capable) {
+ mPowerFlags = setFlag(mPowerFlags, SUB_HAL_POWER_CAPABILITY_MULTIBAND_TRACKING,
+ capable);
+ return this;
+ }
+
+ /**
+ * Sets power single-band acquisition capabilitity.
+ *
+ * @hide
+ */
+ public @NonNull Builder setHasPowerSinglebandAcquisition(boolean capable) {
+ mPowerFlags = setFlag(mPowerFlags, SUB_HAL_POWER_CAPABILITY_SINGLEBAND_ACQUISITION,
+ capable);
+ return this;
+ }
+
+ /**
+ * Sets power multi-band acquisition capabilitity.
+ *
+ * @hide
+ */
+ public @NonNull Builder setHasPowerMultibandAcquisition(boolean capable) {
+ mPowerFlags = setFlag(mPowerFlags, SUB_HAL_POWER_CAPABILITY_MULTIBAND_ACQUISITION,
+ capable);
+ return this;
+ }
+
+ /**
+ * Sets power other modes capabilitity.
+ *
+ * @hide
+ */
+ public @NonNull Builder setHasPowerOtherModes(boolean capable) {
+ mPowerFlags = setFlag(mPowerFlags, SUB_HAL_POWER_CAPABILITY_OTHER_MODES, capable);
+ return this;
+ }
+
+ /**
+ * Builds a new GnssCapabilities.
+ */
+ public @NonNull GnssCapabilities build() {
+ return new GnssCapabilities(mTopFlags, mMeasurementCorrectionsFlags, mPowerFlags);
+ }
+
+ private static int setFlag(int value, int flag, boolean set) {
+ if (set) {
+ return value | flag;
+ } else {
+ return value & ~flag;
+ }
+ }
}
}
diff --git a/wifi/aidl-export/android/net/wifi/WpsInfo.aidl b/location/java/android/location/IGnssNmeaListener.aidl
similarity index 74%
copy from wifi/aidl-export/android/net/wifi/WpsInfo.aidl
copy to location/java/android/location/IGnssNmeaListener.aidl
index f5e4ebe..c67cc89 100644
--- a/wifi/aidl-export/android/net/wifi/WpsInfo.aidl
+++ b/location/java/android/location/IGnssNmeaListener.aidl
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2011, The Android Open Source Project
+/*
+ * 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.
@@ -14,6 +14,12 @@
* limitations under the License.
*/
-package android.net.wifi;
+package android.location;
-parcelable WpsInfo;
+/**
+ * {@hide}
+ */
+oneway interface IGnssNmeaListener
+{
+ void onNmeaReceived(long timestamp, String nmea);
+}
\ No newline at end of file
diff --git a/location/java/android/location/IGnssStatusListener.aidl b/location/java/android/location/IGnssStatusListener.aidl
index 57b1268..c25046e 100644
--- a/location/java/android/location/IGnssStatusListener.aidl
+++ b/location/java/android/location/IGnssStatusListener.aidl
@@ -27,5 +27,4 @@
void onGnssStopped();
void onFirstFix(int ttff);
void onSvStatusChanged(in GnssStatus gnssStatus);
- void onNmeaReceived(long timestamp, String nmea);
}
diff --git a/location/java/android/location/ILocationManager.aidl b/location/java/android/location/ILocationManager.aidl
index a666eb4..621fe1b 100644
--- a/location/java/android/location/ILocationManager.aidl
+++ b/location/java/android/location/ILocationManager.aidl
@@ -21,6 +21,7 @@
import android.location.Criteria;
import android.location.GeocoderParams;
import android.location.Geofence;
+import android.location.GnssCapabilities;
import android.location.GnssMeasurementCorrections;
import android.location.GnssMeasurementRequest;
import android.location.IGeocodeListener;
@@ -28,17 +29,17 @@
import android.location.IGnssMeasurementsListener;
import android.location.IGnssStatusListener;
import android.location.IGnssNavigationMessageListener;
+import android.location.IGnssNmeaListener;
import android.location.ILocationCallback;
import android.location.ILocationListener;
import android.location.LastLocationRequest;
import android.location.Location;
import android.location.LocationRequest;
import android.location.LocationTime;
+import android.location.ProviderProperties;
import android.os.Bundle;
import android.os.ICancellationSignal;
-import com.android.internal.location.ProviderProperties;
-
/**
* System private API for talking with the location service.
*
@@ -71,13 +72,16 @@
double upperRightLatitude, double upperRightLongitude, int maxResults,
in GeocoderParams params, in IGeocodeListener listener);
- long getGnssCapabilities();
+ GnssCapabilities getGnssCapabilities();
int getGnssYearOfHardware();
String getGnssHardwareModelName();
void registerGnssStatusCallback(in IGnssStatusListener callback, String packageName, String attributionTag);
void unregisterGnssStatusCallback(in IGnssStatusListener callback);
+ void registerGnssNmeaCallback(in IGnssNmeaListener callback, String packageName, String attributionTag);
+ void unregisterGnssNmeaCallback(in IGnssNmeaListener callback);
+
void addGnssMeasurementsListener(in GnssMeasurementRequest request, in IGnssMeasurementsListener listener, String packageName, String attributionTag);
void removeGnssMeasurementsListener(in IGnssMeasurementsListener listener);
void injectGnssMeasurementCorrections(in GnssMeasurementCorrections corrections);
@@ -93,6 +97,7 @@
void flushGnssBatch();
void stopGnssBatch();
+ boolean hasProvider(String provider);
List<String> getAllProviders();
List<String> getProviders(in Criteria criteria, boolean enabledOnly);
String getBestProvider(in Criteria criteria, boolean enabledOnly);
diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java
index ecdba1f..00381a6 100644
--- a/location/java/android/location/LocationManager.java
+++ b/location/java/android/location/LocationManager.java
@@ -61,7 +61,6 @@
import com.android.internal.annotations.GuardedBy;
import com.android.internal.listeners.ListenerExecutor;
import com.android.internal.listeners.ListenerTransportMultiplexer;
-import com.android.internal.location.ProviderProperties;
import com.android.internal.util.Preconditions;
import java.lang.ref.WeakReference;
@@ -381,6 +380,8 @@
@GuardedBy("mLock")
@Nullable private GnssStatusTransportMultiplexer mGnssStatusTransportMultiplexer;
@GuardedBy("mLock")
+ @Nullable private GnssNmeaTransportMultiplexer mGnssNmeaTransportMultiplexer;
+ @GuardedBy("mLock")
@Nullable private GnssMeasurementsTransportMultiplexer mGnssMeasurementsTransportMultiplexer;
@GuardedBy("mLock")
@Nullable private GnssNavigationTransportMultiplexer mGnssNavigationTransportMultiplexer;
@@ -404,6 +405,15 @@
}
}
+ private GnssNmeaTransportMultiplexer getGnssNmeaTransportMultiplexer() {
+ synchronized (mLock) {
+ if (mGnssNmeaTransportMultiplexer == null) {
+ mGnssNmeaTransportMultiplexer = new GnssNmeaTransportMultiplexer();
+ }
+ return mGnssNmeaTransportMultiplexer;
+ }
+ }
+
private GnssMeasurementsTransportMultiplexer getGnssMeasurementsTransportMultiplexer() {
synchronized (mLock) {
if (mGnssMeasurementsTransportMultiplexer == null) {
@@ -1616,6 +1626,25 @@
}
/**
+ * Returns true if the given location provider exists on this device, irrespective of whether
+ * it is currently enabled or not.
+ *
+ * @param provider a potential location provider
+ * @return true if the location provider exists, false otherwise
+ *
+ * @throws IllegalArgumentException if provider is null
+ */
+ public boolean hasProvider(@NonNull String provider) {
+ Preconditions.checkArgument(provider != null, "invalid null provider");
+
+ try {
+ return mService.hasProvider(provider);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* Returns a list of the names of all available location providers. All providers are returned,
* including those that are currently disabled.
*
@@ -1703,7 +1732,12 @@
* @return location provider information, or null if provider does not exist
*
* @throws IllegalArgumentException if provider is null
+ *
+ * @deprecated This method has no way to indicate that a provider's properties are unknown, and
+ * so may return incorrect results on rare occasions. Use {@link #getProviderProperties(String)}
+ * instead.
*/
+ @Deprecated
public @Nullable LocationProvider getProvider(@NonNull String provider) {
Preconditions.checkArgument(provider != null, "invalid null provider");
@@ -1723,11 +1757,33 @@
}
try {
+
ProviderProperties properties = mService.getProviderProperties(provider);
- if (properties == null) {
- return null;
- }
return new LocationProvider(provider, properties);
+ } catch (IllegalArgumentException e) {
+ // provider does not exist
+ return null;
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Returns the properties of the given provider, or null if the properties are currently
+ * unknown. Provider properties may change over time, although this is discouraged, and should
+ * be rare. The most common transition is when provider properties go from being unknown to
+ * known, which is most common near boot time.
+ *
+ * @param provider a provider listed by {@link #getAllProviders()}
+ * @return location provider properties, or null if properties are currently unknown
+ *
+ * @throws IllegalArgumentException if provider is null or does not exist
+ */
+ public @Nullable ProviderProperties getProviderProperties(@NonNull String provider) {
+ Preconditions.checkArgument(provider != null, "invalid null provider");
+
+ try {
+ return mService.getProviderProperties(provider);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -1826,12 +1882,14 @@
public void addTestProvider(
@NonNull String provider, boolean requiresNetwork, boolean requiresSatellite,
boolean requiresCell, boolean hasMonetaryCost, boolean supportsAltitude,
- boolean supportsSpeed, boolean supportsBearing, int powerRequirement, int accuracy) {
+ boolean supportsSpeed, boolean supportsBearing,
+ @ProviderProperties.PowerUsage int powerUsage,
+ @ProviderProperties.Accuracy int accuracy) {
Preconditions.checkArgument(provider != null, "invalid null provider");
ProviderProperties properties = new ProviderProperties(requiresNetwork,
requiresSatellite, requiresCell, hasMonetaryCost, supportsAltitude, supportsSpeed,
- supportsBearing, powerRequirement, accuracy);
+ supportsBearing, powerUsage, accuracy);
try {
mService.addTestProvider(provider, properties, mContext.getOpPackageName(),
mContext.getFeatureId());
@@ -2045,20 +2103,15 @@
*/
public @NonNull GnssCapabilities getGnssCapabilities() {
try {
- long gnssCapabilities = mService.getGnssCapabilities();
- if (gnssCapabilities == GnssCapabilities.INVALID_CAPABILITIES) {
- gnssCapabilities = 0L;
- }
- return GnssCapabilities.of(gnssCapabilities);
+ return mService.getGnssCapabilities();
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
/**
- * Returns the model year of the GNSS hardware and software build. More details, such as build
- * date, may be available in {@link #getGnssHardwareModelName()}. May return 0 if the model year
- * is less than 2016.
+ * Returns the model year of the GNSS hardware and software build, or 0 if the model year
+ * is before 2016.
*/
public int getGnssYearOfHardware() {
try {
@@ -2069,13 +2122,10 @@
}
/**
- * Returns the Model Name (including Vendor and Hardware/Software Version) of the GNSS hardware
- * driver.
+ * Returns the model name (including vendor and hardware/software version) of the GNSS hardware
+ * driver, or null if this information is not available.
*
- * <p> No device-specific serial number or ID is returned from this API.
- *
- * <p> Will return null when the GNSS hardware abstraction layer does not support providing
- * this value.
+ * <p>No device-specific serial number or ID is returned from this API.
*/
@Nullable
public String getGnssHardwareModelName() {
@@ -2170,8 +2220,11 @@
* Registers a GNSS status callback. This method must be called from a {@link Looper} thread,
* and callbacks will occur on that looper.
*
- * @param callback GNSS status callback object to register
- * @return true if the listener was successfully added
+ * <p>See {@link #registerGnssStatusCallback(Executor, GnssStatus.Callback)} for more detail on
+ * how this method works.
+ *
+ * @param callback the callback to register
+ * @return {@code true} always
*
* @throws SecurityException if the ACCESS_FINE_LOCATION permission is not present
*
@@ -2187,9 +2240,12 @@
/**
* Registers a GNSS status callback.
*
- * @param callback GNSS status callback object to register
- * @param handler a handler with a looper that the callback runs on
- * @return true if the listener was successfully added
+ * <p>See {@link #registerGnssStatusCallback(Executor, GnssStatus.Callback)} for more detail on
+ * how this method works.
+ *
+ * @param callback the callback to register
+ * @param handler the handler the callback runs on
+ * @return {@code true} always
*
* @throws IllegalArgumentException if callback is null
* @throws SecurityException if the ACCESS_FINE_LOCATION permission is not present
@@ -2205,11 +2261,12 @@
}
/**
- * Registers a GNSS status callback.
+ * Registers a GNSS status callback. GNSS status information will only be received while the
+ * {@link #GPS_PROVIDER} is enabled, and while the client app is in the foreground.
*
* @param executor the executor that the callback runs on
- * @param callback GNSS status callback object to register
- * @return true if the listener was successfully added
+ * @param callback the callback to register
+ * @return {@code true} always
*
* @throws IllegalArgumentException if executor is null
* @throws IllegalArgumentException if callback is null
@@ -2254,8 +2311,12 @@
/**
* Adds an NMEA listener.
*
- * @param listener a {@link OnNmeaMessageListener} object to register
- * @return true if the listener was successfully added
+ * <p>See {@link #addNmeaListener(Executor, OnNmeaMessageListener)} for more detail on how this
+ * method works.
+ *
+ * @param listener the listener to register
+ * @return {@code true} always
+ *
* @throws SecurityException if the ACCESS_FINE_LOCATION permission is not present
* @deprecated Use {@link #addNmeaListener(OnNmeaMessageListener, Handler)} or {@link
* #addNmeaListener(Executor, OnNmeaMessageListener)} instead.
@@ -2269,9 +2330,12 @@
/**
* Adds an NMEA listener.
*
- * @param listener a {@link OnNmeaMessageListener} object to register
- * @param handler a handler with the looper that the listener runs on.
- * @return true if the listener was successfully added
+ * <p>See {@link #addNmeaListener(Executor, OnNmeaMessageListener)} for more detail on how this
+ * method works.
+ *
+ * @param listener the listener to register
+ * @param handler the handler that the listener runs on
+ * @return {@code true} always
*
* @throws IllegalArgumentException if listener is null
* @throws SecurityException if the ACCESS_FINE_LOCATION permission is not present
@@ -2287,11 +2351,12 @@
}
/**
- * Adds an NMEA listener.
+ * Adds an NMEA listener. GNSS NMEA information will only be received while the
+ * {@link #GPS_PROVIDER} is enabled, and while the client app is in the foreground.
*
- * @param listener a {@link OnNmeaMessageListener} object to register
- * @param executor the {@link Executor} that the listener runs on.
- * @return true if the listener was successfully added
+ * @param listener the listener to register
+ * @param executor the executor that the listener runs on
+ * @return {@code true} always
*
* @throws IllegalArgumentException if executor is null
* @throws IllegalArgumentException if listener is null
@@ -2301,7 +2366,7 @@
public boolean addNmeaListener(
@NonNull @CallbackExecutor Executor executor,
@NonNull OnNmeaMessageListener listener) {
- getGnssStatusTransportMultiplexer().addListener(listener, executor);
+ getGnssNmeaTransportMultiplexer().addListener(listener, executor);
return true;
}
@@ -2311,7 +2376,7 @@
* @param listener a {@link OnNmeaMessageListener} object to remove
*/
public void removeNmeaListener(@NonNull OnNmeaMessageListener listener) {
- getGnssStatusTransportMultiplexer().removeListener(listener);
+ getGnssNmeaTransportMultiplexer().removeListener(listener);
}
/**
@@ -2339,10 +2404,14 @@
public void removeGpsMeasurementListener(GpsMeasurementsEvent.Listener listener) {}
/**
- * Registers a GPS Measurement callback which will run on a binder thread.
+ * Registers a GNSS measurements callback which will run on a binder thread.
*
- * @param callback a {@link GnssMeasurementsEvent.Callback} object to register.
- * @return {@code true} if the callback was added successfully, {@code false} otherwise.
+ * <p>See {@link #registerGnssMeasurementsCallback(Executor, GnssMeasurementsEvent.Callback)
+ * for more detail on how this method works.
+ *
+ * @param callback a {@link GnssMeasurementsEvent.Callback} object to register
+ * @return {@code true} always
+ *
* @deprecated Use {@link
* #registerGnssMeasurementsCallback(GnssMeasurementsEvent.Callback, Handler)} or {@link
* #registerGnssMeasurementsCallback(Executor, GnssMeasurementsEvent.Callback)} instead.
@@ -2355,11 +2424,14 @@
}
/**
- * Registers a GPS Measurement callback.
+ * Registers a GNSS measurements callback.
*
- * @param callback a {@link GnssMeasurementsEvent.Callback} object to register.
- * @param handler the handler that the callback runs on.
- * @return {@code true} if the callback was added successfully, {@code false} otherwise.
+ * <p>See {@link #registerGnssMeasurementsCallback(Executor, GnssMeasurementsEvent.Callback)
+ * for more detail on how this method works.
+ *
+ * @param callback a {@link GnssMeasurementsEvent.Callback} object to register
+ * @param handler the handler that the callback runs on
+ * @return {@code true} always
*
* @throws IllegalArgumentException if callback is null
* @throws SecurityException if the ACCESS_FINE_LOCATION permission is not present
@@ -2376,11 +2448,14 @@
}
/**
- * Registers a GPS Measurement callback.
+ * Registers a GNSS measurements callback. GNSS measurements information will only be received
+ * while the {@link #GPS_PROVIDER} is enabled, and while the client app is in the foreground.
*
- * @param callback a {@link GnssMeasurementsEvent.Callback} object to register.
- * @param executor the executor that the callback runs on.
- * @return {@code true} if the callback was added successfully, {@code false} otherwise.
+ * <p>Not all GNSS chipsets support measurements updates, see {@link #getGnssCapabilities()}.
+ *
+ * @param executor the executor that the callback runs on
+ * @param callback the callback to register
+ * @return {@code true} always
*
* @throws IllegalArgumentException if executor is null
* @throws IllegalArgumentException if callback is null
@@ -2397,12 +2472,11 @@
/**
* Registers a GNSS Measurement callback.
*
- * @param request extra parameters to pass to GNSS measurement provider. For example, if {@link
- * GnssRequest#isFullTracking()} is true, GNSS chipset switches off duty
- * cycling.
- * @param executor the executor that the callback runs on.
- * @param callback a {@link GnssMeasurementsEvent.Callback} object to register.
- * @return {@code true} if the callback was added successfully, {@code false} otherwise.
+ * @param request the gnss measurement request containgin measurement parameters
+ * @param executor the executor that the callback runs on
+ * @param callback the callack to register
+ * @return {@code true} always
+ *
* @throws IllegalArgumentException if request is null
* @throws IllegalArgumentException if executor is null
* @throws IllegalArgumentException if callback is null
@@ -2451,8 +2525,7 @@
/**
* Injects GNSS measurement corrections into the GNSS chipset.
*
- * @param measurementCorrections a {@link GnssMeasurementCorrections} object with the GNSS
- * measurement corrections to be injected into the GNSS chipset.
+ * @param measurementCorrections measurement corrections to be injected into the chipset
*
* @throws IllegalArgumentException if measurementCorrections is null
* @throws SecurityException if the ACCESS_FINE_LOCATION permission is not present
@@ -2481,12 +2554,14 @@
}
/**
- * Registers a Gnss Antenna Info listener. Only expect results if
- * {@link GnssCapabilities#hasGnssAntennaInfo()} shows that antenna info is supported.
+ * Registers a GNSS antenna info listener. GNSS antenna info updates will only be received while
+ * the {@link #GPS_PROVIDER} is enabled, and while the client app is in the foreground.
*
- * @param executor the executor that the listener runs on.
- * @param listener a {@link GnssAntennaInfo.Listener} object to register.
- * @return {@code true} if the listener was added successfully, {@code false} otherwise.
+ * <p>Not all GNSS chipsets support antenna info updates, see {@link #getGnssCapabilities()}.
+ *
+ * @param executor the executor that the listener runs on
+ * @param listener the listener to register
+ * @return {@code true} always
*
* @throws IllegalArgumentException if executor is null
* @throws IllegalArgumentException if listener is null
@@ -2503,7 +2578,7 @@
/**
* Unregisters a GNSS Antenna Info listener.
*
- * @param listener a {@link GnssAntennaInfo.Listener} object to remove.
+ * @param listener a {@link GnssAntennaInfo.Listener} object to remove
*/
public void unregisterAntennaInfoListener(@NonNull GnssAntennaInfo.Listener listener) {
getGnssAntennaInfoTransportMultiplexer().removeListener(listener);
@@ -2534,10 +2609,15 @@
public void removeGpsNavigationMessageListener(GpsNavigationMessageEvent.Listener listener) {}
/**
- * Registers a GNSS Navigation Message callback which will run on a binder thread.
+ * Registers a GNSS navigation message callback which will run on a binder thread.
*
- * @param callback a {@link GnssNavigationMessage.Callback} object to register.
- * @return {@code true} if the callback was added successfully, {@code false} otherwise.
+ * <p>See
+ * {@link #registerGnssNavigationMessageCallback(Executor, GnssNavigationMessage.Callback)} for
+ * more detail on how this method works.
+ *
+ * @param callback the callback to register
+ * @return {@code true} always
+ *
* @deprecated Use {@link
* #registerGnssNavigationMessageCallback(GnssNavigationMessage.Callback, Handler)} or {@link
* #registerGnssNavigationMessageCallback(Executor, GnssNavigationMessage.Callback)} instead.
@@ -2549,11 +2629,15 @@
}
/**
- * Registers a GNSS Navigation Message callback.
+ * Registers a GNSS navigation message callback.
*
- * @param callback a {@link GnssNavigationMessage.Callback} object to register.
- * @param handler the handler that the callback runs on.
- * @return {@code true} if the callback was added successfully, {@code false} otherwise.
+ * <p>See
+ * {@link #registerGnssNavigationMessageCallback(Executor, GnssNavigationMessage.Callback)} for
+ * more detail on how this method works.
+ *
+ * @param callback the callback to register
+ * @param handler the handler that the callback runs on
+ * @return {@code true} always
*
* @throws IllegalArgumentException if callback is null
* @throws SecurityException if the ACCESS_FINE_LOCATION permission is not present
@@ -2569,11 +2653,15 @@
}
/**
- * Registers a GNSS Navigation Message callback.
+ * Registers a GNSS navigation message callback. GNSS navigation messages will only be received
+ * while the {@link #GPS_PROVIDER} is enabled, and while the client app is in the foreground.
*
- * @param callback a {@link GnssNavigationMessage.Callback} object to register.
- * @param executor the looper that the callback runs on.
- * @return {@code true} if the callback was added successfully, {@code false} otherwise.
+ * <p>Not all GNSS chipsets support navigation message updates, see
+ * {@link #getGnssCapabilities()}.
+ *
+ * @param executor the executor that the callback runs on
+ * @param callback the callback to register
+ * @return {@code true} always
*
* @throws IllegalArgumentException if executor is null
* @throws IllegalArgumentException if callback is null
@@ -2601,6 +2689,9 @@
* Returns the batch size (in number of Location objects) that are supported by the batching
* interface.
*
+ * Prior to Android S this call requires the {@link Manifest.permission#LOCATION_HARDWARE}
+ * permission.
+ *
* @return Maximum number of location objects that can be returned
* @deprecated Do not use
* @hide
@@ -2804,20 +2895,6 @@
}
}
- private static class NmeaAdapter extends GnssStatus.Callback implements OnNmeaMessageListener {
-
- private final OnNmeaMessageListener mListener;
-
- NmeaAdapter(OnNmeaMessageListener listener) {
- mListener = listener;
- }
-
- @Override
- public void onNmeaMessage(String message, long timestamp) {
- mListener.onNmeaMessage(message, timestamp);
- }
- }
-
private static class GpsAdapter extends GnssStatus.Callback {
private final GpsStatus.Listener mGpsListener;
@@ -2865,11 +2942,6 @@
return mTtff;
}
- public void addListener(@NonNull OnNmeaMessageListener listener,
- @NonNull Executor executor) {
- addListener(listener, null, new NmeaAdapter(listener), executor);
- }
-
public void addListener(@NonNull GpsStatus.Listener listener, @NonNull Executor executor) {
addListener(listener, null, new GpsAdapter(listener), executor);
}
@@ -2922,14 +2994,51 @@
mGnssStatus = gnssStatus;
deliverToListeners(callback -> callback.onSatelliteStatusChanged(gnssStatus));
}
+ }
+ }
+
+ private class GnssNmeaTransportMultiplexer extends
+ ListenerTransportMultiplexer<Void, OnNmeaMessageListener> {
+
+ private @Nullable IGnssNmeaListener mListenerTransport;
+
+ GnssNmeaTransportMultiplexer() {}
+
+ public void addListener(@NonNull OnNmeaMessageListener listener,
+ @NonNull Executor executor) {
+ addListener(listener, null, listener, executor);
+ }
+
+ @Override
+ protected void registerWithServer(Void ignored) throws RemoteException {
+ IGnssNmeaListener transport = mListenerTransport;
+ if (transport == null) {
+ transport = new GnssNmeaListener();
+ }
+
+ // if a remote exception is thrown the transport should not be set
+ mListenerTransport = null;
+ mService.registerGnssNmeaCallback(transport, mContext.getPackageName(),
+ mContext.getAttributionTag());
+ mListenerTransport = transport;
+ }
+
+ @Override
+ protected void unregisterWithServer() throws RemoteException {
+ if (mListenerTransport != null) {
+ IGnssNmeaListener transport = mListenerTransport;
+ mListenerTransport = null;
+ mService.unregisterGnssNmeaCallback(transport);
+ }
+ }
+
+ private class GnssNmeaListener extends IGnssNmeaListener.Stub {
+
+ GnssNmeaListener() {}
@Override
public void onNmeaReceived(long timestamp, String nmea) {
- deliverToListeners((callback) -> {
- if (callback instanceof NmeaAdapter) {
- ((NmeaAdapter) callback).onNmeaMessage(nmea, timestamp);
- }
- });
+ deliverToListeners(callback -> callback.onNmeaMessage(nmea, timestamp));
}
}
}
diff --git a/location/java/android/location/LocationProvider.java b/location/java/android/location/LocationProvider.java
index b950604..6d2bfed 100644
--- a/location/java/android/location/LocationProvider.java
+++ b/location/java/android/location/LocationProvider.java
@@ -16,23 +16,15 @@
package android.location;
-
-import com.android.internal.location.ProviderProperties;
+import android.annotation.Nullable;
/**
- * An abstract superclass for location providers. A location provider
- * provides periodic reports on the geographical location of the
- * device.
+ * Information about the properties of a location provider.
*
- * <p> Each provider has a set of criteria under which it may be used;
- * for example, some providers require GPS hardware and visibility to
- * a number of satellites; others require the use of the cellular
- * radio, or access to a specific carrier's network, or to the
- * internet. They may also have different battery consumption
- * characteristics or monetary costs to the user. The {@link
- * Criteria} class allows providers to be selected based on
- * user-specified criteria.
+ * @deprecated This class is incapable of representing unknown provider properties and may return
+ * incorrect results when the properties are unknown.
*/
+@Deprecated
public class LocationProvider {
/**
@@ -54,9 +46,9 @@
public static final int AVAILABLE = 2;
private final String mName;
- private final ProviderProperties mProperties;
+ private final @Nullable ProviderProperties mProperties;
- LocationProvider(String name, ProviderProperties properties) {
+ LocationProvider(String name, @Nullable ProviderProperties properties) {
mName = name;
mProperties = properties;
}
@@ -96,7 +88,7 @@
return false;
}
if (criteria.getPowerRequirement() != Criteria.NO_REQUIREMENT &&
- criteria.getPowerRequirement() < properties.getPowerRequirement()) {
+ criteria.getPowerRequirement() < properties.getPowerUsage()) {
return false;
}
if (criteria.isAltitudeRequired() && !properties.hasAltitudeSupport()) {
@@ -119,7 +111,11 @@
* data network (e.g., the Internet), false otherwise.
*/
public boolean requiresNetwork() {
- return mProperties.hasNetworkRequirement();
+ if (mProperties == null) {
+ return false;
+ } else {
+ return mProperties.hasNetworkRequirement();
+ }
}
/**
@@ -128,7 +124,11 @@
* otherwise.
*/
public boolean requiresSatellite() {
- return mProperties.hasSatelliteRequirement();
+ if (mProperties == null) {
+ return false;
+ } else {
+ return mProperties.hasSatelliteRequirement();
+ }
}
/**
@@ -137,7 +137,11 @@
* otherwise.
*/
public boolean requiresCell() {
- return mProperties.hasCellRequirement();
+ if (mProperties == null) {
+ return false;
+ } else {
+ return mProperties.hasCellRequirement();
+ }
}
/**
@@ -146,7 +150,11 @@
* each provider to give accurate information.
*/
public boolean hasMonetaryCost() {
- return mProperties.hasMonetaryCost();
+ if (mProperties == null) {
+ return false;
+ } else {
+ return mProperties.hasMonetaryCost();
+ }
}
/**
@@ -156,7 +164,11 @@
* should return true.
*/
public boolean supportsAltitude() {
- return mProperties.hasAltitudeSupport();
+ if (mProperties == null) {
+ return false;
+ } else {
+ return mProperties.hasAltitudeSupport();
+ }
}
/**
@@ -166,7 +178,11 @@
* should return true.
*/
public boolean supportsSpeed() {
- return mProperties.hasSpeedSupport();
+ if (mProperties == null) {
+ return false;
+ } else {
+ return mProperties.hasSpeedSupport();
+ }
}
/**
@@ -176,27 +192,39 @@
* should return true.
*/
public boolean supportsBearing() {
- return mProperties.hasBearingSupport();
+ if (mProperties == null) {
+ return false;
+ } else {
+ return mProperties.hasBearingSupport();
+ }
}
/**
* Returns the power requirement for this provider.
*
* @return the power requirement for this provider, as one of the
- * constants Criteria.POWER_REQUIREMENT_*.
+ * constants ProviderProperties.POWER_USAGE_*.
*/
public int getPowerRequirement() {
- return mProperties.getPowerRequirement();
+ if (mProperties == null) {
+ return ProviderProperties.POWER_USAGE_HIGH;
+ } else {
+ return mProperties.getPowerUsage();
+ }
}
/**
* Returns a constant describing horizontal accuracy of this provider.
* If the provider returns finer grain or exact location,
- * {@link Criteria#ACCURACY_FINE} is returned, otherwise if the
- * location is only approximate then {@link Criteria#ACCURACY_COARSE}
+ * {@link ProviderProperties#ACCURACY_FINE} is returned, otherwise if the
+ * location is only approximate then {@link ProviderProperties#ACCURACY_COARSE}
* is returned.
*/
public int getAccuracy() {
- return mProperties.getAccuracy();
+ if (mProperties == null) {
+ return ProviderProperties.ACCURACY_COARSE;
+ } else {
+ return mProperties.getAccuracy();
+ }
}
}
diff --git a/location/java/com/android/internal/location/ProviderProperties.aidl b/location/java/android/location/ProviderProperties.aidl
similarity index 94%
rename from location/java/com/android/internal/location/ProviderProperties.aidl
rename to location/java/android/location/ProviderProperties.aidl
index b901444..8b1d79f 100644
--- a/location/java/com/android/internal/location/ProviderProperties.aidl
+++ b/location/java/android/location/ProviderProperties.aidl
@@ -14,6 +14,6 @@
* limitations under the License.
*/
-package com.android.internal.location;
+package android.location;
parcelable ProviderProperties;
diff --git a/location/java/com/android/internal/location/ProviderProperties.java b/location/java/android/location/ProviderProperties.java
similarity index 75%
rename from location/java/com/android/internal/location/ProviderProperties.java
rename to location/java/android/location/ProviderProperties.java
index dbb61d2..8fa8c98 100644
--- a/location/java/com/android/internal/location/ProviderProperties.java
+++ b/location/java/android/location/ProviderProperties.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 The Android Open Source Project
+ * 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.
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package com.android.internal.location;
+package android.location;
import android.annotation.IntDef;
-import android.location.Criteria;
+import android.annotation.NonNull;
import android.os.Parcel;
import android.os.Parcelable;
@@ -29,18 +29,43 @@
/**
* Location provider properties.
- * @hide
*/
public final class ProviderProperties implements Parcelable {
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef({Criteria.POWER_LOW, Criteria.POWER_MEDIUM, Criteria.POWER_HIGH})
- public @interface PowerRequirement {}
+ /**
+ * A constant indicating low power usage.
+ */
+ public static final int POWER_USAGE_LOW = 1;
+
+ /**
+ * A constant indicating a medium power usage.
+ */
+ public static final int POWER_USAGE_MEDIUM = 2;
+
+ /**
+ * A constant indicating high power usage.
+ */
+ public static final int POWER_USAGE_HIGH = 3;
/** @hide */
@Retention(RetentionPolicy.SOURCE)
- @IntDef({Criteria.ACCURACY_FINE, Criteria.ACCURACY_COARSE})
+ @IntDef(prefix = "POWER_USAGE_", value = {POWER_USAGE_LOW, POWER_USAGE_MEDIUM,
+ POWER_USAGE_HIGH})
+ public @interface PowerUsage {}
+
+ /**
+ * A constant indicating a finer location accuracy.
+ */
+ public static final int ACCURACY_FINE = 1;
+
+ /**
+ * A constant indicating a coarser location accuracy.
+ */
+ public static final int ACCURACY_COARSE = 2;
+
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(prefix = "ACCURACY_", value = {ACCURACY_FINE, ACCURACY_COARSE})
public @interface Accuracy {}
private final boolean mHasNetworkRequirement;
@@ -50,13 +75,16 @@
private final boolean mHasAltitudeSupport;
private final boolean mHasSpeedSupport;
private final boolean mHasBearingSupport;
- private final @PowerRequirement int mPowerRequirement;
+ private final @PowerUsage int mPowerUsage;
private final @Accuracy int mAccuracy;
+ /**
+ * @hide
+ */
public ProviderProperties(boolean hasNetworkRequirement, boolean hasSatelliteRequirement,
boolean hasCellRequirement, boolean hasMonetaryCost, boolean hasAltitudeSupport,
boolean hasSpeedSupport, boolean hasBearingSupport,
- @PowerRequirement int powerRequirement, @Accuracy int accuracy) {
+ @PowerUsage int powerUsage, @Accuracy int accuracy) {
mHasNetworkRequirement = hasNetworkRequirement;
mHasSatelliteRequirement = hasSatelliteRequirement;
mHasCellRequirement = hasCellRequirement;
@@ -64,10 +92,10 @@
mHasAltitudeSupport = hasAltitudeSupport;
mHasSpeedSupport = hasSpeedSupport;
mHasBearingSupport = hasBearingSupport;
- mPowerRequirement = Preconditions.checkArgumentInRange(powerRequirement, Criteria.POWER_LOW,
- Criteria.POWER_HIGH, "powerRequirement");
- mAccuracy = Preconditions.checkArgumentInRange(accuracy, Criteria.ACCURACY_FINE,
- Criteria.ACCURACY_COARSE, "accuracy");
+ mPowerUsage = Preconditions.checkArgumentInRange(powerUsage, POWER_USAGE_LOW,
+ POWER_USAGE_HIGH, "powerUsage");
+ mAccuracy = Preconditions.checkArgumentInRange(accuracy, ACCURACY_FINE,
+ ACCURACY_COARSE, "locationAccuracy");
}
/**
@@ -121,22 +149,22 @@
}
/**
- * Power requirement for this provider.
+ * Power usage for this provider.
*/
- public @PowerRequirement int getPowerRequirement() {
- return mPowerRequirement;
+ public @PowerUsage int getPowerUsage() {
+ return mPowerUsage;
}
/**
- * Constant describing the horizontal accuracy returned
- * by this provider.
+ * Rough location accuracy for this provider, primarily with respect to horizontal location
+ * accuracy.
*/
public @Accuracy int getAccuracy() {
return mAccuracy;
}
- public static final Parcelable.Creator<ProviderProperties> CREATOR =
- new Parcelable.Creator<ProviderProperties>() {
+ public static final @NonNull Creator<ProviderProperties> CREATOR =
+ new Creator<ProviderProperties>() {
@Override
public ProviderProperties createFromParcel(Parcel in) {
return new ProviderProperties(
@@ -147,7 +175,7 @@
/* hasAltitudeSupport= */ in.readBoolean(),
/* hasSpeedSupport= */ in.readBoolean(),
/* hasBearingSupport= */ in.readBoolean(),
- /* powerRequirement= */ in.readInt(),
+ /* powerUsage= */ in.readInt(),
/* accuracy= */ in.readInt());
}
@@ -163,7 +191,7 @@
}
@Override
- public void writeToParcel(Parcel parcel, int flags) {
+ public void writeToParcel(@NonNull Parcel parcel, int flags) {
parcel.writeBoolean(mHasNetworkRequirement);
parcel.writeBoolean(mHasSatelliteRequirement);
parcel.writeBoolean(mHasCellRequirement);
@@ -171,7 +199,7 @@
parcel.writeBoolean(mHasAltitudeSupport);
parcel.writeBoolean(mHasSpeedSupport);
parcel.writeBoolean(mHasBearingSupport);
- parcel.writeInt(mPowerRequirement);
+ parcel.writeInt(mPowerUsage);
parcel.writeInt(mAccuracy);
}
@@ -191,7 +219,7 @@
&& mHasAltitudeSupport == that.mHasAltitudeSupport
&& mHasSpeedSupport == that.mHasSpeedSupport
&& mHasBearingSupport == that.mHasBearingSupport
- && mPowerRequirement == that.mPowerRequirement
+ && mPowerUsage == that.mPowerUsage
&& mAccuracy == that.mAccuracy;
}
@@ -199,13 +227,13 @@
public int hashCode() {
return Objects.hash(mHasNetworkRequirement, mHasSatelliteRequirement, mHasCellRequirement,
mHasMonetaryCost, mHasAltitudeSupport, mHasSpeedSupport, mHasBearingSupport,
- mPowerRequirement, mAccuracy);
+ mPowerUsage, mAccuracy);
}
@Override
public String toString() {
StringBuilder b = new StringBuilder("ProviderProperties[");
- b.append("power=").append(powerToString(mPowerRequirement)).append(", ");
+ b.append("power=").append(powerToString(mPowerUsage)).append(", ");
b.append("accuracy=").append(accuracyToString(mAccuracy));
if (mHasNetworkRequirement || mHasSatelliteRequirement || mHasCellRequirement) {
b.append(", requires=");
@@ -226,42 +254,42 @@
if (mHasBearingSupport || mHasSpeedSupport || mHasAltitudeSupport) {
b.append(", supports=[");
if (mHasBearingSupport) {
- b.append("bearing, ");
+ b.append("bearing,");
}
if (mHasSpeedSupport) {
- b.append("speed, ");
+ b.append("speed,");
}
if (mHasAltitudeSupport) {
- b.append("altitude, ");
+ b.append("altitude,");
}
- b.setLength(b.length() - 2);
+ b.setLength(b.length() - 1);
b.append("]");
}
b.append("]");
return b.toString();
}
- private static String powerToString(@PowerRequirement int power) {
+ private static String powerToString(@PowerUsage int power) {
switch (power) {
- case Criteria.POWER_LOW:
+ case POWER_USAGE_LOW:
return "Low";
- case Criteria.POWER_MEDIUM:
+ case POWER_USAGE_MEDIUM:
return "Medium";
- case Criteria.POWER_HIGH:
+ case POWER_USAGE_HIGH:
return "High";
default:
- return "???";
+ throw new AssertionError();
}
}
private static String accuracyToString(@Accuracy int accuracy) {
switch (accuracy) {
- case Criteria.ACCURACY_COARSE:
+ case ACCURACY_COARSE:
return "Coarse";
- case Criteria.ACCURACY_FINE:
+ case ACCURACY_FINE:
return "Fine";
default:
- return "???";
+ throw new AssertionError();
}
}
}
diff --git a/location/java/com/android/internal/location/GpsNetInitiatedHandler.java b/location/java/com/android/internal/location/GpsNetInitiatedHandler.java
index 4a095c9..4ce9a320 100644
--- a/location/java/com/android/internal/location/GpsNetInitiatedHandler.java
+++ b/location/java/com/android/internal/location/GpsNetInitiatedHandler.java
@@ -50,9 +50,6 @@
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
- // NI verify activity for bringing up UI (not used yet)
- public static final String ACTION_NI_VERIFY = "android.intent.action.NETWORK_INITIATED_VERIFY";
-
// string constants for defining data fields in NI Intent
public static final String NI_INTENT_KEY_NOTIF_ID = "notif_id";
public static final String NI_INTENT_KEY_TITLE = "title";
diff --git a/location/java/com/android/internal/location/ILocationProviderManager.aidl b/location/java/com/android/internal/location/ILocationProviderManager.aidl
index a74538b..a5b22b2 100644
--- a/location/java/com/android/internal/location/ILocationProviderManager.aidl
+++ b/location/java/com/android/internal/location/ILocationProviderManager.aidl
@@ -17,17 +17,17 @@
package com.android.internal.location;
import android.location.LocationResult;
-
-import com.android.internal.location.ProviderProperties;
+import android.location.ProviderProperties;
/**
* Binder interface for manager of all location providers.
* @hide
*/
interface ILocationProviderManager {
- void onSetIdentity(@nullable String packageName, @nullable String attributionTag);
+ void onInitialize(boolean allowed, in ProviderProperties properties, @nullable String packageName, @nullable String attributionTag);
void onSetAllowed(boolean allowed);
void onSetProperties(in ProviderProperties properties);
+
void onReportLocation(in LocationResult locationResult);
void onFlushComplete();
}
diff --git a/location/lib/java/com/android/location/provider/LocationProviderBase.java b/location/lib/java/com/android/location/provider/LocationProviderBase.java
index 54d8066..47e4256 100644
--- a/location/lib/java/com/android/location/provider/LocationProviderBase.java
+++ b/location/lib/java/com/android/location/provider/LocationProviderBase.java
@@ -23,6 +23,7 @@
import android.location.LocationManager;
import android.location.LocationProvider;
import android.location.LocationResult;
+import android.location.ProviderProperties;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import android.os.IBinder;
@@ -35,7 +36,6 @@
import com.android.internal.location.ILocationProvider;
import com.android.internal.location.ILocationProviderManager;
-import com.android.internal.location.ProviderProperties;
import com.android.internal.location.ProviderRequest;
import java.io.FileDescriptor;
@@ -372,11 +372,7 @@
public void setLocationProviderManager(ILocationProviderManager manager) {
synchronized (mBinder) {
try {
- if (mPackageName != null || mAttributionTag != null) {
- manager.onSetIdentity(mPackageName, mAttributionTag);
- }
- manager.onSetProperties(mProperties);
- manager.onSetAllowed(mAllowed);
+ manager.onInitialize(mAllowed, mProperties, mPackageName, mAttributionTag);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
} catch (RuntimeException e) {
diff --git a/location/lib/java/com/android/location/provider/ProviderPropertiesUnbundled.java b/location/lib/java/com/android/location/provider/ProviderPropertiesUnbundled.java
index 21ee5f4..9d8ccdf 100644
--- a/location/lib/java/com/android/location/provider/ProviderPropertiesUnbundled.java
+++ b/location/lib/java/com/android/location/provider/ProviderPropertiesUnbundled.java
@@ -17,8 +17,7 @@
package com.android.location.provider;
import android.annotation.NonNull;
-
-import com.android.internal.location.ProviderProperties;
+import android.location.ProviderProperties;
import java.util.Objects;
diff --git a/media/java/android/media/AudioPlaybackConfiguration.java b/media/java/android/media/AudioPlaybackConfiguration.java
index b9f449c..17305a5 100644
--- a/media/java/android/media/AudioPlaybackConfiguration.java
+++ b/media/java/android/media/AudioPlaybackConfiguration.java
@@ -21,7 +21,6 @@
import android.annotation.IntDef;
import android.annotation.NonNull;
-import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.os.Binder;
import android.os.IBinder;
@@ -48,8 +47,6 @@
public static final int PLAYER_PIID_INVALID = -1;
/** @hide */
public static final int PLAYER_UPID_INVALID = -1;
- /** @hide */
- public static final int PLAYER_DEVICEID_INVALID = 0;
// information about the implementation
/**
@@ -161,11 +158,6 @@
*/
@SystemApi
public static final int PLAYER_STATE_STOPPED = 4;
- /**
- * @hide
- * The state used to update device id, does not actually change the state of the player
- */
- public static final int PLAYER_UPDATE_DEVICE_ID = 5;
/** @hide */
@IntDef({
@@ -174,8 +166,7 @@
PLAYER_STATE_IDLE,
PLAYER_STATE_STARTED,
PLAYER_STATE_PAUSED,
- PLAYER_STATE_STOPPED,
- PLAYER_UPDATE_DEVICE_ID
+ PLAYER_STATE_STOPPED
})
@Retention(RetentionPolicy.SOURCE)
public @interface PlayerState {}
@@ -193,8 +184,6 @@
private int mPlayerState;
private AudioAttributes mPlayerAttr; // never null
- private int mDeviceId;
-
/**
* Never use without initializing parameters afterwards
*/
@@ -212,7 +201,6 @@
mPlayerType = pic.mPlayerType;
mClientUid = uid;
mClientPid = pid;
- mDeviceId = PLAYER_DEVICEID_INVALID;
mPlayerState = PLAYER_STATE_IDLE;
mPlayerAttr = pic.mAttributes;
if ((sPlayerDeathMonitor != null) && (pic.mIPlayer != null)) {
@@ -253,7 +241,6 @@
in.mPlayerAttr.getAllowedCapturePolicy() == ALLOW_CAPTURE_BY_ALL
? ALLOW_CAPTURE_BY_ALL : ALLOW_CAPTURE_BY_NONE)
.build();
- anonymCopy.mDeviceId = in.mDeviceId;
// anonymized data
anonymCopy.mPlayerType = PLAYER_TYPE_UNKNOWN;
anonymCopy.mClientUid = PLAYER_UPID_INVALID;
@@ -291,25 +278,6 @@
}
/**
- * Returns information about the {@link AudioDeviceInfo} used for this playback.
- * @return the audio playback device or null if the device is not available at the time of query
- */
- public @Nullable AudioDeviceInfo getAudioDevice() {
- if (mDeviceId == PLAYER_DEVICEID_INVALID) {
- return null;
- }
- // TODO(175802592): change this to AudioManager.getDeviceForPortId() when available
- AudioDeviceInfo[] devices =
- AudioManager.getDevicesStatic(AudioManager.GET_DEVICES_OUTPUTS);
- for (int i = 0; i < devices.length; i++) {
- if (devices[i].getId() == mDeviceId) {
- return devices[i];
- }
- }
- return null;
- }
-
- /**
* @hide
* Return the type of player linked to this configuration.
* <br>Note that player types not exposed in the system API will be represented as
@@ -391,29 +359,13 @@
* @hide
* Handle a player state change
* @param event
- * @param deviceId active device id or {@Code PLAYER_DEVICEID_INVALID}
- * <br>Note device id is valid for {@code PLAYER_UPDATE_DEVICE_ID} or
- * <br>{@code PLAYER_STATE_STARTED} events, as the device id will be reset to none when
- * <br>pausing or stopping playback. It will be set to active device when playback starts or
- * <br>it will be changed when PLAYER_UPDATE_DEVICE_ID is sent. The latter can happen if the
- * <br>device changes in the middle of playback.
* @return true if the state changed, false otherwise
*/
- public boolean handleStateEvent(int event, int deviceId) {
- boolean changed = false;
+ public boolean handleStateEvent(int event) {
+ final boolean changed;
synchronized (this) {
-
- // Do not update if it is only device id update
- if (event != PLAYER_UPDATE_DEVICE_ID) {
- changed = (mPlayerState != event);
- mPlayerState = event;
- }
-
- if (event == PLAYER_STATE_STARTED || event == PLAYER_UPDATE_DEVICE_ID) {
- changed = changed || (mDeviceId != deviceId);
- mDeviceId = deviceId;
- }
-
+ changed = (mPlayerState != event);
+ mPlayerState = event;
if (changed && (event == PLAYER_STATE_RELEASED) && (mIPlayerShell != null)) {
mIPlayerShell.release();
mIPlayerShell = null;
@@ -484,7 +436,7 @@
@Override
public int hashCode() {
- return Objects.hash(mPlayerIId, mDeviceId, mPlayerType, mClientUid, mClientPid);
+ return Objects.hash(mPlayerIId, mPlayerType, mClientUid, mClientPid);
}
@Override
@@ -495,7 +447,6 @@
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(mPlayerIId);
- dest.writeInt(mDeviceId);
dest.writeInt(mPlayerType);
dest.writeInt(mClientUid);
dest.writeInt(mClientPid);
@@ -510,7 +461,6 @@
private AudioPlaybackConfiguration(Parcel in) {
mPlayerIId = in.readInt();
- mDeviceId = in.readInt();
mPlayerType = in.readInt();
mClientUid = in.readInt();
mClientPid = in.readInt();
@@ -528,7 +478,6 @@
AudioPlaybackConfiguration that = (AudioPlaybackConfiguration) o;
return ((mPlayerIId == that.mPlayerIId)
- && (mDeviceId == that.mDeviceId)
&& (mPlayerType == that.mPlayerType)
&& (mClientUid == that.mClientUid)
&& (mClientPid == that.mClientPid));
@@ -537,7 +486,6 @@
@Override
public String toString() {
return "AudioPlaybackConfiguration piid:" + mPlayerIId
- + " deviceId:" + mDeviceId
+ " type:" + toLogFriendlyPlayerType(mPlayerType)
+ " u/pid:" + mClientUid + "/" + mClientPid
+ " state:" + toLogFriendlyPlayerState(mPlayerState)
@@ -623,7 +571,6 @@
case PLAYER_STATE_STARTED: return "started";
case PLAYER_STATE_PAUSED: return "paused";
case PLAYER_STATE_STOPPED: return "stopped";
- case PLAYER_UPDATE_DEVICE_ID: return "device";
default:
return "unknown player state - FIXME";
}
diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java
index 164b194..81ef064 100644
--- a/media/java/android/media/AudioSystem.java
+++ b/media/java/android/media/AudioSystem.java
@@ -31,6 +31,8 @@
import android.util.Log;
import android.util.Pair;
+import com.android.internal.annotations.GuardedBy;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
@@ -712,6 +714,42 @@
}
}
+ /**
+ * @hide
+ * Handles events from the audio policy manager about routing events
+ */
+ public interface RoutingUpdateCallback {
+ /**
+ * Callback to notify a routing update event occurred
+ */
+ void onRoutingUpdated();
+ }
+
+ @GuardedBy("AudioSystem.class")
+ private static RoutingUpdateCallback sRoutingUpdateCallback;
+
+ /** @hide */
+ public static void setRoutingCallback(RoutingUpdateCallback cb) {
+ synchronized (AudioSystem.class) {
+ sRoutingUpdateCallback = cb;
+ native_register_routing_callback();
+ }
+ }
+
+ private static void routingCallbackFromNative() {
+ final RoutingUpdateCallback cb;
+ synchronized (AudioSystem.class) {
+ cb = sRoutingUpdateCallback;
+ }
+ //###
+ Log.i(TAG, "#################### update");
+ if (cb == null) {
+ Log.e(TAG, "routing update from APM was not captured");
+ return;
+ }
+ cb.onRoutingUpdated();
+ }
+
/*
* Error codes used by public APIs (AudioTrack, AudioRecord, AudioManager ...)
* Must be kept in sync with frameworks/base/core/jni/android_media_AudioErrors.h
@@ -1597,6 +1635,8 @@
private static native final void native_register_dynamic_policy_callback();
// declare this instance as having a recording configuration update callback handler
private static native final void native_register_recording_callback();
+ // declare this instance as having a routing update callback handler
+ private static native void native_register_routing_callback();
// must be kept in sync with value in include/system/audio.h
/** @hide */ public static final int AUDIO_HW_SYNC_INVALID = 0;
diff --git a/media/java/android/media/AudioTrack.java b/media/java/android/media/AudioTrack.java
index e9a18e9..e3b6fba 100644
--- a/media/java/android/media/AudioTrack.java
+++ b/media/java/android/media/AudioTrack.java
@@ -1824,7 +1824,6 @@
@Override
protected void finalize() {
- tryToDisableNativeRoutingCallback();
baseRelease();
native_finalize();
}
@@ -2718,15 +2717,9 @@
}
private void startImpl() {
- synchronized (mRoutingChangeListeners) {
- if (!mEnableSelfRoutingMonitor) {
- testEnableNativeRoutingCallbacksLocked();
- mEnableSelfRoutingMonitor = true;
- }
- }
synchronized(mPlayStateLock) {
+ baseStart();
native_start();
- baseStart(native_getRoutedDeviceId());
if (mPlayState == PLAYSTATE_PAUSED_STOPPING) {
mPlayState = PLAYSTATE_STOPPING;
} else {
@@ -2764,7 +2757,6 @@
mPlayStateLock.notify();
}
}
- tryToDisableNativeRoutingCallback();
}
/**
@@ -3504,21 +3496,12 @@
return null;
}
- private void tryToDisableNativeRoutingCallback() {
- synchronized (mRoutingChangeListeners) {
- if (mEnableSelfRoutingMonitor) {
- mEnableSelfRoutingMonitor = false;
- testDisableNativeRoutingCallbacksLocked();
- }
- }
- }
-
/*
* Call BEFORE adding a routing callback handler.
*/
@GuardedBy("mRoutingChangeListeners")
private void testEnableNativeRoutingCallbacksLocked() {
- if (mRoutingChangeListeners.size() == 0 && !mEnableSelfRoutingMonitor) {
+ if (mRoutingChangeListeners.size() == 0) {
native_enableDeviceCallback();
}
}
@@ -3528,7 +3511,7 @@
*/
@GuardedBy("mRoutingChangeListeners")
private void testDisableNativeRoutingCallbacksLocked() {
- if (mRoutingChangeListeners.size() == 0 && !mEnableSelfRoutingMonitor) {
+ if (mRoutingChangeListeners.size() == 0) {
native_disableDeviceCallback();
}
}
@@ -3545,9 +3528,6 @@
private ArrayMap<AudioRouting.OnRoutingChangedListener,
NativeRoutingEventHandlerDelegate> mRoutingChangeListeners = new ArrayMap<>();
- @GuardedBy("mRoutingChangeListeners")
- private boolean mEnableSelfRoutingMonitor;
-
/**
* Adds an {@link AudioRouting.OnRoutingChangedListener} to receive notifications of routing
* changes on this AudioTrack.
@@ -3647,7 +3627,6 @@
*/
private void broadcastRoutingChange() {
AudioManager.resetAudioPortGeneration();
- baseUpdateDeviceId(getRoutedDevice());
synchronized (mRoutingChangeListeners) {
for (NativeRoutingEventHandlerDelegate delegate : mRoutingChangeListeners.values()) {
delegate.notifyClient();
diff --git a/media/java/android/media/ExifInterface.java b/media/java/android/media/ExifInterface.java
index de885f49..8ea380a 100644
--- a/media/java/android/media/ExifInterface.java
+++ b/media/java/android/media/ExifInterface.java
@@ -83,6 +83,10 @@
* <p>
* Supported for writing: JPEG, PNG, WebP.
* <p>
+ * Note: JPEG and HEIF files may contain XMP data either inside the Exif data chunk or outside of
+ * it. This class will search both locations for XMP data, but if XMP data exist both inside and
+ * outside Exif, will favor the XMP data inside Exif over the one outside.
+ * <p>
* Note: It is recommended to use the <a href="{@docRoot}jetpack/androidx.html">AndroidX</a>
* <a href="{@docRoot}reference/androidx/exifinterface/media/ExifInterface.html">ExifInterface
* Library</a> since it is a superset of this class. In addition to the functionalities of this
@@ -3185,6 +3189,24 @@
readExifSegment(bytes, IFD_TYPE_PRIMARY);
}
+ String xmpOffsetStr = retriever.extractMetadata(
+ MediaMetadataRetriever.METADATA_KEY_XMP_OFFSET);
+ String xmpLengthStr = retriever.extractMetadata(
+ MediaMetadataRetriever.METADATA_KEY_XMP_LENGTH);
+ if (xmpOffsetStr != null && xmpLengthStr != null) {
+ int offset = Integer.parseInt(xmpOffsetStr);
+ int length = Integer.parseInt(xmpLengthStr);
+ in.seek(offset);
+ byte[] xmpBytes = new byte[length];
+ if (in.read(xmpBytes) != length) {
+ throw new IOException("Failed to read XMP from HEIF");
+ }
+ if (getAttribute(TAG_XMP) == null) {
+ mAttributes[IFD_TYPE_PRIMARY].put(TAG_XMP, new ExifAttribute(
+ IFD_FORMAT_BYTE, xmpBytes.length, offset, xmpBytes));
+ }
+ }
+
if (DEBUG) {
Log.d(TAG, "Heif meta: " + width + "x" + height + ", rotation " + rotation);
}
diff --git a/media/java/android/media/HwAudioSource.java b/media/java/android/media/HwAudioSource.java
index bbf632a..01a02f1 100644
--- a/media/java/android/media/HwAudioSource.java
+++ b/media/java/android/media/HwAudioSource.java
@@ -22,8 +22,6 @@
import com.android.internal.util.Preconditions;
-import java.util.ArrayList;
-
/**
* The HwAudioSource represents the audio playback directly from a source audio device.
* It currently supports {@link HwAudioSource#start()} and {@link HwAudioSource#stop()} only
@@ -132,32 +130,10 @@
*/
public void start() {
Preconditions.checkState(!isPlaying(), "HwAudioSource is currently playing");
+ baseStart();
mNativeHandle = AudioSystem.startAudioSource(
mAudioDeviceInfo.getPort().activeConfig(),
mAudioAttributes);
- // FIXME: b/174876389 clean up device id reporting
- baseStart(getDeviceId());
- }
-
- private int getDeviceId() {
- ArrayList<AudioPatch> patches = new ArrayList<AudioPatch>();
- if (AudioManager.listAudioPatches(patches) != AudioManager.SUCCESS) {
- return 0;
- }
-
- for (int i = 0; i < patches.size(); i++) {
- AudioPatch patch = patches.get(i);
- AudioPortConfig[] sources = patch.sources();
- AudioPortConfig[] sinks = patch.sinks();
- if ((sources != null) && (sources.length > 0)) {
- for (int c = 0; c < sources.length; c++) {
- if (sources[c].port().id() == mAudioDeviceInfo.getId()) {
- return sinks[c].port().id();
- }
- }
- }
- }
- return 0;
}
/**
diff --git a/media/java/android/media/IAudioService.aidl b/media/java/android/media/IAudioService.aidl
index b6bb3a3..bad0d19 100755
--- a/media/java/android/media/IAudioService.aidl
+++ b/media/java/android/media/IAudioService.aidl
@@ -63,7 +63,7 @@
oneway void playerAttributes(in int piid, in AudioAttributes attr);
- oneway void playerEvent(in int piid, in int event, in int deviceId);
+ oneway void playerEvent(in int piid, in int event);
oneway void releasePlayer(in int piid);
diff --git a/media/java/android/media/IRemoteVolumeControllerCallback.aidl b/media/java/android/media/IRemoteSessionCallback.aidl
similarity index 95%
rename from media/java/android/media/IRemoteVolumeControllerCallback.aidl
rename to media/java/android/media/IRemoteSessionCallback.aidl
index 34c6361..e16c87e 100644
--- a/media/java/android/media/IRemoteVolumeControllerCallback.aidl
+++ b/media/java/android/media/IRemoteSessionCallback.aidl
@@ -25,7 +25,7 @@
* TODO add in better support for multiple remote sessions.
* @hide
*/
-oneway interface IRemoteVolumeControllerCallback {
+oneway interface IRemoteSessionCallback {
void onVolumeChanged(in MediaSession.Token sessionToken, int flags);
// sets the default session to use with the slider, replaces remoteSliderVisibility
// on IVolumeController
diff --git a/media/java/android/media/MediaCodecInfo.java b/media/java/android/media/MediaCodecInfo.java
index e7e83eb..9657b25e 100644
--- a/media/java/android/media/MediaCodecInfo.java
+++ b/media/java/android/media/MediaCodecInfo.java
@@ -1865,10 +1865,6 @@
&& 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,
@@ -2010,8 +2006,11 @@
* 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.
+ * 32-bit processes will not support resolutions larger than 4096x4096 due to
+ * the limited address space, but performance points will be presented as is.
+ * In other words, even though a component publishes a performance point for
+ * a resolution higher than 4096x4096, it does not mean that the resolution is supported
+ * for 32-bit processes.
*/
@Nullable
public List<PerformancePoint> getSupportedPerformancePoints() {
@@ -2215,28 +2214,6 @@
(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/MediaFrameworkInitializer.java b/media/java/android/media/MediaFrameworkPlatformInitializer.java
similarity index 87%
rename from media/java/android/media/MediaFrameworkInitializer.java
rename to media/java/android/media/MediaFrameworkPlatformInitializer.java
index 577442e..e703669 100644
--- a/media/java/android/media/MediaFrameworkInitializer.java
+++ b/media/java/android/media/MediaFrameworkPlatformInitializer.java
@@ -28,11 +28,15 @@
/**
* Class for performing registration for all media services
*
- * TODO (b/160513103): Move this class when moving media service code to APEX
+ * TODO (b/160513103): This class is still needed on platform side until
+ * MEDIA_SESSION_SERVICE is moved onto com.android.media apex.
+ * Once that's done, we can move the code that registers the service onto the
+ * MediaFrameworkInitializer class on the apex.
+ *
* @hide
*/
-public class MediaFrameworkInitializer {
- private MediaFrameworkInitializer() {
+public class MediaFrameworkPlatformInitializer {
+ private MediaFrameworkPlatformInitializer() {
}
private static volatile MediaServiceManager sMediaServiceManager;
diff --git a/media/java/android/media/MediaMetadataRetriever.java b/media/java/android/media/MediaMetadataRetriever.java
index 32a9168..c13f610 100644
--- a/media/java/android/media/MediaMetadataRetriever.java
+++ b/media/java/android/media/MediaMetadataRetriever.java
@@ -1374,17 +1374,13 @@
/**
* If the media contains XMP data, this key retrieves the offset (in bytes)
* of the data.
- * @hide
*/
- @SystemApi(client = MODULE_LIBRARIES)
public static final int METADATA_KEY_XMP_OFFSET = 41;
/**
* If the media contains XMP data, this key retrieves the length (in bytes)
* of the data.
- * @hide
*/
- @SystemApi(client = MODULE_LIBRARIES)
public static final int METADATA_KEY_XMP_LENGTH = 42;
// Add more here...
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java
index ceac2c9..f8311cd 100644
--- a/media/java/android/media/MediaPlayer.java
+++ b/media/java/android/media/MediaPlayer.java
@@ -1352,6 +1352,7 @@
}
private void startImpl() {
+ baseStart();
stayAwake(true);
_start();
}
@@ -1377,6 +1378,7 @@
public void stop() throws IllegalStateException {
stayAwake(false);
_stop();
+ baseStop();
}
private native void _stop() throws IllegalStateException;
@@ -1390,6 +1392,7 @@
public void pause() throws IllegalStateException {
stayAwake(false);
_pause();
+ basePause();
}
private native void _pause() throws IllegalStateException;
@@ -1494,60 +1497,13 @@
return null;
}
-
- /**
- * Sends device list change notification to all listeners.
- */
- private void broadcastRoutingChange() {
- AudioManager.resetAudioPortGeneration();
- synchronized (mRoutingChangeListeners) {
- // Prevent the case where an event is triggered by registering a routing change
- // listener via the media player.
- if (mEnableSelfRoutingMonitor) {
- baseUpdateDeviceId(getRoutedDevice());
- }
- for (NativeRoutingEventHandlerDelegate delegate
- : mRoutingChangeListeners.values()) {
- delegate.notifyClient();
- }
- }
- }
-
/*
- * Call BEFORE adding a routing callback handler.
+ * Call BEFORE adding a routing callback handler or AFTER removing a routing callback handler.
*/
@GuardedBy("mRoutingChangeListeners")
- private void testEnableNativeRoutingCallbacksLocked() {
- if (mRoutingChangeListeners.size() == 0 && !mEnableSelfRoutingMonitor) {
- native_enableDeviceCallback(true);
- }
- }
-
- private void tryToEnableNativeRoutingCallback() {
- synchronized (mRoutingChangeListeners) {
- if (!mEnableSelfRoutingMonitor) {
- testEnableNativeRoutingCallbacksLocked();
- mEnableSelfRoutingMonitor = true;
- }
- }
- }
-
- private void tryToDisableNativeRoutingCallback() {
- synchronized (mRoutingChangeListeners) {
- if (mEnableSelfRoutingMonitor) {
- mEnableSelfRoutingMonitor = false;
- testDisableNativeRoutingCallbacksLocked();
- }
- }
- }
-
- /*
- * Call AFTER removing a routing callback handler.
- */
- @GuardedBy("mRoutingChangeListeners")
- private void testDisableNativeRoutingCallbacksLocked() {
- if (mRoutingChangeListeners.size() == 0 && !mEnableSelfRoutingMonitor) {
- native_enableDeviceCallback(false);
+ private void enableNativeRoutingCallbacksLocked(boolean enabled) {
+ if (mRoutingChangeListeners.size() == 0) {
+ native_enableDeviceCallback(enabled);
}
}
@@ -1560,9 +1516,6 @@
private ArrayMap<AudioRouting.OnRoutingChangedListener,
NativeRoutingEventHandlerDelegate> mRoutingChangeListeners = new ArrayMap<>();
- @GuardedBy("mRoutingChangeListeners")
- private boolean mEnableSelfRoutingMonitor;
-
/**
* Adds an {@link AudioRouting.OnRoutingChangedListener} to receive notifications of routing
* changes on this MediaPlayer.
@@ -1576,7 +1529,7 @@
Handler handler) {
synchronized (mRoutingChangeListeners) {
if (listener != null && !mRoutingChangeListeners.containsKey(listener)) {
- testEnableNativeRoutingCallbacksLocked();
+ enableNativeRoutingCallbacksLocked(true);
mRoutingChangeListeners.put(
listener, new NativeRoutingEventHandlerDelegate(this, listener,
handler != null ? handler : mEventHandler));
@@ -1595,8 +1548,8 @@
synchronized (mRoutingChangeListeners) {
if (mRoutingChangeListeners.containsKey(listener)) {
mRoutingChangeListeners.remove(listener);
+ enableNativeRoutingCallbacksLocked(false);
}
- testDisableNativeRoutingCallbacksLocked();
}
}
@@ -3348,7 +3301,6 @@
@Override
protected void finalize() {
- tryToDisableNativeRoutingCallback();
baseRelease();
native_finalize();
}
@@ -3463,8 +3415,6 @@
case MEDIA_STOPPED:
{
- tryToDisableNativeRoutingCallback();
- baseStop();
TimeProvider timeProvider = mTimeProvider;
if (timeProvider != null) {
timeProvider.onStopped();
@@ -3473,16 +3423,8 @@
break;
case MEDIA_STARTED:
- {
- baseStart(native_getRoutedDeviceId());
- tryToEnableNativeRoutingCallback();
- }
- // fall through
case MEDIA_PAUSED:
{
- if (msg.what == MEDIA_PAUSED) {
- basePause();
- }
TimeProvider timeProvider = mTimeProvider;
if (timeProvider != null) {
timeProvider.onPaused(msg.what == MEDIA_PAUSED);
@@ -3648,8 +3590,14 @@
break;
case MEDIA_AUDIO_ROUTING_CHANGED:
- broadcastRoutingChange();
- return;
+ AudioManager.resetAudioPortGeneration();
+ synchronized (mRoutingChangeListeners) {
+ for (NativeRoutingEventHandlerDelegate delegate
+ : mRoutingChangeListeners.values()) {
+ delegate.notifyClient();
+ }
+ }
+ return;
case MEDIA_TIME_DISCONTINUITY:
final OnMediaTimeDiscontinuityListener mediaTimeListener;
@@ -3855,7 +3803,6 @@
@Override
public void onCompletion(MediaPlayer mp) {
baseStop();
- tryToDisableNativeRoutingCallback();
}
};
diff --git a/media/java/android/media/MediaServiceManager.java b/media/java/android/media/MediaServiceManager.java
index 21e2d84..96bff4f 100644
--- a/media/java/android/media/MediaServiceManager.java
+++ b/media/java/android/media/MediaServiceManager.java
@@ -17,6 +17,8 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.SystemApi;
+import android.annotation.SystemApi.Client;
import android.os.IBinder;
import android.os.ServiceManager;
@@ -27,7 +29,11 @@
* <p> Only the media mainline module will be able to access an instance of this class.
* @hide
*/
+@SystemApi(client = Client.MODULE_LIBRARIES)
public class MediaServiceManager {
+ private static final String MEDIA_SESSION_SERVICE = "media_session";
+ private static final String MEDIA_TRANSCODING_SERVICE = "media.transcoding";
+
/**
* @hide
*/
@@ -59,10 +65,18 @@
}
/**
- * Returns {@link ServiceRegisterer} for the "media_session" service.
+ * Returns {@link ServiceRegisterer} for MEDIA_SESSION_SERVICE.
*/
@NonNull
public ServiceRegisterer getMediaSessionServiceRegisterer() {
- return new ServiceRegisterer("media_session");
+ return new ServiceRegisterer(MEDIA_SESSION_SERVICE);
+ }
+
+ /**
+ * Returns {@link ServiceRegisterer} for MEDIA_TRANSCODING_SERVICE.
+ */
+ @NonNull
+ public ServiceRegisterer getMediaTranscodingServiceRegisterer() {
+ return new ServiceRegisterer(MEDIA_TRANSCODING_SERVICE);
}
}
diff --git a/media/java/android/media/OWNERS b/media/java/android/media/OWNERS
index cbc9ab7..cf06fad 100644
--- a/media/java/android/media/OWNERS
+++ b/media/java/android/media/OWNERS
@@ -6,3 +6,4 @@
olly@google.com
andrewlewis@google.com
sungsoo@google.com
+jmtrivi@google.com
diff --git a/media/java/android/media/PlayerBase.java b/media/java/android/media/PlayerBase.java
index 58ae279..da69c6c 100644
--- a/media/java/android/media/PlayerBase.java
+++ b/media/java/android/media/PlayerBase.java
@@ -90,8 +90,6 @@
private float mPanMultiplierR = 1.0f;
@GuardedBy("mLock")
private float mVolMultiplier = 1.0f;
- @GuardedBy("mLock")
- private int mDeviceId;
/**
* Constructor. Must be given audio attributes, as they are required for AppOps.
@@ -154,35 +152,14 @@
}
}
- void baseUpdateDeviceId(@Nullable AudioDeviceInfo deviceInfo) {
- int deviceId = 0;
- if (deviceInfo != null) {
- deviceId = deviceInfo.getId();
- }
- int piid;
- synchronized (mLock) {
- piid = mPlayerIId;
- mDeviceId = deviceId;
- }
- try {
- getService().playerEvent(piid,
- AudioPlaybackConfiguration.PLAYER_UPDATE_DEVICE_ID, deviceId);
- } catch (RemoteException e) {
- Log.e(TAG, "Error talking to audio service, "
- + deviceId
- + " device id will not be tracked for piid=" + piid, e);
- }
- }
-
- private void updateState(int state, int deviceId) {
+ private void updateState(int state) {
final int piid;
synchronized (mLock) {
mState = state;
piid = mPlayerIId;
- mDeviceId = deviceId;
}
try {
- getService().playerEvent(piid, state, deviceId);
+ getService().playerEvent(piid, state);
} catch (RemoteException e) {
Log.e(TAG, "Error talking to audio service, "
+ AudioPlaybackConfiguration.toLogFriendlyPlayerState(state)
@@ -190,11 +167,9 @@
}
}
- void baseStart(int deviceId) {
- if (DEBUG) {
- Log.v(TAG, "baseStart() piid=" + mPlayerIId + " deviceId=" + deviceId);
- }
- updateState(AudioPlaybackConfiguration.PLAYER_STATE_STARTED, deviceId);
+ void baseStart() {
+ if (DEBUG) { Log.v(TAG, "baseStart() piid=" + mPlayerIId); }
+ updateState(AudioPlaybackConfiguration.PLAYER_STATE_STARTED);
synchronized (mLock) {
if (isRestricted_sync()) {
playerSetVolume(true/*muting*/,0, 0);
@@ -216,12 +191,12 @@
void basePause() {
if (DEBUG) { Log.v(TAG, "basePause() piid=" + mPlayerIId); }
- updateState(AudioPlaybackConfiguration.PLAYER_STATE_PAUSED, 0);
+ updateState(AudioPlaybackConfiguration.PLAYER_STATE_PAUSED);
}
void baseStop() {
if (DEBUG) { Log.v(TAG, "baseStop() piid=" + mPlayerIId); }
- updateState(AudioPlaybackConfiguration.PLAYER_STATE_STOPPED, 0);
+ updateState(AudioPlaybackConfiguration.PLAYER_STATE_STOPPED);
}
void baseSetPan(float pan) {
diff --git a/media/java/android/media/SoundPool.java b/media/java/android/media/SoundPool.java
index 797caf3..3f685a4 100644
--- a/media/java/android/media/SoundPool.java
+++ b/media/java/android/media/SoundPool.java
@@ -303,8 +303,7 @@
*/
public final int play(int soundID, float leftVolume, float rightVolume,
int priority, int loop, float rate) {
- // FIXME: b/174876164 implement device id for soundpool
- baseStart(0);
+ baseStart();
return _play(soundID, leftVolume, rightVolume, priority, loop, rate);
}
diff --git a/media/java/android/media/session/ISessionManager.aidl b/media/java/android/media/session/ISessionManager.aidl
index f157d7f..66d5794 100644
--- a/media/java/android/media/session/ISessionManager.aidl
+++ b/media/java/android/media/session/ISessionManager.aidl
@@ -17,7 +17,7 @@
import android.content.ComponentName;
import android.content.pm.ParceledListSlice;
-import android.media.IRemoteVolumeControllerCallback;
+import android.media.IRemoteSessionCallback;
import android.media.Session2Token;
import android.media.session.IActiveSessionsListener;
import android.media.session.IOnMediaKeyEventDispatchedListener;
@@ -57,8 +57,8 @@
void addSession2TokensListener(in ISession2TokensListener listener, int userId);
void removeSession2TokensListener(in ISession2TokensListener listener);
- void registerRemoteVolumeControllerCallback(in IRemoteVolumeControllerCallback rvc);
- void unregisterRemoteVolumeControllerCallback(in IRemoteVolumeControllerCallback rvc);
+ void registerRemoteSessionCallback(in IRemoteSessionCallback rvc);
+ void unregisterRemoteSessionCallback(in IRemoteSessionCallback rvc);
// For PhoneWindowManager to precheck media keys
boolean isGlobalPriorityActive();
diff --git a/media/java/android/media/session/MediaSessionManager.java b/media/java/android/media/session/MediaSessionManager.java
index 6af39f8..f22bcd88 100644
--- a/media/java/android/media/session/MediaSessionManager.java
+++ b/media/java/android/media/session/MediaSessionManager.java
@@ -27,10 +27,11 @@
import android.content.Context;
import android.content.pm.ParceledListSlice;
import android.media.AudioManager;
-import android.media.IRemoteVolumeControllerCallback;
-import android.media.MediaFrameworkInitializer;
+import android.media.IRemoteSessionCallback;
+import android.media.MediaFrameworkPlatformInitializer;
import android.media.MediaSession2;
import android.media.Session2Token;
+import android.media.VolumeProvider;
import android.os.Bundle;
import android.os.Handler;
import android.os.RemoteException;
@@ -87,8 +88,8 @@
private final OnMediaKeyEventSessionChangedListenerStub
mOnMediaKeyEventSessionChangedListenerStub =
new OnMediaKeyEventSessionChangedListenerStub();
- private final RemoteVolumeControllerCallbackStub mRemoteVolumeControllerCallbackStub =
- new RemoteVolumeControllerCallbackStub();
+ private final RemoteSessionCallbackStub mRemoteSessionCallbackStub =
+ new RemoteSessionCallbackStub();
private final Object mLock = new Object();
@GuardedBy("mLock")
@@ -108,8 +109,8 @@
@GuardedBy("mLock")
private MediaSession.Token mCurMediaKeyEventSession;
@GuardedBy("mLock")
- private final Map<RemoteVolumeControllerCallback, Executor>
- mRemoteVolumeControllerCallbacks = new ArrayMap<>();
+ private final Map<RemoteSessionCallback, Executor>
+ mRemoteSessionCallbacks = new ArrayMap<>();
private Context mContext;
private OnVolumeKeyLongPressListenerImpl mOnVolumeKeyLongPressListener;
@@ -122,7 +123,7 @@
// Consider rewriting like DisplayManagerGlobal
// Decide if we need context
mContext = context;
- mService = ISessionManager.Stub.asInterface(MediaFrameworkInitializer
+ mService = ISessionManager.Stub.asInterface(MediaFrameworkPlatformInitializer
.getMediaServiceManager()
.getMediaSessionServiceRegisterer()
.get());
@@ -180,7 +181,7 @@
* be provided in priority order with the most important controller at index
* 0.
* <p>
- * This requires the android.Manifest.permission.MEDIA_CONTENT_CONTROL
+ * This requires the {@link android.Manifest.permission#MEDIA_CONTENT_CONTROL}
* permission be held by the calling app. You may also retrieve this list if
* your app is an enabled notification listener using the
* {@link NotificationListenerService} APIs, in which case you must pass the
@@ -196,14 +197,18 @@
}
/**
- * Get active sessions for a specific user. To retrieve actions for a user
- * other than your own you must hold the
- * {@link android.Manifest.permission#INTERACT_ACROSS_USERS_FULL} permission
- * in addition to any other requirements. If you are an enabled notification
- * listener you may only get sessions for the users you are enabled for.
+ * Get active sessions for the given user.
+ * <p>
+ * This requires the {@link android.Manifest.permission#MEDIA_CONTENT_CONTROL} permission be
+ * held by the calling app. You may also retrieve this list if your app is an enabled
+ * notification listener using the {@link NotificationListenerService} APIs, in which case you
+ * must pass the {@link ComponentName} of your enabled listener.
+ * <p>
+ * The calling application needs to hold the
+ * {@link android.Manifest.permission#INTERACT_ACROSS_USERS_FULL} permission in order to
+ * retrieve sessions for user ids that do not belong to current process.
*
- * @param notificationListener The enabled notification listener component.
- * May be null.
+ * @param notificationListener The enabled notification listener component. May be null.
* @param userId The user id to fetch sessions for.
* @return A list of controllers for ongoing sessions.
* @hide
@@ -248,8 +253,9 @@
* Gets a list of {@link Session2Token} with type {@link Session2Token#TYPE_SESSION} for the
* given user.
* <p>
- * If you want to get tokens for another user, you must hold the
- * android.Manifest.permission#INTERACT_ACROSS_USERS_FULL permission.
+ * The calling application needs to hold the
+ * {@link android.Manifest.permission#INTERACT_ACROSS_USERS_FULL} permission in order to
+ * retrieve session tokens for user ids that do not belong to current process.
*
* @param userId The user id to fetch sessions for.
* @return A list of {@link Session2Token}
@@ -267,11 +273,12 @@
}
/**
- * Add a listener to be notified when the list of active sessions changes. This requires the
- * {@link android.Manifest.permission#MEDIA_CONTENT_CONTROL} permission be held by the calling
- * app. You may also retrieve this list if your app is an enabled notification listener using
- * the {@link NotificationListenerService} APIs, in which case you must pass the
- * {@link ComponentName} of your enabled listener.
+ * Add a listener to be notified when the list of active sessions changes.
+ * <p>
+ * This requires the {@link android.Manifest.permission#MEDIA_CONTENT_CONTROL} permission be
+ * held by the calling app. You may also retrieve this list if your app is an enabled
+ * notificationlistener using the {@link NotificationListenerService} APIs, in which case you
+ * must pass the {@link ComponentName} of your enabled listener.
*
* @param sessionListener The listener to add.
* @param notificationListener The enabled notification listener component. May be null.
@@ -283,12 +290,13 @@
}
/**
- * Add a listener to be notified when the list of active sessions changes. This requires the
- * {@link android.Manifest.permission#MEDIA_CONTENT_CONTROL} permission be held by the calling
- * app. You may also retrieve this list if your app is an enabled notification listener using
- * the {@link NotificationListenerService} APIs, in which case you must pass the
- * {@link ComponentName} of your enabled listener. Updates will be posted to the handler
- * specified or to the caller's thread if the handler is null.
+ * Add a listener to be notified when the list of active sessions changes.
+ * <p>
+ * This requires the {@link android.Manifest.permission#MEDIA_CONTENT_CONTROL} permission be
+ * held by the calling app. You may also retrieve this list if your app is an enabled
+ * notification listener using the {@link NotificationListenerService} APIs, in which case you
+ * must pass the {@link ComponentName} of your enabled listener. Updates will be posted to the
+ * handler specified or to the caller's thread if the handler is null.
*
* @param sessionListener The listener to add.
* @param notificationListener The enabled notification listener component. May be null.
@@ -302,15 +310,17 @@
}
/**
- * Add a listener to be notified when the list of active sessions changes for the given user.
- * The calling app must have the {@link android.Manifest.permission#INTERACT_ACROSS_USERS_FULL}
- * permission if it wants to call this method for a user that is not running the app.
+ * Add a listener to be notified when the list of active sessions changes.
* <p>
* This requires the {@link android.Manifest.permission#MEDIA_CONTENT_CONTROL} permission be
* held by the calling app. You may also retrieve this list if your app is an enabled
* notification listener using the {@link NotificationListenerService} APIs, in which case you
* must pass the {@link ComponentName} of your enabled listener. Updates will be posted to the
* handler specified or to the caller's thread if the handler is null.
+ * <p>
+ * The calling application needs to hold the
+ * {@link android.Manifest.permission#INTERACT_ACROSS_USERS_FULL} permission in order to
+ * add listeners for user ids that do not belong to current process.
*
* @param sessionListener The listener to add.
* @param notificationListener The enabled notification listener component. May be null.
@@ -407,6 +417,10 @@
* Library</a> for consistent behavior across all devices.
* <p>
* Adds a listener to be notified when the {@link #getSession2Tokens()} changes.
+ * <p>
+ * The calling application needs to hold the
+ * {@link android.Manifest.permission#INTERACT_ACROSS_USERS_FULL} permission in order to
+ * add listeners for user ids that do not belong to current process.
*
* @param userId The userId to listen for changes on
* @param listener The listener to add
@@ -469,27 +483,29 @@
* Set the remote volume controller callback to receive volume updates on.
* Only for use by System UI and Settings application.
*
+ * @param executor The executor on which the callback should be invoked
* @param callback The volume controller callback to receive updates on.
+ *
* @hide
*/
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
- public void registerRemoteVolumeControllerCallback(
+ public void registerRemoteSessionCallback(
@NonNull @CallbackExecutor Executor executor,
- @NonNull RemoteVolumeControllerCallback callback) {
+ @NonNull RemoteSessionCallback callback) {
Objects.requireNonNull(executor, "executor shouldn't be null");
Objects.requireNonNull(callback, "callback shouldn't be null");
boolean shouldRegisterCallback = false;
synchronized (mLock) {
- int prevCallbackCount = mRemoteVolumeControllerCallbacks.size();
- mRemoteVolumeControllerCallbacks.put(callback, executor);
- if (prevCallbackCount == 0 && mRemoteVolumeControllerCallbacks.size() == 1) {
+ int prevCallbackCount = mRemoteSessionCallbacks.size();
+ mRemoteSessionCallbacks.put(callback, executor);
+ if (prevCallbackCount == 0 && mRemoteSessionCallbacks.size() == 1) {
shouldRegisterCallback = true;
}
}
if (shouldRegisterCallback) {
try {
- mService.registerRemoteVolumeControllerCallback(
- mRemoteVolumeControllerCallbackStub);
+ mService.registerRemoteSessionCallback(
+ mRemoteSessionCallbackStub);
} catch (RemoteException e) {
Log.e(TAG, "Failed to register remote volume controller callback", e);
}
@@ -498,27 +514,27 @@
/**
* Unregisters the remote volume controller callback which was previously registered with
- * {@link #registerRemoteVolumeControllerCallback(Executor, RemoteVolumeControllerCallback)}.
+ * {@link #registerRemoteSessionCallback(Executor, RemoteSessionCallback)}.
* Only for use by System UI and Settings application.
*
* @param callback The volume controller callback to receive updates on.
* @hide
*/
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
- public void unregisterRemoteVolumeControllerCallback(
- @NonNull RemoteVolumeControllerCallback callback) {
+ public void unregisterRemoteSessionCallback(
+ @NonNull RemoteSessionCallback callback) {
Objects.requireNonNull(callback, "callback shouldn't be null");
boolean shouldUnregisterCallback = false;
synchronized (mLock) {
- if (mRemoteVolumeControllerCallbacks.remove(callback) != null
- && mRemoteVolumeControllerCallbacks.size() == 0) {
+ if (mRemoteSessionCallbacks.remove(callback) != null
+ && mRemoteSessionCallbacks.size() == 0) {
shouldUnregisterCallback = true;
}
}
try {
if (shouldUnregisterCallback) {
- mService.unregisterRemoteVolumeControllerCallback(
- mRemoteVolumeControllerCallbackStub);
+ mService.unregisterRemoteSessionCallback(
+ mRemoteSessionCallbackStub);
}
} catch (RemoteException e) {
Log.e(TAG, "Failed to unregister remote volume controller callback", e);
@@ -705,8 +721,9 @@
/**
* Checks whether the remote user is a trusted app.
* <p>
- * An app is trusted if the app holds the android.Manifest.permission.MEDIA_CONTENT_CONTROL
- * permission or has an enabled notification listener.
+ * An app is trusted if the app holds the
+ * {@link android.Manifest.permission#MEDIA_CONTENT_CONTROL} permission or has an enabled
+ * notification listener.
*
* @param userInfo The remote user info from either
* {@link MediaSession#getCurrentControllerInfo()} or
@@ -1093,26 +1110,34 @@
}
/**
- * Callback to receive changes in the remote volume controller.
+ * Callback to receive changes in the existing remote sessions. A remote session is a
+ * {@link MediaSession} that is connected to a remote player via
+ * {@link MediaSession#setPlaybackToRemote(VolumeProvider)}
*
* @hide
*/
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
- public interface RemoteVolumeControllerCallback {
+ public interface RemoteSessionCallback {
/**
- * Called when the volume is changed.
+ * Called when the volume is changed for the given session. Flags that are defined in
+ * {@link AudioManager} will also be sent and will contain information about how to
+ * handle the volume change. For example, {@link AudioManager#FLAG_SHOW_UI} indicates that a
+ * toast showing the volume should be shown.
*
* @param sessionToken the remote media session token
- * @param flags any of the flags from {@link AudioManager}
+ * @param flags extra information about how to handle the volume change
*/
void onVolumeChanged(@NonNull MediaSession.Token sessionToken, int flags);
/**
- * Called when the session for the default remote controller is changed.
+ * Called when the default remote session is changed where the default remote session
+ * denotes an active remote session that has the highest priority for receiving key events.
+ * Null will be sent if there are currently no active remote sessions.
*
- * @param sessionToken the remote media session token
+ * @param sessionToken the token of the default remote session, a session with the highest
+ * priority for receiving key events.
*/
- void onSessionChanged(@Nullable MediaSession.Token sessionToken);
+ void onDefaultRemoteSessionChanged(@Nullable MediaSession.Token sessionToken);
}
/**
@@ -1348,27 +1373,27 @@
}
}
- private final class RemoteVolumeControllerCallbackStub
- extends IRemoteVolumeControllerCallback.Stub {
+ private final class RemoteSessionCallbackStub
+ extends IRemoteSessionCallback.Stub {
@Override
public void onVolumeChanged(MediaSession.Token sessionToken, int flags) {
- Map<RemoteVolumeControllerCallback, Executor> callbacks = new ArrayMap<>();
+ Map<RemoteSessionCallback, Executor> callbacks = new ArrayMap<>();
synchronized (mLock) {
- callbacks.putAll(mRemoteVolumeControllerCallbacks);
+ callbacks.putAll(mRemoteSessionCallbacks);
}
- for (Map.Entry<RemoteVolumeControllerCallback, Executor> e : callbacks.entrySet()) {
+ for (Map.Entry<RemoteSessionCallback, Executor> e : callbacks.entrySet()) {
e.getValue().execute(() -> e.getKey().onVolumeChanged(sessionToken, flags));
}
}
@Override
public void onSessionChanged(MediaSession.Token sessionToken) {
- Map<RemoteVolumeControllerCallback, Executor> callbacks = new ArrayMap<>();
+ Map<RemoteSessionCallback, Executor> callbacks = new ArrayMap<>();
synchronized (mLock) {
- callbacks.putAll(mRemoteVolumeControllerCallbacks);
+ callbacks.putAll(mRemoteSessionCallbacks);
}
- for (Map.Entry<RemoteVolumeControllerCallback, Executor> e : callbacks.entrySet()) {
- e.getValue().execute(() -> e.getKey().onSessionChanged(sessionToken));
+ for (Map.Entry<RemoteSessionCallback, Executor> e : callbacks.entrySet()) {
+ e.getValue().execute(() -> e.getKey().onDefaultRemoteSessionChanged(sessionToken));
}
}
}
diff --git a/media/java/android/media/tv/tuner/Tuner.java b/media/java/android/media/tv/tuner/Tuner.java
index dec0709..02b6571 100644
--- a/media/java/android/media/tv/tuner/Tuner.java
+++ b/media/java/android/media/tv/tuner/Tuner.java
@@ -454,10 +454,12 @@
*
* <p>Tuner resource manager (TRM) uses the client priority value to decide whether it is able
* to reclaim insufficient resources from another client.
+ *
* <p>The nice value represents how much the client intends to give up the resource when an
* insufficient resource situation happens.
*
- * @param priority the new priority.
+ * @param priority the new priority. Any negative value would cause no-op on priority setting
+ * and the API would only process nice value setting in that case.
* @param niceValue the nice value.
*/
public void updateResourcePriority(int priority, int niceValue) {
diff --git a/media/java/android/media/tv/tuner/dvr/DvrRecorder.java b/media/java/android/media/tv/tuner/dvr/DvrRecorder.java
index 8871167..c4b622d 100644
--- a/media/java/android/media/tv/tuner/dvr/DvrRecorder.java
+++ b/media/java/android/media/tv/tuner/dvr/DvrRecorder.java
@@ -47,6 +47,7 @@
private static int sInstantId = 0;
private int mSegmentId = 0;
private int mOverflow;
+ private Boolean mIsStopped = null;
private native int nativeAttachFilter(Filter filter);
private native int nativeDetachFilter(Filter filter);
@@ -135,7 +136,13 @@
.write(FrameworkStatsLog.TV_TUNER_DVR_STATUS, mUserId,
FrameworkStatsLog.TV_TUNER_DVR_STATUS__TYPE__RECORD,
FrameworkStatsLog.TV_TUNER_DVR_STATUS__STATE__STARTED, mSegmentId, 0);
- return nativeStartDvr();
+ synchronized (mIsStopped) {
+ int result = nativeStartDvr();
+ if (result == Tuner.RESULT_SUCCESS) {
+ mIsStopped = false;
+ }
+ return result;
+ }
}
/**
@@ -152,7 +159,13 @@
.write(FrameworkStatsLog.TV_TUNER_DVR_STATUS, mUserId,
FrameworkStatsLog.TV_TUNER_DVR_STATUS__TYPE__RECORD,
FrameworkStatsLog.TV_TUNER_DVR_STATUS__STATE__STOPPED, mSegmentId, mOverflow);
- return nativeStopDvr();
+ synchronized (mIsStopped) {
+ int result = nativeStopDvr();
+ if (result == Tuner.RESULT_SUCCESS) {
+ mIsStopped = true;
+ }
+ return result;
+ }
}
/**
@@ -164,7 +177,13 @@
*/
@Result
public int flush() {
- return nativeFlushDvr();
+ synchronized (mIsStopped) {
+ if (mIsStopped) {
+ return nativeFlushDvr();
+ }
+ Log.w(TAG, "Cannot flush non-stopped Record DVR.");
+ return Tuner.RESULT_INVALID_STATE;
+ }
}
/**
diff --git a/media/jni/Android.bp b/media/jni/Android.bp
index 79f6cbf..25b1b40 100644
--- a/media/jni/Android.bp
+++ b/media/jni/Android.bp
@@ -140,6 +140,7 @@
srcs: [
"android_media_tv_Tuner.cpp",
"tuner/DemuxClient.cpp",
+ "tuner/DvrClient.cpp",
"tuner/FilterClient.cpp",
"tuner/FrontendClient.cpp",
"tuner/TunerClient.cpp",
diff --git a/media/jni/android_media_tv_Tuner.cpp b/media/jni/android_media_tv_Tuner.cpp
index 440d5bc..602364e 100644
--- a/media/jni/android_media_tv_Tuner.cpp
+++ b/media/jni/android_media_tv_Tuner.cpp
@@ -261,70 +261,38 @@
return mLnbSp;
}
-/////////////// DvrCallback ///////////////////////
-Return<void> DvrCallback::onRecordStatus(RecordStatus status) {
- ALOGD("DvrCallback::onRecordStatus");
+/////////////// DvrClientCallbackImpl ///////////////////////
+void DvrClientCallbackImpl::onRecordStatus(RecordStatus status) {
+ ALOGD("DvrClientCallbackImpl::onRecordStatus");
JNIEnv *env = AndroidRuntime::getJNIEnv();
env->CallVoidMethod(
- mDvr,
+ mDvrObj,
gFields.onDvrRecordStatusID,
(jint) status);
- return Void();
}
-Return<void> DvrCallback::onPlaybackStatus(PlaybackStatus status) {
- ALOGD("DvrCallback::onPlaybackStatus");
+void DvrClientCallbackImpl::onPlaybackStatus(PlaybackStatus status) {
+ ALOGD("DvrClientCallbackImpl::onPlaybackStatus");
JNIEnv *env = AndroidRuntime::getJNIEnv();
env->CallVoidMethod(
- mDvr,
+ mDvrObj,
gFields.onDvrPlaybackStatusID,
(jint) status);
- return Void();
}
-void DvrCallback::setDvr(const jobject dvr) {
- ALOGD("DvrCallback::setDvr");
- JNIEnv *env = AndroidRuntime::getJNIEnv();
- mDvr = env->NewWeakGlobalRef(dvr);
+void DvrClientCallbackImpl::setDvr(jweak dvrObj) {
+ ALOGD("DvrClientCallbackImpl::setDvr");
+ mDvrObj = dvrObj;
}
-DvrCallback::~DvrCallback() {
+DvrClientCallbackImpl::~DvrClientCallbackImpl() {
JNIEnv *env = AndroidRuntime::getJNIEnv();
- if (mDvr != NULL) {
- env->DeleteWeakGlobalRef(mDvr);
- mDvr = NULL;
+ if (mDvrObj != NULL) {
+ env->DeleteWeakGlobalRef(mDvrObj);
+ mDvrObj = NULL;
}
}
-/////////////// Dvr ///////////////////////
-
-Dvr::Dvr(sp<IDvr> sp, jobject obj) : mDvrSp(sp), mDvrMQEventFlag(nullptr) {
- JNIEnv *env = AndroidRuntime::getJNIEnv();
- mDvrObj = env->NewWeakGlobalRef(obj);
-}
-
-Dvr::~Dvr() {
- JNIEnv *env = AndroidRuntime::getJNIEnv();
- env->DeleteWeakGlobalRef(mDvrObj);
- mDvrObj = NULL;
-}
-
-jint Dvr::close() {
- Result r = mDvrSp->close();
- if (r == Result::SUCCESS) {
- EventFlag::deleteEventFlag(&mDvrMQEventFlag);
- }
- return (jint) r;
-}
-
-sp<IDvr> Dvr::getIDvr() {
- return mDvrSp;
-}
-
-MQ& Dvr::getDvrMQ() {
- return *mDvrMQ;
-}
-
/////////////// C2DataIdInfo ///////////////////////
C2DataIdInfo::C2DataIdInfo(uint32_t index, uint64_t value) : C2Param(kParamSize, index) {
@@ -337,8 +305,8 @@
/////////////// MediaEvent ///////////////////////
-MediaEvent::MediaEvent(sp<Filter> filter, hidl_handle avHandle,
- uint64_t dataId, uint64_t dataSize, jobject obj) : mFilter(filter),
+MediaEvent::MediaEvent(sp<FilterClient> filterClient, hidl_handle avHandle,
+ uint64_t dataId, uint64_t dataSize, jobject obj) : mFilterClient(filterClient),
mDataId(dataId), mDataSize(dataSize), mBuffer(nullptr),
mDataIdRefCnt(0), mAvHandleRefCnt(0), mIonHandle(nullptr) {
JNIEnv *env = AndroidRuntime::getJNIEnv();
@@ -359,12 +327,13 @@
if (pC2Buffer != NULL) {
pC2Buffer->unregisterOnDestroyNotify(&DestroyCallback, this);
}
+ mFilterClient = NULL;
}
void MediaEvent::finalize() {
- if (mAvHandleRefCnt == 0) {
- mFilter->mFilterSp->releaseAvHandle(
- hidl_handle(mAvHandle), mDataIdRefCnt == 0 ? mDataId : 0);
+ if (mAvHandleRefCnt == 0 && mFilterClient != NULL) {
+ mFilterClient->releaseAvHandle(
+ mAvHandle, mDataIdRefCnt == 0 ? mDataId : 0);
native_handle_close(mAvHandle);
}
}
@@ -382,21 +351,25 @@
int numInts = 0;
int memIndex;
int dataSize;
+ SharedHandleInfo info = mFilterClient->getAvSharedHandleInfo();
+ native_handle_t* avSharedHandle = info.sharedHandle;
+ uint64_t avSharedMemSize = info.size;
+
if (mAvHandle->numFds == 0) {
- if (mFilter->mAvSharedHandle == NULL) {
+ if (avSharedHandle == NULL) {
ALOGE("Shared AV memory handle is not initialized.");
return NULL;
}
- if (mFilter->mAvSharedHandle->numFds == 0) {
+ if (avSharedHandle->numFds == 0) {
ALOGE("Shared AV memory handle is empty.");
return NULL;
}
- fd = mFilter->mAvSharedHandle->data[0];
- dataSize = mFilter->mAvSharedMemSize;
- numInts = mFilter->mAvSharedHandle->numInts;
+ fd = avSharedHandle->data[0];
+ dataSize = avSharedMemSize;
+ numInts = avSharedHandle->numInts;
if (numInts > 0) {
// If the first int in the shared native handle has value, use it as the index
- memIndex = mFilter->mAvSharedHandle->data[mFilter->mAvSharedHandle->numFds];
+ memIndex = avSharedHandle->data[avSharedHandle->numFds];
}
} else {
fd = mAvHandle->data[0];
@@ -407,11 +380,11 @@
// event has value, use it as the index
memIndex = mAvHandle->data[mAvHandle->numFds];
} else {
- if (mFilter->mAvSharedHandle != NULL) {
- numInts = mFilter->mAvSharedHandle->numInts;
+ if (avSharedHandle != NULL) {
+ numInts = avSharedHandle->numInts;
if (numInts > 0) {
// If the first int in the shared native handle has value, use it as the index
- memIndex = mFilter->mAvSharedHandle->data[mFilter->mAvSharedHandle->numFds];
+ memIndex = avSharedHandle->data[avSharedHandle->numFds];
}
}
}
@@ -462,9 +435,9 @@
return mDataId;
}
-/////////////// FilterCallback ///////////////////////
+/////////////// FilterClientCallbackImpl ///////////////////////
-jobjectArray FilterCallback::getSectionEvent(
+jobjectArray FilterClientCallbackImpl::getSectionEvent(
jobjectArray& arr, const std::vector<DemuxFilterEvent::Event>& events) {
JNIEnv *env = AndroidRuntime::getJNIEnv();
jclass eventClazz = env->FindClass("android/media/tv/tuner/filter/SectionEvent");
@@ -486,7 +459,7 @@
return arr;
}
-jobjectArray FilterCallback::getMediaEvent(
+jobjectArray FilterClientCallbackImpl::getMediaEvent(
jobjectArray& arr, const std::vector<DemuxFilterEvent::Event>& events) {
JNIEnv *env = AndroidRuntime::getJNIEnv();
jclass eventClazz = env->FindClass("android/media/tv/tuner/filter/MediaEvent");
@@ -537,7 +510,7 @@
if (mediaEvent.avMemory.getNativeHandle() != NULL || mediaEvent.avDataId != 0) {
sp<MediaEvent> mediaEventSp =
- new MediaEvent(mFilter, mediaEvent.avMemory,
+ new MediaEvent(mFilterClient, mediaEvent.avMemory,
mediaEvent.avDataId, dataLength + offset, obj);
mediaEventSp->mAvHandleRefCnt++;
env->SetLongField(obj, eventContext, (jlong) mediaEventSp.get());
@@ -549,7 +522,7 @@
return arr;
}
-jobjectArray FilterCallback::getPesEvent(
+jobjectArray FilterClientCallbackImpl::getPesEvent(
jobjectArray& arr, const std::vector<DemuxFilterEvent::Event>& events) {
JNIEnv *env = AndroidRuntime::getJNIEnv();
jclass eventClazz = env->FindClass("android/media/tv/tuner/filter/PesEvent");
@@ -570,7 +543,7 @@
return arr;
}
-jobjectArray FilterCallback::getTsRecordEvent(
+jobjectArray FilterClientCallbackImpl::getTsRecordEvent(
jobjectArray& arr, const std::vector<DemuxFilterEvent::Event>& events,
const std::vector<DemuxFilterEventExt::Event>& eventsExt) {
JNIEnv *env = AndroidRuntime::getJNIEnv();
@@ -623,7 +596,7 @@
return arr;
}
-jobjectArray FilterCallback::getMmtpRecordEvent(
+jobjectArray FilterClientCallbackImpl::getMmtpRecordEvent(
jobjectArray& arr, const std::vector<DemuxFilterEvent::Event>& events,
const std::vector<DemuxFilterEventExt::Event>& eventsExt) {
JNIEnv *env = AndroidRuntime::getJNIEnv();
@@ -665,7 +638,7 @@
return arr;
}
-jobjectArray FilterCallback::getDownloadEvent(
+jobjectArray FilterClientCallbackImpl::getDownloadEvent(
jobjectArray& arr, const std::vector<DemuxFilterEvent::Event>& events) {
JNIEnv *env = AndroidRuntime::getJNIEnv();
jclass eventClazz = env->FindClass("android/media/tv/tuner/filter/DownloadEvent");
@@ -689,7 +662,7 @@
return arr;
}
-jobjectArray FilterCallback::getIpPayloadEvent(
+jobjectArray FilterClientCallbackImpl::getIpPayloadEvent(
jobjectArray& arr, const std::vector<DemuxFilterEvent::Event>& events) {
JNIEnv *env = AndroidRuntime::getJNIEnv();
jclass eventClazz = env->FindClass("android/media/tv/tuner/filter/IpPayloadEvent");
@@ -705,7 +678,7 @@
return arr;
}
-jobjectArray FilterCallback::getTemiEvent(
+jobjectArray FilterClientCallbackImpl::getTemiEvent(
jobjectArray& arr, const std::vector<DemuxFilterEvent::Event>& events) {
JNIEnv *env = AndroidRuntime::getJNIEnv();
jclass eventClazz = env->FindClass("android/media/tv/tuner/filter/TemiEvent");
@@ -728,7 +701,7 @@
return arr;
}
-jobjectArray FilterCallback::getScramblingStatusEvent(
+jobjectArray FilterClientCallbackImpl::getScramblingStatusEvent(
jobjectArray& arr, const std::vector<DemuxFilterEventExt::Event>& eventsExt) {
JNIEnv *env = AndroidRuntime::getJNIEnv();
jclass eventClazz = env->FindClass("android/media/tv/tuner/filter/ScramblingStatusEvent");
@@ -740,7 +713,7 @@
return arr;
}
-jobjectArray FilterCallback::getIpCidChangeEvent(
+jobjectArray FilterClientCallbackImpl::getIpCidChangeEvent(
jobjectArray& arr, const std::vector<DemuxFilterEventExt::Event>& eventsExt) {
JNIEnv *env = AndroidRuntime::getJNIEnv();
jclass eventClazz = env->FindClass("android/media/tv/tuner/filter/IpCidChangeEvent");
@@ -752,7 +725,7 @@
return arr;
}
-jobjectArray FilterCallback::getRestartEvent(
+jobjectArray FilterClientCallbackImpl::getRestartEvent(
jobjectArray& arr, const std::vector<DemuxFilterEventExt::Event>& eventsExt) {
JNIEnv *env = AndroidRuntime::getJNIEnv();
jclass eventClazz = env->FindClass("android/media/tv/tuner/filter/RestartEvent");
@@ -764,9 +737,9 @@
return arr;
}
-Return<void> FilterCallback::onFilterEvent_1_1(const DemuxFilterEvent& filterEvent,
+void FilterClientCallbackImpl::onFilterEvent_1_1(const DemuxFilterEvent& filterEvent,
const DemuxFilterEventExt& filterEventExt) {
- ALOGD("FilterCallback::onFilterEvent_1_1");
+ ALOGD("FilterClientCallbackImpl::onFilterEvent_1_1");
JNIEnv *env = AndroidRuntime::getJNIEnv();
jobjectArray array;
@@ -848,14 +821,13 @@
}
}
env->CallVoidMethod(
- mFilter->mFilterObj,
+ mFilterObj,
gFields.onFilterEventID,
array);
- return Void();
}
-Return<void> FilterCallback::onFilterEvent(const DemuxFilterEvent& filterEvent) {
- ALOGD("FilterCallback::onFilterEvent");
+void FilterClientCallbackImpl::onFilterEvent(const DemuxFilterEvent& filterEvent) {
+ ALOGD("FilterClientCallbackImpl::onFilterEvent");
std::vector<DemuxFilterEventExt::Event> emptyEventsExt;
DemuxFilterEventExt emptyFilterEventExt {
.events = emptyEventsExt,
@@ -863,49 +835,20 @@
return onFilterEvent_1_1(filterEvent, emptyFilterEventExt);
}
-Return<void> FilterCallback::onFilterStatus(const DemuxFilterStatus status) {
- ALOGD("FilterCallback::onFilterStatus");
+void FilterClientCallbackImpl::onFilterStatus(const DemuxFilterStatus status) {
+ ALOGD("FilterClientCallbackImpl::onFilterStatus");
JNIEnv *env = AndroidRuntime::getJNIEnv();
env->CallVoidMethod(
- mFilter->mFilterObj,
+ mFilterObj,
gFields.onFilterStatusID,
(jint)status);
- return Void();
}
-void FilterCallback::setFilter(const sp<Filter> filter) {
- ALOGD("FilterCallback::setFilter");
- // JNI Object
- mFilter = filter;
-}
-
-FilterCallback::~FilterCallback() {}
-
-/////////////// Filter ///////////////////////
-
-Filter::Filter(sp<IFilter> sp, jobject obj) : mFilterSp(sp) {
- JNIEnv *env = AndroidRuntime::getJNIEnv();
- mFilterObj = env->NewWeakGlobalRef(obj);
-}
-
-Filter::~Filter() {
- JNIEnv *env = AndroidRuntime::getJNIEnv();
-
- env->DeleteWeakGlobalRef(mFilterObj);
- mFilterObj = NULL;
- EventFlag::deleteEventFlag(&mFilterMQEventFlag);
-}
-
-int Filter::close() {
- Result r = mFilterSp->close();
- if (r == Result::SUCCESS) {
- EventFlag::deleteEventFlag(&mFilterMQEventFlag);
- }
- return (int)r;
-}
-
-sp<IFilter> Filter::getIFilter() {
- return mFilterSp;
+void FilterClientCallbackImpl::setFilter(jweak filterObj, sp<FilterClient> filterClient) {
+ ALOGD("FilterClientCallbackImpl::setFilter");
+ // Java Object
+ mFilterObj = filterObj;
+ mFilterClient = filterClient;
}
/////////////// TimeFilter ///////////////////////
@@ -927,22 +870,23 @@
return mTimeFilterSp;
}
-/////////////// FrontendCallback ///////////////////////
+/////////////// FrontendClientCallbackImpl ///////////////////////
-FrontendCallback::FrontendCallback(jweak tunerObj, FrontendId id) : mObject(tunerObj), mId(id) {}
+FrontendClientCallbackImpl::FrontendClientCallbackImpl(
+ jweak tunerObj, FrontendId id) : mObject(tunerObj), mId(id) {}
-Return<void> FrontendCallback::onEvent(FrontendEventType frontendEventType) {
- ALOGD("FrontendCallback::onEvent, type=%d", frontendEventType);
+void FrontendClientCallbackImpl::onEvent(FrontendEventType frontendEventType) {
+ ALOGD("FrontendClientCallbackImpl::onEvent, type=%d", frontendEventType);
JNIEnv *env = AndroidRuntime::getJNIEnv();
env->CallVoidMethod(
mObject,
gFields.onFrontendEventID,
(jint)frontendEventType);
- return Void();
}
-Return<void> FrontendCallback::onScanMessage(FrontendScanMessageType type, const FrontendScanMessage& message) {
- ALOGD("FrontendCallback::onScanMessage, type=%d", type);
+void FrontendClientCallbackImpl::onScanMessage(
+ FrontendScanMessageType type, const FrontendScanMessage& message) {
+ ALOGD("FrontendClientCallbackImpl::onScanMessage, type=%d", type);
JNIEnv *env = AndroidRuntime::getJNIEnv();
jclass clazz = env->FindClass("android/media/tv/tuner/Tuner");
switch(type) {
@@ -1050,13 +994,15 @@
mObject,
env->GetMethodID(clazz, "onDvbsStandard", "(I)V"),
standard);
- } else if (std.getDiscriminator() == FrontendScanMessage::Standard::hidl_discriminator::tStd) {
+ } else if (std.getDiscriminator() ==
+ FrontendScanMessage::Standard::hidl_discriminator::tStd) {
standard = (jint) std.tStd();
env->CallVoidMethod(
mObject,
env->GetMethodID(clazz, "onDvbtStandard", "(I)V"),
standard);
- } else if (std.getDiscriminator() == FrontendScanMessage::Standard::hidl_discriminator::sifStd) {
+ } else if (std.getDiscriminator() ==
+ FrontendScanMessage::Standard::hidl_discriminator::sifStd) {
standard = (jint) std.sifStd();
env->CallVoidMethod(
mObject,
@@ -1081,17 +1027,17 @@
}
env->CallVoidMethod(
mObject,
- env->GetMethodID(clazz, "onAtsc3PlpInfos", "([Landroid/media/tv/tuner/frontend/Atsc3PlpInfo;)V"),
+ env->GetMethodID(clazz, "onAtsc3PlpInfos",
+ "([Landroid/media/tv/tuner/frontend/Atsc3PlpInfo;)V"),
array);
break;
}
}
- return Void();
}
-Return<void> FrontendCallback::onScanMessageExt1_1(FrontendScanMessageTypeExt1_1 type,
+void FrontendClientCallbackImpl::onScanMessageExt1_1(FrontendScanMessageTypeExt1_1 type,
const FrontendScanMessageExt1_1& message) {
- ALOGD("FrontendCallback::onScanMessageExt1_1, type=%d", type);
+ ALOGD("FrontendClientCallbackImpl::onScanMessageExt1_1, type=%d", type);
JNIEnv *env = AndroidRuntime::getJNIEnv();
jclass clazz = env->FindClass("android/media/tv/tuner/Tuner");
switch(type) {
@@ -1165,7 +1111,6 @@
default:
break;
}
- return Void();
}
/////////////// Tuner ///////////////////////
@@ -1202,7 +1147,11 @@
env->DeleteWeakGlobalRef(mObject);
env->DeleteGlobalRef(mClass);
mTuner = NULL;
+ mFe = NULL;
+ mDemux = NULL;
mTunerClient = NULL;
+ mFeClient = NULL;
+ mDemuxClient = NULL;
mClass = NULL;
mObject = NULL;
}
@@ -1252,9 +1201,11 @@
return obj;
}
-jobject JTuner::openFrontendById(int id) {
+jobject JTuner::openFrontendByHandle(int feHandle) {
sp<IFrontend> fe;
Result res;
+ uint32_t id = getResourceIdFromHandle(feHandle);
+
mTuner->openFrontendById(id, [&](Result r, const sp<IFrontend>& frontend) {
fe = frontend;
res = r;
@@ -1269,11 +1220,25 @@
if (mDemux != NULL) {
mDemux->setFrontendDataSource(mFeId);
}
- sp<FrontendCallback> feCb = new FrontendCallback(mObject, id);
- fe->setCallback(feCb);
jint jId = (jint) id;
+ // TODO: Handle reopening frontend with different handle
+ sp<FrontendClient> feClient = mTunerClient->openFrontend(feHandle);
+ if (feClient == NULL) {
+ ALOGE("Failed to open frontend");
+ return NULL;
+ }
+ mFeClient = feClient;
+
+ mFeId = mFeClient->getId();
+ jId = (jint) id;
+ if (mDemuxClient != NULL) {
+ mDemuxClient->setFrontendDataSource(mFeClient);
+ }
+ sp<FrontendClientCallbackImpl> feClientCb = new FrontendClientCallbackImpl(mObject, id);
+ mFeClient->setCallback(feClientCb);
+
JNIEnv *env = AndroidRuntime::getJNIEnv();
// TODO: add more fields to frontend
return env->NewObject(
@@ -1589,30 +1554,19 @@
}
int JTuner::tune(const FrontendSettings& settings, const FrontendSettingsExt1_1& settingsExt1_1) {
- if (mFe == NULL) {
+ if (mFeClient == nullptr) {
ALOGE("frontend is not initialized");
return (int)Result::INVALID_STATE;
}
- Result result;
- sp<::android::hardware::tv::tuner::V1_1::IFrontend> fe_1_1 =
- ::android::hardware::tv::tuner::V1_1::IFrontend::castFrom(mFe);
- if (fe_1_1 == NULL) {
- ALOGD("1.1 frontend is not found. Using 1.0 instead.");
- result = mFe->tune(settings);
- return (int)result;
- }
-
- result = fe_1_1->tune_1_1(settings, settingsExt1_1);
- return (int)result;
+ return (int) mFeClient->tune(settings,settingsExt1_1);
}
int JTuner::stopTune() {
- if (mFe == NULL) {
+ if (mFeClient == nullptr) {
ALOGE("frontend is not initialized");
return (int)Result::INVALID_STATE;
}
- Result result = mFe->stopTune();
- return (int)result;
+ return (int) mFeClient->stopTune();
}
int JTuner::scan(const FrontendSettings& settings, FrontendScanType scanType,
@@ -1662,28 +1616,47 @@
}
Result JTuner::openDemux() {
- if (mTuner == nullptr) {
+ if (mTuner == nullptr || mTunerClient == nullptr) {
return Result::NOT_INITIALIZED;
}
- if (mDemux != nullptr) {
- return Result::SUCCESS;
- }
- Result res;
- uint32_t id;
- sp<IDemux> demuxSp;
- mTuner->openDemux([&](Result r, uint32_t demuxId, const sp<IDemux>& demux) {
- demuxSp = demux;
- id = demuxId;
- res = r;
- ALOGD("open demux, id = %d", demuxId);
- });
- if (res == Result::SUCCESS) {
- mDemux = demuxSp;
- mDemuxId = id;
- if (mFe != NULL) {
- mDemux->setFrontendDataSource(mFeId);
+
+ Result res = Result::SUCCESS;
+
+ if (mDemux == nullptr) {
+ uint32_t id;
+ sp<IDemux> demuxSp;
+ mTuner->openDemux([&](Result r, uint32_t demuxId, const sp<IDemux>& demux) {
+ demuxSp = demux;
+ id = demuxId;
+ res = r;
+ ALOGD("open demux, id = %d", demuxId);
+ });
+ if (res == Result::SUCCESS) {
+ mDemux = demuxSp;
+ mDemuxId = id;
+ if (mFe != NULL) {
+ mDemux->setFrontendDataSource(mFeId);
+ }
+ } else {
+ return res;
}
}
+
+ // TODO: replace demux opening with mTunerClient->openDemux(handle)
+ // when DemuxClient is fully ready
+ if (mDemuxClient == nullptr) {
+ sp<DemuxClient> demuxClient = new DemuxClient();
+ if (demuxClient == NULL) {
+ ALOGE("Failed to open demux");
+ return Result::UNKNOWN_ERROR;
+ }
+ mDemuxClient = demuxClient;
+ mDemuxClient->setHidlDemux(mDemux);
+ if (mFeClient != NULL) {
+ mDemuxClient->setFrontendDataSource(mFeClient);
+ }
+ }
+
return res;
}
@@ -1701,23 +1674,31 @@
return (jint) res;
}
}
+
+ if (mFeClient != NULL) {
+ res = mFeClient->close();
+ if (res != Result::SUCCESS) {
+ return (jint) res;
+ }
+ mFeClient = NULL;
+ }
+ if (mDemuxClient != NULL) {
+ res = mDemuxClient->close();
+ if (res != Result::SUCCESS) {
+ return (jint) res;
+ }
+ mDemuxClient = NULL;
+ }
return (jint) res;
}
-jobject JTuner::getAvSyncHwId(sp<Filter> filter) {
- if (mDemux == NULL) {
+jobject JTuner::getAvSyncHwId(sp<FilterClient> filterClient) {
+ if (mDemuxClient == NULL) {
return NULL;
}
- uint32_t avSyncHwId;
- Result res;
- sp<IFilter> iFilterSp = filter->getIFilter();
- mDemux->getAvSyncHwId(iFilterSp,
- [&](Result r, uint32_t id) {
- res = r;
- avSyncHwId = id;
- });
- if (res == Result::SUCCESS) {
+ int avSyncHwId = mDemuxClient->getAvSyncHwId(filterClient);
+ if (avSyncHwId >= 0) {
JNIEnv *env = AndroidRuntime::getJNIEnv();
jclass integerClazz = env->FindClass("java/lang/Integer");
jmethodID intInit = env->GetMethodID(integerClazz, "<init>", "(I)V");
@@ -1727,17 +1708,11 @@
}
jobject JTuner::getAvSyncTime(jint id) {
- if (mDemux == NULL) {
+ if (mDemuxClient == NULL) {
return NULL;
}
- uint64_t time;
- Result res;
- mDemux->getAvSyncTime(static_cast<uint32_t>(id),
- [&](Result r, uint64_t ts) {
- res = r;
- time = ts;
- });
- if (res == Result::SUCCESS) {
+ long time = mDemuxClient->getAvSyncTime((int)id);
+ if (time >= 0) {
JNIEnv *env = AndroidRuntime::getJNIEnv();
jclass longClazz = env->FindClass("java/lang/Long");
jmethodID longInit = env->GetMethodID(longClazz, "<init>", "(J)V");
@@ -1747,13 +1722,13 @@
}
int JTuner::connectCiCam(jint id) {
- if (mDemux == NULL) {
+ if (mDemuxClient == NULL) {
Result r = openDemux();
if (r != Result::SUCCESS) {
return (int) r;
}
}
- Result r = mDemux->connectCiCam(static_cast<uint32_t>(id));
+ Result r = mDemuxClient->connectCiCam((int)id);
return (int) r;
}
@@ -1779,13 +1754,13 @@
}
int JTuner::disconnectCiCam() {
- if (mDemux == NULL) {
+ if (mDemuxClient == NULL) {
Result r = openDemux();
if (r != Result::SUCCESS) {
return (int) r;
}
}
- Result r = mDemux->disconnectCiCam();
+ Result r = mDemuxClient->disconnectCiCam();
return (int) r;
}
@@ -1832,34 +1807,23 @@
}
jobject JTuner::openFilter(DemuxFilterType type, int bufferSize) {
- if (mDemux == NULL) {
- if (openDemux() != Result::SUCCESS) {
- return NULL;
- }
+ if (mDemux == NULL || mDemuxClient == NULL) {
+ return NULL;
}
- sp<IFilter> iFilterSp;
- sp<::android::hardware::tv::tuner::V1_1::IFilter> iFilterSp_1_1;
- sp<FilterCallback> callback = new FilterCallback();
- Result res;
- mDemux->openFilter(type, bufferSize, callback,
- [&](Result r, const sp<IFilter>& filter) {
- iFilterSp = filter;
- res = r;
- });
- if (res != Result::SUCCESS || iFilterSp == NULL) {
+ sp<FilterClient> filterClient;
+ sp<FilterClientCallbackImpl> callback = new FilterClientCallbackImpl();
+ filterClient = mDemuxClient->openFilter(type, bufferSize, callback);
+ if (filterClient == NULL) {
ALOGD("Failed to open filter, type = %d", type.mainType);
return NULL;
}
uint64_t fId;
- iFilterSp->getId([&](Result, uint32_t filterId) {
- fId = filterId;
- });
- iFilterSp_1_1 = ::android::hardware::tv::tuner::V1_1::IFilter::castFrom(iFilterSp);
- if (iFilterSp_1_1 != NULL) {
- iFilterSp_1_1->getId64Bit([&](Result, uint64_t filterId64Bit) {
- fId = filterId64Bit;
- });
+ Result res = filterClient->getId64Bit(fId);
+ if (res != Result::SUCCESS) {
+ uint32_t id;
+ filterClient->getId(id);
+ fId = static_cast<uint64_t>(id);
}
JNIEnv *env = AndroidRuntime::getJNIEnv();
@@ -1869,35 +1833,9 @@
gFields.filterInitID,
(jlong) fId);
- sp<Filter> filterSp = new Filter(iFilterSp, filterObj);
- filterSp->incStrong(filterObj);
- env->SetLongField(filterObj, gFields.filterContext, (jlong)filterSp.get());
- filterSp->mIsMediaFilter = false;
- filterSp->mAvSharedHandle = NULL;
- callback->setFilter(filterSp);
-
- if (type.mainType == DemuxFilterMainType::MMTP) {
- if (type.subType.mmtpFilterType() == DemuxMmtpFilterType::AUDIO ||
- type.subType.mmtpFilterType() == DemuxMmtpFilterType::VIDEO) {
- filterSp->mIsMediaFilter = true;
- }
- }
-
- if (type.mainType == DemuxFilterMainType::TS) {
- if (type.subType.tsFilterType() == DemuxTsFilterType::AUDIO ||
- type.subType.tsFilterType() == DemuxTsFilterType::VIDEO) {
- filterSp->mIsMediaFilter = true;
- }
- }
-
- if (iFilterSp_1_1 != NULL && filterSp->mIsMediaFilter) {
- iFilterSp_1_1->getAvSharedHandle([&](Result r, hidl_handle avMemory, uint64_t avMemSize) {
- if (r == Result::SUCCESS) {
- filterSp->mAvSharedHandle = native_handle_clone(avMemory.getNativeHandle());
- filterSp->mAvSharedMemSize = avMemSize;
- }
- });
- }
+ filterClient->incStrong(filterObj);
+ env->SetLongField(filterObj, gFields.filterContext, (jlong)filterClient.get());
+ callback->setFilter(env->NewWeakGlobalRef(filterObj), filterClient);
return filterObj;
}
@@ -1934,21 +1872,14 @@
jobject JTuner::openDvr(DvrType type, jlong bufferSize) {
ALOGD("JTuner::openDvr");
- if (mDemux == NULL) {
- if (openDemux() != Result::SUCCESS) {
- return NULL;
- }
+ if (mDemuxClient == NULL) {
+ return NULL;
}
- sp<IDvr> iDvrSp;
- sp<DvrCallback> callback = new DvrCallback();
- Result res;
- mDemux->openDvr(type, (uint32_t) bufferSize, callback,
- [&](Result r, const sp<IDvr>& dvr) {
- res = r;
- iDvrSp = dvr;
- });
+ sp<DvrClient> dvrClient;
+ sp<DvrClientCallbackImpl> callback = new DvrClientCallbackImpl();
+ dvrClient = mDemuxClient->openDvr(type, (int) bufferSize, callback);
- if (res != Result::SUCCESS || iDvrSp == NULL) {
+ if (dvrClient == NULL) {
return NULL;
}
@@ -1960,21 +1891,19 @@
env->FindClass("android/media/tv/tuner/dvr/DvrRecorder"),
gFields.dvrRecorderInitID,
mObject);
- sp<Dvr> dvrSp = new Dvr(iDvrSp, dvrObj);
- dvrSp->incStrong(dvrObj);
- env->SetLongField(dvrObj, gFields.dvrRecorderContext, (jlong)dvrSp.get());
+ dvrClient->incStrong(dvrObj);
+ env->SetLongField(dvrObj, gFields.dvrRecorderContext, (jlong)dvrClient.get());
} else {
dvrObj =
env->NewObject(
env->FindClass("android/media/tv/tuner/dvr/DvrPlayback"),
gFields.dvrPlaybackInitID,
mObject);
- sp<Dvr> dvrSp = new Dvr(iDvrSp, dvrObj);
- dvrSp->incStrong(dvrObj);
- env->SetLongField(dvrObj, gFields.dvrPlaybackContext, (jlong)dvrSp.get());
+ dvrClient->incStrong(dvrObj);
+ env->SetLongField(dvrObj, gFields.dvrPlaybackContext, (jlong)dvrClient.get());
}
- callback->setDvr(dvrObj);
+ callback->setDvr(env->NewWeakGlobalRef(dvrObj));
return dvrObj;
}
@@ -2616,6 +2545,15 @@
if (r == Result::SUCCESS) {
mFe = NULL;
mFe_1_1 = NULL;
+ } else {
+ return (jint) r;
+ }
+
+ if (mFeClient != NULL) {
+ r = mFeClient->close();
+ }
+ if (r == Result::SUCCESS) {
+ mFeClient = NULL;
}
return (jint) r;
}
@@ -2627,10 +2565,18 @@
}
if (r == Result::SUCCESS) {
mDemux = NULL;
+ } else {
+ return (jint) r;
+ }
+
+ if (mDemuxClient != NULL) {
+ r = mDemuxClient->close();
+ }
+ if (r == Result::SUCCESS) {
+ mDemuxClient = NULL;
}
return (jint) r;
}
-
} // namespace android
////////////////////////////////////////////////////////////////////////////////
@@ -3271,8 +3217,8 @@
return settingsExt1_1;
}
-static sp<Filter> getFilter(JNIEnv *env, jobject filter) {
- return (Filter *)env->GetLongField(filter, gFields.filterContext);
+static sp<FilterClient> getFilterClient(JNIEnv *env, jobject filter) {
+ return (FilterClient *)env->GetLongField(filter, gFields.filterContext);
}
static DvrSettings getDvrSettings(JNIEnv *env, jobject settings, bool isRecorder) {
@@ -3315,12 +3261,12 @@
return dvrSettings;
}
-static sp<Dvr> getDvr(JNIEnv *env, jobject dvr) {
+static sp<DvrClient> getDvrClient(JNIEnv *env, jobject dvr) {
bool isRecorder =
env->IsInstanceOf(dvr, env->FindClass("android/media/tv/tuner/dvr/DvrRecorder"));
jfieldID fieldId =
isRecorder ? gFields.dvrRecorderContext : gFields.dvrPlaybackContext;
- return (Dvr *)env->GetLongField(dvr, fieldId);
+ return (DvrClient *)env->GetLongField(dvr, fieldId);
}
static void android_media_tv_Tuner_native_init(JNIEnv *env) {
@@ -3383,7 +3329,7 @@
static void android_media_tv_Tuner_native_setup(JNIEnv *env, jobject thiz) {
sp<JTuner> tuner = new JTuner(env, thiz);
- setTuner(env,thiz, tuner);
+ setTuner(env, thiz, tuner);
}
static jint android_media_tv_Tuner_native_get_tuner_version(JNIEnv *env, jobject thiz) {
@@ -3399,8 +3345,7 @@
static jobject android_media_tv_Tuner_open_frontend_by_handle(
JNIEnv *env, jobject thiz, jint handle) {
sp<JTuner> tuner = getTuner(env, thiz);
- uint32_t id = getResourceIdFromHandle(handle);
- return tuner->openFrontendById(id);
+ return tuner->openFrontendByHandle(handle);
}
static int android_media_tv_Tuner_tune(JNIEnv *env, jobject thiz, jint type, jobject settings) {
@@ -3446,13 +3391,13 @@
static jobject android_media_tv_Tuner_get_av_sync_hw_id(
JNIEnv *env, jobject thiz, jobject filter) {
- sp<Filter> filterSp = getFilter(env, filter);
- if (filterSp == NULL) {
- ALOGD("Failed to get sync ID. Filter not found");
+ sp<FilterClient> filterClient = getFilterClient(env, filter);
+ if (filterClient == NULL) {
+ ALOGD("Failed to get sync ID. Filter client not found");
return NULL;
}
sp<JTuner> tuner = getTuner(env, thiz);
- return tuner->getAvSyncHwId(filterSp);
+ return tuner->getAvSyncHwId(filterClient);
}
static jobject android_media_tv_Tuner_get_av_sync_time(JNIEnv *env, jobject thiz, jint id) {
@@ -3913,53 +3858,13 @@
}
static Result configureIpFilterContextId(
- JNIEnv *env, sp<IFilter> iFilterSp, jobject ipFilterConfigObj) {
+ JNIEnv *env, sp<FilterClient> filterClient, jobject ipFilterConfigObj) {
jclass clazz = env->FindClass(
"android/media/tv/tuner/filter/IpFilterConfiguration");
uint32_t cid = env->GetIntField(ipFilterConfigObj, env->GetFieldID(
clazz, "mIpFilterContextId", "I"));
- Result res = Result::SUCCESS;
- if (cid != static_cast<uint32_t>(Constant::INVALID_IP_FILTER_CONTEXT_ID)) {
- sp<::android::hardware::tv::tuner::V1_1::IFilter> iFilterSp_1_1;
- iFilterSp_1_1 = ::android::hardware::tv::tuner::V1_1::IFilter::castFrom(iFilterSp);
- if (iFilterSp_1_1 != NULL) {
- res = iFilterSp_1_1->configureIpCid(cid);
- if (res != Result::SUCCESS) {
- return res;
- }
- } else {
- ALOGW("configureIpCid is not supported with the current HAL implementation.");
- }
- }
- return res;
-}
-
-static jint copyData(JNIEnv *env, std::unique_ptr<MQ>& mq, EventFlag* flag, jbyteArray buffer,
- jlong offset, jlong size) {
- ALOGD("copyData, size=%ld, offset=%ld", (long) size, (long) offset);
-
- jlong available = mq->availableToRead();
- ALOGD("copyData, available=%ld", (long) available);
- size = std::min(size, available);
-
- jboolean isCopy;
- jbyte *dst = env->GetByteArrayElements(buffer, &isCopy);
- ALOGD("copyData, isCopy=%d", isCopy);
- if (dst == nullptr) {
- jniThrowRuntimeException(env, "Failed to GetByteArrayElements");
- return 0;
- }
-
- if (mq->read(reinterpret_cast<unsigned char*>(dst) + offset, size)) {
- env->ReleaseByteArrayElements(buffer, dst, 0);
- flag->wake(static_cast<uint32_t>(DemuxQueueNotifyBits::DATA_CONSUMED));
- } else {
- jniThrowRuntimeException(env, "Failed to read FMQ");
- env->ReleaseByteArrayElements(buffer, dst, 0);
- return 0;
- }
- return size;
+ return filterClient->configureIpFilterContextId(cid);
}
static bool isAvFilterSettings(DemuxFilterSettings filterSettings) {
@@ -3975,21 +3880,20 @@
static jint android_media_tv_Tuner_configure_filter(
JNIEnv *env, jobject filter, int type, int subtype, jobject settings) {
ALOGD("configure filter type=%d, subtype=%d", type, subtype);
- sp<Filter> filterSp = getFilter(env, filter);
- sp<IFilter> iFilterSp = filterSp->getIFilter();
- if (iFilterSp == NULL) {
+ sp<FilterClient> filterClient = getFilterClient(env, filter);
+ if (filterClient == NULL) {
ALOGD("Failed to configure filter: filter not found");
return (jint) Result::NOT_INITIALIZED;
}
DemuxFilterSettings filterSettings = getFilterConfiguration(env, type, subtype, settings);
- Result res = iFilterSp->configure(filterSettings);
+ Result res = filterClient->configure(filterSettings);
if (res != Result::SUCCESS) {
return (jint) res;
}
if (static_cast<DemuxFilterMainType>(type) == DemuxFilterMainType::IP) {
- res = configureIpFilterContextId(env, iFilterSp, settings);
+ res = configureIpFilterContextId(env, filterClient, settings);
if (res != Result::SUCCESS) {
return (jint) res;
}
@@ -3997,49 +3901,19 @@
AvStreamType streamType;
if (isAvFilterSettings(filterSettings) && getAvStreamType(env, settings, streamType)) {
- sp<::android::hardware::tv::tuner::V1_1::IFilter> iFilterSp_1_1;
- iFilterSp_1_1 = ::android::hardware::tv::tuner::V1_1::IFilter::castFrom(iFilterSp);
- if (iFilterSp_1_1 != NULL) {
- res = iFilterSp_1_1->configureAvStreamType(streamType);
- } else {
- ALOGW("configureAvStreamType is not supported with the current HAL implementation.");
- }
- if (res != Result::SUCCESS) {
- return (jint) res;
- }
+ res = filterClient->configureAvStreamType(streamType);
}
-
- MQDescriptorSync<uint8_t> filterMQDesc;
- Result getQueueDescResult = Result::UNKNOWN_ERROR;
- if (filterSp->mFilterMQ == NULL) {
- iFilterSp->getQueueDesc(
- [&](Result r, const MQDescriptorSync<uint8_t>& desc) {
- filterMQDesc = desc;
- getQueueDescResult = r;
- ALOGD("getFilterQueueDesc");
- });
- if (getQueueDescResult == Result::SUCCESS) {
- filterSp->mFilterMQ = std::make_unique<MQ>(filterMQDesc, true);
- EventFlag::createEventFlag(
- filterSp->mFilterMQ->getEventFlagWord(), &(filterSp->mFilterMQEventFlag));
- }
- }
- return (jint) getQueueDescResult;
+ return (jint) res;
}
static jint android_media_tv_Tuner_get_filter_id(JNIEnv* env, jobject filter) {
- sp<IFilter> iFilterSp = getFilter(env, filter)->getIFilter();
- if (iFilterSp == NULL) {
- ALOGD("Failed to get filter ID: filter not found");
+ sp<FilterClient> filterClient = getFilterClient(env, filter);
+ if (filterClient == NULL) {
+ ALOGD("Failed to get filter ID: filter client not found");
return (int) Result::NOT_INITIALIZED;
}
- Result res;
uint32_t id;
- iFilterSp->getId(
- [&](Result r, uint32_t filterId) {
- res = r;
- id = filterId;
- });
+ Result res = filterClient->getId(id);
if (res != Result::SUCCESS) {
return (jint) Constant::INVALID_FILTER_ID;
}
@@ -4047,30 +3921,13 @@
}
static jlong android_media_tv_Tuner_get_filter_64bit_id(JNIEnv* env, jobject filter) {
- sp<IFilter> iFilterSp = getFilter(env, filter)->getIFilter();
- if (iFilterSp == NULL) {
- ALOGD("Failed to get filter ID: filter not found");
- return static_cast<jlong>(
- ::android::hardware::tv::tuner::V1_1::Constant64Bit::INVALID_FILTER_ID_64BIT);
+ sp<FilterClient> filterClient = getFilterClient(env, filter);
+ if (filterClient == NULL) {
+ ALOGD("Failed to get filter ID 64 bit: filter client not found");
+ return (int) Result::NOT_INITIALIZED;
}
-
- sp<::android::hardware::tv::tuner::V1_1::IFilter> iFilterSp_1_1;
- iFilterSp_1_1 = ::android::hardware::tv::tuner::V1_1::IFilter::castFrom(iFilterSp);
- Result res;
uint64_t id;
-
- if (iFilterSp_1_1 != NULL) {
- iFilterSp_1_1->getId64Bit(
- [&](Result r, uint64_t filterId64Bit) {
- res = r;
- id = filterId64Bit;
- });
- } else {
- ALOGW("getId64Bit is not supported with the current HAL implementation.");
- return static_cast<jlong>(
- ::android::hardware::tv::tuner::V1_1::Constant64Bit::INVALID_FILTER_ID_64BIT);
- }
-
+ Result res = filterClient->getId64Bit(id);
return (res == Result::SUCCESS) ?
static_cast<jlong>(id) : static_cast<jlong>(
::android::hardware::tv::tuner::V1_1::Constant64Bit::INVALID_FILTER_ID_64BIT);
@@ -4078,96 +3935,93 @@
static jint android_media_tv_Tuner_configure_monitor_event(
JNIEnv* env, jobject filter, int monitorEventType) {
- sp<IFilter> iFilterSp = getFilter(env, filter)->getIFilter();
- if (iFilterSp == NULL) {
- ALOGD("Failed to configure scrambling event: filter not found");
- return (jint) Result::NOT_INITIALIZED;
+ sp<FilterClient> filterClient = getFilterClient(env, filter);
+ if (filterClient == NULL) {
+ ALOGD("Failed to configure scrambling event: filter client not found");
+ return (int) Result::NOT_INITIALIZED;
}
-
- sp<::android::hardware::tv::tuner::V1_1::IFilter> iFilterSp_1_1;
- iFilterSp_1_1 = ::android::hardware::tv::tuner::V1_1::IFilter::castFrom(iFilterSp);
- Result res;
-
- if (iFilterSp_1_1 != NULL) {
- res = iFilterSp_1_1->configureMonitorEvent(monitorEventType);
- } else {
- ALOGW("configureScramblingEvent is not supported with the current HAL implementation.");
- return (jint) Result::INVALID_STATE;
- }
-
+ Result res = filterClient->configureMonitorEvent(monitorEventType);
return (jint) res;
}
static jint android_media_tv_Tuner_set_filter_data_source(
JNIEnv* env, jobject filter, jobject srcFilter) {
- sp<IFilter> iFilterSp = getFilter(env, filter)->getIFilter();
- if (iFilterSp == NULL) {
- ALOGD("Failed to set filter data source: filter not found");
- return (jint) Result::NOT_INITIALIZED;
+ sp<FilterClient> filterClient = getFilterClient(env, filter);
+ if (filterClient == NULL) {
+ ALOGD("Failed to set filter data source: filter client not found");
+ return (int) Result::NOT_INITIALIZED;
}
- Result r;
+ Result res;
if (srcFilter == NULL) {
- r = iFilterSp->setDataSource(NULL);
+ res = filterClient->setDataSource(NULL);
} else {
- sp<IFilter> srcSp = getFilter(env, srcFilter)->getIFilter();
- if (iFilterSp == NULL) {
+ sp<FilterClient> srcClient = getFilterClient(env, srcFilter);
+ if (srcClient == NULL) {
ALOGD("Failed to set filter data source: src filter not found");
return (jint) Result::INVALID_ARGUMENT;
}
- r = iFilterSp->setDataSource(srcSp);
+ res = filterClient->setDataSource(srcClient);
}
- return (jint) r;
+ return (jint) res;
}
static jint android_media_tv_Tuner_start_filter(JNIEnv *env, jobject filter) {
- sp<IFilter> iFilterSp = getFilter(env, filter)->getIFilter();
- if (iFilterSp == NULL) {
- ALOGD("Failed to start filter: filter not found");
- return (jint) Result::NOT_INITIALIZED;
+ sp<FilterClient> filterClient = getFilterClient(env, filter);
+ if (filterClient == NULL) {
+ ALOGD("Failed to start filter: filter client not found");
+ return (int) Result::NOT_INITIALIZED;
}
- Result r = iFilterSp->start();
- return (jint) r;
+ return (jint) filterClient->start();
}
static jint android_media_tv_Tuner_stop_filter(JNIEnv *env, jobject filter) {
- sp<IFilter> iFilterSp = getFilter(env, filter)->getIFilter();
- if (iFilterSp == NULL) {
- ALOGD("Failed to stop filter: filter not found");
- return (jint) Result::NOT_INITIALIZED;
+ sp<FilterClient> filterClient = getFilterClient(env, filter);
+ if (filterClient == NULL) {
+ ALOGD("Failed to stop filter: filter client not found");
+ return (int) Result::NOT_INITIALIZED;
}
- Result r = iFilterSp->stop();
- return (jint) r;
+ return (jint) filterClient->stop();
}
static jint android_media_tv_Tuner_flush_filter(JNIEnv *env, jobject filter) {
- sp<IFilter> iFilterSp = getFilter(env, filter)->getIFilter();
- if (iFilterSp == NULL) {
- ALOGD("Failed to flush filter: filter not found");
- return (jint) Result::NOT_INITIALIZED;
+ sp<FilterClient> filterClient = getFilterClient(env, filter);
+ if (filterClient == NULL) {
+ ALOGD("Failed to flush filter: filter client not found");
+ return (int) Result::NOT_INITIALIZED;
}
- Result r = iFilterSp->flush();
- return (jint) r;
+ return (jint) filterClient->flush();
}
static jint android_media_tv_Tuner_read_filter_fmq(
JNIEnv *env, jobject filter, jbyteArray buffer, jlong offset, jlong size) {
- sp<Filter> filterSp = getFilter(env, filter);
- if (filterSp == NULL) {
+ sp<FilterClient> filterClient = getFilterClient(env, filter);
+ if (filterClient == NULL) {
jniThrowException(env, "java/lang/IllegalStateException",
- "Failed to read filter FMQ: filter not found");
- return 0;
+ "Failed to read filter FMQ: filter client not found");
+ return -1;
}
- return copyData(env, filterSp->mFilterMQ, filterSp->mFilterMQEventFlag, buffer, offset, size);
+
+ jboolean isCopy;
+ jbyte *dst = env->GetByteArrayElements(buffer, &isCopy);
+ ALOGD("copyData, isCopy=%d", isCopy);
+ if (dst == nullptr) {
+ jniThrowRuntimeException(env, "Failed to GetByteArrayElements");
+ return -1;
+ }
+ int realReadSize = filterClient->read(reinterpret_cast<uint8_t*>(dst) + offset, size);
+ env->ReleaseByteArrayElements(buffer, dst, 0);
+ return (jint) realReadSize;
}
static jint android_media_tv_Tuner_close_filter(JNIEnv *env, jobject filter) {
- sp<IFilter> iFilterSp = getFilter(env, filter)->getIFilter();
- if (iFilterSp == NULL) {
- ALOGD("Failed to close filter: filter not found");
- return (jint) Result::NOT_INITIALIZED;
+ sp<FilterClient> filterClient = getFilterClient(env, filter);
+ if (filterClient == NULL) {
+ jniThrowException(env, "java/lang/IllegalStateException",
+ "Failed to close filter: filter client not found");
+ return 0;
}
- Result r = iFilterSp->close();
- return (jint) r;
+
+ return (jint) filterClient->close();
}
static sp<TimeFilter> getTimeFilter(JNIEnv *env, jobject filter) {
@@ -4275,7 +4129,8 @@
if (descramblerSp == NULL) {
return (jint) Result::NOT_INITIALIZED;
}
- sp<IFilter> iFilterSp = getFilter(env, filter)->getIFilter();
+ // TODO: use filter client once descramblerClient is ready
+ sp<IFilter> iFilterSp = getFilterClient(env, filter)->getHalFilter();
Result result = descramblerSp->addPid(getDemuxPid((int)pidType, (int)pid), iFilterSp);
return (jint) result;
}
@@ -4286,7 +4141,8 @@
if (descramblerSp == NULL) {
return (jint) Result::NOT_INITIALIZED;
}
- sp<IFilter> iFilterSp = getFilter(env, filter)->getIFilter();
+ // TODO: use filter client once descramblerClient is ready
+ sp<IFilter> iFilterSp = getFilterClient(env, filter)->getHalFilter();
Result result = descramblerSp->removePid(getDemuxPid((int)pidType, (int)pid), iFilterSp);
return (jint) result;
}
@@ -4354,104 +4210,80 @@
}
static jint android_media_tv_Tuner_attach_filter(JNIEnv *env, jobject dvr, jobject filter) {
- sp<Dvr> dvrSp = getDvr(env, dvr);
- if (dvrSp == NULL) {
- return (jint) Result::NOT_INITIALIZED;
- }
- sp<Filter> filterSp = getFilter(env, filter);
- if (filterSp == NULL) {
+ sp<FilterClient> filterClient = getFilterClient(env, filter);
+ if (filterClient == NULL) {
return (jint) Result::INVALID_ARGUMENT;
}
- sp<IDvr> iDvrSp = dvrSp->getIDvr();
- sp<IFilter> iFilterSp = filterSp->getIFilter();
- Result result = iDvrSp->attachFilter(iFilterSp);
+ sp<DvrClient> dvrClient = getDvrClient(env, dvr);
+ if (dvrClient == NULL) {
+ return (jint) Result::NOT_INITIALIZED;
+ }
+ Result result = dvrClient->attachFilter(filterClient);
return (jint) result;
}
static jint android_media_tv_Tuner_detach_filter(JNIEnv *env, jobject dvr, jobject filter) {
- sp<Dvr> dvrSp = getDvr(env, dvr);
- if (dvrSp == NULL) {
- return (jint) Result::NOT_INITIALIZED;
- }
- sp<Filter> filterSp = getFilter(env, filter);
- if (filterSp == NULL) {
+ sp<FilterClient> filterClient = getFilterClient(env, filter);
+ if (filterClient == NULL) {
return (jint) Result::INVALID_ARGUMENT;
}
- sp<IDvr> iDvrSp = dvrSp->getIDvr();
- sp<IFilter> iFilterSp = filterSp->getIFilter();
- Result result = iDvrSp->detachFilter(iFilterSp);
+ sp<DvrClient> dvrClient = getDvrClient(env, dvr);
+ if (dvrClient == NULL) {
+ return (jint) Result::NOT_INITIALIZED;
+ }
+ Result result = dvrClient->detachFilter(filterClient);
return (jint) result;
}
static jint android_media_tv_Tuner_configure_dvr(JNIEnv *env, jobject dvr, jobject settings) {
- sp<Dvr> dvrSp = getDvr(env, dvr);
- if (dvrSp == NULL) {
- ALOGD("Failed to configure dvr: dvr not found");
+ sp<DvrClient> dvrClient = getDvrClient(env, dvr);
+ if (dvrClient == NULL) {
+ ALOGD("Failed to configure dvr: dvr client not found");
return (int)Result::NOT_INITIALIZED;
}
- sp<IDvr> iDvrSp = dvrSp->getIDvr();
bool isRecorder =
env->IsInstanceOf(dvr, env->FindClass("android/media/tv/tuner/dvr/DvrRecorder"));
- Result result = iDvrSp->configure(getDvrSettings(env, settings, isRecorder));
- if (result != Result::SUCCESS) {
- return (jint) result;
- }
- MQDescriptorSync<uint8_t> dvrMQDesc;
- Result getQueueDescResult = Result::UNKNOWN_ERROR;
- iDvrSp->getQueueDesc(
- [&](Result r, const MQDescriptorSync<uint8_t>& desc) {
- dvrMQDesc = desc;
- getQueueDescResult = r;
- ALOGD("getDvrQueueDesc");
- });
- if (getQueueDescResult == Result::SUCCESS) {
- dvrSp->mDvrMQ = std::make_unique<MQ>(dvrMQDesc, true);
- EventFlag::createEventFlag(
- dvrSp->mDvrMQ->getEventFlagWord(), &(dvrSp->mDvrMQEventFlag));
- }
- return (jint) getQueueDescResult;
+ Result result = dvrClient->configure(getDvrSettings(env, settings, isRecorder));
+ return (jint) result;
}
static jint android_media_tv_Tuner_start_dvr(JNIEnv *env, jobject dvr) {
- sp<Dvr> dvrSp = getDvr(env, dvr);
- if (dvrSp == NULL) {
- ALOGD("Failed to start dvr: dvr not found");
+ sp<DvrClient> dvrClient = getDvrClient(env, dvr);
+ if (dvrClient == NULL) {
+ ALOGD("Failed to start dvr: dvr client not found");
return (jint) Result::NOT_INITIALIZED;
}
- sp<IDvr> iDvrSp = dvrSp->getIDvr();
- Result result = iDvrSp->start();
+ Result result = dvrClient->start();
return (jint) result;
}
static jint android_media_tv_Tuner_stop_dvr(JNIEnv *env, jobject dvr) {
- sp<Dvr> dvrSp = getDvr(env, dvr);
- if (dvrSp == NULL) {
- ALOGD("Failed to stop dvr: dvr not found");
+ sp<DvrClient> dvrClient = getDvrClient(env, dvr);
+ if (dvrClient == NULL) {
+ ALOGD("Failed to stop dvr: dvr client not found");
return (jint) Result::NOT_INITIALIZED;
}
- sp<IDvr> iDvrSp = dvrSp->getIDvr();
- Result result = iDvrSp->stop();
+ Result result = dvrClient->stop();
return (jint) result;
}
static jint android_media_tv_Tuner_flush_dvr(JNIEnv *env, jobject dvr) {
- sp<Dvr> dvrSp = getDvr(env, dvr);
- if (dvrSp == NULL) {
- ALOGD("Failed to flush dvr: dvr not found");
+ sp<DvrClient> dvrClient = getDvrClient(env, dvr);
+ if (dvrClient == NULL) {
+ ALOGD("Failed to flush dvr: dvr client not found");
return (jint) Result::NOT_INITIALIZED;
}
- sp<IDvr> iDvrSp = dvrSp->getIDvr();
- Result result = iDvrSp->flush();
+ Result result = dvrClient->flush();
return (jint) result;
}
static jint android_media_tv_Tuner_close_dvr(JNIEnv* env, jobject dvr) {
- sp<Dvr> dvrSp = getDvr(env, dvr);
- if (dvrSp == NULL) {
- ALOGD("Failed to close dvr: dvr not found");
+ sp<DvrClient> dvrClient = getDvrClient(env, dvr);
+ if (dvrClient == NULL) {
+ ALOGD("Failed to close dvr: dvr client not found");
return (jint) Result::NOT_INITIALIZED;
}
- return dvrSp->close();
+ return (jint) dvrClient->close();
}
static sp<Lnb> getLnb(JNIEnv *env, jobject lnb) {
@@ -4496,170 +4328,76 @@
}
static void android_media_tv_Tuner_dvr_set_fd(JNIEnv *env, jobject dvr, jint fd) {
- sp<Dvr> dvrSp = getDvr(env, dvr);
- if (dvrSp == NULL) {
- ALOGD("Failed to set FD for dvr: dvr not found");
+ sp<DvrClient> dvrClient = getDvrClient(env, dvr);
+ if (dvrClient == NULL) {
+ ALOGD("Failed to set FD for dvr: dvr client not found");
+ return;
}
- dvrSp->mFd = (int) fd;
- ALOGD("set fd = %d", dvrSp->mFd);
+ dvrClient->setFd((int)fd);
+ ALOGD("set fd = %d", fd);
}
static jlong android_media_tv_Tuner_read_dvr(JNIEnv *env, jobject dvr, jlong size) {
- sp<Dvr> dvrSp = getDvr(env, dvr);
- if (dvrSp == NULL) {
+ sp<DvrClient> dvrClient = getDvrClient(env, dvr);
+ if (dvrClient == NULL) {
jniThrowException(env, "java/lang/IllegalStateException",
- "Failed to read dvr: dvr not found");
- return 0;
+ "Failed to read dvr: dvr client not found");
+ return -1;
}
- long available = dvrSp->mDvrMQ->availableToWrite();
- long write = std::min((long) size, available);
-
- MQ::MemTransaction tx;
- long ret = 0;
- if (dvrSp->mDvrMQ->beginWrite(write, &tx)) {
- auto first = tx.getFirstRegion();
- auto data = first.getAddress();
- long length = first.getLength();
- long firstToWrite = std::min(length, write);
- ret = read(dvrSp->mFd, data, firstToWrite);
-
- if (ret < 0) {
- ALOGE("[DVR] Failed to read from FD: %s", strerror(errno));
- jniThrowRuntimeException(env, strerror(errno));
- return 0;
- }
- if (ret < firstToWrite) {
- ALOGW("[DVR] file to MQ, first region: %ld bytes to write, but %ld bytes written",
- firstToWrite, ret);
- } else if (firstToWrite < write) {
- ALOGD("[DVR] write second region: %ld bytes written, %ld bytes in total", ret, write);
- auto second = tx.getSecondRegion();
- data = second.getAddress();
- length = second.getLength();
- int secondToWrite = std::min(length, write - firstToWrite);
- ret += read(dvrSp->mFd, data, secondToWrite);
- }
- ALOGD("[DVR] file to MQ: %ld bytes need to be written, %ld bytes written", write, ret);
- if (!dvrSp->mDvrMQ->commitWrite(ret)) {
- ALOGE("[DVR] Error: failed to commit write!");
- return 0;
- }
-
- } else {
- ALOGE("dvrMq.beginWrite failed");
- }
-
- if (ret > 0) {
- dvrSp->mDvrMQEventFlag->wake(static_cast<uint32_t>(DemuxQueueNotifyBits::DATA_READY));
- }
- return (jlong) ret;
+ return (jlong) dvrClient->readFromFile(size);
}
static jlong android_media_tv_Tuner_read_dvr_from_array(
JNIEnv* env, jobject dvr, jbyteArray buffer, jlong offset, jlong size) {
- sp<Dvr> dvrSp = getDvr(env, dvr);
- if (dvrSp == NULL) {
- ALOGW("Failed to read dvr: dvr not found");
- return 0;
+ sp<DvrClient> dvrClient = getDvrClient(env, dvr);
+ if (dvrClient == NULL) {
+ ALOGW("Failed to read dvr: dvr client not found");
+ return -1;
}
- if (dvrSp->mDvrMQ == NULL) {
- ALOGW("Failed to read dvr: dvr not configured");
- return 0;
- }
-
- jlong available = dvrSp->mDvrMQ->availableToWrite();
- size = std::min(size, available);
jboolean isCopy;
jbyte *src = env->GetByteArrayElements(buffer, &isCopy);
if (src == nullptr) {
ALOGD("Failed to GetByteArrayElements");
- return 0;
+ return -1;
}
+ long realSize = dvrClient->readFromBuffer(reinterpret_cast<unsigned char*>(src) + offset, size);
+ env->ReleaseByteArrayElements(buffer, src, 0);
+ return (jlong) realSize;
- if (dvrSp->mDvrMQ->write(reinterpret_cast<unsigned char*>(src) + offset, size)) {
- env->ReleaseByteArrayElements(buffer, src, 0);
- dvrSp->mDvrMQEventFlag->wake(static_cast<uint32_t>(DemuxQueueNotifyBits::DATA_READY));
- } else {
- ALOGD("Failed to write FMQ");
- env->ReleaseByteArrayElements(buffer, src, 0);
- return 0;
- }
- return size;
}
static jlong android_media_tv_Tuner_write_dvr(JNIEnv *env, jobject dvr, jlong size) {
- sp<Dvr> dvrSp = getDvr(env, dvr);
- if (dvrSp == NULL) {
+ sp<DvrClient> dvrClient = getDvrClient(env, dvr);
+ if (dvrClient == NULL) {
jniThrowException(env, "java/lang/IllegalStateException",
- "Failed to write dvr: dvr not found");
- return 0;
+ "Failed to write dvr: dvr client not found");
+ return -1;
}
- if (dvrSp->mDvrMQ == NULL) {
- jniThrowException(env, "java/lang/IllegalStateException",
- "Failed to write dvr: dvr not configured");
- return 0;
- }
-
- MQ& dvrMq = dvrSp->getDvrMQ();
-
- long available = dvrMq.availableToRead();
- long toRead = std::min((long) size, available);
-
- long ret = 0;
- MQ::MemTransaction tx;
- if (dvrMq.beginRead(toRead, &tx)) {
- auto first = tx.getFirstRegion();
- auto data = first.getAddress();
- long length = first.getLength();
- long firstToRead = std::min(length, toRead);
- ret = write(dvrSp->mFd, data, firstToRead);
-
- if (ret < 0) {
- ALOGE("[DVR] Failed to write to FD: %s", strerror(errno));
- jniThrowRuntimeException(env, strerror(errno));
- return 0;
- }
- if (ret < firstToRead) {
- ALOGW("[DVR] MQ to file: %ld bytes read, but %ld bytes written", firstToRead, ret);
- } else if (firstToRead < toRead) {
- ALOGD("[DVR] read second region: %ld bytes read, %ld bytes in total", ret, toRead);
- auto second = tx.getSecondRegion();
- data = second.getAddress();
- length = second.getLength();
- int secondToRead = toRead - firstToRead;
- ret += write(dvrSp->mFd, data, secondToRead);
- }
- ALOGD("[DVR] MQ to file: %ld bytes to be read, %ld bytes written", toRead, ret);
- if (!dvrMq.commitRead(ret)) {
- ALOGE("[DVR] Error: failed to commit read!");
- return 0;
- }
-
- } else {
- ALOGE("dvrMq.beginRead failed");
- }
- if (ret > 0) {
- dvrSp->mDvrMQEventFlag->wake(static_cast<uint32_t>(DemuxQueueNotifyBits::DATA_CONSUMED));
- }
-
- return (jlong) ret;
+ return (jlong) dvrClient->writeToFile(size);
}
static jlong android_media_tv_Tuner_write_dvr_to_array(
JNIEnv *env, jobject dvr, jbyteArray buffer, jlong offset, jlong size) {
- sp<Dvr> dvrSp = getDvr(env, dvr);
- if (dvrSp == NULL) {
- ALOGW("Failed to write dvr: dvr not found");
- return 0;
+ sp<DvrClient> dvrClient = getDvrClient(env, dvr);
+ if (dvrClient == NULL) {
+ ALOGW("Failed to read dvr: dvr client not found");
+ return -1;
}
- if (dvrSp->mDvrMQ == NULL) {
- ALOGW("Failed to write dvr: dvr not configured");
- return 0;
+
+ jboolean isCopy;
+ jbyte *dst = env->GetByteArrayElements(buffer, &isCopy);
+ ALOGD("copyData, isCopy=%d", isCopy);
+ if (dst == nullptr) {
+ jniThrowRuntimeException(env, "Failed to GetByteArrayElements");
+ return -1;
}
- return copyData(env, dvrSp->mDvrMQ, dvrSp->mDvrMQEventFlag, buffer, offset, size);
+
+ long realSize = dvrClient->writeToBuffer(reinterpret_cast<unsigned char*>(dst) + offset, size);
+ env->ReleaseByteArrayElements(buffer, dst, 0);
+ return (jlong) realSize;
}
static sp<MediaEvent> getMediaEventSp(JNIEnv *env, jobject mediaEventObj) {
diff --git a/media/jni/android_media_tv_Tuner.h b/media/jni/android_media_tv_Tuner.h
index bec834c..9dc4ddf 100644
--- a/media/jni/android_media_tv_Tuner.h
+++ b/media/jni/android_media_tv_Tuner.h
@@ -34,6 +34,11 @@
#include <utils/Mutex.h>
#include <utils/RefBase.h>
+#include "tuner/DemuxClient.h"
+#include "tuner/FilterClient.h"
+#include "tuner/FilterClientCallback.h"
+#include "tuner/FrontendClient.h"
+#include "tuner/FrontendClientCallback.h"
#include "tuner/TunerClient.h"
#include "jni.h"
@@ -95,57 +100,30 @@
Lnb(sp<ILnb> sp, jobject obj);
~Lnb();
sp<ILnb> getILnb();
+ // TODO: remove after migrate to client lib
sp<ILnb> mLnbSp;
jweak mLnbObj;
};
-struct DvrCallback : public IDvrCallback {
- ~DvrCallback();
- virtual Return<void> onRecordStatus(RecordStatus status);
- virtual Return<void> onPlaybackStatus(PlaybackStatus status);
+struct DvrClientCallbackImpl : public DvrClientCallback {
+ ~DvrClientCallbackImpl();
+ virtual void onRecordStatus(RecordStatus status);
+ virtual void onPlaybackStatus(PlaybackStatus status);
- void setDvr(const jobject dvr);
+ void setDvr(jweak dvrObj);
private:
- jweak mDvr;
-};
-
-struct Dvr : public RefBase {
- Dvr(sp<IDvr> sp, jweak obj);
- ~Dvr();
- jint close();
- MQ& getDvrMQ();
- sp<IDvr> getIDvr();
- sp<IDvr> mDvrSp;
jweak mDvrObj;
- std::unique_ptr<MQ> mDvrMQ;
- EventFlag* mDvrMQEventFlag;
- std::string mFilePath;
- int mFd;
-};
-
-struct Filter : public RefBase {
- Filter(sp<IFilter> sp, jobject obj);
- ~Filter();
- int close();
- sp<IFilter> getIFilter();
- sp<IFilter> mFilterSp;
- std::unique_ptr<MQ> mFilterMQ;
- EventFlag* mFilterMQEventFlag;
- jweak mFilterObj;
- native_handle_t* mAvSharedHandle;
- uint64_t mAvSharedMemSize;
- bool mIsMediaFilter;
};
struct MediaEvent : public RefBase {
- MediaEvent(sp<Filter> filter, hidl_handle avHandle, uint64_t dataId,
+ MediaEvent(sp<FilterClient> filterClient, hidl_handle avHandle, uint64_t dataId,
uint64_t dataSize, jobject obj);
~MediaEvent();
jobject getLinearBlock();
uint64_t getAudioHandle();
void finalize();
- sp<Filter> mFilter;
+ sp<FilterClient> mFilterClient;
native_handle_t* mAvHandle;
uint64_t mDataId;
uint64_t mDataSize;
@@ -159,16 +137,16 @@
std::weak_ptr<C2Buffer> mC2Buffer;
};
-struct FilterCallback : public IFilterCallback {
- ~FilterCallback();
- virtual Return<void> onFilterEvent_1_1(const DemuxFilterEvent& filterEvent,
+struct FilterClientCallbackImpl : public FilterClientCallback {
+ virtual void onFilterEvent_1_1(const DemuxFilterEvent& filterEvent,
const DemuxFilterEventExt& filterEventExt);
- virtual Return<void> onFilterEvent(const DemuxFilterEvent& filterEvent);
- virtual Return<void> onFilterStatus(const DemuxFilterStatus status);
+ virtual void onFilterEvent(const DemuxFilterEvent& filterEvent);
+ virtual void onFilterStatus(const DemuxFilterStatus status);
- void setFilter(const sp<Filter> filter);
+ void setFilter(jweak filterObj, sp<FilterClient> filterClient);
private:
- sp<Filter> mFilter;
+ jweak mFilterObj;
+ sp<FilterClient> mFilterClient;
jobjectArray getSectionEvent(
jobjectArray& arr, const std::vector<DemuxFilterEvent::Event>& events);
jobjectArray getMediaEvent(
@@ -195,13 +173,13 @@
jobjectArray& arr, const std::vector<DemuxFilterEventExt::Event>& eventsExt);
};
-struct FrontendCallback : public IFrontendCallback {
- FrontendCallback(jweak tunerObj, FrontendId id);
+struct FrontendClientCallbackImpl : public FrontendClientCallback {
+ FrontendClientCallbackImpl(jweak tunerObj, FrontendId id);
- virtual Return<void> onEvent(FrontendEventType frontendEventType);
- virtual Return<void> onScanMessage(
+ virtual void onEvent(FrontendEventType frontendEventType);
+ virtual void onScanMessage(
FrontendScanMessageType type, const FrontendScanMessage& message);
- virtual Return<void> onScanMessageExt1_1(
+ virtual void onScanMessageExt1_1(
FrontendScanMessageTypeExt1_1 type, const FrontendScanMessageExt1_1& messageExt);
jweak mObject;
@@ -212,22 +190,24 @@
TimeFilter(sp<ITimeFilter> sp, jweak obj);
~TimeFilter();
sp<ITimeFilter> getITimeFilter();
+ // TODO: remove after migrate to client lib
sp<ITimeFilter> mTimeFilterSp;
jweak mTimeFilterObj;
};
struct JTuner : public RefBase {
JTuner(JNIEnv *env, jobject thiz);
+ // TODO: modify after migrate to client lib
sp<ITuner> getTunerService();
int getTunerVersion();
- jobject getAvSyncHwId(sp<Filter> filter);
+ jobject getAvSyncHwId(sp<FilterClient> filter);
jobject getAvSyncTime(jint id);
int connectCiCam(jint id);
int linkCiCam(jint id);
int disconnectCiCam();
int unlinkCiCam(jint id);
jobject getFrontendIds();
- jobject openFrontendById(int id);
+ jobject openFrontendByHandle(int feHandle);
jint closeFrontendById(int id);
jobject getFrontendInfo(int id);
int tune(const FrontendSettings& settings, const FrontendSettingsExt1_1& settingsExt1_1);
@@ -257,15 +237,22 @@
private:
jclass mClass;
jweak mObject;
+ // TODO: remove after migrate to client lib
static sp<ITuner> mTuner;
static sp<::android::hardware::tv::tuner::V1_1::ITuner> mTuner_1_1;
static sp<TunerClient> mTunerClient;
+ // TODO: remove after migrate to client lib
sp<IFrontend> mFe;
+ // TODO: remove after migrate to client lib
sp<::android::hardware::tv::tuner::V1_1::IFrontend> mFe_1_1;
+ sp<FrontendClient> mFeClient;
int mFeId;
hidl_vec<LnbId> mLnbIds;
+ // TODO: remove after migrate to client lib
sp<ILnb> mLnb;
+ // TODO: remove after migrate to client lib
sp<IDemux> mDemux;
+ sp<DemuxClient> mDemuxClient;
uint32_t mDemuxId;
static jobject getAnalogFrontendCaps(JNIEnv *env, FrontendInfo::FrontendCapabilities& caps);
static jobject getAtsc3FrontendCaps(JNIEnv *env, FrontendInfo::FrontendCapabilities& caps);
@@ -279,6 +266,9 @@
static jobject getDtmbFrontendCaps(JNIEnv *env, int id);
bool isV1_1ExtendedStatusType(jint type);
+ static uint32_t getResourceIdFromHandle(jint handle) {
+ return (handle & 0x00ff0000) >> 16;
+ }
};
class C2DataIdInfo : public C2Param {
diff --git a/media/jni/tuner/DemuxClient.cpp b/media/jni/tuner/DemuxClient.cpp
index 11acb5e..59dfd70 100644
--- a/media/jni/tuner/DemuxClient.cpp
+++ b/media/jni/tuner/DemuxClient.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#define LOG_TAG "FrontendClient"
+#define LOG_TAG "DemuxClient"
#include <android-base/logging.h>
#include <utils/Log.h>
@@ -68,14 +68,12 @@
sp<HidlFilterCallback> callback = new HidlFilterCallback(cb);
sp<IFilter> hidlFilter = openHidlFilter(type, bufferSize, callback);
if (hidlFilter != NULL) {
- sp<FilterClient> filterClient = new FilterClient();
+ sp<FilterClient> filterClient = new FilterClient(type);
filterClient->setHidlFilter(hidlFilter);
return filterClient;
}
}
- // TODO: handle share av memory handle
-
return NULL;
}
@@ -118,7 +116,21 @@
return -1;
}
-//DvrClient openDvr(int dvbType, int bufferSize, DvrClientCallback cb);
+sp<DvrClient> DemuxClient::openDvr(DvrType dvbType, int bufferSize, sp<DvrClientCallback> cb) {
+ // TODO: pending aidl interface
+
+ if (mDemux != NULL) {
+ sp<HidlDvrCallback> callback = new HidlDvrCallback(cb);
+ sp<IDvr> hidlDvr = openHidlDvr(dvbType, bufferSize, callback);
+ if (hidlDvr != NULL) {
+ sp<DvrClient> dvrClient = new DvrClient();
+ dvrClient->setHidlDvr(hidlDvr);
+ return dvrClient;
+ }
+ }
+
+ return NULL;
+}
Result DemuxClient::connectCiCam(int ciCamId) {
// pending aidl interface
@@ -141,7 +153,7 @@
}
Result DemuxClient::close() {
- // pending aidl interface
+ // TODO: pending aidl interface
if (mDemux != NULL) {
Result res = mDemux->close();
@@ -175,4 +187,24 @@
return hidlFilter;
}
+
+sp<IDvr> DemuxClient::openHidlDvr(DvrType dvrType, int bufferSize,
+ sp<HidlDvrCallback> callback) {
+ if (mDemux == NULL) {
+ return NULL;
+ }
+
+ sp<IDvr> hidlDvr;
+ Result res;
+ mDemux->openDvr(dvrType, bufferSize, callback,
+ [&](Result r, const sp<IDvr>& dvr) {
+ hidlDvr = dvr;
+ res = r;
+ });
+ if (res != Result::SUCCESS || hidlDvr == NULL) {
+ return NULL;
+ }
+
+ return hidlDvr;
+}
} // namespace android
diff --git a/media/jni/tuner/DemuxClient.h b/media/jni/tuner/DemuxClient.h
index a0671a5..f11f2c6 100644
--- a/media/jni/tuner/DemuxClient.h
+++ b/media/jni/tuner/DemuxClient.h
@@ -21,6 +21,8 @@
#include <android/hardware/tv/tuner/1.0/IDemux.h>
#include <android/hardware/tv/tuner/1.1/types.h>
+#include "DvrClient.h"
+#include "DvrClientCallback.h"
#include "FilterClient.h"
#include "FilterClientCallback.h"
#include "FrontendClient.h"
@@ -28,6 +30,7 @@
//using ::aidl::android::media::tv::tuner::ITunerDemux;
using ::android::hardware::tv::tuner::V1_0::DemuxFilterType;
+using ::android::hardware::tv::tuner::V1_0::DvrType;
using ::android::hardware::tv::tuner::V1_0::IDemux;
using namespace std;
@@ -68,8 +71,7 @@
/**
* Open a DVR (Digital Video Record) client.
*/
- // TODO: handle DvrClient and callback
- //DvrClient openDvr(int dvbType, int bufferSize, DvrClientCallback cb);
+ sp<DvrClient> openDvr(DvrType dvbType, int bufferSize, sp<DvrClientCallback> cb);
/**
* Connect Conditional Access Modules (CAM) through Common Interface (CI).
@@ -88,6 +90,7 @@
private:
sp<IFilter> openHidlFilter(DemuxFilterType type, int bufferSize, sp<HidlFilterCallback> cb);
+ sp<IDvr> openHidlDvr(DvrType type, int bufferSize, sp<HidlDvrCallback> cb);
/**
* An AIDL Tuner Demux Singleton assigned at the first time the Tuner Client
diff --git a/media/jni/tuner/DvrClient.cpp b/media/jni/tuner/DvrClient.cpp
new file mode 100644
index 0000000..dd08491
--- /dev/null
+++ b/media/jni/tuner/DvrClient.cpp
@@ -0,0 +1,329 @@
+/*
+ * 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.
+ */
+
+#define LOG_TAG "DvrClient"
+
+#include <android-base/logging.h>
+#include <utils/Log.h>
+
+#include "DvrClient.h"
+
+using ::android::hardware::tv::tuner::V1_0::DemuxQueueNotifyBits;
+using ::android::hardware::tv::tuner::V1_0::Result;
+
+namespace android {
+
+/////////////// DvrClient ///////////////////////
+
+// TODO: pending aidl interface
+DvrClient::DvrClient() {
+ //mTunerDvr = tunerDvr;
+ mFd = -1;
+ mDvrMQ = NULL;
+ mDvrMQEventFlag = NULL;
+}
+
+DvrClient::~DvrClient() {
+ //mTunerDvr = NULL;
+ mDvr = NULL;
+ mFd = -1;
+ mDvrMQ = NULL;
+ mDvrMQEventFlag = NULL;
+}
+
+// TODO: remove after migration to Tuner Service is done.
+void DvrClient::setHidlDvr(sp<IDvr> dvr) {
+ mDvr = dvr;
+}
+
+void DvrClient::setFd(int fd) {
+ mFd = fd;
+}
+
+long DvrClient::readFromFile(long size) {
+ if (mDvrMQ == NULL || mDvrMQEventFlag == NULL) {
+ ALOGE("Failed to readFromFile. DVR mq is not configured");
+ return -1;
+ }
+ if (mFd < 0) {
+ ALOGE("Failed to readFromFile. File is not configured");
+ return -1;
+ }
+
+ long available = mDvrMQ->availableToWrite();
+ long write = min(size, available);
+
+ MQ::MemTransaction tx;
+ long ret = 0;
+ if (mDvrMQ->beginWrite(write, &tx)) {
+ auto first = tx.getFirstRegion();
+ auto data = first.getAddress();
+ long length = first.getLength();
+ long firstToWrite = min(length, write);
+ ret = read(mFd, data, firstToWrite);
+
+ if (ret < 0) {
+ ALOGE("Failed to read from FD: %s", strerror(errno));
+ return -1;
+ }
+ if (ret < firstToWrite) {
+ ALOGW("file to MQ, first region: %ld bytes to write, but %ld bytes written",
+ firstToWrite, ret);
+ } else if (firstToWrite < write) {
+ ALOGD("write second region: %ld bytes written, %ld bytes in total", ret, write);
+ auto second = tx.getSecondRegion();
+ data = second.getAddress();
+ length = second.getLength();
+ int secondToWrite = std::min(length, write - firstToWrite);
+ ret += read(mFd, data, secondToWrite);
+ }
+ ALOGD("file to MQ: %ld bytes need to be written, %ld bytes written", write, ret);
+ if (!mDvrMQ->commitWrite(ret)) {
+ ALOGE("Error: failed to commit write!");
+ return -1;
+ }
+ } else {
+ ALOGE("dvrMq.beginWrite failed");
+ }
+
+ if (ret > 0) {
+ mDvrMQEventFlag->wake(static_cast<uint32_t>(DemuxQueueNotifyBits::DATA_READY));
+ }
+ return ret;
+}
+
+long DvrClient::readFromBuffer(uint8_t* buffer, long size) {
+ if (mDvrMQ == NULL || mDvrMQEventFlag == NULL) {
+ ALOGE("Failed to readFromBuffer. DVR mq is not configured");
+ return -1;
+ }
+ if (buffer == nullptr) {
+ ALOGE("Failed to readFromBuffer. Buffer can't be null");
+ return -1;
+ }
+
+ long available = mDvrMQ->availableToWrite();
+ size = min(size, available);
+
+ if (mDvrMQ->write(buffer, size)) {
+ mDvrMQEventFlag->wake(static_cast<uint32_t>(DemuxQueueNotifyBits::DATA_READY));
+ } else {
+ ALOGD("Failed to write FMQ");
+ return -1;
+ }
+ return size;
+}
+
+long DvrClient::writeToFile(long size) {
+ if (mDvrMQ == NULL || mDvrMQEventFlag == NULL) {
+ ALOGE("Failed to writeToFile. DVR mq is not configured");
+ return -1;
+ }
+ if (mFd < 0) {
+ ALOGE("Failed to writeToFile. File is not configured");
+ return -1;
+ }
+
+ long available = mDvrMQ->availableToRead();
+ long toRead = min(size, available);
+
+ long ret = 0;
+ MQ::MemTransaction tx;
+ if (mDvrMQ->beginRead(toRead, &tx)) {
+ auto first = tx.getFirstRegion();
+ auto data = first.getAddress();
+ long length = first.getLength();
+ long firstToRead = std::min(length, toRead);
+ ret = write(mFd, data, firstToRead);
+
+ if (ret < 0) {
+ ALOGE("Failed to write to FD: %s", strerror(errno));
+ return -1;
+ }
+ if (ret < firstToRead) {
+ ALOGW("MQ to file: %ld bytes read, but %ld bytes written", firstToRead, ret);
+ } else if (firstToRead < toRead) {
+ ALOGD("read second region: %ld bytes read, %ld bytes in total", ret, toRead);
+ auto second = tx.getSecondRegion();
+ data = second.getAddress();
+ length = second.getLength();
+ int secondToRead = toRead - firstToRead;
+ ret += write(mFd, data, secondToRead);
+ }
+ ALOGD("MQ to file: %ld bytes to be read, %ld bytes written", toRead, ret);
+ if (!mDvrMQ->commitRead(ret)) {
+ ALOGE("Error: failed to commit read!");
+ return 0;
+ }
+ } else {
+ ALOGE("dvrMq.beginRead failed");
+ }
+ if (ret > 0) {
+ mDvrMQEventFlag->wake(static_cast<uint32_t>(DemuxQueueNotifyBits::DATA_CONSUMED));
+ }
+
+ return ret;
+}
+
+long DvrClient::writeToBuffer(uint8_t* buffer, long size) {
+ if (mDvrMQ == NULL || mDvrMQEventFlag == NULL) {
+ ALOGE("Failed to writetoBuffer. DVR mq is not configured");
+ return -1;
+ }
+ if (buffer == nullptr) {
+ ALOGE("Failed to writetoBuffer. Buffer can't be null");
+ return -1;
+ }
+
+ long available = mDvrMQ->availableToRead();
+ size = min(size, available);
+
+ if (mDvrMQ->read(buffer, size)) {
+ mDvrMQEventFlag->wake(static_cast<uint32_t>(DemuxQueueNotifyBits::DATA_CONSUMED));
+ } else {
+ ALOGD("Failed to write FMQ");
+ return -1;
+ }
+ return size;
+}
+
+Result DvrClient::configure(DvrSettings settings) {
+ // pending aidl interface
+
+ if (mDvr != NULL) {
+ Result res = mDvr->configure(settings);
+ if (res == Result::SUCCESS) {
+ MQDescriptorSync<uint8_t> dvrMQDesc;
+ res = getQueueDesc(dvrMQDesc);
+ if (res == Result::SUCCESS) {
+ mDvrMQ = make_unique<MQ>(dvrMQDesc, true);
+ EventFlag::createEventFlag(mDvrMQ->getEventFlagWord(), &mDvrMQEventFlag);
+ }
+ }
+ return res;
+ }
+
+ return Result::INVALID_STATE;
+}
+
+Result DvrClient::attachFilter(sp<FilterClient> filterClient) {
+ // pending aidl interface
+
+ if (mDvr != NULL) {
+ sp<IFilter> hidlFilter = filterClient->getHalFilter();
+ if (hidlFilter == NULL) {
+ return Result::INVALID_ARGUMENT;
+ }
+ return mDvr->attachFilter(hidlFilter);
+ }
+
+ return Result::INVALID_STATE;
+}
+
+Result DvrClient::detachFilter(sp<FilterClient> filterClient) {
+ // pending aidl interface
+
+ if (mDvr != NULL) {
+ sp<IFilter> hidlFilter = filterClient->getHalFilter();
+ if (hidlFilter == NULL) {
+ return Result::INVALID_ARGUMENT;
+ }
+ return mDvr->detachFilter(hidlFilter);
+ }
+
+ return Result::INVALID_STATE;
+}
+
+Result DvrClient::start() {
+ // pending aidl interface
+
+ if (mDvr != NULL) {
+ return mDvr->start();
+ }
+
+ return Result::INVALID_STATE;
+}
+
+Result DvrClient::stop() {
+ // pending aidl interface
+
+ if (mDvr != NULL) {
+ return mDvr->stop();
+ }
+
+ return Result::INVALID_STATE;
+}
+
+Result DvrClient::flush() {
+ // pending aidl interface
+
+ if (mDvr != NULL) {
+ return mDvr->flush();
+ }
+
+ return Result::INVALID_STATE;
+}
+
+Result DvrClient::close() {
+ // pending aidl interface
+
+ if (mDvr != NULL) {
+ Result res = mDvr->close();
+ if (res == Result::SUCCESS) {
+ mDvr = NULL;
+ }
+ return res;
+ }
+
+ return Result::INVALID_STATE;
+}
+
+/////////////// IDvrCallback ///////////////////////
+
+HidlDvrCallback::HidlDvrCallback(sp<DvrClientCallback> dvrClientCallback)
+ : mDvrClientCallback(dvrClientCallback) {}
+
+Return<void> HidlDvrCallback::onRecordStatus(const RecordStatus status) {
+ if (mDvrClientCallback != NULL) {
+ mDvrClientCallback->onRecordStatus(status);
+ }
+ return Void();
+}
+
+Return<void> HidlDvrCallback::onPlaybackStatus(const PlaybackStatus status) {
+ if (mDvrClientCallback != NULL) {
+ mDvrClientCallback->onPlaybackStatus(status);
+ }
+ return Void();
+}
+
+/////////////// DvrClient Helper Methods ///////////////////////
+
+Result DvrClient::getQueueDesc(MQDesc& dvrMQDesc) {
+ // pending aidl interface
+
+ if (mDvr != NULL) {
+ Result res = Result::UNKNOWN_ERROR;
+ mDvr->getQueueDesc([&](Result r, const MQDesc& desc) {
+ dvrMQDesc = desc;
+ res = r;
+ });
+ return res;
+ }
+
+ return Result::INVALID_STATE;
+}
+} // namespace android
diff --git a/media/jni/tuner/DvrClient.h b/media/jni/tuner/DvrClient.h
new file mode 100644
index 0000000..2aba5e0
--- /dev/null
+++ b/media/jni/tuner/DvrClient.h
@@ -0,0 +1,162 @@
+/*
+ * 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.
+ */
+
+#ifndef _ANDROID_MEDIA_TV_DVR_CLIENT_H_
+#define _ANDROID_MEDIA_TV_DVR_CLIENT_H_
+
+//#include <aidl/android/media/tv/tuner/ITunerDvr.h>
+#include <android/hardware/tv/tuner/1.0/IDvr.h>
+#include <android/hardware/tv/tuner/1.0/IDvrCallback.h>
+#include <android/hardware/tv/tuner/1.1/types.h>
+#include <fmq/MessageQueue.h>
+
+#include "DvrClientCallback.h"
+#include "FilterClient.h"
+
+//using ::aidl::android::media::tv::tuner::ITunerDvr;
+
+using ::android::hardware::EventFlag;
+using ::android::hardware::MQDescriptorSync;
+using ::android::hardware::MessageQueue;
+using ::android::hardware::tv::tuner::V1_0::DvrSettings;
+using ::android::hardware::tv::tuner::V1_0::IDvr;
+using ::android::hardware::tv::tuner::V1_0::IDvrCallback;
+
+using namespace std;
+
+using MQ = MessageQueue<uint8_t, kSynchronizedReadWrite>;
+using MQDesc = MQDescriptorSync<uint8_t>;
+
+namespace android {
+
+// TODO: pending aidl interface
+/*class TunerDvrCallback : public BnTunerDvrCallback {
+
+public:
+ TunerDvrCallback(sp<DvrClientCallback> dvrClientCallback);
+
+ Status onRecordStatus(int status);
+ Status onPlaybackStatus(int status);
+
+private:
+ sp<DvrClientCallback> mDvrClientCallback;
+};*/
+
+struct HidlDvrCallback : public IDvrCallback {
+
+public:
+ HidlDvrCallback(sp<DvrClientCallback> dvrClientCallback);
+ virtual Return<void> onRecordStatus(const RecordStatus status);
+ virtual Return<void> onPlaybackStatus(const PlaybackStatus status);
+
+private:
+ sp<DvrClientCallback> mDvrClientCallback;
+};
+
+struct DvrClient : public RefBase {
+
+public:
+ DvrClient();
+ ~DvrClient();
+
+ // TODO: remove after migration to Tuner Service is done.
+ void setHidlDvr(sp<IDvr> dvr);
+
+ /**
+ * Set the DVR file descriptor.
+ */
+ void setFd(int fd);
+
+ /**
+ * Read data from file with given size. Return the actual read size.
+ */
+ long readFromFile(long size);
+
+ /**
+ * Read data from the given buffer with given size. Return the actual read size.
+ */
+ long readFromBuffer(uint8_t* buffer, long size);
+
+ /**
+ * Write data to file with given size. Return the actual write size.
+ */
+ long writeToFile(long size);
+
+ /**
+ * Write data to the given buffer with given size. Return the actual write size.
+ */
+ long writeToBuffer(uint8_t* buffer, long size);
+
+ /**
+ * Configure the DVR.
+ */
+ Result configure(DvrSettings settings);
+
+ /**
+ * Attach one filter to DVR interface for recording.
+ */
+ Result attachFilter(sp<FilterClient> filterClient);
+
+ /**
+ * Detach one filter from the DVR's recording.
+ */
+ Result detachFilter(sp<FilterClient> filterClient);
+
+ /**
+ * Start DVR.
+ */
+ Result start();
+
+ /**
+ * Stop DVR.
+ */
+ Result stop();
+
+ /**
+ * Flush DVR data.
+ */
+ Result flush();
+
+ /**
+ * close the DVR instance to release resource for DVR.
+ */
+ Result close();
+
+private:
+ Result getQueueDesc(MQDesc& dvrMQDesc);
+
+ /**
+ * An AIDL Tuner Dvr Singleton assigned at the first time the Tuner Client
+ * opens a dvr. Default null when dvr is not opened.
+ */
+ // TODO: pending on aidl interface
+ //shared_ptr<ITunerDvr> mTunerDvr;
+
+ /**
+ * A Dvr HAL interface that is ready before migrating to the TunerDvr.
+ * This is a temprary interface before Tuner Framework migrates to use TunerService.
+ * Default null when the HAL service does not exist.
+ */
+ sp<IDvr> mDvr;
+
+ unique_ptr<MQ> mDvrMQ;
+ EventFlag* mDvrMQEventFlag;
+ string mFilePath;
+ int mFd;
+};
+} // namespace android
+
+#endif // _ANDROID_MEDIA_TV_DVR_CLIENT_H_
diff --git a/media/jni/tuner/DvrClientCallback.h b/media/jni/tuner/DvrClientCallback.h
new file mode 100644
index 0000000..6684424
--- /dev/null
+++ b/media/jni/tuner/DvrClientCallback.h
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+#ifndef _ANDROID_MEDIA_TV_DVR_CLIENT_CALLBACK_H_
+#define _ANDROID_MEDIA_TV_DVR_CLIENT_CALLBACK_H_
+
+using ::android::hardware::tv::tuner::V1_0::PlaybackStatus;
+using ::android::hardware::tv::tuner::V1_0::RecordStatus;
+
+using namespace std;
+
+namespace android {
+
+struct DvrClientCallback : public RefBase {
+ virtual void onRecordStatus(const RecordStatus status);
+ virtual void onPlaybackStatus(const PlaybackStatus status);
+};
+} // namespace android
+
+#endif // _ANDROID_MEDIA_TV_DVR_CLIENT_CALLBACK_H_
\ No newline at end of file
diff --git a/media/jni/tuner/FilterClient.cpp b/media/jni/tuner/FilterClient.cpp
index a71cae60..0aab5fe 100644
--- a/media/jni/tuner/FilterClient.cpp
+++ b/media/jni/tuner/FilterClient.cpp
@@ -22,6 +22,9 @@
#include "FilterClient.h"
using ::android::hardware::tv::tuner::V1_0::DemuxQueueNotifyBits;
+using ::android::hardware::tv::tuner::V1_0::DemuxFilterMainType;
+using ::android::hardware::tv::tuner::V1_0::DemuxMmtpFilterType;
+using ::android::hardware::tv::tuner::V1_0::DemuxTsFilterType;
namespace android {
@@ -29,20 +32,25 @@
// TODO: pending aidl interface
// TODO: add filter callback
-FilterClient::FilterClient() {
+FilterClient::FilterClient(DemuxFilterType type) {
//mTunerFilter = tunerFilter;
+ mAvSharedHandle = NULL;
+ checkIsMediaFilter(type);
}
FilterClient::~FilterClient() {
//mTunerFilter = NULL;
mFilter = NULL;
mFilter_1_1 = NULL;
+ mAvSharedHandle = NULL;
+ mAvSharedMemSize = 0;
}
// TODO: remove after migration to Tuner Service is done.
void FilterClient::setHidlFilter(sp<IFilter> filter) {
mFilter = filter;
mFilter_1_1 = ::android::hardware::tv::tuner::V1_1::IFilter::castFrom(mFilter);
+ handleAvShareMemory();
}
int FilterClient::read(uint8_t* buffer, int size) {
@@ -59,6 +67,22 @@
return -1;
}
+SharedHandleInfo FilterClient::getAvSharedHandleInfo() {
+ SharedHandleInfo info{
+ .sharedHandle = NULL,
+ .size = 0,
+ };
+
+ // TODO: pending aidl interface
+
+ if (mFilter_1_1 != NULL) {
+ info.sharedHandle = mAvSharedHandle;
+ info.size = mAvSharedMemSize;
+ }
+
+ return info;
+}
+
Result FilterClient::configure(DemuxFilterSettings configure) {
// TODO: pending aidl interface
@@ -187,7 +211,11 @@
// TODO: pending aidl interface
if (mFilter != NULL) {
- return mFilter->close();
+ Result res = mFilter->close();
+ if (res == Result::SUCCESS) {
+ mFilter = NULL;
+ }
+ return res;
}
return Result::INVALID_STATE;
@@ -261,4 +289,31 @@
return size;
}
+
+void FilterClient::checkIsMediaFilter(DemuxFilterType type) {
+ if (type.mainType == DemuxFilterMainType::MMTP) {
+ if (type.subType.mmtpFilterType() == DemuxMmtpFilterType::AUDIO ||
+ type.subType.mmtpFilterType() == DemuxMmtpFilterType::VIDEO) {
+ mIsMediaFilter = true;
+ }
+ }
+
+ if (type.mainType == DemuxFilterMainType::TS) {
+ if (type.subType.tsFilterType() == DemuxTsFilterType::AUDIO ||
+ type.subType.tsFilterType() == DemuxTsFilterType::VIDEO) {
+ mIsMediaFilter = true;
+ }
+ }
+}
+
+void FilterClient::handleAvShareMemory() {
+ if (mFilter_1_1 != NULL && mIsMediaFilter) {
+ mFilter_1_1->getAvSharedHandle([&](Result r, hidl_handle avMemory, uint64_t avMemSize) {
+ if (r == Result::SUCCESS) {
+ mAvSharedHandle = native_handle_clone(avMemory.getNativeHandle());
+ mAvSharedMemSize = avMemSize;
+ }
+ });
+ }
+}
} // namespace android
diff --git a/media/jni/tuner/FilterClient.h b/media/jni/tuner/FilterClient.h
index 4af74b0..976b2f5 100644
--- a/media/jni/tuner/FilterClient.h
+++ b/media/jni/tuner/FilterClient.h
@@ -34,6 +34,7 @@
using ::android::hardware::Void;
using ::android::hardware::hidl_handle;
using ::android::hardware::tv::tuner::V1_0::DemuxFilterSettings;
+using ::android::hardware::tv::tuner::V1_0::DemuxFilterType;
using ::android::hardware::tv::tuner::V1_0::IFilter;
using ::android::hardware::tv::tuner::V1_0::Result;
using ::android::hardware::tv::tuner::V1_1::AvStreamType;
@@ -45,6 +46,11 @@
namespace android {
+struct SharedHandleInfo {
+ native_handle_t* sharedHandle;
+ uint64_t size;
+};
+
// TODO: pending aidl interface
/*class TunerFilterCallback : public BnTunerFilterCallback {
@@ -75,7 +81,7 @@
public:
// TODO: pending aidl interface
- FilterClient();
+ FilterClient(DemuxFilterType type);
~FilterClient();
// TODO: remove after migration to Tuner Service is done.
@@ -89,6 +95,11 @@
int read(uint8_t* buffer, int size);
/**
+ * Get the a/v shared memory handle information
+ */
+ SharedHandleInfo getAvSharedHandleInfo();
+
+ /**
* Configure the filter.
*/
Result configure(DemuxFilterSettings configure);
@@ -161,6 +172,8 @@
private:
Result getFilterMq();
int copyData(uint8_t* buffer, int size);
+ void checkIsMediaFilter(DemuxFilterType type);
+ void handleAvShareMemory();
/**
* An AIDL Tuner Filter Singleton assigned at the first time when the Tuner Client
@@ -189,6 +202,10 @@
sp<FilterClientCallback> mCallback;
//shared_ptr<TunerFilterCallback> mAidlCallback;
sp<HidlFilterCallback> mHidlCallback;
+
+ native_handle_t* mAvSharedHandle;
+ uint64_t mAvSharedMemSize;
+ bool mIsMediaFilter;
};
} // namespace android
diff --git a/media/jni/tuner/TunerClient.cpp b/media/jni/tuner/TunerClient.cpp
index a56a418..bd18c707 100644
--- a/media/jni/tuner/TunerClient.cpp
+++ b/media/jni/tuner/TunerClient.cpp
@@ -40,6 +40,8 @@
// Connect with Tuner Service.
::ndk::SpAIBinder binder(AServiceManager_getService("media.tuner"));
mTunerService = ITunerService::fromBinder(binder);
+ // TODO: Remove after JNI migration is done.
+ mTunerService = NULL;
if (mTunerService == NULL) {
ALOGE("Failed to get tuner service");
}
@@ -54,10 +56,21 @@
vector<FrontendId> TunerClient::getFrontendIds() {
vector<FrontendId> ids;
- // TODO: pending aidl interface
- /*if (mTunerService != NULL) {
- return mTunerService->getFrontendIds();
- }*/
+
+ if (mTunerService != NULL) {
+ vector<int32_t> v;
+ int aidl_return;
+ Status s = mTunerService->getFrontendIds(&v, &aidl_return);
+ if (!s.isOk() || aidl_return != (int) Result::SUCCESS
+ || v.size() == 0) {
+ ids.clear();
+ return ids;
+ }
+ for (int32_t id : v) {
+ ids.push_back(static_cast<FrontendId>(id));
+ }
+ return ids;
+ }
if (mTuner != NULL) {
Result res;
diff --git a/native/android/Android.bp b/native/android/Android.bp
index 6db4da9..3daaf05 100644
--- a/native/android/Android.bp
+++ b/native/android/Android.bp
@@ -103,7 +103,7 @@
version_script: "libandroid.map.txt",
stubs: {
symbol_file: "libandroid.map.txt",
- versions: ["29"],
+ versions: ["29", "31"],
},
}
diff --git a/native/android/OWNERS b/native/android/OWNERS
index 266764a..ac5a895 100644
--- a/native/android/OWNERS
+++ b/native/android/OWNERS
@@ -1,4 +1,3 @@
-set noparent
-
+per-file libandroid_net.map.txt, net.c = set noparent
per-file libandroid_net.map.txt, net.c = codewiz@google.com, jchalard@google.com, junyulai@google.com
per-file libandroid_net.map.txt, net.c = lorenzo@google.com, reminv@google.com, satk@google.com
diff --git a/native/graphics/OWNERS b/native/graphics/OWNERS
index a6d1bc3..d81ea2c 100644
--- a/native/graphics/OWNERS
+++ b/native/graphics/OWNERS
@@ -1 +1 @@
-include /core/java/android/graphics/OWNERS
+include /graphics/java/android/graphics/OWNERS
diff --git a/packages/CompanionDeviceManager/res/values-af/strings.xml b/packages/CompanionDeviceManager/res/values-af/strings.xml
index 824cc69..b83c914 100644
--- a/packages/CompanionDeviceManager/res/values-af/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-af/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Metgeseltoestel-bestuurder"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Koppel met <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Koppel <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> met <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-am/strings.xml b/packages/CompanionDeviceManager/res/values-am/strings.xml
index 5d89504..bad5a9f 100644
--- a/packages/CompanionDeviceManager/res/values-am/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-am/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"አጃቢ የመሣሪያ አስተዳዳሪ"</string>
- <string name="chooser_title" msgid="4958797271463138976">"ከ<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ጋር አገናኝ"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ከ <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> አገናኝ"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ar/strings.xml b/packages/CompanionDeviceManager/res/values-ar/strings.xml
index 9199986..a9a202e 100644
--- a/packages/CompanionDeviceManager/res/values-ar/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ar/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"تطبيق \"مدير الجهاز المصاحب\""</string>
- <string name="chooser_title" msgid="4958797271463138976">"الربط باستخدام تطبيق <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"ربط تطبيق <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> بجهاز <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-as/strings.xml b/packages/CompanionDeviceManager/res/values-as/strings.xml
index 2bd6d7e..31db4732 100644
--- a/packages/CompanionDeviceManager/res/values-as/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-as/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"কম্পেনিয়ন ডিভাইচ মেনেজাৰ"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>ৰ সৈতে লিংক কৰক"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>ৰ সৈতে <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> লিংক কৰক"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-az/strings.xml b/packages/CompanionDeviceManager/res/values-az/strings.xml
index c992cfd..ee794c3 100644
--- a/packages/CompanionDeviceManager/res/values-az/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-az/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Kompanyon Cihaz Meneceri"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ilə əlaqələndirin"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> tətbiqini <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> ilə əlaqələndirin"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-b+sr+Latn/strings.xml b/packages/CompanionDeviceManager/res/values-b+sr+Latn/strings.xml
index 8a388a4..708e49a 100644
--- a/packages/CompanionDeviceManager/res/values-b+sr+Latn/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-b+sr+Latn/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Menadžer pridruženog uređaja"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Povežite sa aplikacijom <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Povežite aplikaciju <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> i uređaj <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-be/strings.xml b/packages/CompanionDeviceManager/res/values-be/strings.xml
index e1b8016..a1a04e6 100644
--- a/packages/CompanionDeviceManager/res/values-be/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-be/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Менеджар спадарожнай прылады"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Звяжыце з праграмай <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Звяжыце праграму <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> з прыладай <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-bg/strings.xml b/packages/CompanionDeviceManager/res/values-bg/strings.xml
index 8748e20..eb9204a 100644
--- a/packages/CompanionDeviceManager/res/values-bg/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-bg/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Свързване с(ъс) <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Свържете <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> с(ъс) <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-bn/strings.xml b/packages/CompanionDeviceManager/res/values-bn/strings.xml
index a9fb9ff..eb9204a 100644
--- a/packages/CompanionDeviceManager/res/values-bn/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-bn/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>-এর সাথে লিঙ্ক করুন"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>-এর সাথে <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> লিঙ্ক করুন"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-bs/strings.xml b/packages/CompanionDeviceManager/res/values-bs/strings.xml
index 220553c..6515981fa 100644
--- a/packages/CompanionDeviceManager/res/values-bs/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-bs/strings.xml
@@ -17,6 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Prateći upravitelj uređaja"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Povežite se s aplikacijom <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Povežite aplikaciju <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> s uređajem <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="chooser_title" msgid="2262294130493605839">"Odaberite profil <xliff:g id="PROFILE_NAME">%1$s</xliff:g> kojim će upravljati aplikacija <strong><xliff:g id="APP_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="profile_name_generic" msgid="6851028682723034988">"uređaj"</string>
+ <string name="confirmation_title" msgid="4751119145078041732">"Postavite aplikaciju <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> da upravlja vašim profilom <xliff:g id="PROFILE_NAME">%2$s</xliff:g> –- <strong><xliff:g id="DEVICE_NAME">%3$s</xliff:g></strong>"</string>
+ <string name="profile_summary" msgid="3167701603666642104">"Potrebna je <xliff:g id="APP_NAME_0">%1$s</xliff:g> za upravljanje vašim profilom <xliff:g id="PROFILE_NAME_1">%2$s</xliff:g>. Aplikacija <xliff:g id="APP_NAME2">%3$s</xliff:g> dobit će pristup dopuštenju za <xliff:g id="PERMISSIONS">%4$s</xliff:g> dok je povezan profil <xliff:g id="PROFILE_NAME2">%5$s</xliff:g>."</string>
+ <string name="consent_yes" msgid="4055438216605487056">"Da"</string>
+ <string name="consent_no" msgid="1335543792857823917">"Ne, hvala"</string>
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ca/strings.xml b/packages/CompanionDeviceManager/res/values-ca/strings.xml
index 0623cb3..a51c967 100644
--- a/packages/CompanionDeviceManager/res/values-ca/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ca/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Gestor de dispositius complementaris"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Enllaça amb <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Enllaça <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> amb <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-cs/strings.xml b/packages/CompanionDeviceManager/res/values-cs/strings.xml
index ebd9cb1..faed4dd 100644
--- a/packages/CompanionDeviceManager/res/values-cs/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-cs/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Správce doprovodných zařízení"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Propojení s aplikací <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Propojení aplikace <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> se zařízením <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-da/strings.xml b/packages/CompanionDeviceManager/res/values-da/strings.xml
index 7601e40..c87181a 100644
--- a/packages/CompanionDeviceManager/res/values-da/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-da/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Medfølgende enhedshåndtering"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Tilknyt <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Knyt <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> til <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-de/strings.xml b/packages/CompanionDeviceManager/res/values-de/strings.xml
index b58f2c5..239243a 100644
--- a/packages/CompanionDeviceManager/res/values-de/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-de/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Begleitgerät-Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Mit <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> verknüpfen"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> mit <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> verknüpfen"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-el/strings.xml b/packages/CompanionDeviceManager/res/values-el/strings.xml
index 2d56213..0738161 100644
--- a/packages/CompanionDeviceManager/res/values-el/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-el/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Διαχείριση συνοδευτικής εφαρμογής"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Σύνδεση με <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Σύνδεση <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> με <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-en-rAU/strings.xml b/packages/CompanionDeviceManager/res/values-en-rAU/strings.xml
index 91c7643..a30c199 100644
--- a/packages/CompanionDeviceManager/res/values-en-rAU/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-en-rAU/strings.xml
@@ -17,6 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Link with <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Link <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> with <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="chooser_title" msgid="2262294130493605839">"Choose a <xliff:g id="PROFILE_NAME">%1$s</xliff:g> to be managed by <strong><xliff:g id="APP_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="profile_name_generic" msgid="6851028682723034988">"device"</string>
+ <string name="confirmation_title" msgid="4751119145078041732">"Set <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> to manage your <xliff:g id="PROFILE_NAME">%2$s</xliff:g> - <strong><xliff:g id="DEVICE_NAME">%3$s</xliff:g></strong>"</string>
+ <string name="profile_summary" msgid="3167701603666642104">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> is needed to manage your <xliff:g id="PROFILE_NAME_1">%2$s</xliff:g>. <xliff:g id="APP_NAME2">%3$s</xliff:g> will get access to <xliff:g id="PERMISSIONS">%4$s</xliff:g> while the <xliff:g id="PROFILE_NAME2">%5$s</xliff:g> is connected."</string>
+ <string name="consent_yes" msgid="4055438216605487056">"Yes"</string>
+ <string name="consent_no" msgid="1335543792857823917">"No, thanks"</string>
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-en-rCA/strings.xml b/packages/CompanionDeviceManager/res/values-en-rCA/strings.xml
index 91c7643..a30c199 100644
--- a/packages/CompanionDeviceManager/res/values-en-rCA/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-en-rCA/strings.xml
@@ -17,6 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Link with <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Link <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> with <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="chooser_title" msgid="2262294130493605839">"Choose a <xliff:g id="PROFILE_NAME">%1$s</xliff:g> to be managed by <strong><xliff:g id="APP_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="profile_name_generic" msgid="6851028682723034988">"device"</string>
+ <string name="confirmation_title" msgid="4751119145078041732">"Set <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> to manage your <xliff:g id="PROFILE_NAME">%2$s</xliff:g> - <strong><xliff:g id="DEVICE_NAME">%3$s</xliff:g></strong>"</string>
+ <string name="profile_summary" msgid="3167701603666642104">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> is needed to manage your <xliff:g id="PROFILE_NAME_1">%2$s</xliff:g>. <xliff:g id="APP_NAME2">%3$s</xliff:g> will get access to <xliff:g id="PERMISSIONS">%4$s</xliff:g> while the <xliff:g id="PROFILE_NAME2">%5$s</xliff:g> is connected."</string>
+ <string name="consent_yes" msgid="4055438216605487056">"Yes"</string>
+ <string name="consent_no" msgid="1335543792857823917">"No, thanks"</string>
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-en-rGB/strings.xml b/packages/CompanionDeviceManager/res/values-en-rGB/strings.xml
index 91c7643..a30c199 100644
--- a/packages/CompanionDeviceManager/res/values-en-rGB/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-en-rGB/strings.xml
@@ -17,6 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Link with <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Link <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> with <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="chooser_title" msgid="2262294130493605839">"Choose a <xliff:g id="PROFILE_NAME">%1$s</xliff:g> to be managed by <strong><xliff:g id="APP_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="profile_name_generic" msgid="6851028682723034988">"device"</string>
+ <string name="confirmation_title" msgid="4751119145078041732">"Set <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> to manage your <xliff:g id="PROFILE_NAME">%2$s</xliff:g> - <strong><xliff:g id="DEVICE_NAME">%3$s</xliff:g></strong>"</string>
+ <string name="profile_summary" msgid="3167701603666642104">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> is needed to manage your <xliff:g id="PROFILE_NAME_1">%2$s</xliff:g>. <xliff:g id="APP_NAME2">%3$s</xliff:g> will get access to <xliff:g id="PERMISSIONS">%4$s</xliff:g> while the <xliff:g id="PROFILE_NAME2">%5$s</xliff:g> is connected."</string>
+ <string name="consent_yes" msgid="4055438216605487056">"Yes"</string>
+ <string name="consent_no" msgid="1335543792857823917">"No, thanks"</string>
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-en-rIN/strings.xml b/packages/CompanionDeviceManager/res/values-en-rIN/strings.xml
index 91c7643..a30c199 100644
--- a/packages/CompanionDeviceManager/res/values-en-rIN/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-en-rIN/strings.xml
@@ -17,6 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Link with <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Link <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> with <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="chooser_title" msgid="2262294130493605839">"Choose a <xliff:g id="PROFILE_NAME">%1$s</xliff:g> to be managed by <strong><xliff:g id="APP_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="profile_name_generic" msgid="6851028682723034988">"device"</string>
+ <string name="confirmation_title" msgid="4751119145078041732">"Set <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> to manage your <xliff:g id="PROFILE_NAME">%2$s</xliff:g> - <strong><xliff:g id="DEVICE_NAME">%3$s</xliff:g></strong>"</string>
+ <string name="profile_summary" msgid="3167701603666642104">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> is needed to manage your <xliff:g id="PROFILE_NAME_1">%2$s</xliff:g>. <xliff:g id="APP_NAME2">%3$s</xliff:g> will get access to <xliff:g id="PERMISSIONS">%4$s</xliff:g> while the <xliff:g id="PROFILE_NAME2">%5$s</xliff:g> is connected."</string>
+ <string name="consent_yes" msgid="4055438216605487056">"Yes"</string>
+ <string name="consent_no" msgid="1335543792857823917">"No, thanks"</string>
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-en-rXC/strings.xml b/packages/CompanionDeviceManager/res/values-en-rXC/strings.xml
index e052e61..ea39d0a 100644
--- a/packages/CompanionDeviceManager/res/values-en-rXC/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-en-rXC/strings.xml
@@ -17,6 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Link with <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Link <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> with <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="chooser_title" msgid="2262294130493605839">"Choose a <xliff:g id="PROFILE_NAME">%1$s</xliff:g> to be managed by <strong><xliff:g id="APP_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="profile_name_generic" msgid="6851028682723034988">"device"</string>
+ <string name="confirmation_title" msgid="4751119145078041732">"Set <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> to manage your <xliff:g id="PROFILE_NAME">%2$s</xliff:g> - <strong><xliff:g id="DEVICE_NAME">%3$s</xliff:g></strong>"</string>
+ <string name="profile_summary" msgid="3167701603666642104">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> is needed to manage your <xliff:g id="PROFILE_NAME_1">%2$s</xliff:g>. <xliff:g id="APP_NAME2">%3$s</xliff:g> will get access to <xliff:g id="PERMISSIONS">%4$s</xliff:g> while the <xliff:g id="PROFILE_NAME2">%5$s</xliff:g> is connected."</string>
+ <string name="consent_yes" msgid="4055438216605487056">"Yes"</string>
+ <string name="consent_no" msgid="1335543792857823917">"No thanks"</string>
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-es-rUS/strings.xml b/packages/CompanionDeviceManager/res/values-es-rUS/strings.xml
index 0552ee7..579639f 100644
--- a/packages/CompanionDeviceManager/res/values-es-rUS/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-es-rUS/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Administrador de dispositivo complementario"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Vincular con <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Vincular <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> con <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-es/strings.xml b/packages/CompanionDeviceManager/res/values-es/strings.xml
index c9e218e..4192f5e 100644
--- a/packages/CompanionDeviceManager/res/values-es/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-es/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Gestor de dispositivos complementario"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Vincular con <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Vincular <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> con <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-et/strings.xml b/packages/CompanionDeviceManager/res/values-et/strings.xml
index 1ac26f7..5432ab3 100644
--- a/packages/CompanionDeviceManager/res/values-et/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-et/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Kaasseadme haldur"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Linkimine rakendusega <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Rakenduse <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> linkimine seadmega <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-eu/strings.xml b/packages/CompanionDeviceManager/res/values-eu/strings.xml
index 26e1979..6e9729b 100644
--- a/packages/CompanionDeviceManager/res/values-eu/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-eu/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Gailu osagarriaren kudeatzailea"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Lotu <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> aplikazioarekin"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Lotu <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> gailuarekin"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-fa/strings.xml b/packages/CompanionDeviceManager/res/values-fa/strings.xml
index b43fe29..c1d951e 100644
--- a/packages/CompanionDeviceManager/res/values-fa/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-fa/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"مدیر دستگاه مرتبط"</string>
- <string name="chooser_title" msgid="4958797271463138976">"پیوند با <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"پیوند <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> با <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-fi/strings.xml b/packages/CompanionDeviceManager/res/values-fi/strings.xml
index fbc18f6..eb9204a 100644
--- a/packages/CompanionDeviceManager/res/values-fi/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-fi/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Linkitä <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Linkitä <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ja <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-fr-rCA/strings.xml b/packages/CompanionDeviceManager/res/values-fr-rCA/strings.xml
index 05e3402..3c8fdd1 100644
--- a/packages/CompanionDeviceManager/res/values-fr-rCA/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-fr-rCA/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Gestionnaire d\'appareil compagnon"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Lier à <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Lier <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> à <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-fr/strings.xml b/packages/CompanionDeviceManager/res/values-fr/strings.xml
index 881d6aa..fc0e4da 100644
--- a/packages/CompanionDeviceManager/res/values-fr/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-fr/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Gestionnaire d\'appareils associés"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Associer à l\'application <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Associer l\'application <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> à l\'appareil <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-gl/strings.xml b/packages/CompanionDeviceManager/res/values-gl/strings.xml
index 6f85022..0a4e7fe 100644
--- a/packages/CompanionDeviceManager/res/values-gl/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-gl/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Xestor de dispositivos complementarios"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Vincular con <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Vincular <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> con <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-gu/strings.xml b/packages/CompanionDeviceManager/res/values-gu/strings.xml
index 5088507..bee2e77 100644
--- a/packages/CompanionDeviceManager/res/values-gu/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-gu/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"કમ્પેનિયન ડિવાઇસ મેનેજર"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> સાથે લિંક કરો"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>ને <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> સાથે લિંક કરો"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-hi/strings.xml b/packages/CompanionDeviceManager/res/values-hi/strings.xml
index 4afcb63..46bb4ce 100644
--- a/packages/CompanionDeviceManager/res/values-hi/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-hi/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"सहयोगी डिवाइस मैनेजर"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> से लिंक करें"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> को <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> से लिंक करें"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-hr/strings.xml b/packages/CompanionDeviceManager/res/values-hr/strings.xml
index 7b71939..beacbfd 100644
--- a/packages/CompanionDeviceManager/res/values-hr/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-hr/strings.xml
@@ -17,6 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Povežite s aplikacijom <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Povežite aplikaciju <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> s uređajem <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="chooser_title" msgid="2262294130493605839">"Odaberite profil <xliff:g id="PROFILE_NAME">%1$s</xliff:g> kojim će upravljati aplikacija <strong><xliff:g id="APP_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="profile_name_generic" msgid="6851028682723034988">"uređaj"</string>
+ <string name="confirmation_title" msgid="4751119145078041732">"Postavite aplikaciju <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> da upravlja vašim profilom <xliff:g id="PROFILE_NAME">%2$s</xliff:g> –- <strong><xliff:g id="DEVICE_NAME">%3$s</xliff:g></strong>"</string>
+ <string name="profile_summary" msgid="3167701603666642104">"Potrebna je <xliff:g id="APP_NAME_0">%1$s</xliff:g> za upravljanje vašim profilom <xliff:g id="PROFILE_NAME_1">%2$s</xliff:g>. Aplikacija <xliff:g id="APP_NAME2">%3$s</xliff:g> dobit će pristup dopuštenju za <xliff:g id="PERMISSIONS">%4$s</xliff:g> dok je povezan profil <xliff:g id="PROFILE_NAME2">%5$s</xliff:g>."</string>
+ <string name="consent_yes" msgid="4055438216605487056">"Da"</string>
+ <string name="consent_no" msgid="1335543792857823917">"Ne, hvala"</string>
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-hu/strings.xml b/packages/CompanionDeviceManager/res/values-hu/strings.xml
index 19920b2..cd29006 100644
--- a/packages/CompanionDeviceManager/res/values-hu/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-hu/strings.xml
@@ -17,6 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Társeszközök kezelője"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Összekapcsolás a(z) <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> alkalmazással"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"A(z) <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> alkalmazás és a(z) <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> eszköz összekapcsolása"</string>
+ <string name="chooser_title" msgid="2262294130493605839">"A(z) <strong><xliff:g id="APP_NAME">%2$s</xliff:g></strong> alkalmazással kezelni kívánt <xliff:g id="PROFILE_NAME">%1$s</xliff:g> kiválasztása"</string>
+ <string name="profile_name_generic" msgid="6851028682723034988">"eszköz"</string>
+ <string name="confirmation_title" msgid="4751119145078041732">"A(z) <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> alkalmazás beállítása a(z) <xliff:g id="PROFILE_NAME">%2$s</xliff:g> (<strong><xliff:g id="DEVICE_NAME">%3$s</xliff:g></strong>) kezelésére"</string>
+ <string name="profile_summary" msgid="3167701603666642104">"Szükség van a(z) <xliff:g id="APP_NAME_0">%1$s</xliff:g> alkalmazásra a(z) <xliff:g id="PROFILE_NAME_1">%2$s</xliff:g> kezeléséhez. Amíg csatlakoztatva van a(z) <xliff:g id="PROFILE_NAME2">%5$s</xliff:g>, a(z) <xliff:g id="APP_NAME2">%3$s</xliff:g> hozzáférést kap a következőkhöz: <xliff:g id="PERMISSIONS">%4$s</xliff:g>."</string>
+ <string name="consent_yes" msgid="4055438216605487056">"Igen"</string>
+ <string name="consent_no" msgid="1335543792857823917">"Nem"</string>
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-hy/strings.xml b/packages/CompanionDeviceManager/res/values-hy/strings.xml
index 8dee4a3..eb9204a 100644
--- a/packages/CompanionDeviceManager/res/values-hy/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-hy/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> հավելվածի հետ կապում"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> հավելվածի կապում <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> սարքի հետ"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-in/strings.xml b/packages/CompanionDeviceManager/res/values-in/strings.xml
index efd77fe7..7115961 100644
--- a/packages/CompanionDeviceManager/res/values-in/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-in/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Pengelola Perangkat Pendamping"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Tautkan dengan <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Tautkan <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> dengan <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-is/strings.xml b/packages/CompanionDeviceManager/res/values-is/strings.xml
index 4bf9447..615ce83 100644
--- a/packages/CompanionDeviceManager/res/values-is/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-is/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Stjórnun fylgdartækja"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Tengjast við <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Tengja <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> við <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-it/strings.xml b/packages/CompanionDeviceManager/res/values-it/strings.xml
index a602061..2632509 100644
--- a/packages/CompanionDeviceManager/res/values-it/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-it/strings.xml
@@ -17,6 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Gestione dispositivi companion"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Collega con <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Collega <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> con <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="chooser_title" msgid="2262294130493605839">"Scegli un <xliff:g id="PROFILE_NAME">%1$s</xliff:g> che sia gestito da <strong><xliff:g id="APP_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="profile_name_generic" msgid="6851028682723034988">"dispositivo"</string>
+ <string name="confirmation_title" msgid="4751119145078041732">"Configura <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> per gestire il tuo <xliff:g id="PROFILE_NAME">%2$s</xliff:g> - <strong><xliff:g id="DEVICE_NAME">%3$s</xliff:g></strong>"</string>
+ <string name="profile_summary" msgid="3167701603666642104">"È richiesta l\'app <xliff:g id="APP_NAME_0">%1$s</xliff:g> per gestire il tuo <xliff:g id="PROFILE_NAME_1">%2$s</xliff:g>. <xliff:g id="APP_NAME2">%3$s</xliff:g> avrà accesso a <xliff:g id="PERMISSIONS">%4$s</xliff:g> quando <xliff:g id="PROFILE_NAME2">%5$s</xliff:g> è connesso."</string>
+ <string name="consent_yes" msgid="4055438216605487056">"Sì"</string>
+ <string name="consent_no" msgid="1335543792857823917">"No, grazie"</string>
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-iw/strings.xml b/packages/CompanionDeviceManager/res/values-iw/strings.xml
index b95fae5..05154ee 100644
--- a/packages/CompanionDeviceManager/res/values-iw/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-iw/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"ניהול מכשיר מותאם"</string>
- <string name="chooser_title" msgid="4958797271463138976">"קישור אל <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"קישור <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> אל <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ja/strings.xml b/packages/CompanionDeviceManager/res/values-ja/strings.xml
index 8c39e70..76fd4b6 100644
--- a/packages/CompanionDeviceManager/res/values-ja/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ja/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"コンパニオン デバイス マネージャ"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> とのリンク"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> と <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> とのリンク"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ka/strings.xml b/packages/CompanionDeviceManager/res/values-ka/strings.xml
index 6fa899a..df70f08 100644
--- a/packages/CompanionDeviceManager/res/values-ka/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ka/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"კომპანიონი მოწყობილობების მენეჯერი"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>-თან მიბმა"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"მიაბით ერთმანეთს <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> და <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-kk/strings.xml b/packages/CompanionDeviceManager/res/values-kk/strings.xml
index 18ab5e6f..eb9204a 100644
--- a/packages/CompanionDeviceManager/res/values-kk/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-kk/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> қолданбасымен байланыстыру"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> қолданбасымен және <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> құрылғысымен байланыстыру"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-km/strings.xml b/packages/CompanionDeviceManager/res/values-km/strings.xml
index 42efac4..8c1de45 100644
--- a/packages/CompanionDeviceManager/res/values-km/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-km/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"កម្មវិធីគ្រប់គ្រងឧបករណ៍ដៃគូ"</string>
- <string name="chooser_title" msgid="4958797271463138976">"ភ្ជាប់ជាមួយ <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"ភ្ជាប់ <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ជាមួយ <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-kn/strings.xml b/packages/CompanionDeviceManager/res/values-kn/strings.xml
index e21bb02..1c3d07b 100644
--- a/packages/CompanionDeviceManager/res/values-kn/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-kn/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"ಕಂಪ್ಯಾನಿಯನ್ ಸಾಧನ ನಿರ್ವಾಹಕರು"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ನ ಜೊತೆಗೆ ಲಿಂಕ್ ಮಾಡಿ"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ಅನ್ನು <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> ನ ಜೊತೆಗೆ ಲಿಂಕ್ ಮಾಡಿ"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ko/strings.xml b/packages/CompanionDeviceManager/res/values-ko/strings.xml
index 17702f5..7cfe8b6 100644
--- a/packages/CompanionDeviceManager/res/values-ko/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ko/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"부속 기기 관리자"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> 연결"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>을(를) <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>에 연결"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ky/strings.xml b/packages/CompanionDeviceManager/res/values-ky/strings.xml
index 63efea7..eb9204a 100644
--- a/packages/CompanionDeviceManager/res/values-ky/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ky/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> колдонмосу менен байланыштыруу"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> колдонмосун <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> түзмөгү менен байланыштыруу"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-lo/strings.xml b/packages/CompanionDeviceManager/res/values-lo/strings.xml
index f637551..97d4c33 100644
--- a/packages/CompanionDeviceManager/res/values-lo/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-lo/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"ຕົວຈັດການອຸປະກອນປະກອບ"</string>
- <string name="chooser_title" msgid="4958797271463138976">"ເຊື່ອມຕໍ່ກັບ <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"ເຊື່ອມຕໍ່ <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ກັບ <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-lt/strings.xml b/packages/CompanionDeviceManager/res/values-lt/strings.xml
index ddaa601..eb9204a 100644
--- a/packages/CompanionDeviceManager/res/values-lt/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-lt/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Susieti su pr. <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Susieti programą <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> su <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> įrenginiu"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-lv/strings.xml b/packages/CompanionDeviceManager/res/values-lv/strings.xml
index ba8840c..39eafe1 100644
--- a/packages/CompanionDeviceManager/res/values-lv/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-lv/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Palīgierīču pārzinis"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Saistīšana ar lietotni <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Lietotnes <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> saistīšana ar ierīci <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-mk/strings.xml b/packages/CompanionDeviceManager/res/values-mk/strings.xml
index 4c2e4117..eb9204a 100644
--- a/packages/CompanionDeviceManager/res/values-mk/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-mk/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Поврзување со <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Поврзување на <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> со <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ml/strings.xml b/packages/CompanionDeviceManager/res/values-ml/strings.xml
index 950e4e4..8e750de 100644
--- a/packages/CompanionDeviceManager/res/values-ml/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ml/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"കമ്പാനിയൻ ഉപകരണ മാനേജർ"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ഉപയോഗിച്ച് ലിങ്ക് ചെയ്യുക"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> with <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> ലിങ്ക് ചെയ്യുക"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-mn/strings.xml b/packages/CompanionDeviceManager/res/values-mn/strings.xml
index 5add54a..eb9204a 100644
--- a/packages/CompanionDeviceManager/res/values-mn/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-mn/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>-тай холбох"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>-г <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>-тай холбох"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-mr/strings.xml b/packages/CompanionDeviceManager/res/values-mr/strings.xml
index 45348c0..4f8f4ee 100644
--- a/packages/CompanionDeviceManager/res/values-mr/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-mr/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"सहयोगी डिव्हाइस व्यवस्थापक"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g><strong> सह लिंक करा"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> ला <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> शी लिंक करा"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ms/strings.xml b/packages/CompanionDeviceManager/res/values-ms/strings.xml
index 5a50f15..c170afa 100644
--- a/packages/CompanionDeviceManager/res/values-ms/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ms/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Pengurus Peranti Rakan"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Paut dengan <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Paut <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> dengan <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-my/strings.xml b/packages/CompanionDeviceManager/res/values-my/strings.xml
index 3fba5ff..6d0274f 100644
--- a/packages/CompanionDeviceManager/res/values-my/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-my/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"တွဲဖက်ကိရိယာ မန်နေဂျာ"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<xliff:g id="APP_NAME">%1$s</xliff:g></strong> ဖြင့် ချိတ်ဆက်ရန်<strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<xliff:g id="APP_NAME">%1$s</xliff:g> ကို <xliff:g id="DEVICE_NAME">%2$s</xliff:g> ဖြင့် ချိတ်ဆက်ခြင်း <strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-nb/strings.xml b/packages/CompanionDeviceManager/res/values-nb/strings.xml
index 0b49f47..eb9204a 100644
--- a/packages/CompanionDeviceManager/res/values-nb/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-nb/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Knytt til <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Knytt <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> til <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ne/strings.xml b/packages/CompanionDeviceManager/res/values-ne/strings.xml
index 348104f..99ba62b 100644
--- a/packages/CompanionDeviceManager/res/values-ne/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ne/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"सहयोगी यन्त्रको प्रबन्धक"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> सँग लिंक गर्नुहोस्"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> सँग <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> लाई लिंक गर्नुहोस्"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-nl/strings.xml b/packages/CompanionDeviceManager/res/values-nl/strings.xml
index 12177ca..5a7fb3a 100644
--- a/packages/CompanionDeviceManager/res/values-nl/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-nl/strings.xml
@@ -17,6 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Koppelen met <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> met <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> koppelen"</string>
+ <string name="chooser_title" msgid="2262294130493605839">"Een <xliff:g id="PROFILE_NAME">%1$s</xliff:g> kiezen om te beheren met <strong><xliff:g id="APP_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="profile_name_generic" msgid="6851028682723034988">"apparaat"</string>
+ <string name="confirmation_title" msgid="4751119145078041732">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> instellen om je <xliff:g id="PROFILE_NAME">%2$s</xliff:g> - <strong><xliff:g id="DEVICE_NAME">%3$s</xliff:g></strong> te beheren"</string>
+ <string name="profile_summary" msgid="3167701603666642104">"Je hebt <xliff:g id="APP_NAME_0">%1$s</xliff:g> nodig om je <xliff:g id="PROFILE_NAME_1">%2$s</xliff:g> te beheren. <xliff:g id="APP_NAME2">%3$s</xliff:g> krijgt toegang tot <xliff:g id="PERMISSIONS">%4$s</xliff:g> terwijl je <xliff:g id="PROFILE_NAME2">%5$s</xliff:g> is verbonden."</string>
+ <string name="consent_yes" msgid="4055438216605487056">"Ja"</string>
+ <string name="consent_no" msgid="1335543792857823917">"Nee, bedankt"</string>
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-or/strings.xml b/packages/CompanionDeviceManager/res/values-or/strings.xml
index b5a9e1c..732017a 100644
--- a/packages/CompanionDeviceManager/res/values-or/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-or/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"ସହଯୋଗୀ ଡିଭାଇସ୍ ପରିଚାଳକ"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ସହ ଲିଙ୍କ୍ କରନ୍ତୁ"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> ସହିତ <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ଲିଙ୍କ୍ କରନ୍ତୁ"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-pa/strings.xml b/packages/CompanionDeviceManager/res/values-pa/strings.xml
index 70a408f..a61c759 100644
--- a/packages/CompanionDeviceManager/res/values-pa/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-pa/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"ਸੰਬੰਧੀ ਡੀਵਾਈਸ ਪ੍ਰਬੰਧਕ"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ਨਾਲ ਲਿੰਕ ਕਰੋ"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ਨੂੰ <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> ਨਾਲ ਲਿੰਕ ਕਰੋ"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-pl/strings.xml b/packages/CompanionDeviceManager/res/values-pl/strings.xml
index c622cedc..a828370 100644
--- a/packages/CompanionDeviceManager/res/values-pl/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-pl/strings.xml
@@ -17,6 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Menedżer urządzeń towarzyszących"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Połącz z: <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Połącz: <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> z: <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="chooser_title" msgid="2262294130493605839">"Wybierz profil <xliff:g id="PROFILE_NAME">%1$s</xliff:g>, którym ma zarządzać aplikacja <strong><xliff:g id="APP_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="profile_name_generic" msgid="6851028682723034988">"urządzenie"</string>
+ <string name="confirmation_title" msgid="4751119145078041732">"Ustaw aplikację <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> do zarządzania profilem <xliff:g id="PROFILE_NAME">%2$s</xliff:g> na urządzeniu <strong><xliff:g id="DEVICE_NAME">%3$s</xliff:g></strong>"</string>
+ <string name="profile_summary" msgid="3167701603666642104">"Aplikacja <xliff:g id="APP_NAME_0">%1$s</xliff:g> jest wymagana do zarządzania profilem <xliff:g id="PROFILE_NAME_1">%2$s</xliff:g>. Kiedy profil <xliff:g id="PROFILE_NAME2">%5$s</xliff:g> będzie połączony, <xliff:g id="APP_NAME2">%3$s</xliff:g> będzie mieć te uprawnienia: <xliff:g id="PERMISSIONS">%4$s</xliff:g>."</string>
+ <string name="consent_yes" msgid="4055438216605487056">"Tak"</string>
+ <string name="consent_no" msgid="1335543792857823917">"Nie, dziękuję"</string>
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-pt-rBR/strings.xml b/packages/CompanionDeviceManager/res/values-pt-rBR/strings.xml
index b18c3ad..8d96226 100644
--- a/packages/CompanionDeviceManager/res/values-pt-rBR/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-pt-rBR/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Gerenciador de dispositivos complementar"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Vincular a <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Vincular <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> a <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-pt-rPT/strings.xml b/packages/CompanionDeviceManager/res/values-pt-rPT/strings.xml
index a64c544..bb84540 100644
--- a/packages/CompanionDeviceManager/res/values-pt-rPT/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-pt-rPT/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Gestor de dispositivos associados"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Associe à aplicação <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Associe a aplicação <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ao dispositivo <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-pt/strings.xml b/packages/CompanionDeviceManager/res/values-pt/strings.xml
index b18c3ad..8d96226 100644
--- a/packages/CompanionDeviceManager/res/values-pt/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-pt/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Gerenciador de dispositivos complementar"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Vincular a <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Vincular <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> a <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ro/strings.xml b/packages/CompanionDeviceManager/res/values-ro/strings.xml
index 1c78602..6446ce0 100644
--- a/packages/CompanionDeviceManager/res/values-ro/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ro/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Manager de dispozitiv Companion"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Conectați cu <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Conectați <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> cu <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ru/strings.xml b/packages/CompanionDeviceManager/res/values-ru/strings.xml
index 74b9100..4923f1f 100644
--- a/packages/CompanionDeviceManager/res/values-ru/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ru/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Управление подключенными устройствами"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Подключение к приложению <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Подключение приложения <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> к устройству <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-si/strings.xml b/packages/CompanionDeviceManager/res/values-si/strings.xml
index 89f4409..eb8d872 100644
--- a/packages/CompanionDeviceManager/res/values-si/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-si/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"සහායක උපාංග කළමනාකරු"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> සමඟ සම්බන්ධ කරන්න"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> සමඟ <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> සම්බන්ධ කරන්න"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-sk/strings.xml b/packages/CompanionDeviceManager/res/values-sk/strings.xml
index 21b3b30..bf66ced 100644
--- a/packages/CompanionDeviceManager/res/values-sk/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-sk/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Správca sprievodných zariadení"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Prepojenie s aplikáciou <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Prepojenie <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> so zariadením <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-sl/strings.xml b/packages/CompanionDeviceManager/res/values-sl/strings.xml
index 5645fb1..644b960 100644
--- a/packages/CompanionDeviceManager/res/values-sl/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-sl/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Upravitelj spremljevalnih naprav"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Povezava z aplikacijo <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Povezava aplikacije <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> z napravo <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-sq/strings.xml b/packages/CompanionDeviceManager/res/values-sq/strings.xml
index 793554f..84812dc 100644
--- a/packages/CompanionDeviceManager/res/values-sq/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-sq/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Menaxheri i pajisjes shoqëruese"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Lidh me <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Lidh <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> me <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-sr/strings.xml b/packages/CompanionDeviceManager/res/values-sr/strings.xml
index eac6805..3507af3 100644
--- a/packages/CompanionDeviceManager/res/values-sr/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-sr/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Менаџер придруженог уређаја"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Повежите са апликацијом <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Повежите апликацију <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> и уређај <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-sv/strings.xml b/packages/CompanionDeviceManager/res/values-sv/strings.xml
index 7d2ad85..caacba0 100644
--- a/packages/CompanionDeviceManager/res/values-sv/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-sv/strings.xml
@@ -17,6 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Länka med <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Länka <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> till <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="chooser_title" msgid="2262294130493605839">"Välj en <xliff:g id="PROFILE_NAME">%1$s</xliff:g> för hantering av <strong><xliff:g id="APP_NAME">%2$s</xliff:g></strong>"</string>
+ <string name="profile_name_generic" msgid="6851028682723034988">"enhet"</string>
+ <string name="confirmation_title" msgid="4751119145078041732">"Konfigurera <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> för att hantera din <xliff:g id="PROFILE_NAME">%2$s</xliff:g> – <strong><xliff:g id="DEVICE_NAME">%3$s</xliff:g></strong>"</string>
+ <string name="profile_summary" msgid="3167701603666642104">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> krävs för att hantera din <xliff:g id="PROFILE_NAME_1">%2$s</xliff:g>. <xliff:g id="APP_NAME2">%3$s</xliff:g> får åtkomst till <xliff:g id="PERMISSIONS">%4$s</xliff:g> medan <xliff:g id="PROFILE_NAME2">%5$s</xliff:g> är ansluten."</string>
+ <string name="consent_yes" msgid="4055438216605487056">"Ja"</string>
+ <string name="consent_no" msgid="1335543792857823917">"Nej tack"</string>
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-sw/strings.xml b/packages/CompanionDeviceManager/res/values-sw/strings.xml
index 8308bbd..13e7879 100644
--- a/packages/CompanionDeviceManager/res/values-sw/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-sw/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Kidhibiti cha Vifaa Visaidizi"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Unganisha na <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Ungansha <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> na <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ta/strings.xml b/packages/CompanionDeviceManager/res/values-ta/strings.xml
index 0511037..9cc9aa7 100644
--- a/packages/CompanionDeviceManager/res/values-ta/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ta/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"கம்பேனியன் சாதன நிர்வாகி"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ஆப்ஸுடன் இணைத்தல்"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ஆப்ஸை <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> சாதனத்துடன் இணைத்தல்"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-te/strings.xml b/packages/CompanionDeviceManager/res/values-te/strings.xml
index ebcc7f5..a4dcba6 100644
--- a/packages/CompanionDeviceManager/res/values-te/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-te/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"సహచర పరికర మేనేజర్"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>తో లింక్ చేయండి"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> with <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>తో లింక్ చేయండి"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-th/strings.xml b/packages/CompanionDeviceManager/res/values-th/strings.xml
index 3240794..eb9204a 100644
--- a/packages/CompanionDeviceManager/res/values-th/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-th/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"ลิงก์กับ <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"ลิงก์ <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> กับ <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-tl/strings.xml b/packages/CompanionDeviceManager/res/values-tl/strings.xml
index 444b0d8..1f0d78e 100644
--- a/packages/CompanionDeviceManager/res/values-tl/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-tl/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Kasamang Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"I-link sa <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"I-link ang <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> sa <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-tr/strings.xml b/packages/CompanionDeviceManager/res/values-tr/strings.xml
index 9c20ed4..eb9204a 100644
--- a/packages/CompanionDeviceManager/res/values-tr/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-tr/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> uygulamasına bağlan"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> uygulamasını <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> cihazına bağla"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-uk/strings.xml b/packages/CompanionDeviceManager/res/values-uk/strings.xml
index bed8d4d..46de2cdc 100644
--- a/packages/CompanionDeviceManager/res/values-uk/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-uk/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Диспетчер супутніх пристроїв"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Налаштуйте зв’язок із додатком <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Зв’яжіть пристрій <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> з додатком <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ur/strings.xml b/packages/CompanionDeviceManager/res/values-ur/strings.xml
index e9ad738..d2ce1fb 100644
--- a/packages/CompanionDeviceManager/res/values-ur/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ur/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"ساتھی آلہ مینیجر"</string>
- <string name="chooser_title" msgid="4958797271463138976">";lt;strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong&gt& سے لنک کریں"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> کو <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> سے لنک کریں"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-uz/strings.xml b/packages/CompanionDeviceManager/res/values-uz/strings.xml
index c7d82ad..eb9204a 100644
--- a/packages/CompanionDeviceManager/res/values-uz/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-uz/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> ilovasiga ulash"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> with <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong> ilovasiga ulash"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-vi/strings.xml b/packages/CompanionDeviceManager/res/values-vi/strings.xml
index 29e128c..eb9204a 100644
--- a/packages/CompanionDeviceManager/res/values-vi/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-vi/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Companion Device Manager"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Liên kết với <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Liên kết <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> với <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-zh-rCN/strings.xml b/packages/CompanionDeviceManager/res/values-zh-rCN/strings.xml
index 8e962185..64efeac 100644
--- a/packages/CompanionDeviceManager/res/values-zh-rCN/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-zh-rCN/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"配套设备管理器"</string>
- <string name="chooser_title" msgid="4958797271463138976">"关联 <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"将 <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> 关联到 <strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-zh-rHK/strings.xml b/packages/CompanionDeviceManager/res/values-zh-rHK/strings.xml
index dd055d0..ecacf3a 100644
--- a/packages/CompanionDeviceManager/res/values-zh-rHK/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-zh-rHK/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"隨附裝置管理員"</string>
- <string name="chooser_title" msgid="4958797271463138976">"使用「<xliff:g id="APP_NAME">%1$s</xliff:g>」<strong></strong>連接"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"連結「<xliff:g id="DEVICE_NAME">%2$s</xliff:g>」<strong></strong>和「<xliff:g id="APP_NAME">%1$s</xliff:g>」<strong></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-zh-rTW/strings.xml b/packages/CompanionDeviceManager/res/values-zh-rTW/strings.xml
index 2c46d59..ecacf3a 100644
--- a/packages/CompanionDeviceManager/res/values-zh-rTW/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-zh-rTW/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"隨附裝置管理員"</string>
- <string name="chooser_title" msgid="4958797271463138976">"與「<xliff:g id="APP_NAME">%1$s</xliff:g>」<strong></strong>連結"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"為「<xliff:g id="APP_NAME">%1$s</xliff:g>」<strong></strong>與<strong></strong> <xliff:g id="DEVICE_NAME">%2$s</xliff:g> 建立連結"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-zu/strings.xml b/packages/CompanionDeviceManager/res/values-zu/strings.xml
index 80a24ff..74f7a0e 100644
--- a/packages/CompanionDeviceManager/res/values-zu/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-zu/strings.xml
@@ -17,6 +17,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4470785958457506021">"Isiphathi sedivayisi esihambisanayo"</string>
- <string name="chooser_title" msgid="4958797271463138976">"Xhuma ne-<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong>"</string>
- <string name="confirmation_title" msgid="5683126664999349196">"Xhuma ne-<strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> nge-<strong><xliff:g id="DEVICE_NAME">%2$s</xliff:g></strong>"</string>
+ <!-- no translation found for chooser_title (2262294130493605839) -->
+ <skip />
+ <!-- no translation found for profile_name_generic (6851028682723034988) -->
+ <skip />
+ <!-- no translation found for confirmation_title (4751119145078041732) -->
+ <skip />
+ <!-- no translation found for profile_summary (3167701603666642104) -->
+ <skip />
+ <!-- no translation found for consent_yes (4055438216605487056) -->
+ <skip />
+ <!-- no translation found for consent_no (1335543792857823917) -->
+ <skip />
</resources>
diff --git a/packages/Connectivity/service/Android.bp b/packages/Connectivity/service/Android.bp
new file mode 100644
index 0000000..a26f715
--- /dev/null
+++ b/packages/Connectivity/service/Android.bp
@@ -0,0 +1,79 @@
+//
+// 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.
+//
+
+cc_defaults {
+ name: "libservice-connectivity-defaults",
+ // TODO: build against the NDK (sdk_version: "30" for example)
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-parameter",
+ "-Wthread-safety",
+ ],
+ srcs: [
+ "jni/com_android_server_TestNetworkService.cpp",
+ "jni/com_android_server_connectivity_Vpn.cpp",
+ ],
+ shared_libs: [
+ "libbase",
+ "liblog",
+ "libnativehelper",
+ // TODO: remove dependency on ifc_[add/del]_address by having Java code to add/delete
+ // addresses, and remove dependency on libnetutils.
+ "libnetutils",
+ ],
+}
+
+cc_library_shared {
+ name: "libservice-connectivity",
+ defaults: ["libservice-connectivity-defaults"],
+ srcs: [
+ "jni/onload.cpp",
+ ],
+ apex_available: [
+ // TODO: move this library to the tethering APEX and remove libservice-connectivity-static
+ // "com.android.tethering",
+ ],
+}
+
+// Static library linked into libservices.core until libservice-connectivity can be loaded from
+// the tethering APEX instead.
+cc_library_static {
+ name: "libservice-connectivity-static",
+ defaults: ["libservice-connectivity-defaults"],
+}
+
+java_library {
+ name: "service-connectivity",
+ srcs: [
+ ":connectivity-service-srcs",
+ ],
+ installable: true,
+ jarjar_rules: "jarjar-rules.txt",
+ libs: [
+ "android.net.ipsec.ike",
+ "services.core",
+ "services.net",
+ "unsupportedappusage",
+ ],
+ static_libs: [
+ "net-utils-device-common",
+ "net-utils-framework-common",
+ ],
+ apex_available: [
+ "//apex_available:platform",
+ ],
+}
diff --git a/packages/Connectivity/service/jarjar-rules.txt b/packages/Connectivity/service/jarjar-rules.txt
new file mode 100644
index 0000000..ef53ebb
--- /dev/null
+++ b/packages/Connectivity/service/jarjar-rules.txt
@@ -0,0 +1 @@
+rule com.android.net.module.util.** com.android.connectivity.util.@1
\ No newline at end of file
diff --git a/services/core/jni/com_android_server_TestNetworkService.cpp b/packages/Connectivity/service/jni/com_android_server_TestNetworkService.cpp
similarity index 100%
rename from services/core/jni/com_android_server_TestNetworkService.cpp
rename to packages/Connectivity/service/jni/com_android_server_TestNetworkService.cpp
diff --git a/services/core/jni/com_android_server_connectivity_Vpn.cpp b/packages/Connectivity/service/jni/com_android_server_connectivity_Vpn.cpp
similarity index 99%
rename from services/core/jni/com_android_server_connectivity_Vpn.cpp
rename to packages/Connectivity/service/jni/com_android_server_connectivity_Vpn.cpp
index 836d6d8..ea5e718 100644
--- a/services/core/jni/com_android_server_connectivity_Vpn.cpp
+++ b/packages/Connectivity/service/jni/com_android_server_connectivity_Vpn.cpp
@@ -34,6 +34,7 @@
#include <sys/types.h>
#include <log/log.h>
+#include <android/log.h>
#include "netutils/ifc.h"
diff --git a/packages/Connectivity/service/jni/onload.cpp b/packages/Connectivity/service/jni/onload.cpp
new file mode 100644
index 0000000..3afcb0e
--- /dev/null
+++ b/packages/Connectivity/service/jni/onload.cpp
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+
+#include <nativehelper/JNIHelp.h>
+#include <log/log.h>
+
+namespace android {
+
+int register_android_server_connectivity_Vpn(JNIEnv* env);
+int register_android_server_TestNetworkService(JNIEnv* env);
+
+extern "C" jint JNI_OnLoad(JavaVM* vm, void*) {
+ JNIEnv *env;
+ if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) {
+ ALOGE("GetEnv failed");
+ return JNI_ERR;
+ }
+
+ if (register_android_server_connectivity_Vpn(env) < 0
+ || register_android_server_TestNetworkService(env) < 0) {
+ return JNI_ERR;
+ }
+
+ return JNI_VERSION_1_6;
+}
+
+};
\ No newline at end of file
diff --git a/packages/DynamicSystemInstallationService/OWNERS b/packages/DynamicSystemInstallationService/OWNERS
new file mode 100644
index 0000000..c1b7ec4
--- /dev/null
+++ b/packages/DynamicSystemInstallationService/OWNERS
@@ -0,0 +1,3 @@
+howardsoc@google.com
+pchsueh@google.com
+yochiang@google.com
diff --git a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java
index ac27580..a4896cb2 100644
--- a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java
+++ b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java
@@ -211,10 +211,10 @@
@Override
public void onProgressUpdate(InstallationAsyncTask.Progress progress) {
- mCurrentPartitionName = progress.mPartitionName;
- mCurrentPartitionSize = progress.mPartitionSize;
- mCurrentPartitionInstalledSize = progress.mInstalledSize;
- mNumInstalledPartitions = progress.mNumInstalledPartitions;
+ mCurrentPartitionName = progress.partitionName;
+ mCurrentPartitionSize = progress.partitionSize;
+ mCurrentPartitionInstalledSize = progress.installedSize;
+ mNumInstalledPartitions = progress.numInstalledPartitions;
postStatus(STATUS_IN_PROGRESS, CAUSE_NOT_SPECIFIED, null);
}
diff --git a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/InstallationAsyncTask.java b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/InstallationAsyncTask.java
index 4d31ce9..ac73f35 100644
--- a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/InstallationAsyncTask.java
+++ b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/InstallationAsyncTask.java
@@ -102,20 +102,16 @@
static final int RESULT_ERROR_UNSUPPORTED_FORMAT = 5;
static final int RESULT_ERROR_EXCEPTION = 6;
- class Progress {
- String mPartitionName;
- long mPartitionSize;
- long mInstalledSize;
+ static class Progress {
+ public final String partitionName;
+ public final long partitionSize;
+ public final int numInstalledPartitions;
+ public long installedSize;
- int mNumInstalledPartitions;
-
- Progress(String partitionName, long partitionSize, long installedSize,
- int numInstalled) {
- mPartitionName = partitionName;
- mPartitionSize = partitionSize;
- mInstalledSize = installedSize;
-
- mNumInstalledPartitions = numInstalled;
+ Progress(String partitionName, long partitionSize, int numInstalledPartitions) {
+ this.partitionName = partitionName;
+ this.partitionSize = partitionSize;
+ this.numInstalledPartitions = numInstalledPartitions;
}
}
@@ -141,6 +137,8 @@
private boolean mIsZip;
private boolean mIsCompleted;
+ private int mNumInstalledPartitions;
+
private InputStream mStream;
private ZipFile mZipFile;
@@ -312,18 +310,17 @@
Log.d(TAG, "Creating partition: userdata");
thread.start();
- long installedSize = 0;
- Progress progress = new Progress("userdata", mUserdataSize, installedSize, 0);
+ Progress progress = new Progress("userdata", mUserdataSize, mNumInstalledPartitions++);
while (thread.isAlive()) {
if (isCancelled()) {
return;
}
- installedSize = mDynSystem.getInstallationProgress().bytes_processed;
+ final long installedSize = mDynSystem.getInstallationProgress().bytes_processed;
- if (installedSize > progress.mInstalledSize + MIN_PROGRESS_TO_PUBLISH) {
- progress.mInstalledSize = installedSize;
+ if (installedSize > progress.installedSize + MIN_PROGRESS_TO_PUBLISH) {
+ progress.installedSize = installedSize;
publishProgress(progress);
}
@@ -357,7 +354,7 @@
private void installStreamingGzUpdate()
throws IOException, InterruptedException, ImageValidationException {
Log.d(TAG, "To install a streaming GZ update");
- installImage("system", mSystemSize, new GZIPInputStream(mStream), 1);
+ installImage("system", mSystemSize, new GZIPInputStream(mStream));
}
private void installStreamingZipUpdate()
@@ -367,12 +364,8 @@
ZipInputStream zis = new ZipInputStream(mStream);
ZipEntry zipEntry = null;
- int numInstalledPartitions = 1;
-
while ((zipEntry = zis.getNextEntry()) != null) {
- if (installImageFromAnEntry(zipEntry, zis, numInstalledPartitions)) {
- numInstalledPartitions++;
- }
+ installImageFromAnEntry(zipEntry, zis);
if (isCancelled()) {
break;
@@ -385,14 +378,10 @@
Log.d(TAG, "To install a local ZIP update");
Enumeration<? extends ZipEntry> entries = mZipFile.entries();
- int numInstalledPartitions = 1;
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
- if (installImageFromAnEntry(
- entry, mZipFile.getInputStream(entry), numInstalledPartitions)) {
- numInstalledPartitions++;
- }
+ installImageFromAnEntry(entry, mZipFile.getInputStream(entry));
if (isCancelled()) {
break;
@@ -400,8 +389,7 @@
}
}
- private boolean installImageFromAnEntry(
- ZipEntry entry, InputStream is, int numInstalledPartitions)
+ private boolean installImageFromAnEntry(ZipEntry entry, InputStream is)
throws IOException, InterruptedException, ImageValidationException {
String name = entry.getName();
@@ -420,13 +408,12 @@
long uncompressedSize = entry.getSize();
- installImage(partitionName, uncompressedSize, is, numInstalledPartitions);
+ installImage(partitionName, uncompressedSize, is);
return true;
}
- private void installImage(
- String partitionName, long uncompressedSize, InputStream is, int numInstalledPartitions)
+ private void installImage(String partitionName, long uncompressedSize, InputStream is)
throws IOException, InterruptedException, ImageValidationException {
SparseInputStream sis = new SparseInputStream(new BufferedInputStream(is));
@@ -473,10 +460,9 @@
mInstallationSession.setAshmem(pfd, READ_BUFFER_SIZE);
- long installedSize = 0;
- Progress progress = new Progress(
- partitionName, partitionSize, installedSize, numInstalledPartitions);
+ Progress progress = new Progress(partitionName, partitionSize, mNumInstalledPartitions++);
+ long installedSize = 0;
byte[] bytes = new byte[READ_BUFFER_SIZE];
int numBytesRead;
@@ -493,8 +479,8 @@
installedSize += numBytesRead;
- if (installedSize > progress.mInstalledSize + MIN_PROGRESS_TO_PUBLISH) {
- progress.mInstalledSize = installedSize;
+ if (installedSize > progress.installedSize + MIN_PROGRESS_TO_PUBLISH) {
+ progress.installedSize = installedSize;
publishProgress(progress);
}
}
diff --git a/packages/FusedLocation/test/src/com/android/location/fused/tests/FusedLocationServiceTest.java b/packages/FusedLocation/test/src/com/android/location/fused/tests/FusedLocationServiceTest.java
index f9f1607..2bda530 100644
--- a/packages/FusedLocation/test/src/com/android/location/fused/tests/FusedLocationServiceTest.java
+++ b/packages/FusedLocation/test/src/com/android/location/fused/tests/FusedLocationServiceTest.java
@@ -27,6 +27,7 @@
import android.location.LocationManager;
import android.location.LocationRequest;
import android.location.LocationResult;
+import android.location.ProviderProperties;
import android.os.ParcelFileDescriptor;
import android.os.SystemClock;
import android.os.WorkSource;
@@ -37,7 +38,6 @@
import com.android.internal.location.ILocationProvider;
import com.android.internal.location.ILocationProviderManager;
-import com.android.internal.location.ProviderProperties;
import com.android.internal.location.ProviderRequest;
import com.android.location.fused.FusedLocationProvider;
@@ -153,7 +153,8 @@
}
@Override
- public void onSetIdentity(String packageName, String attributionTag) {
+ public void onInitialize(boolean allowed, ProviderProperties properties, String packageName,
+ String attributionTag) {
}
diff --git a/packages/OsuLogin/Android.bp b/packages/OsuLogin/Android.bp
deleted file mode 100644
index 445c81b..0000000
--- a/packages/OsuLogin/Android.bp
+++ /dev/null
@@ -1,18 +0,0 @@
-android_app {
- name: "OsuLogin",
- defaults: ["wifi-module-sdk-version-defaults"],
- static_libs: ["androidx.legacy_legacy-support-v4"],
- resource_dirs: ["res"],
- srcs: ["src/**/*.java"],
- sdk_version: "system_current",
- certificate: ":com.android.hotspot2.osulogin.certificate",
- apex_available: [
- "com.android.wifi",
- "test_com.android.wifi",
- ],
-}
-
-android_app_certificate {
- name: "com.android.hotspot2.osulogin.certificate",
- certificate: "certs/com.android.hotspot2.osulogin"
-}
diff --git a/packages/OsuLogin/AndroidManifest.xml b/packages/OsuLogin/AndroidManifest.xml
deleted file mode 100644
index 730cd87..0000000
--- a/packages/OsuLogin/AndroidManifest.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * 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.
- */
--->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.hotspot2.osulogin">
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
- <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
- <uses-permission android:name="android.permission.INTERNET"/>
-
- <application
- android:networkSecurityConfig="@xml/network_security_config"
- android:enabled="true"
- android:label="@string/app_name"
- android:configChanges="keyboardHidden|orientation|screenSize"
- android:supportsRtl="true">
- <activity android:name="com.android.hotspot2.osulogin.OsuLoginActivity"
- android:label="@string/action_bar_label"
- android:theme="@style/AppTheme"
- android:configChanges="keyboardHidden|orientation|screenSize"
- android:exported="true">
- <intent-filter>
- <action android:name="android.net.wifi.action.PASSPOINT_LAUNCH_OSU_VIEW"/>
- <category android:name="android.intent.category.DEFAULT"/>
- </intent-filter>
- </activity>
- </application>
-</manifest>
diff --git a/packages/OsuLogin/OWNERS b/packages/OsuLogin/OWNERS
deleted file mode 100644
index aa7c3e6..0000000
--- a/packages/OsuLogin/OWNERS
+++ /dev/null
@@ -1,2 +0,0 @@
-satk@google.com
-etancohen@google.com
diff --git a/packages/OsuLogin/certs/com.android.hotspot2.osulogin.pk8 b/packages/OsuLogin/certs/com.android.hotspot2.osulogin.pk8
deleted file mode 100644
index 87fd622..0000000
--- a/packages/OsuLogin/certs/com.android.hotspot2.osulogin.pk8
+++ /dev/null
Binary files differ
diff --git a/packages/OsuLogin/certs/com.android.hotspot2.osulogin.x509.pem b/packages/OsuLogin/certs/com.android.hotspot2.osulogin.x509.pem
deleted file mode 100644
index 1dfe701..0000000
--- a/packages/OsuLogin/certs/com.android.hotspot2.osulogin.x509.pem
+++ /dev/null
@@ -1,35 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIGDzCCA/egAwIBAgIUHzkh0UCF/H+1mZZp0ROX4nXKOUowDQYJKoZIhvcNAQEL
-BQAwgZUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQH
-DA1Nb3VudGFpbiBWaWV3MRAwDgYDVQQKDAdBbmRyb2lkMRAwDgYDVQQLDAdBbmRy
-b2lkMREwDwYDVQQDDAhPc3VMb2dpbjEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBh
-bmRyb2lkLmNvbTAgFw0yMDAzMjUwMjQ5MTNaGA80NzU4MDIxOTAyNDkxM1owgZUx
-CzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1Nb3Vu
-dGFpbiBWaWV3MRAwDgYDVQQKDAdBbmRyb2lkMRAwDgYDVQQLDAdBbmRyb2lkMREw
-DwYDVQQDDAhPc3VMb2dpbjEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lk
-LmNvbTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMJDnjAeIZ2KUvKc
-ONwxuzIhLvXr6LRm+Uz0ebjz++5IzQJLwr/COPBG9zbIm8izj2acp+l4WVEYT6I4
-Es5LEp556ySCuZx8IjOd0Zd6NCdaKmYouDTjYTrELWUlZjfA7Km2L5x2M6ArnDO5
-zJ1BIsQ06S3C7iR3ktAQ1cFdidg6Ha2gainS0A1JKN3kL9BL1pvHRLzWZX4gsNhB
-C/6Ue3W3Sx2JRQkaaLksDdoKq0QswEk5tGfKbVr9+hHv/pztaaqEXSeV6f305cAx
-Hzd6+QJ8f8AJz2Rhnv43y72UO8b02CSP3laUj8geidR8XXw+R7Kzu8NfFDL7uVIh
-ktPaBxfWPNYtedp3JrGeZhkzljsushY+bVHECEzROhY2CiUZBEn+wwZLWe2W7oee
-VCL1EZBYctK5CfrrV6x0wvbBUF/ViwV+2LQXQNp08xB8bJBqoBn4KZjK0tTN86Dq
-qRALyoVIVh5VDU9Wbi3vrJb0/9TEQtMjuo0DS3hdtnowdRyAyhwbQHO26dqnnzBI
-XtTAve4RkOwnb8QzZde56qvRgweDE9Im1jpx4E+MMGqVYs8Txurmd/t6bCjTvp1P
-4i88crk/zqCoHEQEbiaNdfkULJAWg9wqxPjqPCTVNtOXoJwuHsNymQVSztIUSySz
-ZQ8Trk0ApqQf8yH2mjM6HJJZoNpBAgMBAAGjUzBRMB0GA1UdDgQWBBRdpduh1P+I
-BMbg5S4n1kbj5hQsOzAfBgNVHSMEGDAWgBRdpduh1P+IBMbg5S4n1kbj5hQsOzAP
-BgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4ICAQB+FzSuoA7LCvn8l86V
-sSI4lH1KLLH+wrXp20w/wYcBY+s4hYPpAJ8YbEMOT9uibK/HpEWYFqiVCqk4gKXr
-Qraxvmtqq0WNSwkjeopTYlZeBzTC/If3UoOCp7KCfMdydIcxvk6LNokMWWqSCNP8
-QiD872XuBvj/uQeBsbHZTqruqPnu+LZwpuHFVRp/Pyj9rT61PsvGitb7q/chW0G7
-7csHOc5q2223LKlNknPsfbcR6nVEg4KfN7kPKny8iJtl2pdbfBjFDp+73nzW8qZU
-5JWO5nWL7cJh4mt5sPGrzpt/Hf8/Dngg69sImRqjv/6/wCV0pEmmNjKJkXcMaZ0T
-2TSs+A7K6l15NYk8exkMymTU7jk+iDud3tnQ68YHf/A9pDu15OCw6U/pTgOgu9co
-rBLLhGV0Tb6XAnsWKe9tsLcumQXU5ZUn9m5VJl58wQHNhUqpT7L0fWtpiTMTStVA
-/yZbndPO4SbjR5rjcAk1xge8lyIIp0WBWmwoQ/1y4DXF/yPaX733wO7uWUljgKuy
-MM/zM4zklB8nFjXfPNf3j24Bzqmy7rqy4XB64enVmYQ2mVNqfwXvINoo2XOrAmj/
-bhSWXiCFltJFM7fmJGOMEEHBt9QfbmCgmM4aoWMgH7P+HxGW+Vc3tGixBbsxNRC+
-/VrPAINQV4x5q8zGYNQBqNFn/A==
------END CERTIFICATE-----
diff --git a/packages/OsuLogin/certs/key.pem b/packages/OsuLogin/certs/key.pem
deleted file mode 100644
index f560a8d..0000000
--- a/packages/OsuLogin/certs/key.pem
+++ /dev/null
@@ -1,52 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDCQ54wHiGdilLy
-nDjcMbsyIS716+i0ZvlM9Hm48/vuSM0CS8K/wjjwRvc2yJvIs49mnKfpeFlRGE+i
-OBLOSxKeeeskgrmcfCIzndGXejQnWipmKLg042E6xC1lJWY3wOypti+cdjOgK5wz
-ucydQSLENOktwu4kd5LQENXBXYnYOh2toGop0tANSSjd5C/QS9abx0S81mV+ILDY
-QQv+lHt1t0sdiUUJGmi5LA3aCqtELMBJObRnym1a/foR7/6c7WmqhF0nlen99OXA
-MR83evkCfH/ACc9kYZ7+N8u9lDvG9Ngkj95WlI/IHonUfF18Pkeys7vDXxQy+7lS
-IZLT2gcX1jzWLXnadyaxnmYZM5Y7LrIWPm1RxAhM0ToWNgolGQRJ/sMGS1ntlu6H
-nlQi9RGQWHLSuQn661esdML2wVBf1YsFfti0F0DadPMQfGyQaqAZ+CmYytLUzfOg
-6qkQC8qFSFYeVQ1PVm4t76yW9P/UxELTI7qNA0t4XbZ6MHUcgMocG0Bztunap58w
-SF7UwL3uEZDsJ2/EM2XXueqr0YMHgxPSJtY6ceBPjDBqlWLPE8bq5nf7emwo076d
-T+IvPHK5P86gqBxEBG4mjXX5FCyQFoPcKsT46jwk1TbTl6CcLh7DcpkFUs7SFEsk
-s2UPE65NAKakH/Mh9pozOhySWaDaQQIDAQABAoICAGgX7XKhIqgVD59aoIk0yLby
-2wQBdf780ocu1O6LJiqnrdqWF/PCsdnmXN9pHTitJqD4Pm03BL0Uhs9ItqL9zStH
-7vzwY177kSQRY9aEL+AKS3/UP+hvEpF3v09ce+pSIT5LFjYDjGQ+GgQJgh+dYHC8
-XVodAphdzjhZXQCxC4TmlzKLK3ffs4X69r/3XruBd6yfWTDKvTWZdMlcCX5Pt9v6
-7HAWNvzKvuTCO2Xjo6PzStGx7v5SlMhWISJtdARInv80z+m/RdPD3zxd1flXloiD
-h7yyRQPn31cfNLgP7vwMBKmKwbuo/WZhHr/SKBHEGY0jC/CDSQKMqd/dh5ynTnbC
-vi/qjKFIHofmhzgQ+fiHMeMsAO1c9eYs8a6bDeJjhA5qJP1HjSie9Ss9z94mp6Ww
-TRkU93yVX04DU4TCCf0IcFpKdbtKp84i6iLV9lKGh9juM42hSOFUV6bhxmlJ9zvM
-yl7vfhhuFHy1SypmaK/oJ+nwac4vIMaHCX9ifl6hm/z4PrGFSYJGQoJtVOz0vT15
-lSwCJVdHkGAe0LI+3iFn5jJlluD7TqsLmZLxqTTmzDZ3U9WhAslmn5TcZd92mL0i
-ZVTfCkjyl1wUHeif2992oTUH6CFZ1jKd8xwdWvyKkvQcjhiS9GUsm7j6jolR/QI7
-VPQlocM/vCCusrMWnR7xAoIBAQDv9O8kboz6WzN6Xw5UC7MWpi2jZg1bTs/uKcfz
-biAEC96iJQ33YSkYi6QzV4jSaackU99vGkHbQIdaBTkudz+FK5XqH0auImB2xxcR
-Xu9G2j2fhzESchVTtOnotVgjiuv18SLZ/GQoSIccs0QxcisPiTa5Ij9pl8xVoS6J
-sxfqAe15hASqLh+9Ula3+Orb1kCkqK0UwU0nM9nfUH88BKvUwQIMA7kipTA8jJog
-MJOlYPQUGxkltlim8Vip//P336E7CWT6fWbfo62US6IEu6HcC6T8u8jcLjIKsmjJ
-YJyqrepZqAVMPlv2Z+mNhxRR0ct6blfjJSrEZEtxBRn98kZ1AoIBAQDPQJ1z7Mfy
-AOfjSO6Dlfr7V9SWmGvexosH0gu6H8KO+n1/ZPH5fHGt7ORubUDhkNI/fqZK0Hls
-Q9Jwgq1QI9UwMTogF8DgmZ6L6jiXhUScIk0BFhUxOBoplugaI0jdTW350D2quFUJ
-LjYo+VcRapTfXXVehHSjbUh3nmTWj0WboA+//7xq8q9KHPb1Sbiwjf7N1iYD5R8p
-PaaG0DMET+l90bxI+QVX1enwjZGcFjo8VI+qXGGkpB/1zK5yWm29ZWypLw8TZreM
-7rLUdBY1/m7MB54zOaJ2jSsxLQSXIVSGPI1ugkmFr6OxeuLdcCLN4yca3+HYHewa
-w3GCBP3kfYMdAoIBAAxG0slhYpMYgWy8WkZQhuwcum8GtJ48TQUZXCKHOtoaJVzU
-Wn+SmACqfE8oJlblkuiX5fGQPVhTV9lyNPe8oCJXFYdx7DLSjW7mRrbbzZApcEeu
-KgOQlKjAs8r1JDpFTEc7/BV9BT7OXyNHxLBm7+8OjR8xsl7bplenNHNVF18glB7I
-c1ilnXgZM1icQp/WuV3zR0+tiB3+WCJFwwy2DHiJG2qz8g/ktbATXXtSIOuwJyy0
-Kjg0uRppdKjV8Ix5A426sFDkg5PjkujoabSmSOSyL9HCZcdmEadcc2ICMGHHHhtS
-Lls1QY08ycU06QQ6oJd198cmSqbbnsR8h1TnxVUCggEBAI2zF/QSiAImLGVxj+HX
-wWnneyobvGTsSlJmgi4XWOZ4zSU011xEgVTxCp2VhS6z3YwcA4ZTUzF6jX7vWZ/Z
-YAE7JwqaMv1dCtGOqnKuY2J88Tk05/hm6zxUOQzl4wOr1O1gO0lmDn3gYpdRIv59
-aJvvQjgFR9oU9d8TJM6t1mG45gvXxfM5Si/Z7d93MBdGflgteoBfPxbrV9gEsVzZ
-ZkLoC1u5JrYPQ4t8v3mAmQB2sGNCFmCC9ncQIpV8zlsX5VsnGZ+iMwzghtRLKoRw
-GUDWVIuhdDqp+kX9CY5q82d0Lx7HZY1JsRm/cy0DZkhubmYpfDhO/QavagQDdbOr
-POECggEAXOliqX4yFvy6USXihHVM44s63gK+yH0+0iRppqoB3+E5tDyhvvvBMPLZ
-7EBkhd7ILTDXbc0c8nSl8I/556YSlIaOB4Xbf4UQbsmD4fNGEnNWFbCzcEWYOjpQ
-5QyXjIzK/k8eg22OZlC3XNjGHgb/mA5f+v2enGQNuy7WRTl1mKYZB2h/2p6xy+jV
-CGhd4btB2bOu+1XR/B2KFvI5NdtPPti05LmsYgsU00yYJfQkpc7VvOSH5Jyy3eZL
-L9xTAy7NWBQ3LGdIpX+V1jcn3SzVits0m6hOUCtJLT1snMXAKFweTvWAQynuGomc
-VPf88ITMTOBjOH6YC8jKd/n2lVWLjw==
------END PRIVATE KEY-----
diff --git a/packages/OsuLogin/res/layout/osu_web_view.xml b/packages/OsuLogin/res/layout/osu_web_view.xml
deleted file mode 100644
index 4436aab..0000000
--- a/packages/OsuLogin/res/layout/osu_web_view.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="com.android.hotspot2.osulogin.OsuLoginActivity">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="4dp">
-
- <!-- Eliminates ProgressBar padding by boxing it into a 4dp high container -->
- <ProgressBar
- android:id="@+id/progress_bar"
- style="@android:style/Widget.Material.Light.ProgressBar.Horizontal"
- android:indeterminate="false"
- android:max="100"
- android:progress="0"
- android:layout_gravity="center"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
- </FrameLayout>
- <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
- android:id="@+id/swipe_refresh"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <WebView
- android:id="@+id/webview"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentBottom="false"
- android:layout_alignParentRight="false"/>
- </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
- </LinearLayout>
-</FrameLayout>
diff --git a/packages/OsuLogin/res/values-af/strings.xml b/packages/OsuLogin/res/values-af/strings.xml
deleted file mode 100644
index bfeee10..0000000
--- a/packages/OsuLogin/res/values-af/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">"Sluit aanlyn aan"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Kon nie aanmeld nie"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-am/strings.xml b/packages/OsuLogin/res/values-am/strings.xml
deleted file mode 100644
index e27c578..0000000
--- a/packages/OsuLogin/res/values-am/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/OsuLogin/res/values-ar/strings.xml b/packages/OsuLogin/res/values-ar/strings.xml
deleted file mode 100644
index b72d7c1..0000000
--- a/packages/OsuLogin/res/values-ar/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/OsuLogin/res/values-as/strings.xml b/packages/OsuLogin/res/values-as/strings.xml
deleted file mode 100644
index 422de32..0000000
--- a/packages/OsuLogin/res/values-as/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/OsuLogin/res/values-az/strings.xml b/packages/OsuLogin/res/values-az/strings.xml
deleted file mode 100644
index 977f939..0000000
--- a/packages/OsuLogin/res/values-az/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">"Onlayn Qeydiyyat"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Qeydiyyat alınmadı"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-b+sr+Latn/strings.xml b/packages/OsuLogin/res/values-b+sr+Latn/strings.xml
deleted file mode 100644
index 6eb2cc1..0000000
--- a/packages/OsuLogin/res/values-b+sr+Latn/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">"Onlajn registracija"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Registracija nije uspela"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-be/strings.xml b/packages/OsuLogin/res/values-be/strings.xml
deleted file mode 100644
index 158c3f2..0000000
--- a/packages/OsuLogin/res/values-be/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/OsuLogin/res/values-bg/strings.xml b/packages/OsuLogin/res/values-bg/strings.xml
deleted file mode 100644
index ea3145d..0000000
--- a/packages/OsuLogin/res/values-bg/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/OsuLogin/res/values-bn/strings.xml b/packages/OsuLogin/res/values-bn/strings.xml
deleted file mode 100644
index c9f615e..0000000
--- a/packages/OsuLogin/res/values-bn/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/OsuLogin/res/values-bs/strings.xml b/packages/OsuLogin/res/values-bs/strings.xml
deleted file mode 100644
index e9b9751..0000000
--- a/packages/OsuLogin/res/values-bs/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">"Online registracija"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Registracija nije uspjela"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-ca/strings.xml b/packages/OsuLogin/res/values-ca/strings.xml
deleted file mode 100644
index 7d93096..0000000
--- a/packages/OsuLogin/res/values-ca/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">"Registre en línia"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Ha fallat el registre"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-cs/strings.xml b/packages/OsuLogin/res/values-cs/strings.xml
deleted file mode 100644
index b9cb794..0000000
--- a/packages/OsuLogin/res/values-cs/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">"Online registrace"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Registrace selhala"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-da/strings.xml b/packages/OsuLogin/res/values-da/strings.xml
deleted file mode 100644
index 68c93b7..0000000
--- a/packages/OsuLogin/res/values-da/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">"Online registrering"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Registrering mislykkedes"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-de/strings.xml b/packages/OsuLogin/res/values-de/strings.xml
deleted file mode 100644
index 7e5a310..0000000
--- a/packages/OsuLogin/res/values-de/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">"Online-Registrierung"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Registrierung fehlgeschlagen"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-el/strings.xml b/packages/OsuLogin/res/values-el/strings.xml
deleted file mode 100644
index a58e481..0000000
--- a/packages/OsuLogin/res/values-el/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/OsuLogin/res/values-en-rAU/strings.xml b/packages/OsuLogin/res/values-en-rAU/strings.xml
deleted file mode 100644
index fbbcab1..0000000
--- a/packages/OsuLogin/res/values-en-rAU/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">"Online sign-up"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Sign-up failed"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-en-rCA/strings.xml b/packages/OsuLogin/res/values-en-rCA/strings.xml
deleted file mode 100644
index fbbcab1..0000000
--- a/packages/OsuLogin/res/values-en-rCA/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">"Online sign-up"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Sign-up failed"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-en-rGB/strings.xml b/packages/OsuLogin/res/values-en-rGB/strings.xml
deleted file mode 100644
index fbbcab1..0000000
--- a/packages/OsuLogin/res/values-en-rGB/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">"Online sign-up"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Sign-up failed"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-en-rIN/strings.xml b/packages/OsuLogin/res/values-en-rIN/strings.xml
deleted file mode 100644
index fbbcab1..0000000
--- a/packages/OsuLogin/res/values-en-rIN/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">"Online sign-up"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Sign-up failed"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-en-rXC/strings.xml b/packages/OsuLogin/res/values-en-rXC/strings.xml
deleted file mode 100644
index af7ff67..0000000
--- a/packages/OsuLogin/res/values-en-rXC/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">"Online Sign Up"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Sign-up failed"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-es-rUS/strings.xml b/packages/OsuLogin/res/values-es-rUS/strings.xml
deleted file mode 100644
index 144804c..0000000
--- a/packages/OsuLogin/res/values-es-rUS/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">"Registrarse en línea"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Se produjo un error de registro"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-es/strings.xml b/packages/OsuLogin/res/values-es/strings.xml
deleted file mode 100644
index 3ad95cd8..0000000
--- a/packages/OsuLogin/res/values-es/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">"Registro online"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Error al completar el registro"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-et/strings.xml b/packages/OsuLogin/res/values-et/strings.xml
deleted file mode 100644
index 94c5cea..0000000
--- a/packages/OsuLogin/res/values-et/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">"Veebis registreerimine"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Registreerimine ebaõnnestus"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-eu/strings.xml b/packages/OsuLogin/res/values-eu/strings.xml
deleted file mode 100644
index 30caa87..0000000
--- a/packages/OsuLogin/res/values-eu/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">"Sarean izen-ematea"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Ezin izan da eman izena"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-fa/strings.xml b/packages/OsuLogin/res/values-fa/strings.xml
deleted file mode 100644
index 3005203..0000000
--- a/packages/OsuLogin/res/values-fa/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/OsuLogin/res/values-fi/strings.xml b/packages/OsuLogin/res/values-fi/strings.xml
deleted file mode 100644
index 24eac8a..0000000
--- a/packages/OsuLogin/res/values-fi/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">"Rekisteröidy verkossa"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Rekisteröityminen ei onnistunut"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-fr-rCA/strings.xml b/packages/OsuLogin/res/values-fr-rCA/strings.xml
deleted file mode 100644
index bcaa662..0000000
--- a/packages/OsuLogin/res/values-fr-rCA/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">"Inscription en ligne"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Échec de l\'inscription"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-fr/strings.xml b/packages/OsuLogin/res/values-fr/strings.xml
deleted file mode 100644
index bcaa662..0000000
--- a/packages/OsuLogin/res/values-fr/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">"Inscription en ligne"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Échec de l\'inscription"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-gl/strings.xml b/packages/OsuLogin/res/values-gl/strings.xml
deleted file mode 100644
index 5fc4444..0000000
--- a/packages/OsuLogin/res/values-gl/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">"Rexistro en liña"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Produciuse un erro co rexistro"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-gu/strings.xml b/packages/OsuLogin/res/values-gu/strings.xml
deleted file mode 100644
index 8449963..0000000
--- a/packages/OsuLogin/res/values-gu/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/OsuLogin/res/values-hi/strings.xml b/packages/OsuLogin/res/values-hi/strings.xml
deleted file mode 100644
index 9e07438..0000000
--- a/packages/OsuLogin/res/values-hi/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/OsuLogin/res/values-hr/strings.xml b/packages/OsuLogin/res/values-hr/strings.xml
deleted file mode 100644
index e9b9751..0000000
--- a/packages/OsuLogin/res/values-hr/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">"Online registracija"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Registracija nije uspjela"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-hu/strings.xml b/packages/OsuLogin/res/values-hu/strings.xml
deleted file mode 100644
index cb0e036..0000000
--- a/packages/OsuLogin/res/values-hu/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">"Online regisztráció"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"A regisztráció nem sikerült"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-hy/strings.xml b/packages/OsuLogin/res/values-hy/strings.xml
deleted file mode 100644
index ae1c36a..0000000
--- a/packages/OsuLogin/res/values-hy/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/OsuLogin/res/values-in/strings.xml b/packages/OsuLogin/res/values-in/strings.xml
deleted file mode 100644
index 6aaf694..0000000
--- a/packages/OsuLogin/res/values-in/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">"Pendaftaran Online"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Pendaftaran gagal"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-is/strings.xml b/packages/OsuLogin/res/values-is/strings.xml
deleted file mode 100644
index f1ae520..0000000
--- a/packages/OsuLogin/res/values-is/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">"Skráning á netinu"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Skráning mistókst"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-it/strings.xml b/packages/OsuLogin/res/values-it/strings.xml
deleted file mode 100644
index fbff7b0..0000000
--- a/packages/OsuLogin/res/values-it/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">"Registrazione online"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Registrazione non riuscita"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-iw/strings.xml b/packages/OsuLogin/res/values-iw/strings.xml
deleted file mode 100644
index 866ef88..0000000
--- a/packages/OsuLogin/res/values-iw/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/OsuLogin/res/values-ja/strings.xml b/packages/OsuLogin/res/values-ja/strings.xml
deleted file mode 100644
index 8a220d6..0000000
--- a/packages/OsuLogin/res/values-ja/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/OsuLogin/res/values-ka/strings.xml b/packages/OsuLogin/res/values-ka/strings.xml
deleted file mode 100644
index bf08006..0000000
--- a/packages/OsuLogin/res/values-ka/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/OsuLogin/res/values-kk/strings.xml b/packages/OsuLogin/res/values-kk/strings.xml
deleted file mode 100644
index 8b87356..0000000
--- a/packages/OsuLogin/res/values-kk/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/OsuLogin/res/values-km/strings.xml b/packages/OsuLogin/res/values-km/strings.xml
deleted file mode 100644
index f58ccc3..0000000
--- a/packages/OsuLogin/res/values-km/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/OsuLogin/res/values-kn/strings.xml b/packages/OsuLogin/res/values-kn/strings.xml
deleted file mode 100644
index 49a6562..0000000
--- a/packages/OsuLogin/res/values-kn/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/OsuLogin/res/values-ko/strings.xml b/packages/OsuLogin/res/values-ko/strings.xml
deleted file mode 100644
index e647ca0..0000000
--- a/packages/OsuLogin/res/values-ko/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/OsuLogin/res/values-ky/strings.xml b/packages/OsuLogin/res/values-ky/strings.xml
deleted file mode 100644
index 42da248..0000000
--- a/packages/OsuLogin/res/values-ky/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/OsuLogin/res/values-lo/strings.xml b/packages/OsuLogin/res/values-lo/strings.xml
deleted file mode 100644
index 9ff2241..0000000
--- a/packages/OsuLogin/res/values-lo/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/OsuLogin/res/values-lt/strings.xml b/packages/OsuLogin/res/values-lt/strings.xml
deleted file mode 100644
index 1a4c06e..0000000
--- a/packages/OsuLogin/res/values-lt/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">"Internetinis prisiregistravimas"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Nepavyko prisiregistruoti"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-lv/strings.xml b/packages/OsuLogin/res/values-lv/strings.xml
deleted file mode 100644
index 11cdb97..0000000
--- a/packages/OsuLogin/res/values-lv/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">"Reģistrācija tiešsaistē"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Reģistrācija neizdevās."</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-mk/strings.xml b/packages/OsuLogin/res/values-mk/strings.xml
deleted file mode 100644
index de608e1..0000000
--- a/packages/OsuLogin/res/values-mk/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/OsuLogin/res/values-ml/strings.xml b/packages/OsuLogin/res/values-ml/strings.xml
deleted file mode 100644
index 8e797c8..0000000
--- a/packages/OsuLogin/res/values-ml/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/OsuLogin/res/values-mn/strings.xml b/packages/OsuLogin/res/values-mn/strings.xml
deleted file mode 100644
index 59d79d0..0000000
--- a/packages/OsuLogin/res/values-mn/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/OsuLogin/res/values-mr/strings.xml b/packages/OsuLogin/res/values-mr/strings.xml
deleted file mode 100644
index 15479a6..0000000
--- a/packages/OsuLogin/res/values-mr/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/OsuLogin/res/values-ms/strings.xml b/packages/OsuLogin/res/values-ms/strings.xml
deleted file mode 100644
index 7e1cf95..0000000
--- a/packages/OsuLogin/res/values-ms/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">"Pendaftaran Dalam Talian"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Pendaftaran gagal"</string>
-</resources>
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/OsuLogin/res/values-nb/strings.xml b/packages/OsuLogin/res/values-nb/strings.xml
deleted file mode 100644
index 2e0c47a1..0000000
--- a/packages/OsuLogin/res/values-nb/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">"Registrering på nettet"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Registreringen mislyktes"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-ne/strings.xml b/packages/OsuLogin/res/values-ne/strings.xml
deleted file mode 100644
index 16bd92f..0000000
--- a/packages/OsuLogin/res/values-ne/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/OsuLogin/res/values-nl/strings.xml b/packages/OsuLogin/res/values-nl/strings.xml
deleted file mode 100644
index 7cf8bd2..0000000
--- a/packages/OsuLogin/res/values-nl/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">"Online aanmelding"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Aanmelding mislukt"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-or/strings.xml b/packages/OsuLogin/res/values-or/strings.xml
deleted file mode 100644
index e0584d7..0000000
--- a/packages/OsuLogin/res/values-or/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/OsuLogin/res/values-pa/strings.xml b/packages/OsuLogin/res/values-pa/strings.xml
deleted file mode 100644
index 7e47d0e..0000000
--- a/packages/OsuLogin/res/values-pa/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/OsuLogin/res/values-pl/strings.xml b/packages/OsuLogin/res/values-pl/strings.xml
deleted file mode 100644
index c0722ab..0000000
--- a/packages/OsuLogin/res/values-pl/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">"Rejestracja online"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Nie udało się zarejestrować"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-pt-rBR/strings.xml b/packages/OsuLogin/res/values-pt-rBR/strings.xml
deleted file mode 100644
index c9fe377..0000000
--- a/packages/OsuLogin/res/values-pt-rBR/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">"Inscrição on-line"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Falha na inscrição"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-pt-rPT/strings.xml b/packages/OsuLogin/res/values-pt-rPT/strings.xml
deleted file mode 100644
index 0059281..0000000
--- a/packages/OsuLogin/res/values-pt-rPT/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">"Inscrição online"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Falha na inscrição."</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-pt/strings.xml b/packages/OsuLogin/res/values-pt/strings.xml
deleted file mode 100644
index c9fe377..0000000
--- a/packages/OsuLogin/res/values-pt/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">"Inscrição on-line"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Falha na inscrição"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-ro/strings.xml b/packages/OsuLogin/res/values-ro/strings.xml
deleted file mode 100644
index eead127..0000000
--- a/packages/OsuLogin/res/values-ro/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">"Înscriere online"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Nu s-a înscris"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-ru/strings.xml b/packages/OsuLogin/res/values-ru/strings.xml
deleted file mode 100644
index a271ef7..0000000
--- a/packages/OsuLogin/res/values-ru/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/OsuLogin/res/values-si/strings.xml b/packages/OsuLogin/res/values-si/strings.xml
deleted file mode 100644
index 52e5979..0000000
--- a/packages/OsuLogin/res/values-si/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/OsuLogin/res/values-sk/strings.xml b/packages/OsuLogin/res/values-sk/strings.xml
deleted file mode 100644
index f6b9f70..0000000
--- a/packages/OsuLogin/res/values-sk/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">"Online registrácia"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Registrácia zlyhala"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-sl/strings.xml b/packages/OsuLogin/res/values-sl/strings.xml
deleted file mode 100644
index 6e6b95c..0000000
--- a/packages/OsuLogin/res/values-sl/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">"Spletna registracija"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Registracija ni uspela"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-sq/strings.xml b/packages/OsuLogin/res/values-sq/strings.xml
deleted file mode 100644
index f67a238..0000000
--- a/packages/OsuLogin/res/values-sq/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">"Regjistrimi në linjë"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Regjistrimi dështoi"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-sr/strings.xml b/packages/OsuLogin/res/values-sr/strings.xml
deleted file mode 100644
index 14e0828..0000000
--- a/packages/OsuLogin/res/values-sr/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/OsuLogin/res/values-sv/strings.xml b/packages/OsuLogin/res/values-sv/strings.xml
deleted file mode 100644
index ea5fdfd..0000000
--- a/packages/OsuLogin/res/values-sv/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">"Registrering online"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Registreringen misslyckades"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-sw/strings.xml b/packages/OsuLogin/res/values-sw/strings.xml
deleted file mode 100644
index c20a402..0000000
--- a/packages/OsuLogin/res/values-sw/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">"Kujisajili Mtandaoni"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Imeshindwa kukusajili"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-ta/strings.xml b/packages/OsuLogin/res/values-ta/strings.xml
deleted file mode 100644
index e2eb567..0000000
--- a/packages/OsuLogin/res/values-ta/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/OsuLogin/res/values-te/strings.xml b/packages/OsuLogin/res/values-te/strings.xml
deleted file mode 100644
index 56b0b44..0000000
--- a/packages/OsuLogin/res/values-te/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/OsuLogin/res/values-th/strings.xml b/packages/OsuLogin/res/values-th/strings.xml
deleted file mode 100644
index 552dca2..0000000
--- a/packages/OsuLogin/res/values-th/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/OsuLogin/res/values-tl/strings.xml b/packages/OsuLogin/res/values-tl/strings.xml
deleted file mode 100644
index ba89e96..0000000
--- a/packages/OsuLogin/res/values-tl/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">"Pag-sign Up Online"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Hindi nakapag-sign up"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-tr/strings.xml b/packages/OsuLogin/res/values-tr/strings.xml
deleted file mode 100644
index 1d927fe..0000000
--- a/packages/OsuLogin/res/values-tr/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">"Online Kaydolma"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Kaydolma işlemi başarısız oldu"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-uk/strings.xml b/packages/OsuLogin/res/values-uk/strings.xml
deleted file mode 100644
index 6e60ff0..0000000
--- a/packages/OsuLogin/res/values-uk/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/OsuLogin/res/values-ur/strings.xml b/packages/OsuLogin/res/values-ur/strings.xml
deleted file mode 100644
index eed7686..0000000
--- a/packages/OsuLogin/res/values-ur/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/OsuLogin/res/values-uz/strings.xml b/packages/OsuLogin/res/values-uz/strings.xml
deleted file mode 100644
index 152d129..0000000
--- a/packages/OsuLogin/res/values-uz/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">"Onlayn registratsiya"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Registratsiya qilinmadi"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-vi/strings.xml b/packages/OsuLogin/res/values-vi/strings.xml
deleted file mode 100644
index 84558076..0000000
--- a/packages/OsuLogin/res/values-vi/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">"Đăng ký trực tuyến"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Không đăng ký được"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values-zh-rCN/strings.xml b/packages/OsuLogin/res/values-zh-rCN/strings.xml
deleted file mode 100644
index 7f13647..0000000
--- a/packages/OsuLogin/res/values-zh-rCN/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/OsuLogin/res/values-zh-rHK/strings.xml b/packages/OsuLogin/res/values-zh-rHK/strings.xml
deleted file mode 100644
index 8731791..0000000
--- a/packages/OsuLogin/res/values-zh-rHK/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/OsuLogin/res/values-zh-rTW/strings.xml b/packages/OsuLogin/res/values-zh-rTW/strings.xml
deleted file mode 100644
index 79208c8..0000000
--- a/packages/OsuLogin/res/values-zh-rTW/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/OsuLogin/res/values-zu/strings.xml b/packages/OsuLogin/res/values-zu/strings.xml
deleted file mode 100644
index 27ac6bb..0000000
--- a/packages/OsuLogin/res/values-zu/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">"I-OsuLogin"</string>
- <string name="action_bar_label" msgid="550995560341508693">"Ukubhalisa Okuku-inthanethi"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"Ukubhalisa kuhlulekile"</string>
-</resources>
diff --git a/packages/OsuLogin/res/values/dimens.xml b/packages/OsuLogin/res/values/dimens.xml
deleted file mode 100644
index 47c8224..0000000
--- a/packages/OsuLogin/res/values/dimens.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<resources>
- <!-- Default screen margins, per the Android Design guidelines. -->
- <dimen name="activity_horizontal_margin">16dp</dimen>
- <dimen name="activity_vertical_margin">16dp</dimen>
-</resources>
diff --git a/packages/OsuLogin/res/values/strings.xml b/packages/OsuLogin/res/values/strings.xml
deleted file mode 100644
index 14de0f5..0000000
--- a/packages/OsuLogin/res/values/strings.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<resources>
- <!-- application name [CHAR LIMIT=32] -->
- <string name="app_name">OsuLogin</string>
- <!-- action bar label [CHAR LIMIT=32] -->
- <string name="action_bar_label">Online Sign Up</string>
- <!-- toast message [CHAR LIMIT=32] -->
- <string name="sign_up_failed">Sign-up failed</string>
-</resources>
diff --git a/packages/OsuLogin/res/values/styles.xml b/packages/OsuLogin/res/values/styles.xml
deleted file mode 100644
index f6c2339..0000000
--- a/packages/OsuLogin/res/values/styles.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<resources>
-
- <!--
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
- -->
- <style name="AppBaseTheme" parent="@android:style/Theme.DeviceDefault.Settings">
- <!--
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
- -->
- </style>
-
- <!-- Application theme. -->
- <style name="AppTheme" parent="AppBaseTheme">
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->
- </style>
-</resources>
diff --git a/packages/OsuLogin/res/xml/network_security_config.xml b/packages/OsuLogin/res/xml/network_security_config.xml
deleted file mode 100644
index 3ef4b84..0000000
--- a/packages/OsuLogin/res/xml/network_security_config.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<network-security-config>
-<base-config cleartextTrafficPermitted="true">
- <trust-anchors>
- <certificates src="system" />
- <certificates src="wfa" />
- </trust-anchors>
-</base-config>
-</network-security-config>
diff --git a/packages/OsuLogin/src/com/android/hotspot2/osulogin/OsuLoginActivity.java b/packages/OsuLogin/src/com/android/hotspot2/osulogin/OsuLoginActivity.java
deleted file mode 100644
index 9797846..0000000
--- a/packages/OsuLogin/src/com/android/hotspot2/osulogin/OsuLoginActivity.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * 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 com.android.hotspot2.osulogin;
-
-import static android.net.NetworkCapabilities.NET_CAPABILITY_TRUSTED;
-
-import android.app.Activity;
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.net.ConnectivityManager;
-import android.net.Network;
-import android.net.NetworkCapabilities;
-import android.net.NetworkRequest;
-import android.net.wifi.WifiManager;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.View;
-import android.webkit.WebChromeClient;
-import android.webkit.WebResourceError;
-import android.webkit.WebResourceRequest;
-import android.webkit.WebSettings;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-import android.widget.ProgressBar;
-import android.widget.Toast;
-
-import androidx.annotation.Nullable;
-import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-/**
- * Online Sign Up Login Web View launched during Provision Process of Hotspot 2.0 rel2.
- */
-public class OsuLoginActivity extends Activity {
- private static final String TAG = "OsuLogin";
- private static final boolean DBG = true;
-
- private String mUrl;
- private String mHostName;
- private Network mNetwork;
- private ConnectivityManager mCm;
- private ConnectivityManager.NetworkCallback mNetworkCallback;
- private WifiManager mWifiManager;
- private WebView mWebView;
- private SwipeRefreshLayout mSwipeRefreshLayout;
- private ProgressBar mProgressBar;
- private boolean mForceDisconnect = true;
- boolean mRedirectResponseReceived = false;
-
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- if (DBG) {
- Log.d(TAG, "onCreate: Opening OSU Web View");
- }
-
- mWifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
- if (mWifiManager == null) {
- Log.e(TAG, "Cannot get wifi service");
- finishAndRemoveTask();
- return;
- }
-
- if (getIntent() == null) {
- Log.e(TAG, "Intent is null");
- finishAndRemoveTask();
- return;
- }
-
- mNetwork = getIntent().getParcelableExtra(WifiManager.EXTRA_OSU_NETWORK);
- if (mNetwork == null) {
- Log.e(TAG, "Cannot get the network instance for OSU from intent");
- finishAndRemoveTask();
- return;
- }
-
- mUrl = getIntent().getStringExtra(WifiManager.EXTRA_URL);
- if (mUrl == null) {
- Log.e(TAG, "Cannot get OSU server url from intent");
- finishAndRemoveTask();
- return;
- }
-
- mHostName = getHost(mUrl);
- if (mHostName == null) {
- Log.e(TAG, "Cannot get host from the url");
- finishAndRemoveTask();
- return;
- }
-
- mCm = (ConnectivityManager) getApplicationContext().getSystemService(
- Context.CONNECTIVITY_SERVICE);
- if (mCm == null) {
- Log.e(TAG, "Cannot get connectivity service");
- finishAndRemoveTask();
- return;
- }
-
- if (!mCm.bindProcessToNetwork(mNetwork)) {
- Log.e(TAG, "Network is no longer valid");
- finishAndRemoveTask();
- return;
- }
-
- final NetworkCapabilities networkCapabilities = mCm.getNetworkCapabilities(mNetwork);
- if (networkCapabilities == null || !networkCapabilities.hasTransport(
- NetworkCapabilities.TRANSPORT_WIFI)) {
- Log.e(TAG, "WiFi is not supported for the Network");
- finishAndRemoveTask();
- return;
- }
-
- getActionBar().setDisplayShowHomeEnabled(false);
- getActionBar().setElevation(0); // remove shadow
- getActionBar().setTitle(getString(R.string.action_bar_label));
- getActionBar().setSubtitle("");
- setContentView(R.layout.osu_web_view);
-
- // Exit this app if network disappeared.
- mNetworkCallback = new ConnectivityManager.NetworkCallback() {
- @Override
- public void onLost(Network network) {
- if (DBG) {
- Log.d(TAG, "Lost for the current Network, close the browser");
- }
- mForceDisconnect = false; // It is already disconnected.
- if (!mRedirectResponseReceived) {
- showSignUpFailedToast();
- }
- if (mNetwork.equals(network)) {
- finishAndRemoveTask();
- }
- }
- };
-
- mCm.registerNetworkCallback(
- new NetworkRequest.Builder().addTransportType(
- NetworkCapabilities.TRANSPORT_WIFI).removeCapability(
- NET_CAPABILITY_TRUSTED).build(),
- mNetworkCallback);
-
- mWebView = findViewById(R.id.webview);
- mWebView.clearCache(true);
- WebSettings webSettings = mWebView.getSettings();
- webSettings.setJavaScriptEnabled(true);
- webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE);
- webSettings.setUseWideViewPort(true);
- webSettings.setLoadWithOverviewMode(true);
- webSettings.setSupportZoom(true);
- webSettings.setBuiltInZoomControls(true);
- webSettings.setDisplayZoomControls(false);
- mProgressBar = findViewById(R.id.progress_bar);
- mWebView.setWebViewClient(new OsuWebViewClient());
- mWebView.setWebChromeClient(new WebChromeClient() {
- @Override
- public void onProgressChanged(WebView view, int newProgress) {
- mProgressBar.setProgress(newProgress);
- }
- });
-
- if (DBG) {
- Log.d(TAG, "OSU Web View to " + mUrl);
- }
-
- mWebView.loadUrl(mUrl);
- mSwipeRefreshLayout = findViewById(R.id.swipe_refresh);
- mSwipeRefreshLayout.setOnRefreshListener(() -> {
- mWebView.reload();
- mSwipeRefreshLayout.setRefreshing(true);
- });
- }
-
- @Override
- public boolean onKeyDown(int keyCode, KeyEvent event) {
- // Check if the key event was the Back button.
- if ((keyCode == KeyEvent.KEYCODE_BACK)) {
- // If there is a history to move back
- if (mWebView.canGoBack()) {
- mWebView.goBack();
- return true;
- }
- }
- return super.onKeyDown(keyCode, event);
- }
-
- @Override
- protected void onDestroy() {
- if (mNetworkCallback != null) {
- mCm.unregisterNetworkCallback(mNetworkCallback);
- mNetworkCallback = null;
- }
- if (mWifiManager != null && mForceDisconnect) {
- mWifiManager.disconnect();
- mWifiManager = null;
- }
- super.onDestroy();
- }
-
- private String getHost(String url) {
- try {
- return new URL(url).getHost();
- } catch (MalformedURLException e) {
- Log.e(TAG, "Invalid URL " + url);
- }
- return null;
- }
-
- private String getHeaderSubtitle(String urlString) {
- try {
- URL url = new URL(urlString);
- return url.getProtocol() + "://" + url.getHost();
- } catch (MalformedURLException e) {
- Log.e(TAG, "Invalid URL " + urlString);
- }
- return "";
- }
-
- private void showSignUpFailedToast() {
- Toast.makeText(getApplicationContext(), R.string.sign_up_failed,
- Toast.LENGTH_SHORT).show();
- }
-
- private class OsuWebViewClient extends WebViewClient {
- boolean mPageError = false;
-
- @Override
- public void onPageStarted(WebView view, String urlString, Bitmap favicon) {
- String subtitle = getHeaderSubtitle(urlString);
- getActionBar().setSubtitle(subtitle);
- mProgressBar.setVisibility(View.VISIBLE);
- }
-
- @Override
- public void onPageFinished(WebView view, String url) {
- mProgressBar.setVisibility(View.INVISIBLE);
- mSwipeRefreshLayout.setRefreshing(false);
-
- // Do not show the page error on UI.
- if (mPageError) {
- if (mRedirectResponseReceived) {
- // Do not disconnect current connection while provisioning is in progress.
- mForceDisconnect = false;
- }
- finishAndRemoveTask();
- }
- }
-
- @Override
- public void onReceivedError(WebView view, WebResourceRequest request,
- WebResourceError error) {
- if (request.getUrl().toString().startsWith("http://127.0.0.1")) {
- mRedirectResponseReceived = true;
- view.stopLoading();
- }
-
- if (request.isForMainFrame()) {
- // This happens right after getting HTTP redirect response from an OSU server
- // since no more Http request is allowed to send to the OSU server.
- mPageError = true;
- Log.e(TAG, "onReceived Error for MainFrame: " + error.getErrorCode());
- }
- }
- }
-}
diff --git a/packages/SettingsLib/Android.bp b/packages/SettingsLib/Android.bp
index 23cb36f..3834162 100644
--- a/packages/SettingsLib/Android.bp
+++ b/packages/SettingsLib/Android.bp
@@ -43,6 +43,7 @@
"SettingsLibSearchWidget",
"SettingsLibSettingsSpinner",
"SettingsLibLayoutPreference",
+ "SettingsLibMainSwitchPreference",
"SettingsLibActionButtonsPreference",
"SettingsLibEntityHeaderWidgets",
"SettingsLibBarChartPreference",
diff --git a/packages/SettingsLib/HelpUtils/res/values-uz/strings.xml b/packages/SettingsLib/HelpUtils/res/values-uz/strings.xml
index 81d0dd9..cb56912 100644
--- a/packages/SettingsLib/HelpUtils/res/values-uz/strings.xml
+++ b/packages/SettingsLib/HelpUtils/res/values-uz/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">"Yordam va fikr-mulohaza"</string>
+ <string name="help_feedback_label" msgid="7106780063063027882">"Yordam/fikr-mulohaza"</string>
</resources>
diff --git a/packages/SettingsLib/MainSwitchPreference/Android.bp b/packages/SettingsLib/MainSwitchPreference/Android.bp
new file mode 100644
index 0000000..1dc18f5
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/Android.bp
@@ -0,0 +1,14 @@
+android_library {
+ name: "SettingsLibMainSwitchPreference",
+
+ srcs: ["src/**/*.java"],
+ resource_dirs: ["res"],
+
+ static_libs: [
+ "androidx.preference_preference",
+ "SettingsLibRestrictedLockUtils",
+ ],
+
+ sdk_version: "system_current",
+ min_sdk_version: "21",
+}
diff --git a/packages/SettingsLib/MainSwitchPreference/AndroidManifest.xml b/packages/SettingsLib/MainSwitchPreference/AndroidManifest.xml
new file mode 100644
index 0000000..96d9e51
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/AndroidManifest.xml
@@ -0,0 +1,23 @@
+<?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.settingslib.widget">
+
+ <uses-sdk android:minSdkVersion="21" />
+
+</manifest>
diff --git a/packages/SettingsLib/MainSwitchPreference/res/drawable/thumb_off.xml b/packages/SettingsLib/MainSwitchPreference/res/drawable/thumb_off.xml
new file mode 100644
index 0000000..8a73fb5
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/res/drawable/thumb_off.xml
@@ -0,0 +1,25 @@
+<?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"
+ android:shape="oval" >
+
+ <size android:height="24dp" android:width="24dp" />
+ <solid android:color="@color/thumb_off" />
+ <stroke android:width="4dp" android:color="@android:color/transparent" />
+
+</shape>
diff --git a/packages/SettingsLib/MainSwitchPreference/res/drawable/thumb_on.xml b/packages/SettingsLib/MainSwitchPreference/res/drawable/thumb_on.xml
new file mode 100644
index 0000000..8a0af00
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/res/drawable/thumb_on.xml
@@ -0,0 +1,25 @@
+<?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"
+ android:shape="oval" >
+
+ <size android:height="24dp" android:width="24dp" />
+ <solid android:color="?android:attr/colorAccent" />
+ <stroke android:width="4dp" android:color="@android:color/transparent" />
+
+</shape>
diff --git a/packages/SettingsLib/MainSwitchPreference/res/drawable/thumb_selector.xml b/packages/SettingsLib/MainSwitchPreference/res/drawable/thumb_selector.xml
new file mode 100644
index 0000000..8cc9bb3
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/res/drawable/thumb_selector.xml
@@ -0,0 +1,21 @@
+<?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.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/thumb_on" android:state_checked="true" />
+ <item android:drawable="@drawable/thumb_off" android:state_checked="false" />
+</selector>
diff --git a/packages/SettingsLib/MainSwitchPreference/res/drawable/track_off.xml b/packages/SettingsLib/MainSwitchPreference/res/drawable/track_off.xml
new file mode 100644
index 0000000..1be3a8e
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/res/drawable/track_off.xml
@@ -0,0 +1,26 @@
+<?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.
+ -->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/track_off_background" />
+ <item
+ android:width="13.33dp"
+ android:height="1.67dp"
+ android:left="19dp"
+ android:gravity="center"
+ android:drawable="@drawable/track_off_indicator" />
+</layer-list>
diff --git a/packages/SettingsLib/MainSwitchPreference/res/drawable/track_off_background.xml b/packages/SettingsLib/MainSwitchPreference/res/drawable/track_off_background.xml
new file mode 100644
index 0000000..3cc490f
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/res/drawable/track_off_background.xml
@@ -0,0 +1,34 @@
+<?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.
+ -->
+
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="48dp"
+ android:height="24dp"
+ android:viewportWidth="48"
+ android:viewportHeight="24">
+
+ <group>
+ <clip-path
+ android:pathData="M12 0H36C42.6274 0 48 5.37258 48 12C48 18.6274 42.6274 24 36 24H12C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0Z" />
+
+ <path
+ android:pathData="M0 0V24H48V0"
+ android:fillColor="@color/track_off" />
+ </group>
+
+</vector>
diff --git a/packages/SettingsLib/MainSwitchPreference/res/drawable/track_off_indicator.xml b/packages/SettingsLib/MainSwitchPreference/res/drawable/track_off_indicator.xml
new file mode 100644
index 0000000..6cc6224
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/res/drawable/track_off_indicator.xml
@@ -0,0 +1,34 @@
+<?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.
+ -->
+
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="13.33dp"
+ android:height="1.67dp"
+ android:viewportWidth="13.33"
+ android:viewportHeight="1.67">
+
+ <group>
+ <clip-path
+ android:pathData="M0 0H13.3333V1.66667H0V0Z" />
+
+ <path
+ android:pathData="M0 0V1.66667H13.3333V0"
+ android:fillColor="@android:color/white" />
+ </group>
+
+</vector>
diff --git a/packages/SettingsLib/MainSwitchPreference/res/drawable/track_on.xml b/packages/SettingsLib/MainSwitchPreference/res/drawable/track_on.xml
new file mode 100644
index 0000000..2553891
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/res/drawable/track_on.xml
@@ -0,0 +1,26 @@
+<?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.
+ -->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/track_on_background" />
+ <item
+ android:width="13.19dp"
+ android:height="10.06dp"
+ android:gravity="center"
+ android:right="19dp"
+ android:drawable="@drawable/track_on_indicator" />
+</layer-list>
diff --git a/packages/SettingsLib/MainSwitchPreference/res/drawable/track_on_background.xml b/packages/SettingsLib/MainSwitchPreference/res/drawable/track_on_background.xml
new file mode 100644
index 0000000..02e3a84
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/res/drawable/track_on_background.xml
@@ -0,0 +1,34 @@
+<?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.
+ -->
+
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="48dp"
+ android:height="24dp"
+ android:viewportWidth="48"
+ android:viewportHeight="24">
+
+ <group>
+ <clip-path
+ android:pathData="M12 0H36C42.6274 0 48 5.37258 48 12C48 18.6274 42.6274 24 36 24H12C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0Z" />
+
+ <path
+ android:pathData="M0 0V24H48V0"
+ android:fillColor="@color/track_on" />
+ </group>
+
+</vector>
diff --git a/packages/SettingsLib/MainSwitchPreference/res/drawable/track_on_indicator.xml b/packages/SettingsLib/MainSwitchPreference/res/drawable/track_on_indicator.xml
new file mode 100644
index 0000000..2281d04
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/res/drawable/track_on_indicator.xml
@@ -0,0 +1,31 @@
+<?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.
+ -->
+
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="13.19dp"
+ android:height="10.06dp"
+ android:viewportWidth="13.19"
+ android:viewportHeight="10.06">
+
+ <group>
+ <path
+ android:pathData="M4.75012 8.12738L1.62262 4.99988L0.557617 6.05738L4.75012 10.2499L13.7501 1.24988L12.6926 0.192383L4.75012 8.12738Z"
+ android:fillColor="@android:color/white" />
+ </group>
+
+</vector>
diff --git a/packages/SettingsLib/MainSwitchPreference/res/drawable/track_selector.xml b/packages/SettingsLib/MainSwitchPreference/res/drawable/track_selector.xml
new file mode 100644
index 0000000..5c699be
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/res/drawable/track_selector.xml
@@ -0,0 +1,21 @@
+<?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.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/track_on" android:state_checked="true" />
+ <item android:drawable="@drawable/track_off" android:state_checked="false" />
+</selector>
diff --git a/packages/SettingsLib/MainSwitchPreference/res/layout/main_switch_bar.xml b/packages/SettingsLib/MainSwitchPreference/res/layout/main_switch_bar.xml
new file mode 100644
index 0000000..a9e9f8c
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/res/layout/main_switch_bar.xml
@@ -0,0 +1,73 @@
+<?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_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="@android:color/transparent"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:id="@+id/frame"
+ android:minHeight="@dimen/min_switch_bar_height"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="@android:color/transparent"
+ android:paddingLeft="@dimen/switchbar_margin_start"
+ android:paddingRight="@dimen/switchbar_margin_end">
+
+ <TextView
+ android:id="@+id/switch_text"
+ android:layout_height="wrap_content"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_gravity="center_vertical"
+ android:maxLines="2"
+ android:ellipsize="end"
+ android:textAppearance="?android:attr/textAppearanceListItem"
+ android:textAlignment="viewStart"
+ style="@style/MainSwitchText" />
+
+ <ImageView
+ android:id="@+id/restricted_icon"
+ android:layout_width="@dimen/restricted_icon_size"
+ android:layout_height="@dimen/restricted_icon_size"
+ android:tint="?android:attr/colorAccent"
+ android:theme="@android:style/Theme.Material"
+ android:layout_gravity="center_vertical"
+ android:layout_marginEnd="@dimen/restricted_icon_margin_end"
+ android:src="@*android:drawable/ic_info"
+ android:visibility="gone" />
+
+ <Switch
+ android:id="@android:id/switch_widget"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:track="@drawable/track_selector"
+ android:thumb="@drawable/thumb_selector"
+ android:theme="@style/Settings.MainSwitch"/>
+ </LinearLayout>
+
+ <View
+ android:id="@+id/below_divider"
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:background="?android:attr/listDivider" />
+</LinearLayout>
+
+
diff --git a/packages/SettingsLib/MainSwitchPreference/res/layout/main_switch_layout.xml b/packages/SettingsLib/MainSwitchPreference/res/layout/main_switch_layout.xml
new file mode 100644
index 0000000..efc047c
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/res/layout/main_switch_layout.xml
@@ -0,0 +1,30 @@
+<?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_height="wrap_content"
+ android:layout_width="match_parent" >
+
+ <com.android.settingslib.widget.MainSwitchBar
+ android:id="@+id/main_switch_bar"
+ android:visibility="gone"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+
+</LinearLayout>
+
+
diff --git a/packages/SettingsLib/MainSwitchPreference/res/values-night/colors.xml b/packages/SettingsLib/MainSwitchPreference/res/values-night/colors.xml
new file mode 100644
index 0000000..ecbb84a
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/res/values-night/colors.xml
@@ -0,0 +1,25 @@
+<?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.
+ -->
+
+<resources>
+
+ <color name="title_text_color">@*android:color/primary_text_dark</color>
+ <color name="thumb_off">#BFFFFFFF</color>
+ <color name="track_on">@*android:color/material_grey_600</color>
+ <color name="track_off">@*android:color/material_grey_600</color>
+
+</resources>
diff --git a/packages/SettingsLib/MainSwitchPreference/res/values/colors.xml b/packages/SettingsLib/MainSwitchPreference/res/values/colors.xml
new file mode 100644
index 0000000..b401398
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/res/values/colors.xml
@@ -0,0 +1,26 @@
+<?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.
+ -->
+
+<resources>
+
+ <color name="background_color">@android:color/transparent</color>
+ <color name="title_text_color">@*android:color/primary_text_light</color>
+ <color name="thumb_off">#BFFFFFFF</color>
+ <color name="track_on">@*android:color/accent_device_default_dark</color>
+ <color name="track_off">@*android:color/material_grey_600</color>
+
+</resources>
diff --git a/packages/SettingsLib/MainSwitchPreference/res/values/dimens.xml b/packages/SettingsLib/MainSwitchPreference/res/values/dimens.xml
new file mode 100644
index 0000000..dd443de
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/res/values/dimens.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.
+ -->
+
+<resources>
+
+ <!-- Size of layout margin left -->
+ <dimen name="switchbar_margin_start">26dp</dimen>
+
+ <!-- Size of layout margin right -->
+ <dimen name="switchbar_margin_end">24dp</dimen>
+
+ <!-- Minimum width of switch -->
+ <dimen name="min_switch_width">48dp</dimen>
+
+ <!-- Minimum width of switch bar -->
+ <dimen name="min_switch_bar_height">72dp</dimen>
+
+ <!-- Restricted icon size in switch bar -->
+ <dimen name="restricted_icon_size">@*android:dimen/config_restrictedIconSize</dimen>
+
+ <!-- Restricted icon in switch bar -->
+ <dimen name="restricted_icon_margin_end">16dp</dimen>
+</resources>
diff --git a/packages/SettingsLib/MainSwitchPreference/res/values/styles.xml b/packages/SettingsLib/MainSwitchPreference/res/values/styles.xml
new file mode 100644
index 0000000..fbb896c
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/res/values/styles.xml
@@ -0,0 +1,29 @@
+<?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.
+ -->
+
+<resources>
+
+ <style name="MainSwitchText">
+ <item name="android:textSize">20sp</item>
+ <item name="android:textColor">@color/title_text_color</item>
+ </style>
+
+ <style name="Settings.MainSwitch" parent="@android:style/Widget.Material.CompoundButton.Switch">
+ <item name="android:switchMinWidth">@dimen/min_switch_width</item>
+ </style>
+
+</resources>
diff --git a/packages/SettingsLib/MainSwitchPreference/src/com/android/settingslib/widget/MainSwitchBar.java b/packages/SettingsLib/MainSwitchPreference/src/com/android/settingslib/widget/MainSwitchBar.java
new file mode 100644
index 0000000..532c996
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/src/com/android/settingslib/widget/MainSwitchBar.java
@@ -0,0 +1,300 @@
+/*
+ * 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.widget;
+
+import android.content.Context;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.CompoundButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.Switch;
+import android.widget.TextView;
+
+import androidx.annotation.VisibleForTesting;
+
+import com.android.settingslib.RestrictedLockUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * MainSwitchBar is a View with a customized Switch.
+ * This component is used as the main switch of the page
+ * to enable or disable the prefereces on the page.
+ */
+public class MainSwitchBar extends LinearLayout implements CompoundButton.OnCheckedChangeListener {
+
+ private final List<OnMainSwitchChangeListener> mSwitchChangeListeners = new ArrayList<>();
+
+ private View mAboveDivider;
+ private View mBelowDivider;
+ private TextView mTextView;
+ private ImageView mRestrictedIcon;
+ private Switch mSwitch;
+
+ private RestrictedLockUtils.EnforcedAdmin mEnforcedAdmin;
+ private boolean mDisabledByAdmin;
+
+ public MainSwitchBar(Context context) {
+ this(context, null);
+ }
+
+ public MainSwitchBar(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public MainSwitchBar(Context context, AttributeSet attrs, int defStyleAttr) {
+ this(context, attrs, defStyleAttr, 0);
+ }
+
+ public MainSwitchBar(Context context, AttributeSet attrs, int defStyleAttr,
+ int defStyleRes) {
+ super(context, attrs, defStyleAttr, defStyleRes);
+
+ LayoutInflater.from(context).inflate(R.layout.main_switch_bar, this);
+
+ setFocusable(true);
+ setClickable(true);
+
+ mTextView = (TextView) findViewById(R.id.switch_text);
+ mSwitch = (Switch) findViewById(android.R.id.switch_widget);
+
+ addOnSwitchChangeListener((switchView, isChecked) -> setChecked(isChecked));
+
+ mRestrictedIcon = findViewById(R.id.restricted_icon);
+ mRestrictedIcon.setOnClickListener((View v) -> {
+ if (mDisabledByAdmin) {
+ RestrictedLockUtils.sendShowAdminSupportDetailsIntent(context, mEnforcedAdmin);
+ onRestrictedIconClick();
+ }
+ });
+
+ setChecked(mSwitch.isChecked());
+ }
+
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ propagateChecked(isChecked);
+ }
+
+ @Override
+ public boolean performClick() {
+ return getDelegatingView().performClick();
+ }
+
+ /**
+ * Update the switch status
+ */
+ public void setChecked(boolean checked) {
+ if (mSwitch != null) {
+ mSwitch.setChecked(checked);
+ }
+ }
+
+ /**
+ * Return the status of the Switch
+ */
+ public boolean isChecked() {
+ return mSwitch.isChecked();
+ }
+
+ /**
+ * Return the Switch
+ */
+ public final Switch getSwitch() {
+ return mSwitch;
+ }
+
+ /**
+ * Set the title text
+ */
+ public void setTitle(String text) {
+ if (mTextView != null) {
+ mTextView.setText(text);
+ }
+ }
+
+ /**
+ * Show the MainSwitchBar
+ */
+ public void show() {
+ if (!isShowing()) {
+ setVisibility(View.VISIBLE);
+ mSwitch.setOnCheckedChangeListener(this);
+ }
+ }
+
+ /**
+ * Hide the MainSwitchBar
+ */
+ public void hide() {
+ if (isShowing()) {
+ setVisibility(View.GONE);
+ mSwitch.setOnCheckedChangeListener(null);
+ }
+ }
+
+ /**
+ * Return the displaying status of MainSwitchBar
+ */
+ public boolean isShowing() {
+ return (getVisibility() == View.VISIBLE);
+ }
+
+ /**
+ * Adds a listener for switch changes
+ */
+ public void addOnSwitchChangeListener(OnMainSwitchChangeListener listener) {
+ if (!mSwitchChangeListeners.contains(listener)) {
+ mSwitchChangeListeners.add(listener);
+ }
+ }
+
+ /**
+ * Remove a listener for switch changes
+ */
+ public void removeOnSwitchChangeListener(OnMainSwitchChangeListener listener) {
+ if (mSwitchChangeListeners.contains(listener)) {
+ mSwitchChangeListeners.remove(listener);
+ }
+ }
+
+ /**
+ * If admin is not null, disables the text and switch but keeps the view clickable.
+ * Otherwise, calls setEnabled which will enables the entire view including
+ * the text and switch.
+ */
+ public void setDisabledByAdmin(RestrictedLockUtils.EnforcedAdmin admin) {
+ mEnforcedAdmin = admin;
+ if (admin != null) {
+ super.setEnabled(true);
+ mDisabledByAdmin = true;
+ mTextView.setEnabled(false);
+ mSwitch.setEnabled(false);
+ mSwitch.setVisibility(View.GONE);
+ mRestrictedIcon.setVisibility(View.VISIBLE);
+ } else {
+ mDisabledByAdmin = false;
+ mSwitch.setVisibility(View.VISIBLE);
+ mRestrictedIcon.setVisibility(View.GONE);
+ setEnabled(true);
+ }
+ }
+
+ /**
+ * Enable or disable the text and switch.
+ */
+ public void setEnabled(boolean enabled) {
+ if (enabled && mDisabledByAdmin) {
+ setDisabledByAdmin(null);
+ return;
+ }
+ super.setEnabled(enabled);
+ mTextView.setEnabled(enabled);
+ mSwitch.setEnabled(enabled);
+ }
+
+ /**
+ * Called by the restricted icon clicked.
+ */
+ protected void onRestrictedIconClick() {
+ }
+
+ @VisibleForTesting
+ View getDelegatingView() {
+ return mDisabledByAdmin ? mRestrictedIcon : mSwitch;
+ }
+
+ private void propagateChecked(boolean isChecked) {
+ final int count = mSwitchChangeListeners.size();
+ for (int n = 0; n < count; n++) {
+ mSwitchChangeListeners.get(n).onSwitchChanged(mSwitch, isChecked);
+ }
+ }
+
+ static class SavedState extends BaseSavedState {
+ boolean mChecked;
+ boolean mVisible;
+
+ SavedState(Parcelable superState) {
+ super(superState);
+ }
+
+ /**
+ * Constructor called from {@link #CREATOR}
+ */
+ private SavedState(Parcel in) {
+ super(in);
+ mChecked = (Boolean) in.readValue(null);
+ mVisible = (Boolean) in.readValue(null);
+ }
+
+ @Override
+ public void writeToParcel(Parcel out, int flags) {
+ super.writeToParcel(out, flags);
+ out.writeValue(mChecked);
+ out.writeValue(mVisible);
+ }
+
+ @Override
+ public String toString() {
+ return "MainSwitchBar.SavedState{"
+ + Integer.toHexString(System.identityHashCode(this))
+ + " checked=" + mChecked
+ + " visible=" + mVisible + "}";
+ }
+
+ public static final Parcelable.Creator<SavedState> CREATOR =
+ new Parcelable.Creator<SavedState>() {
+ public SavedState createFromParcel(Parcel in) {
+ return new SavedState(in);
+ }
+
+ public SavedState[] newArray(int size) {
+ return new SavedState[size];
+ }
+ };
+ }
+
+ @Override
+ public Parcelable onSaveInstanceState() {
+ Parcelable superState = super.onSaveInstanceState();
+
+ SavedState ss = new SavedState(superState);
+ ss.mChecked = mSwitch.isChecked();
+ ss.mVisible = isShowing();
+ return ss;
+ }
+
+ @Override
+ public void onRestoreInstanceState(Parcelable state) {
+ SavedState ss = (SavedState) state;
+
+ super.onRestoreInstanceState(ss.getSuperState());
+
+ mSwitch.setChecked(ss.mChecked);
+ setChecked(ss.mChecked);
+ setVisibility(ss.mVisible ? View.VISIBLE : View.GONE);
+ mSwitch.setOnCheckedChangeListener(ss.mVisible ? this : null);
+
+ requestLayout();
+ }
+}
diff --git a/packages/SettingsLib/MainSwitchPreference/src/com/android/settingslib/widget/MainSwitchPreference.java b/packages/SettingsLib/MainSwitchPreference/src/com/android/settingslib/widget/MainSwitchPreference.java
new file mode 100644
index 0000000..dae0e70
--- /dev/null
+++ b/packages/SettingsLib/MainSwitchPreference/src/com/android/settingslib/widget/MainSwitchPreference.java
@@ -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.settingslib.widget;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.Switch;
+
+import androidx.preference.PreferenceViewHolder;
+import androidx.preference.TwoStatePreference;
+
+import com.android.settingslib.RestrictedLockUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * MainSwitchPreference is a Preference with a customized Switch.
+ * This component is used as the main switch of the page
+ * to enable or disable the prefereces on the page.
+ */
+public class MainSwitchPreference extends TwoStatePreference {
+
+ private final List<OnMainSwitchChangeListener> mSwitchChangeListeners = new ArrayList<>();
+
+ private MainSwitchBar mMainSwitchBar;
+ private Switch mSwitch;
+ private String mTitle;
+
+ private RestrictedLockUtils.EnforcedAdmin mEnforcedAdmin;
+
+ public MainSwitchPreference(Context context) {
+ super(context);
+ init();
+ }
+
+ public MainSwitchPreference(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ init();
+ }
+
+ public MainSwitchPreference(Context context, AttributeSet attrs, int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ init();
+ }
+
+ public MainSwitchPreference(Context context, AttributeSet attrs, int defStyleAttr,
+ int defStyleRes) {
+ super(context, attrs, defStyleAttr, defStyleRes);
+ init();
+ }
+
+ @Override
+ public void onBindViewHolder(PreferenceViewHolder holder) {
+ super.onBindViewHolder(holder);
+
+ holder.setDividerAllowedAbove(true);
+ holder.setDividerAllowedBelow(false);
+
+ mMainSwitchBar = (MainSwitchBar) holder.findViewById(R.id.main_switch_bar);
+ updateStatus(isChecked());
+ registerListenerToSwitchBar();
+ }
+
+ private void init() {
+ setLayoutResource(R.layout.main_switch_layout);
+ }
+
+ /**
+ * Set the preference title text
+ */
+ public void setTitle(String text) {
+ mTitle = text;
+ if (mMainSwitchBar != null) {
+ mMainSwitchBar.setTitle(mTitle);
+ }
+ }
+
+ /**
+ * Update the switch status of preference
+ */
+ public void updateStatus(boolean checked) {
+ setChecked(checked);
+ if (mMainSwitchBar != null) {
+ mMainSwitchBar.setChecked(checked);
+ mMainSwitchBar.setTitle(mTitle);
+ mMainSwitchBar.setDisabledByAdmin(mEnforcedAdmin);
+ mMainSwitchBar.show();
+ }
+ }
+
+ /**
+ * Adds a listener for switch changes
+ */
+ public void addOnSwitchChangeListener(OnMainSwitchChangeListener listener) {
+ if (mMainSwitchBar == null) {
+ mSwitchChangeListeners.add(listener);
+ } else {
+ mMainSwitchBar.addOnSwitchChangeListener(listener);
+ }
+ }
+
+ /**
+ * Remove a listener for switch changes
+ */
+ public void removeOnSwitchChangeListener(OnMainSwitchChangeListener listener) {
+ if (mMainSwitchBar == null) {
+ mSwitchChangeListeners.remove(listener);
+ } else {
+ mMainSwitchBar.removeOnSwitchChangeListener(listener);
+ }
+ }
+
+ /**
+ * If admin is not null, disables the text and switch but keeps the view clickable.
+ * Otherwise, calls setEnabled which will enables the entire view including
+ * the text and switch.
+ */
+ public void setDisabledByAdmin(RestrictedLockUtils.EnforcedAdmin admin) {
+ mEnforcedAdmin = admin;
+ if (mMainSwitchBar != null) {
+ mMainSwitchBar.setDisabledByAdmin(mEnforcedAdmin);
+ }
+ }
+
+ private void registerListenerToSwitchBar() {
+ for (OnMainSwitchChangeListener listener : mSwitchChangeListeners) {
+ mMainSwitchBar.addOnSwitchChangeListener(listener);
+ }
+ mSwitchChangeListeners.clear();
+ }
+}
diff --git a/wifi/java/android/net/wifi/IWifiConnectedNetworkScorer.aidl b/packages/SettingsLib/MainSwitchPreference/src/com/android/settingslib/widget/OnMainSwitchChangeListener.java
similarity index 61%
copy from wifi/java/android/net/wifi/IWifiConnectedNetworkScorer.aidl
copy to packages/SettingsLib/MainSwitchPreference/src/com/android/settingslib/widget/OnMainSwitchChangeListener.java
index f96d037c..1c610d9 100644
--- a/wifi/java/android/net/wifi/IWifiConnectedNetworkScorer.aidl
+++ b/packages/SettingsLib/MainSwitchPreference/src/com/android/settingslib/widget/OnMainSwitchChangeListener.java
@@ -14,20 +14,17 @@
* limitations under the License.
*/
-package android.net.wifi;
+package com.android.settingslib.widget;
-import android.net.wifi.IScoreUpdateObserver;
+import android.widget.Switch;
/**
- * Interface for Wi-Fi connected network scorer.
- *
- * @hide
+ * Called when the checked state of the Switch has changed.
*/
-oneway interface IWifiConnectedNetworkScorer
-{
- void onStart(int sessionId);
-
- void onStop(int sessionId);
-
- void onSetScoreUpdateObserver(IScoreUpdateObserver observerImpl);
+public interface OnMainSwitchChangeListener {
+ /**
+ * @param switchView The Switch view whose state has changed.
+ * @param isChecked The new checked state of switchView.
+ */
+ void onSwitchChanged(Switch switchView, boolean isChecked);
}
diff --git a/packages/SettingsLib/res/values-ca/strings.xml b/packages/SettingsLib/res/values-ca/strings.xml
index 300b475..98d502d 100644
--- a/packages/SettingsLib/res/values-ca/strings.xml
+++ b/packages/SettingsLib/res/values-ca/strings.xml
@@ -413,7 +413,7 @@
<string name="convert_to_file_encryption_done" msgid="8965831011811180627">"El fitxer ja està encriptat"</string>
<string name="title_convert_fbe" msgid="5780013350366495149">"S\'està convertint en l\'encriptació basada en fitxers"</string>
<string name="convert_to_fbe_warning" msgid="34294381569282109">"Converteix la partició de dades en una encriptació basada en fitxers.\n Advertiment: s\'esborraran totes les teves dades.\n Aquesta funció és alfa i és possible que no funcioni correctament.\n Per continuar, prem Esborra i converteix…"</string>
- <string name="button_convert_fbe" msgid="1159861795137727671">"Esborra i converteix…"</string>
+ <string name="button_convert_fbe" msgid="1159861795137727671">"Neteja i converteix…"</string>
<string name="picture_color_mode" msgid="1013807330552931903">"Mode de color de la imatge"</string>
<string name="picture_color_mode_desc" msgid="151780973768136200">"Utilitza sRGB"</string>
<string name="daltonizer_mode_disabled" msgid="403424372812399228">"Desactivat"</string>
diff --git a/packages/SettingsLib/res/values-fi/strings.xml b/packages/SettingsLib/res/values-fi/strings.xml
index 6081b2a..b103802 100644
--- a/packages/SettingsLib/res/values-fi/strings.xml
+++ b/packages/SettingsLib/res/values-fi/strings.xml
@@ -492,8 +492,8 @@
<string name="status_unavailable" msgid="5279036186589861608">"Ei käytettävissä"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC-osoite satunnaistetaan"</string>
<plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d laitetta liitetty</item>
- <item quantity="one">%1$d laite liitetty</item>
+ <item quantity="other">%1$d laitetta yhdistettynä</item>
+ <item quantity="one">%1$d laite yhdistettynä</item>
</plurals>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Enemmän aikaa"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Vähemmän aikaa"</string>
diff --git a/packages/SettingsLib/res/values-in/strings.xml b/packages/SettingsLib/res/values-in/strings.xml
index 69d4582..332d5b3 100644
--- a/packages/SettingsLib/res/values-in/strings.xml
+++ b/packages/SettingsLib/res/values-in/strings.xml
@@ -207,7 +207,7 @@
<string name="enable_adb_summary" msgid="3711526030096574316">"Mode debug ketika USB tersambung"</string>
<string name="clear_adb_keys" msgid="3010148733140369917">"Cabut otorisasi debug USB"</string>
<string name="enable_adb_wireless" msgid="6973226350963971018">"Proses debug nirkabel"</string>
- <string name="enable_adb_wireless_summary" msgid="7344391423657093011">"Mode debug saat Wi-Fi tersambung"</string>
+ <string name="enable_adb_wireless_summary" msgid="7344391423657093011">"Mode debug saat Wi-Fi terhubung"</string>
<string name="adb_wireless_error" msgid="721958772149779856">"Error"</string>
<string name="adb_wireless_settings" msgid="2295017847215680229">"Proses debug nirkabel"</string>
<string name="adb_wireless_list_empty_off" msgid="1713707973837255490">"Untuk melihat dan menggunakan perangkat yang tersedia, aktifkan proses debug nirkabel"</string>
@@ -225,13 +225,13 @@
<string name="adb_pairing_device_dialog_title" msgid="7141739231018530210">"Sambungkan dengan perangkat"</string>
<string name="adb_pairing_device_dialog_pairing_code_label" msgid="3639239786669722731">"Kode penyambungan Wi-Fi"</string>
<string name="adb_pairing_device_dialog_failed_title" msgid="3426758947882091735">"Penyambungan perangkat gagal"</string>
- <string name="adb_pairing_device_dialog_failed_msg" msgid="6611097519661997148">"Pastikan perangkat tersambung ke jaringan yang sama."</string>
- <string name="adb_wireless_qrcode_summary" msgid="8051414549011801917">"Menyambungkan perangkat melalui Wi‑Fi dengan memindai Kode QR"</string>
+ <string name="adb_pairing_device_dialog_failed_msg" msgid="6611097519661997148">"Pastikan perangkat terhubung ke jaringan yang sama."</string>
+ <string name="adb_wireless_qrcode_summary" msgid="8051414549011801917">"Sambungkan perangkat melalui Wi‑Fi dengan memindai Kode QR"</string>
<string name="adb_wireless_verifying_qrcode_text" msgid="6123192424916029207">"Menyambungkan perangkat…"</string>
<string name="adb_qrcode_pairing_device_failed_msg" msgid="6936292092592914132">"Gagal menyambungkan perangkat. Kode QR salah, atau perangkat tidak tersambung ke jaringan yang sama."</string>
<string name="adb_wireless_ip_addr_preference_title" msgid="8335132107715311730">"Alamat IP & Port"</string>
<string name="adb_wireless_qrcode_pairing_title" msgid="1906409667944674707">"Memindai kode QR"</string>
- <string name="adb_wireless_qrcode_pairing_description" msgid="6014121407143607851">"Menyambungkan perangkat melalui Wi‑Fi dengan memindai Kode QR"</string>
+ <string name="adb_wireless_qrcode_pairing_description" msgid="6014121407143607851">"Sambungkan perangkat melalui Wi‑Fi dengan memindai Kode QR"</string>
<string name="adb_wireless_no_network_msg" msgid="2365795244718494658">"Harap sambungkan ke jaringan Wi-Fi"</string>
<string name="keywords_adb_wireless" msgid="6507505581882171240">"adb, debug, dev"</string>
<string name="bugreport_in_power" msgid="8664089072534638709">"Pintasan laporan bug"</string>
diff --git a/packages/SettingsLib/res/values-iw/strings.xml b/packages/SettingsLib/res/values-iw/strings.xml
index 4cc6775..db2ffe5 100644
--- a/packages/SettingsLib/res/values-iw/strings.xml
+++ b/packages/SettingsLib/res/values-iw/strings.xml
@@ -212,9 +212,9 @@
<string name="adb_wireless_settings" msgid="2295017847215680229">"ניפוי באגים אלחוטי"</string>
<string name="adb_wireless_list_empty_off" msgid="1713707973837255490">"כדי להציג את המכשירים הזמינים ולהשתמש בהם, יש להפעיל ניפוי באגים אלחוטי"</string>
<string name="adb_pair_method_qrcode_title" msgid="6982904096137468634">"התאמת מכשיר באמצעות קוד QR"</string>
- <string name="adb_pair_method_qrcode_summary" msgid="7130694277228970888">"התאמת מכשירים חדשים באמצעות סורק של קודי QR"</string>
+ <string name="adb_pair_method_qrcode_summary" msgid="7130694277228970888">"התאמת מכשירים חדשים באמצעות סורק קודי QR"</string>
<string name="adb_pair_method_code_title" msgid="1122590300445142904">"התאמת מכשיר באמצעות קוד התאמה"</string>
- <string name="adb_pair_method_code_summary" msgid="6370414511333685185">"התאמת מכשירים חדשים באמצעות קוד בן שש ספרות"</string>
+ <string name="adb_pair_method_code_summary" msgid="6370414511333685185">"התאמת מכשירים חדשים באמצעות קוד בן 6 ספרות"</string>
<string name="adb_paired_devices_title" msgid="5268997341526217362">"מכשירים מותאמים"</string>
<string name="adb_wireless_device_connected_summary" msgid="3039660790249148713">"מחובר עכשיו"</string>
<string name="adb_wireless_device_details_title" msgid="7129369670526565786">"פרטי מכשיר"</string>
@@ -226,12 +226,12 @@
<string name="adb_pairing_device_dialog_pairing_code_label" msgid="3639239786669722731">"קוד התאמה של Wi-Fi"</string>
<string name="adb_pairing_device_dialog_failed_title" msgid="3426758947882091735">"ההתאמה נכשלה"</string>
<string name="adb_pairing_device_dialog_failed_msg" msgid="6611097519661997148">"יש לוודא שהמכשיר מחובר לאותה רשת."</string>
- <string name="adb_wireless_qrcode_summary" msgid="8051414549011801917">"יש לסרוק קוד QR כדי להתאים מכשיר באמצעות Wi‑Fi"</string>
+ <string name="adb_wireless_qrcode_summary" msgid="8051414549011801917">"כדי להתאים מכשיר דרך Wi‑Fi, יש לסרוק קוד QR"</string>
<string name="adb_wireless_verifying_qrcode_text" msgid="6123192424916029207">"המכשיר בתהליך התאמה…"</string>
<string name="adb_qrcode_pairing_device_failed_msg" msgid="6936292092592914132">"התאמת המכשיר נכשלה. קוד ה-QR היה שגוי או שהמכשיר לא מחובר לאותה רשת."</string>
<string name="adb_wireless_ip_addr_preference_title" msgid="8335132107715311730">"יציאה וכתובת IP"</string>
<string name="adb_wireless_qrcode_pairing_title" msgid="1906409667944674707">"סריקת קוד QR"</string>
- <string name="adb_wireless_qrcode_pairing_description" msgid="6014121407143607851">"יש לסרוק קוד QR כדי להתאים מכשיר באמצעות Wi‑Fi"</string>
+ <string name="adb_wireless_qrcode_pairing_description" msgid="6014121407143607851">"כדי להתאים מכשיר דרך Wi‑Fi, יש לסרוק קוד QR"</string>
<string name="adb_wireless_no_network_msg" msgid="2365795244718494658">"יש להתחבר לרשת Wi-Fi"</string>
<string name="keywords_adb_wireless" msgid="6507505581882171240">"adb, ניפוי באגים, פיתוח"</string>
<string name="bugreport_in_power" msgid="8664089072534638709">"קיצור של דוח באגים"</string>
diff --git a/packages/SettingsLib/res/values-ml/strings.xml b/packages/SettingsLib/res/values-ml/strings.xml
index 122b481..b7de429 100644
--- a/packages/SettingsLib/res/values-ml/strings.xml
+++ b/packages/SettingsLib/res/values-ml/strings.xml
@@ -145,7 +145,7 @@
<string name="data_usage_ota" msgid="7984667793701597001">"സിസ്റ്റം അപ്ഡേറ്റുകൾ"</string>
<string name="tether_settings_title_usb" msgid="3728686573430917722">"USB ടെതറിംഗ്"</string>
<string name="tether_settings_title_wifi" msgid="4803402057533895526">"പോർട്ടബിൾ ഹോട്ട്സ്പോട്ട്"</string>
- <string name="tether_settings_title_bluetooth" msgid="916519902721399656">"ബ്ലൂടൂത്ത് ടെതറിംഗ്"</string>
+ <string name="tether_settings_title_bluetooth" msgid="916519902721399656">"Bluetooth ടെതറിംഗ്"</string>
<string name="tether_settings_title_usb_bluetooth" msgid="1727111807207577322">"ടെതറിംഗ്"</string>
<string name="tether_settings_title_all" msgid="8910259483383010470">"ടെതറിംഗും പോർട്ടബിൾ ഹോട്ട്സ്പോട്ടും"</string>
<string name="managed_user_title" msgid="449081789742645723">"എല്ലാ ഔദ്യോഗിക ആപ്സും"</string>
diff --git a/packages/SettingsLib/res/values-sq/strings.xml b/packages/SettingsLib/res/values-sq/strings.xml
index 5774d9b..821e897b 100644
--- a/packages/SettingsLib/res/values-sq/strings.xml
+++ b/packages/SettingsLib/res/values-sq/strings.xml
@@ -203,9 +203,9 @@
<string name="vpn_settings_not_available" msgid="2894137119965668920">"Cilësimet e VPN-së nuk ofrohen për këtë përdorues"</string>
<string name="tethering_settings_not_available" msgid="266821736434699780">"Cilësimet e ndarjes nuk ofrohen për këtë përdorues"</string>
<string name="apn_settings_not_available" msgid="1147111671403342300">"Cilësimet e \"Emrit të pikës së qasjes\" nuk mund të përdoren për këtë përdorues"</string>
- <string name="enable_adb" msgid="8072776357237289039">"Korrigjimi i USB-së"</string>
+ <string name="enable_adb" msgid="8072776357237289039">"Korrigjimi përmes USB-së"</string>
<string name="enable_adb_summary" msgid="3711526030096574316">"Korrigjo gabimet e modalitetit kur UBS-ja është e lidhur"</string>
- <string name="clear_adb_keys" msgid="3010148733140369917">"Anulo autorizimet e korrigjimeve të gabimeve të USB-së"</string>
+ <string name="clear_adb_keys" msgid="3010148733140369917">"Anulo autorizimet e korrigjimeve përmes USB-së"</string>
<string name="enable_adb_wireless" msgid="6973226350963971018">"Korrigjimi përmes Wi-Fi"</string>
<string name="enable_adb_wireless_summary" msgid="7344391423657093011">"Modaliteti i korrigjimit kur Wi‑Fi është i lidhur"</string>
<string name="adb_wireless_error" msgid="721958772149779856">"Gabim"</string>
@@ -225,7 +225,7 @@
<string name="adb_pairing_device_dialog_title" msgid="7141739231018530210">"Çifto me pajisjen"</string>
<string name="adb_pairing_device_dialog_pairing_code_label" msgid="3639239786669722731">"Kodi i çiftimit të Wi‑Fi"</string>
<string name="adb_pairing_device_dialog_failed_title" msgid="3426758947882091735">"Çiftimi ishte i pasuksesshëm"</string>
- <string name="adb_pairing_device_dialog_failed_msg" msgid="6611097519661997148">"Sigurohu që pajisja të jetë e lidhur me të njëjtin rrjet"</string>
+ <string name="adb_pairing_device_dialog_failed_msg" msgid="6611097519661997148">"Sigurohu që pajisja të jetë e lidhur me të njëjtin rrjet."</string>
<string name="adb_wireless_qrcode_summary" msgid="8051414549011801917">"Çifto pajisjen përmes Wi‑Fi duke skanuar një kod QR"</string>
<string name="adb_wireless_verifying_qrcode_text" msgid="6123192424916029207">"Po çifton pajisjen…"</string>
<string name="adb_qrcode_pairing_device_failed_msg" msgid="6936292092592914132">"Çiftimi i pajisjes dështoi. Ose kodi QR nuk ishte i saktë, ose pajisja nuk është e lidhur me të njëjtin rrjet."</string>
@@ -299,11 +299,11 @@
<string name="debug_view_attributes" msgid="3539609843984208216">"Aktivizo shikimin e inspektimit të atributeve"</string>
<string name="mobile_data_always_on_summary" msgid="1112156365594371019">"Mbaji të dhënat celulare gjithmonë aktive edhe kur Wi‑Fi është aktiv (për ndërrim të shpejtë të rrjetit)."</string>
<string name="tethering_hardware_offload_summary" msgid="7801345335142803029">"Përdor përshpejtimin e harduerit për ndarjen e lidhjes (internet) nëse është i disponueshëm"</string>
- <string name="adb_warning_title" msgid="7708653449506485728">"Të lejohet korrigjimi i USB-së?"</string>
- <string name="adb_warning_message" msgid="8145270656419669221">"Korrigjuesi i USB-së është vetëm për qëllime zhvillimore. Përdore për të kopjuar të dhëna mes kompjuterit dhe pajisjes tënde, për të instaluar aplikacione në pajisjen tënde pa asnjë njoftim si dhe për të lexuar të dhënat e ditarit."</string>
+ <string name="adb_warning_title" msgid="7708653449506485728">"Të lejohet korrigjimi përmes USB-së?"</string>
+ <string name="adb_warning_message" msgid="8145270656419669221">"Korrigjuesi përmes USB-së është vetëm për qëllime zhvillimore. Përdore për të kopjuar të dhëna mes kompjuterit dhe pajisjes tënde, për të instaluar aplikacione në pajisjen tënde pa asnjë njoftim si dhe për të lexuar të dhënat e evidencave."</string>
<string name="adbwifi_warning_title" msgid="727104571653031865">"Të lejohet korrigjimi përmes Wi-Fi?"</string>
<string name="adbwifi_warning_message" msgid="8005936574322702388">"Korrigjimin përmes Wi-Fi është vetëm për qëllime zhvillimore. Përdore për të kopjuar të dhëna mes kompjuterit dhe pajisjes sate, për të instaluar aplikacione në pajisjen tënde pa asnjë njoftim si dhe për të lexuar të dhënat e regjistrit."</string>
- <string name="adb_keys_warning_message" msgid="2968555274488101220">"Të bllokohet qasja për korrigjim të USB-së nga të gjithë kompjuterët që ke autorizuar më parë?"</string>
+ <string name="adb_keys_warning_message" msgid="2968555274488101220">"Të bllokohet qasja për korrigjim përmes USB-së nga të gjithë kompjuterët që ke autorizuar më parë?"</string>
<string name="dev_settings_warning_title" msgid="8251234890169074553">"Të lejohen cilësimet e zhvillimit?"</string>
<string name="dev_settings_warning_message" msgid="37741686486073668">"Këto cilësime janë të projektuara vetëm për përdorim në programim. Ato mund të shkaktojnë që pajisja dhe aplikacionet në të, të mos punojnë ose të veprojnë në mënyrë të gabuar."</string>
<string name="verify_apps_over_usb_title" msgid="6031809675604442636">"Verifiko apl. përmes USB-së"</string>
diff --git a/packages/SettingsLib/res/values-sw/strings.xml b/packages/SettingsLib/res/values-sw/strings.xml
index 084b5c93..b08da89 100644
--- a/packages/SettingsLib/res/values-sw/strings.xml
+++ b/packages/SettingsLib/res/values-sw/strings.xml
@@ -210,7 +210,7 @@
<string name="enable_adb_wireless_summary" msgid="7344391423657093011">"Hali ya utatuzi wakati Wi-Fi imeunganishwa"</string>
<string name="adb_wireless_error" msgid="721958772149779856">"Hitilafu"</string>
<string name="adb_wireless_settings" msgid="2295017847215680229">"Utatuzi usiotumia waya"</string>
- <string name="adb_wireless_list_empty_off" msgid="1713707973837255490">"Ili kungalia na kutumia vifaa vinavyopatikana, washa utatuzi usiotumia waya"</string>
+ <string name="adb_wireless_list_empty_off" msgid="1713707973837255490">"Ili kuangalia na kutumia vifaa vinavyopatikana, washa utatuzi usiotumia waya"</string>
<string name="adb_pair_method_qrcode_title" msgid="6982904096137468634">"Oanisha kifaa ukitumia msimbo wa QR"</string>
<string name="adb_pair_method_qrcode_summary" msgid="7130694277228970888">"Oanisha vifaa vipya ukitumia kichanganuzi cha Msimbo wa QR"</string>
<string name="adb_pair_method_code_title" msgid="1122590300445142904">"Oanisha kifaa ukitumia msimbo wa kuoanisha"</string>
diff --git a/packages/SettingsLib/res/values-th/strings.xml b/packages/SettingsLib/res/values-th/strings.xml
index dabb9d3..a895138 100644
--- a/packages/SettingsLib/res/values-th/strings.xml
+++ b/packages/SettingsLib/res/values-th/strings.xml
@@ -284,7 +284,7 @@
<string name="wifi_verbose_logging_summary" msgid="4993823188807767892">"เพิ่มระดับการบันทึก Wi‑Fi แสดงต่อ SSID RSSI ในตัวเลือก Wi‑Fi"</string>
<string name="wifi_scan_throttling_summary" msgid="2577105472017362814">"ลดการเปลืองแบตเตอรี่และเพิ่มประสิทธิภาพเครือข่าย"</string>
<string name="wifi_enhanced_mac_randomization_summary" msgid="1210663439867489931">"เมื่อเปิดใช้โหมดนี้ ที่อยู่ MAC ของอุปกรณ์นี้อาจเปลี่ยนทุกครั้งที่เชื่อมต่อกับเครือข่ายที่มีการเปิดใช้การสุ่ม MAC"</string>
- <string name="wifi_metered_label" msgid="8737187690304098638">"มีการวัดปริมาณอินเทอร์เน็ต"</string>
+ <string name="wifi_metered_label" msgid="8737187690304098638">"แบบจำกัดปริมาณอินเทอร์เน็ต"</string>
<string name="wifi_unmetered_label" msgid="6174142840934095093">"ไม่มีการวัดปริมาณอินเทอร์เน็ต"</string>
<string name="select_logd_size_title" msgid="1604578195914595173">"ขนาดบัฟเฟอร์ของตัวบันทึก"</string>
<string name="select_logd_size_dialog_title" msgid="2105401994681013578">"เลือกขนาด Logger ต่อบัฟเฟอร์ไฟล์บันทึก"</string>
diff --git a/packages/SettingsLib/res/values-ur/strings.xml b/packages/SettingsLib/res/values-ur/strings.xml
index 4363f0b..5a8b6dc 100644
--- a/packages/SettingsLib/res/values-ur/strings.xml
+++ b/packages/SettingsLib/res/values-ur/strings.xml
@@ -31,7 +31,7 @@
<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>
+ <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>
diff --git a/packages/SettingsLib/res/values-uz/strings.xml b/packages/SettingsLib/res/values-uz/strings.xml
index 1eecf88..7530016 100644
--- a/packages/SettingsLib/res/values-uz/strings.xml
+++ b/packages/SettingsLib/res/values-uz/strings.xml
@@ -427,12 +427,12 @@
<string name="power_remaining_settings_home_page" msgid="4885165789445462557">"<xliff:g id="PERCENTAGE">%1$s</xliff:g> – <xliff:g id="TIME_STRING">%2$s</xliff:g>"</string>
<string name="power_remaining_duration_only" msgid="8264199158671531431">"Taxminan <xliff:g id="TIME_REMAINING">%1$s</xliff:g> qoldi"</string>
<string name="power_discharging_duration" msgid="1076561255466053220">"Taxminan <xliff:g id="TIME_REMAINING">%1$s</xliff:g> qoldi (<xliff:g id="LEVEL">%2$s</xliff:g>)"</string>
- <string name="power_remaining_duration_only_enhanced" msgid="2527842780666073218">"Joriy holatda taxminan <xliff:g id="TIME_REMAINING">%1$s</xliff:g> qoldi"</string>
- <string name="power_discharging_duration_enhanced" msgid="1800465736237672323">"Joriy holatda taxminan <xliff:g id="TIME_REMAINING">%1$s</xliff:g> qoldi (<xliff:g id="LEVEL">%2$s</xliff:g>)"</string>
+ <string name="power_remaining_duration_only_enhanced" msgid="2527842780666073218">"Quvvati tugashiga taxminan <xliff:g id="TIME_REMAINING">%1$s</xliff:g> qoldi"</string>
+ <string name="power_discharging_duration_enhanced" msgid="1800465736237672323">"Quvvati tugahsiga taxminan <xliff:g id="TIME_REMAINING">%1$s</xliff:g> qoldi (<xliff:g id="LEVEL">%2$s</xliff:g>)"</string>
<!-- no translation found for power_remaining_duration_only_short (7438846066602840588) -->
<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_enhanced" msgid="563438403581662942">"Shunday ishlatishda 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_enhanced" msgid="3268796172652988877">"Quvvati tugashiga taxminan <xliff:g id="TIME">%1$s</xliff:g> qoldi"</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>
@@ -515,7 +515,7 @@
<string name="media_transfer_this_device_name" msgid="2716555073132169240">"Telefon karnayi"</string>
<string name="profile_connect_timeout_subtext" msgid="4043408193005851761">"Ulanishda muammo yuz berdi. Qurilmani oʻchiring va yoqing"</string>
<string name="media_transfer_wired_device_name" msgid="4447880899964056007">"Simli audio qurilma"</string>
- <string name="help_label" msgid="3528360748637781274">"Yordam va fikr-mulohaza"</string>
+ <string name="help_label" msgid="3528360748637781274">"Yordam/fikr-mulohaza"</string>
<string name="storage_category" msgid="2287342585424631813">"Xotira"</string>
<string name="shared_data_title" msgid="1017034836800864953">"Umumiy maʼlumotlar"</string>
<string name="shared_data_summary" msgid="5516326713822885652">"Umumiy maʼlumotlarni ochish va oʻzgartirish"</string>
diff --git a/packages/SettingsLib/src/com/android/settingslib/RestrictedPreferenceHelper.java b/packages/SettingsLib/src/com/android/settingslib/RestrictedPreferenceHelper.java
index 1ba1f72..2dbfef0 100644
--- a/packages/SettingsLib/src/com/android/settingslib/RestrictedPreferenceHelper.java
+++ b/packages/SettingsLib/src/com/android/settingslib/RestrictedPreferenceHelper.java
@@ -141,8 +141,9 @@
/**
* Disable this preference based on the enforce admin.
*
- * @param EnforcedAdmin Details of the admin who enforced the restriction. If it
- * is {@code null}, then this preference will be enabled. Otherwise, it will be disabled.
+ * @param admin details of the admin who enforced the restriction. If it is
+ * {@code null}, then this preference will be enabled. Otherwise, it will be disabled.
+ * Only gray out the preference which is not {@link RestrictedTopLevelPreference}.
* @return true if the disabled state was changed.
*/
public boolean setDisabledByAdmin(EnforcedAdmin admin) {
@@ -153,7 +154,11 @@
mDisabledByAdmin = disabled;
changed = true;
}
- mPreference.setEnabled(!disabled);
+
+ if (!(mPreference instanceof RestrictedTopLevelPreference)) {
+ mPreference.setEnabled(!disabled);
+ }
+
return changed;
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/RestrictedTopLevelPreference.java b/packages/SettingsLib/src/com/android/settingslib/RestrictedTopLevelPreference.java
new file mode 100644
index 0000000..0096015
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/RestrictedTopLevelPreference.java
@@ -0,0 +1,120 @@
+/*
+ * 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;
+
+import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
+
+import android.content.Context;
+import android.os.UserHandle;
+import android.util.AttributeSet;
+
+import androidx.core.content.res.TypedArrayUtils;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceManager;
+import androidx.preference.PreferenceViewHolder;
+
+/** Top level preference that can be disabled by a device admin using a user restriction. */
+public class RestrictedTopLevelPreference extends Preference {
+ private RestrictedPreferenceHelper mHelper;
+
+ public RestrictedTopLevelPreference(Context context, AttributeSet attrs,
+ int defStyleAttr, int defStyleRes) {
+ super(context, attrs, defStyleAttr, defStyleRes);
+ mHelper = new RestrictedPreferenceHelper(context, /* preference= */ this, attrs);
+ }
+
+ public RestrictedTopLevelPreference(Context context, AttributeSet attrs, int defStyleAttr) {
+ this(context, attrs, defStyleAttr, /* defStyleRes= */ 0);
+ }
+
+ public RestrictedTopLevelPreference(Context context, AttributeSet attrs) {
+ this(context, attrs, TypedArrayUtils.getAttr(context, R.attr.preferenceStyle,
+ android.R.attr.preferenceStyle));
+ }
+
+ public RestrictedTopLevelPreference(Context context) {
+ this(context, /* attrs= */ null);
+ }
+
+ @Override
+ public void onBindViewHolder(PreferenceViewHolder holder) {
+ super.onBindViewHolder(holder);
+ mHelper.onBindViewHolder(holder);
+ }
+
+ @Override
+ public void performClick() {
+ if (!mHelper.performClick()) {
+ super.performClick();
+ }
+ }
+
+ @Override
+ protected void onAttachedToHierarchy(PreferenceManager preferenceManager) {
+ mHelper.onAttachedToHierarchy();
+ super.onAttachedToHierarchy(preferenceManager);
+ }
+
+ /**
+ * Set the user restriction and disable this preference.
+ *
+ * @param userRestriction constant from {@link android.os.UserManager}
+ */
+ public void checkRestrictionAndSetDisabled(String userRestriction) {
+ mHelper.checkRestrictionAndSetDisabled(userRestriction, UserHandle.myUserId());
+ }
+
+ /**
+ * Set the user restriction and disable this preference for the given user.
+ *
+ * @param userRestriction constant from {@link android.os.UserManager}
+ * @param userId user to check the restriction for.
+ */
+ public void checkRestrictionAndSetDisabled(String userRestriction, int userId) {
+ mHelper.checkRestrictionAndSetDisabled(userRestriction, userId);
+ }
+
+ @Override
+ public void setEnabled(boolean enabled) {
+ if (enabled && isDisabledByAdmin()) {
+ mHelper.setDisabledByAdmin(/* admin= */ null);
+ return;
+ }
+ super.setEnabled(enabled);
+ }
+
+ /**
+ * Check whether this preference is disabled by admin.
+ *
+ * @return true if this preference is disabled by admin.
+ */
+ public boolean isDisabledByAdmin() {
+ return mHelper.isDisabledByAdmin();
+ }
+
+ /**
+ * Disable preference based on the enforce admin.
+ *
+ * @param admin details of the admin who enforced the restriction. If it is {@code null}, then
+ * this preference will be enabled. Otherwise, it will be disabled.
+ */
+ public void setDisabledByAdmin(EnforcedAdmin admin) {
+ if (mHelper.setDisabledByAdmin(admin)) {
+ notifyChanged();
+ }
+ }
+}
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/MediaOutputSliceConstants.java b/packages/SettingsLib/src/com/android/settingslib/media/MediaOutputSliceConstants.java
index fc16eb6..61af5a7 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/MediaOutputSliceConstants.java
+++ b/packages/SettingsLib/src/com/android/settingslib/media/MediaOutputSliceConstants.java
@@ -22,16 +22,6 @@
public class MediaOutputSliceConstants {
/**
- * Key for the Media output setting.
- */
- public static final String KEY_MEDIA_OUTPUT = "media_output";
-
- /**
- * Key for the Media output group setting.
- */
- public static final String KEY_MEDIA_OUTPUT_GROUP = "media_output_group";
-
- /**
* Key for the Remote Media slice.
*/
public static final String KEY_REMOTE_MEDIA = "remote_media";
@@ -47,19 +37,6 @@
public static final String KEY_SESSION_INFO_ID = "key_session_info_id";
/**
- * Activity Action: Show a settings dialog containing {@link MediaDevice} to transfer media.
- */
- public static final String ACTION_MEDIA_OUTPUT =
- "com.android.settings.panel.action.MEDIA_OUTPUT";
-
- /**
- * Activity Action: Show a settings dialog containing {@link MediaDevice} to handle media group
- * operation.
- */
- public static final String ACTION_MEDIA_OUTPUT_GROUP =
- "com.android.settings.panel.action.MEDIA_OUTPUT_GROUP";
-
- /**
* A string extra specifying a media package name.
*/
public static final String EXTRA_PACKAGE_NAME =
@@ -72,12 +49,6 @@
"com.android.systemui.action.LAUNCH_MEDIA_OUTPUT_DIALOG";
/**
- * An intent action to dismiss media output dialog.
- */
- public static final String ACTION_DISMISS_MEDIA_OUTPUT_DIALOG =
- "com.android.systemui.action.DISMISS_MEDIA_OUTPUT_DIALOG";
-
- /**
* Settings package name.
*/
public static final String SETTINGS_PACKAGE_NAME = "com.android.settings";
diff --git a/packages/SettingsLib/src/com/android/settingslib/volume/MediaSessions.java b/packages/SettingsLib/src/com/android/settingslib/volume/MediaSessions.java
index 12ef639..fbf8a2f 100644
--- a/packages/SettingsLib/src/com/android/settingslib/volume/MediaSessions.java
+++ b/packages/SettingsLib/src/com/android/settingslib/volume/MediaSessions.java
@@ -33,7 +33,7 @@
import android.media.session.MediaSession.Token;
import android.media.session.MediaSessionManager;
import android.media.session.MediaSessionManager.OnActiveSessionsChangedListener;
-import android.media.session.MediaSessionManager.RemoteVolumeControllerCallback;
+import android.media.session.MediaSessionManager.RemoteSessionCallback;
import android.media.session.PlaybackState;
import android.os.Bundle;
import android.os.Handler;
@@ -100,8 +100,8 @@
mMgr.addOnActiveSessionsChangedListener(mSessionsListener, null, mHandler);
mInit = true;
postUpdateSessions();
- mMgr.registerRemoteVolumeControllerCallback(mHandlerExecutor,
- mRemoteVolumeControllerCallback);
+ mMgr.registerRemoteSessionCallback(mHandlerExecutor,
+ mRemoteSessionCallback);
}
protected void postUpdateSessions() {
@@ -116,7 +116,7 @@
if (D.BUG) Log.d(TAG, "destroy");
mInit = false;
mMgr.removeOnActiveSessionsChangedListener(mSessionsListener);
- mMgr.unregisterRemoteVolumeControllerCallback(mRemoteVolumeControllerCallback);
+ mMgr.unregisterRemoteSessionCallback(mRemoteSessionCallback);
}
/**
@@ -142,11 +142,11 @@
mCallbacks.onRemoteVolumeChanged(token, flags);
}
- private void onUpdateRemoteControllerH(Token sessionToken) {
+ private void onUpdateRemoteSessionListH(Token sessionToken) {
final MediaController controller =
sessionToken != null ? new MediaController(mContext, sessionToken) : null;
final String pkg = controller != null ? controller.getPackageName() : null;
- if (D.BUG) Log.d(TAG, "updateRemoteControllerH " + pkg);
+ if (D.BUG) Log.d(TAG, "onUpdateRemoteSessionListH " + pkg);
// this may be our only indication that a remote session is changed, refresh
postUpdateSessions();
}
@@ -336,8 +336,8 @@
}
};
- private final RemoteVolumeControllerCallback mRemoteVolumeControllerCallback =
- new RemoteVolumeControllerCallback() {
+ private final RemoteSessionCallback mRemoteSessionCallback =
+ new RemoteSessionCallback() {
@Override
public void onVolumeChanged(@NonNull MediaSession.Token sessionToken,
int flags) {
@@ -346,15 +346,17 @@
}
@Override
- public void onSessionChanged(@Nullable MediaSession.Token sessionToken) {
- mHandler.obtainMessage(H.UPDATE_REMOTE_CONTROLLER, sessionToken).sendToTarget();
+ public void onDefaultRemoteSessionChanged(
+ @Nullable MediaSession.Token sessionToken) {
+ mHandler.obtainMessage(H.UPDATE_REMOTE_SESSION_LIST,
+ sessionToken).sendToTarget();
}
};
private final class H extends Handler {
private static final int UPDATE_SESSIONS = 1;
private static final int REMOTE_VOLUME_CHANGED = 2;
- private static final int UPDATE_REMOTE_CONTROLLER = 3;
+ private static final int UPDATE_REMOTE_SESSION_LIST = 3;
private H(Looper looper) {
super(looper);
@@ -369,8 +371,8 @@
case REMOTE_VOLUME_CHANGED:
onRemoteVolumeChangedH((Token) msg.obj, msg.arg1);
break;
- case UPDATE_REMOTE_CONTROLLER:
- onUpdateRemoteControllerH((Token) msg.obj);
+ case UPDATE_REMOTE_SESSION_LIST:
+ onUpdateRemoteSessionListH((Token) msg.obj);
break;
}
}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/RestrictedPreferenceHelperTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/RestrictedPreferenceHelperTest.java
index 1b10c73..f6affb8 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/RestrictedPreferenceHelperTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/RestrictedPreferenceHelperTest.java
@@ -43,6 +43,8 @@
private Context mContext;
@Mock
private Preference mPreference;
+ @Mock
+ private RestrictedTopLevelPreference mRestrictedTopLevelPreference;
private PreferenceViewHolder mViewHolder;
private RestrictedPreferenceHelper mHelper;
@@ -86,4 +88,21 @@
verify(summaryView).setText(null);
verify(summaryView, never()).setVisibility(View.GONE);
}
+
+ @Test
+ public void setDisabledByAdmin_RestrictedPreference_shouldDisablePreference() {
+ mHelper.setDisabledByAdmin(new RestrictedLockUtils.EnforcedAdmin());
+
+ verify(mPreference).setEnabled(false);
+ }
+
+ @Test
+ public void setDisabledByAdmin_TopLevelRestrictedPreference_shouldNotDisablePreference() {
+ mHelper = new RestrictedPreferenceHelper(mContext,
+ mRestrictedTopLevelPreference, /* attrs= */ null);
+
+ mHelper.setDisabledByAdmin(new RestrictedLockUtils.EnforcedAdmin());
+
+ verify(mRestrictedTopLevelPreference, never()).setEnabled(false);
+ }
}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/RestrictedTopLevelPreferenceTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/RestrictedTopLevelPreferenceTest.java
new file mode 100644
index 0000000..f97ef4a
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/RestrictedTopLevelPreferenceTest.java
@@ -0,0 +1,74 @@
+/*
+ * 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;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.util.ReflectionHelpers;
+
+@RunWith(RobolectricTestRunner.class)
+public class RestrictedTopLevelPreferenceTest {
+
+ private Context mContext;
+ private RestrictedTopLevelPreference mPreference;
+ private RestrictedPreferenceHelper mHelper;
+
+ @Before
+ public void setUp() {
+ mContext = RuntimeEnvironment.application;
+ mPreference = spy(new RestrictedTopLevelPreference(mContext));
+ mHelper = spy(new RestrictedPreferenceHelper(mContext, mPreference, null));
+ ReflectionHelpers.setField(mPreference, "mHelper", mHelper);
+ }
+
+ @Test
+ public void setEnabled_disabledByAdmin_shouldCallSetDisabledByAdmin() {
+ when(mHelper.isDisabledByAdmin()).thenReturn(true);
+
+ mPreference.setEnabled(true);
+
+ verify(mHelper).setDisabledByAdmin(any());
+ }
+
+ @Test
+ public void setEnabled_notDisabledByAdmin_shouldNotCallSetDisabledByAdmin() {
+ when(mHelper.isDisabledByAdmin()).thenReturn(false);
+
+ mPreference.setEnabled(true);
+
+ verify(mHelper, never()).setDisabledByAdmin(any());
+ }
+
+ @Test
+ public void setDisabledByAdmin_shouldNotCallSetEnabled() {
+ mPreference.setDisabledByAdmin(new RestrictedLockUtils.EnforcedAdmin());
+
+ verify(mPreference, never()).setEnabled(anyBoolean());
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/MainSwitchBarTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/MainSwitchBarTest.java
new file mode 100644
index 0000000..9347609
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/MainSwitchBarTest.java
@@ -0,0 +1,90 @@
+/*
+ * 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.widget;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.content.Context;
+import android.view.View;
+import android.widget.Switch;
+import android.widget.TextView;
+
+import com.android.settingslib.RestrictedLockUtils;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class MainSwitchBarTest {
+
+ private Context mContext;
+ private MainSwitchBar mBar;
+
+ @Before
+ public void setUp() {
+ mContext = RuntimeEnvironment.application;
+ mBar = new MainSwitchBar(mContext);
+ }
+
+ @Test
+ public void setChecked_true_shouldChecked() {
+ mBar.setChecked(true);
+
+ assertThat(mBar.isChecked()).isTrue();
+ }
+
+ @Test
+ public void setTitle_shouldUpdateTitle() {
+ final String title = "title";
+
+ mBar.setTitle(title);
+ final TextView textView = ((TextView) mBar.findViewById(R.id.switch_text));
+
+ assertThat(textView.getText()).isEqualTo(title);
+ }
+
+ @Test
+ public void getSwitch_shouldNotNull() {
+ final Switch switchObj = mBar.getSwitch();
+
+ assertThat(switchObj).isNotNull();
+ }
+
+ @Test
+ public void show_shouldVisible() {
+ mBar.show();
+
+ assertThat(mBar.getVisibility()).isEqualTo(View.VISIBLE);
+ }
+
+ @Test
+ public void hide_shouldNotVisible() {
+ mBar.hide();
+
+ assertThat(mBar.getVisibility()).isEqualTo(View.GONE);
+ }
+
+ @Test
+ public void disabledByAdmin_shouldDelegateToRestrictedIcon() {
+ mBar.setDisabledByAdmin(new RestrictedLockUtils.EnforcedAdmin());
+
+ assertThat(mBar.getDelegatingView().getId()).isEqualTo(R.id.restricted_icon);
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/MainSwitchPreferenceTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/MainSwitchPreferenceTest.java
new file mode 100644
index 0000000..2e77aca
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/MainSwitchPreferenceTest.java
@@ -0,0 +1,78 @@
+/*
+ * 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.widget;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.content.Context;
+import android.view.View;
+import android.widget.TextView;
+
+import androidx.preference.PreferenceViewHolder;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class MainSwitchPreferenceTest {
+
+ private Context mContext;
+ private View mRootView;
+ private PreferenceViewHolder mHolder;
+ private MainSwitchPreference mPreference;
+
+ @Before
+ public void setUp() {
+ mContext = RuntimeEnvironment.application;
+ mRootView = View.inflate(mContext, R.layout.main_switch_layout, null /* parent */);
+ mHolder = PreferenceViewHolder.createInstanceForTests(mRootView);
+ mPreference = new MainSwitchPreference(mContext);
+ }
+
+ @Test
+ public void setTitle_shouldUpdateTitle() {
+ final String defaultOnText = "Test title";
+
+ mPreference.onBindViewHolder(mHolder);
+ mPreference.setTitle(defaultOnText);
+ mPreference.updateStatus(true /* checked */);
+
+ assertThat(((TextView) mRootView.findViewById(R.id.switch_text)).getText())
+ .isEqualTo(defaultOnText);
+ }
+
+ @Test
+ public void shouldAllowDividerBelow() {
+ mPreference.onBindViewHolder(mHolder);
+
+ View divider = mRootView.findViewById(R.id.below_divider);
+
+ assertThat(divider.getVisibility()).isEqualTo(View.VISIBLE);
+ }
+
+ @Test
+ public void updateStatus_shouldMatchTheStatus() {
+ mPreference.onBindViewHolder(mHolder);
+ mPreference.updateStatus(true);
+
+ assertThat(mPreference.isChecked()).isTrue();
+ }
+
+}
diff --git a/packages/SettingsProvider/OWNERS b/packages/SettingsProvider/OWNERS
index b2ac4f4..cf9799c 100644
--- a/packages/SettingsProvider/OWNERS
+++ b/packages/SettingsProvider/OWNERS
@@ -1,3 +1,4 @@
+hackbod@android.com
hackbod@google.com
narayan@google.com
svetoslavganov@google.com
diff --git a/packages/SettingsProvider/res/values-iw/strings.xml b/packages/SettingsProvider/res/values-iw/strings.xml
index 8d8594d..10765fe 100644
--- a/packages/SettingsProvider/res/values-iw/strings.xml
+++ b/packages/SettingsProvider/res/values-iw/strings.xml
@@ -20,6 +20,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="4567566098528588863">"אחסון הגדרות"</string>
- <string name="wifi_softap_config_change" msgid="5688373762357941645">"ההגדרות של הנקודה לשיתוף אינטרנט השתנו"</string>
+ <string name="wifi_softap_config_change" msgid="5688373762357941645">"הגדרות נקודת האינטרנט (hotspot) השתנו"</string>
<string name="wifi_softap_config_change_summary" msgid="8946397286141531087">"יש להקיש להצגת פרטים"</string>
</resources>
diff --git a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
index 09f7866..b6e45fc0 100644
--- a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
+++ b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
@@ -180,6 +180,7 @@
Settings.Secure.EMERGENCY_GESTURE_SOUND_ENABLED,
Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED,
Settings.Secure.ASSIST_HANDLES_LEARNING_TIME_ELAPSED_MILLIS,
- Settings.Secure.ASSIST_HANDLES_LEARNING_EVENT_COUNT
+ Settings.Secure.ASSIST_HANDLES_LEARNING_EVENT_COUNT,
+ Settings.Secure.ACCESSIBILITY_BUTTON_MODE
};
}
diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java
index 668e267..66165b6 100644
--- a/packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java
+++ b/packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java
@@ -146,5 +146,6 @@
VALIDATORS.put(Global.CUSTOM_BUGREPORT_HANDLER_USER, ANY_INTEGER_VALIDATOR);
VALIDATORS.put(Global.DEVELOPMENT_SETTINGS_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(Global.NOTIFICATION_FEEDBACK_ENABLED, BOOLEAN_VALIDATOR);
+ VALIDATORS.put(Global.RESTRICTED_NETWORKING_MODE, BOOLEAN_VALIDATOR);
}
}
diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
index 517fa54..d14acc6a 100644
--- a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
+++ b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
@@ -269,5 +269,9 @@
VALIDATORS.put(
Secure.ASSIST_HANDLES_LEARNING_TIME_ELAPSED_MILLIS, NONE_NEGATIVE_LONG_VALIDATOR);
VALIDATORS.put(Secure.ASSIST_HANDLES_LEARNING_EVENT_COUNT, NON_NEGATIVE_INTEGER_VALIDATOR);
+ VALIDATORS.put(Secure.ACCESSIBILITY_BUTTON_MODE,
+ new InclusiveIntegerRangeValidator(
+ Secure.ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR,
+ Secure.ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU));
}
}
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
index e9f09e5..5c7a466 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
@@ -1810,6 +1810,9 @@
dumpSetting(s, p,
Settings.Secure.ACCESSIBILITY_MAGNIFICATION_CAPABILITY,
SecureSettingsProto.Accessibility.ACCESSIBILITY_MAGNIFICATION_CAPABILITY);
+ dumpSetting(s, p,
+ Settings.Secure.ACCESSIBILITY_BUTTON_MODE,
+ SecureSettingsProto.Accessibility.ACCESSIBILITY_BUTTON_MODE);
p.end(accessibilityToken);
final long adaptiveSleepToken = p.start(SecureSettingsProto.ADAPTIVE_SLEEP);
diff --git a/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java b/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
index c740bac..2070773 100644
--- a/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
+++ b/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
@@ -139,6 +139,7 @@
Settings.Global.AUTOFILL_MAX_VISIBLE_DATASETS,
Settings.Global.AUTOMATIC_POWER_SAVE_MODE,
Settings.Global.AVERAGE_TIME_TO_DISCHARGE,
+ Settings.Global.BACKPORT_S_NOTIF_RULES,
Settings.Global.BATTERY_CHARGING_STATE_UPDATE_DELAY,
Settings.Global.BATTERY_ESTIMATES_LAST_UPDATE_TIME,
Settings.Global.BROADCAST_BG_CONSTANTS,
@@ -419,6 +420,7 @@
Settings.Global.RADIO_WIMAX,
Settings.Global.RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS,
Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT,
+ Settings.Global.RESTRICTED_NETWORKING_MODE,
Settings.Global.REQUIRE_PASSWORD_TO_DECRYPT,
Settings.Global.SAFE_BOOT_DISALLOWED,
Settings.Global.SELINUX_STATUS,
diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml
index 7ea9686..a184cd7 100644
--- a/packages/Shell/AndroidManifest.xml
+++ b/packages/Shell/AndroidManifest.xml
@@ -298,6 +298,9 @@
<uses-permission android:name="android.permission.UPGRADE_RUNTIME_PERMISSIONS" />
<!-- Permission needed to read wifi network credentials for CtsNetTestCases -->
+ <uses-permission android:name="android.permission.NETWORK_AIRPLANE_MODE" />
+
+ <!-- Permission needed to read wifi network credentials for CtsNetTestCases -->
<uses-permission android:name="android.permission.READ_WIFI_CREDENTIAL" />
<!-- Permission needed to use wifi usability API's for CtsNetTestCases -->
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
index fda1e36..9021864 100644
--- a/packages/SystemUI/Android.bp
+++ b/packages/SystemUI/Android.bp
@@ -63,6 +63,7 @@
"androidx.recyclerview_recyclerview",
"androidx.preference_preference",
"androidx.appcompat_appcompat",
+ "androidx.concurrent_concurrent-futures",
"androidx.mediarouter_mediarouter",
"androidx.palette_palette",
"androidx.legacy_legacy-preference-v14",
@@ -130,6 +131,7 @@
"androidx.recyclerview_recyclerview",
"androidx.preference_preference",
"androidx.appcompat_appcompat",
+ "androidx.concurrent_concurrent-futures",
"androidx.mediarouter_mediarouter",
"androidx.palette_palette",
"androidx.legacy_legacy-preference-v14",
diff --git a/packages/SystemUI/res-keyguard/values-ur/strings.xml b/packages/SystemUI/res-keyguard/values-ur/strings.xml
index a14f20d..4ca6338 100644
--- a/packages/SystemUI/res-keyguard/values-ur/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ur/strings.xml
@@ -25,7 +25,7 @@
<string name="keyguard_password_enter_puk_code" msgid="3813154965969758868">"SIM PUK اور نیا PIN کوڈ ٹائپ کریں"</string>
<string name="keyguard_password_enter_puk_prompt" msgid="3529260761374385243">"SIM PUK کوڈ"</string>
<string name="keyguard_password_enter_pin_prompt" msgid="2304037870481240781">"نیا SIM PIN کوڈ"</string>
- <string name="keyguard_password_entry_touch_hint" msgid="6180028658339706333"><font size="17">"پاسورڈ ٹائپ کرنے کیلئے ٹچ کریں"</font></string>
+ <string name="keyguard_password_entry_touch_hint" msgid="6180028658339706333"><font size="17">"پاس ورڈ ٹائپ کرنے کیلئے ٹچ کریں"</font></string>
<string name="keyguard_password_enter_password_code" msgid="7393393239623946777">"غیر مقفل کرنے کیلئے پاس ورڈ ٹائپ کریں"</string>
<string name="keyguard_password_enter_pin_password_code" msgid="3692259677395250509">"غیر مقفل کرنے کیلئے PIN ٹائپ کریں"</string>
<string name="keyguard_enter_your_pin" msgid="5429932527814874032">"اپنا PIN درج کریں"</string>
@@ -73,7 +73,7 @@
<string name="kg_sim_pin_instructions_multi" msgid="3639863309953109649">"\"<xliff:g id="CARRIER">%1$s</xliff:g>\" کیلئے SIM PIN درج کریں۔"</string>
<string name="kg_sim_lock_esim_instructions" msgid="5577169988158738030">"<xliff:g id="PREVIOUS_MSG">%1$s</xliff:g> موبائل سروس کے بغیر آلہ کا استعمال کرنے کیلئے eSIM غیر فعال کریں۔"</string>
<string name="kg_pin_instructions" msgid="822353548385014361">"PIN درج کریں"</string>
- <string name="kg_password_instructions" msgid="324455062831719903">"پاسورڈ درج کریں"</string>
+ <string name="kg_password_instructions" msgid="324455062831719903">"پاس ورڈ درج کریں"</string>
<string name="kg_puk_enter_puk_hint" msgid="3005288372875367017">"SIM اب غیر فعال ہوگیا ہے۔ جاری رکھنے کیلئے PUK کوڈ درج کریں۔ تفصیلات کیلئے کیریئر سے رابطہ کریں۔"</string>
<string name="kg_puk_enter_puk_hint_multi" msgid="4876780689904862943">"SIM \"<xliff:g id="CARRIER">%1$s</xliff:g>\" اب غیر فعال ہے۔ جاری رکھنے کیلئے PUK کوڈ درج کریں۔ تفصیلات کیلئے کیریئر سے رابطہ کریں۔"</string>
<string name="kg_puk_enter_pin_hint" msgid="6028432138916150399">"پسندیدہ PIN کوڈ درج کریں"</string>
@@ -84,7 +84,7 @@
<string name="kg_invalid_puk" msgid="1774337070084931186">"صحیح PUK کوڈ دوبارہ درج کریں۔ بار بار کی کوششیں SIM کو مستقل طور پر غیر فعال کر دیں گی۔"</string>
<string name="kg_login_too_many_attempts" msgid="4519957179182578690">"پیٹرن کی بہت ساری کوششیں"</string>
<string name="kg_too_many_failed_pin_attempts_dialog_message" msgid="544687656831558971">"آپ نے اپنا PIN <xliff:g id="NUMBER_0">%1$d</xliff:g> بار غلط طریقے سے ٹائپ کیا ہے۔ \n\n <xliff:g id="NUMBER_1">%2$d</xliff:g> سیکنڈ میں دوبارہ کوشش کریں۔"</string>
- <string name="kg_too_many_failed_password_attempts_dialog_message" msgid="190984061975729494">"آپ نے اپنا پاسورڈ <xliff:g id="NUMBER_0">%1$d</xliff:g> بار غلط طریقے سے ٹائپ کیا ہے۔ \n\n <xliff:g id="NUMBER_1">%2$d</xliff:g> سیکنڈ میں دوبارہ کوشش کریں۔"</string>
+ <string name="kg_too_many_failed_password_attempts_dialog_message" msgid="190984061975729494">"آپ نے اپنا پاس ورڈ <xliff:g id="NUMBER_0">%1$d</xliff:g> بار غلط طریقے سے ٹائپ کیا ہے۔ \n\n <xliff:g id="NUMBER_1">%2$d</xliff:g> سیکنڈ میں دوبارہ کوشش کریں۔"</string>
<string name="kg_too_many_failed_pattern_attempts_dialog_message" msgid="4252405904570284368">"آپ نے اپنا غیر مقفل کرنے کا پیٹرن <xliff:g id="NUMBER_0">%1$d</xliff:g> بار غلط طریقے سے ڈرا کیا ہے۔ \n\n <xliff:g id="NUMBER_1">%2$d</xliff:g> سیکنڈ میں دوبارہ کوشش کریں۔"</string>
<string name="kg_password_wrong_pin_code_pukked" msgid="8047350661459040581">"غلط SIM PIN کوڈ، اب آپ کو اپنا آلہ غیر مقفل کرنے کیلئے اپنے کیریئر سے رابطہ کرنا ہوگا۔"</string>
<plurals name="kg_password_wrong_pin_code" formatted="false" msgid="7030584350995485026">
@@ -104,13 +104,13 @@
<string name="airplane_mode" msgid="2528005343938497866">"ہوائی جہاز وضع"</string>
<string name="kg_prompt_reason_restart_pattern" msgid="4720554342633852066">"آلہ دوبارہ چالو ہونے کے بعد پیٹرن درکار ہوتا ہے"</string>
<string name="kg_prompt_reason_restart_pin" msgid="1587671566498057656">"آلہ دوبارہ چالو ہونے کے بعد PIN درکار ہوتا ہے"</string>
- <string name="kg_prompt_reason_restart_password" msgid="8061279087240952002">"آلہ دوبارہ چالو ہونے کے بعد پاسورڈ درکار ہوتا ہے"</string>
+ <string name="kg_prompt_reason_restart_password" msgid="8061279087240952002">"آلہ دوبارہ چالو ہونے کے بعد پاس ورڈ درکار ہوتا ہے"</string>
<string name="kg_prompt_reason_timeout_pattern" msgid="9170360502528959889">"اضافی سیکیورٹی کیلئے پیٹرن درکار ہے"</string>
<string name="kg_prompt_reason_timeout_pin" msgid="5945186097160029201">"اضافی سیکیورٹی کیلئے PIN درکار ہے"</string>
- <string name="kg_prompt_reason_timeout_password" msgid="2258263949430384278">"اضافی سیکیورٹی کیلئے پاسورڈ درکار ہے"</string>
+ <string name="kg_prompt_reason_timeout_password" msgid="2258263949430384278">"اضافی سیکیورٹی کیلئے پاس ورڈ درکار ہے"</string>
<string name="kg_prompt_reason_switch_profiles_pattern" msgid="1922016914701991230">"جب آپ پروفائل سوئچ کرتے ہیں تو پیٹرن درکار ہوتا ہے"</string>
<string name="kg_prompt_reason_switch_profiles_pin" msgid="6490434826361055400">"جب آپ پروفائل سوئچ کرتے ہیں تو PIN درکار ہوتا ہے"</string>
- <string name="kg_prompt_reason_switch_profiles_password" msgid="1680374696393804441">"جب آپ پروفائل سوئچ کرتے ہیں تو پاسورڈ درکار ہوتا ہے"</string>
+ <string name="kg_prompt_reason_switch_profiles_password" msgid="1680374696393804441">"جب آپ پروفائل سوئچ کرتے ہیں تو پاس ورڈ درکار ہوتا ہے"</string>
<string name="kg_prompt_reason_device_admin" msgid="6961159596224055685">"آلہ منتظم کی جانب سے مقفل ہے"</string>
<string name="kg_prompt_reason_user_request" msgid="6015774877733717904">"آلہ کو دستی طور پر مقفل کیا گیا تھا"</string>
<plurals name="kg_prompt_reason_time_pattern" formatted="false" msgid="1337428979661197957">
@@ -122,8 +122,8 @@
<item quantity="one">آلہ <xliff:g id="NUMBER_0">%d</xliff:g> گھنٹہ سے غیر مقفل نہیں کیا گیا۔ PIN کی توثیق کریں۔</item>
</plurals>
<plurals name="kg_prompt_reason_time_password" formatted="false" msgid="5343961527665116914">
- <item quantity="other">آلہ <xliff:g id="NUMBER_1">%d</xliff:g> گھنٹوں سے غیر مقفل نہیں کیا گيا۔ پاسورڈ کی توثیق کریں۔</item>
- <item quantity="one">آلہ <xliff:g id="NUMBER_0">%d</xliff:g> گھنٹہ سے غیر مقفل نہیں کیا گیا۔ پاسورڈ کی توثیق کریں۔</item>
+ <item quantity="other">آلہ <xliff:g id="NUMBER_1">%d</xliff:g> گھنٹوں سے غیر مقفل نہیں کیا گيا۔ پاس ورڈ کی توثیق کریں۔</item>
+ <item quantity="one">آلہ <xliff:g id="NUMBER_0">%d</xliff:g> گھنٹہ سے غیر مقفل نہیں کیا گیا۔ پاس ورڈ کی توثیق کریں۔</item>
</plurals>
<string name="kg_fingerprint_not_recognized" msgid="5982606907039479545">"تسلیم شدہ نہیں ہے"</string>
<string name="kg_face_not_recognized" msgid="7903950626744419160">"تسلیم شدہ نہیں ہے"</string>
diff --git a/packages/SystemUI/res-keyguard/values-uz/strings.xml b/packages/SystemUI/res-keyguard/values-uz/strings.xml
index 24a14c7..44e4191 100644
--- a/packages/SystemUI/res-keyguard/values-uz/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-uz/strings.xml
@@ -102,9 +102,9 @@
<string name="keyguard_carrier_default" msgid="6359808469637388586">"Aloqa yo‘q."</string>
<string name="accessibility_ime_switch_button" msgid="9082358310194861329">"Matn kiritish usulini almashtirish"</string>
<string name="airplane_mode" msgid="2528005343938497866">"Parvoz rejimi"</string>
- <string name="kg_prompt_reason_restart_pattern" msgid="4720554342633852066">"Qurilma o‘chirib yoqilgandan keyin grafik kalit talab qilinadi"</string>
- <string name="kg_prompt_reason_restart_pin" msgid="1587671566498057656">"Qurilma o‘chirib yoqilgandan keyin PIN kod talab qilinadi"</string>
- <string name="kg_prompt_reason_restart_password" msgid="8061279087240952002">"Qurilma o‘chirib yoqilgandan keyin parol talab qilinadi"</string>
+ <string name="kg_prompt_reason_restart_pattern" msgid="4720554342633852066">"Qurilma qayta ishga tushganidan keyin grafik kalitni kiritish zarur"</string>
+ <string name="kg_prompt_reason_restart_pin" msgid="1587671566498057656">"Qurilma qayta ishga tushganidan keyin PIN kodni kiritish zarur"</string>
+ <string name="kg_prompt_reason_restart_password" msgid="8061279087240952002">"Qurilma qayta ishga tushganidan keyin parolni kiritish zarur"</string>
<string name="kg_prompt_reason_timeout_pattern" msgid="9170360502528959889">"Qo‘shimcha xavfsizlik chorasi sifatida grafik kalit talab qilinadi"</string>
<string name="kg_prompt_reason_timeout_pin" msgid="5945186097160029201">"Qo‘shimcha xavfsizlik chorasi sifatida PIN kod talab qilinadi"</string>
<string name="kg_prompt_reason_timeout_password" msgid="2258263949430384278">"Qo‘shimcha xavfsizlik chorasi sifatida parol talab qilinadi"</string>
diff --git a/packages/SystemUI/res/drawable/ic_fingerprint.xml b/packages/SystemUI/res/drawable/ic_fingerprint.xml
new file mode 100644
index 0000000..e5f3360
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_fingerprint.xml
@@ -0,0 +1,59 @@
+<!--
+ 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
+-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="32dp"
+ android:height="32dp"
+ android:tint="?attr/wallpaperTextColor"
+ android:alpha=".75"
+ android:viewportHeight="32.0"
+ android:viewportWidth="32.0">
+ <path
+ android:fillColor="#ffffff"
+ android:pathData="M23.7,5.9c-0.1,0.0 -0.2,0.0 -0.3,-0.1C21.0,4.5 18.6,3.9 16.0,3.9c-2.5,0.0
+ -4.6,0.6 -6.9,1.9C8.8,6.0 8.3,5.9 8.1,5.5C7.9,5.2 8.0,4.7 8.4,4.5c2.5,-1.4 4.9,-2.1 7.7,
+ -2.1c2.8,0.0 5.4,0.7 8.0,2.1c0.4,0.2 0.5,0.6 0.3,1.0C24.2,5.7 24.0,5.9 23.7,5.9z" />
+ <path
+ android:fillColor="#ffffff"
+ android:pathData="M5.3,13.2c-0.1,0.0 -0.3,0.0 -0.4,-0.1c-0.3,-0.2 -0.4,-0.7 -0.2,-1.0c1.3,
+ -1.9 2.9,-3.4 4.9,-4.5c4.1,-2.2 9.3,-2.2 13.4,0.0c1.9,1.1 3.6,2.5 4.9,4.4c0.2,0.3 0.1,0.8
+ -0.2,1.0c-0.3,0.2 -0.8,0.1 -1.0,-0.2c-1.2,-1.7 -2.6,-3.0 -4.3,-4.0c-3.7,-2.0 -8.3,-2.0
+ -12.0,0.0c-1.7,0.9 -3.2,2.3 -4.3,4.0C5.7,13.1 5.5,13.2 5.3,13.2z" />
+ <path
+ android:fillColor="#ffffff"
+ android:pathData="M13.3,29.6c-0.2,0.0 -0.4,-0.1 -0.5,-0.2c-1.1,-1.2 -1.7,-2.0 -2.6,
+ -3.6c-0.9,-1.7 -1.4,-3.7 -1.4,-5.9c0.0,-4.1 3.3,-7.4 7.4,-7.4c4.1,0.0 7.4,3.3 7.4,7.4c0.0,
+ 0.4 -0.3,0.7 -0.7,0.7s-0.7,-0.3 -0.7,-0.7c0.0,-3.3 -2.7,-5.9 -5.9,-5.9c-3.3,0.0 -5.9,
+ 2.7 -5.9,5.9c0.0,2.0 0.4,3.8 1.2,5.2c0.8,1.6 1.4,2.2 2.4,3.3c0.3,0.3 0.3,0.8 0.0,1.0
+ C13.7,29.5 13.5,29.6 13.3,29.6z" />
+ <path
+ android:fillColor="#ffffff"
+ android:pathData="M22.6,27.1c-1.6,0.0 -2.9,-0.4 -4.1,-1.2c-1.9,-1.4 -3.1,-3.6 -3.1,
+ -6.0c0.0,-0.4 0.3,-0.7 0.7,-0.7s0.7,0.3 0.7,0.7c0.0,1.9 0.9,3.7 2.5,4.8c0.9,0.6 1.9,
+ 1.0 3.2,1.0c0.3,0.0 0.8,0.0 1.3,-0.1c0.4,-0.1 0.8,0.2 0.8,0.6c0.1,0.4 -0.2,0.8 -0.6,
+ 0.8C23.4,27.1 22.8,27.1 22.6,27.1z" />
+ <path
+ android:fillColor="#ffffff"
+ android:pathData="M20.0,29.9c-0.1,0.0 -0.1,0.0 -0.2,0.0c-2.1,-0.6 -3.4,-1.4 -4.8,-2.9c-1.8,
+ -1.9 -2.8,-4.4 -2.8,-7.1c0.0,-2.2 1.8,-4.1 4.1,-4.1c2.2,0.0 4.1,1.8 4.1,4.1c0.0,1.4 1.2,
+ 2.6 2.6,2.6c1.4,0.0 2.6,-1.2 2.6,-2.6c0.0,-5.1 -4.2,-9.3 -9.3,-9.3c-3.6,0.0 -6.9,2.1 -8.4,
+ 5.4C7.3,17.1 7.0,18.4 7.0,19.8c0.0,1.1 0.1,2.7 0.9,4.9c0.1,0.4 -0.1,0.8 -0.4,0.9c-0.4,
+ 0.1 -0.8,-0.1 -0.9,-0.4c-0.6,-1.8 -0.9,-3.6 -0.9,-5.4c0.0,-1.6 0.3,-3.1 0.9,-4.4c1.7,
+ -3.8 5.6,-6.3 9.8,-6.3c5.9,0.0 10.7,4.8 10.7,10.7c0.0,2.2 -1.8,4.1 -4.1,4.1s-4.0,
+ -1.8 -4.0,-4.1c0.0,-1.4 -1.2,-2.6 -2.6,-2.6c-1.4,0.0 -2.6,1.2 -2.6,2.6c0.0,2.3 0.9,
+ 4.5 2.4,6.1c1.2,1.3 2.4,2.0 4.2,2.5c0.4,0.1 0.6,0.5 0.5,0.9C20.6,29.7 20.3,29.9 20.0,
+ 29.9z" />
+</vector>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/status_bar_notification_row.xml b/packages/SystemUI/res/layout/status_bar_notification_row.xml
index 84b9e3d..2c08f5d 100644
--- a/packages/SystemUI/res/layout/status_bar_notification_row.xml
+++ b/packages/SystemUI/res/layout/status_bar_notification_row.xml
@@ -18,6 +18,7 @@
<!-- extends FrameLayout -->
<com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/expandableNotificationRow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
diff --git a/packages/SystemUI/res/values-af/strings.xml b/packages/SystemUI/res/values-af/strings.xml
index da91f27..fa4eea5 100644
--- a/packages/SystemUI/res/values-af/strings.xml
+++ b/packages/SystemUI/res/values-af/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Kan 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>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Wysig"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Wysig skermkiekie"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Kan lui of vibreer op grond van fooninstellings. Gesprekke van <xliff:g id="APP_NAME">%1$s</xliff:g> af verskyn by verstek in \'n borrel."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Hou jou aandag met \'n swewende kortpad na hierdie inhoud toe."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Laat die stelsel bepaal of hierdie kennisgewing \'n klank moet maak of vibreer"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> Bevorder na Verstek"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> Gedegradeer na Stil"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> Hoër gegradeer"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> Laer gegradeer"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Wys boaan die gespreksafdeling, verskyn as \'n swewende borrel, wys profielfoto op sluitskerm"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Instellings"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioriteit"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Hierdie program wys tans bo-oor ander programme op jou skerm en gebruik die mikrofoon en kamera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Instellings"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Hierdie kennisgewing is outomaties deur die stelsel <b>na Verstek bevorder</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Hierdie kennisgewing is outomaties deur die stelsel <b>na Stil gedegradeer</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Hierdie kennisgewing is outomaties <b>hoër gegradeer</b> in jou skakering."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Hierdie kennisgewing is outomaties <b>laer gegradeer</b> in jou skakering."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Is dit korrek?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Dankie vir jou terugvoer!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-am/strings.xml b/packages/SystemUI/res/values-am/strings.xml
index d098079..5a22d91 100644
--- a/packages/SystemUI/res/values-am/strings.xml
+++ b/packages/SystemUI/res/values-am/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"ቅጽበታዊ ገጽ እይታን ማስቀመጥ አልተቻለም"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ቅጽበታዊ ገጽ እይታዎችን ማንሳት በመተግበሪያው ወይም በእርስዎ ድርጅት አይፈቀድም"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"አርትዕ ያድርጉ"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"ቅጽበታዊ ገጽ ዕይታን አርትዕ ያድርጉ"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"በእርስዎ የስልክ ቅንብሮች የሚወሰን ሆኖ ሊደውል ወይም ሊነዝር ይችላል። የ<xliff:g id="APP_NAME">%1$s</xliff:g> አረፋ ውይይቶች በነባሪነት።"</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"ለዚህ ይዞታ ከተንሳፋፊ አቋራጭ ጋር የእርስዎን ትኩረት ያቆያል።"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"ይህ ማሳወቂያ ድምጽ ወይም ንዝረት መደረግ ካለበት ስርዓቱ እንዲወሰን ያድርጉት"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>ሁኔታ:</b> ለነባሪ ከፍ ተዋውቋል።"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>ሁኔታ:</b> ወደ ዝምታ ዝቅ ተደርጓል"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>ሁኔታ:</b> ክፍተኛ ደረጃ ተሰጥቶታል"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>ሁኔታ:</b> ዝቅተኛ ደረጃ ተሰጥቶታል"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"በውይይት ክፍል አናት ላይ ያሳያል፣ እንደ ተንሳፋፊ አረፋ ብቅ ይላል፣ በቆልፍ ማያ ገጽ ላይ የመገለጫ ሥዕልን ያሳያል"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"ቅንብሮች"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"ቅድሚያ"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"ይህ መተግበሪያ በማያ ገጽዎ ላይ በሌሎች መተግበሪያዎች ላይ እያሳየ እና ማይክሮፎኑንና ካሜራውን እየተጠቀመ ነው።"</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"ቅንብሮች"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"እሺ"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"ይህ ማሳወቂያ በሥርዓቱ በራስ-ሰር <b> ለነባሪ ተዋውቋል</b>።"</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"ይህ ማሳወቂያ በሥርዓቱ በራስ-ሰር <b>ወደ ዝምታ ዝቅ ተደርጓል </b>።"</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"ይህ ማሳወቂያ በራስ-ሰር በጥላው ውስጥ <b>ከፍተኛ ደረጃ ተሰጥቶታል</b>።"</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"ይህ ማሳወቂያ በራስ-ሰር በጥላው ውስጥ <b>ዝቅተኛ ደረጃ ተሰጥቶታል</b>።"</string>
<string name="feedback_prompt" msgid="2278631214125128281">"ይህ ትክክል ነበር?"</string>
<string name="feedback_response" msgid="4671729244976641339">"ለግብረመልስዎ እናመሰግናለን!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"እሺ"</string>
diff --git a/packages/SystemUI/res/values-ar/strings.xml b/packages/SystemUI/res/values-ar/strings.xml
index 2fa6b27..39afa83 100644
--- a/packages/SystemUI/res/values-ar/strings.xml
+++ b/packages/SystemUI/res/values-ar/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"يتعذّر حفظ لقطة الشاشة."</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"يحظر التطبيق أو تحظر مؤسستك التقاط لقطات شاشة"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"تعديل"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"تعديل لقطة الشاشة"</string>
@@ -710,14 +710,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"يمكن إصدار رنين أو اهتزاز بناءً على إعدادات الهاتف. تظهر المحادثات من <xliff:g id="APP_NAME">%1$s</xliff:g> كفقاعات تلقائيًا."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"يلفِت هذا الإشعار انتباهك لهذا المحتوى باستخدام اختصار عائم."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"السماح للنظام بتحديد ما إذا يجب اهتزاز الجهاز أو إصدار رنين عند تلقّي هذا الإشعار"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>الحالة:</b> تمت الترقية إلى الإعداد التلقائي"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>الحالة:</b> تم خفض الترتيب إلى الوضع صامت"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>الحالة:</b> تمت زيادة الترتيب"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>الحالة:</b> تم خفض الترتيب"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"تظهر في أعلى قسم المحادثات وتظهر كفقاعة عائمة وتعرض صورة الملف الشخصي على شاشة القفل"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"الإعدادات"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"الأولوية"</string>
@@ -736,14 +732,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"يتم عرض هذا التطبيق فوق التطبيقات الأخرى على شاشتك ويستخدم الميكروفون والكاميرا."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"الإعدادات"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"حسنًا"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"تم تلقائيًا <b>ترقية الإشعار إلى إعداد تلقائي</b> من خلال النظام."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"تم تلقائيًا <b>خفض ترتيب هذا الإشعار إلى الوضع صامت</b> من خلال النظام."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"تم تلقائيًا <b>زيادة ترتيب</b> هذا الإشعار في مركز الإشعارات."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"تم تلقائيًا <b>خفض ترتيب</b> هذا الإشعار في مركز الإشعارات."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"هل كان هذا صحيحًا؟"</string>
<string name="feedback_response" msgid="4671729244976641339">"شكرًا على تعليقك"</string>
<string name="feedback_ok" msgid="6481426753298857144">"حسنًا"</string>
diff --git a/packages/SystemUI/res/values-as/strings.xml b/packages/SystemUI/res/values-as/strings.xml
index 85bd4a7..cfb3009 100644
--- a/packages/SystemUI/res/values-as/strings.xml
+++ b/packages/SystemUI/res/values-as/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"স্ক্ৰীনশ্বট ছেভ কৰিব নোৱাৰি"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"এপটোৱে বা আপোনাৰ প্ৰতিষ্ঠানে স্ক্ৰীণশ্বট ল\'বলৈ অনুমতি নিদিয়ে"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"সম্পাদনা কৰক"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"স্ক্ৰীনশ্বট সম্পাদনা কৰক"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"ফ’নৰ ছেটিঙৰ ওপৰত নিৰ্ভৰ কৰি ৰিং কৰিব অথবা কম্পন হ’ব পাৰে। <xliff:g id="APP_NAME">%1$s</xliff:g>ৰ বাৰ্তালাপ ডিফ’ল্ট হিচাপে বাবল হয়।"</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"উপঙি থকা এটা শ্বৰ্টকাটৰ জৰিয়তে এই সমলখিনিৰ প্ৰতি আপোনাক মনোযোগী কৰি ৰাখে।"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"এই জাননীটোৱে ধ্বনি নে কম্পন সৃষ্টি কৰিব সেয়া ছিষ্টেমটোক নিৰ্ধাৰণ কৰিবলৈ দিয়ক"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>স্থিতি:</b> ডিফ’ল্টলৈ বৃদ্ধি কৰা হৈছে"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>স্থিতি:</b> নীৰৱলৈ হ্ৰাস কৰা হৈছে"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>স্থিতি:</b> স্থান ওপৰলৈ কৰা হৈছে"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>স্থিতি:</b> স্থান তললৈ কৰা হৈছে"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"বাৰ্তালাপ শাখাটোৰ শীৰ্ষত দেখুৱায়, ওপঙা বাবল হিচাপে দেখা পোৱা যায়, লক স্ক্ৰীনত প্ৰ’ফাইলৰ চিত্ৰ প্ৰদৰ্শন কৰে"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"ছেটিংসমূহ"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"অগ্ৰাধিকাৰ"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"এই এপে আপোনাৰ স্ক্ৰীণত থকা অন্য় এপৰ ওপৰত প্ৰদৰ্শিত হৈ মাইক্ৰ\'ফ\'ন আৰু কেমেৰা ব্য়ৱহাৰ কৰি আছে।"</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"ছেটিংসমূহ"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ঠিক আছে"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"ছিষ্টেমটোৱে স্বয়ংক্ৰিয়ভাৱে এই জাননীটোৰ ক্ষেত্ৰত দিয়া <b>গুৰুত্ব ডিফ’ল্ট</b>লৈ বৃদ্ধি কৰিছে।"</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"ছিষ্টেমটোৱে স্বয়ংক্ৰিয়ভাৱে এই জাননীটোৰ ক্ষেত্ৰত দিয়া <b>গুৰুত্ব নীৰৱ</b>লৈ হ্ৰাস কৰিছে।"</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"আপোনাৰ শ্বেডত স্বয়ংক্ৰিয়ভাৱে এই জাননীটোৰ <b>স্থান ওপৰলৈ</b> কৰা হৈছে।"</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"আপোনাৰ শ্বেডত স্বয়ংক্ৰিয়ভাৱে এই জাননীটোৰ <b>স্থান তললৈ</b> কৰা হৈছে।"</string>
<string name="feedback_prompt" msgid="2278631214125128281">"এইটো শুদ্ধ আছিলনে?"</string>
<string name="feedback_response" msgid="4671729244976641339">"আপোনাৰ মতামতৰ বাবে ধন্যবাদ!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ঠিক আছে"</string>
diff --git a/packages/SystemUI/res/values-az/strings.xml b/packages/SystemUI/res/values-az/strings.xml
index 84f9560..fef70c3 100644
--- a/packages/SystemUI/res/values-az/strings.xml
+++ b/packages/SystemUI/res/values-az/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Skrinşotu yadda saxlamaq mümkün olmadı"</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>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Redaktə edin"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Skrinşota düzəliş edin"</string>
@@ -548,7 +548,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"Admin, cihazdakı trafikə nəzarət edən şəbəkə loqlarını aktiv etdi.\n\nƏtraflı məlumat üçün administrator ilə əlaqə saxlayın."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"VPN bağlantısı quraşdırmağa icazə vermisiniz.\n\nBu tətbiq cihazınızı və şəbəkə fəaliyyətinizi, həmçinin, e-məktubları, tətbiq və veb saytları izləyə bilər."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"İş profiliniz <xliff:g id="ORGANIZATION">%1$s</xliff:g> tərəfindən idarə olunur.\n\nAdmin e-poçt, tətbiq və veb saytlar daxil olmaqla şəbəkə fəaliyətinizə nəzarət etməyə qadirdir.\n\nƏtraflı məlumat üçün administrator ilə əlaqə saxlayın.\n\nEyni zamanda, şəbəkə fəaliyyətinizə nəzarət edən VPN\'ə qoşulusunuz."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Bu cihaz valideyniniz tərəfindən idarə olunur. Valideyniniz istifadə etdiyiniz tətbiqlər, məkanınız və ekran vaxtınız kimi məlumatları görə və idarə edə bilər."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Bu cihaz valideyniniz tərəfindən idarə olunur. Valideyniniz işlətdiyiniz tətbiqlər, məkanınız və ekran vaxtınız kimi bilgiləri görə və idarə edə bilər."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"VPN (Virtual Şəxsi Şəbəkələr)"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"E-poçt, tətbiq və veb saytlar da daxil olmaqla şəbəkə fəaliyyətinə nəzarət edən <xliff:g id="APPLICATION">%1$s</xliff:g> tətbiqinə qoşulusunuz."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"<xliff:g id="APPLICATION">%1$s</xliff:g> tətbiqinə qoşulmusunuz və o, e-məktublar, tətbiq və veb saytlar daxil olmaqla şəxsi şəbəkə fəaliyyətinizə nəzarət edə bilər."</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Telefon ayarlarına əsasən zəng çala və ya vibrasiya edə bilər. <xliff:g id="APP_NAME">%1$s</xliff:g> tətbiqindən söhbətlərdə defolt olaraq qabarcıq çıxır."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Bu məzmuna üzən qısayol ilə diqqətinizi cəlb edir."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Bu bildirişin səs çıxarması və ya vibrasiya etməsi sistem tərəfindən təyin edilsin"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> Defolt ayara keçirilib"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> Səssiz rejimə keçirilib"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> Yuxarı sıraya keçirilib"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> Aşağı sıraya keçirilib"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Söhbət bölməsinin yuxarısında göstərilir, üzən qabarcıq kimi görünür, kilid ekranında profil şəkli göstərir"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Ayarlar"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritet"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Bu tətbiq ekranda digər tətbiqlərin üzərində göstərilir və mikrofon ilə kameradan istifadə edir."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Ayarlar"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Bu bildiriş sistem tərəfindən avtomatik olaraq <b>Defolt ayara keçirilib</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Bu bildiriş sistem tərəfindən avtomatik olaraq <b>Səssiz rejimə keçirilib</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Bu bildiriş avtomatik olaraq siyahıda <b>yuxarı sıraya keçirilib</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Bu bildiriş avtomatik olaraq siyahıda <b>aşağı sıraya keçirilib</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Bu, doğru oldu?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Rəyiniz üçün təşəkkür edirik!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-b+sr+Latn/strings.xml b/packages/SystemUI/res/values-b+sr+Latn/strings.xml
index 7c0e652..978b46d 100644
--- a/packages/SystemUI/res/values-b+sr+Latn/strings.xml
+++ b/packages/SystemUI/res/values-b+sr+Latn/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Čuvanje snimka ekrana nije uspelo"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Aplikacija ili organizacija ne dozvoljavaju pravljenje snimaka ekrana"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Izmeni"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Izmenite snimak ekrana"</string>
@@ -701,14 +701,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Može da zvoni ili vibrira u zavisnosti od podešavanja telefona. Konverzacije iz aplikacije <xliff:g id="APP_NAME">%1$s</xliff:g> se podrazumevano prikazuju u oblačićima."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Privlači vam pažnju pomoću plutajuće prečice do ovog sadržaja."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Neka sistem utvrdi da li ovo obaveštenje treba da emituje zvuk ili da vibrira"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> Unapređeno u Podrazumevano"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> Degradirano u Nečujno"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> Rangirano više"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> Rangirano niže"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Prikazuje se u vrhu odeljka za konverzacije kao plutajući oblačić, prikazuje sliku profila na zaključanom ekranu"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Podešavanja"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritet"</string>
@@ -727,14 +723,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Ova aplikacija se prikazuje preko drugih aplikacija na ekranu i koristi mikrofon i kameru."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Podešavanja"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Potvrdi"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Sistem je ovo obaveštenje automatski <b>unapredio u podrazumevano</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Sistem je ovo obaveštenje automatski <b>degradirao u Nečujno</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Ovo obaveštenje je automatski <b>rangirano više</b> na traci sa obaveštenjima."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Ovo obaveštenje je automatski <b>rangirano niže</b> na traci sa obaveštenjima."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Da li je to tačno?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Hvala vam na povratnim informacijama!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"Potvrdi"</string>
diff --git a/packages/SystemUI/res/values-be/strings.xml b/packages/SystemUI/res/values-be/strings.xml
index 65d45b9..641134e 100644
--- a/packages/SystemUI/res/values-be/strings.xml
+++ b/packages/SystemUI/res/values-be/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Не ўдалося захаваць здымак экрана"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Рабіць здымкі экрана не дазваляе праграма ці ваша арганізацыя"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Змяніць"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Змяніць здымак экрана"</string>
@@ -704,14 +704,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"У залежнасці ад налад тэлефона магчымы званок або вібрацыя. Размовы ў праграме \"<xliff:g id="APP_NAME">%1$s</xliff:g>\" стандартна паяўляюцца ў выглядзе ўсплывальных апавяшчэнняў."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Прыцягвае ўвагу да гэтага змесціва ўсплывальнай кнопкай."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Сістэма сама будзе вызначаць, ці трэба для гэтага апавяшчэння ўключаць гук або вібрацыю"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Стан:</b> Пазначана як стандартнае"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Стан:</b> Пераведзена ў рэжым \"Без гуку\""</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Стан:</b> Ацэнена як важнае"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Стан:</b> Ацэнена як няважнае"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Паказваецца ўверсе раздзела размоў, як усплывальнае апавяшчэнне, паказвае фота профілю на экране блакіроўкі"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Налады"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Прыярытэт"</string>
@@ -730,14 +726,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Гэта праграма паказваецца на экране паверх іншых праграм. Яна выкарыстоўвае мікрафон і камеру."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Налады"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ОК"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Гэта апавяшчэнне аўтаматычна пазначана сістэмай як <b>Стандартнае</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Гэта апавяшчэнне аўтаматычна пераведзена сістэмай у <b>рэжым \"Без гуку\"</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Гэта апавяшчэнне аўтаматычна ацэнена як <b>важнае</b> для вас."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Гэта апавяшчэнне аўтаматычна ацэнена як <b>няважнае</b> для вас."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Усё правільна?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Дзякуй за водгук!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ОК"</string>
diff --git a/packages/SystemUI/res/values-bg/strings.xml b/packages/SystemUI/res/values-bg/strings.xml
index 6f90c2a..0848383 100644
--- a/packages/SystemUI/res/values-bg/strings.xml
+++ b/packages/SystemUI/res/values-bg/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Екранната снимка не може да се запази"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Правенето на екранни снимки не е разрешено от приложението или организацията ви"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Редактиране"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Редактиране на екранната снимка"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Може да звъни или да вибрира въз основа на настройките за телефона. Разговорите от <xliff:g id="APP_NAME">%1$s</xliff:g> се показват като балончета по подразбиране."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Задържа вниманието ви посредством плаващ пряк път към това съдържание."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Нека системата да определя дали дадено известие да се придружава от звук, или вибриране"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Състояние:</b> Повишено до основно"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Състояние:</b> Понижено до беззвучно"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Състояние:</b> Класирано по-високо"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Състояние:</b> Класирано по-ниско"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Показва се като плаващо балонче в горната част на секцията с разговори, показва снимката на потр. профил на заключения екран"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Настройки"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Приоритет"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Това приложение се показва върху други приложения на екрана и използва микрофона и камерата."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Настройки"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Това известие автоматично бе <b>повишено до основно</b> от системата."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Това известие автоматично бе <b>понижено до беззвучно</b> от системата."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Това известие автоматично бе <b>класирано по-високо</b> в панела ви."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Това известие автоматично бе <b>класирано по-ниско</b> в панела ви."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Правилно ли е това?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Благодарим ви за отзивите!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ОК"</string>
diff --git a/packages/SystemUI/res/values-bn/strings.xml b/packages/SystemUI/res/values-bn/strings.xml
index 6b23edc..1099901 100644
--- a/packages/SystemUI/res/values-bn/strings.xml
+++ b/packages/SystemUI/res/values-bn/strings.xml
@@ -85,7 +85,8 @@
<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>
+ <!-- no translation found for screenshot_failed_to_save_text (7232739948999195960) -->
+ <skip />
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"এই অ্যাপ বা আপনার প্রতিষ্ঠান স্ক্রিনশট নেওয়ার অনুমতি দেয়নি"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"এডিট করুন"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"স্ক্রিনশট এডিট করুন"</string>
@@ -698,14 +699,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"ফোনের সেটিংস অনুযায়ী ফোন রিং বা ভাইব্রেট হতে পারে। <xliff:g id="APP_NAME">%1$s</xliff:g>-এর কথোপকথন সাধারণত বাবলের মতো দেখাবে।"</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"ফ্লোটিং শর্টকাট ব্যবহার করে এই কন্টেন্টে আপনার দৃষ্টি আকর্ষণ করে রাখে।"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"এই বিজ্ঞপ্তি এলে ডিভাইস আওয়াজ করবে না ভাইব্রেট করবে তা সিস্টেমকে সেট করতে দিন"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>স্ট্যাটাস:</b> লেভেল বাড়িয়ে ডিফল্ট করা হয়েছে"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>স্ট্যাটাস:</b> লেভেল কমিয়ে সাইলেন্ করা হয়েছে"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>স্ট্যাটাস:</b> র্যাঙ্ক বেড়ে গেছে"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>স্ট্যাটাস:</b> র্যাঙ্ক কমে গেছে"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"কথোপকথন বিভাগের উপরে ভাসমান বাবলের মতো দেখা যাবে, লক স্ক্রিনে প্রোফাইল ছবি দেখাবে"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"সেটিংস"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"অগ্রাধিকার"</string>
@@ -724,14 +721,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"এই অ্যাপটি স্ক্রিনে অন্যান্য অ্যাপের উপরে দেখানো হচ্ছে এবং মাইক্রোফোন ও ক্যামেরা ব্যবহার করছে।"</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"সেটিংস"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ঠিক আছে"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"সিস্টেম অটোমেটিক এই বিজ্ঞপ্তির <b>লেভেল বাড়িয়ে ডিফল্ট</b> হিসেবে সেট করেছে।"</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"সিস্টেম অটোমেটিক এই বিজ্ঞপ্তির <b>লেভেল কমিয়ে সাইলেন্ট</b> করে দিয়েছে।"</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"আপনার শেডে অটোমেটিক এই বিজ্ঞপ্তির <b>র্যাঙ্ক বাড়িয়ে</b> দেওয়া হয়েছে।"</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"আপনার শেডে অটোমেটিক এই বিজ্ঞপ্তির <b>র্যাঙ্ক কমিয়ে</b> দেওয়া হয়েছে।"</string>
<string name="feedback_prompt" msgid="2278631214125128281">"এটি কি সঠিক ছিল?"</string>
<string name="feedback_response" msgid="4671729244976641339">"মতামতের জন্য ধন্যবাদ!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"বুঝেছি"</string>
diff --git a/packages/SystemUI/res/values-bs/strings.xml b/packages/SystemUI/res/values-bs/strings.xml
index bb2bd8b..3c81a4b 100644
--- a/packages/SystemUI/res/values-bs/strings.xml
+++ b/packages/SystemUI/res/values-bs/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Nije moguće sačuvati snimak ekrana"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Ova aplikacija ili vaša organizacija ne dozvoljavaju snimanje ekrana"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Uredi"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Uredite snimak ekrana"</string>
@@ -701,14 +701,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Može zvoniti ili vibrirati na osnovu postavki vašeg telefona. Razgovori iz oblačića u aplikaciji <xliff:g id="APP_NAME">%1$s</xliff:g> kao zadana opcija."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Privlači vašu pažnju pomoću plutajuće prečice do ovog sadržaja."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Neka sistem odluči treba li se ovo obavještenje oglasiti zvukom ili vibracijom"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> je unaprijeđen u Zadano"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> je unazađen u Nečujno"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> je rangiran više"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> je rangiran niže"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Prikazuje se na vrhu odjeljka za razgovor, pojavljuje se kao plutajući oblačić, prikazuje sliku profila na zaključanom ekranu"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Postavke"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritetni"</string>
@@ -727,14 +723,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Ova aplikacija prekriva druge aplikacije na ekranu i koristi mikrofon i kameru."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Postavke"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Uredu"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Sistem je ovo obavještenje automatski <b>unaprijedio u Zadano</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Sistem je ovo obavještenje automatski <b>unazadio u Nečujno</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Ovo obavještenje je automatski <b>rangirano više</b> u pozadini."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Ovo obavještenje je automatski <b>rangirano niže</b> u pozadini."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Je li ovo bilo tačno?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Hvala na povratnim informacijama!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"UREDU"</string>
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index bb7bdd4..ef419ab 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"No es pot desar la captura de pantalla"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"L\'aplicació o la teva organització no permeten fer captures de pantalla"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Edita"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Edita la captura de pantalla"</string>
@@ -499,7 +499,7 @@
<string name="profile_owned_footer" msgid="2756770645766113964">"El perfil es pot supervisar"</string>
<string name="vpn_footer" msgid="3457155078010607471">"És possible que la xarxa estigui supervisada."</string>
<string name="branded_vpn_footer" msgid="816930186313188514">"És possible que la xarxa estigui supervisada"</string>
- <string name="quick_settings_disclosure_parental_controls" msgid="2114102871438223600">"El teu pare o la teva mare gestionen aquest dispositiu"</string>
+ <string name="quick_settings_disclosure_parental_controls" msgid="2114102871438223600">"Els teus pares gestionen aquest dispositiu"</string>
<string name="quick_settings_disclosure_management_monitoring" msgid="8231336875820702180">"La teva organització és propietària del dispositiu i és possible que supervisi el trànsit de xarxa"</string>
<string name="quick_settings_disclosure_named_management_monitoring" msgid="2831423806103479812">"<xliff:g id="ORGANIZATION_NAME">%1$s</xliff:g> és propietària d\'aquest dispositiu i és possible que supervisi el trànsit de xarxa"</string>
<string name="quick_settings_disclosure_management_named_vpn" msgid="6096715329056415588">"Aquest dispositiu pertany a la teva organització i està connectat a <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Pot sonar o vibrar en funció de la configuració del telèfon. Les converses de l\'aplicació <xliff:g id="APP_NAME">%1$s</xliff:g> es mostren com a bombolles de manera predeterminada."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Atrau la teva atenció amb una drecera flotant a aquest contingut."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Fes que el sistema determini si aquesta notificació ha d\'emetre un so o una vibració"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Estat</b>: s\'ha augmentat a Predeterminat"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Estat</b>: s\'ha disminuït a Silenci"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Estat</b>: s\'ha classificat amb un nivell superior"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Estat</b>: s\'ha classificat amb un nivell inferior"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Es mostra com a bombolla flotant a la part superior de la secció de converses i mostra la foto de perfil a la pantalla de bloqueig"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Configuració"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritat"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Aquesta aplicació es mostra sobre altres aplicacions a la pantalla i utilitza el micròfon i la càmera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Configuració"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"D\'acord"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"El sistema <b>ha augmentat a Predeterminat</b> el nivell d\'aquesta notificació."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"El sistema <b>ha disminuït a Silenci</b> el nivell d\'aquesta notificació."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Aquesta notificació s\'ha classificat automàticament amb un <b>nivell superior</b> a l\'àrea de notificacions."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Aquesta notificació s\'ha classificat automàticament amb un <b>nivell inferior</b> a l\'àrea de notificacions."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"La informació ha estat correcta?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Gràcies pels suggeriments."</string>
<string name="feedback_ok" msgid="6481426753298857144">"D\'acord"</string>
diff --git a/packages/SystemUI/res/values-cs/strings.xml b/packages/SystemUI/res/values-cs/strings.xml
index 7cfe95c..972232f 100644
--- a/packages/SystemUI/res/values-cs/strings.xml
+++ b/packages/SystemUI/res/values-cs/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Snímek obrazovky se nepodařilo uložit"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Aplikace nebo organizace zakazuje pořizování snímků obrazovky"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Upravit"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Upravit snímek obrazovky"</string>
@@ -704,14 +704,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Může vyzvánět nebo vibrovat v závislosti na nastavení telefonu. Konverzace z aplikace <xliff:g id="APP_NAME">%1$s</xliff:g> ve výchozím nastavení bublají."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Přitahuje pozornost pomocí plovoucí zkratky k tomuto obsahu."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Nechat systém rozhodnout, zda má toto oznámení vydat zvuk či zavibrovat"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Stav:</b> priorita zvýšena na Výchozí"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Stav:</b> priorita snížena na Tiché"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Stav:</b> zařazeno výše"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Stav:</b> zařazeno níže"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Zobrazuje se v horní části sekce konverzací a má podobu plovoucí bubliny, zobrazuje profilovou fotku na obrazovce uzamčení"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Nastavení"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Priorita"</string>
@@ -730,14 +726,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Tato aplikace se zobrazuje přes ostatní aplikace na obrazovce a využívá mikrofon a fotoaparát."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Nastavení"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"U tohoto oznámení systém automaticky <b>zvýšil prioritu na Výchozí</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"U tohoto oznámení systém automaticky <b>snížil prioritu na Tiché</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Toto oznámení bylo na panelu automaticky <b>zařazeno výše</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Toto oznámení bylo na panelu automaticky <b>zařazeno níže</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Udělal to správně?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Děkujeme za zpětnou vazbu."</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-da/strings.xml b/packages/SystemUI/res/values-da/strings.xml
index 5bde4d8..eb5f8ca 100644
--- a/packages/SystemUI/res/values-da/strings.xml
+++ b/packages/SystemUI/res/values-da/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Dit screenshot kunne ikke gemmes."</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Appen eller din organisation tillader ikke, at du tager screenshots"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Rediger"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Rediger screenshot"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Kan ringe eller vibrere baseret på telefonens indstillinger. Samtaler fra <xliff:g id="APP_NAME">%1$s</xliff:g> vises som standard i bobler."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Fastholder din opmærksomhed med en svævende genvej til indholdet."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Få systemet til at afgøre, om denne notifikation skal vibrere eller afspille en lyd"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> Angivet som Standard"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> Angivet som Lydløs"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> Rangeret højere"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> Placeret lavere"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Vises øverst i samtalesektionen som en svævende boble og med profilbillede på låseskærmen"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Indstillinger"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritet"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Denne app vises over andre apps på din skærm og anvender mikrofonen og kameraet."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Indstillinger"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Denne notifikation blev automatisk <b>angivet som Standard</b> af systemet."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Denne notifikation blev automatisk <b>angivet som Lydløs</b> af systemet."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Denne notifikation blev automatisk <b>rangeret højere</b> i din skygge."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Denne notifikation blev automatisk <b>rangeret lavere</b> i din skygge."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Var dette korrekt?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Tak for din feedback"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-de/strings.xml b/packages/SystemUI/res/values-de/strings.xml
index 14e7e16..66fb7eb 100644
--- a/packages/SystemUI/res/values-de/strings.xml
+++ b/packages/SystemUI/res/values-de/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Screenshot kann nicht gespeichert werden"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Die App oder deine Organisation lässt das Erstellen von Screenshots nicht zu"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Bearbeiten"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Screenshot bearbeiten"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Kann klingeln oder vibrieren, je nach Telefoneinstellungen. Unterhaltungen von <xliff:g id="APP_NAME">%1$s</xliff:g> werden standardmäßig als Bubble angezeigt."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Du wirst mit einer unverankerten Verknüpfung darauf aufmerksam gemacht."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Das System entscheiden lassen, ob bei dieser Benachrichtigung ein Ton oder eine Vibration ausgegeben wird"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status</b>: auf „Standard“ hochgestuft"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status</b>: auf „Lautlos“ herabgestuft"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status</b>: höher eingestuft"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status</b>: niedriger eingestuft"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Wird oben im Bereich \"Unterhaltungen\" als unverankerte Bubble mit einem Profilbild auf dem Sperrbildschirm angezeigt"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Einstellungen"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Priorität"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Diese App wird über anderen Apps auf dem Bildschirm angezeigt und verwendet das Mikrofon und die Kamera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Einstellungen"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Ok"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Diese Benachrichtigung wurde durch das System automatisch <b>auf „Standard“ hochgestuft</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Diese Benachrichtigung wurde durch das System automatisch <b>auf „Lautlos“ herabgestuft</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Diese Benachrichtigung wurde in deiner Leiste automatisch <b>höher eingestuft</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Diese Benachrichtigung wurde in deiner Leiste automatisch <b>niedriger eingestuft</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"War das richtig?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Vielen Dank für dein Feedback."</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-el/strings.xml b/packages/SystemUI/res/values-el/strings.xml
index 1e65310..40e2294 100644
--- a/packages/SystemUI/res/values-el/strings.xml
+++ b/packages/SystemUI/res/values-el/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Δεν είναι δυνατή η αποθήκευση στιγμιότυπου οθόνης."</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Η λήψη στιγμιότυπων οθόνης δεν επιτρέπεται από την εφαρμογή ή τον οργανισμό σας"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Επεξεργασία"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Επεξεργασία στιγμιότυπου οθόνης"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Ενδέχεται να κουδουνίζει ή να δονείται βάσει των ρυθμίσεων του τηλεφώνου. Οι συζητήσεις από την εφαρμογή <xliff:g id="APP_NAME">%1$s</xliff:g> εμφανίζονται σε συννεφάκι από προεπιλογή."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Κρατάει την προσοχή σας με μια κινούμενη συντόμευση προς αυτό το περιεχόμενο."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Επιτρέψτε στο σύστημα να αποφασίσει αν αυτή η ειδοποίηση θα αναπαράγει έναν ήχο ή θα ενεργοποιήσει τη δόνηση της συσκευής"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Κατάσταση:</b> Προάχθηκε σε Προεπιλογή"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Κατάσταση:</b> Υποβιβάστηκε σε Αθόρυβη"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Κατάσταση:</b> Κατατάχθηκε υψηλότερα"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Κατάσταση:</b> Κατατάχθηκε χαμηλότερα"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Εμφανίζεται επάνω στις συζητήσεις, προβάλλεται ως κιν. συννεφάκι, εμφανίζει τη φωτ. προφίλ στην οθ. κλειδ."</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Ρυθμίσεις"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Προτεραιότητα"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Αυτή η εφαρμογή εμφανίζεται πάνω σε άλλες εφαρμογές στην οθόνη σας και χρησιμοποιεί το μικρόφωνο και την κάμερα."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Ρυθμίσεις"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ΟΚ"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Αυτή η ειδοποίηση <b>προάχθηκε σε Προεπιλογή</b> αυτόματα από το σύστημα."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Αυτή η ειδοποίηση <b>υποβιβάστηκε σε Αθόρυβη</b> αυτόματα από το σύστημα."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Αυτή η ειδοποίηση <b>κατατάχθηκε υψηλότερα</b> στο πλαίσιο σκίασης με αυτόματο τρόπο."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Αυτή η ειδοποίηση <b>κατατάχθηκε χαμηλότερα</b> στο πλαίσιο σκίασης με αυτόματο τρόπο."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Ήταν σωστό αυτό;"</string>
<string name="feedback_response" msgid="4671729244976641339">"Σας ευχαριστούμε για τα σχόλιά σας!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ΟΚ"</string>
diff --git a/packages/SystemUI/res/values-en-rAU/strings.xml b/packages/SystemUI/res/values-en-rAU/strings.xml
index 0779fba..ca81ed6 100644
--- a/packages/SystemUI/res/values-en-rAU/strings.xml
+++ b/packages/SystemUI/res/values-en-rAU/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Can\'t save screenshot"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Taking screenshots isn\'t allowed by the app or your organisation"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Edit"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Edit screenshot"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"May ring or vibrate based on phone settings. Conversations from <xliff:g id="APP_NAME">%1$s</xliff:g> bubble by default."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Keeps your attention with a floating shortcut to this content."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Have the system determine if this notification should make sound or vibration"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> promoted to default"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> demoted to silent"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> ranked higher"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> ranked lower"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Shows at top of conversation section, appears as floating bubble, displays profile picture on lock screen"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Settings"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Priority"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"This app is displaying over other apps on your screen and using the microphone and camera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Settings"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"This notification was automatically <b>promoted to default</b> by the system."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"This notification was automatically <b>demoted to silent</b> by the system."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"This notification was automatically <b>ranked higher</b> in your shade."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"This notification was automatically <b>ranked lower</b> in your shade."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Was this correct?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Thanks for your feedback!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-en-rCA/strings.xml b/packages/SystemUI/res/values-en-rCA/strings.xml
index 3d93f9f..89537e9 100644
--- a/packages/SystemUI/res/values-en-rCA/strings.xml
+++ b/packages/SystemUI/res/values-en-rCA/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Can\'t save screenshot"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Taking screenshots isn\'t allowed by the app or your organisation"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Edit"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Edit screenshot"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"May ring or vibrate based on phone settings. Conversations from <xliff:g id="APP_NAME">%1$s</xliff:g> bubble by default."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Keeps your attention with a floating shortcut to this content."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Have the system determine if this notification should make sound or vibration"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> promoted to default"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> demoted to silent"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> ranked higher"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> ranked lower"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Shows at top of conversation section, appears as floating bubble, displays profile picture on lock screen"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Settings"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Priority"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"This app is displaying over other apps on your screen and using the microphone and camera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Settings"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"This notification was automatically <b>promoted to default</b> by the system."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"This notification was automatically <b>demoted to silent</b> by the system."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"This notification was automatically <b>ranked higher</b> in your shade."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"This notification was automatically <b>ranked lower</b> in your shade."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Was this correct?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Thanks for your feedback!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-en-rGB/strings.xml b/packages/SystemUI/res/values-en-rGB/strings.xml
index 0779fba..ca81ed6 100644
--- a/packages/SystemUI/res/values-en-rGB/strings.xml
+++ b/packages/SystemUI/res/values-en-rGB/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Can\'t save screenshot"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Taking screenshots isn\'t allowed by the app or your organisation"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Edit"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Edit screenshot"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"May ring or vibrate based on phone settings. Conversations from <xliff:g id="APP_NAME">%1$s</xliff:g> bubble by default."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Keeps your attention with a floating shortcut to this content."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Have the system determine if this notification should make sound or vibration"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> promoted to default"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> demoted to silent"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> ranked higher"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> ranked lower"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Shows at top of conversation section, appears as floating bubble, displays profile picture on lock screen"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Settings"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Priority"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"This app is displaying over other apps on your screen and using the microphone and camera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Settings"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"This notification was automatically <b>promoted to default</b> by the system."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"This notification was automatically <b>demoted to silent</b> by the system."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"This notification was automatically <b>ranked higher</b> in your shade."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"This notification was automatically <b>ranked lower</b> in your shade."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Was this correct?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Thanks for your feedback!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-en-rIN/strings.xml b/packages/SystemUI/res/values-en-rIN/strings.xml
index 0779fba..ca81ed6 100644
--- a/packages/SystemUI/res/values-en-rIN/strings.xml
+++ b/packages/SystemUI/res/values-en-rIN/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Can\'t save screenshot"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Taking screenshots isn\'t allowed by the app or your organisation"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Edit"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Edit screenshot"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"May ring or vibrate based on phone settings. Conversations from <xliff:g id="APP_NAME">%1$s</xliff:g> bubble by default."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Keeps your attention with a floating shortcut to this content."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Have the system determine if this notification should make sound or vibration"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> promoted to default"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> demoted to silent"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> ranked higher"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> ranked lower"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Shows at top of conversation section, appears as floating bubble, displays profile picture on lock screen"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Settings"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Priority"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"This app is displaying over other apps on your screen and using the microphone and camera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Settings"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"This notification was automatically <b>promoted to default</b> by the system."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"This notification was automatically <b>demoted to silent</b> by the system."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"This notification was automatically <b>ranked higher</b> in your shade."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"This notification was automatically <b>ranked lower</b> in your shade."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Was this correct?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Thanks for your feedback!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-en-rXC/strings.xml b/packages/SystemUI/res/values-en-rXC/strings.xml
index 7d7e4b9..6fa2171 100644
--- a/packages/SystemUI/res/values-en-rXC/strings.xml
+++ b/packages/SystemUI/res/values-en-rXC/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Can\'t save screenshot"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Taking screenshots isn\'t allowed by the app or your organization"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Edit"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Edit screenshot"</string>
diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml
index 5940767..e9a2785 100644
--- a/packages/SystemUI/res/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"No se pudo guardar la captura de pantalla"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"La app o tu organización no permiten las capturas de pantalla"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Editar"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Editar captura de pantalla"</string>
@@ -524,7 +524,7 @@
<string name="disable_vpn" msgid="482685974985502922">"Inhabilitar VPN"</string>
<string name="disconnect_vpn" msgid="26286850045344557">"Desconectar VPN"</string>
<string name="monitoring_button_view_policies" msgid="3869724835853502410">"Ver políticas"</string>
- <string name="monitoring_button_view_controls" msgid="8316440345340701117">"Controles de vista"</string>
+ <string name="monitoring_button_view_controls" msgid="8316440345340701117">"Ver controles"</string>
<string name="monitoring_description_named_management" msgid="505833016545056036">"Este dispositivo pertenece a <xliff:g id="ORGANIZATION_NAME">%1$s</xliff:g>.\n\nTu administrador de TI puede controlar y administrar la configuración, el acceso corporativo, las apps, los datos asociados al dispositivo y la información de ubicación.\n\nPara obtener más información, comunícate con el administrador de TI."</string>
<string name="monitoring_description_management" msgid="4308879039175729014">"Este dispositivo pertenece a tu organización.\n\nTu administrador de TI puede controlar y administrar la configuración, el acceso corporativo, las apps, los datos asociados al dispositivo y la información de ubicación.\n\nPara obtener más información, comunícate con el administrador de TI."</string>
<string name="monitoring_description_management_ca_certificate" msgid="7785013130658110130">"Tu organización instaló una autoridad de certificación en este dispositivo. Es posible que se controle o modifique el tráfico de tu red segura."</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Puede sonar o vibrar en función de la configuración del teléfono. Conversaciones de la burbuja de <xliff:g id="APP_NAME">%1$s</xliff:g> de forma predeterminada."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Retiene tu atención con un acceso directo flotante a este contenido."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Dejar que el sistema determine si esta notificación debe emitir un sonido o una vibración"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Estado:</b> Se promovió a Predeterminada"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Estado:</b> Descendió de nivel a Silenciada"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Estado:</b> Se clasificó en una posición superior"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Estado:</b> Se clasificó en una posición inferior"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Aparece en la parte superior de la sección de conversaciones, en forma de burbuja flotante, y muestra la foto de perfil en la pantalla de bloqueo."</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Configuración"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritaria"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Esta app se muestra sobre otras apps en la pantalla y está usando el micrófono y la cámara."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Configuración"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Aceptar"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"El sistema <b>promovió esta notificación a Predeterminada</b> de forma automática."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"El sistema <b>descendió esta notificación a Silenciada</b> de forma automática."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Se clasificó esta notificación <b>en una posición superior</b> de forma automática en el panel."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Se clasificó esta notificación <b>en una posición inferior</b> de forma automática en el panel."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"¿Te parece bien?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Gracias por tus comentarios."</string>
<string name="feedback_ok" msgid="6481426753298857144">"Aceptar"</string>
diff --git a/packages/SystemUI/res/values-es/strings.xml b/packages/SystemUI/res/values-es/strings.xml
index 1f6a153..11ff9af 100644
--- a/packages/SystemUI/res/values-es/strings.xml
+++ b/packages/SystemUI/res/values-es/strings.xml
@@ -85,7 +85,8 @@
<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>
+ <!-- no translation found for screenshot_failed_to_save_text (7232739948999195960) -->
+ <skip />
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"La aplicación o tu organización no permiten realizar capturas de pantalla"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Editar"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Editar captura de pantalla"</string>
@@ -698,14 +699,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Es posible que suene o vibre según los ajustes del teléfono. Las conversaciones de <xliff:g id="APP_NAME">%1$s</xliff:g> aparecen como burbujas de forma predeterminada."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Llama tu atención con un acceso directo flotante a este contenido."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Haz que el sistema determine si con esta notificación el dispositivo debe sonar o vibrar"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Estado:</b> cambio a Predeterminado"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Estado:</b> cambio a Silencio"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Estado:</b> posición más alta"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Estado:</b> posición más baja"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Se muestra arriba en la sección de conversaciones, como burbuja flotante, y la imagen de perfil aparece en la pantalla de bloqueo"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Ajustes"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioridad"</string>
@@ -724,14 +721,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Esta aplicación se está mostrando sobre otras aplicaciones en tu pantalla y está usando el micrófono y la cámara."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Ajustes"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Aceptar"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"El sistema ha <b>aumentado automáticamente a Predeterminado</b> la importancia de esta notificación."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"El sistema ha <b>disminuido automáticamente a Silencio</b> la importancia de esta notificación."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Esta notificación se ha colocado automáticamente en una <b>posición más alta</b> en tu pantalla de notificaciones."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Esta notificación se ha colocado automáticamente en una <b>posición más baja</b> en tu pantalla de notificaciones."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"¿Estuvo bien?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Gracias por tus comentarios."</string>
<string name="feedback_ok" msgid="6481426753298857144">"Aceptar"</string>
diff --git a/packages/SystemUI/res/values-et/strings.xml b/packages/SystemUI/res/values-et/strings.xml
index 3e454f2..27a9df0 100644
--- a/packages/SystemUI/res/values-et/strings.xml
+++ b/packages/SystemUI/res/values-et/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Ekraanipilti ei saa salvestada"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Rakendus või teie organisatsioon ei luba ekraanipilte jäädvustada"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Muutmine"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Ekraanipildi muutmine"</string>
@@ -524,7 +524,7 @@
<string name="disable_vpn" msgid="482685974985502922">"Keela VPN"</string>
<string name="disconnect_vpn" msgid="26286850045344557">"Katkesta VPN-i ühendus"</string>
<string name="monitoring_button_view_policies" msgid="3869724835853502410">"Kuva eeskirjad"</string>
- <string name="monitoring_button_view_controls" msgid="8316440345340701117">"Kuva järelevalve haldamine"</string>
+ <string name="monitoring_button_view_controls" msgid="8316440345340701117">"Kuva haldusvalikud"</string>
<string name="monitoring_description_named_management" msgid="505833016545056036">"See seade kuulub organisatsioonile <xliff:g id="ORGANIZATION_NAME">%1$s</xliff:g>.\n\nIT-administraator saab jälgida ning hallata seadeid, ettevõttesisest juurdepääsu, rakendusi, seadmega seotud andmeid ja seadme asukohateavet.\n\nLisateabe saamiseks võtke ühendust IT-administraatoriga."</string>
<string name="monitoring_description_management" msgid="4308879039175729014">"See seade kuulub teie organisatsioonile.\n\nIT-administraator saab jälgida ning hallata seadeid, ettevõttesisest juurdepääsu, rakendusi, seadmega seotud andmeid ja seadme asukohateavet.\n\nLisateabe saamiseks võtke ühendust IT-administraatoriga."</string>
<string name="monitoring_description_management_ca_certificate" msgid="7785013130658110130">"Teie organisatsioon installis sellesse seadmesse sertifikaadi volituse. Teie turvalist võrguliiklust võidakse jälgida ja muuta."</string>
@@ -548,7 +548,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"Teie administraator on sisse lülitanud võrgu logimise funktsiooni, mis jälgib teie seadmes liiklust.\n\nLisateabe saamiseks võtke ühendust administraatoriga."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"Andsite rakendusele loa VPN-i ühenduse seadistamiseks.\n\nSee rakendus võib jälgida teie seadet ja võrgutegevusi, sh meile, rakendusi ja veebisaite."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"Teie tööprofiili haldab <xliff:g id="ORGANIZATION">%1$s</xliff:g>.\n\nAdministraator saab jälgida teie töökoha võrgutegevusi, sh meile, rakendusi ja veebisaite.\n\nLisateabe saamiseks võtke ühendust administraatoriga.\n\nTeil on ühendus ka VPN-iga, mis saab teie võrgutegevusi jälgida."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Seda seadet haldab sinu vanem. Sinu vanem näeb ja saab hallata teavet, näiteks kasutatavaid rakendusi, asukohta ja ekraaniaega."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Seda seadet haldab sinu vanem. Sinu vanem näeb ja saab hallata teavet, näiteks kasutatavaid rakendusi, sinu asukohta ja ekraaniaega."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"VPN"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"Olete ühendatud rakendusega <xliff:g id="APPLICATION">%1$s</xliff:g>, mis võib jälgida teie võrgutegevusi, sh meile, rakendusi ja veebisaite."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"Teie seade on ühendatud rakendusega <xliff:g id="APPLICATION">%1$s</xliff:g>, mis võib jälgida teie isiklikke võrgutegevusi, sh meile, rakendusi ja veebisaite."</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Võib telefoni seadete põhjal heliseda või vibreerida. Rakenduse <xliff:g id="APP_NAME">%1$s</xliff:g> vestlused kuvatakse vaikimisi mullis."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Hoiab teie tähelepanu hõljuva otseteega selle sisu juurde."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Laske süsteemil määrata, kas selle märguande puhul peaks esitama heli või vibreerima"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Olek:</b> määrati prioriteet Vaikimisi"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Olek:</b> määrati prioriteet Vaikne"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Olek:</b> määrati kõrgem prioriteet"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Olek:</b> määrati madalam prioriteet"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Kuvatakse vestluste jaotise ülaosas hõljuva mullina ja lukustuskuval kuvatakse profiilipilt"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Seaded"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioriteetne"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"See rakendus kuvatakse teie ekraanil muude rakenduste peal ning see kasutab mikrofoni ja kaamerat."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Seaded"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Süsteem määras sellele märguandele automaatselt prioriteedi <b>Vaikimisi</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Süsteem määras sellele märguandele automaatselt prioriteedi <b>Vaikne</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Sellele märguandele määrati teie märguandealas automaatselt <b>kõrgem prioriteet</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Sellele märguandele määrati teie märguandealas automaatselt <b>madalam prioriteet</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Kas see oli õige?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Täname tagasiside eest!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-et/strings_tv.xml b/packages/SystemUI/res/values-et/strings_tv.xml
index b7039e3..593298e 100644
--- a/packages/SystemUI/res/values-et/strings_tv.xml
+++ b/packages/SystemUI/res/values-et/strings_tv.xml
@@ -23,7 +23,7 @@
<string name="app_accessed_mic" msgid="2754428675130470196">"%1$s pääses teie mikrofonile juurde"</string>
<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="notification_disclosure_vpn_text" msgid="3873532735584866236">"Teenuse <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 5dcfa7f..b2dc3d6 100644
--- a/packages/SystemUI/res/values-eu/strings.xml
+++ b/packages/SystemUI/res/values-eu/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Ezin da gorde pantaila-argazkia"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Aplikazioak edo erakundeak ez du onartzen pantaila-argazkiak ateratzea"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Editatu"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Editatu pantaila-argazkia"</string>
@@ -548,7 +548,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"Administratzaileak sare-erregistroak aktibatu ditu; horrela, zure gailuko trafikoa gainbegira dezake.\n\nInformazio gehiago lortzeko, jarri administratzailearekin harremanetan."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"Aplikazio bati VPN konexio bat konfiguratzeko baimena eman diozu.\n\nAplikazio horrek gailuko eta sareko jarduerak kontrola ditzake, mezu elektronikoak, aplikazioak eta webguneak barne."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"<xliff:g id="ORGANIZATION">%1$s</xliff:g> erakundeak kudeatzen du zure laneko profila.\n\nAdministratzaileak sareko jarduerak kontrola diezazkizuke, besteak beste, posta elektronikoa, aplikazioak eta webguneak.\n\nInformazio gehiago lortzeko, jarri administratzailearekin harremanetan.\n\nHorrez gain, VPN batera zaude konektatuta, eta hark ere kontrola ditzake zure sareko jarduerak."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Zure gurasoak kudeatzen du gailua. Zure gurasoak gailuko informazioa ikus eta kudea dezake; besteak beste, zer aplikazio erabiltzen dituzun, zure kokapena zein den eta pantaila aurrean zenbat eta noiz egoten zaren."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Zure gurasoak kudeatzen du gailua. Zure gurasoak gailuko informazioa ikusi eta kudea dezake; besteak beste, zer aplikazio erabiltzen dituzun, zure kokapena zein den eta pantaila aurrean zenbat eta noiz egoten zaren."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"VPN konexioa"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"<xliff:g id="APPLICATION">%1$s</xliff:g> aplikaziora konektatuta zaude. Aplikazio horrek sarean egiten dituzun jarduerak kontrola ditzake, mezu elektronikoak, aplikazioak eta webguneak barne."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"<xliff:g id="APPLICATION">%1$s</xliff:g> aplikaziora konektatuta zaude. Aplikazio horrek sarean egiten dituzun jarduera pertsonalak kontrola ditzake, mezu elektronikoak, aplikazioak eta webguneak barne."</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Tonua jo edo dar-dar egin dezake, telefonoaren ezarpenen arabera. Modu lehenetsian, <xliff:g id="APP_NAME">%1$s</xliff:g> aplikazioko elkarrizketak burbuila gisa agertzen dira."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Eduki honetarako lasterbide gainerakor bat eskaintzen dizu, arretarik gal ez dezazun."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Ezarri sistemak zehaztu dezala jakinarazpen honek soinua edo dardara egin behar duen ala ez"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"Lehenetsi gisa ezarri da <b>egoera:</b>"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"Soinurik gabeko modura aldatu da <b>egoera:</b>"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"Mailaz igo da <b>egoera:</b>"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"Mailaz jaitsi da <b>egoera:</b>"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Burbuila gisa agertzen da elkarrizketen atalaren goialdean, eta profileko argazkia bistaratzen du pantaila blokeatuta dagoenean"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Ezarpenak"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Lehentasuna"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Aplikazioa pantailako beste aplikazioen gainean agertzen da, eta mikrofonoa eta kamera erabiltzen ari da."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Ezarpenak"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Ados"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Jakinarazpen hau automatikoki <b>ezarri du lehenetsi gisa</b> sistemak."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Jakinarazpen hau automatikoki <b>aldatu da soinurik gabeko modura</b> du sistemak."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Jakinarazpen hau automatikoki <b>igo da mailaz</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Jakinarazpen hau automatikoki <b>jaitsi da mailaz</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Zuzena al da hau?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Mila esker iritzia emateagatik!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"Ados"</string>
diff --git a/packages/SystemUI/res/values-fa/strings.xml b/packages/SystemUI/res/values-fa/strings.xml
index 85a89b3..214f5c2 100644
--- a/packages/SystemUI/res/values-fa/strings.xml
+++ b/packages/SystemUI/res/values-fa/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"نماگرفت ذخیره نمیشود"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"برنامه یا سازمان شما اجازه نمیدهند نماگرفت بگیرید."</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"ویرایش"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"ویرایش نماگرفت"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"بسته به تنظیمات ممکن است تلفن زنگ بزند یا لرزش داشته باشد. مکالمههای <xliff:g id="APP_NAME">%1$s</xliff:g> بهطور پیشفرض در حبابک نشان داده میشوند."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"با میانبری شناور به این محتوا، توجهتان را جلب میکند."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"سیستم را تنظیم کنید که تشخیص دهد اعلان صدا و لرزش داشته باشد یا نه"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>وضعیت:</b> به «پیشفرض» ارتقا یافت"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>وضعیت:</b> به «بیصدا» تنزل یافت"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>وضعیت:</b> در رتبهبندی بالاتری قرار گرفت"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>وضعیت:</b> در رتبهبندی پایینتری قرار گرفت"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"در بالای بخش مکالمه بهصورت حبابک شناور نشان داده میشود و تصویر نمایه را در صفحه قفل نمایش میدهد"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"تنظیمات"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"اولویت"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"این برنامه روی برنامههای دیگر در صفحهنمایش نشان داده میشود و از میکروفون و دوربین استفاده میکند."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"تنظیمات"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"تأیید"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"سیستم این اعلان را بهطور خودکار <b>به «پیشفرض» ارتقا داد</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"سیستم این اعلان را بهطور خودکار <b>به «بیصدا» تنزل داد</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"این اعلان بهطور خودکار در کشوی اعلانات <b>در رتبهبندی بالاتری قرار گرفت</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"این اعلان بهطور خودکار در کشوی اعلانات <b>در رتبهبندی پایینتری قرار گرفت</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"این مورد درست بود؟"</string>
<string name="feedback_response" msgid="4671729244976641339">"از بازخوردتان سپاسگزاریم!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"تأیید"</string>
diff --git a/packages/SystemUI/res/values-fi/strings.xml b/packages/SystemUI/res/values-fi/strings.xml
index bb17d32..cb60ff4 100644
--- a/packages/SystemUI/res/values-fi/strings.xml
+++ b/packages/SystemUI/res/values-fi/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Kuvakaappausta ei voi tallentaa"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Sovellus tai organisaatio ei salli kuvakaappauksien tallentamista."</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Muuta"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Muokkaa kuvakaappausta"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Voi soida tai väristä puhelimen asetuksista riippuen. Näistä keskusteluista (<xliff:g id="APP_NAME">%1$s</xliff:g>) syntyy oletuksena kuplia."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Kelluva sisällön pikakuvake säilyttää huomiosi"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Järjestelmä valitsee, kuuluuko tästä ilmoituksesta ääntä tai väriseekö se"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Tila:</b> valittu oletusarvoiseksi"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Tila:</b> hiljennetty"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Tila:</b> valittu tärkeämmäksi"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Tila:</b> valittu vähemmän tärkeäksi"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Näkyy keskusteluosion yläosassa kelluvana kuplana, profiilikuva näkyy lukitusnäytöllä"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Asetukset"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Tärkeä"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Tämä sovellus näkyy näytöllä muiden sovellusten päällä ja käyttää mikrofonia sekä kameraa."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Asetukset"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Järjestelmä valitsi tämän ilmoituksen automaattisesti <b>oletusarvoiseksi</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Järjestelmä <b>hiljensi</b> tämän ilmoituksen automaattisesti."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Tämä ilmoitus valittiin automaattisesti <b>tärkeämmäksi</b> ilmoitusalueella."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Tämä ilmoitus valittiin automaattisesti <b>vähemmän tärkeäksi</b> ilmoitusalueella."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Oliko tämä oikein?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Kiitos palautteesta!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-fr-rCA/strings.xml b/packages/SystemUI/res/values-fr-rCA/strings.xml
index 897a475..17752c5 100644
--- a/packages/SystemUI/res/values-fr-rCA/strings.xml
+++ b/packages/SystemUI/res/values-fr-rCA/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Impossible d\'enregistrer la capture d\'écran"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"L\'application ou votre organisation n\'autorise pas les saisies d\'écran"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Modifier"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Modifier la capture d\'écran"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Peut sonner ou vibrer, selon les paramètres du téléphone. Conversations des bulles de <xliff:g id="APP_NAME">%1$s</xliff:g> par défaut."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Garde votre attention à l\'aide d\'un raccourci flottant vers ce contenu."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Faire en sorte que le système détermine si cette notification devrait émettre un son ou vibrer"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>État :</b> élevé à la catégorie Par défaut"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>État :</b> abaissé à la catégorie Silencieux"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>État :</b> élevé d\'un niveau"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>État :</b> abaissé d\'un niveau"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"S\'affiche en haut de la section des conversations sous forme de bulle flottante et affiche la photo du profil sur l\'écran de verrouillage"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Paramètres"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritaire"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Cette application superpose du contenu par-dessus d\'autres applications à l\'écran et utilise le microphone et l\'appareil photo."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Paramètres"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"La notification a été automatiquement <b>élevée à la catégorie Par défaut</b> par le système."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"La notification a été automatiquement <b>abaissée à la catégorie Silencieux</b> par le système."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"La notification a été automatiquement <b>élevée d\'un niveau</b> dans votre volet."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"La notification a été automatiquement <b>abaissée d\'un niveau</b> dans votre volet."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Était-ce correct?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Merci de vos commentaires!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-fr/strings.xml b/packages/SystemUI/res/values-fr/strings.xml
index d756991..39d82ef 100644
--- a/packages/SystemUI/res/values-fr/strings.xml
+++ b/packages/SystemUI/res/values-fr/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Impossible d\'enregistrer la capture d\'écran"</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>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Modifier"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Modifier la capture d\'écran"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Peut sonner ou vibrer en fonction des paramètres du téléphone. Les conversations provenant de <xliff:g id="APP_NAME">%1$s</xliff:g> s\'affichent sous forme de bulles par défaut."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Attire votre attention à l\'aide d\'un raccourci flottant vers ce contenu."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Laisser le système déterminer si cette notification doit être accompagnée d\'un son ou d\'une vibration"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>État :</b> Élevée à la catégorie \"Par défaut\""</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>État :</b> Abaissée à la catégorie \"Silencieux\""</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>État :</b> Élevée d\'un niveau"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>État ::</b> Abaissée d\'un niveau"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"S\'affiche en haut de la section des conversations, apparaît sous forme de bulle flottante, affiche la photo de profil sur l\'écran de verrouillage"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Paramètres"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritaire"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Cette application se superpose aux autres applications sur l\'écran, et utilise le micro et la caméra."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Paramètres"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"La notification a été automatiquement <b>élevée à la catégorie \"Par défaut\"</b> par le système."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"La notification a été automatiquement <b>abaissée à la catégorie \"Silencieux\"</b> par le système."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"La notification a été automatiquement <b>élevée d\'un niveau</b> dans votre volet."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"La notification a été automatiquement <b>abaissée d\'un niveau</b> dans votre volet."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Est-ce que c\'était correct ?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Merci de nous avoir envoyé vos commentaires."</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-gl/strings.xml b/packages/SystemUI/res/values-gl/strings.xml
index abfdf6b..6494e0afc 100644
--- a/packages/SystemUI/res/values-gl/strings.xml
+++ b/packages/SystemUI/res/values-gl/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Non se puido gardar a captura de pantalla"</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>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Editar"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Editar a captura de pantalla"</string>
@@ -548,7 +548,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"O administrador activou o rexistro na rede, que controla o tráfico do teu dispositivo.\n\nPara obter máis información, contacta co administrador."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"Outorgaches permiso a unha aplicación para configurar unha conexión VPN.\n\nEsta aplicación pode supervisar a túa actividade na rede, incluídos os correos electrónicos, as aplicacións e os sitios web."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"<xliff:g id="ORGANIZATION">%1$s</xliff:g> xestiona o teu perfil de traballo.\n\nO administrador pode controlar a túa actividade na rede, mesmo os correos electrónicos, as aplicacións e os sitios web.\n\nPara obter máis información, ponte en contacto co administrador.\n\nTamén estás conectado a unha VPN, que pode controlar a túa actividade na rede."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"O teu pai ou nai xestiona este dispositivo. O teu pai ou nai pode ver e xestionar información como as aplicacións que usas, a túa localización e o tempo diante da pantalla."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"O teu pai ou nai xestiona este dispositivo e pode ver e xestionar información como as aplicacións que usas, a túa localización e o tempo diante da pantalla."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"VPN"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"Estás conectado a <xliff:g id="APPLICATION">%1$s</xliff:g>, que pode controlar a túa actividade na rede, mesmo os correos electrónicos, as aplicacións e os sitios web."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"Estás conectado a <xliff:g id="APPLICATION">%1$s</xliff:g>, que pode supervisar a túa actividade persoal na rede, incluídos os correos electrónicos, as aplicacións e os sitios web."</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Podería soar ou vibrar en función da configuración do teléfono. Conversas desde a burbulla da aplicación <xliff:g id="APP_NAME">%1$s</xliff:g> de forma predeterminada."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Mantén a túa atención cun atallo flotante a este contido."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Fai que o sistema determine se a notificación debe emitir un son ou unha vibración"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Estado:</b> ascendeuse a Predeterminada"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Estado:</b> o nivel diminuíuse a Silencioso"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Estado:</b> clasificouse nun nivel superior"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Estado:</b> clasificouse nun nivel inferior"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Móstranse na parte superior da sección de conversas en forma de burbulla flotante e aparece a imaxe do perfil na pantalla de bloqueo"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Configuración"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioridade"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Esta aplicación móstrase sobre outras aplicacións da pantalla e está utilizando o micrófono e a cámara."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Configuración"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Aceptar"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"O sistema <b>ascendeu a Predeterminada</b> esta notificación de forma automática."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"O sistema <b>diminuíu a Silencioso</b> o nivel desta notificación de forma automática."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Esta notificación <b>clasificouse nun nivel superior</b> de forma automática no teu ton."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Esta notificación <b>clasificouse nun nivel inferior</b> de forma automática no teu ton."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"A información era correcta?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Grazas polo teu comentario"</string>
<string name="feedback_ok" msgid="6481426753298857144">"Aceptar"</string>
diff --git a/packages/SystemUI/res/values-gu/strings.xml b/packages/SystemUI/res/values-gu/strings.xml
index a4562aa..369fd1d 100644
--- a/packages/SystemUI/res/values-gu/strings.xml
+++ b/packages/SystemUI/res/values-gu/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"સ્ક્રીનશૉટ સાચવી શકાતો નથી"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ઍપ્લિકેશન કે તમારી સંસ્થા દ્વારા સ્ક્રીનશૉટ લેવાની મંજૂરી નથી"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"ફેરફાર કરો"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"સ્ક્રીનશૉટમાં ફેરફાર કરો"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"ફોન સેટિંગના આધારે રિંગ અથવા વાઇબ્રેટ થઈ શકે છે. ડિફૉલ્ટ તરીકે <xliff:g id="APP_NAME">%1$s</xliff:g> બબલની વાતચીત."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"ફ્લોટિંગ શૉર્ટકટથી આ કન્ટેન્ટ પર તમારું ધ્યાન દોરી રાખે છે."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"આ નોટિફિકેશન સાઉન્ડ અથવા વાઇબ્રેટ કરી શકશે કે નહીં તે સિસ્ટમને નક્કી કરવા દો"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>સ્ટેટસ:</b> ડિફૉલ્ટ તરીકે બઢતી આપવામાં આવી"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>સ્ટેટસ:</b> સાઇલન્ટ પર અવનત કરવામાં આવ્યું"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>સ્ટેટસ:</b> ઉપલી રેંક આપવામાં આવી"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>સ્ટેટસ:</b> નીચલી રેંક આપવામાં આવી"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"એને વાતચીત વિભાગની ટોચ પર બતાવે છે, તરતા બબલ તરીકે દેખાય છે, લૉક સ્ક્રીન પર પ્રોફાઇલ ફોટા તરીકે બતાવે છે"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"સેટિંગ"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"પ્રાધાન્યતા"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"આ ઍપ તમારી સ્ક્રીન પરની અન્ય ઍપની ઉપર પ્રદર્શિત થઈ રહી છે અને માઇક્રોફોન અને કૅમેરાનો ઉપયોગ કરી રહી છે."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"સેટિંગ"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ઓકે"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"સિસ્ટમ દ્વારા આ નોટિફિકેશનને ઑટોમૅટિક રીતે <b>ડિફૉલ્ટ તરીકે બઢતી</b> આપવામાં આવી."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"સિસ્ટમ દ્વારા આ નોટિફિકેશનને ઑટોમૅટિક રીતે <b>સાઇલન્ટ પર અવનત</b> કરવામાં આવ્યું."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"તમારા શેડમાં આ નોટિફિકેશનને ઑટોમૅટિક રીતે <b>ઉપલી રેંક</b> આપવામાં આવી."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"તમારા શેડમાં આ નોટિફિકેશનને ઑટોમૅટિક રીતે <b>નીચલી રેંક</b> આપવામાં આવી."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"શું આ યોગ્ય હતું?"</string>
<string name="feedback_response" msgid="4671729244976641339">"તમારા પ્રતિસાદ બદલ આભાર!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ઓકે"</string>
diff --git a/packages/SystemUI/res/values-hi/strings.xml b/packages/SystemUI/res/values-hi/strings.xml
index 6cde262..0b16f52 100644
--- a/packages/SystemUI/res/values-hi/strings.xml
+++ b/packages/SystemUI/res/values-hi/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"स्क्रीनशॉट को सेव नहीं किया जा सका"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ऐप्लिकेशन या आपका संगठन स्क्रीनशॉट लेने की अनुमति नहीं देता"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"बदलाव करें"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"स्क्रीनशॉट में बदलाव करें"</string>
@@ -550,7 +550,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"आपके एडमिन ने नेटवर्क लॉग करना चालू कर दिया है, जो आपके डिवाइस पर ट्रैफ़िक की निगरानी करता है.\n\nज़्यादा जानकारी के लिए अपने एडमिन से संपर्क करें."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"आपने किसी ऐप को VPN कनेक्शन सेट करने की अनुमति दी है.\n\nयह ऐप ईमेल, ऐप्स और सुरक्षित वेबसाइटों सहित आपके डिवाइस और नेटवर्क की गतिविधि की निगरानी कर सकता है."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"<xliff:g id="ORGANIZATION">%1$s</xliff:g> आपकी वर्क प्रोफ़ाइल को प्रबंधित करता है.\n\n आपका एडमिन ईमेल, ऐप्लिकेशन और वेबसाइटों सहित आपकी नेटवर्क गतिविधि की निगरानी कर सकता है.\n\nऔर जानकारी के लिए अपने एडमिन से संपर्क करें.\n\nआप ऐसे VPN से भी कनेक्ट हैं, जो आपकी नेटवर्क गतिविधि की निगरानी कर सकता है."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"इस डिवाइस का प्रबंधन आपके अभिभावक करते हैं. अभिभावक आपके डिवाइस से जुड़ी जानकारी देख सकते हैं और उसे प्रबंधित कर सकते हैं. इनमें, आपके इस्तेमाल किए गए ऐप्लिकेशन, जगह की जानकारी, और डिवाइस के इस्तेमाल में बिताए गए समय जैसी जानकारी शामिल है."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"इस डिवाइस का प्रबंधन आपके अभिभावक करते हैं. अभिभावक आपके डिवाइस से जुड़ी जानकारी देख सकते हैं. साथ ही, इसे प्रबंधित कर सकते हैं. इनमें आपके इस्तेमाल किए गए ऐप्लिकेशन, जगह की जानकारी, और डिवाइस के इस्तेमाल में बिताए गए समय जैसी जानकारी शामिल है."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"वीपीएन"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"आप <xliff:g id="APPLICATION">%1$s</xliff:g> से कनेक्ट हैं, जो ईमेल, ऐप्लिकेशन और वेबसाइटों सहित आपकी नेटवर्क गतिविधि की निगरानी कर सकता है."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"आप <xliff:g id="APPLICATION">%1$s</xliff:g> से कनेक्ट हैं, जो ईमेल, ऐप्स और वेबसाइटों सहित आपकी व्यक्तिगत नेटवर्क गतिविधि की निगरानी कर सकता है."</string>
@@ -700,14 +700,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"फ़ोन की सेटिंग के आधार पर, सूचना आने पर घंटी बज सकती है या वाइब्रेशन हो सकता है. <xliff:g id="APP_NAME">%1$s</xliff:g> में होने वाली बातचीत, डिफ़ॉल्ट रूप से बबल के तौर पर दिखती है."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"फ़्लोट करने वाले शॉर्टकट की मदद से इस सामग्री पर आपका ध्यान बना रहता है."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"सिस्टम को यह तय करने की अनुमति दें कि इस सूचना के मिलने पर आवाज़ हो या वाइब्रेशन हो"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>स्थिति:</b> लेवल बढ़ाकर, डिफ़ॉल्ट के तौर पर सेट किया गया"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>स्थिति:</b> लेवल घटाकर, साइलेंट पर सेट किया गया"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>स्थिति:</b> रैंकिंग में ऊपर किया गया"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>स्थिति:</b> रैंकिंग में नीचे किया गया"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"इससे बातचीत, सेक्शन में सबसे ऊपर और फ़्लोटिंग बबल के तौर पर दिखती है. साथ ही, लॉक स्क्रीन पर प्रोफ़ाइल फ़ोटो दिखती है"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"सेटिंग"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"प्राथमिकता"</string>
@@ -726,14 +722,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"यह ऐप्लिकेशन आपकी स्क्रीन पर इस्तेमाल हो रहे दूसरे ऐप्लिकेशन के ऊपर दिखाया जा रहा है. इसके साथ ही यह माइक्रोफ़ोन और कैमरे का भी इस्तेमाल कर रहा है."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"सेटिंग"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ठीक है"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"सिस्टम ने अपने-आप इस सूचना का <b>लेवल बढ़ाकर, इसे डिफ़ॉल्ट</b> के तौर पर सेट किया था."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"सिस्टम ने अपने-आप <b>इस सूचना का लेवल घटाकर, इसे साइलेंट</b> पर सेट किया था."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"आपकी शेड में, इस सूचना को अपने-आप <b>रैंकिंग में ऊपर</b> किया गया था."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"आपकी शेड में, इस सूचना को अपने-आप <b>रैंकिंग में नीचे</b> किया गया था."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"आपको यह सुविधा कैसी लगी?"</string>
<string name="feedback_response" msgid="4671729244976641339">"सुझाव या शिकायत के लिए धन्यवाद!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ठीक है"</string>
diff --git a/packages/SystemUI/res/values-hr/strings.xml b/packages/SystemUI/res/values-hr/strings.xml
index 3b25e38..2f13421 100644
--- a/packages/SystemUI/res/values-hr/strings.xml
+++ b/packages/SystemUI/res/values-hr/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Nije moguće spremiti snimku zaslona"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Aplikacija ili vaša organizacija ne dopuštaju snimanje zaslona"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Uredi"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Uređivanje snimke zaslona"</string>
@@ -701,14 +701,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Možda će zvoniti ili vibrirati, ovisno o postavkama telefona. Razgovori iz aplikacije <xliff:g id="APP_NAME">%1$s</xliff:g> prikazuju se u oblačiću prema zadanim postavkama."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Održava vam pozornost pomoću plutajućeg prečaca ovom sadržaju."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Neka sustav odredi treba li obavijest najaviti zvukom ili vibracijom"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> promaknuta u zadanu"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> prebačena u bešumnu"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> više rangirana"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> niže rangirana"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Prikazuje se pri vrhu odjeljka razgovora kao pomični oblačić i prikazuje profilnu sliku na zaključanom zaslonu"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Postavke"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritet"</string>
@@ -727,14 +723,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Ova se aplikacija prikazuje preko drugih aplikacija na zaslonu i upotrebljava mikrofon i kameru."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Postavke"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"U redu"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Sustav je ovu obavijest automatski <b>promaknuo u zadanu</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Sustav je ovu obavijest automatski <b>prebacio u bešumnu</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Ova obavijest automatski je <b>rangirana više</b> na vašem zaslonu."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Ova obavijest automatski je <b>rangirana niže</b> na vašem zaslonu."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Je li to bilo točno?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Zahvaljujemo na povratnim informacijama!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"U redu"</string>
diff --git a/packages/SystemUI/res/values-hu/strings.xml b/packages/SystemUI/res/values-hu/strings.xml
index e7ee331..a7b3cc3 100644
--- a/packages/SystemUI/res/values-hu/strings.xml
+++ b/packages/SystemUI/res/values-hu/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Nem lehetséges a képernyőkép mentése"</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>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Szerkesztés"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Képernyőkép szerkesztése"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"A telefonbeállítások alapján csöröghet és rezeghet. A(z) <xliff:g id="APP_NAME">%1$s</xliff:g> alkalmazásban lévő beszélgetések alapértelmezés szerint buborékban jelennek meg."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"A tartalomra mutató lebegő parancsikon segítségével tartja fenn az Ön figyelmét."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"A rendszer határozza meg, hogy ez az értesítés adjon-e ki hangot, illetve rezegjen-e"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Állapot:</b> alapértelmezettre állítva"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Állapot:</b> némára állítva"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Állapot:</b> előrébb sorolva"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Állapot:</b> hátrébb sorolva"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"A beszélgetések szakaszának tetején, lebegő buborékként látható, megjeleníti a profilképet a lezárási képernyőn"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Beállítások"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritás"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Ez az alkalmazás a képernyőn lévő egyéb alkalmazások előtt jelenik meg, és használja a mikrofont és a kamerát."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Beállítások"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Ezt az értesítést automatikusan <b>alapértelmezettre állította</b> a rendszer."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Ezt az értesítést automatikusan <b>némára állította</b> a rendszer."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Ezt az értesítést automatikusan <b>előrébb sorolta</b> a rendszer az értesítési felületen."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Ezt az értesítést automatikusan <b>hátrébb sorolta</b> a rendszer az értesítési felületen."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Megfelelő ez így?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Köszönjük a visszajelzést!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-hy/strings.xml b/packages/SystemUI/res/values-hy/strings.xml
index af300ea..fed73da 100644
--- a/packages/SystemUI/res/values-hy/strings.xml
+++ b/packages/SystemUI/res/values-hy/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Չհաջողվեց պահել սքրինշոթը"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Հավելվածը կամ ձեր կազմակերպությունը չի թույլատրում սքրինշոթի ստացումը"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Փոփոխել"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Փոփոխել սքրինշոթը"</string>
@@ -548,7 +548,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"Ձեր ադմինիստրատորը միացրել է ցանցային իրադարձությունների գրանցումը, որը վերահսկում է ձեր սարքի թրաֆիկը։\n\nԼրացուցիչ տեղեկություններ ստանալու համար դիմեք ձեր ադմինիստրատորին։"</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"Ինչ-որ հավելվածի թույլ եք տվել հաստատել VPN կապակցում:\n\nԱյդ հավելվածը կարող է վերահսկել ձեր սարքի և ցանցի գործունեությունը, այդ թվում նաև էլփոստի հաշիվները, հավելվածները և կայքերը:"</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"Ձեր աշխատանքային պրոֆիլի կառավարիչն է <xliff:g id="ORGANIZATION">%1$s</xliff:g> կազմակերպությունը։\n\nԱդմինիստրատորը կարող է վերահսկել ձեր ցանցային գործունեությունը, այդ թվում նաև էլփոստը, հավելվածները և կայքերը։\n\nԼրացուցիչ տեղեկությունների համար դիմեք ադմինիստրատորին։\n\nԴուք կապակցված են նաև VPN ցանցին, որը կարող է վերահսկել ձեր ցանցային գործունեությունը։"</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Այս սարքը կառավարում է ձեր ծնողը։ Նա կարող է տեսնել և կառավարել որոշակի տեղեկություններ, օրինակ՝ հավելվածները, որոնք դուք օգտագործում եք, ձեր տեղադրությունը և սարքի օգտագործման ժամանակը։"</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Այս սարքը կառավարում է ձեր ծնողը։ Նա կարող է դիտել և փոփոխել որոշակի տեղեկություններ, օրինակ՝ հավելվածները, որոնք դուք օգտագործում եք, ձեր տեղադրությունը և սարքի օգտագործման ժամանակը։"</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"VPN"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"Դուք կապակցված եք <xliff:g id="APPLICATION">%1$s</xliff:g> հավելվածին, որը կարող է վերահսկել ձեր ցանցային գործունեությունը, այդ թվում նաև էլփոստի հաշիվները, հավելվածները և կայքերը:"</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"Դուք կապակցված եք <xliff:g id="APPLICATION">%1$s</xliff:g> հավելվածին, որը կարող է վերահսկել անձնական ցանցում կատարած ձեր գործողությունները, այդ թվում նաև էլփոստի հաշիվները, հավելվածները և կայքերը:"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Կարող է զնգալ կամ թրթռալ (հեռախոսի կարգավորումներից կախված)։ <xliff:g id="APP_NAME">%1$s</xliff:g>-ի զրույցներն ըստ կանխադրման հայտնվում են ամպիկների տեսքով։"</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Լողացող դյուրանցման միջոցով ձեր ուշադրությունն է գրավում բովանդակության նկատմամբ"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Թող համակարգն ավտոմատ որոշի՝ արդյոք այս ծանուցումը ձայնով, թե թրթռոցով է պետք մատուցել"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Կարգավիճակը․</b> բարձրացվել է և դարձել կանխադրված"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Կարգավիճակը․</b> իջեցվել է և դարձել անձայն"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Կարգավիճակը․</b> կարևորության մակարդակը բարձրացվել է"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Կարգավիճակը․</b> կարևորության մակարդակն իջեցվել է"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Ցուցադրվում է զրույցների ցանկի վերևում, հայտնվում է լողացող ամպիկի տեսքով, ցուցադրում է պրոֆիլի նկարը կողպէկրանին"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Կարգավորումներ"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Կարևոր"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Այս հավելվածը ցուցադրվում է մյուս հավելվածների վրայից և օգտագործում է խոսափողն ու տեսախցիկը:"</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Կարգավորումներ"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Եղավ"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Այս ծանուցման կարևորության մակարդակը ավտոմատ <b>բարձրացվել է և դարձել կանխադրված</b>։"</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Այս ծանուցման կարևորության մակարդակը ավտոմատ <b>իջեցվել է և դարձել անձայն</b>։"</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Ծանուցումների վահանակում այս ծանուցուման կարևորության մակարդակն ավտոմատ <b>բարձրացվել է</b>։"</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Ծանուցումների վահանակում այս ծանուցուման կարևորության մակարդակն ավտոմատ <b>իջեցվել է</b>։"</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Սա ճի՞շտ էր"</string>
<string name="feedback_response" msgid="4671729244976641339">"Շնորհակալություն արձագանքելու համար"</string>
<string name="feedback_ok" msgid="6481426753298857144">"Եղավ"</string>
diff --git a/packages/SystemUI/res/values-in/strings.xml b/packages/SystemUI/res/values-in/strings.xml
index 0038463..7ae3e5d 100644
--- a/packages/SystemUI/res/values-in/strings.xml
+++ b/packages/SystemUI/res/values-in/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Tidak dapat menyimpan screenshot"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Mengambil screenshot tidak diizinkan oleh aplikasi atau organisasi"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Edit"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Mengedit screenshot"</string>
@@ -548,7 +548,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"Admin telah mengaktifkan pencatatan log jaringan, yang memantau traffic di perangkat.\n\nUntuk informasi selengkapnya, hubungi admin."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"Anda memberikan izin kepada aplikasi untuk menyiapkan sambungan VPN.\n\nAplikasi ini ini dapat memantau aktivitas perangkat dan jaringan, termasuk email, aplikasi, dan situs web."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"Profil kerja dikelola oleh <xliff:g id="ORGANIZATION">%1$s</xliff:g>.\n\nAdmin dapat memantau aktivitas jaringan, termasuk email, aplikasi, dan situs web.\n\nUntuk informasi selengkapnya, hubungi admin.\n\nAnda juga tersambung ke VPN, yang dapat memantau aktivitas jaringan."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Perangkat ini dikelola oleh orang tua. Orang tua Anda dapat melihat dan mengelola informasi, seperti aplikasi yang digunakan, lokasi, dan waktu pemakaian perangkat."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Perangkat ini dikelola oleh orang tuamu. Orang tuamu bisa melihat dan mengelola berbagai informasi, seperti aplikasi yang kamu gunakan, lokasimu, dan lama pemakaian perangkat."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"VPN"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"Anda tersambung ke <xliff:g id="APPLICATION">%1$s</xliff:g>, yang dapat memantau aktivitas jaringan, termasuk email, aplikasi, dan situs."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"Anda tersambung ke <xliff:g id="APPLICATION">%1$s</xliff:g>, yang dapat memantau aktivitas jaringan pribadi, termasuk email, aplikasi, dan situs web."</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Dapat berdering atau bergetar berdasarkan setelan ponsel. Percakapan dari balon <xliff:g id="APP_NAME">%1$s</xliff:g> secara default."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Menjaga perhatian dengan pintasan floating ke konten ini."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Biarkan sistem menentukan apakah notifikasi ini akan berbunyi atau bergetar"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> Dipromosikan menjadi Default"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> Didemosikan menjadi Senyap"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> Diberi Peringkat Lebih Tinggi"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> Diberi Peringkat Lebih Rendah"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Muncul di atas bagian percakapan, ditampilkan sebagai balon yang mengambang, menampilkan gambar profil di layar kunci"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Setelan"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritas"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Aplikasi ini ditampilkan di atas aplikasi lain di layar serta sedang menggunakan mikrofon dan kamera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Setelan"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Ya"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Notifikasi ini otomatis <b>dipromosikan menjadi Default</b> oleh sistem."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Notifikasi ini otomatis <b>didemosikan menjadi Senyap</b> oleh sistem."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Notifikasi ini otomatis <b>diberi peringkat lebih tinggi</b> di shade Anda."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Notifikasi ini otomatis <b>diberi peringkat lebih rendah</b> di shade Anda."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Sudah benar?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Terima kasih atas masukan Anda"</string>
<string name="feedback_ok" msgid="6481426753298857144">"Oke"</string>
diff --git a/packages/SystemUI/res/values-is/strings.xml b/packages/SystemUI/res/values-is/strings.xml
index 25b907f..0361ba4 100644
--- a/packages/SystemUI/res/values-is/strings.xml
+++ b/packages/SystemUI/res/values-is/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Ekki er hægt að vista skjámynd"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Forritið eða fyrirtækið þitt leyfir ekki skjámyndatöku"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Breyta"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Breyta skjámynd"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Gæti hringt eða titrað eftir stillingum símans. Samtöl á <xliff:g id="APP_NAME">%1$s</xliff:g> birtast sjálfkrafa í blöðru."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Fangar athygli þína með fljótandi flýtileið á þetta efni."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Láta kerfið ákvarða hvort hljóð eða titringur fylgir þessari tilkynningu"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Staða:</b> gerð sjálfgefin"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Staða:</b> var gerð þögul"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Staða:</b> fékk hærri stöðu"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Staða:</b> fékk lægri stöðu"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Birtist efst í samtalshluta, birtist sem fljótandi blaðra, birtir prófílmynd á lásskjánum"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Áfram"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Forgangur"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Þetta forrit er að birta efni yfir öðrum forritum á skjánum þínum og er að nota hljóðnemann og myndavélina."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Stillingar"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Í lagi"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Stig þessarar tilkynningar var sjálfkrafa <b>hækkað í sjálfgefið</b> af kerfinu."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Stig þessarar tilkynningar var sjálfkrafa <b>lækkað í þögult</b> af kerfinu."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Stig þessarar tilkynningar var sjálfkrafa <b>hækkað</b> í tilkynningaglugganum þínum."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Stig þessarar tilkynningar var sjálfkrafa <b>lækkað</b> í tilkynningaglugganum þínum."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Var þetta rétt?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Takk fyrir að segja þína skoðun!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"Í lagi"</string>
diff --git a/packages/SystemUI/res/values-it/strings.xml b/packages/SystemUI/res/values-it/strings.xml
index e393cea..948faf1 100644
--- a/packages/SystemUI/res/values-it/strings.xml
+++ b/packages/SystemUI/res/values-it/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Impossibile salvare lo screenshot"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"L\'acquisizione di screenshot non è consentita dall\'app o dall\'organizzazione"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Modifica"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Modifica screenshot"</string>
@@ -499,7 +499,7 @@
<string name="profile_owned_footer" msgid="2756770645766113964">"Il profilo potrebbe essere monitorato"</string>
<string name="vpn_footer" msgid="3457155078010607471">"La rete potrebbe essere monitorata"</string>
<string name="branded_vpn_footer" msgid="816930186313188514">"La rete potrebbe essere monitorata"</string>
- <string name="quick_settings_disclosure_parental_controls" msgid="2114102871438223600">"Questo dispositivo è gestito da uno dei tuoi genitori"</string>
+ <string name="quick_settings_disclosure_parental_controls" msgid="2114102871438223600">"Questo dispositivo è gestito dai tuoi genitori"</string>
<string name="quick_settings_disclosure_management_monitoring" msgid="8231336875820702180">"Questo dispositivo appartiene alla tua organizzazione, che potrebbe monitorare il traffico di rete"</string>
<string name="quick_settings_disclosure_named_management_monitoring" msgid="2831423806103479812">"Questo dispositivo appartiene a <xliff:g id="ORGANIZATION_NAME">%1$s</xliff:g>, che potrebbe monitorare il traffico di rete"</string>
<string name="quick_settings_disclosure_management_named_vpn" msgid="6096715329056415588">"Questo dispositivo appartiene alla tua organizzazione ed è collegato a <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
@@ -548,7 +548,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"L\'amministratore ha attivato i log di rete, che consentono di monitorare il traffico sul dispositivo.\n\nPer ulteriori informazioni, contatta l\'amministratore."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"Hai autorizzato l\'app a configurare una connessione VPN.\n\nQuesta app può monitorare il tuo dispositivo e l\'attività di rete, inclusi email, app e siti web."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"Il tuo profilo di lavoro è gestito da <xliff:g id="ORGANIZATION">%1$s</xliff:g>.\n\nL\'amministratore può monitorare la tua attività di rete, inclusi siti web, email e app.\n\nPer ulteriori informazioni, contatta l\'amministratore.\n\nSei inoltre connesso a una VPN, da cui è possibile monitorare la tua attività di rete."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Questo dispositivo è gestito da uno dei tuoi genitori. Il genitore può visualizzare e gestire informazioni quali le app che usi, la tua posizione e il tuo tempo di utilizzo."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Questo dispositivo è gestito da uno dei tuoi genitori, il quale può visualizzare e gestire informazioni come le app che usi, la tua posizione e il tuo tempo di utilizzo."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"VPN"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"Sei collegato a <xliff:g id="APPLICATION">%1$s</xliff:g>, da cui è possibile monitorare la tua attività di rete, inclusi siti web, email e app."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"Sei connesso a <xliff:g id="APPLICATION">%1$s</xliff:g>, da cui è possibile monitorare la tua attività di rete personale, inclusi email, app e siti web."</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Può suonare o vibrare in base alle impostazioni del telefono. Conversazioni dalla bolla <xliff:g id="APP_NAME">%1$s</xliff:g> per impostazione predefinita."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Mantiene la tua attenzione con una scorciatoia mobile a questi contenuti."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Fai stabilire al sistema se questa notifica deve emettere suoni o vibrazioni"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Stato:</b> promossa a Predefinita"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Stato:</b> retrocessa a Silenziosa"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Stato:</b> posizionata più in alto"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Stato:</b> posizionata più in basso"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Appare in cima alla sezione delle conversazioni e sotto forma di bolla mobile, mostra l\'immagine del profilo nella schermata di blocco"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Impostazioni"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Priorità"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Questa app è visualizzata sopra altre app sullo schermo e sta utilizzando il microfono e la fotocamera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Impostazioni"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Ok"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Questa notifica è stata <b>promossa automaticamente a Predefinita</b> dal sistema."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Questa notifica è stata <b>retrocessa automaticamente a Silenziosa</b> dal sistema."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Questa notifica è stata <b>posizionata automaticamente più in alto</b> nell\'area notifiche."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Questa notifica è stata <b>posizionata automaticamente più in basso</b> nell\'area notifiche."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Era corretto?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Grazie per il feedback."</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-iw/strings.xml b/packages/SystemUI/res/values-iw/strings.xml
index 4f30f1f..d20623e 100644
--- a/packages/SystemUI/res/values-iw/strings.xml
+++ b/packages/SystemUI/res/values-iw/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"לא ניתן לשמור את צילום המסך"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"האפליקציה או הארגון שלך אינם מתירים ליצור צילומי מסך"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"עריכה"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"עריכת צילום מסך"</string>
@@ -704,14 +704,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"ייתכן שיופעל צלצול או רטט בהתאם להגדרות הטלפון. שיחות מהאפליקציה <xliff:g id="APP_NAME">%1$s</xliff:g> מופיעות בבועות כברירת מחדל."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"מעוררת תשומת לב באמצעות קיצור דרך צף לתוכן הזה."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"אפשר לתת למערכת לקבוע אם ההתראה הזאת צריכה להיות מלווה בצליל או ברטט"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>הסטטוס:</b> הועלה בדרגה ל\'ברירת מחדל\'"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>הסטטוס:</b> הורד בדרגה ל\'שקט\'"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>הסטטוס:</b> דורג גבוה יותר"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>הסטטוס:</b> דורג נמוך יותר"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"מוצגת בחלק העליון של קטע התראות השיחה, מופיעה בבועה צפה, תוצג תמונת פרופיל במסך הנעילה"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"הגדרות"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"עדיפות"</string>
@@ -730,14 +726,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"האפליקציה הזו מוצגת מעל אפליקציות אחרות במסך, ומשתמשת במיקרופון ובמצלמה."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"הגדרות"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"אישור"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"ההתראה הזו <b>שודרגה ל\'ברירת מחדל\'</b> באופן אוטומטי על-ידי המערכת."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"ההתראה הזו <b>הורדה בדרגה ל\'שקט\'</b> באופן אוטומטי על-ידי המערכת."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"ההתראה הזו <b>דורגה גבוה יותר</b> באופן אוטומטי בהתראות שלך."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"ההתראה הזו <b>דורגה נמוך יותר</b&gt באופן אוטומטי בהתראות שלך."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"האם פעולה זו הייתה נכונה?"</string>
<string name="feedback_response" msgid="4671729244976641339">"תודה על המשוב!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"אישור"</string>
diff --git a/packages/SystemUI/res/values-ja/strings.xml b/packages/SystemUI/res/values-ja/strings.xml
index baca136..3bb841d 100644
--- a/packages/SystemUI/res/values-ja/strings.xml
+++ b/packages/SystemUI/res/values-ja/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"スクリーンショットを保存できません"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"スクリーンショットの作成はアプリまたは組織で許可されていません"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"編集"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"スクリーンショットを編集します"</string>
@@ -548,7 +548,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"管理者がネットワーク ログを有効にしているため、このデバイスのトラフィックは監視されています。\n\n詳しくは管理者にお問い合わせください。"</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"アプリにVPN接続の設定を許可しました。\n\nこのアプリはあなたのデバイスやネットワークアクティビティ(メール、アプリ、ウェブサイトなど)を監視できます。"</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"この仕事用プロファイルは、<xliff:g id="ORGANIZATION">%1$s</xliff:g> により管理されています。\n\n管理者は、このプロファイルでのネットワーク アクティビティ(メール、アプリ、ウェブサイトなど)を監視できます。\n\n詳しくは管理者にお問い合わせください。\n\nまた、VPN に接続しているため、このネットワークでのあなたのネットワーク アクティビティも監視されます。"</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"このデバイスは保護者によって管理されています。使用しているアプリ、現在地、利用時間などの情報を保護者が確認、管理できます。"</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"このデバイスは保護者によって管理されています。保護者は、あなたが使用するアプリ、あなたの現在地、デバイスの利用時間などの情報を確認したり、管理したりできます。"</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"VPN"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"<xliff:g id="APPLICATION">%1$s</xliff:g> に接続しています。このアプリはあなたのネットワーク アクティビティ(メール、アプリ、ウェブサイトなど)を監視できます。"</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"<xliff:g id="APPLICATION">%1$s</xliff:g>に接続しています。このアプリはあなたの個人のネットワークアクティビティ(メール、アプリ、ウェブサイトなど)を監視できます。"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"スマートフォンの設定を基に着信音またはバイブレーションが有効になります。デフォルトでは <xliff:g id="APP_NAME">%1$s</xliff:g> からの会話がバブルとして表示されます。"</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"このコンテンツのフローティング ショートカットで通知をお知らせします。"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"この通知を音またはバイブレーションで知らせるかどうかの自動判断"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>ステータス:</b> ランクがデフォルトに上がりました"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>ステータス:</b> ランクがサイレントに下がりました"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>ステータス:</b> ランクが上がりました"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>ステータス:</b> ランクが下がりました"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"会話セクションの一番上にバブルとして表示され、プロフィール写真がロック画面に表示されます"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"設定"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"優先"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"このアプリは画面上で他のアプリの上に重ねて表示されます。また、マイクとカメラを使用しています。"</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"設定"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"この通知は、システムによって自動的に<b>ランクがデフォルトに上がり</b>ました。"</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"この通知は、システムによって自動的に<b>ランクがサイレントに下がり</b>ました。"</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"この通知は、自動的にシェード内の<b>ランクが上がり</b>ました。"</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"この通知は、自動的にシェード内の<b>ランクが下がり</b>ました。"</string>
<string name="feedback_prompt" msgid="2278631214125128281">"間違いありませんか?"</string>
<string name="feedback_response" msgid="4671729244976641339">"フィードバックをお寄せいただきありがとうございます。"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-ka/strings.xml b/packages/SystemUI/res/values-ka/strings.xml
index d11c302..3e3405e 100644
--- a/packages/SystemUI/res/values-ka/strings.xml
+++ b/packages/SystemUI/res/values-ka/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"ეკრანის ანაბეჭდის შენახვა ვერ ხერხდება"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ეკრანის ანაბეჭდების შექმნა არ არის ნებადართული აპის ან თქვენი ორგანიზაციის მიერ"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"რედაქტირება"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"ეკრანის ანაბეჭდის რედაქტირება"</string>
@@ -499,7 +499,7 @@
<string name="profile_owned_footer" msgid="2756770645766113964">"შესაძლოა პროფილზე ხორციელდებოდეს მონიტორინგი"</string>
<string name="vpn_footer" msgid="3457155078010607471">"შესაძლოა ქსელზე ხორციელდება მონიტორინგი"</string>
<string name="branded_vpn_footer" msgid="816930186313188514">"ქსელზე შესაძლოა მონიტორინგი ხორციელდებოდეს"</string>
- <string name="quick_settings_disclosure_parental_controls" msgid="2114102871438223600">"ამ მოწყობილობას თქვენი მშობელი მართავს"</string>
+ <string name="quick_settings_disclosure_parental_controls" msgid="2114102871438223600">"მოწყობილობას თქვენი მშობელი მართავს"</string>
<string name="quick_settings_disclosure_management_monitoring" msgid="8231336875820702180">"ამ მოწყობილობას ფლობს თქვენი ორგანიზაცია და მას ქსელის ტრაფიკის მონიტორინგი შეუძლია"</string>
<string name="quick_settings_disclosure_named_management_monitoring" msgid="2831423806103479812">"ამ მოწყობილობას ფლობს <xliff:g id="ORGANIZATION_NAME">%1$s</xliff:g> და მას ქსელის ტრაფიკის მონიტორინგი შეუძლია"</string>
<string name="quick_settings_disclosure_management_named_vpn" msgid="6096715329056415588">"ამ მოწყობილობას ფლობს თქვენი ორგანიზაცია და ის დაკავშირებულია <xliff:g id="VPN_APP">%1$s</xliff:g>-თან"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"დარეკვა ან ვიბრაცია ტელეფონის პარამეტრების მიხედვით. მიმოწერები <xliff:g id="APP_NAME">%1$s</xliff:g>-ის ბუშტიდან, ნაგულისხმევად."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"იპყრობს თქვენს ყურადღებას ამ კონტენტის მოლივლივე მალსახმობით."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"სისტემისთვის ისეთი უფლების მინიჭება, რომ მან განსაზღვროს, ამ შეტყობინებამ ხმოვანი სიგნალი უნდა აამოქმედოს თუ ვიბრაცია"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>სტატუსი:</b> ნაგულისხმევად გარდაქმნილი"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>სტატუსი:</b> „უხმო“ სტატუსზე გადასული"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>სტატუსი:</b> უფრო პრიორიტეტული"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>სტატუსი:</b> ნაკლებად პრიორიტეტული"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"გამოჩნდება მიმოწერების ზედა ნაწილში ბუშტის სახით, აჩვენებს პროფილის სურათს ჩაკეტილ ეკრანზე"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"პარამეტრები"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"პრიორიტეტი"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"ეს აპი თქვენს ეკრანზე ფარავს სხვა აპებს და იყენებს მიკროფონსა და კამერას."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"პარამეტრები"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"კარგი"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"ეს შეტყობინება ავტომატურად <b>გარდაიქმნა ნაგულისხმევად</b> სისტემის მიერ."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"ეს შეტყობინება ავტომატურად <b>გადავიდა „უხმო“ სტატუსზე</b> სისტემის მიერ."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"ეს შეტყობინება ავტომატურად <b>ჩაითვალა უფრო</b> პრიორიტეტულად."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"ეს შეტყობინება ავტომატურად <b>ჩაითვალა ნაკლებად</b> პრიორიტეტულად."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"სწორია ეს?"</string>
<string name="feedback_response" msgid="4671729244976641339">"გმადლობთ გამოხმაურებისთვის!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"კარგი"</string>
diff --git a/packages/SystemUI/res/values-kk/strings.xml b/packages/SystemUI/res/values-kk/strings.xml
index 55552e9..7cbb40b 100644
--- a/packages/SystemUI/res/values-kk/strings.xml
+++ b/packages/SystemUI/res/values-kk/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Скриншотты сақтау мүмкін емес."</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Қолданба немесе ұйым скриншоттар түсіруге рұқсат етпейді"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Өзгерту"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Скриншотты өзгерту"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Телефон параметрлеріне байланысты шылдырлауы не дірілдеуі мүмкін. <xliff:g id="APP_NAME">%1$s</xliff:g> чаттары әдепкісінше қалқымалы етіп көрсетіледі."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Осы мазмұнға бекітілген қалқымалы таңбашамен назарыңызды өзіне тартады."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Хабарландыру дыбысының немесе дірілдің қосылуын жүйе анықтайтын болады"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Күйі:</b> \"Әдепкі\" санатына көтерілген"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Күйі:</b> \"Үнсіз\" санатына төмендетілген"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Күйі:</b> маңыздылық деңгейі көтерілген"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Күйі:</b> маңыздылық деңгейі төмендетілген"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Әңгімелер бөлімінің жоғарғы жағында тұрады, қалқыма хабар түрінде шығады, құлыптаулы экранда профиль суретін көрсетеді"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Параметрлер"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Маңызды"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Бұл қолданба экранда басқа қолданбалардың үстінен көрсетіліп тұр және ол микрофон мен камераны пайдалануда."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Параметрлер"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Жарайды"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Жүйе бұл хабарландырудың маңыздылық деңгейін автоматты түрде <b>\"Әдепкі\" санатына көтерді</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Жүйе бұл хабарландырудың деңгейін автоматты түрде <b>\"Үнсіз\" санатына төмендетті</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Жүйе бұл хабарландырудың маңыздылық деңгейін автоматты түрде <b>көтерді</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Жүйе бұл хабарландырудың маңыздылық деңгейін автоматты түрде <b>төмендетті</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Барлығы дұрыс па?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Пікіріңіз үшін рақмет!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"Жарайды"</string>
diff --git a/packages/SystemUI/res/values-km/strings.xml b/packages/SystemUI/res/values-km/strings.xml
index 5885383..e15cc92 100644
--- a/packages/SystemUI/res/values-km/strings.xml
+++ b/packages/SystemUI/res/values-km/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"មិនអាចរក្សាទុករូបថតអេក្រង់បានទេ"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ការថតរូបអេក្រង់មិនត្រូវបានអនុញ្ញាតដោយកម្មវិធីនេះ ឬស្ថាប័នរបស់អ្នក"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"កែ"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"កែរូបថតអេក្រង់"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"អាចរោទ៍ ឬញ័រ ដោយផ្អែកលើការកំណត់ទូរសព្ទ។ ការសន្ទនាពីពពុះ <xliff:g id="APP_NAME">%1$s</xliff:g> តាមលំនាំដើម។"</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"ធ្វើឱ្យអ្នកចាប់អារម្មណ៍ដោយប្រើផ្លូវកាត់អណ្ដែតសម្រាប់ខ្លឹមសារនេះ។"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"ឱ្យប្រព័ន្ធកំណត់ថាតើការជូនដំណឹងនេះគួរតែបន្លឺសំឡេង ឬញ័រ"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>ស្ថានភាព៖</b> បានដំឡើងទៅលំនាំដើម"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>ស្ថានភាព៖</b> បានបញ្ចុះទៅស្ងាត់"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>ស្ថានភាព៖</b> បានចាត់ថ្នាក់ខ្ពស់ជាងមុន"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>ស្ថានភាព៖</b> បានចាត់ថ្នាក់ទាបជាងមុន"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"បង្ហាញនៅខាងលើផ្នែកសន្ទនា បង្ហាញជាពពុះអណ្ដែត បង្ហាញរូបភាពកម្រងព័ត៌មាននៅលើអេក្រង់ចាក់សោ"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"ការកំណត់"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"អាទិភាព"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"កម្មវិធីនេះកំពុងបង្ហាញពីលើកម្មវិធីផ្សេងទៀតនៅលើអេក្រង់របស់អ្នក និងកំពុងប្រើមីក្រូហ្វូន ក៏ដូចជាកាមេរ៉ា។"</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"ការកំណត់"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"យល់ព្រម"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"ការជូនដំណឹងនេះត្រូវបាន<b>ដំឡើងទៅលំនាំដើម</b>ដោយប្រព័ន្ធដោយស្វ័យប្រវត្តិ។"</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"ការជូនដំណឹងនេះត្រូវបាន<b>បញ្ចុះទៅស្ងាត់</b>ដោយប្រព័ន្ធដោយស្វ័យប្រវត្តិ។"</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"ការជូនដំណឹងនេះត្រូវបាន<b>ចាត់ថ្នាក់ខ្ពស់ជាងមុន</b>ដោយស្វ័យប្រវត្តិ នៅក្នុងផ្ទាំងជូនដំណឹងរបស់អ្នក។"</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"ការជូនដំណឹងនេះត្រូវបាន<b>ចាត់ថ្នាក់ទាបជាងមុន</b>ដោយស្វ័យប្រវត្តិ នៅក្នុងផ្ទាំងជូនដំណឹងរបស់អ្នក។"</string>
<string name="feedback_prompt" msgid="2278631214125128281">"តើវាត្រឹមត្រូវទេ?"</string>
<string name="feedback_response" msgid="4671729244976641339">"សូមអរគុណចំពោះមតិកែលម្អរបស់អ្នក!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"យល់ព្រម"</string>
diff --git a/packages/SystemUI/res/values-kn/strings.xml b/packages/SystemUI/res/values-kn/strings.xml
index 0b3c4e3..177db59 100644
--- a/packages/SystemUI/res/values-kn/strings.xml
+++ b/packages/SystemUI/res/values-kn/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"ಸ್ಕ್ರೀನ್ಶಾಟ್ ಉಳಿಸಲು ಸಾಧ್ಯವಿಲ್ಲ"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ಅಪ್ಲಿಕೇಶನ್ ಅಥವಾ ಸಂಸ್ಥೆಯು ಸ್ಕ್ರೀನ್ಶಾಟ್ಗಳನ್ನು ತೆಗೆಯುವುದನ್ನು ಅನುಮತಿಸುವುದಿಲ್ಲ"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"ಎಡಿಟ್ ಮಾಡಿ"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"ಸ್ಕ್ರೀನ್ಶಾಟ್ ಅನ್ನು ಎಡಿಟ್ ಮಾಡಿ"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"ಸೆಟ್ಟಿಂಗ್ಗಳನ್ನು ಆಧರಿಸಿ ಫೋನ್ ರಿಂಗ್ ಅಥವಾ ವೈಬ್ರೇಟ್ ಆಗುತ್ತದೆ. ಡಿಫಾಲ್ಟ್ ಆಗಿ, <xliff:g id="APP_NAME">%1$s</xliff:g> ನ ಬಬಲ್ ಸಂಭಾಷಣೆಗಳು."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"ಈ ವಿಷಯಕ್ಕೆ ಲಿಂಕ್ ಮಾಡಿ ಕೊಂಡೊಯ್ಯುವ ಶಾರ್ಟ್ಕಟ್ ಕಡೆಗೆ ಗಮನ ಇರಿಸಿ."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"ಈ ಅಧಿಸೂಚನೆಯು ಶಬ್ದ ಮಾಡಬೇಕೇ ಅಥವಾ ವೈಬ್ರೇಟ್ ಮಾಡಬೇಕೇ ಎಂಬುದನ್ನು ನಿರ್ಧರಿಸುವ ಅವಕಾಶವನ್ನು ಸಿಸ್ಟಂಗೆ ನೀಡಿ"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>ಸ್ಥಿತಿ:</b> ಡೀಫಾಲ್ಟ್ಗೆ ಬಡ್ತಿ ಹೊಂದಿದೆ"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>ಸ್ಥಿತಿ:</b> ಸೈಲೆಂಟ್ಗೆ ಕೆಳದರ್ಜೆಗೆ ಇಳಿದಿದೆ"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>ಸ್ಥಿತಿ:</b> ಉನ್ನತ ಸ್ಥಾನವನ್ನು ಹೊಂದಿದೆ"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>ಸ್ಥಿತಿ:</b> ಕಡಿಮೆ ಸ್ಥಾನವನ್ನು ಹೊಂದಿದೆ"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"ಸಂಭಾಷಣೆ ವಿಭಾಗದ ಮೇಲ್ಭಾಗದಲ್ಲಿ ತೇಲುವ ಬಬಲ್ ಆಗಿ ಗೋಚರಿಸುತ್ತದೆ ಮತ್ತು ಪ್ರೊಫೈಲ್ ಚಿತ್ರವನ್ನು ಲಾಕ್ಸ್ಕ್ರೀನ್ ಮೇಲೆ ಗೋಚರಿಸುತ್ತದೆ"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"ಸೆಟ್ಟಿಂಗ್ಗಳು"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"ಆದ್ಯತೆ"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"ಈ ಅಪ್ಲಿಕೇಶನ್ ನಿಮ್ಮ ಸ್ಕ್ರೀನ್ನಲ್ಲಿ ಇತರ ಅಪ್ಲಿಕೇಶನ್ಗಳ ಮೇಲಿಂದ ಪ್ರದರ್ಶಿಸುತ್ತಿದೆ ಮತ್ತು ಮೈಕ್ರೊಫೋನ್ ಮತ್ತು ಕ್ಯಾಮರಾವನ್ನು ಬಳಸುತ್ತಿದೆ."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"ಸೆಟ್ಟಿಂಗ್ಗಳು"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ಸರಿ"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"ಈ ಅಧಿಸೂಚನೆಯು ಸ್ವಯಂಚಾಲಿತವಾಗಿ ಸಿಸ್ಟಂನಿಂದ <b> ಡೀಫಾಲ್ಟ್ಗೆ ಬಡ್ತಿ ಹೊಂದಿದೆ</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"ಈ ಅಧಿಸೂಚನೆಯು ಸ್ವಯಂಚಾಲಿತವಾಗಿ ಸಿಸ್ಟಂನಿಂದ <b>ಸೈಲೆಂಟ್ಗೆ ಹಿಂಬಡ್ತಿ ಹೊಂದಿದೆ</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"ಈ ಅಧಿಸೂಚನೆಯು ಸ್ವಯಂಚಾಲಿತವಾಗಿ ನಿಮ್ಮ ಶೇಡ್ನಲ್ಲಿ <b>ಉನ್ನತ ಸ್ಥಾನವನ್ನು ಹೊಂದಿದೆ</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"ಈ ಅಧಿಸೂಚನೆಯು ಸ್ವಯಂಚಾಲಿತವಾಗಿ ನಿಮ್ಮ ಶೇಡ್ನಲ್ಲಿ <b>ಕಡಿಮೆ ಸ್ಥಾನವನ್ನು ಹೊಂದಿದೆ</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"ಇದು ಸರಿಯಾಗಿತ್ತೇ?"</string>
<string name="feedback_response" msgid="4671729244976641339">"ನಿಮ್ಮ ಪ್ರತಿಕ್ರಿಯೆಗೆ ಧನ್ಯವಾದಗಳು!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ಸರಿ"</string>
diff --git a/packages/SystemUI/res/values-ko/strings.xml b/packages/SystemUI/res/values-ko/strings.xml
index e39ffaa..eb81396 100644
--- a/packages/SystemUI/res/values-ko/strings.xml
+++ b/packages/SystemUI/res/values-ko/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"스크린샷을 저장할 수 없습니다."</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"앱이나 조직에서 스크린샷 촬영을 허용하지 않습니다."</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"수정"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"스크린샷 수정"</string>
@@ -548,7 +548,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"관리자가 기기에서 발생하는 트래픽을 모니터링하는 네트워크 로깅을 사용 설정했습니다.\n\n자세한 정보는 관리자에게 문의하세요."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"VPN 연결을 설정할 수 있는 권한을 앱에 부여했습니다.\n\n이 앱에서 이메일, 앱, 웹사이트와 같은 내 네트워크 활동 및 기기를 모니터링할 수 있습니다."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"<xliff:g id="ORGANIZATION">%1$s</xliff:g>에서 직장 프로필을 관리합니다.\n\n관리자가 이메일, 앱, 웹사이트를 비롯한 네트워크 활동을 모니터링할 수 있습니다.\n\n자세한 정보는 관리자에게 문의하세요.\n\n또한 VPN에 연결되어 있으며, VPN에서 네트워크 활동을 모니터링할 수 있습니다."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"부모님이 관리하는 기기입니다. 부모님이 내가 사용하는 앱, 위치, 기기 사용 시간과 같은 정보를 보고 관리할 수 있습니다."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"부모님이 관리하는 기기입니다. 부모님이 내가 사용하는 앱, 내 위치, 기기 사용 시간과 같은 정보를 보고 관리할 수 있습니다."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"VPN"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"<xliff:g id="APPLICATION">%1$s</xliff:g>에 연결되었습니다. 이 앱은 이메일, 앱, 웹사이트와 같은 내 네트워크 활동을 모니터링할 수 있습니다."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"<xliff:g id="APPLICATION">%1$s</xliff:g>에 연결되었습니다. 이 앱은 이메일, 앱, 웹사이트와 같은 내 네트워크 활동을 모니터링할 수 있습니다."</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"휴대전화 설정에 따라 벨소리나 진동이 울릴 수 있습니다. 기본적으로 <xliff:g id="APP_NAME">%1$s</xliff:g>의 대화는 대화창으로 표시됩니다."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"이 콘텐츠로 연결되는 플로팅 바로가기로 사용자의 주의를 끕니다."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"시스템에서 알림 시 소리 또는 진동을 사용할지 결정하도록 허용합니다."</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>상태:</b> 기본으로 높임"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>상태:</b> 무음으로 낮춤"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>상태:</b> 순위 높임"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>상태:</b> 순위 낮춤"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"대화 섹션 상단에 표시, 플로팅 대화창으로 표시, 그리고 잠금 화면에 프로필 사진이 표시됨"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"설정"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"우선순위"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"앱이 화면의 다른 앱 위에 표시되고 있으며, 마이크와 카메라를 사용 중입니다.."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"설정"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"확인"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"시스템에서 자동으로 이 알림의 순위를 <b>기본으로 높였</b>습니다."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"시스템에서 자동으로 이 알림의 순위를 <b>무음으로 낮췄</b>습니다."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"알림 창에서 자동으로 이 알림의 순위를 <b>높였</b>습니다."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"알림 창에서 자동으로 이 알림의 순위를 <b>낮췄</b>습니다."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"맞나요?"</string>
<string name="feedback_response" msgid="4671729244976641339">"의견을 보내 주셔서 감사합니다."</string>
<string name="feedback_ok" msgid="6481426753298857144">"확인"</string>
diff --git a/packages/SystemUI/res/values-ky/strings.xml b/packages/SystemUI/res/values-ky/strings.xml
index 99cc3d5..caa2b31 100644
--- a/packages/SystemUI/res/values-ky/strings.xml
+++ b/packages/SystemUI/res/values-ky/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Скриншот сакталган жок"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Скриншот тартууга колдонмо же ишканаңыз тыюу салган."</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Түзөтүү"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Скриншотту түзөтүү"</string>
@@ -700,14 +700,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Телефондун жөндөөлөрүнө жараша шыңгырап же дирилдеши мүмкүн. <xliff:g id="APP_NAME">%1$s</xliff:g> колдонмосундагы жазышуулар демейки жөндөө боюнча калкып чыкма билдирмелер түрүндө көрүнөт."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Калкыма ыкчам баскыч менен көңүлүңүздү бул мазмунга буруп турат."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Билдирменин үнүн чыгартууну же басууну тутумга тапшырыңыз"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Абалы:</b> Демейкиге өзгөрдү"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Абалы:</b> Үнсүз абалга төмөндөдү"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Абалы:</b> Жогорулады"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Абалы:</b> Төмөндөдү"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Жазышуулар тизмесинин өйдө жагында калкып чыкма билдирме түрүндө көрүнүп, профиль сүрөтү кулпуланган экрандан чагылдырылат"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Жөндөөлөр"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Маанилүүлүгү"</string>
@@ -726,14 +722,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Бул колдонмо экрандагы башка терезелердин үстүнөн көрсөтүлүп, микрофонду жана камераны колдонууда."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Жөндөөлөр"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ЖАРАЙТ"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Бул билдирмени тутум автоматтык түрдө <b>Демейкиге өзгөрттү</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Бул билдирмени тутум автоматтык түрдө <b>Үнсүз абалга төмөндөттү</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Бул билдирменин панелиңиздеги абалы автоматтык түрдө <b>жогорулады</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Бул билдирменин панелиңиздеги абалы автоматтык түрдө <b>төмөндөдү</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Бул туурабы?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Пикириңиз үчүн рахмат!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"Жарайт"</string>
diff --git a/packages/SystemUI/res/values-lo/strings.xml b/packages/SystemUI/res/values-lo/strings.xml
index a01d1a4..5ed1d4b 100644
--- a/packages/SystemUI/res/values-lo/strings.xml
+++ b/packages/SystemUI/res/values-lo/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"ບໍ່ສາມາດບັນທຶກຮູບໜ້າຈໍໄດ້"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ແອັບ ຫຼື ອົງກອນຂອງທ່ານບໍ່ອະນຸຍາດໃຫ້ຖ່າຍຮູບໜ້າຈໍ"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"ແກ້ໄຂ"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"ແກ້ໄຂຮູບໜ້າຈໍ"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"ອາດສົ່ງສຽງ ຫຼື ສັ່ນເຕືອນໂດຍອ້າງອີງຈາກການຕັ້ງຄ່າໂທລະສັບ. ການສົນທະນາຈາກ <xliff:g id="APP_NAME">%1$s</xliff:g> ຈະເປັນ bubble ຕາມຄ່າເລີ່ມຕົ້ນ."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"ເອົາໃຈໃສ່ທາງລັດແບບລອຍໄປຫາເນື້ອຫານີ້."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"ໃຫ້ລະບົບກຳນົດວ່າການແຈ້ງເຕືອນນິ້ຄວນມີສຽງ ຫຼື ສັ່ນເຕືອນຫຼືບໍ່"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>ສະຖານະ:</b> ເລື່ອນລະດັບເປັນຄ່າເລີ່ມຕົ້ນແລ້ວ"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>ສະຖານະ:</b> ຫຼຸດລະດັບເປັນປິດສຽງແລ້ວ"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>ສະຖານະ:</b> ມີອັນດັບສູງຂຶ້ນແລ້ວ"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>ສະຖານະ:</b> ມີອັນດັບຕ່ຳລົງແລ້ວ"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"ສະແດງຢູ່ເທິງສຸດຂອງພາກສ່ວນການສົນທະນາ, ປາກົດເປັນ bubble ແບບລອຍ, ສະແດງຮູບໂປຣໄຟລ໌ຢູ່ໜ້າຈໍລັອກ"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"ຕັ້ງຄ່າ"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"ສຳຄັນ"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"ແອັບນີ້ກຳລັງສະແດງຜົນບັງແອັບອື່ນຢູ່ໜ້າຈໍຂອງທ່ານ ແລະ ກຳລັງໃຊ້ໄມໂຄຣໂຟນ ແລະ ກ້ອງຖ່າຍຮູບຢູ່."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"ການຕັ້ງຄ່າ"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ຕົກລົງ"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"ການແຈ້ງເຕືອນນີ້ <b>ຖືກເລື່ອນລະດັບເປັນຄ່າເລີ່ມຕົ້ນອັດຕະໂນມັດແລ້ວ</b> ໂດຍລະບົບ."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"ການແຈ້ງເຕືອນນີ້ <b>ຖືກຫຼຸດລະດັບເປັນປິດສຽງອັດຕະໂນມັດແລ້ວ</b> ໂດຍລະບົບ."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"ການແຈ້ງເຕືອນນີ້ <b>ມີອັນດັບສູງຂຶ້ນໂດຍອັດຕະໂນມັດແລ້ວ</b> ໃນໜ້າການແຈ້ງເຕືອນຂອງທ່ານ."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"ການແຈ້ງເຕືອນນີ້ <b>ມີອັນດັບຕ່ຳລົງໂດຍອັດຕະໂນມັດແລ້ວ</b> ໃນໜ້າການແຈ້ງເຕືອນຂອງທ່ານ."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"ສິ່ງນີ້ບໍ່ຖືກຕ້ອງບໍ?"</string>
<string name="feedback_response" msgid="4671729244976641339">"ຂອບໃຈສຳລັບຄຳເຫັນຂອງທ່ານ!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ຕົກລົງ"</string>
diff --git a/packages/SystemUI/res/values-lt/strings.xml b/packages/SystemUI/res/values-lt/strings.xml
index 7cb83b9..17d517c 100644
--- a/packages/SystemUI/res/values-lt/strings.xml
+++ b/packages/SystemUI/res/values-lt/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Ekrano kopijos išsaugoti nepavyko"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Jūsų organizacijoje arba naudojant šią programą neleidžiama daryti ekrano kopijų"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Redaguoti"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Redaguoti ekrano kopiją"</string>
@@ -530,7 +530,7 @@
<string name="disable_vpn" msgid="482685974985502922">"Išjungti VPN"</string>
<string name="disconnect_vpn" msgid="26286850045344557">"Atjungti VPN"</string>
<string name="monitoring_button_view_policies" msgid="3869724835853502410">"Žr. politiką"</string>
- <string name="monitoring_button_view_controls" msgid="8316440345340701117">"Rodinio valdikliai"</string>
+ <string name="monitoring_button_view_controls" msgid="8316440345340701117">"Peržiūrėti valdiklius"</string>
<string name="monitoring_description_named_management" msgid="505833016545056036">"Šis įrenginys priklauso „<xliff:g id="ORGANIZATION_NAME">%1$s</xliff:g>“.\n\nIT administratorius gali stebėti ir tvarkyti nustatymus, įmonės prieigą, programas, su įrenginiu susietus duomenis ir įrenginio vietovės informaciją.\n\nDaugiau informacijos galite gauti susisiekę su IT administratoriumi."</string>
<string name="monitoring_description_management" msgid="4308879039175729014">"Šis įrenginys priklauso jūsų organizacijai.\n\nIT administratorius gali stebėti ir tvarkyti nustatymus, įmonės prieigą, programas, su įrenginiu susietus duomenis ir įrenginio vietovės informaciją.\n\nDaugiau informacijos galite gauti susisiekę su IT administratoriumi."</string>
<string name="monitoring_description_management_ca_certificate" msgid="7785013130658110130">"Jūsų organizacija įdiegė šiame įrenginyje sertifikato įgaliojimą. Jūsų saugaus tinklo srautas gali būti stebimas arba keičiamas."</string>
@@ -704,14 +704,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Gali skambėti arba vibruoti, atsižvelgiant į telefono nustatymus. Pokalbiai iš „<xliff:g id="APP_NAME">%1$s</xliff:g>“ debesėlio pagal numatytuosius nustatymus."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Naudojant slankųjį spartųjį klavišą lengviau sutelkti dėmesį į šį turinį."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Nustatykite, kad sistema aptiktų, ar šis pranešimas turi skambėti, ar vibruoti"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Būsena:</b> pakeista į numatytąjį lygį"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Būsena:</b> pakeista į begarsį lygį"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Būsenos:</b> reitingas padidintas"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Būsenos:</b> reitingas sumažintas"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Rodoma pokalbių skilties viršuje, rodoma kaip slankusis burbulas, pateikiama profilio nuotrauka užrakinimo ekrane"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Nustatymai"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritetiniai"</string>
@@ -730,14 +726,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Ši programa rodoma ekrane virš kitų programų, ji naudoja mikrofoną ir fotoaparatą."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Nustatymai"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Gerai"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Šio pranešimo svarbą sistema automatiškai <b>padidino iki numatytojo lygio</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Šio pranešimo svarbą sistema automatiškai <b>sumažino iki begarsio lygio</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Šio pranešimo reitingas pranešimų skydelyje automatiškai <b>padidintas</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Šio pranešimo reitingas pranešimų skydelyje automatiškai <b>sumažintas</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Ar tai teisinga?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Dėkojame už atsiliepimą!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"Gerai"</string>
diff --git a/packages/SystemUI/res/values-lv/strings.xml b/packages/SystemUI/res/values-lv/strings.xml
index 2d6a509..6fd32b59 100644
--- a/packages/SystemUI/res/values-lv/strings.xml
+++ b/packages/SystemUI/res/values-lv/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Nevar saglabāt ekrānuzņēmumu"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Lietotne vai jūsu organizācija neatļauj veikt ekrānuzņēmumus."</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Rediģēt"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Rediģēt ekrānuzņēmumu"</string>
@@ -701,14 +701,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Atkarībā no tālruņa iestatījumiem var zvanīt vai vibrēt. Sarunas no lietotnes <xliff:g id="APP_NAME">%1$s</xliff:g> pēc noklusējuma tiek parādītas burbulī."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Piesaista jūsu uzmanību, rādot peldošu saīsni uz šo saturu."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Iestatiet, lai sistēma noteiktu, vai šim paziņojumam būs skaņa vai vibrācija"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Statuss:</b> svarīgums paaugstināts līdz noklusējumam"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Statuss:</b> svarīgums pazemināts, un paziņojums tiks rādīts bez skaņas"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Statuss:</b> rangs paaugstināts"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Statuss:</b> rangs pazemināts"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Parādās sarunu sadaļas augšdaļā un kā peldošs burbulis, kā arī bloķēšanas ekrānā tiek rādīts profila attēls"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Iestatījumi"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritārs"</string>
@@ -727,14 +723,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Šī lietotne tiek rādīta ekrānā pāri citām lietotnēm, un tajā tiek izmantots mikrofons un kamera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Iestatījumi"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Labi"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Šī paziņojuma svarīgums sistēmā tika automātiski <b>paaugstināts līdz noklusējumam</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Šī paziņojuma svarīgums sistēmā tika automātiski <b>pazemināts, un paziņojums tiks rādīts bez skaņas</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Šī paziņojums rangs paziņojumu panelī tika automātiski <b>paaugstināts</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Šī paziņojuma rangs paziņojumu panelī tika automātiski <b>pazemināts</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Vai šī informācija ir pareiza?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Paldies par atsauksmēm!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"Labi"</string>
diff --git a/packages/SystemUI/res/values-mk/strings.xml b/packages/SystemUI/res/values-mk/strings.xml
index 2168279..51f9b8c 100644
--- a/packages/SystemUI/res/values-mk/strings.xml
+++ b/packages/SystemUI/res/values-mk/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Не може да се зачува слика од екранот"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Апликацијата или вашата организација не дозволува снимање слики од екранот"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Измени"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Изменете ја сликата од екранот"</string>
@@ -548,7 +548,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"Вашиот администратор вклучил евиденција на мрежата, што подразбира следење на сообраќајот на вашиот уред.\n\nЗа повеќе информации, контактирајте со администраторот."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"Дозволивте апликацијата да постави поврзување преку ВПН.\n\nАпликацијата може да го следи уредот и активноста на мрежата, вклучувајќи ги е-пораките, апликациите и веб-локациите."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"<xliff:g id="ORGANIZATION">%1$s</xliff:g> управува со вашиот работен профил.\n\nАдминистратор е во можност да ја следи вашата активност на мрежата, вклучувајќи ги е-пораките, апликациите и веб-локациите.\n\nЗа повеќе информации, контактирајте со администраторот.\n\nYИсто така, поврзани сте на VPN којашто може да ја следи вашата активност на мрежата."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Родителот управува со уредов. Родителот може да прегледува и управува со податоците, како што се апликациите што ги користите, вашата локација и време поминато на уредот."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Родителот управува со уредов. Родителот може да прегледува и управува со податоците, како што се апликациите што ги користиш, твојата локација и времето поминато на уредот."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"ВПН"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"Поврзани сте на <xliff:g id="APPLICATION">%1$s</xliff:g>, што може да ја следи вашата активност на мрежата, заедно со е-пораките, апликациите и веб-сајтовите."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"Поврзани сте на <xliff:g id="APPLICATION">%1$s</xliff:g>, којашто може да ја следи вашата лична активност на мрежата, вклучувајќи ги е-пораките, апликациите и веб-локациите."</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Може да ѕвони или вибрира во зависност од поставките на телефонот Стандардно, разговорите од <xliff:g id="APP_NAME">%1$s</xliff:g> се во балончиња."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Ви го задржува вниманието со лебдечка кратенка на содржинава."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Дозволете системот да определи дали известувањево треба да испушти звук или да вибрира"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Статус:</b> поставено на „Стандардно“"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Статус:</b> намалено на „Тивко“"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Статус:</b> рангирано повисоко"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Статус:</b> рангирано пониско"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Се појавува на горниот дел од секцијата на разговорот во вид на лебдечко меурче, покажувајќи ја профилната слика на заклучениот екран"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Поставки"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Приоритетно"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Апликацијава се прикажува врз други апликации на вашиот екран и ги користи микрофонот и камерата."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Поставки"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Во ред"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Известувањево беше автоматски <b>поставено на „Стандардно“</b> од страна на системот."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Известувањево беше автоматски <b>намалено на „Тивко“</b> од страна на системот."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Известувањево беше автоматски <b>рангирано повисоко</b> во нијансите за известувања."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Известувањево беше автоматски <b>рангирано пониско</b> во нијансите за известувања."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Дали ова беше точно?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Фала за повратните информации!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"Во ред"</string>
diff --git a/packages/SystemUI/res/values-ml/strings.xml b/packages/SystemUI/res/values-ml/strings.xml
index 3cbb8e7..534faa7 100644
--- a/packages/SystemUI/res/values-ml/strings.xml
+++ b/packages/SystemUI/res/values-ml/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"സ്ക്രീൻഷോട്ട് സംരക്ഷിക്കാനാകുന്നില്ല"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"സ്ക്രീൻഷോട്ടുകൾ എടുക്കുന്നത് ആപ്പോ നിങ്ങളുടെ സ്ഥാപനമോ അനുവദിക്കുന്നില്ല"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"എഡിറ്റ് ചെയ്യുക"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"സ്ക്രീൻഷോട്ട് എഡിറ്റ് ചെയ്യുക"</string>
@@ -548,7 +548,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"നിങ്ങളുടെ ഉപകരണത്തിലെ ട്രാഫിക്ക് നിരീക്ഷിക്കുന്ന നെറ്റ്വർക്ക് ലോഗിംഗ് അഡ്മിൻ ഓണാക്കിയിട്ടുണ്ട്.\n\nകൂടുതൽ വിവരങ്ങൾക്ക് അഡ്മിനുമായി ബന്ധപ്പെടുക."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"VPN കണക്ഷൻ സജ്ജീകരിക്കാൻ നിങ്ങൾ ഒരു ആപ്പിന് അനുമതി നൽകി.\n\nഈ ആപ്പിന് നിങ്ങളുടെ ഇമെയിലുകളും ആപ്സും വെബ്സൈറ്റുകളും ഉൾപ്പെടെ, ഉപകരണവും നെറ്റ്വർക്ക് പ്രവർത്തനവും നിരീക്ഷിക്കാൻ കഴിയും."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"നിങ്ങളുടെ ഔദ്യോഗിക പ്രൊഫൈൽ നിയന്ത്രിക്കുന്നത് <xliff:g id="ORGANIZATION">%1$s</xliff:g> ആണ്.\n\nഇമെയിലുകൾ, ആപ്സ്, വെബ്സൈറ്റുകൾ എന്നിവയടങ്ങുന്ന നിങ്ങളുടെ നെറ്റ്വർക്ക് ആക്റ്റിവിറ്റി നിരീക്ഷിക്കാൻ അഡ്മിന് കഴിയും.\n\nകൂടുതൽ വിവരങ്ങൾക്ക് അഡ്മിനുമായി ബന്ധപ്പെടുക.\n\nനെറ്റ്വർക്ക് ആക്റ്റിവിറ്റി നിരീക്ഷിക്കാൻ സാധിക്കുന്ന ഒരു VPN-ലേക്ക് കൂടി നിങ്ങൾ കണക്റ്റ് ചെയ്യപ്പെട്ടിരിക്കുന്നു."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"ഈ ഉപകരണം മാനേജ് ചെയ്യുന്നത് നിങ്ങളുടെ രക്ഷിതാവാണ്. നിങ്ങൾ ഉപയോഗിക്കുന്ന ആപ്പുകൾ, സ്ക്രീൻ സമയം, ലൊക്കേഷൻ എന്നിവ പോലുള്ള വിവരങ്ങൾ നിങ്ങളുടെ രക്ഷിതാവിന് കാണാം, നിയന്ത്രിക്കാം."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"ഈ ഉപകരണം മാനേജ് ചെയ്യുന്നത് നിങ്ങളുടെ രക്ഷിതാവാണ്. നിങ്ങൾ ഉപയോഗിക്കുന്ന ആപ്പുകൾ, സ്ക്രീൻ സമയം, ലൊക്കേഷൻ എന്നിവ പോലുള്ള വിവരങ്ങൾ നിങ്ങളുടെ രക്ഷിതാവിന് കാണാനും നിയന്ത്രിക്കാനുമാകും."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"VPN"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"നിങ്ങൾ <xliff:g id="APPLICATION">%1$s</xliff:g> ആപ്പിലേക്ക് കണക്റ്റുചെയ്തിരിക്കുന്നു, അതിന് ഇമെയിലുകൾ, ആപ്പുകൾ, വെബ്സൈറ്റുകൾ എന്നിവ ഉൾപ്പെടെ നിങ്ങളുടെ നെറ്റ്വർക്ക് ആക്റ്റിവിറ്റി നിരീക്ഷിക്കാനാകും."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"നിങ്ങൾ <xliff:g id="APPLICATION">%1$s</xliff:g> എന്നതിലേക്ക് കണക്റ്റുചെയ്തിരിക്കുന്നു, അതിന് ഇമെയിലുകൾ, ആപ്സ്, വെബ്സൈറ്റുകൾ എന്നിവ ഉൾപ്പെടെ നിങ്ങളുടെ സ്വകാര്യ നെറ്റ്വർക്ക് പ്രവർത്തനം നിരീക്ഷിക്കാനാകും."</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"ഫോൺ ക്രമീകരണം അടിസ്ഥാനമാക്കി റിംഗ് ചെയ്തേക്കാം അല്ലെങ്കിൽ വൈബ്രേറ്റ് ചെയ്തേക്കാം. <xliff:g id="APP_NAME">%1$s</xliff:g>-ൽ നിന്നുള്ള സംഭാഷണങ്ങൾ ഡിഫോൾട്ടായി ബബ്ൾ ആവുന്നു."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"ഈ ഉള്ളടക്കത്തിലേക്ക് ഒരു ഫ്ലോട്ടിംഗ് കുറുക്കുവഴി ഉപയോഗിച്ച് നിങ്ങളുടെ ശ്രദ്ധ നിലനിർത്തുന്നു."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"ഈ അറിയിപ്പ് വരുമ്പോൾ ശബ്ദിക്കുകയാണോ വൈബ്രേറ്റ് ചെയ്യുകയാണോ വേണ്ടതെന്ന് നിർണ്ണയിക്കാൻ സിസ്റ്റത്തെ അനുവദിക്കുക"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>നില:</b> ഡിഫോൾട്ടാക്കി പ്രമോട്ട് ചെയ്തു"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>നില:</b> നിശബ്ദമാക്കി തരം താഴ്ത്തി"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>നില:</b> ഉയർന്ന റാങ്കിംഗ് നൽകി"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>നില:</b> താഴ്ന്ന റാങ്കിംഗ് നൽകി"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"സംഭാഷണ വിഭാഗത്തിന് മുകളിലായി കാണിക്കുന്നു, ഫ്ലോട്ടിംഗ് ബബിളായി ദൃശ്യമാകുന്നു, ലോക്ക് സ്ക്രീനിൽ പ്രൊഫൈൽ ചിത്രം പ്രദർശിപ്പിക്കുന്നു"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"ക്രമീകരണം"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"മുൻഗണന"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"ഈ ആപ്പ് നിങ്ങളുടെ സ്ക്രീനിലെ മറ്റ് ആപ്പുകൾക്ക് മുകളിൽ പ്രദർശിപ്പിക്കുന്നു, മൈക്രോഫോണും ക്യാമറയും ഉപയോഗിക്കുകയും ചെയ്യുന്നു."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"ക്രമീകരണം"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ശരി"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"ഈ അറിയിപ്പ്, സിസ്റ്റം സ്വയമേവ <b>ഡിഫോൾട്ടാക്കി പ്രമോട്ട് ചെയ്തു</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"ഈ അറിയിപ്പ്, സിസ്റ്റം സ്വയമേവ <b>നിശബ്ദമാക്കി തരം താഴ്ത്തി</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"ഈ അറിയിപ്പിന് നിങ്ങളുടെ ഷെയ്ഡിൽ സ്വയമേവ <b>ഉയർന്ന റാങ്കിംഗ് നൽകി</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"ഈ അറിയിപ്പിന് നിങ്ങളുടെ ഷെയ്ഡിൽ സ്വയമേവ <b>താഴ്ന്ന റാങ്കിംഗ് നൽകി</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"ഇത് ശരിയായിരുന്നോ?"</string>
<string name="feedback_response" msgid="4671729244976641339">"നിങ്ങളുടെ ഫീഡ്ബാക്കിന് നന്ദി!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ശരി"</string>
diff --git a/packages/SystemUI/res/values-mn/strings.xml b/packages/SystemUI/res/values-mn/strings.xml
index 9ce77ef..190e3e5 100644
--- a/packages/SystemUI/res/values-mn/strings.xml
+++ b/packages/SystemUI/res/values-mn/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Дэлгэцийн агшныг хадгалах боломжгүй"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Таны апп, байгууллагад дэлгэцийн зураг авахыг зөвшөөрдөггүй"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Засах"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Дэлгэцийн агшныг засах"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Утасны тохиргоонд тулгуурлан хонх дуугаргах эсвэл чичирхийлж болзошгүй. <xliff:g id="APP_NAME">%1$s</xliff:g>-н харилцан яриаг өгөгдмөл тохиргооны дагуу бөмбөлөг болгоно."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Энэ контентын хөвөн гарч ирэх товчлолтойгоор таны анхаарлыг татдаг."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Энэ мэдэгдэл дуу гаргах эсвэл чичрэх эсэхийг системээр тодорхойлуулаарай"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Төлөв:</b> Өгөгдмөл болгож дэвшүүлсэн"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Төлөв:</b> Чимээгүй болгож зэрэглэлийг нь бууруулсан"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Төлөв:</b> Дээгүүр зэрэглэл хийсэн"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Төлөв:</b> Доогуур зэрэглэл хийсэн"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Харилцан ярианы хэсгийн дээд талд хөвж буй бөмбөлөг хэлбэрээр харагдах бөгөөд профайлын зургийг түгжигдсэн дэлгэцэд үзүүлнэ"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Тохиргоо"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Ач холбогдол"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Энэ аппыг таны дэлгэцэд бусад аппын дээр харуулж байгаа бөгөөд микрофон болон камерыг ашиглаж байна."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Тохиргоо"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ОК"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Энэ мэдэгдлийг систем автоматаар <b>Өгөгдмөл болгож дэвшүүлсэн</b> байна."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Энэ мэдэгдлийг систем автоматаар <b>Чимээгүй болгож зэрэглэлийг нь бууруулсан</b> байна."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Энэ мэдэгдлийг таны хураангуй самбарт автоматаар <b>дээгүүр зэрэглэл хийсэн</b> байна."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Энэ мэдэгдлийг таны хураангуй самбарт автоматаар <b>доогуур зэрэглэл хийсэн</b> байна."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Энэ зөв байсан уу?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Санал хүсэлтээ илгээсэнд баярлалаа!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ОК"</string>
diff --git a/packages/SystemUI/res/values-mr/strings.xml b/packages/SystemUI/res/values-mr/strings.xml
index ed4b7f4..1f2e82e 100644
--- a/packages/SystemUI/res/values-mr/strings.xml
+++ b/packages/SystemUI/res/values-mr/strings.xml
@@ -63,7 +63,7 @@
<string name="usb_debugging_allow" msgid="1722643858015321328">"अनुमती द्या"</string>
<string name="usb_debugging_secondary_user_title" msgid="7843050591380107998">"USB डीबग करण्यास अनुमती नाही"</string>
<string name="usb_debugging_secondary_user_message" msgid="3740347841470403244">"सध्या या डीव्हाइसमध्ये साइन इन केलेला वापरकर्ता USB डीबग करणे सुरू करू शकत नाही. हे वैशिष्ट्य वापरण्यासाठी, प्राथमिक वापरकर्त्यावर स्विच करा."</string>
- <string name="wifi_debugging_title" msgid="7300007687492186076">"या नेटवर्कवर वायरलेस डीबगिंग करण्याला अनुमती द्यायची का?"</string>
+ <string name="wifi_debugging_title" msgid="7300007687492186076">"या नेटवर्कवर वायरलेस डीबगिंग करण्यासाठी अनुमती द्यायची का?"</string>
<string name="wifi_debugging_message" msgid="5461204211731802995">"नेटवर्कचे नाव (SSID)\n<xliff:g id="SSID_0">%1$s</xliff:g>\n\nवाय-फाय ॲड्रेस (BSSID)\n<xliff:g id="BSSID_1">%2$s</xliff:g>"</string>
<string name="wifi_debugging_always" msgid="2968383799517975155">"या नेटवर्कवर नेहमी अनुमती द्या"</string>
<string name="wifi_debugging_allow" msgid="4573224609684957886">"अनुमती द्या"</string>
@@ -85,7 +85,8 @@
<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>
+ <!-- no translation found for screenshot_failed_to_save_text (7232739948999195960) -->
+ <skip />
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"अॅप किंवा आपल्या संस्थेद्वारे स्क्रीनशॉट घेण्याची अनुमती नाही"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"संपादित करा"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"स्क्रीनशॉट संपादित करा"</string>
@@ -698,14 +699,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"फोन सेटिंग्जच्या आधारावर रिंग किंवा व्हायब्रेट होऊ शकतो. <xliff:g id="APP_NAME">%1$s</xliff:g> मधील संभाषणे बाय डीफॉल्ट बबल होतात."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"या आशयाच्या फ्लोटिंग शॉर्टकटसह तुमचे लक्ष केंद्रित करते."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"ही सूचना मिळाल्यावर आवाज व्हावा की व्हायब्रेशन व्हावे ते सिस्टममध्ये नमूद करा"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>स्थिती</b> ही डीफॉल्ट म्हणून प्रमोट केली गेली"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>स्थिती</b> ला सायलंट म्हणून डीमोट केले गेले"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>स्थिती</b> ला थोडे जास्त म्हणून रँक केले गेले"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>स्थिती</b> ला थोडी कमी म्हणून रँक केले गेले"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"संभाषण विभागात सर्वात वरती फ्लोटिंग बबल म्हणून दिसते, लॉक स्क्रीनवर प्रोफाइल पिक्चर दाखवते"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"सेटिंग्ज"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"प्राधान्य"</string>
@@ -724,14 +721,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"हे अॅप तुमच्या स्क्रीनवरील इतर अॅप्स वर प्रदर्शित होत आहे आणि मायक्रोफोन आणि कॅमेरा वापरत आहे."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"सेटिंग्ज"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ओके"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"सिस्टमद्वारे ही सूचना आपोआप <b>डीफॉल्ट वर प्रमोट केली</b> गेली."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"सिस्टमद्वारे या सूचनेला आपोआप <b>सायलंट म्हणून डीमोट केले</b> गेले."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"तुमच्या रंगछटेमध्ये या सूचनेला आपोआप <b>थोडी जास्त</b> म्हणून रँक केले गेले."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"तुमच्या रंगछटेमध्ये या सूचनेला आपोआप <b>थोडी कमी</b> म्हणून रँक केले गेले."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"हे बरोबर होते का?"</string>
<string name="feedback_response" msgid="4671729244976641339">"तुमच्या फीडबॅकबद्दल धन्यवाद!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ओके"</string>
diff --git a/packages/SystemUI/res/values-ms/strings.xml b/packages/SystemUI/res/values-ms/strings.xml
index e03de37..17fe32d 100644
--- a/packages/SystemUI/res/values-ms/strings.xml
+++ b/packages/SystemUI/res/values-ms/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Tidak dapat menyimpan tangkapan skrin"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Pengambilan tangkapan skrin tidak dibenarkan oleh apl atau organisasi anda"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Edit"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Edit tangkapan skrin"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Mungkin berbunyi atau bergetar berdasarkan tetapan telefon. Perbualan daripada gelembung <xliff:g id="APP_NAME">%1$s</xliff:g> secara lalai."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Memastikan anda memberikan perhatian dengan pintasan terapung ke kandungan ini."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Minta sistem menentukan jika pemberitahuan ini patut menghasilkan bunyi atau getaran"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> Dinaikkan Taraf kepada Lalai"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> Diturunkan Taraf kepada Senyap"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> Dinilai Lebih Tinggi"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> Dinilai Lebih Rendah"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Ditunjukkan di sebelah atas bahagian perbualan, muncul sebagai gelembung terapung, memaparkan gambar profil pada skrin kunci"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Tetapan"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Keutamaan"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Apl ini dipaparkan di atas apl lain pada skrin anda dan sedang menggunakan mikrofon dan kamera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Tetapan"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Pemberitahuan ini secara automatik <b>dinaikkan taraf kepada Lalai</b> oleh sistem."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Pemberitahuan ini secara automatik <b&gtditurunkan taraf kepada Senyap</b> oleh sistem."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Pemberitahuan ini secara automatik <b>dinilai lebih tinggi</b> dalam rona warna anda."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Pemberitahuan ini secara automatik <b>dinilai lebih rendah</b> dalam rona warna anda."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Adakah ini betul?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Terima kasih atas maklum balas anda!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-my/strings.xml b/packages/SystemUI/res/values-my/strings.xml
index 50154ba..610105e 100644
--- a/packages/SystemUI/res/values-my/strings.xml
+++ b/packages/SystemUI/res/values-my/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"ဖန်သားပြင်ဓာတ်ပုံကို သိမ်း၍မရပါ"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ဖန်သားပြင်ဓာတ်ပုံရိုက်ကူးခြင်းကို ဤအက်ပ် သို့မဟုတ် သင်၏အဖွဲ့အစည်းက ခွင့်မပြုပါ"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"တည်းဖြတ်ရန်"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"ဖန်သားပြင်ဓာတ်ပုံကို တည်းဖြတ်သည်"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"ဖုန်းဆက်တင်များပေါ် အခြေခံပြီး အသံမြည်နိုင်သည် သို့မဟုတ် တုန်ခါနိုင်သည်။ မူရင်းသတ်မှတ်ချက်အဖြစ် <xliff:g id="APP_NAME">%1$s</xliff:g> မှ စကားဝိုင်းများကို ပူဖောင်းကွက်ဖြင့် ပြသည်။"</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"အကြောင်းအရာကို floating shortcut ကိုသုံး၍ အာရုံစိုက်လာအောင်လုပ်ပါ။"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"ဤအကြောင်းကြားချက်က အသံ သို့မဟုတ် တုန်ခါမှု ပေးရန် သင့်/မသင့်ကို စနစ်က ဆုံးဖြတ်ပါစေ"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>အခြေအနေ-</b> မူရင်းသို့ ချိန်ညှိထားသည်"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>အခြေအနေ-</b> အသံတိတ်ခြင်းသို့ ပြန်ချိန်ညှိထားသည်"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>အခြေအနေ-</b> အဆင့်တိုးထားသည်"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>အခြေအနေ-</b> အဆင့်လျှော့ထားသည်"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"စကားဝိုင်းကဏ္ဍ၏ ထိပ်ပိုင်းတွင် ပြပြီး ပူဖောင်းကွက်အဖြစ် မြင်ရသည်၊ လော့ခ်ချထားချိန် မျက်နှာပြင်တွင် ပရိုဖိုင်ပုံကို ပြသည်"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"ဆက်တင်များ"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"ဦးစားပေး"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"ဤအက်ပ်က မိုက်ခရိုဖုန်းနှင့် ကင်မရာကို အသုံးပြု၍ ဖန်သားမျက်နှာပြင်ပေါ်ရှိ အခြားအက်ပ်များ အပေါ်မှ ထပ်ပြီး ပြသနေပါသည်။"</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"ဆက်တင်များ"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"ဤအကြောင်းကြားချက်ကို စနစ်က အလိုအလျောက် <b>မူရင်းသို့ ချိန်ညှိထားသည်</b>။"</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"ဤအကြောင်းကြားချက်ကို စနစ်က အလိုအလျောက် <b>အသံတိတ်ခြင်းသို့ ပြန်ချိန်ညှိထားသည်</b>။"</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"ဤအကြောင်းကြားချက်ကို သင့်အကြောင်းကြားစာအကွက်တွင် အလိုအလျောက် <b>အဆင့်တိုးထားသည်</b>။"</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"ဤအကြောင်းကြားချက်ကို သင့်အကြောင်းကြားစာအကွက်တွင် အလိုအလျောက် <b>အဆင့်လျှော့ထားသည်</b>။"</string>
<string name="feedback_prompt" msgid="2278631214125128281">"ဤအရာက မှန်ပါသလား။"</string>
<string name="feedback_response" msgid="4671729244976641339">"အကြံပြုချက်အတွက် ကျေးဇူးတင်ပါသည်"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-nb/strings.xml b/packages/SystemUI/res/values-nb/strings.xml
index 4147bc8..b16f1e7 100644
--- a/packages/SystemUI/res/values-nb/strings.xml
+++ b/packages/SystemUI/res/values-nb/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Kan ikke lagre skjermdumpen"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Appen eller organisasjonen din tillater ikke at du tar skjermdumper"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Rediger"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Rediger skjermdumpen"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Kan ringe eller vibrere basert på telefoninnstillingene. Samtaler fra <xliff:g id="APP_NAME">%1$s</xliff:g> lager bobler som standard."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Holder deg oppmerksom med en svevende snarvei til dette innholdet."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"La systemet velge om dette varselet skal lage lyd eller vibrere"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> Oppgradert til standard"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> Nedgradert til lydløst"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> Rangert høyere"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> Rangert lavere"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Vises øverst i samtaledelen, vises som en flytende boble, viser profilbildet på låseskjermen"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Innstillinger"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritet"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Denne appen vises over andre apper på skjermen, og bruker mikrofonen og kameraet."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Innstillinger"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Dette varselet ble automatisk <b>oppgradert til standard</b> av systemet."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Dette varselet ble automatisk <b>nedgradert til lydløst</b> av systemet."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Dette varselet ble automatisk <b>rangert høyere</b> i panelet."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Dette varselet ble automatisk <b>rangert lavere</b> i panelet."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Var det riktig?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Takk for tilbakemeldingen!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-ne/strings.xml b/packages/SystemUI/res/values-ne/strings.xml
index e4fbe93..fb4dca0 100644
--- a/packages/SystemUI/res/values-ne/strings.xml
+++ b/packages/SystemUI/res/values-ne/strings.xml
@@ -85,7 +85,8 @@
<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>
+ <!-- no translation found for screenshot_failed_to_save_text (7232739948999195960) -->
+ <skip />
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"उक्त एप वा तपाईंको संगठनले स्क्रिनसटहरू लिन दिँदैन"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"सम्पादन गर्नुहोस्"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"स्क्रिनसट सम्पादन गर्नुहोस्"</string>
@@ -698,14 +699,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"फोनको सेटिङका आधारमा घन्टी बज्न वा कम्पन हुन सक्छ। <xliff:g id="APP_NAME">%1$s</xliff:g> का वार्तालापहरू पूर्वनिर्धारित रूपमा बबलमा देखाइन्छन्।"</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"फ्लोटिङ सर्टकटमार्फत यो सामग्रीतर्फ तपाईंको ध्यान आकर्षित गर्दछ।"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"सिस्टमलाई यो सूचना आउँदा ध्वनि बज्नु पर्छ वा कम्पन हुनु पर्छ भन्ने कुराको निधो गर्न दिनुहोस्"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>स्थिति:</b> सूचनालाई महत्त्वपूर्ण ठानी पूर्वनिर्धारित मोडमा सेट गरिएको छ"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>स्थिति:</b> सूचनालाई कम महत्त्वपूर्ण ठानी साइलेन्ट मोडमा सेट गरिएको छ"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>स्थिति:</b> धेरै महत्त्वपूर्ण सूचनाका रूपमा सेट गरिएको छ"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>स्थिति:</b> कम महत्त्वपूर्ण सूचनाका रूपमा सेट गरिएको छ"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"वार्तालाप खण्डको सिरानमा देखा पर्छ, तैरने बबलका रूपमा देखा पर्छ, लक स्क्रिनमा प्रोफाइल फोटो देखाइन्छ"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"सेटिङ"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"प्राथमिकता"</string>
@@ -724,14 +721,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"यो अनुप्रयोगले तपाईंको स्क्रिनका अन्य एपमाथि प्रदर्शन गर्नुका साथै माइक्रोफोन र क्यामेराको प्रयोग गर्दै छ।"</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"सेटिङहरू"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ठिक छ"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"सिस्टमले स्वतः यस सूचनालाई <b>महत्त्वपूर्ण ठानी पूर्वनिर्धारित मोडमा</b> सेट गरिदियो।"</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"सिस्टमले स्वतः यस सूचनालाई <b>कम महत्त्वपूर्ण ठानी साइलेन्ट मोडमा</b> सेट गरिदियो।"</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"तपाईंको सेडमा यो सूचना स्वतः <b>धेरै महत्त्वपूर्ण सूचनाका रूपमा</b> सेट गरियो।"</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"तपाईंको सेडमा यो सूचना स्वतः <b>कम महत्त्वपूर्ण सूचनाका रूपमा</b> सेट गरियो।"</string>
<string name="feedback_prompt" msgid="2278631214125128281">"के यो सही थियो?"</string>
<string name="feedback_response" msgid="4671729244976641339">"तपाईंको प्रतिक्रियाका लागि धन्यवाद!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ठिक छ"</string>
diff --git a/packages/SystemUI/res/values-nl/strings.xml b/packages/SystemUI/res/values-nl/strings.xml
index 1871eef..a858a1d 100644
--- a/packages/SystemUI/res/values-nl/strings.xml
+++ b/packages/SystemUI/res/values-nl/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Kan screenshot niet opslaan"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Het maken van screenshots wordt niet toegestaan door de app of je organisatie"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Bewerken"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Screenshot bewerken"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Kan overgaan of trillen op basis van de telefooninstellingen. Gesprekken uit <xliff:g id="APP_NAME">%1$s</xliff:g> worden standaard als bubbels weergegeven."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Trekt de aandacht met een zwevende snelkoppeling naar deze content."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Het systeem laten bepalen of deze melding geluid moet maken of moet trillen"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> opgeschaald naar Standaard"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> verlaagd naar Stil"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> hoger gerangschikt"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> lager gerangschikt"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Wordt bovenaan het gespreksgedeelte weergegeven, verschijnt als zwevende bubbel, geeft profielfoto weer op vergrendelscherm"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Instellingen"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioriteit"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Deze app geeft andere apps op je scherm weer en gebruikt de microfoon en camera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Instellingen"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Deze melding is automatisch <b>opgeschaald naar Standaard</b> door het systeem."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Deze melding is automatisch <b>verlaagd naar Stil</b> door het systeem."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Deze melding is automatisch <b>hoger gerangschikt</b> in je meldingenpaneel."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Deze melding is automatisch <b>lager gerangschikt</b> in je meldingenpaneel."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Is dit juist?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Bedankt voor je feedback."</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-or/strings.xml b/packages/SystemUI/res/values-or/strings.xml
index 601b8f4..4931b77 100644
--- a/packages/SystemUI/res/values-or/strings.xml
+++ b/packages/SystemUI/res/values-or/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"ସ୍କ୍ରିନସଟକୁ ସେଭ୍ କରାଯାଇପାରିବ ନାହିଁ"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ଆପ୍ କିମ୍ବା ସଂସ୍ଥା ଦ୍ୱାରା ସ୍କ୍ରୀନଶଟ୍ ନେବାକୁ ଅନୁମତି ଦିଆଯାଇ ନାହିଁ"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"ଏଡିଟ୍ କରନ୍ତୁ"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"ସ୍କ୍ରିନସଟ୍ ଏଡିଟ୍ କରନ୍ତୁ"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"ଫୋନ୍ ସେଟିଂସ୍ ଆଧାରରେ ରିଙ୍ଗ କିମ୍ବା ଭାଇବ୍ରେଟ୍ ହୋଇପାରେ। <xliff:g id="APP_NAME">%1$s</xliff:g>ରୁ ବାର୍ତ୍ତାଳାପଗୁଡ଼ିକ ଡିଫଲ୍ଟ ଭାବରେ ବବଲ୍ ହୁଏ।"</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"ଏହି ବିଷୟବସ୍ତୁ ପାଇଁ ଏକ ଭାସମାନ ସର୍ଟକଟ୍ ସହ ଆପଣଙ୍କର ଧ୍ୟାନ ଦିଅନ୍ତୁ।"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"ଏହି ବିଜ୍ଞପ୍ତି ପ୍ରାପ୍ତ ହେବା ସମୟରେ ସାଉଣ୍ଡ ହେବା ଉଚିତ ନା ଭାଇବ୍ରେସନ୍ ତାହା ସିଷ୍ଟମକୁ ସ୍ଥିର କରିବାକୁ ଦିଅନ୍ତୁ"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>ସ୍ଥିତି:</b> ଡିଫଲ୍ଟକୁ ପ୍ରମୋଟ୍ କରାଯାଇଛି"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>ସ୍ଥିତି:</b> ନୀରବକୁ ଡିମୋଟ୍ କରାଯାଇଛି"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>ସ୍ଥିତି:</b> ରେଙ୍କ ଉପରକୁ କରାଯାଇଛି"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>ସ୍ଥିତି:</b> ରେଙ୍କ ତଳକୁ କରାଯାଇଛି"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"ବାର୍ତ୍ତାଳାପ ବିଭାଗର ଶୀର୍ଷରେ ଦେଖାଏ, ଫ୍ଲୋଟିଂ ବବଲ୍ ଭାବେ ଦେଖାଯାଏ, ଲକ୍ ସ୍କ୍ରିନରେ ପ୍ରୋଫାଇଲ୍ ଛବି ଡିସପ୍ଲେ କରେ"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"ସେଟିଂସ୍"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"ପ୍ରାଥମିକତା"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"ଏହି ଆପ୍, ଆପଣଙ୍କର ସ୍କ୍ରୀନ୍ ଉପରେ ଥିବା ଅନ୍ୟ ଆପ୍ ଉପରେ ପ୍ରଦର୍ଶିତ ହେଉଛି ଏବଂ ମାଇକ୍ରୋଫୋନ୍ ଓ କ୍ୟାମେରା ବ୍ୟବହାର କରୁଛି।"</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"ସେଟିଂସ୍"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ଠିକ୍ ଅଛି"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"ସିଷ୍ଟମ୍ ଏହି ବିଜ୍ଞପ୍ତିକୁ ସ୍ୱଚାଳିତ ଭାବେ <b>ଡିଫଲ୍ଟକୁ ପ୍ରମୋଟ୍ କରିଛି</b>।"</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"ସିଷ୍ଟମ୍ ଏହି ବିଜ୍ଞପ୍ତିକୁ ସ୍ୱଚାଳିତ ଭାବେ <b>ନୀରବକୁ ଡିମୋଟ୍ କରିଛି</b>।"</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"ଆପଣଙ୍କ ସେଡରେ ସ୍ୱଚାଳିତ ଭାବେ ଏହି ବିଜ୍ଞପ୍ତିର <b>ରେଙ୍କ ଉପରକୁ</b> କରାଯାଇଛି।"</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"ଆପଣଙ୍କ ସେଡରେ ସ୍ୱଚାଳିତ ଭାବେ ଏହି ବିଜ୍ଞପ୍ତିର <b>ରେଙ୍କ ତଳକୁ</b> କରାଯାଇଛି।"</string>
<string name="feedback_prompt" msgid="2278631214125128281">"ଏହା ଠିକ୍ ଥିଲା କି?"</string>
<string name="feedback_response" msgid="4671729244976641339">"ଆପଣଙ୍କ ମତାମତ ପାଇଁ ଧନ୍ୟବାଦ!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ଠିକ୍ ଅଛି"</string>
diff --git a/packages/SystemUI/res/values-pa/strings.xml b/packages/SystemUI/res/values-pa/strings.xml
index b374a6e..a2ff2b2 100644
--- a/packages/SystemUI/res/values-pa/strings.xml
+++ b/packages/SystemUI/res/values-pa/strings.xml
@@ -85,7 +85,8 @@
<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>
+ <!-- no translation found for screenshot_failed_to_save_text (7232739948999195960) -->
+ <skip />
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ਐਪ ਜਾਂ ਤੁਹਾਡੀ ਸੰਸਥਾ ਵੱਲੋਂ ਸਕ੍ਰੀਨਸ਼ਾਟ ਲੈਣ ਦੀ ਇਜਾਜ਼ਤ ਨਹੀਂ ਦਿੱਤੀ ਗਈ ਹੈ"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"ਸੰਪਾਦਨ ਕਰੋ"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"ਸਕ੍ਰੀਨਸ਼ਾਟ ਦਾ ਸੰਪਾਦਨ ਕਰੋ"</string>
@@ -698,14 +699,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"ਫ਼ੋਨ ਸੈਟਿੰਗਾਂ ਦੇ ਆਧਾਰ \'ਤੇ ਘੰਟੀ ਵੱਜ ਸਕਦੀ ਹੈ ਜਾਂ ਥਰਥਰਾਹਟ ਹੋ ਸਕਦੀ ਹੈ। ਪੂਰਵ-ਨਿਰਧਾਰਤ ਤੌਰ \'ਤੇ <xliff:g id="APP_NAME">%1$s</xliff:g> ਬਬਲ ਤੋਂ ਗੱਲਾਂਬਾਤਾਂ।"</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"ਇਸ ਸਮੱਗਰੀ ਦੇ ਅਸਥਿਰ ਸ਼ਾਰਟਕੱਟ ਨਾਲ ਆਪਣਾ ਧਿਆਨ ਕੇਂਦਰਿਤ ਰੱਖੋ।"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"ਸਿਸਟਮ ਨੂੰ ਨਿਰਧਾਰਤ ਕਰਨ ਦਿਓ ਕਿ ਇਸ ਸੂਚਨਾ ਲਈ ਕੋਈ ਧੁਨੀ ਵਜਾਉਣੀ ਚਾਹੀਦੀ ਹੈ ਜਾਂ ਥਰਥਰਾਹਟ ਕਰਨੀ ਚਾਹੀਦੀ ਹੈ"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>ਸਥਿਤੀ:</b> ਦਰਜਾ ਵਧਾ ਕੇ ਪੂਰਵ-ਨਿਰਧਾਰਤ \'ਤੇ ਸੈੱਟ ਕੀਤਾ ਗਿਆ"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>ਸਥਿਤੀ:</b> ਦਰਜਾ ਘਟਾ ਕੇ ਸ਼ਾਂਤ \'ਤੇ ਸੈੱਟ ਕੀਤਾ ਗਿਆ"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>ਸਥਿਤੀ:</b> ਦਰਜਾ ਵਧਾਇਆ ਗਿਆ"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>ਸਥਿਤੀ:</b> ਦਰਜਾ ਘਟਾਇਆ ਗਿਆ"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"ਗੱਲਬਾਤ ਸੈਕਸ਼ਨ ਦੇ ਸਿਖਰ \'ਤੇ ਦਿਖਾਈਆਂ ਜਾਂਦੀਆਂ ਹਨ, ਬਬਲ ਵਜੋਂ ਦਿਸਦੀਆਂ ਹਨ, ਲਾਕ ਸਕ੍ਰੀਨ \'ਤੇ ਪ੍ਰੋਫਾਈਲ ਤਸਵੀਰ ਦਿਖਾਈ ਜਾਂਦੀ ਹੈ"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"ਸੈਟਿੰਗਾਂ"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"ਤਰਜੀਹ"</string>
@@ -724,14 +721,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"ਇਹ ਐਪ ਤੁਹਾਡੀ ਸਕ੍ਰੀਨ \'ਤੇ ਹੋਰਾਂ ਐਪਾਂ ਉੱਪਰ ਦਿਖਾਈ ਜਾ ਰਹੀ ਹੈ ਅਤੇ ਮਾਈਕ੍ਰੋਫ਼ੋਨ ਅਤੇ ਕੈਮਰੇ ਦੀ ਵਰਤੋਂ ਕਰ ਰਹੀ ਹੈ।"</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"ਸੈਟਿੰਗਾਂ"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ਠੀਕ ਹੈ"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"ਸਿਸਟਮ ਨੇ ਇਸ ਸੂਚਨਾ ਦਾ ਸਵੈਚਲਿਤ ਤੌਰ \'ਤੇ <b>ਦਰਜਾ ਵਧਾ ਕੇ ਪੂਰਵ-ਨਿਰਧਾਰਤ</b> \'ਤੇ ਸੈੱਟ ਕਰ ਦਿੱਤਾ ਹੈ।"</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"ਸਿਸਟਮ ਨੇ ਇਸ ਸੂਚਨਾ ਦਾ ਸਵੈਚਲਿਤ ਤੌਰ \'ਤੇ <b>ਦਰਜਾ ਘਟਾ ਕੇ ਸ਼ਾਂਤ</b> \'ਤੇ ਸੈੱਟ ਕਰ ਦਿੱਤਾ ਗਿਆ ਸੀ।"</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"ਤੁਹਾਡੇ ਸ਼ੇਡ ਵਿੱਚ ਇਸ ਸੂਚਨਾ ਦਾ ਸਵੈਚਲਿਤ ਤੌਰ \'ਤੇ <b>ਦਰਜਾ ਉੱਪਰ</b> ਕਰ ਦਿੱਤਾ ਗਿਆ ਸੀ।"</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"ਤੁਹਾਡੇ ਸ਼ੇਡ ਵਿੱਚ ਇਸ ਸੂਚਨਾ ਦਾ ਸਵੈਚਲਿਤ ਤੌਰ \'ਤੇ <b>ਦਰਜਾ ਹੇਠਾਂ</b> ਕਰ ਦਿੱਤਾ ਗਿਆ ਸੀ।"</string>
<string name="feedback_prompt" msgid="2278631214125128281">"ਕੀ ਇਹ ਸਹੀ ਸੀ?"</string>
<string name="feedback_response" msgid="4671729244976641339">"ਤੁਹਾਡੇ ਵਿਚਾਰ ਲਈ ਧੰਨਵਾਦ!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ਠੀਕ ਹੈ"</string>
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index 3ff500e..9955285 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Nie można zapisać zrzutu ekranu."</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>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Edytuj"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Edytuj zrzut ekranu"</string>
@@ -402,7 +402,7 @@
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Do wschodu słońca"</string>
<string name="quick_settings_night_secondary_label_on_at" msgid="3584738542293528235">"Włącz o <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_secondary_label_until" msgid="1883981263191927372">"Do <xliff:g id="TIME">%s</xliff:g>"</string>
- <string name="quick_settings_ui_mode_night_label" msgid="1398928270610780470">"Tryb ciemny"</string>
+ <string name="quick_settings_ui_mode_night_label" msgid="1398928270610780470">"Ciemny motyw"</string>
<string name="quick_settings_dark_mode_secondary_label_battery_saver" msgid="4990712734503013251">"Oszczędzanie baterii"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at_sunset" msgid="6017379738102015710">"Włącz o zachodzie"</string>
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Do wschodu słońca"</string>
@@ -704,14 +704,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Może włączyć dzwonek lub wibracje w zależności od ustawień telefonu. Rozmowy z aplikacji <xliff:g id="APP_NAME">%1$s</xliff:g> są domyślnie wyświetlane jako dymki."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Przyciąga uwagę dzięki pływającym skrótom do treści."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Pozwól systemowi decydować, czy o powiadomieniu powinien informować dźwięk czy wibracja"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Stan:</b> zmieniony na Domyślny"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Stan:</b> zmieniono na Ciche"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Stan:</b> podniesiono ważność"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Stan:</b> obniżono ważność"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Wyświetla się jako pływający dymek u góry sekcji rozmów, pokazuje zdjęcie profilowe na ekranie blokady"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Ustawienia"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Priorytet"</string>
@@ -730,14 +726,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Ta aplikacja wyświetla się nad innymi aplikacjami na ekranie i używa mikrofonu oraz aparatu."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Ustawienia"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"To powiadomienie zostało automatycznie <b>zmienione na Domyślne</b> przez system."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"To powiadomienie zostało automatycznie <b>zmienione na Ciche</b> przez system."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Ważność tego powiadomienia została automatycznie <b>podniesiona</b> przez system."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Ważność tego powiadomienia została automatycznie <b>obniżona</b> przez system."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Czy to było prawidłowe?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Dziękujemy za opinię"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-pt-rBR/strings.xml b/packages/SystemUI/res/values-pt-rBR/strings.xml
index 8529f40..9b7220f 100644
--- a/packages/SystemUI/res/values-pt-rBR/strings.xml
+++ b/packages/SystemUI/res/values-pt-rBR/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Não foi possível salvar a captura de tela"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"O app ou a organização não permitem capturas de tela"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Editar"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Editar captura de tela"</string>
@@ -524,7 +524,7 @@
<string name="disable_vpn" msgid="482685974985502922">"Desativar VPN"</string>
<string name="disconnect_vpn" msgid="26286850045344557">"Desconectar VPN"</string>
<string name="monitoring_button_view_policies" msgid="3869724835853502410">"Ver políticas"</string>
- <string name="monitoring_button_view_controls" msgid="8316440345340701117">"Controles de visualização"</string>
+ <string name="monitoring_button_view_controls" msgid="8316440345340701117">"Ver controles"</string>
<string name="monitoring_description_named_management" msgid="505833016545056036">"Este dispositivo pertence à organização <xliff:g id="ORGANIZATION_NAME">%1$s</xliff:g>.\n\nO administrador de TI pode monitorar e gerenciar configurações, acesso corporativo, apps, dados associados ao dispositivo e informações de local do dispositivo.\n\nPara saber mais, entre em contato com seu administrador de TI."</string>
<string name="monitoring_description_management" msgid="4308879039175729014">"Este dispositivo pertence à sua organização.\n\nO administrador de TI pode monitorar e gerenciar configurações, acesso corporativo, apps, dados associados ao dispositivo e informações de local do dispositivo.\n\nPara saber mais, entre em contato com seu administrador de TI."</string>
<string name="monitoring_description_management_ca_certificate" msgid="7785013130658110130">"Sua organização instalou uma autoridade de certificação neste dispositivo. É possível monitorar ou modificar seu tráfego de rede seguro."</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Pode vibrar ou tocar com base nas configurações do smartphone. As conversas do app <xliff:g id="APP_NAME">%1$s</xliff:g> aparecem em balões por padrão."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Mantém sua atenção com um atalho flutuante para esse conteúdo."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Faça com que o sistema determine se a notificação resultará em som ou vibração"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> promovida a Padrão"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> rebaixada a Silenciosa"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> classificada com maior prioridade"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> classificada com menor prioridade"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Aparecem na parte superior de uma seção de conversa, em forma de balões, mostrando a foto do perfil na tela de bloqueio"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Configurações"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritárias"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Este app está sobreposto a outros apps na sua tela e está usando o microfone e a câmera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Configurações"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Esta notificação foi automaticamente <b>promovida a Padrão</b> pelo sistema."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Esta notificação foi automaticamente <b>rebaixada para Silenciosa</b> pelo sistema."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Esta notificação foi automaticamente <b>classificada com maior prioridade</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Esta notificação foi automaticamente <b>classificada com menor prioridade</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Isso está correto?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Agradecemos seu feedback."</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-pt-rPT/strings.xml b/packages/SystemUI/res/values-pt-rPT/strings.xml
index e90e105..9b52677 100644
--- a/packages/SystemUI/res/values-pt-rPT/strings.xml
+++ b/packages/SystemUI/res/values-pt-rPT/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Não é possível guardar a captura de ecrã."</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"A app ou a sua entidade não permitem tirar capturas de ecrã"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Editar"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Editar captura de ecrã"</string>
@@ -548,7 +548,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"O seu gestor ativou os registos de rede, que monitorizam o tráfego no seu dispositivo.\n\nPara mais informações, contacte o gestor."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"Concedeu autorização a uma app para configurar uma ligação VPN.\n\nEsta app pode monitorizar a atividade do dispositivo e da rede, incluindo emails, aplicações e Sites."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"O seu perfil de trabalho é gerido por <xliff:g id="ORGANIZATION">%1$s</xliff:g>.\n\nO seu gestor tem a capacidade de monitorizar a sua atividade da rede, incluindo emails, aplicações e Sites.\n\nPara mais informações, contacte o gestor.\n\nAlém disso, está ligado a uma VPN, que pode monitorizar a sua atividade da rede."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Este dispositivo é gerido pelos teus pais. Estes podem ver e gerir informações como as apps que utilizas, a tua localização e o tempo de utilização."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Este dispositivo é gerido pelos teus pais, que podem ver e gerir informações como as apps que utilizas, a tua localização e o tempo de utilização."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"VPN"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"Está associado à app <xliff:g id="APPLICATION">%1$s</xliff:g>, que pode monitorizar a sua atividade de rede, incluindo emails, aplicações e Sites."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"Está ligado a <xliff:g id="APPLICATION">%1$s</xliff:g>, que pode monitorizar a atividade da rede pessoal, incluindo emails, aplicações e Sites."</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Pode tocar ou vibrar com base nas definições do telemóvel. As conversas da app <xliff:g id="APP_NAME">%1$s</xliff:g> aparecem como um balão por predefinição."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Mantém a sua atenção com um atalho flutuante para este conteúdo."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Faça com que o sistema determine se esta notificação deve emitir um som ou uma vibração"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Estado:</b> promovida para Predefinida"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Estado:</b> despromovida para Silenciosa"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Estado:</b> passou para classificação superior"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Estado:</b> passou para classificação inferior"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Aparece no topo da secção de conversas, surge como balão flutuante e apresenta a imagem do perfil no ecrã de bloqueio."</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Definições"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioridade"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Esta app está a sobrepor-se a outras aplicações no ecrã e a utilizar o microfone e a câmara."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Definições"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Esta notificação foi automaticamente <b>promovida para Predefinida</b> pelo sistema."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Esta notificação foi automaticamente <b>despromovida para Silenciosa</b> pelo sistema."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Esta notificação passou automaticamente para uma <b>classificação superior</b> no seu painel."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Esta notificação passou automaticamente para uma <b>classificação inferior</b> no seu painel."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Estava correto?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Obrigado pelo seu feedback!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-pt/strings.xml b/packages/SystemUI/res/values-pt/strings.xml
index 8529f40..9b7220f 100644
--- a/packages/SystemUI/res/values-pt/strings.xml
+++ b/packages/SystemUI/res/values-pt/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Não foi possível salvar a captura de tela"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"O app ou a organização não permitem capturas de tela"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Editar"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Editar captura de tela"</string>
@@ -524,7 +524,7 @@
<string name="disable_vpn" msgid="482685974985502922">"Desativar VPN"</string>
<string name="disconnect_vpn" msgid="26286850045344557">"Desconectar VPN"</string>
<string name="monitoring_button_view_policies" msgid="3869724835853502410">"Ver políticas"</string>
- <string name="monitoring_button_view_controls" msgid="8316440345340701117">"Controles de visualização"</string>
+ <string name="monitoring_button_view_controls" msgid="8316440345340701117">"Ver controles"</string>
<string name="monitoring_description_named_management" msgid="505833016545056036">"Este dispositivo pertence à organização <xliff:g id="ORGANIZATION_NAME">%1$s</xliff:g>.\n\nO administrador de TI pode monitorar e gerenciar configurações, acesso corporativo, apps, dados associados ao dispositivo e informações de local do dispositivo.\n\nPara saber mais, entre em contato com seu administrador de TI."</string>
<string name="monitoring_description_management" msgid="4308879039175729014">"Este dispositivo pertence à sua organização.\n\nO administrador de TI pode monitorar e gerenciar configurações, acesso corporativo, apps, dados associados ao dispositivo e informações de local do dispositivo.\n\nPara saber mais, entre em contato com seu administrador de TI."</string>
<string name="monitoring_description_management_ca_certificate" msgid="7785013130658110130">"Sua organização instalou uma autoridade de certificação neste dispositivo. É possível monitorar ou modificar seu tráfego de rede seguro."</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Pode vibrar ou tocar com base nas configurações do smartphone. As conversas do app <xliff:g id="APP_NAME">%1$s</xliff:g> aparecem em balões por padrão."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Mantém sua atenção com um atalho flutuante para esse conteúdo."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Faça com que o sistema determine se a notificação resultará em som ou vibração"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> promovida a Padrão"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> rebaixada a Silenciosa"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> classificada com maior prioridade"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> classificada com menor prioridade"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Aparecem na parte superior de uma seção de conversa, em forma de balões, mostrando a foto do perfil na tela de bloqueio"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Configurações"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritárias"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Este app está sobreposto a outros apps na sua tela e está usando o microfone e a câmera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Configurações"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Esta notificação foi automaticamente <b>promovida a Padrão</b> pelo sistema."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Esta notificação foi automaticamente <b>rebaixada para Silenciosa</b> pelo sistema."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Esta notificação foi automaticamente <b>classificada com maior prioridade</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Esta notificação foi automaticamente <b>classificada com menor prioridade</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Isso está correto?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Agradecemos seu feedback."</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-ro/strings.xml b/packages/SystemUI/res/values-ro/strings.xml
index 9339dec..d0d0103 100644
--- a/packages/SystemUI/res/values-ro/strings.xml
+++ b/packages/SystemUI/res/values-ro/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Nu se poate salva captura de ecran"</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>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Editați"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Editați captura de ecran"</string>
@@ -701,14 +701,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Poate să sune sau să vibreze, în funcție de setările telefonului. Conversațiile din balonul <xliff:g id="APP_NAME">%1$s</xliff:g> în mod prestabilit."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Vă atrage atenția printr-o comandă rapidă flotantă la acest conținut."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Solicitați-i sistemului să stabilească dacă această notificare este sonoră sau cu vibrații."</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Stare:</b> promovată la prestabilită"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Stare:</b> setată ca Silențioasă"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Stare:</b> clasificată mai sus"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Stare:</b> clasificată mai jos"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Se afișează în partea de sus a secțiunii de conversație, apare ca un balon flotant, afișează fotografia de profil pe ecranul de blocare"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Setări"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritate"</string>
@@ -727,14 +723,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Această aplicație se afișează peste alte aplicații de pe ecran și folosește microfonul și camera foto."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Setări"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Notificarea a fost <b>promovată automat la Prestabilită</b> de sistem."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Notificarea a fost <b>setată automat ca Silențioasă</b> de sistem."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Notificarea a fost <b>clasificată automat mai sus</b> în umbră."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Notificarea a fost <b>clasificată automat mai jos</b> în umbră."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Este corect?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Mulțumim pentru feedback!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index 1fa974935..1b1aa29 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Не удалось сохранить скриншот."</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Не удалось сделать скриншот: нет разрешения от приложения или организации."</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Изменить"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Изменить скриншот"</string>
@@ -505,7 +505,7 @@
<string name="profile_owned_footer" msgid="2756770645766113964">"Действия в профиле могут отслеживаться"</string>
<string name="vpn_footer" msgid="3457155078010607471">"Сеть может отслеживаться"</string>
<string name="branded_vpn_footer" msgid="816930186313188514">"Сеть может отслеживаться"</string>
- <string name="quick_settings_disclosure_parental_controls" msgid="2114102871438223600">"Этим устройством управляет один из твоих родителей."</string>
+ <string name="quick_settings_disclosure_parental_controls" msgid="2114102871438223600">"Устройством управляет один из родителей."</string>
<string name="quick_settings_disclosure_management_monitoring" msgid="8231336875820702180">"Ваша организация управляет этим устройством и может отслеживать сетевой трафик"</string>
<string name="quick_settings_disclosure_named_management_monitoring" msgid="2831423806103479812">"Организация \"<xliff:g id="ORGANIZATION_NAME">%1$s</xliff:g>\" управляет этим устройством и может отслеживать сетевой трафик"</string>
<string name="quick_settings_disclosure_management_named_vpn" msgid="6096715329056415588">"Это устройство принадлежит вашей организации и подключено к приложению \"<xliff:g id="VPN_APP">%1$s</xliff:g>\""</string>
@@ -554,7 +554,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"Администратор включил ведение сетевого журнала, чтобы отслеживать трафик на вашем устройстве.\n\nДля получения подробной информации обращайтесь к администратору."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"Вы разрешили приложению подключаться к сети VPN.\n\nОно может отслеживать ваши действия на устройстве и в Интернете, включая работу с электронной почтой, приложениями и веб-сайтами."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"Вашим рабочим профилем управляет <xliff:g id="ORGANIZATION">%1$s</xliff:g>.\n\nАдминистратор может отслеживать ваши действия в сети, в том числе работу с электронной почтой, приложениями и веб-сайтами.\n\nДля получения подробной информации обращайтесь к администратору.\n\nВы также подключены к сети VPN, в которой можно отслеживать ваши действия."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Этим устройством управляет один из твоих родителей. Он может видеть определенные сведения (например, какие приложения ты используешь и где находишься), а также устанавливать определенные настройки (например, ограничивать время использования устройства)."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Этим устройством управляет один из твоих родителей. Он может видеть, например, какими приложениями ты пользуешься и где находишься, а также задавать определенные настройки (например, ограничивать время использования устройства)."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"Сеть VPN"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"Запущено приложение \"<xliff:g id="APPLICATION">%1$s</xliff:g>\", которое может отслеживать ваши действия в сети, включая работу с электронной почтой, приложениями и веб-сайтами."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"Запущено приложение \"<xliff:g id="APPLICATION">%1$s</xliff:g>\", которое может отслеживать ваши действия в Интернете (выполняемые в личном профиле), включая работу с электронной почтой, приложениями и веб-сайтами."</string>
@@ -704,14 +704,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Звонок или вибрация в зависимости от настроек телефона. Разговоры из приложения \"<xliff:g id="APP_NAME">%1$s</xliff:g>\" по умолчанию появляются в виде всплывающего чата."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Привлекает ваше внимание к контенту с помощью плавающего ярлыка"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Система будет сама определять, включать ли звуковой сигнал или вибрацию для уведомления"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Статус:</b> повышено до уровня \"По умолчанию\""</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Статус:</b> понижено до уровня \"Без звука\""</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Статус:</b> уровень важности повышен"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Статус:</b> уровень важности понижен"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Появляется в верхней части списка разговоров и как всплывающий чат, фото профиля показывается на заблок. экране"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Настройки"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Приоритет"</string>
@@ -730,14 +726,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Это приложение располагается поверх других приложений, а также использует микрофон и камеру."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Настройки"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ОК"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Уровень важности этого уведомления был автоматически <b>повышен до \"По умолчанию\"</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Уровень важности этого уведомления был автоматически </b>понижен до \"Без звука\"</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Уровень важности этого уведомления на панели был автоматически <b>повышен</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Уровень важности этого уведомления на панели был автоматически <b>понижен</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Все верно?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Спасибо!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ОК"</string>
diff --git a/packages/SystemUI/res/values-si/strings.xml b/packages/SystemUI/res/values-si/strings.xml
index d39bc52..9981614 100644
--- a/packages/SystemUI/res/values-si/strings.xml
+++ b/packages/SystemUI/res/values-si/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"තිර රුව සුරැකීමට නොහැකිය"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"තිර රූ ගැනීමට යෙදුම හෝ ඔබගේ සංවිධානය ඉඩ නොදේ"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"සංස්කරණය කරන්න"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"තිර රුව සංස්කරණය කරන්න"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"දුරකථන සැකසීම් මත පදනම්ව නාද කිරීමට හෝ කම්පනය කිරීමට හැකිය. <xliff:g id="APP_NAME">%1$s</xliff:g> වෙතින් සංවාද පෙරනිමියෙන් බුබුළු දමයි"</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"පාවෙන කෙටිමගක් සමග ඔබේ අවධානය මෙම අන්තර්ගතය වෙත තබා ගන්න."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"මෙම දැනුම් දීම ශබ්දයක් හෝ කම්පනයක් ඇති කළ යුතු ද යන්න පද්ධතිය මගින් තීරණය කර තිබේද"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>තත්ත්වය:</b> පෙරනිමි වෙත ප්රවර්ධනය කරන ලදි"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>තත්ත්වය:</b> නිශ්ශබ්ද වෙත පහත දමන ලදි"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>තත්ත්වය:</b> ඉහළට ශ්රේණිගත කරන ලදි"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>තත්ත්වය:</b> පහළට ශ්රේණිගත කරන ලදි"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"සංවාද කොටසේ ඉහළම පෙන්වයි, බුබුළක් ලෙස දිස් වේ, අගුලු තිරයේ පැතිකඩ පින්තූරය සංදර්ශනය වේ"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"සැකසීම්"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"ප්රමුඛතාව"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"මෙම යෙදුම් ඔබගේ තිරය මත අනෙකුත් යෙදුම්වලට උඩින් සංදර්ශනය වන අතර මයික්රෆෝනය සහ කැමරාව භාවිතා කරයි."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"සැකසීම්"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"හරි"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"පද්ධතිය මගින් මෙම දැනුම්දීම ස්වයංක්රියව <b>පෙරනිමි වෙත ප්රවර්ධනය කරන ලදි</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"පද්ධතිය මගින් මෙම දැනුම්දීම ස්වයංක්රියව <b>නිශ්ශබ්ද වෙත පහත දමන ලදි</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"ඔබගේ වැස්ම තුළ මෙම දැනුම්දීම ස්වයංක්රියව <b>ඉහළට ශ්රේණිගත කරන ලදි</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"ඔබගේ වැස්ම තුළ මෙම දැනුම්දීම ස්වයංක්රියව <b>පහළට ශ්රේණිගත කරන ලදි</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"මෙය නිවැරදි වුයේද?"</string>
<string name="feedback_response" msgid="4671729244976641339">"ඔබේ ප්රතිපෝෂණයට ස්තූතියි!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"හරි"</string>
diff --git a/packages/SystemUI/res/values-sk/strings.xml b/packages/SystemUI/res/values-sk/strings.xml
index a50da0e..470b021 100644
--- a/packages/SystemUI/res/values-sk/strings.xml
+++ b/packages/SystemUI/res/values-sk/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Snímka obrazovky sa nedá uložiť"</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>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Upraviť"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Upraviť snímku obrazovky"</string>
@@ -704,14 +704,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Môže zvoniť alebo vibrovať podľa nastavení telefónu. Predvolene sa zobrazia konverzácie z bubliny <xliff:g id="APP_NAME">%1$s</xliff:g>."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Upúta vás plávajúcim odkazom na tento obsah."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Nechajte systém určiť, či má toto upozornenie vydávať zvuk alebo vibrovať"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Stav:</b> Preradené vyššie do kategórie Predvolené"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> Preradené nižšie do kategórie Tiché"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> Preradené vyššie"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Stav:</b> Preradené nižšie"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Nájdete ju hore v sekcii konverzácií ako plávajúcu bublinu, zobrazuje profilovú fotku na uzamknutej obrazovke"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Nastavenia"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Priorita"</string>
@@ -730,14 +726,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Táto aplikácia sa zobrazuje cez ďalšie aplikácie na obrazovke a používa mikrofón aj fotoaparát."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Nastavenia"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Systém toto upozornenie automaticky <b>preradil vyššie do kategórie Predvolené</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Systém toto upozornenie automaticky <b>preradil nižšie do kategórie Tiché</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Toto upozornenie bolo na vašom paneli automaticky <b>preradené vyššie</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Toto upozornenie bolo na vašom paneli automaticky <b>preradené nižšie</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Bolo toto správne?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Ďakujeme za váš názor."</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-sl/strings.xml b/packages/SystemUI/res/values-sl/strings.xml
index 7d9a5d9..08fdb58 100644
--- a/packages/SystemUI/res/values-sl/strings.xml
+++ b/packages/SystemUI/res/values-sl/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Posnetka zaslona ni mogoče shraniti"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Aplikacija ali vaša organizacija ne dovoljuje posnetkov zaslona"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Uredi"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Urejanje posnetka zaslona"</string>
@@ -554,7 +554,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"Skrbnik je vklopil beleženje omrežnega prometa, ki nadzoruje promet v napravi.\n\nČe želite več informacij, se obrnite na skrbnika."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"Aplikaciji ste dovolili vzpostavitev povezave VPN.\n\nTa aplikacija lahko nadzira napravo in omrežno dejavnost, vključno z e-pošto, aplikacijami in spletnimi mesti."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"Delovni profil upravlja <xliff:g id="ORGANIZATION">%1$s</xliff:g>.\n\nSkrbnik lahko nadzira vašo omrežno dejavnost, vključno z e-pošto, aplikacijami in spletnimi mesti.\n\nČe želite več informacij, se obrnite na skrbnika.\n\nPovezani ste tudi z omrežjem VPN, ki lahko nadzira vašo omrežno dejavnost."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"To napravo upravlja tvoj starš. Tvoj starš si lahko ogleda in upravlja podatke, na primer katere aplikacije uporabljaš, tvojo lokacijo in koliko časa uporabljaš telefon."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"To napravo upravlja tvoj starš. Lahko si ogleda in upravlja podatke, na primer katere aplikacije uporabljaš, tvojo lokacijo in koliko časa uporabljaš napravo."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"VPN"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"Povezani ste z aplikacijo <xliff:g id="APPLICATION">%1$s</xliff:g>, ki lahko nadzira omrežno dejavnost, vključno z e-pošto, aplikacijami in spletnimi mesti."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"Povezani ste z aplikacijo <xliff:g id="APPLICATION">%1$s</xliff:g>, ki lahko nadzira vašo osebno omrežno dejavnost, vključno z e-pošto, aplikacijami in spletnimi mesti."</string>
@@ -704,14 +704,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Zvonjenje ali vibriranje je omogočeno na podlagi nastavitev telefona. Pogovori v aplikaciji <xliff:g id="APP_NAME">%1$s</xliff:g> so privzeto prikazani v oblačkih."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Zadrži vašo pozornost z lebdečo bližnjico do te vsebine."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Naj sistem določi, ali ob prejemu tega obvestila naprava predvaja zvok ali zavibrira"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Stanje:</b> Uvrščeno med privzeta obvestila"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Stanje:</b> Uvrščeno med obvestila brez zvoka"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Stanje:</b> Uvrščeno višje"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Stanje:</b> Uvrščeno nižje"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Prikaz na vrhu razdelka s pogovorom in v plavajočem oblačku, prikaz profilne slike na zaklenjenem zaslonu"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Nastavitve"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prednost"</string>
@@ -730,14 +726,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Ta aplikacija prekriva druge aplikacije na zaslonu ter uporablja mikrofon in fotoaparat."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Nastavitve"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"V redu"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Sistem je to obvestilo samodejno <b>uvrstil višje – med privzeta obvestila</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Sistem je to obvestilo samodejno <b>uvrstil nižje – med obvestila brez zvoka</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"To obvestilo je bilo samodejno <b>uvrščeno višje</b> na zaslonu z obvestili."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"To obvestilo je bilo samodejno <b>uvrščeno nižje</b> na zaslonu z obvestili."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Je bilo to prav?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Hvala za povratne informacije."</string>
<string name="feedback_ok" msgid="6481426753298857144">"V redu"</string>
diff --git a/packages/SystemUI/res/values-sq/strings.xml b/packages/SystemUI/res/values-sq/strings.xml
index a72f090..aaee225 100644
--- a/packages/SystemUI/res/values-sq/strings.xml
+++ b/packages/SystemUI/res/values-sq/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Pamja e ekranit nuk mund të ruhet"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Nxjerrja e pamjeve të ekranit nuk lejohet nga aplikacioni ose organizata jote."</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Modifiko"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Modifiko pamjen e ekranit"</string>
@@ -499,7 +499,7 @@
<string name="profile_owned_footer" msgid="2756770645766113964">"Profili mund të monitorohet"</string>
<string name="vpn_footer" msgid="3457155078010607471">"Rrjeti mund të jetë i monitoruar"</string>
<string name="branded_vpn_footer" msgid="816930186313188514">"Rrjeti mund të jetë i monitoruar"</string>
- <string name="quick_settings_disclosure_parental_controls" msgid="2114102871438223600">"Kjo pajisje menaxhohet nga prindi yt."</string>
+ <string name="quick_settings_disclosure_parental_controls" msgid="2114102871438223600">"Kjo pajisje menaxhohet nga prindi yt"</string>
<string name="quick_settings_disclosure_management_monitoring" msgid="8231336875820702180">"Organizata jote e zotëron këtë pajisje dhe mund të monitorojë trafikun e rrjetit"</string>
<string name="quick_settings_disclosure_named_management_monitoring" msgid="2831423806103479812">"<xliff:g id="ORGANIZATION_NAME">%1$s</xliff:g> e zotëron këtë pajisje dhe mund të monitorojë trafikun e rrjetit"</string>
<string name="quick_settings_disclosure_management_named_vpn" msgid="6096715329056415588">"Kjo pajisje i përket organizatës sate dhe është e lidhur me <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
@@ -548,7 +548,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"Administratori yt ka aktivizuar regjistrimin e rrjetit, i cili monitoron trafikun në pajisjen tënde.\n\nPër më shumë informacione, kontakto me administratorin."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"I dhe leje një aplikacioni që të konfigurojë një lidhje VPN.\n\nKy aplikacion mund të monitorojë pajisjen tënde dhe aktivitetin e rrjetit, përfshirë email-et, aplikacionet dhe sajtet e uebit."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"Profili yt i punës menaxhohet nga <xliff:g id="ORGANIZATION">%1$s</xliff:g>.\n\nAdministratori yt mund të monitorojë aktivitetin tënd të rrjetit, duke përfshirë email-et, aplikacionet dhe sajtet e uebit.\n\nPër më shumë informacion, kontakto me administratorin tënd.\n\nJe i lidhur edhe me një VPN, që mund të monitorojë aktivitetin tënd të rrjetit."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Kjo pajisje menaxhohet nga prindi yt. Prindi yt mund të shohë e menaxhojë informacionin, si p.sh. aplikacionet që përdor, vendndodhjen tënde dhe kohën para ekranit."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Kjo pajisje menaxhohet nga prindi yt. Prindi yt mund të shikojë dhe menaxhojë informacionet, si p.sh. aplikacionet që përdor, vendndodhjen tënde dhe kohën para ekranit."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"VPN"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"Je i lidhur me aplikacionin <xliff:g id="APPLICATION">%1$s</xliff:g> i cili mund të monitorojë aktivitetin tënd në rrjet, duke përfshirë mail-et, aplikacionet dhe sajtet e uebit."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"Je i lidhur me aplikacionin <xliff:g id="APPLICATION">%1$s</xliff:g>, i cili mund të monitorojë aktivitetin tënd personal në rrjet, përfshirë email-et, aplikacionet dhe sajtet e uebit."</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Mund të bjerë zilja ose të dridhet në bazë të cilësimeve të telefonit. Bisedat nga flluska e <xliff:g id="APP_NAME">%1$s</xliff:g> si parazgjedhje."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Mban vëmendjen tënde me një shkurtore pluskuese te kjo përmbajtje."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Kërkoji sistemit të përcaktojë nëse ky njoftim duhet të lëshojë tingull apo dridhje"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Statusi:</b> Promovuar si parazgjedhje"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Statusi:</b> Ulur në nivel si në heshtje"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Statusi:</b> Renditur më lart"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Statusi:</b> Renditur më poshtë"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Shfaqet në krye të seksionit të bisedës dhe shfaqet si flluskë pluskuese, shfaq fotografinë e profilit në ekranin e kyçjes"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Cilësimet"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Përparësia"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Ky aplikacion po shfaqet mbi aplikacionet e tjera në ekran dhe po përdor mikrofonin dhe kamerën."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Cilësimet"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Në rregull"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Ky njoftim <b>është promovuar automatikisht si parazgjedhje</b> nga sistemi."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Ky njoftim është <b>ulur automatikisht në nivel si në heshtje</b> nga sistemi."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Ky njoftim është <b>renditur automatikisht më lart</b> në strehën e njoftimeve."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Ky njoftim është <b>renditur automatikisht më poshtë</b> në strehën e njoftimeve."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"A ishte e saktë kjo?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Faleminderit për komentin!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"Në rregull"</string>
diff --git a/packages/SystemUI/res/values-sr/strings.xml b/packages/SystemUI/res/values-sr/strings.xml
index 3cc9f20..d7645be 100644
--- a/packages/SystemUI/res/values-sr/strings.xml
+++ b/packages/SystemUI/res/values-sr/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Чување снимка екрана није успело"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Апликација или организација не дозвољавају прављење снимака екрана"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Измени"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Измените снимак екрана"</string>
@@ -701,14 +701,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Може да звони или вибрира у зависности од подешавања телефона. Конверзације из апликације <xliff:g id="APP_NAME">%1$s</xliff:g> се подразумевано приказују у облачићима."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Привлачи вам пажњу помоћу плутајуће пречице до овог садржаја."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Нека систем утврди да ли ово обавештење треба да емитује звук или да вибрира"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Статус:</b> Унапређено у Подразумевано"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Статус:</b> Деградирано у Нечујно"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Статус:</b> Рангирано више"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Статус:</b> Рангирано ниже"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Приказује се у врху одељка за конверзације као плутајући облачић, приказује слику профила на закључаном екрану"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Подешавања"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Приоритет"</string>
@@ -727,14 +723,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Ова апликација се приказује преко других апликација на екрану и користи микрофон и камеру."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Подешавања"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Потврди"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Систем је ово обавештење аутоматски <b>унапредио у подразумевано</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Систем је ово обавештење аутоматски <b>деградирао у Нечујно</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Ово обавештење је аутоматски <b>рангирано више</b> на траци са обавештењима."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Ово обавештење је аутоматски <b>рангирано ниже</b> на траци са обавештењима."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Да ли је то тачно?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Хвала вам на повратним информацијама!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"Потврди"</string>
diff --git a/packages/SystemUI/res/values-sv/strings.xml b/packages/SystemUI/res/values-sv/strings.xml
index 5b8a526..8e5e79e 100644
--- a/packages/SystemUI/res/values-sv/strings.xml
+++ b/packages/SystemUI/res/values-sv/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Det gick inte att spara skärmdumpen"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Appen eller organisationen tillåter inte att du tar skärmdumpar"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Redigera"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Redigera skärmdump"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Kan ringa eller vibrera beroende på inställningarna på telefonen. Konversationer från <xliff:g id="APP_NAME">%1$s</xliff:g> visas i bubblor som standard."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Behåller din uppmärksamhet med en flytande genväg till innehållet."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Låt systemet avgöra om den här aviseringen ska låta eller vibrera"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> Ändrad till Standard"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> Ändrad till Tyst"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> Höjd"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> Sänkt"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Visas högst upp bland konversationerna som en flytande bubbla, visar profilbilden på låsskärmen"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Inställningar"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritet"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Appen visas över andra appar på skärmen och den använder mikrofonen och kameran."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Inställningar"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Aviseringens relevans <b>ändrades till Standard</b> automatiskt av systemet."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Aviseringens relevans <b>ändrades till Tyst</b> automatiskt av systemet."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Aviseringens relevans i meddelandepanelen <b>höjdes</b> automatiskt."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Aviseringens relevans i meddelandepanelen <b>sänktes</b> automatiskt."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Stämmer detta?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Tack för din feedback!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-sw/strings.xml b/packages/SystemUI/res/values-sw/strings.xml
index b2b2c37..768fd85 100644
--- a/packages/SystemUI/res/values-sw/strings.xml
+++ b/packages/SystemUI/res/values-sw/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Imeshindwa kuhifadhi picha ya skrini"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Programu au shirika lako halikuruhusu kupiga picha za skrini"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Badilisha"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Badilisha picha ya skrini"</string>
@@ -548,7 +548,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"Msimamizi wako amewasha kumbukumbu ya kuingia mtandaoni ambayo hufuatilia shughuli kwenye kifaa chako.\n\nKwa maelezo zaidi, wasiliana na msimamizi wako."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"Uliruhusu programu iweke muunganisho wa VPN.\n\nProgramu hii inaweza kufuatilia shughuli za kifaa na mtandao wako, ikiwa ni pamoja na barua pepe, programu na tovuti."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"Wasifu wako wa kazini unadhibitiwa na <xliff:g id="ORGANIZATION">%1$s</xliff:g>.\n\nMsimamizi wako anaweza kufuatilia shughuli za mtandaoni, ikiwa ni pamoja na barua pepe, programu na tovuti.\n\nKwa maelezo zaidi, wasiliana na msimamizi wako.\n\nUmeunganishwa pia kwenye VPN, ambayo inaweza kufuatilia shughuli zako mtandaoni."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Kifaa hiki kinadhibitiwa na mzazi wako. Mzazi wako anaweza kuona na kudhibiti maelezo kama vile programu unazotumia, mahali ulipo na muda unaotumia kifaa."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Kifaa hiki kinadhibitiwa na mzazi wako. Mzazi wako anaweza kuona na kudhibiti maelezo kama vile programu unazotumia, mahali ulipo na muda unaotumia kwenye kifaa."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"VPN"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"Umeunganishwa kwenye <xliff:g id="APPLICATION">%1$s</xliff:g>, ambayo inaweza kufuatilia shughuli za mtandao wako, ikiwa ni pamoja na barua pepe, programu na tovuti."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"Umeunganishwa kwenye <xliff:g id="APPLICATION">%1$s</xliff:g>, ambayo inaweza kufuatilia shughuli za mtandao wako, ikiwa ni pamoja na barua pepe, programu na tovuti."</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Huenda ikalia au kutetema kulingana na mipangilio ya simu. Mazungumzo kutoka kiputo cha <xliff:g id="APP_NAME">%1$s</xliff:g> kwa chaguomsingi."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Huweka umakinifu wako kwenye maudhui haya kwa kutumia njia ya mkato ya kuelea."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Ruhusu mfumo ubainishe iwapo arifa hii inapaswa kutoa sauti au mtetemo"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Hali:</b> Imepandishwa Hadhi Kuwa Chaguomsingi"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> Imeshushwa Hadhi Kuwa Kimya"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Hali:</b> Imeorodheshwa Katika Nafasi ya Juu"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Hali:</b> Imeorodheshwa Katika Nafasi ya Chini"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Huonyeshwa kwenye sehemu ya juu ya mazungumzo, huonekana kama kiputo, huonyesha picha ya wasifu kwenye skrini iliyofungwa"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Mipangilio"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Kipaumbele"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Programu hii inachomoza kwenye programu zingine zilizo katika skrini yako na inatumia maikrofoni na kamera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Mipangilio"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Sawa"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Arifa hii <b>imepandishwa hadhi kiotomatiki na mfumo kuwa Chaguomsingi</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Arifa hii <b>imeshushwa hadhi kiotomatiki na mfumo kuwa Kimya</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Arifa hii <b>imeorodheshwa kiotomatiki katika nafasi ya juu</b> katika kiwango chako."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Arifa hii <b>imeorodheshwa kiotomatiki katika nafasi ya chini</b> katika kiwango chako."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Je, hatua hii ilikuwa sahihi?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Asante kwa maoni yako!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"Sawa"</string>
diff --git a/packages/SystemUI/res/values-sw600dp-land/config.xml b/packages/SystemUI/res/values-sw600dp-land/config.xml
index 3b00ad1..6dff2e3 100644
--- a/packages/SystemUI/res/values-sw600dp-land/config.xml
+++ b/packages/SystemUI/res/values-sw600dp-land/config.xml
@@ -16,4 +16,7 @@
-->
<resources>
<integer name="quick_settings_num_columns">3</integer>
+
+ <!-- Max number of columns for quick controls area -->
+ <integer name="controls_max_columns">2</integer>
</resources>
diff --git a/packages/SystemUI/res/values-sw600dp/config.xml b/packages/SystemUI/res/values-sw600dp/config.xml
index d886f00..2f5e8ea 100644
--- a/packages/SystemUI/res/values-sw600dp/config.xml
+++ b/packages/SystemUI/res/values-sw600dp/config.xml
@@ -35,4 +35,7 @@
<!-- Whether wallet view is shown in landscape / seascape orientations -->
<bool name="global_actions_show_landscape_wallet_view">true</bool>
+ <!-- Max number of columns for quick controls area -->
+ <integer name="controls_max_columns">4</integer>
+
</resources>
diff --git a/packages/SystemUI/res/values-ta/strings.xml b/packages/SystemUI/res/values-ta/strings.xml
index 8833153..efdace4 100644
--- a/packages/SystemUI/res/values-ta/strings.xml
+++ b/packages/SystemUI/res/values-ta/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"ஸ்கிரீன்ஷாட்டைச் சேமிக்க முடியவில்லை"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ஸ்கிரீன் ஷாட்டுகளை எடுப்பதை, ஆப்ஸ் அல்லது உங்கள் நிறுவனம் அனுமதிக்கவில்லை"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"திருத்து"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"ஸ்கிரீன்ஷாட்டைத் திருத்தும்"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"மொபைல் அமைப்புகளின் அடிப்படையில் ஒலிக்கவோ அதிரவோ செய்யும். <xliff:g id="APP_NAME">%1$s</xliff:g> இலிருந்து வரும் உரையாடல்கள் இயல்பாகவே குமிழாகத் தோன்றும்."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"இந்த உள்ளடக்கத்திற்கான மிதக்கும் ஷார்ட்கட் மூலம் உங்கள் கவனத்தைப் பெற்றிருக்கும்."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"இந்த அறிவிப்பு ஒலி எழுப்ப வேண்டுமா அதிர வேண்டுமா என்பதை சிஸ்டம் தீர்மானிக்கும்"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>நிலை:</b> இயல்புநிலைக்கு உயர்த்தி அமைக்கப்பட்டது"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>நிலை:</b> நிசப்த நிலைக்குக் குறைத்து அமைக்கப்பட்டது"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>நிலை:</b> முக்கியத்துவம் உயர்த்தப்பட்டது"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>நிலை:</b> முக்கியத்துவம் குறைக்கப்பட்டது"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"உரையாடல் பிரிவின் மேற்பகுதியில் மிதக்கும் குமிழாகத் தோன்றும். பூட்டுத் திரையின் மேல் சுயவிவரப் படத்தைக் காட்டும்"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"அமைப்புகள்"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"முன்னுரிமை"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"இந்த ஆப்ஸானது, உங்கள் திரையில் பிற ஆப்ஸின் இடைமுகத்தின் மேல் தோன்றுவதுடன், மைக்ரோஃபோனையும் கேமராவையும் உபயோகிக்கிறது."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"அமைப்புகள்"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"சரி"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"சிஸ்டத்தால் தானாகவே இந்த அறிவிப்பு <b>இயல்பு நிலைக்கு உயர்த்தி அமைக்கப்பட்டது</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"சிஸ்டத்தால் தானாகவே இந்த அறிவிப்பு <b>நிசப்த நிலைக்குக் குறைத்து அமைக்கப்பட்டது</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"அறிவிப்பு விவரத்தில் தானாகவே இந்த அறிவிப்பின் <b>முக்கியத்துவம் உயர்த்தப்பட்டது</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"அறிவிப்பு விவரத்தில் தானாகவே இந்த அறிவிப்பின் <b>முக்கியத்துவம் குறைக்கப்பட்டது</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"இது சரியானதா?"</string>
<string name="feedback_response" msgid="4671729244976641339">"உங்கள் கருத்துக்கு நன்றி!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"சரி"</string>
diff --git a/packages/SystemUI/res/values-te/strings.xml b/packages/SystemUI/res/values-te/strings.xml
index ccb4fa7..36a5de7 100644
--- a/packages/SystemUI/res/values-te/strings.xml
+++ b/packages/SystemUI/res/values-te/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"స్క్రీన్షాట్ను సేవ్ చేయడం సాధ్యపడలేదు"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"స్క్రీన్షాట్లు తీయడానికి యాప్ లేదా మీ సంస్థ అనుమతించలేదు"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"ఎడిట్ చేయండి"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"స్క్రీన్షాట్ను ఎడిట్ చేయండి"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"ఫోన్ సెట్టింగ్ల ఆధారంగా రింగ్ లేదా వైబ్రేట్ కావచ్చు. <xliff:g id="APP_NAME">%1$s</xliff:g> నుండి సంభాషణలు ఆటోమేటిక్గా బబుల్గా కనిపిస్తాయి."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"ఫ్లోటింగ్ షార్ట్కట్తో మీ దృష్టిని ఈ కంటెంట్పై నిలిపి ఉంచుతుంది."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"ఈ నోటిఫికేషన్ వచ్చినప్పుడు శబ్దం చేయాలా లేదా వైబ్రేట్ చేయాలా అనేది నిర్ణయించడానికి సిస్టమ్కు అనుమతి ఇవ్వండి"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>స్టేటస్:</b> ఆటోమేటిక్ సెట్టింగ్కు ప్రోమోట్ చేయబడింది"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>స్టేటస్:</b> నిశ్శబ్దం స్థాయికి తగ్గించబడింది"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>స్టేటస్:</b> ఎక్కువ ర్యాంక్కు సర్దుబాటు చేయబడింది"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>స్టేటస్:</b> తక్కువ ర్యాంక్కు సర్దుబాటు చేయబడింది"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"సంభాషణ విభాగం ఎగువన ఉంటుంది, తేలుతున్న బబుల్లాగా కనిపిస్తుంది, లాక్ స్క్రీన్పై ప్రొఫైల్ ఫోటోను ప్రదర్శిస్తుంది"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"సెట్టింగ్లు"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"ప్రాధాన్యత"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"ఈ యాప్ మీ స్క్రీన్లోని ఇతర యాప్లపై ప్రదర్శించబడుతోంది మరియు మైక్రోఫోన్, కెమెరాను ఉపయోగిస్తుంది."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"సెట్టింగ్లు"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"సరే"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"ఈ నోటిఫికేషన్, సిస్టమ్ ద్వారా దానంతట అదే <b>ఆటోమేటిక్గా ప్రమోట్ చేయబడింది</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"ఈ నోటిఫికేషన్, సిస్టమ్ ద్వారా ఆటోమేటిక్గా <b>నిశ్శబ్దం స్థాయికి తగ్గించబడింది</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"మీ నోటిఫికేషన్ షేడ్లో ఈ నోటిఫికేషన్ ఆటోమేటిక్గా <b>ఎక్కువ ర్యాంక్</b>కు సర్దుబాటు చేయబడింది."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"మీ నోటిఫికేషన్ షేడ్లో ఈ నోటిఫికేషన్ ఆటోమేటిక్గా <b>తక్కువ ర్యాంక్</b>కు సర్దుబాటు చేయబడింది."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"ఇది సరైనదేనా?"</string>
<string name="feedback_response" msgid="4671729244976641339">"మీ ఫీడ్బ్యాక్ను అందించినందుకు ధన్యవాదాలు!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"సరే"</string>
diff --git a/packages/SystemUI/res/values-te/strings_tv.xml b/packages/SystemUI/res/values-te/strings_tv.xml
index 50f4b45..1879edd 100644
--- a/packages/SystemUI/res/values-te/strings_tv.xml
+++ b/packages/SystemUI/res/values-te/strings_tv.xml
@@ -21,8 +21,8 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mic_active" msgid="5766614241012047024">"మైక్రోఫోన్ యాక్టివ్గా ఉంది"</string>
<string name="app_accessed_mic" msgid="2754428675130470196">"మీ మైక్రోఫోన్ను %1$s యాక్సెస్ చేసింది"</string>
- <string name="notification_vpn_connected" msgid="3891023882833274730">"VPN కనెక్ట్ చేయబడింది"</string>
- <string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN డిస్కనెక్ట్ చేయబడింది"</string>
+ <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>
diff --git a/packages/SystemUI/res/values-th/strings.xml b/packages/SystemUI/res/values-th/strings.xml
index 9c408e1..5dd4400 100644
--- a/packages/SystemUI/res/values-th/strings.xml
+++ b/packages/SystemUI/res/values-th/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"บันทึกภาพหน้าจอไม่ได้"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"แอปหรือองค์กรของคุณไม่อนุญาตให้จับภาพหน้าจอ"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"แก้ไข"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"แก้ไขภาพหน้าจอ"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"อาจส่งเสียงหรือสั่นโดยขึ้นอยู่กับการตั้งค่าโทรศัพท์ การสนทนาจาก <xliff:g id="APP_NAME">%1$s</xliff:g> จะแสดงเป็นบับเบิลโดยค่าเริ่มต้น"</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"ดึงดูดความสนใจของคุณไว้เสมอด้วยทางลัดแบบลอยที่มายังเนื้อหานี้"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"ให้ระบบพิจารณาว่าจะให้การแจ้งเตือนนี้ส่งเสียงหรือสั่นหรือไม่"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>สถานะ:</b> เลื่อนระดับเป็นค่าเริ่มต้น"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>สถานะ:</b> ลดระดับเป็นปิดเสียง"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>สถานะ:</b> อันดับสูงขึ้น"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>สถานะ:</b> อันดับต่ำลง"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"แสดงที่ด้านบนของส่วนการสนทนา ปรากฏเป็นบับเบิลแบบลอย แสดงรูปโปรไฟล์บนหน้าจอล็อก"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"การตั้งค่า"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"ลำดับความสำคัญ"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"แอปนี้กำลังแสดงทับแอปอื่นๆ ในหน้าจอและใช้ไมโครโฟนและกล้อง"</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"การตั้งค่า"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ตกลง"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"ระบบ<b>เลื่อนระดับการแจ้งเตือนนี้เป็นค่าเริ่มต้น</b>โดยอัตโนมัติ"</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"ระบบ<b>ลดระดับการแจ้งเตือนนี้เป็นปิดเสียง</b>โดยอัตโนมัติ"</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"การแจ้งเตือนนี้<b>มีอันดับสูงขึ้น</b>ในหน้าต่างแจ้งเตือนโดยอัตโนมัติ"</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"การแจ้งเตือนนี้<b>มีอันดับต่ำลง</b>ในหน้าต่างแจ้งเตือนโดยอัตโนมัติ"</string>
<string name="feedback_prompt" msgid="2278631214125128281">"การดำเนินการนี้ถูกต้องไหม"</string>
<string name="feedback_response" msgid="4671729244976641339">"ขอบคุณที่แสดงความคิดเห็น"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ตกลง"</string>
diff --git a/packages/SystemUI/res/values-tl/strings.xml b/packages/SystemUI/res/values-tl/strings.xml
index 9e8aa96..0ade0ed 100644
--- a/packages/SystemUI/res/values-tl/strings.xml
+++ b/packages/SystemUI/res/values-tl/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Hindi ma-save ang screenshot"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Hindi pinahihintulutan ng app o ng iyong organisasyon ang pagkuha ng mga screenshot"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"I-edit"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"I-edit ang screenshot"</string>
@@ -499,7 +499,7 @@
<string name="profile_owned_footer" msgid="2756770645766113964">"Maaaring subaybayan ang profile"</string>
<string name="vpn_footer" msgid="3457155078010607471">"Maaaring sinusubaybayan ang network"</string>
<string name="branded_vpn_footer" msgid="816930186313188514">"Maaaring sinusubaybayan ang network"</string>
- <string name="quick_settings_disclosure_parental_controls" msgid="2114102871438223600">"Pinapamahalaan ng iyong magulang ang device na ito"</string>
+ <string name="quick_settings_disclosure_parental_controls" msgid="2114102871438223600">"Pinapamahalaan ng magulang mo itong device"</string>
<string name="quick_settings_disclosure_management_monitoring" msgid="8231336875820702180">"Pagmamay-ari ng organisasyon mo ang device na ito at puwede nitong subaybayan ang trapiko sa network"</string>
<string name="quick_settings_disclosure_named_management_monitoring" msgid="2831423806103479812">"Pagmamay-ari ng <xliff:g id="ORGANIZATION_NAME">%1$s</xliff:g> ang device na ito at puwede nitong subaybayan ang trapiko sa network"</string>
<string name="quick_settings_disclosure_management_named_vpn" msgid="6096715329056415588">"Pagmamay-ari ng iyong organisasyon ang device na ito at nakakonekta ito sa <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Puwedeng mag-ring o mag-vibrate batay sa mga setting ng telepono. Mga pag-uusap mula sa <xliff:g id="APP_NAME">%1$s</xliff:g> bubble bilang default."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Pinapanatili ang iyong atensyon sa pamamagitan ng lumulutang na shortcut sa content na ito."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Ipatukoy sa system kung dapat gumawa ng tunog o pag-vibrate ang notification na ito"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> Na-promote sa Default"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Status:</b> Na-demote sa Naka-silent"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Status:</b> Ranked nang Mas Mataas"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Status:</b> Na-rank nang Mas Mababa"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Makikita sa itaas ng seksyon ng pag-uusap, lumalabas bilang floating bubble, ipinapakita sa lock screen ang larawan sa profile"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Mga Setting"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Priyoridad"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Ipinapakita ang app na ito sa ibabaw ng iba pang app sa iyong screen at ginagamit nito ang mikropono at camera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Mga Setting"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Awtomatikong <b>na-promote sa Default</b> ng system ang notification na ito."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Awtomatikong <b>na-demote sa Naka-silent</b> ng system ang notification na ito."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Awtomatikong <b>na-rank nang mas mataas</b> ang notification na ito sa iyong shade."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Awtomatikong <b>na-rank nang mas mababa</b> ang notification na ito sa iyong shade."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Tama ba ito?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Salamat sa iyong feedback!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-tr/strings.xml b/packages/SystemUI/res/values-tr/strings.xml
index 2b89578..2608931 100644
--- a/packages/SystemUI/res/values-tr/strings.xml
+++ b/packages/SystemUI/res/values-tr/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"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>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Düzenle"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Ekran görüntüsünü düzenle"</string>
@@ -548,7 +548,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"Yöneticiniz,cihazınızdaki trafiği izleyen ağ günlük kaydını açtı.\n\nDaha fazla bilgi için yöneticinizle iletişim kurun."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"VPN bağlantısı kurması için bir uygulamaya izin verdiniz.\n\nBu uygulama, cihazınızın yanı sıra e-postalarınız, uygulamalarınız ve web siteleriniz dahil olmak üzere ağ etkinliğinizi izleyebilir."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"İş profiliniz <xliff:g id="ORGANIZATION">%1$s</xliff:g> tarafından yönetiliyor.\n\nYöneticiniz e-postalar, uygulamalar ve web siteleri de dahil olmak üzere ağ etkinliğinizi izleyebilir.\n\nDaha fazla bilgi için yöneticinizle iletişim kurun.\n\nAyrıca, ağ etkinliğinizi izleyebilen bir VPN\'ye de bağlısınız."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Bu cihaz ebeveyniniz tarafından yönetiliyor. Kullandığınız uygulamalar, konumunuz ve ekran başında kalma süreniz gibi bilgiler ebeveyniniz tarafından görülüp yönetebilir."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Bu cihaz ebeveyniniz tarafından yönetiliyor. Kullandığınız uygulamalar, konumunuz ve ekran başında kalma süreniz gibi bilgiler ebeveyniniz tarafından görülüp yönetilebilir."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"VPN"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"E-postalarınız, uygulamalarınız ve web siteleriniz dahil olmak üzere ağ etkinliğinizi izleyebilen <xliff:g id="APPLICATION">%1$s</xliff:g> uygulamasına bağlısınız."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"E-postalarınız, uygulamalarınız ve web siteleriniz dahil olmak üzere kişisel ağ etkinliğinizi izleyebilen <xliff:g id="APPLICATION">%1$s</xliff:g> uygulamasına bağlısınız."</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Telefon ayarlarına bağlı olarak zili çalabilir veya titreyebilir <xliff:g id="APP_NAME">%1$s</xliff:g> adlı uygulamadan görüşmeler varsayılan olarak baloncukla gösterilir."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Kayan kısayolla dikkatinizi bu içerik üzerinde tutar."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Bu bildirimin ses çıkarması veya titreşmesi gerekip gerekmediğine sistem karar versin"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Durum:</b> Varsayılana yükseltildi"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Durum:</b> Sessize Düşürüldü"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Durum:</b> Daha Yüksek Sıralandı"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Durum:</b> Daha Düşük Sıralandı"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Görüşme bölümünün üstünde gösterilir, kayan baloncuk olarak görünür, kilit ekranında profil resmini görüntüler"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Ayarlar"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Öncelik"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Bu uygulama, ekranınızdaki diğer uygulamaların üzerinde görüntüleniyor ve mikrofon ile kamerayı kullanıyor."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Ayarlar"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"Tamam"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Bu bildirim, sistem tarafından otomatik olarak <b>Varsayılana yükseltildi</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Bu bildirim, sistem tarafından otomatik olarak <b>Sessize düşürüldü</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Bu bildirim, gölgenizde otomatik olarak <b>daha yüksek sıralandı</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Bu bildirim, gölgenizde otomatik olarak <b>daha düşük sıralandı</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Bu doğru muydu?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Geri bildiriminiz için teşekkürler!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"Tamam"</string>
diff --git a/packages/SystemUI/res/values-uk/strings.xml b/packages/SystemUI/res/values-uk/strings.xml
index ec7b85a..ce00b92 100644
--- a/packages/SystemUI/res/values-uk/strings.xml
+++ b/packages/SystemUI/res/values-uk/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Не вдалося зберегти знімок екрана"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Додаток або адміністратор вашої організації не дозволяють робити знімки екрана"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Редагувати"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Редагувати знімок екрана"</string>
@@ -554,7 +554,7 @@
<string name="monitoring_description_network_logging" msgid="577305979174002252">"Ваш адміністратор увімкнув реєстрацію в мережі, під час якої на вашому пристрої відстежується трафік.\n\nЩоб дізнатися більше, зв’яжіться з адміністратором."</string>
<string name="monitoring_description_vpn" msgid="1685428000684586870">"Ви дозволили додатку під’єднуватися до мережі VPN.\n\nЦей додаток може відстежувати вашу активність на пристрої та в мережі, зокрема в електронній пошті, додатках і на веб-сайтах."</string>
<string name="monitoring_description_vpn_profile_owned" msgid="4964237035412372751">"Вашим робочим профілем керує адміністратор організації <xliff:g id="ORGANIZATION">%1$s</xliff:g>.\n\nВін може відстежувати ваші дії в мережі, зокрема електронні листи, додатки та веб-сайти.\n\nЩоб дізнатися більше, зв’яжіться з адміністратором.\n\nВаш пристрій також під’єднано до мережі VPN, у якій можна відстежувати ваші дії в мережі."</string>
- <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Цим пристроєм керує батько або мати. Вони можуть бачити та контролювати, якими додатками ви користуєтесь, де перебуваєте й скільки часу проводите за пристроєм."</string>
+ <string name="monitoring_description_parental_controls" msgid="8184693528917051626">"Цим пристроєм керують твої батьки. Вони можуть бачити та контролювати, якими додатками ти користуєшся, де перебуваєш і скільки часу проводиш за пристроєм."</string>
<string name="legacy_vpn_name" msgid="4174223520162559145">"VPN"</string>
<string name="monitoring_description_app" msgid="376868879287922929">"Ваш профіль під’єднано до додатка <xliff:g id="APPLICATION">%1$s</xliff:g>, який може відстежувати вашу активність у мережі, зокрема в електронній пошті, додатках і на веб-сайтах."</string>
<string name="monitoring_description_app_personal" msgid="1970094872688265987">"Ваш профіль під’єднано до додатка <xliff:g id="APPLICATION">%1$s</xliff:g>, який може відстежувати вашу особисту активність у мережі, зокрема в електронній пошті, додатках і на веб-сайтах."</string>
@@ -704,14 +704,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Може дзвонити або вібрувати залежно від налаштувань телефона. Показує спливаючі розмови з додатка <xliff:g id="APP_NAME">%1$s</xliff:g> за умовчанням."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Привертає увагу до контенту плаваючим ярликом."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Дозволити системі визначати, чи має сповіщення супроводжуватися звуком або вібрацією"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Статус</b>: підвищено до \"За умовчанням\""</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Статус</b>: знижено до \"Без звуку\""</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Статус</b>: пріоритет підвищено"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Статус</b>: пріоритет знижено"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"З\'являється вгорі розділу розмов у спливаючому сповіщенні та показує зображення профілю на заблокованому екрані"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Налаштування"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Пріоритет"</string>
@@ -730,14 +726,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Цей додаток відображається поверх інших додатків на екрані та використовує мікрофон і камеру."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Налаштування"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Пріоритет цього сповіщення автоматично <b>підвищено до \"За умовчанням\"</b> у системі."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Пріоритет цього сповіщення автоматично <b>знижено до \"Без звуку\"</b> в системі."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Пріоритет цього сповіщення на панелі сповіщень автоматично <b>підвищено</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Пріоритет цього сповіщення на панелі сповіщень автоматично <b>знижено</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Правильно?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Дякуємо за відгук!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-ur/strings.xml b/packages/SystemUI/res/values-ur/strings.xml
index 15a4f30..0032c6b 100644
--- a/packages/SystemUI/res/values-ur/strings.xml
+++ b/packages/SystemUI/res/values-ur/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"اسکرین شاٹ کو محفوظ نہیں کیا جا سکتا"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ایپ یا آپ کی تنظیم کی جانب سے اسکرین شاٹس لینے کی اجازت نہیں ہے"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"ترمیم کریں"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"اسکرین شاٹ میں ترمیم کریں"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"فون کی ترتیبات کے مطابق وائبریٹ یا گھنٹی بج سکتی ہے۔ بذریعہ ڈیفالٹ <xliff:g id="APP_NAME">%1$s</xliff:g> بلبلہ سے گفتگوئیں۔"</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"اس مواد کے فلوٹنگ شارٹ کٹ کے ساتھ آپ کی توجہ دیتی ہے۔"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"سسٹم کو اس بات کا تعین کرنے دیں کہ آیا اس اطلاع کی آواز ہو یا وائبریٹ ہونا چاہیے"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Status:</b> ڈیفالٹ پر درجہ بند کیا گیا"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>اسٹیٹس:</b> کو خاموش پر درجہ بند کیا گیا"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>اسٹیٹس:</b> کو اعلی درجہ دیا گیا"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>اسٹیٹس:</b> کو کم درجہ دیا گیا"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"گفتگو کے سیکشن کے اوپری حصے پر دکھاتا ہے، تیرتے بلبلے کی طرح ظاہر ہوتا ہے، لاک اسکرین پر پروفائل تصویر دکھاتا ہے"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"ترتیبات"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"ترجیح"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"یہ ایپ آپ کی اسکرین پر دیگر ایپس پر ڈسپلے کر رہی ہے اور مائیکروفون اور کیمرے کا استعمال کر رہی ہے۔"</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"ترتیبات"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"ٹھیک ہے"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"اس اطلاع کو خودکار طور پر سسٹم کے ذریعے <b>ڈیفالٹ پر پروموٹ</b> کیا گیا۔"</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"اس اطلاع کو خودکار طور پر سسٹم کے ذریعے <b>خاموش پر درجہ بند<b> کیا گیا۔"</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"اس اطلاع کو آپ کے شیڈ میں خودکار طور پر <b>اعلی درجہ</b> دیا گیا۔"</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"اس اطلاع کو آپ کے شیڈ میں خودکار طور پر <b>کم درجہ</b> دیا گیا۔"</string>
<string name="feedback_prompt" msgid="2278631214125128281">"کیا یہ درست تھا؟"</string>
<string name="feedback_response" msgid="4671729244976641339">"آپ کے تاثرات کا شکریہ!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"ٹھیک ہے"</string>
diff --git a/packages/SystemUI/res/values-uz/strings.xml b/packages/SystemUI/res/values-uz/strings.xml
index 9e1387e..532fa40 100644
--- a/packages/SystemUI/res/values-uz/strings.xml
+++ b/packages/SystemUI/res/values-uz/strings.xml
@@ -26,7 +26,7 @@
<string name="status_bar_latest_events_title" msgid="202755896454005436">"Eslatmalar"</string>
<string name="battery_low_title" msgid="6891106956328275225">"Batareya tez orada tugaydi"</string>
<string name="battery_low_percent_format" msgid="4276661262843170964">"<xliff:g id="PERCENTAGE">%s</xliff:g> qoldi"</string>
- <string name="battery_low_percent_format_hybrid" msgid="3985614339605686167">"<xliff:g id="PERCENTAGE">%1$s</xliff:g> (joriy holatda taxminan <xliff:g id="TIME">%2$s</xliff:g> qoldi)"</string>
+ <string name="battery_low_percent_format_hybrid" msgid="3985614339605686167">"Batareya qivvati – <xliff:g id="PERCENTAGE">%1$s</xliff:g>, tugashiga taxminan <xliff:g id="TIME">%2$s</xliff:g> qoldi"</string>
<string name="battery_low_percent_format_hybrid_short" msgid="5917433188456218857">"<xliff:g id="PERCENTAGE">%1$s</xliff:g> (taxminan <xliff:g id="TIME">%2$s</xliff:g> qoldi)"</string>
<string name="battery_low_percent_format_saver_started" msgid="4968468824040940688">"<xliff:g id="PERCENTAGE">%s</xliff:g> qoldi. Quvvat tejash rejimi yoniq."</string>
<string name="invalid_charger" msgid="4370074072117767416">"USB orqali quvvatlash imkonsiz. Qurilmangiz bilan kelgan quvvatlash moslamasidan foydalaning."</string>
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Skrinshot saqlanmadi"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Ilova yoki tashkilotingiz skrinshot olishni taqiqlagan"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Tahrirlash"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Skrinshotni tahrirlash"</string>
@@ -499,7 +499,7 @@
<string name="profile_owned_footer" msgid="2756770645766113964">"Profil kuzatilishi mumkin"</string>
<string name="vpn_footer" msgid="3457155078010607471">"Tarmoqni kuzatish mumkin"</string>
<string name="branded_vpn_footer" msgid="816930186313188514">"Tarmoq kuzatilishi mumkin"</string>
- <string name="quick_settings_disclosure_parental_controls" msgid="2114102871438223600">"Bu – ota-onangiz tomonidan boshqariladigan qurilma."</string>
+ <string name="quick_settings_disclosure_parental_controls" msgid="2114102871438223600">"Bu qurilmani ota-onangiz boshqaradi"</string>
<string name="quick_settings_disclosure_management_monitoring" msgid="8231336875820702180">"Bu qurilma tashkilotingizga tegishli va tarmoq trafigi tashkilotingiz tomonidan kuzatilishi mumkin"</string>
<string name="quick_settings_disclosure_named_management_monitoring" msgid="2831423806103479812">"Bu qurilma <xliff:g id="ORGANIZATION_NAME">%1$s</xliff:g> tashkilotiga tegishli va tarmoq trafigi tashkilot tomonidan kuzatilishi mumkin"</string>
<string name="quick_settings_disclosure_management_named_vpn" msgid="6096715329056415588">"Bu qurilma tashkilotingizga tegishli va <xliff:g id="VPN_APP">%1$s</xliff:g> tarmogʻiga ulangan"</string>
@@ -524,7 +524,7 @@
<string name="disable_vpn" msgid="482685974985502922">"VPN tarmog‘ini o‘chirish"</string>
<string name="disconnect_vpn" msgid="26286850045344557">"VPN ulanishini uzish"</string>
<string name="monitoring_button_view_policies" msgid="3869724835853502410">"Siyosatlarni ko‘rish"</string>
- <string name="monitoring_button_view_controls" msgid="8316440345340701117">"Boshqaruvni chiqarish"</string>
+ <string name="monitoring_button_view_controls" msgid="8316440345340701117">"Boshqaruv sozlamalari"</string>
<string name="monitoring_description_named_management" msgid="505833016545056036">"Bu qurilma <xliff:g id="ORGANIZATION_NAME">%1$s</xliff:g> tashkilotiga tegishli.\n\nAT administratori sozlamalar, korporativ ruxsat, ilovalar, qurilmaning geolokatsiyasi va unga aloqador axborotlarni kuzatishi va boshqarishi mumkin.\n\nBatafsil axborot uchun AT administratoriga murojaat qiling."</string>
<string name="monitoring_description_management" msgid="4308879039175729014">"Bu qurilma tashkilotingizga tegishli.\n\nAT administratori sozlamalar, korporativ ruxsat, ilovalar, qurilmaning geolokatsiyasi va unga aloqador axborotlarni kuzatishi va boshqarishi mumkin.\n\nBatafsil axborot uchun AT administratoriga murojaat qiling."</string>
<string name="monitoring_description_management_ca_certificate" msgid="7785013130658110130">"Tashkilotingiz bu qurilmada CA sertifikatini o‘rnatdi. U himoyalangan tarmoq trafigini nazorat qilishi va o‘zgartirishi mumkin."</string>
@@ -683,13 +683,13 @@
<string name="inline_block_button" msgid="479892866568378793">"Bloklash"</string>
<string name="inline_keep_button" msgid="299631874103662170">"Ha"</string>
<string name="inline_minimize_button" msgid="1474436209299333445">"Kichraytirish"</string>
- <string name="inline_silent_button_silent" msgid="525243786649275816">"Tovushsiz"</string>
+ <string name="inline_silent_button_silent" msgid="525243786649275816">"Sokin"</string>
<string name="inline_silent_button_stay_silent" msgid="2129254868305468743">"Ovozsiz qolsin"</string>
<string name="inline_silent_button_alert" msgid="5705343216858250354">"Ogohlantirish"</string>
<string name="inline_silent_button_keep_alerting" msgid="6577845442184724992">"Signal berishda davom etilsin"</string>
<string name="inline_turn_off_notifications" msgid="8543989584403106071">"Bildirishnoma kelmasin"</string>
<string name="inline_keep_showing_app" msgid="4393429060390649757">"Bu ilovadan keladigan bildirishnomalar chiqaversinmi?"</string>
- <string name="notification_silence_title" msgid="8608090968400832335">"Tovushsiz"</string>
+ <string name="notification_silence_title" msgid="8608090968400832335">"Sokin"</string>
<string name="notification_alert_title" msgid="3656229781017543655">"Standart"</string>
<string name="notification_automatic_title" msgid="3745465364578762652">"Avtomatik"</string>
<string name="notification_channel_summary_low" msgid="4860617986908931158">"Tovush yoki tebranishsiz"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Telefon sozlamalari asosida jiringlashi yoki tebranishi mumkin. <xliff:g id="APP_NAME">%1$s</xliff:g> suhbatlari standart holatda bulutcha shaklida chiqadi."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Bu kontentni ochuvchi erkin yorliq diqqatingizda boʻladi."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Bu bildirishnoma jiringlashi yoki tebranishini hal qilsin"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Holati:</b> Birlamchi darajaga chiqarildi"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Holati:</b> Sokin darajaga tushirildi"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Holati:</b> Yuqori darajaga chiqarildi"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Holati:</b> Quyi darajaga tushirildi"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Suhbatlar ruknining tepasida qalqib chiquvchi bulutcha shaklida chiqadi, ekran qulfida profil rasmi chiqadi"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Sozlamalar"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Muhim"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Bu ilova ekranda boshqa ilovalar ustidan ochilgan hamda mikrofon va kameradan foydalanmoqda."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Sozlamalar"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Bu bildirishnomaning muhimlik darajasi tizim tomonidan avtomatik ravishda <b>Birlamchi darajaga chiqarildi</b>."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Bu bildirishnomaning muhimlik darajasi tizim tomonidan avtomatik ravishda <b>Sokin darajaga tushirildi</b>."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Bu bildirishnomaning muhimlik darajasi tizim tomonidan avtomatik ravishda <b>yuqori darajaga chiqarildi</b>."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Bu bildirishnomaning muhimlik darajasi tizim tomonidan avtomatik ravishda <b>quyi darajaga tushirildi</b>."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Xatolar boʻlmadimi?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Fikr-mulohazangiz uchun tashakkur!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-vi/strings.xml b/packages/SystemUI/res/values-vi/strings.xml
index 92929b8..0e99877 100644
--- a/packages/SystemUI/res/values-vi/strings.xml
+++ b/packages/SystemUI/res/values-vi/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Không thể lưu ảnh chụp màn hì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>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Chỉnh sửa"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Chỉnh sửa ảnh chụp màn hình"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Có thể đổ chuông hoặc rung tùy theo chế độ cài đặt trên điện thoại. Theo mặc định, các cuộc trò chuyện từ <xliff:g id="APP_NAME">%1$s</xliff:g> được phép hiển thị dưới dạng bong bóng."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Luôn chú ý vào nội dung này bằng phím tắt nổi."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Cho phép hệ thống quyết định xem thông báo này phát âm thanh hay rung"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Trạng thái:</b> Đã thay đổi thành Mặc định"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Trạng thái:</b> Đã thay đổi thành Im lặng"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Trạng thái:</b> Đã tăng mức độ quan trọng"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Trạng thái:</b> Đã giảm mức độ quan trọng"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Hiển thị cuộc trò chuyện ở đầu phần cuộc trò chuyện và dưới dạng bong bóng nổi, hiển thị ảnh hồ sơ trên màn hình khóa"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Cài đặt"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Mức độ ưu tiên"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Ứng dụng này đang hiển thị chồng lên các ứng dụng khác trên màn hình, đồng thời đang sử dụng micrô và máy ảnh."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Cài đặt"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"OK"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Hệ thống đã tự động <b>thay đổi thành Mặc định</b> theo tầm quan trọng của thông báo này."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Hệ thống đã tự động <b>thay đổi thành Im lặng</b> theo tầm quan trọng của thông báo này."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Hệ thống đã tự động <b>tăng mức độ quan trọng</b> của thông báo này trong ngăn thông báo."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Hệ thống đã tự động <b>giảm mức độ quan trọng</b> của thông báo này trong ngăn thông báo."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Thông tin này có chính xác không?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Cảm ơn bạn đã phản hồi!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"OK"</string>
diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml
index 827ca5f..07232ff 100644
--- a/packages/SystemUI/res/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"无法保存屏幕截图"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"此应用或您所在的单位不允许进行屏幕截图"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"编辑"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"编辑屏幕截图"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"可能会响铃或振动(取决于手机设置)。默认情况下,来自<xliff:g id="APP_NAME">%1$s</xliff:g>的对话会以对话泡的形式显示。"</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"通过可链接到这项内容的浮动快捷方式吸引您的注意。"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"让系统决定是否应让设备在收到此通知时发出提示音或振动"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>状态</b>:已提升为“默认”"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>状态</b>:已降低为“静音”"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>状态</b>:已调高顺序"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>状态</b>:已调低顺序"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"以悬浮对话泡形式显示在对话部分顶部,如果设备处于锁定状态,在锁定屏幕上显示个人资料照片"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"设置"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"优先"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"此应用正显示在屏幕上其他应用的上层,并且正在使用麦克风和摄像头。"</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"设置"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"确定"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"系统已自动将此通知的重要性<b>提升为“默认”</b>。"</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"系统已自动将此通知的重要性<b>降低为“静音”</b>。"</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"系统已自动<b>调高</b>此通知在通知栏中的顺序。"</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"系统已自动<b>调低</b>此通知在通知栏中的顺序。"</string>
<string name="feedback_prompt" msgid="2278631214125128281">"是否正确?"</string>
<string name="feedback_response" msgid="4671729244976641339">"感谢您提供反馈!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"确定"</string>
diff --git a/packages/SystemUI/res/values-zh-rHK/strings.xml b/packages/SystemUI/res/values-zh-rHK/strings.xml
index 50bac07..7a07af1 100644
--- a/packages/SystemUI/res/values-zh-rHK/strings.xml
+++ b/packages/SystemUI/res/values-zh-rHK/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"無法儲存螢幕截圖"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"應用程式或您的機構不允許擷取螢幕畫面"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"編輯"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"編輯螢幕截圖"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"可能會根據手機設定發出鈴聲或震動。「<xliff:g id="APP_NAME">%1$s</xliff:g>」的對話會預設以對話氣泡顯示。"</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"為此內容建立浮動捷徑以保持注意力。"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"由系統判斷是否要讓此通知發出音效或震動"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>狀態:</b>已提升為預設"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>狀態:</b>已降低為靜音"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>狀態:</b>已提高次序"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>狀態:</b>已調低次序"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"以浮動對話泡顯示在對話部分的頂部,並在上鎖畫面顯示個人檔案相片"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"設定"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"重要"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"此應用程式目前透過其他應用程式在畫面上顯示內容,且正在使用麥克風和相機。"</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"設定"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"確定"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"系統已自動將此通知的重要性<b>提升為預設</b>。"</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"系統已自動將此通知的重要性<b>降低為靜音</b>。"</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"系統已自動<b>提高</b>此通知在通知欄中的次序。"</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"系統已自動<b>調低</b>此通知在通知欄中的次序。"</string>
<string name="feedback_prompt" msgid="2278631214125128281">"是否正確?"</string>
<string name="feedback_response" msgid="4671729244976641339">"多謝您提供意見!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"確定"</string>
diff --git a/packages/SystemUI/res/values-zh-rTW/strings.xml b/packages/SystemUI/res/values-zh-rTW/strings.xml
index 0ff8ffa..0369d63 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"無法儲存螢幕截圖"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"這個應用程式或貴機構不允許擷取螢幕畫面"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"編輯"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"編輯螢幕截圖"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"可能會根據手機的設定響鈴或震動。根據預設,來自「<xliff:g id="APP_NAME">%1$s</xliff:g>」的對話會以對話框形式顯示。"</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"利用浮動式捷徑快速存取這項內容。"</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"由系統判斷要讓裝置在收到這則通知時震動還是發出音效"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>狀態:</b>已提升為預設"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>狀態:</b>已降低為靜音"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>狀態:</b>已調高順序"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>狀態:</b>已調降順序"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"以浮動對話框的形式顯示在對話部分的頂端。如果裝置處於鎖定狀態,則在螢幕鎖定畫面上顯示個人資料相片"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"設定"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"優先"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"這個應用程式顯示在畫面上其他應用程式的上層,且正在使用麥克風和相機。"</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"設定"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"確定"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"系統已自動將這則通知的重要性<b>提升為預設</b>。"</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"系統已自動將這則通知的重要性<b>降低為靜音</b>。"</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"系統已自動<b>調高</b>這則通知在通知欄中的順序。"</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"系統已自動<b>調降</b>這則通知在通知欄中的順序。"</string>
<string name="feedback_prompt" msgid="2278631214125128281">"是否正確?"</string>
<string name="feedback_response" msgid="4671729244976641339">"感謝你提供意見!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"確定"</string>
diff --git a/packages/SystemUI/res/values-zu/strings.xml b/packages/SystemUI/res/values-zu/strings.xml
index 321fd20..068e2e5 100644
--- a/packages/SystemUI/res/values-zu/strings.xml
+++ b/packages/SystemUI/res/values-zu/strings.xml
@@ -85,7 +85,7 @@
<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_save_text" msgid="7232739948999195960">"Ayikwazi ukulondoloza isithombe-skrini"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Ukuthatha izithombe-skrini akuvunyelwe uhlelo lokusebenza noma inhlangano yakho"</string>
<string name="screenshot_edit_label" msgid="8754981973544133050">"Hlela"</string>
<string name="screenshot_edit_description" msgid="3333092254706788906">"Hlela isithombe-skrini"</string>
@@ -698,14 +698,10 @@
<string name="notification_channel_summary_default_with_bubbles" msgid="1782419896613644568">"Ingase ikhale noma idlidlize kuya ngamasethingi wefoni yakho. Izingxoxo ezivela ku-<xliff:g id="APP_NAME">%1$s</xliff:g> ziba yibhamuza ngokuzenzakalela."</string>
<string name="notification_channel_summary_bubble" msgid="7235935211580860537">"Igcina ukunaka kwakho ngesinqamuleli esintantayo kulokhu okuqukethwe."</string>
<string name="notification_channel_summary_automatic" msgid="5813109268050235275">"Vumela isistimu inqume uma lesi saziso kufanele senze umsindo noma sidlidlize"</string>
- <!-- no translation found for notification_channel_summary_automatic_alerted (954166812246932240) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_silenced (7403004439649872047) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_promoted (1301710305149590426) -->
- <skip />
- <!-- no translation found for notification_channel_summary_automatic_demoted (1831303964660807700) -->
- <skip />
+ <string name="notification_channel_summary_automatic_alerted" msgid="954166812246932240">"<b>Isimo:</b> Siphromothelwe Kokuzenzakalelayo"</string>
+ <string name="notification_channel_summary_automatic_silenced" msgid="7403004439649872047">"<b>Isimo:</b> Sehliselwe Kokuthulile"</string>
+ <string name="notification_channel_summary_automatic_promoted" msgid="1301710305149590426">"<b>Isimo:</b> Silinganiselwe phezulu"</string>
+ <string name="notification_channel_summary_automatic_demoted" msgid="1831303964660807700">"<b>Isimo:</b> Silinganiselwe phansi"</string>
<string name="notification_channel_summary_priority" msgid="7952654515769021553">"Iboniswa ngenhla kwesigaba sengxoxo, ivela njengebhamuza elintantayo, ibonisa isithombe sephrofayela kukukhiya isikrini"</string>
<string name="notification_conversation_channel_settings" msgid="2409977688430606835">"Izilungiselelo"</string>
<string name="notification_priority_title" msgid="2079708866333537093">"Okubalulekile"</string>
@@ -724,14 +720,10 @@
<string name="appops_camera_mic_overlay" msgid="5584311236445644095">"Lolu hlelo lokusebenza liboniswa ngaphezulu kwezinye izinhlelo zokusebenza kusikrini sakho futhi kusetshenziswa imakrofoni nekhamera."</string>
<string name="notification_appops_settings" msgid="5208974858340445174">"Izilungiselelo"</string>
<string name="notification_appops_ok" msgid="2177609375872784124">"KULUNGILE"</string>
- <!-- no translation found for feedback_alerted (5192459808484271208) -->
- <skip />
- <!-- no translation found for feedback_silenced (9116540317466126457) -->
- <skip />
- <!-- no translation found for feedback_promoted (2125562787759780807) -->
- <skip />
- <!-- no translation found for feedback_demoted (951884763467110604) -->
- <skip />
+ <string name="feedback_alerted" msgid="5192459808484271208">"Lesi saziso siphromothwe <b>ngokuzenzakalelayo saba Okuzenzakalelayo</b> isistimu."</string>
+ <string name="feedback_silenced" msgid="9116540317466126457">"Lesi saziso sehliswe isikhundla ngokuzenzakalelayo <b>saba Okuthulile</b> isistimu."</string>
+ <string name="feedback_promoted" msgid="2125562787759780807">"Lesi saziso silinganiselwe phezulu <b>ngokuzenzakalelayo</b> kumthunzi wakho."</string>
+ <string name="feedback_demoted" msgid="951884763467110604">"Lesi saziso silinganiselwe phansi <b>ngokuzenzakalelayo</b> kumthunzi wakho."</string>
<string name="feedback_prompt" msgid="2278631214125128281">"Ingabe kade kulungile lokhu?"</string>
<string name="feedback_response" msgid="4671729244976641339">"Siyabonga ngempendulo!"</string>
<string name="feedback_ok" msgid="6481426753298857144">"KULUNGILE"</string>
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/pip/PipSurfaceTransactionHelper.java b/packages/SystemUI/shared/src/com/android/systemui/shared/pip/PipSurfaceTransactionHelper.java
index 22ffd28..7f04f28 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/pip/PipSurfaceTransactionHelper.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/pip/PipSurfaceTransactionHelper.java
@@ -19,6 +19,8 @@
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.RectF;
+import android.view.Choreographer;
+import android.view.Surface;
import android.view.SurfaceControl;
/**
@@ -50,8 +52,32 @@
.setPosition(leash, left, top);
}
- public void reset(SurfaceControl.Transaction tx, SurfaceControl leash, Rect destinationBounds) {
+ public void scaleAndRotate(SurfaceControl.Transaction tx, SurfaceControl leash,
+ Rect sourceBounds, Rect destinationBounds, Rect insets,
+ float degree, float positionX, float positionY) {
+ mTmpSourceRectF.set(sourceBounds);
+ mTmpDestinationRect.set(sourceBounds);
+ mTmpDestinationRect.inset(insets);
+ // Scale by the shortest edge and offset such that the top/left of the scaled inset
+ // source rect aligns with the top/left of the destination bounds
+ final float scale = sourceBounds.width() <= sourceBounds.height()
+ ? (float) destinationBounds.width() / sourceBounds.width()
+ : (float) destinationBounds.height() / sourceBounds.height();
+ mTmpTransform.setRotate(degree, 0, 0);
+ mTmpTransform.postScale(scale, scale);
+ tx.setMatrix(leash, mTmpTransform, mTmpFloat9)
+ .setWindowCrop(leash, mTmpDestinationRect)
+ .setPosition(leash, positionX, positionY);
+ }
+
+ public void reset(SurfaceControl.Transaction tx, SurfaceControl leash, Rect destinationBounds,
+ @Surface.Rotation int rotation) {
resetScale(tx, leash, destinationBounds);
+ if (rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270) {
+ final int degree = (rotation == Surface.ROTATION_90) ? -90 : 90;
+ mTmpTransform.setRotate(degree, 0, 0);
+ tx.setMatrix(leash, mTmpTransform, mTmpFloat9);
+ }
resetCornerRadius(tx, leash);
crop(tx, leash, destinationBounds);
}
@@ -71,4 +97,11 @@
tx.setWindowCrop(leash, destinationBounds.width(), destinationBounds.height())
.setPosition(leash, destinationBounds.left, destinationBounds.top);
}
+
+ /** @return {@link SurfaceControl.Transaction} instance with vsync-id */
+ public static SurfaceControl.Transaction newSurfaceControlTransaction() {
+ final SurfaceControl.Transaction tx = new SurfaceControl.Transaction();
+ tx.setFrameTimelineVsync(Choreographer.getSfInstance().getVsyncId());
+ return tx;
+ }
}
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/LatencyTrackerCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/LatencyTrackerCompat.java
index bf4fb0b..a8c19ec 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/LatencyTrackerCompat.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/LatencyTrackerCompat.java
@@ -24,10 +24,6 @@
* @see LatencyTracker
*/
public class LatencyTrackerCompat {
- public static boolean isEnabled(Context context) {
- return LatencyTracker.isEnabled(context);
- }
-
/**
* @see LatencyTracker
* @deprecated Please use {@link LatencyTrackerCompat#logToggleRecents(Context, int)} instead.
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ViewTreeObserverWrapper.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ViewTreeObserverWrapper.java
index 4a870f1..cfb23f9 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ViewTreeObserverWrapper.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ViewTreeObserverWrapper.java
@@ -16,6 +16,7 @@
package com.android.systemui.shared.system;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.graphics.Rect;
import android.graphics.Region;
@@ -26,18 +27,21 @@
public class ViewTreeObserverWrapper {
+ private static final HashMap<OnComputeInsetsListener, ViewTreeObserver>
+ sListenerObserverMap = new HashMap<>();
private static final HashMap<OnComputeInsetsListener, OnComputeInternalInsetsListener>
- sOnComputeInsetsListenerMap = new HashMap<>();
+ sListenerInternalListenerMap = new HashMap<>();
/**
- * Register a callback to be invoked when the invoked when it is time to
- * compute the window's insets.
+ * Register a callback to be invoked when the invoked when it is time to compute the window's
+ * insets.
*
+ * @param observer The observer to be added
* @param listener The callback to add
* @throws IllegalStateException If {@link ViewTreeObserver#isAlive()} returns false
*/
public static void addOnComputeInsetsListener(
- ViewTreeObserver observer, OnComputeInsetsListener listener) {
+ @NonNull ViewTreeObserver observer, @NonNull OnComputeInsetsListener listener) {
final OnComputeInternalInsetsListener internalListener = internalInOutInfo -> {
final InsetsInfo inOutInfo = new InsetsInfo();
inOutInfo.contentInsets.set(internalInOutInfo.contentInsets);
@@ -49,23 +53,26 @@
internalInOutInfo.touchableRegion.set(inOutInfo.touchableRegion);
internalInOutInfo.setTouchableInsets(inOutInfo.mTouchableInsets);
};
- sOnComputeInsetsListenerMap.put(listener, internalListener);
+ sListenerObserverMap.put(listener, observer);
+ sListenerInternalListenerMap.put(listener, internalListener);
observer.addOnComputeInternalInsetsListener(internalListener);
}
/**
- * Remove a previously installed insets computation callback
+ * Remove a previously installed insets computation callback.
*
* @param victim The callback to remove
* @throws IllegalStateException If {@link ViewTreeObserver#isAlive()} returns false
* @see #addOnComputeInsetsListener(ViewTreeObserver, OnComputeInsetsListener)
*/
- public void removeOnComputeInsetsListener(
- ViewTreeObserver observer, OnComputeInsetsListener victim) {
- final OnComputeInternalInsetsListener listener = sOnComputeInsetsListenerMap.get(victim);
- if (listener != null) {
+ public static void removeOnComputeInsetsListener(@NonNull OnComputeInsetsListener victim) {
+ final ViewTreeObserver observer = sListenerObserverMap.get(victim);
+ final OnComputeInternalInsetsListener listener = sListenerInternalListenerMap.get(victim);
+ if (observer != null && listener != null) {
observer.removeOnComputeInternalInsetsListener(listener);
}
+ sListenerObserverMap.remove(victim);
+ sListenerInternalListenerMap.remove(victim);
}
/**
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java b/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java
index 901a736..77e568c 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java
@@ -37,16 +37,19 @@
import com.android.keyguard.dagger.KeyguardStatusViewComponent;
import com.android.systemui.Dependency;
import com.android.systemui.R;
+import com.android.systemui.dagger.qualifiers.UiBackground;
import com.android.systemui.navigationbar.NavigationBarController;
import com.android.systemui.navigationbar.NavigationBarView;
+import java.util.concurrent.Executor;
+
import javax.inject.Inject;
public class KeyguardDisplayManager {
protected static final String TAG = "KeyguardDisplayManager";
private static boolean DEBUG = KeyguardConstants.DEBUG;
- private final MediaRouter mMediaRouter;
+ private MediaRouter mMediaRouter = null;
private final DisplayManager mDisplayService;
private final KeyguardStatusViewComponent.Factory mKeyguardStatusViewComponentFactory;
private final Context mContext;
@@ -90,10 +93,11 @@
@Inject
public KeyguardDisplayManager(Context context,
- KeyguardStatusViewComponent.Factory keyguardStatusViewComponentFactory) {
+ KeyguardStatusViewComponent.Factory keyguardStatusViewComponentFactory,
+ @UiBackground Executor uiBgExecutor) {
mContext = context;
mKeyguardStatusViewComponentFactory = keyguardStatusViewComponentFactory;
- mMediaRouter = mContext.getSystemService(MediaRouter.class);
+ uiBgExecutor.execute(() -> mMediaRouter = mContext.getSystemService(MediaRouter.class));
mDisplayService = mContext.getSystemService(DisplayManager.class);
mDisplayService.registerDisplayListener(mDisplayListener, null /* handler */);
}
@@ -162,8 +166,12 @@
public void show() {
if (!mShowing) {
if (DEBUG) Log.v(TAG, "show");
- mMediaRouter.addCallback(MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY,
- mMediaRouterCallback, MediaRouter.CALLBACK_FLAG_PASSIVE_DISCOVERY);
+ if (mMediaRouter != null) {
+ mMediaRouter.addCallback(MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY,
+ mMediaRouterCallback, MediaRouter.CALLBACK_FLAG_PASSIVE_DISCOVERY);
+ } else {
+ Log.w(TAG, "MediaRouter not yet initialized");
+ }
updateDisplays(true /* showing */);
}
mShowing = true;
@@ -172,7 +180,9 @@
public void hide() {
if (mShowing) {
if (DEBUG) Log.v(TAG, "hide");
- mMediaRouter.removeCallback(mMediaRouterCallback);
+ if (mMediaRouter != null) {
+ mMediaRouter.removeCallback(mMediaRouterCallback);
+ }
updateDisplays(false /* showing */);
}
mShowing = false;
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java
index 3fafa5c..ea60f0d 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java
@@ -375,6 +375,17 @@
}
/**
+ * @return true if the current bouncer is password
+ */
+ public boolean dispatchBackKeyEventPreIme() {
+ if (mKeyguardSecurityContainerController.getCurrentSecurityMode()
+ == SecurityMode.Password) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
* Allows the media keys to work when the keyguard is showing.
* The media keys should be of no interest to the actual keyguard view(s),
* so intercepting them here should not be of any harm.
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java
index d42a53c..d58b95c 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java
@@ -43,6 +43,10 @@
abstract CharSequence getTitle();
+ void animateForIme(float interpolatedFraction) {
+ return;
+ }
+
boolean disallowInterceptTouch(MotionEvent event) {
return false;
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
index aaa5efe..92b65b2 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
@@ -136,24 +136,14 @@
@Override
public void startAppearAnimation() {
+ // Reset state, and let IME animation reveal the view as it slides in
setAlpha(0f);
setTranslationY(0f);
- animate()
- .alpha(1)
- .withLayer()
- .setDuration(300)
- .setInterpolator(mLinearOutSlowInInterpolator);
}
@Override
- public boolean startDisappearAnimation(Runnable finishRunnable) {
- animate()
- .alpha(0f)
- .translationY(mDisappearYTranslation)
- .setInterpolator(mFastOutLinearInInterpolator)
- .setDuration(100)
- .withEndAction(finishRunnable);
- return true;
+ public void animateForIme(float interpolatedFraction) {
+ setAlpha(interpolatedFraction);
}
@Override
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java
index 5e33917..0f1c3c8 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java
@@ -194,14 +194,18 @@
@Override
public void onResume(int reason) {
super.onResume(reason);
- // Wait a bit to focus the field so the focusable flag on the window is already set then.
- mMainExecutor.execute(() -> {
- if (mView.isShown() && mPasswordEntry.isEnabled()) {
- mPasswordEntry.requestFocus();
- if (reason != KeyguardSecurityView.SCREEN_ON || mShowImeAtScreenOn) {
- mInputMethodManager.showSoftInput(
- mPasswordEntry, InputMethodManager.SHOW_IMPLICIT);
- }
+
+ mPasswordEntry.requestFocus();
+ if (reason != KeyguardSecurityView.SCREEN_ON || mShowImeAtScreenOn) {
+ showInput();
+ }
+ }
+
+ private void showInput() {
+ mPasswordEntry.post(() -> {
+ if (mPasswordEntry.isFocused() && mView.isShown()) {
+ mInputMethodManager.showSoftInput(
+ mPasswordEntry, InputMethodManager.SHOW_IMPLICIT);
}
});
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
index b62ea6b..42f3cc7 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
@@ -119,21 +119,24 @@
@Override
public WindowInsets onProgress(WindowInsets windowInsets,
List<WindowInsetsAnimation> list) {
- int translationY = 0;
if (mDisappearAnimRunning) {
mSecurityViewFlipper.setTranslationY(
mInitialBounds.bottom - mFinalBounds.bottom);
} else {
+ int translationY = 0;
+ float interpolatedFraction = 1f;
for (WindowInsetsAnimation animation : list) {
if ((animation.getTypeMask() & WindowInsets.Type.ime()) == 0) {
continue;
}
+ interpolatedFraction = animation.getInterpolatedFraction();
+
final int paddingBottom = (int) MathUtils.lerp(
mInitialBounds.bottom - mFinalBounds.bottom, 0,
- animation.getInterpolatedFraction());
+ interpolatedFraction);
translationY += paddingBottom;
}
- mSecurityViewFlipper.setTranslationY(translationY);
+ mSecurityViewFlipper.animateForIme(translationY, interpolatedFraction);
}
return windowInsets;
}
@@ -141,7 +144,7 @@
@Override
public void onEnd(WindowInsetsAnimation animation) {
if (!mDisappearAnimRunning) {
- mSecurityViewFlipper.setTranslationY(0);
+ mSecurityViewFlipper.animateForIme(0, /* interpolatedFraction */ 1f);
}
}
};
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipper.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipper.java
index b8439af..7773fe9 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipper.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipper.java
@@ -83,6 +83,16 @@
return "";
}
+ /**
+ * Translate the entire view, and optionally inform the wrapped view of the progress
+ * so it can animate with the parent.
+ */
+ public void animateForIme(int translationY, float interpolatedFraction) {
+ super.setTranslationY(translationY);
+ KeyguardInputView v = getSecurityView();
+ if (v != null) v.animateForIme(interpolatedFraction);
+ }
+
@Override
protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
return p instanceof LayoutParams;
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
index 3cbab8e..fb97a30 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
@@ -26,6 +26,7 @@
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
+import android.graphics.drawable.InsetDrawable;
import android.graphics.text.LineBreaker;
import android.net.Uri;
import android.os.Trace;
@@ -239,6 +240,12 @@
final int iconSize = mHasHeader ? mIconSizeWithHeader : mIconSize;
iconDrawable = icon.getIcon().loadDrawable(mContext);
if (iconDrawable != null) {
+ if ((iconDrawable instanceof InsetDrawable)
+ && mLockScreenMode == KeyguardUpdateMonitor.LOCK_SCREEN_MODE_LAYOUT_1) {
+ // System icons (DnD) use insets which are fine for centered slice content
+ // but will cause a slight indent for left/right-aligned slice views
+ iconDrawable = ((InsetDrawable) iconDrawable).getDrawable();
+ }
final int width = (int) (iconDrawable.getIntrinsicWidth()
/ (float) iconDrawable.getIntrinsicHeight() * iconSize);
iconDrawable.setBounds(0, 0, Math.max(width, 1), iconSize);
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 2071cfa..b43496c 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -1901,6 +1901,15 @@
}
/**
+ * Whether to show the lock icon on lock screen and bouncer. This depends on the enrolled
+ * biometrics to the device.
+ */
+ public boolean shouldShowLockIcon() {
+ return isFaceAuthEnabledForUser(KeyguardUpdateMonitor.getCurrentUser())
+ && !isUdfpsEnrolled();
+ }
+
+ /**
* @return true if there's at least one udfps enrolled
*/
public boolean isUdfpsEnrolled() {
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationGestureDetector.java b/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationGestureDetector.java
new file mode 100644
index 0000000..4c892e29
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationGestureDetector.java
@@ -0,0 +1,195 @@
+/*
+ * 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.accessibility;
+
+import android.annotation.DisplayContext;
+import android.annotation.NonNull;
+import android.content.Context;
+import android.graphics.PointF;
+import android.os.Handler;
+import android.view.Display;
+import android.view.MotionEvent;
+import android.view.ViewConfiguration;
+
+/**
+ * Detects single tap and drag gestures using the supplied {@link MotionEvent}s. The {@link
+ * OnGestureListener} callback will notify users when a particular motion event has occurred. This
+ * class should only be used with {@link MotionEvent}s reported via touch (don't use for trackball
+ * events).
+ */
+class MagnificationGestureDetector {
+
+ interface OnGestureListener {
+ /**
+ * Called when a tap is completed within {@link ViewConfiguration#getLongPressTimeout()} and
+ * the offset between {@link MotionEvent}s and the down event doesn't exceed {@link
+ * ViewConfiguration#getScaledTouchSlop()}.
+ *
+ * @return {@code true} if this gesture is handled.
+ */
+ boolean onSingleTap();
+
+ /**
+ * Called when the user is performing dragging gesture. It is started after the offset
+ * between the down location and the move event location exceed
+ * {@link ViewConfiguration#getScaledTouchSlop()}.
+ *
+ * @param offsetX The X offset in screen coordinate.
+ * @param offsetY The Y offset in screen coordinate.
+ * @return {@code true} if this gesture is handled.
+ */
+ boolean onDrag(float offsetX, float offsetY);
+
+ /**
+ * Notified when a tap occurs with the down {@link MotionEvent} that triggered it. This will
+ * be triggered immediately for every down event. All other events should be preceded by
+ * this.
+ *
+ * @param x The X coordinate of the down event.
+ * @param y The Y coordinate of the down event.
+ * @return {@code true} if the down event is handled, otherwise the events won't be sent to
+ * the view.
+ */
+ boolean onStart(float x, float y);
+
+ /**
+ * Called when the detection is finished. In other words, it is called when up/cancel {@link
+ * MotionEvent} is received. It will be triggered after single-tap
+ *
+ * @param x The X coordinate on the screen of the up event or the cancel event.
+ * @param y The Y coordinate on the screen of the up event or the cancel event.
+ * @return {@code true} if the event is handled.
+ */
+ boolean onFinish(float x, float y);
+ }
+
+ private final PointF mPointerDown = new PointF();
+ private final PointF mPointerLocation = new PointF(Float.NaN, Float.NaN);
+ private final Handler mHandler;
+ private final Runnable mCancelTapGestureRunnable;
+ private final OnGestureListener mOnGestureListener;
+ private int mTouchSlopSquare;
+ // Assume the gesture default is a single-tap. Set it to false if the gesture couldn't be a
+ // single-tap anymore.
+ private boolean mDetectSingleTap = true;
+ private boolean mDraggingDetected = false;
+
+ /**
+ * @param context {@link Context} that is from {@link Context#createDisplayContext(Display)}.
+ * @param handler The handler to post the runnable.
+ * @param listener The listener invoked for all the callbacks.
+ */
+ MagnificationGestureDetector(@DisplayContext Context context, @NonNull Handler handler,
+ @NonNull OnGestureListener listener) {
+ final int touchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
+ mTouchSlopSquare = touchSlop * touchSlop;
+ mHandler = handler;
+ mOnGestureListener = listener;
+ mCancelTapGestureRunnable = () -> mDetectSingleTap = false;
+ }
+
+ /**
+ * Analyzes the given motion event and if applicable to trigger the appropriate callbacks on the
+ * {@link OnGestureListener} supplied.
+ *
+ * @param event The current motion event.
+ * @return {@code True} if the {@link OnGestureListener} consumes the event, else false.
+ */
+ boolean onTouch(MotionEvent event) {
+ final float rawX = event.getRawX();
+ final float rawY = event.getRawY();
+ boolean handled = false;
+ switch (event.getAction()) {
+ case MotionEvent.ACTION_DOWN:
+ mPointerDown.set(rawX, rawY);
+ mHandler.postAtTime(mCancelTapGestureRunnable,
+ event.getDownTime() + ViewConfiguration.getLongPressTimeout());
+ handled |= mOnGestureListener.onStart(rawX, rawY);
+ break;
+ case MotionEvent.ACTION_POINTER_DOWN:
+ stopSingleTapDetection();
+ break;
+ case MotionEvent.ACTION_MOVE:
+ stopSingleTapDetectionIfNeeded(rawX, rawY);
+ handled |= notifyDraggingGestureIfNeeded(rawX, rawY);
+ break;
+ case MotionEvent.ACTION_UP:
+ stopSingleTapDetectionIfNeeded(rawX, rawY);
+ if (mDetectSingleTap) {
+ handled |= mOnGestureListener.onSingleTap();
+ }
+ // Fall through
+ case MotionEvent.ACTION_CANCEL:
+ handled |= mOnGestureListener.onFinish(rawX, rawY);
+ reset();
+ break;
+ }
+ return handled;
+ }
+
+ private void stopSingleTapDetectionIfNeeded(float x, float y) {
+ if (mDraggingDetected) {
+ return;
+ }
+ if (!isLocationValid(mPointerDown)) {
+ return;
+ }
+
+ final int deltaX = (int) (mPointerDown.x - x);
+ final int deltaY = (int) (mPointerDown.y - y);
+ final int distanceSquare = (deltaX * deltaX) + (deltaY * deltaY);
+ if (distanceSquare > mTouchSlopSquare) {
+ mDraggingDetected = true;
+ stopSingleTapDetection();
+ }
+ }
+
+ private void stopSingleTapDetection() {
+ mHandler.removeCallbacks(mCancelTapGestureRunnable);
+ mDetectSingleTap = false;
+ }
+
+ private boolean notifyDraggingGestureIfNeeded(float x, float y) {
+ if (!mDraggingDetected) {
+ return false;
+ }
+ if (!isLocationValid(mPointerLocation)) {
+ mPointerLocation.set(mPointerDown);
+ }
+ final float offsetX = x - mPointerLocation.x;
+ final float offsetY = y - mPointerLocation.y;
+ mPointerLocation.set(x, y);
+ return mOnGestureListener.onDrag(offsetX, offsetY);
+ }
+
+ private void reset() {
+ resetPointF(mPointerDown);
+ resetPointF(mPointerLocation);
+ mHandler.removeCallbacks(mCancelTapGestureRunnable);
+ mDetectSingleTap = true;
+ mDraggingDetected = false;
+ }
+
+ private static void resetPointF(PointF pointF) {
+ pointF.x = Float.NaN;
+ pointF.y = Float.NaN;
+ }
+
+ private static boolean isLocationValid(PointF location) {
+ return !Float.isNaN(location.x) && !Float.isNaN(location.y);
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java b/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java
index edc3216..c1cf8d3 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java
@@ -22,16 +22,13 @@
import android.content.Context;
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;
-import android.util.MathUtils;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
-import android.view.ViewConfiguration;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
import android.view.accessibility.AccessibilityManager;
@@ -46,11 +43,11 @@
/**
* 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.
+ * {@link Settings.Secure#ACCESSIBILITY_MAGNIFICATION_MODE} when the UI is toggled.
* The button icon is movable by dragging. And the button UI would automatically be dismissed after
* displaying for a period of time.
*/
-class MagnificationModeSwitch {
+class MagnificationModeSwitch implements MagnificationGestureDetector.OnGestureListener {
@VisibleForTesting
static final long FADING_ANIMATION_DURATION_MS = 300;
@@ -66,13 +63,11 @@
private final AccessibilityManager mAccessibilityManager;
private final WindowManager mWindowManager;
private final ImageView mImageView;
- private final PointF mLastDown = new PointF();
- private final PointF mLastDrag = new PointF();
- private final int mTapTimeout = ViewConfiguration.getTapTimeout();
- private final int mTouchSlop;
private int mMagnificationMode = Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN;
private final LayoutParams mParams;
private boolean mIsVisible = false;
+ private final MagnificationGestureDetector mGestureDetector;
+ private boolean mSingleTapDetected = false;
MagnificationModeSwitch(Context context) {
this(context, createView(context));
@@ -86,7 +81,6 @@
Context.WINDOW_SERVICE);
mParams = createLayoutParams(context);
mImageView = imageView;
- mTouchSlop = ViewConfiguration.get(mContext).getScaledTouchSlop();
applyResourcesValues();
mImageView.setOnTouchListener(this::onTouch);
mImageView.setAccessibilityDelegate(new View.AccessibilityDelegate() {
@@ -127,6 +121,8 @@
.start();
mIsFadeOutAnimating = true;
};
+ mGestureDetector = new MagnificationGestureDetector(context,
+ context.getMainThreadHandler(), this);
}
private CharSequence formatStateDescription() {
@@ -144,39 +140,38 @@
}
private boolean onTouch(View v, MotionEvent event) {
- if (!mIsVisible || mImageView == null) {
+ if (!mIsVisible) {
return false;
}
- switch (event.getAction()) {
- case MotionEvent.ACTION_DOWN:
- stopFadeOutAnimation();
- mLastDown.set(event.getRawX(), event.getRawY());
- mLastDrag.set(event.getRawX(), event.getRawY());
- return true;
- case MotionEvent.ACTION_MOVE:
- // Move the button position.
- moveButton(event.getRawX() - mLastDrag.x,
- event.getRawY() - mLastDrag.y);
- mLastDrag.set(event.getRawX(), event.getRawY());
- return true;
- case MotionEvent.ACTION_UP:
- // Single tap to toggle magnification mode and the button position will be reset
- // after the action is performed.
- final float distance = MathUtils.dist(mLastDown.x, mLastDown.y,
- event.getRawX(), event.getRawY());
- if ((event.getEventTime() - event.getDownTime()) <= mTapTimeout
- && distance <= mTouchSlop) {
- handleSingleTap();
- } else {
- showButton(mMagnificationMode);
- }
- return true;
- case MotionEvent.ACTION_CANCEL:
- showButton(mMagnificationMode);
- return true;
- default:
- return false;
+ return mGestureDetector.onTouch(event);
+ }
+
+ @Override
+ public boolean onSingleTap() {
+ mSingleTapDetected = true;
+ handleSingleTap();
+ return true;
+ }
+
+ @Override
+ public boolean onDrag(float offsetX, float offsetY) {
+ moveButton(offsetX, offsetY);
+ return true;
+ }
+
+ @Override
+ public boolean onStart(float x, float y) {
+ stopFadeOutAnimation();
+ return true;
+ }
+
+ @Override
+ public boolean onFinish(float xOffset, float yOffset) {
+ if (!mSingleTapDetected) {
+ showButton(mMagnificationMode);
}
+ mSingleTapDetected = false;
+ return true;
}
private void moveButton(float offsetX, float offsetY) {
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationController.java b/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationController.java
index 87dc6a5..3f7d2d8 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationController.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationController.java
@@ -20,6 +20,8 @@
import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_2BUTTON;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL;
+import android.animation.ObjectAnimator;
+import android.animation.PropertyValuesHolder;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
@@ -28,7 +30,6 @@
import android.graphics.Matrix;
import android.graphics.PixelFormat;
import android.graphics.Point;
-import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Region;
@@ -66,7 +67,7 @@
* Class to handle adding and removing a window magnification.
*/
class WindowMagnificationController implements View.OnTouchListener, SurfaceHolder.Callback,
- MirrorWindowControl.MirrorWindowDelegate {
+ MirrorWindowControl.MirrorWindowDelegate, MagnificationGestureDetector.OnGestureListener {
private static final String TAG = "WindowMagnificationController";
// Delay to avoid updating state description too frequently.
@@ -74,6 +75,7 @@
// It should be consistent with the value defined in WindowMagnificationGestureHandler.
private static final Range<Float> A11Y_ACTION_SCALE_RANGE = new Range<>(2.0f, 8.0f);
private static final float A11Y_CHANGE_SCALE_DIFFERENCE = 1.0f;
+ private static final float ANIMATION_BOUNCE_EFFECT_SCALE = 1.05f;
private final Context mContext;
private final Resources mResources;
private final Handler mHandler;
@@ -102,7 +104,6 @@
private View mRightDrag;
private View mBottomDrag;
- private final PointF mLastDrag = new PointF();
@NonNull
private final WindowMagnifierCallback mWindowMagnifierCallback;
@@ -123,9 +124,12 @@
private int mNavGestureHeight;
private final SfVsyncFrameCallbackProvider mSfVsyncFrameProvider;
+ private final MagnificationGestureDetector mGestureDetector;
+ private final int mBounceEffectDuration;
private Choreographer.FrameCallback mMirrorViewGeometryVsyncCallback;
private Locale mLocale;
private NumberFormat mPercentFormat;
+ private float mBounceEffectAnimationScale;
@Nullable
private MirrorWindowControl mMirrorWindowControl;
@@ -147,14 +151,19 @@
mResources = mContext.getResources();
mScale = mResources.getInteger(R.integer.magnification_default_scale);
+ mBounceEffectDuration = mResources.getInteger(
+ com.android.internal.R.integer.config_shortAnimTime);
updateDimensions();
+ setInitialStartBounds();
+ computeBounceAnimationScale();
mMirrorWindowControl = mirrorWindowControl;
if (mMirrorWindowControl != null) {
mMirrorWindowControl.setWindowDelegate(this);
}
mTransaction = transaction;
- setInitialStartBounds();
+ mGestureDetector =
+ new MagnificationGestureDetector(mContext, handler, this);
// Initialize listeners.
mMirrorViewRunnable = () -> {
@@ -203,6 +212,13 @@
updateNavigationBarDimensions();
}
+ private void computeBounceAnimationScale() {
+ final float windowWidth = mMagnificationFrame.width() + 2 * mMirrorSurfaceMargin;
+ final float visibleWindowWidth = windowWidth - 2 * mOuterBorderSize;
+ final float animationScaleMax = windowWidth / visibleWindowWidth;
+ mBounceEffectAnimationScale = Math.min(animationScaleMax, ANIMATION_BOUNCE_EFFECT_SCALE);
+ }
+
private void updateNavigationBarDimensions() {
if (!supportsSwipeUpGesture()) {
mNavGestureHeight = 0;
@@ -248,6 +264,7 @@
void onConfigurationChanged(int configDiff) {
if ((configDiff & ActivityInfo.CONFIG_DENSITY) != 0) {
updateDimensions();
+ computeBounceAnimationScale();
if (isWindowVisible()) {
deleteWindowMagnification();
enableWindowMagnification(Float.NaN, Float.NaN, Float.NaN);
@@ -483,20 +500,7 @@
public boolean onTouch(View v, MotionEvent event) {
if (v == mDragView || v == mLeftDrag || v == mTopDrag || v == mRightDrag
|| v == mBottomDrag) {
- return handleDragTouchEvent(event);
- }
- return false;
- }
-
- private boolean handleDragTouchEvent(MotionEvent event) {
- switch (event.getAction()) {
- case MotionEvent.ACTION_DOWN:
- mLastDrag.set(event.getRawX(), event.getRawY());
- return true;
- case MotionEvent.ACTION_MOVE:
- moveWindowMagnifier(event.getRawX() - mLastDrag.x, event.getRawY() - mLastDrag.y);
- mLastDrag.set(event.getRawX(), event.getRawY());
- return true;
+ return mGestureDetector.onTouch(event);
}
return false;
}
@@ -685,6 +689,36 @@
return mPercentFormat.format(scale);
}
+ @Override
+ public boolean onSingleTap() {
+ animateBounceEffect();
+ return true;
+ }
+
+ @Override
+ public boolean onDrag(float offsetX, float offsetY) {
+ moveWindowMagnifier(offsetX, offsetY);
+ return true;
+ }
+
+ @Override
+ public boolean onStart(float x, float y) {
+ return true;
+ }
+
+ @Override
+ public boolean onFinish(float x, float y) {
+ return false;
+ }
+
+ private void animateBounceEffect() {
+ final ObjectAnimator scaleAnimator = ObjectAnimator.ofPropertyValuesHolder(mMirrorView,
+ PropertyValuesHolder.ofFloat(View.SCALE_X, 1, mBounceEffectAnimationScale, 1),
+ PropertyValuesHolder.ofFloat(View.SCALE_Y, 1, mBounceEffectAnimationScale, 1));
+ scaleAnimator.setDuration(mBounceEffectDuration);
+ scaleAnimator.start();
+ }
+
private class MirrorWindowA11yDelegate extends View.AccessibilityDelegate {
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
index a15a5aa..60a14be 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
@@ -26,6 +26,7 @@
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.graphics.RectF;
+import android.hardware.display.DisplayManager;
import android.hardware.fingerprint.FingerprintManager;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import android.hardware.fingerprint.IUdfpsOverlayController;
@@ -135,7 +136,7 @@
@SuppressLint("ClickableViewAccessibility")
private final UdfpsView.OnTouchListener mOnTouchListener = (v, event) -> {
UdfpsView view = (UdfpsView) v;
- final boolean isFingerDown = view.isScrimShowing();
+ final boolean isFingerDown = view.isShowScrimAndDot();
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_MOVE:
@@ -166,7 +167,7 @@
@Main Resources resources,
LayoutInflater inflater,
@Nullable FingerprintManager fingerprintManager,
- PowerManager powerManager,
+ DisplayManager displayManager,
WindowManager windowManager,
SystemSettings systemSettings,
@NonNull StatusBarStateController statusBarStateController,
@@ -246,7 +247,7 @@
mBacklightToNitsSpline = Spline.createSpline(normalizedBacklightRange, nitsRange);
mNitsToHbmBacklightSpline = Spline.createSpline(hbmNitsRange, normalizedBacklightRange);
- mDefaultBrightness = obtainDefaultBrightness(powerManager);
+ mDefaultBrightness = obtainDefaultBrightness(mContext);
// TODO(b/160025856): move to the "dump" method.
Log.v(TAG, String.format("ctor | mNitsRange: [%f, %f]", nitsRange[0],
@@ -450,14 +451,9 @@
}
}
- private static float obtainDefaultBrightness(PowerManager powerManager) {
- if (powerManager == null) {
- Log.e(TAG, "PowerManager is unavailable. Can't obtain default brightness.");
- return 0f;
- }
- return MathUtils.constrain(powerManager.getBrightnessConstraint(
- PowerManager.BRIGHTNESS_CONSTRAINT_TYPE_DEFAULT), PowerManager.BRIGHTNESS_MIN,
- PowerManager.BRIGHTNESS_MAX);
+ private static float obtainDefaultBrightness(Context context) {
+ return MathUtils.constrain(context.getDisplay().getBrightnessDefault(),
+ PowerManager.BRIGHTNESS_MIN, PowerManager.BRIGHTNESS_MAX);
}
private static float[] toFloatArray(TypedArray array) {
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java
index 5a61379..663a0da 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java
@@ -27,6 +27,7 @@
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
+import android.graphics.drawable.Drawable;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import android.text.TextUtils;
import android.util.AttributeSet;
@@ -70,6 +71,7 @@
// mInsetsListener to restrict the touchable region and allow the touches outside of the sensor
// to propagate to the rest of the UI.
@NonNull private final ViewTreeObserver.OnComputeInternalInsetsListener mInsetsListener;
+ @NonNull private final Drawable mFingerprintDrawable;
// Used to obtain the sensor location.
@NonNull private FingerprintSensorPropertiesInternal mSensorProps;
@@ -79,7 +81,7 @@
private float mBurnInOffsetX;
private float mBurnInOffsetY;
- private boolean mIsScrimShowing;
+ private boolean mShowScrimAndDot;
private boolean mIsHbmSupported;
@Nullable private String mDebugMessage;
@@ -112,15 +114,16 @@
mSensorPaint = new Paint(0 /* flags */);
mSensorPaint.setAntiAlias(true);
mSensorPaint.setColor(Color.WHITE);
- mSensorPaint.setStyle(Paint.Style.STROKE);
- mSensorPaint.setStrokeWidth(SENSOR_OUTLINE_WIDTH);
mSensorPaint.setShadowLayer(SENSOR_SHADOW_RADIUS, 0, 0, Color.BLACK);
+ mSensorPaint.setStyle(Paint.Style.FILL);
mDebugTextPaint = new Paint();
mDebugTextPaint.setAntiAlias(true);
mDebugTextPaint.setColor(Color.BLUE);
mDebugTextPaint.setTextSize(DEBUG_TEXT_SIZE_PX);
+ mFingerprintDrawable = getResources().getDrawable(R.drawable.ic_fingerprint, null);
+
mTouchableRegion = new Rect();
// When the device is rotated, it's important that mTouchableRegion is updated before
// this listener is called. This listener is usually called shortly after onLayout.
@@ -130,7 +133,7 @@
internalInsetsInfo.touchableRegion.set(mTouchableRegion);
};
- mIsScrimShowing = false;
+ mShowScrimAndDot = false;
}
void setSensorProperties(@NonNull FingerprintSensorPropertiesInternal properties) {
@@ -181,6 +184,13 @@
default:
// Do nothing to stay in portrait mode.
}
+
+ int margin = (int) (mSensorRect.bottom - mSensorRect.top) / 5;
+ mFingerprintDrawable.setBounds(
+ (int) mSensorRect.left + margin,
+ (int) mSensorRect.top + margin,
+ (int) mSensorRect.right - margin,
+ (int) mSensorRect.bottom - margin);
}
@Override
@@ -198,6 +208,8 @@
// is finished, mTouchableRegion will be used by mInsetsListener to compute the touch
// insets.
mSensorRect.roundOut(mTouchableRegion);
+
+
}
@Override
@@ -218,7 +230,7 @@
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
- if (mIsScrimShowing && mIsHbmSupported) {
+ if (mShowScrimAndDot && mIsHbmSupported) {
// Only draw the scrim if HBM is supported.
canvas.drawRect(mScrimRect, mScrimPaint);
}
@@ -229,7 +241,15 @@
if (!TextUtils.isEmpty(mDebugMessage)) {
canvas.drawText(mDebugMessage, 0, 160, mDebugTextPaint);
}
- canvas.drawOval(mSensorRect, mSensorPaint);
+
+ if (mShowScrimAndDot) {
+ // draw dot (white circle)
+ canvas.drawOval(mSensorRect, mSensorPaint);
+ } else {
+ // draw fingerprint icon
+ mFingerprintDrawable.draw(canvas);
+ }
+
canvas.restore();
}
@@ -264,19 +284,17 @@
mScrimPaint.setAlpha(alpha);
}
- boolean isScrimShowing() {
- return mIsScrimShowing;
+ boolean isShowScrimAndDot() {
+ return mShowScrimAndDot;
}
void showScrimAndDot() {
- mIsScrimShowing = true;
- mSensorPaint.setStyle(Paint.Style.FILL);
+ mShowScrimAndDot = true;
invalidate();
}
void hideScrimAndDot() {
- mIsScrimShowing = false;
- mSensorPaint.setStyle(Paint.Style.STROKE);
+ mShowScrimAndDot = false;
invalidate();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/FaceAuthScreenBrightnessController.kt b/packages/SystemUI/src/com/android/systemui/keyguard/FaceAuthScreenBrightnessController.kt
index a7d17e1..b4137fa 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/FaceAuthScreenBrightnessController.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/FaceAuthScreenBrightnessController.kt
@@ -64,7 +64,8 @@
private val globalSettings: GlobalSettings,
private val systemSettings: SystemSettings,
private val mainHandler: Handler,
- private val dumpManager: DumpManager
+ private val dumpManager: DumpManager,
+ private val enabled: Boolean
) : Dumpable {
private var userDefinedBrightness: Float = 1f
@@ -86,7 +87,7 @@
return
}
// TODO enable only when receiving a low-light error
- overridingBrightness = running
+ overridingBrightness = if (enabled) running else false
}
}
private lateinit var whiteOverlay: View
@@ -188,6 +189,7 @@
println("brightnessAnimationDuration: $brightnessAnimationDuration")
println("maxScreenBrightness: $maxScreenBrightness")
println("userDefinedBrightness: $userDefinedBrightness")
+ println("enabled: $enabled")
}
}
}
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java b/packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java
index d7b5eea..626abfc 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java
@@ -142,8 +142,9 @@
return Optional.empty();
}
+ // currently disabled (doesn't ramp up brightness or use scrim) see b/175918367
return Optional.of(new FaceAuthScreenBrightnessController(
notificationShadeWindowController, keyguardUpdateMonitor, resources,
- globalSetting, systemSettings, handler, dumpManager));
+ globalSetting, systemSettings, handler, dumpManager, false));
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt b/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
index c6ed9c0..3629d4d 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
@@ -71,6 +71,7 @@
private const val DEFAULT_LUMINOSITY = 0.25f
private const val LUMINOSITY_THRESHOLD = 0.05f
private const val SATURATION_MULTIPLIER = 0.8f
+const val DEFAULT_COLOR = Color.DKGRAY
private val LOADING = MediaData(-1, false, 0, null, null, null, null, null,
emptyList(), emptyList(), "INVALID", null, null, null, true, null)
@@ -394,7 +395,7 @@
} else {
null
}
- val bgColor = artworkBitmap?.let { computeBackgroundColor(it) } ?: Color.DKGRAY
+ val bgColor = artworkBitmap?.let { computeBackgroundColor(it) } ?: DEFAULT_COLOR
val mediaAction = getResumeMediaAction(resumeAction)
foregroundExecutor.execute {
@@ -590,12 +591,14 @@
private fun computeBackgroundColor(artworkBitmap: Bitmap?): Int {
var color = Color.WHITE
- if (artworkBitmap != null) {
- // If we have art, get colors from that
+ if (artworkBitmap != null && artworkBitmap.width > 1 && artworkBitmap.height > 1) {
+ // If we have valid art, get colors from that
val p = MediaNotificationProcessor.generateArtworkPaletteBuilder(artworkBitmap)
.generate()
val swatch = MediaNotificationProcessor.findBackgroundSwatch(p)
color = swatch.rgb
+ } else {
+ return DEFAULT_COLOR
}
// Adapt background color, so it's always subdued and text is legible
val tmpHsl = floatArrayOf(0f, 0f, 0f)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
index 2076cbf..7ec2691 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
@@ -20,10 +20,8 @@
import static android.provider.Settings.Global.ZEN_MODE_OFF;
import android.app.Dialog;
-import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
-import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.content.pm.ApplicationInfo;
@@ -53,7 +51,6 @@
import com.android.systemui.Prefs;
import com.android.systemui.R;
import com.android.systemui.SysUIToast;
-import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.plugins.ActivityStarter;
@@ -78,17 +75,12 @@
private static final Intent ZEN_PRIORITY_SETTINGS =
new Intent(Settings.ACTION_ZEN_MODE_PRIORITY_SETTINGS);
- private static final String ACTION_SET_VISIBLE = "com.android.systemui.dndtile.SET_VISIBLE";
- private static final String EXTRA_VISIBLE = "visible";
-
private final ZenModeController mController;
private final DndDetailAdapter mDetailAdapter;
private final SharedPreferences mSharedPreferences;
- private final BroadcastDispatcher mBroadcastDispatcher;
private boolean mListening;
private boolean mShowingDetail;
- private boolean mReceiverRegistered;
@Inject
public DndTile(
@@ -100,7 +92,6 @@
ActivityStarter activityStarter,
QSLogger qsLogger,
ZenModeController zenModeController,
- BroadcastDispatcher broadcastDispatcher,
@Main SharedPreferences sharedPreferences
) {
super(host, backgroundLooper, mainHandler, metricsLogger, statusBarStateController,
@@ -108,21 +99,9 @@
mController = zenModeController;
mSharedPreferences = sharedPreferences;
mDetailAdapter = new DndDetailAdapter();
- mBroadcastDispatcher = broadcastDispatcher;
- broadcastDispatcher.registerReceiver(mReceiver, new IntentFilter(ACTION_SET_VISIBLE));
- mReceiverRegistered = true;
mController.observe(getLifecycle(), mZenCallback);
}
- @Override
- protected void handleDestroy() {
- super.handleDestroy();
- if (mReceiverRegistered) {
- mBroadcastDispatcher.unregisterReceiver(mReceiver);
- mReceiverRegistered = false;
- }
- }
-
public static void setVisible(Context context, boolean visible) {
Prefs.putBoolean(context, Prefs.Key.DND_TILE_VISIBLE, visible);
}
@@ -348,15 +327,6 @@
}
};
- private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- final boolean visible = intent.getBooleanExtra(EXTRA_VISIBLE, false);
- setVisible(mContext, visible);
- refreshState();
- }
- };
-
private final class DndDetailAdapter implements DetailAdapter, OnAttachStateChangeListener {
private ZenModePanel mZenPanel;
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java b/packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java
index 3346935..57a41d9 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java
@@ -57,7 +57,7 @@
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags;
import com.android.systemui.R;
import com.android.systemui.SystemUIFactory;
-import com.android.systemui.screenshot.ScreenshotController.SavedImageData.ShareTransition;
+import com.android.systemui.screenshot.ScreenshotController.SavedImageData.ActionTransition;
import java.io.File;
import java.io.IOException;
@@ -98,11 +98,11 @@
private final String mScreenshotId;
private final boolean mSmartActionsEnabled;
private final Random mRandom = new Random();
- private final Supplier<ShareTransition> mSharedElementTransition;
+ private final Supplier<ActionTransition> mSharedElementTransition;
SaveImageInBackgroundTask(Context context, ScreenshotSmartActions screenshotSmartActions,
ScreenshotController.SaveImageInBackgroundData data,
- Supplier<ShareTransition> sharedElementTransition) {
+ Supplier<ActionTransition> sharedElementTransition) {
mContext = context;
mScreenshotSmartActions = screenshotSmartActions;
mImageData = new ScreenshotController.SavedImageData();
@@ -239,7 +239,7 @@
mImageData.uri = uri;
mImageData.smartActions = smartActions;
mImageData.shareTransition = createShareAction(mContext, mContext.getResources(), uri);
- mImageData.editAction = createEditAction(mContext, mContext.getResources(), uri);
+ mImageData.editTransition = createEditAction(mContext, mContext.getResources(), uri);
mImageData.deleteAction = createDeleteAction(mContext, mContext.getResources(), uri);
mParams.mActionsReadyListener.onActionsReady(mImageData);
@@ -293,9 +293,9 @@
* Assumes that the action intent is sent immediately after being supplied.
*/
@VisibleForTesting
- Supplier<ShareTransition> createShareAction(Context context, Resources r, Uri uri) {
+ Supplier<ActionTransition> createShareAction(Context context, Resources r, Uri uri) {
return () -> {
- ShareTransition transition = mSharedElementTransition.get();
+ ActionTransition transition = mSharedElementTransition.get();
// Note: Both the share and edit actions are proxied through ActionProxyReceiver in
// order to do some common work like dismissing the keyguard and sending
@@ -348,52 +348,57 @@
Icon.createWithResource(r, R.drawable.ic_screenshot_share),
r.getString(com.android.internal.R.string.share), shareAction);
- transition.shareAction = shareActionBuilder.build();
+ transition.action = shareActionBuilder.build();
return transition;
};
}
@VisibleForTesting
- Notification.Action createEditAction(Context context, Resources r, Uri uri) {
- // Note: Both the share and edit actions are proxied through ActionProxyReceiver in
- // order to do some common work like dismissing the keyguard and sending
- // closeSystemWindows
+ Supplier<ActionTransition> createEditAction(Context context, Resources r, Uri uri) {
+ return () -> {
+ ActionTransition transition = mSharedElementTransition.get();
+ // Note: Both the share and edit actions are proxied through ActionProxyReceiver in
+ // order to do some common work like dismissing the keyguard and sending
+ // closeSystemWindows
- // Create an edit intent, if a specific package is provided as the editor, then
- // launch that directly
- String editorPackage = context.getString(R.string.config_screenshotEditor);
- Intent editIntent = new Intent(Intent.ACTION_EDIT);
- if (!TextUtils.isEmpty(editorPackage)) {
- editIntent.setComponent(ComponentName.unflattenFromString(editorPackage));
- }
- editIntent.setDataAndType(uri, "image/png");
- editIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
- editIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
- editIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
+ // Create an edit intent, if a specific package is provided as the editor, then
+ // launch that directly
+ String editorPackage = context.getString(R.string.config_screenshotEditor);
+ Intent editIntent = new Intent(Intent.ACTION_EDIT);
+ if (!TextUtils.isEmpty(editorPackage)) {
+ editIntent.setComponent(ComponentName.unflattenFromString(editorPackage));
+ }
+ editIntent.setDataAndType(uri, "image/png");
+ editIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
+ editIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
+ editIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
- PendingIntent pendingIntent = PendingIntent.getActivityAsUser(context, 0,
- editIntent, PendingIntent.FLAG_IMMUTABLE, null, UserHandle.CURRENT);
+ PendingIntent pendingIntent = PendingIntent.getActivityAsUser(
+ context, 0, editIntent, PendingIntent.FLAG_IMMUTABLE,
+ transition.bundle, UserHandle.CURRENT);
- // Make sure pending intents for the system user are still unique across users
- // by setting the (otherwise unused) request code to the current user id.
- int requestCode = mContext.getUserId();
+ // Make sure pending intents for the system user are still unique across users
+ // by setting the (otherwise unused) request code to the current user id.
+ int requestCode = mContext.getUserId();
- // Create a edit action
- PendingIntent editAction = PendingIntent.getBroadcastAsUser(context, requestCode,
- new Intent(context, ActionProxyReceiver.class)
- .putExtra(ScreenshotController.EXTRA_ACTION_INTENT, pendingIntent)
- .putExtra(ScreenshotController.EXTRA_ID, mScreenshotId)
- .putExtra(ScreenshotController.EXTRA_SMART_ACTIONS_ENABLED,
- mSmartActionsEnabled)
- .setAction(Intent.ACTION_EDIT)
- .addFlags(Intent.FLAG_RECEIVER_FOREGROUND),
- PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
- UserHandle.SYSTEM);
- Notification.Action.Builder editActionBuilder = new Notification.Action.Builder(
- Icon.createWithResource(r, R.drawable.ic_screenshot_edit),
- r.getString(com.android.internal.R.string.screenshot_edit), editAction);
+ // Create a edit action
+ PendingIntent editAction = PendingIntent.getBroadcastAsUser(context, requestCode,
+ new Intent(context, ActionProxyReceiver.class)
+ .putExtra(ScreenshotController.EXTRA_ACTION_INTENT, pendingIntent)
+ .putExtra(ScreenshotController.EXTRA_ID, mScreenshotId)
+ .putExtra(ScreenshotController.EXTRA_SMART_ACTIONS_ENABLED,
+ mSmartActionsEnabled)
+ .setAction(Intent.ACTION_EDIT)
+ .addFlags(Intent.FLAG_RECEIVER_FOREGROUND),
+ PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
+ UserHandle.SYSTEM);
+ Notification.Action.Builder editActionBuilder = new Notification.Action.Builder(
+ Icon.createWithResource(r, R.drawable.ic_screenshot_edit),
+ r.getString(com.android.internal.R.string.screenshot_edit), editAction);
- return editActionBuilder.build();
+ transition.action = editActionBuilder.build();
+ return transition;
+ };
}
@VisibleForTesting
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java
index d2fe5d2..68d7343 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java
@@ -78,7 +78,7 @@
import com.android.internal.policy.PhoneWindow;
import com.android.settingslib.applications.InterestingConfigChanges;
import com.android.systemui.R;
-import com.android.systemui.screenshot.ScreenshotController.SavedImageData.ShareTransition;
+import com.android.systemui.screenshot.ScreenshotController.SavedImageData.ActionTransition;
import com.android.systemui.util.DeviceConfigProxy;
import java.util.List;
@@ -111,17 +111,17 @@
*/
static class SavedImageData {
public Uri uri;
- public Supplier<ShareTransition> shareTransition;
- public Notification.Action editAction;
+ public Supplier<ActionTransition> shareTransition;
+ public Supplier<ActionTransition> editTransition;
public Notification.Action deleteAction;
public List<Notification.Action> smartActions;
/**
- * POD for shared element transition to share sheet.
+ * POD for shared element transition.
*/
- static class ShareTransition {
+ static class ActionTransition {
public Bundle bundle;
- public Notification.Action shareAction;
+ public Notification.Action action;
public Runnable onCancelRunnable;
}
@@ -131,7 +131,7 @@
public void reset() {
uri = null;
shareTransition = null;
- editAction = null;
+ editTransition = null;
deleteAction = null;
smartActions = null;
}
@@ -339,6 +339,10 @@
}
}
+ boolean isPendingSharedTransition() {
+ return mScreenshotView.isPendingSharedTransition();
+ }
+
/**
* Update resources on configuration change. Reinflate for theme/color changes.
*/
@@ -462,7 +466,7 @@
Log.d(TAG, "saveScreenshot: screenshotView is already attached, resetting. "
+ "(dismissing=" + mScreenshotView.isDismissing() + ")");
}
- mScreenshotView.reset();
+ reloadAssets();
}
mScreenBitmap = screenshot;
@@ -605,7 +609,7 @@
}
mSaveInBgTask = new SaveImageInBackgroundTask(mContext, mScreenshotSmartActions, data,
- getShareTransitionSupplier());
+ getActionTransitionSupplier());
mSaveInBgTask.execute();
}
@@ -659,7 +663,7 @@
* Supplies the necessary bits for the shared element transition to share sheet.
* Note that once supplied, the action intent to share must be sent immediately after.
*/
- private Supplier<ShareTransition> getShareTransitionSupplier() {
+ private Supplier<ActionTransition> getActionTransitionSupplier() {
return () -> {
ExitTransitionCallbacks cb = new ExitTransitionCallbacks() {
@Override
@@ -668,7 +672,8 @@
}
@Override
- public void onFinish() { }
+ public void onFinish() {
+ }
};
Pair<ActivityOptions, ExitTransitionCoordinator> transition =
@@ -677,7 +682,7 @@
ChooserActivity.FIRST_IMAGE_PREVIEW_TRANSITION_NAME));
transition.second.startExit();
- ShareTransition supply = new ShareTransition();
+ ActionTransition supply = new ActionTransition();
supply.bundle = transition.first.toBundle();
supply.onCancelRunnable = () -> ActivityOptions.stopSharedElementAnimation(mWindow);
return supply;
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java
index 357702a..c6e0ace 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java
@@ -73,7 +73,7 @@
import com.android.internal.logging.UiEventLogger;
import com.android.systemui.R;
-import com.android.systemui.screenshot.ScreenshotController.SavedImageData.ShareTransition;
+import com.android.systemui.screenshot.ScreenshotController.SavedImageData.ActionTransition;
import com.android.systemui.shared.system.QuickStepContract;
import java.util.ArrayList;
@@ -105,7 +105,6 @@
private static final long SCREENSHOT_DISMISS_Y_DURATION_MS = 350;
private static final long SCREENSHOT_DISMISS_ALPHA_DURATION_MS = 183;
private static final long SCREENSHOT_DISMISS_ALPHA_OFFSET_MS = 50; // delay before starting fade
- private static final long SCREENSHOT_DISMISS_SHARE_OFFSET_MS = 300; // delay after share clicked
private static final float SCREENSHOT_ACTIONS_START_SCALE_X = .7f;
private static final float ROUNDED_CORNER_RADIUS = .05f;
private static final int SWIPE_PADDING_DP = 12; // extra padding around views to allow swipe
@@ -140,7 +139,7 @@
private UiEventLogger mUiEventLogger;
private ScreenshotViewCallback mCallbacks;
private Animator mDismissAnimation;
- private boolean mIgnoreDismiss;
+ private boolean mPendingSharedTransition;
private final ArrayList<ScreenshotActionChip> mSmartChips = new ArrayList<>();
private PendingInteraction mPendingInteraction;
@@ -292,6 +291,10 @@
requestFocus();
}
+ View getScreenshotPreview() {
+ return mScreenshotPreview;
+ }
+
/**
* Set up the logger and callback on dismissal.
*
@@ -529,44 +532,22 @@
});
return animator;
}
- protected View getScreenshotPreview() {
- return mScreenshotPreview;
- }
void setChipIntents(ScreenshotController.SavedImageData imageData) {
mShareChip.setOnClickListener(v -> {
- ShareTransition transition = imageData.shareTransition.get();
- try {
- mIgnoreDismiss = true;
- transition.shareAction.actionIntent.send();
- mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_SHARE_TAPPED);
-
- // Ensures that we delay dismissing until transition has started.
- postDelayed(() -> {
- mIgnoreDismiss = false;
- animateDismissal();
- }, SCREENSHOT_DISMISS_SHARE_OFFSET_MS);
- } catch (PendingIntent.CanceledException e) {
- mIgnoreDismiss = false;
- if (transition.onCancelRunnable != null) {
- transition.onCancelRunnable.run();
- }
- Log.e(TAG, "Share intent cancelled", e);
- }
+ mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_SHARE_TAPPED);
+ startSharedTransition(
+ imageData.shareTransition.get());
});
- mEditChip.setPendingIntent(imageData.editAction.actionIntent,
- () -> {
- mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_EDIT_TAPPED);
- animateDismissal();
- });
+ mEditChip.setOnClickListener(v -> {
+ mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_EDIT_TAPPED);
+ startSharedTransition(
+ imageData.editTransition.get());
+ });
mScreenshotPreview.setOnClickListener(v -> {
- try {
- imageData.editAction.actionIntent.send();
- } catch (PendingIntent.CanceledException e) {
- Log.e(TAG, "PendingIntent was cancelled", e);
- }
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_PREVIEW_TAPPED);
- animateDismissal();
+ startSharedTransition(
+ imageData.editTransition.get());
});
if (mPendingInteraction != null) {
@@ -605,12 +586,16 @@
return (mDismissAnimation != null && mDismissAnimation.isRunning());
}
+ boolean isPendingSharedTransition() {
+ return mPendingSharedTransition;
+ }
+
void animateDismissal() {
- animateDismissal(createScreenshotDismissAnimation());
+ animateDismissal(createScreenshotTranslateDismissAnimation());
}
private void animateDismissal(Animator dismissAnimation) {
- if (mIgnoreDismiss) {
+ if (mPendingSharedTransition) {
return;
}
if (DEBUG_WINDOW) {
@@ -665,6 +650,7 @@
getViewTreeObserver().removeOnComputeInternalInsetsListener(this);
// Clear any references to the bitmap
mScreenshotPreview.setImageDrawable(null);
+ mPendingSharedTransition = false;
mActionsContainerBackground.setVisibility(View.GONE);
mActionsContainer.setVisibility(View.GONE);
mBackgroundProtection.setAlpha(0f);
@@ -692,7 +678,23 @@
mScreenshotSelectorView.stop();
}
- private AnimatorSet createScreenshotDismissAnimation() {
+ private void startSharedTransition(ActionTransition transition) {
+ try {
+ mPendingSharedTransition = true;
+ transition.action.actionIntent.send();
+
+ // fade out non-preview UI
+ createScreenshotFadeDismissAnimation().start();
+ } catch (PendingIntent.CanceledException e) {
+ mPendingSharedTransition = false;
+ if (transition.onCancelRunnable != null) {
+ transition.onCancelRunnable.run();
+ }
+ Log.e(TAG, "Intent cancelled", e);
+ }
+ }
+
+ private AnimatorSet createScreenshotTranslateDismissAnimation() {
ValueAnimator alphaAnim = ValueAnimator.ofFloat(0, 1);
alphaAnim.setStartDelay(SCREENSHOT_DISMISS_ALPHA_OFFSET_MS);
alphaAnim.setDuration(SCREENSHOT_DISMISS_ALPHA_DURATION_MS);
@@ -719,6 +721,19 @@
return animSet;
}
+ private ValueAnimator createScreenshotFadeDismissAnimation() {
+ ValueAnimator alphaAnim = ValueAnimator.ofFloat(0, 1);
+ alphaAnim.addUpdateListener(animation -> {
+ float alpha = 1 - animation.getAnimatedFraction();
+ mDismissButton.setAlpha(alpha);
+ mActionsContainerBackground.setAlpha(alpha);
+ mActionsContainer.setAlpha(alpha);
+ mBackgroundProtection.setAlpha(alpha);
+ });
+ alphaAnim.setDuration(600);
+ return alphaAnim;
+ }
+
/**
* Create a drawable using the size of the bitmap and insets as the fractional inset parameters.
*/
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java b/packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java
index c2b20d3..7621587 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java
@@ -72,7 +72,9 @@
if (DEBUG_DISMISS) {
Log.d(TAG, "Received ACTION_CLOSE_SYSTEM_DIALOGS");
}
- mScreenshot.dismissScreenshot(false);
+ if (!mScreenshot.isPendingSharedTransition()) {
+ mScreenshot.dismissScreenshot(false);
+ }
}
}
};
diff --git a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java
index be10c26..a3b5f27 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java
+++ b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java
@@ -316,8 +316,7 @@
PowerManager.BRIGHTNESS_CONSTRAINT_TYPE_MINIMUM);
mMaximumBacklight = pm.getBrightnessConstraint(
PowerManager.BRIGHTNESS_CONSTRAINT_TYPE_MAXIMUM);
- mDefaultBacklight = pm.getBrightnessConstraint(
- PowerManager.BRIGHTNESS_CONSTRAINT_TYPE_DEFAULT);
+ mDefaultBacklight = mContext.getDisplay().getBrightnessDefault();
mMinimumBacklightForVr = pm.getBrightnessConstraint(
PowerManager.BRIGHTNESS_CONSTRAINT_TYPE_MINIMUM_VR);
mMaximumBacklightForVr = pm.getBrightnessConstraint(
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
index 7bac007..20efa32 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
@@ -197,7 +197,6 @@
viewState.hasItemsInStableShelf = lastViewState.inShelf;
viewState.hidden = !mAmbientState.isShadeExpanded()
|| mAmbientState.isQsCustomizerShowing();
- viewState.maxShelfEnd = maxShelfEnd;
} else {
viewState.hidden = true;
viewState.location = ExpandableViewState.LOCATION_GONE;
@@ -823,10 +822,6 @@
return - (getIntrinsicHeight() - mStatusBarHeight) / 2;
}
- public int getNotificationMergeSize() {
- return getIntrinsicHeight();
- }
-
@Override
public boolean hasNoContentHeight() {
return true;
@@ -1018,7 +1013,6 @@
private class ShelfState extends ExpandableViewState {
private float openedAmount;
private boolean hasItemsInStableShelf;
- private float maxShelfEnd;
@Override
public void applyToView(View view) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/OnUserInteractionCallbackImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/OnUserInteractionCallbackImpl.java
index 19a356b..23417fe 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/OnUserInteractionCallbackImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/OnUserInteractionCallbackImpl.java
@@ -18,6 +18,7 @@
import static android.service.notification.NotificationStats.DISMISS_SENTIMENT_NEUTRAL;
+import android.annotation.Nullable;
import android.os.SystemClock;
import android.service.notification.NotificationListenerService;
import android.service.notification.NotificationStats;
@@ -29,6 +30,7 @@
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.collection.coordinator.VisualStabilityCoordinator;
import com.android.systemui.statusbar.notification.collection.notifcollection.DismissedByUserStats;
+import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager;
import com.android.systemui.statusbar.notification.logging.NotificationLogger;
import com.android.systemui.statusbar.notification.row.OnUserInteractionCallback;
import com.android.systemui.statusbar.policy.HeadsUpManager;
@@ -43,19 +45,22 @@
private final HeadsUpManager mHeadsUpManager;
private final StatusBarStateController mStatusBarStateController;
private final VisualStabilityCoordinator mVisualStabilityCoordinator;
+ private final GroupMembershipManager mGroupMembershipManager;
public OnUserInteractionCallbackImpl(
NotifPipeline notifPipeline,
NotifCollection notifCollection,
HeadsUpManager headsUpManager,
StatusBarStateController statusBarStateController,
- VisualStabilityCoordinator visualStabilityCoordinator
+ VisualStabilityCoordinator visualStabilityCoordinator,
+ GroupMembershipManager groupMembershipManager
) {
mNotifPipeline = notifPipeline;
mNotifCollection = notifCollection;
mHeadsUpManager = headsUpManager;
mStatusBarStateController = statusBarStateController;
mVisualStabilityCoordinator = visualStabilityCoordinator;
+ mGroupMembershipManager = groupMembershipManager;
}
/**
@@ -67,7 +72,8 @@
@Override
public void onDismiss(
NotificationEntry entry,
- @NotificationListenerService.NotificationCancelReason int cancellationReason
+ @NotificationListenerService.NotificationCancelReason int cancellationReason,
+ @Nullable NotificationEntry groupSummaryToDismiss
) {
int dismissalSurface = NotificationStats.DISMISSAL_SHADE;
if (mHeadsUpManager.isAlerting(entry.getKey())) {
@@ -76,6 +82,10 @@
dismissalSurface = NotificationStats.DISMISSAL_AOD;
}
+ if (groupSummaryToDismiss != null) {
+ onDismiss(groupSummaryToDismiss, cancellationReason, null);
+ }
+
mNotifCollection.dismissNotification(
entry,
new DismissedByUserStats(
@@ -96,4 +106,21 @@
entry,
SystemClock.uptimeMillis());
}
+
+ /**
+ * @param entry that is being dismissed
+ * @return the group summary to dismiss along with this entry if this is the last entry in
+ * the group. Else, returns null.
+ */
+ @Override
+ @Nullable
+ public NotificationEntry getGroupSummaryToDismiss(NotificationEntry entry) {
+ if (entry.getParent() != null
+ && entry.getParent().getSummary() != null
+ && mGroupMembershipManager.isOnlyChildInGroup(entry)) {
+ NotificationEntry groupSummary = entry.getParent().getSummary();
+ return groupSummary.isClearable() ? groupSummary : null;
+ }
+ return null;
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/legacy/OnUserInteractionCallbackImplLegacy.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/legacy/OnUserInteractionCallbackImplLegacy.java
index 610cd33..11f22dd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/legacy/OnUserInteractionCallbackImplLegacy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/legacy/OnUserInteractionCallbackImplLegacy.java
@@ -18,6 +18,7 @@
import static android.service.notification.NotificationStats.DISMISS_SENTIMENT_NEUTRAL;
+import android.annotation.Nullable;
import android.service.notification.NotificationListenerService;
import android.service.notification.NotificationStats;
@@ -60,11 +61,16 @@
* 1. Manually dismisses a notification {@see ExpandableNotificationRow}.
* 2. Clicks on a notification with flag {@link android.app.Notification#FLAG_AUTO_CANCEL}.
* {@see StatusBarNotificationActivityStarter}
+ *
+ * @param groupSummaryToDismiss the group summary that should be dismissed
+ * along with this dismissal. If null, does not additionally
+ * dismiss any notifications.
*/
@Override
public void onDismiss(
NotificationEntry entry,
- @NotificationListenerService.NotificationCancelReason int cancellationReason
+ @NotificationListenerService.NotificationCancelReason int cancellationReason,
+ @Nullable NotificationEntry groupSummaryToDismiss
) {
int dismissalSurface = NotificationStats.DISMISSAL_SHADE;
if (mHeadsUpManager.isAlerting(entry.getKey())) {
@@ -73,11 +79,8 @@
dismissalSurface = NotificationStats.DISMISSAL_AOD;
}
- if (mGroupMembershipManager.isOnlyChildInGroup(entry)) {
- NotificationEntry groupSummary = mGroupMembershipManager.getLogicalGroupSummary(entry);
- if (groupSummary.isClearable()) {
- onDismiss(groupSummary, cancellationReason);
- }
+ if (groupSummaryToDismiss != null) {
+ onDismiss(groupSummaryToDismiss, cancellationReason, null);
}
mNotificationEntryManager.performRemoveNotification(
@@ -100,5 +103,20 @@
public void onImportanceChanged(NotificationEntry entry) {
mVisualStabilityManager.temporarilyAllowReordering();
}
+
+ /**
+ * @param entry that is being dismissed
+ * @return the group summary to dismiss along with this entry if this is the last entry in
+ * the group. Else, returns null.
+ */
+ @Override
+ @Nullable
+ public NotificationEntry getGroupSummaryToDismiss(NotificationEntry entry) {
+ if (mGroupMembershipManager.isOnlyChildInGroup(entry)) {
+ NotificationEntry groupSummary = mGroupMembershipManager.getLogicalGroupSummary(entry);
+ return groupSummary.isClearable() ? groupSummary : null;
+ }
+ return null;
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/GroupMembershipManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/GroupMembershipManager.java
index 196cb8f..b9c8f72 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/GroupMembershipManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/GroupMembershipManager.java
@@ -57,8 +57,6 @@
/**
* Whether this is the only child in a group
- * TODO: remove this when migrating to the new pipeline, this is taken care of in the
- * dismissal logic built into NotifCollection
*/
boolean isOnlyChildInGroup(NotificationEntry entry);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java
index ff55cd6..93156d8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java
@@ -268,7 +268,8 @@
notifCollection.get(),
headsUpManager,
statusBarStateController,
- visualStabilityCoordinator.get())
+ visualStabilityCoordinator.get(),
+ groupMembershipManagerLazy.get())
: new OnUserInteractionCallbackImplLegacy(
entryManager,
headsUpManager,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
index 3c437d1..8223d97 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
@@ -650,6 +650,11 @@
boolean beforeN = mEntry.targetSdk < Build.VERSION_CODES.N;
boolean beforeP = mEntry.targetSdk < Build.VERSION_CODES.P;
boolean beforeS = mEntry.targetSdk < Build.VERSION_CODES.S;
+ if (Notification.DevFlags.shouldBackportSNotifRules(mContext.getContentResolver())) {
+ // When back-porting S rules, if an app targets P/Q/R then enforce the new S rule on
+ // that notification. If it's before P though, we still want to enforce legacy rules.
+ beforeS = beforeP;
+ }
int smallHeight;
View expandedView = layout.getExpandedChild();
@@ -1433,7 +1438,8 @@
dismiss(fromAccessibility);
if (mEntry.isClearable()) {
if (mOnUserInteractionCallback != null) {
- mOnUserInteractionCallback.onDismiss(mEntry, REASON_CANCEL);
+ mOnUserInteractionCallback.onDismiss(mEntry, REASON_CANCEL,
+ mOnUserInteractionCallback.getGroupSummaryToDismiss(mEntry));
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/OnUserInteractionCallback.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/OnUserInteractionCallback.java
index 0c3f553..94c5507 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/OnUserInteractionCallback.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/OnUserInteractionCallback.java
@@ -28,14 +28,27 @@
/**
* Handle a user interaction that triggers a notification dismissal. Called when a user clicks
* on an auto-cancelled notification or manually swipes to dismiss the notification.
+ *
+ * @param entry notification being dismissed
+ * @param cancellationReason reason for the cancellation
+ * @param groupSummaryToDismiss group summary to dismiss with `entry`.
*/
void onDismiss(
NotificationEntry entry,
- @NotificationListenerService.NotificationCancelReason int cancellationReason);
+ @NotificationListenerService.NotificationCancelReason int cancellationReason,
+ NotificationEntry groupSummaryToDismiss);
/**
* Triggered after a user has changed the importance of the notification via its
* {@link NotificationGuts}.
*/
void onImportanceChanged(NotificationEntry entry);
+
+
+ /**
+ * @param entry being dismissed by the user
+ * @return group summary that should be dismissed along with `entry`. Can be null if no
+ * relevant group summary exists or the group summary should not be dismissed with `entry`.
+ */
+ NotificationEntry getGroupSummaryToDismiss(NotificationEntry entry);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index 0dc824f..9e8385b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -632,10 +632,15 @@
if (DEBUG) {
int y = mTopPadding;
+ mDebugPaint.setColor(Color.RED);
canvas.drawLine(0, y, getWidth(), y, mDebugPaint);
+
y = getLayoutHeight();
+ mDebugPaint.setColor(Color.YELLOW);
canvas.drawLine(0, y, getWidth(), y, mDebugPaint);
+
y = getHeight() - getEmptyBottomMargin();
+ mDebugPaint.setColor(Color.GREEN);
canvas.drawLine(0, y, getWidth(), y, mDebugPaint);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
index 4ca9c5d..713daaa 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
@@ -289,8 +289,6 @@
SysUiStatsLog.KEYGUARD_BOUNCER_STATE_CHANGED__STATE__HIDDEN);
mDismissCallbackRegistry.notifyDismissCancelled();
}
- mExpansion = EXPANSION_HIDDEN;
- dispatchExpansionChanged();
mIsScrimmed = false;
mFalsingCollector.onBouncerHidden();
mCallback.onBouncerVisiblityChanged(false /* shown */);
@@ -453,10 +451,6 @@
}
}
- public boolean onBackPressed() {
- return mKeyguardViewController != null && mKeyguardViewController.handleBackKey();
- }
-
/**
* @return True if and only if the security method should be shown before showing the
* notifications on Keyguard, like SIM PIN/PUK.
@@ -496,6 +490,14 @@
return mKeyguardViewController.interceptMediaKey(event);
}
+ /**
+ * @return true if the pre IME back event should be handled
+ */
+ public boolean dispatchBackKeyEventPreIme() {
+ ensureView();
+ return mKeyguardViewController.dispatchBackKeyEventPreIme();
+ }
+
public void notifyKeyguardAuthenticated(boolean strongAuth) {
ensureView();
mKeyguardViewController.finish(strongAuth, KeyguardUpdateMonitor.getCurrentUser());
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 b9e8d74..6da5d1b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
@@ -164,10 +164,10 @@
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 showLockIcon,
float qsExpansion) {
- mMinTopMargin = statusBarMinHeight + (udfpsEnrolled ? mContainerTopPaddingWithoutLockIcon :
- mContainerTopPaddingWithLockIcon);
+ mMinTopMargin = statusBarMinHeight + (showLockIcon
+ ? mContainerTopPaddingWithLockIcon : mContainerTopPaddingWithoutLockIcon);
mMaxShadeBottom = maxShadeBottom;
mNotificationStackHeight = notificationStackHeight;
mPanelExpansion = panelExpansion;
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 6bdc303..ab0366e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java
@@ -501,7 +501,7 @@
if (mBlockUpdates && canBlockUpdates()) {
shouldUpdate = false;
}
- if (shouldUpdate && mLockIcon != null) {
+ if (shouldUpdate && mLockIcon != null && mLockIcon.getVisibility() != GONE) {
mLockIcon.update(state,
mStatusBarStateController.isDozing(), mKeyguardJustShown);
}
@@ -549,16 +549,14 @@
return false;
}
- if (mKeyguardUpdateMonitor.isUdfpsEnrolled()) {
- boolean changed = mLockIcon.getVisibility() == GONE;
+ if (!mKeyguardUpdateMonitor.shouldShowLockIcon()) {
+ boolean changed = mLockIcon.getVisibility() != GONE;
mLockIcon.setVisibility(GONE);
return changed;
}
boolean onAodOrDocked = mStatusBarStateController.isDozing() || mDocked;
- boolean invisible = onAodOrDocked || mWakeAndUnlockRunning || mShowingLaunchAffordance
- || (mKeyguardSecurityModel.getSecurityMode(KeyguardUpdateMonitor.getCurrentUser())
- == KeyguardSecurityModel.SecurityMode.None);
+ boolean invisible = onAodOrDocked || mWakeAndUnlockRunning || mShowingLaunchAffordance;
boolean fingerprintOrBypass = mFingerprintUnlock
|| mKeyguardBypassController.getBypassEnabled();
if (fingerprintOrBypass && !mBouncerShowingScrimmed) {
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 8d3b128..ba08e76 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
@@ -912,7 +912,8 @@
clockPreferredY, hasCustomClock(),
hasVisibleNotifications, mInterpolatedDarkAmount, mEmptyDragAmount,
bypassEnabled, getUnlockedStackScrollerPadding(),
- mUpdateMonitor.isUdfpsEnrolled(), getQsExpansionFraction());
+ mUpdateMonitor.shouldShowLockIcon(),
+ getQsExpansionFraction());
mClockPositionAlgorithm.run(mClockPositionResult);
mKeyguardStatusViewController.updatePosition(
mClockPositionResult.clockX, mClockPositionResult.clockY,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowView.java
index a4fc3a3..619aadb 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowView.java
@@ -162,6 +162,11 @@
return mInteractionEventHandler.dispatchKeyEvent(event);
}
+ @Override
+ public boolean dispatchKeyEventPreIme(KeyEvent event) {
+ return mInteractionEventHandler.dispatchKeyEventPreIme(event);
+ }
+
protected void setInteractionEventHandler(InteractionEventHandler listener) {
mInteractionEventHandler = listener;
}
@@ -361,6 +366,8 @@
boolean interceptMediaKey(KeyEvent event);
boolean dispatchKeyEvent(KeyEvent event);
+
+ boolean dispatchKeyEventPreIme(KeyEvent event);
}
/**
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 2ac9f30..5595ae7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewController.java
@@ -348,6 +348,11 @@
}
@Override
+ public boolean dispatchKeyEventPreIme(KeyEvent event) {
+ return mService.dispatchKeyEventPreIme(event);
+ }
+
+ @Override
public boolean dispatchKeyEvent(KeyEvent event) {
boolean down = event.getAction() == KeyEvent.ACTION_DOWN;
switch (event.getKeyCode()) {
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 a18d87c..a991d3615 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -3520,6 +3520,23 @@
&& mStatusBarKeyguardViewManager.interceptMediaKey(event);
}
+ /**
+ * While IME is active and a BACK event is detected, check with
+ * {@link StatusBarKeyguardViewManager#dispatchBackKeyEventPreIme(KeyEvent)} to see if the event
+ * should be handled before routing to IME, in order to prevent the user having to hit back
+ * twice to exit bouncer.
+ */
+ public boolean dispatchKeyEventPreIme(KeyEvent event) {
+ switch (event.getKeyCode()) {
+ case KeyEvent.KEYCODE_BACK:
+ if (mState == StatusBarState.KEYGUARD
+ && mStatusBarKeyguardViewManager.dispatchBackKeyEventPreIme()) {
+ return onBackPressed();
+ }
+ }
+ return false;
+ }
+
protected boolean shouldUnlockOnMenuPressed() {
return mDeviceInteractive && mState != StatusBarState.SHADE
&& mStatusBarKeyguardViewManager.shouldDismissOnMenuPressed();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
index 055b78a..b4c687d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -955,6 +955,13 @@
return mBouncer.interceptMediaKey(event);
}
+ /**
+ * @return true if the pre IME back event should be handled
+ */
+ public boolean dispatchBackKeyEventPreIme() {
+ return mBouncer.dispatchBackKeyEventPreIme();
+ }
+
public void readyForKeyguardDone() {
mViewMediatorCallback.readyForKeyguardDone();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java
index 6a0ebf7..598addc 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java
@@ -365,22 +365,24 @@
final NotificationVisibility nv = NotificationVisibility.obtain(entry.getKey(),
entry.getRanking().getRank(), getVisibleNotificationsCount(), true, location);
+ // retrieve the group summary to remove with this entry before we tell NMS the
+ // notification was clicked to avoid a race condition
+ final boolean shouldAutoCancel = shouldAutoCancel(entry.getSbn());
+ final NotificationEntry summaryToRemove = shouldAutoCancel
+ ? mOnUserInteractionCallback.getGroupSummaryToDismiss(entry) : null;
- // TODO (b/162832756): delete these notification removals when migrating to the new
- // pipeline; this is taken care of in {@link NotifCollection#tryRemoveNotification}
- // which cancels lifetime extenders if the notification was dismissed by the user (ie:
- // clicked or manually dismissed)
- if (!canBubble && !mFeatureFlags.isNewNotifPipelineRenderingEnabled()) {
- if (shouldAutoCancel(entry.getSbn())
- || mRemoteInputManager.isNotificationKeptForRemoteInputHistory(
+ // inform NMS that the notification was clicked
+ mClickNotifier.onNotificationClick(notificationKey, nv);
+
+ if (!canBubble) {
+ if (shouldAutoCancel || mRemoteInputManager.isNotificationKeptForRemoteInputHistory(
notificationKey)) {
// Immediately remove notification from visually showing.
// We have to post the removal to the UI thread for synchronization.
mMainThreadHandler.post(() -> {
- final Runnable removeNotification = () -> {
- mClickNotifier.onNotificationClick(entry.getKey(), nv);
- mOnUserInteractionCallback.onDismiss(entry, REASON_CLICK);
- };
+ final Runnable removeNotification = () ->
+ mOnUserInteractionCallback.onDismiss(
+ entry, REASON_CLICK, summaryToRemove);
if (mPresenter.isCollapsing()) {
// To avoid lags we're only performing the remove
// after the shade is collapsed
@@ -390,9 +392,6 @@
}
});
}
- } else {
- // inform NMS that the notification was clicked
- mClickNotifier.onNotificationClick(notificationKey, nv);
}
mIsCollapsingToShowActivityOverLockscreen = false;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NextAlarmControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NextAlarmControllerImpl.java
index 272c494..22fd93e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NextAlarmControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NextAlarmControllerImpl.java
@@ -25,11 +25,15 @@
import androidx.annotation.NonNull;
+import com.android.systemui.Dumpable;
+import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.dagger.SysUISingleton;
+import com.android.systemui.dump.DumpManager;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
+import java.util.Date;
import javax.inject.Inject;
@@ -38,7 +42,7 @@
*/
@SysUISingleton
public class NextAlarmControllerImpl extends BroadcastReceiver
- implements NextAlarmController {
+ implements NextAlarmController, Dumpable {
private final ArrayList<NextAlarmChangeCallback> mChangeCallbacks = new ArrayList<>();
@@ -48,18 +52,34 @@
/**
*/
@Inject
- public NextAlarmControllerImpl(Context context) {
- mAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
+ public NextAlarmControllerImpl(
+ AlarmManager alarmManager,
+ BroadcastDispatcher broadcastDispatcher,
+ DumpManager dumpManager) {
+ dumpManager.registerDumpable("NextAlarmController", this);
+ mAlarmManager = alarmManager;
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_USER_SWITCHED);
filter.addAction(AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED);
- context.registerReceiverAsUser(this, UserHandle.ALL, filter, null, null);
+ broadcastDispatcher.registerReceiver(this, filter, null, UserHandle.ALL);
updateNextAlarm();
}
+ @Override
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
- pw.println("NextAlarmController state:");
- pw.print(" mNextAlarm="); pw.println(mNextAlarm);
+ pw.print("mNextAlarm=");
+ if (mNextAlarm != null) {
+ pw.println(new Date(mNextAlarm.getTriggerTime()));
+ pw.print(" PendingIntentPkg=");
+ pw.println(mNextAlarm.getShowIntent().getCreatorPackage());
+ } else {
+ pw.println("null");
+ }
+
+ pw.println("Registered Callbacks:");
+ for (NextAlarmChangeCallback callback : mChangeCallbacks) {
+ pw.print(" "); pw.println(callback.toString());
+ }
}
@Override
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationGestureDetectorTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationGestureDetectorTest.java
new file mode 100644
index 0000000..6f4846a
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationGestureDetectorTest.java
@@ -0,0 +1,173 @@
+/*
+ * 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.accessibility;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyFloat;
+import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+
+import android.os.Handler;
+import android.os.SystemClock;
+import android.testing.AndroidTestingRunner;
+import android.view.MotionEvent;
+import android.view.ViewConfiguration;
+
+import androidx.test.filters.SmallTest;
+
+import com.android.systemui.SysuiTestCase;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InOrder;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+
+
+@SmallTest
+@RunWith(AndroidTestingRunner.class)
+public class MagnificationGestureDetectorTest extends SysuiTestCase {
+
+ private static final float ACTION_DOWN_X = 100;
+ private static final float ACTION_DOWN_Y = 200;
+ private int mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
+ private MagnificationGestureDetector mGestureDetector;
+ private MotionEventHelper mMotionEventHelper = new MotionEventHelper();
+ @Mock
+ private MagnificationGestureDetector.OnGestureListener mListener;
+ @Mock
+ private Handler mHandler;
+ private Runnable mCancelSingleTapRunnable;
+
+ @Before
+ public void setUp() throws Exception {
+ MockitoAnnotations.initMocks(this);
+ doAnswer((invocation) -> {
+ mCancelSingleTapRunnable = invocation.getArgument(0);
+ return null;
+ }).when(mHandler).postAtTime(any(Runnable.class), anyLong());
+ mGestureDetector = new MagnificationGestureDetector(mContext, mHandler, mListener);
+ }
+
+ @After
+ public void tearDown() {
+ mMotionEventHelper.recycleEvents();
+ }
+
+ @Test
+ public void onActionDown_invokeDownCallback() {
+ final long downTime = SystemClock.uptimeMillis();
+ final MotionEvent downEvent = mMotionEventHelper.obtainMotionEvent(downTime, downTime,
+ MotionEvent.ACTION_DOWN, ACTION_DOWN_X, ACTION_DOWN_Y);
+
+ mGestureDetector.onTouch(downEvent);
+
+ mListener.onStart(ACTION_DOWN_X, ACTION_DOWN_Y);
+ }
+
+ @Test
+ public void performSingleTap_invokeCallbacksInOrder() {
+ final long downTime = SystemClock.uptimeMillis();
+ final MotionEvent downEvent = mMotionEventHelper.obtainMotionEvent(downTime, downTime,
+ MotionEvent.ACTION_DOWN, ACTION_DOWN_X, ACTION_DOWN_Y);
+ final MotionEvent upEvent = mMotionEventHelper.obtainMotionEvent(downTime, downTime,
+ MotionEvent.ACTION_UP, ACTION_DOWN_X, ACTION_DOWN_Y);
+
+ mGestureDetector.onTouch(downEvent);
+ mGestureDetector.onTouch(upEvent);
+
+ InOrder inOrder = Mockito.inOrder(mListener);
+ inOrder.verify(mListener).onStart(ACTION_DOWN_X, ACTION_DOWN_Y);
+ inOrder.verify(mListener).onSingleTap();
+ inOrder.verify(mListener).onFinish(ACTION_DOWN_X, ACTION_DOWN_Y);
+ verify(mListener, never()).onDrag(anyFloat(), anyFloat());
+ }
+
+ @Test
+ public void performSingleTapWithActionCancel_notInvokeOnSingleTapCallback() {
+ final long downTime = SystemClock.uptimeMillis();
+ final MotionEvent downEvent = mMotionEventHelper.obtainMotionEvent(downTime, downTime,
+ MotionEvent.ACTION_DOWN, ACTION_DOWN_X, ACTION_DOWN_Y);
+ final MotionEvent cancelEvent = mMotionEventHelper.obtainMotionEvent(downTime, downTime,
+ MotionEvent.ACTION_CANCEL, ACTION_DOWN_X, ACTION_DOWN_Y);
+
+ mGestureDetector.onTouch(downEvent);
+ mGestureDetector.onTouch(cancelEvent);
+
+ verify(mListener, never()).onSingleTap();
+ }
+
+ @Test
+ public void performSingleTapWithTwoPointers_notInvokeSingleTapCallback() {
+ final long downTime = SystemClock.uptimeMillis();
+ final MotionEvent downEvent = mMotionEventHelper.obtainMotionEvent(downTime, downTime,
+ MotionEvent.ACTION_DOWN, ACTION_DOWN_X, ACTION_DOWN_Y);
+ final MotionEvent upEvent = mMotionEventHelper.obtainMotionEvent(downTime, downTime,
+ MotionEvent.ACTION_POINTER_DOWN, ACTION_DOWN_X, ACTION_DOWN_Y);
+
+ mGestureDetector.onTouch(downEvent);
+ mGestureDetector.onTouch(upEvent);
+
+ verify(mListener, never()).onSingleTap();
+ }
+
+ @Test
+ public void performLongPress_invokeCallbacksInOrder() {
+ final long downTime = SystemClock.uptimeMillis();
+ final MotionEvent downEvent = mMotionEventHelper.obtainMotionEvent(downTime, downTime,
+ MotionEvent.ACTION_DOWN, ACTION_DOWN_X, ACTION_DOWN_Y);
+ final MotionEvent upEvent = mMotionEventHelper.obtainMotionEvent(downTime, downTime,
+ MotionEvent.ACTION_UP, ACTION_DOWN_X, ACTION_DOWN_Y);
+
+ mGestureDetector.onTouch(downEvent);
+ // Execute the pending message for stopping single-tap detection.
+ mCancelSingleTapRunnable.run();
+ mGestureDetector.onTouch(upEvent);
+
+ InOrder inOrder = Mockito.inOrder(mListener);
+ inOrder.verify(mListener).onStart(ACTION_DOWN_X, ACTION_DOWN_Y);
+ inOrder.verify(mListener).onFinish(ACTION_DOWN_X, ACTION_DOWN_Y);
+ verify(mListener, never()).onSingleTap();
+ }
+
+ @Test
+ public void performDrag_invokeCallbacksInOrder() {
+ final long downTime = SystemClock.uptimeMillis();
+ final float dragOffset = mTouchSlop + 10;
+ final MotionEvent downEvent = mMotionEventHelper.obtainMotionEvent(downTime, downTime,
+ MotionEvent.ACTION_DOWN, ACTION_DOWN_X, ACTION_DOWN_Y);
+ final MotionEvent moveEvent = mMotionEventHelper.obtainMotionEvent(downTime, downTime,
+ MotionEvent.ACTION_MOVE, ACTION_DOWN_X + dragOffset, ACTION_DOWN_Y);
+ final MotionEvent upEvent = mMotionEventHelper.obtainMotionEvent(downTime, downTime,
+ MotionEvent.ACTION_UP, ACTION_DOWN_X, ACTION_DOWN_Y);
+
+ mGestureDetector.onTouch(downEvent);
+ mGestureDetector.onTouch(moveEvent);
+ mGestureDetector.onTouch(upEvent);
+
+ InOrder inOrder = Mockito.inOrder(mListener);
+ inOrder.verify(mListener).onStart(ACTION_DOWN_X, ACTION_DOWN_Y);
+ inOrder.verify(mListener).onDrag(dragOffset, 0);
+ inOrder.verify(mListener).onFinish(ACTION_DOWN_X, ACTION_DOWN_Y);
+ verify(mListener, never()).onSingleTap();
+ }
+}
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 96f3c15..3d504fb 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationModeSwitchTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationModeSwitchTest.java
@@ -73,7 +73,6 @@
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import java.util.ArrayList;
import java.util.List;
@SmallTest
@@ -91,8 +90,8 @@
private ViewPropertyAnimator mViewPropertyAnimator;
private MagnificationModeSwitch mMagnificationModeSwitch;
private View.OnTouchListener mTouchListener;
- private List<MotionEvent> mMotionEvents = new ArrayList<>();
private Runnable mFadeOutAnimation;
+ private MotionEventHelper mMotionEventHelper = new MotionEventHelper();
@Before
public void setUp() throws Exception {
@@ -117,11 +116,8 @@
@After
public void tearDown() {
- for (MotionEvent event:mMotionEvents) {
- event.recycle();
- }
- mMotionEvents.clear();
mFadeOutAnimation = null;
+ mMotionEventHelper.recycleEvents();
}
@Test
@@ -436,9 +432,7 @@
private MotionEvent obtainMotionEvent(long downTime, long eventTime, int action, float x,
float y) {
- MotionEvent event = MotionEvent.obtain(downTime, eventTime, action, x, y, 0);
- mMotionEvents.add(event);
- return event;
+ return mMotionEventHelper.obtainMotionEvent(downTime, eventTime, action, x, y);
}
private void executeFadeOutAnimation() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/MotionEventHelper.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/MotionEventHelper.java
new file mode 100644
index 0000000..92dad9b
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/MotionEventHelper.java
@@ -0,0 +1,47 @@
+/*
+ * 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.accessibility;
+
+import android.view.MotionEvent;
+
+import com.android.internal.annotations.GuardedBy;
+
+import java.util.ArrayList;
+import java.util.List;
+
+class MotionEventHelper {
+ @GuardedBy("this")
+ private final List<MotionEvent> mMotionEvents = new ArrayList<>();
+
+ void recycleEvents() {
+ for (MotionEvent event:mMotionEvents) {
+ event.recycle();
+ }
+ synchronized (this) {
+ mMotionEvents.clear();
+ }
+ }
+
+ MotionEvent obtainMotionEvent(long downTime, long eventTime, int action, float x,
+ float y) {
+ MotionEvent event = MotionEvent.obtain(downTime, eventTime, action, x, y, 0);
+ synchronized (this) {
+ mMotionEvents.add(event);
+ }
+ return event;
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationControllerTest.java
index f28322f..9659610e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationControllerTest.java
@@ -26,6 +26,7 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyLong;
@@ -40,6 +41,7 @@
import android.content.pm.ActivityInfo;
import android.content.res.Resources;
import android.os.Handler;
+import android.os.SystemClock;
import android.testing.AndroidTestingRunner;
import android.testing.TestableResources;
import android.view.Display;
@@ -347,4 +349,26 @@
verify(mWindowManager).updateViewLayout(eq(mMirrorView), paramsArgumentCaptor.capture());
assertEquals(newA11yWindowTitle, paramsArgumentCaptor.getValue().accessibilityTitle);
}
+
+ @Test
+ public void onSingleTap_enabled_scaleIsChanged() {
+ mInstrumentation.runOnMainSync(() -> {
+ mWindowMagnificationController.enableWindowMagnification(Float.NaN, Float.NaN,
+ Float.NaN);
+ });
+
+ mInstrumentation.runOnMainSync(() -> {
+ mWindowMagnificationController.onSingleTap();
+ });
+
+ final long timeout = SystemClock.uptimeMillis() + 1000;
+ while (SystemClock.uptimeMillis() < timeout) {
+ SystemClock.sleep(10);
+
+ if (Float.compare(1.0f, mMirrorView.getScaleX()) < 0) {
+ return;
+ }
+ }
+ fail("mMirrorView scale is not changed");
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java
index 648c319..a65c352 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java
@@ -27,6 +27,7 @@
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.hardware.biometrics.SensorProperties;
+import android.hardware.display.DisplayManager;
import android.hardware.fingerprint.FingerprintManager;
import android.hardware.fingerprint.FingerprintSensorProperties;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
@@ -84,7 +85,7 @@
@Mock
private FingerprintManager mFingerprintManager;
@Mock
- private PowerManager mPowerManager;
+ private DisplayManager mDisplayManager;
@Mock
private WindowManager mWindowManager;
@Mock
@@ -124,7 +125,7 @@
mResources,
mLayoutInflater,
mFingerprintManager,
- mPowerManager,
+ mDisplayManager,
mWindowManager,
mSystemSettings,
mStatusBarStateController,
@@ -175,7 +176,7 @@
@Test
public void fingerDown() throws RemoteException {
// Configure UdfpsView to accept the ACTION_DOWN event
- when(mUdfpsView.isScrimShowing()).thenReturn(false);
+ when(mUdfpsView.isShowScrimAndDot()).thenReturn(false);
when(mUdfpsView.isValidTouch(anyFloat(), anyFloat(), anyFloat())).thenReturn(true);
// GIVEN that the overlay is showing
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/FaceAuthScreenBrightnessControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/FaceAuthScreenBrightnessControllerTest.kt
index 73a7ca9..cb05a6b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/FaceAuthScreenBrightnessControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/FaceAuthScreenBrightnessControllerTest.kt
@@ -83,7 +83,7 @@
MockitoAnnotations.initMocks(this)
faceAuthScreenBrightnessController = object : FaceAuthScreenBrightnessController(
notificationShadeWindowController, keyguardUpdateMonitor, resources, globalSettings,
- systemSettings, mainHandler, dumpManager) {
+ systemSettings, mainHandler, dumpManager, true) {
override fun createAnimator(start: Float, end: Float) = animator
}
`when`(systemSettings.getFloat(eq(SCREEN_BRIGHTNESS_FLOAT))).thenReturn(INITIAL_BRIGHTNESS)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/MediaDataManagerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/MediaDataManagerTest.kt
index 84c1bf9..2db224f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/MediaDataManagerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/MediaDataManagerTest.kt
@@ -2,6 +2,7 @@
import android.app.Notification.MediaStyle
import android.app.PendingIntent
+import android.graphics.Bitmap
import android.media.MediaDescription
import android.media.MediaMetadata
import android.media.session.MediaController
@@ -298,4 +299,26 @@
verify(listener).onMediaDataRemoved(eq(KEY))
}
+
+ @Test
+ fun testBadArtwork_doesNotUse() {
+ // WHEN notification has a too-small artwork
+ val artwork = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888)
+ val notif = SbnBuilder().run {
+ setPkg(PACKAGE_NAME)
+ modifyNotification(context).also {
+ it.setSmallIcon(android.R.drawable.ic_media_pause)
+ it.setStyle(MediaStyle().apply { setMediaSession(session.sessionToken) })
+ it.setLargeIcon(artwork)
+ }
+ build()
+ }
+ mediaDataManager.onNotificationAdded(KEY, notif)
+
+ // THEN it loads and uses the default background color
+ assertThat(backgroundExecutor.runAllReady()).isEqualTo(1)
+ assertThat(foregroundExecutor.runAllReady()).isEqualTo(1)
+ verify(listener).onMediaDataLoaded(eq(KEY), eq(null), capture(mediaDataCaptor))
+ assertThat(mediaDataCaptor.value!!.backgroundColor).isEqualTo(DEFAULT_COLOR)
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/screenshot/ScreenshotNotificationSmartActionsTest.java b/packages/SystemUI/tests/src/com/android/systemui/screenshot/ScreenshotNotificationSmartActionsTest.java
index 6759c90..c79416a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/screenshot/ScreenshotNotificationSmartActionsTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/screenshot/ScreenshotNotificationSmartActionsTest.java
@@ -43,7 +43,7 @@
import com.android.systemui.SystemUIFactory;
import com.android.systemui.SysuiTestCase;
-import com.android.systemui.screenshot.ScreenshotController.SavedImageData.ShareTransition;
+import com.android.systemui.screenshot.ScreenshotController.SavedImageData.ActionTransition;
import org.junit.Before;
import org.junit.Test;
@@ -177,10 +177,10 @@
data.mActionsReadyListener = null;
SaveImageInBackgroundTask task =
new SaveImageInBackgroundTask(mContext, mScreenshotSmartActions, data,
- ShareTransition::new);
+ ActionTransition::new);
Notification.Action shareAction = task.createShareAction(mContext, mContext.getResources(),
- Uri.parse("Screenshot_123.png")).get().shareAction;
+ Uri.parse("Screenshot_123.png")).get().action;
Intent intent = shareAction.actionIntent.getIntent();
assertNotNull(intent);
@@ -205,10 +205,10 @@
data.mActionsReadyListener = null;
SaveImageInBackgroundTask task =
new SaveImageInBackgroundTask(mContext, mScreenshotSmartActions, data,
- ShareTransition::new);
+ ActionTransition::new);
Notification.Action editAction = task.createEditAction(mContext, mContext.getResources(),
- Uri.parse("Screenshot_123.png"));
+ Uri.parse("Screenshot_123.png")).get().action;
Intent intent = editAction.actionIntent.getIntent();
assertNotNull(intent);
@@ -233,7 +233,7 @@
data.mActionsReadyListener = null;
SaveImageInBackgroundTask task =
new SaveImageInBackgroundTask(mContext, mScreenshotSmartActions, data,
- ShareTransition::new);
+ ActionTransition::new);
Notification.Action deleteAction = task.createDeleteAction(mContext,
mContext.getResources(),
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 1ac7937..95a3505 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
@@ -91,6 +91,7 @@
public void setUp() {
MockitoAnnotations.initMocks(this);
+ when(mKeyguardUpdateMonitor.shouldShowLockIcon()).thenReturn(true);
when(mLockIcon.getContext()).thenReturn(mContext);
mLockIconController = new LockscreenLockIconController(
mLockscreenGestureLogger, mKeyguardUpdateMonitor, mLockPatternUtils,
@@ -145,12 +146,10 @@
}
@Test
- public void testVisibility_noBouncer() {
- // no security (ie: no lock screen OR swipe to unlock)
- when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn(
- KeyguardSecurityModel.SecurityMode.None);
+ public void testVisibility_doNotShowLockIcon() {
+ when(mKeyguardUpdateMonitor.shouldShowLockIcon()).thenReturn(false);
mOnAttachStateChangeListener.onViewAttachedToWindow(mLockIcon);
- verify(mLockIcon).updateIconVisibility(false);
+ verify(mLockIcon).setVisibility(View.GONE);
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java
index 52b7b02..68464ce 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java
@@ -179,6 +179,8 @@
when(mEntryManager.getVisibleNotifications()).thenReturn(mActiveNotifications);
when(mStatusBarStateController.getState()).thenReturn(StatusBarState.SHADE);
when(mFeatureFlags.isNewNotifPipelineRenderingEnabled()).thenReturn(false);
+ when(mOnUserInteractionCallback.getGroupSummaryToDismiss(mNotificationRow.getEntry()))
+ .thenReturn(null);
mNotificationActivityStarter =
new StatusBarNotificationActivityStarter.Builder(
@@ -268,7 +270,7 @@
eq(sbn.getKey()), any(NotificationVisibility.class));
// Notification calls dismiss callback to remove notification due to FLAG_AUTO_CANCEL
orderVerifier.verify(mOnUserInteractionCallback).onDismiss(mNotificationRow.getEntry(),
- REASON_CLICK);
+ REASON_CLICK, null);
}
@Test
@@ -298,7 +300,7 @@
// Notification should not be cancelled.
verify(mOnUserInteractionCallback, never()).onDismiss(eq(mNotificationRow.getEntry()),
- anyInt());
+ anyInt(), eq(null));
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/InflatedSmartRepliesTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/InflatedSmartRepliesTest.java
index 8ee15bb..32675c9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/InflatedSmartRepliesTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/InflatedSmartRepliesTest.java
@@ -425,7 +425,8 @@
private void setupAppGeneratedReplies(
CharSequence[] smartReplies, boolean allowSystemGeneratedReplies) {
PendingIntent pendingIntent =
- PendingIntent.getBroadcast(mContext, 0, TEST_INTENT, 0);
+ PendingIntent.getBroadcast(mContext, 0, TEST_INTENT,
+ PendingIntent.FLAG_MUTABLE);
Notification.Action action =
new Notification.Action.Builder(null, "Test Action", pendingIntent).build();
when(mRemoteInput.getChoices()).thenReturn(smartReplies);
@@ -456,7 +457,8 @@
}
private Notification.Action.Builder createActionBuilder(String actionTitle, Intent intent) {
- PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, intent, 0);
+ PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, intent,
+ PendingIntent.FLAG_MUTABLE);
return new Notification.Action.Builder(mActionIcon, actionTitle, pendingIntent);
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java
index 4fb85ad..a844d09 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java
@@ -102,7 +102,7 @@
private void setTestPendingIntent(RemoteInputView view) {
PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0,
- new Intent(TEST_ACTION), 0);
+ new Intent(TEST_ACTION), PendingIntent.FLAG_MUTABLE);
RemoteInput input = new RemoteInput.Builder(TEST_RESULT_KEY).build();
view.setPendingIntent(pendingIntent);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SmartReplyViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SmartReplyViewTest.java
index 836a81e..5de62b9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SmartReplyViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SmartReplyViewTest.java
@@ -492,7 +492,8 @@
private SmartReplyView.SmartReplies createSmartReplies(CharSequence[] choices,
boolean fromAssistant) {
PendingIntent pendingIntent =
- PendingIntent.getBroadcast(mContext, 0, new Intent(TEST_ACTION), 0);
+ PendingIntent.getBroadcast(mContext, 0, new Intent(TEST_ACTION),
+ PendingIntent.FLAG_MUTABLE);
RemoteInput input = new RemoteInput.Builder(TEST_RESULT_KEY).setChoices(choices).build();
return new SmartReplyView.SmartReplies(
Arrays.asList(choices), input, pendingIntent, fromAssistant);
@@ -508,7 +509,7 @@
private Notification.Action createAction(String actionTitle) {
PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0,
- new Intent(TEST_ACTION), 0);
+ new Intent(TEST_ACTION), PendingIntent.FLAG_MUTABLE);
return new Notification.Action.Builder(mActionIcon, actionTitle, pendingIntent).build();
}
diff --git a/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java b/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java
index 52a82dd..5ee30fb7 100644
--- a/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java
+++ b/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java
@@ -51,7 +51,6 @@
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.nio.charset.StandardCharsets;
public class WallpaperBackupAgent extends BackupAgent {
private static final String TAG = "WallpaperBackup";
@@ -323,8 +322,7 @@
private Rect parseCropHint(File wallpaperInfo, String sectionTag) {
Rect cropHint = new Rect();
try (FileInputStream stream = new FileInputStream(wallpaperInfo)) {
- XmlPullParser parser = Xml.newPullParser();
- parser.setInput(stream, StandardCharsets.UTF_8.name());
+ XmlPullParser parser = Xml.resolvePullParser(stream);
int type;
do {
@@ -351,8 +349,7 @@
private ComponentName parseWallpaperComponent(File wallpaperInfo, String sectionTag) {
ComponentName name = null;
try (FileInputStream stream = new FileInputStream(wallpaperInfo)) {
- final XmlPullParser parser = Xml.newPullParser();
- parser.setInput(stream, StandardCharsets.UTF_8.name());
+ final XmlPullParser parser = Xml.resolvePullParser(stream);
int type;
do {
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityServiceConnection.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityServiceConnection.java
index 5d67992..2626654 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityServiceConnection.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityServiceConnection.java
@@ -120,8 +120,6 @@
AccessibilityUserState userState = mUserStateWeakReference.get();
if (userState == null) return;
userState.removeServiceLocked(this);
- userState.resetFocusAppearanceLocked();
- mSystemSupport.onClientChangeLocked(false);
mSystemSupport.getFullScreenMagnificationController().resetAllIfNeeded(mId);
mActivityTaskManagerService.setAllowAppSwitches(mComponentName.flattenToString(), -1,
userState.mUserId);
@@ -146,7 +144,6 @@
} finally {
Binder.restoreCallingIdentity(identity);
}
- userState.resetFocusAppearanceLocked();
mSystemSupport.onClientChangeLocked(false);
}
}
@@ -313,7 +310,6 @@
AccessibilityUserState userState = mUserStateWeakReference.get();
if (userState != null) {
userState.serviceDisconnectedLocked(this);
- userState.resetFocusAppearanceLocked();
}
resetLocked();
mSystemSupport.getFullScreenMagnificationController().resetAllIfNeeded(mId);
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java
index 90e2fdf..22efd37 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java
@@ -194,7 +194,8 @@
mUserNonInteractiveUiTimeout = 0;
mUserInteractiveUiTimeout = 0;
mMagnificationMode = ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN;
- resetFocusAppearanceLocked();
+ mFocusStrokeWidth = mFocusStrokeWidthDefaultValue;
+ mFocusColor = mFocusColorDefaultValue;
}
void addServiceLocked(AccessibilityServiceConnection serviceConnection) {
@@ -924,13 +925,4 @@
mFocusStrokeWidth = strokeWidth;
mFocusColor = color;
}
-
- /**
- * Resets the stroke width and color of the focus rectangle to the default value.
- *
- */
- public void resetFocusAppearanceLocked() {
- mFocusStrokeWidth = mFocusStrokeWidthDefaultValue;
- mFocusColor = mFocusColorDefaultValue;
- }
}
diff --git a/services/accessibility/java/com/android/server/accessibility/ActionReplacingCallback.java b/services/accessibility/java/com/android/server/accessibility/ActionReplacingCallback.java
index a2c7e4f..bafb641 100644
--- a/services/accessibility/java/com/android/server/accessibility/ActionReplacingCallback.java
+++ b/services/accessibility/java/com/android/server/accessibility/ActionReplacingCallback.java
@@ -40,14 +40,10 @@
private final IAccessibilityInteractionConnectionCallback mServiceCallback;
private final IAccessibilityInteractionConnection mConnectionWithReplacementActions;
private final int mInteractionId;
- private final int mNodeWithReplacementActionsInteractionId;
private final Object mLock = new Object();
@GuardedBy("mLock")
- private boolean mRequestForNodeWithReplacementActionFailed;
-
- @GuardedBy("mLock")
- AccessibilityNodeInfo mNodeWithReplacementActions;
+ List<AccessibilityNodeInfo> mNodesWithReplacementActions;
@GuardedBy("mLock")
List<AccessibilityNodeInfo> mNodesFromOriginalWindow;
@@ -55,8 +51,18 @@
@GuardedBy("mLock")
AccessibilityNodeInfo mNodeFromOriginalWindow;
+ // Keep track of whether or not we've been called back for a single node
@GuardedBy("mLock")
- List<AccessibilityNodeInfo> mPrefetchedNodesFromOriginalWindow;
+ boolean mSingleNodeCallbackHappened;
+
+ // Keep track of whether or not we've been called back for multiple node
+ @GuardedBy("mLock")
+ boolean mMultiNodeCallbackHappened;
+
+ // We shouldn't get any more callbacks after we've called back the original service, but
+ // keep track to make sure we catch such strange things
+ @GuardedBy("mLock")
+ boolean mDone;
public ActionReplacingCallback(IAccessibilityInteractionConnectionCallback serviceCallback,
IAccessibilityInteractionConnection connectionWithReplacementActions,
@@ -64,20 +70,19 @@
mServiceCallback = serviceCallback;
mConnectionWithReplacementActions = connectionWithReplacementActions;
mInteractionId = interactionId;
- mNodeWithReplacementActionsInteractionId = interactionId + 1;
// Request the root node of the replacing window
final long identityToken = Binder.clearCallingIdentity();
try {
mConnectionWithReplacementActions.findAccessibilityNodeInfoByAccessibilityId(
- AccessibilityNodeInfo.ROOT_NODE_ID, null,
- mNodeWithReplacementActionsInteractionId, this, 0,
+ AccessibilityNodeInfo.ROOT_NODE_ID, null, interactionId + 1, this, 0,
interrogatingPid, interrogatingTid, null, null);
} catch (RemoteException re) {
if (DEBUG) {
Slog.e(LOG_TAG, "Error calling findAccessibilityNodeInfoByAccessibilityId()");
}
- mRequestForNodeWithReplacementActionFailed = true;
+ // Pretend we already got a (null) list of replacement nodes
+ mMultiNodeCallbackHappened = true;
} finally {
Binder.restoreCallingIdentity(identityToken);
}
@@ -85,73 +90,46 @@
@Override
public void setFindAccessibilityNodeInfoResult(AccessibilityNodeInfo info, int interactionId) {
- synchronized (mLock) {
+ boolean readyForCallback;
+ synchronized(mLock) {
if (interactionId == mInteractionId) {
mNodeFromOriginalWindow = info;
- } else if (interactionId == mNodeWithReplacementActionsInteractionId) {
- mNodeWithReplacementActions = info;
} else {
Slog.e(LOG_TAG, "Callback with unexpected interactionId");
return;
}
+
+ mSingleNodeCallbackHappened = true;
+ readyForCallback = mMultiNodeCallbackHappened;
}
- replaceInfoActionsAndCallServiceIfReady();
+ if (readyForCallback) {
+ replaceInfoActionsAndCallService();
+ }
}
@Override
public void setFindAccessibilityNodeInfosResult(List<AccessibilityNodeInfo> infos,
int interactionId) {
- synchronized (mLock) {
+ boolean callbackForSingleNode;
+ boolean callbackForMultipleNodes;
+ synchronized(mLock) {
if (interactionId == mInteractionId) {
mNodesFromOriginalWindow = infos;
- } else if (interactionId == mNodeWithReplacementActionsInteractionId) {
- setNodeWithReplacementActionsFromList(infos);
+ } else if (interactionId == mInteractionId + 1) {
+ mNodesWithReplacementActions = infos;
} else {
Slog.e(LOG_TAG, "Callback with unexpected interactionId");
return;
}
+ callbackForSingleNode = mSingleNodeCallbackHappened;
+ callbackForMultipleNodes = mMultiNodeCallbackHappened;
+ mMultiNodeCallbackHappened = true;
}
- replaceInfoActionsAndCallServiceIfReady();
- }
-
- @Override
- public void setPrefetchAccessibilityNodeInfoResult(List<AccessibilityNodeInfo> infos,
- int interactionId)
- throws RemoteException {
- synchronized (mLock) {
- if (interactionId == mInteractionId) {
- mPrefetchedNodesFromOriginalWindow = infos;
- } else {
- Slog.e(LOG_TAG, "Callback with unexpected interactionId");
- return;
- }
- }
- replaceInfoActionsAndCallServiceIfReady();
- }
-
- private void replaceInfoActionsAndCallServiceIfReady() {
- boolean originalAndReplacementCallsHaveHappened = false;
- synchronized (mLock) {
- originalAndReplacementCallsHaveHappened = mNodeWithReplacementActions != null
- && (mNodeFromOriginalWindow != null
- || mNodesFromOriginalWindow != null
- || mPrefetchedNodesFromOriginalWindow != null);
- originalAndReplacementCallsHaveHappened
- |= mRequestForNodeWithReplacementActionFailed;
- }
- if (originalAndReplacementCallsHaveHappened) {
+ if (callbackForSingleNode) {
replaceInfoActionsAndCallService();
- replaceInfosActionsAndCallService();
- replacePrefetchInfosActionsAndCallService();
}
- }
-
- private void setNodeWithReplacementActionsFromList(List<AccessibilityNodeInfo> infos) {
- for (int i = 0; i < infos.size(); i++) {
- AccessibilityNodeInfo info = infos.get(i);
- if (info.getSourceNodeId() == AccessibilityNodeInfo.ROOT_NODE_ID) {
- mNodeWithReplacementActions = info;
- }
+ if (callbackForMultipleNodes) {
+ replaceInfosActionsAndCallService();
}
}
@@ -165,10 +143,18 @@
private void replaceInfoActionsAndCallService() {
final AccessibilityNodeInfo nodeToReturn;
synchronized (mLock) {
+ if (mDone) {
+ if (DEBUG) {
+ Slog.e(LOG_TAG, "Extra callback");
+ }
+ return;
+ }
if (mNodeFromOriginalWindow != null) {
replaceActionsOnInfoLocked(mNodeFromOriginalWindow);
}
+ recycleReplaceActionNodesLocked();
nodeToReturn = mNodeFromOriginalWindow;
+ mDone = true;
}
try {
mServiceCallback.setFindAccessibilityNodeInfoResult(nodeToReturn, mInteractionId);
@@ -182,7 +168,21 @@
private void replaceInfosActionsAndCallService() {
final List<AccessibilityNodeInfo> nodesToReturn;
synchronized (mLock) {
- nodesToReturn = replaceActionsLocked(mNodesFromOriginalWindow);
+ if (mDone) {
+ if (DEBUG) {
+ Slog.e(LOG_TAG, "Extra callback");
+ }
+ return;
+ }
+ if (mNodesFromOriginalWindow != null) {
+ for (int i = 0; i < mNodesFromOriginalWindow.size(); i++) {
+ replaceActionsOnInfoLocked(mNodesFromOriginalWindow.get(i));
+ }
+ }
+ recycleReplaceActionNodesLocked();
+ nodesToReturn = (mNodesFromOriginalWindow == null)
+ ? null : new ArrayList<>(mNodesFromOriginalWindow);
+ mDone = true;
}
try {
mServiceCallback.setFindAccessibilityNodeInfosResult(nodesToReturn, mInteractionId);
@@ -193,31 +193,6 @@
}
}
- private void replacePrefetchInfosActionsAndCallService() {
- final List<AccessibilityNodeInfo> nodesToReturn;
- synchronized (mLock) {
- nodesToReturn = replaceActionsLocked(mPrefetchedNodesFromOriginalWindow);
- }
- try {
- mServiceCallback.setPrefetchAccessibilityNodeInfoResult(nodesToReturn, mInteractionId);
- } catch (RemoteException re) {
- if (DEBUG) {
- Slog.e(LOG_TAG, "Failed to setFindAccessibilityNodeInfosResult");
- }
- }
- }
-
- @GuardedBy("mLock")
- private List<AccessibilityNodeInfo> replaceActionsLocked(List<AccessibilityNodeInfo> infos) {
- if (infos != null) {
- for (int i = 0; i < infos.size(); i++) {
- replaceActionsOnInfoLocked(infos.get(i));
- }
- }
- return (infos == null)
- ? null : new ArrayList<>(infos);
- }
-
@GuardedBy("mLock")
private void replaceActionsOnInfoLocked(AccessibilityNodeInfo info) {
info.removeAllActions();
@@ -229,22 +204,40 @@
info.setDismissable(false);
// We currently only replace actions for the root node
if ((info.getSourceNodeId() == AccessibilityNodeInfo.ROOT_NODE_ID)
- && mNodeWithReplacementActions != null) {
- List<AccessibilityAction> actions = mNodeWithReplacementActions.getActionList();
- if (actions != null) {
- for (int j = 0; j < actions.size(); j++) {
- info.addAction(actions.get(j));
+ && mNodesWithReplacementActions != null) {
+ // This list should always contain a single node with the root ID
+ for (int i = 0; i < mNodesWithReplacementActions.size(); i++) {
+ AccessibilityNodeInfo nodeWithReplacementActions =
+ mNodesWithReplacementActions.get(i);
+ if (nodeWithReplacementActions.getSourceNodeId()
+ == AccessibilityNodeInfo.ROOT_NODE_ID) {
+ List<AccessibilityAction> actions = nodeWithReplacementActions.getActionList();
+ if (actions != null) {
+ for (int j = 0; j < actions.size(); j++) {
+ info.addAction(actions.get(j));
+ }
+ // The PIP needs to be able to take accessibility focus
+ info.addAction(AccessibilityAction.ACTION_ACCESSIBILITY_FOCUS);
+ info.addAction(AccessibilityAction.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
+ }
+ info.setClickable(nodeWithReplacementActions.isClickable());
+ info.setFocusable(nodeWithReplacementActions.isFocusable());
+ info.setContextClickable(nodeWithReplacementActions.isContextClickable());
+ info.setScrollable(nodeWithReplacementActions.isScrollable());
+ info.setLongClickable(nodeWithReplacementActions.isLongClickable());
+ info.setDismissable(nodeWithReplacementActions.isDismissable());
}
- // The PIP needs to be able to take accessibility focus
- info.addAction(AccessibilityAction.ACTION_ACCESSIBILITY_FOCUS);
- info.addAction(AccessibilityAction.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
}
- info.setClickable(mNodeWithReplacementActions.isClickable());
- info.setFocusable(mNodeWithReplacementActions.isFocusable());
- info.setContextClickable(mNodeWithReplacementActions.isContextClickable());
- info.setScrollable(mNodeWithReplacementActions.isScrollable());
- info.setLongClickable(mNodeWithReplacementActions.isLongClickable());
- info.setDismissable(mNodeWithReplacementActions.isDismissable());
}
}
+
+ @GuardedBy("mLock")
+ private void recycleReplaceActionNodesLocked() {
+ if (mNodesWithReplacementActions == null) return;
+ for (int i = mNodesWithReplacementActions.size() - 1; i >= 0; i--) {
+ AccessibilityNodeInfo nodeWithReplacementAction = mNodesWithReplacementActions.get(i);
+ nodeWithReplacementAction.recycle();
+ }
+ mNodesWithReplacementActions = null;
+ }
}
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
index bc59602..b5f4813 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
@@ -1246,8 +1246,10 @@
mRemoteAugmentedAutofillService = null;
}
};
+ final int serviceUid = mRemoteAugmentedAutofillServiceInfo.applicationInfo.uid;
mRemoteAugmentedAutofillService = new RemoteAugmentedAutofillService(getContext(),
- componentName, mUserId, callbacks, mMaster.isInstantServiceAllowed(),
+ serviceUid, componentName,
+ mUserId, callbacks, mMaster.isInstantServiceAllowed(),
mMaster.verbose, mMaster.mAugmentedServiceIdleUnbindTimeoutMs,
mMaster.mAugmentedServiceRequestTimeoutMs);
}
@@ -1255,6 +1257,11 @@
return mRemoteAugmentedAutofillService;
}
+ @GuardedBy("mLock")
+ @Nullable RemoteAugmentedAutofillService getRemoteAugmentedAutofillServiceIfCreatedLocked() {
+ return mRemoteAugmentedAutofillService;
+ }
+
/**
* Called when the {@link AutofillManagerService#mAugmentedAutofillResolver}
* changed (among other places).
diff --git a/services/autofill/java/com/android/server/autofill/AutofillUriGrantsManager.java b/services/autofill/java/com/android/server/autofill/AutofillUriGrantsManager.java
new file mode 100644
index 0000000..801be5e
--- /dev/null
+++ b/services/autofill/java/com/android/server/autofill/AutofillUriGrantsManager.java
@@ -0,0 +1,257 @@
+/*
+ * 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.autofill;
+
+import static android.content.ContentResolver.SCHEME_CONTENT;
+
+import static com.android.server.autofill.Helper.sVerbose;
+
+import android.annotation.NonNull;
+import android.annotation.UserIdInt;
+import android.app.IUriGrantsManager;
+import android.app.UriGrantsManager;
+import android.content.ClipData;
+import android.content.ComponentName;
+import android.content.ContentProvider;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Binder;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.UserHandle;
+import android.util.ArrayMap;
+import android.util.ArraySet;
+import android.util.Pair;
+import android.util.Slog;
+
+import com.android.internal.annotations.GuardedBy;
+import com.android.server.LocalServices;
+import com.android.server.uri.UriGrantsManagerInternal;
+
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Grants and revokes URI permissions for content-based autofill suggestions.
+ *
+ * <p>Note that the system cannot just hand out grants directly; it must always do so on behalf of
+ * an owner (see {@link com.android.server.uri.UriGrantsManagerService}). For autofill, the owner
+ * is the autofill service provider that creates a given autofill suggestion containing a content
+ * URI. Therefore, this manager class must be instantiated with the service uid of the provider for
+ * which it will manage URI grants.
+ *
+ * <p>To dump the state of this class, use {@code adb shell dumpsys autofill}.
+ *
+ * <p>To dump all active URI permissions, use {@code adb shell dumpsys activity permissions}.
+ */
+final class AutofillUriGrantsManager {
+ private static final String TAG = AutofillUriGrantsManager.class.getSimpleName();
+
+ private final int mSourceUid;
+ @UserIdInt
+ private final int mSourceUserId;
+ @NonNull
+ private final IBinder mPermissionOwner;
+ @NonNull
+ private final UriGrantsManagerInternal mUgmInternal;
+ @NonNull
+ private final IUriGrantsManager mUgm;
+
+ // We use a local lock here for simplicity, since the synchronized code does not depend on
+ // any other resources (the "hold and wait" condition required for deadlock is not present).
+ // If this changes in the future, instead of using a local lock this should be updated to
+ // use the shared lock from AutofillManagerServiceImpl.
+ @NonNull
+ private final Object mLock;
+
+ // Tracks the URIs that have been granted to each package. For each URI, the map stores the
+ // activities that triggered the grant. This allows revoking permissions only once all
+ // activities that triggered the grant are finished.
+ @NonNull
+ @GuardedBy("mLock")
+ private final ArrayMap<String, List<Pair<Uri, String>>> mActiveGrantsByPackage;
+
+ /**
+ * Creates a new instance of the manager.
+ *
+ * @param serviceUid The uid of the autofill service provider for which this manager is being
+ * created. URI grants will be requested on behalf of this uid (ie, this uid will be passed as
+ * the {@code fromUid} to {@link IUriGrantsManager#grantUriPermissionFromOwner}).
+ */
+ AutofillUriGrantsManager(int serviceUid) {
+ mSourceUid = serviceUid;
+ mSourceUserId = UserHandle.getUserId(mSourceUid);
+ mUgmInternal = LocalServices.getService(UriGrantsManagerInternal.class);
+ mPermissionOwner = mUgmInternal.newUriPermissionOwner("autofill-" + serviceUid);
+ mUgm = UriGrantsManager.getService();
+ mLock = new Object();
+ mActiveGrantsByPackage = new ArrayMap<>(0);
+ }
+
+ public void grantUriPermissions(@NonNull ComponentName targetActivity,
+ @UserIdInt int targetUserId, @NonNull ClipData clip) {
+ String targetPkg = targetActivity.getPackageName();
+ for (int i = 0; i < clip.getItemCount(); i++) {
+ ClipData.Item item = clip.getItemAt(i);
+ Uri uri = item.getUri();
+ if (uri == null || !SCHEME_CONTENT.equals(uri.getScheme())) {
+ continue;
+ }
+ if (grantUriPermissions(targetPkg, targetUserId, uri)) {
+ addToActiveGrants(uri, targetActivity);
+ }
+ }
+ }
+
+ public void revokeUriPermissions(@NonNull ComponentName targetActivity,
+ @UserIdInt int targetUserId) {
+ String targetPkg = targetActivity.getPackageName();
+ Set<Uri> urisWhoseGrantsShouldBeRevoked = removeFromActiveGrants(targetActivity);
+ for (Uri uri : urisWhoseGrantsShouldBeRevoked) {
+ revokeUriPermissions(targetPkg, targetUserId, uri);
+ }
+ }
+
+ private boolean grantUriPermissions(@NonNull String targetPkg, @UserIdInt int targetUserId,
+ @NonNull Uri uri) {
+ final int sourceUserId = ContentProvider.getUserIdFromUri(uri, mSourceUserId);
+ if (sVerbose) {
+ Slog.v(TAG, "Granting URI permissions: uri=" + uri
+ + ", sourceUid=" + mSourceUid + ", sourceUserId=" + sourceUserId
+ + ", targetPkg=" + targetPkg + ", targetUserId=" + targetUserId);
+ }
+ final Uri uriWithoutUserId = ContentProvider.getUriWithoutUserId(uri);
+ final long ident = Binder.clearCallingIdentity();
+ try {
+ mUgm.grantUriPermissionFromOwner(
+ mPermissionOwner,
+ mSourceUid,
+ targetPkg,
+ uriWithoutUserId,
+ Intent.FLAG_GRANT_READ_URI_PERMISSION,
+ sourceUserId,
+ targetUserId);
+ return true;
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Granting URI permissions failed: uri=" + uri
+ + ", sourceUid=" + mSourceUid + ", sourceUserId=" + sourceUserId
+ + ", targetPkg=" + targetPkg + ", targetUserId=" + targetUserId, e);
+ return false;
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
+ }
+
+ private void revokeUriPermissions(@NonNull String targetPkg, @UserIdInt int targetUserId,
+ @NonNull Uri uri) {
+ final int sourceUserId = ContentProvider.getUserIdFromUri(uri, mSourceUserId);
+ if (sVerbose) {
+ Slog.v(TAG, "Revoking URI permissions: uri=" + uri
+ + ", sourceUid=" + mSourceUid + ", sourceUserId=" + sourceUserId
+ + ", target=" + targetPkg + ", targetUserId=" + targetUserId);
+ }
+ final Uri uriWithoutUserId = ContentProvider.getUriWithoutUserId(uri);
+ final long ident = Binder.clearCallingIdentity();
+ try {
+ mUgmInternal.revokeUriPermissionFromOwner(
+ mPermissionOwner,
+ uriWithoutUserId,
+ Intent.FLAG_GRANT_READ_URI_PERMISSION,
+ sourceUserId,
+ targetPkg,
+ targetUserId);
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
+ }
+
+ private void addToActiveGrants(@NonNull Uri uri, @NonNull ComponentName targetActivity) {
+ synchronized (mLock) {
+ String packageName = targetActivity.getPackageName();
+ List<Pair<Uri, String>> uris = mActiveGrantsByPackage.computeIfAbsent(packageName,
+ k -> new ArrayList<>(1));
+ uris.add(Pair.create(uri, targetActivity.getClassName()));
+ }
+ }
+
+ private Set<Uri> removeFromActiveGrants(@NonNull ComponentName targetActivity) {
+ synchronized (mLock) {
+ String targetPackageName = targetActivity.getPackageName();
+ List<Pair<Uri, String>> uris = mActiveGrantsByPackage.get(targetPackageName);
+ if (uris == null || uris.isEmpty()) {
+ return Collections.emptySet();
+ }
+
+ // Collect all URIs whose grant was triggered by the target activity.
+ String targetActivityClassName = targetActivity.getClassName();
+ Set<Uri> urisWhoseGrantsShouldBeRevoked = new ArraySet<>(1);
+ for (Iterator<Pair<Uri, String>> iter = uris.iterator(); iter.hasNext(); ) {
+ Pair<Uri, String> uriAndActivity = iter.next();
+ if (uriAndActivity.second.equals(targetActivityClassName)) {
+ urisWhoseGrantsShouldBeRevoked.add(uriAndActivity.first);
+ iter.remove();
+ }
+ }
+
+ // A URI grant may have been triggered by more than one activity for the same package.
+ // We should not revoke a grant if it was triggered by multiple activities and one or
+ // more of those activities is still alive. Therefore we do a second pass and prune
+ // the set of URIs to be revoked if an additional activity that triggered its grant
+ // is still present.
+ for (Pair<Uri, String> uriAndActivity : uris) {
+ urisWhoseGrantsShouldBeRevoked.remove(uriAndActivity.first);
+ }
+
+ // If there are no remaining URIs granted to the package, drop the entry from the map.
+ if (uris.isEmpty()) {
+ mActiveGrantsByPackage.remove(targetPackageName);
+ }
+ return urisWhoseGrantsShouldBeRevoked;
+ }
+ }
+
+ /**
+ * Dump the active URI grants.
+ */
+ public void dump(@NonNull String prefix, @NonNull PrintWriter pw) {
+ synchronized (mLock) {
+ if (mActiveGrantsByPackage.isEmpty()) {
+ pw.print(prefix); pw.println("URI grants: none");
+ return;
+ }
+ pw.print(prefix); pw.println("URI grants:");
+ final String prefix2 = prefix + " ";
+ final String prefix3 = prefix2 + " ";
+ for (int i = mActiveGrantsByPackage.size() - 1; i >= 0; i--) {
+ String packageName = mActiveGrantsByPackage.keyAt(i);
+ pw.print(prefix2); pw.println(packageName);
+ List<Pair<Uri, String>> uris = mActiveGrantsByPackage.valueAt(i);
+ if (uris == null || uris.isEmpty()) {
+ continue;
+ }
+ for (Pair<Uri, String> uriAndActivity : uris) {
+ pw.print(prefix3);
+ pw.println(uriAndActivity.first + ": " + uriAndActivity.second);
+ }
+ }
+ }
+ }
+}
diff --git a/services/autofill/java/com/android/server/autofill/RemoteAugmentedAutofillService.java b/services/autofill/java/com/android/server/autofill/RemoteAugmentedAutofillService.java
index bd26d44..db5bc4d 100644
--- a/services/autofill/java/com/android/server/autofill/RemoteAugmentedAutofillService.java
+++ b/services/autofill/java/com/android/server/autofill/RemoteAugmentedAutofillService.java
@@ -57,6 +57,7 @@
import com.android.internal.os.IResultReceiver;
import com.android.server.autofill.ui.InlineFillUi;
+import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CancellationException;
@@ -74,8 +75,9 @@
private final int mRequestTimeoutMs;
private final ComponentName mComponentName;
private final RemoteAugmentedAutofillServiceCallbacks mCallbacks;
+ private final AutofillUriGrantsManager mUriGrantsManager;
- RemoteAugmentedAutofillService(Context context, ComponentName serviceName,
+ RemoteAugmentedAutofillService(Context context, int serviceUid, ComponentName serviceName,
int userId, RemoteAugmentedAutofillServiceCallbacks callbacks,
boolean bindInstantServiceAllowed, boolean verbose, int idleUnbindTimeoutMs,
int requestTimeoutMs) {
@@ -87,6 +89,7 @@
mRequestTimeoutMs = requestTimeoutMs;
mComponentName = serviceName;
mCallbacks = callbacks;
+ mUriGrantsManager = new AutofillUriGrantsManager(serviceUid);
// Bind right away.
connect();
@@ -121,6 +124,10 @@
return mComponentName;
}
+ public AutofillUriGrantsManager getAutofillUriGrantsManager() {
+ return mUriGrantsManager;
+ }
+
@Override // from ServiceConnector.Impl
protected void onServiceConnectionStatusChanged(
IAugmentedAutofillService service, boolean connected) {
@@ -173,8 +180,8 @@
maybeRequestShowInlineSuggestions(sessionId,
inlineSuggestionsRequest, inlineSuggestionsData,
clientState, focusedId, focusedValue,
- inlineSuggestionsCallback,
- client, onErrorCallback, remoteRenderService, userId);
+ inlineSuggestionsCallback, client, onErrorCallback,
+ remoteRenderService, userId, activityComponent);
if (!showingFillWindow) {
requestAutofill.complete(null);
}
@@ -245,7 +252,8 @@
@Nullable Function<InlineFillUi, Boolean> inlineSuggestionsCallback,
@NonNull IAutoFillManagerClient client, @NonNull Runnable onErrorCallback,
@Nullable RemoteInlineSuggestionRenderService remoteRenderService,
- int userId) {
+ int userId,
+ @NonNull ComponentName targetActivity) {
if (inlineSuggestionsData == null || inlineSuggestionsData.isEmpty()
|| inlineSuggestionsCallback == null || request == null
|| remoteRenderService == null) {
@@ -299,6 +307,8 @@
final ArrayList<AutofillId> fieldIds = dataset.getFieldIds();
final ClipData content = dataset.getFieldContent();
if (content != null) {
+ mUriGrantsManager.grantUriPermissions(
+ targetActivity, userId, content);
final AutofillId fieldId = fieldIds.get(0);
if (sDebug) {
Slog.d(TAG, "Calling client autofillContent(): "
@@ -358,6 +368,12 @@
+ ComponentName.flattenToShortString(mComponentName) + "]";
}
+ @Override
+ public void dump(@NonNull String prefix, @NonNull PrintWriter pw) {
+ super.dump(prefix, pw);
+ mUriGrantsManager.dump(prefix, pw);
+ }
+
/**
* Called by {@link Session} when it's time to destroy all augmented autofill requests.
*/
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index 9d8901a..67f654e 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -1555,6 +1555,19 @@
return;
}
+ // Get a handle to the RemoteAugmentedAutofillService. In
+ // AutofillManagerServiceImpl.updateRemoteAugmentedAutofillService() we invalidate sessions
+ // whenever the service changes, so there should never be a case when we get here and the
+ // remote service instance is not present or different.
+ final RemoteAugmentedAutofillService remoteAugmentedAutofillService =
+ mService.getRemoteAugmentedAutofillServiceIfCreatedLocked();
+ if (remoteAugmentedAutofillService == null) {
+ Slog.e(TAG, "Can't fill after auth: RemoteAugmentedAutofillService is null");
+ mService.resetLastAugmentedAutofillResponse();
+ removeFromServiceLocked();
+ return;
+ }
+
// Update state to ensure that after filling the field here we don't end up firing another
// autofill request that will end up showing the same suggestions to the user again. When
// the auth activity came up, the field for which the suggestions were shown lost focus and
@@ -1567,6 +1580,13 @@
final Bundle clientState = data.getBundle(AutofillManager.EXTRA_CLIENT_STATE);
mService.logAugmentedAutofillSelected(id, dataset.getId(), clientState);
+ // For any content URIs, grant URI permissions to the target app before filling.
+ if (content != null) {
+ final AutofillUriGrantsManager autofillUgm =
+ remoteAugmentedAutofillService.getAutofillUriGrantsManager();
+ autofillUgm.grantUriPermissions(mComponentName, userId, content);
+ }
+
// Fill the value into the field.
if (sDebug) {
Slog.d(TAG, "Filling after auth: fieldId=" + fieldId + ", value=" + value
@@ -3987,6 +4007,13 @@
if (remoteRenderService != null) {
remoteRenderService.destroySuggestionViews(userId, id);
}
+ final RemoteAugmentedAutofillService remoteAugmentedAutofillService =
+ mService.getRemoteAugmentedAutofillServiceIfCreatedLocked();
+ if (remoteAugmentedAutofillService != null) {
+ final AutofillUriGrantsManager autofillUgm =
+ remoteAugmentedAutofillService.getAutofillUriGrantsManager();
+ autofillUgm.revokeUriPermissions(mComponentName, userId);
+ }
mDestroyed = true;
diff --git a/services/backup/java/com/android/server/backup/utils/BackupEligibilityRules.java b/services/backup/java/com/android/server/backup/utils/BackupEligibilityRules.java
index 2078492..002f6d7 100644
--- a/services/backup/java/com/android/server/backup/utils/BackupEligibilityRules.java
+++ b/services/backup/java/com/android/server/backup/utils/BackupEligibilityRules.java
@@ -183,7 +183,12 @@
} catch (PackageManager.NameNotFoundException e) {
Slog.w(TAG, "Failed to read allowAdbBackup property for + "
+ packageName);
- return false;
+
+ // This temporarily falls back to the legacy allowBackup flag to
+ // avoid breaking existing users of adb backup. Once they're able to use
+ // the new ALLOW_ADB_BACKUP property, we'll return false here.
+ // TODO(b/176088499): Return false here.
+ return allowBackup;
}
} else {
// All other apps can use adb backup only when running in debuggable mode.
diff --git a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
index f3d0a2e..8a27acc 100644
--- a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
+++ b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
@@ -612,20 +612,25 @@
+ " for " + association
+ " - profile still present in " + otherAssociationWithDeviceProfile);
} else {
- mRoleManager.removeRoleHolderAsUser(
- association.getDeviceProfile(),
- association.getPackageName(),
- RoleManager.MANAGE_HOLDERS_FLAG_DONT_KILL_APP,
- UserHandle.of(association.getUserId()),
- getContext().getMainExecutor(),
- success -> {
- if (!success) {
- Log.e(LOG_TAG, "Failed to revoke device profile role "
- + association.getDeviceProfile()
- + " to " + association.getPackageName()
- + " for user " + association.getUserId());
- }
- });
+ long identity = Binder.clearCallingIdentity();
+ try {
+ mRoleManager.removeRoleHolderAsUser(
+ association.getDeviceProfile(),
+ association.getPackageName(),
+ RoleManager.MANAGE_HOLDERS_FLAG_DONT_KILL_APP,
+ UserHandle.of(association.getUserId()),
+ getContext().getMainExecutor(),
+ success -> {
+ if (!success) {
+ Log.e(LOG_TAG, "Failed to revoke device profile role "
+ + association.getDeviceProfile()
+ + " to " + association.getPackageName()
+ + " for user " + association.getUserId());
+ }
+ });
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
}
}
}
@@ -867,20 +872,22 @@
}
private void grantDeviceProfile(Association association) {
- mRoleManager.addRoleHolderAsUser(
- association.getDeviceProfile(),
- association.getPackageName(),
- RoleManager.MANAGE_HOLDERS_FLAG_DONT_KILL_APP,
- UserHandle.of(association.getUserId()),
- getContext().getMainExecutor(),
- success -> {
- if (!success) {
- Log.e(LOG_TAG, "Failed to grant device profile role "
- + association.getDeviceProfile()
- + " to " + association.getPackageName()
- + " for user " + association.getUserId());
- }
- });
+ if (association.getDeviceProfile() != null) {
+ mRoleManager.addRoleHolderAsUser(
+ association.getDeviceProfile(),
+ association.getPackageName(),
+ RoleManager.MANAGE_HOLDERS_FLAG_DONT_KILL_APP,
+ UserHandle.of(association.getUserId()),
+ getContext().getMainExecutor(),
+ success -> {
+ if (!success) {
+ Log.e(LOG_TAG, "Failed to grant device profile role "
+ + association.getDeviceProfile()
+ + " to " + association.getPackageName()
+ + " for user " + association.getUserId());
+ }
+ });
+ }
}
void onDeviceDisconnected(String address) {
diff --git a/services/core/Android.bp b/services/core/Android.bp
index f848197..6ce334b 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -233,17 +233,3 @@
"java/com/android/server/net/LockdownVpnTracker.java",
],
}
-
-java_library {
- name: "service-connectivity",
- srcs: [
- ":connectivity-service-srcs",
- ],
- installable: true,
- libs: [
- "android.net.ipsec.ike",
- "services.core",
- "services.net",
- "unsupportedappusage",
- ],
-}
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 9b99199..4e75a9e 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -83,6 +83,7 @@
import android.net.ConnectivityDiagnosticsManager.DataStallReport;
import android.net.ConnectivityManager;
import android.net.DataStallReportParcelable;
+import android.net.DnsResolverServiceManager;
import android.net.ICaptivePortal;
import android.net.IConnectivityDiagnosticsCallback;
import android.net.IConnectivityManager;
@@ -144,6 +145,7 @@
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
+import android.os.INetworkActivityListener;
import android.os.INetworkManagementService;
import android.os.Looper;
import android.os.Message;
@@ -173,6 +175,7 @@
import android.util.SparseIntArray;
import android.util.Xml;
+import com.android.connectivity.aidl.INetworkAgent;
import com.android.internal.R;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
@@ -200,7 +203,6 @@
import com.android.server.connectivity.KeepaliveTracker;
import com.android.server.connectivity.LingerMonitor;
import com.android.server.connectivity.MockableSystemProperties;
-import com.android.server.connectivity.MultipathPolicyTracker;
import com.android.server.connectivity.NetworkAgentInfo;
import com.android.server.connectivity.NetworkDiagnostics;
import com.android.server.connectivity.NetworkNotificationManager;
@@ -441,11 +443,6 @@
private static final int EVENT_EXPIRE_NET_TRANSITION_WAKELOCK = 24;
/**
- * Used internally to indicate the system is ready.
- */
- private static final int EVENT_SYSTEM_READY = 25;
-
- /**
* used to add a network request with a pending intent
* obj = NetworkRequestInfo
*/
@@ -576,9 +573,8 @@
return sMagicDecoderRing.get(what, Integer.toString(what));
}
- private static IDnsResolver getDnsResolver() {
- return IDnsResolver.Stub
- .asInterface(ServiceManager.getService("dnsresolver"));
+ private static IDnsResolver getDnsResolver(Context context) {
+ return IDnsResolver.Stub.asInterface(DnsResolverServiceManager.getService(context));
}
/** Handler thread used for all of the handlers below. */
@@ -660,9 +656,6 @@
final MultinetworkPolicyTracker mMultinetworkPolicyTracker;
@VisibleForTesting
- final MultipathPolicyTracker mMultipathPolicyTracker;
-
- @VisibleForTesting
final Map<IBinder, ConnectivityDiagnosticsCallbackInfo> mConnectivityDiagnosticsCallbacks =
new HashMap<>();
@@ -954,7 +947,7 @@
public ConnectivityService(Context context, INetworkManagementService netManager,
INetworkStatsService statsService, INetworkPolicyManager policyManager) {
- this(context, netManager, statsService, policyManager, getDnsResolver(),
+ this(context, netManager, statsService, policyManager, getDnsResolver(context),
new IpConnectivityLog(), NetdService.getInstance(), new Dependencies());
}
@@ -1166,8 +1159,6 @@
mContext, mHandler, () -> rematchForAvoidBadWifiUpdate());
mMultinetworkPolicyTracker.start();
- mMultipathPolicyTracker = new MultipathPolicyTracker(mContext, mHandler);
-
mDnsManager = new DnsManager(mContext, mDnsResolver);
registerPrivateDnsSettingsCallbacks();
}
@@ -1380,8 +1371,11 @@
return;
}
final String action = blocked ? "BLOCKED" : "UNBLOCKED";
+ final NetworkRequest satisfiedRequest = nri.getSatisfiedRequest();
+ final int requestId = satisfiedRequest != null
+ ? satisfiedRequest.requestId : nri.mRequests.get(0).requestId;
mNetworkInfoBlockingLogs.log(String.format(
- "%s %d(%d) on netId %d", action, nri.mUid, nri.request.requestId, net.getNetId()));
+ "%s %d(%d) on netId %d", action, nri.mUid, requestId, net.getNetId()));
}
/**
@@ -1709,16 +1703,17 @@
return newNc;
}
- Binder.withCleanCallingIdentity(
- () -> {
- if (!mLocationPermissionChecker.checkLocationPermission(
- callerPkgName, null /* featureId */, callerUid, null /* message */)) {
- // Caller does not have the requisite location permissions. Reset the
- // owner's UID in the NetworkCapabilities.
- newNc.setOwnerUid(INVALID_UID);
- }
- }
- );
+ final long token = Binder.clearCallingIdentity();
+ try {
+ if (!mLocationPermissionChecker.checkLocationPermission(
+ callerPkgName, null /* featureId */, callerUid, null /* message */)) {
+ // Caller does not have the requisite location permissions. Reset the
+ // owner's UID in the NetworkCapabilities.
+ newNc.setOwnerUid(INVALID_UID);
+ }
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
return newNc;
}
@@ -1798,9 +1793,9 @@
private INetworkManagementEventObserver mDataActivityObserver = new BaseNetworkObserver() {
@Override
- public void interfaceClassDataActivityChanged(String label, boolean active, long tsNanos) {
- int deviceType = Integer.parseInt(label);
- sendDataActivityBroadcast(deviceType, active, tsNanos);
+ public void interfaceClassDataActivityChanged(int networkType, boolean active, long tsNanos,
+ int uid) {
+ sendDataActivityBroadcast(networkType, active, tsNanos);
}
};
@@ -2013,7 +2008,7 @@
void handleRestrictBackgroundChanged(boolean restrictBackground) {
if (mRestrictBackground == restrictBackground) return;
- for (final NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
+ for (final NetworkAgentInfo nai : mNetworkAgentInfos) {
final boolean curMetered = nai.networkCapabilities.isMetered();
maybeNotifyNetworkBlocked(nai, curMetered, curMetered, mRestrictBackground,
restrictBackground);
@@ -2309,10 +2304,13 @@
*/
@VisibleForTesting
public void systemReadyInternal() {
- // Let PermissionMonitor#startMonitoring() running in the beginning of the systemReady
- // before MultipathPolicyTracker.start(). Since mApps in PermissionMonitor needs to be
- // populated first to ensure that listening network request which is sent by
- // MultipathPolicyTracker won't be added NET_CAPABILITY_FOREGROUND capability.
+ // Since mApps in PermissionMonitor needs to be populated first to ensure that
+ // listening network request which is sent by MultipathPolicyTracker won't be added
+ // NET_CAPABILITY_FOREGROUND capability. Thus, MultipathPolicyTracker.start() must
+ // be called after PermissionMonitor#startMonitoring().
+ // Calling PermissionMonitor#startMonitoring() in systemReadyInternal() and the
+ // MultipathPolicyTracker.start() is called in NetworkPolicyManagerService#systemReady()
+ // to ensure the tracking will be initialized correctly.
mPermissionMonitor.startMonitoring();
mProxyTracker.loadGlobalProxy();
registerNetdEventCallback();
@@ -2331,8 +2329,31 @@
// Create network requests for always-on networks.
mHandler.sendMessage(mHandler.obtainMessage(EVENT_CONFIGURE_ALWAYS_ON_NETWORKS));
+ }
- mHandler.sendMessage(mHandler.obtainMessage(EVENT_SYSTEM_READY));
+ /**
+ * Start listening for default data network activity state changes.
+ */
+ @Override
+ public void registerNetworkActivityListener(@NonNull INetworkActivityListener l) {
+ // TODO: Replace network activity listener registry in ConnectivityManager from NMS to here
+ }
+
+ /**
+ * Stop listening for default data network activity state changes.
+ */
+ @Override
+ public void unregisterNetworkActivityListener(@NonNull INetworkActivityListener l) {
+ // TODO: Replace network activity listener registry in ConnectivityManager from NMS to here
+ }
+
+ /**
+ * Check whether the default network radio is currently active.
+ */
+ @Override
+ public boolean isDefaultNetworkActive() {
+ // TODO: Replace isNetworkActive() in NMS.
+ return false;
}
/**
@@ -2607,7 +2628,6 @@
dumpAvoidBadWifiSettings(pw);
pw.println();
- mMultipathPolicyTracker.dump(pw);
if (ArrayUtils.contains(args, SHORT_ARG) == false) {
pw.println();
@@ -2696,7 +2716,7 @@
*/
private NetworkAgentInfo[] networksSortedById() {
NetworkAgentInfo[] networks = new NetworkAgentInfo[0];
- networks = mNetworkAgentInfos.values().toArray(networks);
+ networks = mNetworkAgentInfos.toArray(networks);
Arrays.sort(networks, Comparator.comparingInt(nai -> nai.network.getNetId()));
return networks;
}
@@ -2705,7 +2725,7 @@
* Return an array of all current NetworkRequest sorted by request id.
*/
@VisibleForTesting
- protected NetworkRequestInfo[] requestsSortedById() {
+ NetworkRequestInfo[] requestsSortedById() {
NetworkRequestInfo[] requests = new NetworkRequestInfo[0];
requests = mNetworkRequests.values().toArray(requests);
// Sort the array based off the NRI containing the min requestId in its requests.
@@ -2742,11 +2762,6 @@
handleAsyncChannelHalfConnect(msg);
break;
}
- case AsyncChannel.CMD_CHANNEL_DISCONNECT: {
- NetworkAgentInfo nai = mNetworkAgentInfos.get(msg.replyTo);
- if (nai != null) nai.asyncChannel.disconnect();
- break;
- }
case AsyncChannel.CMD_CHANNEL_DISCONNECTED: {
handleAsyncChannelDisconnected(msg);
break;
@@ -2756,8 +2771,9 @@
}
private void maybeHandleNetworkAgentMessage(Message msg) {
- NetworkAgentInfo nai = mNetworkAgentInfos.get(msg.replyTo);
- if (nai == null) {
+ final Pair<NetworkAgentInfo, Object> arg = (Pair<NetworkAgentInfo, Object>) msg.obj;
+ final NetworkAgentInfo nai = arg.first;
+ if (!mNetworkAgentInfos.contains(nai)) {
if (VDBG) {
log(String.format("%s from unknown NetworkAgent", eventName(msg.what)));
}
@@ -2766,7 +2782,7 @@
switch (msg.what) {
case NetworkAgent.EVENT_NETWORK_CAPABILITIES_CHANGED: {
- NetworkCapabilities networkCapabilities = (NetworkCapabilities) msg.obj;
+ NetworkCapabilities networkCapabilities = (NetworkCapabilities) arg.second;
if (networkCapabilities.hasConnectivityManagedCapability()) {
Log.wtf(TAG, "BUG: " + nai + " has CS-managed capability.");
}
@@ -2783,13 +2799,13 @@
break;
}
case NetworkAgent.EVENT_NETWORK_PROPERTIES_CHANGED: {
- LinkProperties newLp = (LinkProperties) msg.obj;
+ LinkProperties newLp = (LinkProperties) arg.second;
processLinkPropertiesFromAgent(nai, newLp);
handleUpdateLinkProperties(nai, newLp);
break;
}
case NetworkAgent.EVENT_NETWORK_INFO_CHANGED: {
- NetworkInfo info = (NetworkInfo) msg.obj;
+ NetworkInfo info = (NetworkInfo) arg.second;
updateNetworkInfo(nai, info);
break;
}
@@ -2814,7 +2830,7 @@
break;
}
case NetworkAgent.EVENT_SOCKET_KEEPALIVE: {
- mKeepaliveTracker.handleEventSocketKeepalive(nai, msg);
+ mKeepaliveTracker.handleEventSocketKeepalive(nai, msg.arg1, msg.arg2);
break;
}
case NetworkAgent.EVENT_UNDERLYING_NETWORKS_CHANGED: {
@@ -2825,7 +2841,7 @@
}
final ArrayList<Network> underlying;
try {
- underlying = ((Bundle) msg.obj).getParcelableArrayList(
+ underlying = ((Bundle) arg.second).getParcelableArrayList(
NetworkAgent.UNDERLYING_NETWORKS_KEY);
} catch (NullPointerException | ClassCastException e) {
break;
@@ -2904,8 +2920,7 @@
if (nai.lastCaptivePortalDetected &&
Settings.Global.CAPTIVE_PORTAL_MODE_AVOID == getCaptivePortalMode()) {
if (DBG) log("Avoiding captive portal network: " + nai.toShortString());
- nai.asyncChannel.sendMessage(
- NetworkAgent.CMD_PREVENT_AUTOMATIC_RECONNECT);
+ nai.onPreventAutomaticReconnect();
teardownUnneededNetwork(nai);
break;
}
@@ -2997,13 +3012,10 @@
}
updateInetCondition(nai);
// Let the NetworkAgent know the state of its network
- Bundle redirectUrlBundle = new Bundle();
- redirectUrlBundle.putString(NetworkAgent.REDIRECT_URL_KEY, redirectUrl);
// TODO: Evaluate to update partial connectivity to status to NetworkAgent.
- nai.asyncChannel.sendMessage(
- NetworkAgent.CMD_REPORT_NETWORK_STATUS,
- (valid ? NetworkAgent.VALID_NETWORK : NetworkAgent.INVALID_NETWORK),
- 0, redirectUrlBundle);
+ nai.onValidationStatusChanged(
+ valid ? NetworkAgent.VALID_NETWORK : NetworkAgent.INVALID_NETWORK,
+ redirectUrl);
// If NetworkMonitor detects partial connectivity before
// EVENT_PROMPT_UNVALIDATED arrives, show the partial connectivity notification
@@ -3037,6 +3049,14 @@
}
break;
}
+ case NetworkAgentInfo.EVENT_AGENT_REGISTERED: {
+ handleNetworkAgentRegistered(msg);
+ break;
+ }
+ case NetworkAgentInfo.EVENT_AGENT_DISCONNECTED: {
+ handleNetworkAgentDisconnected(msg);
+ break;
+ }
}
return true;
}
@@ -3213,7 +3233,7 @@
private void handlePrivateDnsSettingsChanged() {
final PrivateDnsConfig cfg = mDnsManager.getPrivateDnsConfig();
- for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
+ for (NetworkAgentInfo nai : mNetworkAgentInfos) {
handlePerNetworkPrivateDnsConfig(nai, cfg);
if (networkRequiresPrivateDnsValidation(nai)) {
handleUpdateLinkProperties(nai, new LinkProperties(nai.linkProperties));
@@ -3311,7 +3331,6 @@
private void handleAsyncChannelHalfConnect(Message msg) {
ensureRunningOnConnectivityServiceThread();
- final AsyncChannel ac = (AsyncChannel) msg.obj;
if (mNetworkProviderInfos.containsKey(msg.replyTo)) {
if (msg.arg1 == AsyncChannel.STATUS_SUCCESSFUL) {
if (VDBG) log("NetworkFactory connected");
@@ -3323,39 +3342,45 @@
loge("Error connecting NetworkFactory");
mNetworkProviderInfos.remove(msg.obj);
}
- } else if (mNetworkAgentInfos.containsKey(msg.replyTo)) {
- if (msg.arg1 == AsyncChannel.STATUS_SUCCESSFUL) {
- if (VDBG) log("NetworkAgent connected");
- // A network agent has requested a connection. Establish the connection.
- mNetworkAgentInfos.get(msg.replyTo).asyncChannel.
- sendMessage(AsyncChannel.CMD_CHANNEL_FULL_CONNECTION);
- } else {
- loge("Error connecting NetworkAgent");
- NetworkAgentInfo nai = mNetworkAgentInfos.remove(msg.replyTo);
- if (nai != null) {
- final boolean wasDefault = isDefaultNetwork(nai);
- synchronized (mNetworkForNetId) {
- mNetworkForNetId.remove(nai.network.getNetId());
- }
- mNetIdManager.releaseNetId(nai.network.getNetId());
- // Just in case.
- mLegacyTypeTracker.remove(nai, wasDefault);
+ }
+ }
+
+ private void handleNetworkAgentRegistered(Message msg) {
+ final NetworkAgentInfo nai = (NetworkAgentInfo) msg.obj;
+ if (!mNetworkAgentInfos.contains(nai)) {
+ return;
+ }
+
+ if (msg.arg1 == NetworkAgentInfo.ARG_AGENT_SUCCESS) {
+ if (VDBG) log("NetworkAgent registered");
+ } else {
+ loge("Error connecting NetworkAgent");
+ mNetworkAgentInfos.remove(nai);
+ if (nai != null) {
+ final boolean wasDefault = isDefaultNetwork(nai);
+ synchronized (mNetworkForNetId) {
+ mNetworkForNetId.remove(nai.network.getNetId());
}
+ mNetIdManager.releaseNetId(nai.network.getNetId());
+ // Just in case.
+ mLegacyTypeTracker.remove(nai, wasDefault);
}
}
}
- // This is a no-op if it's called with a message designating a network that has
+ private void handleNetworkAgentDisconnected(Message msg) {
+ NetworkAgentInfo nai = (NetworkAgentInfo) msg.obj;
+ if (mNetworkAgentInfos.contains(nai)) {
+ disconnectAndDestroyNetwork(nai);
+ }
+ }
+
+ // This is a no-op if it's called with a message designating a provider that has
// already been destroyed, because its reference will not be found in the relevant
// maps.
private void handleAsyncChannelDisconnected(Message msg) {
- NetworkAgentInfo nai = mNetworkAgentInfos.get(msg.replyTo);
- if (nai != null) {
- disconnectAndDestroyNetwork(nai);
- } else {
- NetworkProviderInfo npi = mNetworkProviderInfos.remove(msg.replyTo);
- if (DBG && npi != null) log("unregisterNetworkFactory for " + npi.name);
- }
+ NetworkProviderInfo npi = mNetworkProviderInfos.remove(msg.replyTo);
+ if (DBG && npi != null) log("unregisterNetworkFactory for " + npi.name);
}
// Destroys a network, remove references to it from the internal state managed by
@@ -3399,7 +3424,7 @@
wakeupModifyInterface(iface, nai.networkCapabilities, false);
}
nai.networkMonitor().notifyNetworkDisconnected();
- mNetworkAgentInfos.remove(nai.messenger);
+ mNetworkAgentInfos.remove(nai);
nai.clatd.update();
synchronized (mNetworkForNetId) {
// Remove the NetworkAgent, but don't mark the netId as
@@ -3507,7 +3532,7 @@
mNetworkRequests.put(nri.request, nri);
mNetworkRequestInfoLogs.log("REGISTER " + nri);
if (nri.request.isListen()) {
- for (NetworkAgentInfo network : mNetworkAgentInfos.values()) {
+ for (NetworkAgentInfo network : mNetworkAgentInfos) {
if (nri.request.networkCapabilities.hasSignalStrength() &&
network.satisfiesImmutableCapabilitiesOf(nri.request)) {
updateSignalStrengthThresholds(network, "REGISTER", nri.request);
@@ -3555,30 +3580,58 @@
return false;
}
for (NetworkRequestInfo nri : mNetworkRequests.values()) {
- if (reason == UnneededFor.LINGER && nri.request.isBackgroundRequest()) {
+ if (reason == UnneededFor.LINGER
+ && !nri.isMultilayerRequest()
+ && nri.mRequests.get(0).isBackgroundRequest()) {
// Background requests don't affect lingering.
continue;
}
- // If this Network is already the highest scoring Network for a request, or if
- // there is hope for it to become one if it validated, then it is needed.
- if (nri.request.isRequest() && nai.satisfies(nri.request) &&
- (nai.isSatisfyingRequest(nri.request.requestId) ||
- // Note that this catches two important cases:
- // 1. Unvalidated cellular will not be reaped when unvalidated WiFi
- // is currently satisfying the request. This is desirable when
- // cellular ends up validating but WiFi does not.
- // 2. Unvalidated WiFi will not be reaped when validated cellular
- // is currently satisfying the request. This is desirable when
- // WiFi ends up validating and out scoring cellular.
- nri.mSatisfier.getCurrentScore()
- < nai.getCurrentScoreAsValidated())) {
+ if (isNetworkPotentialSatisfier(nai, nri)) {
return false;
}
}
return true;
}
+ private boolean isNetworkPotentialSatisfier(
+ @NonNull final NetworkAgentInfo candidate, @NonNull final NetworkRequestInfo nri) {
+ // listen requests won't keep up a network satisfying it. If this is not a multilayer
+ // request, we can return immediately. For multilayer requests, we have to check to see if
+ // any of the multilayer requests may have a potential satisfier.
+ if (!nri.isMultilayerRequest() && nri.mRequests.get(0).isListen()) {
+ return false;
+ }
+ for (final NetworkRequest req : nri.mRequests) {
+ // As non-multilayer listen requests have already returned, the below would only happen
+ // for a multilayer request therefore continue to the next request if available.
+ if (req.isListen()) {
+ continue;
+ }
+ // If this Network is already the highest scoring Network for a request, or if
+ // there is hope for it to become one if it validated, then it is needed.
+ if (candidate.satisfies(req)) {
+ // As soon as a network is found that satisfies a request, return. Specifically for
+ // multilayer requests, returning as soon as a NetworkAgentInfo satisfies a request
+ // is important so as to not evaluate lower priority requests further in
+ // nri.mRequests.
+ final boolean isNetworkNeeded = candidate.isSatisfyingRequest(req.requestId)
+ // Note that this catches two important cases:
+ // 1. Unvalidated cellular will not be reaped when unvalidated WiFi
+ // is currently satisfying the request. This is desirable when
+ // cellular ends up validating but WiFi does not.
+ // 2. Unvalidated WiFi will not be reaped when validated cellular
+ // is currently satisfying the request. This is desirable when
+ // WiFi ends up validating and out scoring cellular.
+ || nri.mSatisfier.getCurrentScore()
+ < candidate.getCurrentScoreAsValidated();
+ return isNetworkNeeded;
+ }
+ }
+
+ return false;
+ }
+
private NetworkRequestInfo getNriForAppRequest(
NetworkRequest request, int callingUid, String requestedOperation) {
final NetworkRequestInfo nri = mNetworkRequests.get(request);
@@ -3695,7 +3748,7 @@
} else {
// listens don't have a singular affectedNetwork. Check all networks to see
// if this listen request applies and remove it.
- for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
+ for (NetworkAgentInfo nai : mNetworkAgentInfos) {
nai.removeRequest(nri.request.requestId);
if (nri.request.networkCapabilities.hasSignalStrength() &&
nai.satisfiesImmutableCapabilitiesOf(nri.request)) {
@@ -3768,13 +3821,12 @@
}
if (always) {
- nai.asyncChannel.sendMessage(
- NetworkAgent.CMD_SAVE_ACCEPT_UNVALIDATED, encodeBool(accept));
+ nai.onSaveAcceptUnvalidated(accept);
}
if (!accept) {
// Tell the NetworkAgent to not automatically reconnect to the network.
- nai.asyncChannel.sendMessage(NetworkAgent.CMD_PREVENT_AUTOMATIC_RECONNECT);
+ nai.onPreventAutomaticReconnect();
// Teardown the network.
teardownUnneededNetwork(nai);
}
@@ -3805,13 +3857,12 @@
// TODO: Use the current design or save the user choice into IpMemoryStore.
if (always) {
- nai.asyncChannel.sendMessage(
- NetworkAgent.CMD_SAVE_ACCEPT_UNVALIDATED, encodeBool(accept));
+ nai.onSaveAcceptUnvalidated(accept);
}
if (!accept) {
// Tell the NetworkAgent to not automatically reconnect to the network.
- nai.asyncChannel.sendMessage(NetworkAgent.CMD_PREVENT_AUTOMATIC_RECONNECT);
+ nai.onPreventAutomaticReconnect();
// Tear down the network.
teardownUnneededNetwork(nai);
} else {
@@ -3875,8 +3926,12 @@
new CaptivePortal(new CaptivePortalImpl(network).asBinder()));
appIntent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK);
- Binder.withCleanCallingIdentity(() ->
- mContext.startActivityAsUser(appIntent, UserHandle.CURRENT));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ mContext.startActivityAsUser(appIntent, UserHandle.CURRENT);
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
private class CaptivePortalImpl extends ICaptivePortal.Stub {
@@ -3945,7 +4000,7 @@
private void rematchForAvoidBadWifiUpdate() {
rematchAllNetworksAndRequests();
- for (NetworkAgentInfo nai: mNetworkAgentInfos.values()) {
+ for (NetworkAgentInfo nai: mNetworkAgentInfos) {
if (nai.networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) {
sendUpdatedScoreToFactories(nai);
}
@@ -4088,7 +4143,7 @@
// to a network that provides no or limited connectivity is not useful, because the user
// cannot use that network except through the notification shown by this method, and the
// notification is only shown if the network is explicitly selected by the user.
- nai.asyncChannel.sendMessage(NetworkAgent.CMD_PREVENT_AUTOMATIC_RECONNECT);
+ nai.onPreventAutomaticReconnect();
// TODO: Evaluate if it's needed to wait 8 seconds for triggering notification when
// NetworkMonitor detects the network is partial connectivity. Need to change the design to
@@ -4123,11 +4178,13 @@
return ConnectivityManager.MULTIPATH_PREFERENCE_UNMETERED;
}
- Integer networkPreference = mMultipathPolicyTracker.getMultipathPreference(network);
- if (networkPreference != null) {
+ final NetworkPolicyManager netPolicyManager =
+ mContext.getSystemService(NetworkPolicyManager.class);
+
+ final int networkPreference = netPolicyManager.getMultipathPreference(network);
+ if (networkPreference != 0) {
return networkPreference;
}
-
return mMultinetworkPolicyTracker.getMeteredMultipathPreference();
}
@@ -4231,10 +4288,6 @@
mKeepaliveTracker.handleStopKeepalive(nai, slot, reason);
break;
}
- case EVENT_SYSTEM_READY: {
- mMultipathPolicyTracker.start();
- break;
- }
case EVENT_REVALIDATE_NETWORK: {
handleReportNetworkConnectivity((Network) msg.obj, msg.arg1, toBool(msg.arg2));
break;
@@ -4740,7 +4793,7 @@
return new VpnInfo[0];
}
List<VpnInfo> infoList = new ArrayList<>();
- for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
+ for (NetworkAgentInfo nai : mNetworkAgentInfos) {
VpnInfo info = createVpnInfo(nai);
if (info != null) {
infoList.add(info);
@@ -4841,7 +4894,7 @@
*/
private void propagateUnderlyingNetworkCapabilities(Network updatedNetwork) {
ensureRunningOnConnectivityServiceThread();
- for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
+ for (NetworkAgentInfo nai : mNetworkAgentInfos) {
if (updatedNetwork == null || hasUnderlyingNetwork(nai, updatedNetwork)) {
updateCapabilitiesForNetwork(nai);
}
@@ -5464,6 +5517,10 @@
this(r, null);
}
+ boolean isMultilayerRequest() {
+ return mRequests.size() > 1;
+ }
+
private List<NetworkRequest> initializeRequests(NetworkRequest r) {
final ArrayList<NetworkRequest> tempRequests = new ArrayList<>();
tempRequests.add(new NetworkRequest(r));
@@ -5505,7 +5562,7 @@
public void binderDied() {
log("ConnectivityService NetworkRequestInfo binderDied(" +
mRequests + ", " + mBinder + ")");
- releaseNetworkRequest(mRequests);
+ releaseNetworkRequests(mRequests);
}
@Override
@@ -5538,24 +5595,25 @@
mAppOpsManager.checkPackage(callerUid, callerPackageName);
}
- private ArrayList<Integer> getSignalStrengthThresholds(NetworkAgentInfo nai) {
+ private int[] getSignalStrengthThresholds(@NonNull final NetworkAgentInfo nai) {
final SortedSet<Integer> thresholds = new TreeSet<>();
synchronized (nai) {
- for (NetworkRequestInfo nri : mNetworkRequests.values()) {
- if (nri.request.networkCapabilities.hasSignalStrength() &&
- nai.satisfiesImmutableCapabilitiesOf(nri.request)) {
- thresholds.add(nri.request.networkCapabilities.getSignalStrength());
+ for (final NetworkRequestInfo nri : mNetworkRequests.values()) {
+ for (final NetworkRequest req : nri.mRequests) {
+ if (req.networkCapabilities.hasSignalStrength()
+ && nai.satisfiesImmutableCapabilitiesOf(req)) {
+ thresholds.add(req.networkCapabilities.getSignalStrength());
+ }
}
}
}
- return new ArrayList<>(thresholds);
+ // TODO: use NetworkStackUtils.convertToIntArray after moving it
+ return ArrayUtils.convertToIntArray(new ArrayList<>(thresholds));
}
private void updateSignalStrengthThresholds(
NetworkAgentInfo nai, String reason, NetworkRequest request) {
- ArrayList<Integer> thresholdsArray = getSignalStrengthThresholds(nai);
- Bundle thresholds = new Bundle();
- thresholds.putIntegerArrayList("thresholds", thresholdsArray);
+ final int[] thresholdsArray = getSignalStrengthThresholds(nai);
if (VDBG || (DBG && !"CONNECT".equals(reason))) {
String detail;
@@ -5565,12 +5623,10 @@
detail = reason;
}
log(String.format("updateSignalStrengthThresholds: %s, sending %s to %s",
- detail, Arrays.toString(thresholdsArray.toArray()), nai.toShortString()));
+ detail, Arrays.toString(thresholdsArray), nai.toShortString()));
}
- nai.asyncChannel.sendMessage(
- android.net.NetworkAgent.CMD_SET_SIGNAL_STRENGTH_THRESHOLDS,
- 0, 0, thresholds);
+ nai.onSignalStrengthThresholdsUpdated(thresholdsArray);
}
private void ensureValidNetworkSpecifier(NetworkCapabilities nc) {
@@ -5680,7 +5736,7 @@
nai = mNetworkForNetId.get(network.getNetId());
}
if (nai != null) {
- nai.asyncChannel.sendMessage(android.net.NetworkAgent.CMD_REQUEST_BANDWIDTH_UPDATE);
+ nai.onBandwidthUpdateRequested();
synchronized (mBandwidthRequests) {
final int uid = mDeps.getCallingUid();
Integer uidReqs = mBandwidthRequests.get(uid);
@@ -5831,7 +5887,7 @@
return mNextNetworkProviderId.getAndIncrement();
}
- private void releaseNetworkRequest(List<NetworkRequest> networkRequests) {
+ private void releaseNetworkRequests(List<NetworkRequest> networkRequests) {
for (int i = 0; i < networkRequests.size(); i++) {
releaseNetworkRequest(networkRequests.get(i));
}
@@ -5923,7 +5979,7 @@
// NetworkAgentInfo keyed off its connecting messenger
// TODO - eval if we can reduce the number of lists/hashmaps/sparsearrays
// NOTE: Only should be accessed on ConnectivityServiceThread, except dump().
- private final HashMap<Messenger, NetworkAgentInfo> mNetworkAgentInfos = new HashMap<>();
+ private final ArraySet<NetworkAgentInfo> mNetworkAgentInfos = new ArraySet<>();
@GuardedBy("mBlockedAppUids")
private final HashSet<Integer> mBlockedAppUids = new HashSet<>();
@@ -5971,17 +6027,17 @@
/**
* Register a new agent. {@see #registerNetworkAgent} below.
*/
- public Network registerNetworkAgent(Messenger messenger, NetworkInfo networkInfo,
+ public Network registerNetworkAgent(INetworkAgent na, NetworkInfo networkInfo,
LinkProperties linkProperties, NetworkCapabilities networkCapabilities,
int currentScore, NetworkAgentConfig networkAgentConfig) {
- return registerNetworkAgent(messenger, networkInfo, linkProperties, networkCapabilities,
+ return registerNetworkAgent(na, networkInfo, linkProperties, networkCapabilities,
currentScore, networkAgentConfig, NetworkProvider.ID_NONE);
}
/**
* Register a new agent with ConnectivityService to handle a network.
*
- * @param messenger a messenger for ConnectivityService to contact the agent asynchronously.
+ * @param na a reference for ConnectivityService to contact the agent asynchronously.
* @param networkInfo the initial info associated with this network. It can be updated later :
* see {@link #updateNetworkInfo}.
* @param linkProperties the initial link properties of this network. They can be updated
@@ -5994,7 +6050,7 @@
* @param providerId the ID of the provider owning this NetworkAgent.
* @return the network created for this agent.
*/
- public Network registerNetworkAgent(Messenger messenger, NetworkInfo networkInfo,
+ public Network registerNetworkAgent(INetworkAgent na, NetworkInfo networkInfo,
LinkProperties linkProperties, NetworkCapabilities networkCapabilities,
int currentScore, NetworkAgentConfig networkAgentConfig, int providerId) {
if (networkCapabilities.hasTransport(TRANSPORT_TEST)) {
@@ -6006,14 +6062,14 @@
final int uid = mDeps.getCallingUid();
final long token = Binder.clearCallingIdentity();
try {
- return registerNetworkAgentInternal(messenger, networkInfo, linkProperties,
+ return registerNetworkAgentInternal(na, networkInfo, linkProperties,
networkCapabilities, currentScore, networkAgentConfig, providerId, uid);
} finally {
Binder.restoreCallingIdentity(token);
}
}
- private Network registerNetworkAgentInternal(Messenger messenger, NetworkInfo networkInfo,
+ private Network registerNetworkAgentInternal(INetworkAgent na, NetworkInfo networkInfo,
LinkProperties linkProperties, NetworkCapabilities networkCapabilities,
int currentScore, NetworkAgentConfig networkAgentConfig, int providerId, int uid) {
if (networkCapabilities.hasTransport(TRANSPORT_TEST)) {
@@ -6029,7 +6085,7 @@
// TODO: Instead of passing mDefaultRequest, provide an API to determine whether a Network
// satisfies mDefaultRequest.
final NetworkCapabilities nc = new NetworkCapabilities(networkCapabilities);
- final NetworkAgentInfo nai = new NetworkAgentInfo(messenger, new AsyncChannel(),
+ final NetworkAgentInfo nai = new NetworkAgentInfo(na,
new Network(mNetIdManager.reserveNetId()), new NetworkInfo(networkInfo), lp, nc,
currentScore, mContext, mTrackerHandler, new NetworkAgentConfig(networkAgentConfig),
this, mNetd, mDnsResolver, mNMS, providerId, uid);
@@ -6047,7 +6103,7 @@
nai.network, name, new NetworkMonitorCallbacks(nai));
// NetworkAgentInfo registration will finish when the NetworkMonitor is created.
// If the network disconnects or sends any other event before that, messages are deferred by
- // NetworkAgent until nai.asyncChannel.connect(), which will be called when finalizing the
+ // NetworkAgent until nai.connect(), which will be called when finalizing the
// registration.
return nai.network;
}
@@ -6055,7 +6111,7 @@
private void handleRegisterNetworkAgent(NetworkAgentInfo nai, INetworkMonitor networkMonitor) {
nai.onNetworkMonitorCreated(networkMonitor);
if (VDBG) log("Got NetworkAgent Messenger");
- mNetworkAgentInfos.put(nai.messenger, nai);
+ mNetworkAgentInfos.add(nai);
synchronized (mNetworkForNetId) {
mNetworkForNetId.put(nai.network.getNetId(), nai);
}
@@ -6065,7 +6121,7 @@
} catch (RemoteException e) {
e.rethrowAsRuntimeException();
}
- nai.asyncChannel.connect(mContext, mTrackerHandler, nai.messenger);
+ nai.notifyRegistered();
NetworkInfo networkInfo = nai.networkInfo;
updateNetworkInfo(nai, networkInfo);
updateUids(nai, null, nai.networkCapabilities);
@@ -6878,7 +6934,7 @@
break;
}
}
- nai.asyncChannel.disconnect();
+ nai.disconnect();
}
private void handleLingerComplete(NetworkAgentInfo oldNetwork) {
@@ -7068,7 +7124,7 @@
// Gather the list of all relevant agents and sort them by score.
final ArrayList<NetworkAgentInfo> nais = new ArrayList<>();
- for (final NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
+ for (final NetworkAgentInfo nai : mNetworkAgentInfos) {
if (!nai.everConnected) continue;
nais.add(nai);
}
@@ -7103,7 +7159,7 @@
private void applyNetworkReassignment(@NonNull final NetworkReassignment changes,
final long now) {
- final Collection<NetworkAgentInfo> nais = mNetworkAgentInfos.values();
+ final Collection<NetworkAgentInfo> nais = mNetworkAgentInfos;
// Since most of the time there are only 0 or 1 background networks, it would probably
// be more efficient to just use an ArrayList here. TODO : measure performance
@@ -7196,7 +7252,7 @@
updateLegacyTypeTrackerAndVpnLockdownForRematch(oldDefaultNetwork, newDefaultNetwork, nais);
// Tear down all unneeded networks.
- for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
+ for (NetworkAgentInfo nai : mNetworkAgentInfos) {
if (unneeded(nai, UnneededFor.TEARDOWN)) {
if (nai.getLingerExpiry() > 0) {
// This network has active linger timers and no requests, but is not
@@ -7433,7 +7489,7 @@
// This has to happen after matching the requests, because callbacks are just requests.
notifyNetworkCallbacks(networkAgent, ConnectivityManager.CALLBACK_PRECHECK);
} else if (state == NetworkInfo.State.DISCONNECTED) {
- networkAgent.asyncChannel.disconnect();
+ networkAgent.disconnect();
if (networkAgent.isVPN()) {
updateUids(networkAgent, networkAgent.networkCapabilities, null);
}
@@ -7521,7 +7577,7 @@
* @param newRules The new rules to apply.
*/
private void maybeNotifyNetworkBlockedForNewUidRules(int uid, int newRules) {
- for (final NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
+ for (final NetworkAgentInfo nai : mNetworkAgentInfos) {
final boolean metered = nai.networkCapabilities.isMetered();
final boolean oldBlocked, newBlocked;
// TODO: Consider that doze mode or turn on/off battery saver would deliver lots of uid
@@ -7627,7 +7683,7 @@
ensureRunningOnConnectivityServiceThread();
ArrayList<Network> defaultNetworks = new ArrayList<>();
NetworkAgentInfo defaultNetwork = getDefaultNetwork();
- for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
+ for (NetworkAgentInfo nai : mNetworkAgentInfos) {
if (nai.everConnected && (nai == defaultNetwork || nai.isVPN())) {
defaultNetworks.add(nai.network);
}
@@ -7763,10 +7819,13 @@
final int userId = UserHandle.getCallingUserId();
- Binder.withCleanCallingIdentity(() -> {
+ final long token = Binder.clearCallingIdentity();
+ try {
final IpMemoryStore ipMemoryStore = IpMemoryStore.getMemoryStore(mContext);
ipMemoryStore.factoryReset();
- });
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
// Turn airplane mode off
setAirplaneMode(false);
@@ -8358,7 +8417,7 @@
return false;
}
- for (NetworkAgentInfo virtual : mNetworkAgentInfos.values()) {
+ for (NetworkAgentInfo virtual : mNetworkAgentInfos) {
if (virtual.supportsUnderlyingNetworks()
&& virtual.networkCapabilities.getOwnerUid() == callbackUid
&& ArrayUtils.contains(virtual.declaredUnderlyingNetworks, nai.network)) {
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index 636da6f..1ea4a89 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -187,10 +187,10 @@
/** Set of interfaces with active alerts. */
@GuardedBy("mQuotaLock")
private HashMap<String, Long> mActiveAlerts = Maps.newHashMap();
- /** Set of UIDs denylisted on metered networks. */
+ /** Set of UIDs denied on metered networks. */
@GuardedBy("mRulesLock")
private SparseBooleanArray mUidRejectOnMetered = new SparseBooleanArray();
- /** Set of UIDs allowlisted on metered networks. */
+ /** Set of UIDs allowed on metered networks. */
@GuardedBy("mRulesLock")
private SparseBooleanArray mUidAllowOnMetered = new SparseBooleanArray();
/** Set of UIDs with cleartext penalties. */
@@ -396,22 +396,12 @@
* Notify our observers of a change in the data activity state of the interface
*/
private void notifyInterfaceClassActivity(int type, boolean isActive, long tsNanos,
- int uid, boolean fromRadio) {
+ int uid) {
final boolean isMobile = ConnectivityManager.isNetworkTypeMobile(type);
int powerState = isActive
? DataConnectionRealTimeInfo.DC_POWER_STATE_HIGH
: DataConnectionRealTimeInfo.DC_POWER_STATE_LOW;
if (isMobile) {
- if (!fromRadio) {
- if (mMobileActivityFromRadio) {
- // If this call is not coming from a report from the radio itself, but we
- // have previously received reports from the radio, then we will take the
- // power state to just be whatever the radio last reported.
- powerState = mLastPowerStateFromRadio;
- }
- } else {
- mMobileActivityFromRadio = true;
- }
if (mLastPowerStateFromRadio != powerState) {
mLastPowerStateFromRadio = powerState;
try {
@@ -431,15 +421,9 @@
}
}
- if (!isMobile || fromRadio || !mMobileActivityFromRadio) {
- // Report the change in data activity. We don't do this if this is a change
- // on the mobile network, that is not coming from the radio itself, and we
- // have previously seen change reports from the radio. In that case only
- // the radio is the authority for the current state.
- final boolean active = isActive;
- invokeForAllObservers(o -> o.interfaceClassDataActivityChanged(
- Integer.toString(type), active, tsNanos));
- }
+ final boolean active = isActive;
+ invokeForAllObservers(o -> o.interfaceClassDataActivityChanged(
+ type, active, tsNanos, uid));
boolean report = false;
synchronized (mIdleTimerLock) {
@@ -577,13 +561,13 @@
}
if (uidRejectOnQuota != null) {
for (int i = 0; i < uidRejectOnQuota.size(); i++) {
- setUidMeteredNetworkDenylist(uidRejectOnQuota.keyAt(i),
+ setUidOnMeteredNetworkDenylist(uidRejectOnQuota.keyAt(i),
uidRejectOnQuota.valueAt(i));
}
}
if (uidAcceptOnQuota != null) {
for (int i = 0; i < uidAcceptOnQuota.size(); i++) {
- setUidMeteredNetworkAllowlist(uidAcceptOnQuota.keyAt(i),
+ setUidOnMeteredNetworkAllowlist(uidAcceptOnQuota.keyAt(i),
uidAcceptOnQuota.valueAt(i));
}
}
@@ -671,7 +655,7 @@
timestampNanos = timestamp;
}
mDaemonHandler.post(() ->
- notifyInterfaceClassActivity(label, isActive, timestampNanos, uid, false));
+ notifyInterfaceClassActivity(label, isActive, timestampNanos, uid));
}
@Override
@@ -1157,7 +1141,7 @@
mNetworkActive = false;
}
mDaemonHandler.post(() -> notifyInterfaceClassActivity(type, true,
- SystemClock.elapsedRealtimeNanos(), -1, false));
+ SystemClock.elapsedRealtimeNanos(), -1));
}
}
@@ -1181,7 +1165,7 @@
}
mActiveIdleTimers.remove(iface);
mDaemonHandler.post(() -> notifyInterfaceClassActivity(params.type, false,
- SystemClock.elapsedRealtimeNanos(), -1, false));
+ SystemClock.elapsedRealtimeNanos(), -1));
}
}
@@ -1304,14 +1288,14 @@
}
}
- private void setUidOnMeteredNetworkList(int uid, boolean denylist, boolean enable) {
+ private void setUidOnMeteredNetworkList(int uid, boolean allowlist, boolean enable) {
NetworkStack.checkNetworkStackPermission(mContext);
synchronized (mQuotaLock) {
boolean oldEnable;
SparseBooleanArray quotaList;
synchronized (mRulesLock) {
- quotaList = denylist ? mUidRejectOnMetered : mUidAllowOnMetered;
+ quotaList = allowlist ? mUidAllowOnMetered : mUidRejectOnMetered;
oldEnable = quotaList.get(uid, false);
}
if (oldEnable == enable) {
@@ -1321,18 +1305,18 @@
Trace.traceBegin(Trace.TRACE_TAG_NETWORK, "inetd bandwidth");
try {
- if (denylist) {
- if (enable) {
- mNetdService.bandwidthAddNaughtyApp(uid);
- } else {
- mNetdService.bandwidthRemoveNaughtyApp(uid);
- }
- } else {
+ if (allowlist) {
if (enable) {
mNetdService.bandwidthAddNiceApp(uid);
} else {
mNetdService.bandwidthRemoveNiceApp(uid);
}
+ } else {
+ if (enable) {
+ mNetdService.bandwidthAddNaughtyApp(uid);
+ } else {
+ mNetdService.bandwidthRemoveNaughtyApp(uid);
+ }
}
synchronized (mRulesLock) {
if (enable) {
@@ -1350,13 +1334,13 @@
}
@Override
- public void setUidMeteredNetworkDenylist(int uid, boolean enable) {
- setUidOnMeteredNetworkList(uid, true, enable);
+ public void setUidOnMeteredNetworkDenylist(int uid, boolean enable) {
+ setUidOnMeteredNetworkList(uid, false, enable);
}
@Override
- public void setUidMeteredNetworkAllowlist(int uid, boolean enable) {
- setUidOnMeteredNetworkList(uid, false, enable);
+ public void setUidOnMeteredNetworkAllowlist(int uid, boolean enable) {
+ setUidOnMeteredNetworkList(uid, true, enable);
}
@Override
@@ -1779,7 +1763,7 @@
} else {
ruleName = "deny";
}
- } else { // Denylist mode
+ } else { // Deny mode
if (rule == FIREWALL_RULE_DENY) {
ruleName = "deny";
} else {
@@ -1866,8 +1850,8 @@
pw.print("Active alert ifaces: "); pw.println(mActiveAlerts.toString());
pw.print("Data saver mode: "); pw.println(mDataSaverMode);
synchronized (mRulesLock) {
- dumpUidRuleOnQuotaLocked(pw, "denylist", mUidRejectOnMetered);
- dumpUidRuleOnQuotaLocked(pw, "allowlist", mUidAllowOnMetered);
+ dumpUidRuleOnQuotaLocked(pw, "denied UIDs", mUidRejectOnMetered);
+ dumpUidRuleOnQuotaLocked(pw, "allowed UIDs", mUidAllowOnMetered);
}
}
@@ -1920,7 +1904,7 @@
private void dumpUidRuleOnQuotaLocked(PrintWriter pw, String name, SparseBooleanArray list) {
pw.print("UID bandwith control ");
pw.print(name);
- pw.print(" rule: [");
+ pw.print(": [");
final int size = list.size();
for (int i = 0; i < size; i++) {
pw.print(list.keyAt(i));
diff --git a/services/core/java/com/android/server/OWNERS b/services/core/java/com/android/server/OWNERS
index a10764b..8f1ca83 100644
--- a/services/core/java/com/android/server/OWNERS
+++ b/services/core/java/com/android/server/OWNERS
@@ -13,6 +13,9 @@
# Sensor Privacy
per-file SensorPrivacyService.java = file:platform/frameworks/native:/libs/sensorprivacy/OWNERS
+# ServiceWatcher
+per-file ServiceWatcher.java = sooniln@google.com
+
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
@@ -22,6 +25,7 @@
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 DynamicSystemService.java = file:/packages/DynamicSystemInstallationService/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
diff --git a/services/core/java/com/android/server/ServiceWatcher.java b/services/core/java/com/android/server/ServiceWatcher.java
index 3ccb6e5..c2d8fa2 100644
--- a/services/core/java/com/android/server/ServiceWatcher.java
+++ b/services/core/java/com/android/server/ServiceWatcher.java
@@ -26,6 +26,7 @@
import static android.content.pm.PackageManager.MATCH_SYSTEM_ONLY;
import android.annotation.BoolRes;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.StringRes;
import android.annotation.UserIdInt;
@@ -53,6 +54,7 @@
import java.io.PrintWriter;
import java.util.List;
import java.util.Objects;
+import java.util.function.Predicate;
/**
* Maintains a binding to the best service that matches the given intent information. Bind and
@@ -68,6 +70,8 @@
private static final long RETRY_DELAY_MS = 15 * 1000;
+ private static final Predicate<ResolveInfo> DEFAULT_SERVICE_CHECK_PREDICATE = x -> true;
+
/** Function to run on binder interface. */
public interface BinderRunner {
/** Called to run client code with the binder. */
@@ -184,6 +188,7 @@
private final Context mContext;
private final Handler mHandler;
private final Intent mIntent;
+ private final Predicate<ResolveInfo> mServiceCheckPredicate;
private final PackageMonitor mPackageMonitor = new PackageMonitor() {
@Override
@@ -239,15 +244,24 @@
@Nullable OnBindRunner onBind, @Nullable Runnable onUnbind,
@BoolRes int enableOverlayResId, @StringRes int nonOverlayPackageResId) {
this(context, FgThread.getHandler(), action, onBind, onUnbind, enableOverlayResId,
- nonOverlayPackageResId);
+ nonOverlayPackageResId, DEFAULT_SERVICE_CHECK_PREDICATE);
}
public ServiceWatcher(Context context, Handler handler, String action,
@Nullable OnBindRunner onBind, @Nullable Runnable onUnbind,
@BoolRes int enableOverlayResId, @StringRes int nonOverlayPackageResId) {
+ this(context, handler, action, onBind, onUnbind, enableOverlayResId, nonOverlayPackageResId,
+ DEFAULT_SERVICE_CHECK_PREDICATE);
+ }
+
+ public ServiceWatcher(Context context, Handler handler, String action,
+ @Nullable OnBindRunner onBind, @Nullable Runnable onUnbind,
+ @BoolRes int enableOverlayResId, @StringRes int nonOverlayPackageResId,
+ @NonNull Predicate<ResolveInfo> serviceCheckPredicate) {
mContext = context;
mHandler = handler;
mIntent = new Intent(Objects.requireNonNull(action));
+ mServiceCheckPredicate = Objects.requireNonNull(serviceCheckPredicate);
Resources resources = context.getResources();
boolean enableOverlay = resources.getBoolean(enableOverlayResId);
@@ -269,9 +283,16 @@
* constraints.
*/
public boolean checkServiceResolves() {
- return !mContext.getPackageManager().queryIntentServicesAsUser(mIntent,
- MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE | MATCH_SYSTEM_ONLY,
- UserHandle.USER_SYSTEM).isEmpty();
+ List<ResolveInfo> resolveInfos = mContext.getPackageManager()
+ .queryIntentServicesAsUser(mIntent,
+ MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE | MATCH_SYSTEM_ONLY,
+ UserHandle.USER_SYSTEM);
+ for (ResolveInfo resolveInfo : resolveInfos) {
+ if (mServiceCheckPredicate.test(resolveInfo)) {
+ return true;
+ }
+ }
+ return false;
}
/**
@@ -320,6 +341,9 @@
GET_META_DATA | MATCH_DIRECT_BOOT_AUTO | MATCH_SYSTEM_ONLY,
mCurrentUserId);
for (ResolveInfo resolveInfo : resolveInfos) {
+ if (!mServiceCheckPredicate.test(resolveInfo)) {
+ continue;
+ }
ServiceInfo serviceInfo = new ServiceInfo(resolveInfo, mCurrentUserId);
if (serviceInfo.compareTo(bestServiceInfo) > 0) {
bestServiceInfo = serviceInfo;
diff --git a/services/core/java/com/android/server/TestNetworkService.java b/services/core/java/com/android/server/TestNetworkService.java
index 655d8ab..e8687e5 100644
--- a/services/core/java/com/android/server/TestNetworkService.java
+++ b/services/core/java/com/android/server/TestNetworkService.java
@@ -107,23 +107,23 @@
String ifacePrefix = isTun ? TEST_TUN_PREFIX : TEST_TAP_PREFIX;
String iface = ifacePrefix + sTestTunIndex.getAndIncrement();
- return Binder.withCleanCallingIdentity(
- () -> {
- try {
- ParcelFileDescriptor tunIntf =
- ParcelFileDescriptor.adoptFd(jniCreateTunTap(isTun, iface));
- for (LinkAddress addr : linkAddrs) {
- mNetd.interfaceAddAddress(
- iface,
- addr.getAddress().getHostAddress(),
- addr.getPrefixLength());
- }
+ final long token = Binder.clearCallingIdentity();
+ try {
+ ParcelFileDescriptor tunIntf =
+ ParcelFileDescriptor.adoptFd(jniCreateTunTap(isTun, iface));
+ for (LinkAddress addr : linkAddrs) {
+ mNetd.interfaceAddAddress(
+ iface,
+ addr.getAddress().getHostAddress(),
+ addr.getPrefixLength());
+ }
- return new TestNetworkInterface(tunIntf, iface);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- });
+ return new TestNetworkInterface(tunIntf, iface);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
/**
@@ -317,7 +317,12 @@
try {
// This requires NETWORK_STACK privileges.
- Binder.withCleanCallingIdentity(() -> mNMS.setInterfaceUp(iface));
+ final long token = Binder.clearCallingIdentity();
+ try {
+ mNMS.setInterfaceUp(iface);
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
// Synchronize all accesses to mTestNetworkTracker to prevent the case where:
// 1. TestNetworkAgent successfully binds to death of binder
diff --git a/services/core/java/com/android/server/VcnManagementService.java b/services/core/java/com/android/server/VcnManagementService.java
index 165b6a1..74e3851 100644
--- a/services/core/java/com/android/server/VcnManagementService.java
+++ b/services/core/java/com/android/server/VcnManagementService.java
@@ -25,24 +25,44 @@
import android.net.NetworkRequest;
import android.net.vcn.IVcnManagementService;
import android.net.vcn.VcnConfig;
+import android.os.Binder;
+import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.ParcelUuid;
+import android.os.PersistableBundle;
+import android.os.Process;
+import android.os.ServiceSpecificException;
+import android.os.UserHandle;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyManager;
+import android.util.ArrayMap;
+import android.util.Slog;
+import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting.Visibility;
+import com.android.server.vcn.util.PersistableBundleUtils;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
/**
* VcnManagementService manages Virtual Carrier Network profiles and lifecycles.
*
* <pre>The internal structure of the VCN Management subsystem is as follows:
*
- * +------------------------+ 1:1 +--------------------------------+
- * | VcnManagementService | ------------ Creates -------------> | TelephonySubscriptionManager |
- * | | | |
- * | Manages configs and | | Tracks subscriptions, carrier |
- * | VcnInstance lifecycles | <--- Notifies of subscription & --- | privilege changes, caches maps |
- * +------------------------+ carrier privilege changes +--------------------------------+
+ * +-------------------------+ 1:1 +--------------------------------+
+ * | VcnManagementService | ------------ Creates ------------> | TelephonySubscriptionManager |
+ * | | | |
+ * | Manages configs and | | Tracks subscriptions, carrier |
+ * | Vcn instance lifecycles | <--- Notifies of subscription & -- | privilege changes, caches maps |
+ * +-------------------------+ carrier privilege changes +--------------------------------+
* | 1:N ^
* | |
* | +-------------------------------+
@@ -54,19 +74,19 @@
* | mode state changes
* v |
* +-----------------------------------------------------------------------+
- * | VcnInstance |
+ * | Vcn |
* | |
- * | Manages tunnel lifecycles based on fulfillable NetworkRequest(s) |
- * | and overall safe-mode |
+ * | Manages GatewayConnection lifecycles based on fulfillable |
+ * | NetworkRequest(s) and overall safe-mode |
* +-----------------------------------------------------------------------+
* | 1:N ^
* Creates to fulfill |
- * NetworkRequest(s), tears Notifies of VcnTunnel
+ * NetworkRequest(s), tears Notifies of VcnGatewayConnection
* down when no longer needed teardown (e.g. Network reaped)
* | and safe-mode timer changes
* v |
* +-----------------------------------------------------------------------+
- * | VcnTunnel |
+ * | VcnGatewayConnection |
* | |
* | Manages a single (IKEv2) tunnel session and NetworkAgent, |
* | handles mobility events, (IPsec) Tunnel setup and safe-mode timers |
@@ -92,20 +112,72 @@
public static final boolean VDBG = false; // STOPSHIP: if true
+ @VisibleForTesting(visibility = Visibility.PRIVATE)
+ static final String VCN_CONFIG_FILE = "/data/system/vcn/configs.xml";
+
/* Binder context for this service */
@NonNull private final Context mContext;
@NonNull private final Dependencies mDeps;
@NonNull private final Looper mLooper;
+ @NonNull private final Handler mHandler;
@NonNull private final VcnNetworkProvider mNetworkProvider;
+ @GuardedBy("mLock")
+ @NonNull
+ private final Map<ParcelUuid, VcnConfig> mConfigs = new ArrayMap<>();
+
+ @NonNull private final Object mLock = new Object();
+
+ @NonNull private final PersistableBundleUtils.LockingReadWriteHelper mConfigDiskRwHelper;
+
@VisibleForTesting(visibility = Visibility.PRIVATE)
VcnManagementService(@NonNull Context context, @NonNull Dependencies deps) {
mContext = requireNonNull(context, "Missing context");
mDeps = requireNonNull(deps, "Missing dependencies");
mLooper = mDeps.getLooper();
+ mHandler = new Handler(mLooper);
mNetworkProvider = new VcnNetworkProvider(mContext, mLooper);
+
+ mConfigDiskRwHelper = mDeps.newPersistableBundleLockingReadWriteHelper(VCN_CONFIG_FILE);
+
+ // Run on handler to ensure I/O does not block system server startup
+ mHandler.post(() -> {
+ PersistableBundle configBundle = null;
+ try {
+ configBundle = mConfigDiskRwHelper.readFromDisk();
+ } catch (IOException e1) {
+ Slog.e(TAG, "Failed to read configs from disk; retrying", e1);
+
+ // Retry immediately. The IOException may have been transient.
+ try {
+ configBundle = mConfigDiskRwHelper.readFromDisk();
+ } catch (IOException e2) {
+ Slog.wtf(TAG, "Failed to read configs from disk", e2);
+ return;
+ }
+ }
+
+ if (configBundle != null) {
+ final Map<ParcelUuid, VcnConfig> configs =
+ PersistableBundleUtils.toMap(
+ configBundle,
+ PersistableBundleUtils::toParcelUuid,
+ VcnConfig::new);
+
+ synchronized (mLock) {
+ for (Entry<ParcelUuid, VcnConfig> entry : configs.entrySet()) {
+ // Ensure no new configs are overwritten; a carrier app may have added a new
+ // config.
+ if (!mConfigs.containsKey(entry.getKey())) {
+ mConfigs.put(entry.getKey(), entry.getValue());
+ }
+ }
+ // TODO: Trigger re-evaluation of active VCNs; start/stop VCNs as needed.
+ }
+ }
+ });
}
// Package-visibility for SystemServer to create instances.
@@ -130,16 +202,81 @@
}
return mHandlerThread.getLooper();
}
+
+ /**
+ * Retrieves the caller's UID
+ *
+ * <p>This call MUST be made before calling {@link Binder#clearCallingIdentity}, otherwise
+ * this will not work properly.
+ *
+ * @return
+ */
+ public int getBinderCallingUid() {
+ return Binder.getCallingUid();
+ }
+
+ /**
+ * Creates and returns a new {@link PersistableBundle.LockingReadWriteHelper}
+ *
+ * @param path the file path to read/write from/to.
+ * @return the {@link PersistableBundleUtils.LockingReadWriteHelper} instance
+ */
+ public PersistableBundleUtils.LockingReadWriteHelper
+ newPersistableBundleLockingReadWriteHelper(@NonNull String path) {
+ return new PersistableBundleUtils.LockingReadWriteHelper(path);
+ }
}
/** Notifies the VcnManagementService that external dependencies can be set up. */
public void systemReady() {
- // TODO: Retrieve existing profiles from KeyStore
-
mContext.getSystemService(ConnectivityManager.class)
.registerNetworkProvider(mNetworkProvider);
}
+ private void enforcePrimaryUser() {
+ final int uid = mDeps.getBinderCallingUid();
+ if (uid == Process.SYSTEM_UID) {
+ throw new IllegalStateException(
+ "Calling identity was System Server. Was Binder calling identity cleared?");
+ }
+
+ if (!UserHandle.getUserHandleForUid(uid).isSystem()) {
+ throw new SecurityException(
+ "VcnManagementService can only be used by callers running as the primary user");
+ }
+ }
+
+ private void enforceCallingUserAndCarrierPrivilege(ParcelUuid subscriptionGroup) {
+ // Only apps running in the primary (system) user are allowed to configure the VCN. This is
+ // in line with Telephony's behavior with regards to binding to a Carrier App provided
+ // CarrierConfigService.
+ enforcePrimaryUser();
+
+ // TODO (b/172619301): Check based on events propagated from CarrierPrivilegesTracker
+ final SubscriptionManager subMgr = mContext.getSystemService(SubscriptionManager.class);
+ final List<SubscriptionInfo> subscriptionInfos = new ArrayList<>();
+ Binder.withCleanCallingIdentity(
+ () -> {
+ subscriptionInfos.addAll(subMgr.getSubscriptionsInGroup(subscriptionGroup));
+ });
+
+ final TelephonyManager telMgr = mContext.getSystemService(TelephonyManager.class);
+ for (SubscriptionInfo info : subscriptionInfos) {
+ // Check subscription is active first; much cheaper/faster check, and an app (currently)
+ // cannot be carrier privileged for inactive subscriptions.
+ if (subMgr.isValidSlotIndex(info.getSimSlotIndex())
+ && telMgr.hasCarrierPrivileges(info.getSubscriptionId())) {
+ // TODO (b/173717728): Allow configuration for inactive, but manageable
+ // subscriptions.
+ // TODO (b/173718661): Check for whole subscription groups at a time.
+ return;
+ }
+ }
+
+ throw new SecurityException(
+ "Carrier privilege required for subscription group to set VCN Config");
+ }
+
/**
* Sets a VCN config for a given subscription group.
*
@@ -150,7 +287,17 @@
requireNonNull(subscriptionGroup, "subscriptionGroup was null");
requireNonNull(config, "config was null");
- // TODO: Store VCN configuration, trigger startup as necessary
+ enforceCallingUserAndCarrierPrivilege(subscriptionGroup);
+
+ synchronized (mLock) {
+ mConfigs.put(subscriptionGroup, config);
+
+ // Must be done synchronously to ensure that writes do not happen out-of-order.
+ writeConfigsToDiskLocked();
+ }
+
+ // TODO: Clear Binder calling identity
+ // TODO: Trigger startup as necessary
}
/**
@@ -162,7 +309,40 @@
public void clearVcnConfig(@NonNull ParcelUuid subscriptionGroup) {
requireNonNull(subscriptionGroup, "subscriptionGroup was null");
- // TODO: Clear VCN configuration, trigger teardown as necessary
+ enforceCallingUserAndCarrierPrivilege(subscriptionGroup);
+
+ synchronized (mLock) {
+ mConfigs.remove(subscriptionGroup);
+
+ // Must be done synchronously to ensure that writes do not happen out-of-order.
+ writeConfigsToDiskLocked();
+ }
+
+ // TODO: Clear Binder calling identity
+ // TODO: Trigger teardown as necessary
+ }
+
+ @GuardedBy("mLock")
+ private void writeConfigsToDiskLocked() {
+ try {
+ PersistableBundle bundle =
+ PersistableBundleUtils.fromMap(
+ mConfigs,
+ PersistableBundleUtils::fromParcelUuid,
+ VcnConfig::toPersistableBundle);
+ mConfigDiskRwHelper.writeToDisk(bundle);
+ } catch (IOException e) {
+ Slog.e(TAG, "Failed to save configs to disk", e);
+ throw new ServiceSpecificException(0, "Failed to save configs");
+ }
+ }
+
+ /** Get current configuration list for testing purposes */
+ @VisibleForTesting(visibility = Visibility.PRIVATE)
+ Map<ParcelUuid, VcnConfig> getConfigs() {
+ synchronized (mLock) {
+ return Collections.unmodifiableMap(mConfigs);
+ }
}
/**
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index 6a52266..5fde046 100644
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -1700,13 +1700,12 @@
// TODO: remove as part of fixing b/173627642
@SuppressWarnings("AndroidFrameworkCompatChange")
private void postFgsNotificationLocked(ServiceRecord r) {
- final boolean isLegacyApp = (r.appInfo.targetSdkVersion < Build.VERSION_CODES.S);
boolean showNow = !mAm.mConstants.mFlagFgsNotificationDeferralEnabled;
if (!showNow) {
// Legacy apps' FGS notifications are not deferred unless the relevant
// DeviceConfig element has been set
showNow = mAm.mConstants.mFlagFgsNotificationDeferralApiGated
- && isLegacyApp;
+ && r.appInfo.targetSdkVersion < Build.VERSION_CODES.S;
}
if (!showNow) {
// is the notification such that it should show right away?
@@ -1761,11 +1760,6 @@
Slog.d(TAG_SERVICE, "FGS " + r
+ " notification in " + (when - now) + " ms");
}
- if (isLegacyApp) {
- Slog.i(TAG_SERVICE, "Deferring FGS notification in legacy app "
- + r.appInfo.packageName + "/" + UserHandle.formatUid(r.appInfo.uid)
- + " : " + r.foregroundNoti);
- }
mAm.mHandler.postAtTime(mPostDeferredFGSNotifications, when);
}
diff --git a/services/core/java/com/android/server/am/ActivityManagerConstants.java b/services/core/java/com/android/server/am/ActivityManagerConstants.java
index 6892ef7..b0f296f 100644
--- a/services/core/java/com/android/server/am/ActivityManagerConstants.java
+++ b/services/core/java/com/android/server/am/ActivityManagerConstants.java
@@ -370,9 +370,9 @@
volatile boolean mFlagFgsNotificationDeferralEnabled = true;
// Restrict FGS notification deferral policy to only those apps that target
- // API version S or higher. Disabled by default; set to "true" to force
- // legacy app FGS notifications to display immediately in all cases.
- volatile boolean mFlagFgsNotificationDeferralApiGated = false;
+ // API version S or higher. Enabled by default; set to "false" to defer FGS
+ // notifications from legacy apps as well.
+ volatile boolean mFlagFgsNotificationDeferralApiGated = true;
// Time in milliseconds to defer FGS notifications after their transition to
// the foreground state.
@@ -806,7 +806,7 @@
mFlagFgsNotificationDeferralApiGated = DeviceConfig.getBoolean(
DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
KEY_DEFERRED_FGS_NOTIFICATIONS_API_GATED,
- /*default value*/ false);
+ /*default value*/ true);
}
private void updateFgsNotificationDeferralInterval() {
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 7fb0bda..1841d67 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -11247,6 +11247,10 @@
// set on ION VMAs, therefore consider the entire ION heap as used kernel memory
kernelUsed += ionHeap;
}
+ final long gpuUsage = Debug.getGpuTotalUsageKb();
+ if (gpuUsage >= 0) {
+ pw.print(" GPU: "); pw.println(stringifyKBSize(gpuUsage));
+ }
final long lostRAM = memInfo.getTotalSizeKb()
- (ss[INDEX_TOTAL_PSS] - ss[INDEX_TOTAL_SWAP_PSS])
- memInfo.getFreeSizeKb() - memInfo.getCachedSizeKb()
@@ -12041,6 +12045,12 @@
// set on ION VMAs, therefore consider the entire ION heap as used kernel memory
kernelUsed += ionHeap;
}
+ final long gpuUsage = Debug.getGpuTotalUsageKb();
+ if (gpuUsage >= 0) {
+ memInfoBuilder.append(" GPU: ");
+ memInfoBuilder.append(stringifyKBSize(gpuUsage));
+ memInfoBuilder.append("\n");
+ }
memInfoBuilder.append(" Used RAM: ");
memInfoBuilder.append(stringifyKBSize(
totalPss - cachedPss + kernelUsed));
diff --git a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java
index 12fe3ed..fffa814 100644
--- a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java
+++ b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java
@@ -2928,6 +2928,7 @@
final PlatformCompat platformCompat = (PlatformCompat)
ServiceManager.getService(Context.PLATFORM_COMPAT_SERVICE);
String toggleValue = getNextArgRequired();
+ boolean killPackage = !"--no-kill".equals(getNextOption());
boolean toggleAll = false;
int targetSdkVersion = -1;
long changeId = -1;
@@ -2979,7 +2980,11 @@
CompatibilityChangeConfig overrides =
new CompatibilityChangeConfig(
new Compatibility.ChangeConfig(enabled, disabled));
- platformCompat.setOverrides(overrides, packageName);
+ if (killPackage) {
+ platformCompat.setOverrides(overrides, packageName);
+ } else {
+ platformCompat.setOverridesForTest(overrides, packageName);
+ }
pw.println("Enabled change " + changeId + " for " + packageName + ".");
}
return 0;
@@ -2998,13 +3003,21 @@
CompatibilityChangeConfig overrides =
new CompatibilityChangeConfig(
new Compatibility.ChangeConfig(enabled, disabled));
- platformCompat.setOverrides(overrides, packageName);
+ if (killPackage) {
+ platformCompat.setOverrides(overrides, packageName);
+ } else {
+ platformCompat.setOverridesForTest(overrides, packageName);
+ }
pw.println("Disabled change " + changeId + " for " + packageName + ".");
}
return 0;
case "reset":
if (toggleAll) {
- platformCompat.clearOverrides(packageName);
+ if (killPackage) {
+ platformCompat.clearOverrides(packageName);
+ } else {
+ platformCompat.clearOverridesForTest(packageName);
+ }
pw.println("Reset all changes for " + packageName + " to default value.");
return 0;
}
@@ -3410,15 +3423,18 @@
pw.println(" write");
pw.println(" Write all pending state to storage.");
pw.println(" compat [COMMAND] [...]: sub-commands for toggling app-compat changes.");
- pw.println(" enable|disable|reset <CHANGE_ID|CHANGE_NAME> <PACKAGE_NAME>");
+ pw.println(" enable|disable [--no-kill] <CHANGE_ID|CHANGE_NAME> <PACKAGE_NAME>");
+ pw.println(" Toggles a change either by id or by name for <PACKAGE_NAME>.");
+ pw.println(" It kills <PACKAGE_NAME> (to allow the toggle to take effect) unless --no-kill is provided.");
+ pw.println(" reset <CHANGE_ID|CHANGE_NAME> <PACKAGE_NAME>");
pw.println(" Toggles a change either by id or by name for <PACKAGE_NAME>.");
pw.println(" It kills <PACKAGE_NAME> (to allow the toggle to take effect).");
- pw.println(" enable-all|disable-all <targetSdkVersion> <PACKAGE_NAME");
+ pw.println(" enable-all|disable-all <targetSdkVersion> <PACKAGE_NAME>");
pw.println(" Toggles all changes that are gated by <targetSdkVersion>.");
- pw.println(" reset-all <PACKAGE_NAME>");
+ pw.println(" reset-all [--no-kill] <PACKAGE_NAME>");
pw.println(" Removes all existing overrides for all changes for ");
pw.println(" <PACKAGE_NAME> (back to default behaviour).");
- pw.println(" It kills <PACKAGE_NAME> (to allow the toggle to take effect).");
+ pw.println(" It kills <PACKAGE_NAME> (to allow the toggle to take effect) unless --no-kill is provided.");
pw.println(" memory-factor [command] [...]: sub-commands for overriding memory pressure factor");
pw.println(" set <NORMAL|MODERATE|LOW|CRITICAL>");
pw.println(" Overrides memory pressure factor. May also supply a raw int level");
diff --git a/services/core/java/com/android/server/am/BatteryStatsService.java b/services/core/java/com/android/server/am/BatteryStatsService.java
index 083e970..2f7c523 100644
--- a/services/core/java/com/android/server/am/BatteryStatsService.java
+++ b/services/core/java/com/android/server/am/BatteryStatsService.java
@@ -254,9 +254,7 @@
mHandler = new Handler(mHandlerThread.getLooper());
// TODO(b/173077356): Replace directly calling the HAL with PowerStatsService queries
- // Make sure to init Hal Wrapper before creating BatteryStatsImpl.
- mPowerStatsHALWrapper = new PowerStatsHALWrapper.PowerStatsHALWrapperImpl();
- mPowerStatsHALWrapper.initialize();
+ mPowerStatsHALWrapper = PowerStatsHALWrapper.getPowerStatsHalImpl();
final MeasuredEnergyArray initialEnergies = getEnergyConsumptionData();
final boolean[] supportedBuckets = getSupportedEnergyBuckets(initialEnergies);
diff --git a/services/core/java/com/android/server/am/OomAdjuster.java b/services/core/java/com/android/server/am/OomAdjuster.java
index 5b3e651..e5d57df 100644
--- a/services/core/java/com/android/server/am/OomAdjuster.java
+++ b/services/core/java/com/android/server/am/OomAdjuster.java
@@ -484,7 +484,7 @@
ActiveUids uids = mTmpUidRecords;
uids.clear();
uids.put(uidRec.uid, uidRec);
- updateUidsLocked(uids, now);
+ updateUidsLocked(uids, SystemClock.elapsedRealtime());
mProcessList.incrementProcStateSeqAndNotifyAppsLocked(uids);
}
}
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index 4444de0..2ab5aa6 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -3467,6 +3467,8 @@
/** @see AudioManager#getStreamVolume(int) */
public int getStreamVolume(int streamType) {
ensureValidStreamType(streamType);
+ Log.e(TAG, "AudioSystem.getDevicesForStream In AudioService from u/pid"
+ + Binder.getCallingUid() + "/" + Binder.getCallingPid());
int device = getDeviceForStream(streamType);
synchronized (VolumeStreamState.class) {
int index = mStreamStates[streamType].getIndex(device);
@@ -7951,6 +7953,8 @@
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
+ mAudioSystem.dump(pw);
+
sLifecycleLogger.dump(pw);
if (mAudioHandler != null) {
pw.println("\nMessage handler (watch for unhandled messages):");
@@ -8906,14 +8910,8 @@
mPlaybackMonitor.playerAttributes(piid, attr, Binder.getCallingUid());
}
- /**
- * Update player event
- * @param piid Player id to update
- * @param event The new player event
- * @param deviceId The new player device id
- */
- public void playerEvent(int piid, int event, int deviceId) {
- mPlaybackMonitor.playerEvent(piid, event, deviceId, Binder.getCallingUid());
+ public void playerEvent(int piid, int event) {
+ mPlaybackMonitor.playerEvent(piid, event, Binder.getCallingUid());
}
public void playerHasOpPlayAudio(int piid, boolean hasOpPlayAudio) {
diff --git a/services/core/java/com/android/server/audio/AudioSystemAdapter.java b/services/core/java/com/android/server/audio/AudioSystemAdapter.java
index 891c713..ff84505e 100644
--- a/services/core/java/com/android/server/audio/AudioSystemAdapter.java
+++ b/services/core/java/com/android/server/audio/AudioSystemAdapter.java
@@ -21,9 +21,13 @@
import android.media.AudioDeviceAttributes;
import android.media.AudioSystem;
import android.media.audiopolicy.AudioMix;
+import android.os.SystemClock;
+import android.util.Log;
+import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
/**
* Provides an adapter to access functionality of the android.media.AudioSystem class for device
@@ -31,15 +35,79 @@
* Use the "real" AudioSystem through the default adapter.
* Use the "always ok" adapter to avoid dealing with the APM behaviors during a test.
*/
-public class AudioSystemAdapter {
+public class AudioSystemAdapter implements AudioSystem.RoutingUpdateCallback {
+
+ private static final String TAG = "AudioSystemAdapter";
+
+ // initialized in factory getDefaultAdapter()
+ private static AudioSystemAdapter sSingletonDefaultAdapter;
+
+ /**
+ * should be false by default unless enabling measurements of method call counts and time spent
+ * in measured methods
+ */
+ private static final boolean ENABLE_GETDEVICES_STATS = false;
+ private static final int NB_MEASUREMENTS = 2;
+ private static final int METHOD_GETDEVICESFORSTREAM = 0;
+ private static final int METHOD_GETDEVICESFORATTRIBUTES = 1;
+ private long[] mMethodTimeNs;
+ private int[] mMethodCallCounter;
+ private String[] mMethodNames = {"getDevicesForStream", "getDevicesForAttributes"};
+
+ private static final boolean USE_CACHE_FOR_GETDEVICES = true;
+ private ConcurrentHashMap<Integer, Integer> mDevicesForStreamCache;
+ private int[] mMethodCacheHit;
+
+ /**
+ * should be false except when trying to debug caching errors. When true, the value retrieved
+ * from the cache will be compared against the real queried value, which defeats the purpose of
+ * the cache in terms of performance.
+ */
+ private static final boolean DEBUG_CACHE = false;
+
+ /**
+ * Implementation of AudioSystem.RoutingUpdateCallback
+ */
+ @Override
+ public void onRoutingUpdated() {
+ if (DEBUG_CACHE) {
+ Log.d(TAG, "---- onRoutingUpdated (from native) ----------");
+ }
+ invalidateRoutingCache();
+ }
/**
* Create a wrapper around the {@link AudioSystem} static methods, all functions are directly
* forwarded to the AudioSystem class.
* @return an adapter around AudioSystem
*/
- static final @NonNull AudioSystemAdapter getDefaultAdapter() {
- return new AudioSystemAdapter();
+ static final synchronized @NonNull AudioSystemAdapter getDefaultAdapter() {
+ if (sSingletonDefaultAdapter == null) {
+ sSingletonDefaultAdapter = new AudioSystemAdapter();
+ AudioSystem.setRoutingCallback(sSingletonDefaultAdapter);
+ if (USE_CACHE_FOR_GETDEVICES) {
+ sSingletonDefaultAdapter.mDevicesForStreamCache =
+ new ConcurrentHashMap<Integer, Integer>(AudioSystem.getNumStreamTypes());
+ sSingletonDefaultAdapter.mMethodCacheHit = new int[NB_MEASUREMENTS];
+ }
+ if (ENABLE_GETDEVICES_STATS) {
+ sSingletonDefaultAdapter.mMethodCallCounter = new int[NB_MEASUREMENTS];
+ sSingletonDefaultAdapter.mMethodTimeNs = new long[NB_MEASUREMENTS];
+ }
+ }
+ return sSingletonDefaultAdapter;
+ }
+
+ private void invalidateRoutingCache() {
+ if (DEBUG_CACHE) {
+ Log.d(TAG, "---- clearing cache ----------");
+ }
+ if (mDevicesForStreamCache == null) {
+ return;
+ }
+ synchronized (mDevicesForStreamCache) {
+ mDevicesForStreamCache.clear();
+ }
}
/**
@@ -48,6 +116,44 @@
* @return a mask of device types
*/
public int getDevicesForStream(int stream) {
+ if (!ENABLE_GETDEVICES_STATS) {
+ return getDevicesForStreamImpl(stream);
+ }
+ mMethodCallCounter[METHOD_GETDEVICESFORSTREAM]++;
+ final long startTime = SystemClock.uptimeNanos();
+ final int res = getDevicesForStreamImpl(stream);
+ mMethodTimeNs[METHOD_GETDEVICESFORSTREAM] += SystemClock.uptimeNanos() - startTime;
+ return res;
+ }
+
+ private int getDevicesForStreamImpl(int stream) {
+ if (USE_CACHE_FOR_GETDEVICES) {
+ Integer res;
+ synchronized (mDevicesForStreamCache) {
+ res = mDevicesForStreamCache.get(stream);
+ if (res == null) {
+ res = AudioSystem.getDevicesForStream(stream);
+ mDevicesForStreamCache.put(stream, res);
+ if (DEBUG_CACHE) {
+ Log.d(TAG, " stream=" + stream + " dev=0x" + Integer.toHexString(res));
+ }
+ return res;
+ }
+ // cache hit
+ mMethodCacheHit[METHOD_GETDEVICESFORSTREAM]++;
+ if (DEBUG_CACHE) {
+ final int real = AudioSystem.getDevicesForStream(stream);
+ if (res == real) {
+ Log.d(TAG, " stream=" + stream + " dev=0x" + Integer.toHexString(res)
+ + " CACHE");
+ } else {
+ Log.e(TAG, " stream=" + stream + " dev=0x" + Integer.toHexString(res)
+ + " CACHE ERROR real dev=0x" + Integer.toHexString(real));
+ }
+ }
+ }
+ return res;
+ }
return AudioSystem.getDevicesForStream(stream);
}
@@ -58,6 +164,19 @@
*/
public @NonNull ArrayList<AudioDeviceAttributes> getDevicesForAttributes(
@NonNull AudioAttributes attributes) {
+ if (!ENABLE_GETDEVICES_STATS) {
+ return getDevicesForAttributesImpl(attributes);
+ }
+ mMethodCallCounter[METHOD_GETDEVICESFORATTRIBUTES]++;
+ final long startTime = SystemClock.uptimeNanos();
+ final ArrayList<AudioDeviceAttributes> res = getDevicesForAttributesImpl(attributes);
+ mMethodTimeNs[METHOD_GETDEVICESFORATTRIBUTES] += SystemClock.uptimeNanos() - startTime;
+ return res;
+ }
+
+ private @NonNull ArrayList<AudioDeviceAttributes> getDevicesForAttributesImpl(
+ @NonNull AudioAttributes attributes) {
+ // TODO implement caching for attributes-based routing
return AudioSystem.getDevicesForAttributes(attributes);
}
@@ -72,6 +191,7 @@
*/
public int setDeviceConnectionState(int device, int state, String deviceAddress,
String deviceName, int codecFormat) {
+ invalidateRoutingCache();
return AudioSystem.setDeviceConnectionState(device, state, deviceAddress, deviceName,
codecFormat);
}
@@ -96,6 +216,7 @@
*/
public int handleDeviceConfigChange(int device, String deviceAddress,
String deviceName, int codecFormat) {
+ invalidateRoutingCache();
return AudioSystem.handleDeviceConfigChange(device, deviceAddress, deviceName,
codecFormat);
}
@@ -109,6 +230,7 @@
*/
public int setDevicesRoleForStrategy(int strategy, int role,
@NonNull List<AudioDeviceAttributes> devices) {
+ invalidateRoutingCache();
return AudioSystem.setDevicesRoleForStrategy(strategy, role, devices);
}
@@ -119,6 +241,7 @@
* @return
*/
public int removeDevicesRoleForStrategy(int strategy, int role) {
+ invalidateRoutingCache();
return AudioSystem.removeDevicesRoleForStrategy(strategy, role);
}
@@ -131,11 +254,12 @@
*/
public int setDevicesRoleForCapturePreset(int capturePreset, int role,
@NonNull List<AudioDeviceAttributes> devices) {
+ invalidateRoutingCache();
return AudioSystem.setDevicesRoleForCapturePreset(capturePreset, role, devices);
}
/**
- * Same as {@link AudioSystem#removeDevicesRoleForCapturePreset(int, int)}
+ * Same as {@link AudioSystem#removeDevicesRoleForCapturePreset(int, int, int[], String[])}
* @param capturePreset
* @param role
* @param devicesToRemove
@@ -143,6 +267,7 @@
*/
public int removeDevicesRoleForCapturePreset(
int capturePreset, int role, @NonNull List<AudioDeviceAttributes> devicesToRemove) {
+ invalidateRoutingCache();
return AudioSystem.removeDevicesRoleForCapturePreset(capturePreset, role, devicesToRemove);
}
@@ -153,6 +278,7 @@
* @return
*/
public int clearDevicesRoleForCapturePreset(int capturePreset, int role) {
+ invalidateRoutingCache();
return AudioSystem.clearDevicesRoleForCapturePreset(capturePreset, role);
}
@@ -218,6 +344,7 @@
* @return
*/
public int setPhoneState(int state, int uid) {
+ invalidateRoutingCache();
return AudioSystem.setPhoneState(state, uid);
}
@@ -238,6 +365,7 @@
* @return
*/
public int setForceUse(int usage, int config) {
+ invalidateRoutingCache();
return AudioSystem.setForceUse(usage, config);
}
@@ -257,6 +385,7 @@
* @return
*/
public int registerPolicyMixes(ArrayList<AudioMix> mixes, boolean register) {
+ invalidateRoutingCache();
return AudioSystem.registerPolicyMixes(mixes, register);
}
@@ -268,6 +397,7 @@
* @return
*/
public int setUidDeviceAffinities(int uid, @NonNull int[] types, @NonNull String[] addresses) {
+ invalidateRoutingCache();
return AudioSystem.setUidDeviceAffinities(uid, types, addresses);
}
@@ -277,6 +407,7 @@
* @return
*/
public int removeUidDeviceAffinities(int uid) {
+ invalidateRoutingCache();
return AudioSystem.removeUidDeviceAffinities(uid);
}
@@ -289,6 +420,7 @@
*/
public int setUserIdDeviceAffinities(int userId, @NonNull int[] types,
@NonNull String[] addresses) {
+ invalidateRoutingCache();
return AudioSystem.setUserIdDeviceAffinities(userId, types, addresses);
}
@@ -298,6 +430,27 @@
* @return
*/
public int removeUserIdDeviceAffinities(int userId) {
+ invalidateRoutingCache();
return AudioSystem.removeUserIdDeviceAffinities(userId);
}
+
+ /**
+ * Part of AudioService dump
+ * @param pw
+ */
+ public void dump(PrintWriter pw) {
+ if (!ENABLE_GETDEVICES_STATS) {
+ // only stats in this dump
+ return;
+ }
+ pw.println("\nAudioSystemAdapter:");
+ for (int i = 0; i < NB_MEASUREMENTS; i++) {
+ pw.println(mMethodNames[i]
+ + ": counter=" + mMethodCallCounter[i]
+ + " time(ms)=" + (mMethodTimeNs[i] / 1E6)
+ + (USE_CACHE_FOR_GETDEVICES
+ ? (" FScacheHit=" + mMethodCacheHit[METHOD_GETDEVICESFORSTREAM]) : ""));
+ }
+ pw.println("\n");
+ }
}
diff --git a/services/core/java/com/android/server/audio/FocusRequester.java b/services/core/java/com/android/server/audio/FocusRequester.java
index 41008c2..b6d6472 100644
--- a/services/core/java/com/android/server/audio/FocusRequester.java
+++ b/services/core/java/com/android/server/audio/FocusRequester.java
@@ -140,6 +140,10 @@
return (mFocusDispatcher != null) && mFocusDispatcher.equals(fd);
}
+ @NonNull String getPackageName() {
+ return mPackageName;
+ }
+
boolean hasSamePackage(@NonNull String pack) {
return mPackageName.compareTo(pack) == 0;
}
diff --git a/services/core/java/com/android/server/audio/MediaFocusControl.java b/services/core/java/com/android/server/audio/MediaFocusControl.java
index f02bb8f..5025c4a 100644
--- a/services/core/java/com/android/server/audio/MediaFocusControl.java
+++ b/services/core/java/com/android/server/audio/MediaFocusControl.java
@@ -353,6 +353,13 @@
FocusRequester fr = stackIterator.next();
if(fr.hasSameBinder(cb)) {
Log.i(TAG, "AudioFocus removeFocusStackEntryOnDeath(): removing entry for " + cb);
+ mEventLogger.log(new AudioEventLogger.StringEvent(
+ "focus requester:" + fr.getClientId()
+ + " in uid:" + fr.getClientUid()
+ + " pack:" + fr.getPackageName()
+ + " died"));
+ notifyExtPolicyFocusLoss_syncAf(fr.toAudioFocusInfo(), false);
+
stackIterator.remove();
// stack entry not used anymore, clear references
fr.release();
@@ -371,7 +378,7 @@
* it has died.
*/
@GuardedBy("mAudioFocusLock")
- private void removeFocusEntryForExtPolicy(IBinder cb) {
+ private void removeFocusEntryForExtPolicyOnDeath(IBinder cb) {
if (mFocusOwnersForFocusPolicy.isEmpty()) {
return;
}
@@ -383,6 +390,11 @@
final FocusRequester fr = owner.getValue();
if (fr.hasSameBinder(cb)) {
ownerIterator.remove();
+ mEventLogger.log(new AudioEventLogger.StringEvent(
+ "focus requester:" + fr.getClientId()
+ + " in uid:" + fr.getClientUid()
+ + " pack:" + fr.getPackageName()
+ + " died"));
fr.release();
notifyExtFocusPolicyFocusAbandon_syncAf(fr.toAudioFocusInfo());
break;
@@ -456,7 +468,7 @@
public void binderDied() {
synchronized(mAudioFocusLock) {
if (mFocusPolicy != null) {
- removeFocusEntryForExtPolicy(mCb);
+ removeFocusEntryForExtPolicyOnDeath(mCb);
} else {
removeFocusStackEntryOnDeath(mCb);
if (mMultiAudioFocusEnabled && !mMultiAudioFocusList.isEmpty()) {
diff --git a/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java b/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java
index 36c67cd..a577883 100644
--- a/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java
+++ b/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java
@@ -233,25 +233,15 @@
}
}
- /**
- * Update player event
- * @param piid Player id to update
- * @param event The new player event
- * @param deviceId The new player device id
- * @param binderUid Calling binder uid
- */
- public void playerEvent(int piid, int event, int deviceId, int binderUid) {
- if (DEBUG) {
- Log.v(TAG, String.format("playerEvent(piid=%d, deviceId=%d, event=%d)",
- piid, deviceId, event));
- }
+ public void playerEvent(int piid, int event, int binderUid) {
+ if (DEBUG) { Log.v(TAG, String.format("playerEvent(piid=%d, event=%d)", piid, event)); }
final boolean change;
synchronized(mPlayerLock) {
final AudioPlaybackConfiguration apc = mPlayers.get(new Integer(piid));
if (apc == null) {
return;
}
- sEventLogger.log(new PlayerEvent(piid, event, deviceId));
+ sEventLogger.log(new PlayerEvent(piid, event));
if (event == AudioPlaybackConfiguration.PLAYER_STATE_STARTED) {
for (Integer uidInteger: mBannedUids) {
if (checkBanPlayer(apc, uidInteger.intValue())) {
@@ -269,7 +259,7 @@
if (checkConfigurationCaller(piid, apc, binderUid)) {
//TODO add generation counter to only update to the latest state
checkVolumeForPrivilegedAlarm(apc, event);
- change = apc.handleStateEvent(event, deviceId);
+ change = apc.handleStateEvent(event);
} else {
Log.e(TAG, "Error handling event " + event);
change = false;
@@ -299,8 +289,7 @@
mPlayers.remove(new Integer(piid));
mDuckingManager.removeReleased(apc);
checkVolumeForPrivilegedAlarm(apc, AudioPlaybackConfiguration.PLAYER_STATE_RELEASED);
- change = apc.handleStateEvent(AudioPlaybackConfiguration.PLAYER_STATE_RELEASED,
- AudioPlaybackConfiguration.PLAYER_DEVICEID_INVALID);
+ change = apc.handleStateEvent(AudioPlaybackConfiguration.PLAYER_STATE_RELEASED);
}
}
if (change) {
@@ -879,19 +868,16 @@
// only keeping the player interface ID as it uniquely identifies the player in the event
final int mPlayerIId;
final int mState;
- final int mDeviceId;
- PlayerEvent(int piid, int state, int deviceId) {
+ PlayerEvent(int piid, int state) {
mPlayerIId = piid;
mState = state;
- mDeviceId = deviceId;
}
@Override
public String eventToString() {
return new StringBuilder("player piid:").append(mPlayerIId).append(" state:")
- .append(AudioPlaybackConfiguration.toLogFriendlyPlayerState(mState))
- .append(" DeviceId:").append(mDeviceId).toString();
+ .append(AudioPlaybackConfiguration.toLogFriendlyPlayerState(mState)).toString();
}
}
diff --git a/services/core/java/com/android/server/biometrics/BiometricService.java b/services/core/java/com/android/server/biometrics/BiometricService.java
index 75e1938..a81abcd 100644
--- a/services/core/java/com/android/server/biometrics/BiometricService.java
+++ b/services/core/java/com/android/server/biometrics/BiometricService.java
@@ -608,8 +608,9 @@
}
@Override
- public void registerAuthenticator(int id, int modality, @Authenticators.Types int strength,
- IBiometricAuthenticator authenticator) {
+ public synchronized void registerAuthenticator(int id, int modality,
+ @Authenticators.Types int strength,
+ @NonNull IBiometricAuthenticator authenticator) {
checkInternalPermission();
Slog.d(TAG, "Registering ID: " + id
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/FaceUserState.java b/services/core/java/com/android/server/biometrics/sensors/face/FaceUserState.java
index 78e875b..a26662d 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/FaceUserState.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/FaceUserState.java
@@ -133,7 +133,7 @@
if (tagName.equals(TAG_FACE)) {
String name = parser.getAttributeValue(null, ATTR_NAME);
int faceId = parser.getAttributeInt(null, ATTR_FACE_ID);
- int deviceId = parser.getAttributeInt(null, ATTR_DEVICE_ID);
+ long deviceId = parser.getAttributeLong(null, ATTR_DEVICE_ID);
mBiometrics.add(new Face(name, faceId, deviceId));
}
}
diff --git a/services/core/java/com/android/server/compat/CompatChange.java b/services/core/java/com/android/server/compat/CompatChange.java
index ff31931..a8aa9aa 100644
--- a/services/core/java/com/android/server/compat/CompatChange.java
+++ b/services/core/java/com/android/server/compat/CompatChange.java
@@ -143,6 +143,9 @@
* @return {@code true} if the change should be enabled for the package.
*/
boolean isEnabled(ApplicationInfo app) {
+ if (app == null) {
+ return defaultValue();
+ }
if (mPackageOverrides != null && mPackageOverrides.containsKey(app.packageName)) {
return mPackageOverrides.get(app.packageName);
}
@@ -156,6 +159,15 @@
}
/**
+ * Returns the default value for the change id, assuming there are no overrides.
+ *
+ * @return {@code false} if it's a default disabled change, {@code true} otherwise.
+ */
+ boolean defaultValue() {
+ return !getDisabled();
+ }
+
+ /**
* Checks whether a change has an override for a package.
* @param packageName name of the package
* @return true if there is such override
diff --git a/services/core/java/com/android/server/compat/CompatConfig.java b/services/core/java/com/android/server/compat/CompatConfig.java
index d80c58b..8511118 100644
--- a/services/core/java/com/android/server/compat/CompatConfig.java
+++ b/services/core/java/com/android/server/compat/CompatConfig.java
@@ -392,6 +392,14 @@
return alreadyKnown;
}
+ boolean defaultChangeIdValue(long changeId) {
+ CompatChange c = mChanges.get(changeId);
+ if (c == null) {
+ return true;
+ }
+ return c.defaultValue();
+ }
+
@VisibleForTesting
void clearChanges() {
synchronized (mChanges) {
diff --git a/services/core/java/com/android/server/compat/PlatformCompat.java b/services/core/java/com/android/server/compat/PlatformCompat.java
index 77d5411..aa85f7f 100644
--- a/services/core/java/com/android/server/compat/PlatformCompat.java
+++ b/services/core/java/com/android/server/compat/PlatformCompat.java
@@ -60,7 +60,6 @@
private final CompatConfig mCompatConfig;
private static int sMinTargetSdk = Build.VERSION_CODES.Q;
- private static int sMaxTargetSdk = Build.VERSION_CODES.R;
public PlatformCompat(Context context) {
mContext = context;
@@ -120,10 +119,12 @@
* permission check.
*/
public boolean isChangeEnabledInternal(long changeId, ApplicationInfo appInfo) {
- boolean value = isChangeEnabledInternalNoLogging(changeId, appInfo);
- reportChange(changeId, appInfo.uid,
- value ? ChangeReporter.STATE_ENABLED : ChangeReporter.STATE_DISABLED);
- return value;
+ boolean enabled = isChangeEnabledInternalNoLogging(changeId, appInfo);
+ if (appInfo != null) {
+ reportChange(changeId, appInfo.uid,
+ enabled ? ChangeReporter.STATE_ENABLED : ChangeReporter.STATE_DISABLED);
+ }
+ return enabled;
}
@Override
@@ -131,9 +132,6 @@
@UserIdInt int userId) {
checkCompatChangeReadAndLogPermission();
ApplicationInfo appInfo = getApplicationInfo(packageName, userId);
- if (appInfo == null) {
- return true;
- }
return isChangeEnabled(changeId, appInfo);
}
@@ -142,7 +140,7 @@
checkCompatChangeReadAndLogPermission();
String[] packages = mContext.getPackageManager().getPackagesForUid(uid);
if (packages == null || packages.length == 0) {
- return true;
+ return mCompatConfig.defaultChangeIdValue(changeId);
}
boolean enabled = true;
for (String packageName : packages) {
@@ -385,8 +383,7 @@
return false;
}
if (change.getEnableSinceTargetSdk() > 0) {
- if (change.getEnableSinceTargetSdk() < sMinTargetSdk
- || change.getEnableSinceTargetSdk() > sMaxTargetSdk) {
+ if (change.getEnableSinceTargetSdk() < sMinTargetSdk) {
return false;
}
}
diff --git a/services/core/java/com/android/server/connectivity/KeepaliveTracker.java b/services/core/java/com/android/server/connectivity/KeepaliveTracker.java
index 96cbfde..34d9ccc 100644
--- a/services/core/java/com/android/server/connectivity/KeepaliveTracker.java
+++ b/services/core/java/com/android/server/connectivity/KeepaliveTracker.java
@@ -18,10 +18,7 @@
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.net.NattSocketKeepalive.NATT_PORT;
-import static android.net.NetworkAgent.CMD_ADD_KEEPALIVE_PACKET_FILTER;
-import static android.net.NetworkAgent.CMD_REMOVE_KEEPALIVE_PACKET_FILTER;
import static android.net.NetworkAgent.CMD_START_SOCKET_KEEPALIVE;
-import static android.net.NetworkAgent.CMD_STOP_SOCKET_KEEPALIVE;
import static android.net.SocketKeepalive.BINDER_DIED;
import static android.net.SocketKeepalive.DATA_RECEIVED;
import static android.net.SocketKeepalive.ERROR_INSUFFICIENT_RESOURCES;
@@ -330,10 +327,9 @@
Log.d(TAG, "Starting keepalive " + mSlot + " on " + mNai.toShortString());
switch (mType) {
case TYPE_NATT:
- mNai.asyncChannel.sendMessage(
- CMD_ADD_KEEPALIVE_PACKET_FILTER, slot, 0 /* Unused */, mPacket);
- mNai.asyncChannel
- .sendMessage(CMD_START_SOCKET_KEEPALIVE, slot, mInterval, mPacket);
+ final NattKeepalivePacketData nattData = (NattKeepalivePacketData) mPacket;
+ mNai.onAddNattKeepalivePacketFilter(slot, nattData);
+ mNai.onStartNattSocketKeepalive(slot, mInterval, nattData);
break;
case TYPE_TCP:
try {
@@ -342,11 +338,10 @@
handleStopKeepalive(mNai, mSlot, ERROR_INVALID_SOCKET);
return;
}
- mNai.asyncChannel.sendMessage(
- CMD_ADD_KEEPALIVE_PACKET_FILTER, slot, 0 /* Unused */, mPacket);
+ final TcpKeepalivePacketData tcpData = (TcpKeepalivePacketData) mPacket;
+ mNai.onAddTcpKeepalivePacketFilter(slot, tcpData);
// TODO: check result from apf and notify of failure as needed.
- mNai.asyncChannel
- .sendMessage(CMD_START_SOCKET_KEEPALIVE, slot, mInterval, mPacket);
+ mNai.onStartTcpSocketKeepalive(slot, mInterval, tcpData);
break;
default:
Log.wtf(TAG, "Starting keepalive with unknown type: " + mType);
@@ -394,9 +389,8 @@
mTcpController.stopSocketMonitor(mSlot);
// fall through
case TYPE_NATT:
- mNai.asyncChannel.sendMessage(CMD_STOP_SOCKET_KEEPALIVE, mSlot);
- mNai.asyncChannel.sendMessage(CMD_REMOVE_KEEPALIVE_PACKET_FILTER,
- mSlot);
+ mNai.onStopSocketKeepalive(mSlot);
+ mNai.onRemoveKeepalivePacketFilter(mSlot);
break;
default:
Log.wtf(TAG, "Stopping keepalive with unknown type: " + mType);
@@ -548,17 +542,13 @@
}
/** Handle keepalive events from lower layer. */
- public void handleEventSocketKeepalive(@NonNull NetworkAgentInfo nai,
- @NonNull Message message) {
- int slot = message.arg1;
- int reason = message.arg2;
-
+ public void handleEventSocketKeepalive(@NonNull NetworkAgentInfo nai, int slot, int reason) {
KeepaliveInfo ki = null;
try {
ki = mKeepalives.get(nai).get(slot);
} catch(NullPointerException e) {}
if (ki == null) {
- Log.e(TAG, "Event " + message.what + "," + slot + "," + reason
+ Log.e(TAG, "Event " + NetworkAgent.EVENT_SOCKET_KEEPALIVE + "," + slot + "," + reason
+ " for unknown keepalive " + slot + " on " + nai.toShortString());
return;
}
@@ -601,7 +591,7 @@
ki.mStartedState = KeepaliveInfo.NOT_STARTED;
cleanupStoppedKeepalive(nai, slot);
} else {
- Log.wtf(TAG, "Event " + message.what + "," + slot + "," + reason
+ Log.wtf(TAG, "Event " + NetworkAgent.EVENT_SOCKET_KEEPALIVE + "," + slot + "," + reason
+ " for keepalive in wrong state: " + ki.toString());
}
}
diff --git a/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java b/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
index 52b9f5c..841c970 100644
--- a/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
+++ b/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
@@ -27,25 +27,35 @@
import android.net.INetd;
import android.net.INetworkMonitor;
import android.net.LinkProperties;
+import android.net.NattKeepalivePacketData;
import android.net.Network;
+import android.net.NetworkAgent;
import android.net.NetworkAgentConfig;
import android.net.NetworkCapabilities;
import android.net.NetworkInfo;
import android.net.NetworkMonitorManager;
import android.net.NetworkRequest;
import android.net.NetworkState;
+import android.net.TcpKeepalivePacketData;
+import android.os.Bundle;
import android.os.Handler;
+import android.os.IBinder;
import android.os.INetworkManagementService;
-import android.os.Messenger;
+import android.os.RemoteException;
import android.os.SystemClock;
import android.util.Log;
+import android.util.Pair;
import android.util.SparseArray;
-import com.android.internal.util.AsyncChannel;
+import com.android.connectivity.aidl.INetworkAgent;
+import com.android.connectivity.aidl.INetworkAgentRegistry;
import com.android.internal.util.WakeupMessage;
import com.android.server.ConnectivityService;
import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.SortedSet;
import java.util.TreeSet;
@@ -221,6 +231,31 @@
*/
public static final int EVENT_NETWORK_LINGER_COMPLETE = 1001;
+ /**
+ * Inform ConnectivityService that the agent is half-connected.
+ * arg1 = ARG_AGENT_SUCCESS or ARG_AGENT_FAILURE
+ * obj = NetworkAgentInfo
+ * @hide
+ */
+ public static final int EVENT_AGENT_REGISTERED = 1002;
+
+ /**
+ * Inform ConnectivityService that the agent was disconnected.
+ * obj = NetworkAgentInfo
+ * @hide
+ */
+ public static final int EVENT_AGENT_DISCONNECTED = 1003;
+
+ /**
+ * Argument for EVENT_AGENT_HALF_CONNECTED indicating failure.
+ */
+ public static final int ARG_AGENT_FAILURE = 0;
+
+ /**
+ * Argument for EVENT_AGENT_HALF_CONNECTED indicating success.
+ */
+ public static final int ARG_AGENT_SUCCESS = 1;
+
// All linger timers for this network, sorted by expiry time. A linger timer is added whenever
// a request is moved to a network with a better score, regardless of whether the network is or
// was lingering or not.
@@ -262,8 +297,9 @@
// report is generated. Once non-null, it will never be null again.
@Nullable private ConnectivityReport mConnectivityReport;
- public final Messenger messenger;
- public final AsyncChannel asyncChannel;
+ public final INetworkAgent networkAgent;
+ // Only accessed from ConnectivityService handler thread
+ private final AgentDeathMonitor mDeathMonitor = new AgentDeathMonitor();
public final int factorySerialNumber;
@@ -279,13 +315,12 @@
private final Context mContext;
private final Handler mHandler;
- public NetworkAgentInfo(Messenger messenger, AsyncChannel ac, Network net, NetworkInfo info,
+ public NetworkAgentInfo(INetworkAgent na, Network net, NetworkInfo info,
LinkProperties lp, NetworkCapabilities nc, int score, Context context,
Handler handler, NetworkAgentConfig config, ConnectivityService connService, INetd netd,
IDnsResolver dnsResolver, INetworkManagementService nms, int factorySerialNumber,
int creatorUid) {
- this.messenger = messenger;
- asyncChannel = ac;
+ networkAgent = na;
network = net;
networkInfo = info;
linkProperties = lp;
@@ -300,6 +335,249 @@
this.creatorUid = creatorUid;
}
+ private class AgentDeathMonitor implements IBinder.DeathRecipient {
+ @Override
+ public void binderDied() {
+ notifyDisconnected();
+ }
+ }
+
+ /**
+ * Notify the NetworkAgent that it was registered, and should be unregistered if it dies.
+ *
+ * Must be called from the ConnectivityService handler thread. A NetworkAgent can only be
+ * registered once.
+ */
+ public void notifyRegistered() {
+ try {
+ networkAgent.asBinder().linkToDeath(mDeathMonitor, 0);
+ networkAgent.onRegistered(new NetworkAgentMessageHandler(mHandler));
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error registering NetworkAgent", e);
+ maybeUnlinkDeathMonitor();
+ mHandler.obtainMessage(EVENT_AGENT_REGISTERED, ARG_AGENT_FAILURE, 0, this)
+ .sendToTarget();
+ return;
+ }
+
+ mHandler.obtainMessage(EVENT_AGENT_REGISTERED, ARG_AGENT_SUCCESS, 0, this).sendToTarget();
+ }
+
+ /**
+ * Disconnect the NetworkAgent. Must be called from the ConnectivityService handler thread.
+ */
+ public void disconnect() {
+ try {
+ networkAgent.onDisconnected();
+ } catch (RemoteException e) {
+ Log.i(TAG, "Error disconnecting NetworkAgent", e);
+ // Fall through: it's fine if the remote has died
+ }
+
+ notifyDisconnected();
+ maybeUnlinkDeathMonitor();
+ }
+
+ private void maybeUnlinkDeathMonitor() {
+ try {
+ networkAgent.asBinder().unlinkToDeath(mDeathMonitor, 0);
+ } catch (NoSuchElementException e) {
+ // Was not linked: ignore
+ }
+ }
+
+ private void notifyDisconnected() {
+ // Note this may be called multiple times if ConnectivityService disconnects while the
+ // NetworkAgent also dies. ConnectivityService ignores disconnects of already disconnected
+ // agents.
+ mHandler.obtainMessage(EVENT_AGENT_DISCONNECTED, this).sendToTarget();
+ }
+
+ /**
+ * Notify the NetworkAgent that bandwidth update was requested.
+ */
+ public void onBandwidthUpdateRequested() {
+ try {
+ networkAgent.onBandwidthUpdateRequested();
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error sending bandwidth update request event", e);
+ }
+ }
+
+ /**
+ * Notify the NetworkAgent that validation status has changed.
+ */
+ public void onValidationStatusChanged(int validationStatus, @Nullable String captivePortalUrl) {
+ try {
+ networkAgent.onValidationStatusChanged(validationStatus, captivePortalUrl);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error sending validation status change event", e);
+ }
+ }
+
+ /**
+ * Notify the NetworkAgent that the acceptUnvalidated setting should be saved.
+ */
+ public void onSaveAcceptUnvalidated(boolean acceptUnvalidated) {
+ try {
+ networkAgent.onSaveAcceptUnvalidated(acceptUnvalidated);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error sending accept unvalidated event", e);
+ }
+ }
+
+ /**
+ * Notify the NetworkAgent that NATT socket keepalive should be started.
+ */
+ public void onStartNattSocketKeepalive(int slot, int intervalDurationMs,
+ @NonNull NattKeepalivePacketData packetData) {
+ try {
+ networkAgent.onStartNattSocketKeepalive(slot, intervalDurationMs, packetData);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error sending NATT socket keepalive start event", e);
+ }
+ }
+
+ /**
+ * Notify the NetworkAgent that TCP socket keepalive should be started.
+ */
+ public void onStartTcpSocketKeepalive(int slot, int intervalDurationMs,
+ @NonNull TcpKeepalivePacketData packetData) {
+ try {
+ networkAgent.onStartTcpSocketKeepalive(slot, intervalDurationMs, packetData);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error sending TCP socket keepalive start event", e);
+ }
+ }
+
+ /**
+ * Notify the NetworkAgent that socket keepalive should be stopped.
+ */
+ public void onStopSocketKeepalive(int slot) {
+ try {
+ networkAgent.onStopSocketKeepalive(slot);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error sending TCP socket keepalive stop event", e);
+ }
+ }
+
+ /**
+ * Notify the NetworkAgent that signal strength thresholds should be updated.
+ */
+ public void onSignalStrengthThresholdsUpdated(@NonNull int[] thresholds) {
+ try {
+ networkAgent.onSignalStrengthThresholdsUpdated(thresholds);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error sending signal strength thresholds event", e);
+ }
+ }
+
+ /**
+ * Notify the NetworkAgent that automatic reconnect should be prevented.
+ */
+ public void onPreventAutomaticReconnect() {
+ try {
+ networkAgent.onPreventAutomaticReconnect();
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error sending prevent automatic reconnect event", e);
+ }
+ }
+
+ /**
+ * Notify the NetworkAgent that a NATT keepalive packet filter should be added.
+ */
+ public void onAddNattKeepalivePacketFilter(int slot,
+ @NonNull NattKeepalivePacketData packetData) {
+ try {
+ networkAgent.onAddNattKeepalivePacketFilter(slot, packetData);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error sending add NATT keepalive packet filter event", e);
+ }
+ }
+
+ /**
+ * Notify the NetworkAgent that a TCP keepalive packet filter should be added.
+ */
+ public void onAddTcpKeepalivePacketFilter(int slot,
+ @NonNull TcpKeepalivePacketData packetData) {
+ try {
+ networkAgent.onAddTcpKeepalivePacketFilter(slot, packetData);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error sending add TCP keepalive packet filter event", e);
+ }
+ }
+
+ /**
+ * Notify the NetworkAgent that a keepalive packet filter should be removed.
+ */
+ public void onRemoveKeepalivePacketFilter(int slot) {
+ try {
+ networkAgent.onRemoveKeepalivePacketFilter(slot);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error sending remove keepalive packet filter event", e);
+ }
+ }
+
+ // TODO: consider moving out of NetworkAgentInfo into its own class
+ private class NetworkAgentMessageHandler extends INetworkAgentRegistry.Stub {
+ private final Handler mHandler;
+
+ private NetworkAgentMessageHandler(Handler handler) {
+ mHandler = handler;
+ }
+
+ @Override
+ public void sendNetworkCapabilities(NetworkCapabilities nc) {
+ mHandler.obtainMessage(NetworkAgent.EVENT_NETWORK_CAPABILITIES_CHANGED,
+ new Pair<>(NetworkAgentInfo.this, nc)).sendToTarget();
+ }
+
+ @Override
+ public void sendLinkProperties(LinkProperties lp) {
+ mHandler.obtainMessage(NetworkAgent.EVENT_NETWORK_PROPERTIES_CHANGED,
+ new Pair<>(NetworkAgentInfo.this, lp)).sendToTarget();
+ }
+
+ @Override
+ public void sendNetworkInfo(NetworkInfo info) {
+ mHandler.obtainMessage(NetworkAgent.EVENT_NETWORK_INFO_CHANGED,
+ new Pair<>(NetworkAgentInfo.this, info)).sendToTarget();
+ }
+
+ @Override
+ public void sendScore(int score) {
+ mHandler.obtainMessage(NetworkAgent.EVENT_NETWORK_SCORE_CHANGED, score, 0,
+ new Pair<>(NetworkAgentInfo.this, null)).sendToTarget();
+ }
+
+ @Override
+ public void sendExplicitlySelected(boolean explicitlySelected, boolean acceptPartial) {
+ mHandler.obtainMessage(NetworkAgent.EVENT_SET_EXPLICITLY_SELECTED,
+ explicitlySelected ? 1 : 0, acceptPartial ? 1 : 0,
+ new Pair<>(NetworkAgentInfo.this, null)).sendToTarget();
+ }
+
+ @Override
+ public void sendSocketKeepaliveEvent(int slot, int reason) {
+ mHandler.obtainMessage(NetworkAgent.EVENT_SOCKET_KEEPALIVE,
+ slot, reason, new Pair<>(NetworkAgentInfo.this, null)).sendToTarget();
+ }
+
+ @Override
+ public void sendUnderlyingNetworks(@Nullable List<Network> networks) {
+ final Bundle args = new Bundle();
+ if (networks instanceof ArrayList<?>) {
+ args.putParcelableArrayList(NetworkAgent.UNDERLYING_NETWORKS_KEY,
+ (ArrayList<Network>) networks);
+ } else {
+ args.putParcelableArrayList(NetworkAgent.UNDERLYING_NETWORKS_KEY,
+ networks == null ? null : new ArrayList<>(networks));
+ }
+ mHandler.obtainMessage(NetworkAgent.EVENT_UNDERLYING_NETWORKS_CHANGED,
+ new Pair<>(NetworkAgentInfo.this, args)).sendToTarget();
+ }
+ }
+
/**
* Inform NetworkAgentInfo that a new NetworkMonitor was created.
*/
diff --git a/services/core/java/com/android/server/connectivity/PacManager.java b/services/core/java/com/android/server/connectivity/PacManager.java
index 198de78..06721ae 100644
--- a/services/core/java/com/android/server/connectivity/PacManager.java
+++ b/services/core/java/com/android/server/connectivity/PacManager.java
@@ -390,7 +390,7 @@
return;
}
if (!mHasSentBroadcast) {
- sendPacBroadcast(new ProxyInfo(mPacUrl, mLastPort));
+ sendPacBroadcast(ProxyInfo.buildPacProxy(mPacUrl, mLastPort));
mHasSentBroadcast = true;
}
}
diff --git a/services/core/java/com/android/server/connectivity/ProxyTracker.java b/services/core/java/com/android/server/connectivity/ProxyTracker.java
index 5cb3d94..f6ca152 100644
--- a/services/core/java/com/android/server/connectivity/ProxyTracker.java
+++ b/services/core/java/com/android/server/connectivity/ProxyTracker.java
@@ -38,7 +38,9 @@
import android.util.Log;
import com.android.internal.annotations.GuardedBy;
+import com.android.net.module.util.ProxyUtils;
+import java.util.Collections;
import java.util.Objects;
/**
@@ -163,9 +165,10 @@
if (!TextUtils.isEmpty(host) || !TextUtils.isEmpty(pacFileUrl)) {
ProxyInfo proxyProperties;
if (!TextUtils.isEmpty(pacFileUrl)) {
- proxyProperties = new ProxyInfo(Uri.parse(pacFileUrl));
+ proxyProperties = ProxyInfo.buildPacProxy(Uri.parse(pacFileUrl));
} else {
- proxyProperties = new ProxyInfo(host, port, exclList);
+ proxyProperties = ProxyInfo.buildDirectProxy(host, port,
+ ProxyUtils.exclusionStringAsList(exclList));
}
if (!proxyProperties.isValid()) {
if (DBG) Log.d(TAG, "Invalid proxy properties, ignoring: " + proxyProperties);
@@ -204,7 +207,8 @@
return false;
}
}
- final ProxyInfo p = new ProxyInfo(proxyHost, proxyPort, "");
+ final ProxyInfo p = ProxyInfo.buildDirectProxy(proxyHost, proxyPort,
+ Collections.emptyList());
setGlobalProxy(p);
return true;
}
@@ -219,7 +223,8 @@
*/
public void sendProxyBroadcast() {
final ProxyInfo defaultProxy = getDefaultProxy();
- final ProxyInfo proxyInfo = null != defaultProxy ? defaultProxy : new ProxyInfo("", 0, "");
+ final ProxyInfo proxyInfo = null != defaultProxy ?
+ defaultProxy : ProxyInfo.buildDirectProxy("", 0, Collections.emptyList());
if (mPacManager.setCurrentProxyScriptUrl(proxyInfo) == PacManager.DONT_SEND_BROADCAST) {
return;
}
@@ -261,7 +266,7 @@
mGlobalProxy = new ProxyInfo(proxyInfo);
host = mGlobalProxy.getHost();
port = mGlobalProxy.getPort();
- exclList = mGlobalProxy.getExclusionListAsString();
+ exclList = ProxyUtils.exclusionListAsString(mGlobalProxy.getExclusionList());
pacFileUrl = Uri.EMPTY.equals(proxyInfo.getPacFileUrl())
? "" : proxyInfo.getPacFileUrl().toString();
} else {
diff --git a/services/core/java/com/android/server/content/SyncManager.java b/services/core/java/com/android/server/content/SyncManager.java
index 6ae410a..fe89903 100644
--- a/services/core/java/com/android/server/content/SyncManager.java
+++ b/services/core/java/com/android/server/content/SyncManager.java
@@ -3838,12 +3838,10 @@
}
UserHandle user = new UserHandle(userId);
- // TODO(b/174186839) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
final PendingIntent pendingIntent = PendingIntent
.getActivityAsUser(mContext, 0, clickIntent,
- PendingIntent.FLAG_CANCEL_CURRENT
- | PendingIntent.FLAG_MUTABLE_UNAUDITED, null, user);
+ PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
+ null, user);
CharSequence tooManyDeletesDescFormat = mContext.getResources().getText(
R.string.contentServiceTooManyDeletesNotificationDesc);
diff --git a/services/core/java/com/android/server/display/DisplayDeviceConfig.java b/services/core/java/com/android/server/display/DisplayDeviceConfig.java
index 574d8c6..0a30e07 100644
--- a/services/core/java/com/android/server/display/DisplayDeviceConfig.java
+++ b/services/core/java/com/android/server/display/DisplayDeviceConfig.java
@@ -16,10 +16,13 @@
package com.android.server.display;
+import android.content.Context;
import android.os.Environment;
+import android.os.PowerManager;
import android.util.Slog;
import android.view.DisplayAddress;
+import com.android.internal.BrightnessSynchronizer;
import com.android.server.display.config.DisplayConfiguration;
import com.android.server.display.config.DisplayQuirks;
import com.android.server.display.config.NitsMap;
@@ -33,6 +36,7 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -49,6 +53,7 @@
public static final String QUIRK_CAN_SET_BRIGHTNESS_VIA_HWC = "canSetBrightnessViaHwc";
+ private static final float BRIGHTNESS_DEFAULT = 0.5f;
private static final String ETC_DIR = "etc";
private static final String DISPLAY_CONFIG_DIR = "displayconfig";
private static final String CONFIG_FILE_FORMAT = "display_%s.xml";
@@ -57,11 +62,21 @@
private static final String NO_SUFFIX_FORMAT = "%d";
private static final long STABLE_FLAG = 1L << 62;
+ // Float.NaN (used as invalid for brightness) cannot be stored in config.xml
+ // so -2 is used instead
+ private static final float INVALID_BRIGHTNESS_IN_CONFIG = -2f;
+
private float[] mNits;
private float[] mBrightness;
+ private float mBrightnessMinimum = Float.NaN;
+ private float mBrightnessMaximum = Float.NaN;
+ private float mBrightnessDefault = Float.NaN;
private List<String> mQuirks;
- private DisplayDeviceConfig() {
+ private final Context mContext;
+
+ private DisplayDeviceConfig(Context context) {
+ mContext = context;
}
/**
@@ -72,37 +87,50 @@
* <li>physicalDisplayId without a stable flag (old system)</li>
* <li>portId</li>
* </ol>
+ *
* @param physicalDisplayId The display ID for which to load the configuration.
* @return A configuration instance for the specified display.
*/
- public static DisplayDeviceConfig create(long physicalDisplayId) {
+ public static DisplayDeviceConfig create(Context context, long physicalDisplayId,
+ boolean isDefaultDisplay) {
DisplayDeviceConfig config;
- config = loadConfigFromDirectory(Environment.getProductDirectory(), physicalDisplayId);
+ config = loadConfigFromDirectory(context, Environment.getProductDirectory(),
+ physicalDisplayId);
if (config != null) {
return config;
}
- config = loadConfigFromDirectory(Environment.getVendorDirectory(), physicalDisplayId);
+ config = loadConfigFromDirectory(context, Environment.getVendorDirectory(),
+ physicalDisplayId);
if (config != null) {
return config;
}
- return null;
+ // If no config can be loaded from any ddc xml at all,
+ // prepare a whole config using the global config.xml.
+ // Guaranteed not null
+ if (isDefaultDisplay) {
+ config = getConfigFromGlobalXml(context);
+ } else {
+ config = getConfigFromPmValues(context);
+ }
+ return config;
}
- private static DisplayDeviceConfig loadConfigFromDirectory(
+ private static DisplayDeviceConfig loadConfigFromDirectory(Context context,
File baseDirectory, long physicalDisplayId) {
DisplayDeviceConfig config;
// Create config using filename from physical ID (including "stable" bit).
- config = getConfigFromSuffix(baseDirectory, STABLE_ID_SUFFIX_FORMAT, physicalDisplayId);
+ config = getConfigFromSuffix(context, baseDirectory, STABLE_ID_SUFFIX_FORMAT,
+ physicalDisplayId);
if (config != null) {
return config;
}
// Create config using filename from physical ID (excluding "stable" bit).
final long withoutStableFlag = physicalDisplayId & ~STABLE_FLAG;
- config = getConfigFromSuffix(baseDirectory, NO_SUFFIX_FORMAT, withoutStableFlag);
+ config = getConfigFromSuffix(context, baseDirectory, NO_SUFFIX_FORMAT, withoutStableFlag);
if (config != null) {
return config;
}
@@ -111,14 +139,8 @@
final DisplayAddress.Physical physicalAddress =
DisplayAddress.fromPhysicalDisplayId(physicalDisplayId);
int port = physicalAddress.getPort();
- config = getConfigFromSuffix(baseDirectory, PORT_SUFFIX_FORMAT, port);
- if (config != null) {
- return config;
- }
-
- // None of these files exist.
- return null;
-
+ config = getConfigFromSuffix(context, baseDirectory, PORT_SUFFIX_FORMAT, port);
+ return config;
}
/**
@@ -139,6 +161,18 @@
return mBrightness;
}
+ public float getBrightnessMinimum() {
+ return mBrightnessMinimum;
+ }
+
+ public float getBrightnessMaximum() {
+ return mBrightnessMaximum;
+ }
+
+ public float getBrightnessDefault() {
+ return mBrightnessDefault;
+ }
+
/**
* @param quirkValue The quirk to test.
* @return {@code true} if the specified quirk is present in this configuration,
@@ -153,12 +187,15 @@
String str = "DisplayDeviceConfig{"
+ "mBrightness=" + Arrays.toString(mBrightness)
+ ", mNits=" + Arrays.toString(mNits)
+ + ", mBrightnessMinimum=" + mBrightnessMinimum
+ + ", mBrightnessMaximum=" + mBrightnessMaximum
+ + ", mBrightnessDefault=" + mBrightnessDefault
+ ", mQuirks=" + mQuirks
+ "}";
return str;
}
- private static DisplayDeviceConfig getConfigFromSuffix(File baseDirectory,
+ private static DisplayDeviceConfig getConfigFromSuffix(Context context, File baseDirectory,
String suffixFormat, long idNumber) {
final String suffix = String.format(suffixFormat, idNumber);
@@ -167,13 +204,25 @@
baseDirectory, ETC_DIR, DISPLAY_CONFIG_DIR, filename);
if (filePath.exists()) {
- final DisplayDeviceConfig config = new DisplayDeviceConfig();
+ final DisplayDeviceConfig config = new DisplayDeviceConfig(context);
config.initFromFile(filePath);
return config;
}
return null;
}
+ private static DisplayDeviceConfig getConfigFromGlobalXml(Context context) {
+ DisplayDeviceConfig config = new DisplayDeviceConfig(context);
+ config.initFromGlobalXml();
+ return config;
+ }
+
+ private static DisplayDeviceConfig getConfigFromPmValues(Context context) {
+ DisplayDeviceConfig config = new DisplayDeviceConfig(context);
+ config.initFromPmValues();
+ return config;
+ }
+
private void initFromFile(File configFile) {
if (!configFile.exists()) {
// Display configuration files aren't required to exist.
@@ -187,16 +236,87 @@
try (InputStream in = new BufferedInputStream(new FileInputStream(configFile))) {
final DisplayConfiguration config = XmlParser.read(in);
- loadBrightnessMap(config);
- loadQuirks(config);
+ if (config != null) {
+ loadBrightnessMap(config);
+ loadBrightnessDefaultFromDdcXml(config);
+ loadBrightnessConstraintsFromConfigXml();
+ loadQuirks(config);
+ } else {
+ Slog.w(TAG, "DisplayDeviceConfig file is null");
+ }
} catch (IOException | DatatypeConfigurationException | XmlPullParserException e) {
Slog.e(TAG, "Encountered an error while reading/parsing display config file: "
+ configFile, e);
}
}
+ private void initFromGlobalXml() {
+ // If no ddc exists, use config.xml
+ loadBrightnessDefaultFromConfigXml();
+ loadBrightnessConstraintsFromConfigXml();
+ }
+
+ private void initFromPmValues() {
+ mBrightnessMinimum = PowerManager.BRIGHTNESS_MIN;
+ mBrightnessMaximum = PowerManager.BRIGHTNESS_MAX;
+ mBrightnessDefault = BRIGHTNESS_DEFAULT;
+ }
+
+ private void loadBrightnessDefaultFromDdcXml(DisplayConfiguration config) {
+ // Default brightness values are stored in the displayDeviceConfig file,
+ // Or we fallback standard values if not.
+ // Priority 1: Value in the displayDeviceConfig
+ // Priority 2: Value in the config.xml (float)
+ // Priority 3: Value in the config.xml (int)
+ if (config != null) {
+ BigDecimal configBrightnessDefault = config.getScreenBrightnessDefault();
+ if (configBrightnessDefault != null) {
+ mBrightnessDefault = configBrightnessDefault.floatValue();
+ } else {
+ mBrightnessDefault = BRIGHTNESS_DEFAULT;
+ }
+ }
+ }
+
+ private void loadBrightnessDefaultFromConfigXml() {
+ // Priority 1: Value in the config.xml (float)
+ // Priority 2: Value in the config.xml (int)
+ final float def = mContext.getResources().getFloat(com.android.internal.R.dimen
+ .config_screenBrightnessSettingDefaultFloat);
+ if (def == INVALID_BRIGHTNESS_IN_CONFIG) {
+ mBrightnessDefault = BrightnessSynchronizer.brightnessIntToFloat(
+ mContext.getResources().getInteger(com.android.internal.R.integer
+ .config_screenBrightnessSettingDefault));
+ } else {
+ mBrightnessDefault = def;
+ }
+ }
+
+ private void loadBrightnessConstraintsFromConfigXml() {
+ // TODO(b/175373898) add constraints (min / max) to ddc.
+ final float min = mContext.getResources().getFloat(com.android.internal.R.dimen
+ .config_screenBrightnessSettingMinimumFloat);
+ final float max = mContext.getResources().getFloat(com.android.internal.R.dimen
+ .config_screenBrightnessSettingMaximumFloat);
+ if (min == INVALID_BRIGHTNESS_IN_CONFIG || max == INVALID_BRIGHTNESS_IN_CONFIG) {
+ mBrightnessMinimum = BrightnessSynchronizer.brightnessIntToFloat(
+ mContext.getResources().getInteger(com.android.internal.R.integer
+ .config_screenBrightnessSettingMinimum));
+ mBrightnessMaximum = BrightnessSynchronizer.brightnessIntToFloat(
+ mContext.getResources().getInteger(com.android.internal.R.integer
+ .config_screenBrightnessSettingMaximum));
+ } else {
+ mBrightnessMinimum = min;
+ mBrightnessMaximum = max;
+ }
+ }
+
private void loadBrightnessMap(DisplayConfiguration config) {
final NitsMap map = config.getScreenBrightnessMap();
+ // Map may not exist in config file
+ if (map == null) {
+ return;
+ }
final List<Point> points = map.getPoint();
final int size = points.size();
diff --git a/services/core/java/com/android/server/display/DisplayDeviceInfo.java b/services/core/java/com/android/server/display/DisplayDeviceInfo.java
index 468d825..2641ee7 100644
--- a/services/core/java/com/android/server/display/DisplayDeviceInfo.java
+++ b/services/core/java/com/android/server/display/DisplayDeviceInfo.java
@@ -25,6 +25,8 @@
import android.view.DisplayEventReceiver;
import android.view.Surface;
+import com.android.internal.BrightnessSynchronizer;
+
import java.util.Arrays;
import java.util.Objects;
@@ -337,6 +339,10 @@
public DisplayEventReceiver.FrameRateOverride[] frameRateOverrides =
new DisplayEventReceiver.FrameRateOverride[0];
+ public float brightnessMinimum;
+ public float brightnessMaximum;
+ public float brightnessDefault;
+
public void setAssumedDensityForExternalDisplay(int width, int height) {
densityDpi = Math.min(width, height) * DisplayMetrics.DENSITY_XHIGH / 1080;
// Technically, these values should be smaller than the apparent density
@@ -391,7 +397,11 @@
|| !Objects.equals(deviceProductInfo, other.deviceProductInfo)
|| ownerUid != other.ownerUid
|| !Objects.equals(ownerPackageName, other.ownerPackageName)
- || !Objects.equals(frameRateOverrides, other.frameRateOverrides)) {
+ || !Objects.equals(frameRateOverrides, other.frameRateOverrides)
+ || !BrightnessSynchronizer.floatEquals(brightnessMinimum, other.brightnessMinimum)
+ || !BrightnessSynchronizer.floatEquals(brightnessMaximum, other.brightnessMaximum)
+ || !BrightnessSynchronizer.floatEquals(brightnessDefault,
+ other.brightnessDefault)) {
diff |= DIFF_OTHER;
}
return diff;
@@ -431,6 +441,9 @@
ownerUid = other.ownerUid;
ownerPackageName = other.ownerPackageName;
frameRateOverrides = other.frameRateOverrides;
+ brightnessMinimum = other.brightnessMinimum;
+ brightnessMaximum = other.brightnessMaximum;
+ brightnessDefault = other.brightnessDefault;
}
// For debugging purposes
@@ -471,6 +484,9 @@
for (DisplayEventReceiver.FrameRateOverride frameRateOverride : frameRateOverrides) {
sb.append(frameRateOverride).append(" ");
}
+ sb.append(", brightnessMinimum ").append(brightnessMinimum);
+ sb.append(", brightnessMaximum ").append(brightnessMaximum);
+ sb.append(", brightnessDefault ").append(brightnessDefault);
sb.append(flagsToString(flags));
sb.append("}");
return sb.toString();
diff --git a/services/core/java/com/android/server/display/DisplayManagerService.java b/services/core/java/com/android/server/display/DisplayManagerService.java
index 2c7cd5b..6fa244e 100644
--- a/services/core/java/com/android/server/display/DisplayManagerService.java
+++ b/services/core/java/com/android/server/display/DisplayManagerService.java
@@ -288,9 +288,6 @@
@GuardedBy("mSyncRoot")
private final SparseArray<Float> mDisplayBrightnesses = new SparseArray<>();
- // The default brightness.
- private final float mDisplayDefaultBrightness;
-
// Set to true when there are pending display changes that have yet to be applied
// to the surface flinger state.
private boolean mPendingTraversal;
@@ -416,9 +413,6 @@
mMinimumBrightnessCurve = new Curve(lux, nits);
mMinimumBrightnessSpline = Spline.createSpline(lux, nits);
- PowerManager pm = mContext.getSystemService(PowerManager.class);
- mDisplayDefaultBrightness = pm.getBrightnessConstraint(
- PowerManager.BRIGHTNESS_CONSTRAINT_TYPE_DEFAULT);
mCurrentUserId = UserHandle.USER_SYSTEM;
ColorSpace[] colorSpaces = SurfaceControl.getCompositionColorSpaces();
mWideColorSpace = colorSpaces[1];
@@ -1108,7 +1102,7 @@
}
addDisplayPowerControllerLocked(displayId);
mDisplayStates.append(displayId, Display.STATE_OFF);
- mDisplayBrightnesses.append(displayId, mDisplayDefaultBrightness);
+ mDisplayBrightnesses.append(displayId, display.getDisplayInfoLocked().brightnessDefault);
DisplayManagerGlobal.invalidateLocalDisplayInfoCaches();
@@ -1876,7 +1870,7 @@
}
final DisplayPowerController displayPowerController = new DisplayPowerController(
mContext, mDisplayPowerCallbacks, mPowerHandler, mSensorManager,
- mDisplayBlanker, displayId);
+ mDisplayBlanker, mLogicalDisplayMapper.getLocked(displayId));
mDisplayPowerControllers.append(displayId, displayPowerController);
}
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java
index f488260..e31704f 100644
--- a/services/core/java/com/android/server/display/DisplayPowerController.java
+++ b/services/core/java/com/android/server/display/DisplayPowerController.java
@@ -163,6 +163,9 @@
// The display blanker.
private final DisplayBlanker mBlanker;
+ // The LogicalDisplay tied to this DisplayPowerController.
+ private final LogicalDisplay mLogicalDisplay;
+
// The ID of the LogicalDisplay tied to this DisplayPowerController.
private final int mDisplayId;
@@ -406,7 +409,7 @@
*/
public DisplayPowerController(Context context,
DisplayPowerCallbacks callbacks, Handler handler,
- SensorManager sensorManager, DisplayBlanker blanker, int displayId) {
+ SensorManager sensorManager, DisplayBlanker blanker, LogicalDisplay logicalDisplay) {
mHandler = new DisplayControllerHandler(handler.getLooper());
mBrightnessTracker = new BrightnessTracker(context, null);
mSettingsObserver = new SettingsObserver(mHandler);
@@ -418,9 +421,10 @@
mContext = context;
mBrightnessSynchronizer = new BrightnessSynchronizer(context);
mBrightnessSynchronizer.startSynchronizing();
- mDisplayId = displayId;
+ mLogicalDisplay = logicalDisplay;
+ mDisplayId = mLogicalDisplay.getDisplayIdLocked();
- PowerManager pm = context.getSystemService(PowerManager.class);
+ PowerManager pm = context.getSystemService(PowerManager.class);
final Resources resources = context.getResources();
@@ -439,7 +443,7 @@
mScreenBrightnessRangeMaximum = clampAbsoluteBrightness(
pm.getBrightnessConstraint(PowerManager.BRIGHTNESS_CONSTRAINT_TYPE_MAXIMUM));
mScreenBrightnessDefault = clampAbsoluteBrightness(
- pm.getBrightnessConstraint(PowerManager.BRIGHTNESS_CONSTRAINT_TYPE_DEFAULT));
+ mLogicalDisplay.getDisplayInfoLocked().brightnessDefault);
// VR SETTINGS
mScreenBrightnessForVrDefault = clampAbsoluteBrightness(
@@ -1833,6 +1837,9 @@
pw.println();
pw.println("Display Power Controller Configuration:");
+ pw.println(" mScreenBrightnessRangeMinimum=" + mScreenBrightnessRangeMinimum);
+ pw.println(" mScreenBrightnessRangeMaximum=" + mScreenBrightnessRangeMaximum);
+ pw.println(" mScreenBrightnessRangeDefault=" + mScreenBrightnessDefault);
pw.println(" mScreenBrightnessDozeConfig=" + mScreenBrightnessDozeConfig);
pw.println(" mScreenBrightnessDimConfig=" + mScreenBrightnessDimConfig);
pw.println(" mScreenBrightnessDefault=" + mScreenBrightnessDefault);
diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
index 9b8ed3a..8198e51 100644
--- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
@@ -415,7 +415,9 @@
Spline sysToNits = null;
// Load the mapping from nits to HAL brightness range (display-device-config.xml)
- mDisplayDeviceConfig = DisplayDeviceConfig.create(mPhysicalDisplayId);
+ final Context context = getOverlayContext();
+ mDisplayDeviceConfig = DisplayDeviceConfig.create(context, mPhysicalDisplayId,
+ mIsDefaultDisplay);
if (mDisplayDeviceConfig == null) {
return;
}
@@ -431,9 +433,9 @@
nitsToHal = Spline.createSpline(halNits, halBrightness);
// Load the mapping from system brightness range to nits (config.xml)
- final Resources res = getOverlayContext().getResources();
+ final Resources res = context.getResources();
final float[] sysNits = BrightnessMappingStrategy.getFloatArray(res.obtainTypedArray(
- com.android.internal.R.array.config_screenBrightnessNits));
+ com.android.internal.R.array.config_screenBrightnessNits));
final int[] sysBrightness = res.getIntArray(
com.android.internal.R.array.config_screenBrightnessBacklight);
if (sysNits.length == 0 || sysBrightness.length != sysNits.length) {
@@ -630,6 +632,15 @@
// The display is trusted since it is created by system.
mInfo.flags |= DisplayDeviceInfo.FLAG_TRUSTED;
+ if (mDisplayDeviceConfig != null) {
+ mInfo.brightnessMinimum = mDisplayDeviceConfig.getBrightnessMinimum();
+ mInfo.brightnessMaximum = mDisplayDeviceConfig.getBrightnessMaximum();
+ mInfo.brightnessDefault = mDisplayDeviceConfig.getBrightnessDefault();
+ } else {
+ mInfo.brightnessMinimum = PowerManager.BRIGHTNESS_MIN;
+ mInfo.brightnessMaximum = PowerManager.BRIGHTNESS_MAX;
+ mInfo.brightnessDefault = 0.5f;
+ }
}
return mInfo;
}
@@ -997,7 +1008,7 @@
pw.println(" " + mSupportedModes.valueAt(i));
}
pw.println("mSupportedColorModes=" + mSupportedColorModes.toString());
- pw.print("mDisplayDeviceConfig=" + mDisplayDeviceConfig);
+ pw.println("mDisplayDeviceConfig=" + mDisplayDeviceConfig);
}
private int findDisplayConfigIdLocked(int modeId, int configGroup) {
diff --git a/services/core/java/com/android/server/display/LogicalDisplay.java b/services/core/java/com/android/server/display/LogicalDisplay.java
index d80e168..5bf83db 100644
--- a/services/core/java/com/android/server/display/LogicalDisplay.java
+++ b/services/core/java/com/android/server/display/LogicalDisplay.java
@@ -366,7 +366,9 @@
mBaseDisplayInfo.displayCutout = maskCutout ? null : deviceInfo.displayCutout;
mBaseDisplayInfo.displayId = mDisplayId;
updateFrameRateOverrides(deviceInfo);
-
+ mBaseDisplayInfo.brightnessMinimum = deviceInfo.brightnessMinimum;
+ mBaseDisplayInfo.brightnessMaximum = deviceInfo.brightnessMaximum;
+ mBaseDisplayInfo.brightnessDefault = deviceInfo.brightnessDefault;
mPrimaryDisplayDeviceInfo = deviceInfo;
mInfo.set(null);
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecConfig.java b/services/core/java/com/android/server/hdmi/HdmiCecConfig.java
index 371fd3d..16695d1 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecConfig.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecConfig.java
@@ -22,12 +22,19 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.StringDef;
+import android.content.ContentResolver;
import android.content.Context;
import android.content.SharedPreferences;
+import android.database.ContentObserver;
import android.hardware.hdmi.HdmiControlManager;
+import android.net.Uri;
import android.os.Environment;
+import android.os.Handler;
+import android.os.Looper;
import android.os.SystemProperties;
+import android.os.UserHandle;
import android.provider.Settings.Global;
+import android.util.ArrayMap;
import android.util.Slog;
import com.android.internal.annotations.VisibleForTesting;
@@ -88,6 +95,23 @@
@Nullable private final CecSettings mSystemConfig;
@Nullable private final CecSettings mVendorOverride;
+ private final ArrayMap<Setting, Set<SettingChangeListener>>
+ mSettingChangeListeners = new ArrayMap<>();
+
+ private SettingsObserver mSettingsObserver;
+
+ /**
+ * Listener used to get notifications when value of a setting changes.
+ */
+ public interface SettingChangeListener {
+ /**
+ * Called when value of a setting changes.
+ *
+ * @param setting name of a CEC setting that changed
+ */
+ void onChange(@NonNull @CecSettingName String setting);
+ }
+
/**
* Setting storage input/output helper class.
*/
@@ -159,6 +183,18 @@
}
}
+ private class SettingsObserver extends ContentObserver {
+ SettingsObserver(Handler handler) {
+ super(handler);
+ }
+
+ @Override
+ public void onChange(boolean selfChange, Uri uri) {
+ String setting = uri.getLastPathSegment();
+ HdmiCecConfig.this.notifyGlobalSettingChanged(setting);
+ }
+ }
+
@VisibleForTesting
HdmiCecConfig(@NonNull Context context,
@NonNull StorageAdapter storageAdapter,
@@ -311,6 +347,7 @@
} else if (storage == STORAGE_SHARED_PREFS) {
Slog.d(TAG, "Setting '" + storageKey + "' shared pref.");
mStorageAdapter.storeSharedPref(storageKey, value);
+ notifySettingChanged(setting);
}
}
@@ -318,6 +355,103 @@
return Integer.decode(value.getIntValue());
}
+ private void notifyGlobalSettingChanged(String setting) {
+ switch (setting) {
+ case Global.HDMI_CONTROL_ENABLED:
+ notifySettingChanged(HdmiControlManager.CEC_SETTING_NAME_HDMI_CEC_ENABLED);
+ break;
+ case Global.HDMI_CEC_VERSION:
+ notifySettingChanged(HdmiControlManager.CEC_SETTING_NAME_HDMI_CEC_VERSION);
+ break;
+ case Global.HDMI_CONTROL_SEND_STANDBY_ON_SLEEP:
+ notifySettingChanged(HdmiControlManager.CEC_SETTING_NAME_POWER_CONTROL_MODE);
+ break;
+ }
+ }
+
+ private void notifySettingChanged(@NonNull @CecSettingName String name) {
+ Setting setting = getSetting(name);
+ if (setting == null) {
+ throw new IllegalArgumentException("Setting '" + name + "' does not exist.");
+ }
+ notifySettingChanged(setting);
+ }
+
+ private void notifySettingChanged(@NonNull Setting setting) {
+ Set<SettingChangeListener> listeners = mSettingChangeListeners.get(setting);
+ if (listeners == null) {
+ return; // No listeners registered, do nothing.
+ }
+ for (SettingChangeListener listener: listeners) {
+ listener.onChange(setting.getName());
+ }
+ }
+
+ /**
+ * This method registers Global Setting change observer.
+ * Needs to be called once after initialization of HdmiCecConfig.
+ */
+ public void registerGlobalSettingsObserver(Looper looper) {
+ Handler handler = new Handler(looper);
+ mSettingsObserver = new SettingsObserver(handler);
+ ContentResolver resolver = mContext.getContentResolver();
+ String[] settings = new String[] {
+ Global.HDMI_CONTROL_ENABLED,
+ Global.HDMI_CEC_VERSION,
+ Global.HDMI_CONTROL_SEND_STANDBY_ON_SLEEP,
+ };
+ for (String setting: settings) {
+ resolver.registerContentObserver(Global.getUriFor(setting), false,
+ mSettingsObserver, UserHandle.USER_ALL);
+ }
+ }
+
+ /**
+ * This method unregisters Global Setting change observer.
+ */
+ public void unregisterGlobalSettingsObserver() {
+ ContentResolver resolver = mContext.getContentResolver();
+ resolver.unregisterContentObserver(mSettingsObserver);
+ }
+
+ /**
+ * Register change listener for a given setting name.
+ */
+ public void registerChangeListener(@NonNull @CecSettingName String name,
+ SettingChangeListener listener) {
+ Setting setting = getSetting(name);
+ if (setting == null) {
+ throw new IllegalArgumentException("Setting '" + name + "' does not exist.");
+ }
+ @Storage int storage = getStorage(setting);
+ if (storage != STORAGE_GLOBAL_SETTINGS && storage != STORAGE_SHARED_PREFS) {
+ throw new IllegalArgumentException("Change listeners for setting '" + name
+ + "' not supported.");
+ }
+ if (!mSettingChangeListeners.containsKey(setting)) {
+ mSettingChangeListeners.put(setting, new HashSet<>());
+ }
+ mSettingChangeListeners.get(setting).add(listener);
+ }
+
+ /**
+ * Remove change listener for a given setting name.
+ */
+ public void removeChangeListener(@NonNull @CecSettingName String name,
+ SettingChangeListener listener) {
+ Setting setting = getSetting(name);
+ if (setting == null) {
+ throw new IllegalArgumentException("Setting '" + name + "' does not exist.");
+ }
+ if (mSettingChangeListeners.containsKey(setting)) {
+ Set<SettingChangeListener> listeners = mSettingChangeListeners.get(setting);
+ listeners.remove(listener);
+ if (listeners.isEmpty()) {
+ mSettingChangeListeners.remove(setting);
+ }
+ }
+ }
+
/**
* Returns a list of all settings based on the XML metadata.
*/
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index c15fdca..b78954dcb 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -498,6 +498,7 @@
if (mMessageValidator == null) {
mMessageValidator = new HdmiCecMessageValidator(this);
}
+ mHdmiCecConfig.registerGlobalSettingsObserver(mIoLooper);
}
private void bootCompleted() {
diff --git a/services/core/java/com/android/server/input/InputManagerService.java b/services/core/java/com/android/server/input/InputManagerService.java
index bff81e6..71fcd1d 100644
--- a/services/core/java/com/android/server/input/InputManagerService.java
+++ b/services/core/java/com/android/server/input/InputManagerService.java
@@ -161,6 +161,9 @@
"com.snapchat.android" // b/173297887
};
+ /** TODO(b/169067926): Remove this. */
+ private static final boolean UNTRUSTED_TOUCHES_TOAST = false;
+
// Pointer to native input manager service object.
private final long mPtr;
@@ -2307,7 +2310,8 @@
// Native callback
private void notifyUntrustedTouch(String packageName) {
// TODO(b/169067926): Remove toast after gathering feedback on dogfood.
- if (ArrayUtils.contains(PACKAGE_BLOCKLIST_FOR_UNTRUSTED_TOUCHES_TOAST, packageName)) {
+ if (!UNTRUSTED_TOUCHES_TOAST || ArrayUtils.contains(
+ PACKAGE_BLOCKLIST_FOR_UNTRUSTED_TOUCHES_TOAST, packageName)) {
Log.i(TAG, "Suppressing untrusted touch toast for " + packageName);
return;
}
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index 90edd77..ab7e3b0 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -162,7 +162,11 @@
import com.android.internal.inputmethod.IBooleanResultCallback;
import com.android.internal.inputmethod.IInputBindResultResultCallback;
import com.android.internal.inputmethod.IInputContentUriToken;
+import com.android.internal.inputmethod.IInputMethodInfoListResultCallback;
import com.android.internal.inputmethod.IInputMethodPrivilegedOperations;
+import com.android.internal.inputmethod.IInputMethodSubtypeListResultCallback;
+import com.android.internal.inputmethod.IInputMethodSubtypeResultCallback;
+import com.android.internal.inputmethod.IIntResultCallback;
import com.android.internal.inputmethod.InputMethodDebug;
import com.android.internal.inputmethod.SoftInputShowHideReason;
import com.android.internal.inputmethod.StartInputFlags;
@@ -1970,43 +1974,51 @@
}
@Override
- public List<InputMethodInfo> getInputMethodList(@UserIdInt int userId) {
- if (UserHandle.getCallingUserId() != userId) {
- mContext.enforceCallingPermission(Manifest.permission.INTERACT_ACROSS_USERS_FULL, null);
- }
- synchronized (mMethodMap) {
- final int[] resolvedUserIds = InputMethodUtils.resolveUserId(userId,
- mSettings.getCurrentUserId(), null);
- if (resolvedUserIds.length != 1) {
- return Collections.emptyList();
+ public void getInputMethodList(@UserIdInt int userId,
+ IInputMethodInfoListResultCallback resultCallback) {
+ CallbackUtils.onResult(resultCallback, () -> {
+ if (UserHandle.getCallingUserId() != userId) {
+ mContext.enforceCallingPermission(
+ Manifest.permission.INTERACT_ACROSS_USERS_FULL, null);
}
- final long ident = Binder.clearCallingIdentity();
- try {
- return getInputMethodListLocked(resolvedUserIds[0]);
- } finally {
- Binder.restoreCallingIdentity(ident);
+ synchronized (mMethodMap) {
+ final int[] resolvedUserIds = InputMethodUtils.resolveUserId(userId,
+ mSettings.getCurrentUserId(), null);
+ if (resolvedUserIds.length != 1) {
+ return Collections.emptyList();
+ }
+ final long ident = Binder.clearCallingIdentity();
+ try {
+ return getInputMethodListLocked(resolvedUserIds[0]);
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
}
- }
+ });
}
@Override
- public List<InputMethodInfo> getEnabledInputMethodList(@UserIdInt int userId) {
- if (UserHandle.getCallingUserId() != userId) {
- mContext.enforceCallingPermission(Manifest.permission.INTERACT_ACROSS_USERS_FULL, null);
- }
- synchronized (mMethodMap) {
- final int[] resolvedUserIds = InputMethodUtils.resolveUserId(userId,
- mSettings.getCurrentUserId(), null);
- if (resolvedUserIds.length != 1) {
- return Collections.emptyList();
+ public void getEnabledInputMethodList(@UserIdInt int userId,
+ IInputMethodInfoListResultCallback resultCallback) {
+ CallbackUtils.onResult(resultCallback, () -> {
+ if (UserHandle.getCallingUserId() != userId) {
+ mContext.enforceCallingPermission(
+ Manifest.permission.INTERACT_ACROSS_USERS_FULL, null);
}
- final long ident = Binder.clearCallingIdentity();
- try {
- return getEnabledInputMethodListLocked(resolvedUserIds[0]);
- } finally {
- Binder.restoreCallingIdentity(ident);
+ synchronized (mMethodMap) {
+ final int[] resolvedUserIds = InputMethodUtils.resolveUserId(userId,
+ mSettings.getCurrentUserId(), null);
+ if (resolvedUserIds.length != 1) {
+ return Collections.emptyList();
+ }
+ final long ident = Binder.clearCallingIdentity();
+ try {
+ return getEnabledInputMethodListLocked(resolvedUserIds[0]);
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
}
- }
+ });
}
@GuardedBy("mMethodMap")
@@ -2159,27 +2171,34 @@
}
/**
- * @param imiId if null, returns enabled subtypes for the current imi
- * @return enabled subtypes of the specified imi
+ * Gets enabled subtypes of the specified {@link InputMethodInfo}.
+ *
+ * @param imiId if null, returns enabled subtypes for the current {@link InputMethodInfo}.
+ * @param allowsImplicitlySelectedSubtypes {@code true} to return the implicitly selected
+ * subtypes.
+ * @param resultCallback to callback the result.
*/
@Override
- public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(String imiId,
- boolean allowsImplicitlySelectedSubtypes) {
- final int callingUserId = UserHandle.getCallingUserId();
- synchronized (mMethodMap) {
- final int[] resolvedUserIds = InputMethodUtils.resolveUserId(callingUserId,
- mSettings.getCurrentUserId(), null);
- if (resolvedUserIds.length != 1) {
- return Collections.emptyList();
+ public void getEnabledInputMethodSubtypeList(String imiId,
+ boolean allowsImplicitlySelectedSubtypes,
+ IInputMethodSubtypeListResultCallback resultCallback) {
+ CallbackUtils.onResult(resultCallback, () -> {
+ final int callingUserId = UserHandle.getCallingUserId();
+ synchronized (mMethodMap) {
+ final int[] resolvedUserIds = InputMethodUtils.resolveUserId(callingUserId,
+ mSettings.getCurrentUserId(), null);
+ if (resolvedUserIds.length != 1) {
+ return Collections.emptyList();
+ }
+ final long ident = Binder.clearCallingIdentity();
+ try {
+ return getEnabledInputMethodSubtypeListLocked(imiId,
+ allowsImplicitlySelectedSubtypes, resolvedUserIds[0]);
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
}
- final long ident = Binder.clearCallingIdentity();
- try {
- return getEnabledInputMethodSubtypeListLocked(imiId,
- allowsImplicitlySelectedSubtypes, resolvedUserIds[0]);
- } finally {
- Binder.restoreCallingIdentity(ident);
- }
- }
+ });
}
@GuardedBy("mMethodMap")
@@ -3892,29 +3911,31 @@
}
@Override
- public InputMethodSubtype getLastInputMethodSubtype() {
- synchronized (mMethodMap) {
- if (!calledFromValidUserLocked()) {
- return null;
- }
- final Pair<String, String> lastIme = mSettings.getLastInputMethodAndSubtypeLocked();
- // TODO: Handle the case of the last IME with no subtypes
- if (lastIme == null || TextUtils.isEmpty(lastIme.first)
- || TextUtils.isEmpty(lastIme.second)) return null;
- final InputMethodInfo lastImi = mMethodMap.get(lastIme.first);
- if (lastImi == null) return null;
- try {
- final int lastSubtypeHash = Integer.parseInt(lastIme.second);
- final int lastSubtypeId =
- InputMethodUtils.getSubtypeIdFromHashCode(lastImi, lastSubtypeHash);
- if (lastSubtypeId < 0 || lastSubtypeId >= lastImi.getSubtypeCount()) {
+ public void getLastInputMethodSubtype(IInputMethodSubtypeResultCallback resultCallback) {
+ CallbackUtils.onResult(resultCallback, () -> {
+ synchronized (mMethodMap) {
+ if (!calledFromValidUserLocked()) {
return null;
}
- return lastImi.getSubtypeAt(lastSubtypeId);
- } catch (NumberFormatException e) {
- return null;
+ final Pair<String, String> lastIme = mSettings.getLastInputMethodAndSubtypeLocked();
+ // TODO: Handle the case of the last IME with no subtypes
+ if (lastIme == null || TextUtils.isEmpty(lastIme.first)
+ || TextUtils.isEmpty(lastIme.second)) return null;
+ final InputMethodInfo lastImi = mMethodMap.get(lastIme.first);
+ if (lastImi == null) return null;
+ try {
+ final int lastSubtypeHash = Integer.parseInt(lastIme.second);
+ final int lastSubtypeId =
+ InputMethodUtils.getSubtypeIdFromHashCode(lastImi, lastSubtypeHash);
+ if (lastSubtypeId < 0 || lastSubtypeId >= lastImi.getSubtypeCount()) {
+ return null;
+ }
+ return lastImi.getSubtypeAt(lastSubtypeId);
+ } catch (NumberFormatException e) {
+ return null;
+ }
}
- }
+ });
}
@Override
@@ -3981,9 +4002,11 @@
* @return {@link WindowManagerInternal#getInputMethodWindowVisibleHeight(int)}
*/
@Override
- public int getInputMethodWindowVisibleHeight() {
- // TODO(yukawa): Should we verify the display ID?
- return mWindowManagerInternal.getInputMethodWindowVisibleHeight(mCurTokenDisplayId);
+ public void getInputMethodWindowVisibleHeight(IIntResultCallback resultCallback) {
+ CallbackUtils.onResult(resultCallback, () -> {
+ // TODO(yukawa): Should we verify the display ID?
+ return mWindowManagerInternal.getInputMethodWindowVisibleHeight(mCurTokenDisplayId);
+ });
}
@Override
@@ -4950,17 +4973,21 @@
}
/**
- * @return Return the current subtype of this input method.
+ * Gets the current subtype of this input method.
+ *
+ * @param resultCallback to callback the result.
*/
@Override
- public InputMethodSubtype getCurrentInputMethodSubtype() {
- synchronized (mMethodMap) {
- // TODO: Make this work even for non-current users?
- if (!calledFromValidUserLocked()) {
- return null;
+ public void getCurrentInputMethodSubtype(IInputMethodSubtypeResultCallback resultCallback) {
+ CallbackUtils.onResult(resultCallback, () -> {
+ synchronized (mMethodMap) {
+ // TODO: Make this work even for non-current users?
+ if (!calledFromValidUserLocked()) {
+ return null;
+ }
+ return getCurrentInputMethodSubtypeLocked();
}
- return getCurrentInputMethodSubtypeLocked();
- }
+ });
}
InputMethodSubtype getCurrentInputMethodSubtypeLocked() {
diff --git a/services/core/java/com/android/server/inputmethod/MultiClientInputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/MultiClientInputMethodManagerService.java
index ccb78a4..3485881 100644
--- a/services/core/java/com/android/server/inputmethod/MultiClientInputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/MultiClientInputMethodManagerService.java
@@ -75,6 +75,10 @@
import com.android.internal.inputmethod.CallbackUtils;
import com.android.internal.inputmethod.IBooleanResultCallback;
import com.android.internal.inputmethod.IInputBindResultResultCallback;
+import com.android.internal.inputmethod.IInputMethodInfoListResultCallback;
+import com.android.internal.inputmethod.IInputMethodSubtypeListResultCallback;
+import com.android.internal.inputmethod.IInputMethodSubtypeResultCallback;
+import com.android.internal.inputmethod.IIntResultCallback;
import com.android.internal.inputmethod.IMultiClientInputMethod;
import com.android.internal.inputmethod.IMultiClientInputMethodPrivilegedOperations;
import com.android.internal.inputmethod.IMultiClientInputMethodSession;
@@ -1457,35 +1461,42 @@
@BinderThread
@Override
- public List<InputMethodInfo> getInputMethodList(@UserIdInt int userId) {
- if (UserHandle.getCallingUserId() != userId) {
- mContext.enforceCallingPermission(INTERACT_ACROSS_USERS_FULL, null);
- }
- return mInputMethodInfoMap.getAsList(userId);
+ public void getInputMethodList(@UserIdInt int userId,
+ IInputMethodInfoListResultCallback resultCallback) {
+ CallbackUtils.onResult(resultCallback, () -> {
+ if (UserHandle.getCallingUserId() != userId) {
+ mContext.enforceCallingPermission(INTERACT_ACROSS_USERS_FULL, null);
+ }
+ return mInputMethodInfoMap.getAsList(userId);
+ });
}
@BinderThread
@Override
- public List<InputMethodInfo> getEnabledInputMethodList(@UserIdInt int userId) {
- if (UserHandle.getCallingUserId() != userId) {
- mContext.enforceCallingPermission(INTERACT_ACROSS_USERS_FULL, null);
- }
- return mInputMethodInfoMap.getAsList(userId);
+ public void getEnabledInputMethodList(@UserIdInt int userId,
+ IInputMethodInfoListResultCallback resultCallback) {
+ CallbackUtils.onResult(resultCallback, () -> {
+ if (UserHandle.getCallingUserId() != userId) {
+ mContext.enforceCallingPermission(INTERACT_ACROSS_USERS_FULL, null);
+ }
+ return mInputMethodInfoMap.getAsList(userId);
+ });
}
@BinderThread
@Override
- public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(String imiId,
- boolean allowsImplicitlySelectedSubtypes) {
+ public void getEnabledInputMethodSubtypeList(String imiId,
+ boolean allowsImplicitlySelectedSubtypes,
+ IInputMethodSubtypeListResultCallback resultCallback) {
reportNotSupported();
- return Collections.emptyList();
+ CallbackUtils.onResult(resultCallback, Collections::emptyList);
}
@BinderThread
@Override
- public InputMethodSubtype getLastInputMethodSubtype() {
+ public void getLastInputMethodSubtype(IInputMethodSubtypeResultCallback resultCallback) {
reportNotSupported();
- return null;
+ CallbackUtils.onResult(resultCallback, () -> null);
}
@BinderThread
@@ -1793,9 +1804,9 @@
@BinderThread
@Override
- public InputMethodSubtype getCurrentInputMethodSubtype() {
+ public void getCurrentInputMethodSubtype(IInputMethodSubtypeResultCallback resultCallback) {
reportNotSupported();
- return null;
+ CallbackUtils.onResult(resultCallback, () -> null);
}
@BinderThread
@@ -1806,9 +1817,9 @@
@BinderThread
@Override
- public int getInputMethodWindowVisibleHeight() {
+ public void getInputMethodWindowVisibleHeight(IIntResultCallback resultCallback) {
reportNotSupported();
- return 0;
+ CallbackUtils.onResult(resultCallback, () -> 0);
}
@BinderThread
diff --git a/services/core/java/com/android/server/location/LocationManagerService.java b/services/core/java/com/android/server/location/LocationManagerService.java
index 9068287..372bcee 100644
--- a/services/core/java/com/android/server/location/LocationManagerService.java
+++ b/services/core/java/com/android/server/location/LocationManagerService.java
@@ -52,8 +52,8 @@
import android.location.IGnssAntennaInfoListener;
import android.location.IGnssMeasurementsListener;
import android.location.IGnssNavigationMessageListener;
+import android.location.IGnssNmeaListener;
import android.location.IGnssStatusListener;
-import android.location.IGpsGeofenceHardware;
import android.location.ILocationCallback;
import android.location.ILocationListener;
import android.location.ILocationManager;
@@ -64,6 +64,7 @@
import android.location.LocationProvider;
import android.location.LocationRequest;
import android.location.LocationTime;
+import android.location.ProviderProperties;
import android.location.util.identity.CallerIdentity;
import android.os.Binder;
import android.os.Bundle;
@@ -80,17 +81,19 @@
import android.util.Log;
import com.android.internal.annotations.GuardedBy;
-import com.android.internal.location.ProviderProperties;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.Preconditions;
import com.android.server.LocalServices;
import com.android.server.SystemService;
import com.android.server.location.geofence.GeofenceManager;
import com.android.server.location.geofence.GeofenceProxy;
+import com.android.server.location.gnss.GnssConfiguration;
import com.android.server.location.gnss.GnssManagerService;
+import com.android.server.location.gnss.hal.GnssNative;
import com.android.server.location.injector.AlarmHelper;
import com.android.server.location.injector.AppForegroundHelper;
import com.android.server.location.injector.AppOpsHelper;
+import com.android.server.location.injector.EmergencyHelper;
import com.android.server.location.injector.Injector;
import com.android.server.location.injector.LocationAttributionHelper;
import com.android.server.location.injector.LocationEventLog;
@@ -102,6 +105,7 @@
import com.android.server.location.injector.SystemAlarmHelper;
import com.android.server.location.injector.SystemAppForegroundHelper;
import com.android.server.location.injector.SystemAppOpsHelper;
+import com.android.server.location.injector.SystemEmergencyHelper;
import com.android.server.location.injector.SystemLocationPermissionsHelper;
import com.android.server.location.injector.SystemLocationPowerSaveModeHelper;
import com.android.server.location.injector.SystemScreenInteractiveHelper;
@@ -367,8 +371,10 @@
// initialize gnss last because it has no awareness of boot phases and blindly assumes that
// all other location providers are loaded at initialization
- if (GnssManagerService.isGnssSupported()) {
- mGnssManagerService = new GnssManagerService(mContext, mInjector);
+ if (GnssNative.isSupported()) {
+ GnssConfiguration gnssConfiguration = new GnssConfiguration(mContext);
+ GnssNative gnssNative = GnssNative.create(mInjector, gnssConfiguration);
+ mGnssManagerService = new GnssManagerService(mContext, mInjector, gnssNative);
mGnssManagerService.onSystemReady();
LocationProviderManager gnssManager = new LocationProviderManager(mContext, mInjector,
@@ -390,13 +396,11 @@
}
// bind to gnss geofence proxy
- if (GnssManagerService.isGnssSupported()) {
- IGpsGeofenceHardware gpsGeofenceHardware = mGnssManagerService.getGpsGeofenceProxy();
- if (gpsGeofenceHardware != null) {
- GeofenceProxy provider = GeofenceProxy.createAndBind(mContext, gpsGeofenceHardware);
- if (provider == null) {
- Log.e(TAG, "unable to bind to GeofenceProxy");
- }
+ if (mGnssManagerService != null) {
+ GeofenceProxy provider = GeofenceProxy.createAndBind(mContext,
+ mGnssManagerService.getGnssGeofenceProxy());
+ if (provider == null) {
+ Log.e(TAG, "unable to bind to GeofenceProxy");
}
}
@@ -414,7 +418,7 @@
Boolean.parseBoolean(fragments[5]) /* supportsAltitude */,
Boolean.parseBoolean(fragments[6]) /* supportsSpeed */,
Boolean.parseBoolean(fragments[7]) /* supportsBearing */,
- Integer.parseInt(fragments[8]) /* powerRequirement */,
+ Integer.parseInt(fragments[8]) /* powerUsage */,
Integer.parseInt(fragments[9]) /* accuracy */);
getOrAddLocationProviderManager(name).setMockProvider(
new MockLocationProvider(properties, CallerIdentity.fromContext(mContext)));
@@ -516,6 +520,11 @@
}
@Override
+ public boolean hasProvider(String provider) {
+ return getLocationProviderManager(provider) != null;
+ }
+
+ @Override
public List<String> getAllProviders() {
ArrayList<String> providers = new ArrayList<>(mProviderManagers.size());
for (LocationProviderManager manager : mProviderManagers) {
@@ -859,6 +868,21 @@
}
@Override
+ public void registerGnssNmeaCallback(IGnssNmeaListener listener, String packageName,
+ String attributionTag) {
+ if (mGnssManagerService != null) {
+ mGnssManagerService.registerGnssNmeaCallback(listener, packageName, attributionTag);
+ }
+ }
+
+ @Override
+ public void unregisterGnssNmeaCallback(IGnssNmeaListener listener) {
+ if (mGnssManagerService != null) {
+ mGnssManagerService.unregisterGnssNmeaCallback(listener);
+ }
+ }
+
+ @Override
public void addGnssMeasurementsListener(@Nullable GnssMeasurementRequest request,
IGnssMeasurementsListener listener, String packageName, String attributionTag) {
if (mGnssManagerService != null) {
@@ -883,8 +907,8 @@
}
@Override
- public long getGnssCapabilities() {
- return mGnssManagerService == null ? GnssCapabilities.INVALID_CAPABILITIES
+ public GnssCapabilities getGnssCapabilities() {
+ return mGnssManagerService == null ? new GnssCapabilities.Builder().build()
: mGnssManagerService.getGnssCapabilities();
}
@@ -944,11 +968,10 @@
}
@Override
- public ProviderProperties getProviderProperties(String providerName) {
- LocationProviderManager manager = getLocationProviderManager(providerName);
- if (manager == null) {
- return null;
- }
+ public ProviderProperties getProviderProperties(String provider) {
+ LocationProviderManager manager = getLocationProviderManager(provider);
+ Preconditions.checkArgument(manager != null,
+ "provider \"" + provider + "\" does not exist");
return manager.getProperties();
}
@@ -1285,8 +1308,10 @@
private static class SystemInjector implements Injector {
- private final LocationEventLog mLocationEventLog;
+ private final Context mContext;
+
private final UserInfoHelper mUserInfoHelper;
+ private final LocationEventLog mLocationEventLog;
private final AlarmHelper mAlarmHelper;
private final SystemAppOpsHelper mAppOpsHelper;
private final SystemLocationPermissionsHelper mLocationPermissionsHelper;
@@ -1297,9 +1322,19 @@
private final LocationAttributionHelper mLocationAttributionHelper;
private final LocationUsageLogger mLocationUsageLogger;
+ // lazily instantiated since they may not always be used
+
+ @GuardedBy("this")
+ private @Nullable SystemEmergencyHelper mEmergencyCallHelper;
+
+ @GuardedBy("this")
+ private boolean mSystemReady;
+
SystemInjector(Context context, UserInfoHelper userInfoHelper) {
- mLocationEventLog = new LocationEventLog();
+ mContext = context;
+
mUserInfoHelper = userInfoHelper;
+ mLocationEventLog = new LocationEventLog();
mAlarmHelper = new SystemAlarmHelper(context);
mAppOpsHelper = new SystemAppOpsHelper(context);
mLocationPermissionsHelper = new SystemLocationPermissionsHelper(context,
@@ -1313,13 +1348,19 @@
mLocationUsageLogger = new LocationUsageLogger();
}
- void onSystemReady() {
+ synchronized void onSystemReady() {
mAppOpsHelper.onSystemReady();
mLocationPermissionsHelper.onSystemReady();
mSettingsHelper.onSystemReady();
mAppForegroundHelper.onSystemReady();
mLocationPowerSaveModeHelper.onSystemReady();
mScreenInteractiveHelper.onSystemReady();
+
+ if (mEmergencyCallHelper != null) {
+ mEmergencyCallHelper.onSystemReady();
+ }
+
+ mSystemReady = true;
}
@Override
@@ -1353,11 +1394,6 @@
}
@Override
- public LocationUsageLogger getLocationUsageLogger() {
- return mLocationUsageLogger;
- }
-
- @Override
public LocationPowerSaveModeHelper getLocationPowerSaveModeHelper() {
return mLocationPowerSaveModeHelper;
}
@@ -1373,8 +1409,25 @@
}
@Override
+ public synchronized EmergencyHelper getEmergencyHelper() {
+ if (mEmergencyCallHelper == null) {
+ mEmergencyCallHelper = new SystemEmergencyHelper(mContext);
+ if (mSystemReady) {
+ mEmergencyCallHelper.onSystemReady();
+ }
+ }
+
+ return mEmergencyCallHelper;
+ }
+
+ @Override
public LocationEventLog getLocationEventLog() {
return mLocationEventLog;
}
+
+ @Override
+ public LocationUsageLogger getLocationUsageLogger() {
+ return mLocationUsageLogger;
+ }
}
}
diff --git a/services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java b/services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java
index 20458b4..cc510fb 100644
--- a/services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java
+++ b/services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java
@@ -39,6 +39,10 @@
import com.android.server.location.ClientBrokerProto;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Supplier;
@@ -119,6 +123,13 @@
private final boolean mHasAccessContextHubPermission;
/*
+ * The set of nanoapp IDs that represent the group of nanoapps this client has a messaging
+ * channel with, i.e. has sent or received messages from this particular nanoapp.
+ */
+ private final Set<Long> mMessageChannelNanoappIdSet =
+ Collections.newSetFromMap(new ConcurrentHashMap<Long, Boolean>());
+
+ /*
* Helper class to manage registered PendingIntent requests from the client.
*/
private class PendingIntentRequest {
@@ -134,7 +145,8 @@
private boolean mValid = false;
- PendingIntentRequest() {}
+ PendingIntentRequest() {
+ }
PendingIntentRequest(PendingIntent pendingIntent, long nanoAppId) {
mPendingIntent = pendingIntent;
@@ -177,7 +189,7 @@
mPackage = mContext.getPackageManager().getNameForUid(Binder.getCallingUid());
mHasAccessContextHubPermission = context.checkCallingPermission(
- Manifest.permission.ACCESS_CONTEXT_HUB) == PERMISSION_GRANTED;
+ Manifest.permission.ACCESS_CONTEXT_HUB) == PERMISSION_GRANTED;
}
/* package */ ContextHubClientBroker(
@@ -193,7 +205,7 @@
mPackage = pendingIntent.getCreatorPackage();
mHasAccessContextHubPermission = context.checkCallingPermission(
- Manifest.permission.ACCESS_CONTEXT_HUB) == PERMISSION_GRANTED;
+ Manifest.permission.ACCESS_CONTEXT_HUB) == PERMISSION_GRANTED;
}
/**
@@ -209,6 +221,7 @@
int result;
if (isRegistered()) {
+ mMessageChannelNanoappIdSet.add(message.getNanoAppId());
ContextHubMsg messageToNanoApp =
ContextHubServiceUtil.createHidlContextHubMessage(mHostEndPointId, message);
@@ -269,6 +282,7 @@
* @param message the message that came from a nanoapp
*/
/* package */ void sendMessageToClient(NanoAppMessage message) {
+ mMessageChannelNanoappIdSet.add(message.getNanoAppId());
invokeCallback(callback -> callback.onMessageFromNanoApp(message));
Supplier<Intent> supplier =
@@ -413,7 +427,7 @@
/**
* Sends an intent to any existing PendingIntent
*
- * @param supplier method to create the extra Intent
+ * @param supplier method to create the extra Intent
* @param nanoAppId the ID of the nanoapp which this event is for
*/
private synchronized void sendPendingIntent(Supplier<Intent> supplier, long nanoAppId) {
@@ -427,7 +441,7 @@
* Sends a PendingIntent with extra Intent data
*
* @param pendingIntent the PendingIntent
- * @param intent the extra Intent data
+ * @param intent the extra Intent data
*/
private void doSendPendingIntent(PendingIntent pendingIntent, Intent intent) {
try {
@@ -500,6 +514,17 @@
} else {
out += "package: " + mPackage;
}
+ if (mMessageChannelNanoappIdSet.size() > 0) {
+ out += " messageChannelNanoappSet: (";
+ Iterator<Long> it = mMessageChannelNanoappIdSet.iterator();
+ while (it.hasNext()) {
+ out += "0x" + Long.toHexString(it.next());
+ if (it.hasNext()) {
+ out += ",";
+ }
+ }
+ out += ")";
+ }
out += "]";
return out;
diff --git a/services/core/java/com/android/server/location/gnss/GnssAntennaInfoProvider.java b/services/core/java/com/android/server/location/gnss/GnssAntennaInfoProvider.java
index 9961d27..e9f79efb 100644
--- a/services/core/java/com/android/server/location/gnss/GnssAntennaInfoProvider.java
+++ b/services/core/java/com/android/server/location/gnss/GnssAntennaInfoProvider.java
@@ -20,12 +20,12 @@
import static com.android.server.location.gnss.GnssManagerService.TAG;
import android.location.GnssAntennaInfo;
+import android.location.GnssCapabilities;
import android.location.IGnssAntennaInfoListener;
import android.location.util.identity.CallerIdentity;
import android.util.Log;
-import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.util.Preconditions;
+import com.android.server.location.gnss.hal.GnssNative;
import com.android.server.location.injector.Injector;
import java.util.Collection;
@@ -35,23 +35,22 @@
* Provides GNSS antenna information to clients.
*/
public class GnssAntennaInfoProvider extends
- GnssListenerMultiplexer<Void, IGnssAntennaInfoListener, Void> {
+ GnssListenerMultiplexer<Void, IGnssAntennaInfoListener, Void> implements
+ GnssNative.BaseCallbacks, GnssNative.AntennaInfoCallbacks {
- private final GnssAntennaInfoProviderNative mNative;
+ private final GnssNative mGnssNative;
- public GnssAntennaInfoProvider(Injector injector) {
- this(injector, new GnssAntennaInfoProviderNative());
- }
-
- @VisibleForTesting
- public GnssAntennaInfoProvider(Injector injector, GnssAntennaInfoProviderNative aNative) {
+ public GnssAntennaInfoProvider(Injector injector, GnssNative gnssNative) {
super(injector);
- mNative = aNative;
+ mGnssNative = gnssNative;
+
+ mGnssNative.addBaseCallbacks(this);
+ mGnssNative.addAntennaInfoCallbacks(this);
}
@Override
protected boolean isServiceSupported() {
- return mNative.isAntennaInfoSupported();
+ return mGnssNative.isAntennaInfoListeningSupported();
}
@Override
@@ -62,9 +61,7 @@
@Override
protected boolean registerWithService(Void ignored,
Collection<GnssListenerRegistration> registrations) {
- Preconditions.checkState(mNative.isAntennaInfoSupported());
-
- if (mNative.startAntennaInfoListening()) {
+ if (mGnssNative.startAntennaInfoListening()) {
if (D) {
Log.d(TAG, "starting gnss antenna info");
}
@@ -77,7 +74,7 @@
@Override
protected void unregisterWithService() {
- if (mNative.stopAntennaInfoListening()) {
+ if (mGnssNative.stopAntennaInfoListening()) {
if (D) {
Log.d(TAG, "stopping gnss antenna info");
}
@@ -86,39 +83,19 @@
}
}
- /**
- * Called by GnssLocationProvider.
- */
- public void onGnssAntennaInfoAvailable(List<GnssAntennaInfo> gnssAntennaInfos) {
- deliverToListeners((listener) -> {
- listener.onGnssAntennaInfoReceived(gnssAntennaInfos);
+ @Override
+ public void onHalRestarted() {
+ resetService();
+ }
+
+ @Override
+ public void onCapabilitiesChanged(GnssCapabilities oldCapabilities,
+ GnssCapabilities newCapabilities) {}
+
+ @Override
+ public void onReportAntennaInfo(List<GnssAntennaInfo> antennaInfos) {
+ deliverToListeners(listener -> {
+ listener.onGnssAntennaInfoReceived(antennaInfos);
});
}
-
- /**
- * Wrapper class for native methods. This is mocked for testing.
- */
- @VisibleForTesting
- public static class GnssAntennaInfoProviderNative {
-
- public boolean isAntennaInfoSupported() {
- return native_is_antenna_info_supported();
- }
-
- /** Start antenna info listening. */
- public boolean startAntennaInfoListening() {
- return native_start_antenna_info_listening();
- }
-
- /** Stop antenna info listening. */
- public boolean stopAntennaInfoListening() {
- return native_stop_antenna_info_listening();
- }
- }
-
- static native boolean native_is_antenna_info_supported();
-
- static native boolean native_start_antenna_info_listening();
-
- static native boolean native_stop_antenna_info_listening();
}
diff --git a/services/core/java/com/android/server/location/gnss/GnssCapabilitiesProvider.java b/services/core/java/com/android/server/location/gnss/GnssCapabilitiesProvider.java
deleted file mode 100644
index 1c4fb10..0000000
--- a/services/core/java/com/android/server/location/gnss/GnssCapabilitiesProvider.java
+++ /dev/null
@@ -1,127 +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.location.gnss;
-
-import android.location.GnssCapabilities;
-import android.util.Log;
-
-import com.android.internal.annotations.GuardedBy;
-
-/**
- * Provides GNSS capabilities supported by the GNSS HAL implementation.
- */
-public class GnssCapabilitiesProvider {
- private static final String TAG = "GnssCapabilitiesProvider";
- private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
-
- private static final long GNSS_CAPABILITIES_TOP_HAL =
- GnssCapabilities.LOW_POWER_MODE | GnssCapabilities.SATELLITE_BLOCKLIST
- | GnssCapabilities.GEOFENCING | GnssCapabilities.MEASUREMENTS
- | GnssCapabilities.NAV_MESSAGES;
-
- private static final long GNSS_CAPABILITIES_SUB_HAL_MEASUREMENT_CORRECTIONS =
- GnssCapabilities.MEASUREMENT_CORRECTIONS
- | GnssCapabilities.MEASUREMENT_CORRECTIONS_LOS_SATS
- | GnssCapabilities.MEASUREMENT_CORRECTIONS_EXCESS_PATH_LENGTH
- | GnssCapabilities.MEASUREMENT_CORRECTIONS_REFLECTING_PLANE;
-
- // Capabilities in {@link android.location.GnssCapabilities} supported by GNSS chipset.
- @GuardedBy("this")
- private long mGnssCapabilities;
-
- /**
- * Returns the capabilities supported by the GNSS chipset.
- *
- * <p>The capabilities are described in {@link android.location.GnssCapabilities} and
- * their integer values correspond to the bit positions in the returned {@code long} value.
- */
- public long getGnssCapabilities() {
- synchronized (this) {
- return mGnssCapabilities;
- }
- }
-
- /**
- * Updates the general capabilities exposed through {@link android.location.GnssCapabilities}.
- */
- void setTopHalCapabilities(int topHalCapabilities) {
- long gnssCapabilities = 0;
- if (hasCapability(topHalCapabilities,
- GnssLocationProvider.GPS_CAPABILITY_LOW_POWER_MODE)) {
- gnssCapabilities |= GnssCapabilities.LOW_POWER_MODE;
- }
- if (hasCapability(topHalCapabilities,
- GnssLocationProvider.GPS_CAPABILITY_SATELLITE_BLOCKLIST)) {
- gnssCapabilities |= GnssCapabilities.SATELLITE_BLOCKLIST;
- }
- if (hasCapability(topHalCapabilities, GnssLocationProvider.GPS_CAPABILITY_GEOFENCING)) {
- gnssCapabilities |= GnssCapabilities.GEOFENCING;
- }
- if (hasCapability(topHalCapabilities, GnssLocationProvider.GPS_CAPABILITY_MEASUREMENTS)) {
- gnssCapabilities |= GnssCapabilities.MEASUREMENTS;
- }
- if (hasCapability(topHalCapabilities, GnssLocationProvider.GPS_CAPABILITY_NAV_MESSAGES)) {
- gnssCapabilities |= GnssCapabilities.NAV_MESSAGES;
- }
- if (hasCapability(topHalCapabilities, GnssLocationProvider.GPS_CAPABILITY_ANTENNA_INFO)) {
- gnssCapabilities |= GnssCapabilities.ANTENNA_INFO;
- }
-
- synchronized (this) {
- mGnssCapabilities &= ~GNSS_CAPABILITIES_TOP_HAL;
- mGnssCapabilities |= gnssCapabilities;
- if (DEBUG) {
- Log.d(TAG, "setTopHalCapabilities, mGnssCapabilities=0x" + Long.toHexString(
- mGnssCapabilities) + ", " + GnssCapabilities.of(mGnssCapabilities));
- }
- }
- }
-
- /**
- * Updates the measurement corrections related capabilities exposed through
- * {@link android.location.GnssCapabilities}.
- */
- void setSubHalMeasurementCorrectionsCapabilities(int measurementCorrectionsCapabilities) {
- long gnssCapabilities = GnssCapabilities.MEASUREMENT_CORRECTIONS;
- if (hasCapability(measurementCorrectionsCapabilities,
- GnssMeasurementCorrectionsProvider.CAPABILITY_LOS_SATS)) {
- gnssCapabilities |= GnssCapabilities.MEASUREMENT_CORRECTIONS_LOS_SATS;
- }
- if (hasCapability(measurementCorrectionsCapabilities,
- GnssMeasurementCorrectionsProvider.CAPABILITY_EXCESS_PATH_LENGTH)) {
- gnssCapabilities |= GnssCapabilities.MEASUREMENT_CORRECTIONS_EXCESS_PATH_LENGTH;
- }
- if (hasCapability(measurementCorrectionsCapabilities,
- GnssMeasurementCorrectionsProvider.CAPABILITY_REFLECTING_PLANE)) {
- gnssCapabilities |= GnssCapabilities.MEASUREMENT_CORRECTIONS_REFLECTING_PLANE;
- }
-
- synchronized (this) {
- mGnssCapabilities &= ~GNSS_CAPABILITIES_SUB_HAL_MEASUREMENT_CORRECTIONS;
- mGnssCapabilities |= gnssCapabilities;
- if (DEBUG) {
- Log.d(TAG, "setSubHalMeasurementCorrectionsCapabilities, mGnssCapabilities=0x"
- + Long.toHexString(mGnssCapabilities) + ", " + GnssCapabilities.of(
- mGnssCapabilities));
- }
- }
- }
-
- private static boolean hasCapability(int halCapabilities, int capability) {
- return (halCapabilities & capability) != 0;
- }
-}
diff --git a/services/core/java/com/android/server/location/gnss/GnssConfiguration.java b/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
index 2628372..60b7447 100644
--- a/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
+++ b/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
@@ -31,7 +31,7 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
-import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -48,7 +48,7 @@
* Instances of this class are not thread-safe and should either be used from a single thread
* or with external synchronization when used by multiple threads.
*/
-class GnssConfiguration {
+public class GnssConfiguration {
private static final String TAG = "GnssConfiguration";
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
@@ -98,13 +98,13 @@
/**
* Properties loaded from PROPERTIES_FILE.
*/
- private Properties mProperties;
+ private final Properties mProperties;
private int mEsExtensionSec = 0;
private final Context mContext;
- GnssConfiguration(Context context) {
+ public GnssConfiguration(Context context) {
mContext = context;
mProperties = new Properties();
}
@@ -120,7 +120,7 @@
* Returns the value of config parameter ES_EXTENSION_SEC. The value is range checked
* and constrained to min/max limits.
*/
- int getEsExtensionSec() {
+ public int getEsExtensionSec() {
return mEsExtensionSec;
}
@@ -168,8 +168,8 @@
* Returns the value of config parameter SUPL_ES or {@code defaultSuplEs} if no value is
* provided or if there is an error parsing the configured value.
*/
- int getSuplEs(int defaulSuplEs) {
- return getIntConfig(CONFIG_SUPL_ES, defaulSuplEs);
+ public int getSuplEs(int defaultSuplEs) {
+ return getIntConfig(CONFIG_SUPL_ES, defaultSuplEs);
}
/**
@@ -181,27 +181,21 @@
}
/**
- * Returns the list of proxy apps from the value of config parameter NFW_PROXY_APPS or
- * {@Collections.EMPTY_LIST} if no value is provided.
+ * Returns the list of proxy apps from the value of config parameter NFW_PROXY_APPS.
*/
List<String> getProxyApps() {
// Space separated list of Android proxy app package names.
String proxyAppsStr = mProperties.getProperty(CONFIG_NFW_PROXY_APPS);
if (TextUtils.isEmpty(proxyAppsStr)) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
String[] proxyAppsArray = proxyAppsStr.trim().split("\\s+");
if (proxyAppsArray.length == 0) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
- ArrayList proxyApps = new ArrayList(proxyAppsArray.length);
- for (String proxyApp : proxyAppsArray) {
- proxyApps.add(proxyApp);
- }
-
- return proxyApps;
+ return Arrays.asList(proxyAppsArray);
}
/**
diff --git a/services/core/java/com/android/server/location/gnss/GnssGeofenceProvider.java b/services/core/java/com/android/server/location/gnss/GnssGeofenceProvider.java
deleted file mode 100644
index 53883b9..0000000
--- a/services/core/java/com/android/server/location/gnss/GnssGeofenceProvider.java
+++ /dev/null
@@ -1,189 +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.location.gnss;
-
-import android.location.IGpsGeofenceHardware;
-import android.util.Log;
-import android.util.SparseArray;
-
-import com.android.internal.annotations.GuardedBy;
-import com.android.internal.annotations.VisibleForTesting;
-
-/**
- * Manages GNSS Geofence operations.
- */
-class GnssGeofenceProvider extends IGpsGeofenceHardware.Stub {
-
- private static final String TAG = "GnssGeofenceProvider";
- private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
-
- /** Holds the parameters of a geofence. */
- private static class GeofenceEntry {
- public int geofenceId;
- public double latitude;
- public double longitude;
- public double radius;
- public int lastTransition;
- public int monitorTransitions;
- public int notificationResponsiveness;
- public int unknownTimer;
- public boolean paused;
- }
-
- private final Object mLock = new Object();
- @GuardedBy("mLock")
- private final GnssGeofenceProviderNative mNative;
- @GuardedBy("mLock")
- private final SparseArray<GeofenceEntry> mGeofenceEntries = new SparseArray<>();
-
- GnssGeofenceProvider() {
- this(new GnssGeofenceProviderNative());
- }
-
- @VisibleForTesting
- GnssGeofenceProvider(GnssGeofenceProviderNative gnssGeofenceProviderNative) {
- mNative = gnssGeofenceProviderNative;
- }
-
- void resumeIfStarted() {
- if (DEBUG) {
- Log.d(TAG, "resumeIfStarted");
- }
- synchronized (mLock) {
- for (int i = 0; i < mGeofenceEntries.size(); i++) {
- GeofenceEntry entry = mGeofenceEntries.valueAt(i);
- boolean added = mNative.addGeofence(entry.geofenceId, entry.latitude,
- entry.longitude,
- entry.radius,
- entry.lastTransition, entry.monitorTransitions,
- entry.notificationResponsiveness, entry.unknownTimer);
- if (added && entry.paused) {
- mNative.pauseGeofence(entry.geofenceId);
- }
- }
- }
- }
-
- @Override
- public boolean isHardwareGeofenceSupported() {
- synchronized (mLock) {
- return mNative.isGeofenceSupported();
- }
- }
-
- @Override
- public boolean addCircularHardwareGeofence(int geofenceId, double latitude,
- double longitude, double radius, int lastTransition, int monitorTransitions,
- int notificationResponsiveness, int unknownTimer) {
- synchronized (mLock) {
- boolean added = mNative.addGeofence(geofenceId, latitude, longitude, radius,
- lastTransition, monitorTransitions, notificationResponsiveness,
- unknownTimer);
- if (added) {
- GeofenceEntry entry = new GeofenceEntry();
- entry.geofenceId = geofenceId;
- entry.latitude = latitude;
- entry.longitude = longitude;
- entry.radius = radius;
- entry.lastTransition = lastTransition;
- entry.monitorTransitions = monitorTransitions;
- entry.notificationResponsiveness = notificationResponsiveness;
- entry.unknownTimer = unknownTimer;
- mGeofenceEntries.put(geofenceId, entry);
- }
- return added;
- }
- }
-
- @Override
- public boolean removeHardwareGeofence(int geofenceId) {
- synchronized (mLock) {
- boolean removed = mNative.removeGeofence(geofenceId);
- if (removed) {
- mGeofenceEntries.remove(geofenceId);
- }
- return removed;
- }
- }
-
- @Override
- public boolean pauseHardwareGeofence(int geofenceId) {
- synchronized (mLock) {
- boolean paused = mNative.pauseGeofence(geofenceId);
- if (paused) {
- GeofenceEntry entry = mGeofenceEntries.get(geofenceId);
- if (entry != null) {
- entry.paused = true;
- }
- }
- return paused;
- }
- }
-
- @Override
- public boolean resumeHardwareGeofence(int geofenceId, int monitorTransitions) {
- synchronized (mLock) {
- boolean resumed = mNative.resumeGeofence(geofenceId, monitorTransitions);
- if (resumed) {
- GeofenceEntry entry = mGeofenceEntries.get(geofenceId);
- if (entry != null) {
- entry.paused = false;
- entry.monitorTransitions = monitorTransitions;
- }
- }
- return resumed;
- }
- }
-
- @VisibleForTesting
- static class GnssGeofenceProviderNative {
- public boolean isGeofenceSupported() {
- return native_is_geofence_supported();
- }
-
- public boolean addGeofence(int geofenceId, double latitude, double longitude, double radius,
- int lastTransition, int monitorTransitions, int notificationResponsiveness,
- int unknownTimer) {
- return native_add_geofence(geofenceId, latitude, longitude, radius, lastTransition,
- monitorTransitions, notificationResponsiveness, unknownTimer);
- }
-
- public boolean removeGeofence(int geofenceId) {
- return native_remove_geofence(geofenceId);
- }
-
- public boolean resumeGeofence(int geofenceId, int transitions) {
- return native_resume_geofence(geofenceId, transitions);
- }
-
- public boolean pauseGeofence(int geofenceId) {
- return native_pause_geofence(geofenceId);
- }
- }
-
- private static native boolean native_is_geofence_supported();
-
- private static native boolean native_add_geofence(int geofenceId, double latitude,
- double longitude, double radius, int lastTransition, int monitorTransitions,
- int notificationResponsivenes, int unknownTimer);
-
- private static native boolean native_remove_geofence(int geofenceId);
-
- private static native boolean native_resume_geofence(int geofenceId, int transitions);
-
- private static native boolean native_pause_geofence(int geofenceId);
-}
diff --git a/services/core/java/com/android/server/location/gnss/GnssGeofenceProxy.java b/services/core/java/com/android/server/location/gnss/GnssGeofenceProxy.java
new file mode 100644
index 0000000..32a7952
--- /dev/null
+++ b/services/core/java/com/android/server/location/gnss/GnssGeofenceProxy.java
@@ -0,0 +1,148 @@
+/*
+ * 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.location.gnss;
+
+import android.location.GnssCapabilities;
+import android.location.IGpsGeofenceHardware;
+import android.util.SparseArray;
+
+import com.android.internal.annotations.GuardedBy;
+import com.android.server.location.gnss.hal.GnssNative;
+
+/**
+ * Manages GNSS Geofence operations.
+ */
+class GnssGeofenceProxy extends IGpsGeofenceHardware.Stub implements GnssNative.BaseCallbacks {
+
+ /** Holds the parameters of a geofence. */
+ private static class GeofenceEntry {
+ public int geofenceId;
+ public double latitude;
+ public double longitude;
+ public double radius;
+ public int lastTransition;
+ public int monitorTransitions;
+ public int notificationResponsiveness;
+ public int unknownTimer;
+ public boolean paused;
+ }
+
+ private final Object mLock = new Object();
+
+ private final GnssNative mGnssNative;
+
+ @GuardedBy("mLock")
+ private final SparseArray<GeofenceEntry> mGeofenceEntries = new SparseArray<>();
+
+ GnssGeofenceProxy(GnssNative gnssNative) {
+ mGnssNative = gnssNative;
+
+ mGnssNative.addBaseCallbacks(this);
+ }
+
+ @Override
+ public boolean isHardwareGeofenceSupported() {
+ synchronized (mLock) {
+ return mGnssNative.isGeofencingSupported();
+ }
+ }
+
+ @Override
+ public boolean addCircularHardwareGeofence(int geofenceId, double latitude,
+ double longitude, double radius, int lastTransition, int monitorTransitions,
+ int notificationResponsiveness, int unknownTimer) {
+ synchronized (mLock) {
+ boolean added = mGnssNative.addGeofence(geofenceId, latitude, longitude, radius,
+ lastTransition, monitorTransitions, notificationResponsiveness,
+ unknownTimer);
+ if (added) {
+ GeofenceEntry entry = new GeofenceEntry();
+ entry.geofenceId = geofenceId;
+ entry.latitude = latitude;
+ entry.longitude = longitude;
+ entry.radius = radius;
+ entry.lastTransition = lastTransition;
+ entry.monitorTransitions = monitorTransitions;
+ entry.notificationResponsiveness = notificationResponsiveness;
+ entry.unknownTimer = unknownTimer;
+ mGeofenceEntries.put(geofenceId, entry);
+ }
+ return added;
+ }
+ }
+
+ @Override
+ public boolean removeHardwareGeofence(int geofenceId) {
+ synchronized (mLock) {
+ boolean removed = mGnssNative.removeGeofence(geofenceId);
+ if (removed) {
+ mGeofenceEntries.remove(geofenceId);
+ }
+ return removed;
+ }
+ }
+
+ @Override
+ public boolean pauseHardwareGeofence(int geofenceId) {
+ synchronized (mLock) {
+ boolean paused = mGnssNative.pauseGeofence(geofenceId);
+ if (paused) {
+ GeofenceEntry entry = mGeofenceEntries.get(geofenceId);
+ if (entry != null) {
+ entry.paused = true;
+ }
+ }
+ return paused;
+ }
+ }
+
+ @Override
+ public boolean resumeHardwareGeofence(int geofenceId, int monitorTransitions) {
+ synchronized (mLock) {
+ boolean resumed = mGnssNative.resumeGeofence(geofenceId, monitorTransitions);
+ if (resumed) {
+ GeofenceEntry entry = mGeofenceEntries.get(geofenceId);
+ if (entry != null) {
+ entry.paused = false;
+ entry.monitorTransitions = monitorTransitions;
+ }
+ }
+ return resumed;
+ }
+ }
+
+ @Override
+ public void onHalRestarted() {
+ synchronized (mLock) {
+ for (int i = 0; i < mGeofenceEntries.size(); i++) {
+ GeofenceEntry entry = mGeofenceEntries.valueAt(i);
+ boolean added = mGnssNative.addGeofence(entry.geofenceId, entry.latitude,
+ entry.longitude,
+ entry.radius,
+ entry.lastTransition, entry.monitorTransitions,
+ entry.notificationResponsiveness, entry.unknownTimer);
+ if (added && entry.paused) {
+ mGnssNative.pauseGeofence(entry.geofenceId);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void onCapabilitiesChanged(GnssCapabilities oldCapabilities,
+ GnssCapabilities newCapabilities) {}
+}
diff --git a/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java
index 9e12667..afe7567 100644
--- a/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java
+++ b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java
@@ -17,6 +17,28 @@
package com.android.server.location.gnss;
import static com.android.internal.util.ConcurrentUtils.DIRECT_EXECUTOR;
+import static com.android.server.location.gnss.hal.GnssNative.AGPS_REF_LOCATION_TYPE_GSM_CELLID;
+import static com.android.server.location.gnss.hal.GnssNative.AGPS_REF_LOCATION_TYPE_UMTS_CELLID;
+import static com.android.server.location.gnss.hal.GnssNative.AGPS_SETID_TYPE_IMSI;
+import static com.android.server.location.gnss.hal.GnssNative.AGPS_SETID_TYPE_MSISDN;
+import static com.android.server.location.gnss.hal.GnssNative.AGPS_SETID_TYPE_NONE;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_AIDING_TYPE_ALL;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_AIDING_TYPE_ALMANAC;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_AIDING_TYPE_CELLDB_INFO;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_AIDING_TYPE_EPHEMERIS;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_AIDING_TYPE_HEALTH;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_AIDING_TYPE_IONO;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_AIDING_TYPE_POSITION;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_AIDING_TYPE_RTI;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_AIDING_TYPE_SADATA;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_AIDING_TYPE_SVDIR;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_AIDING_TYPE_SVSTEER;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_AIDING_TYPE_TIME;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_AIDING_TYPE_UTC;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_POSITION_MODE_MS_ASSISTED;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_POSITION_MODE_MS_BASED;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_POSITION_MODE_STANDALONE;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_POSITION_RECURRENCE_PERIODIC;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
@@ -28,21 +50,16 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.database.ContentObserver;
-import android.hardware.location.GeofenceHardware;
-import android.hardware.location.GeofenceHardwareImpl;
import android.location.Criteria;
-import android.location.FusedBatchOptions;
-import android.location.GnssAntennaInfo;
-import android.location.GnssMeasurementsEvent;
-import android.location.GnssNavigationMessage;
+import android.location.GnssCapabilities;
import android.location.GnssStatus;
-import android.location.IGpsGeofenceHardware;
import android.location.INetInitiatedListener;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.location.LocationRequest;
import android.location.LocationResult;
+import android.location.ProviderProperties;
import android.location.util.identity.CallerIdentity;
import android.os.AsyncTask;
import android.os.BatteryStats;
@@ -72,13 +89,12 @@
import com.android.internal.app.IBatteryStats;
import com.android.internal.location.GpsNetInitiatedHandler;
import com.android.internal.location.GpsNetInitiatedHandler.GpsNiNotification;
-import com.android.internal.location.ProviderProperties;
import com.android.internal.location.ProviderRequest;
-import com.android.internal.location.gnssmetrics.GnssMetrics;
import com.android.internal.util.FrameworkStatsLog;
import com.android.server.FgThread;
import com.android.server.location.gnss.GnssSatelliteBlocklistHelper.GnssSatelliteBlocklistCallback;
import com.android.server.location.gnss.NtpTimeHelper.InjectNtpTimeCallback;
+import com.android.server.location.gnss.hal.GnssNative;
import com.android.server.location.injector.Injector;
import com.android.server.location.provider.AbstractLocationProvider;
@@ -97,8 +113,10 @@
* {@hide}
*/
public class GnssLocationProvider extends AbstractLocationProvider implements
- InjectNtpTimeCallback,
- GnssSatelliteBlocklistCallback {
+ InjectNtpTimeCallback, GnssSatelliteBlocklistCallback, GnssNative.BaseCallbacks,
+ GnssNative.LocationCallbacks, GnssNative.SvStatusCallbacks, GnssNative.AGpsCallbacks,
+ GnssNative.PsdsCallbacks, GnssNative.NotificationCallbacks,
+ GnssNative.LocationRequestCallbacks, GnssNative.TimeCallbacks {
private static final String TAG = "GnssLocationProvider";
@@ -113,104 +131,20 @@
/* supportAltitude = */true,
/* supportsSpeed = */true,
/* supportsBearing = */true,
- Criteria.POWER_HIGH,
- Criteria.ACCURACY_FINE);
-
- // these need to match GnssPositionMode enum in IGnss.hal
- private static final int GPS_POSITION_MODE_STANDALONE = 0;
- private static final int GPS_POSITION_MODE_MS_BASED = 1;
- private static final int GPS_POSITION_MODE_MS_ASSISTED = 2;
-
- // these need to match GnssPositionRecurrence enum in IGnss.hal
- private static final int GPS_POSITION_RECURRENCE_PERIODIC = 0;
- private static final int GPS_POSITION_RECURRENCE_SINGLE = 1;
-
- // these need to match GnssStatusValue enum in IGnssCallback.hal
- private static final int GPS_STATUS_NONE = 0;
- private static final int GPS_STATUS_SESSION_BEGIN = 1;
- private static final int GPS_STATUS_SESSION_END = 2;
- private static final int GPS_STATUS_ENGINE_ON = 3;
- private static final int GPS_STATUS_ENGINE_OFF = 4;
-
- // these need to match GnssLocationFlags enum in types.hal
- private static final int LOCATION_INVALID = 0;
- private static final int LOCATION_HAS_LAT_LONG = 1;
- private static final int LOCATION_HAS_ALTITUDE = 2;
- private static final int LOCATION_HAS_SPEED = 4;
- private static final int LOCATION_HAS_BEARING = 8;
- private static final int LOCATION_HAS_HORIZONTAL_ACCURACY = 16;
- private static final int LOCATION_HAS_VERTICAL_ACCURACY = 32;
- private static final int LOCATION_HAS_SPEED_ACCURACY = 64;
- private static final int LOCATION_HAS_BEARING_ACCURACY = 128;
-
- // these need to match ElapsedRealtimeFlags enum in types.hal
- private static final int ELAPSED_REALTIME_HAS_TIMESTAMP_NS = 1;
- private static final int ELAPSED_REALTIME_HAS_TIME_UNCERTAINTY_NS = 2;
-
- // IMPORTANT - the GPS_DELETE_* symbols here must match GnssAidingData enum in IGnss.hal
- private static final int GPS_DELETE_EPHEMERIS = 0x0001;
- private static final int GPS_DELETE_ALMANAC = 0x0002;
- private static final int GPS_DELETE_POSITION = 0x0004;
- private static final int GPS_DELETE_TIME = 0x0008;
- private static final int GPS_DELETE_IONO = 0x0010;
- private static final int GPS_DELETE_UTC = 0x0020;
- private static final int GPS_DELETE_HEALTH = 0x0040;
- private static final int GPS_DELETE_SVDIR = 0x0080;
- private static final int GPS_DELETE_SVSTEER = 0x0100;
- private static final int GPS_DELETE_SADATA = 0x0200;
- private static final int GPS_DELETE_RTI = 0x0400;
- private static final int GPS_DELETE_CELLDB_INFO = 0x8000;
- private static final int GPS_DELETE_ALL = 0xFFFF;
-
- // The GPS_CAPABILITY_* flags must match Capabilities enum in IGnssCallback.hal
- private static final int GPS_CAPABILITY_SCHEDULING = 0x0000001;
- private static final int GPS_CAPABILITY_MSB = 0x0000002;
- private static final int GPS_CAPABILITY_MSA = 0x0000004;
- private static final int GPS_CAPABILITY_SINGLE_SHOT = 0x0000008;
- private static final int GPS_CAPABILITY_ON_DEMAND_TIME = 0x0000010;
- public static final int GPS_CAPABILITY_GEOFENCING = 0x0000020;
- public static final int GPS_CAPABILITY_MEASUREMENTS = 0x0000040;
- public static final int GPS_CAPABILITY_NAV_MESSAGES = 0x0000080;
- public static final int GPS_CAPABILITY_LOW_POWER_MODE = 0x0000100;
- public static final int GPS_CAPABILITY_SATELLITE_BLOCKLIST = 0x0000200;
- public static final int GPS_CAPABILITY_MEASUREMENT_CORRECTIONS = 0x0000400;
- public static final int GPS_CAPABILITY_ANTENNA_INFO = 0x0000800;
+ ProviderProperties.POWER_USAGE_HIGH,
+ ProviderProperties.ACCURACY_FINE);
// The AGPS SUPL mode
private static final int AGPS_SUPL_MODE_MSA = 0x02;
private static final int AGPS_SUPL_MODE_MSB = 0x01;
+ // handler messages
private static final int INJECT_NTP_TIME = 5;
- // PSDS stands for Predicted Satellite Data Service
private static final int DOWNLOAD_PSDS_DATA = 6;
private static final int REQUEST_LOCATION = 16;
private static final int REPORT_LOCATION = 17; // HAL reports location
private static final int REPORT_SV_STATUS = 18; // HAL reports SV status
- // Request setid
- private static final int AGPS_RIL_REQUEST_SETID_IMSI = 1;
- private static final int AGPS_RIL_REQUEST_SETID_MSISDN = 2;
-
- // ref. location info
- private static final int AGPS_REF_LOCATION_TYPE_GSM_CELLID = 1;
- private static final int AGPS_REF_LOCATION_TYPE_UMTS_CELLID = 2;
-
- // set id info
- private static final int AGPS_SETID_TYPE_NONE = 0;
- private static final int AGPS_SETID_TYPE_IMSI = 1;
- private static final int AGPS_SETID_TYPE_MSISDN = 2;
-
- private static final int GPS_GEOFENCE_UNAVAILABLE = 1 << 0L;
- private static final int GPS_GEOFENCE_AVAILABLE = 1 << 1L;
-
- // GPS Geofence errors. Should match GeofenceStatus enum in IGnssGeofenceCallback.hal.
- private static final int GPS_GEOFENCE_OPERATION_SUCCESS = 0;
- private static final int GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES = 100;
- private static final int GPS_GEOFENCE_ERROR_ID_EXISTS = -101;
- private static final int GPS_GEOFENCE_ERROR_ID_UNKNOWN = -102;
- private static final int GPS_GEOFENCE_ERROR_INVALID_TRANSITION = -103;
- private static final int GPS_GEOFENCE_ERROR_GENERIC = -149;
-
// TCP/IP constants.
// Valid TCP/UDP port range is (0, 65535].
private static final int TCP_MIN_PORT = 0;
@@ -290,19 +224,13 @@
private static final long LOCATION_OFF_DELAY_THRESHOLD_WARN_MILLIS = 2 * 1000;
private static final long LOCATION_OFF_DELAY_THRESHOLD_ERROR_MILLIS = 15 * 1000;
- private static final String DOWNLOAD_EXTRA_WAKELOCK_KEY = "GnssLocationProviderPsdsDownload";
-
- // Set lower than the current ITAR limit of 600m/s to allow this to trigger even if GPS HAL
- // stops output right at 600m/s, depriving this of the information of a device that reaches
- // greater than 600m/s, and higher than the speed of sound to avoid impacting most use cases.
- private static final float ITAR_SPEED_LIMIT_METERS_PER_SECOND = 400.0F;
-
-
private final Object mLock = new Object();
private final Context mContext;
private final Handler mHandler;
+ private final GnssNative mGnssNative;
+
@GuardedBy("mLock")
private final ExponentialBackOff mPsdsBackOff = new ExponentialBackOff(RETRY_INTERVAL,
MAX_RETRY_INTERVAL);
@@ -315,7 +243,6 @@
private boolean mBatchingEnabled;
private boolean mShutdown;
- private boolean mNavigating;
private boolean mStarted;
private boolean mBatchingStarted;
private long mStartedChangedElapsedRealtime;
@@ -335,9 +262,6 @@
private final WorkSource mClientSource = new WorkSource();
- // capabilities reported through the top level IGnssCallback.hal
- private volatile int mTopHalCapabilities;
-
// true if PSDS is supported
private boolean mSupportsPsds;
@GuardedBy("mLock")
@@ -358,15 +282,7 @@
private boolean mSuplEsEnabled = false;
private final LocationExtras mLocationExtras = new LocationExtras();
- private final GnssStatusProvider mGnssStatusListenerHelper;
- private final GnssMeasurementsProvider mGnssMeasurementsProvider;
- private final GnssMeasurementCorrectionsProvider mGnssMeasurementCorrectionsProvider;
- private final GnssAntennaInfoProvider mGnssAntennaInfoProvider;
- private final GnssNavigationMessageProvider mGnssNavigationMessageProvider;
- private final GnssPowerIndicationProvider mGnssPowerIndicationProvider;
private final NtpTimeHelper mNtpTimeHelper;
- private final GnssGeofenceProvider mGnssGeofenceProvider;
- private final GnssCapabilitiesProvider mGnssCapabilitiesProvider;
private final GnssSatelliteBlocklistHelper mGnssSatelliteBlocklistHelper;
// Available only on GNSS HAL 2.0 implementations and later.
@@ -385,44 +301,12 @@
private final AppOpsManager mAppOps;
private final IBatteryStats mBatteryStats;
- private GeofenceHardwareImpl mGeofenceHardwareImpl;
-
- // Volatile for simple inter-thread sync on these values.
- private volatile int mHardwareYear = 0;
- private volatile String mHardwareModelName;
-
- private volatile boolean mItarSpeedLimitExceeded = false;
-
@GuardedBy("mLock")
private final ArrayList<Runnable> mFlushListeners = new ArrayList<>(0);
// GNSS Metrics
private final GnssMetrics mGnssMetrics;
- public GnssStatusProvider getGnssStatusProvider() {
- return mGnssStatusListenerHelper;
- }
-
- public IGpsGeofenceHardware getGpsGeofenceProxy() {
- return mGnssGeofenceProvider;
- }
-
- public GnssMeasurementsProvider getGnssMeasurementsProvider() {
- return mGnssMeasurementsProvider;
- }
-
- public GnssMeasurementCorrectionsProvider getGnssMeasurementCorrectionsProvider() {
- return mGnssMeasurementCorrectionsProvider;
- }
-
- public GnssAntennaInfoProvider getGnssAntennaInfoProvider() {
- return mGnssAntennaInfoProvider;
- }
-
- public GnssNavigationMessageProvider getGnssNavigationMessageProvider() {
- return mGnssNavigationMessageProvider;
- }
-
/**
* Implements {@link GnssSatelliteBlocklistCallback#onUpdateSatelliteBlocklist}.
*/
@@ -486,20 +370,23 @@
}
}
- public GnssLocationProvider(Context context, Injector injector) {
- super(FgThread.getExecutor(), CallerIdentity.fromContext(context));
+ public GnssLocationProvider(Context context, Injector injector, GnssNative gnssNative,
+ GnssMetrics gnssMetrics) {
+ super(FgThread.getExecutor(), CallerIdentity.fromContext(context), PROPERTIES);
mContext = context;
+ mGnssNative = gnssNative;
+ mGnssMetrics = gnssMetrics;
// Create a wake lock
PowerManager powerManager = Objects.requireNonNull(
mContext.getSystemService(PowerManager.class));
- mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
+ mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "*location*:" + TAG);
mWakeLock.setReferenceCounted(true);
// Create a separate wake lock for psds downloader as it may be released due to timeout.
mDownloadPsdsWakeLock = powerManager.newWakeLock(
- PowerManager.PARTIAL_WAKE_LOCK, DOWNLOAD_EXTRA_WAKELOCK_KEY);
+ PowerManager.PARTIAL_WAKE_LOCK, "*location*:PsdsDownload");
mDownloadPsdsWakeLock.setReferenceCounted(true);
mAlarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);
@@ -519,8 +406,7 @@
// relative long time, so the ctor() is kept to create objects needed by this instance,
// while IO initialization and registration is delegated to our internal handler
// this approach is just fine because events are posted to our handler anyway
- mGnssConfiguration = new GnssConfiguration(mContext);
- mGnssCapabilitiesProvider = new GnssCapabilitiesProvider();
+ mGnssConfiguration = mGnssNative.getConfiguration();
// Create a GPS net-initiated handler (also needed by handleInitialize)
mNIHandler = new GpsNetInitiatedHandler(context,
mNetInitiatedListener,
@@ -530,22 +416,21 @@
mNetworkConnectivityHandler = new GnssNetworkConnectivityHandler(context,
GnssLocationProvider.this::onNetworkAvailable, mHandler.getLooper(), mNIHandler);
- mGnssStatusListenerHelper = new GnssStatusProvider(injector);
- mGnssMeasurementsProvider = new GnssMeasurementsProvider(injector);
- mGnssMeasurementCorrectionsProvider = new GnssMeasurementCorrectionsProvider(mHandler);
- mGnssAntennaInfoProvider = new GnssAntennaInfoProvider(injector);
- mGnssNavigationMessageProvider = new GnssNavigationMessageProvider(injector);
- mGnssPowerIndicationProvider = new GnssPowerIndicationProvider();
-
- mGnssMetrics = new GnssMetrics(mContext, mBatteryStats);
mNtpTimeHelper = new NtpTimeHelper(mContext, mHandler.getLooper(), this);
mGnssSatelliteBlocklistHelper =
new GnssSatelliteBlocklistHelper(mContext,
mHandler.getLooper(), this);
- mGnssGeofenceProvider = new GnssGeofenceProvider();
- setProperties(PROPERTIES);
setAllowed(true);
+
+ mGnssNative.addBaseCallbacks(this);
+ mGnssNative.addLocationCallbacks(this);
+ mGnssNative.addSvStatusCallbacks(this);
+ mGnssNative.setAGpsCallbacks(this);
+ mGnssNative.setPsdsCallbacks(this);
+ mGnssNative.setNotificationCallbacks(this);
+ mGnssNative.setLocationRequestCallbacks(this);
+ mGnssNative.setTimeCallbacks(this);
}
/** Called when system is ready. */
@@ -575,12 +460,7 @@
}
private void handleInitialize() {
- // it *appears* that native_init() needs to be called at least once before invoking any
- // other gnss methods, so we cycle once on initialization.
- native_init();
- native_cleanup();
-
- if (native_is_gnss_visibility_control_supported()) {
+ if (mGnssNative.isGnssVisibilityControlSupported()) {
mGnssVisibilityControl = new GnssVisibilityControl(mContext, mHandler.getLooper(),
mNIHandler);
}
@@ -616,7 +496,7 @@
// permanently passively listen to all network locations
LocationManager locationManager = Objects.requireNonNull(
mContext.getSystemService(LocationManager.class));
- if (locationManager.getProvider(LocationManager.NETWORK_PROVIDER) != null) {
+ if (locationManager.getAllProviders().contains(LocationManager.NETWORK_PROVIDER)) {
locationManager.requestLocationUpdates(
LocationManager.NETWORK_PROVIDER,
new LocationRequest.Builder(LocationRequest.PASSIVE_INTERVAL)
@@ -635,7 +515,7 @@
*/
@Override
public void injectTime(long time, long timeReference, int uncertainty) {
- native_inject_time(time, timeReference, uncertainty);
+ mGnssNative.injectTime(time, timeReference, uncertainty);
}
/**
@@ -647,7 +527,7 @@
if (mSupportsPsds) {
synchronized (mLock) {
for (int psdsType : mPendingDownloadPsdsTypes) {
- downloadPsdsData(psdsType);
+ sendMessage(DOWNLOAD_PSDS_DATA, psdsType, null);
}
mPendingDownloadPsdsTypes.clear();
}
@@ -724,38 +604,7 @@
return;
}
- int gnssLocationFlags = LOCATION_HAS_LAT_LONG
- | (location.hasAltitude() ? LOCATION_HAS_ALTITUDE : 0)
- | (location.hasSpeed() ? LOCATION_HAS_SPEED : 0)
- | (location.hasBearing() ? LOCATION_HAS_BEARING : 0)
- | (location.hasAccuracy() ? LOCATION_HAS_HORIZONTAL_ACCURACY : 0)
- | (location.hasVerticalAccuracy() ? LOCATION_HAS_VERTICAL_ACCURACY : 0)
- | (location.hasSpeedAccuracy() ? LOCATION_HAS_SPEED_ACCURACY : 0)
- | (location.hasBearingAccuracy() ? LOCATION_HAS_BEARING_ACCURACY : 0);
-
- double latitudeDegrees = location.getLatitude();
- double longitudeDegrees = location.getLongitude();
- double altitudeMeters = location.getAltitude();
- float speedMetersPerSec = location.getSpeed();
- float bearingDegrees = location.getBearing();
- float horizontalAccuracyMeters = location.getAccuracy();
- float verticalAccuracyMeters = location.getVerticalAccuracyMeters();
- float speedAccuracyMetersPerSecond = location.getSpeedAccuracyMetersPerSecond();
- float bearingAccuracyDegrees = location.getBearingAccuracyDegrees();
- long timestamp = location.getTime();
-
- int elapsedRealtimeFlags = ELAPSED_REALTIME_HAS_TIMESTAMP_NS
- | (location.hasElapsedRealtimeUncertaintyNanos()
- ? ELAPSED_REALTIME_HAS_TIME_UNCERTAINTY_NS : 0);
- long elapsedRealtimeNanos = location.getElapsedRealtimeNanos();
- double elapsedRealtimeUncertaintyNanos = location.getElapsedRealtimeUncertaintyNanos();
-
- native_inject_best_location(
- gnssLocationFlags, latitudeDegrees, longitudeDegrees,
- altitudeMeters, speedMetersPerSec, bearingDegrees,
- horizontalAccuracyMeters, verticalAccuracyMeters,
- speedAccuracyMetersPerSecond, bearingAccuracyDegrees, timestamp,
- elapsedRealtimeFlags, elapsedRealtimeNanos, elapsedRealtimeUncertaintyNanos);
+ mGnssNative.injectBestLocation(location);
}
/** Returns true if the location request is too frequent. */
@@ -789,7 +638,7 @@
if (data != null) {
mHandler.post(() -> {
if (DEBUG) Log.d(TAG, "calling native_inject_psds_data");
- native_inject_psds_data(data, data.length, psdsType);
+ mGnssNative.injectPsdsData(data, data.length, psdsType);
synchronized (mLock) {
mPsdsBackOff.reset();
}
@@ -824,9 +673,8 @@
}
private void injectLocation(Location location) {
- if (location.hasAccuracy() && !location.isFromMockProvider()) {
- native_inject_location(location.getLatitude(), location.getLongitude(),
- location.getAccuracy());
+ if (!location.isFromMockProvider()) {
+ mGnssNative.injectLocation(location);
}
}
@@ -836,7 +684,7 @@
if (mSuplServerHost != null
&& mSuplServerPort > TCP_MIN_PORT
&& mSuplServerPort <= TCP_MAX_PORT) {
- native_set_agps_server(GnssNetworkConnectivityHandler.AGPS_TYPE_SUPL,
+ mGnssNative.setAgpsServer(GnssNetworkConnectivityHandler.AGPS_TYPE_SUPL,
mSuplServerHost, mSuplServerPort);
}
}
@@ -852,16 +700,16 @@
if (agpsEnabled) {
int suplMode = mGnssConfiguration.getSuplMode(0);
if (suplMode == 0) {
- return GPS_POSITION_MODE_STANDALONE;
+ return GNSS_POSITION_MODE_STANDALONE;
}
// MS-Based is the preferred mode for Assisted-GPS position computation, so we favor
// such mode when it is available
- if (hasCapability(GPS_CAPABILITY_MSB) && (suplMode & AGPS_SUPL_MODE_MSB) != 0) {
- return GPS_POSITION_MODE_MS_BASED;
+ if (mGnssNative.getCapabilities().hasMsb() && (suplMode & AGPS_SUPL_MODE_MSB) != 0) {
+ return GNSS_POSITION_MODE_MS_BASED;
}
}
- return GPS_POSITION_MODE_STANDALONE;
+ return GNSS_POSITION_MODE_STANDALONE;
}
private void setGpsEnabled(boolean enabled) {
@@ -873,23 +721,23 @@
private void handleEnable() {
if (DEBUG) Log.d(TAG, "handleEnable");
- boolean inited = native_init();
+ boolean inited = mGnssNative.init();
if (inited) {
setGpsEnabled(true);
- mSupportsPsds = native_supports_psds();
+ mSupportsPsds = mGnssNative.isPsdsSupported();
// TODO: remove the following native calls if we can make sure they are redundant.
if (mSuplServerHost != null) {
- native_set_agps_server(GnssNetworkConnectivityHandler.AGPS_TYPE_SUPL,
+ mGnssNative.setAgpsServer(GnssNetworkConnectivityHandler.AGPS_TYPE_SUPL,
mSuplServerHost, mSuplServerPort);
}
if (mC2KServerHost != null) {
- native_set_agps_server(GnssNetworkConnectivityHandler.AGPS_TYPE_C2K,
+ mGnssNative.setAgpsServer(GnssNetworkConnectivityHandler.AGPS_TYPE_C2K,
mC2KServerHost, mC2KServerPort);
}
- mBatchingEnabled = native_init_batching() && native_get_batch_size() > 1;
+ mBatchingEnabled = mGnssNative.initBatching() && mGnssNative.getBatchSize() > 1;
if (mGnssVisibilityControl != null) {
mGnssVisibilityControl.onGpsEnabledChanged(/* isEnabled= */ true);
}
@@ -911,8 +759,8 @@
mGnssVisibilityControl.onGpsEnabledChanged(/* isEnabled= */ false);
}
// do this before releasing wakelock
- native_cleanup_batching();
- native_cleanup();
+ mGnssNative.cleanupBatching();
+ mGnssNative.cleanup();
}
private void updateEnabled() {
@@ -951,7 +799,7 @@
* minimum size guaranteed to be available for batching operations.
*/
public int getBatchSize() {
- return native_get_batch_size();
+ return mGnssNative.getBatchSize();
}
@Override
@@ -965,7 +813,7 @@
if (!added) {
listener.run();
} else {
- native_flush_batch();
+ mGnssNative.flushBatch();
}
}
@@ -1009,9 +857,9 @@
} else {
stopBatching();
- if (mStarted && hasCapability(GPS_CAPABILITY_SCHEDULING)) {
+ if (mStarted && mGnssNative.getCapabilities().hasScheduling()) {
// change period and/or lowPowerMode
- if (!setPositionMode(mPositionMode, GPS_POSITION_RECURRENCE_PERIODIC,
+ if (!setPositionMode(mPositionMode, GNSS_POSITION_RECURRENCE_PERIODIC,
mFixInterval, mProviderRequest.isLowPower())) {
Log.e(TAG, "set_position_mode failed in updateRequirements");
}
@@ -1045,8 +893,8 @@
return true;
}
- boolean result = native_set_position_mode(mode, recurrence, minInterval,
- 0, 0, lowPowerMode);
+ boolean result = mGnssNative.setPositionMode(mode, recurrence, minInterval, 0, 0,
+ lowPowerMode);
if (result) {
mLastPositionMode = positionMode;
} else {
@@ -1125,11 +973,11 @@
requestUtcTime();
} else if ("force_psds_injection".equals(command)) {
if (mSupportsPsds) {
- downloadPsdsData(/* psdsType= */
- GnssPsdsDownloader.LONG_TERM_PSDS_SERVER_INDEX);
+ sendMessage(DOWNLOAD_PSDS_DATA, GnssPsdsDownloader.LONG_TERM_PSDS_SERVER_INDEX,
+ null);
}
} else if ("request_power_stats".equals(command)) {
- GnssPowerIndicationProvider.requestPowerStats();
+ mGnssNative.requestPowerStats();
} else {
Log.w(TAG, "sendExtraCommand: unknown command " + command);
}
@@ -1139,26 +987,26 @@
int flags;
if (extras == null) {
- flags = GPS_DELETE_ALL;
+ flags = GNSS_AIDING_TYPE_ALL;
} else {
flags = 0;
- if (extras.getBoolean("ephemeris")) flags |= GPS_DELETE_EPHEMERIS;
- if (extras.getBoolean("almanac")) flags |= GPS_DELETE_ALMANAC;
- if (extras.getBoolean("position")) flags |= GPS_DELETE_POSITION;
- if (extras.getBoolean("time")) flags |= GPS_DELETE_TIME;
- if (extras.getBoolean("iono")) flags |= GPS_DELETE_IONO;
- if (extras.getBoolean("utc")) flags |= GPS_DELETE_UTC;
- if (extras.getBoolean("health")) flags |= GPS_DELETE_HEALTH;
- if (extras.getBoolean("svdir")) flags |= GPS_DELETE_SVDIR;
- if (extras.getBoolean("svsteer")) flags |= GPS_DELETE_SVSTEER;
- if (extras.getBoolean("sadata")) flags |= GPS_DELETE_SADATA;
- if (extras.getBoolean("rti")) flags |= GPS_DELETE_RTI;
- if (extras.getBoolean("celldb-info")) flags |= GPS_DELETE_CELLDB_INFO;
- if (extras.getBoolean("all")) flags |= GPS_DELETE_ALL;
+ if (extras.getBoolean("ephemeris")) flags |= GNSS_AIDING_TYPE_EPHEMERIS;
+ if (extras.getBoolean("almanac")) flags |= GNSS_AIDING_TYPE_ALMANAC;
+ if (extras.getBoolean("position")) flags |= GNSS_AIDING_TYPE_POSITION;
+ if (extras.getBoolean("time")) flags |= GNSS_AIDING_TYPE_TIME;
+ if (extras.getBoolean("iono")) flags |= GNSS_AIDING_TYPE_IONO;
+ if (extras.getBoolean("utc")) flags |= GNSS_AIDING_TYPE_UTC;
+ if (extras.getBoolean("health")) flags |= GNSS_AIDING_TYPE_HEALTH;
+ if (extras.getBoolean("svdir")) flags |= GNSS_AIDING_TYPE_SVDIR;
+ if (extras.getBoolean("svsteer")) flags |= GNSS_AIDING_TYPE_SVSTEER;
+ if (extras.getBoolean("sadata")) flags |= GNSS_AIDING_TYPE_SADATA;
+ if (extras.getBoolean("rti")) flags |= GNSS_AIDING_TYPE_RTI;
+ if (extras.getBoolean("celldb-info")) flags |= GNSS_AIDING_TYPE_CELLDB_INFO;
+ if (extras.getBoolean("all")) flags |= GNSS_AIDING_TYPE_ALL;
}
if (flags != 0) {
- native_delete_aiding_data(flags);
+ mGnssNative.deleteAidingData(flags);
}
}
@@ -1168,13 +1016,7 @@
mTimeToFirstFix = 0;
mLastFixTime = 0;
setStarted(true);
- mPositionMode = GPS_POSITION_MODE_STANDALONE;
- // Notify about suppressed output, if speed limit was previously exceeded.
- // Elsewhere, we check again with every speed output reported.
- if (mItarSpeedLimitExceeded) {
- Log.i(TAG, "startNavigating with ITAR limit in place. Output limited "
- + "until slow enough speed reported.");
- }
+ mPositionMode = GNSS_POSITION_MODE_STANDALONE;
boolean agpsEnabled =
(Settings.Global.getInt(mContext.getContentResolver(),
@@ -1185,13 +1027,13 @@
String mode;
switch (mPositionMode) {
- case GPS_POSITION_MODE_STANDALONE:
+ case GNSS_POSITION_MODE_STANDALONE:
mode = "standalone";
break;
- case GPS_POSITION_MODE_MS_ASSISTED:
+ case GNSS_POSITION_MODE_MS_ASSISTED:
mode = "MS_ASSISTED";
break;
- case GPS_POSITION_MODE_MS_BASED:
+ case GNSS_POSITION_MODE_MS_BASED:
mode = "MS_BASED";
break;
default:
@@ -1201,14 +1043,14 @@
Log.d(TAG, "setting position_mode to " + mode);
}
- int interval = (hasCapability(GPS_CAPABILITY_SCHEDULING) ? mFixInterval : 1000);
- if (!setPositionMode(mPositionMode, GPS_POSITION_RECURRENCE_PERIODIC,
+ int interval = mGnssNative.getCapabilities().hasScheduling() ? mFixInterval : 1000;
+ if (!setPositionMode(mPositionMode, GNSS_POSITION_RECURRENCE_PERIODIC,
interval, mProviderRequest.isLowPower())) {
setStarted(false);
Log.e(TAG, "set_position_mode failed in startNavigating()");
return;
}
- if (!native_start()) {
+ if (!mGnssNative.start()) {
setStarted(false);
Log.e(TAG, "native_start failed in startNavigating()");
return;
@@ -1217,7 +1059,7 @@
// reset SV count to zero
mLocationExtras.reset();
mFixRequestTime = SystemClock.elapsedRealtime();
- if (!hasCapability(GPS_CAPABILITY_SCHEDULING)) {
+ if (!mGnssNative.getCapabilities().hasScheduling()) {
// set timer to give up if we do not receive a fix within NO_FIX_TIMEOUT
// and our fix interval is not short
if (mFixInterval >= NO_FIX_TIMEOUT) {
@@ -1233,7 +1075,7 @@
if (DEBUG) Log.d(TAG, "stopNavigating");
if (mStarted) {
setStarted(false);
- native_stop();
+ mGnssNative.stop();
mLastFixTime = 0;
// native_stop() may reset the position mode in hardware.
mLastPositionMode = null;
@@ -1249,7 +1091,7 @@
if (DEBUG) {
Log.d(TAG, "startBatching " + mFixInterval);
}
- if (native_start_batch(MILLISECONDS.toNanos(mFixInterval), true)) {
+ if (mGnssNative.startBatch(MILLISECONDS.toNanos(mFixInterval), true)) {
mBatchingStarted = true;
} else {
Log.e(TAG, "native_start_batch failed in startBatching()");
@@ -1259,7 +1101,7 @@
private void stopBatching() {
if (DEBUG) Log.d(TAG, "stopBatching");
if (mBatchingStarted) {
- native_stop_batch();
+ mGnssNative.stopBatch();
mBatchingStarted = false;
}
}
@@ -1279,28 +1121,7 @@
mWakeupListener, mHandler);
}
- private boolean hasCapability(int capability) {
- return (mTopHalCapabilities & capability) != 0;
- }
-
- void reportLocation(boolean hasLatLong, Location location) {
- sendMessage(REPORT_LOCATION, hasLatLong ? 1 : 0, location);
- }
-
private void handleReportLocation(boolean hasLatLong, Location location) {
- if (location.hasSpeed()) {
- mItarSpeedLimitExceeded = location.getSpeed() > ITAR_SPEED_LIMIT_METERS_PER_SECOND;
- }
-
- if (mItarSpeedLimitExceeded) {
- Log.i(TAG, "Hal reported a speed in excess of ITAR limit."
- + " GPS/GNSS Navigation output blocked.");
- if (mStarted) {
- mGnssMetrics.logReceivedLocationStatus(false);
- }
- return; // No output of location allowed
- }
-
if (VERBOSE) Log.v(TAG, "reportLocation " + location.toString());
location.setExtras(mLocationExtras.getBundle());
@@ -1343,9 +1164,6 @@
if (mStarted) {
mGnssMetrics.logTimeToFirstFixMilliSecs(mTimeToFirstFix);
}
-
- // notify status listeners
- mGnssStatusListenerHelper.onFirstFix(mTimeToFirstFix);
}
if (mStarted) {
@@ -1353,51 +1171,19 @@
// spend too much power searching for a location, when the requested update rate is
// slow.
// As we just recievied a location, we'll cancel that timer.
- if (!hasCapability(GPS_CAPABILITY_SCHEDULING) && mFixInterval < NO_FIX_TIMEOUT) {
+ if (!mGnssNative.getCapabilities().hasScheduling() && mFixInterval < NO_FIX_TIMEOUT) {
mAlarmManager.cancel(mTimeoutListener);
}
}
- if (!hasCapability(GPS_CAPABILITY_SCHEDULING) && mStarted
+ if (!mGnssNative.getCapabilities().hasScheduling() && mStarted
&& mFixInterval > GPS_POLLING_THRESHOLD_INTERVAL) {
if (DEBUG) Log.d(TAG, "got fix, hibernating");
hibernate();
}
}
- void reportStatus(int status) {
- if (DEBUG) Log.v(TAG, "reportStatus status: " + status);
-
- boolean wasNavigating = mNavigating;
- switch (status) {
- case GPS_STATUS_SESSION_BEGIN:
- mNavigating = true;
- break;
- case GPS_STATUS_ENGINE_ON:
- break;
- case GPS_STATUS_SESSION_END:
- // fall through
- case GPS_STATUS_ENGINE_OFF:
- mNavigating = false;
- break;
- }
-
- if (wasNavigating != mNavigating) {
- mGnssStatusListenerHelper.onStatusChanged(mNavigating);
- }
- }
-
- void reportSvStatus(int svCount, int[] svidWithFlags, float[] cn0DbHzs,
- float[] elevations, float[] azimuths, float[] carrierFrequencies,
- float[] basebandCn0DbHzs) {
- sendMessage(REPORT_SV_STATUS, 0,
- GnssStatus.wrap(svCount, svidWithFlags, cn0DbHzs, elevations, azimuths,
- carrierFrequencies, basebandCn0DbHzs));
- }
-
private void handleReportSvStatus(GnssStatus gnssStatus) {
- mGnssStatusListenerHelper.onSvStatusChanged(gnssStatus);
-
// Log CN0 as part of GNSS metrics
mGnssMetrics.logCn0(gnssStatus);
@@ -1427,289 +1213,12 @@
mGnssMetrics.logSvStatus(gnssStatus);
}
- void reportAGpsStatus(int agpsType, int agpsStatus, byte[] suplIpAddr) {
- mNetworkConnectivityHandler.onReportAGpsStatus(agpsType, agpsStatus, suplIpAddr);
- }
-
- void reportNmea(long timestamp) {
- if (!mItarSpeedLimitExceeded) {
- int length = native_read_nmea(mNmeaBuffer, mNmeaBuffer.length);
- String nmea = new String(mNmeaBuffer, 0 /* offset */, length);
- mGnssStatusListenerHelper.onNmeaReceived(timestamp, nmea);
- }
- }
-
- void reportMeasurementData(GnssMeasurementsEvent event) {
- if (!mItarSpeedLimitExceeded) {
- // send to handler to allow native to return quickly
- mHandler.post(() -> mGnssMeasurementsProvider.onMeasurementsAvailable(event));
- }
- }
-
- void reportAntennaInfo(List<GnssAntennaInfo> antennaInfos) {
- mHandler.post(() -> mGnssAntennaInfoProvider.onGnssAntennaInfoAvailable(antennaInfos));
- }
-
- void reportNavigationMessage(GnssNavigationMessage event) {
- if (!mItarSpeedLimitExceeded) {
- // send to handler to allow native to return quickly
- mHandler.post(() -> mGnssNavigationMessageProvider.onNavigationMessageAvailable(event));
- }
- }
-
- void reportGnssPowerStats(GnssPowerStats powerStats) {
- mHandler.post(() -> mGnssPowerIndicationProvider.onGnssPowerStatsAvailable(powerStats));
- }
-
- void setTopHalCapabilities(int topHalCapabilities) {
- mHandler.post(() -> {
- mTopHalCapabilities = topHalCapabilities;
-
- if (hasCapability(GPS_CAPABILITY_ON_DEMAND_TIME)) {
- mNtpTimeHelper.enablePeriodicTimeInjection();
- requestUtcTime();
- }
-
- restartRequests();
-
- mGnssCapabilitiesProvider.setTopHalCapabilities(mTopHalCapabilities);
- });
- }
-
- void setSubHalMeasurementCorrectionsCapabilities(int subHalCapabilities) {
- mHandler.post(() -> {
- if (!mGnssMeasurementCorrectionsProvider.onCapabilitiesUpdated(subHalCapabilities)) {
- return;
- }
-
- mGnssCapabilitiesProvider.setSubHalMeasurementCorrectionsCapabilities(
- subHalCapabilities);
- });
- }
-
- /**
- * Sets the capabilities bits for IGnssPowerIndication HAL.
- *
- * These capabilities are defined in IGnssPowerIndicationCallback.aidl.
- */
- void setSubHalPowerIndicationCapabilities(int subHalCapabilities) {
- mHandler.post(() -> mGnssPowerIndicationProvider.onCapabilitiesUpdated(subHalCapabilities));
- }
-
- private void restartRequests() {
- Log.i(TAG, "restartRequests");
-
- restartLocationRequest();
- mGnssGeofenceProvider.resumeIfStarted();
- }
-
private void restartLocationRequest() {
if (DEBUG) Log.d(TAG, "restartLocationRequest");
setStarted(false);
updateRequirements();
}
- void setGnssYearOfHardware(final int yearOfHardware) {
- // mHardwareYear is simply set here, to be read elsewhere, and is volatile for safe sync
- if (DEBUG) Log.d(TAG, "setGnssYearOfHardware called with " + yearOfHardware);
- mHardwareYear = yearOfHardware;
- }
-
- void setGnssHardwareModelName(final String modelName) {
- // mHardwareModelName is simply set here, to be read elsewhere, and volatile for safe sync
- if (DEBUG) Log.d(TAG, "setGnssModelName called with " + modelName);
- mHardwareModelName = modelName;
- }
-
- void reportGnssServiceRestarted() {
- if (DEBUG) Log.d(TAG, "reportGnssServiceDied");
-
- // it *appears* that native_init() needs to be called at least once before invoking any
- // other gnss methods, so we cycle once on initialization.
- native_init();
- native_cleanup();
-
- // resend configuration into the restarted HAL service.
- reloadGpsProperties();
- if (isGpsEnabled()) {
- setGpsEnabled(false);
- updateEnabled();
- }
- }
-
- /**
- * Interface for GnssSystemInfo methods.
- */
- public interface GnssSystemInfoProvider {
- /**
- * Returns the year of underlying GPS hardware.
- */
- int getGnssYearOfHardware();
-
- /**
- * Returns the model name of underlying GPS hardware.
- */
- String getGnssHardwareModelName();
- }
-
- /**
- * @hide
- */
- public GnssSystemInfoProvider getGnssSystemInfoProvider() {
- return new GnssSystemInfoProvider() {
- @Override
- public int getGnssYearOfHardware() {
- return mHardwareYear;
- }
-
- @Override
- public String getGnssHardwareModelName() {
- return mHardwareModelName;
- }
- };
- }
-
- /**
- * Interface for GnssMetrics methods.
- */
- public interface GnssMetricsProvider {
- /**
- * Returns GNSS metrics as proto string
- */
- String getGnssMetricsAsProtoString();
- }
-
- /**
- * @hide
- */
- public GnssMetricsProvider getGnssMetricsProvider() {
- return mGnssMetrics::dumpGnssMetricsAsProtoString;
- }
-
- /**
- * @hide
- */
- public GnssCapabilitiesProvider getGnssCapabilitiesProvider() {
- return mGnssCapabilitiesProvider;
- }
-
- void reportLocationBatch(Location[] locations) {
- if (DEBUG) {
- Log.d(TAG, "Location batch of size " + locations.length + " reported");
- }
-
- Runnable[] listeners;
- synchronized (mLock) {
- listeners = mFlushListeners.toArray(new Runnable[0]);
- mFlushListeners.clear();
- }
-
- if (locations.length > 0) {
- reportLocation(LocationResult.create(Arrays.asList(locations)).validate());
- }
-
- for (Runnable listener : listeners) {
- listener.run();
- }
- }
-
- void downloadPsdsData(int psdsType) {
- if (DEBUG) Log.d(TAG, "downloadPsdsData. psdsType: " + psdsType);
- sendMessage(DOWNLOAD_PSDS_DATA, psdsType, null);
- }
-
- /**
- * Converts the GPS HAL status to the internal Geofence Hardware status.
- */
- private static int getGeofenceStatus(int status) {
- switch (status) {
- case GPS_GEOFENCE_OPERATION_SUCCESS:
- return GeofenceHardware.GEOFENCE_SUCCESS;
- case GPS_GEOFENCE_ERROR_GENERIC:
- return GeofenceHardware.GEOFENCE_FAILURE;
- case GPS_GEOFENCE_ERROR_ID_EXISTS:
- return GeofenceHardware.GEOFENCE_ERROR_ID_EXISTS;
- case GPS_GEOFENCE_ERROR_INVALID_TRANSITION:
- return GeofenceHardware.GEOFENCE_ERROR_INVALID_TRANSITION;
- case GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES:
- return GeofenceHardware.GEOFENCE_ERROR_TOO_MANY_GEOFENCES;
- case GPS_GEOFENCE_ERROR_ID_UNKNOWN:
- return GeofenceHardware.GEOFENCE_ERROR_ID_UNKNOWN;
- default:
- return -1;
- }
- }
-
- void reportGeofenceTransition(int geofenceId, Location location, int transition,
- long transitionTimestamp) {
- mHandler.post(() -> {
- if (mGeofenceHardwareImpl == null) {
- mGeofenceHardwareImpl = GeofenceHardwareImpl.getInstance(mContext);
- }
-
- mGeofenceHardwareImpl.reportGeofenceTransition(
- geofenceId,
- location,
- transition,
- transitionTimestamp,
- GeofenceHardware.MONITORING_TYPE_GPS_HARDWARE,
- FusedBatchOptions.SourceTechnologies.GNSS);
- });
- }
-
- void reportGeofenceStatus(int status, Location location) {
- mHandler.post(() -> {
- if (mGeofenceHardwareImpl == null) {
- mGeofenceHardwareImpl = GeofenceHardwareImpl.getInstance(mContext);
- }
- int monitorStatus = GeofenceHardware.MONITOR_CURRENTLY_UNAVAILABLE;
- if (status == GPS_GEOFENCE_AVAILABLE) {
- monitorStatus = GeofenceHardware.MONITOR_CURRENTLY_AVAILABLE;
- }
- mGeofenceHardwareImpl.reportGeofenceMonitorStatus(
- GeofenceHardware.MONITORING_TYPE_GPS_HARDWARE,
- monitorStatus,
- location,
- FusedBatchOptions.SourceTechnologies.GNSS);
- });
- }
-
- void reportGeofenceAddStatus(int geofenceId, int status) {
- mHandler.post(() -> {
- if (mGeofenceHardwareImpl == null) {
- mGeofenceHardwareImpl = GeofenceHardwareImpl.getInstance(mContext);
- }
- mGeofenceHardwareImpl.reportGeofenceAddStatus(geofenceId, getGeofenceStatus(status));
- });
- }
-
- void reportGeofenceRemoveStatus(int geofenceId, int status) {
- mHandler.post(() -> {
- if (mGeofenceHardwareImpl == null) {
- mGeofenceHardwareImpl = GeofenceHardwareImpl.getInstance(mContext);
- }
- mGeofenceHardwareImpl.reportGeofenceRemoveStatus(geofenceId, getGeofenceStatus(status));
- });
- }
-
- void reportGeofencePauseStatus(int geofenceId, int status) {
- mHandler.post(() -> {
- if (mGeofenceHardwareImpl == null) {
- mGeofenceHardwareImpl = GeofenceHardwareImpl.getInstance(mContext);
- }
- mGeofenceHardwareImpl.reportGeofencePauseStatus(geofenceId, getGeofenceStatus(status));
- });
- }
-
- void reportGeofenceResumeStatus(int geofenceId, int status) {
- mHandler.post(() -> {
- if (mGeofenceHardwareImpl == null) {
- mGeofenceHardwareImpl = GeofenceHardwareImpl.getInstance(mContext);
- }
- mGeofenceHardwareImpl.reportGeofenceResumeStatus(geofenceId, getGeofenceStatus(status));
- });
- }
-
//=============================================================
// NI Client support
//=============================================================
@@ -1723,7 +1232,7 @@
Log.d(TAG, "sendNiResponse, notifId: " + notificationId
+ ", response: " + userResponse);
}
- native_send_ni_response(notificationId, userResponse);
+ mGnssNative.sendNiResponse(notificationId, userResponse);
FrameworkStatsLog.write(FrameworkStatsLog.GNSS_NI_EVENT_REPORTED,
FrameworkStatsLog.GNSS_NI_EVENT_REPORTED__EVENT_TYPE__NI_RESPONSE,
@@ -1751,7 +1260,7 @@
}
/** Reports a NI notification. */
- void reportNiNotification(int notificationId, int niType, int notifyFlags, int timeout,
+ private void reportNiNotification(int notificationId, int niType, int notifyFlags, int timeout,
int defaultResponse, String requestorId, String text, int requestorIdEncoding,
int textEncoding) {
Log.i(TAG, "reportNiNotification: entered");
@@ -1800,52 +1309,12 @@
/* userResponse= */ 0);
}
- /**
- * We should be careful about receiving null string from the TelephonyManager,
- * because sending null String to JNI function would cause a crash.
- */
- void requestSetID(int flags) {
- TelephonyManager phone = (TelephonyManager)
- mContext.getSystemService(Context.TELEPHONY_SERVICE);
- int type = AGPS_SETID_TYPE_NONE;
- String setId = null;
-
- int ddSubId = SubscriptionManager.getDefaultDataSubscriptionId();
- if (SubscriptionManager.isValidSubscriptionId(ddSubId)) {
- phone = phone.createForSubscriptionId(ddSubId);
- }
- if ((flags & AGPS_RIL_REQUEST_SETID_IMSI) == AGPS_RIL_REQUEST_SETID_IMSI) {
- setId = phone.getSubscriberId();
- if (setId != null) {
- // This means the framework has the SIM card.
- type = AGPS_SETID_TYPE_IMSI;
- }
- } else if ((flags & AGPS_RIL_REQUEST_SETID_MSISDN) == AGPS_RIL_REQUEST_SETID_MSISDN) {
- setId = phone.getLine1Number();
- if (setId != null) {
- // This means the framework has the SIM card.
- type = AGPS_SETID_TYPE_MSISDN;
- }
- }
-
- native_agps_set_id(type, (setId == null) ? "" : setId);
- }
-
- void requestLocation(boolean independentFromGnss, boolean isUserEmergency) {
- if (DEBUG) {
- Log.d(TAG, "requestLocation. independentFromGnss: " + independentFromGnss
- + ", isUserEmergency: "
- + isUserEmergency);
- }
- sendMessage(REQUEST_LOCATION, independentFromGnss ? 1 : 0, isUserEmergency);
- }
-
- void requestUtcTime() {
+ private void requestUtcTime() {
if (DEBUG) Log.d(TAG, "utcTimeRequest");
sendMessage(INJECT_NTP_TIME, 0, null);
}
- void requestRefLocation() {
+ private void requestRefLocation() {
TelephonyManager phone = (TelephonyManager)
mContext.getSystemService(Context.TELEPHONY_SERVICE);
final int phoneType = phone.getPhoneType();
@@ -1866,8 +1335,8 @@
} else {
type = AGPS_REF_LOCATION_TYPE_GSM_CELLID;
}
- native_agps_set_ref_location_cellid(type, mcc, mnc,
- gsm_cell.getLac(), gsm_cell.getCid());
+ mGnssNative.setAgpsReferenceLocationCellId(type, mcc, mnc, gsm_cell.getLac(),
+ gsm_cell.getCid());
} else {
Log.e(TAG, "Error getting cell location info.");
}
@@ -1876,21 +1345,6 @@
}
}
- // Implements method nfwNotifyCb() in IGnssVisibilityControlCallback.hal.
- void reportNfwNotification(String proxyAppPackageName, byte protocolStack,
- String otherProtocolStackName, byte requestor, String requestorId, byte responseType,
- boolean inEmergencyMode, boolean isCachedLocation) {
- if (mGnssVisibilityControl == null) {
- Log.e(TAG, "reportNfwNotification: mGnssVisibilityControl is not initialized.");
- return;
- }
-
- mGnssVisibilityControl.reportNfwNotification(proxyAppPackageName, protocolStack,
- otherProtocolStackName, requestor, requestorId, responseType, inEmergencyMode,
- isCachedLocation);
- }
-
- // Implements method isInEmergencySession() in IGnssVisibilityControlCallback.hal.
boolean isInEmergencySession() {
return mNIHandler.getInEmergency();
}
@@ -1988,97 +1442,143 @@
pw.println("mBatchingStarted=" + mBatchingStarted);
pw.println("mBatchSize=" + getBatchSize());
pw.println("mFixInterval=" + mFixInterval);
- mGnssPowerIndicationProvider.dump(fd, pw, args);
- pw.print("mTopHalCapabilities=0x" + Integer.toHexString(mTopHalCapabilities) + " ( ");
- if (hasCapability(GPS_CAPABILITY_SCHEDULING)) pw.print("SCHEDULING ");
- if (hasCapability(GPS_CAPABILITY_MSB)) pw.print("MSB ");
- if (hasCapability(GPS_CAPABILITY_MSA)) pw.print("MSA ");
- if (hasCapability(GPS_CAPABILITY_SINGLE_SHOT)) pw.print("SINGLE_SHOT ");
- if (hasCapability(GPS_CAPABILITY_ON_DEMAND_TIME)) pw.print("ON_DEMAND_TIME ");
- if (hasCapability(GPS_CAPABILITY_GEOFENCING)) pw.print("GEOFENCING ");
- if (hasCapability(GPS_CAPABILITY_MEASUREMENTS)) pw.print("MEASUREMENTS ");
- if (hasCapability(GPS_CAPABILITY_NAV_MESSAGES)) pw.print("NAV_MESSAGES ");
- if (hasCapability(GPS_CAPABILITY_LOW_POWER_MODE)) pw.print("LOW_POWER_MODE ");
- if (hasCapability(GPS_CAPABILITY_SATELLITE_BLOCKLIST)) pw.print("SATELLITE_BLOCKLIST ");
- if (hasCapability(GPS_CAPABILITY_MEASUREMENT_CORRECTIONS)) {
- pw.print("MEASUREMENT_CORRECTIONS ");
- }
- if (hasCapability(GPS_CAPABILITY_ANTENNA_INFO)) pw.print("ANTENNA_INFO ");
- pw.println(")");
- if (hasCapability(GPS_CAPABILITY_MEASUREMENT_CORRECTIONS)) {
- pw.println("SubHal=MEASUREMENT_CORRECTIONS["
- + mGnssMeasurementCorrectionsProvider.toStringCapabilities() + "]");
- }
pw.print(mGnssMetrics.dumpGnssMetricsAsText());
if (dumpAll) {
pw.println("native internal state: ");
- pw.println(" " + native_get_internal_state());
+ pw.println(" " + mGnssNative.getInternalState());
}
}
- // preallocated to avoid memory allocation in reportNmea()
- private final byte[] mNmeaBuffer = new byte[120];
+ @Override
+ public void onHalRestarted() {
+ reloadGpsProperties();
+ if (isGpsEnabled()) {
+ setGpsEnabled(false);
+ updateEnabled();
+ }
+ }
- private static native boolean native_is_gnss_visibility_control_supported();
+ @Override
+ public void onCapabilitiesChanged(GnssCapabilities oldCapabilities,
+ GnssCapabilities newCapabilities) {
+ mHandler.post(() -> {
+ if (mGnssNative.getCapabilities().hasOnDemandTime()) {
+ mNtpTimeHelper.enablePeriodicTimeInjection();
+ requestUtcTime();
+ }
- private native boolean native_init();
+ restartLocationRequest();
+ });
+ }
- private native void native_cleanup();
+ @Override
+ public void onReportLocation(boolean hasLatLong, Location location) {
+ sendMessage(REPORT_LOCATION, hasLatLong ? 1 : 0, location);
+ }
- private native boolean native_set_position_mode(int mode, int recurrence, int minInterval,
- int preferredAccuracy, int preferredTime, boolean lowPowerMode);
+ @Override
+ public void onReportLocations(Location[] locations) {
+ if (DEBUG) {
+ Log.d(TAG, "Location batch of size " + locations.length + " reported");
+ }
- private native boolean native_start();
+ Runnable[] listeners;
+ synchronized (mLock) {
+ listeners = mFlushListeners.toArray(new Runnable[0]);
+ mFlushListeners.clear();
+ }
- private native boolean native_stop();
+ if (locations.length > 0) {
+ reportLocation(LocationResult.create(Arrays.asList(locations)).validate());
+ }
- private native void native_delete_aiding_data(int flags);
+ for (Runnable listener : listeners) {
+ listener.run();
+ }
+ }
- private native int native_read_nmea(byte[] buffer, int bufferSize);
+ @Override
+ public void onReportSvStatus(GnssStatus gnssStatus) {
+ sendMessage(REPORT_SV_STATUS, 0, gnssStatus);
+ }
- private native void native_inject_best_location(
- int gnssLocationFlags, double latitudeDegrees, double longitudeDegrees,
- double altitudeMeters, float speedMetersPerSec, float bearingDegrees,
- float horizontalAccuracyMeters, float verticalAccuracyMeters,
- float speedAccuracyMetersPerSecond, float bearingAccuracyDegrees,
- long timestamp, int elapsedRealtimeFlags, long elapsedRealtimeNanos,
- double elapsedRealtimeUncertaintyNanos);
+ @Override
+ public void onReportAGpsStatus(int agpsType, int agpsStatus, byte[] suplIpAddr) {
+ mNetworkConnectivityHandler.onReportAGpsStatus(agpsType, agpsStatus, suplIpAddr);
+ }
- private native void native_inject_location(double latitude, double longitude, float accuracy);
+ @Override
+ public void onRequestPsdsDownload(int psdsType) {
+ sendMessage(DOWNLOAD_PSDS_DATA, psdsType, null);
+ }
- // PSDS Support
- private native void native_inject_time(long time, long timeReference, int uncertainty);
+ @Override
+ public void onReportNiNotification(int notificationId, int niType, int notifyFlags,
+ int timeout, int defaultResponse, String requestorId, String text,
+ int requestorIdEncoding, int textEncoding) {
+ reportNiNotification(notificationId, niType, notifyFlags, timeout,
+ defaultResponse, requestorId, text, requestorIdEncoding, textEncoding);
+ }
- private native boolean native_supports_psds();
+ @Override
+ public void onRequestSetID(@GnssNative.AGpsCallbacks.AgpsSetIdFlags int flags) {
+ TelephonyManager phone = (TelephonyManager)
+ mContext.getSystemService(Context.TELEPHONY_SERVICE);
+ int type = AGPS_SETID_TYPE_NONE;
+ String setId = null;
- private native void native_inject_psds_data(byte[] data, int length, int psdsType);
+ int ddSubId = SubscriptionManager.getDefaultDataSubscriptionId();
+ if (SubscriptionManager.isValidSubscriptionId(ddSubId)) {
+ phone = phone.createForSubscriptionId(ddSubId);
+ }
+ if ((flags & AGPS_REQUEST_SETID_IMSI) == AGPS_REQUEST_SETID_IMSI) {
+ setId = phone.getSubscriberId();
+ if (setId != null) {
+ // This means the framework has the SIM card.
+ type = AGPS_SETID_TYPE_IMSI;
+ }
+ } else if ((flags & AGPS_REQUEST_SETID_MSISDN) == AGPS_REQUEST_SETID_MSISDN) {
+ setId = phone.getLine1Number();
+ if (setId != null) {
+ // This means the framework has the SIM card.
+ type = AGPS_SETID_TYPE_MSISDN;
+ }
+ }
- // DEBUG Support
- private native String native_get_internal_state();
+ mGnssNative.setAgpsSetId(type, (setId == null) ? "" : setId);
+ }
- // AGPS Support
- private native void native_agps_ni_message(byte[] msg, int length);
+ @Override
+ public void onRequestLocation(boolean independentFromGnss, boolean isUserEmergency) {
+ if (DEBUG) {
+ Log.d(TAG, "requestLocation. independentFromGnss: " + independentFromGnss
+ + ", isUserEmergency: "
+ + isUserEmergency);
+ }
+ sendMessage(REQUEST_LOCATION, independentFromGnss ? 1 : 0, isUserEmergency);
+ }
- private native void native_set_agps_server(int type, String hostname, int port);
+ @Override
+ public void onRequestUtcTime() {
+ requestUtcTime();
+ }
- // Network-initiated (NI) Support
- private native void native_send_ni_response(int notificationId, int userResponse);
+ @Override
+ public void onRequestRefLocation() {
+ requestRefLocation();
+ }
- // AGPS ril support
- private native void native_agps_set_ref_location_cellid(int type, int mcc, int mnc,
- int lac, int cid);
+ @Override
+ public void onReportNfwNotification(String proxyAppPackageName, byte protocolStack,
+ String otherProtocolStackName, byte requestor, String requestorId,
+ byte responseType, boolean inEmergencyMode, boolean isCachedLocation) {
+ if (mGnssVisibilityControl == null) {
+ Log.e(TAG, "reportNfwNotification: mGnssVisibilityControl uninitialized.");
+ return;
+ }
- private native void native_agps_set_id(int type, String setid);
-
- private static native boolean native_init_batching();
-
- private static native void native_cleanup_batching();
-
- private static native int native_get_batch_size();
-
- private static native boolean native_start_batch(long periodNanos, boolean wakeOnFifoFull);
-
- private static native void native_flush_batch();
-
- private static native boolean native_stop_batch();
+ mGnssVisibilityControl.reportNfwNotification(proxyAppPackageName, protocolStack,
+ otherProtocolStackName, requestor, requestorId, responseType, inEmergencyMode,
+ isCachedLocation);
+ }
}
diff --git a/services/core/java/com/android/server/location/gnss/GnssManagerService.java b/services/core/java/com/android/server/location/gnss/GnssManagerService.java
index fa137aa..ff92444 100644
--- a/services/core/java/com/android/server/location/gnss/GnssManagerService.java
+++ b/services/core/java/com/android/server/location/gnss/GnssManagerService.java
@@ -19,99 +19,78 @@
import android.Manifest;
import android.annotation.Nullable;
import android.content.Context;
-import android.location.GnssAntennaInfo;
+import android.hardware.location.GeofenceHardware;
+import android.hardware.location.GeofenceHardwareImpl;
+import android.location.FusedBatchOptions;
+import android.location.GnssCapabilities;
import android.location.GnssMeasurementCorrections;
import android.location.GnssMeasurementRequest;
-import android.location.GnssMeasurementsEvent;
-import android.location.GnssNavigationMessage;
import android.location.IGnssAntennaInfoListener;
import android.location.IGnssMeasurementsListener;
import android.location.IGnssNavigationMessageListener;
+import android.location.IGnssNmeaListener;
import android.location.IGnssStatusListener;
import android.location.IGpsGeofenceHardware;
-import android.location.INetInitiatedListener;
import android.location.Location;
-import android.location.LocationManagerInternal;
import android.location.util.identity.CallerIdentity;
+import android.os.BatteryStats;
import android.os.RemoteException;
+import android.os.ServiceManager;
import android.util.IndentingPrintWriter;
import android.util.Log;
-import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.util.Preconditions;
-import com.android.server.LocalServices;
-import com.android.server.location.injector.AppOpsHelper;
+import com.android.internal.app.IBatteryStats;
+import com.android.server.FgThread;
+import com.android.server.location.gnss.hal.GnssNative;
import com.android.server.location.injector.Injector;
import java.io.FileDescriptor;
-import java.util.List;
/** Manages Gnss providers and related Gnss functions for LocationManagerService. */
-public class GnssManagerService implements GnssNative.Callbacks {
+public class GnssManagerService {
public static final String TAG = "GnssManager";
public static final boolean D = Log.isLoggable(TAG, Log.DEBUG);
private static final String ATTRIBUTION_ID = "GnssService";
- public static boolean isGnssSupported() {
- return GnssNative.isSupported();
- }
-
private final Context mContext;
- private final AppOpsHelper mAppOpsHelper;
- private final LocationManagerInternal mLocationManagerInternal;
+ private final GnssNative mGnssNative;
private final GnssLocationProvider mGnssLocationProvider;
private final GnssStatusProvider mGnssStatusProvider;
+ private final GnssNmeaProvider mGnssNmeaProvider;
private final GnssMeasurementsProvider mGnssMeasurementsProvider;
- private final GnssMeasurementCorrectionsProvider mGnssMeasurementCorrectionsProvider;
private final GnssAntennaInfoProvider mGnssAntennaInfoProvider;
private final GnssNavigationMessageProvider mGnssNavigationMessageProvider;
- private final GnssLocationProvider.GnssSystemInfoProvider mGnssSystemInfoProvider;
- private final GnssLocationProvider.GnssMetricsProvider mGnssMetricsProvider;
- private final GnssCapabilitiesProvider mGnssCapabilitiesProvider;
- private final INetInitiatedListener mNetInitiatedListener;
- private final IGpsGeofenceHardware mGpsGeofenceProxy;
+ private final IGpsGeofenceHardware mGnssGeofenceProxy;
- public GnssManagerService(Context context, Injector injector) {
- this(context, injector, null);
- }
+ private final GnssMetrics mGnssMetrics;
- @VisibleForTesting
- GnssManagerService(Context context, Injector injector,
- GnssLocationProvider gnssLocationProvider) {
- Preconditions.checkState(isGnssSupported());
-
- GnssNative.initialize();
-
+ public GnssManagerService(Context context, Injector injector, GnssNative gnssNative) {
mContext = context.createAttributionContext(ATTRIBUTION_ID);
- mAppOpsHelper = injector.getAppOpsHelper();
- mLocationManagerInternal = LocalServices.getService(LocationManagerInternal.class);
+ mGnssNative = gnssNative;
- if (gnssLocationProvider == null) {
- gnssLocationProvider = new GnssLocationProvider(mContext, injector);
- }
+ mGnssMetrics = new GnssMetrics(mContext, IBatteryStats.Stub.asInterface(
+ ServiceManager.getService(BatteryStats.SERVICE_NAME)));
- mGnssLocationProvider = gnssLocationProvider;
- mGnssStatusProvider = mGnssLocationProvider.getGnssStatusProvider();
- mGnssMeasurementsProvider = mGnssLocationProvider.getGnssMeasurementsProvider();
- mGnssAntennaInfoProvider = mGnssLocationProvider.getGnssAntennaInfoProvider();
- mGnssMeasurementCorrectionsProvider =
- mGnssLocationProvider.getGnssMeasurementCorrectionsProvider();
- mGnssNavigationMessageProvider = mGnssLocationProvider.getGnssNavigationMessageProvider();
- mGnssSystemInfoProvider = mGnssLocationProvider.getGnssSystemInfoProvider();
- mGnssMetricsProvider = mGnssLocationProvider.getGnssMetricsProvider();
- mGnssCapabilitiesProvider = mGnssLocationProvider.getGnssCapabilitiesProvider();
- mNetInitiatedListener = mGnssLocationProvider.getNetInitiatedListener();
- mGpsGeofenceProxy = mGnssLocationProvider.getGpsGeofenceProxy();
+ mGnssLocationProvider = new GnssLocationProvider(mContext, injector, mGnssNative,
+ mGnssMetrics);
+ mGnssStatusProvider = new GnssStatusProvider(injector, mGnssNative);
+ mGnssNmeaProvider = new GnssNmeaProvider(injector, mGnssNative);
+ mGnssMeasurementsProvider = new GnssMeasurementsProvider(injector, mGnssNative);
+ mGnssAntennaInfoProvider = new GnssAntennaInfoProvider(injector, mGnssNative);
+ mGnssNavigationMessageProvider = new GnssNavigationMessageProvider(injector, mGnssNative);
+ mGnssGeofenceProxy = new GnssGeofenceProxy(mGnssNative);
+
+ mGnssNative.setGeofenceCallbacks(new GnssGeofenceHalModule());
// allow gnss access to begin - we must assume that callbacks can start immediately
- GnssNative.register(this);
+ mGnssNative.register();
}
/** Called when system is ready. */
- public synchronized void onSystemReady() {
+ public void onSystemReady() {
mGnssLocationProvider.onSystemReady();
}
@@ -121,15 +100,15 @@
}
/** Retrieve the IGpsGeofenceHardware. */
- public IGpsGeofenceHardware getGpsGeofenceProxy() {
- return mGpsGeofenceProxy;
+ public IGpsGeofenceHardware getGnssGeofenceProxy() {
+ return mGnssGeofenceProxy;
}
/**
* Get year of GNSS hardware.
*/
public int getGnssYearOfHardware() {
- return mGnssSystemInfoProvider.getGnssYearOfHardware();
+ return mGnssNative.getHardwareYear();
}
/**
@@ -137,15 +116,15 @@
*/
@Nullable
public String getGnssHardwareModelName() {
- return mGnssSystemInfoProvider.getGnssHardwareModelName();
+ return mGnssNative.getHardwareModelName();
}
/**
* Get GNSS hardware capabilities. The capabilities returned are a bitfield as described in
* {@link android.location.GnssCapabilities}.
*/
- public long getGnssCapabilities() {
- return mGnssCapabilitiesProvider.getGnssCapabilities();
+ public GnssCapabilities getGnssCapabilities() {
+ return mGnssNative.getCapabilities();
}
/**
@@ -174,6 +153,24 @@
}
/**
+ * Registers listener for GNSS NMEA messages.
+ */
+ public void registerGnssNmeaCallback(IGnssNmeaListener listener, String packageName,
+ @Nullable String attributionTag) {
+ mContext.enforceCallingOrSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION, null);
+
+ CallerIdentity identity = CallerIdentity.fromBinder(mContext, packageName, attributionTag);
+ mGnssNmeaProvider.addListener(identity, listener);
+ }
+
+ /**
+ * Unregisters listener for GNSS NMEA messages.
+ */
+ public void unregisterGnssNmeaCallback(IGnssNmeaListener listener) {
+ mGnssNmeaProvider.removeListener(listener);
+ }
+
+ /**
* Adds a GNSS measurements listener.
*/
public void addGnssMeasurementsListener(GnssMeasurementRequest request,
@@ -192,7 +189,9 @@
mContext.enforceCallingOrSelfPermission(Manifest.permission.LOCATION_HARDWARE, null);
mContext.enforceCallingOrSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION, null);
- mGnssMeasurementCorrectionsProvider.injectGnssMeasurementCorrections(corrections);
+ if (!mGnssNative.injectMeasurementCorrections(corrections)) {
+ Log.w(TAG, "failed to inject GNSS measurement corrections");
+ }
}
/**
@@ -248,9 +247,9 @@
*/
public void sendNiResponse(int notifId, int userResponse) {
try {
- mNetInitiatedListener.sendNiResponse(notifId, userResponse);
+ mGnssLocationProvider.getNetInitiatedListener().sendNiResponse(notifId, userResponse);
} catch (RemoteException e) {
- Log.e(TAG, "RemoteException in LocationManagerService.sendNiResponse");
+ throw e.rethrowFromSystemServer();
}
}
@@ -259,12 +258,12 @@
*/
public void dump(FileDescriptor fd, IndentingPrintWriter ipw, String[] args) {
if (args.length > 0 && args[0].equals("--gnssmetrics")) {
- if (mGnssMetricsProvider != null) {
- ipw.append(mGnssMetricsProvider.getGnssMetricsAsProtoString());
- }
+ ipw.append(mGnssMetrics.dumpGnssMetricsAsProtoString());
return;
}
+ ipw.println("Capabilities: " + mGnssNative.getCapabilities());
+
ipw.println("Antenna Info Provider:");
ipw.increaseIndent();
mGnssAntennaInfoProvider.dump(fd, ipw, args);
@@ -284,169 +283,92 @@
ipw.increaseIndent();
mGnssStatusProvider.dump(fd, ipw, args);
ipw.decreaseIndent();
+
+ GnssPowerStats powerStats = mGnssNative.getPowerStats();
+ if (powerStats != null) {
+ ipw.println("Last Power Stats:");
+ ipw.increaseIndent();
+ powerStats.dump(fd, ipw, args, mGnssNative.getCapabilities());
+ ipw.decreaseIndent();
+ }
}
- // all native callbacks - to be funneled to various locations as appropriate
+ private class GnssGeofenceHalModule implements GnssNative.GeofenceCallbacks {
- @Override
- public void reportLocation(boolean hasLatLong, Location location) {
- mGnssLocationProvider.reportLocation(hasLatLong, location);
- }
+ private GeofenceHardwareImpl mGeofenceHardwareImpl;
- @Override
- public void reportStatus(int status) {
- mGnssLocationProvider.reportStatus(status);
- }
+ private synchronized GeofenceHardwareImpl getGeofenceHardware() {
+ if (mGeofenceHardwareImpl == null) {
+ mGeofenceHardwareImpl = GeofenceHardwareImpl.getInstance(mContext);
+ }
+ return mGeofenceHardwareImpl;
+ }
- @Override
- public void reportSvStatus(int svCount, int[] svidWithFlags, float[] cn0DbHzs,
- float[] elevations, float[] azimuths, float[] carrierFrequencies,
- float[] basebandCn0DbHzs) {
- mGnssLocationProvider.reportSvStatus(svCount, svidWithFlags, cn0DbHzs, elevations, azimuths,
- carrierFrequencies, basebandCn0DbHzs);
- }
+ @Override
+ public void onReportGeofenceTransition(int geofenceId, Location location,
+ @GeofenceTransition int transition, long timestamp) {
+ FgThread.getHandler().post(() -> getGeofenceHardware().reportGeofenceTransition(
+ geofenceId, location, transition, timestamp,
+ GeofenceHardware.MONITORING_TYPE_GPS_HARDWARE,
+ FusedBatchOptions.SourceTechnologies.GNSS));
+ }
- @Override
- public void reportAGpsStatus(int agpsType, int agpsStatus, byte[] suplIpAddr) {
- mGnssLocationProvider.reportAGpsStatus(agpsType, agpsStatus, suplIpAddr);
- }
+ @Override
+ public void onReportGeofenceStatus(@GeofenceAvailability int status, Location location) {
+ FgThread.getHandler().post(() -> {
+ int monitorStatus = GeofenceHardware.MONITOR_CURRENTLY_UNAVAILABLE;
+ if (status == GEOFENCE_AVAILABILITY_AVAILABLE) {
+ monitorStatus = GeofenceHardware.MONITOR_CURRENTLY_AVAILABLE;
+ }
+ getGeofenceHardware().reportGeofenceMonitorStatus(
+ GeofenceHardware.MONITORING_TYPE_GPS_HARDWARE,
+ monitorStatus,
+ location,
+ FusedBatchOptions.SourceTechnologies.GNSS);
+ });
+ }
- @Override
- public void reportNmea(long timestamp) {
- mGnssLocationProvider.reportNmea(timestamp);
- }
+ @Override
+ public void onReportGeofenceAddStatus(int geofenceId, @GeofenceStatus int status) {
+ FgThread.getHandler().post(() -> getGeofenceHardware().reportGeofenceAddStatus(
+ geofenceId, translateGeofenceStatus(status)));
+ }
- @Override
- public void reportMeasurementData(GnssMeasurementsEvent event) {
- mGnssLocationProvider.reportMeasurementData(event);
- }
+ @Override
+ public void onReportGeofenceRemoveStatus(int geofenceId, @GeofenceStatus int status) {
+ FgThread.getHandler().post(() -> getGeofenceHardware().reportGeofenceRemoveStatus(
+ geofenceId, translateGeofenceStatus(status)));
+ }
- @Override
- public void reportAntennaInfo(List<GnssAntennaInfo> antennaInfos) {
- mGnssLocationProvider.reportAntennaInfo(antennaInfos);
- }
+ @Override
+ public void onReportGeofencePauseStatus(int geofenceId, @GeofenceStatus int status) {
+ FgThread.getHandler().post(() -> getGeofenceHardware().reportGeofencePauseStatus(
+ geofenceId, translateGeofenceStatus(status)));
+ }
- @Override
- public void reportNavigationMessage(GnssNavigationMessage event) {
- mGnssLocationProvider.reportNavigationMessage(event);
- }
+ @Override
+ public void onReportGeofenceResumeStatus(int geofenceId, @GeofenceStatus int status) {
+ FgThread.getHandler().post(() -> getGeofenceHardware().reportGeofenceResumeStatus(
+ geofenceId, translateGeofenceStatus(status)));
+ }
- @Override
- public void reportGnssPowerStats(GnssPowerStats powerStats) {
- mGnssLocationProvider.reportGnssPowerStats(powerStats);
- }
-
- @Override
- public void setTopHalCapabilities(int topHalCapabilities) {
- mGnssLocationProvider.setTopHalCapabilities(topHalCapabilities);
- }
-
- @Override
- public void setSubHalMeasurementCorrectionsCapabilities(int subHalCapabilities) {
- mGnssLocationProvider.setSubHalMeasurementCorrectionsCapabilities(subHalCapabilities);
- }
-
- @Override
- public void setSubHalPowerIndicationCapabilities(int subHalCapabilities) {
- mGnssLocationProvider.setSubHalPowerIndicationCapabilities(subHalCapabilities);
- }
-
- @Override
- public void setGnssYearOfHardware(int yearOfHardware) {
- mGnssLocationProvider.setGnssYearOfHardware(yearOfHardware);
- }
-
- @Override
- public void setGnssHardwareModelName(String modelName) {
- mGnssLocationProvider.setGnssHardwareModelName(modelName);
- }
-
- @Override
- public void reportGnssServiceRestarted() {
- mGnssLocationProvider.reportGnssServiceRestarted();
- }
-
- @Override
- public void reportLocationBatch(Location[] locationArray) {
- mGnssLocationProvider.reportLocationBatch(locationArray);
- }
-
- @Override
- public void psdsDownloadRequest(int psdsType) {
- mGnssLocationProvider.downloadPsdsData(psdsType);
- }
-
- @Override
- public void reportGeofenceTransition(int geofenceId, Location location, int transition,
- long transitionTimestamp) {
- mGnssLocationProvider.reportGeofenceTransition(geofenceId, location, transition,
- transitionTimestamp);
- }
-
- @Override
- public void reportGeofenceStatus(int status, Location location) {
- mGnssLocationProvider.reportGeofenceStatus(status, location);
- }
-
- @Override
- public void reportGeofenceAddStatus(int geofenceId, int status) {
- mGnssLocationProvider.reportGeofenceAddStatus(geofenceId, status);
- }
-
- @Override
- public void reportGeofenceRemoveStatus(int geofenceId, int status) {
- mGnssLocationProvider.reportGeofenceRemoveStatus(geofenceId, status);
- }
-
- @Override
- public void reportGeofencePauseStatus(int geofenceId, int status) {
- mGnssLocationProvider.reportGeofencePauseStatus(geofenceId, status);
- }
-
- @Override
- public void reportGeofenceResumeStatus(int geofenceId, int status) {
- mGnssLocationProvider.reportGeofenceResumeStatus(geofenceId, status);
- }
-
- @Override
- public void reportNiNotification(int notificationId, int niType, int notifyFlags,
- int timeout, int defaultResponse, String requestorId, String text,
- int requestorIdEncoding, int textEncoding) {
- mGnssLocationProvider.reportNiNotification(notificationId, niType, notifyFlags, timeout,
- defaultResponse, requestorId, text, requestorIdEncoding, textEncoding);
- }
-
- @Override
- public void requestSetID(int flags) {
- mGnssLocationProvider.requestSetID(flags);
- }
-
- @Override
- public void requestLocation(boolean independentFromGnss, boolean isUserEmergency) {
- mGnssLocationProvider.requestLocation(independentFromGnss, isUserEmergency);
- }
-
- @Override
- public void requestUtcTime() {
- mGnssLocationProvider.requestUtcTime();
- }
-
- @Override
- public void requestRefLocation() {
- mGnssLocationProvider.requestRefLocation();
- }
-
- @Override
- public void reportNfwNotification(String proxyAppPackageName, byte protocolStack,
- String otherProtocolStackName, byte requestor, String requestorId,
- byte responseType, boolean inEmergencyMode, boolean isCachedLocation) {
- mGnssLocationProvider.reportNfwNotification(proxyAppPackageName, protocolStack,
- otherProtocolStackName, requestor, requestorId, responseType, inEmergencyMode,
- isCachedLocation);
- }
-
- @Override
- public boolean isInEmergencySession() {
- return mGnssLocationProvider.isInEmergencySession();
+ private int translateGeofenceStatus(@GeofenceStatus int status) {
+ switch (status) {
+ case GEOFENCE_STATUS_OPERATION_SUCCESS:
+ return GeofenceHardware.GEOFENCE_SUCCESS;
+ case GEOFENCE_STATUS_ERROR_GENERIC:
+ return GeofenceHardware.GEOFENCE_FAILURE;
+ case GEOFENCE_STATUS_ERROR_ID_EXISTS:
+ return GeofenceHardware.GEOFENCE_ERROR_ID_EXISTS;
+ case GEOFENCE_STATUS_ERROR_INVALID_TRANSITION:
+ return GeofenceHardware.GEOFENCE_ERROR_INVALID_TRANSITION;
+ case GEOFENCE_STATUS_ERROR_TOO_MANY_GEOFENCES:
+ return GeofenceHardware.GEOFENCE_ERROR_TOO_MANY_GEOFENCES;
+ case GEOFENCE_STATUS_ERROR_ID_UNKNOWN:
+ return GeofenceHardware.GEOFENCE_ERROR_ID_UNKNOWN;
+ default:
+ return -1;
+ }
+ }
}
}
diff --git a/services/core/java/com/android/server/location/gnss/GnssMeasurementCorrectionsProvider.java b/services/core/java/com/android/server/location/gnss/GnssMeasurementCorrectionsProvider.java
deleted file mode 100644
index 4401f29..0000000
--- a/services/core/java/com/android/server/location/gnss/GnssMeasurementCorrectionsProvider.java
+++ /dev/null
@@ -1,151 +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.location.gnss;
-
-import android.location.GnssMeasurementCorrections;
-import android.os.Handler;
-import android.util.Log;
-
-import com.android.internal.annotations.VisibleForTesting;
-
-/**
- * Manages GNSS measurement corrections.
- *
- * <p>Implements the framework side of the GNSS HAL interfaces {@code IMeasurementCorrections.hal}
- * and {@code IMeasurementCorrectionsCallback.hal).
- *
- * @hide
- */
-public class GnssMeasurementCorrectionsProvider {
- private static final String TAG = "GnssMeasurementCorrectionsProvider";
-
- // These must match with the Capabilities enum in IMeasurementCorrectionsCallback.hal.
- static final int CAPABILITY_LOS_SATS = 0x0000001;
- static final int CAPABILITY_EXCESS_PATH_LENGTH = 0x0000002;
- static final int CAPABILITY_REFLECTING_PLANE = 0x0000004;
-
- private static final int INVALID_CAPABILITIES = 1 << 31;
-
- private final Handler mHandler;
- private final GnssMeasurementCorrectionsProviderNative mNative;
- private volatile int mCapabilities = INVALID_CAPABILITIES;
-
- GnssMeasurementCorrectionsProvider(Handler handler) {
- this(handler, new GnssMeasurementCorrectionsProviderNative());
- }
-
- @VisibleForTesting
- GnssMeasurementCorrectionsProvider(Handler handler,
- GnssMeasurementCorrectionsProviderNative aNative) {
- mHandler = handler;
- mNative = aNative;
- }
-
- /**
- * Returns {@code true} if the GNSS HAL implementation supports measurement corrections.
- */
- public boolean isAvailableInPlatform() {
- return mNative.isMeasurementCorrectionsSupported();
- }
-
- /**
- * Injects GNSS measurement corrections into the GNSS chipset.
- *
- * @param measurementCorrections a {@link GnssMeasurementCorrections} object with the GNSS
- * measurement corrections to be injected into the GNSS chipset.
- */
- public void injectGnssMeasurementCorrections(
- GnssMeasurementCorrections measurementCorrections) {
- if (!isCapabilitiesReceived()) {
- Log.w(TAG, "Failed to inject GNSS measurement corrections. Capabilities "
- + "not received yet.");
- return;
- }
- mHandler.post(() -> {
- if (!mNative.injectGnssMeasurementCorrections(measurementCorrections)) {
- Log.e(TAG, "Failure in injecting GNSS corrections.");
- }
- });
- }
-
- /** Handle measurement corrections capabilities update from the GNSS HAL implementation. */
- boolean onCapabilitiesUpdated(int capabilities) {
- if (hasCapability(capabilities, CAPABILITY_LOS_SATS) || hasCapability(capabilities,
- CAPABILITY_EXCESS_PATH_LENGTH)) {
- mCapabilities = capabilities;
- return true;
- } else {
- Log.e(TAG, "Failed to set capabilities. Received capabilities 0x"
- + Integer.toHexString(capabilities) + " does not contain the mandatory "
- + "LOS_SATS or the EXCESS_PATH_LENGTH capability.");
- return false;
- }
- }
-
- /**
- * Returns the measurement corrections specific capabilities of the GNSS HAL implementation.
- */
- int getCapabilities() {
- return mCapabilities;
- }
-
- /**
- * Returns the string representation of the GNSS measurement capabilities.
- */
- String toStringCapabilities() {
- final int capabilities = getCapabilities();
- StringBuilder s = new StringBuilder();
- s.append("mCapabilities=0x").append(Integer.toHexString(capabilities));
- s.append(" ( ");
- if (hasCapability(capabilities, CAPABILITY_LOS_SATS)) {
- s.append("LOS_SATS ");
- }
- if (hasCapability(capabilities, CAPABILITY_EXCESS_PATH_LENGTH)) {
- s.append("EXCESS_PATH_LENGTH ");
- }
- if (hasCapability(capabilities, CAPABILITY_REFLECTING_PLANE)) {
- s.append("REFLECTING_PLANE ");
- }
- s.append(")");
- return s.toString();
- }
-
- private static boolean hasCapability(int halCapabilities, int capability) {
- return (halCapabilities & capability) != 0;
- }
-
- private boolean isCapabilitiesReceived() {
- return mCapabilities != INVALID_CAPABILITIES;
- }
-
- @VisibleForTesting
- static class GnssMeasurementCorrectionsProviderNative {
- public boolean isMeasurementCorrectionsSupported() {
- return native_is_measurement_corrections_supported();
- }
-
- public boolean injectGnssMeasurementCorrections(
- GnssMeasurementCorrections measurementCorrections) {
- return native_inject_gnss_measurement_corrections(measurementCorrections);
- }
- }
-
- static native boolean native_is_measurement_corrections_supported();
-
- static native boolean native_inject_gnss_measurement_corrections(
- GnssMeasurementCorrections measurementCorrections);
-}
diff --git a/services/core/java/com/android/server/location/gnss/GnssMeasurementsProvider.java b/services/core/java/com/android/server/location/gnss/GnssMeasurementsProvider.java
index fa8e2a6..b7cc9f5 100644
--- a/services/core/java/com/android/server/location/gnss/GnssMeasurementsProvider.java
+++ b/services/core/java/com/android/server/location/gnss/GnssMeasurementsProvider.java
@@ -21,6 +21,7 @@
import android.annotation.Nullable;
import android.app.AppOpsManager;
+import android.location.GnssCapabilities;
import android.location.GnssMeasurementRequest;
import android.location.GnssMeasurementsEvent;
import android.location.IGnssMeasurementsListener;
@@ -29,8 +30,7 @@
import android.stats.location.LocationStatsEnums;
import android.util.Log;
-import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.util.Preconditions;
+import com.android.server.location.gnss.hal.GnssNative;
import com.android.server.location.injector.AppOpsHelper;
import com.android.server.location.injector.Injector;
import com.android.server.location.injector.LocationAttributionHelper;
@@ -38,7 +38,6 @@
import com.android.server.location.injector.SettingsHelper;
import java.util.Collection;
-import java.util.Objects;
/**
* An base implementation for GNSS measurements provider. It abstracts out the responsibility of
@@ -47,8 +46,10 @@
* @hide
*/
public final class GnssMeasurementsProvider extends
- GnssListenerMultiplexer<GnssMeasurementRequest, IGnssMeasurementsListener, Boolean>
- implements SettingsHelper.GlobalSettingChangedListener {
+ GnssListenerMultiplexer<GnssMeasurementRequest, IGnssMeasurementsListener,
+ GnssMeasurementRequest> implements
+ SettingsHelper.GlobalSettingChangedListener, GnssNative.BaseCallbacks,
+ GnssNative.MeasurementCallbacks {
private class GnssMeasurementListenerRegistration extends GnssListenerRegistration {
@@ -79,24 +80,22 @@
private final AppOpsHelper mAppOpsHelper;
private final LocationAttributionHelper mLocationAttributionHelper;
private final LocationUsageLogger mLogger;
- private final GnssMeasurementProviderNative mNative;
+ private final GnssNative mGnssNative;
- public GnssMeasurementsProvider(Injector injector) {
- this(injector, new GnssMeasurementProviderNative());
- }
-
- @VisibleForTesting
- public GnssMeasurementsProvider(Injector injector, GnssMeasurementProviderNative aNative) {
+ public GnssMeasurementsProvider(Injector injector, GnssNative gnssNative) {
super(injector);
mAppOpsHelper = injector.getAppOpsHelper();
mLocationAttributionHelper = injector.getLocationAttributionHelper();
mLogger = injector.getLocationUsageLogger();
- mNative = aNative;
+ mGnssNative = gnssNative;
+
+ mGnssNative.addBaseCallbacks(this);
+ mGnssNative.addMeasurementCallbacks(this);
}
@Override
protected boolean isServiceSupported() {
- return mNative.isMeasurementSupported();
+ return mGnssNative.isMeasurementSupported();
}
@Override
@@ -112,17 +111,14 @@
}
@Override
- protected boolean registerWithService(Boolean fullTrackingRequest,
+ protected boolean registerWithService(GnssMeasurementRequest request,
Collection<GnssListenerRegistration> registrations) {
- Preconditions.checkState(mNative.isMeasurementSupported());
-
- if (mNative.startMeasurementCollection(fullTrackingRequest)) {
+ if (mGnssNative.startMeasurementCollection(request.isFullTracking())) {
if (D) {
- Log.d(TAG, "starting gnss measurements (" + fullTrackingRequest + ")");
+ Log.d(TAG, "starting gnss measurements (" + request + ")");
}
return true;
} else {
-
Log.e(TAG, "error starting gnss measurements");
return false;
}
@@ -130,14 +126,12 @@
@Override
protected void unregisterWithService() {
- if (mNative.isMeasurementSupported()) {
- if (mNative.stopMeasurementCollection()) {
- if (D) {
- Log.d(TAG, "stopping gnss measurements");
- }
- } else {
- Log.e(TAG, "error stopping gnss measurements");
+ if (mGnssNative.stopMeasurementCollection()) {
+ if (D) {
+ Log.d(TAG, "stopping gnss measurements");
}
+ } else {
+ Log.e(TAG, "error stopping gnss measurements");
}
}
@@ -158,18 +152,21 @@
}
@Override
- protected Boolean mergeRegistrations(Collection<GnssListenerRegistration> registrations) {
+ protected GnssMeasurementRequest mergeRegistrations(
+ Collection<GnssListenerRegistration> registrations) {
+ boolean fullTracking = false;
if (mSettingsHelper.isGnssMeasurementsFullTrackingEnabled()) {
- return true;
- }
-
- for (GnssListenerRegistration registration : registrations) {
- if (Objects.requireNonNull(registration.getRequest()).isFullTracking()) {
- return true;
+ fullTracking = true;
+ } else {
+ for (GnssListenerRegistration registration : registrations) {
+ if (registration.getRequest().isFullTracking()) {
+ fullTracking = true;
+ break;
+ }
}
}
- return false;
+ return new GnssMeasurementRequest.Builder().setFullTracking(fullTracking).build();
}
@Override
@@ -198,10 +195,17 @@
null, registration.isForeground());
}
- /**
- * Called by GnssLocationProvider.
- */
- public void onMeasurementsAvailable(GnssMeasurementsEvent event) {
+ @Override
+ public void onHalRestarted() {
+ resetService();
+ }
+
+ @Override
+ public void onCapabilitiesChanged(GnssCapabilities oldCapabilities,
+ GnssCapabilities newCapabilities) {}
+
+ @Override
+ public void onReportMeasurements(GnssMeasurementsEvent event) {
deliverToListeners(registration -> {
if (mAppOpsHelper.noteOpNoThrow(AppOpsManager.OP_FINE_LOCATION,
registration.getIdentity())) {
@@ -211,25 +215,4 @@
}
});
}
-
- @VisibleForTesting
- static class GnssMeasurementProviderNative {
- boolean isMeasurementSupported() {
- return native_is_measurement_supported();
- }
-
- boolean startMeasurementCollection(boolean enableFullTracking) {
- return native_start_measurement_collection(enableFullTracking);
- }
-
- boolean stopMeasurementCollection() {
- return native_stop_measurement_collection();
- }
- }
-
- static native boolean native_is_measurement_supported();
-
- static native boolean native_start_measurement_collection(boolean enableFullTracking);
-
- static native boolean native_stop_measurement_collection();
}
diff --git a/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java b/services/core/java/com/android/server/location/gnss/GnssMetrics.java
similarity index 95%
rename from location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
rename to services/core/java/com/android/server/location/gnss/GnssMetrics.java
index dd8a8c3..c7d8144 100644
--- a/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
+++ b/services/core/java/com/android/server/location/gnss/GnssMetrics.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * 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.
@@ -14,15 +14,11 @@
* limitations under the License.
*/
-package com.android.internal.location.gnssmetrics;
-
-import static android.location.GnssSignalQuality.GNSS_SIGNAL_QUALITY_GOOD;
-import static android.location.GnssSignalQuality.GNSS_SIGNAL_QUALITY_POOR;
-import static android.location.GnssSignalQuality.GNSS_SIGNAL_QUALITY_UNKNOWN;
-import static android.location.GnssSignalQuality.NUM_GNSS_SIGNAL_QUALITY_LEVELS;
+package com.android.server.location.gnss;
import android.app.StatsManager;
import android.content.Context;
+import android.location.GnssSignalQuality;
import android.location.GnssStatus;
import android.os.RemoteException;
import android.os.SystemClock;
@@ -67,11 +63,11 @@
// A boolean array indicating whether the constellation types have been used in fix.
private boolean[] mConstellationTypes;
- private Statistics mLocationFailureStatistics;
- private Statistics mTimeToFirstFixSecStatistics;
- private Statistics mPositionAccuracyMeterStatistics;
- private Statistics mTopFourAverageCn0Statistics;
- private Statistics mTopFourAverageCn0StatisticsL5;
+ private final Statistics mLocationFailureStatistics;
+ private final Statistics mTimeToFirstFixSecStatistics;
+ private final Statistics mPositionAccuracyMeterStatistics;
+ private final Statistics mTopFourAverageCn0Statistics;
+ private final Statistics mTopFourAverageCn0StatisticsL5;
// Total number of sv status messages processed
private int mNumSvStatus;
// Total number of L5 sv status messages processed
@@ -91,7 +87,7 @@
long mSvStatusReportsUsedInFix;
long mL5SvStatusReportsUsedInFix;
- private StatsManager mStatsManager;
+ private final StatsManager mStatsManager;
public GnssMetrics(Context context, IBatteryStats stats) {
mGnssPowerMetrics = new GnssPowerMetrics(stats);
@@ -390,7 +386,7 @@
stats.getLoggingDurationMs() / ((double) DateUtils.MINUTE_IN_MILLIS)).append(
"\n");
long[] t = stats.getTimeInGpsSignalQualityLevel();
- if (t != null && t.length == NUM_GNSS_SIGNAL_QUALITY_LEVELS) {
+ if (t != null && t.length == GnssSignalQuality.NUM_GNSS_SIGNAL_QUALITY_LEVELS) {
s.append(" Amount of time (while on battery) Top 4 Avg CN0 > "
+ GnssPowerMetrics.POOR_TOP_FOUR_AVG_CN0_THRESHOLD_DB_HZ
+ " dB-Hz (min): ").append(
@@ -505,7 +501,7 @@
// so that
// the first CNO report will trigger an update to BatteryStats
mLastAverageCn0 = -100.0;
- mLastSignalLevel = GNSS_SIGNAL_QUALITY_UNKNOWN;
+ mLastSignalLevel = GnssSignalQuality.GNSS_SIGNAL_QUALITY_UNKNOWN;
}
/**
@@ -577,9 +573,9 @@
*/
private int getSignalLevel(double cn0) {
if (cn0 > POOR_TOP_FOUR_AVG_CN0_THRESHOLD_DB_HZ) {
- return GNSS_SIGNAL_QUALITY_GOOD;
+ return GnssSignalQuality.GNSS_SIGNAL_QUALITY_GOOD;
}
- return GNSS_SIGNAL_QUALITY_POOR;
+ return GnssSignalQuality.GNSS_SIGNAL_QUALITY_POOR;
}
}
diff --git a/services/core/java/com/android/server/location/gnss/GnssNative.java b/services/core/java/com/android/server/location/gnss/GnssNative.java
deleted file mode 100644
index 4494c19..0000000
--- a/services/core/java/com/android/server/location/gnss/GnssNative.java
+++ /dev/null
@@ -1,324 +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.location.gnss;
-
-import android.location.GnssAntennaInfo;
-import android.location.GnssMeasurementsEvent;
-import android.location.GnssNavigationMessage;
-import android.location.Location;
-
-import com.android.internal.annotations.GuardedBy;
-import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.util.Preconditions;
-import com.android.server.FgThread;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.util.List;
-
-/**
- * Entry point for all GNSS native callbacks, and responsible for initializing the GNSS HAL.
- */
-class GnssNative {
-
- interface Callbacks {
- void reportLocation(boolean hasLatLong, Location location);
- void reportStatus(int status);
- void reportSvStatus(int svCount, int[] svidWithFlags, float[] cn0DbHzs,
- float[] elevations, float[] azimuths, float[] carrierFrequencies,
- float[] basebandCn0DbHzs);
- void reportAGpsStatus(int agpsType, int agpsStatus, byte[] suplIpAddr);
- void reportNmea(long timestamp);
- void reportMeasurementData(GnssMeasurementsEvent event);
- void reportAntennaInfo(List<GnssAntennaInfo> antennaInfos);
- void reportNavigationMessage(GnssNavigationMessage event);
- void reportGnssPowerStats(GnssPowerStats powerStats);
- void setTopHalCapabilities(int topHalCapabilities);
- void setSubHalMeasurementCorrectionsCapabilities(int subHalCapabilities);
- void setSubHalPowerIndicationCapabilities(int subHalCapabilities);
- void setGnssYearOfHardware(int yearOfHardware);
- void setGnssHardwareModelName(String modelName);
- void reportGnssServiceRestarted();
- void reportLocationBatch(Location[] locationArray);
- void psdsDownloadRequest(int psdsType);
- void reportGeofenceTransition(int geofenceId, Location location, int transition,
- long transitionTimestamp);
- void reportGeofenceStatus(int status, Location location);
- void reportGeofenceAddStatus(int geofenceId, int status);
- void reportGeofenceRemoveStatus(int geofenceId, int status);
- void reportGeofencePauseStatus(int geofenceId, int status);
- void reportGeofenceResumeStatus(int geofenceId, int status);
- void reportNiNotification(
- int notificationId,
- int niType,
- int notifyFlags,
- int timeout,
- int defaultResponse,
- String requestorId,
- String text,
- int requestorIdEncoding,
- int textEncoding
- );
- void requestSetID(int flags);
- void requestLocation(boolean independentFromGnss, boolean isUserEmergency);
- void requestUtcTime();
- void requestRefLocation();
- void reportNfwNotification(String proxyAppPackageName, byte protocolStack,
- String otherProtocolStackName, byte requestor, String requestorId,
- byte responseType, boolean inEmergencyMode, boolean isCachedLocation);
- boolean isInEmergencySession();
- }
-
- /**
- * Indicates that this method is a native entry point. Useful purely for IDEs which can
- * understand entry points, and thus eliminate incorrect warnings about methods not used.
- */
- @Target(ElementType.METHOD)
- @Retention(RetentionPolicy.SOURCE)
- private @interface NativeEntryPoint {}
-
- @GuardedBy("GnssNative.class")
- private static boolean sInitialized;
-
- @GuardedBy("GnssNative.class")
- private static GnssNativeInitNative sInitNative = new GnssNativeInitNative();
-
- @GuardedBy("GnssNative.class")
- private static GnssNative sInstance;
-
- @VisibleForTesting
- public static synchronized void setInitNativeForTest(GnssNativeInitNative initNative) {
- sInitNative = initNative;
- }
-
- public static synchronized boolean isSupported() {
- initialize();
- return sInitNative.isSupported();
- }
-
- static synchronized void initialize() {
- if (!sInitialized) {
- sInitNative.classInitOnce();
- sInitialized = true;
- }
- }
-
- @VisibleForTesting
- public static synchronized void resetCallbacksForTest() {
- sInstance = null;
- }
-
- static synchronized void register(Callbacks callbacks) {
- Preconditions.checkState(sInstance == null);
- initialize();
- sInstance = new GnssNative(callbacks);
- }
-
- private final Callbacks mCallbacks;
-
- private GnssNative(Callbacks callbacks) {
- mCallbacks = callbacks;
- sInitNative.initOnce(this, false);
- }
-
- @NativeEntryPoint
- private void reportLocation(boolean hasLatLong, Location location) {
- mCallbacks.reportLocation(hasLatLong, location);
- }
-
- @NativeEntryPoint
- private void reportStatus(int status) {
- mCallbacks.reportStatus(status);
- }
-
- @NativeEntryPoint
- private void reportSvStatus(int svCount, int[] svidWithFlags, float[] cn0DbHzs,
- float[] elevations, float[] azimuths, float[] carrierFrequencies,
- float[] basebandCn0DbHzs) {
- mCallbacks.reportSvStatus(svCount, svidWithFlags, cn0DbHzs, elevations, azimuths,
- carrierFrequencies, basebandCn0DbHzs);
- }
-
- @NativeEntryPoint
- private void reportAGpsStatus(int agpsType, int agpsStatus, byte[] suplIpAddr) {
- mCallbacks.reportAGpsStatus(agpsType, agpsStatus, suplIpAddr);
- }
-
- @NativeEntryPoint
- private void reportNmea(long timestamp) {
- mCallbacks.reportNmea(timestamp);
- }
-
- @NativeEntryPoint
- private void reportMeasurementData(GnssMeasurementsEvent event) {
- mCallbacks.reportMeasurementData(event);
- }
-
- @NativeEntryPoint
- private void reportAntennaInfo(List<GnssAntennaInfo> antennaInfos) {
- mCallbacks.reportAntennaInfo(antennaInfos);
- }
-
- @NativeEntryPoint
- private void reportNavigationMessage(GnssNavigationMessage event) {
- mCallbacks.reportNavigationMessage(event);
- }
-
- @NativeEntryPoint
- private void reportGnssPowerStats(GnssPowerStats powerStats) {
- mCallbacks.reportGnssPowerStats(powerStats);
- }
-
- @NativeEntryPoint
- private void setTopHalCapabilities(int topHalCapabilities) {
- mCallbacks.setTopHalCapabilities(topHalCapabilities);
- }
-
- @NativeEntryPoint
- private void setSubHalMeasurementCorrectionsCapabilities(int subHalCapabilities) {
- mCallbacks.setSubHalMeasurementCorrectionsCapabilities(subHalCapabilities);
- }
-
- @NativeEntryPoint
- private void setSubHalPowerIndicationCapabilities(int subHalCapabilities) {
- mCallbacks.setSubHalPowerIndicationCapabilities(subHalCapabilities);
- }
-
- @NativeEntryPoint
- private void setGnssYearOfHardware(int yearOfHardware) {
- mCallbacks.setGnssYearOfHardware(yearOfHardware);
- }
-
- @NativeEntryPoint
- private void setGnssHardwareModelName(String modelName) {
- mCallbacks.setGnssHardwareModelName(modelName);
- }
-
- @NativeEntryPoint
- private void reportGnssServiceDied() {
- FgThread.getExecutor().execute(() -> {
- sInitNative.initOnce(GnssNative.this, true);
- mCallbacks.reportGnssServiceRestarted();
- });
- }
-
- @NativeEntryPoint
- private void reportLocationBatch(Location[] locationArray) {
- mCallbacks.reportLocationBatch(locationArray);
- }
-
- @NativeEntryPoint
- private void psdsDownloadRequest(int psdsType) {
- mCallbacks.psdsDownloadRequest(psdsType);
- }
-
- @NativeEntryPoint
- private void reportGeofenceTransition(int geofenceId, Location location, int transition,
- long transitionTimestamp) {
- mCallbacks.reportGeofenceTransition(geofenceId, location, transition, transitionTimestamp);
- }
-
- @NativeEntryPoint
- private void reportGeofenceStatus(int status, Location location) {
- mCallbacks.reportGeofenceStatus(status, location);
- }
-
- @NativeEntryPoint
- private void reportGeofenceAddStatus(int geofenceId, int status) {
- mCallbacks.reportGeofenceAddStatus(geofenceId, status);
- }
-
- @NativeEntryPoint
- private void reportGeofenceRemoveStatus(int geofenceId, int status) {
- mCallbacks.reportGeofenceRemoveStatus(geofenceId, status);
- }
-
- @NativeEntryPoint
- private void reportGeofencePauseStatus(int geofenceId, int status) {
- mCallbacks.reportGeofencePauseStatus(geofenceId, status);
- }
-
- @NativeEntryPoint
- private void reportGeofenceResumeStatus(int geofenceId, int status) {
- mCallbacks.reportGeofenceResumeStatus(geofenceId, status);
- }
-
- @NativeEntryPoint
- private void reportNiNotification(int notificationId, int niType, int notifyFlags,
- int timeout, int defaultResponse, String requestorId, String text,
- int requestorIdEncoding, int textEncoding) {
- mCallbacks.reportNiNotification(notificationId, niType, notifyFlags, timeout,
- defaultResponse, requestorId, text, requestorIdEncoding, textEncoding);
- }
-
- @NativeEntryPoint
- private void requestSetID(int flags) {
- mCallbacks.requestSetID(flags);
- }
-
- @NativeEntryPoint
- private void requestLocation(boolean independentFromGnss, boolean isUserEmergency) {
- mCallbacks.requestLocation(independentFromGnss, isUserEmergency);
- }
-
- @NativeEntryPoint
- private void requestUtcTime() {
- mCallbacks.requestUtcTime();
- }
-
- @NativeEntryPoint
- private void requestRefLocation() {
- mCallbacks.requestRefLocation();
- }
-
- @NativeEntryPoint
- private void reportNfwNotification(String proxyAppPackageName, byte protocolStack,
- String otherProtocolStackName, byte requestor, String requestorId,
- byte responseType, boolean inEmergencyMode, boolean isCachedLocation) {
- mCallbacks.reportNfwNotification(proxyAppPackageName, protocolStack, otherProtocolStackName,
- requestor, requestorId, responseType, inEmergencyMode, isCachedLocation);
- }
-
- @NativeEntryPoint
- private boolean isInEmergencySession() {
- return mCallbacks.isInEmergencySession();
- }
-
- @VisibleForTesting
- public static class GnssNativeInitNative {
-
- public void classInitOnce() {
- native_class_init_once();
- }
-
- public boolean isSupported() {
- return native_is_supported();
- }
-
- public void initOnce(GnssNative gnssNative, boolean reinitializeGnssServiceHandle) {
- gnssNative.native_init_once(reinitializeGnssServiceHandle);
- }
- }
-
- static native void native_class_init_once();
-
- static native boolean native_is_supported();
-
- native void native_init_once(boolean reinitializeGnssServiceHandle);
-}
diff --git a/services/core/java/com/android/server/location/gnss/GnssNavigationMessageProvider.java b/services/core/java/com/android/server/location/gnss/GnssNavigationMessageProvider.java
index 92491f7..9b1cde0 100644
--- a/services/core/java/com/android/server/location/gnss/GnssNavigationMessageProvider.java
+++ b/services/core/java/com/android/server/location/gnss/GnssNavigationMessageProvider.java
@@ -20,13 +20,13 @@
import static com.android.server.location.gnss.GnssManagerService.TAG;
import android.app.AppOpsManager;
+import android.location.GnssCapabilities;
import android.location.GnssNavigationMessage;
import android.location.IGnssNavigationMessageListener;
import android.location.util.identity.CallerIdentity;
import android.util.Log;
-import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.util.Preconditions;
+import com.android.server.location.gnss.hal.GnssNative;
import com.android.server.location.injector.AppOpsHelper;
import com.android.server.location.injector.Injector;
@@ -40,21 +40,24 @@
* @hide
*/
public class GnssNavigationMessageProvider extends
- GnssListenerMultiplexer<Void, IGnssNavigationMessageListener, Void> {
+ GnssListenerMultiplexer<Void, IGnssNavigationMessageListener, Void> implements
+ GnssNative.BaseCallbacks, GnssNative.NavigationMessageCallbacks {
private final AppOpsHelper mAppOpsHelper;
- private final GnssNavigationMessageProviderNative mNative;
+ private final GnssNative mGnssNative;
- public GnssNavigationMessageProvider(Injector injector) {
- this(injector, new GnssNavigationMessageProviderNative());
- }
-
- @VisibleForTesting
- public GnssNavigationMessageProvider(Injector injector,
- GnssNavigationMessageProviderNative aNative) {
+ public GnssNavigationMessageProvider(Injector injector, GnssNative gnssNative) {
super(injector);
mAppOpsHelper = injector.getAppOpsHelper();
- mNative = aNative;
+ mGnssNative = gnssNative;
+
+ mGnssNative.addBaseCallbacks(this);
+ mGnssNative.addNavigationMessageCallbacks(this);
+ }
+
+ @Override
+ protected boolean isServiceSupported() {
+ return mGnssNative.isNavigationMessageCollectionSupported();
}
@Override
@@ -65,9 +68,7 @@
@Override
protected boolean registerWithService(Void ignored,
Collection<GnssListenerRegistration> registrations) {
- Preconditions.checkState(mNative.isNavigationMessageSupported());
-
- if (mNative.startNavigationMessageCollection()) {
+ if (mGnssNative.startNavigationMessageCollection()) {
if (D) {
Log.d(TAG, "starting gnss navigation messages");
}
@@ -80,21 +81,26 @@
@Override
protected void unregisterWithService() {
- if (mNative.isNavigationMessageSupported()) {
- if (mNative.stopNavigationMessageCollection()) {
- if (D) {
- Log.d(TAG, "stopping gnss navigation messages");
- }
- } else {
- Log.e(TAG, "error stopping gnss navigation messages");
+ if (mGnssNative.stopNavigationMessageCollection()) {
+ if (D) {
+ Log.d(TAG, "stopping gnss navigation messages");
}
+ } else {
+ Log.e(TAG, "error stopping gnss navigation messages");
}
}
- /**
- * Called by GnssLocationProvider.
- */
- public void onNavigationMessageAvailable(GnssNavigationMessage event) {
+ @Override
+ public void onHalRestarted() {
+ resetService();
+ }
+
+ @Override
+ public void onCapabilitiesChanged(GnssCapabilities oldCapabilities,
+ GnssCapabilities newCapabilities) {}
+
+ @Override
+ public void onReportNavigationMessage(GnssNavigationMessage event) {
deliverToListeners(registration -> {
if (mAppOpsHelper.noteOpNoThrow(AppOpsManager.OP_FINE_LOCATION,
registration.getIdentity())) {
@@ -104,30 +110,4 @@
}
});
}
-
- @Override
- protected boolean isServiceSupported() {
- return mNative.isNavigationMessageSupported();
- }
-
- @VisibleForTesting
- static class GnssNavigationMessageProviderNative {
- boolean isNavigationMessageSupported() {
- return native_is_navigation_message_supported();
- }
-
- boolean startNavigationMessageCollection() {
- return native_start_navigation_message_collection();
- }
-
- boolean stopNavigationMessageCollection() {
- return native_stop_navigation_message_collection();
- }
- }
-
- static native boolean native_is_navigation_message_supported();
-
- static native boolean native_start_navigation_message_collection();
-
- static native boolean native_stop_navigation_message_collection();
}
diff --git a/services/core/java/com/android/server/location/gnss/GnssNmeaProvider.java b/services/core/java/com/android/server/location/gnss/GnssNmeaProvider.java
new file mode 100644
index 0000000..bad1b79
--- /dev/null
+++ b/services/core/java/com/android/server/location/gnss/GnssNmeaProvider.java
@@ -0,0 +1,115 @@
+/*
+ * 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.location.gnss;
+
+import static com.android.server.location.gnss.GnssManagerService.D;
+import static com.android.server.location.gnss.GnssManagerService.TAG;
+
+import android.annotation.Nullable;
+import android.app.AppOpsManager;
+import android.location.GnssCapabilities;
+import android.location.IGnssNmeaListener;
+import android.location.util.identity.CallerIdentity;
+import android.util.Log;
+
+import com.android.internal.listeners.ListenerExecutor;
+import com.android.server.location.gnss.hal.GnssNative;
+import com.android.server.location.injector.AppOpsHelper;
+import com.android.server.location.injector.Injector;
+
+import java.util.Collection;
+import java.util.function.Function;
+
+/**
+ * Implementation of a handler for {@link IGnssNmeaListener}.
+ */
+class GnssNmeaProvider extends GnssListenerMultiplexer<Void, IGnssNmeaListener, Void> implements
+ GnssNative.BaseCallbacks, GnssNative.NmeaCallbacks {
+
+ private final AppOpsHelper mAppOpsHelper;
+ private final GnssNative mGnssNative;
+
+ // preallocated to avoid memory allocation in onReportNmea()
+ private final byte[] mNmeaBuffer = new byte[120];
+
+ GnssNmeaProvider(Injector injector, GnssNative gnssNative) {
+ super(injector);
+
+ mAppOpsHelper = injector.getAppOpsHelper();
+ mGnssNative = gnssNative;
+
+ mGnssNative.addBaseCallbacks(this);
+ mGnssNative.addNmeaCallbacks(this);
+ }
+
+ @Override
+ public void addListener(CallerIdentity identity, IGnssNmeaListener listener) {
+ super.addListener(identity, listener);
+ }
+
+ @Override
+ protected boolean registerWithService(Void ignored,
+ Collection<GnssListenerRegistration> registrations) {
+ if (D) {
+ Log.d(TAG, "starting gnss nmea messages");
+ }
+ return true;
+ }
+
+ @Override
+ protected void unregisterWithService() {
+ if (D) {
+ Log.d(TAG, "stopping gnss nmea messages");
+ }
+ }
+
+ @Override
+ public void onHalRestarted() {
+ resetService();
+ }
+
+ @Override
+ public void onCapabilitiesChanged(GnssCapabilities oldCapabilities,
+ GnssCapabilities newCapabilities) {}
+
+ @Override
+ public void onReportNmea(long timestamp) {
+ deliverToListeners(
+ new Function<GnssListenerRegistration,
+ ListenerExecutor.ListenerOperation<IGnssNmeaListener>>() {
+
+ // only read in the nmea string if we need to
+ private @Nullable String mNmea;
+
+ @Override
+ public ListenerExecutor.ListenerOperation<IGnssNmeaListener> apply(
+ GnssListenerRegistration registration) {
+ if (mAppOpsHelper.noteOpNoThrow(AppOpsManager.OP_FINE_LOCATION,
+ registration.getIdentity())) {
+ if (mNmea == null) {
+ int length = mGnssNative.readNmea(mNmeaBuffer,
+ mNmeaBuffer.length);
+ mNmea = new String(mNmeaBuffer, 0, length);
+ }
+ return listener -> listener.onNmeaReceived(timestamp, mNmea);
+ } else {
+ return null;
+ }
+ }
+ });
+ }
+}
diff --git a/services/core/java/com/android/server/location/gnss/GnssPowerIndicationProvider.java b/services/core/java/com/android/server/location/gnss/GnssPowerIndicationProvider.java
deleted file mode 100644
index 5941a33..0000000
--- a/services/core/java/com/android/server/location/gnss/GnssPowerIndicationProvider.java
+++ /dev/null
@@ -1,122 +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.location.gnss;
-
-import static android.hardware.gnss.IGnssPowerIndicationCallback.CAPABILITY_MULTIBAND_ACQUISITION;
-import static android.hardware.gnss.IGnssPowerIndicationCallback.CAPABILITY_MULTIBAND_TRACKING;
-import static android.hardware.gnss.IGnssPowerIndicationCallback.CAPABILITY_OTHER_MODES;
-import static android.hardware.gnss.IGnssPowerIndicationCallback.CAPABILITY_SINGLEBAND_ACQUISITION;
-import static android.hardware.gnss.IGnssPowerIndicationCallback.CAPABILITY_SINGLEBAND_TRACKING;
-import static android.hardware.gnss.IGnssPowerIndicationCallback.CAPABILITY_TOTAL;
-
-import android.util.Log;
-
-import java.io.FileDescriptor;
-import java.io.PrintWriter;
-
-/**
- * Manages GNSS Power Indication operations.
- */
-class GnssPowerIndicationProvider {
- private static final String TAG = "GnssPowerIndPdr";
- private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
- private volatile int mCapabilities;
- private GnssPowerStats mGnssPowerStats;
-
- /**
- * Handles GNSS Power Indication capabilities update from the GNSS HAL callback.
- */
- public void onCapabilitiesUpdated(int capabilities) {
- mCapabilities = capabilities;
- }
-
- public void onGnssPowerStatsAvailable(GnssPowerStats powerStats) {
- if (DEBUG) {
- Log.d(TAG, "onGnssPowerStatsAvailable: " + powerStats.toString());
- }
- powerStats.validate();
- mGnssPowerStats = powerStats;
- }
-
- /**
- * Returns the GNSS Power Indication specific capabilities.
- */
- public int getCapabilities() {
- return mCapabilities;
- }
-
- /**
- * Requests the GNSS HAL to report {@link GnssPowerStats}.
- */
- public static void requestPowerStats() {
- native_request_power_stats();
- }
-
- private boolean hasCapability(int capability) {
- return (mCapabilities & capability) != 0;
- }
-
- /**
- * Dump info for debugging.
- */
- public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
- if (mGnssPowerStats == null) {
- return;
- }
- pw.print("GnssPowerStats[");
- if (mGnssPowerStats.hasElapsedRealtimeNanos()) {
- pw.print("ElapsedRealtime=" + mGnssPowerStats.getElapsedRealtimeNanos());
- }
- if (mGnssPowerStats.hasElapsedRealtimeUncertaintyNanos()) {
- pw.print(", ElapsedRealtimeUncertaintyNanos="
- + mGnssPowerStats.getElapsedRealtimeUncertaintyNanos());
- }
- if (hasCapability(CAPABILITY_TOTAL)) {
- pw.print(", TotalEnergyMilliJoule=" + mGnssPowerStats.getTotalEnergyMilliJoule());
- }
- if (hasCapability(CAPABILITY_SINGLEBAND_TRACKING)) {
- pw.print(", SinglebandTrackingModeEnergyMilliJoule="
- + mGnssPowerStats.getSinglebandTrackingModeEnergyMilliJoule());
- }
- if (hasCapability(CAPABILITY_MULTIBAND_TRACKING)) {
- pw.print(", MultibandTrackingModeEnergyMilliJoule="
- + mGnssPowerStats.getMultibandTrackingModeEnergyMilliJoule());
- }
- if (hasCapability(CAPABILITY_SINGLEBAND_ACQUISITION)) {
- pw.print(", SinglebandAcquisitionModeEnergyMilliJoule="
- + mGnssPowerStats.getSinglebandAcquisitionModeEnergyMilliJoule());
- }
- if (hasCapability(CAPABILITY_MULTIBAND_ACQUISITION)) {
- pw.print(", MultibandAcquisitionModeEnergyMilliJoule="
- + mGnssPowerStats.getMultibandAcquisitionModeEnergyMilliJoule());
- }
- if (hasCapability(CAPABILITY_OTHER_MODES)) {
- pw.print(", OtherModesEnergyMilliJoule=[");
- double[] otherModes = mGnssPowerStats.getOtherModesEnergyMilliJoule();
- for (int i = 0; i < otherModes.length; i++) {
- pw.print(otherModes[i]);
- if (i < otherModes.length - 1) {
- pw.print(", ");
- }
- }
- pw.print("] ");
- }
- pw.println(']');
- }
-
- private static native void native_request_power_stats();
-}
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 b924d1f..924ffe1 100644
--- a/services/core/java/com/android/server/location/gnss/GnssPowerStats.java
+++ b/services/core/java/com/android/server/location/gnss/GnssPowerStats.java
@@ -19,13 +19,23 @@
import static android.hardware.gnss.ElapsedRealtime.HAS_TIMESTAMP_NS;
import static android.hardware.gnss.ElapsedRealtime.HAS_TIME_UNCERTAINTY_NS;
+import static java.util.concurrent.TimeUnit.NANOSECONDS;
+
+import android.location.GnssCapabilities;
+import android.util.IndentingPrintWriter;
+import android.util.TimeUtils;
+
import com.android.internal.util.Preconditions;
+import com.android.server.location.gnss.hal.GnssNative.GnssRealtimeFlags;
+
+import java.io.FileDescriptor;
/**
* Represents Cumulative GNSS power statistics since boot.
*/
-class GnssPowerStats {
- private final int mElapsedRealtimeFlags;
+public class GnssPowerStats {
+
+ private final @GnssRealtimeFlags int mElapsedRealtimeFlags;
private final long mElapsedRealtimeNanos;
private final double mElapsedRealtimeUncertaintyNanos;
private final double mTotalEnergyMilliJoule;
@@ -35,7 +45,7 @@
private final double mMultibandAcquisitionModeEnergyMilliJoule;
private final double[] mOtherModesEnergyMilliJoule;
- GnssPowerStats(int elapsedRealtimeFlags,
+ public GnssPowerStats(@GnssRealtimeFlags int elapsedRealtimeFlags,
long elapsedRealtimeNanos,
double elapsedRealtimeUncertaintyNanos,
double totalEnergyMilliJoule,
@@ -131,4 +141,51 @@
public void validate() {
Preconditions.checkArgument(hasElapsedRealtimeNanos());
}
+
+ /**
+ * Dumps power stat information filtered by the given capabilities.
+ */
+ public void dump(FileDescriptor fd, IndentingPrintWriter ipw, String[] args,
+ GnssCapabilities capabilities) {
+ if (hasElapsedRealtimeNanos()) {
+ ipw.print("time: ");
+ ipw.print(TimeUtils.formatRealtime(NANOSECONDS.toMillis(mElapsedRealtimeNanos)));
+ if (hasElapsedRealtimeUncertaintyNanos() && mElapsedRealtimeUncertaintyNanos != 0) {
+ ipw.print(" +/- ");
+ ipw.print(NANOSECONDS.toMillis((long) mElapsedRealtimeUncertaintyNanos));
+ }
+ }
+ if (capabilities.hasPowerTotal()) {
+ ipw.print("total power: ");
+ ipw.print(mTotalEnergyMilliJoule);
+ ipw.println("mJ");
+ }
+ if (capabilities.hasPowerSinglebandTracking()) {
+ ipw.print("single-band tracking power: ");
+ ipw.print(mSinglebandTrackingModeEnergyMilliJoule);
+ ipw.println("mJ");
+ }
+ if (capabilities.hasPowerMultibandTracking()) {
+ ipw.print("multi-band tracking power: ");
+ ipw.print(mMultibandTrackingModeEnergyMilliJoule);
+ ipw.println("mJ");
+ }
+ if (capabilities.hasPowerSinglebandAcquisition()) {
+ ipw.print("single-band acquisition power: ");
+ ipw.print(mSinglebandAcquisitionModeEnergyMilliJoule);
+ ipw.println("mJ");
+ }
+ if (capabilities.hasPowerMultibandAcquisition()) {
+ ipw.print("multi-band acquisition power: ");
+ ipw.print(mMultibandAcquisitionModeEnergyMilliJoule);
+ ipw.println("mJ");
+ }
+ if (capabilities.hasPowerOtherModes()) {
+ for (int i = 1; i <= mOtherModesEnergyMilliJoule.length; i++) {
+ ipw.print("other mode [" + i + "] power: ");
+ ipw.print(mOtherModesEnergyMilliJoule[i]);
+ ipw.println("mJ");
+ }
+ }
+ }
}
diff --git a/services/core/java/com/android/server/location/gnss/GnssStatusProvider.java b/services/core/java/com/android/server/location/gnss/GnssStatusProvider.java
index 49aa235..e0673db 100644
--- a/services/core/java/com/android/server/location/gnss/GnssStatusProvider.java
+++ b/services/core/java/com/android/server/location/gnss/GnssStatusProvider.java
@@ -20,6 +20,7 @@
import static com.android.server.location.gnss.GnssManagerService.TAG;
import android.app.AppOpsManager;
+import android.location.GnssCapabilities;
import android.location.GnssStatus;
import android.location.IGnssStatusListener;
import android.location.util.identity.CallerIdentity;
@@ -27,6 +28,7 @@
import android.stats.location.LocationStatsEnums;
import android.util.Log;
+import com.android.server.location.gnss.hal.GnssNative;
import com.android.server.location.injector.AppOpsHelper;
import com.android.server.location.injector.Injector;
import com.android.server.location.injector.LocationUsageLogger;
@@ -36,15 +38,23 @@
/**
* Implementation of a handler for {@link IGnssStatusListener}.
*/
-public class GnssStatusProvider extends GnssListenerMultiplexer<Void, IGnssStatusListener, Void> {
+public class GnssStatusProvider extends
+ GnssListenerMultiplexer<Void, IGnssStatusListener, Void> implements
+ GnssNative.BaseCallbacks, GnssNative.StatusCallbacks, GnssNative.SvStatusCallbacks {
private final AppOpsHelper mAppOpsHelper;
private final LocationUsageLogger mLogger;
- public GnssStatusProvider(Injector injector) {
+ private boolean mIsNavigating = false;
+
+ public GnssStatusProvider(Injector injector, GnssNative gnssNative) {
super(injector);
mAppOpsHelper = injector.getAppOpsHelper();
mLogger = injector.getLocationUsageLogger();
+
+ gnssNative.addBaseCallbacks(this);
+ gnssNative.addStatusCallbacks(this);
+ gnssNative.addSvStatusCallbacks(this);
}
@Override
@@ -95,30 +105,50 @@
registration.isForeground());
}
- /**
- * Called by GnssLocationProvider.
- */
- public void onStatusChanged(boolean isNavigating) {
- if (isNavigating) {
- deliverToListeners(IGnssStatusListener::onGnssStarted);
- } else {
- deliverToListeners(IGnssStatusListener::onGnssStopped);
+ @Override
+ public void onHalRestarted() {
+ resetService();
+ }
+
+ @Override
+ public void onCapabilitiesChanged(GnssCapabilities oldCapabilities,
+ GnssCapabilities newCapabilities) {}
+
+ @Override
+ public void onReportStatus(@GnssNative.StatusCallbacks.GnssStatusValue int gnssStatus) {
+ boolean isNavigating;
+ switch (gnssStatus) {
+ case GNSS_STATUS_SESSION_BEGIN:
+ isNavigating = true;
+ break;
+ case GNSS_STATUS_SESSION_END:
+ // fall through
+ case GNSS_STATUS_ENGINE_OFF:
+ isNavigating = false;
+ break;
+ default:
+ isNavigating = mIsNavigating;
+ }
+
+ if (isNavigating != mIsNavigating) {
+ mIsNavigating = isNavigating;
+ if (isNavigating) {
+ deliverToListeners(IGnssStatusListener::onGnssStarted);
+ } else {
+ deliverToListeners(IGnssStatusListener::onGnssStopped);
+ }
}
}
- /**
- * Called by GnssLocationProvider.
- */
- public void onFirstFix(int ttff) {
+ @Override
+ public void onReportFirstFix(int ttff) {
deliverToListeners(listener -> {
listener.onFirstFix(ttff);
});
}
- /**
- * Called by GnssLocationProvider.
- */
- public void onSvStatusChanged(GnssStatus gnssStatus) {
+ @Override
+ public void onReportSvStatus(GnssStatus gnssStatus) {
deliverToListeners(registration -> {
if (mAppOpsHelper.noteOpNoThrow(AppOpsManager.OP_FINE_LOCATION,
registration.getIdentity())) {
@@ -128,18 +158,4 @@
}
});
}
-
- /**
- * Called by GnssLocationProvider.
- */
- public void onNmeaReceived(long timestamp, String nmea) {
- deliverToListeners(registration -> {
- if (mAppOpsHelper.noteOpNoThrow(AppOpsManager.OP_FINE_LOCATION,
- registration.getIdentity())) {
- return listener -> listener.onNmeaReceived(timestamp, nmea);
- } else {
- return null;
- }
- });
- }
}
diff --git a/services/core/java/com/android/server/location/gnss/hal/GnssNative.java b/services/core/java/com/android/server/location/gnss/hal/GnssNative.java
new file mode 100644
index 0000000..89d8249
--- /dev/null
+++ b/services/core/java/com/android/server/location/gnss/hal/GnssNative.java
@@ -0,0 +1,1490 @@
+/*
+ * 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.location.gnss.hal;
+
+import static com.android.server.location.gnss.GnssManagerService.TAG;
+
+import android.annotation.IntDef;
+import android.annotation.Nullable;
+import android.location.GnssAntennaInfo;
+import android.location.GnssCapabilities;
+import android.location.GnssMeasurementCorrections;
+import android.location.GnssMeasurementsEvent;
+import android.location.GnssNavigationMessage;
+import android.location.GnssStatus;
+import android.location.Location;
+import android.os.SystemClock;
+import android.util.Log;
+
+import com.android.internal.annotations.GuardedBy;
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.util.ArrayUtils;
+import com.android.internal.util.Preconditions;
+import com.android.server.FgThread;
+import com.android.server.location.gnss.GnssConfiguration;
+import com.android.server.location.gnss.GnssPowerStats;
+import com.android.server.location.injector.EmergencyHelper;
+import com.android.server.location.injector.Injector;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * Entry point for most GNSS HAL commands and callbacks.
+ */
+public class GnssNative {
+
+ // IMPORTANT - must match GnssPositionMode enum in IGnss.hal
+ public static final int GNSS_POSITION_MODE_STANDALONE = 0;
+ public static final int GNSS_POSITION_MODE_MS_BASED = 1;
+ public static final int GNSS_POSITION_MODE_MS_ASSISTED = 2;
+
+ @IntDef(prefix = "GNSS_POSITION_MODE_", value = {GNSS_POSITION_MODE_STANDALONE,
+ GNSS_POSITION_MODE_MS_BASED, GNSS_POSITION_MODE_MS_ASSISTED})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface GnssPositionMode {}
+
+ // IMPORTANT - must match GnssPositionRecurrence enum in IGnss.hal
+ public static final int GNSS_POSITION_RECURRENCE_PERIODIC = 0;
+ public static final int GNSS_POSITION_RECURRENCE_SINGLE = 1;
+
+ @IntDef(prefix = "GNSS_POSITION_RECURRENCE_", value = {GNSS_POSITION_RECURRENCE_PERIODIC,
+ GNSS_POSITION_RECURRENCE_SINGLE})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface GnssPositionRecurrence {}
+
+ // IMPORTANT - must match the GnssLocationFlags enum in types.hal
+ public static final int GNSS_LOCATION_HAS_LAT_LONG = 1;
+ public static final int GNSS_LOCATION_HAS_ALTITUDE = 2;
+ public static final int GNSS_LOCATION_HAS_SPEED = 4;
+ public static final int GNSS_LOCATION_HAS_BEARING = 8;
+ public static final int GNSS_LOCATION_HAS_HORIZONTAL_ACCURACY = 16;
+ public static final int GNSS_LOCATION_HAS_VERTICAL_ACCURACY = 32;
+ public static final int GNSS_LOCATION_HAS_SPEED_ACCURACY = 64;
+ public static final int GNSS_LOCATION_HAS_BEARING_ACCURACY = 128;
+
+ @IntDef(flag = true, prefix = "GNSS_LOCATION_", value = {GNSS_LOCATION_HAS_LAT_LONG,
+ GNSS_LOCATION_HAS_ALTITUDE, GNSS_LOCATION_HAS_SPEED, GNSS_LOCATION_HAS_BEARING,
+ GNSS_LOCATION_HAS_HORIZONTAL_ACCURACY, GNSS_LOCATION_HAS_VERTICAL_ACCURACY,
+ GNSS_LOCATION_HAS_SPEED_ACCURACY, GNSS_LOCATION_HAS_BEARING_ACCURACY})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface GnssLocationFlags {}
+
+ // IMPORTANT - must match the ElapsedRealtimeFlags enum in types.hal
+ public static final int GNSS_REALTIME_HAS_TIMESTAMP_NS = 1;
+ public static final int GNSS_REALTIME_HAS_TIME_UNCERTAINTY_NS = 2;
+
+ @IntDef(flag = true, value = {GNSS_REALTIME_HAS_TIMESTAMP_NS,
+ GNSS_REALTIME_HAS_TIME_UNCERTAINTY_NS})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface GnssRealtimeFlags {}
+
+ // IMPORTANT - must match the GnssAidingData enum in IGnss.hal
+ public static final int GNSS_AIDING_TYPE_EPHEMERIS = 0x0001;
+ public static final int GNSS_AIDING_TYPE_ALMANAC = 0x0002;
+ public static final int GNSS_AIDING_TYPE_POSITION = 0x0004;
+ public static final int GNSS_AIDING_TYPE_TIME = 0x0008;
+ public static final int GNSS_AIDING_TYPE_IONO = 0x0010;
+ public static final int GNSS_AIDING_TYPE_UTC = 0x0020;
+ public static final int GNSS_AIDING_TYPE_HEALTH = 0x0040;
+ public static final int GNSS_AIDING_TYPE_SVDIR = 0x0080;
+ public static final int GNSS_AIDING_TYPE_SVSTEER = 0x0100;
+ public static final int GNSS_AIDING_TYPE_SADATA = 0x0200;
+ public static final int GNSS_AIDING_TYPE_RTI = 0x0400;
+ public static final int GNSS_AIDING_TYPE_CELLDB_INFO = 0x8000;
+ public static final int GNSS_AIDING_TYPE_ALL = 0xFFFF;
+
+ @IntDef(flag = true, prefix = "GNSS_AIDING_", value = {GNSS_AIDING_TYPE_EPHEMERIS,
+ GNSS_AIDING_TYPE_ALMANAC, GNSS_AIDING_TYPE_POSITION, GNSS_AIDING_TYPE_TIME,
+ GNSS_AIDING_TYPE_IONO, GNSS_AIDING_TYPE_UTC, GNSS_AIDING_TYPE_HEALTH,
+ GNSS_AIDING_TYPE_SVDIR, GNSS_AIDING_TYPE_SVSTEER, GNSS_AIDING_TYPE_SADATA,
+ GNSS_AIDING_TYPE_RTI, GNSS_AIDING_TYPE_CELLDB_INFO, GNSS_AIDING_TYPE_ALL})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface GnssAidingTypeFlags {}
+
+ // IMPORTANT - must match OEM definitions, this isn't part of a hal for some reason
+ public static final int AGPS_REF_LOCATION_TYPE_GSM_CELLID = 1;
+ public static final int AGPS_REF_LOCATION_TYPE_UMTS_CELLID = 2;
+
+ @IntDef(prefix = "AGPS_REF_LOCATION_TYPE_", value = {AGPS_REF_LOCATION_TYPE_GSM_CELLID,
+ AGPS_REF_LOCATION_TYPE_UMTS_CELLID})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface AgpsReferenceLocationType {}
+
+ // IMPORTANT - must match OEM definitions, this isn't part of a hal for some reason
+ public static final int AGPS_SETID_TYPE_NONE = 0;
+ public static final int AGPS_SETID_TYPE_IMSI = 1;
+ public static final int AGPS_SETID_TYPE_MSISDN = 2;
+
+ @IntDef(prefix = "AGPS_SETID_TYPE_", value = {AGPS_SETID_TYPE_NONE, AGPS_SETID_TYPE_IMSI,
+ AGPS_SETID_TYPE_MSISDN})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface AgpsSetIdType {}
+
+ /** Callbacks relevant to the entire HAL. */
+ public interface BaseCallbacks {
+ void onHalRestarted();
+ void onCapabilitiesChanged(GnssCapabilities oldCapabilities,
+ GnssCapabilities newCapabilities);
+ }
+
+ /** Callbacks for status events. */
+ public interface StatusCallbacks {
+
+ // IMPORTANT - must match GnssStatusValue enum in IGnssCallback.hal
+ int GNSS_STATUS_NONE = 0;
+ int GNSS_STATUS_SESSION_BEGIN = 1;
+ int GNSS_STATUS_SESSION_END = 2;
+ int GNSS_STATUS_ENGINE_ON = 3;
+ int GNSS_STATUS_ENGINE_OFF = 4;
+
+ @IntDef(prefix = "GNSS_STATUS_", value = {GNSS_STATUS_NONE, GNSS_STATUS_SESSION_BEGIN,
+ GNSS_STATUS_SESSION_END, GNSS_STATUS_ENGINE_ON, GNSS_STATUS_ENGINE_OFF})
+ @Retention(RetentionPolicy.SOURCE)
+ @interface GnssStatusValue {}
+
+ void onReportStatus(@GnssStatusValue int status);
+ void onReportFirstFix(int ttff);
+ }
+
+ /** Callbacks for SV status events. */
+ public interface SvStatusCallbacks {
+ void onReportSvStatus(GnssStatus gnssStatus);
+ }
+
+ /** Callbacks for NMEA events. */
+ public interface NmeaCallbacks {
+ void onReportNmea(long timestamp);
+ }
+
+ /** Callbacks for location events. */
+ public interface LocationCallbacks {
+ void onReportLocation(boolean hasLatLong, Location location);
+ void onReportLocations(Location[] locations);
+ }
+
+ /** Callbacks for measurement events. */
+ public interface MeasurementCallbacks {
+ void onReportMeasurements(GnssMeasurementsEvent event);
+ }
+
+ /** Callbacks for antenna info events. */
+ public interface AntennaInfoCallbacks {
+ void onReportAntennaInfo(List<GnssAntennaInfo> antennaInfos);
+ }
+
+ /** Callbacks for navigation message events. */
+ public interface NavigationMessageCallbacks {
+ void onReportNavigationMessage(GnssNavigationMessage event);
+ }
+
+ /** Callbacks for geofence events. */
+ public interface GeofenceCallbacks {
+
+ // IMPORTANT - must match GeofenceTransition enum in IGnssGeofenceCallback.hal
+ int GEOFENCE_TRANSITION_ENTERED = 1 << 0L;
+ int GEOFENCE_TRANSITION_EXITED = 1 << 1L;
+ int GEOFENCE_TRANSITION_UNCERTAIN = 1 << 2L;
+
+ @IntDef(prefix = "GEOFENCE_TRANSITION_", value = {GEOFENCE_TRANSITION_ENTERED,
+ GEOFENCE_TRANSITION_EXITED, GEOFENCE_TRANSITION_UNCERTAIN})
+ @Retention(RetentionPolicy.SOURCE)
+ @interface GeofenceTransition {}
+
+ // IMPORTANT - must match GeofenceAvailability enum in IGnssGeofenceCallback.hal
+ int GEOFENCE_AVAILABILITY_UNAVAILABLE = 1 << 0L;
+ int GEOFENCE_AVAILABILITY_AVAILABLE = 1 << 1L;
+
+ @IntDef(prefix = "GEOFENCE_AVAILABILITY_", value = {GEOFENCE_AVAILABILITY_UNAVAILABLE,
+ GEOFENCE_AVAILABILITY_AVAILABLE})
+ @Retention(RetentionPolicy.SOURCE)
+ @interface GeofenceAvailability {}
+
+ // IMPORTANT - must match GeofenceStatus enum in IGnssGeofenceCallback.hal
+ int GEOFENCE_STATUS_OPERATION_SUCCESS = 0;
+ int GEOFENCE_STATUS_ERROR_TOO_MANY_GEOFENCES = 100;
+ int GEOFENCE_STATUS_ERROR_ID_EXISTS = -101;
+ int GEOFENCE_STATUS_ERROR_ID_UNKNOWN = -102;
+ int GEOFENCE_STATUS_ERROR_INVALID_TRANSITION = -103;
+ int GEOFENCE_STATUS_ERROR_GENERIC = -149;
+
+ @IntDef(prefix = "GEOFENCE_STATUS_", value = {GEOFENCE_STATUS_OPERATION_SUCCESS,
+ GEOFENCE_STATUS_ERROR_TOO_MANY_GEOFENCES, GEOFENCE_STATUS_ERROR_ID_EXISTS,
+ GEOFENCE_STATUS_ERROR_ID_UNKNOWN, GEOFENCE_STATUS_ERROR_INVALID_TRANSITION,
+ GEOFENCE_STATUS_ERROR_GENERIC})
+ @Retention(RetentionPolicy.SOURCE)
+ @interface GeofenceStatus {}
+
+ void onReportGeofenceTransition(int geofenceId, Location location,
+ @GeofenceTransition int transition, long timestamp);
+ void onReportGeofenceStatus(@GeofenceAvailability int availabilityStatus,
+ Location location);
+ void onReportGeofenceAddStatus(int geofenceId, @GeofenceStatus int status);
+ void onReportGeofenceRemoveStatus(int geofenceId, @GeofenceStatus int status);
+ void onReportGeofencePauseStatus(int geofenceId, @GeofenceStatus int status);
+ void onReportGeofenceResumeStatus(int geofenceId, @GeofenceStatus int status);
+ }
+
+ /** Callbacks for the HAL requesting time. */
+ public interface TimeCallbacks {
+ void onRequestUtcTime();
+ }
+
+ /** Callbacks for the HAL requesting locations. */
+ public interface LocationRequestCallbacks {
+ void onRequestLocation(boolean independentFromGnss, boolean isUserEmergency);
+ void onRequestRefLocation();
+ }
+
+ /** Callbacks for HAL requesting PSDS download. */
+ public interface PsdsCallbacks {
+ void onRequestPsdsDownload(int psdsType);
+ }
+
+ /** Callbacks for AGPS functionality. */
+ public interface AGpsCallbacks {
+
+ // IMPORTANT - must match OEM definitions, this isn't part of a hal for some reason
+ int AGPS_REQUEST_SETID_IMSI = 1 << 0L;
+ int AGPS_REQUEST_SETID_MSISDN = 1 << 1L;
+
+ @IntDef(flag = true, prefix = "AGPS_REQUEST_SETID_", value = {AGPS_REQUEST_SETID_IMSI,
+ AGPS_REQUEST_SETID_MSISDN})
+ @Retention(RetentionPolicy.SOURCE)
+ @interface AgpsSetIdFlags {}
+
+ void onReportAGpsStatus(int agpsType, int agpsStatus, byte[] suplIpAddr);
+ void onRequestSetID(@AgpsSetIdFlags int flags);
+ }
+
+ /** Callbacks for notifications. */
+ public interface NotificationCallbacks {
+ void onReportNiNotification(int notificationId, int niType, int notifyFlags,
+ int timeout, int defaultResponse, String requestorId, String text,
+ int requestorIdEncoding, int textEncoding);
+ void onReportNfwNotification(String proxyAppPackageName, byte protocolStack,
+ String otherProtocolStackName, byte requestor, String requestorId,
+ byte responseType, boolean inEmergencyMode, boolean isCachedLocation);
+ }
+
+ // set lower than the current ITAR limit of 600m/s to allow this to trigger even if GPS HAL
+ // stops output right at 600m/s, depriving this of the information of a device that reaches
+ // greater than 600m/s, and higher than the speed of sound to avoid impacting most use cases.
+ private static final float ITAR_SPEED_LIMIT_METERS_PER_SECOND = 400.0f;
+
+ /**
+ * Indicates that this method is a native entry point. Useful purely for IDEs which can
+ * understand entry points, and thus eliminate incorrect warnings about methods not used.
+ */
+ @Target(ElementType.METHOD)
+ @Retention(RetentionPolicy.SOURCE)
+ private @interface NativeEntryPoint {}
+
+ @GuardedBy("GnssNative.class")
+ private static GnssHal sGnssHal;
+
+ @GuardedBy("GnssNative.class")
+ private static boolean sGnssHalInitialized;
+
+ @GuardedBy("GnssNative.class")
+ private static GnssNative sInstance;
+
+ /**
+ * Sets GnssHal instance to use for testing.
+ */
+ @VisibleForTesting
+ public static synchronized void setGnssHalForTest(GnssHal gnssHal) {
+ sGnssHal = Objects.requireNonNull(gnssHal);
+ sGnssHalInitialized = false;
+ sInstance = null;
+ }
+
+ private static synchronized void initializeHal() {
+ if (!sGnssHalInitialized) {
+ if (sGnssHal == null) {
+ sGnssHal = new GnssHal();
+ }
+ sGnssHal.classInitOnce();
+ sGnssHalInitialized = true;
+ }
+ }
+
+ /**
+ * Returns true if GNSS is supported on this device. If true, then
+ * {@link #create(Injector, GnssConfiguration)} may be invoked.
+ */
+ public static synchronized boolean isSupported() {
+ initializeHal();
+ return sGnssHal.isSupported();
+ }
+
+ /**
+ * Creates a new instance of GnssNative. Should only be invoked if {@link #isSupported()} is
+ * true. May only be invoked once.
+ */
+ public static synchronized GnssNative create(Injector injector,
+ GnssConfiguration configuration) {
+ // side effect - ensures initialization
+ Preconditions.checkState(isSupported());
+ Preconditions.checkState(sInstance == null);
+ return (sInstance = new GnssNative(sGnssHal, injector, configuration));
+ }
+
+ private final GnssHal mGnssHal;
+ private final EmergencyHelper mEmergencyHelper;
+ private final GnssConfiguration mConfiguration;
+
+ // these callbacks may have multiple implementations
+ private BaseCallbacks[] mBaseCallbacks = new BaseCallbacks[0];
+ private StatusCallbacks[] mStatusCallbacks = new StatusCallbacks[0];
+ private SvStatusCallbacks[] mSvStatusCallbacks = new SvStatusCallbacks[0];
+ private NmeaCallbacks[] mNmeaCallbacks = new NmeaCallbacks[0];
+ private LocationCallbacks[] mLocationCallbacks = new LocationCallbacks[0];
+ private MeasurementCallbacks[] mMeasurementCallbacks = new MeasurementCallbacks[0];
+ private AntennaInfoCallbacks[] mAntennaInfoCallbacks = new AntennaInfoCallbacks[0];
+ private NavigationMessageCallbacks[] mNavigationMessageCallbacks =
+ new NavigationMessageCallbacks[0];
+
+ // these callbacks may only have a single implementation
+ private GeofenceCallbacks mGeofenceCallbacks;
+ private TimeCallbacks mTimeCallbacks;
+ private LocationRequestCallbacks mLocationRequestCallbacks;
+ private PsdsCallbacks mPsdsCallbacks;
+ private AGpsCallbacks mAGpsCallbacks;
+ private NotificationCallbacks mNotificationCallbacks;
+
+ private boolean mRegistered;
+
+ private volatile boolean mItarSpeedLimitExceeded;
+
+ private GnssCapabilities mCapabilities = new GnssCapabilities.Builder().build();
+ private @Nullable GnssPowerStats mPowerStats = null;
+ private int mHardwareYear = 0;
+ private @Nullable String mHardwareModelName = null;
+ private long mStartRealtimeMs = 0;
+ private boolean mHasFirstFix = false;
+
+ private GnssNative(GnssHal gnssHal, Injector injector, GnssConfiguration configuration) {
+ mGnssHal = Objects.requireNonNull(gnssHal);
+ mEmergencyHelper = injector.getEmergencyHelper();
+ mConfiguration = configuration;
+ }
+
+ public void addBaseCallbacks(BaseCallbacks callbacks) {
+ Preconditions.checkState(!mRegistered);
+ mBaseCallbacks = ArrayUtils.appendElement(BaseCallbacks.class, mBaseCallbacks, callbacks);
+ }
+
+ public void addStatusCallbacks(StatusCallbacks callbacks) {
+ Preconditions.checkState(!mRegistered);
+ mStatusCallbacks = ArrayUtils.appendElement(StatusCallbacks.class, mStatusCallbacks,
+ callbacks);
+ }
+
+ public void addSvStatusCallbacks(SvStatusCallbacks callbacks) {
+ Preconditions.checkState(!mRegistered);
+ mSvStatusCallbacks = ArrayUtils.appendElement(SvStatusCallbacks.class, mSvStatusCallbacks,
+ callbacks);
+ }
+
+ public void addNmeaCallbacks(NmeaCallbacks callbacks) {
+ Preconditions.checkState(!mRegistered);
+ mNmeaCallbacks = ArrayUtils.appendElement(NmeaCallbacks.class, mNmeaCallbacks,
+ callbacks);
+ }
+
+ public void addLocationCallbacks(LocationCallbacks callbacks) {
+ Preconditions.checkState(!mRegistered);
+ mLocationCallbacks = ArrayUtils.appendElement(LocationCallbacks.class, mLocationCallbacks,
+ callbacks);
+ }
+
+ public void addMeasurementCallbacks(MeasurementCallbacks callbacks) {
+ Preconditions.checkState(!mRegistered);
+ mMeasurementCallbacks = ArrayUtils.appendElement(MeasurementCallbacks.class,
+ mMeasurementCallbacks, callbacks);
+ }
+
+ public void addAntennaInfoCallbacks(AntennaInfoCallbacks callbacks) {
+ Preconditions.checkState(!mRegistered);
+ mAntennaInfoCallbacks = ArrayUtils.appendElement(AntennaInfoCallbacks.class,
+ mAntennaInfoCallbacks, callbacks);
+ }
+
+ public void addNavigationMessageCallbacks(NavigationMessageCallbacks callbacks) {
+ Preconditions.checkState(!mRegistered);
+ mNavigationMessageCallbacks = ArrayUtils.appendElement(NavigationMessageCallbacks.class,
+ mNavigationMessageCallbacks, callbacks);
+ }
+
+ public void setGeofenceCallbacks(GeofenceCallbacks callbacks) {
+ Preconditions.checkState(!mRegistered);
+ Preconditions.checkState(mGeofenceCallbacks == null);
+ mGeofenceCallbacks = Objects.requireNonNull(callbacks);
+ }
+
+ public void setTimeCallbacks(TimeCallbacks callbacks) {
+ Preconditions.checkState(!mRegistered);
+ Preconditions.checkState(mTimeCallbacks == null);
+ mTimeCallbacks = Objects.requireNonNull(callbacks);
+ }
+
+ public void setLocationRequestCallbacks(LocationRequestCallbacks callbacks) {
+ Preconditions.checkState(!mRegistered);
+ Preconditions.checkState(mLocationRequestCallbacks == null);
+ mLocationRequestCallbacks = Objects.requireNonNull(callbacks);
+ }
+
+ public void setPsdsCallbacks(PsdsCallbacks callbacks) {
+ Preconditions.checkState(!mRegistered);
+ Preconditions.checkState(mPsdsCallbacks == null);
+ mPsdsCallbacks = Objects.requireNonNull(callbacks);
+ }
+
+ public void setAGpsCallbacks(AGpsCallbacks callbacks) {
+ Preconditions.checkState(!mRegistered);
+ Preconditions.checkState(mAGpsCallbacks == null);
+ mAGpsCallbacks = Objects.requireNonNull(callbacks);
+ }
+
+ public void setNotificationCallbacks(NotificationCallbacks callbacks) {
+ Preconditions.checkState(!mRegistered);
+ Preconditions.checkState(mNotificationCallbacks == null);
+ mNotificationCallbacks = Objects.requireNonNull(callbacks);
+ }
+
+ /**
+ * Registers with the HAL and allows callbacks to begin. Once registered with the native HAL,
+ * no more callbacks can be added or set. Must only be called once.
+ */
+ public void register() {
+ Preconditions.checkState(!mRegistered);
+ mRegistered = true;
+
+ initializeGnss(false);
+ }
+
+ private void initializeGnss(boolean restart) {
+ Preconditions.checkState(mRegistered);
+ mGnssHal.initOnce(GnssNative.this, restart);
+
+ // gnss chipset appears to require an init/cleanup cycle on startup in order to properly
+ // initialize - undocumented and no idea why this is the case
+ if (mGnssHal.init()) {
+ mGnssHal.cleanup();
+ Log.i(TAG, "gnss hal initialized");
+ } else {
+ Log.e(TAG, "gnss hal initialization failed");
+ }
+ }
+
+ public GnssConfiguration getConfiguration() {
+ return mConfiguration;
+ }
+
+ /**
+ * Starts up GNSS HAL, and has undocumented side effect of informing HAL that location is
+ * allowed by settings.
+ */
+ public boolean init() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.init();
+ }
+
+ /**
+ * Shuts down GNSS HAL, and has undocumented side effect of informing HAL that location is not
+ * allowed by settings.
+ */
+ public void cleanup() {
+ Preconditions.checkState(mRegistered);
+ mGnssHal.cleanup();
+ }
+
+ /**
+ * Returns the latest power stats from the GNSS HAL.
+ */
+ public @Nullable GnssPowerStats getPowerStats() {
+ return mPowerStats;
+ }
+
+ /**
+ * Returns current capabilities of the GNSS HAL.
+ */
+ public GnssCapabilities getCapabilities() {
+ return mCapabilities;
+ }
+
+ /**
+ * Returns hardware year of GNSS chipset.
+ */
+ public int getHardwareYear() {
+ return mHardwareYear;
+ }
+
+ /**
+ * Returns hardware model name of GNSS chipset.
+ */
+ public @Nullable String getHardwareModelName() {
+ return mHardwareModelName;
+ }
+
+ /**
+ * Returns true if the ITAR speed limit is currently being exceeded, and thus location
+ * information may be blocked.
+ */
+ public boolean isItarSpeedLimitExceeded() {
+ return mItarSpeedLimitExceeded;
+ }
+
+ /**
+ * Starts the GNSS HAL.
+ */
+ public boolean start() {
+ Preconditions.checkState(mRegistered);
+ mStartRealtimeMs = SystemClock.elapsedRealtime();
+ mHasFirstFix = false;
+ return mGnssHal.start();
+ }
+
+ /**
+ * Stops the GNSS HAL.
+ */
+ public boolean stop() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.stop();
+ }
+
+ /**
+ * Sets the position mode.
+ */
+ public boolean setPositionMode(@GnssPositionMode int mode,
+ @GnssPositionRecurrence int recurrence, int minInterval, int preferredAccuracy,
+ int preferredTime, boolean lowPowerMode) {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.setPositionMode(mode, recurrence, minInterval, preferredAccuracy,
+ preferredTime, lowPowerMode);
+ }
+
+ /**
+ * Returns a debug string from the GNSS HAL.
+ */
+ public String getInternalState() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.getInternalState();
+ }
+
+ /**
+ * Deletes any aiding data specified by the given flags.
+ */
+ public void deleteAidingData(@GnssAidingTypeFlags int flags) {
+ Preconditions.checkState(mRegistered);
+ mGnssHal.deleteAidingData(flags);
+ }
+
+ /**
+ * Reads an NMEA message into the given buffer, returning the number of bytes loaded into the
+ * buffer.
+ */
+ public int readNmea(byte[] buffer, int bufferSize) {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.readNmea(buffer, bufferSize);
+ }
+
+ /**
+ * Injects location information into the GNSS HAL.
+ */
+ public void injectLocation(Location location) {
+ Preconditions.checkState(mRegistered);
+ if (location.hasAccuracy()) {
+ mGnssHal.injectLocation(location.getLatitude(), location.getLongitude(),
+ location.getAccuracy());
+ }
+ }
+
+ /**
+ * Injects a location into the GNSS HAL in response to a HAL request for location.
+ */
+ public void injectBestLocation(Location location) {
+ Preconditions.checkState(mRegistered);
+
+ int gnssLocationFlags = GNSS_LOCATION_HAS_LAT_LONG
+ | (location.hasAltitude() ? GNSS_LOCATION_HAS_ALTITUDE : 0)
+ | (location.hasSpeed() ? GNSS_LOCATION_HAS_SPEED : 0)
+ | (location.hasBearing() ? GNSS_LOCATION_HAS_BEARING : 0)
+ | (location.hasAccuracy() ? GNSS_LOCATION_HAS_HORIZONTAL_ACCURACY : 0)
+ | (location.hasVerticalAccuracy() ? GNSS_LOCATION_HAS_VERTICAL_ACCURACY : 0)
+ | (location.hasSpeedAccuracy() ? GNSS_LOCATION_HAS_SPEED_ACCURACY : 0)
+ | (location.hasBearingAccuracy() ? GNSS_LOCATION_HAS_BEARING_ACCURACY : 0);
+
+ double latitudeDegrees = location.getLatitude();
+ double longitudeDegrees = location.getLongitude();
+ double altitudeMeters = location.getAltitude();
+ float speedMetersPerSec = location.getSpeed();
+ float bearingDegrees = location.getBearing();
+ float horizontalAccuracyMeters = location.getAccuracy();
+ float verticalAccuracyMeters = location.getVerticalAccuracyMeters();
+ float speedAccuracyMetersPerSecond = location.getSpeedAccuracyMetersPerSecond();
+ float bearingAccuracyDegrees = location.getBearingAccuracyDegrees();
+ long timestamp = location.getTime();
+
+ int elapsedRealtimeFlags = GNSS_REALTIME_HAS_TIMESTAMP_NS
+ | (location.hasElapsedRealtimeUncertaintyNanos()
+ ? GNSS_REALTIME_HAS_TIME_UNCERTAINTY_NS : 0);
+ long elapsedRealtimeNanos = location.getElapsedRealtimeNanos();
+ double elapsedRealtimeUncertaintyNanos = location.getElapsedRealtimeUncertaintyNanos();
+
+ mGnssHal.injectBestLocation(gnssLocationFlags, latitudeDegrees, longitudeDegrees,
+ altitudeMeters, speedMetersPerSec, bearingDegrees, horizontalAccuracyMeters,
+ verticalAccuracyMeters, speedAccuracyMetersPerSecond, bearingAccuracyDegrees,
+ timestamp, elapsedRealtimeFlags, elapsedRealtimeNanos,
+ elapsedRealtimeUncertaintyNanos);
+ }
+
+ /**
+ * Injects time information into the GNSS HAL.
+ */
+ public void injectTime(long time, long timeReference, int uncertainty) {
+ Preconditions.checkState(mRegistered);
+ mGnssHal.injectTime(time, timeReference, uncertainty);
+ }
+
+ /**
+ * Returns true if navigation message collection is supported.
+ */
+ public boolean isNavigationMessageCollectionSupported() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.isNavigationMessageCollectionSupported();
+ }
+
+ /**
+ * Starts navigation message collection.
+ */
+ public boolean startNavigationMessageCollection() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.startNavigationMessageCollection();
+ }
+
+ /**
+ * Stops navigation message collection.
+ */
+ public boolean stopNavigationMessageCollection() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.stopNavigationMessageCollection();
+ }
+
+ /**
+ * Returns true if antenna info listening is supported.
+ */
+ public boolean isAntennaInfoListeningSupported() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.isAntennaInfoListeningSupported();
+ }
+
+ /**
+ * Starts antenna info listening.
+ */
+ public boolean startAntennaInfoListening() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.startAntennaInfoListening();
+ }
+
+ /**
+ * Stops antenna info listening.
+ */
+ public boolean stopAntennaInfoListening() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.stopAntennaInfoListening();
+ }
+
+ /**
+ * Returns true if measurement collection is supported.
+ */
+ public boolean isMeasurementSupported() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.isMeasurementSupported();
+ }
+
+ /**
+ * Starts measurement collection.
+ */
+ public boolean startMeasurementCollection(boolean enableFullTracking) {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.startMeasurementCollection(enableFullTracking);
+ }
+
+ /**
+ * Stops measurement collection.
+ */
+ public boolean stopMeasurementCollection() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.stopMeasurementCollection();
+ }
+
+ /**
+ * Returns true if measurement corrections are supported.
+ */
+ public boolean isMeasurementCorrectionsSupported() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.isMeasurementCorrectionsSupported();
+ }
+
+ /**
+ * Injects measurement corrections into the GNSS HAL.
+ */
+ public boolean injectMeasurementCorrections(GnssMeasurementCorrections corrections) {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.injectMeasurementCorrections(corrections);
+ }
+
+ /**
+ * Initialize batching.
+ */
+ public boolean initBatching() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.initBatching();
+ }
+
+ /**
+ * Cleanup batching.
+ */
+ public void cleanupBatching() {
+ Preconditions.checkState(mRegistered);
+ mGnssHal.cleanupBatching();
+ }
+
+ /**
+ * Start batching.
+ */
+ public boolean startBatch(long periodNanos, boolean wakeOnFifoFull) {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.startBatch(periodNanos, wakeOnFifoFull);
+ }
+
+ /**
+ * Flush batching.
+ */
+ public void flushBatch() {
+ Preconditions.checkState(mRegistered);
+ mGnssHal.flushBatch();
+ }
+
+ /**
+ * Stop batching.
+ */
+ public void stopBatch() {
+ Preconditions.checkState(mRegistered);
+ mGnssHal.stopBatch();
+ }
+
+ /**
+ * Get current batching size.
+ */
+ public int getBatchSize() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.getBatchSize();
+ }
+
+ /**
+ * Check if GNSS geofencing is supported.
+ */
+ public boolean isGeofencingSupported() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.isGeofencingSupported();
+ }
+
+ /**
+ * Add geofence.
+ */
+ public boolean addGeofence(int geofenceId, double latitude, double longitude, double radius,
+ int lastTransition, int monitorTransitions, int notificationResponsiveness,
+ int unknownTimer) {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.addGeofence(geofenceId, latitude, longitude, radius, lastTransition,
+ monitorTransitions, notificationResponsiveness, unknownTimer);
+ }
+
+ /**
+ * Resume geofence.
+ */
+ public boolean resumeGeofence(int geofenceId, int monitorTransitions) {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.resumeGeofence(geofenceId, monitorTransitions);
+ }
+
+ /**
+ * Pause geofence.
+ */
+ public boolean pauseGeofence(int geofenceId) {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.pauseGeofence(geofenceId);
+ }
+
+ /**
+ * Remove geofence.
+ */
+ public boolean removeGeofence(int geofenceId) {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.removeGeofence(geofenceId);
+ }
+
+ /**
+ * Returns true if visibility control is supported.
+ */
+ public boolean isGnssVisibilityControlSupported() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.isGnssVisibilityControlSupported();
+ }
+
+ /**
+ * Send a network initiated respnse.
+ */
+ public void sendNiResponse(int notificationId, int userResponse) {
+ Preconditions.checkState(mRegistered);
+ mGnssHal.sendNiResponse(notificationId, userResponse);
+ }
+
+ /**
+ * Request an eventual update of GNSS power statistics.
+ */
+ public void requestPowerStats() {
+ Preconditions.checkState(mRegistered);
+ mGnssHal.requestPowerStats();
+ }
+
+ /**
+ * Sets AGPS server information.
+ */
+ public void setAgpsServer(int type, String hostname, int port) {
+ Preconditions.checkState(mRegistered);
+ mGnssHal.setAgpsServer(type, hostname, port);
+ }
+
+ /**
+ * Sets AGPS set id.
+ */
+ public void setAgpsSetId(@AgpsSetIdType int type, String setId) {
+ Preconditions.checkState(mRegistered);
+ mGnssHal.setAgpsSetId(type, setId);
+ }
+
+ /**
+ * Sets AGPS reference cell id location.
+ */
+ public void setAgpsReferenceLocationCellId(@AgpsReferenceLocationType int type, int mcc,
+ int mnc, int lac, int cid) {
+ Preconditions.checkState(mRegistered);
+ mGnssHal.setAgpsReferenceLocationCellId(type, mcc, mnc, lac, cid);
+ }
+
+ /**
+ * Returns true if Predicted Satellite Data Service APIs are supported.
+ */
+ public boolean isPsdsSupported() {
+ Preconditions.checkState(mRegistered);
+ return mGnssHal.isPsdsSupported();
+ }
+
+ /**
+ * Injects Predicited Satellite Data Service data into the GNSS HAL.
+ */
+ public void injectPsdsData(byte[] data, int length, int psdsType) {
+ Preconditions.checkState(mRegistered);
+ mGnssHal.injectPsdsData(data, length, psdsType);
+ }
+
+ @NativeEntryPoint
+ void reportGnssServiceDied() {
+ Log.e(TAG, "gnss hal died - restarting shortly...");
+
+ // move to another thread just in case there is some awkward gnss thread dependency with
+ // the death notification. there shouldn't be, but you never know with gnss...
+ FgThread.getExecutor().execute(this::restartHal);
+ }
+
+ @VisibleForTesting
+ void restartHal() {
+ initializeGnss(true);
+ Log.e(TAG, "gnss hal restarted");
+
+ for (int i = 0; i < mBaseCallbacks.length; i++) {
+ mBaseCallbacks[i].onHalRestarted();
+ }
+ }
+
+ @NativeEntryPoint
+ void reportLocation(boolean hasLatLong, Location location) {
+ if (hasLatLong && !mHasFirstFix) {
+ mHasFirstFix = true;
+
+ // notify status listeners
+ int ttff = (int) (SystemClock.elapsedRealtime() - mStartRealtimeMs);
+ for (int i = 0; i < mStatusCallbacks.length; i++) {
+ mStatusCallbacks[i].onReportFirstFix(ttff);
+ }
+ }
+
+ if (location.hasSpeed()) {
+ boolean exceeded = location.getSpeed() > ITAR_SPEED_LIMIT_METERS_PER_SECOND;
+ if (!mItarSpeedLimitExceeded && exceeded) {
+ Log.w(TAG, "speed nearing ITAR threshold - blocking further GNSS output");
+ } else if (mItarSpeedLimitExceeded && !exceeded) {
+ Log.w(TAG, "speed leaving ITAR threshold - allowing further GNSS output");
+ }
+ mItarSpeedLimitExceeded = exceeded;
+ }
+
+ if (mItarSpeedLimitExceeded) {
+ return;
+ }
+
+ for (int i = 0; i < mLocationCallbacks.length; i++) {
+ mLocationCallbacks[i].onReportLocation(hasLatLong, location);
+ }
+ }
+
+ @NativeEntryPoint
+ void reportStatus(@StatusCallbacks.GnssStatusValue int gnssStatus) {
+ for (int i = 0; i < mStatusCallbacks.length; i++) {
+ mStatusCallbacks[i].onReportStatus(gnssStatus);
+ }
+ }
+
+ @NativeEntryPoint
+ void reportSvStatus(int svCount, int[] svidWithFlags, float[] cn0DbHzs,
+ float[] elevations, float[] azimuths, float[] carrierFrequencies,
+ float[] basebandCn0DbHzs) {
+ GnssStatus gnssStatus = GnssStatus.wrap(svCount, svidWithFlags, cn0DbHzs, elevations,
+ azimuths, carrierFrequencies, basebandCn0DbHzs);
+ for (int i = 0; i < mSvStatusCallbacks.length; i++) {
+ mSvStatusCallbacks[i].onReportSvStatus(gnssStatus);
+ }
+ }
+
+ @NativeEntryPoint
+ void reportAGpsStatus(int agpsType, int agpsStatus, byte[] suplIpAddr) {
+ mAGpsCallbacks.onReportAGpsStatus(agpsType, agpsStatus, suplIpAddr);
+ }
+
+ @NativeEntryPoint
+ void reportNmea(long timestamp) {
+ if (mItarSpeedLimitExceeded) {
+ return;
+ }
+
+ for (int i = 0; i < mNmeaCallbacks.length; i++) {
+ mNmeaCallbacks[i].onReportNmea(timestamp);
+ }
+ }
+
+ @NativeEntryPoint
+ void reportMeasurementData(GnssMeasurementsEvent event) {
+ if (mItarSpeedLimitExceeded) {
+ return;
+ }
+
+ for (int i = 0; i < mMeasurementCallbacks.length; i++) {
+ mMeasurementCallbacks[i].onReportMeasurements(event);
+ }
+ }
+
+ @NativeEntryPoint
+ void reportAntennaInfo(List<GnssAntennaInfo> antennaInfos) {
+ for (int i = 0; i < mAntennaInfoCallbacks.length; i++) {
+ mAntennaInfoCallbacks[i].onReportAntennaInfo(antennaInfos);
+ }
+ }
+
+ @NativeEntryPoint
+ void reportNavigationMessage(GnssNavigationMessage event) {
+ if (mItarSpeedLimitExceeded) {
+ return;
+ }
+
+ for (int i = 0; i < mNavigationMessageCallbacks.length; i++) {
+ mNavigationMessageCallbacks[i].onReportNavigationMessage(event);
+ }
+ }
+
+ @NativeEntryPoint
+ void setTopHalCapabilities(@GnssCapabilities.TopHalCapabilityFlags int capabilities) {
+ GnssCapabilities oldCapabilities = mCapabilities;
+ mCapabilities = oldCapabilities.withTopHalFlags(capabilities);
+ onCapabilitiesChanged(oldCapabilities, mCapabilities);
+ }
+
+ @NativeEntryPoint
+ void setSubHalMeasurementCorrectionsCapabilities(
+ @GnssCapabilities.SubHalMeasurementCorrectionsCapabilityFlags int capabilities) {
+ GnssCapabilities oldCapabilities = mCapabilities;
+ mCapabilities = oldCapabilities.withSubHalMeasurementCorrectionsFlags(capabilities);
+ onCapabilitiesChanged(oldCapabilities, mCapabilities);
+ }
+
+ @NativeEntryPoint
+ void setSubHalPowerIndicationCapabilities(
+ @GnssCapabilities.SubHalPowerCapabilityFlags int capabilities) {
+ GnssCapabilities oldCapabilities = mCapabilities;
+ mCapabilities = oldCapabilities.withSubHalPowerFlags(capabilities);
+ onCapabilitiesChanged(oldCapabilities, mCapabilities);
+ }
+
+ private void onCapabilitiesChanged(GnssCapabilities oldCapabilities,
+ GnssCapabilities newCapabilities) {
+ if (newCapabilities.equals(oldCapabilities)) {
+ return;
+ }
+
+ Log.i(TAG, "gnss capabilities changed to " + newCapabilities);
+
+ for (int i = 0; i < mBaseCallbacks.length; i++) {
+ mBaseCallbacks[i].onCapabilitiesChanged(oldCapabilities, newCapabilities);
+ }
+ }
+
+ @NativeEntryPoint
+ void reportGnssPowerStats(GnssPowerStats powerStats) {
+ mPowerStats = powerStats;
+ }
+
+ @NativeEntryPoint
+ void setGnssYearOfHardware(int year) {
+ mHardwareYear = year;
+ }
+
+ @NativeEntryPoint
+ private void setGnssHardwareModelName(String modelName) {
+ mHardwareModelName = modelName;
+ }
+
+ @NativeEntryPoint
+ void reportLocationBatch(Location[] locations) {
+ for (int i = 0; i < mLocationCallbacks.length; i++) {
+ mLocationCallbacks[i].onReportLocations(locations);
+ }
+ }
+
+ @NativeEntryPoint
+ void psdsDownloadRequest(int psdsType) {
+ mPsdsCallbacks.onRequestPsdsDownload(psdsType);
+ }
+
+ @NativeEntryPoint
+ void reportGeofenceTransition(int geofenceId, Location location, int transition,
+ long transitionTimestamp) {
+ mGeofenceCallbacks.onReportGeofenceTransition(geofenceId, location, transition,
+ transitionTimestamp);
+ }
+
+ @NativeEntryPoint
+ void reportGeofenceStatus(int status, Location location) {
+ mGeofenceCallbacks.onReportGeofenceStatus(status, location);
+ }
+
+ @NativeEntryPoint
+ void reportGeofenceAddStatus(int geofenceId, @GeofenceCallbacks.GeofenceStatus int status) {
+ mGeofenceCallbacks.onReportGeofenceAddStatus(geofenceId, status);
+ }
+
+ @NativeEntryPoint
+ void reportGeofenceRemoveStatus(int geofenceId, @GeofenceCallbacks.GeofenceStatus int status) {
+ mGeofenceCallbacks.onReportGeofenceRemoveStatus(geofenceId, status);
+ }
+
+ @NativeEntryPoint
+ void reportGeofencePauseStatus(int geofenceId, @GeofenceCallbacks.GeofenceStatus int status) {
+ mGeofenceCallbacks.onReportGeofencePauseStatus(geofenceId, status);
+ }
+
+ @NativeEntryPoint
+ void reportGeofenceResumeStatus(int geofenceId, @GeofenceCallbacks.GeofenceStatus int status) {
+ mGeofenceCallbacks.onReportGeofenceResumeStatus(geofenceId, status);
+ }
+
+ @NativeEntryPoint
+ void reportNiNotification(int notificationId, int niType, int notifyFlags,
+ int timeout, int defaultResponse, String requestorId, String text,
+ int requestorIdEncoding, int textEncoding) {
+ mNotificationCallbacks.onReportNiNotification(notificationId, niType, notifyFlags, timeout,
+ defaultResponse, requestorId, text, requestorIdEncoding, textEncoding);
+ }
+
+ @NativeEntryPoint
+ void requestSetID(int flags) {
+ mAGpsCallbacks.onRequestSetID(flags);
+ }
+
+ @NativeEntryPoint
+ void requestLocation(boolean independentFromGnss, boolean isUserEmergency) {
+ mLocationRequestCallbacks.onRequestLocation(independentFromGnss, isUserEmergency);
+ }
+
+ @NativeEntryPoint
+ void requestUtcTime() {
+ mTimeCallbacks.onRequestUtcTime();
+ }
+
+ @NativeEntryPoint
+ void requestRefLocation() {
+ mLocationRequestCallbacks.onRequestRefLocation();
+ }
+
+ @NativeEntryPoint
+ void reportNfwNotification(String proxyAppPackageName, byte protocolStack,
+ String otherProtocolStackName, byte requestor, String requestorId,
+ byte responseType, boolean inEmergencyMode, boolean isCachedLocation) {
+ mNotificationCallbacks.onReportNfwNotification(proxyAppPackageName, protocolStack,
+ otherProtocolStackName, requestor, requestorId, responseType, inEmergencyMode,
+ isCachedLocation);
+ }
+
+ @NativeEntryPoint
+ boolean isInEmergencySession() {
+ return mEmergencyHelper.isInEmergency(mConfiguration.getEsExtensionSec());
+ }
+
+ /**
+ * Encapsulates actual HAL methods for testing purposes.
+ */
+ @VisibleForTesting
+ public static class GnssHal {
+
+ protected GnssHal() {}
+
+ protected void classInitOnce() {
+ native_class_init_once();
+ }
+
+ protected boolean isSupported() {
+ return native_is_supported();
+ }
+
+ protected void initOnce(GnssNative gnssNative, boolean reinitializeGnssServiceHandle) {
+ gnssNative.native_init_once(reinitializeGnssServiceHandle);
+ }
+
+ protected boolean init() {
+ return native_init();
+ }
+
+ protected void cleanup() {
+ native_cleanup();
+ }
+
+ protected boolean start() {
+ return native_start();
+ }
+
+ protected boolean stop() {
+ return native_stop();
+ }
+
+ protected boolean setPositionMode(@GnssPositionMode int mode,
+ @GnssPositionRecurrence int recurrence, int minInterval, int preferredAccuracy,
+ int preferredTime, boolean lowPowerMode) {
+ return native_set_position_mode(mode, recurrence, minInterval, preferredAccuracy,
+ preferredTime, lowPowerMode);
+ }
+
+ protected String getInternalState() {
+ return native_get_internal_state();
+ }
+
+ protected void deleteAidingData(@GnssAidingTypeFlags int flags) {
+ native_delete_aiding_data(flags);
+ }
+
+ protected int readNmea(byte[] buffer, int bufferSize) {
+ return native_read_nmea(buffer, bufferSize);
+ }
+
+ protected void injectLocation(double latitude, double longitude, float accuracy) {
+ native_inject_location(latitude, longitude, accuracy);
+ }
+
+ protected void injectBestLocation(@GnssLocationFlags int gnssLocationFlags, double latitude,
+ double longitude, double altitude, float speed, float bearing,
+ float horizontalAccuracy, float verticalAccuracy, float speedAccuracy,
+ float bearingAccuracy, long timestamp, @GnssRealtimeFlags int elapsedRealtimeFlags,
+ long elapsedRealtimeNanos, double elapsedRealtimeUncertaintyNanos) {
+ native_inject_best_location(gnssLocationFlags, latitude, longitude, altitude, speed,
+ bearing, horizontalAccuracy, verticalAccuracy, speedAccuracy, bearingAccuracy,
+ timestamp, elapsedRealtimeFlags, elapsedRealtimeNanos,
+ elapsedRealtimeUncertaintyNanos);
+ }
+
+ protected void injectTime(long time, long timeReference, int uncertainty) {
+ native_inject_time(time, timeReference, uncertainty);
+ }
+
+ protected boolean isNavigationMessageCollectionSupported() {
+ return native_is_navigation_message_supported();
+ }
+
+ protected boolean startNavigationMessageCollection() {
+ return native_start_navigation_message_collection();
+ }
+
+ protected boolean stopNavigationMessageCollection() {
+ return native_stop_navigation_message_collection();
+ }
+
+ protected boolean isAntennaInfoListeningSupported() {
+ return native_is_antenna_info_supported();
+ }
+
+ protected boolean startAntennaInfoListening() {
+ return native_start_antenna_info_listening();
+ }
+
+ protected boolean stopAntennaInfoListening() {
+ return native_stop_antenna_info_listening();
+ }
+
+ protected boolean isMeasurementSupported() {
+ return native_is_measurement_supported();
+ }
+
+ protected boolean startMeasurementCollection(boolean enableFullTracking) {
+ return native_start_measurement_collection(enableFullTracking);
+ }
+
+ protected boolean stopMeasurementCollection() {
+ return native_stop_measurement_collection();
+ }
+
+ protected boolean isMeasurementCorrectionsSupported() {
+ return native_is_measurement_corrections_supported();
+ }
+
+ protected boolean injectMeasurementCorrections(GnssMeasurementCorrections corrections) {
+ return native_inject_measurement_corrections(corrections);
+ }
+
+ protected int getBatchSize() {
+ return native_get_batch_size();
+ }
+
+ protected boolean initBatching() {
+ return native_init_batching();
+ }
+
+ protected void cleanupBatching() {
+ native_cleanup_batching();
+ }
+
+ protected boolean startBatch(long periodNanos, boolean wakeOnFifoFull) {
+ return native_start_batch(periodNanos, wakeOnFifoFull);
+ }
+
+ protected void flushBatch() {
+ native_flush_batch();
+ }
+
+ protected void stopBatch() {
+ native_stop_batch();
+ }
+
+ protected boolean isGeofencingSupported() {
+ return native_is_geofence_supported();
+ }
+
+ protected boolean addGeofence(int geofenceId, double latitude, double longitude,
+ double radius, int lastTransition, int monitorTransitions,
+ int notificationResponsiveness, int unknownTimer) {
+ return native_add_geofence(geofenceId, latitude, longitude, radius, lastTransition,
+ monitorTransitions, notificationResponsiveness, unknownTimer);
+ }
+
+ protected boolean resumeGeofence(int geofenceId, int monitorTransitions) {
+ return native_resume_geofence(geofenceId, monitorTransitions);
+ }
+
+ protected boolean pauseGeofence(int geofenceId) {
+ return native_pause_geofence(geofenceId);
+ }
+
+ protected boolean removeGeofence(int geofenceId) {
+ return native_remove_geofence(geofenceId);
+ }
+
+ protected boolean isGnssVisibilityControlSupported() {
+ return native_is_gnss_visibility_control_supported();
+ }
+
+ protected void sendNiResponse(int notificationId, int userResponse) {
+ native_send_ni_response(notificationId, userResponse);
+ }
+
+ protected void requestPowerStats() {
+ native_request_power_stats();
+ }
+
+ protected void setAgpsServer(int type, String hostname, int port) {
+ native_set_agps_server(type, hostname, port);
+ }
+
+ protected void setAgpsSetId(@AgpsSetIdType int type, String setId) {
+ native_agps_set_id(type, setId);
+ }
+
+ protected void setAgpsReferenceLocationCellId(@AgpsReferenceLocationType int type, int mcc,
+ int mnc, int lac, int cid) {
+ native_agps_set_ref_location_cellid(type, mcc, mnc, lac, cid);
+ }
+
+ protected boolean isPsdsSupported() {
+ return native_supports_psds();
+ }
+
+ protected void injectPsdsData(byte[] data, int length, int psdsType) {
+ native_inject_psds_data(data, length, psdsType);
+ }
+ }
+
+ // basic APIs
+
+ private static native void native_class_init_once();
+
+ private static native boolean native_is_supported();
+
+ private native void native_init_once(boolean reinitializeGnssServiceHandle);
+
+ private static native boolean native_init();
+
+ private static native void native_cleanup();
+
+ private static native boolean native_start();
+
+ private static native boolean native_stop();
+
+ private static native boolean native_set_position_mode(int mode, int recurrence,
+ int minInterval, int preferredAccuracy, int preferredTime, boolean lowPowerMode);
+
+ private static native String native_get_internal_state();
+
+ private static native void native_delete_aiding_data(int flags);
+
+ // NMEA APIs
+
+ private static native int native_read_nmea(byte[] buffer, int bufferSize);
+
+ // location injection APIs
+
+ private static native void native_inject_location(double latitude, double longitude,
+ float accuracy);
+
+
+ private static native void native_inject_best_location(
+ int gnssLocationFlags, double latitudeDegrees, double longitudeDegrees,
+ double altitudeMeters, float speedMetersPerSec, float bearingDegrees,
+ float horizontalAccuracyMeters, float verticalAccuracyMeters,
+ float speedAccuracyMetersPerSecond, float bearingAccuracyDegrees,
+ long timestamp, int elapsedRealtimeFlags, long elapsedRealtimeNanos,
+ double elapsedRealtimeUncertaintyNanos);
+
+ // time injection APIs
+
+ private static native void native_inject_time(long time, long timeReference, int uncertainty);
+
+ // navigation message APIs
+
+ private static native boolean native_is_navigation_message_supported();
+
+ private static native boolean native_start_navigation_message_collection();
+
+ private static native boolean native_stop_navigation_message_collection();
+
+ // antenna info APIS
+
+ private static native boolean native_is_antenna_info_supported();
+
+ private static native boolean native_start_antenna_info_listening();
+
+ private static native boolean native_stop_antenna_info_listening();
+
+ // measurement APIs
+
+ private static native boolean native_is_measurement_supported();
+
+ private static native boolean native_start_measurement_collection(boolean enableFullTracking);
+
+ private static native boolean native_stop_measurement_collection();
+
+ // measurement corrections APIs
+
+ private static native boolean native_is_measurement_corrections_supported();
+
+ private static native boolean native_inject_measurement_corrections(
+ GnssMeasurementCorrections corrections);
+
+ // batching APIs
+
+ private static native boolean native_init_batching();
+
+ private static native void native_cleanup_batching();
+
+ private static native boolean native_start_batch(long periodNanos, boolean wakeOnFifoFull);
+
+ private static native void native_flush_batch();
+
+ private static native boolean native_stop_batch();
+
+ private static native int native_get_batch_size();
+
+ // geofence APIs
+
+ private static native boolean native_is_geofence_supported();
+
+ private static native boolean native_add_geofence(int geofenceId, double latitude,
+ double longitude, double radius, int lastTransition, int monitorTransitions,
+ int notificationResponsivenes, int unknownTimer);
+
+ private static native boolean native_resume_geofence(int geofenceId, int monitorTransitions);
+
+ private static native boolean native_pause_geofence(int geofenceId);
+
+ private static native boolean native_remove_geofence(int geofenceId);
+
+ // network initiated (NI) APIs
+
+ private static native boolean native_is_gnss_visibility_control_supported();
+
+ private static native void native_send_ni_response(int notificationId, int userResponse);
+
+ // power stats APIs
+
+ private static native void native_request_power_stats();
+
+ // AGPS APIs
+
+ private static native void native_set_agps_server(int type, String hostname, int port);
+
+ private static native void native_agps_set_id(int type, String setid);
+
+ private static native void native_agps_set_ref_location_cellid(int type, int mcc, int mnc,
+ int lac, int cid);
+
+ // PSDS APIs
+
+ private static native boolean native_supports_psds();
+
+ private static native void native_inject_psds_data(byte[] data, int length, int psdsType);
+}
diff --git a/wifi/java/android/net/wifi/IWifiConnectedNetworkScorer.aidl b/services/core/java/com/android/server/location/injector/EmergencyHelper.java
similarity index 64%
rename from wifi/java/android/net/wifi/IWifiConnectedNetworkScorer.aidl
rename to services/core/java/com/android/server/location/injector/EmergencyHelper.java
index f96d037c..be4bf50 100644
--- a/wifi/java/android/net/wifi/IWifiConnectedNetworkScorer.aidl
+++ b/services/core/java/com/android/server/location/injector/EmergencyHelper.java
@@ -14,20 +14,16 @@
* limitations under the License.
*/
-package android.net.wifi;
-
-import android.net.wifi.IScoreUpdateObserver;
+package com.android.server.location.injector;
/**
- * Interface for Wi-Fi connected network scorer.
- *
- * @hide
+ * Provides helpers for emergency sessions.
*/
-oneway interface IWifiConnectedNetworkScorer
-{
- void onStart(int sessionId);
+public abstract class EmergencyHelper {
- void onStop(int sessionId);
-
- void onSetScoreUpdateObserver(IScoreUpdateObserver observerImpl);
+ /**
+ * Returns true if the device is in an emergency session, or if an emergency session ended
+ * within the given extension time.
+ */
+ public abstract boolean isInEmergency(long extensionTimeMs);
}
diff --git a/services/core/java/com/android/server/location/injector/Injector.java b/services/core/java/com/android/server/location/injector/Injector.java
index c42396d..03938b2 100644
--- a/services/core/java/com/android/server/location/injector/Injector.java
+++ b/services/core/java/com/android/server/location/injector/Injector.java
@@ -51,6 +51,9 @@
/** Returns a LocationAttributionHelper. */
LocationAttributionHelper getLocationAttributionHelper();
+ /** Returns an EmergencyHelper. */
+ EmergencyHelper getEmergencyHelper();
+
/** Returns a LocationUsageLogger. */
LocationUsageLogger getLocationUsageLogger();
diff --git a/services/core/java/com/android/server/location/injector/SystemEmergencyHelper.java b/services/core/java/com/android/server/location/injector/SystemEmergencyHelper.java
new file mode 100644
index 0000000..05d0aef
--- /dev/null
+++ b/services/core/java/com/android/server/location/injector/SystemEmergencyHelper.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 com.android.server.location.injector;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.SystemClock;
+import android.telephony.PhoneStateListener;
+import android.telephony.TelephonyManager;
+
+import com.android.server.FgThread;
+
+import java.util.Objects;
+
+/**
+ * Provides helpers for emergency sessions.
+ */
+public class SystemEmergencyHelper extends EmergencyHelper {
+
+ private final Context mContext;
+
+ private TelephonyManager mTelephonyManager;
+
+ private boolean mIsInEmergencyCall;
+ private long mEmergencyCallEndRealtimeMs = Long.MIN_VALUE;
+
+ public SystemEmergencyHelper(Context context) {
+ mContext = context;
+ }
+
+ /** Called when system is ready. */
+ public void onSystemReady() {
+ if (mTelephonyManager != null) {
+ return;
+ }
+
+ mTelephonyManager = Objects.requireNonNull(
+ mContext.getSystemService(TelephonyManager.class));
+
+ // TODO: this doesn't account for multisim phones
+
+ mTelephonyManager.registerPhoneStateListener(FgThread.getExecutor(),
+ new EmergencyCallPhoneStateListener());
+ mContext.registerReceiver(new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (!Intent.ACTION_NEW_OUTGOING_CALL.equals(intent.getAction())) {
+ return;
+ }
+
+ mIsInEmergencyCall = mTelephonyManager.isEmergencyNumber(
+ intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER));
+ }
+ }, new IntentFilter(Intent.ACTION_NEW_OUTGOING_CALL));
+ }
+
+ @Override
+ public boolean isInEmergency(long extensionTimeMs) {
+ return mIsInEmergencyCall
+ || ((SystemClock.elapsedRealtime() - mEmergencyCallEndRealtimeMs) < extensionTimeMs)
+ || mTelephonyManager.getEmergencyCallbackMode()
+ || mTelephonyManager.isInEmergencySmsMode();
+ }
+
+ private class EmergencyCallPhoneStateListener extends PhoneStateListener implements
+ PhoneStateListener.CallStateChangedListener {
+
+ @Override
+ public void onCallStateChanged(int state, String incomingNumber) {
+ if (state == TelephonyManager.CALL_STATE_IDLE) {
+ if (mIsInEmergencyCall) {
+ mEmergencyCallEndRealtimeMs = SystemClock.elapsedRealtime();
+ mIsInEmergencyCall = false;
+ }
+ }
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/location/provider/AbstractLocationProvider.java b/services/core/java/com/android/server/location/provider/AbstractLocationProvider.java
index d06f54d..5364feb 100644
--- a/services/core/java/com/android/server/location/provider/AbstractLocationProvider.java
+++ b/services/core/java/com/android/server/location/provider/AbstractLocationProvider.java
@@ -18,11 +18,11 @@
import android.annotation.Nullable;
import android.location.LocationResult;
+import android.location.ProviderProperties;
import android.location.util.identity.CallerIdentity;
import android.os.Binder;
import android.os.Bundle;
-import com.android.internal.location.ProviderProperties;
import com.android.internal.location.ProviderRequest;
import com.android.internal.util.Preconditions;
@@ -90,7 +90,10 @@
this.identity = identity;
}
- State withAllowed(boolean allowed) {
+ /**
+ * Returns a state the same as the current but with allowed set as specified.
+ */
+ public State withAllowed(boolean allowed) {
if (allowed == this.allowed) {
return this;
} else {
@@ -98,7 +101,10 @@
}
}
- State withProperties(@Nullable ProviderProperties properties) {
+ /**
+ * Returns a state the same as the current but with properties set as specified.
+ */
+ public State withProperties(@Nullable ProviderProperties properties) {
if (Objects.equals(properties, this.properties)) {
return this;
} else {
@@ -106,7 +112,10 @@
}
}
- State withIdentity(@Nullable CallerIdentity identity) {
+ /**
+ * Returns a state the same as the current but with an identity set as specified.
+ */
+ public State withIdentity(@Nullable CallerIdentity identity) {
if (Objects.equals(identity, this.identity)) {
return this;
} else {
@@ -175,28 +184,21 @@
private final LocationProviderController mController;
-
- /**
- * See {@link #AbstractLocationProvider(Executor, CallerIdentity)}.
- */
- protected AbstractLocationProvider(Executor executor) {
- this(executor, null);
- }
-
/**
* Creates a new location provider.
*
* All callback methods will be invoked on the given executor. A direct executor may be provided
* only if the provider can guarantee that all callback methods will never synchronously invoke
- * any command method (that changes provider state, or reports a location, etc...). If this
- * invariant is not held, use a normal executor or risk deadlock.
+ * any {@link LocationProviderController} methods. If this invariant is not held, use a normal
+ * executor or risk deadlock.
*
- * An optional identity may be provided to initialize the location provider.
+ * An optional identity and properties may be provided to initialize the location provider.
*/
- protected AbstractLocationProvider(Executor executor, CallerIdentity identity) {
+ protected AbstractLocationProvider(Executor executor, @Nullable CallerIdentity identity,
+ @Nullable ProviderProperties properties) {
mExecutor = executor;
- mInternalState = new AtomicReference<>(
- new InternalState(null, State.EMPTY_STATE.withIdentity(identity)));
+ mInternalState = new AtomicReference<>(new InternalState(null,
+ State.EMPTY_STATE.withIdentity(identity).withProperties(properties)));
mController = new Controller();
}
@@ -209,46 +211,23 @@
return mController;
}
- /**
- * Sets the state of the provider to the new state.
- */
- protected void setState(State newState) {
- InternalState oldInternalState = mInternalState.getAndUpdate(
- internalState -> internalState.withState(newState));
- if (newState.equals(oldInternalState.state)) {
+ protected void setState(UnaryOperator<State> operator) {
+ AtomicReference<State> oldStateRef = new AtomicReference<>();
+ InternalState newInternalState = mInternalState.updateAndGet(
+ internalState -> {
+ oldStateRef.set(internalState.state);
+ return internalState.withState(operator);
+ });
+ State oldState = oldStateRef.get();
+
+ if (oldState.equals(newInternalState.state)) {
return;
}
- // we know that we only updated the state, so the listener for the old state is the same as
- // the listener for the new state.
- if (oldInternalState.listener != null) {
+ if (newInternalState.listener != null) {
final long identity = Binder.clearCallingIdentity();
try {
- oldInternalState.listener.onStateChanged(oldInternalState.state, newState);
- } finally {
- Binder.restoreCallingIdentity(identity);
- }
- }
- }
-
- private void setState(UnaryOperator<State> operator) {
- InternalState oldInternalState = mInternalState.getAndUpdate(
- internalState -> internalState.withState(operator));
-
- // recreate the new state from our knowledge of the old state - unfortunately may result in
- // an extra allocation, but oh well...
- State newState = operator.apply(oldInternalState.state);
-
- if (newState.equals(oldInternalState.state)) {
- return;
- }
-
- // we know that we only updated the state, so the listener for the old state is the same as
- // the listener for the new state.
- if (oldInternalState.listener != null) {
- final long identity = Binder.clearCallingIdentity();
- try {
- oldInternalState.listener.onStateChanged(oldInternalState.state, newState);
+ newInternalState.listener.onStateChanged(oldState, newInternalState.state);
} finally {
Binder.restoreCallingIdentity(identity);
}
@@ -279,7 +258,7 @@
/**
* Call this method to report a change in provider properties.
*/
- protected void setProperties(ProviderProperties properties) {
+ protected void setProperties(@Nullable ProviderProperties properties) {
setState(state -> state.withProperties(properties));
}
@@ -293,7 +272,7 @@
/**
* Call this method to report a change in provider packages.
*/
- protected void setIdentity(CallerIdentity identity) {
+ protected void setIdentity(@Nullable CallerIdentity identity) {
setState(state -> state.withIdentity(identity));
}
diff --git a/services/core/java/com/android/server/location/provider/LocationProviderManager.java b/services/core/java/com/android/server/location/provider/LocationProviderManager.java
index 2fe8bcc..858b762 100644
--- a/services/core/java/com/android/server/location/provider/LocationProviderManager.java
+++ b/services/core/java/com/android/server/location/provider/LocationProviderManager.java
@@ -46,7 +46,6 @@
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
-import android.location.Criteria;
import android.location.ILocationCallback;
import android.location.ILocationListener;
import android.location.LastLocationRequest;
@@ -56,6 +55,7 @@
import android.location.LocationManagerInternal.ProviderEnabledListener;
import android.location.LocationRequest;
import android.location.LocationResult;
+import android.location.ProviderProperties;
import android.location.util.identity.CallerIdentity;
import android.os.Binder;
import android.os.Build;
@@ -82,7 +82,6 @@
import android.util.TimeUtils;
import com.android.internal.annotations.GuardedBy;
-import com.android.internal.location.ProviderProperties;
import com.android.internal.location.ProviderRequest;
import com.android.internal.util.Preconditions;
import com.android.server.FgThread;
@@ -452,7 +451,7 @@
return isActive()
&& getRequest().getIntervalMillis() < MAX_HIGH_POWER_INTERVAL_MS
- && getProperties().getPowerRequirement() == Criteria.POWER_HIGH;
+ && getProperties().getPowerUsage() == ProviderProperties.POWER_USAGE_HIGH;
}
@GuardedBy("mLock")
@@ -1358,6 +1357,8 @@
public boolean isEnabled(int userId) {
if (userId == UserHandle.USER_NULL) {
return false;
+ } else if (userId == UserHandle.USER_CURRENT) {
+ return isEnabled(mUserHelper.getCurrentUserId());
}
Preconditions.checkArgument(userId >= 0);
@@ -1519,6 +1520,9 @@
}
}
return lastLocation;
+ } else if (userId == UserHandle.USER_CURRENT) {
+ return getLastLocationUnsafe(mUserHelper.getCurrentUserId(), permissionLevel,
+ ignoreLocationSettings, maximumAgeMs);
}
Preconditions.checkArgument(userId >= 0);
@@ -1561,6 +1565,9 @@
setLastLocation(location, runningUserIds[i]);
}
return;
+ } else if (userId == UserHandle.USER_CURRENT) {
+ setLastLocation(location, mUserHelper.getCurrentUserId());
+ return;
}
Preconditions.checkArgument(userId >= 0);
diff --git a/services/core/java/com/android/server/location/provider/MockLocationProvider.java b/services/core/java/com/android/server/location/provider/MockLocationProvider.java
index 0c6d5dc..f9aa402 100644
--- a/services/core/java/com/android/server/location/provider/MockLocationProvider.java
+++ b/services/core/java/com/android/server/location/provider/MockLocationProvider.java
@@ -21,10 +21,10 @@
import android.annotation.Nullable;
import android.location.Location;
import android.location.LocationResult;
+import android.location.ProviderProperties;
import android.location.util.identity.CallerIdentity;
import android.os.Bundle;
-import com.android.internal.location.ProviderProperties;
import com.android.internal.location.ProviderRequest;
import java.io.FileDescriptor;
@@ -41,8 +41,7 @@
public MockLocationProvider(ProviderProperties properties, CallerIdentity identity) {
// using a direct executor is ok because this class has no locks that could deadlock
- super(DIRECT_EXECUTOR, identity);
- setProperties(properties);
+ super(DIRECT_EXECUTOR, identity, properties);
}
/** Sets the allowed state of this mock provider. */
diff --git a/services/core/java/com/android/server/location/provider/MockableLocationProvider.java b/services/core/java/com/android/server/location/provider/MockableLocationProvider.java
index 79f641f..c1b0abf 100644
--- a/services/core/java/com/android/server/location/provider/MockableLocationProvider.java
+++ b/services/core/java/com/android/server/location/provider/MockableLocationProvider.java
@@ -21,11 +21,11 @@
import android.annotation.Nullable;
import android.location.Location;
import android.location.LocationResult;
+import android.location.ProviderProperties;
import android.location.util.identity.CallerIdentity;
import android.os.Bundle;
import com.android.internal.annotations.GuardedBy;
-import com.android.internal.location.ProviderProperties;
import com.android.internal.location.ProviderRequest;
import com.android.internal.util.Preconditions;
@@ -75,7 +75,7 @@
public MockableLocationProvider(Object ownerLock) {
// using a direct executor is acceptable because all inbound calls are delegated to the
// actual provider implementations which will use their own executors
- super(DIRECT_EXECUTOR);
+ super(DIRECT_EXECUTOR, null, null);
mOwnerLock = ownerLock;
mRequest = ProviderRequest.EMPTY_REQUEST;
}
@@ -167,7 +167,7 @@
newState = State.EMPTY_STATE;
}
- setState(newState);
+ setState(prevState -> newState);
}
/**
@@ -325,7 +325,7 @@
return;
}
- setState(newState);
+ setState(prevState -> newState);
}
}
diff --git a/services/core/java/com/android/server/location/provider/PassiveLocationProvider.java b/services/core/java/com/android/server/location/provider/PassiveLocationProvider.java
index 0e8b40b..1f4c4cf 100644
--- a/services/core/java/com/android/server/location/provider/PassiveLocationProvider.java
+++ b/services/core/java/com/android/server/location/provider/PassiveLocationProvider.java
@@ -19,12 +19,11 @@
import static com.android.internal.util.ConcurrentUtils.DIRECT_EXECUTOR;
import android.content.Context;
-import android.location.Criteria;
import android.location.LocationResult;
+import android.location.ProviderProperties;
import android.location.util.identity.CallerIdentity;
import android.os.Bundle;
-import com.android.internal.location.ProviderProperties;
import com.android.internal.location.ProviderRequest;
import java.io.FileDescriptor;
@@ -47,14 +46,12 @@
/* supportsAltitude = */false,
/* supportsSpeed = */false,
/* supportsBearing = */false,
- Criteria.POWER_LOW,
- Criteria.ACCURACY_COARSE);
+ ProviderProperties.POWER_USAGE_LOW,
+ ProviderProperties.ACCURACY_COARSE);
public PassiveLocationProvider(Context context) {
// using a direct executor is ok because this class has no locks that could deadlock
- super(DIRECT_EXECUTOR, CallerIdentity.fromContext(context));
-
- setProperties(PROPERTIES);
+ super(DIRECT_EXECUTOR, CallerIdentity.fromContext(context), PROPERTIES);
setAllowed(true);
}
diff --git a/services/core/java/com/android/server/location/provider/proxy/ProxyLocationProvider.java b/services/core/java/com/android/server/location/provider/proxy/ProxyLocationProvider.java
index 6e92c8d..345fdc0 100644
--- a/services/core/java/com/android/server/location/provider/proxy/ProxyLocationProvider.java
+++ b/services/core/java/com/android/server/location/provider/proxy/ProxyLocationProvider.java
@@ -22,6 +22,7 @@
import android.content.ComponentName;
import android.content.Context;
import android.location.LocationResult;
+import android.location.ProviderProperties;
import android.location.util.identity.CallerIdentity;
import android.os.Binder;
import android.os.Bundle;
@@ -31,7 +32,6 @@
import com.android.internal.annotations.GuardedBy;
import com.android.internal.location.ILocationProvider;
import com.android.internal.location.ILocationProviderManager;
-import com.android.internal.location.ProviderProperties;
import com.android.internal.location.ProviderRequest;
import com.android.internal.util.ArrayUtils;
import com.android.server.ServiceWatcher;
@@ -82,7 +82,7 @@
int nonOverlayPackageResId) {
// safe to use direct executor since our locks are not acquired in a code path invoked by
// our owning provider
- super(DIRECT_EXECUTOR);
+ super(DIRECT_EXECUTOR, null, null);
mContext = context;
mServiceWatcher = new ServiceWatcher(context, action, this::onBind,
@@ -116,7 +116,7 @@
synchronized (mLock) {
mProxy = null;
mService = null;
- setState(State.EMPTY_STATE);
+ setState(prevState -> State.EMPTY_STATE);
flushListeners = mFlushListeners.toArray(new Runnable[0]);
mFlushListeners.clear();
}
@@ -210,7 +210,8 @@
// executed on binder thread
@Override
- public void onSetIdentity(@Nullable String packageName, @Nullable String attributionTag) {
+ public void onInitialize(boolean allowed, ProviderProperties properties,
+ @Nullable String packageName, @Nullable String attributionTag) {
synchronized (mLock) {
if (mProxy != this) {
return;
@@ -226,7 +227,10 @@
identity = CallerIdentity.fromBinder(mContext, packageName, attributionTag);
}
- setIdentity(identity);
+ setState(prevState -> prevState
+ .withAllowed(allowed)
+ .withProperties(properties)
+ .withIdentity(identity));
}
}
@@ -238,14 +242,6 @@
return;
}
- // if no identity is set yet, set it now
- if (getIdentity() == null) {
- String packageName = guessPackageName(mContext, Binder.getCallingUid(),
- Objects.requireNonNull(mService).getPackageName());
- // unsafe is ok since the package is coming direct from the package manager here
- setIdentity(CallerIdentity.fromBinderUnsafe(packageName, null));
- }
-
setProperties(properties);
}
}
diff --git a/services/core/java/com/android/server/location/timezone/LocationTimeZoneManagerService.java b/services/core/java/com/android/server/location/timezone/LocationTimeZoneManagerService.java
index 98ebec2..ab64f97 100644
--- a/services/core/java/com/android/server/location/timezone/LocationTimeZoneManagerService.java
+++ b/services/core/java/com/android/server/location/timezone/LocationTimeZoneManagerService.java
@@ -21,6 +21,7 @@
import android.content.Context;
import android.content.res.Resources;
import android.os.Binder;
+import android.os.Handler;
import android.os.ResultReceiver;
import android.os.ShellCallback;
import android.os.SystemProperties;
@@ -129,14 +130,17 @@
@NonNull private final Context mContext;
/**
- * The {@link ThreadingDomain} used to supply the {@link android.os.Handler} and shared lock
- * object used by the controller and related components.
+ * The {@link ThreadingDomain} used to supply the shared lock object used by the controller and
+ * related components.
*
* <p>Most operations are executed on the associated handler thread <em>but not all</em>, hence
* the requirement for additional synchronization using a shared lock.
*/
@NonNull private final ThreadingDomain mThreadingDomain;
+ /** A handler associated with the {@link #mThreadingDomain}. */
+ @NonNull private final Handler mHandler;
+
/** The shared lock from {@link #mThreadingDomain}. */
@NonNull private final Object mSharedLock;
@@ -146,7 +150,8 @@
LocationTimeZoneManagerService(Context context) {
mContext = context.createAttributionContext(ATTRIBUTION_TAG);
- mThreadingDomain = new HandlerThreadingDomain(FgThread.getHandler());
+ mHandler = FgThread.getHandler();
+ mThreadingDomain = new HandlerThreadingDomain(mHandler);
mSharedLock = mThreadingDomain.getLockObject();
}
@@ -193,6 +198,7 @@
} else {
proxy = new RealLocationTimeZoneProviderProxy(
mContext,
+ mHandler,
mThreadingDomain,
PRIMARY_LOCATION_TIME_ZONE_SERVICE_ACTION,
R.bool.config_enablePrimaryLocationTimeZoneOverlay,
@@ -214,6 +220,7 @@
} else {
proxy = new RealLocationTimeZoneProviderProxy(
mContext,
+ mHandler,
mThreadingDomain,
SECONDARY_LOCATION_TIME_ZONE_SERVICE_ACTION,
R.bool.config_enableSecondaryLocationTimeZoneOverlay,
diff --git a/services/core/java/com/android/server/location/timezone/OWNERS b/services/core/java/com/android/server/location/timezone/OWNERS
new file mode 100644
index 0000000..28aff18
--- /dev/null
+++ b/services/core/java/com/android/server/location/timezone/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+nfuller@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/services/core/java/com/android/server/location/timezone/RealLocationTimeZoneProviderProxy.java b/services/core/java/com/android/server/location/timezone/RealLocationTimeZoneProviderProxy.java
index 1bb5cec..231136bc 100644
--- a/services/core/java/com/android/server/location/timezone/RealLocationTimeZoneProviderProxy.java
+++ b/services/core/java/com/android/server/location/timezone/RealLocationTimeZoneProviderProxy.java
@@ -16,10 +16,19 @@
package com.android.server.location.timezone;
+import static android.content.pm.PackageManager.PERMISSION_GRANTED;
+
+import static com.android.server.location.timezone.LocationTimeZoneManagerService.warnLog;
+
+import android.Manifest;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.ComponentName;
import android.content.Context;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.content.pm.ServiceInfo;
+import android.os.Handler;
import android.os.IBinder;
import android.os.RemoteException;
import android.service.timezone.ITimeZoneProvider;
@@ -31,6 +40,7 @@
import com.android.server.ServiceWatcher;
import java.util.Objects;
+import java.util.function.Predicate;
/**
* System server-side proxy for ITimeZoneProvider implementations, i.e. this provides the
@@ -43,21 +53,51 @@
@NonNull private final ServiceWatcher mServiceWatcher;
- @GuardedBy("mProxyLock")
+ @GuardedBy("mSharedLock")
@Nullable private ManagerProxy mManagerProxy;
- @GuardedBy("mProxyLock")
+ @GuardedBy("mSharedLock")
@NonNull private TimeZoneProviderRequest mRequest;
RealLocationTimeZoneProviderProxy(
- @NonNull Context context, @NonNull ThreadingDomain threadingDomain,
- @NonNull String action, int enableOverlayResId,
- int nonOverlayPackageResId) {
+ @NonNull Context context, @NonNull Handler handler,
+ @NonNull ThreadingDomain threadingDomain, @NonNull String action,
+ int enableOverlayResId, int nonOverlayPackageResId) {
super(context, threadingDomain);
mManagerProxy = null;
mRequest = TimeZoneProviderRequest.createStopUpdatesRequest();
- mServiceWatcher = new ServiceWatcher(context, action, this::onBind, this::onUnbind,
- enableOverlayResId, nonOverlayPackageResId);
+
+ // A predicate that is used to confirm that an intent service can be used as a
+ // location-based TimeZoneProvider. The service must:
+ // 1) Declare android:permission="android.permission.BIND_TIME_ZONE_PROVIDER_SERVICE" - this
+ // ensures that the provider will only communicate with the system server.
+ // 2) Be in an application that has been granted the
+ // android.permission.INSTALL_LOCATION_TIME_ZONE_PROVIDER_SERVICE permission. This
+ // ensures only trusted time zone providers will be discovered.
+ final String requiredClientPermission = Manifest.permission.BIND_TIME_ZONE_PROVIDER_SERVICE;
+ final String requiredPermission =
+ Manifest.permission.INSTALL_LOCATION_TIME_ZONE_PROVIDER_SERVICE;
+ Predicate<ResolveInfo> intentServiceCheckPredicate = resolveInfo -> {
+ ServiceInfo serviceInfo = resolveInfo.serviceInfo;
+
+ boolean hasClientPermissionRequirement =
+ requiredClientPermission.equals(serviceInfo.permission);
+
+ String packageName = serviceInfo.packageName;
+ PackageManager packageManager = context.getPackageManager();
+ int checkResult = packageManager.checkPermission(requiredPermission, packageName);
+ boolean hasRequiredPermission = checkResult == PERMISSION_GRANTED;
+
+ boolean result = hasClientPermissionRequirement && hasRequiredPermission;
+ if (!result) {
+ warnLog("resolveInfo=" + resolveInfo + " does not meet requirements:"
+ + " hasClientPermissionRequirement=" + hasClientPermissionRequirement
+ + ", hasRequiredPermission=" + hasRequiredPermission);
+ }
+ return result;
+ };
+ mServiceWatcher = new ServiceWatcher(context, handler, action, this::onBind, this::onUnbind,
+ enableOverlayResId, nonOverlayPackageResId, intentServiceCheckPredicate);
}
@Override
@@ -76,21 +116,6 @@
}
private void onBind(IBinder binder, ComponentName componentName) {
- processServiceWatcherCallbackOnThreadingDomainThread(() -> onBindOnHandlerThread(binder));
- }
-
- private void onUnbind() {
- processServiceWatcherCallbackOnThreadingDomainThread(this::onUnbindOnHandlerThread);
- }
-
- private void processServiceWatcherCallbackOnThreadingDomainThread(@NonNull Runnable runnable) {
- // For simplicity, this code just post()s the runnable to the mThreadingDomain Thread in all
- // cases. This adds a delay if ServiceWatcher and ThreadingDomain happen to be using the
- // same thread, but nothing here should be performance critical.
- mThreadingDomain.post(runnable);
- }
-
- private void onBindOnHandlerThread(@NonNull IBinder binder) {
mThreadingDomain.assertCurrentThread();
ITimeZoneProvider provider = ITimeZoneProvider.Stub.asInterface(binder);
@@ -108,7 +133,7 @@
}
}
- private void onUnbindOnHandlerThread() {
+ private void onUnbind() {
mThreadingDomain.assertCurrentThread();
synchronized (mSharedLock) {
@@ -129,7 +154,7 @@
}
}
- @GuardedBy("mProxyLock")
+ @GuardedBy("mSharedLock")
private void trySendCurrentRequest() {
TimeZoneProviderRequest request = mRequest;
mServiceWatcher.runOnBinder(binder -> {
diff --git a/services/core/java/com/android/server/media/MediaSessionService.java b/services/core/java/com/android/server/media/MediaSessionService.java
index 4be7689..1b27ef4 100644
--- a/services/core/java/com/android/server/media/MediaSessionService.java
+++ b/services/core/java/com/android/server/media/MediaSessionService.java
@@ -16,6 +16,7 @@
package com.android.server.media;
+import static android.Manifest.permission.INTERACT_ACROSS_USERS_FULL;
import static android.os.UserHandle.ALL;
import static android.os.UserHandle.CURRENT;
@@ -42,7 +43,7 @@
import android.content.pm.ParceledListSlice;
import android.media.AudioManager;
import android.media.AudioPlaybackConfiguration;
-import android.media.IRemoteVolumeControllerCallback;
+import android.media.IRemoteSessionCallback;
import android.media.Session2Token;
import android.media.session.IActiveSessionsListener;
import android.media.session.IOnMediaKeyEventDispatchedListener;
@@ -141,7 +142,7 @@
// Used to notify System UI and Settings when remote volume was changed.
@GuardedBy("mLock")
- final RemoteCallbackList<IRemoteVolumeControllerCallback> mRemoteVolumeControllers =
+ final RemoteCallbackList<IRemoteSessionCallback> mRemoteVolumeControllers =
new RemoteCallbackList<>();
private SessionPolicyProvider mCustomSessionPolicyProvider;
@@ -303,7 +304,7 @@
MediaSession.Token token = session.getSessionToken();
for (int i = size - 1; i >= 0; i--) {
try {
- IRemoteVolumeControllerCallback cb =
+ IRemoteSessionCallback cb =
mRemoteVolumeControllers.getBroadcastItem(i);
cb.onVolumeChanged(token, flags);
} catch (Exception e) {
@@ -712,7 +713,7 @@
for (int i = size - 1; i >= 0; i--) {
try {
- IRemoteVolumeControllerCallback cb =
+ IRemoteSessionCallback cb =
mRemoteVolumeControllers.getBroadcastItem(i);
cb.onSessionChanged(token);
} catch (Exception e) {
@@ -1115,8 +1116,7 @@
final long token = Binder.clearCallingIdentity();
try {
enforcePackageName(packageName, uid);
- int resolvedUserId = ActivityManager.handleIncomingUser(pid, uid, userId,
- false /* allowAll */, true /* requireFull */, "createSession", packageName);
+ int resolvedUserId = handleIncomingUser(pid, uid, userId, packageName);
if (cb == null) {
throw new IllegalArgumentException("Controller callback cannot be null");
}
@@ -1191,11 +1191,8 @@
final long token = Binder.clearCallingIdentity();
try {
- // Check that they can make calls on behalf of the user and
- // get the final user id
- int resolvedUserId = ActivityManager.handleIncomingUser(pid, uid, userId,
- true /* allowAll */, true /* requireFull */, "getSession2Tokens",
- null /* optional packageName */);
+ // Check that they can make calls on behalf of the user and get the final user id
+ int resolvedUserId = handleIncomingUser(pid, uid, userId, null);
List<Session2Token> result;
synchronized (mLock) {
FullUserRecord user = getFullUserRecordLocked(userId);
@@ -1262,9 +1259,7 @@
try {
// Check that they can make calls on behalf of the user and get the final user id.
- int resolvedUserId = ActivityManager.handleIncomingUser(pid, uid, userId,
- true /* allowAll */, true /* requireFull */, "addSession2TokensListener",
- null /* optional packageName */);
+ int resolvedUserId = handleIncomingUser(pid, uid, userId, null);
synchronized (mLock) {
int index = findIndexOfSession2TokensListenerLocked(listener);
if (index >= 0) {
@@ -1844,7 +1839,7 @@
}
@Override
- public void registerRemoteVolumeControllerCallback(IRemoteVolumeControllerCallback rvc) {
+ public void registerRemoteSessionCallback(IRemoteSessionCallback rvc) {
final int pid = Binder.getCallingPid();
final int uid = Binder.getCallingUid();
final long token = Binder.clearCallingIdentity();
@@ -1859,7 +1854,7 @@
}
@Override
- public void unregisterRemoteVolumeControllerCallback(IRemoteVolumeControllerCallback rvc) {
+ public void unregisterRemoteSessionCallback(IRemoteSessionCallback rvc) {
final int pid = Binder.getCallingPid();
final int uid = Binder.getCallingUid();
final long token = Binder.clearCallingIdentity();
@@ -1981,16 +1976,40 @@
packageName = componentName.getPackageName();
enforcePackageName(packageName, uid);
}
- // Check that they can make calls on behalf of the user and
- // get the final user id
- int resolvedUserId = ActivityManager.handleIncomingUser(pid, uid, userId,
- true /* allowAll */, true /* requireFull */, "getSessions", packageName);
- // Check if they have the permissions or their component is
- // enabled for the user they're calling from.
+ // Check that they can make calls on behalf of the user and get the final user id
+ int resolvedUserId = handleIncomingUser(pid, uid, userId, packageName);
+ // Check if they have the permissions or their component is enabled for the user
+ // they're calling from.
enforceMediaPermissions(componentName, pid, uid, resolvedUserId);
return resolvedUserId;
}
+ // Handles incoming user by checking whether the caller has permission to access the
+ // given user id's information or not. Permission is not necessary if the given user id is
+ // equal to the caller's user id, but if not, the caller needs to have the
+ // INTERACT_ACROSS_USERS_FULL permission. Otherwise, a security exception will be thrown.
+ // The return value will be the given user id, unless the given user id is
+ // UserHandle.CURRENT, which will return the ActivityManager.getCurrentUser() value instead.
+ private int handleIncomingUser(int pid, int uid, int userId, String packageName) {
+ int callingUserId = UserHandle.getUserHandleForUid(uid).getIdentifier();
+ if (userId == callingUserId) {
+ return userId;
+ }
+
+ boolean canInteractAcrossUsersFull = mContext.checkPermission(
+ INTERACT_ACROSS_USERS_FULL, pid, uid) == PackageManager.PERMISSION_GRANTED;
+ if (canInteractAcrossUsersFull) {
+ if (userId == CURRENT.getIdentifier()) {
+ return ActivityManager.getCurrentUser();
+ }
+ return userId;
+ }
+
+ throw new SecurityException("Permission denied while calling from " + packageName
+ + " with user id: " + userId + "; Need to run as either the calling user id ("
+ + callingUserId + "), or with " + INTERACT_ACROSS_USERS_FULL + " permission");
+ }
+
private boolean hasEnabledNotificationListener(int callingUserId,
String controllerPackageName, int controllerUid) {
int controllerUserId = UserHandle.getUserHandleForUid(controllerUid).getIdentifier();
diff --git a/services/core/java/com/android/server/net/IpConfigStore.java b/services/core/java/com/android/server/net/IpConfigStore.java
index 9c5abd4..cc3a002 100644
--- a/services/core/java/com/android/server/net/IpConfigStore.java
+++ b/services/core/java/com/android/server/net/IpConfigStore.java
@@ -30,6 +30,7 @@
import android.util.SparseArray;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.net.module.util.ProxyUtils;
import java.io.BufferedInputStream;
import java.io.DataInputStream;
@@ -123,7 +124,8 @@
switch (config.proxySettings) {
case STATIC:
ProxyInfo proxyProperties = config.httpProxy;
- String exclusionList = proxyProperties.getExclusionListAsString();
+ String exclusionList = ProxyUtils.exclusionListAsString(
+ proxyProperties.getExclusionList());
out.writeUTF(PROXY_SETTINGS_KEY);
out.writeUTF(config.proxySettings.toString());
out.writeUTF(PROXY_HOST_KEY);
@@ -370,13 +372,14 @@
switch (proxySettings) {
case STATIC:
- ProxyInfo proxyInfo =
- new ProxyInfo(proxyHost, proxyPort, exclusionList);
+ ProxyInfo proxyInfo = ProxyInfo.buildDirectProxy(proxyHost, proxyPort,
+ ProxyUtils.exclusionStringAsList(exclusionList));
config.proxySettings = proxySettings;
config.httpProxy = proxyInfo;
break;
case PAC:
- ProxyInfo proxyPacProperties = new ProxyInfo(Uri.parse(pacFileUrl));
+ ProxyInfo proxyPacProperties =
+ ProxyInfo.buildPacProxy(Uri.parse(pacFileUrl));
config.proxySettings = proxySettings;
config.httpProxy = proxyPacProperties;
break;
diff --git a/services/core/java/com/android/server/net/NetworkPolicyLogger.java b/services/core/java/com/android/server/net/NetworkPolicyLogger.java
index 5bd352c..676f421 100644
--- a/services/core/java/com/android/server/net/NetworkPolicyLogger.java
+++ b/services/core/java/com/android/server/net/NetworkPolicyLogger.java
@@ -78,6 +78,7 @@
static final int NTWK_BLOCKED_BG_RESTRICT = 5;
static final int NTWK_ALLOWED_DEFAULT = 6;
static final int NTWK_ALLOWED_SYSTEM = 7;
+ static final int NTWK_BLOCKED_RESTRICTED_MODE = 8;
private final LogBuffer mNetworkBlockedBuffer = new LogBuffer(MAX_NETWORK_BLOCKED_LOG_SIZE);
private final LogBuffer mUidStateChangeBuffer = new LogBuffer(MAX_LOG_SIZE);
@@ -281,6 +282,8 @@
return "blocked when background is restricted";
case NTWK_ALLOWED_DEFAULT:
return "allowed by default";
+ case NTWK_BLOCKED_RESTRICTED_MODE:
+ return "blocked by restricted networking mode";
default:
return String.valueOf(reason);
}
diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
index 5f8b31a..0e7b4b8 100644
--- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
+++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
@@ -18,6 +18,7 @@
import static android.Manifest.permission.ACCESS_NETWORK_STATE;
import static android.Manifest.permission.CONNECTIVITY_INTERNAL;
+import static android.Manifest.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS;
import static android.Manifest.permission.MANAGE_NETWORK_POLICY;
import static android.Manifest.permission.MANAGE_SUBSCRIPTION_PLANS;
import static android.Manifest.permission.NETWORK_SETTINGS;
@@ -26,6 +27,8 @@
import static android.Manifest.permission.READ_NETWORK_USAGE_HISTORY;
import static android.Manifest.permission.READ_PHONE_STATE;
import static android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE;
+import static android.app.PendingIntent.FLAG_IMMUTABLE;
+import static android.app.PendingIntent.FLAG_UPDATE_CURRENT;
import static android.content.Intent.ACTION_PACKAGE_ADDED;
import static android.content.Intent.ACTION_UID_REMOVED;
import static android.content.Intent.ACTION_USER_ADDED;
@@ -44,6 +47,7 @@
import static android.net.ConnectivityManager.TYPE_MOBILE;
import static android.net.INetd.FIREWALL_CHAIN_DOZABLE;
import static android.net.INetd.FIREWALL_CHAIN_POWERSAVE;
+import static android.net.INetd.FIREWALL_CHAIN_RESTRICTED;
import static android.net.INetd.FIREWALL_CHAIN_STANDBY;
import static android.net.INetd.FIREWALL_RULE_ALLOW;
import static android.net.INetd.FIREWALL_RULE_DENY;
@@ -57,6 +61,7 @@
import static android.net.NetworkPolicyManager.FIREWALL_RULE_DEFAULT;
import static android.net.NetworkPolicyManager.MASK_ALL_NETWORKS;
import static android.net.NetworkPolicyManager.MASK_METERED_NETWORKS;
+import static android.net.NetworkPolicyManager.MASK_RESTRICTED_MODE_NETWORKS;
import static android.net.NetworkPolicyManager.POLICY_ALLOW_METERED_BACKGROUND;
import static android.net.NetworkPolicyManager.POLICY_NONE;
import static android.net.NetworkPolicyManager.POLICY_REJECT_METERED_BACKGROUND;
@@ -65,12 +70,14 @@
import static android.net.NetworkPolicyManager.RULE_NONE;
import static android.net.NetworkPolicyManager.RULE_REJECT_ALL;
import static android.net.NetworkPolicyManager.RULE_REJECT_METERED;
+import static android.net.NetworkPolicyManager.RULE_REJECT_RESTRICTED_MODE;
import static android.net.NetworkPolicyManager.RULE_TEMPORARY_ALLOW_METERED;
import static android.net.NetworkPolicyManager.isProcStateAllowedWhileIdleOrPowerSaveMode;
import static android.net.NetworkPolicyManager.isProcStateAllowedWhileOnRestrictBackground;
import static android.net.NetworkPolicyManager.resolveNetworkId;
import static android.net.NetworkPolicyManager.uidPoliciesToString;
import static android.net.NetworkPolicyManager.uidRulesToString;
+import static android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK;
import static android.net.NetworkTemplate.MATCH_MOBILE;
import static android.net.NetworkTemplate.MATCH_WIFI;
import static android.net.NetworkTemplate.buildTemplateMobileAll;
@@ -111,6 +118,7 @@
import static com.android.server.net.NetworkPolicyLogger.NTWK_BLOCKED_BG_RESTRICT;
import static com.android.server.net.NetworkPolicyLogger.NTWK_BLOCKED_DENYLIST;
import static com.android.server.net.NetworkPolicyLogger.NTWK_BLOCKED_POWER;
+import static com.android.server.net.NetworkPolicyLogger.NTWK_BLOCKED_RESTRICTED_MODE;
import static com.android.server.net.NetworkStatsService.ACTION_NETWORK_STATS_UPDATED;
import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT;
@@ -143,6 +151,7 @@
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.UserInfo;
import android.content.res.Resources;
+import android.database.ContentObserver;
import android.net.ConnectivityManager;
import android.net.ConnectivityManager.NetworkCallback;
import android.net.IConnectivityManager;
@@ -176,6 +185,7 @@
import android.os.INetworkManagementService;
import android.os.Message;
import android.os.MessageQueue.IdleHandler;
+import android.os.ParcelFileDescriptor;
import android.os.PersistableBundle;
import android.os.PowerManager;
import android.os.PowerManager.ServiceType;
@@ -185,8 +195,6 @@
import android.os.Process;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
-import android.os.ResultReceiver;
-import android.os.ShellCallback;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.Trace;
@@ -237,6 +245,7 @@
import com.android.server.LocalServices;
import com.android.server.ServiceThread;
import com.android.server.SystemConfig;
+import com.android.server.connectivity.MultipathPolicyTracker;
import com.android.server.usage.AppStandbyInternal;
import com.android.server.usage.AppStandbyInternal.AppIdleStateChangeListener;
@@ -414,6 +423,7 @@
private final Clock mClock;
private final UserManager mUserManager;
private final CarrierConfigManager mCarrierConfigManager;
+ private final MultipathPolicyTracker mMultipathPolicyTracker;
private IConnectivityManager mConnManager;
private PowerManagerInternal mPowerManagerInternal;
@@ -441,7 +451,10 @@
@GuardedBy("mUidRulesFirstLock") volatile boolean mRestrictPower;
@GuardedBy("mUidRulesFirstLock") volatile boolean mDeviceIdleMode;
// Store whether user flipped restrict background in battery saver mode
- @GuardedBy("mUidRulesFirstLock") volatile boolean mRestrictBackgroundChangedInBsm;
+ @GuardedBy("mUidRulesFirstLock")
+ volatile boolean mRestrictBackgroundChangedInBsm;
+ @GuardedBy("mUidRulesFirstLock")
+ volatile boolean mRestrictedNetworkingMode;
private final boolean mSuppressDefaultPolicy;
@@ -475,6 +488,8 @@
final SparseIntArray mUidFirewallDozableRules = new SparseIntArray();
@GuardedBy("mUidRulesFirstLock")
final SparseIntArray mUidFirewallPowerSaveRules = new SparseIntArray();
+ @GuardedBy("mUidRulesFirstLock")
+ final SparseIntArray mUidFirewallRestrictedModeRules = new SparseIntArray();
/** Set of states for the child firewall chains. True if the chain is active. */
@GuardedBy("mUidRulesFirstLock")
@@ -594,6 +609,8 @@
@GuardedBy("mUidRulesFirstLock")
private final SparseBooleanArray mInternetPermissionMap = new SparseBooleanArray();
+ private RestrictedModeObserver mRestrictedModeObserver;
+
// TODO: keep allowlist of system-critical services that should never have
// rules enforced, such as system, phone, and radio UIDs.
@@ -607,7 +624,35 @@
int COUNT = IS_UID_NETWORKING_BLOCKED + 1;
}
- public final StatLogger mStatLogger = new StatLogger(new String[] {
+ private static class RestrictedModeObserver extends ContentObserver {
+ private final Context mContext;
+ private final RestrictedModeListener mListener;
+
+ RestrictedModeObserver(Context ctx, RestrictedModeListener listener) {
+ super(null);
+ mContext = ctx;
+ mListener = listener;
+ mContext.getContentResolver().registerContentObserver(
+ Settings.Global.getUriFor(Settings.Global.RESTRICTED_NETWORKING_MODE), false,
+ this);
+ }
+
+ public boolean isRestrictedModeEnabled() {
+ return Settings.Global.getInt(mContext.getContentResolver(),
+ Settings.Global.RESTRICTED_NETWORKING_MODE, 0) != 0;
+ }
+
+ @Override
+ public void onChange(boolean selfChange) {
+ mListener.onChange(isRestrictedModeEnabled());
+ }
+
+ public interface RestrictedModeListener {
+ void onChange(boolean enabled);
+ }
+ }
+
+ public final StatLogger mStatLogger = new StatLogger(new String[]{
"updateNetworkEnabledNL()",
"isUidNetworkingBlocked()",
});
@@ -654,7 +699,7 @@
mPolicyFile = new AtomicFile(new File(systemDir, "netpolicy.xml"), "net-policy");
mAppOps = context.getSystemService(AppOpsManager.class);
-
+ mMultipathPolicyTracker = new MultipathPolicyTracker(mContext, mHandler);
// Expose private service for system components to use.
LocalServices.addService(NetworkPolicyManagerInternal.class,
new NetworkPolicyManagerInternalImpl());
@@ -683,7 +728,7 @@
* Allows pre-defined apps for restrict background, but only if the user didn't already
* revoked them.
*
- * @return whether any uid has been allowlisted.
+ * @return whether any uid has been added to allowlist.
*/
@GuardedBy("mUidRulesFirstLock")
boolean addDefaultRestrictBackgroundAllowlistUidsUL() {
@@ -707,7 +752,7 @@
for (int i = 0; i < allowDataUsage.size(); i++) {
final String pkg = allowDataUsage.valueAt(i);
if (LOGD)
- Slog.d(TAG, "checking restricted background allowlisting for package " + pkg
+ Slog.d(TAG, "checking restricted background exemption for package " + pkg
+ " and user " + userId);
final ApplicationInfo app;
try {
@@ -782,6 +827,15 @@
mRestrictPower = mPowerManagerInternal.getLowPowerState(
ServiceType.NETWORK_FIREWALL).batterySaverEnabled;
+ mRestrictedModeObserver = new RestrictedModeObserver(mContext,
+ enabled -> {
+ synchronized (mUidRulesFirstLock) {
+ mRestrictedNetworkingMode = enabled;
+ updateRestrictedModeAllowlistUL();
+ }
+ });
+ mRestrictedNetworkingMode = mRestrictedModeObserver.isRestrictedModeEnabled();
+
mSystemReady = true;
waitForAdminData();
@@ -922,6 +976,7 @@
if (!initCompleteSignal.await(30, TimeUnit.SECONDS)) {
throw new IllegalStateException("Service " + TAG +" init timeout");
}
+ mMultipathPolicyTracker.start();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IllegalStateException("Service " + TAG + " init interrupted", e);
@@ -1023,7 +1078,7 @@
// user resets app preferences.
mMeteredRestrictedUids.remove(userId);
if (action == ACTION_USER_ADDED) {
- // Add apps that are allowlisted by default.
+ // Add apps that are allowed by default.
addDefaultRestrictBackgroundAllowlistUidsUL(userId);
}
// Update global restrict for that user
@@ -1376,17 +1431,17 @@
final Intent snoozeIntent = buildSnoozeWarningIntent(policy.template);
builder.setDeleteIntent(PendingIntent.getBroadcast(
- mContext, 0, snoozeIntent, PendingIntent.FLAG_UPDATE_CURRENT));
+ mContext, 0, snoozeIntent, FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE));
final Intent viewIntent = buildViewDataUsageIntent(res, policy.template);
// TODO: Resolve to single code path.
if (UserManager.isHeadlessSystemUserMode()) {
builder.setContentIntent(PendingIntent.getActivityAsUser(
- mContext, 0, viewIntent, PendingIntent.FLAG_UPDATE_CURRENT,
+ mContext, 0, viewIntent, FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE,
/* options= */ null, UserHandle.CURRENT));
} else {
builder.setContentIntent(PendingIntent.getActivity(
- mContext, 0, viewIntent, PendingIntent.FLAG_UPDATE_CURRENT));
+ mContext, 0, viewIntent, FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE));
}
break;
}
@@ -1410,11 +1465,11 @@
// TODO: Resolve to single code path.
if (UserManager.isHeadlessSystemUserMode()) {
builder.setContentIntent(PendingIntent.getActivityAsUser(
- mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT,
+ mContext, 0, intent, FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE,
/* options= */ null, UserHandle.CURRENT));
} else {
builder.setContentIntent(PendingIntent.getActivity(
- mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT));
+ mContext, 0, intent, FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE));
}
break;
}
@@ -1441,11 +1496,11 @@
// TODO: Resolve to single code path.
if (UserManager.isHeadlessSystemUserMode()) {
builder.setContentIntent(PendingIntent.getActivityAsUser(
- mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT,
+ mContext, 0, intent, FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE,
/* options= */ null, UserHandle.CURRENT));
} else {
builder.setContentIntent(PendingIntent.getActivity(
- mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT));
+ mContext, 0, intent, FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE));
}
break;
}
@@ -1462,17 +1517,17 @@
final Intent snoozeIntent = buildSnoozeRapidIntent(policy.template);
builder.setDeleteIntent(PendingIntent.getBroadcast(
- mContext, 0, snoozeIntent, PendingIntent.FLAG_UPDATE_CURRENT));
+ mContext, 0, snoozeIntent, FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE));
final Intent viewIntent = buildViewDataUsageIntent(res, policy.template);
// TODO: Resolve to single code path.
if (UserManager.isHeadlessSystemUserMode()) {
builder.setContentIntent(PendingIntent.getActivityAsUser(
- mContext, 0, viewIntent, PendingIntent.FLAG_UPDATE_CURRENT,
+ mContext, 0, viewIntent, FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE,
/* options= */ null, UserHandle.CURRENT));
} else {
builder.setContentIntent(PendingIntent.getActivity(
- mContext, 0, viewIntent, PendingIntent.FLAG_UPDATE_CURRENT));
+ mContext, 0, viewIntent, FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE));
}
break;
}
@@ -2228,8 +2283,8 @@
final TypedXmlPullParser in = Xml.resolvePullParser(fis);
// Must save the <restrict-background> tags and convert them to <uid-policy> later,
- // to skip UIDs that were explicitly denylisted.
- final SparseBooleanArray allowlistedRestrictBackground = new SparseBooleanArray();
+ // to skip UIDs that were explicitly denied.
+ final SparseBooleanArray restrictBackgroundAllowedUids = new SparseBooleanArray();
int type;
int version = VERSION_INIT;
@@ -2387,7 +2442,7 @@
insideAllowlist = true;
} else if (TAG_RESTRICT_BACKGROUND.equals(tag) && insideAllowlist) {
final int uid = readIntAttribute(in, ATTR_UID);
- allowlistedRestrictBackground.append(uid, true);
+ restrictBackgroundAllowedUids.append(uid, true);
} else if (TAG_REVOKED_RESTRICT_BACKGROUND.equals(tag) && insideAllowlist) {
final int uid = readIntAttribute(in, ATTR_UID);
mRestrictBackgroundAllowlistRevokedUids.put(uid, true);
@@ -2400,9 +2455,9 @@
}
}
- final int size = allowlistedRestrictBackground.size();
+ final int size = restrictBackgroundAllowedUids.size();
for (int i = 0; i < size; i++) {
- final int uid = allowlistedRestrictBackground.keyAt(i);
+ final int uid = restrictBackgroundAllowedUids.keyAt(i);
final int policy = mUidPolicy.get(uid, POLICY_NONE);
if ((policy & POLICY_REJECT_METERED_BACKGROUND) != 0) {
Slog.w(TAG, "ignoring restrict-background-allowlist for " + uid
@@ -2668,13 +2723,13 @@
if (!isUidValidForAllowlistRulesUL(uid)) {
notifyApp = false;
} else {
- final boolean wasDenylisted = oldPolicy == POLICY_REJECT_METERED_BACKGROUND;
- final boolean isDenylisted = policy == POLICY_REJECT_METERED_BACKGROUND;
- final boolean wasAllowlisted = oldPolicy == POLICY_ALLOW_METERED_BACKGROUND;
- final boolean isAllowlisted = policy == POLICY_ALLOW_METERED_BACKGROUND;
- final boolean wasBlocked = wasDenylisted || (mRestrictBackground && !wasAllowlisted);
- final boolean isBlocked = isDenylisted || (mRestrictBackground && !isAllowlisted);
- if ((wasAllowlisted && (!isAllowlisted || isDenylisted))
+ final boolean wasDenied = oldPolicy == POLICY_REJECT_METERED_BACKGROUND;
+ final boolean isDenied = policy == POLICY_REJECT_METERED_BACKGROUND;
+ final boolean wasAllowed = oldPolicy == POLICY_ALLOW_METERED_BACKGROUND;
+ final boolean isAllowed = policy == POLICY_ALLOW_METERED_BACKGROUND;
+ final boolean wasBlocked = wasDenied || (mRestrictBackground && !wasAllowed);
+ final boolean isBlocked = isDenied || (mRestrictBackground && !isAllowed);
+ if ((wasAllowed && (!isAllowed || isDenied))
&& mDefaultRestrictBackgroundAllowlistUids.get(uid)
&& !mRestrictBackgroundAllowlistRevokedUids.get(uid)) {
if (LOGD)
@@ -2959,7 +3014,7 @@
Slog.d(TAG, "setRestrictBackgroundUL(): " + restrictBackground + "; reason: " + reason);
final boolean oldRestrictBackground = mRestrictBackground;
mRestrictBackground = restrictBackground;
- // Must allowlist foreground apps before turning data saver mode on.
+ // Must allow foreground apps before turning data saver mode on.
// TODO: there is no need to iterate through all apps here, just those in the foreground,
// so it could call AM to get the UIDs of such apps, and iterate through them instead.
updateRulesForRestrictBackgroundUL();
@@ -3012,7 +3067,7 @@
Binder.restoreCallingIdentity(token);
}
if (policy == POLICY_REJECT_METERED_BACKGROUND) {
- // App is denylisted.
+ // App is restricted.
return RESTRICT_BACKGROUND_STATUS_ENABLED;
}
if (!mRestrictBackground) {
@@ -3455,6 +3510,17 @@
}
}
+ /**
+ * Get multipath preference value for the given network.
+ */
+ public int getMultipathPreference(Network network) {
+ final Integer preference = mMultipathPolicyTracker.getMultipathPreference(network);
+ if (preference != null) {
+ return preference;
+ }
+ return 0;
+ }
+
@Override
protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
if (!DumpUtils.checkDumpPermission(mContext, TAG, writer)) return;
@@ -3483,6 +3549,7 @@
fout.print("Restrict background: "); fout.println(mRestrictBackground);
fout.print("Restrict power: "); fout.println(mRestrictPower);
fout.print("Device idle: "); fout.println(mDeviceIdleMode);
+ fout.print("Restricted networking mode: "); fout.println(mRestrictedNetworkingMode);
synchronized (mMeteredIfacesLock) {
fout.print("Metered ifaces: ");
fout.println(mMeteredIfaces);
@@ -3675,13 +3742,16 @@
mLogger.dumpLogs(fout);
}
}
+ fout.println();
+ mMultipathPolicyTracker.dump(fout);
}
@Override
- public void onShellCommand(FileDescriptor in, FileDescriptor out, FileDescriptor err,
- String[] args, ShellCallback callback, ResultReceiver resultReceiver) {
- (new NetworkPolicyManagerShellCommand(mContext, this)).exec(
- this, in, out, err, args, callback, resultReceiver);
+ public int handleShellCommand(@NonNull ParcelFileDescriptor in,
+ @NonNull ParcelFileDescriptor out, @NonNull ParcelFileDescriptor err,
+ @NonNull String[] args) {
+ return new NetworkPolicyManagerShellCommand(mContext, this).exec(this,
+ in.getFileDescriptor(), out.getFileDescriptor(), err.getFileDescriptor(), args);
}
void setDebugUid(int uid) {
@@ -3792,6 +3862,93 @@
}
}
+ /**
+ * updates restricted mode state / access for all apps
+ * Called on initialization and when restricted mode is enabled / disabled.
+ */
+ @VisibleForTesting
+ @GuardedBy("mUidRulesFirstLock")
+ void updateRestrictedModeAllowlistUL() {
+ mUidFirewallRestrictedModeRules.clear();
+ forEachUid("updateRestrictedModeAllowlist", uid -> {
+ final int oldUidRule = mUidRules.get(uid);
+ final int newUidRule = getNewRestrictedModeUidRule(uid, oldUidRule);
+ final boolean hasUidRuleChanged = oldUidRule != newUidRule;
+ final int newFirewallRule = getRestrictedModeFirewallRule(newUidRule);
+
+ // setUidFirewallRulesUL will allowlist all uids that are passed to it, so only add
+ // non-default rules.
+ if (newFirewallRule != FIREWALL_RULE_DEFAULT) {
+ mUidFirewallRestrictedModeRules.append(uid, newFirewallRule);
+ }
+
+ if (hasUidRuleChanged) {
+ mUidRules.put(uid, newUidRule);
+ mHandler.obtainMessage(MSG_RULES_CHANGED, uid, newUidRule).sendToTarget();
+ }
+ });
+ if (mRestrictedNetworkingMode) {
+ // firewall rules only need to be set when this mode is being enabled.
+ setUidFirewallRulesUL(FIREWALL_CHAIN_RESTRICTED, mUidFirewallRestrictedModeRules);
+ }
+ enableFirewallChainUL(FIREWALL_CHAIN_RESTRICTED, mRestrictedNetworkingMode);
+ }
+
+ // updates restricted mode state / access for a single app / uid.
+ @VisibleForTesting
+ @GuardedBy("mUidRulesFirstLock")
+ void updateRestrictedModeForUidUL(int uid) {
+ final int oldUidRule = mUidRules.get(uid);
+ final int newUidRule = getNewRestrictedModeUidRule(uid, oldUidRule);
+ final boolean hasUidRuleChanged = oldUidRule != newUidRule;
+
+ if (hasUidRuleChanged) {
+ mUidRules.put(uid, newUidRule);
+ mHandler.obtainMessage(MSG_RULES_CHANGED, uid, newUidRule).sendToTarget();
+ }
+
+ // if restricted networking mode is on, and the app has an access exemption, the uid rule
+ // will not change, but the firewall rule will have to be updated.
+ if (mRestrictedNetworkingMode) {
+ // Note: setUidFirewallRule also updates mUidFirewallRestrictedModeRules.
+ // In this case, default firewall rules can also be added.
+ setUidFirewallRule(FIREWALL_CHAIN_RESTRICTED, uid,
+ getRestrictedModeFirewallRule(newUidRule));
+ }
+ }
+
+ private int getNewRestrictedModeUidRule(int uid, int oldUidRule) {
+ int newRule = oldUidRule;
+ newRule &= ~MASK_RESTRICTED_MODE_NETWORKS;
+ if (mRestrictedNetworkingMode && !hasRestrictedModeAccess(uid)) {
+ newRule |= RULE_REJECT_RESTRICTED_MODE;
+ }
+ return newRule;
+ }
+
+ private static int getRestrictedModeFirewallRule(int uidRule) {
+ if ((uidRule & RULE_REJECT_RESTRICTED_MODE) != 0) {
+ // rejected in restricted mode, this is the default behavior.
+ return FIREWALL_RULE_DEFAULT;
+ } else {
+ return FIREWALL_RULE_ALLOW;
+ }
+ }
+
+ private boolean hasRestrictedModeAccess(int uid) {
+ try {
+ // TODO: this needs to be kept in sync with
+ // PermissionMonitor#hasRestrictedNetworkPermission
+ return mIPm.checkUidPermission(CONNECTIVITY_USE_RESTRICTED_NETWORKS, uid)
+ == PERMISSION_GRANTED
+ || mIPm.checkUidPermission(NETWORK_STACK, uid) == PERMISSION_GRANTED
+ || mIPm.checkUidPermission(PERMISSION_MAINLINE_NETWORK_STACK, uid)
+ == PERMISSION_GRANTED;
+ } catch (RemoteException e) {
+ return false;
+ }
+ }
+
@GuardedBy("mUidRulesFirstLock")
void updateRulesForPowerSaveUL() {
Trace.traceBegin(Trace.TRACE_TAG_NETWORK, "updateRulesForPowerSaveUL");
@@ -4013,6 +4170,7 @@
updateRulesForAppIdleUL();
updateRulesForRestrictPowerUL();
updateRulesForRestrictBackgroundUL();
+ updateRestrictedModeAllowlistUL();
// If the set of restricted networks may have changed, re-evaluate those.
if (restrictedNetworksChanged) {
@@ -4229,6 +4387,7 @@
mPowerSaveWhitelistAppIds.delete(uid);
mPowerSaveTempWhitelistAppIds.delete(uid);
mAppIdleTempWhitelistAppIds.delete(uid);
+ mUidFirewallRestrictedModeRules.delete(uid);
// ...then update iptables asynchronously.
mHandler.obtainMessage(MSG_RESET_FIREWALL_RULES_BY_UID, uid, 0).sendToTarget();
@@ -4254,6 +4413,10 @@
updateRuleForAppIdleUL(uid);
updateRuleForRestrictPowerUL(uid);
+ // If the uid has the necessary permissions, then it should be added to the restricted mode
+ // firewall allowlist.
+ updateRestrictedModeForUidUL(uid);
+
// Update internal state for power-related modes.
updateRulesForPowerRestrictionsUL(uid);
@@ -4271,9 +4434,9 @@
* <ul>
* <li>@{code bw_penalty_box}: UIDs added to this chain do not have access (denylist).
* <li>@{code bw_happy_box}: UIDs added to this chain have access (allowlist), unless they're
- * also denylisted.
+ * also in denylist.
* <li>@{code bw_data_saver}: when enabled (through {@link #setRestrictBackground(boolean)}),
- * no UIDs other than those allowlisted will have access.
+ * no UIDs other than those in allowlist will have access.
* <ul>
*
* <p>The @{code bw_penalty_box} and @{code bw_happy_box} are primarily managed through the
@@ -4288,7 +4451,8 @@
* <ul>
* <li>When Data Saver mode is on, the foreground app should be temporarily added to
* {@code bw_happy_box} before the @{code bw_data_saver} chain is enabled.
- * <li>If the foreground app is denylisted by the user, it should be temporarily removed from
+ * <li>If the foreground app was restricted by the user (i.e. has the policy
+ * {@code POLICY_REJECT_METERED_BACKGROUND}), it should be temporarily removed from
* {@code bw_penalty_box}.
* <li>When the app leaves foreground state, the temporary changes above should be reverted.
* </ul>
@@ -4323,8 +4487,8 @@
final boolean isForeground = isUidForegroundOnRestrictBackgroundUL(uid);
final boolean isRestrictedByAdmin = isRestrictedByAdminUL(uid);
- final boolean isDenylisted = (uidPolicy & POLICY_REJECT_METERED_BACKGROUND) != 0;
- final boolean isAllowlisted = (uidPolicy & POLICY_ALLOW_METERED_BACKGROUND) != 0;
+ final boolean isDenied = (uidPolicy & POLICY_REJECT_METERED_BACKGROUND) != 0;
+ final boolean isAllowed = (uidPolicy & POLICY_ALLOW_METERED_BACKGROUND) != 0;
final int oldRule = oldUidRules & MASK_METERED_NETWORKS;
int newRule = RULE_NONE;
@@ -4332,15 +4496,15 @@
if (isRestrictedByAdmin) {
newRule = RULE_REJECT_METERED;
} else if (isForeground) {
- if (isDenylisted || (mRestrictBackground && !isAllowlisted)) {
+ if (isDenied || (mRestrictBackground && !isAllowed)) {
newRule = RULE_TEMPORARY_ALLOW_METERED;
- } else if (isAllowlisted) {
+ } else if (isAllowed) {
newRule = RULE_ALLOW_METERED;
}
} else {
- if (isDenylisted) {
+ if (isDenied) {
newRule = RULE_REJECT_METERED;
- } else if (mRestrictBackground && isAllowlisted) {
+ } else if (mRestrictBackground && isAllowed) {
newRule = RULE_ALLOW_METERED;
}
}
@@ -4349,8 +4513,8 @@
if (LOGV) {
Log.v(TAG, "updateRuleForRestrictBackgroundUL(" + uid + ")"
+ ": isForeground=" +isForeground
- + ", isDenylisted=" + isDenylisted
- + ", isAllowlisted=" + isAllowlisted
+ + ", isDenied=" + isDenied
+ + ", isAllowed=" + isAllowed
+ ", isRestrictedByAdmin=" + isRestrictedByAdmin
+ ", oldRule=" + uidRulesToString(oldRule)
+ ", newRule=" + uidRulesToString(newRule)
@@ -4367,49 +4531,49 @@
// Second step: apply bw changes based on change of state.
if (newRule != oldRule) {
if (hasRule(newRule, RULE_TEMPORARY_ALLOW_METERED)) {
- // Temporarily allowlist foreground app, removing from denylist if necessary
+ // Temporarily allow foreground app, removing from denylist if necessary
// (since bw_penalty_box prevails over bw_happy_box).
setMeteredNetworkAllowlist(uid, true);
// TODO: if statement below is used to avoid an unnecessary call to netd / iptables,
// but ideally it should be just:
- // setMeteredNetworkDenylist(uid, isDenylisted);
- if (isDenylisted) {
+ // setMeteredNetworkDenylist(uid, isDenied);
+ if (isDenied) {
setMeteredNetworkDenylist(uid, false);
}
} else if (hasRule(oldRule, RULE_TEMPORARY_ALLOW_METERED)) {
- // Remove temporary allowlist from app that is not on foreground anymore.
+ // Remove temporary exemption from app that is not on foreground anymore.
// TODO: if statements below are used to avoid unnecessary calls to netd / iptables,
// but ideally they should be just:
- // setMeteredNetworkAllowlist(uid, isAllowlisted);
- // setMeteredNetworkDenylist(uid, isDenylisted);
- if (!isAllowlisted) {
+ // setMeteredNetworkAllowlist(uid, isAllowed);
+ // setMeteredNetworkDenylist(uid, isDenied);
+ if (!isAllowed) {
setMeteredNetworkAllowlist(uid, false);
}
- if (isDenylisted || isRestrictedByAdmin) {
+ if (isDenied || isRestrictedByAdmin) {
setMeteredNetworkDenylist(uid, true);
}
} else if (hasRule(newRule, RULE_REJECT_METERED)
|| hasRule(oldRule, RULE_REJECT_METERED)) {
// Flip state because app was explicitly added or removed to denylist.
- setMeteredNetworkDenylist(uid, (isDenylisted || isRestrictedByAdmin));
- if (hasRule(oldRule, RULE_REJECT_METERED) && isAllowlisted) {
- // Since denylist prevails over allowlist, we need to handle the special case
- // where app is allowlisted and denylisted at the same time (although such
- // scenario should be blocked by the UI), then denylist is removed.
- setMeteredNetworkAllowlist(uid, isAllowlisted);
+ setMeteredNetworkDenylist(uid, (isDenied || isRestrictedByAdmin));
+ if (hasRule(oldRule, RULE_REJECT_METERED) && isAllowed) {
+ // Since denial prevails over allowance, we need to handle the special case
+ // where app is allowed and denied at the same time (although such
+ // scenario should be blocked by the UI), then it is removed from the denylist.
+ setMeteredNetworkAllowlist(uid, isAllowed);
}
} else if (hasRule(newRule, RULE_ALLOW_METERED)
|| hasRule(oldRule, RULE_ALLOW_METERED)) {
// Flip state because app was explicitly added or removed to allowlist.
- setMeteredNetworkAllowlist(uid, isAllowlisted);
+ setMeteredNetworkAllowlist(uid, isAllowed);
} else {
// All scenarios should have been covered above.
Log.wtf(TAG, "Unexpected change of metered UID state for " + uid
+ ": foreground=" + isForeground
- + ", allowlisted=" + isAllowlisted
- + ", denylisted=" + isDenylisted
+ + ", allowlisted=" + isAllowed
+ + ", denylisted=" + isDenied
+ ", isRestrictedByAdmin=" + isRestrictedByAdmin
+ ", newRule=" + uidRulesToString(newUidRules)
+ ", oldRule=" + uidRulesToString(oldUidRules));
@@ -4425,7 +4589,7 @@
* listeners in case of change.
* <p>
* There are 3 power-related rules that affects whether an app has background access on
- * non-metered networks, and when the condition applies and the UID is not allowlisted for power
+ * non-metered networks, and when the condition applies and the UID is not allowed for power
* restriction, it's added to the equivalent firewall chain:
* <ul>
* <li>App is idle: {@code fw_standby} firewall chain.
@@ -4890,7 +5054,7 @@
private void setMeteredNetworkDenylist(int uid, boolean enable) {
if (LOGV) Slog.v(TAG, "setMeteredNetworkDenylist " + uid + ": " + enable);
try {
- mNetworkManager.setUidMeteredNetworkDenylist(uid, enable);
+ mNetworkManager.setUidOnMeteredNetworkDenylist(uid, enable);
} catch (IllegalStateException e) {
Log.wtf(TAG, "problem setting denylist (" + enable + ") rules for " + uid, e);
} catch (RemoteException e) {
@@ -4901,7 +5065,7 @@
private void setMeteredNetworkAllowlist(int uid, boolean enable) {
if (LOGV) Slog.v(TAG, "setMeteredNetworkAllowlist " + uid + ": " + enable);
try {
- mNetworkManager.setUidMeteredNetworkAllowlist(uid, enable);
+ mNetworkManager.setUidOnMeteredNetworkAllowlist(uid, enable);
} catch (IllegalStateException e) {
Log.wtf(TAG, "problem setting allowlist (" + enable + ") rules for " + uid, e);
} catch (RemoteException e) {
@@ -4978,6 +5142,8 @@
mUidFirewallStandbyRules.put(uid, rule);
} else if (chain == FIREWALL_CHAIN_POWERSAVE) {
mUidFirewallPowerSaveRules.put(uid, rule);
+ } else if (chain == FIREWALL_CHAIN_RESTRICTED) {
+ mUidFirewallRestrictedModeRules.put(uid, rule);
}
try {
@@ -5023,8 +5189,10 @@
mNetworkManager.setFirewallUidRule(FIREWALL_CHAIN_STANDBY, uid, FIREWALL_RULE_DEFAULT);
mNetworkManager
.setFirewallUidRule(FIREWALL_CHAIN_POWERSAVE, uid, FIREWALL_RULE_DEFAULT);
- mNetworkManager.setUidMeteredNetworkAllowlist(uid, false);
- mNetworkManager.setUidMeteredNetworkDenylist(uid, false);
+ mNetworkManager
+ .setFirewallUidRule(FIREWALL_CHAIN_RESTRICTED, uid, FIREWALL_RULE_DEFAULT);
+ mNetworkManager.setUidOnMeteredNetworkAllowlist(uid, false);
+ mNetworkManager.setUidOnMeteredNetworkDenylist(uid, false);
} catch (IllegalStateException e) {
Log.wtf(TAG, "problem resetting firewall uid rules for " + uid, e);
} catch (RemoteException e) {
@@ -5209,26 +5377,21 @@
// Networks are never blocked for system components
if (isSystem(uid)) {
reason = NTWK_ALLOWED_SYSTEM;
- }
- else if (hasRule(uidRules, RULE_REJECT_ALL)) {
+ } else if (hasRule(uidRules, RULE_REJECT_RESTRICTED_MODE)) {
+ reason = NTWK_BLOCKED_RESTRICTED_MODE;
+ } else if (hasRule(uidRules, RULE_REJECT_ALL)) {
reason = NTWK_BLOCKED_POWER;
- }
- else if (!isNetworkMetered) {
+ } else if (!isNetworkMetered) {
reason = NTWK_ALLOWED_NON_METERED;
- }
- else if (hasRule(uidRules, RULE_REJECT_METERED)) {
+ } else if (hasRule(uidRules, RULE_REJECT_METERED)) {
reason = NTWK_BLOCKED_DENYLIST;
- }
- else if (hasRule(uidRules, RULE_ALLOW_METERED)) {
+ } else if (hasRule(uidRules, RULE_ALLOW_METERED)) {
reason = NTWK_ALLOWED_ALLOWLIST;
- }
- else if (hasRule(uidRules, RULE_TEMPORARY_ALLOW_METERED)) {
+ } else if (hasRule(uidRules, RULE_TEMPORARY_ALLOW_METERED)) {
reason = NTWK_ALLOWED_TMP_ALLOWLIST;
- }
- else if (isBackgroundRestricted) {
+ } else if (isBackgroundRestricted) {
reason = NTWK_BLOCKED_BG_RESTRICT;
- }
- else {
+ } else {
reason = NTWK_ALLOWED_DEFAULT;
}
@@ -5241,6 +5404,7 @@
case NTWK_ALLOWED_SYSTEM:
blocked = false;
break;
+ case NTWK_BLOCKED_RESTRICTED_MODE:
case NTWK_BLOCKED_POWER:
case NTWK_BLOCKED_DENYLIST:
case NTWK_BLOCKED_BG_RESTRICT:
diff --git a/services/core/java/com/android/server/net/NetworkStatsCollection.java b/services/core/java/com/android/server/net/NetworkStatsCollection.java
index 342a11b..c4beddd4 100644
--- a/services/core/java/com/android/server/net/NetworkStatsCollection.java
+++ b/services/core/java/com/android/server/net/NetworkStatsCollection.java
@@ -28,9 +28,9 @@
import static android.net.NetworkStats.TAG_NONE;
import static android.net.NetworkStats.UID_ALL;
import static android.net.TrafficStats.UID_REMOVED;
-import static android.net.NetworkUtils.multiplySafeByRational;
import static android.text.format.DateUtils.WEEK_IN_MILLIS;
+import static com.android.internal.net.NetworkUtilsInternal.multiplySafeByRational;
import static com.android.server.net.NetworkStatsService.TAG;
import android.net.NetworkIdentity;
diff --git a/services/core/java/com/android/server/notification/ManagedServices.java b/services/core/java/com/android/server/notification/ManagedServices.java
index 54e9b37..21537e6 100644
--- a/services/core/java/com/android/server/notification/ManagedServices.java
+++ b/services/core/java/com/android/server/notification/ManagedServices.java
@@ -73,7 +73,6 @@
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
-import org.xmlpull.v1.XmlSerializer;
import java.io.IOException;
import java.io.PrintWriter;
@@ -544,7 +543,8 @@
/**
* This is called to process tags other than {@link #TAG_MANAGED_SERVICES}.
*/
- protected void readExtraTag(String tag, TypedXmlPullParser parser) throws IOException {}
+ protected void readExtraTag(String tag, TypedXmlPullParser parser)
+ throws IOException, XmlPullParserException {}
protected final void migrateToXml() {
for (UserInfo user : mUm.getUsers()) {
@@ -1613,6 +1613,7 @@
public boolean isSystem;
public ServiceConnection connection;
public int targetSdkVersion;
+ public Pair<ComponentName, Integer> mKey;
public ManagedServiceInfo(IInterface service, ComponentName component,
int userid, boolean isSystem, ServiceConnection connection, int targetSdkVersion) {
@@ -1622,6 +1623,7 @@
this.isSystem = isSystem;
this.connection = connection;
this.targetSdkVersion = targetSdkVersion;
+ mKey = Pair.create(component, userid);
}
public boolean isGuest(ManagedServices host) {
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index c9ed518..a146c8c 100755
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -66,6 +66,9 @@
import static android.os.IServiceManager.DUMP_FLAG_PRIORITY_NORMAL;
import static android.os.UserHandle.USER_NULL;
import static android.os.UserHandle.USER_SYSTEM;
+import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_ALERTING;
+import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_CONVERSATIONS;
+import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_SILENT;
import static android.service.notification.NotificationListenerService.HINT_HOST_DISABLE_CALL_EFFECTS;
import static android.service.notification.NotificationListenerService.HINT_HOST_DISABLE_EFFECTS;
import static android.service.notification.NotificationListenerService.HINT_HOST_DISABLE_NOTIFICATION_EFFECTS;
@@ -163,6 +166,8 @@
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.PackageManagerInternal;
import android.content.pm.ParceledListSlice;
+import android.content.pm.ResolveInfo;
+import android.content.pm.ServiceInfo;
import android.content.pm.ShortcutInfo;
import android.content.pm.ShortcutServiceInternal;
import android.content.pm.UserInfo;
@@ -209,6 +214,7 @@
import android.service.notification.IStatusBarNotificationHolder;
import android.service.notification.ListenersDisablingEffectsProto;
import android.service.notification.NotificationAssistantService;
+import android.service.notification.NotificationListenerFilter;
import android.service.notification.NotificationListenerService;
import android.service.notification.NotificationRankingUpdate;
import android.service.notification.NotificationRecordProto;
@@ -285,6 +291,7 @@
import org.json.JSONException;
import org.json.JSONObject;
+import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import java.io.ByteArrayInputStream;
@@ -301,6 +308,7 @@
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
@@ -1021,7 +1029,7 @@
nv.recycle();
}
reportUserInteraction(r);
- mAssistants.notifyAssistantActionClicked(r.getSbn(), action, generatedByAssistant);
+ mAssistants.notifyAssistantActionClicked(r, action, generatedByAssistant);
}
}
@@ -1110,7 +1118,7 @@
reportSeen(r);
}
r.setVisibility(true, nv.rank, nv.count, mNotificationRecordLogger);
- mAssistants.notifyAssistantVisibilityChangedLocked(r.getSbn(), true);
+ mAssistants.notifyAssistantVisibilityChangedLocked(r, true);
boolean isHun = (nv.location
== NotificationVisibility.NotificationLocation.LOCATION_FIRST_HEADS_UP);
// hasBeenVisiblyExpanded must be called after updating the expansion state of
@@ -1129,7 +1137,7 @@
NotificationRecord r = mNotificationsByKey.get(nv.key);
if (r == null) continue;
r.setVisibility(false, nv.rank, nv.count, mNotificationRecordLogger);
- mAssistants.notifyAssistantVisibilityChangedLocked(r.getSbn(), false);
+ mAssistants.notifyAssistantVisibilityChangedLocked(r, false);
nv.recycle();
}
}
@@ -1161,7 +1169,7 @@
reportUserInteraction(r);
}
mAssistants.notifyAssistantExpansionChangedLocked(
- r.getSbn(), userAction, expanded);
+ r.getSbn(), r.getNotificationType(), userAction, expanded);
}
}
}
@@ -1180,7 +1188,7 @@
NotificationRecordLogger.NotificationEvent.NOTIFICATION_DIRECT_REPLIED,
r);
reportUserInteraction(r);
- mAssistants.notifyAssistantNotificationDirectReplyLocked(r.getSbn());
+ mAssistants.notifyAssistantNotificationDirectReplyLocked(r);
}
}
}
@@ -1227,7 +1235,8 @@
// Treat clicking on a smart reply as a user interaction.
reportUserInteraction(r);
mAssistants.notifyAssistantSuggestedReplySent(
- r.getSbn(), reply, r.getSuggestionsGeneratedByAssistant());
+ r.getSbn(), r.getNotificationType(), reply,
+ r.getSuggestionsGeneratedByAssistant());
}
}
}
@@ -2241,7 +2250,8 @@
init(handler, new RankingHandlerWorker(mRankingThread.getLooper()),
AppGlobals.getPackageManager(), getContext().getPackageManager(),
getLocalService(LightsManager.class),
- new NotificationListeners(AppGlobals.getPackageManager()),
+ new NotificationListeners(getContext(), mNotificationLock, mUserProfiles,
+ AppGlobals.getPackageManager()),
new NotificationAssistants(getContext(), mNotificationLock, mUserProfiles,
AppGlobals.getPackageManager()),
new ConditionProviders(getContext(), mUserProfiles, AppGlobals.getPackageManager()),
@@ -3253,6 +3263,21 @@
}
@Override
+ public NotificationListenerFilter getListenerFilter(ComponentName cn, int userId) {
+ checkCallerIsSystem();
+ return mListeners.getNotificationListenerFilter(Pair.create(cn, userId));
+ }
+
+ @Override
+ public void setListenerFilter(ComponentName cn, int userId,
+ NotificationListenerFilter nlf) {
+ checkCallerIsSystem();
+ mListeners.setNotificationListenerFilter(Pair.create(cn, userId), nlf);
+ // TODO (b/173052211): cancel notifications for listeners that can no longer see them
+ handleSavePolicyFile();
+ }
+
+ @Override
public int getPackageImportance(String pkg) {
checkCallerIsSystemOrSameApp(pkg);
return mPreferencesHelper.getImportance(pkg, Binder.getCallingUid());
@@ -4268,7 +4293,7 @@
: mNotificationList.get(i);
if (r == null) continue;
StatusBarNotification sbn = r.getSbn();
- if (!isVisibleToListener(sbn, info)) continue;
+ if (!isVisibleToListener(sbn, r.getNotificationType(), info)) continue;
StatusBarNotification sbnToSend =
(trim == TRIM_FULL) ? sbn : sbn.cloneLight();
list.add(sbnToSend);
@@ -4298,7 +4323,7 @@
final NotificationRecord r = snoozedRecords.get(i);
if (r == null) continue;
StatusBarNotification sbn = r.getSbn();
- if (!isVisibleToListener(sbn, info)) continue;
+ if (!isVisibleToListener(sbn, r.getNotificationType(), info)) continue;
StatusBarNotification sbnToSend =
(trim == TRIM_FULL) ? sbn : sbn.cloneLight();
list.add(sbnToSend);
@@ -6339,7 +6364,7 @@
cancelNotificationLocked(r, false, REASON_SNOOZED, wasPosted, null);
updateLightsLocked();
if (mSnoozeCriterionId != null) {
- mAssistants.notifyAssistantSnoozedLocked(r.getSbn(), mSnoozeCriterionId);
+ mAssistants.notifyAssistantSnoozedLocked(r, mSnoozeCriterionId);
mSnoozeHelper.snooze(r, mSnoozeCriterionId);
} else {
mSnoozeHelper.snooze(r, mDuration);
@@ -8812,7 +8837,7 @@
for (int i = 0; i < N; i++) {
NotificationRecord record = mNotificationList.get(i);
- if (!isVisibleToListener(record.getSbn(), info)) {
+ if (!isVisibleToListener(record.getSbn(), record.getNotificationType(), info)) {
continue;
}
final String key = record.getSbn().getKey();
@@ -8886,11 +8911,21 @@
}
@VisibleForTesting
- boolean isVisibleToListener(StatusBarNotification sbn, ManagedServiceInfo listener) {
+ boolean isVisibleToListener(StatusBarNotification sbn, int notificationType,
+ ManagedServiceInfo listener) {
if (!listener.enabledAndUserMatches(sbn.getUserId())) {
return false;
}
- return isInteractionVisibleToListener(listener, sbn.getUserId());
+ if (!isInteractionVisibleToListener(listener, sbn.getUserId())) {
+ return false;
+ }
+ NotificationListenerFilter nls = mListeners.getNotificationListenerFilter(listener.mKey);
+ if (nls != null
+ && (!nls.isTypeAllowed(notificationType)
+ || !nls.isPackageAllowed(sbn.getPackageName()))) {
+ return false;
+ }
+ return true;
}
/**
@@ -9126,7 +9161,8 @@
for (final ManagedServiceInfo info : NotificationAssistants.this.getServices()) {
ArrayList<String> keys = new ArrayList<>(records.size());
for (NotificationRecord r : records) {
- boolean sbnVisible = isVisibleToListener(r.getSbn(), info)
+ boolean sbnVisible = isVisibleToListener(
+ r.getSbn(), r.getNotificationType(), info)
&& info.isSameUser(r.getUserId());
if (sbnVisible) {
keys.add(r.getKey());
@@ -9241,6 +9277,7 @@
final StatusBarNotification sbn = r.getSbn();
notifyAssistantLocked(
sbn,
+ r.getNotificationType(),
true /* sameUserOnly */,
(assistant, sbnHolder) -> {
try {
@@ -9257,14 +9294,15 @@
@GuardedBy("mNotificationLock")
void notifyAssistantVisibilityChangedLocked(
- final StatusBarNotification sbn,
+ final NotificationRecord r,
final boolean isVisible) {
- final String key = sbn.getKey();
+ final String key = r.getSbn().getKey();
if (DBG) {
Slog.d(TAG, "notifyAssistantVisibilityChangedLocked: " + key);
}
notifyAssistantLocked(
- sbn,
+ r.getSbn(),
+ r.getNotificationType(),
true /* sameUserOnly */,
(assistant, sbnHolder) -> {
try {
@@ -9278,11 +9316,13 @@
@GuardedBy("mNotificationLock")
void notifyAssistantExpansionChangedLocked(
final StatusBarNotification sbn,
+ final int notificationType,
final boolean isUserAction,
final boolean isExpanded) {
final String key = sbn.getKey();
notifyAssistantLocked(
sbn,
+ notificationType,
true /* sameUserOnly */,
(assistant, sbnHolder) -> {
try {
@@ -9295,10 +9335,11 @@
@GuardedBy("mNotificationLock")
void notifyAssistantNotificationDirectReplyLocked(
- final StatusBarNotification sbn) {
- final String key = sbn.getKey();
+ final NotificationRecord r) {
+ final String key = r.getKey();
notifyAssistantLocked(
- sbn,
+ r.getSbn(),
+ r.getNotificationType(),
true /* sameUserOnly */,
(assistant, sbnHolder) -> {
try {
@@ -9311,10 +9352,12 @@
@GuardedBy("mNotificationLock")
void notifyAssistantSuggestedReplySent(
- final StatusBarNotification sbn, CharSequence reply, boolean generatedByAssistant) {
+ final StatusBarNotification sbn, int notificationType,
+ CharSequence reply, boolean generatedByAssistant) {
final String key = sbn.getKey();
notifyAssistantLocked(
sbn,
+ notificationType,
true /* sameUserOnly */,
(assistant, sbnHolder) -> {
try {
@@ -9332,11 +9375,12 @@
@GuardedBy("mNotificationLock")
void notifyAssistantActionClicked(
- final StatusBarNotification sbn, Notification.Action action,
+ final NotificationRecord r, Notification.Action action,
boolean generatedByAssistant) {
- final String key = sbn.getKey();
+ final String key = r.getSbn().getKey();
notifyAssistantLocked(
- sbn,
+ r.getSbn(),
+ r.getNotificationType(),
true /* sameUserOnly */,
(assistant, sbnHolder) -> {
try {
@@ -9358,9 +9402,10 @@
*/
@GuardedBy("mNotificationLock")
private void notifyAssistantSnoozedLocked(
- final StatusBarNotification sbn, final String snoozeCriterionId) {
+ final NotificationRecord r, final String snoozeCriterionId) {
notifyAssistantLocked(
- sbn,
+ r.getSbn(),
+ r.getNotificationType(),
true /* sameUserOnly */,
(assistant, sbnHolder) -> {
try {
@@ -9384,6 +9429,7 @@
@GuardedBy("mNotificationLock")
private void notifyAssistantLocked(
final StatusBarNotification sbn,
+ int notificationType,
boolean sameUserOnly,
BiConsumer<INotificationListener, StatusBarNotificationHolder> callback) {
TrimCache trimCache = new TrimCache(sbn);
@@ -9397,7 +9443,7 @@
+ sameUserOnly + "], callback = [" + callback + "]");
}
for (final ManagedServiceInfo info : NotificationAssistants.this.getServices()) {
- boolean sbnVisible = isVisibleToListener(sbn, info)
+ boolean sbnVisible = isVisibleToListener(sbn, notificationType, info)
&& (!sameUserOnly || info.isSameUser(sbn.getUserId()));
if (debug) {
Slog.v(TAG, "notifyAssistantLocked info=" + info + " snbVisible=" + sbnVisible);
@@ -9451,11 +9497,22 @@
public class NotificationListeners extends ManagedServices {
static final String TAG_ENABLED_NOTIFICATION_LISTENERS = "enabled_listeners";
+ static final String TAG_REQUESTED_LISTENERS = "requested_listeners";
+ static final String TAG_REQUESTED_LISTENER = "listener";
+ static final String ATT_COMPONENT = "component";
+ static final String ATT_TYPES = "types";
+ static final String ATT_PKGS = "pkgs";
+ static final String TAG_APPROVED = "allowed";
+ static final String TAG_DISALLOWED= "disallowed";
+ static final String XML_SEPARATOR = ",";
private final ArraySet<ManagedServiceInfo> mLightTrimListeners = new ArraySet<>();
+ ArrayMap<Pair<ComponentName, Integer>, NotificationListenerFilter>
+ mRequestedNotificationListeners = new ArrayMap<>();
- public NotificationListeners(IPackageManager pm) {
- super(getContext(), mNotificationLock, mUserProfiles, pm);
+ public NotificationListeners(Context context, Object lock, UserProfiles userProfiles,
+ IPackageManager pm) {
+ super(context, lock, userProfiles, pm);
}
@Override
@@ -9552,6 +9609,59 @@
}
@Override
+ public void onUserRemoved(int user) {
+ super.onUserRemoved(user);
+ for (int i = mRequestedNotificationListeners.size() - 1; i >= 0; i--) {
+ if (mRequestedNotificationListeners.keyAt(i).second == user) {
+ mRequestedNotificationListeners.removeAt(i);
+ }
+ }
+ }
+
+ @Override
+ public void onUserUnlocked(int user) {
+ int flags = PackageManager.GET_SERVICES | PackageManager.GET_META_DATA;
+
+ final PackageManager pmWrapper = mContext.getPackageManager();
+ List<ResolveInfo> installedServices = pmWrapper.queryIntentServicesAsUser(
+ new Intent(getConfig().serviceInterface), flags, user);
+
+ for (ResolveInfo resolveInfo : installedServices) {
+ ServiceInfo info = resolveInfo.serviceInfo;
+
+ if (!getConfig().bindPermission.equals(info.permission)) {
+ continue;
+ }
+ Pair key = Pair.create(info.getComponentName(), user);
+ if (!mRequestedNotificationListeners.containsKey(key)) {
+ mRequestedNotificationListeners.put(key, new NotificationListenerFilter());
+ }
+ }
+ super.onUserUnlocked(user);
+ }
+
+ @Override
+ public void onPackagesChanged(boolean removingPackage, String[] pkgList, int[] uidList) {
+ super.onPackagesChanged(removingPackage, pkgList, uidList);
+
+ // Since the default behavior is to allow everything, we don't need to explicitly
+ // handle package add or update. they will be added to the xml file on next boot or
+ // when the user tries to change the settings.
+ if (removingPackage) {
+ for (int i = 0; i < pkgList.length; i++) {
+ String pkg = pkgList[i];
+ int userId = UserHandle.getUserId(uidList[i]);
+ for (int j = mRequestedNotificationListeners.size() - 1; j >= 0; j--) {
+ Pair<ComponentName, Integer> key = mRequestedNotificationListeners.keyAt(j);
+ if (key.second == userId && key.first.getPackageName().equals(pkg)) {
+ mRequestedNotificationListeners.removeAt(j);
+ }
+ }
+ }
+ }
+ }
+
+ @Override
protected String getRequiredPermission() {
return null;
}
@@ -9563,6 +9673,75 @@
return true;
}
+ @Override
+ protected void readExtraTag(String tag, TypedXmlPullParser parser)
+ throws IOException, XmlPullParserException {
+ if (TAG_REQUESTED_LISTENERS.equals(tag)) {
+ final int listenersOuterDepth = parser.getDepth();
+ while (XmlUtils.nextElementWithin(parser, listenersOuterDepth)) {
+ if (!TAG_REQUESTED_LISTENER.equals(parser.getName())) {
+ continue;
+ }
+ final int userId = XmlUtils.readIntAttribute(parser, ATT_USER_ID);
+ final ComponentName cn = ComponentName.unflattenFromString(
+ XmlUtils.readStringAttribute(parser, ATT_COMPONENT));
+ int approved = FLAG_FILTER_TYPE_CONVERSATIONS | FLAG_FILTER_TYPE_ALERTING
+ | FLAG_FILTER_TYPE_SILENT;
+
+ ArraySet<String> disallowedPkgs = new ArraySet<>();
+ final int listenerOuterDepth = parser.getDepth();
+ while (XmlUtils.nextElementWithin(parser, listenerOuterDepth)) {
+ if (TAG_APPROVED.equals(parser.getName())) {
+ approved = XmlUtils.readIntAttribute(parser, ATT_TYPES);
+ } else if (TAG_DISALLOWED.equals(parser.getName())) {
+ String pkgs = XmlUtils.readStringAttribute(parser, ATT_PKGS);
+ if (!TextUtils.isEmpty(pkgs)) {
+ disallowedPkgs = new ArraySet<>(pkgs.split(XML_SEPARATOR));
+ }
+ }
+ }
+ NotificationListenerFilter nlf =
+ new NotificationListenerFilter(approved, disallowedPkgs);
+ mRequestedNotificationListeners.put(Pair.create(cn, userId), nlf);
+ }
+ }
+ }
+
+ @Override
+ protected void writeExtraXmlTags(TypedXmlSerializer out) throws IOException {
+ out.startTag(null, TAG_REQUESTED_LISTENERS);
+ for (Pair<ComponentName, Integer> listener : mRequestedNotificationListeners.keySet()) {
+ NotificationListenerFilter nlf = mRequestedNotificationListeners.get(listener);
+ out.startTag(null, TAG_REQUESTED_LISTENER);
+ XmlUtils.writeStringAttribute(
+ out, ATT_COMPONENT, listener.first.flattenToString());
+ XmlUtils.writeIntAttribute(out, ATT_USER_ID, listener.second);
+
+ out.startTag(null, TAG_APPROVED);
+ XmlUtils.writeIntAttribute(out, ATT_TYPES, nlf.getTypes());
+ out.endTag(null, TAG_APPROVED);
+
+ out.startTag(null, TAG_DISALLOWED);
+ XmlUtils.writeStringAttribute(
+ out, ATT_PKGS, String.join(XML_SEPARATOR, nlf.getDisallowedPackages()));
+ out.endTag(null, TAG_DISALLOWED);
+
+ out.endTag(null, TAG_REQUESTED_LISTENER);
+ }
+
+ out.endTag(null, TAG_REQUESTED_LISTENERS);
+ }
+
+ protected @Nullable NotificationListenerFilter getNotificationListenerFilter(
+ Pair<ComponentName, Integer> pair) {
+ return mRequestedNotificationListeners.get(pair);
+ }
+
+ protected void setNotificationListenerFilter(Pair<ComponentName, Integer> pair,
+ NotificationListenerFilter nlf) {
+ mRequestedNotificationListeners.put(pair, nlf);
+ }
+
@GuardedBy("mNotificationLock")
public void setOnNotificationPostedTrimLocked(ManagedServiceInfo info, int trim) {
if (trim == TRIM_LIGHT) {
@@ -9618,8 +9797,9 @@
TrimCache trimCache = new TrimCache(sbn);
for (final ManagedServiceInfo info : getServices()) {
- boolean sbnVisible = isVisibleToListener(sbn, info);
- boolean oldSbnVisible = (oldSbn != null) && isVisibleToListener(oldSbn, info);
+ boolean sbnVisible = isVisibleToListener(sbn, r. getNotificationType(), info);
+ boolean oldSbnVisible = (oldSbn != null)
+ && isVisibleToListener(oldSbn, old.getNotificationType(), info);
// This notification hasn't been and still isn't visible -> ignore.
if (!oldSbnVisible && !sbnVisible) {
continue;
@@ -9672,7 +9852,7 @@
for (final NotificationRecord r : mNotificationList) {
// When granting permissions, ignore notifications which are invisible.
// When revoking permissions, all notifications are invisible, so process all.
- if (grant && !isVisibleToListener(r.getSbn(), info)) {
+ if (grant && !isVisibleToListener(r.getSbn(), r.getNotificationType(), info)) {
continue;
}
// If the notification is hidden, permissions are not required by the listener.
@@ -9714,7 +9894,7 @@
// notification
final StatusBarNotification sbnLight = sbn.cloneLight();
for (final ManagedServiceInfo info : getServices()) {
- if (!isVisibleToListener(sbn, info)) {
+ if (!isVisibleToListener(sbn, r.getNotificationType(), info)) {
continue;
}
@@ -9754,7 +9934,8 @@
public void notifyRankingUpdateLocked(List<NotificationRecord> changedHiddenNotifications) {
boolean isHiddenRankingUpdate = changedHiddenNotifications != null
&& changedHiddenNotifications.size() > 0;
-
+ // TODO (b/73052211): if the ranking update changed the notification type,
+ // cancel notifications for NLSes that can't see them anymore
for (final ManagedServiceInfo serviceInfo : getServices()) {
if (!serviceInfo.isEnabledForCurrentProfiles() || !isInteractionVisibleToListener(
serviceInfo, ActivityManager.getCurrentUser())) {
@@ -9765,7 +9946,8 @@
if (isHiddenRankingUpdate && serviceInfo.targetSdkVersion >=
Build.VERSION_CODES.P) {
for (NotificationRecord rec : changedHiddenNotifications) {
- if (isVisibleToListener(rec.getSbn(), serviceInfo)) {
+ if (isVisibleToListener(
+ rec.getSbn(), rec.getNotificationType(), serviceInfo)) {
notifyThisListener = true;
break;
}
@@ -9979,6 +10161,7 @@
}
}
+
class RoleObserver implements OnRoleHoldersChangedListener {
// Role name : user id : list of approved packages
private ArrayMap<String, ArrayMap<Integer, ArraySet<String>>> mNonBlockableDefaultApps;
diff --git a/services/core/java/com/android/server/notification/NotificationRecord.java b/services/core/java/com/android/server/notification/NotificationRecord.java
index cff4f07..6bc4f7e 100644
--- a/services/core/java/com/android/server/notification/NotificationRecord.java
+++ b/services/core/java/com/android/server/notification/NotificationRecord.java
@@ -1257,6 +1257,16 @@
return !Objects.equals(getSbn().getPackageName(), getSbn().getOpPkg());
}
+ public int getNotificationType() {
+ if (isConversation()) {
+ return NotificationListenerService.FLAG_FILTER_TYPE_CONVERSATIONS;
+ } else if (getImportance() >= IMPORTANCE_DEFAULT) {
+ return NotificationListenerService.FLAG_FILTER_TYPE_ALERTING;
+ } else {
+ return NotificationListenerService.FLAG_FILTER_TYPE_SILENT;
+ }
+ }
+
/**
* @return all {@link Uri} that should have permission granted to whoever
* will be rendering it. This list has already been vetted to only
diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java
index 225c998..ccbf73c 100644
--- a/services/core/java/com/android/server/pm/UserManagerService.java
+++ b/services/core/java/com/android/server/pm/UserManagerService.java
@@ -4760,31 +4760,13 @@
final boolean hasParent = user.profileGroupId != user.id
&& user.profileGroupId != UserInfo.NO_PROFILE_GROUP_ID;
if (verbose) {
- final DevicePolicyManagerInternal dpm = getDevicePolicyManagerInternal();
- String deviceOwner = "";
- String profileOwner = "";
- if (dpm != null) {
- final long ident = Binder.clearCallingIdentity();
- try {
- if (dpm.getDeviceOwnerUserId() == user.id) {
- deviceOwner = " (device-owner)";
- }
- if (dpm.getProfileOwnerAsUser(user.id) != null) {
- profileOwner = " (profile-owner)";
- }
- } finally {
- Binder.restoreCallingIdentity(ident);
- }
- }
- pw.printf("%d: id=%d, name=%s, flags=%s%s%s%s%s%s%s%s%s\n", i, user.id,
- user.name,
+ pw.printf("%d: id=%d, name=%s, flags=%s%s%s%s%s%s%s\n", i, user.id, user.name,
UserInfo.flagsToString(user.flags),
hasParent ? " (parentId=" + user.profileGroupId + ")" : "",
running ? " (running)" : "",
user.partial ? " (partial)" : "",
user.preCreated ? " (pre-created)" : "",
user.convertedFromPreCreated ? " (converted)" : "",
- deviceOwner, profileOwner,
current ? " (current)" : "");
} else {
// NOTE: the standard "list users" command is used by integration tests and
@@ -4878,21 +4860,6 @@
if (userInfo.convertedFromPreCreated) {
pw.print(" <converted>");
}
- final DevicePolicyManagerInternal dpm = getDevicePolicyManagerInternal();
- if (dpm != null) {
- final long ident = Binder.clearCallingIdentity();
- try {
- if (dpm.getDeviceOwnerUserId() == userId) {
- pw.print(" <device-owner>");
- }
- if (dpm.getProfileOwnerAsUser(userId) != null) {
- pw.print(" <profile-owner>");
- }
- } finally {
- Binder.restoreCallingIdentity(ident);
- }
- }
-
pw.println();
pw.print(" Type: "); pw.println(userInfo.userType);
pw.print(" Flags: "); pw.print(userInfo.flags); pw.print(" (");
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 6919cea..6e4806f 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -2698,8 +2698,7 @@
float stepFloat = (maxFloat - minFloat) / BRIGHTNESS_STEPS * direction;
float brightnessFloat = Settings.System.getFloatForUser(
mContext.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_FLOAT,
- mPowerManager.getBrightnessConstraint(
- PowerManager.BRIGHTNESS_CONSTRAINT_TYPE_DEFAULT),
+ mContext.getDisplay().getBrightnessDefault(),
UserHandle.USER_CURRENT_OR_SELF);
brightnessFloat += stepFloat;
// Make sure we don't go beyond the limits.
diff --git a/services/core/java/com/android/server/powerstats/PowerStatsHALWrapper.java b/services/core/java/com/android/server/powerstats/PowerStatsHALWrapper.java
index 88e5f69..79c0392 100644
--- a/services/core/java/com/android/server/powerstats/PowerStatsHALWrapper.java
+++ b/services/core/java/com/android/server/powerstats/PowerStatsHALWrapper.java
@@ -16,7 +16,11 @@
package com.android.server.powerstats;
+import android.hardware.power.stats.ChannelInfo;
+import android.hardware.power.stats.EnergyMeasurement;
import android.hardware.power.stats.IPowerStats;
+import android.hardware.power.stats.PowerEntityInfo;
+import android.hardware.power.stats.StateResidencyResult;
import android.os.Binder;
import android.os.IBinder;
import android.os.RemoteException;
@@ -32,6 +36,7 @@
*/
public final class PowerStatsHALWrapper {
private static final String TAG = PowerStatsHALWrapper.class.getSimpleName();
+ private static final boolean DEBUG = false;
/**
* IPowerStatsHALWrapper defines the interface to the PowerStatsHAL.
@@ -122,17 +127,30 @@
*
* @return true if connection to power stats HAL was correctly established.
*/
- boolean initialize();
+ boolean isInitialized();
}
/**
- * PowerStatsHALWrapperImpl is the implementation of the IPowerStatsHALWrapper
- * used by the PowerStatsService. Other implementations will be used by the testing
- * framework and will be passed into the PowerStatsService through an injector.
+ * PowerStatsHALWrapper20Impl is the implementation of the IPowerStatsHALWrapper
+ * used by the PowerStatsService on devices that support only PowerStats HAL 2.0.
+ * Other implementations will be used by the testing framework and will be passed
+ * into the PowerStatsService through an injector.
*/
- public static final class PowerStatsHALWrapperImpl implements IPowerStatsHALWrapper {
+ public static final class PowerStatsHAL20WrapperImpl implements IPowerStatsHALWrapper {
private static Supplier<IPowerStats> sVintfPowerStats;
+ public PowerStatsHAL20WrapperImpl() {
+ Supplier<IPowerStats> service = new VintfHalCache();
+ sVintfPowerStats = null;
+
+ if (service.get() == null) {
+ if (DEBUG) Slog.d(TAG, "PowerStats HAL 2.0 not available on this device.");
+ sVintfPowerStats = null;
+ } else {
+ sVintfPowerStats = service;
+ }
+ }
+
@Override
public android.hardware.power.stats.PowerEntityInfo[] getPowerEntityInfo() {
android.hardware.power.stats.PowerEntityInfo[] powerEntityInfoHAL = null;
@@ -141,7 +159,7 @@
try {
powerEntityInfoHAL = sVintfPowerStats.get().getPowerEntityInfo();
} catch (RemoteException e) {
- Slog.e(TAG, "Failed to get power entity info from PowerStats HAL");
+ if (DEBUG) Slog.d(TAG, "Failed to get power entity info from PowerStats HAL");
}
}
@@ -158,7 +176,7 @@
stateResidencyResultHAL =
sVintfPowerStats.get().getStateResidency(powerEntityIds);
} catch (RemoteException e) {
- Slog.e(TAG, "Failed to get state residency from PowerStats HAL");
+ if (DEBUG) Slog.d(TAG, "Failed to get state residency from PowerStats HAL");
}
}
@@ -173,7 +191,9 @@
try {
energyConsumerInfoHAL = sVintfPowerStats.get().getEnergyConsumerInfo();
} catch (RemoteException e) {
- Slog.e(TAG, "Failed to get energy consumer info from PowerStats HAL");
+ if (DEBUG) {
+ Slog.d(TAG, "Failed to get energy consumer info from PowerStats HAL");
+ }
}
}
@@ -190,7 +210,9 @@
energyConsumedHAL =
sVintfPowerStats.get().getEnergyConsumed(energyConsumerIds);
} catch (RemoteException e) {
- Slog.e(TAG, "Failed to get energy consumer results from PowerStats HAL");
+ if (DEBUG) {
+ Slog.d(TAG, "Failed to get energy consumer results from PowerStats HAL");
+ }
}
}
@@ -205,7 +227,7 @@
try {
energyMeterInfoHAL = sVintfPowerStats.get().getEnergyMeterInfo();
} catch (RemoteException e) {
- Slog.e(TAG, "Failed to get energy meter info from PowerStats HAL");
+ if (DEBUG) Slog.d(TAG, "Failed to get energy meter info from PowerStats HAL");
}
}
@@ -221,7 +243,7 @@
energyMeasurementHAL =
sVintfPowerStats.get().readEnergyMeters(channelIds);
} catch (RemoteException e) {
- Slog.e(TAG, "Failed to get energy measurements from PowerStats HAL");
+ if (DEBUG) Slog.d(TAG, "Failed to get energy measurements from PowerStats HAL");
}
}
@@ -229,17 +251,90 @@
}
@Override
- public boolean initialize() {
- Supplier<IPowerStats> service = new VintfHalCache();
+ public boolean isInitialized() {
+ return (sVintfPowerStats != null);
+ }
+ }
- if (service.get() == null) {
- sVintfPowerStats = null;
- return false;
+ /**
+ * PowerStatsHALWrapper10Impl is the implementation of the IPowerStatsHALWrapper
+ * used by the PowerStatsService on devices that support only PowerStats HAL 1.0.
+ * Other implementations will be used by the testing framework and will be passed
+ * into the PowerStatsService through an injector.
+ */
+ public static final class PowerStatsHAL10WrapperImpl implements IPowerStatsHALWrapper {
+ private boolean mIsInitialized;
+
+ // PowerStatsHAL 1.0 native functions exposed by JNI layer.
+ private static native boolean nativeInit();
+ private static native PowerEntityInfo[] nativeGetPowerEntityInfo();
+ private static native StateResidencyResult[] nativeGetStateResidency(int[] powerEntityIds);
+ private static native ChannelInfo[] nativeGetEnergyMeterInfo();
+ private static native EnergyMeasurement[] nativeReadEnergyMeters(int[] channelIds);
+
+ public PowerStatsHAL10WrapperImpl() {
+ if (nativeInit()) {
+ mIsInitialized = true;
} else {
- sVintfPowerStats = service;
- return true;
+ if (DEBUG) Slog.d(TAG, "PowerStats HAL 1.0 not available on this device.");
+ mIsInitialized = false;
}
}
+
+ @Override
+ public android.hardware.power.stats.PowerEntityInfo[] getPowerEntityInfo() {
+ return nativeGetPowerEntityInfo();
+ }
+
+ @Override
+ public android.hardware.power.stats.StateResidencyResult[] getStateResidency(
+ int[] powerEntityIds) {
+ return nativeGetStateResidency(powerEntityIds);
+ }
+
+ @Override
+ public int[] getEnergyConsumerInfo() {
+ if (DEBUG) Slog.d(TAG, "Energy consumer info is not supported");
+ return null;
+ }
+
+ @Override
+ public android.hardware.power.stats.EnergyConsumerResult[] getEnergyConsumed(
+ int[] energyConsumerIds) {
+ if (DEBUG) Slog.d(TAG, "Energy consumer results are not supported");
+ return null;
+ }
+
+ @Override
+ public android.hardware.power.stats.ChannelInfo[] getEnergyMeterInfo() {
+ return nativeGetEnergyMeterInfo();
+ }
+
+ @Override
+ public android.hardware.power.stats.EnergyMeasurement[] readEnergyMeters(int[] channelIds) {
+ return nativeReadEnergyMeters(channelIds);
+ }
+
+ @Override
+ public boolean isInitialized() {
+ return mIsInitialized;
+ }
+ }
+
+ /**
+ * Returns an instance of an IPowerStatsHALWrapper. If PowerStats HAL 2.0 is supported on the
+ * device, return a PowerStatsHAL20WrapperImpl, else return a PowerStatsHAL10WrapperImpl.
+ *
+ * @return an instance of an IPowerStatsHALWrapper where preference is given to PowerStats HAL
+ * 2.0.
+ */
+ public static IPowerStatsHALWrapper getPowerStatsHalImpl() {
+ PowerStatsHAL20WrapperImpl powerStatsHAL20WrapperImpl = new PowerStatsHAL20WrapperImpl();
+ if (powerStatsHAL20WrapperImpl.isInitialized()) {
+ return powerStatsHAL20WrapperImpl;
+ } else {
+ return new PowerStatsHAL10WrapperImpl();
+ }
}
private static class VintfHalCache implements Supplier<IPowerStats>, IBinder.DeathRecipient {
diff --git a/services/core/java/com/android/server/powerstats/PowerStatsService.java b/services/core/java/com/android/server/powerstats/PowerStatsService.java
index 1150d4b..ce50e58 100644
--- a/services/core/java/com/android/server/powerstats/PowerStatsService.java
+++ b/services/core/java/com/android/server/powerstats/PowerStatsService.java
@@ -29,7 +29,6 @@
import com.android.internal.util.DumpUtils;
import com.android.server.SystemService;
import com.android.server.powerstats.PowerStatsHALWrapper.IPowerStatsHALWrapper;
-import com.android.server.powerstats.PowerStatsHALWrapper.PowerStatsHALWrapperImpl;
import com.android.server.powerstats.ProtoStreamUtils.ChannelInfoUtils;
import com.android.server.powerstats.ProtoStreamUtils.EnergyConsumerIdUtils;
import com.android.server.powerstats.ProtoStreamUtils.PowerEntityInfoUtils;
@@ -78,7 +77,7 @@
}
IPowerStatsHALWrapper createPowerStatsHALWrapperImpl() {
- return new PowerStatsHALWrapperImpl();
+ return PowerStatsHALWrapper.getPowerStatsHalImpl();
}
PowerStatsLogger createPowerStatsLogger(Context context, File dataStoragePath,
@@ -143,7 +142,7 @@
private void onSystemServiceReady() {
mPowerStatsHALWrapper = mInjector.createPowerStatsHALWrapperImpl();
- if (mPowerStatsHALWrapper.initialize()) {
+ if (mPowerStatsHALWrapper.isInitialized()) {
if (DEBUG) Slog.d(TAG, "Starting PowerStatsService");
// Only start logger and triggers if initialization is successful.
diff --git a/services/core/java/com/android/server/powerstats/ProtoStreamUtils.java b/services/core/java/com/android/server/powerstats/ProtoStreamUtils.java
index 5a4256a..5e23b86 100644
--- a/services/core/java/com/android/server/powerstats/ProtoStreamUtils.java
+++ b/services/core/java/com/android/server/powerstats/ProtoStreamUtils.java
@@ -46,23 +46,31 @@
static class PowerEntityInfoUtils {
public static void print(PowerEntityInfo[] powerEntityInfo) {
+ if (powerEntityInfo == null) return;
+
for (int i = 0; i < powerEntityInfo.length; i++) {
Slog.d(TAG, "PowerEntityId: " + powerEntityInfo[i].powerEntityId
+ ", PowerEntityName: " + powerEntityInfo[i].powerEntityName);
- for (int j = 0; j < powerEntityInfo[i].states.length; j++) {
- Slog.d(TAG, " StateId: " + powerEntityInfo[i].states[j].stateId
- + ", StateName: " + powerEntityInfo[i].states[j].stateName);
+ if (powerEntityInfo[i].states != null) {
+ for (int j = 0; j < powerEntityInfo[i].states.length; j++) {
+ Slog.d(TAG, " StateId: " + powerEntityInfo[i].states[j].stateId
+ + ", StateName: " + powerEntityInfo[i].states[j].stateName);
+ }
}
}
}
public static void dumpsys(PowerEntityInfo[] powerEntityInfo, PrintWriter pw) {
+ if (powerEntityInfo == null) return;
+
for (int i = 0; i < powerEntityInfo.length; i++) {
pw.println("PowerEntityId: " + powerEntityInfo[i].powerEntityId
+ ", PowerEntityName: " + powerEntityInfo[i].powerEntityName);
- for (int j = 0; j < powerEntityInfo[i].states.length; j++) {
- pw.println(" StateId: " + powerEntityInfo[i].states[j].stateId
- + ", StateName: " + powerEntityInfo[i].states[j].stateName);
+ if (powerEntityInfo[i].states != null) {
+ for (int j = 0; j < powerEntityInfo[i].states.length; j++) {
+ pw.println(" StateId: " + powerEntityInfo[i].states[j].stateId
+ + ", StateName: " + powerEntityInfo[i].states[j].stateName);
+ }
}
}
}
@@ -70,6 +78,8 @@
static class StateResidencyResultUtils {
public static void print(StateResidencyResult[] stateResidencyResult) {
+ if (stateResidencyResult == null) return;
+
for (int i = 0; i < stateResidencyResult.length; i++) {
Slog.d(TAG, "PowerEntityId: " + stateResidencyResult[i].powerEntityId);
for (int j = 0; j < stateResidencyResult[i].stateResidencyData.length; j++) {
@@ -90,6 +100,8 @@
public static void packProtoMessage(ChannelInfo[] channelInfo, ProtoOutputStream pos) {
long token;
+ if (channelInfo == null) return;
+
for (int i = 0; i < channelInfo.length; i++) {
token = pos.start(PowerStatsServiceMeterProto.CHANNEL_INFO);
pos.write(ChannelInfoProto.CHANNEL_ID, channelInfo[i].channelId);
@@ -100,6 +112,8 @@
}
public static void print(ChannelInfo[] channelInfo) {
+ if (channelInfo == null) return;
+
for (int i = 0; i < channelInfo.length; i++) {
Slog.d(TAG, "ChannelId: " + channelInfo[i].channelId
+ ", ChannelName: " + channelInfo[i].channelName);
@@ -107,6 +121,8 @@
}
public static void dumpsys(ChannelInfo[] channelInfo, PrintWriter pw) {
+ if (channelInfo == null) return;
+
for (int i = 0; i < channelInfo.length; i++) {
pw.println("ChannelId: " + channelInfo[i].channelId
+ ", ChannelName: " + channelInfo[i].channelName);
@@ -125,6 +141,8 @@
ProtoOutputStream pos) {
long token;
+ if (energyMeasurement == null) return;
+
for (int i = 0; i < energyMeasurement.length; i++) {
token = pos.start(PowerStatsServiceMeterProto.ENERGY_MEASUREMENT);
pos.write(EnergyMeasurementProto.CHANNEL_ID, energyMeasurement[i].channelId);
@@ -200,6 +218,8 @@
}
public static void print(EnergyMeasurement[] energyMeasurement) {
+ if (energyMeasurement == null) return;
+
for (int i = 0; i < energyMeasurement.length; i++) {
Slog.d(TAG, "ChannelId: " + energyMeasurement[i].channelId
+ ", Timestamp (ms): " + energyMeasurement[i].timestampMs
@@ -212,6 +232,8 @@
public static void packProtoMessage(int[] energyConsumerId, ProtoOutputStream pos) {
long token;
+ if (energyConsumerId == null) return;
+
for (int i = 0; i < energyConsumerId.length; i++) {
token = pos.start(PowerStatsServiceModelProto.ENERGY_CONSUMER_ID);
pos.write(EnergyConsumerIdProto.ENERGY_CONSUMER_ID, energyConsumerId[i]);
@@ -220,12 +242,16 @@
}
public static void print(int[] energyConsumerId) {
+ if (energyConsumerId == null) return;
+
for (int i = 0; i < energyConsumerId.length; i++) {
Slog.d(TAG, "EnergyConsumerId: " + energyConsumerId[i]);
}
}
public static void dumpsys(int[] energyConsumerId, PrintWriter pw) {
+ if (energyConsumerId == null) return;
+
for (int i = 0; i < energyConsumerId.length; i++) {
pw.println("EnergyConsumerId: " + energyConsumerId[i]);
}
@@ -243,6 +269,8 @@
ProtoOutputStream pos) {
long token;
+ if (energyConsumerResult == null) return;
+
for (int i = 0; i < energyConsumerResult.length; i++) {
token = pos.start(PowerStatsServiceModelProto.ENERGY_CONSUMER_RESULT);
pos.write(EnergyConsumerResultProto.ENERGY_CONSUMER_ID,
@@ -321,6 +349,8 @@
}
public static void print(EnergyConsumerResult[] energyConsumerResult) {
+ if (energyConsumerResult == null) return;
+
for (int i = 0; i < energyConsumerResult.length; i++) {
Slog.d(TAG, "EnergyConsumerId: " + energyConsumerResult[i].energyConsumerId
+ ", Timestamp (ms): " + energyConsumerResult[i].timestampMs
diff --git a/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java b/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java
index 990055e..5c01e43 100644
--- a/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java
+++ b/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java
@@ -32,6 +32,8 @@
import android.os.ResultReceiver;
import android.os.ShellCallback;
import android.os.SystemProperties;
+import android.util.ArrayMap;
+import android.util.ArraySet;
import android.util.Slog;
import com.android.internal.annotations.GuardedBy;
@@ -49,10 +51,6 @@
import java.io.FileWriter;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
/**
* The recovery system service is responsible for coordinating recovery related
@@ -84,9 +82,9 @@
private final Context mContext;
@GuardedBy("this")
- private final Map<String, IntentSender> mCallerPendingRequest = new HashMap<>();
+ private final ArrayMap<String, IntentSender> mCallerPendingRequest = new ArrayMap<>();
@GuardedBy("this")
- private final Set<String> mCallerPreparedForReboot = new HashSet<>();
+ private final ArraySet<String> mCallerPreparedForReboot = new ArraySet<>();
/**
* Need to prepare for resume on reboot.
@@ -121,7 +119,7 @@
@IntDef({ ROR_NEED_PREPARATION,
ROR_SKIP_PREPARATION_AND_NOTIFY,
ROR_SKIP_PREPARATION_NOT_NOTIFY })
- @interface ResumeOnRebootActionsOnRequest {}
+ private @interface ResumeOnRebootActionsOnRequest {}
/**
* The action to perform upon resume on reboot clear request for a given client.
@@ -129,7 +127,7 @@
@IntDef({ROR_NOT_REQUESTED,
ROR_REQUESTED_NEED_CLEAR,
ROR_REQUESTED_SKIP_CLEAR})
- @interface ResumeOnRebootActionsOnClear{}
+ private @interface ResumeOnRebootActionsOnClear{}
static class Injector {
protected final Context mContext;
@@ -342,9 +340,8 @@
!= PackageManager.PERMISSION_GRANTED
&& mContext.checkCallingOrSelfPermission(android.Manifest.permission.REBOOT)
!= PackageManager.PERMISSION_GRANTED) {
- throw new SecurityException("Caller or self must have "
- + android.Manifest.permission.RECOVERY + " or "
- + android.Manifest.permission.REBOOT + " for resume on reboot.");
+ throw new SecurityException("Caller must have " + android.Manifest.permission.RECOVERY
+ + " or " + android.Manifest.permission.REBOOT + " for resume on reboot.");
}
}
@@ -414,10 +411,14 @@
Slog.w(TAG, "onPreparedForReboot called when some clients have prepared.");
}
+ if (mCallerPendingRequest.isEmpty()) {
+ Slog.w(TAG, "onPreparedForReboot called but no client has requested.");
+ }
+
// Send intents to notify callers
- for (Map.Entry<String, IntentSender> entry : mCallerPendingRequest.entrySet()) {
- sendPreparedForRebootIntentIfNeeded(entry.getValue());
- mCallerPreparedForReboot.add(entry.getKey());
+ for (int i = 0; i < mCallerPendingRequest.size(); i++) {
+ sendPreparedForRebootIntentIfNeeded(mCallerPendingRequest.valueAt(i));
+ mCallerPreparedForReboot.add(mCallerPendingRequest.keyAt(i));
}
mCallerPendingRequest.clear();
}
@@ -475,9 +476,7 @@
return needClear ? ROR_REQUESTED_NEED_CLEAR : ROR_REQUESTED_SKIP_CLEAR;
}
- @Override // Binder call
- public boolean rebootWithLskf(String packageName, String reason, boolean slotSwitch) {
- enforcePermissionForResumeOnReboot();
+ private boolean rebootWithLskfImpl(String packageName, String reason, boolean slotSwitch) {
if (packageName == null) {
Slog.w(TAG, "Missing packageName when rebooting with lskf.");
return false;
@@ -498,11 +497,29 @@
return true;
}
+ @Override // Binder call for the legacy rebootWithLskf
+ public boolean rebootWithLskfAssumeSlotSwitch(String packageName, String reason) {
+ mContext.enforceCallingOrSelfPermission(android.Manifest.permission.RECOVERY, null);
+ return rebootWithLskfImpl(packageName, reason, true);
+ }
+
@Override // Binder call
- public synchronized boolean isLskfCaptured(String packageName) {
+ public boolean rebootWithLskf(String packageName, String reason, boolean slotSwitch) {
enforcePermissionForResumeOnReboot();
- if (!mCallerPreparedForReboot.contains(packageName)) {
- Slog.i(TAG, "Reboot requested before prepare completed for caller " + packageName);
+ return rebootWithLskfImpl(packageName, reason, slotSwitch);
+ }
+
+ @Override // Binder call
+ public boolean isLskfCaptured(String packageName) {
+ enforcePermissionForResumeOnReboot();
+ boolean captured;
+ synchronized (this) {
+ captured = mCallerPreparedForReboot.contains(packageName);
+ }
+
+ if (!captured) {
+ Slog.i(TAG, "Reboot requested before prepare completed for caller "
+ + packageName);
return false;
}
return true;
diff --git a/services/core/java/com/android/server/role/RoleManagerService.java b/services/core/java/com/android/server/role/RoleManagerService.java
index d6add78..4e42f16 100644
--- a/services/core/java/com/android/server/role/RoleManagerService.java
+++ b/services/core/java/com/android/server/role/RoleManagerService.java
@@ -18,13 +18,11 @@
import android.Manifest;
import android.annotation.AnyThread;
-import android.annotation.CheckResult;
import android.annotation.MainThread;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.UserIdInt;
import android.annotation.WorkerThread;
-import android.app.ActivityManager;
import android.app.AppOpsManager;
import android.app.role.IOnRoleHoldersChangedListener;
import android.app.role.IRoleManager;
@@ -34,20 +32,22 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
-import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.pm.PackageManager;
import android.content.pm.PackageManagerInternal;
import android.content.pm.Signature;
import android.os.Binder;
import android.os.Handler;
+import android.os.ParcelFileDescriptor;
+import android.os.Process;
import android.os.RemoteCallback;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
-import android.os.ResultReceiver;
-import android.os.ShellCallback;
import android.os.UserHandle;
+import android.os.UserManager;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
+import android.util.IndentingPrintWriter;
import android.util.PackageUtils;
import android.util.Slog;
import android.util.SparseArray;
@@ -57,11 +57,7 @@
import com.android.internal.infra.AndroidFuture;
import com.android.internal.infra.ThrottledRunnable;
import com.android.internal.util.ArrayUtils;
-import com.android.internal.util.BitUtils;
import com.android.internal.util.CollectionUtils;
-import com.android.internal.util.DumpUtils;
-import com.android.internal.util.FunctionalUtils;
-import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.Preconditions;
import com.android.internal.util.dump.DualDumpOutputStream;
import com.android.internal.util.function.pooled.PooledLambda;
@@ -71,7 +67,10 @@
import com.android.server.pm.UserManagerInternal;
import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
import java.io.FileDescriptor;
+import java.io.FileOutputStream;
+import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
@@ -87,7 +86,6 @@
* @see RoleManager
*/
public class RoleManagerService extends SystemService implements RoleUserState.Callback {
-
private static final String LOG_TAG = RoleManagerService.class.getSimpleName();
private static final boolean DEBUG = false;
@@ -95,9 +93,11 @@
private static final long GRANT_DEFAULT_ROLES_INTERVAL_MILLIS = 1000;
@NonNull
- private final UserManagerInternal mUserManagerInternal;
- @NonNull
private final AppOpsManager mAppOpsManager;
+ @NonNull
+ private final PackageManagerInternal mPackageManagerInternal;
+ @NonNull
+ private final UserManagerInternal mUserManagerInternal;
@NonNull
private final Object mLock = new Object();
@@ -146,8 +146,9 @@
RoleControllerManager.initializeRemoteServiceComponentName(context);
- mUserManagerInternal = LocalServices.getService(UserManagerInternal.class);
mAppOpsManager = context.getSystemService(AppOpsManager.class);
+ mPackageManagerInternal = LocalServices.getService(PackageManagerInternal.class);
+ mUserManagerInternal = LocalServices.getService(UserManagerInternal.class);
LocalServices.addService(RoleManagerInternal.class, new Internal());
@@ -157,15 +158,16 @@
private void registerUserRemovedReceiver() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(Intent.ACTION_USER_REMOVED);
- getContext().registerReceiverAsUser(new BroadcastReceiver() {
+ getContext().registerReceiverForAllUsers(new BroadcastReceiver() {
@Override
public void onReceive(@NonNull Context context, @NonNull Intent intent) {
if (TextUtils.equals(intent.getAction(), Intent.ACTION_USER_REMOVED)) {
- int userId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0);
+ int userId = intent.<UserHandle>getParcelableExtra(Intent.EXTRA_USER)
+ .getIdentifier();
onRemoveUser(userId);
}
}
- }, UserHandle.ALL, intentFilter, null, null);
+ }, intentFilter, null, null);
}
@Override
@@ -178,7 +180,7 @@
intentFilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
intentFilter.addDataScheme("package");
intentFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
- getContext().registerReceiverAsUser(new BroadcastReceiver() {
+ getContext().registerReceiverForAllUsers(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
int userId = UserHandle.getUserId(intent.getIntExtra(Intent.EXTRA_UID, -1));
@@ -193,12 +195,12 @@
}
maybeGrantDefaultRolesAsync(userId);
}
- }, UserHandle.ALL, intentFilter, null, null);
+ }, intentFilter, null, null);
}
@Override
public void onUserStarting(@NonNull TargetUser user) {
- maybeGrantDefaultRolesSync(user.getUserIdentifier());
+ maybeGrantDefaultRolesSync(user.getUserHandle().getIdentifier());
}
@MainThread
@@ -230,7 +232,7 @@
private AndroidFuture<Void> maybeGrantDefaultRolesInternal(@UserIdInt int userId) {
RoleUserState userState = getOrCreateUserState(userId);
String oldPackagesHash = userState.getPackagesHash();
- String newPackagesHash = computeComponentStateHash(userId);
+ String newPackagesHash = computePackageStateHash(userId);
if (Objects.equals(oldPackagesHash, newPackagesHash)) {
if (DEBUG) {
Slog.i(LOG_TAG, "Already granted default roles for packages hash "
@@ -282,35 +284,42 @@
}
@Nullable
- private static String computeComponentStateHash(@UserIdInt int userId) {
- PackageManagerInternal pm = LocalServices.getService(PackageManagerInternal.class);
- ByteArrayOutputStream out = new ByteArrayOutputStream();
+ private String computePackageStateHash(@UserIdInt int userId) {
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream);
- pm.forEachInstalledPackage(FunctionalUtils.uncheckExceptions(pkg -> {
- out.write(pkg.getPackageName().getBytes());
- out.write(BitUtils.toBytes(pkg.getLongVersionCode()));
- out.write(pm.getApplicationEnabledState(pkg.getPackageName(), userId));
+ mPackageManagerInternal.forEachInstalledPackage(pkg -> {
+ try {
+ dataOutputStream.writeUTF(pkg.getPackageName());
+ dataOutputStream.writeLong(pkg.getLongVersionCode());
+ dataOutputStream.writeInt(mPackageManagerInternal.getApplicationEnabledState(
+ pkg.getPackageName(), userId));
- ArraySet<String> enabledComponents =
- pm.getEnabledComponents(pkg.getPackageName(), userId);
- int numComponents = CollectionUtils.size(enabledComponents);
- out.write(numComponents);
- for (int i = 0; i < numComponents; i++) {
- out.write(enabledComponents.valueAt(i).getBytes());
+ ArraySet<String> enabledComponents =
+ mPackageManagerInternal.getEnabledComponents(pkg.getPackageName(), userId);
+ int numComponents = CollectionUtils.size(enabledComponents);
+ dataOutputStream.writeInt(numComponents);
+ for (int i = 0; i < numComponents; i++) {
+ dataOutputStream.writeUTF(enabledComponents.valueAt(i));
+ }
+
+ ArraySet<String> disabledComponents =
+ mPackageManagerInternal.getDisabledComponents(pkg.getPackageName(), userId);
+ numComponents = CollectionUtils.size(disabledComponents);
+ for (int i = 0; i < numComponents; i++) {
+ dataOutputStream.writeUTF(disabledComponents.valueAt(i));
+ }
+
+ for (Signature signature : pkg.getSigningDetails().signatures) {
+ dataOutputStream.write(signature.toByteArray());
+ }
+ } catch (IOException e) {
+ // Never happens for ByteArrayOutputStream and DataOutputStream.
+ throw new AssertionError(e);
}
+ }, userId);
- ArraySet<String> disabledComponents =
- pm.getDisabledComponents(pkg.getPackageName(), userId);
- numComponents = CollectionUtils.size(disabledComponents);
- for (int i = 0; i < numComponents; i++) {
- out.write(disabledComponents.valueAt(i).getBytes());
- }
- for (Signature signature : pkg.getSigningDetails().signatures) {
- out.write(signature.toByteArray());
- }
- }), userId);
-
- return PackageUtils.computeSha256Digest(out.toByteArray());
+ return PackageUtils.computeSha256Digest(byteArrayOutputStream.toByteArray());
}
@NonNull
@@ -335,7 +344,7 @@
try {
context = systemContext.createPackageContextAsUser(
systemContext.getPackageName(), 0, UserHandle.of(userId));
- } catch (NameNotFoundException e) {
+ } catch (PackageManager.NameNotFoundException e) {
throw new RuntimeException(e);
}
controller = RoleControllerManager.createWithInitializedRemoteServiceComponentName(
@@ -371,9 +380,11 @@
RoleUserState userState;
synchronized (mLock) {
mGrantDefaultRolesThrottledRunnables.remove(userId);
- listeners = mListeners.removeReturnOld(userId);
+ listeners = mListeners.get(userId);
+ mListeners.remove(userId);
mControllers.remove(userId);
- userState = mUserStates.removeReturnOld(userId);
+ userState = mUserStates.get(userId);
+ mUserStates.remove(userId);
}
if (listeners != null) {
listeners.kill();
@@ -455,7 +466,7 @@
Slog.e(LOG_TAG, "user " + userId + " does not exist");
return Collections.emptyList();
}
- userId = handleIncomingUser(userId, false, "getRoleHoldersAsUser");
+ enforceCrossUserPermission(userId, false, "getRoleHoldersAsUser");
getContext().enforceCallingOrSelfPermission(Manifest.permission.MANAGE_ROLE_HOLDERS,
"getRoleHoldersAsUser");
@@ -476,7 +487,7 @@
Slog.e(LOG_TAG, "user " + userId + " does not exist");
return;
}
- userId = handleIncomingUser(userId, false, "addRoleHolderAsUser");
+ enforceCrossUserPermission(userId, false, "addRoleHolderAsUser");
getContext().enforceCallingOrSelfPermission(Manifest.permission.MANAGE_ROLE_HOLDERS,
"addRoleHolderAsUser");
@@ -496,7 +507,7 @@
Slog.e(LOG_TAG, "user " + userId + " does not exist");
return;
}
- userId = handleIncomingUser(userId, false, "removeRoleHolderAsUser");
+ enforceCrossUserPermission(userId, false, "removeRoleHolderAsUser");
getContext().enforceCallingOrSelfPermission(Manifest.permission.MANAGE_ROLE_HOLDERS,
"removeRoleHolderAsUser");
@@ -516,7 +527,7 @@
Slog.e(LOG_TAG, "user " + userId + " does not exist");
return;
}
- userId = handleIncomingUser(userId, false, "clearRoleHoldersAsUser");
+ enforceCrossUserPermission(userId, false, "clearRoleHoldersAsUser");
getContext().enforceCallingOrSelfPermission(Manifest.permission.MANAGE_ROLE_HOLDERS,
"clearRoleHoldersAsUser");
@@ -533,7 +544,7 @@
Slog.e(LOG_TAG, "user " + userId + " does not exist");
return;
}
- userId = handleIncomingUser(userId, true, "addOnRoleHoldersChangedListenerAsUser");
+ enforceCrossUserPermission(userId, true, "addOnRoleHoldersChangedListenerAsUser");
getContext().enforceCallingOrSelfPermission(Manifest.permission.OBSERVE_ROLE_HOLDERS,
"addOnRoleHoldersChangedListenerAsUser");
@@ -551,7 +562,7 @@
Slog.e(LOG_TAG, "user " + userId + " does not exist");
return;
}
- userId = handleIncomingUser(userId, true, "removeOnRoleHoldersChangedListenerAsUser");
+ enforceCrossUserPermission(userId, true, "removeOnRoleHoldersChangedListenerAsUser");
getContext().enforceCallingOrSelfPermission(Manifest.permission.OBSERVE_ROLE_HOLDERS,
"removeOnRoleHoldersChangedListenerAsUser");
@@ -572,7 +583,7 @@
Objects.requireNonNull(roleNames, "roleNames cannot be null");
- int userId = UserHandle.getCallingUserId();
+ int userId = UserHandle.getUserId(Binder.getCallingUid());
getOrCreateUserState(userId).setRoleNames(roleNames);
}
@@ -586,7 +597,7 @@
Preconditions.checkStringNotEmpty(roleName, "roleName cannot be null or empty");
Preconditions.checkStringNotEmpty(packageName, "packageName cannot be null or empty");
- int userId = UserHandle.getCallingUserId();
+ int userId = UserHandle.getUserId(Binder.getCallingUid());
return getOrCreateUserState(userId).addRoleHolder(roleName, packageName);
}
@@ -600,7 +611,7 @@
Preconditions.checkStringNotEmpty(roleName, "roleName cannot be null or empty");
Preconditions.checkStringNotEmpty(packageName, "packageName cannot be null or empty");
- int userId = UserHandle.getCallingUserId();
+ int userId = UserHandle.getUserId(Binder.getCallingUid());
return getOrCreateUserState(userId).removeRoleHolder(roleName, packageName);
}
@@ -612,23 +623,36 @@
Preconditions.checkStringNotEmpty(packageName, "packageName cannot be null or empty");
- int userId = UserHandle.getCallingUserId();
+ int userId = UserHandle.getUserId(Binder.getCallingUid());
return getOrCreateUserState(userId).getHeldRoles(packageName);
}
- @CheckResult
- private int handleIncomingUser(@UserIdInt int userId, boolean allowAll,
- @NonNull String name) {
- return ActivityManager.handleIncomingUser(getCallingPid(), getCallingUid(), userId,
- allowAll, true, name, null);
+ private void enforceCrossUserPermission(@UserIdInt int userId, boolean allowAll,
+ @NonNull String message) {
+ final int callingUid = Binder.getCallingUid();
+ final int callingUserId = UserHandle.getUserId(callingUid);
+ if (userId == callingUserId) {
+ return;
+ }
+ Preconditions.checkArgument(userId >= UserHandle.USER_SYSTEM
+ || (allowAll && userId == UserHandle.USER_ALL), "Invalid user " + userId);
+ getContext().enforceCallingOrSelfPermission(
+ android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, message);
+ if (callingUid == Process.SHELL_UID && userId >= UserHandle.USER_SYSTEM) {
+ if (mUserManagerInternal.hasUserRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES,
+ userId)) {
+ throw new SecurityException("Shell does not have permission to access user "
+ + userId);
+ }
+ }
}
@Override
- public void onShellCommand(@Nullable FileDescriptor in, @Nullable FileDescriptor out,
- @Nullable FileDescriptor err, @NonNull String[] args,
- @Nullable ShellCallback callback, @NonNull ResultReceiver resultReceiver) {
- new RoleManagerShellCommand(this).exec(this, in, out, err, args, callback,
- resultReceiver);
+ public int handleShellCommand(@NonNull ParcelFileDescriptor in,
+ @NonNull ParcelFileDescriptor out, @NonNull ParcelFileDescriptor err,
+ @NonNull String[] args) {
+ return new RoleManagerShellCommand(this).exec(this, in.getFileDescriptor(),
+ out.getFileDescriptor(), err.getFileDescriptor(), args);
}
@Nullable
@@ -639,9 +663,7 @@
getContext().enforceCallingOrSelfPermission(
android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, null);
}
- final PackageManagerInternal packageManager = LocalServices.getService(
- PackageManagerInternal.class);
- if (packageManager.getInstantAppPackageName(callingUid) != null) {
+ if (mPackageManagerInternal.getInstantAppPackageName(callingUid) != null) {
return null;
}
@@ -659,7 +681,7 @@
final Context context = getContext();
context.enforceCallingOrSelfPermission(
android.Manifest.permission.SET_PREFERRED_APPLICATIONS, null);
- if (UserHandle.getCallingUserId() != userId) {
+ if (UserHandle.getUserId(Binder.getCallingUid()) != userId) {
context.enforceCallingOrSelfPermission(
android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, null);
}
@@ -711,35 +733,48 @@
@Override
protected void dump(@NonNull FileDescriptor fd, @NonNull PrintWriter fout,
@Nullable String[] args) {
- if (!DumpUtils.checkDumpPermission(getContext(), LOG_TAG, fout)) {
+ if (!checkDumpPermission("role", fout)) {
return;
}
boolean dumpAsProto = args != null && ArrayUtils.contains(args, "--proto");
DualDumpOutputStream dumpOutputStream;
if (dumpAsProto) {
- dumpOutputStream = new DualDumpOutputStream(new ProtoOutputStream(fd));
+ dumpOutputStream = new DualDumpOutputStream(new ProtoOutputStream(
+ new FileOutputStream(fd)));
} else {
fout.println("ROLE MANAGER STATE (dumpsys role):");
dumpOutputStream = new DualDumpOutputStream(new IndentingPrintWriter(fout, " "));
}
- int[] userIds = mUserManagerInternal.getUserIds();
- int userIdsLength = userIds.length;
- for (int i = 0; i < userIdsLength; i++) {
- int userId = userIds[i];
+ synchronized (mLock) {
+ final int userStatesSize = mUserStates.size();
+ for (int i = 0; i < userStatesSize; i++) {
+ final RoleUserState userState = mUserStates.valueAt(i);
- RoleUserState userState = getOrCreateUserState(userId);
- userState.dump(dumpOutputStream, "user_states",
- RoleManagerServiceDumpProto.USER_STATES);
+ userState.dump(dumpOutputStream, "user_states",
+ RoleManagerServiceDumpProto.USER_STATES);
+ }
}
dumpOutputStream.flush();
}
+
+ private boolean checkDumpPermission(@NonNull String serviceName,
+ @NonNull PrintWriter writer) {
+ if (getContext().checkCallingOrSelfPermission(android.Manifest.permission.DUMP)
+ != PackageManager.PERMISSION_GRANTED) {
+ writer.println("Permission Denial: can't dump " + serviceName + " from from pid="
+ + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid()
+ + " due to missing " + android.Manifest.permission.DUMP + " permission");
+ return false;
+ } else {
+ return true;
+ }
+ }
}
private class Internal extends RoleManagerInternal {
-
@NonNull
@Override
public ArrayMap<String, ArraySet<String>> getRolesAndHolders(@UserIdInt int userId) {
diff --git a/services/core/java/com/android/server/role/RoleManagerShellCommand.java b/services/core/java/com/android/server/role/RoleManagerShellCommand.java
index b26a070..96f3c29 100644
--- a/services/core/java/com/android/server/role/RoleManagerShellCommand.java
+++ b/services/core/java/com/android/server/role/RoleManagerShellCommand.java
@@ -21,16 +21,15 @@
import android.app.role.IRoleManager;
import android.os.RemoteCallback;
import android.os.RemoteException;
-import android.os.ShellCommand;
import android.os.UserHandle;
-import android.util.Log;
+
+import com.android.modules.utils.BasicShellCommandHandler;
import java.io.PrintWriter;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
-class RoleManagerShellCommand extends ShellCommand {
-
+class RoleManagerShellCommand extends BasicShellCommandHandler {
@NonNull
private final IRoleManager mRoleManager;
@@ -39,7 +38,6 @@
}
private class CallbackFuture extends CompletableFuture<Void> {
-
@NonNull
public RemoteCallback createCallback() {
return new RemoteCallback(result -> {
@@ -57,8 +55,7 @@
get(5, TimeUnit.SECONDS);
return 0;
} catch (Exception e) {
- getErrPrintWriter().println("Error: see logcat for details.\n"
- + Log.getStackTraceString(e));
+ getErrPrintWriter().println("Error: see logcat for details.\n" + e);
return -1;
}
}
@@ -92,7 +89,7 @@
int userId = UserHandle.USER_SYSTEM;
String option = getNextOption();
if (option != null && option.equals("--user")) {
- userId = UserHandle.parseUserArg(getNextArgRequired());
+ userId = Integer.parseInt(getNextArgRequired());
}
return userId;
}
@@ -143,7 +140,7 @@
public void onHelp() {
PrintWriter pw = getOutPrintWriter();
pw.println("Role manager (role) commands:");
- pw.println(" help");
+ pw.println(" help or -h");
pw.println(" Print this help text.");
pw.println();
pw.println(" add-role-holder [--user USER_ID] ROLE PACKAGE [FLAGS]");
diff --git a/services/core/java/com/android/server/role/RoleUserState.java b/services/core/java/com/android/server/role/RoleUserState.java
index 7d77450..3a5ed5c 100644
--- a/services/core/java/com/android/server/role/RoleUserState.java
+++ b/services/core/java/com/android/server/role/RoleUserState.java
@@ -28,7 +28,6 @@
import android.util.ArraySet;
import android.util.AtomicFile;
import android.util.Slog;
-import android.util.TypedXmlPullParser;
import android.util.Xml;
import com.android.internal.annotations.GuardedBy;
@@ -55,8 +54,7 @@
/**
* Stores the state of roles for a user.
*/
-public class RoleUserState {
-
+class RoleUserState {
private static final String LOG_TAG = RoleUserState.class.getSimpleName();
public static final int VERSION_UNDEFINED = -1;
@@ -104,7 +102,7 @@
private boolean mDestroyed;
@NonNull
- private final Handler mWriteHandler = new Handler(BackgroundThread.getHandler().getLooper());
+ private final Handler mWriteHandler = new Handler(BackgroundThread.get().getLooper());
/**
* Create a new user state, and read its state from disk if previously persisted.
@@ -392,7 +390,8 @@
private void readLegacyFileLocked() {
File file = getFile(mUserId);
try (FileInputStream in = new AtomicFile(file).openRead()) {
- TypedXmlPullParser parser = Xml.resolvePullParser(in);
+ XmlPullParser parser = Xml.newPullParser();
+ parser.setInput(in, null);
parseXmlLocked(parser);
Slog.i(LOG_TAG, "Read roles.xml successfully");
} catch (FileNotFoundException e) {
@@ -402,7 +401,7 @@
}
}
- private void parseXmlLocked(@NonNull TypedXmlPullParser parser) throws IOException,
+ private void parseXmlLocked(@NonNull XmlPullParser parser) throws IOException,
XmlPullParserException {
int type;
int depth;
@@ -421,9 +420,9 @@
Slog.w(LOG_TAG, "Missing <" + TAG_ROLES + "> in roles.xml");
}
- private void parseRolesLocked(@NonNull TypedXmlPullParser parser) throws IOException,
+ private void parseRolesLocked(@NonNull XmlPullParser parser) throws IOException,
XmlPullParserException {
- mVersion = parser.getAttributeInt(null, ATTRIBUTE_VERSION);
+ mVersion = Integer.parseInt(parser.getAttributeValue(null, ATTRIBUTE_VERSION));
mPackagesHash = parser.getAttributeValue(null, ATTRIBUTE_PACKAGES_HASH);
mRoles.clear();
@@ -445,7 +444,7 @@
}
@NonNull
- private ArraySet<String> parseRoleHoldersLocked(@NonNull TypedXmlPullParser parser)
+ private ArraySet<String> parseRoleHoldersLocked(@NonNull XmlPullParser parser)
throws IOException, XmlPullParserException {
ArraySet<String> roleHolders = new ArraySet<>();
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 8071672..966be99 100644
--- a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
+++ b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
@@ -255,6 +255,9 @@
*/
private static final int MIN_CPU_TIME_PER_UID_FREQ = 10;
+ /** Number of entries in CpuCyclesPerUidCluster atom stored in an array for each cluster. */
+ private static final int CPU_CYCLES_PER_UID_CLUSTER_VALUES = 3;
+
private final Object mThermalLock = new Object();
@GuardedBy("mThermalLock")
private IThermalService mThermalService;
@@ -447,6 +450,12 @@
synchronized (mCpuTimePerUidLock) {
return pullCpuTimePerUidLocked(atomTag, data);
}
+ case FrameworkStatsLog.CPU_CYCLES_PER_UID_CLUSTER:
+ // Use the same lock as CPU_TIME_PER_UID_FREQ because data is pulled from
+ // the same source.
+ synchronized (mCpuTimePerUidFreqLock) {
+ return pullCpuCyclesPerUidClusterLocked(atomTag, data);
+ }
case FrameworkStatsLog.CPU_TIME_PER_UID_FREQ:
synchronized (mCpuTimePerUidFreqLock) {
return pullCpuTimePerUidFreqLocked(atomTag, data);
@@ -785,6 +794,7 @@
registerKernelWakelock();
registerCpuTimePerFreq();
registerCpuTimePerUid();
+ registerCpuCyclesPerUidCluster();
registerCpuTimePerUidFreq();
registerCpuActiveTime();
registerCpuClusterTime();
@@ -1502,6 +1512,97 @@
return StatsManager.PULL_SUCCESS;
}
+ private void registerCpuCyclesPerUidCluster() {
+ int tagId = FrameworkStatsLog.CPU_CYCLES_PER_UID_CLUSTER;
+ PullAtomMetadata metadata = new PullAtomMetadata.Builder()
+ .setAdditiveFields(new int[] {3, 4, 5})
+ .build();
+ mStatsManager.setPullAtomCallback(
+ tagId,
+ metadata,
+ DIRECT_EXECUTOR,
+ mStatsCallbackImpl
+ );
+ }
+
+ int pullCpuCyclesPerUidClusterLocked(int atomTag, List<StatsEvent> pulledData) {
+ PowerProfile powerProfile = new PowerProfile(mContext);
+ // Frequency index to frequency mapping.
+ long[] freqs = mCpuUidFreqTimeReader.readFreqs(powerProfile);
+ // Frequency index to cluster mapping.
+ int[] freqClusters = new int[freqs.length];
+ // Frequency index to power mapping.
+ double[] freqPowers = new double[freqs.length];
+ // Number of clusters.
+ int clusters;
+
+ // Initialize frequency mappings.
+ {
+ int cluster = 0;
+ int freqClusterIndex = 0;
+ long lastFreq = -1;
+ for (int freqIndex = 0; freqIndex < freqs.length; ++freqIndex, ++freqClusterIndex) {
+ long currFreq = freqs[freqIndex];
+ if (currFreq <= lastFreq) {
+ cluster++;
+ freqClusterIndex = 0;
+ }
+ freqClusters[freqIndex] = cluster;
+ freqPowers[freqIndex] =
+ powerProfile.getAveragePowerForCpuCore(cluster, freqClusterIndex);
+ lastFreq = currFreq;
+ }
+
+ clusters = cluster + 1;
+ }
+
+ // Aggregate 0: mcycles, 1: runtime ms, 2: power profile estimate for the same uids for
+ // each cluster.
+ SparseArray<double[]> aggregated = new SparseArray<>();
+ mCpuUidFreqTimeReader.readAbsolute((uid, cpuFreqTimeMs) -> {
+ 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;
+ } else {
+ // Everything else is accounted under their base uid.
+ uid = UserHandle.getAppId(uid);
+ }
+
+ double[] values = aggregated.get(uid);
+ if (values == null) {
+ values = new double[clusters * CPU_CYCLES_PER_UID_CLUSTER_VALUES];
+ aggregated.put(uid, values);
+ }
+
+ for (int freqIndex = 0; freqIndex < cpuFreqTimeMs.length; ++freqIndex) {
+ int cluster = freqClusters[freqIndex];
+ long timeMs = cpuFreqTimeMs[freqIndex];
+ values[cluster * CPU_CYCLES_PER_UID_CLUSTER_VALUES] += freqs[freqIndex] * timeMs;
+ values[cluster * CPU_CYCLES_PER_UID_CLUSTER_VALUES + 1] += timeMs;
+ values[cluster * CPU_CYCLES_PER_UID_CLUSTER_VALUES + 2] +=
+ freqPowers[freqIndex] * timeMs;
+ }
+ });
+
+ int size = aggregated.size();
+ for (int i = 0; i < size; ++i) {
+ int uid = aggregated.keyAt(i);
+ double[] values = aggregated.valueAt(i);
+ for (int cluster = 0; cluster < clusters; ++cluster) {
+ pulledData.add(FrameworkStatsLog.buildStatsEvent(
+ atomTag, uid, cluster,
+ (long) (values[cluster * CPU_CYCLES_PER_UID_CLUSTER_VALUES] / 1e6),
+ (long) values[cluster * CPU_CYCLES_PER_UID_CLUSTER_VALUES + 1],
+ (long) (values[cluster * CPU_CYCLES_PER_UID_CLUSTER_VALUES + 2] / 1e3)));
+ }
+ }
+ return StatsManager.PULL_SUCCESS;
+ }
+
private void registerCpuTimePerUidFreq() {
// the throttling is 3sec, handled in
// frameworks/base/core/java/com/android/internal/os/KernelCpuProcReader
diff --git a/services/core/java/com/android/server/tv/tunerresourcemanager/ClientProfile.java b/services/core/java/com/android/server/tv/tunerresourcemanager/ClientProfile.java
index 2fc17fe..036049f 100644
--- a/services/core/java/com/android/server/tv/tunerresourcemanager/ClientProfile.java
+++ b/services/core/java/com/android/server/tv/tunerresourcemanager/ClientProfile.java
@@ -126,6 +126,9 @@
}
public void setPriority(int priority) {
+ if (priority < 0) {
+ return;
+ }
mPriority = priority;
}
diff --git a/services/core/java/com/android/server/vcn/Android.bp b/services/core/java/com/android/server/vcn/Android.bp
new file mode 100644
index 0000000..5ed204f
--- /dev/null
+++ b/services/core/java/com/android/server/vcn/Android.bp
@@ -0,0 +1,4 @@
+filegroup {
+ name: "framework-vcn-util-sources",
+ srcs: ["util/**/*.java"],
+}
\ No newline at end of file
diff --git a/services/core/java/com/android/server/vcn/TelephonySubscriptionTracker.java b/services/core/java/com/android/server/vcn/TelephonySubscriptionTracker.java
new file mode 100644
index 0000000..c060807
--- /dev/null
+++ b/services/core/java/com/android/server/vcn/TelephonySubscriptionTracker.java
@@ -0,0 +1,314 @@
+/*
+ * 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.vcn;
+
+import static android.telephony.CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED;
+import static android.telephony.CarrierConfigManager.EXTRA_SLOT_INDEX;
+import static android.telephony.CarrierConfigManager.EXTRA_SUBSCRIPTION_INDEX;
+import static android.telephony.SubscriptionManager.INVALID_SIM_SLOT_INDEX;
+import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Handler;
+import android.os.HandlerExecutor;
+import android.os.ParcelUuid;
+import android.os.PersistableBundle;
+import android.telephony.CarrierConfigManager;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
+import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener;
+import android.util.ArraySet;
+import android.util.Slog;
+
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.annotations.VisibleForTesting.Visibility;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Objects;
+import java.util.Set;
+
+/**
+ * TelephonySubscriptionTracker provides a caching layer for tracking active subscription groups.
+ *
+ * <p>This class performs two roles:
+ *
+ * <ol>
+ * <li>De-noises subscription changes by ensuring that only changes in active and ready
+ * subscription groups are acted upon
+ * <li>Caches mapping between subIds and subscription groups
+ * </ol>
+ *
+ * <p>An subscription group is active and ready if any of its contained subIds has had BOTH the
+ * {@link CarrierConfigManager#isConfigForIdentifiedCarrier()} return true, AND the subscription is
+ * listed as active per SubscriptionManager#getAllSubscriptionInfoList().
+ *
+ * <p>Note that due to the asynchronous nature of callbacks and broadcasts, the output of this class
+ * is (only) eventually consistent.
+ *
+ * @hide
+ */
+public class TelephonySubscriptionTracker extends BroadcastReceiver {
+ @NonNull private static final String TAG = TelephonySubscriptionTracker.class.getSimpleName();
+ private static final boolean LOG_DBG = false; // STOPSHIP if true
+
+ @NonNull private final Context mContext;
+ @NonNull private final Handler mHandler;
+ @NonNull private final TelephonySubscriptionTrackerCallback mCallback;
+ @NonNull private final Dependencies mDeps;
+
+ @NonNull private final SubscriptionManager mSubscriptionManager;
+ @NonNull private final CarrierConfigManager mCarrierConfigManager;
+
+ // TODO (Android T+): Add ability to handle multiple subIds per slot.
+ @NonNull private final Map<Integer, Integer> mReadySubIdsBySlotId = new HashMap<>();
+ @NonNull private final OnSubscriptionsChangedListener mSubscriptionChangedListener;
+
+ @NonNull private TelephonySubscriptionSnapshot mCurrentSnapshot;
+
+ public TelephonySubscriptionTracker(
+ @NonNull Context context,
+ @NonNull Handler handler,
+ @NonNull TelephonySubscriptionTrackerCallback callback) {
+ this(context, handler, callback, new Dependencies());
+ }
+
+ @VisibleForTesting(visibility = Visibility.PRIVATE)
+ TelephonySubscriptionTracker(
+ @NonNull Context context,
+ @NonNull Handler handler,
+ @NonNull TelephonySubscriptionTrackerCallback callback,
+ @NonNull Dependencies deps) {
+ mContext = Objects.requireNonNull(context, "Missing context");
+ mHandler = Objects.requireNonNull(handler, "Missing handler");
+ mCallback = Objects.requireNonNull(callback, "Missing callback");
+ mDeps = Objects.requireNonNull(deps, "Missing deps");
+
+ mSubscriptionManager = mContext.getSystemService(SubscriptionManager.class);
+ mCarrierConfigManager = mContext.getSystemService(CarrierConfigManager.class);
+
+ mSubscriptionChangedListener =
+ new OnSubscriptionsChangedListener() {
+ @Override
+ public void onSubscriptionsChanged() {
+ handleSubscriptionsChanged();
+ }
+ };
+ }
+
+ /** Registers the receivers, and starts tracking subscriptions. */
+ public void register() {
+ mContext.registerReceiver(
+ this, new IntentFilter(ACTION_CARRIER_CONFIG_CHANGED), null, mHandler);
+ mSubscriptionManager.addOnSubscriptionsChangedListener(
+ new HandlerExecutor(mHandler), mSubscriptionChangedListener);
+ }
+
+ /** Unregisters the receivers, and stops tracking subscriptions. */
+ public void unregister() {
+ mContext.unregisterReceiver(this);
+ mSubscriptionManager.removeOnSubscriptionsChangedListener(mSubscriptionChangedListener);
+ }
+
+ /**
+ * Handles subscription changes, correlating available subscriptions and loaded carrier configs
+ *
+ * <p>The subscription change listener is registered with a HandlerExecutor backed by mHandler,
+ * so callbacks & broadcasts are all serialized on mHandler, avoiding the need for locking.
+ */
+ public void handleSubscriptionsChanged() {
+ final Set<ParcelUuid> activeSubGroups = new ArraySet<>();
+ final Map<Integer, ParcelUuid> newSubIdToGroupMap = new HashMap<>();
+
+ final List<SubscriptionInfo> allSubs = mSubscriptionManager.getAllSubscriptionInfoList();
+ if (allSubs == null) {
+ return; // Telephony crashed; no way to verify subscriptions.
+ }
+
+ // If allSubs is empty, no subscriptions exist. Cache will be cleared by virtue of no active
+ // subscriptions
+ for (SubscriptionInfo subInfo : allSubs) {
+ if (subInfo.getGroupUuid() == null) {
+ continue;
+ }
+
+ // Build subId -> subGrp cache
+ newSubIdToGroupMap.put(subInfo.getSubscriptionId(), subInfo.getGroupUuid());
+
+ // Update subscription groups that are both ready, and active. For a group to be
+ // considered active, both of the following must be true:
+ //
+ // 1. A final CARRIER_CONFIG_CHANGED (where config is for an identified carrier)
+ // broadcast must have been received for the subId
+ // 2. A active subscription (is loaded into a SIM slot) must be part of the subscription
+ // group.
+ if (subInfo.getSimSlotIndex() != INVALID_SIM_SLOT_INDEX
+ && mReadySubIdsBySlotId.values().contains(subInfo.getSubscriptionId())) {
+ activeSubGroups.add(subInfo.getGroupUuid());
+ }
+ }
+
+ final TelephonySubscriptionSnapshot newSnapshot =
+ new TelephonySubscriptionSnapshot(newSubIdToGroupMap, activeSubGroups);
+
+ // If snapshot was meaningfully updated, fire the callback
+ if (!newSnapshot.equals(mCurrentSnapshot)) {
+ mCurrentSnapshot = newSnapshot;
+ mHandler.post(
+ () -> {
+ mCallback.onNewSnapshot(newSnapshot);
+ });
+ }
+ }
+
+ /**
+ * Broadcast receiver for ACTION_CARRIER_CONFIG_CHANGED
+ *
+ * <p>The broadcast receiver is registered with mHandler, so callbacks & broadcasts are all
+ * serialized on mHandler, avoiding the need for locking.
+ */
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ // Accept sticky broadcasts; if CARRIER_CONFIG_CHANGED was previously broadcast and it
+ // already was for an identified carrier, we can stop waiting for initial load to complete
+ if (!ACTION_CARRIER_CONFIG_CHANGED.equals(intent.getAction())) {
+ return;
+ }
+
+ final int subId = intent.getIntExtra(EXTRA_SUBSCRIPTION_INDEX, INVALID_SUBSCRIPTION_ID);
+ final int slotId = intent.getIntExtra(EXTRA_SLOT_INDEX, INVALID_SIM_SLOT_INDEX);
+
+ if (slotId == INVALID_SIM_SLOT_INDEX) {
+ return;
+ }
+
+ if (SubscriptionManager.isValidSubscriptionId(subId)) {
+ final PersistableBundle carrierConfigs = mCarrierConfigManager.getConfigForSubId(subId);
+ if (mDeps.isConfigForIdentifiedCarrier(carrierConfigs)) {
+ Slog.v(TAG, String.format("SubId %s ready for SlotId %s", subId, slotId));
+ mReadySubIdsBySlotId.put(slotId, subId);
+ handleSubscriptionsChanged();
+ }
+ } else {
+ Slog.v(TAG, "Slot unloaded: " + slotId);
+ mReadySubIdsBySlotId.remove(slotId);
+ handleSubscriptionsChanged();
+ }
+ }
+
+ @VisibleForTesting(visibility = Visibility.PRIVATE)
+ void setReadySubIdsBySlotId(Map<Integer, Integer> readySubIdsBySlotId) {
+ mReadySubIdsBySlotId.putAll(readySubIdsBySlotId);
+ }
+
+ @VisibleForTesting(visibility = Visibility.PRIVATE)
+ Map<Integer, Integer> getReadySubIdsBySlotId() {
+ return Collections.unmodifiableMap(mReadySubIdsBySlotId);
+ }
+
+ /** TelephonySubscriptionSnapshot is a class containing info about active subscriptions */
+ public static class TelephonySubscriptionSnapshot {
+ private final Map<Integer, ParcelUuid> mSubIdToGroupMap;
+ private final Set<ParcelUuid> mActiveGroups;
+
+ @VisibleForTesting(visibility = Visibility.PRIVATE)
+ TelephonySubscriptionSnapshot(
+ @NonNull Map<Integer, ParcelUuid> subIdToGroupMap,
+ @NonNull Set<ParcelUuid> activeGroups) {
+ mSubIdToGroupMap = Collections.unmodifiableMap(
+ Objects.requireNonNull(subIdToGroupMap, "subIdToGroupMap was null"));
+ mActiveGroups = Collections.unmodifiableSet(
+ Objects.requireNonNull(activeGroups, "activeGroups was null"));
+ }
+
+ /** Returns the active subscription groups */
+ @NonNull
+ public Set<ParcelUuid> getActiveSubscriptionGroups() {
+ return mActiveGroups;
+ }
+
+ /** Returns the Subscription Group for a given subId. */
+ @Nullable
+ public ParcelUuid getGroupForSubId(int subId) {
+ return mSubIdToGroupMap.get(subId);
+ }
+
+ /**
+ * Returns all the subIds in a given group, including available, but inactive subscriptions.
+ */
+ @NonNull
+ public Set<Integer> getAllSubIdsInGroup(ParcelUuid subGrp) {
+ final Set<Integer> subIds = new ArraySet<>();
+
+ for (Entry<Integer, ParcelUuid> entry : mSubIdToGroupMap.entrySet()) {
+ if (subGrp.equals(entry.getValue())) {
+ subIds.add(entry.getKey());
+ }
+ }
+
+ return subIds;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mSubIdToGroupMap, mActiveGroups);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof TelephonySubscriptionSnapshot)) {
+ return false;
+ }
+
+ final TelephonySubscriptionSnapshot other = (TelephonySubscriptionSnapshot) obj;
+
+ return mSubIdToGroupMap.equals(other.mSubIdToGroupMap)
+ && mActiveGroups.equals(other.mActiveGroups);
+ }
+ }
+
+ /**
+ * Interface for listening to changes in subscriptions
+ *
+ * @see TelephonySubscriptionTracker
+ */
+ public interface TelephonySubscriptionTrackerCallback {
+ /**
+ * Called when subscription information changes, and a new subscription snapshot was taken
+ *
+ * @param snapshot the snapshot of subscription information.
+ */
+ void onNewSnapshot(@NonNull TelephonySubscriptionSnapshot snapshot);
+ }
+
+ /** External static dependencies for test injection */
+ @VisibleForTesting(visibility = Visibility.PRIVATE)
+ public static class Dependencies {
+ /** Checks if the given bundle is for an identified carrier */
+ public boolean isConfigForIdentifiedCarrier(PersistableBundle bundle) {
+ return CarrierConfigManager.isConfigForIdentifiedCarrier(bundle);
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/wm/ActivityClientController.java b/services/core/java/com/android/server/wm/ActivityClientController.java
index 3826aa3..c25f1b4 100644
--- a/services/core/java/com/android/server/wm/ActivityClientController.java
+++ b/services/core/java/com/android/server/wm/ActivityClientController.java
@@ -41,7 +41,6 @@
import android.annotation.NonNull;
import android.app.Activity;
import android.app.ActivityManager;
-import android.app.ActivityOptions;
import android.app.ActivityTaskManager;
import android.app.IActivityClientController;
import android.app.PictureInPictureParams;
@@ -170,7 +169,7 @@
final ActivityRecord r;
synchronized (mGlobalLock) {
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "activityStopped");
- r = ActivityRecord.isInStackLocked(token);
+ r = ActivityRecord.isInRootTaskLocked(token);
if (r != null) {
if (r.attachedToProcess() && r.isState(Task.ActivityState.RESTARTING_PROCESS)) {
// The activity was requested to restart from
@@ -232,7 +231,7 @@
token, Arrays.toString(horizontalSizeConfiguration),
Arrays.toString(verticalSizeConfigurations));
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r != null) {
r.setSizeConfigurations(horizontalSizeConfiguration, verticalSizeConfigurations,
smallestSizeConfigurations);
@@ -268,7 +267,7 @@
final int taskId = ActivityRecord.getTaskForActivityLocked(token, !nonRoot);
final Task task = mService.mRootWindowContainer.anyTaskForId(taskId);
if (task != null) {
- return ActivityRecord.getStackLocked(token).moveTaskToBack(task);
+ return ActivityRecord.getRootTask(token).moveTaskToBack(task);
}
}
} finally {
@@ -293,7 +292,7 @@
Intent resultData) {
final ActivityRecord r;
synchronized (mGlobalLock) {
- r = ActivityRecord.isInStackLocked(token);
+ r = ActivityRecord.isInRootTaskLocked(token);
if (r == null) {
return false;
}
@@ -314,7 +313,7 @@
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r == null || !r.isDestroyable()) {
return false;
}
@@ -345,7 +344,7 @@
final ActivityRecord r;
synchronized (mGlobalLock) {
- r = ActivityRecord.isInStackLocked(token);
+ r = ActivityRecord.isInRootTaskLocked(token);
if (r == null) {
return true;
}
@@ -440,7 +439,7 @@
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r == null) {
return false;
}
@@ -466,7 +465,7 @@
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r == null) return;
// TODO: This should probably only loop over the task since you need to be in the
@@ -485,7 +484,7 @@
@Override
public boolean isTopOfTask(IBinder token) {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
return r != null && r.getTask().getTopNonFinishingActivity() == r;
}
}
@@ -493,7 +492,7 @@
@Override
public boolean willActivityBeVisible(IBinder token) {
synchronized (mGlobalLock) {
- final Task rootTask = ActivityRecord.getStackLocked(token);
+ final Task rootTask = ActivityRecord.getRootTask(token);
return rootTask != null && rootTask.willActivityBeVisible(token);
}
}
@@ -501,7 +500,7 @@
@Override
public int getDisplayId(IBinder activityToken) {
synchronized (mGlobalLock) {
- final Task rootTask = ActivityRecord.getStackLocked(activityToken);
+ final Task rootTask = ActivityRecord.getRootTask(activityToken);
if (rootTask != null) {
final int displayId = rootTask.getDisplayId();
return displayId != INVALID_DISPLAY ? displayId : DEFAULT_DISPLAY;
@@ -534,7 +533,7 @@
}
private static ActivityRecord getCallingRecord(IBinder token) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
return r != null ? r.resultTo : null;
}
@@ -555,28 +554,11 @@
}
@Override
- public Bundle getActivityOptions(IBinder token) {
- final long origId = Binder.clearCallingIdentity();
- try {
- synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
- if (r == null) {
- return null;
- }
- final ActivityOptions activityOptions = r.takeOptionsLocked(true /* fromClient */);
- return activityOptions != null ? activityOptions.toBundle() : null;
- }
- } finally {
- Binder.restoreCallingIdentity(origId);
- }
- }
-
- @Override
public void setRequestedOrientation(IBinder token, int requestedOrientation) {
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r != null) {
r.setRequestedOrientation(requestedOrientation);
}
@@ -589,7 +571,7 @@
@Override
public int getRequestedOrientation(IBinder token) {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
return r != null
? r.getRequestedOrientation() : ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
}
@@ -600,7 +582,7 @@
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
return r != null && r.setOccludesParent(true);
}
} finally {
@@ -614,7 +596,7 @@
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r == null) {
return false;
}
@@ -632,7 +614,7 @@
@Override
public boolean isImmersive(IBinder token) {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r == null) {
throw new IllegalArgumentException();
}
@@ -643,7 +625,7 @@
@Override
public void setImmersive(IBinder token, boolean immersive) {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r == null) {
throw new IllegalArgumentException();
}
@@ -839,7 +821,7 @@
@Override
public void setTaskDescription(IBinder token, ActivityManager.TaskDescription td) {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r != null) {
r.setTaskDescription(td);
}
@@ -876,7 +858,7 @@
@Override
public boolean isRootVoiceInteraction(IBinder token) {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
return r != null && r.rootVoiceInteraction;
}
}
@@ -917,7 +899,7 @@
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r != null) {
r.setShowWhenLocked(showWhenLocked);
}
@@ -932,7 +914,7 @@
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r != null) {
r.setInheritShowWhenLocked(inheritShowWhenLocked);
}
@@ -947,7 +929,7 @@
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r != null) {
r.setTurnScreenOn(turnScreenOn);
}
@@ -962,7 +944,7 @@
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r != null) {
r.reportFullyDrawnLocked(restoredFromBundle);
}
@@ -977,7 +959,7 @@
int enterAnim, int exitAnim) {
final long origId = Binder.clearCallingIdentity();
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r != null && r.isState(Task.ActivityState.RESUMED, Task.ActivityState.PAUSING)) {
r.mDisplayContent.mAppTransition.overridePendingAppTransition(
packageName, enterAnim, exitAnim, null, null);
@@ -993,7 +975,7 @@
final VrManagerInternal vrService = LocalServices.getService(VrManagerInternal.class);
final ActivityRecord r;
synchronized (mGlobalLock) {
- r = ActivityRecord.isInStackLocked(token);
+ r = ActivityRecord.isInRootTaskLocked(token);
}
if (r == null) {
throw new IllegalArgumentException();
@@ -1026,7 +1008,7 @@
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r != null) {
r.setDisablePreviewScreenshots(disable);
}
@@ -1044,7 +1026,7 @@
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r != null) {
r.registerRemoteAnimations(definition);
}
@@ -1061,7 +1043,7 @@
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r != null) {
r.unregisterRemoteAnimations();
}
@@ -1076,7 +1058,7 @@
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r == null) {
return;
}
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 3390d67..1653896 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -284,6 +284,7 @@
import android.view.IAppTransitionAnimationSpecsFuture;
import android.view.IApplicationToken;
import android.view.InputApplicationHandle;
+import android.view.RemoteAnimationAdapter;
import android.view.RemoteAnimationDefinition;
import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
@@ -462,7 +463,10 @@
HashSet<WeakReference<PendingIntentRecord>> pendingResults; // all pending intents for this act
ArrayList<ReferrerIntent> newIntents; // any pending new intents for single-top mode
Intent mLastNewIntent; // the last new intent we delivered to client
- ActivityOptions pendingOptions; // most recently given options
+ /** The most recently given options. */
+ private ActivityOptions mPendingOptions;
+ /** Non-null if {@link #mPendingOptions} specifies the remote animation. */
+ private RemoteAnimationAdapter mPendingRemoteAnimation;
ActivityOptions returningOptions; // options that are coming back via convertToTranslucent
AppTimeTracker appTimeTracker; // set if we are tracking the time in this app/task/activity
ActivityServiceConnectionsHolder mServiceConnectionsHolder; // Service connections.
@@ -882,8 +886,13 @@
}
}
}
- if (pendingOptions != null) {
- pw.print(prefix); pw.print("pendingOptions="); pw.println(pendingOptions);
+ if (mPendingOptions != null) {
+ pw.print(prefix); pw.print("pendingOptions="); pw.println(mPendingOptions);
+ }
+ if (mPendingRemoteAnimation != null) {
+ pw.print(prefix);
+ pw.print("pendingRemoteAnimationCallingPid=");
+ pw.println(mPendingRemoteAnimation.getCallingPid());
}
if (appTimeTracker != null) {
appTimeTracker.dumpWithHeader(pw, prefix, false);
@@ -1217,10 +1226,6 @@
return task;
}
- Task getStack() {
- return task != null ? task.getRootTask() : null;
- }
-
@Override
void onParentChanged(ConfigurationContainer newParent, ConfigurationContainer oldParent) {
final Task oldTask = oldParent != null ? (Task) oldParent : null;
@@ -1268,14 +1273,14 @@
} else if (mLastParent != null && mLastParent.getRootTask() != null) {
task.getRootTask().mExitingActivities.remove(this);
}
- final Task stack = getStack();
+ final Task rootTask = getRootTask();
// If we reparent, make sure to remove ourselves from the old animation registry.
if (mAnimatingActivityRegistry != null) {
mAnimatingActivityRegistry.notifyFinished(this);
}
- mAnimatingActivityRegistry = stack != null
- ? stack.getAnimatingActivityRegistry()
+ mAnimatingActivityRegistry = rootTask != null
+ ? rootTask.getAnimatingActivityRegistry()
: null;
mLastParent = task;
@@ -1289,10 +1294,10 @@
newTask.setResumedActivity(this, "onParentChanged");
}
- if (stack != null && stack.topRunningActivity() == this) {
+ if (rootTask != null && rootTask.topRunningActivity() == this) {
// make ensure the TaskOrganizer still works after re-parenting
if (firstWindowDrawn) {
- stack.setHasBeenVisible(true);
+ rootTask.setHasBeenVisible(true);
}
}
}
@@ -1637,8 +1642,8 @@
lockTaskLaunchMode = getLockTaskLaunchMode(aInfo, options);
if (options != null) {
- pendingOptions = options;
- final PendingIntent usageReport = pendingOptions.getUsageTimeReport();
+ setOptions(options);
+ final PendingIntent usageReport = options.getUsageTimeReport();
if (usageReport != null) {
appTimeTracker = new AppTimeTracker(usageReport);
}
@@ -2210,7 +2215,7 @@
if (task != null && !finishing) {
task = null;
}
- clearOptionsLocked();
+ abortAndClearOptionsAnimation();
}
}
@@ -2218,9 +2223,9 @@
return inHistory;
}
- boolean isInStackLocked() {
- final Task stack = getRootTask();
- return stack != null && stack.isInTask(this) != null;
+ boolean isInRootTaskLocked() {
+ final Task rootTask = getRootTask();
+ return rootTask != null && rootTask.isInTask(this) != null;
}
boolean isPersistable() {
@@ -2552,14 +2557,14 @@
return FINISH_RESULT_CANCELLED;
}
- if (!isInStackLocked()) {
+ if (!isInRootTaskLocked()) {
Slog.w(TAG, "Finish request when not in stack for r=" + this);
return FINISH_RESULT_CANCELLED;
}
final Task rootTask = getRootTask();
final boolean mayAdjustTop = (isState(RESUMED) || rootTask.getResumedActivity() == null)
- && rootTask.isFocusedStackOnDisplay()
+ && rootTask.isFocusedRootTaskOnDisplay()
// Do not adjust focus task because the task will be reused to launch new activity.
&& !task.isClearingToReuseTask();
final boolean shouldAdjustGlobalFocus = mayAdjustTop
@@ -2722,8 +2727,8 @@
final boolean isCurrentVisible = mVisibleRequested || isState(PAUSED);
if (isCurrentVisible) {
- final Task stack = getStack();
- final ActivityRecord activity = stack.getResumedActivity();
+ final Task rootTask = getRootTask();
+ final ActivityRecord activity = rootTask.getResumedActivity();
boolean ensureVisibility = false;
if (activity != null && !activity.occludesParent()) {
// If the resume activity is not opaque, we need to make sure the visibilities of
@@ -2813,7 +2818,7 @@
// DisplayContent#topRunningActivity().
final ActivityRecord next = taskDisplayArea.topRunningActivity();
final boolean isLastStackOverEmptyHome =
- next == null && stack.isFocusedStackOnDisplay()
+ next == null && stack.isFocusedRootTaskOnDisplay()
&& taskDisplayArea.getOrCreateRootHomeTask() != null;
if (isLastStackOverEmptyHome) {
// Don't destroy activity immediately if this is the last activity on the display and
@@ -2997,7 +3002,7 @@
}
finishing = true;
if (stopped) {
- clearOptionsLocked();
+ abortAndClearOptionsAnimation();
}
mAtmService.getTransitionController().requestTransitionIfNeeded(TRANSIT_CLOSE, this);
}
@@ -3016,7 +3021,7 @@
"Reported destroyed for activity that is not destroying: r=" + this);
}
- if (isInStackLocked()) {
+ if (isInRootTaskLocked()) {
cleanUp(true /* cleanServices */, false /* setState */);
removeFromHistory(reason);
}
@@ -3312,21 +3317,21 @@
getDisplayContent().mNoAnimationNotifyOnTransitionFinished.add(token);
}
- final Task stack = getStack();
+ final Task rootTask = getRootTask();
if (delayed && !isEmpty()) {
// set the token aside because it has an active animation to be finished
ProtoLog.v(WM_DEBUG_ADD_REMOVE,
"removeAppToken make exiting: %s", this);
- if (stack != null) {
- stack.mExitingActivities.add(this);
+ if (rootTask != null) {
+ rootTask.mExitingActivities.add(this);
}
mIsExiting = true;
} else {
// Make sure there is no animation running on this token, so any windows associated
// with it will be removed as soon as their animations are complete
cancelAnimation();
- if (stack != null) {
- stack.mExitingActivities.remove(this);
+ if (rootTask != null) {
+ rootTask.mExitingActivities.remove(this);
}
removeIfPossible();
}
@@ -3865,33 +3870,47 @@
void updateOptionsLocked(ActivityOptions options) {
if (options != null) {
if (DEBUG_TRANSITION) Slog.i(TAG, "Update options for " + this);
- if (pendingOptions != null) {
- pendingOptions.abort();
+ if (mPendingOptions != null) {
+ mPendingOptions.abort();
}
- pendingOptions = options;
+ setOptions(options);
}
}
- void applyOptionsLocked() {
- if (pendingOptions != null
- && pendingOptions.getAnimationType() != ANIM_SCENE_TRANSITION) {
- if (DEBUG_TRANSITION) Slog.i(TAG, "Applying options for " + this);
- applyOptionsLocked(pendingOptions, intent);
- if (task == null) {
- clearOptionsLocked(false /* withAbort */);
- } else {
- // This will clear the options for all the ActivityRecords for this Task.
- task.forAllActivities((r) -> {
- r.clearOptionsLocked(false /* withAbort */);
- });
+ private void setOptions(@NonNull ActivityOptions options) {
+ mPendingOptions = options;
+ if (options.getAnimationType() == ANIM_REMOTE_ANIMATION) {
+ mPendingRemoteAnimation = options.getRemoteAnimationAdapter();
+ }
+ }
+
+ void applyOptionsAnimation() {
+ if (DEBUG_TRANSITION) Slog.i(TAG, "Applying options for " + this);
+ if (mPendingRemoteAnimation != null) {
+ mDisplayContent.mAppTransition.overridePendingAppTransitionRemote(
+ mPendingRemoteAnimation);
+ } else {
+ if (mPendingOptions == null
+ || mPendingOptions.getAnimationType() == ANIM_SCENE_TRANSITION) {
+ // Scene transition will run on the client side.
+ return;
}
+ applyOptionsAnimation(mPendingOptions, intent);
+ }
+ if (task == null) {
+ clearOptionsAnimation();
+ } else {
+ // This will clear the options for all the ActivityRecords for this Task.
+ task.forAllActivities((r) -> {
+ r.clearOptionsAnimation();
+ });
}
}
/**
* Apply override app transition base on options & animation type.
*/
- void applyOptionsLocked(ActivityOptions pendingOptions, Intent intent) {
+ private void applyOptionsAnimation(ActivityOptions pendingOptions, Intent intent) {
final int animationType = pendingOptions.getAnimationType();
final DisplayContent displayContent = getDisplayContent();
switch (animationType) {
@@ -3973,10 +3992,6 @@
displayContent.mAppTransition
.overridePendingAppTransitionStartCrossProfileApps();
break;
- case ANIM_REMOTE_ANIMATION:
- displayContent.mAppTransition.overridePendingAppTransitionRemote(
- pendingOptions.getRemoteAnimationAdapter());
- break;
case ANIM_NONE:
case ANIM_UNDEFINED:
break;
@@ -4037,35 +4052,32 @@
}
}
- void clearOptionsLocked() {
- clearOptionsLocked(true /* withAbort */);
- }
-
- void clearOptionsLocked(boolean withAbort) {
- if (withAbort && pendingOptions != null) {
- pendingOptions.abort();
+ void abortAndClearOptionsAnimation() {
+ if (mPendingOptions != null) {
+ mPendingOptions.abort();
}
- pendingOptions = null;
+ clearOptionsAnimation();
}
- ActivityOptions takeOptionsLocked(boolean fromClient) {
+ void clearOptionsAnimation() {
+ mPendingOptions = null;
+ mPendingRemoteAnimation = null;
+ }
+
+ ActivityOptions getOptions() {
+ return mPendingOptions;
+ }
+
+ ActivityOptions takeOptions() {
if (DEBUG_TRANSITION) Slog.i(TAG, "Taking options for " + this + " callers="
+ Debug.getCallers(6));
- ActivityOptions opts = pendingOptions;
-
- // If we are trying to take activity options from the client, do not null it out if it's a
- // remote animation as the client doesn't need it ever. This is a workaround when client is
- // faster to take the options than we are to resume the next activity.
- // TODO (b/132432864): Fix the root cause of these transition preparing/applying options
- // timing somehow
- if (!fromClient || opts == null || opts.getRemoteAnimationAdapter() == null) {
- pendingOptions = null;
- }
+ final ActivityOptions opts = mPendingOptions;
+ mPendingOptions = null;
return opts;
}
boolean allowMoveToFront() {
- return pendingOptions == null || !pendingOptions.getAvoidMoveToFront();
+ return mPendingOptions == null || !mPendingOptions.getAvoidMoveToFront();
}
void removeUriPermissionsLocked() {
@@ -4887,7 +4899,7 @@
try {
mAtmService.getLifecycleManager().scheduleTransaction(app.getThread(), appToken,
- StartActivityItem.obtain());
+ StartActivityItem.obtain(takeOptions()));
} catch (Exception e) {
Slog.w(TAG, "Exception thrown sending start: " + intent.getComponent(), e);
}
@@ -5208,7 +5220,7 @@
notifyAppStopped();
if (finishing) {
- clearOptionsLocked();
+ abortAndClearOptionsAnimation();
} else {
if (deferRelaunchUntilPaused) {
destroyImmediately("stop-config");
@@ -5765,13 +5777,13 @@
return task.mTaskId;
}
- static ActivityRecord isInStackLocked(IBinder token) {
+ static ActivityRecord isInRootTaskLocked(IBinder token) {
final ActivityRecord r = ActivityRecord.forTokenLocked(token);
return (r != null) ? r.getRootTask().isInTask(r) : null;
}
- static Task getStackLocked(IBinder token) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ static Task getRootTask(IBinder token) {
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r != null) {
return r.getRootTask();
}
@@ -5842,8 +5854,8 @@
// We don't show starting window for overlay activities.
return;
}
- if (pendingOptions != null
- && pendingOptions.getAnimationType() == ActivityOptions.ANIM_SCENE_TRANSITION) {
+ if (mPendingOptions != null
+ && mPendingOptions.getAnimationType() == ActivityOptions.ANIM_SCENE_TRANSITION) {
// Don't show starting window when using shared element transition.
return;
}
@@ -6034,7 +6046,7 @@
// a new hierarchical animation is enabled, we just let them occur as a child of the parent
// stack, i.e. the hierarchy of the surfaces is unchanged.
if (inPinnedWindowingMode()) {
- return getStack().getSurfaceControl();
+ return getRootTask().getSurfaceControl();
} else {
return super.getAnimationLeashParent();
}
@@ -6114,12 +6126,12 @@
getTransit(), task)) {
task.getBounds(mTmpRect);
} else {
- final Task stack = getStack();
- if (stack == null) {
+ final Task rootTask = getRootTask();
+ if (rootTask == null) {
return;
}
// Set clip rect to stack bounds.
- stack.getBounds(mTmpRect);
+ rootTask.getBounds(mTmpRect);
}
mAnimationBoundsLayer = createAnimationBoundsLayer(t);
@@ -6860,9 +6872,9 @@
@VisibleForTesting
@Override
Rect getAnimationBounds(int appStackClipMode) {
- if (appStackClipMode == STACK_CLIP_BEFORE_ANIM && getStack() != null) {
+ if (appStackClipMode == STACK_CLIP_BEFORE_ANIM && getRootTask() != null) {
// Using the stack bounds here effectively applies the clipping before animation.
- return getStack().getBounds();
+ return getRootTask().getBounds();
}
// Use task-bounds if available so that activity-level letterbox (maxAspectRatio) is
// included in the animation.
diff --git a/services/core/java/com/android/server/wm/ActivityStartController.java b/services/core/java/com/android/server/wm/ActivityStartController.java
index f9e85cd..2dd8c59 100644
--- a/services/core/java/com/android/server/wm/ActivityStartController.java
+++ b/services/core/java/com/android/server/wm/ActivityStartController.java
@@ -528,7 +528,7 @@
"pendingActivityLaunch");
try {
starter.startResolvedActivity(pal.r, pal.sourceRecord, null, null, pal.startFlags,
- resume, pal.r.pendingOptions, null, pal.intentGrants);
+ resume, pal.r.getOptions(), null, pal.intentGrants);
} catch (Exception e) {
Slog.e(TAG, "Exception during pending activity launch pal=" + pal, e);
pal.sendErrorResult(e.getMessage());
diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java
index 1b0bec5..5289f86 100644
--- a/services/core/java/com/android/server/wm/ActivityStarter.java
+++ b/services/core/java/com/android/server/wm/ActivityStarter.java
@@ -180,8 +180,8 @@
private ActivityInfo mNewTaskInfo;
private Intent mNewTaskIntent;
- private Task mSourceStack;
- private Task mTargetStack;
+ private Task mSourceRootTask;
+ private Task mTargetRootTask;
// The task that the last activity was started into. We currently reset the actual start
// activity's task and as a result may not have a reference to the task in all cases
private Task mTargetTask;
@@ -279,6 +279,9 @@
ActivityStarter starter = mStarterPool.acquire();
if (starter == null) {
+ if (mService.mRootWindowContainer == null) {
+ throw new IllegalStateException("Too early to start activity.");
+ }
starter = new ActivityStarter(mController, mService, mSupervisor, mInterceptor);
}
@@ -572,10 +575,10 @@
mNewTaskInfo = starter.mNewTaskInfo;
mNewTaskIntent = starter.mNewTaskIntent;
- mSourceStack = starter.mSourceStack;
+ mSourceRootTask = starter.mSourceRootTask;
mTargetTask = starter.mTargetTask;
- mTargetStack = starter.mTargetStack;
+ mTargetRootTask = starter.mTargetRootTask;
mMovedToFront = starter.mMovedToFront;
mNoAnimation = starter.mNoAnimation;
mKeepCurTransition = starter.mKeepCurTransition;
@@ -920,7 +923,7 @@
return ActivityManager.START_FORWARD_AND_REQUEST_CONFLICT;
}
resultRecord = sourceRecord.resultTo;
- if (resultRecord != null && !resultRecord.isInStackLocked()) {
+ if (resultRecord != null && !resultRecord.isInRootTaskLocked()) {
resultRecord = null;
}
resultWho = sourceRecord.resultWho;
@@ -1255,7 +1258,7 @@
}
// We pretend to the caller that it was really started to make it backward compatible, but
// they will just get a cancel result.
- ActivityOptions.abort(r.pendingOptions);
+ ActivityOptions.abort(r.getOptions());
return true;
}
@@ -1636,7 +1639,7 @@
*/
private @Nullable Task handleStartResult(@NonNull ActivityRecord started, int result) {
final Task currentStack = started.getRootTask();
- Task startedActivityStack = currentStack != null ? currentStack : mTargetStack;
+ Task startedActivityStack = currentStack != null ? currentStack : mTargetRootTask;
if (ActivityManager.isStartResultSuccessful(result)) {
if (startedActivityStack != null) {
@@ -1690,7 +1693,7 @@
computeLaunchingTaskFlags();
- computeSourceStack();
+ computeSourceRootTask();
mIntent.setFlags(mLaunchFlags);
@@ -1739,8 +1742,8 @@
}
}
- if (mTargetStack == null) {
- mTargetStack = getLaunchStack(mStartActivity, mLaunchFlags, targetTask, mOptions);
+ if (mTargetRootTask == null) {
+ mTargetRootTask = getLaunchRootTask(mStartActivity, mLaunchFlags, targetTask, mOptions);
}
if (newTask) {
final Task taskToAffiliate = (mLaunchTaskBehind && mSourceRecord != null)
@@ -1751,13 +1754,13 @@
}
if (!mAvoidMoveToFront && mDoResume) {
- mTargetStack.getRootTask().moveToFront("reuseOrNewTask", targetTask);
+ mTargetRootTask.getRootTask().moveToFront("reuseOrNewTask", targetTask);
if (mOptions != null) {
if (mOptions.getTaskAlwaysOnTop()) {
- mTargetStack.setAlwaysOnTop(true);
+ mTargetRootTask.setAlwaysOnTop(true);
}
}
- if (!mTargetStack.isTopStackInDisplayArea() && mService.mInternal.isDreaming()) {
+ if (!mTargetRootTask.isTopRootTaskInDisplayArea() && mService.mInternal.isDreaming()) {
// Launching underneath dream activity (fullscreen, always-on-top). Run the launch-
// -behind transition so the Activity gets created and starts in visible state.
mLaunchTaskBehind = true;
@@ -1785,18 +1788,18 @@
mStartActivity.logStartActivity(
EventLogTags.WM_CREATE_ACTIVITY, mStartActivity.getTask());
- mTargetStack.mLastPausedActivity = null;
+ mTargetRootTask.mLastPausedActivity = null;
mRootWindowContainer.startPowerModeLaunchIfNeeded(
false /* forceSend */, mStartActivity);
- mTargetStack.startActivityLocked(mStartActivity,
+ mTargetRootTask.startActivityLocked(mStartActivity,
topStack != null ? topStack.getTopNonFinishingActivity() : null, newTask,
mKeepCurTransition, mOptions);
if (mDoResume) {
final ActivityRecord topTaskActivity =
mStartActivity.getTask().topRunningActivityLocked();
- if (!mTargetStack.isTopActivityFocusable()
+ if (!mTargetRootTask.isTopActivityFocusable()
|| (topTaskActivity != null && topTaskActivity.isTaskOverlay()
&& mStartActivity != topTaskActivity)) {
// If the activity is not focusable, we can't resume it, but still would like to
@@ -1807,31 +1810,31 @@
// over is removed.
// Passing {@code null} as the start parameter ensures all activities are made
// visible.
- mTargetStack.ensureActivitiesVisible(null /* starting */,
+ mTargetRootTask.ensureActivitiesVisible(null /* starting */,
0 /* configChanges */, !PRESERVE_WINDOWS);
// Go ahead and tell window manager to execute app transition for this activity
// since the app transition will not be triggered through the resume channel.
- mTargetStack.mDisplayContent.executeAppTransition();
+ mTargetRootTask.mDisplayContent.executeAppTransition();
} else {
// If the target stack was not previously focusable (previous top running activity
// on that stack was not visible) then any prior calls to move the stack to the
// will not update the focused stack. If starting the new activity now allows the
// task stack to be focusable, then ensure that we now update the focused stack
// accordingly.
- if (mTargetStack.isTopActivityFocusable()
- && !mRootWindowContainer.isTopDisplayFocusedRootTask(mTargetStack)) {
- mTargetStack.moveToFront("startActivityInner");
+ if (mTargetRootTask.isTopActivityFocusable()
+ && !mRootWindowContainer.isTopDisplayFocusedRootTask(mTargetRootTask)) {
+ mTargetRootTask.moveToFront("startActivityInner");
}
mRootWindowContainer.resumeFocusedTasksTopActivities(
- mTargetStack, mStartActivity, mOptions);
+ mTargetRootTask, mStartActivity, mOptions);
}
}
- mRootWindowContainer.updateUserRootTask(mStartActivity.mUserId, mTargetStack);
+ mRootWindowContainer.updateUserRootTask(mStartActivity.mUserId, mTargetRootTask);
// Update the recent tasks list immediately when the activity starts
mSupervisor.mRecentTasks.add(mStartActivity.getTask());
mSupervisor.handleNonResizableTaskIfNeeded(mStartActivity.getTask(),
- mPreferredWindowingMode, mPreferredTaskDisplayArea, mTargetStack);
+ mPreferredWindowingMode, mPreferredTaskDisplayArea, mTargetRootTask);
return START_SUCCESS;
}
@@ -1846,7 +1849,7 @@
} else if (mInTask != null) {
return mInTask;
} else {
- final Task stack = getLaunchStack(mStartActivity, mLaunchFlags, null /* task */,
+ final Task stack = getLaunchRootTask(mStartActivity, mLaunchFlags, null /* task */,
mOptions);
final ActivityRecord top = stack.getTopNonFinishingActivity();
if (top != null) {
@@ -1861,7 +1864,7 @@
private void computeLaunchParams(ActivityRecord r, ActivityRecord sourceRecord,
Task targetTask) {
- final Task sourceStack = mSourceStack != null ? mSourceStack
+ final Task sourceStack = mSourceRootTask != null ? mSourceRootTask
: mRootWindowContainer.getTopDisplayFocusedRootTask();
if (sourceStack != null && sourceStack.inSplitScreenWindowingMode()
&& (mOptions == null
@@ -1959,7 +1962,7 @@
// Should not recycle task which is from a different user, just adding the starting
// activity to the task.
if (targetTask.mUserId != mStartActivity.mUserId) {
- mTargetStack = targetTask.getRootTask();
+ mTargetRootTask = targetTask.getRootTask();
mAddingToTask = true;
return START_SUCCESS;
}
@@ -1984,7 +1987,7 @@
mRootWindowContainer.startPowerModeLaunchIfNeeded(false /* forceSend */,
targetTaskTop);
- setTargetStackIfNeeded(targetTaskTop);
+ setTargetRootTaskIfNeeded(targetTaskTop);
// When there is a reused activity and the current result is a trampoline activity,
// set the reused activity as the result.
@@ -1998,11 +2001,11 @@
// if that is the case, so this is it! And for paranoia, make sure we have
// correctly resumed the top activity.
if (!mMovedToFront && mDoResume) {
- ProtoLog.d(WM_DEBUG_TASKS, "Bring to front target: %s from %s", mTargetStack,
+ ProtoLog.d(WM_DEBUG_TASKS, "Bring to front target: %s from %s", mTargetRootTask,
targetTaskTop);
- mTargetStack.moveToFront("intentActivityFound");
+ mTargetRootTask.moveToFront("intentActivityFound");
}
- resumeTargetStackIfNeeded();
+ resumeTargetRootTaskIfNeeded();
return START_RETURN_INTENT_TO_CALLER;
}
@@ -2025,11 +2028,11 @@
true /* taskSwitch */);
} else if (mDoResume) {
// Make sure the stack and its belonging display are moved to topmost.
- mTargetStack.moveToFront("intentActivityFound");
+ mTargetRootTask.moveToFront("intentActivityFound");
}
// We didn't do anything... but it was needed (a.k.a., client don't use that intent!)
// And for paranoia, make sure we have correctly resumed the top activity.
- resumeTargetStackIfNeeded();
+ resumeTargetRootTaskIfNeeded();
// The reusedActivity could be finishing, for example of starting an activity with
// FLAG_ACTIVITY_CLEAR_TOP flag. In that case, return the top running activity in the
// task instead.
@@ -2097,7 +2100,7 @@
final boolean resetTask =
reusedActivity != null && (mLaunchFlags & FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) != 0;
if (resetTask) {
- targetTaskTop = mTargetStack.resetTaskIfNeeded(targetTaskTop, mStartActivity);
+ targetTaskTop = mTargetRootTask.resetTaskIfNeeded(targetTaskTop, mStartActivity);
}
if ((mLaunchFlags & (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK))
@@ -2143,9 +2146,9 @@
if (targetTask.getRootTask() == null) {
// Target stack got cleared when we all activities were removed above.
// Go ahead and reset it.
- mTargetStack =
- getLaunchStack(mStartActivity, mLaunchFlags, null /* task */, mOptions);
- mTargetStack.addChild(targetTask, !mLaunchTaskBehind /* toTop */,
+ mTargetRootTask = getLaunchRootTask(mStartActivity, mLaunchFlags,
+ null /* task */, mOptions);
+ mTargetRootTask.addChild(targetTask, !mLaunchTaskBehind /* toTop */,
(mStartActivity.info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0);
}
}
@@ -2161,7 +2164,7 @@
task.moveActivityToFrontLocked(act);
act.updateOptionsLocked(mOptions);
deliverNewIntent(act, intentGrants);
- mTargetStack.mLastPausedActivity = null;
+ mTargetRootTask.mLastPausedActivity = null;
} else {
mAddingToTask = true;
}
@@ -2234,9 +2237,9 @@
mNewTaskInfo = null;
mNewTaskIntent = null;
- mSourceStack = null;
+ mSourceRootTask = null;
- mTargetStack = null;
+ mTargetRootTask = null;
mTargetTask = null;
mMovedToFront = false;
mNoAnimation = false;
@@ -2478,13 +2481,13 @@
}
}
- private void computeSourceStack() {
+ private void computeSourceRootTask() {
if (mSourceRecord == null) {
- mSourceStack = null;
+ mSourceRootTask = null;
return;
}
if (!mSourceRecord.finishing) {
- mSourceStack = mSourceRecord.getRootTask();
+ mSourceRootTask = mSourceRecord.getRootTask();
return;
}
@@ -2506,7 +2509,7 @@
mNewTaskIntent = sourceTask != null ? sourceTask.intent : null;
}
mSourceRecord = null;
- mSourceStack = null;
+ mSourceRootTask = null;
}
/**
@@ -2570,17 +2573,17 @@
* @param intentActivity Existing matching activity.
* @return {@link ActivityRecord} brought to front.
*/
- private void setTargetStackIfNeeded(ActivityRecord intentActivity) {
- mTargetStack = intentActivity.getRootTask();
- mTargetStack.mLastPausedActivity = null;
+ private void setTargetRootTaskIfNeeded(ActivityRecord intentActivity) {
+ mTargetRootTask = intentActivity.getRootTask();
+ mTargetRootTask.mLastPausedActivity = null;
Task intentTask = intentActivity.getTask();
// If the target task is not in the front, then we need to bring it to the front...
// except... well, with SINGLE_TASK_LAUNCH it's not entirely clear. We'd like to have
// the same behavior as if a new instance was being started, which means not bringing it
// to the front if the caller is not itself in the front.
final boolean differentTopTask;
- if (mTargetStack.getDisplayArea() == mPreferredTaskDisplayArea) {
- final Task focusStack = mTargetStack.mDisplayContent.getFocusedRootTask();
+ if (mTargetRootTask.getDisplayArea() == mPreferredTaskDisplayArea) {
+ final Task focusStack = mTargetRootTask.mDisplayContent.getFocusedRootTask();
final ActivityRecord curTop = (focusStack == null)
? null : focusStack.topRunningNonDelayedActivityLocked(mNotTop);
final Task topTask = curTop != null ? curTop.getTask() : null;
@@ -2593,41 +2596,41 @@
if (differentTopTask && !mAvoidMoveToFront) {
mStartActivity.intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
- if (mSourceRecord == null || (mSourceStack.getTopNonFinishingActivity() != null &&
- mSourceStack.getTopNonFinishingActivity().getTask()
+ if (mSourceRecord == null || (mSourceRootTask.getTopNonFinishingActivity() != null
+ && mSourceRootTask.getTopNonFinishingActivity().getTask()
== mSourceRecord.getTask())) {
// We really do want to push this one into the user's face, right now.
if (mLaunchTaskBehind && mSourceRecord != null) {
intentActivity.setTaskToAffiliateWith(mSourceRecord.getTask());
}
- final Task launchStack = getLaunchStack(mStartActivity, mLaunchFlags, intentTask,
- mOptions);
- if (launchStack == null || launchStack == mTargetStack) {
- // Do not set mMovedToFront to true below for split-screen-top stack, or
- // START_TASK_TO_FRONT will be returned and trigger unexpected animations when a
- // new intent has delivered.
- final boolean isSplitScreenTopStack = mTargetStack.isTopSplitScreenStack();
-
+ final Task launchRootTask = getLaunchRootTask(mStartActivity, mLaunchFlags,
+ intentTask, mOptions);
+ if (launchRootTask == null || launchRootTask == mTargetRootTask) {
// TODO(b/151572268): Figure out a better way to move tasks in above 2-levels
// tasks hierarchies.
- if (mTargetStack != intentTask
- && mTargetStack != intentTask.getParent().asTask()) {
+ if (mTargetRootTask != intentTask
+ && mTargetRootTask != intentTask.getParent().asTask()) {
intentTask.getParent().positionChildAt(POSITION_TOP, intentTask,
false /* includingParents */);
intentTask = intentTask.getParent().asTask();
}
+ // If the task is in multi-windowing mode, the activity may already be on
+ // the top (visible to user but not the global top), then the result code
+ // should be START_DELIVERED_TO_TOP instead of START_TASK_TO_FRONT.
+ final boolean wasTopOfVisibleRootTask = intentActivity.mVisibleRequested
+ && intentActivity == mTargetRootTask.topRunningActivity();
// We only want to move to the front, if we aren't going to launch on a
// different stack. If we launch on a different stack, we will put the
// task on top there.
// Defer resuming the top activity while moving task to top, since the
// current task-top activity may not be the activity that should be resumed.
- mTargetStack.moveTaskToFront(intentTask, mNoAnimation, mOptions,
+ mTargetRootTask.moveTaskToFront(intentTask, mNoAnimation, mOptions,
mStartActivity.appTimeTracker, DEFER_RESUME,
"bringingFoundTaskToFront");
- mMovedToFront = !isSplitScreenTopStack;
+ mMovedToFront = !wasTopOfVisibleRootTask;
} else {
- intentTask.reparent(launchStack, ON_TOP, REPARENT_MOVE_ROOT_TASK_TO_FRONT,
+ intentTask.reparent(launchRootTask, ON_TOP, REPARENT_MOVE_ROOT_TASK_TO_FRONT,
ANIMATE, DEFER_RESUME, "reparentToTargetStack");
mMovedToFront = true;
}
@@ -2636,31 +2639,33 @@
}
// Need to update mTargetStack because if task was moved out of it, the original stack may
// be destroyed.
- mTargetStack = intentActivity.getRootTask();
+ mTargetRootTask = intentActivity.getRootTask();
mSupervisor.handleNonResizableTaskIfNeeded(intentTask, WINDOWING_MODE_UNDEFINED,
- mRootWindowContainer.getDefaultTaskDisplayArea(), mTargetStack);
+ mRootWindowContainer.getDefaultTaskDisplayArea(), mTargetRootTask);
}
- private void resumeTargetStackIfNeeded() {
+ private void resumeTargetRootTaskIfNeeded() {
if (mDoResume) {
- final ActivityRecord next = mTargetStack.topRunningActivity(true /* focusableOnly */);
+ final ActivityRecord next = mTargetRootTask.topRunningActivity(
+ true /* focusableOnly */);
if (next != null) {
next.setCurrentLaunchCanTurnScreenOn(true);
}
- if (mTargetStack.isFocusable()) {
- mRootWindowContainer.resumeFocusedTasksTopActivities(mTargetStack, null, mOptions);
+ if (mTargetRootTask.isFocusable()) {
+ mRootWindowContainer.resumeFocusedTasksTopActivities(mTargetRootTask, null,
+ mOptions);
} else {
mRootWindowContainer.ensureActivitiesVisible(null, 0, !PRESERVE_WINDOWS);
}
} else {
ActivityOptions.abort(mOptions);
}
- mRootWindowContainer.updateUserRootTask(mStartActivity.mUserId, mTargetStack);
+ mRootWindowContainer.updateUserRootTask(mStartActivity.mUserId, mTargetRootTask);
}
private void setNewTask(Task taskToAffiliate) {
final boolean toTop = !mLaunchTaskBehind && !mAvoidMoveToFront;
- final Task task = mTargetStack.reuseOrCreateTask(
+ final Task task = mTargetRootTask.reuseOrCreateTask(
mNewTaskInfo != null ? mNewTaskInfo : mStartActivity.info,
mNewTaskIntent != null ? mNewTaskIntent : mIntent, mVoiceSession,
mVoiceInteractor, toTop, mStartActivity, mSourceRecord, mOptions);
@@ -2721,7 +2726,7 @@
return launchFlags;
}
- private Task getLaunchStack(ActivityRecord r, int launchFlags, Task task,
+ private Task getLaunchRootTask(ActivityRecord r, int launchFlags, Task task,
ActivityOptions aOptions) {
// We are reusing a task, keep the stack!
if (mReuseTask != null) {
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index ce70978..ea04c64 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -183,6 +183,7 @@
import android.os.LocaleList;
import android.os.Looper;
import android.os.Message;
+import android.os.Parcel;
import android.os.PowerManager;
import android.os.PowerManagerInternal;
import android.os.Process;
@@ -1153,7 +1154,7 @@
SafeActivityOptions options = SafeActivityOptions.fromBundle(bOptions);
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(callingActivity);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(callingActivity);
if (r == null) {
SafeActivityOptions.abort(options);
return false;
@@ -1811,7 +1812,7 @@
final long callingId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(activityToken);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(activityToken);
if (r == null) {
return;
}
@@ -2652,7 +2653,7 @@
try {
synchronized (mGlobalLock) {
- ActivityRecord r = ActivityRecord.isInStackLocked(activityToken);
+ ActivityRecord r = ActivityRecord.isInRootTaskLocked(activityToken);
if (r == null) {
throw new IllegalArgumentException("Activity does not exist; token="
+ activityToken);
@@ -3482,7 +3483,7 @@
@Override
public void invalidateHomeTaskSnapshot(IBinder token) {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r == null || !r.isActivityTypeHome()) {
return;
}
@@ -4633,7 +4634,7 @@
ActivityRecord activity = null;
if (type == ActivityManager.INTENT_SENDER_ACTIVITY_RESULT) {
- activity = ActivityRecord.isInStackLocked(token);
+ activity = ActivityRecord.isInRootTaskLocked(token);
if (activity == null) {
Slog.w(TAG, "Failed createPendingResult: activity " + token + " not in any stack");
return null;
@@ -4938,6 +4939,21 @@
return allUids.contains(uid);
}
+ @Override
+ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
+ throws RemoteException {
+ try {
+ return super.onTransact(code, data, reply, flags);
+ } catch (RuntimeException e) {
+ if (!(e instanceof SecurityException)) {
+ Slog.w(TAG, "Activity Task Manager onTransact aborts "
+ + " UID:" + Binder.getCallingUid()
+ + " PID:" + Binder.getCallingPid(), e);
+ }
+ throw e;
+ }
+ }
+
final class H extends Handler {
static final int REPORT_TIME_TRACKER_MSG = 1;
@@ -5472,7 +5488,7 @@
int requestCode, int resultCode, Intent data) {
final ActivityRecord r;
synchronized (mGlobalLock) {
- r = ActivityRecord.isInStackLocked(activityToken);
+ r = ActivityRecord.isInRootTaskLocked(activityToken);
if (r == null || r.getRootTask() == null) {
return;
}
@@ -5490,7 +5506,7 @@
public void clearPendingResultForActivity(IBinder activityToken,
WeakReference<PendingIntentRecord> pir) {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(activityToken);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(activityToken);
if (r != null && r.pendingResults != null) {
r.pendingResults.remove(pir);
}
@@ -5500,7 +5516,7 @@
@Override
public ComponentName getActivityName(IBinder activityToken) {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(activityToken);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(activityToken);
return r != null ? r.intent.getComponent() : null;
}
}
@@ -5544,7 +5560,7 @@
@Override
public ActivityServiceConnectionsHolder getServiceConnectionsHolder(IBinder token) {
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r == null) {
return null;
}
diff --git a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
index 400633c..9d291b1 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
@@ -868,8 +868,8 @@
mergedConfiguration.getOverrideConfiguration(), r.compat,
r.launchedFromPackage, task.voiceInteractor, proc.getReportedProcState(),
r.getSavedState(), r.getPersistentSavedState(), results, newIntents,
- dc.isNextTransitionForward(), proc.createProfilerInfoIfNeeded(),
- r.assistToken, activityClientController,
+ r.takeOptions(), dc.isNextTransitionForward(),
+ proc.createProfilerInfoIfNeeded(), r.assistToken, activityClientController,
r.createFixedRotationAdjustmentsIfNeeded()));
// Set desired final state.
@@ -1394,7 +1394,7 @@
// task.reparent() should already placed the task on top,
// still need moveTaskToFrontLocked() below for any transition settings.
}
- if (stack.shouldResizeStackWithLaunchBounds()) {
+ if (stack.shouldResizeRootTaskWithLaunchBounds()) {
stack.resize(bounds, !PRESERVE_WINDOWS, !DEFER_RESUME);
} else {
// WM resizeTask must be done after the task is moved to the correct stack,
@@ -2237,13 +2237,13 @@
}
void activityRelaunchedLocked(IBinder token) {
- final ActivityRecord r = ActivityRecord.isInStackLocked(token);
+ final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r != null) {
r.finishRelaunching();
if (r.getRootTask().shouldSleepOrShutDownActivities()) {
// Activity is always relaunched to either resumed or paused state. If it was
// relaunched while hidden (by keyguard or smth else), it should be stopped.
- r.getStack().ensureActivitiesVisible(null /* starting */, 0 /* configChanges */,
+ r.getRootTask().ensureActivitiesVisible(null /* starting */, 0 /* configChanges */,
false /* preserveWindows */);
}
}
@@ -2566,9 +2566,10 @@
try {
mService.moveTaskToFrontLocked(null /* appThread */, null /* callingPackage */,
task.mTaskId, 0, options);
- // Apply options to prevent pendingOptions be taken by client to make sure
- // the override pending app transition will be applied immediately.
- targetActivity.applyOptionsLocked();
+ // Apply options to prevent pendingOptions be taken when scheduling activity
+ // lifecycle transaction to make sure the override pending app transition will
+ // be applied immediately.
+ targetActivity.applyOptionsAnimation();
} finally {
mActivityMetricsLogger.notifyActivityLaunched(launchingState,
START_TASK_TO_FRONT, targetActivity, activityOptions);
diff --git a/services/core/java/com/android/server/wm/DisplayAreaOrganizerController.java b/services/core/java/com/android/server/wm/DisplayAreaOrganizerController.java
index c475da3..53f7009 100644
--- a/services/core/java/com/android/server/wm/DisplayAreaOrganizerController.java
+++ b/services/core/java/com/android/server/wm/DisplayAreaOrganizerController.java
@@ -134,7 +134,7 @@
@Override
public DisplayAreaAppearedInfo createTaskDisplayArea(IDisplayAreaOrganizer organizer,
- int displayId, int rootFeatureId, String name) {
+ int displayId, int parentFeatureId, String name) {
enforceTaskPermission("createTaskDisplayArea()");
final long uid = Binder.getCallingUid();
final long origId = Binder.clearCallingIdentity();
@@ -149,13 +149,26 @@
+ displayId);
}
- final DisplayArea root = display.getItemFromDisplayAreas(da ->
- da.asRootDisplayArea() != null && da.mFeatureId == rootFeatureId
- ? da
+ // The parentFeatureId can be either a RootDisplayArea or a TaskDisplayArea.
+ // Check if there is a RootDisplayArea with the given parentFeatureId.
+ final RootDisplayArea parentRoot = display.getItemFromDisplayAreas(da ->
+ da.asRootDisplayArea() != null && da.mFeatureId == parentFeatureId
+ ? da.asRootDisplayArea()
: null);
- if (root == null) {
- throw new IllegalArgumentException("Can't find RootDisplayArea with featureId="
- + rootFeatureId);
+ final TaskDisplayArea parentTda;
+ if (parentRoot == null) {
+ // There is no RootDisplayArea matching the parentFeatureId.
+ // Check if there is a TaskDisplayArea with the given parentFeatureId.
+ parentTda = display.getItemFromTaskDisplayAreas(taskDisplayArea ->
+ taskDisplayArea.mFeatureId == parentFeatureId
+ ? taskDisplayArea
+ : null);
+ } else {
+ parentTda = null;
+ }
+ if (parentRoot == null && parentTda == null) {
+ throw new IllegalArgumentException(
+ "Can't find a parent DisplayArea with featureId=" + parentFeatureId);
}
final int taskDisplayAreaFeatureId = mNextTaskDisplayAreaFeatureId++;
@@ -166,10 +179,13 @@
// Oh well...
}
- final TaskDisplayArea tda = createTaskDisplayArea(root.asRootDisplayArea(), name,
- taskDisplayAreaFeatureId);
- return organizeDisplayArea(organizer, tda,
+ final TaskDisplayArea tda = parentRoot != null
+ ? createTaskDisplayArea(parentRoot, name, taskDisplayAreaFeatureId)
+ : createTaskDisplayArea(parentTda, name, taskDisplayAreaFeatureId);
+ final DisplayAreaAppearedInfo tdaInfo = organizeDisplayArea(organizer, tda,
"DisplayAreaOrganizerController.createTaskDisplayArea");
+ mOrganizersByFeatureIds.put(taskDisplayAreaFeatureId, organizer);
+ return tdaInfo;
}
} finally {
Binder.restoreCallingIdentity(origId);
@@ -196,6 +212,7 @@
+ "TaskDisplayArea=" + taskDisplayArea);
}
+ mOrganizersByFeatureIds.remove(taskDisplayArea.mFeatureId);
deleteTaskDisplayArea(taskDisplayArea);
}
} finally {
@@ -253,6 +270,9 @@
new SurfaceControl(displayArea.getSurfaceControl(), callsite));
}
+ /**
+ * Creates a {@link TaskDisplayArea} as the topmost TDA below the given {@link RootDisplayArea}.
+ */
private TaskDisplayArea createTaskDisplayArea(RootDisplayArea root, String name,
int taskDisplayAreaFeatureId) {
final TaskDisplayArea taskDisplayArea = new TaskDisplayArea(root.mDisplayContent,
@@ -283,6 +303,21 @@
return taskDisplayArea;
}
+ /**
+ * Creates a {@link TaskDisplayArea} as the topmost child of the given {@link TaskDisplayArea}.
+ */
+ private TaskDisplayArea createTaskDisplayArea(TaskDisplayArea parentTda, String name,
+ int taskDisplayAreaFeatureId) {
+ final TaskDisplayArea taskDisplayArea = new TaskDisplayArea(parentTda.mDisplayContent,
+ parentTda.mWmService, name, taskDisplayAreaFeatureId,
+ true /* createdByOrganizer */);
+
+ // Insert the TaskDisplayArea on the top.
+ parentTda.addChild(taskDisplayArea, WindowContainer.POSITION_TOP);
+
+ return taskDisplayArea;
+ }
+
private void deleteTaskDisplayArea(TaskDisplayArea taskDisplayArea) {
taskDisplayArea.setOrganizer(null);
mService.mRootWindowContainer.mTaskSupervisor.beginDeferResume();
diff --git a/services/core/java/com/android/server/wm/DisplayAreaPolicy.java b/services/core/java/com/android/server/wm/DisplayAreaPolicy.java
index d4b319a..5952164 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);
+ // Set the essential containers (even if the display doesn't support IME).
+ rootHierarchy.setImeContainer(imeContainer).setTaskDisplayAreas(tdaList);
+ if (content.isTrusted()) {
+ // Only trusted display can have system decorations.
+ configureTrustedHierarchyBuilder(rootHierarchy, wmService, content);
+ }
+
+ // 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 8457933..4c60a3d 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -283,6 +283,12 @@
*/
private SurfaceControl mOverlayLayer;
+ /**
+ * The direct child layer of the display to put all non-overlay windows. This is also used for
+ * screen rotation animation so that there is a parent layer to put the animation leash.
+ */
+ private final SurfaceControl mWindowingLayer;
+
// Contains all IME window containers. Note that the z-ordering of the IME windows will depend
// on the IME target. We mainly have this container grouping so we can keep track of all the IME
// window containers together and move them in-sync if/when needed. We use a subclass of
@@ -294,7 +300,6 @@
final DisplayAreaPolicy mDisplayAreaPolicy;
private WindowState mTmpWindow;
- private WindowState mTmpWindow2;
private boolean mUpdateImeTarget;
private boolean mTmpInitial;
private int mMaxUiWidth;
@@ -459,10 +464,6 @@
private final ApplySurfaceChangesTransactionState mTmpApplySurfaceChangesTransactionState =
new ApplySurfaceChangesTransactionState();
- // True if this display is in the process of being removed. Used to determine if the removal of
- // the display's direct children should be allowed.
- private boolean mRemovingDisplay = false;
-
// {@code false} if this display is in the processing of being created.
private boolean mDisplayReady = false;
@@ -1023,6 +1024,27 @@
.setContainerLayer()
.setCallsite("DisplayContent");
mSurfaceControl = b.setName("Root").setContainerLayer().build();
+
+ // Setup the policy and build the display area hierarchy.
+ mDisplayAreaPolicy = mWmService.getDisplayAreaPolicyProvider().instantiate(
+ mWmService, this /* content */, this /* root */, mImeWindowsContainers);
+
+ final List<DisplayArea<? extends WindowContainer>> areas =
+ mDisplayAreaPolicy.getDisplayAreas(FEATURE_WINDOWED_MAGNIFICATION);
+ final DisplayArea<?> area = areas.size() == 1 ? areas.get(0) : null;
+ if (area != null && area.getParent() == this) {
+ // The windowed magnification area should contain all non-overlay windows, so just use
+ // it as the windowing layer.
+ mWindowingLayer = area.mSurfaceControl;
+ } else {
+ // Need an additional layer for screen level animation, so move the layer containing
+ // the windows to the new root.
+ mWindowingLayer = mSurfaceControl;
+ mSurfaceControl = b.setName("RootWrapper").build();
+ getPendingTransaction().reparent(mWindowingLayer, mSurfaceControl)
+ .show(mWindowingLayer);
+ }
+
mOverlayLayer = b.setName("Display Overlays").setParent(mSurfaceControl).build();
getPendingTransaction()
@@ -1033,10 +1055,6 @@
.show(mOverlayLayer);
getPendingTransaction().apply();
- // Setup the policy and build the display area hierarchy.
- mDisplayAreaPolicy = mWmService.getDisplayAreaPolicyProvider().instantiate(
- mWmService, this /* content */, this /* root */, mImeWindowsContainers);
-
// Sets the display content for the children.
onDisplayChanged(this);
@@ -2796,7 +2814,6 @@
@Override
void removeImmediately() {
- mRemovingDisplay = true;
mDeferredRemoval = false;
try {
if (mParentWindow != null) {
@@ -2820,7 +2837,6 @@
mWmService.mDisplayNotificationController.dispatchDisplayRemoved(this);
} finally {
mDisplayReady = false;
- mRemovingDisplay = false;
}
// Apply the pending transaction here since we may not be able to reach the DisplayContent
@@ -4190,7 +4206,6 @@
// Used to indicate that we have processed the dream window and all additional attached
// windows are behind it.
- mTmpWindow2 = mTmpWindow;
mTmpWindow = null;
// Now perform layout of attached windows, which usually depend on the position of the
@@ -4860,19 +4875,8 @@
}, false /* traverseTopToBottom */);
}
- private DisplayArea getWindowContainers() {
- List<DisplayArea<? extends WindowContainer>> windowContainers =
- mDisplayAreaPolicy.getDisplayAreas(FEATURE_WINDOWED_MAGNIFICATION);
- if (windowContainers.size() != 1) {
- throw new IllegalStateException("There should be only one DisplayArea for "
- + "FEATURE_WINDOWED_MAGNIFICATION");
- }
- return windowContainers.get(0);
- }
-
- @VisibleForTesting
SurfaceControl getWindowingLayer() {
- return getWindowContainers().getSurfaceControl();
+ return mWindowingLayer;
}
DisplayArea.Tokens getImeContainer() {
diff --git a/services/core/java/com/android/server/wm/DisplayFrames.java b/services/core/java/com/android/server/wm/DisplayFrames.java
index 7f3cb49..38d0c21 100644
--- a/services/core/java/com/android/server/wm/DisplayFrames.java
+++ b/services/core/java/com/android/server/wm/DisplayFrames.java
@@ -16,11 +16,17 @@
package com.android.server.wm;
+import static android.view.InsetsState.ITYPE_BOTTOM_DISPLAY_CUTOUT;
+import static android.view.InsetsState.ITYPE_LEFT_DISPLAY_CUTOUT;
+import static android.view.InsetsState.ITYPE_RIGHT_DISPLAY_CUTOUT;
+import static android.view.InsetsState.ITYPE_TOP_DISPLAY_CUTOUT;
+
import android.annotation.NonNull;
import android.graphics.Rect;
import android.util.proto.ProtoOutputStream;
import android.view.DisplayCutout;
import android.view.DisplayInfo;
+import android.view.InsetsState;
import com.android.server.wm.utils.WmDisplayCutout;
@@ -67,25 +73,41 @@
mDisplayInfoCutout = displayCutout != null ? displayCutout : WmDisplayCutout.NO_CUTOUT;
}
- public void onBeginLayout() {
- mUnrestricted.set(0, 0, mDisplayWidth, mDisplayHeight);
+ public void onBeginLayout(InsetsState state) {
mDisplayCutout = mDisplayInfoCutout;
- mDisplayCutoutSafe.set(Integer.MIN_VALUE, Integer.MIN_VALUE,
- Integer.MAX_VALUE, Integer.MAX_VALUE);
- if (!mDisplayCutout.getDisplayCutout().isEmpty()) {
- final DisplayCutout c = mDisplayCutout.getDisplayCutout();
- if (c.getSafeInsetLeft() > 0) {
- mDisplayCutoutSafe.left = mUnrestricted.left + c.getSafeInsetLeft();
+ final Rect unrestricted = mUnrestricted;
+ final Rect safe = mDisplayCutoutSafe;
+ final DisplayCutout cutout = mDisplayCutout.getDisplayCutout();
+ unrestricted.set(0, 0, mDisplayWidth, mDisplayHeight);
+ safe.set(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE);
+ state.setDisplayFrame(unrestricted);
+ state.setDisplayCutout(cutout);
+ if (!cutout.isEmpty()) {
+ if (cutout.getSafeInsetLeft() > 0) {
+ safe.left = unrestricted.left + cutout.getSafeInsetLeft();
}
- if (c.getSafeInsetTop() > 0) {
- mDisplayCutoutSafe.top = mUnrestricted.top + c.getSafeInsetTop();
+ if (cutout.getSafeInsetTop() > 0) {
+ safe.top = unrestricted.top + cutout.getSafeInsetTop();
}
- if (c.getSafeInsetRight() > 0) {
- mDisplayCutoutSafe.right = mUnrestricted.right - c.getSafeInsetRight();
+ if (cutout.getSafeInsetRight() > 0) {
+ safe.right = unrestricted.right - cutout.getSafeInsetRight();
}
- if (c.getSafeInsetBottom() > 0) {
- mDisplayCutoutSafe.bottom = mUnrestricted.bottom - c.getSafeInsetBottom();
+ if (cutout.getSafeInsetBottom() > 0) {
+ safe.bottom = unrestricted.bottom - cutout.getSafeInsetBottom();
}
+ state.getSource(ITYPE_LEFT_DISPLAY_CUTOUT).setFrame(
+ unrestricted.left, unrestricted.top, safe.left, unrestricted.bottom);
+ state.getSource(ITYPE_TOP_DISPLAY_CUTOUT).setFrame(
+ unrestricted.left, unrestricted.top, unrestricted.right, safe.top);
+ state.getSource(ITYPE_RIGHT_DISPLAY_CUTOUT).setFrame(
+ safe.right, unrestricted.top, unrestricted.right, unrestricted.bottom);
+ state.getSource(ITYPE_BOTTOM_DISPLAY_CUTOUT).setFrame(
+ unrestricted.left, safe.bottom, unrestricted.right, unrestricted.bottom);
+ } else {
+ state.removeSource(ITYPE_LEFT_DISPLAY_CUTOUT);
+ state.removeSource(ITYPE_TOP_DISPLAY_CUTOUT);
+ state.removeSource(ITYPE_RIGHT_DISPLAY_CUTOUT);
+ state.removeSource(ITYPE_BOTTOM_DISPLAY_CUTOUT);
}
}
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index cd02e00..fb005b3 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -25,20 +25,16 @@
import static android.content.res.Configuration.UI_MODE_TYPE_CAR;
import static android.content.res.Configuration.UI_MODE_TYPE_MASK;
import static android.view.Display.TYPE_INTERNAL;
-import static android.view.InsetsState.ITYPE_BOTTOM_DISPLAY_CUTOUT;
import static android.view.InsetsState.ITYPE_BOTTOM_GESTURES;
import static android.view.InsetsState.ITYPE_BOTTOM_TAPPABLE_ELEMENT;
import static android.view.InsetsState.ITYPE_CAPTION_BAR;
import static android.view.InsetsState.ITYPE_CLIMATE_BAR;
import static android.view.InsetsState.ITYPE_EXTRA_NAVIGATION_BAR;
import static android.view.InsetsState.ITYPE_IME;
-import static android.view.InsetsState.ITYPE_LEFT_DISPLAY_CUTOUT;
import static android.view.InsetsState.ITYPE_LEFT_GESTURES;
import static android.view.InsetsState.ITYPE_NAVIGATION_BAR;
-import static android.view.InsetsState.ITYPE_RIGHT_DISPLAY_CUTOUT;
import static android.view.InsetsState.ITYPE_RIGHT_GESTURES;
import static android.view.InsetsState.ITYPE_STATUS_BAR;
-import static android.view.InsetsState.ITYPE_TOP_DISPLAY_CUTOUT;
import static android.view.InsetsState.ITYPE_TOP_GESTURES;
import static android.view.InsetsState.ITYPE_TOP_TAPPABLE_ELEMENT;
import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS;
@@ -1408,15 +1404,13 @@
* @param attrs The LayoutParams of the window.
* @param windowToken The token of the window.
* @param outFrame The frame of the window.
- * @param outDisplayCutout The area that has been cut away from the display.
* @param outInsetsState The insets state of this display from the client's perspective.
* @param localClient Whether the client is from the our process.
* @return Whether to always consume the system bars.
* See {@link #areSystemBarsForcedShownLw(WindowState)}.
*/
boolean getLayoutHint(LayoutParams attrs, WindowToken windowToken, Rect outFrame,
- DisplayCutout.ParcelableWrapper outDisplayCutout, InsetsState outInsetsState,
- boolean localClient) {
+ InsetsState outInsetsState, boolean localClient) {
final boolean isFixedRotationTransforming =
windowToken != null && windowToken.isFixedRotationTransforming();
final ActivityRecord activity = windowToken != null ? windowToken.asActivityRecord() : null;
@@ -1432,19 +1426,6 @@
outFrame.intersect(taskBounds);
}
- final int fl = attrs.flags;
- final boolean layoutInScreenAndInsetDecor = (fl & FLAG_LAYOUT_IN_SCREEN) != 0
- && (fl & FLAG_LAYOUT_INSET_DECOR) != 0;
- final DisplayFrames displayFrames = isFixedRotationTransforming
- ? windowToken.getFixedRotationTransformDisplayFrames()
- : mDisplayContent.mDisplayFrames;
- if (layoutInScreenAndInsetDecor) {
- outDisplayCutout.set(
- displayFrames.mDisplayCutout.calculateRelativeTo(outFrame).getDisplayCutout());
- } else {
- outDisplayCutout.set(DisplayCutout.NO_CUTOUT);
- }
-
final boolean inSizeCompatMode = WindowState.inSizeCompatMode(attrs, windowToken);
outInsetsState.set(state, inSizeCompatMode || localClient);
if (inSizeCompatMode) {
@@ -1523,9 +1504,7 @@
*/
void simulateLayoutDisplay(DisplayFrames displayFrames, InsetsState insetsState,
SparseArray<Rect> barContentFrames) {
- displayFrames.onBeginLayout();
- updateInsetsStateForDisplayCutout(displayFrames, insetsState);
- insetsState.setDisplayFrame(displayFrames.mUnrestricted);
+ displayFrames.onBeginLayout(insetsState);
final WindowFrames simulatedWindowFrames = new WindowFrames();
if (mNavigationBar != null) {
simulateLayoutDecorWindow(mNavigationBar, displayFrames, insetsState,
@@ -1547,10 +1526,7 @@
* @param uiMode The current uiMode in configuration.
*/
public void beginLayoutLw(DisplayFrames displayFrames, int uiMode) {
- displayFrames.onBeginLayout();
- final InsetsState state = mDisplayContent.getInsetsStateController().getRawInsetsState();
- updateInsetsStateForDisplayCutout(displayFrames, state);
- state.setDisplayFrame(displayFrames.mUnrestricted);
+ displayFrames.onBeginLayout(mDisplayContent.getInsetsStateController().getRawInsetsState());
mSystemGestures.screenWidth = displayFrames.mUnrestricted.width();
mSystemGestures.screenHeight = displayFrames.mUnrestricted.height();
@@ -1595,23 +1571,6 @@
}
}
- private static void updateInsetsStateForDisplayCutout(DisplayFrames displayFrames,
- InsetsState state) {
- if (displayFrames.mDisplayCutout.getDisplayCutout().isEmpty()) {
- state.removeSource(ITYPE_LEFT_DISPLAY_CUTOUT);
- state.removeSource(ITYPE_TOP_DISPLAY_CUTOUT);
- state.removeSource(ITYPE_RIGHT_DISPLAY_CUTOUT);
- state.removeSource(ITYPE_BOTTOM_DISPLAY_CUTOUT);
- return;
- }
- final Rect u = displayFrames.mUnrestricted;
- final Rect s = displayFrames.mDisplayCutoutSafe;
- state.getSource(ITYPE_LEFT_DISPLAY_CUTOUT).setFrame(u.left, u.top, s.left, u.bottom);
- state.getSource(ITYPE_TOP_DISPLAY_CUTOUT).setFrame(u.left, u.top, u.right, s.top);
- state.getSource(ITYPE_RIGHT_DISPLAY_CUTOUT).setFrame(s.right, u.top, u.right, u.bottom);
- state.getSource(ITYPE_BOTTOM_DISPLAY_CUTOUT).setFrame(u.left, s.bottom, u.right, u.bottom);
- }
-
private void layoutStatusBar(DisplayFrames displayFrames, Rect simulatedContentFrame) {
// decide where the status bar goes ahead of time
if (mStatusBar == null) {
@@ -1623,7 +1582,7 @@
windowFrames.setFrames(sTmpStatusFrame /* parentFrame */,
sTmpStatusFrame /* displayFrame */);
// Let the status bar determine its size.
- mStatusBar.computeFrame(displayFrames);
+ mStatusBar.computeFrameAndUpdateSourceFrame();
// For layout, the status bar is always at the top with our fixed height.
int statusBarBottom = displayFrames.mUnrestricted.top
@@ -1690,7 +1649,7 @@
final WindowFrames windowFrames = mNavigationBar.getLayoutingWindowFrames();
windowFrames.setFrames(navigationFrame /* parentFrame */,
navigationFrame /* displayFrame */);
- mNavigationBar.computeFrame(displayFrames);
+ mNavigationBar.computeFrameAndUpdateSourceFrame();
final Rect contentFrame = sTmpRect;
contentFrame.set(windowFrames.mFrame);
contentFrame.intersect(displayFrames.mDisplayCutoutSafe);
@@ -1872,7 +1831,7 @@
windowFrames.setContentChanged(true);
}
- win.computeFrame(displayFrames);
+ win.computeFrameAndUpdateSourceFrame();
}
WindowState getTopFullscreenOpaqueWindow() {
diff --git a/services/core/java/com/android/server/wm/DragAndDropPermissionsHandler.java b/services/core/java/com/android/server/wm/DragAndDropPermissionsHandler.java
index 9602880..999c585 100644
--- a/services/core/java/com/android/server/wm/DragAndDropPermissionsHandler.java
+++ b/services/core/java/com/android/server/wm/DragAndDropPermissionsHandler.java
@@ -128,7 +128,7 @@
private IBinder getUriPermissionOwnerForActivity(IBinder activityToken) {
ActivityTaskManagerService.enforceNotIsolatedCaller("getUriPermissionOwnerForActivity");
synchronized (mGlobalLock) {
- ActivityRecord r = ActivityRecord.isInStackLocked(activityToken);
+ ActivityRecord r = ActivityRecord.isInRootTaskLocked(activityToken);
if (r == null) {
throw new IllegalArgumentException("Activity does not exist; token="
+ activityToken);
diff --git a/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java b/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java
index 17c3b20..0320a34 100644
--- a/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java
+++ b/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java
@@ -30,7 +30,9 @@
import android.os.Trace;
import android.util.proto.ProtoOutputStream;
import android.view.InsetsSource;
+import android.view.InsetsSourceControl;
import android.view.WindowInsets;
+import android.window.TaskSnapshot;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.protolog.common.ProtoLog;
@@ -53,6 +55,26 @@
super(source, stateController, displayContent);
}
+ @Override
+ InsetsSourceControl getControl(InsetsControlTarget target) {
+ final InsetsSourceControl control = super.getControl(target);
+ if (control != null && target != null && target.getWindow() != null) {
+ final WindowState targetWin = target.getWindow();
+ // If the control target changes during the app transition with the task snapshot
+ // starting window and the IME snapshot is visible, in case not have duplicated IME
+ // showing animation during transitioning, use a flag to inform IME source control to
+ // skip showing animation once.
+ final TaskSnapshot snapshot = targetWin.getRootTask() != null
+ ? targetWin.mWmService.getTaskSnapshot(targetWin.getRootTask().mTaskId,
+ 0 /* userId */, false /* isLowResolution */, false /* restoreFromDisk */)
+ : null;
+ control.setSkipAnimationOnce(targetWin.mActivityRecord != null
+ && targetWin.mActivityRecord.hasStartingWindow()
+ && snapshot != null && snapshot.hasImeSurface());
+ }
+ return control;
+ }
+
/**
* Called from {@link WindowManagerInternal#showImePostLayout} when {@link InputMethodService}
* requests to show IME on {@param imeTarget}.
diff --git a/services/core/java/com/android/server/wm/ImmersiveModeConfirmation.java b/services/core/java/com/android/server/wm/ImmersiveModeConfirmation.java
index 02dad39..9286a46 100644
--- a/services/core/java/com/android/server/wm/ImmersiveModeConfirmation.java
+++ b/services/core/java/com/android/server/wm/ImmersiveModeConfirmation.java
@@ -190,7 +190,9 @@
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
PixelFormat.TRANSLUCENT);
lp.setFitInsetsTypes(lp.getFitInsetsTypes() & ~Type.statusBars());
- lp.privateFlags |= WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS;
+ // Trusted overlay so touches outside the touchable area are allowed to pass through
+ lp.privateFlags |= WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS
+ | WindowManager.LayoutParams.PRIVATE_FLAG_TRUSTED_OVERLAY;
lp.setTitle("ImmersiveModeConfirmation");
lp.windowAnimations = com.android.internal.R.style.Animation_ImmersiveModeConfirmation;
lp.token = getWindowToken();
diff --git a/services/core/java/com/android/server/wm/InputMonitor.java b/services/core/java/com/android/server/wm/InputMonitor.java
index 25d779f..560547e 100644
--- a/services/core/java/com/android/server/wm/InputMonitor.java
+++ b/services/core/java/com/android/server/wm/InputMonitor.java
@@ -330,7 +330,7 @@
inputWindowHandle.setTouchableRegionCrop(null /* Use this surfaces crop */);
inputWindowHandle.setReplaceTouchableRegionWithCrop(true);
useSurfaceCrop = true;
- } else if (task.cropWindowsToStackBounds() && !w.inFreeformWindowingMode()) {
+ } else if (task.cropWindowsToRootTaskBounds() && !w.inFreeformWindowingMode()) {
inputWindowHandle.setTouchableRegionCrop(task.getRootTask().getSurfaceControl());
inputWindowHandle.setReplaceTouchableRegionWithCrop(false);
useSurfaceCrop = true;
diff --git a/services/core/java/com/android/server/wm/InsetsSourceProvider.java b/services/core/java/com/android/server/wm/InsetsSourceProvider.java
index 28a99825..ff5b356 100644
--- a/services/core/java/com/android/server/wm/InsetsSourceProvider.java
+++ b/services/core/java/com/android/server/wm/InsetsSourceProvider.java
@@ -103,8 +103,7 @@
mSource = source;
mDisplayContent = displayContent;
mStateController = stateController;
- mFakeControl = new InsetsSourceControl(source.getType(), null /* leash */,
- new Point());
+ mFakeControl = new InsetsSourceControl(source.getType(), null /* leash */, new Point());
switch (source.getType()) {
case ITYPE_STATUS_BAR:
diff --git a/services/core/java/com/android/server/wm/RecentTasks.java b/services/core/java/com/android/server/wm/RecentTasks.java
index 5598937..dc75bbe 100644
--- a/services/core/java/com/android/server/wm/RecentTasks.java
+++ b/services/core/java/com/android/server/wm/RecentTasks.java
@@ -527,7 +527,7 @@
*/
void notifyTaskPersisterLocked(Task task, boolean flush) {
final Task rootTask = task != null ? task.getRootTask() : null;
- if (rootTask != null && rootTask.isHomeOrRecentsStack()) {
+ if (rootTask != null && rootTask.isHomeOrRecentsRootTask()) {
// Never persist the home or recents task.
return;
}
@@ -561,7 +561,7 @@
private static boolean shouldPersistTaskLocked(Task task) {
final Task rootTask = task.getRootTask();
- return task.isPersistable && (rootTask == null || !rootTask.isHomeOrRecentsStack());
+ return task.isPersistable && (rootTask == null || !rootTask.isHomeOrRecentsRootTask());
}
void onSystemReadyLocked() {
@@ -992,7 +992,7 @@
}
final Task rootTask = task.getRootTask();
if ((task.isPersistable || task.inRecents)
- && (rootTask == null || !rootTask.isHomeOrRecentsStack())) {
+ && (rootTask == null || !rootTask.isHomeOrRecentsRootTask())) {
if (TaskPersister.DEBUG) Slog.d(TAG, "adding to persistentTaskIds task=" + task);
persistentTaskIds.add(task.mTaskId);
} else {
diff --git a/services/core/java/com/android/server/wm/RecentsAnimation.java b/services/core/java/com/android/server/wm/RecentsAnimation.java
index 5bcb287..7d1da5a 100644
--- a/services/core/java/com/android/server/wm/RecentsAnimation.java
+++ b/services/core/java/com/android/server/wm/RecentsAnimation.java
@@ -367,7 +367,7 @@
// type being disturbed if the visibility is updated after setting the next
// transition (the target activity will be one of closing apps).
if (!controller.shouldDeferCancelWithScreenshot()
- && !targetStack.isFocusedStackOnDisplay()) {
+ && !targetStack.isFocusedRootTaskOnDisplay()) {
targetStack.ensureActivitiesVisible(null /* starting */,
0 /* starting */, false /* preserveWindows */);
}
diff --git a/services/core/java/com/android/server/wm/ResetTargetTaskHelper.java b/services/core/java/com/android/server/wm/ResetTargetTaskHelper.java
index 17cb890..fc347bc 100644
--- a/services/core/java/com/android/server/wm/ResetTargetTaskHelper.java
+++ b/services/core/java/com/android/server/wm/ResetTargetTaskHelper.java
@@ -267,8 +267,9 @@
private boolean takeOption(ActivityRecord p, boolean noOptions) {
mCanMoveOptions = false;
if (noOptions && mTopOptions == null) {
- mTopOptions = p.takeOptionsLocked(false /* fromClient */);
+ mTopOptions = p.getOptions();
if (mTopOptions != null) {
+ p.clearOptionsAnimation();
noOptions = false;
}
}
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index d926a36..5195edf 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -2299,7 +2299,7 @@
}
boolean result = false;
- if (targetRootTask != null && (targetRootTask.isTopStackInDisplayArea()
+ if (targetRootTask != null && (targetRootTask.isTopRootTaskInDisplayArea()
|| getTopDisplayFocusedRootTask() == targetRootTask)) {
result = targetRootTask.resumeTopActivityUncheckedLocked(target, targetOptions);
}
@@ -2370,7 +2370,7 @@
rootTask.goToSleepIfPossible(false /* shuttingDown */);
} else {
rootTask.awakeFromSleepingLocked();
- if (rootTask.isFocusedStackOnDisplay()
+ if (rootTask.isFocusedRootTaskOnDisplay()
&& !mTaskSupervisor.getKeyguardController()
.isKeyguardOrAodShowing(display.mDisplayId)) {
// If the keyguard is unlocked - resume immediately.
@@ -2422,12 +2422,27 @@
}
private RootTaskInfo getRootTaskInfo(Task task) {
- final TaskDisplayArea taskDisplayArea = task.getDisplayArea();
RootTaskInfo info = new RootTaskInfo();
task.fillTaskInfo(info);
- // A task might be not attached to a display.
- info.position = taskDisplayArea != null ? taskDisplayArea.getTaskIndexOf(task) : 0;
+ final DisplayContent displayContent = task.getDisplayContent();
+ if (displayContent == null) {
+ // A task might be not attached to a display.
+ info.position = -1;
+ } else {
+ // Find the task z-order among all root tasks on the display from bottom to top.
+ final int[] taskIndex = new int[1];
+ final boolean[] hasFound = new boolean[1];
+ displayContent.forAllRootTasks(rootTask -> {
+ if (task == rootTask) {
+ hasFound[0] = true;
+ return true;
+ }
+ taskIndex[0]++;
+ return false;
+ }, false /* traverseTopToBottom */);
+ info.position = hasFound[0] ? taskIndex[0] : -1;
+ }
info.visible = task.shouldBeVisible(null);
task.getBounds(info.bounds);
diff --git a/services/core/java/com/android/server/wm/Session.java b/services/core/java/com/android/server/wm/Session.java
index 57d48c6..0cefa95 100644
--- a/services/core/java/com/android/server/wm/Session.java
+++ b/services/core/java/com/android/server/wm/Session.java
@@ -61,7 +61,6 @@
import android.util.ArraySet;
import android.util.MergedConfiguration;
import android.util.Slog;
-import android.view.DisplayCutout;
import android.view.IWindow;
import android.view.IWindowId;
import android.view.IWindowSession;
@@ -185,22 +184,21 @@
@Override
public int addToDisplay(IWindow window, WindowManager.LayoutParams attrs,
int viewVisibility, int displayId, InsetsState requestedVisibility, Rect outFrame,
- DisplayCutout.ParcelableWrapper outDisplayCutout, InputChannel outInputChannel,
- InsetsState outInsetsState, InsetsSourceControl[] outActiveControls) {
+ InputChannel outInputChannel, InsetsState outInsetsState,
+ InsetsSourceControl[] outActiveControls) {
return mService.addWindow(this, window, attrs, viewVisibility, displayId,
- UserHandle.getUserId(mUid), requestedVisibility, outFrame, outDisplayCutout,
- outInputChannel, outInsetsState, outActiveControls);
+ UserHandle.getUserId(mUid), requestedVisibility, outFrame, outInputChannel,
+ outInsetsState, outActiveControls);
}
@Override
public int addToDisplayAsUser(IWindow window, WindowManager.LayoutParams attrs,
int viewVisibility, int displayId, int userId, InsetsState requestedVisibility,
- Rect outFrame, DisplayCutout.ParcelableWrapper outDisplayCutout,
- InputChannel outInputChannel, InsetsState outInsetsState,
+ Rect outFrame, InputChannel outInputChannel, InsetsState outInsetsState,
InsetsSourceControl[] outActiveControls) {
return mService.addWindow(this, window, attrs, viewVisibility, displayId, userId,
- requestedVisibility, outFrame, outDisplayCutout, outInputChannel, outInsetsState,
+ requestedVisibility, outFrame, outInputChannel, outInsetsState,
outActiveControls);
}
@@ -209,8 +207,8 @@
int viewVisibility, int displayId, InsetsState outInsetsState) {
return mService.addWindow(this, window, attrs, viewVisibility, displayId,
UserHandle.getUserId(mUid), mDummyRequestedVisibility,
- new Rect() /* outFrame */, new DisplayCutout.ParcelableWrapper() /* cutout */,
- null /* outInputChannel */, outInsetsState, mDummyControls);
+ new Rect() /* outFrame */, null /* outInputChannel */, outInsetsState,
+ mDummyControls);
}
@Override
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 79a32e4..81cbd61 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -605,9 +605,9 @@
private final Handler mHandler;
- private class ActivityStackHandler extends Handler {
+ private class ActivityTaskHandler extends Handler {
- ActivityStackHandler(Looper looper) {
+ ActivityTaskHandler(Looper looper) {
super(looper);
}
@@ -901,7 +901,7 @@
mMinHeight = minHeight;
}
mAtmService.getTaskChangeNotificationController().notifyTaskCreated(_taskId, realActivity);
- mHandler = new ActivityStackHandler(mTaskSupervisor.mLooper);
+ mHandler = new ActivityTaskHandler(mTaskSupervisor.mLooper);
mCurrentUser = mAtmService.mAmInternal.getCurrentUserId();
}
@@ -1136,7 +1136,7 @@
// 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
// move the stack to the front.
- final boolean wasFront = r != null && sourceStack.isTopStackInDisplayArea()
+ final boolean wasFront = r != null && sourceStack.isTopRootTaskInDisplayArea()
&& (sourceStack.topRunningActivity() == r);
final boolean moveStackToFront = moveStackMode == REPARENT_MOVE_ROOT_TASK_TO_FRONT
@@ -1371,14 +1371,14 @@
return intent.filterEquals(this.intent);
}
- boolean returnsToHomeStack() {
+ boolean returnsToHomeRootTask() {
if (inMultiWindowMode() || !hasChild()) return false;
if (intent != null) {
final int returnHomeFlags = FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_TASK_ON_HOME;
return intent != null && (intent.getFlags() & returnHomeFlags) == returnHomeFlags;
}
final Task bottomTask = getBottomMostTask();
- return bottomTask != this && bottomTask.returnsToHomeStack();
+ return bottomTask != this && bottomTask.returnsToHomeRootTask();
}
void setPrevAffiliate(Task prevAffiliate) {
@@ -1926,8 +1926,9 @@
if (r == boundaryActivity) return true;
if (!r.finishing) {
- final ActivityOptions opts = r.takeOptionsLocked(false /* fromClient */);
+ final ActivityOptions opts = r.getOptions();
if (opts != null) {
+ r.clearOptionsAnimation();
// TODO: Why is this updating the boundary activity vs. the current activity???
boundaryActivity.updateOptionsLocked(opts);
}
@@ -2978,15 +2979,15 @@
/** Updates the task's bounds and override configuration to match what is expected for the
* input stack. */
- void updateOverrideConfigurationForStack(Task inStack) {
- final Task stack = getRootTask();
+ void updateOverrideConfigurationForRootTask(Task inRootTask) {
+ final Task rootTask = getRootTask();
- if (stack != null && stack == inStack) {
+ if (rootTask != null && rootTask == inRootTask) {
return;
}
- if (!inStack.inFreeformWindowingMode()) {
- setBounds(inStack.getRequestedOverrideBounds());
+ if (!inRootTask.inFreeformWindowingMode()) {
+ setBounds(inRootTask.getRequestedOverrideBounds());
}
}
@@ -3370,7 +3371,7 @@
|| mResizeMode == RESIZE_MODE_FORCE_RESIZABLE_PRESERVE_ORIENTATION;
}
- boolean cropWindowsToStackBounds() {
+ boolean cropWindowsToRootTaskBounds() {
// Don't crop HOME/RECENTS windows to stack bounds. This is because in split-screen
// they extend past their stack and sysui uses the stack surface to control cropping.
// TODO(b/158242495): get rid of this when drag/drop can use surface bounds.
@@ -4010,7 +4011,7 @@
if (control != null) {
// We let the transition to be controlled by RecentsAnimation, and callback task's
// RemoteAnimationTarget for remote runner to animate.
- if (enter && !isHomeOrRecentsStack()) {
+ if (enter && !isHomeOrRecentsRootTask()) {
ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS,
"applyAnimationUnchecked, control: %s, task: %s, transit: %s",
control, asTask(), AppTransition.appTransitionOldToString(transit));
@@ -5325,7 +5326,7 @@
!PRESERVE_WINDOWS);
}
- final boolean isHomeOrRecentsStack() {
+ final boolean isHomeOrRecentsRootTask() {
return isActivityTypeHome() || isActivityTypeRecents();
}
@@ -5366,7 +5367,7 @@
}
}
- if (!isActivityTypeHome() && returnsToHomeStack()) {
+ if (!isActivityTypeHome() && returnsToHomeRootTask()) {
// Make sure the home stack is behind this stack since that is where we should return to
// when this stack is no longer visible.
taskDisplayArea.moveHomeRootTaskToFront(reason + " returnToHome");
@@ -5506,7 +5507,7 @@
}
if (!shuttingDown) {
- if (containsActivityFromStack(mTaskSupervisor.mStoppingActivities)) {
+ if (containsActivityFromRootTask(mTaskSupervisor.mStoppingActivities)) {
// Still need to tell some activities to stop; can't sleep yet.
ProtoLog.v(WM_DEBUG_STATES, "Sleep still need to stop %d activities",
mTaskSupervisor.mStoppingActivities.size());
@@ -5524,7 +5525,7 @@
return shouldSleep;
}
- private boolean containsActivityFromStack(List<ActivityRecord> rs) {
+ private boolean containsActivityFromRootTask(List<ActivityRecord> rs) {
for (ActivityRecord r : rs) {
if (r.getRootTask() == this) {
return true;
@@ -5770,7 +5771,7 @@
}
}
- boolean isTopStackInDisplayArea() {
+ boolean isTopRootTaskInDisplayArea() {
final TaskDisplayArea taskDisplayArea = getDisplayArea();
return taskDisplayArea != null && taskDisplayArea.isTopRootTask(this);
}
@@ -5779,7 +5780,7 @@
* @return {@code true} if this is the focused root task on its current display, {@code false}
* otherwise.
*/
- boolean isFocusedStackOnDisplay() {
+ boolean isFocusedRootTaskOnDisplay() {
return mDisplayContent != null && this == mDisplayContent.getFocusedRootTask();
}
@@ -5847,7 +5848,7 @@
* Returns true if this stack should be resized to match the bounds specified by
* {@link ActivityOptions#setLaunchBounds} when launching an activity into the stack.
*/
- boolean shouldResizeStackWithLaunchBounds() {
+ boolean shouldResizeRootTaskWithLaunchBounds() {
return inPinnedWindowingMode();
}
@@ -5856,7 +5857,7 @@
* Returns {@code true} if this is the top-most split-screen-primary or
* split-screen-secondary stack, {@code false} otherwise.
*/
- boolean isTopSplitScreenStack() {
+ boolean isTopSplitScreenRootTask() {
return inSplitScreenWindowingMode()
&& this == getDisplayArea().getTopRootTaskInWindowingMode(getWindowingMode());
}
@@ -6028,7 +6029,7 @@
if (!hasRunningActivity) {
// There are no activities left in the stack, let's look somewhere else.
- return resumeNextFocusableActivityWhenStackIsEmpty(prev, options);
+ return resumeNextFocusableActivityWhenRootTaskIsEmpty(prev, options);
}
next.delayedResume = false;
@@ -6247,9 +6248,9 @@
}
if (anim) {
- next.applyOptionsLocked();
+ next.applyOptionsAnimation();
} else {
- next.clearOptionsLocked();
+ next.abortAndClearOptionsAnimation();
}
mTaskSupervisor.mNoAnimActivities.clear();
@@ -6356,7 +6357,7 @@
mAtmService.getAppWarningsLocked().onResumeActivity(next);
next.app.setPendingUiCleanAndForceProcessStateUpTo(mAtmService.mTopProcessState);
- next.clearOptionsLocked();
+ next.abortAndClearOptionsAnimation();
transaction.setLifecycleStateRequest(
ResumeActivityItem.obtain(next.app.getReportedProcState(),
dc.isNextTransitionForward()));
@@ -6378,7 +6379,7 @@
if (!next.hasBeenLaunched) {
next.hasBeenLaunched = true;
} else if (SHOW_APP_STARTING_PREVIEW && lastFocusedStack != null
- && lastFocusedStack.isTopStackInDisplayArea()) {
+ && lastFocusedStack.isTopRootTaskInDisplayArea()) {
next.showStartingWindow(null /* prev */, false /* newTask */,
false /* taskSwitch */);
}
@@ -6422,7 +6423,7 @@
* is a home stack - we have to keep it focused, start and resume a home activity on the current
* display instead to make sure that the display is not empty.
*/
- private boolean resumeNextFocusableActivityWhenStackIsEmpty(ActivityRecord prev,
+ private boolean resumeNextFocusableActivityWhenRootTaskIsEmpty(ActivityRecord prev,
ActivityOptions options) {
final String reason = "noMoreActivities";
@@ -6495,7 +6496,7 @@
// The transition animation and starting window are not needed if {@code allowMoveToFront}
// is false, because the activity won't be visible.
- if ((!isHomeOrRecentsStack() || hasActivity()) && allowMoveToFront) {
+ if ((!isHomeOrRecentsRootTask() || hasActivity()) && allowMoveToFront) {
final DisplayContent dc = mDisplayContent;
if (DEBUG_TRANSITION) Slog.v(TAG_TRANSITION,
"Prepare open transition: starting " + r);
@@ -6734,15 +6735,20 @@
if (taskDisplayArea == null) {
return false;
}
- final int index = taskDisplayArea.getTaskIndexOf(this);
- if (index == 0) {
- return false;
- }
- final int[] indexCount = new int[1];
+ final boolean[] hasFound = new boolean[1];
final Task rootTaskBehind = taskDisplayArea.getRootTask(
- // From bottom to top, find the one behind this Task.
- task -> ++indexCount[0] == index, false /* traverseTopToBottom */);
- return rootTaskBehind.isActivityTypeStandard();
+ // From top to bottom, find the one behind this Task.
+ task -> {
+ if (hasFound[0]) {
+ return true;
+ }
+ if (task == this) {
+ // The next one is our target.
+ hasFound[0] = true;
+ }
+ return false;
+ });
+ return rootTaskBehind != null && rootTaskBehind.isActivityTypeStandard();
}
boolean shouldUpRecreateTaskLocked(ActivityRecord srec, String destAffinity) {
@@ -7008,7 +7014,7 @@
// If we have a watcher, preflight the move before committing to it. First check
// for *other* available tasks, but if none are available, then try again allowing the
// current task to be selected.
- if (isTopStackInDisplayArea() && mAtmService.mController != null) {
+ if (isTopRootTaskInDisplayArea() && mAtmService.mController != null) {
ActivityRecord next = topRunningActivity(null, tr.mTaskId);
if (next == null) {
next = topRunningActivity(null, INVALID_TASK_ID);
@@ -7351,7 +7357,7 @@
+ " is not a child of stack=" + this + " current parent=" + task.getRootTask());
}
- task.updateOverrideConfigurationForStack(this);
+ task.updateOverrideConfigurationForRootTask(this);
final ActivityRecord topRunningActivity = task.topRunningActivityLocked();
final boolean wasResumed = topRunningActivity == task.mResumedActivity;
@@ -7544,7 +7550,7 @@
return true;
}
if (mAtmService.mHasLeanbackFeature && inPinnedWindowingMode()
- && !isFocusedStackOnDisplay()) {
+ && !isFocusedRootTaskOnDisplay()) {
// Preventing Picture-in-Picture stack from receiving input on TVs.
return true;
}
@@ -7634,7 +7640,7 @@
// Do not sleep activities in this stack if we're marked as focused and the keyguard
// is in the process of going away.
- if (isFocusedStackOnDisplay()
+ if (isFocusedRootTaskOnDisplay()
&& mTaskSupervisor.getKeyguardController().isKeyguardGoingAway()
// Avoid resuming activities on secondary displays since we don't want bubble
// activities to be resumed while bubble is still collapsed.
diff --git a/services/core/java/com/android/server/wm/TaskDisplayArea.java b/services/core/java/com/android/server/wm/TaskDisplayArea.java
index 866abbd..97383e3 100644
--- a/services/core/java/com/android/server/wm/TaskDisplayArea.java
+++ b/services/core/java/com/android/server/wm/TaskDisplayArea.java
@@ -212,34 +212,6 @@
return getRootTask(t -> true);
}
- // TODO(b/175832855): Figure-out a way to remove since it might be a source of confusion.
- /**
- * Gets the order of the given {@link Task} as its z-order in the hierarchy below this TDA.
- * The Task can be a direct child of a child TaskDisplayArea. {@code -1} if not found.
- */
- int getTaskIndexOf(Task task) {
- int index = 0;
- final int childCount = getChildCount();
- for (int i = 0; i < childCount; i++) {
- final WindowContainer wc = getChildAt(i);
- if (wc.asTask() != null) {
- if (wc.asTask() == task) {
- return index;
- }
- index++;
- } else {
- final TaskDisplayArea tda = wc.asTaskDisplayArea();
- final int subIndex = tda.getTaskIndexOf(task);
- if (subIndex > -1) {
- return index + subIndex;
- } else {
- index += tda.getRootTaskCount();
- }
- }
- }
- return -1;
- }
-
@Nullable
Task getRootHomeTask() {
return mRootHomeTask;
diff --git a/services/core/java/com/android/server/wm/TaskSnapshotController.java b/services/core/java/com/android/server/wm/TaskSnapshotController.java
index de9fb6a..ed90cc75 100644
--- a/services/core/java/com/android/server/wm/TaskSnapshotController.java
+++ b/services/core/java/com/android/server/wm/TaskSnapshotController.java
@@ -24,7 +24,6 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.window.TaskSnapshot;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.PixelFormat;
@@ -43,6 +42,7 @@
import android.view.WindowInsets.Type;
import android.view.WindowInsetsController.Appearance;
import android.view.WindowManager.LayoutParams;
+import android.window.TaskSnapshot;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.graphics.ColorUtils;
@@ -344,20 +344,20 @@
TaskSnapshot.Builder builder) {
Point taskSize = new Point();
final SurfaceControl.ScreenshotHardwareBuffer taskSnapshot = createTaskSnapshot(task,
- mHighResTaskSnapshotScale, builder.getPixelFormat(), taskSize);
+ mHighResTaskSnapshotScale, builder.getPixelFormat(), taskSize, builder);
builder.setTaskSize(taskSize);
return taskSnapshot;
}
@Nullable
SurfaceControl.ScreenshotHardwareBuffer createTaskSnapshot(@NonNull Task task,
- float scaleFraction) {
- return createTaskSnapshot(task, scaleFraction, PixelFormat.RGBA_8888, null);
+ float scaleFraction, TaskSnapshot.Builder builder) {
+ return createTaskSnapshot(task, scaleFraction, PixelFormat.RGBA_8888, null, builder);
}
@Nullable
SurfaceControl.ScreenshotHardwareBuffer createTaskSnapshot(@NonNull Task task,
- float scaleFraction, int pixelFormat, Point outTaskSize) {
+ float scaleFraction, int pixelFormat, Point outTaskSize, TaskSnapshot.Builder builder) {
if (task.getSurfaceControl() == null) {
if (DEBUG_SCREENSHOT) {
Slog.w(TAG_WM, "Failed to take screenshot. No surface control for " + task);
@@ -376,6 +376,7 @@
excludeLayers[0] = imeWindow.getSurfaceControl();
} else {
excludeLayers = new SurfaceControl[0];
+ builder.setHasImeSurface(imeWindow != null && imeWindow.isDrawn());
}
final SurfaceControl.ScreenshotHardwareBuffer screenshotBuffer =
SurfaceControl.captureLayersExcluding(
@@ -510,7 +511,8 @@
hwBitmap.getColorSpace(), mainWindow.getConfiguration().orientation,
mainWindow.getWindowConfiguration().getRotation(), new Point(taskWidth, taskHeight),
contentInsets, false /* isLowResolution */, false /* isRealSnapshot */,
- task.getWindowingMode(), getAppearance(task), false);
+ task.getWindowingMode(), getAppearance(task), false /* isTranslucent */,
+ false /* hasImeSurface */);
}
/**
diff --git a/services/core/java/com/android/server/wm/TaskSnapshotLoader.java b/services/core/java/com/android/server/wm/TaskSnapshotLoader.java
index cfdb6b3..d3bfbab 100644
--- a/services/core/java/com/android/server/wm/TaskSnapshotLoader.java
+++ b/services/core/java/com/android/server/wm/TaskSnapshotLoader.java
@@ -197,7 +197,7 @@
hwBitmap.getColorSpace(), proto.orientation, proto.rotation, taskSize,
new Rect(proto.insetLeft, proto.insetTop, proto.insetRight, proto.insetBottom),
loadLowResolutionBitmap, proto.isRealSnapshot, proto.windowingMode,
- proto.appearance, proto.isTranslucent);
+ proto.appearance, proto.isTranslucent, false /* hasImeSurface */);
} catch (IOException e) {
Slog.w(TAG, "Unable to load task snapshot data for taskId=" + taskId);
return null;
diff --git a/services/core/java/com/android/server/wm/TaskSnapshotSurface.java b/services/core/java/com/android/server/wm/TaskSnapshotSurface.java
index 8c458a2..09df71c 100644
--- a/services/core/java/com/android/server/wm/TaskSnapshotSurface.java
+++ b/services/core/java/com/android/server/wm/TaskSnapshotSurface.java
@@ -227,7 +227,7 @@
int displayId = activity.getDisplayContent().getDisplayId();
try {
final int res = session.addToDisplay(window, layoutParams,
- View.GONE, displayId, mTmpInsetsState, tmpFrames.frame, tmpFrames.displayCutout,
+ View.GONE, displayId, mTmpInsetsState, tmpFrames.frame,
null /* outInputChannel */, mTmpInsetsState, mTempControls);
if (res < 0) {
Slog.w(TAG, "Failed to add snapshot starting window res=" + res);
diff --git a/services/core/java/com/android/server/wm/WindowContainer.java b/services/core/java/com/android/server/wm/WindowContainer.java
index 6e0fec1..576d224 100644
--- a/services/core/java/com/android/server/wm/WindowContainer.java
+++ b/services/core/java/com/android/server/wm/WindowContainer.java
@@ -1677,13 +1677,13 @@
int count = mChildren.size();
if (traverseTopToBottom) {
for (int i = count - 1; i >= 0; --i) {
- if (mChildren.get(i).forAllRootTasks(callback)) {
+ if (mChildren.get(i).forAllRootTasks(callback, traverseTopToBottom)) {
return true;
}
}
} else {
for (int i = 0; i < count; i++) {
- if (mChildren.get(i).forAllRootTasks(callback)) {
+ if (mChildren.get(i).forAllRootTasks(callback, traverseTopToBottom)) {
return true;
}
// Root tasks may be removed from this display. Ensure each task will be processed
diff --git a/services/core/java/com/android/server/wm/WindowFrames.java b/services/core/java/com/android/server/wm/WindowFrames.java
index 7991ec6..361694b 100644
--- a/services/core/java/com/android/server/wm/WindowFrames.java
+++ b/services/core/java/com/android/server/wm/WindowFrames.java
@@ -17,7 +17,6 @@
package com.android.server.wm;
import static com.android.server.wm.WindowFramesProto.CONTAINING_FRAME;
-import static com.android.server.wm.WindowFramesProto.CUTOUT;
import static com.android.server.wm.WindowFramesProto.DISPLAY_FRAME;
import static com.android.server.wm.WindowFramesProto.FRAME;
import static com.android.server.wm.WindowFramesProto.PARENT_FRAME;
@@ -25,9 +24,6 @@
import android.annotation.NonNull;
import android.graphics.Rect;
import android.util.proto.ProtoOutputStream;
-import android.view.DisplayCutout;
-
-import com.android.server.wm.utils.WmDisplayCutout;
import java.io.PrintWriter;
@@ -96,30 +92,11 @@
*/
private boolean mParentFrameWasClippedByDisplayCutout;
- /**
- * Part of the display that has been cut away. See {@link DisplayCutout}.
- */
- WmDisplayCutout mDisplayCutout = WmDisplayCutout.NO_CUTOUT;
-
- /**
- * The last cutout that has been reported to the client.
- */
- private WmDisplayCutout mLastDisplayCutout = WmDisplayCutout.NO_CUTOUT;
-
- private boolean mDisplayCutoutChanged;
-
boolean mLastForceReportingResized = false;
boolean mForceReportingResized = false;
private boolean mContentChanged;
- public WindowFrames() {
- }
-
- public WindowFrames(Rect parentFrame, Rect displayFrame) {
- setFrames(parentFrame, displayFrame);
- }
-
public void setFrames(Rect parentFrame, Rect displayFrame) {
mParentFrame.set(parentFrame);
mDisplayFrame.set(displayFrame);
@@ -134,10 +111,6 @@
return mParentFrameWasClippedByDisplayCutout;
}
- public void setDisplayCutout(WmDisplayCutout displayCutout) {
- mDisplayCutout = displayCutout;
- }
-
/**
* @return true if the width or height has changed since last reported to the client.
*/
@@ -157,8 +130,7 @@
boolean setReportResizeHints() {
mLastForceReportingResized |= mForceReportingResized;
mFrameSizeChanged |= didFrameSizeChange();
- mDisplayCutoutChanged |= !mLastDisplayCutout.equals(mDisplayCutout);
- return mLastForceReportingResized || mFrameSizeChanged || mDisplayCutoutChanged;
+ return mLastForceReportingResized || mFrameSizeChanged;
}
/**
@@ -168,7 +140,6 @@
void clearReportResizeHints() {
mLastForceReportingResized = false;
mFrameSizeChanged = false;
- mDisplayCutoutChanged = false;
}
/**
@@ -176,7 +147,6 @@
*/
void onResizeHandled() {
mForceReportingResized = false;
- mLastDisplayCutout = mDisplayCutout;
}
/**
@@ -207,7 +177,6 @@
mDisplayFrame.dumpDebug(proto, DISPLAY_FRAME);
mContainingFrame.dumpDebug(proto, CONTAINING_FRAME);
mFrame.dumpDebug(proto, FRAME);
- mDisplayCutout.getDisplayCutout().dumpDebug(proto, CUTOUT);
proto.end(token);
}
@@ -219,12 +188,9 @@
+ " display=" + mDisplayFrame.toShortString(sTmpSB));
pw.println(prefix + "mFrame=" + mFrame.toShortString(sTmpSB)
+ " last=" + mLastFrame.toShortString(sTmpSB));
- pw.println(prefix + " cutout=" + mDisplayCutout.getDisplayCutout()
- + " last=" + mLastDisplayCutout.getDisplayCutout());
}
String getInsetsChangedInfo() {
- return "forceReportingResized=" + mLastForceReportingResized
- + " displayCutoutChanged=" + mDisplayCutoutChanged;
+ return "forceReportingResized=" + mLastForceReportingResized;
}
}
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 1f3d15a..447e66e 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -140,7 +140,6 @@
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.app.ActivityManager;
-import android.window.TaskSnapshot;
import android.app.ActivityManagerInternal;
import android.app.ActivityTaskManager;
import android.app.ActivityThread;
@@ -221,7 +220,6 @@
import android.util.proto.ProtoOutputStream;
import android.view.Choreographer;
import android.view.Display;
-import android.view.DisplayCutout;
import android.view.DisplayInfo;
import android.view.Gravity;
import android.view.IAppTransitionAnimationSpecsFuture;
@@ -267,6 +265,7 @@
import android.view.WindowManagerGlobal;
import android.view.WindowManagerPolicyConstants.PointerEventListener;
import android.window.ClientWindowFrames;
+import android.window.TaskSnapshot;
import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
@@ -1445,8 +1444,8 @@
public int addWindow(Session session, IWindow client, LayoutParams attrs, int viewVisibility,
int displayId, int requestUserId, InsetsState requestedVisibility, Rect outFrame,
- DisplayCutout.ParcelableWrapper outDisplayCutout, InputChannel outInputChannel,
- InsetsState outInsetsState, InsetsSourceControl[] outActiveControls) {
+ InputChannel outInputChannel, InsetsState outInsetsState,
+ InsetsSourceControl[] outActiveControls) {
Arrays.fill(outActiveControls, null);
int[] appOp = new int[1];
final boolean isRoundedCornerOverlay = (attrs.privateFlags
@@ -1759,8 +1758,8 @@
prepareNoneTransitionForRelaunching(activity);
}
- if (displayPolicy.getLayoutHint(win.mAttrs, token, outFrame, outDisplayCutout,
- outInsetsState, win.isClientLocal())) {
+ if (displayPolicy.getLayoutHint(win.mAttrs, token, outFrame, outInsetsState,
+ win.isClientLocal())) {
res |= WindowManagerGlobal.ADD_FLAG_ALWAYS_CONSUME_SYSTEM_BARS;
}
@@ -2020,9 +2019,9 @@
// re-factor.
activity.firstWindowDrawn = false;
activity.clearAllDrawn();
- final Task stack = activity.getStack();
- if (stack != null) {
- stack.mExitingActivities.remove(activity);
+ final Task rootTask = activity.getRootTask();
+ if (rootTask != null) {
+ rootTask.mExitingActivities.remove(activity);
}
}
}
@@ -2202,7 +2201,7 @@
win.mPendingPositionChanged = null;
}
- if (mUseBLASTSync && win.useBLASTSync()) {
+ if (mUseBLASTSync && win.useBLASTSync() && viewVisibility != View.GONE) {
result |= RELAYOUT_RES_BLAST_SYNC;
}
@@ -8392,7 +8391,7 @@
@Override
public boolean getWindowInsets(WindowManager.LayoutParams attrs, int displayId,
- DisplayCutout.ParcelableWrapper outDisplayCutout, InsetsState outInsetsState) {
+ InsetsState outInsetsState) {
final boolean fromLocal = Binder.getCallingPid() == myPid();
final long origId = Binder.clearCallingIdentity();
try {
@@ -8404,7 +8403,7 @@
}
final WindowToken windowToken = dc.getWindowToken(attrs.token);
return dc.getDisplayPolicy().getLayoutHint(attrs, windowToken,
- mTmpRect /* outFrame */, outDisplayCutout, outInsetsState, fromLocal);
+ mTmpRect /* outFrame */, outInsetsState, fromLocal);
}
} finally {
Binder.restoreCallingIdentity(origId);
diff --git a/services/core/java/com/android/server/wm/WindowProcessController.java b/services/core/java/com/android/server/wm/WindowProcessController.java
index 835e803..9d64af7 100644
--- a/services/core/java/com/android/server/wm/WindowProcessController.java
+++ b/services/core/java/com/android/server/wm/WindowProcessController.java
@@ -844,7 +844,7 @@
ArrayList<ActivityRecord> activities = new ArrayList<>(mActivities);
for (int i = 0; i < activities.size(); i++) {
final ActivityRecord r = activities.get(i);
- if (!r.finishing && r.isInStackLocked()) {
+ if (!r.finishing && r.isInRootTaskLocked()) {
r.finishIfPossible("finish-heavy", true /* oomAdj */);
}
}
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 4301072..d1ea9a2 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -252,7 +252,6 @@
import com.android.server.policy.WindowManagerPolicy;
import com.android.server.wm.LocalAnimationAdapter.AnimationSpec;
import com.android.server.wm.SurfaceAnimator.AnimationType;
-import com.android.server.wm.utils.WmDisplayCutout;
import java.io.PrintWriter;
import java.lang.ref.WeakReference;
@@ -1071,8 +1070,7 @@
frame.inset(left, top, right, bottom);
}
- void computeFrame(DisplayFrames displayFrames) {
- getLayoutingWindowFrames().setDisplayCutout(displayFrames.mDisplayCutout);
+ void computeFrameAndUpdateSourceFrame() {
computeFrame();
// Update the source frame to provide insets to other windows during layout. If the
// simulated frames exist, then this is not computing a stable result so just skip.
@@ -1213,9 +1211,6 @@
}
}
- windowFrames.setDisplayCutout(
- windowFrames.mDisplayCutout.calculateRelativeTo(windowFrames.mFrame));
-
// Offset the actual frame by the amount layout frame is off.
windowFrames.offsetFrames(-layoutXDiff, -layoutYDiff);
@@ -1292,10 +1287,6 @@
return mWindowFrames.mContainingFrame;
}
- WmDisplayCutout getWmDisplayCutout() {
- return mWindowFrames.mDisplayCutout;
- }
-
void getCompatFrameSize(Rect outFrame) {
outFrame.set(0, 0, mWindowFrames.mCompatFrame.width(), mWindowFrames.mCompatFrame.height());
}
@@ -1574,7 +1565,7 @@
*/
void getVisibleBounds(Rect bounds) {
final Task task = getTask();
- boolean intersectWithStackBounds = task != null && task.cropWindowsToStackBounds();
+ boolean intersectWithStackBounds = task != null && task.cropWindowsToRootTaskBounds();
bounds.setEmpty();
mTmpRect.setEmpty();
if (intersectWithStackBounds) {
@@ -2624,16 +2615,24 @@
// events can slip to activity from letterbox.
mActivityRecord.getLetterboxInnerBounds(mTmpRect);
if (mTmpRect.isEmpty()) {
- // If this is a modal window we need to dismiss it if it's not full screen
- // and the touch happens outside of the frame that displays the content. This
- // means we need to intercept touches outside of that window. The dim layer
- // user associated with the window (task or stack) will give us the good
- // bounds, as they would be used to display the dim layer.
- final Task task = getTask();
- if (task != null) {
- task.getDimBounds(mTmpRect);
- } else if (getRootTask() != null) {
- getRootTask().getDimBounds(mTmpRect);
+ final Rect transformedBounds = mActivityRecord.getFixedRotationTransformDisplayBounds();
+ if (transformedBounds != null) {
+ // Task is in the same orientation as display, so the rotated bounds should be
+ // chosen as the touchable region. Then when the surface layer transforms the
+ // region to display space, the orientation will be consistent.
+ mTmpRect.set(transformedBounds);
+ } else {
+ // If this is a modal window we need to dismiss it if it's not full screen
+ // and the touch happens outside of the frame that displays the content. This
+ // means we need to intercept touches outside of that window. The dim layer
+ // user associated with the window (task or stack) will give us the good
+ // bounds, as they would be used to display the dim layer.
+ final Task task = getTask();
+ if (task != null) {
+ task.getDimBounds(mTmpRect);
+ } else if (getRootTask() != null) {
+ getRootTask().getDimBounds(mTmpRect);
+ }
}
}
adjustRegionInFreefromWindowMode(mTmpRect);
@@ -2919,7 +2918,7 @@
/**
* Returns {@code true} if this window has been shown on screen at some time in the past.
*
- * @deprecated Use {@link #isDrawnLw} or any of the other drawn/visibility methods.
+ * @deprecated Use {@link #isDrawn} or any of the other drawn/visibility methods.
*/
@Deprecated
boolean hasDrawn() {
@@ -3464,7 +3463,7 @@
private void cropRegionToStackBoundsIfNeeded(Region region) {
final Task task = getTask();
- if (task == null || !task.cropWindowsToStackBounds()) {
+ if (task == null || !task.cropWindowsToRootTaskBounds()) {
return;
}
@@ -3569,7 +3568,6 @@
final DisplayInfo displayInfo = getDisplayInfo();
backdropFrame.set(0, 0, displayInfo.logicalWidth, displayInfo.logicalHeight);
}
- outFrames.displayCutout.set(mWindowFrames.mDisplayCutout.getDisplayCutout());
}
void reportResized() {
diff --git a/services/core/java/com/android/server/wm/utils/WmDisplayCutout.java b/services/core/java/com/android/server/wm/utils/WmDisplayCutout.java
index 46fff03..ee3f4f4d 100644
--- a/services/core/java/com/android/server/wm/utils/WmDisplayCutout.java
+++ b/services/core/java/com/android/server/wm/utils/WmDisplayCutout.java
@@ -57,55 +57,6 @@
}
/**
- * Insets the reference frame of the cutout in the given directions.
- *
- * @return a copy of this instance which has been inset
- * @hide
- */
- public WmDisplayCutout inset(int insetLeft, int insetTop, int insetRight, int insetBottom) {
- DisplayCutout newInner = mInner.inset(insetLeft, insetTop, insetRight, insetBottom);
-
- if (mInner == newInner) {
- return this;
- }
-
- Size frame = mFrameSize == null ? null : new Size(
- mFrameSize.getWidth() - insetLeft - insetRight,
- mFrameSize.getHeight() - insetTop - insetBottom);
-
- return new WmDisplayCutout(newInner, frame);
- }
-
- /**
- * Recalculates the cutout relative to the given reference frame.
- *
- * The safe insets must already have been computed, e.g. with {@link #computeSafeInsets}.
- *
- * @return a copy of this instance with the safe insets recalculated
- * @hide
- */
- public WmDisplayCutout calculateRelativeTo(Rect frame) {
- if (mFrameSize == null) {
- return this;
- }
- final int insetRight = mFrameSize.getWidth() - frame.right;
- final int insetBottom = mFrameSize.getHeight() - frame.bottom;
- if (frame.left == 0 && frame.top == 0 && insetRight == 0 && insetBottom == 0) {
- return this;
- }
- if (frame.left >= mInner.getSafeInsetLeft()
- && frame.top >= mInner.getSafeInsetTop()
- && insetRight >= mInner.getSafeInsetRight()
- && insetBottom >= mInner.getSafeInsetBottom()) {
- return NO_CUTOUT;
- }
- if (mInner.isEmpty()) {
- return this;
- }
- return inset(frame.left, frame.top, insetRight, insetBottom);
- }
-
- /**
* Calculates the safe insets relative to the given display size.
*
* @return a copy of this instance with the safe insets calculated
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
index 2c4eb1b..996462f 100644
--- a/services/core/jni/Android.bp
+++ b/services/core/jni/Android.bp
@@ -40,6 +40,7 @@
"com_android_server_locksettings_SyntheticPasswordManager.cpp",
"com_android_server_net_NetworkStatsService.cpp",
"com_android_server_power_PowerManagerService.cpp",
+ "com_android_server_powerstats_PowerStatsService.cpp",
"com_android_server_security_VerityUtils.cpp",
"com_android_server_SerialService.cpp",
"com_android_server_soundtrigger_middleware_AudioSessionProviderImpl.cpp",
@@ -47,7 +48,6 @@
"com_android_server_stats_pull_StatsPullAtomService.cpp",
"com_android_server_storage_AppFuseBridge.cpp",
"com_android_server_SystemServer.cpp",
- "com_android_server_TestNetworkService.cpp",
"com_android_server_tv_TvUinputBridge.cpp",
"com_android_server_tv_TvInputHal.cpp",
"com_android_server_vr_VrManagerService.cpp",
@@ -64,8 +64,6 @@
"com_android_server_pm_PackageManagerShellCommandDataLoader.cpp",
"onload.cpp",
":lib_networkStatsFactory_native",
- // TODO: move the file below to the connectivity APEX
- "com_android_server_connectivity_Vpn.cpp",
],
include_dirs: [
@@ -173,6 +171,7 @@
static_libs: [
"android.hardware.broadcastradio@common-utils-1x-lib",
+ "libservice-connectivity-static",
],
product_variables: {
diff --git a/services/core/jni/OWNERS b/services/core/jni/OWNERS
index 7fc5565..995cfe9 100644
--- a/services/core/jni/OWNERS
+++ b/services/core/jni/OWNERS
@@ -23,6 +23,7 @@
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_powerstats_* = file:/services/core/java/com/android/server/powerstats/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
diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp
index 57d28ba..d0c2050 100644
--- a/services/core/jni/com_android_server_input_InputManagerService.cpp
+++ b/services/core/jni/com_android_server_input_InputManagerService.cpp
@@ -695,7 +695,7 @@
base::Result<std::shared_ptr<KeyCharacterMap>> ret =
KeyCharacterMap::loadContents(filenameChars.c_str(), contentsChars.c_str(),
KeyCharacterMap::Format::OVERLAY);
- if (ret) {
+ if (ret.ok()) {
result = *ret;
}
}
@@ -1487,7 +1487,7 @@
base::Result<std::unique_ptr<InputChannel>> inputChannel = im->createInputChannel(env, name);
- if (!inputChannel) {
+ if (!inputChannel.ok()) {
std::string message = inputChannel.error().message();
message += StringPrintf(" Status=%d", inputChannel.error().code());
jniThrowRuntimeException(env, message.c_str());
@@ -1521,7 +1521,7 @@
base::Result<std::unique_ptr<InputChannel>> inputChannel =
im->createInputMonitor(env, displayId, isGestureMonitor, name, pid);
- if (!inputChannel) {
+ if (!inputChannel.ok()) {
std::string message = inputChannel.error().message();
message += StringPrintf(" Status=%d", inputChannel.error().code());
jniThrowRuntimeException(env, message.c_str());
@@ -2055,7 +2055,6 @@
->enableSensor(deviceId, static_cast<InputDeviceSensorType>(sensorType),
std::chrono::microseconds(samplingPeriodUs),
std::chrono::microseconds(maxBatchReportLatencyUs));
- return true;
}
static void nativeDisableSensor(JNIEnv* env, jclass /* clazz */, jlong ptr, jint deviceId,
diff --git a/services/core/jni/com_android_server_location_GnssLocationProvider.cpp b/services/core/jni/com_android_server_location_GnssLocationProvider.cpp
index 066dbce..e3a8bb4 100644
--- a/services/core/jni/com_android_server_location_GnssLocationProvider.cpp
+++ b/services/core/jni/com_android_server_location_GnssLocationProvider.cpp
@@ -1442,7 +1442,7 @@
};
/* Initializes the GNSS service handle. */
-static void android_location_GnssLocationProvider_set_gps_service_handle() {
+static void android_location_gnss_hal_GnssNative_set_gps_service_handle() {
gnssHalAidl = waitForVintfService<IGnssAidl>();
if (gnssHalAidl != nullptr) {
ALOGD("Successfully got GNSS AIDL handle.");
@@ -1489,9 +1489,9 @@
}
/* One time initialization at system boot */
-static void android_location_GnssNative_class_init_once(JNIEnv* env, jclass clazz) {
+static void android_location_gnss_hal_GnssNative_class_init_once(JNIEnv* env, jclass clazz) {
// Initialize the top level gnss HAL handle.
- android_location_GnssLocationProvider_set_gps_service_handle();
+ android_location_gnss_hal_GnssNative_set_gps_service_handle();
// Cache methodIDs and class IDs.
method_reportLocation = env->GetMethodID(clazz, "reportLocation",
@@ -1655,8 +1655,8 @@
}
/* Initialization needed at system boot and whenever GNSS service dies. */
-static void android_location_GnssNative_init_once(JNIEnv* env, jobject obj,
- jboolean reinitializeGnssServiceHandle) {
+static void android_location_gnss_hal_GnssNative_init_once(JNIEnv* env, jobject obj,
+ jboolean reinitializeGnssServiceHandle) {
/*
* Save a pointer to JVM.
*/
@@ -1666,7 +1666,7 @@
}
if (reinitializeGnssServiceHandle) {
- android_location_GnssLocationProvider_set_gps_service_handle();
+ android_location_gnss_hal_GnssNative_set_gps_service_handle();
}
if (gnssHal == nullptr) {
@@ -1934,7 +1934,7 @@
}
}
-static jboolean android_location_GnssNative_is_supported(JNIEnv* /* env */, jclass /* clazz */) {
+static jboolean android_location_gnss_hal_GnssNative_is_supported(JNIEnv* /* env */, jclass) {
return (gnssHal != nullptr) ? JNI_TRUE : JNI_FALSE;
}
@@ -1952,7 +1952,7 @@
}
/* Initialization needed each time the GPS service is shutdown. */
-static jboolean android_location_GnssLocationProvider_init(JNIEnv* /* env */, jobject /* obj */) {
+static jboolean android_location_gnss_hal_GnssNative_init(JNIEnv* /* env */, jclass) {
/*
* This must be set before calling into the HAL library.
*/
@@ -2087,7 +2087,7 @@
return JNI_TRUE;
}
-static void android_location_GnssLocationProvider_cleanup(JNIEnv* /* env */, jobject /* obj */) {
+static void android_location_gnss_hal_GnssNative_cleanup(JNIEnv* /* env */, jclass) {
if (gnssHal == nullptr) {
return;
}
@@ -2096,9 +2096,9 @@
checkHidlReturn(result, "IGnss cleanup() failed.");
}
-static jboolean android_location_GnssLocationProvider_set_position_mode(JNIEnv* /* env */,
- jobject /* obj */, jint mode, jint recurrence, jint min_interval, jint preferred_accuracy,
- jint preferred_time, jboolean low_power_mode) {
+static jboolean android_location_gnss_hal_GnssNative_set_position_mode(
+ JNIEnv* /* env */, jclass, jint mode, jint recurrence, jint min_interval,
+ jint preferred_accuracy, jint preferred_time, jboolean low_power_mode) {
Return<bool> result = false;
if (gnssHal_V1_1 != nullptr) {
result = gnssHal_V1_1->setPositionMode_1_1(static_cast<IGnss_V1_0::GnssPositionMode>(mode),
@@ -2118,7 +2118,7 @@
return checkHidlReturn(result, "IGnss setPositionMode() failed.");
}
-static jboolean android_location_GnssLocationProvider_start(JNIEnv* /* env */, jobject /* obj */) {
+static jboolean android_location_gnss_hal_GnssNative_start(JNIEnv* /* env */, jclass) {
if (gnssHal == nullptr) {
return JNI_FALSE;
}
@@ -2127,7 +2127,7 @@
return checkHidlReturn(result, "IGnss start() failed.");
}
-static jboolean android_location_GnssLocationProvider_stop(JNIEnv* /* env */, jobject /* obj */) {
+static jboolean android_location_gnss_hal_GnssNative_stop(JNIEnv* /* env */, jclass) {
if (gnssHal == nullptr) {
return JNI_FALSE;
}
@@ -2136,8 +2136,7 @@
return checkHidlReturn(result, "IGnss stop() failed.");
}
-static void android_location_GnssLocationProvider_delete_aiding_data(JNIEnv* /* env */,
- jobject /* obj */,
+static void android_location_gnss_hal_GnssNative_delete_aiding_data(JNIEnv* /* env */, jclass,
jint flags) {
if (gnssHal == nullptr) {
return;
@@ -2147,8 +2146,8 @@
checkHidlReturn(result, "IGnss deleteAidingData() failed.");
}
-static void android_location_GnssLocationProvider_agps_set_reference_location_cellid(
- JNIEnv* /* env */, jobject /* obj */, jint type, jint mcc, jint mnc, jint lac, jint cid) {
+static void android_location_gnss_hal_GnssNative_agps_set_reference_location_cellid(
+ JNIEnv* /* env */, jclass, jint type, jint mcc, jint mnc, jint lac, jint cid) {
IAGnssRil_V1_0::AGnssRefLocation location;
if (agnssRilIface == nullptr) {
@@ -2175,8 +2174,8 @@
checkHidlReturn(result, "IAGnssRil setRefLocation() failed.");
}
-static void android_location_GnssLocationProvider_agps_set_id(JNIEnv* env, jobject /* obj */,
- jint type, jstring setid_string) {
+static void android_location_gnss_hal_GnssNative_agps_set_id(JNIEnv* env, jclass, jint type,
+ jstring setid_string) {
if (agnssRilIface == nullptr) {
ALOGE("%s: IAGnssRil interface not available.", __func__);
return;
@@ -2187,8 +2186,8 @@
checkHidlReturn(result, "IAGnssRil setSetId() failed.");
}
-static jint android_location_GnssLocationProvider_read_nmea(JNIEnv* env, jobject /* obj */,
- jbyteArray nmeaArray, jint buffer_size) {
+static jint android_location_gnss_hal_GnssNative_read_nmea(JNIEnv* env, jclass,
+ jbyteArray nmeaArray, jint buffer_size) {
// this should only be called from within a call to reportNmea
jbyte* nmea = reinterpret_cast<jbyte *>(env->GetPrimitiveArrayCritical(nmeaArray, 0));
int length = GnssCallback::sNmeaStringLength;
@@ -2199,8 +2198,9 @@
return (jint) length;
}
-static void android_location_GnssLocationProvider_inject_time(JNIEnv* /* env */, jobject /* obj */,
- jlong time, jlong timeReference, jint uncertainty) {
+static void android_location_gnss_hal_GnssNative_inject_time(JNIEnv* /* env */, jclass, jlong time,
+ jlong timeReference,
+ jint uncertainty) {
if (gnssHal == nullptr) {
return;
}
@@ -2209,22 +2209,12 @@
checkHidlReturn(result, "IGnss injectTime() failed.");
}
-static void android_location_GnssLocationProvider_inject_best_location(
- JNIEnv*,
- jobject,
- jint gnssLocationFlags,
- jdouble latitudeDegrees,
- jdouble longitudeDegrees,
- jdouble altitudeMeters,
- jfloat speedMetersPerSec,
- jfloat bearingDegrees,
- jfloat horizontalAccuracyMeters,
- jfloat verticalAccuracyMeters,
- jfloat speedAccuracyMetersPerSecond,
- jfloat bearingAccuracyDegrees,
- jlong timestamp,
- jint elapsedRealtimeFlags,
- jlong elapsedRealtimeNanos,
+static void android_location_gnss_hal_GnssNative_inject_best_location(
+ JNIEnv* /* env */, jclass, jint gnssLocationFlags, jdouble latitudeDegrees,
+ jdouble longitudeDegrees, jdouble altitudeMeters, jfloat speedMetersPerSec,
+ jfloat bearingDegrees, jfloat horizontalAccuracyMeters, jfloat verticalAccuracyMeters,
+ jfloat speedAccuracyMetersPerSecond, jfloat bearingAccuracyDegrees, jlong timestamp,
+ jint elapsedRealtimeFlags, jlong elapsedRealtimeNanos,
jdouble elapsedRealtimeUncertaintyNanos) {
if (gnssHal_V2_0 != nullptr) {
GnssLocation_V2_0 location = createGnssLocation_V2_0(
@@ -2267,8 +2257,10 @@
ALOGE("IGnss injectBestLocation() is called but gnssHal_V1_1 is not available.");
}
-static void android_location_GnssLocationProvider_inject_location(JNIEnv* /* env */,
- jobject /* obj */, jdouble latitude, jdouble longitude, jfloat accuracy) {
+static void android_location_gnss_hal_GnssNative_inject_location(JNIEnv* /* env */, jclass,
+ jdouble latitude,
+ jdouble longitude,
+ jfloat accuracy) {
if (gnssHal == nullptr) {
return;
}
@@ -2277,16 +2269,15 @@
checkHidlReturn(result, "IGnss injectLocation() failed.");
}
-static jboolean android_location_GnssLocationProvider_supports_psds(
- JNIEnv* /* env */, jobject /* obj */) {
+static jboolean android_location_gnss_hal_GnssNative_supports_psds(JNIEnv* /* env */, jclass) {
return (gnssPsdsAidlIface != nullptr || gnssPsdsIface != nullptr || gnssXtraIface != nullptr)
? JNI_TRUE
: JNI_FALSE;
}
-static void android_location_GnssLocationProvider_inject_psds_data(JNIEnv* env, jobject /* obj */,
- jbyteArray data, jint length,
- jint psdsType) {
+static void android_location_gnss_hal_GnssNative_inject_psds_data(JNIEnv* env, jclass,
+ jbyteArray data, jint length,
+ jint psdsType) {
if (gnssPsdsAidlIface == nullptr && gnssPsdsIface == nullptr && gnssXtraIface == nullptr) {
ALOGE("%s: IGnssPsds or IGnssXtra interface not available.", __func__);
return;
@@ -2406,8 +2397,8 @@
}
}
-static void android_location_GnssLocationProvider_set_agps_server(JNIEnv* env, jobject /* obj */,
- jint type, jstring hostname, jint port) {
+static void android_location_gnss_hal_GnssNative_set_agps_server(JNIEnv* env, jclass, jint type,
+ jstring hostname, jint port) {
if (agnssIface_V2_0 != nullptr) {
AGnssDispatcher::setServer<IAGnss_V2_0, IAGnssCallback_V2_0>(agnssIface_V2_0, env, type,
hostname, port);
@@ -2420,8 +2411,8 @@
}
}
-static void android_location_GnssLocationProvider_send_ni_response(JNIEnv* /* env */,
- jobject /* obj */, jint notifId, jint response) {
+static void android_location_gnss_hal_GnssNative_send_ni_response(JNIEnv* /* env */, jclass,
+ jint notifId, jint response) {
if (gnssNiIface == nullptr) {
ALOGE("%s: IGnssNi interface not available.", __func__);
return;
@@ -2504,8 +2495,7 @@
return (jstring) env->NewStringUTF(internalState.str().c_str());
}
-static jstring android_location_GnssLocationProvider_get_internal_state(JNIEnv* env,
- jobject /* obj */) {
+static jstring android_location_gnss_hal_GnssNative_get_internal_state(JNIEnv* env, jclass) {
jstring internalStateStr = nullptr;
/*
* TODO: Create a jobject to represent GnssDebug.
@@ -2537,8 +2527,7 @@
return internalStateStr;
}
-static void android_location_GnssLocationProvider_request_power_stats(JNIEnv* env,
- jobject /* obj */) {
+static void android_location_gnss_hal_GnssNative_request_power_stats(JNIEnv* env) {
if (gnssPowerIndicationIface == nullptr) {
return;
}
@@ -2546,8 +2535,8 @@
checkAidlStatus(status, "IGnssPowerIndication requestGnssPowerStats() failed.");
}
-static jboolean android_location_GnssLocationProvider_is_gnss_visibility_control_supported(
- JNIEnv* /* env */, jclass /* clazz */) {
+static jboolean android_location_gnss_hal_GnssNative_is_gnss_visibility_control_supported(
+ JNIEnv* /* env */, jclass) {
return (gnssVisibilityControlIface != nullptr) ? JNI_TRUE : JNI_FALSE;
}
@@ -2587,15 +2576,15 @@
}
}
-static jboolean android_location_GnssGeofenceProvider_is_geofence_supported(
- JNIEnv* /* env */, jobject /* obj */) {
+static jboolean android_location_gnss_hal_GnssNative_is_geofence_supported(JNIEnv* /* env */,
+ jclass) {
return (gnssGeofencingIface != nullptr) ? JNI_TRUE : JNI_FALSE;
}
-static jboolean android_location_GnssGeofenceProvider_add_geofence(JNIEnv* /* env */,
- jobject /* obj */, jint geofenceId, jdouble latitude, jdouble longitude, jdouble radius,
- jint last_transition, jint monitor_transition, jint notification_responsiveness,
- jint unknown_timer) {
+static jboolean android_location_gnss_hal_GnssNative_add_geofence(
+ JNIEnv* /* env */, jclass, jint geofenceId, jdouble latitude, jdouble longitude,
+ jdouble radius, jint last_transition, jint monitor_transition,
+ jint notification_responsiveness, jint unknown_timer) {
if (gnssGeofencingIface == nullptr) {
ALOGE("%s: IGnssGeofencing interface not available.", __func__);
return JNI_FALSE;
@@ -2608,8 +2597,8 @@
return checkHidlReturn(result, "IGnssGeofencing addGeofence() failed.");
}
-static jboolean android_location_GnssGeofenceProvider_remove_geofence(JNIEnv* /* env */,
- jobject /* obj */, jint geofenceId) {
+static jboolean android_location_gnss_hal_GnssNative_remove_geofence(JNIEnv* /* env */, jclass,
+ jint geofenceId) {
if (gnssGeofencingIface == nullptr) {
ALOGE("%s: IGnssGeofencing interface not available.", __func__);
return JNI_FALSE;
@@ -2619,8 +2608,8 @@
return checkHidlReturn(result, "IGnssGeofencing removeGeofence() failed.");
}
-static jboolean android_location_GnssGeofenceProvider_pause_geofence(JNIEnv* /* env */,
- jobject /* obj */, jint geofenceId) {
+static jboolean android_location_gnss_hal_GnssNative_pause_geofence(JNIEnv* /* env */, jclass,
+ jint geofenceId) {
if (gnssGeofencingIface == nullptr) {
ALOGE("%s: IGnssGeofencing interface not available.", __func__);
return JNI_FALSE;
@@ -2630,8 +2619,9 @@
return checkHidlReturn(result, "IGnssGeofencing pauseGeofence() failed.");
}
-static jboolean android_location_GnssGeofenceProvider_resume_geofence(JNIEnv* /* env */,
- jobject /* obj */, jint geofenceId, jint monitor_transition) {
+static jboolean android_location_gnss_hal_GnssNative_resume_geofence(JNIEnv* /* env */, jclass,
+ jint geofenceId,
+ jint monitor_transition) {
if (gnssGeofencingIface == nullptr) {
ALOGE("%s: IGnssGeofencing interface not available.", __func__);
return JNI_FALSE;
@@ -2641,16 +2631,16 @@
return checkHidlReturn(result, "IGnssGeofencing resumeGeofence() failed.");
}
-static jboolean android_location_GnssAntennaInfoProvider_is_antenna_info_supported(JNIEnv* env,
- jclass clazz) {
+static jboolean android_location_gnss_hal_GnssNative_is_antenna_info_supported(JNIEnv* env,
+ jclass) {
if (gnssAntennaInfoIface != nullptr) {
return JNI_TRUE;
}
return JNI_FALSE;
}
-static jboolean android_location_GnssAntennaInfoProvider_start_antenna_info_listening(
- JNIEnv* /* env */, jobject /* obj */) {
+static jboolean android_location_gnss_hal_GnssNative_start_antenna_info_listening(JNIEnv* /* env */,
+ jclass) {
if (gnssAntennaInfoIface == nullptr) {
ALOGE("%s: IGnssAntennaInfo interface not available.", __func__);
return JNI_FALSE;
@@ -2676,8 +2666,8 @@
return JNI_TRUE;
}
-static jboolean android_location_GnssAntennaInfoProvider_stop_antenna_info_listening(
- JNIEnv* /* env */, jobject /* obj */) {
+static jboolean android_location_gnss_hal_GnssNative_stop_antenna_info_listening(JNIEnv* /* env */,
+ jclass) {
if (gnssAntennaInfoIface == nullptr) {
ALOGE("%s: IGnssAntennaInfo interface not available.", __func__);
return JNI_FALSE;
@@ -2687,8 +2677,7 @@
return checkHidlReturn(result, "IGnssAntennaInfo close() failed.");
}
-static jboolean android_location_GnssMeasurementsProvider_is_measurement_supported(
- JNIEnv* env, jclass clazz) {
+static jboolean android_location_gnss_hal_GnssNative_is_measurement_supported(JNIEnv* env, jclass) {
if (gnssMeasurementIface != nullptr) {
return JNI_TRUE;
}
@@ -2696,10 +2685,8 @@
return JNI_FALSE;
}
-static jboolean android_location_GnssMeasurementsProvider_start_measurement_collection(
- JNIEnv* /* env */,
- jobject /* obj */,
- jboolean enableFullTracking) {
+static jboolean android_location_gnss_hal_GnssNative_start_measurement_collection(
+ JNIEnv* /* env */, jclass, jboolean enableFullTracking) {
if (gnssMeasurementIface == nullptr) {
ALOGE("%s: IGnssMeasurement interface not available.", __func__);
return JNI_FALSE;
@@ -2710,9 +2697,8 @@
enableFullTracking);
}
-static jboolean android_location_GnssMeasurementsProvider_stop_measurement_collection(
- JNIEnv* env,
- jobject obj) {
+static jboolean android_location_gnss_hal_GnssNative_stop_measurement_collection(JNIEnv* env,
+ jclass) {
if (gnssMeasurementIface == nullptr) {
ALOGE("%s: IGnssMeasurement interface not available.", __func__);
return JNI_FALSE;
@@ -2721,9 +2707,8 @@
return gnssMeasurementIface->close();
}
-static jboolean
- android_location_GnssMeasurementCorrectionsProvider_is_measurement_corrections_supported(
- JNIEnv* env, jclass clazz) {
+static jboolean android_location_gnss_hal_GnssNative_is_measurement_corrections_supported(
+ JNIEnv* env, jclass) {
if (gnssCorrectionsIface_V1_0 != nullptr || gnssCorrectionsIface_V1_1 != nullptr) {
return JNI_TRUE;
}
@@ -2816,12 +2801,9 @@
list[i] = singleSatCorrection;
}
}
-static jboolean
- android_location_GnssMeasurementCorrectionsProvider_inject_gnss_measurement_corrections(
- JNIEnv* env,
- jobject obj /* clazz*/,
- jobject correctionsObj) {
+static jboolean android_location_gnss_hal_GnssNative_inject_measurement_corrections(
+ JNIEnv* env, jclass, jobject correctionsObj) {
if (gnssCorrectionsIface_V1_0 == nullptr && gnssCorrectionsIface_V1_1 == nullptr) {
ALOGW("Trying to inject GNSS measurement corrections on a chipset that does not"
" support them.");
@@ -2893,18 +2875,16 @@
return checkHidlReturn(result, "IMeasurementCorrections 1.0 setCorrections() failed.");
}
-static jboolean android_location_GnssNavigationMessageProvider_is_navigation_message_supported(
- JNIEnv* env,
- jclass clazz) {
+static jboolean android_location_gnss_hal_GnssNative_is_navigation_message_supported(JNIEnv* env,
+ jclass) {
if (gnssNavigationMessageIface != nullptr) {
return JNI_TRUE;
}
return JNI_FALSE;
}
-static jboolean android_location_GnssNavigationMessageProvider_start_navigation_message_collection(
- JNIEnv* env,
- jobject obj) {
+static jboolean android_location_gnss_hal_GnssNative_start_navigation_message_collection(
+ JNIEnv* env, jclass) {
if (gnssNavigationMessageIface == nullptr) {
ALOGE("%s: IGnssNavigationMessage interface not available.", __func__);
return JNI_FALSE;
@@ -2926,9 +2906,8 @@
return JNI_TRUE;
}
-static jboolean android_location_GnssNavigationMessageProvider_stop_navigation_message_collection(
- JNIEnv* env,
- jobject obj) {
+static jboolean android_location_gnss_hal_GnssNative_stop_navigation_message_collection(JNIEnv* env,
+ jclass) {
if (gnssNavigationMessageIface == nullptr) {
ALOGE("%s: IGnssNavigationMessage interface not available.", __func__);
return JNI_FALSE;
@@ -3027,7 +3006,7 @@
return gnssConfigurationIface->setEsExtensionSec(emergencyExtensionSeconds);
}
-static jint android_location_GnssLocationProvider_get_batch_size(JNIEnv*, jclass) {
+static jint android_location_gnss_hal_GnssNative_get_batch_size(JNIEnv*) {
if (gnssBatchingIface == nullptr) {
return 0; // batching not supported, size = 0
}
@@ -3039,7 +3018,7 @@
return static_cast<jint>(result);
}
-static jboolean android_location_GnssLocationProvider_init_batching(JNIEnv*, jclass) {
+static jboolean android_location_gnss_hal_GnssNative_init_batching(JNIEnv*, jclass) {
if (gnssBatchingIface_V2_0 != nullptr) {
sp<IGnssBatchingCallback_V2_0> gnssBatchingCbIface_V2_0 = new GnssBatchingCallback_V2_0();
auto result = gnssBatchingIface_V2_0->init_2_0(gnssBatchingCbIface_V2_0);
@@ -3053,7 +3032,7 @@
}
}
-static void android_location_GnssLocationProvider_cleanup_batching(JNIEnv*, jclass) {
+static void android_location_gnss_hal_GnssNative_cleanup_batching(JNIEnv*, jclass) {
if (gnssBatchingIface == nullptr) {
return; // batching not supported
}
@@ -3061,9 +3040,8 @@
checkHidlReturn(result, "IGnssBatching cleanup() failed.");
}
-static jboolean android_location_GnssLocationProvider_start_batch(JNIEnv*, jclass,
- jlong periodNanos,
- jboolean wakeOnFifoFull) {
+static jboolean android_location_gnss_hal_GnssNative_start_batch(JNIEnv*, jclass, jlong periodNanos,
+ jboolean wakeOnFifoFull) {
if (gnssBatchingIface == nullptr) {
return JNI_FALSE; // batching not supported
}
@@ -3080,7 +3058,7 @@
return checkHidlReturn(result, "IGnssBatching start() failed.");
}
-static void android_location_GnssLocationProvider_flush_batch(JNIEnv*, jclass) {
+static void android_location_gnss_hal_GnssNative_flush_batch(JNIEnv*, jclass) {
if (gnssBatchingIface == nullptr) {
return; // batching not supported
}
@@ -3088,7 +3066,7 @@
checkHidlReturn(result, "IGnssBatching flush() failed.");
}
-static jboolean android_location_GnssLocationProvider_stop_batch(JNIEnv*, jclass) {
+static jboolean android_location_gnss_hal_GnssNative_stop_batch(JNIEnv*, jclass) {
if (gnssBatchingIface == nullptr) {
return JNI_FALSE; // batching not supported
}
@@ -3118,156 +3096,146 @@
static const JNINativeMethod sCoreMethods[] = {
/* name, signature, funcPtr */
{"native_class_init_once", "()V",
- reinterpret_cast<void*>(android_location_GnssNative_class_init_once)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_class_init_once)},
{"native_is_supported", "()Z",
- reinterpret_cast<void*>(android_location_GnssNative_is_supported)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_is_supported)},
{"native_init_once", "(Z)V",
- reinterpret_cast<void*>(android_location_GnssNative_init_once)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_init_once)},
};
static const JNINativeMethod sLocationProviderMethods[] = {
/* name, signature, funcPtr */
- {"native_init", "()Z", reinterpret_cast<void*>(android_location_GnssLocationProvider_init)},
+ {"native_init", "()Z", reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_init)},
{"native_cleanup", "()V",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_cleanup)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_cleanup)},
{"native_set_position_mode", "(IIIIIZ)Z",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_set_position_mode)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_set_position_mode)},
{"native_start", "()Z",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_start)},
- {"native_stop", "()Z", reinterpret_cast<void*>(android_location_GnssLocationProvider_stop)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_start)},
+ {"native_stop", "()Z", reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_stop)},
{"native_delete_aiding_data", "(I)V",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_delete_aiding_data)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_delete_aiding_data)},
{"native_read_nmea", "([BI)I",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_read_nmea)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_read_nmea)},
{"native_inject_time", "(JJI)V",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_inject_time)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_inject_time)},
{"native_inject_best_location", "(IDDDFFFFFFJIJD)V",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_inject_best_location)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_inject_best_location)},
{"native_inject_location", "(DDF)V",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_inject_location)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_inject_location)},
{"native_supports_psds", "()Z",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_supports_psds)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_supports_psds)},
{"native_inject_psds_data", "([BII)V",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_inject_psds_data)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_inject_psds_data)},
{"native_agps_set_id", "(ILjava/lang/String;)V",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_agps_set_id)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_agps_set_id)},
{"native_agps_set_ref_location_cellid", "(IIIII)V",
reinterpret_cast<void*>(
- android_location_GnssLocationProvider_agps_set_reference_location_cellid)},
+ android_location_gnss_hal_GnssNative_agps_set_reference_location_cellid)},
{"native_set_agps_server", "(ILjava/lang/String;I)V",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_set_agps_server)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_set_agps_server)},
{"native_send_ni_response", "(II)V",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_send_ni_response)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_send_ni_response)},
{"native_get_internal_state", "()Ljava/lang/String;",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_get_internal_state)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_get_internal_state)},
{"native_is_gnss_visibility_control_supported", "()Z",
reinterpret_cast<void*>(
- android_location_GnssLocationProvider_is_gnss_visibility_control_supported)},
+ android_location_gnss_hal_GnssNative_is_gnss_visibility_control_supported)},
};
-static const JNINativeMethod sMethodsBatching[] = {
+static const JNINativeMethod sBatchingMethods[] = {
/* name, signature, funcPtr */
{"native_get_batch_size", "()I",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_get_batch_size)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_get_batch_size)},
{"native_start_batch", "(JZ)Z",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_start_batch)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_start_batch)},
{"native_flush_batch", "()V",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_flush_batch)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_flush_batch)},
{"native_stop_batch", "()Z",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_stop_batch)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_stop_batch)},
{"native_init_batching", "()Z",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_init_batching)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_init_batching)},
{"native_cleanup_batching", "()V",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_cleanup_batching)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_cleanup_batching)},
};
static const JNINativeMethod sAntennaInfoMethods[] = {
/* name, signature, funcPtr */
{"native_is_antenna_info_supported", "()Z",
- reinterpret_cast<void*>(
- android_location_GnssAntennaInfoProvider_is_antenna_info_supported)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_is_antenna_info_supported)},
{"native_start_antenna_info_listening", "()Z",
reinterpret_cast<void*>(
- android_location_GnssAntennaInfoProvider_start_antenna_info_listening)},
+ android_location_gnss_hal_GnssNative_start_antenna_info_listening)},
{"native_stop_antenna_info_listening", "()Z",
- reinterpret_cast<void*>(
- android_location_GnssAntennaInfoProvider_stop_antenna_info_listening)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_stop_antenna_info_listening)},
};
static const JNINativeMethod sGeofenceMethods[] = {
- /* name, signature, funcPtr */
- {"native_is_geofence_supported",
- "()Z",
- reinterpret_cast<void *>(android_location_GnssGeofenceProvider_is_geofence_supported)},
- {"native_add_geofence",
- "(IDDDIIII)Z",
- reinterpret_cast<void *>(android_location_GnssGeofenceProvider_add_geofence)},
- {"native_remove_geofence",
- "(I)Z",
- reinterpret_cast<void *>(android_location_GnssGeofenceProvider_remove_geofence)},
- {"native_pause_geofence", "(I)Z", reinterpret_cast<void *>(
- android_location_GnssGeofenceProvider_pause_geofence)},
- {"native_resume_geofence",
- "(II)Z",
- reinterpret_cast<void *>(android_location_GnssGeofenceProvider_resume_geofence)},
+ /* name, signature, funcPtr */
+ {"native_is_geofence_supported", "()Z",
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_is_geofence_supported)},
+ {"native_add_geofence", "(IDDDIIII)Z",
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_add_geofence)},
+ {"native_remove_geofence", "(I)Z",
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_remove_geofence)},
+ {"native_pause_geofence", "(I)Z",
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_pause_geofence)},
+ {"native_resume_geofence", "(II)Z",
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_resume_geofence)},
};
static const JNINativeMethod sMeasurementMethods[] = {
- /* name, signature, funcPtr */
- {"native_is_measurement_supported", "()Z",
- reinterpret_cast<void*>(
- android_location_GnssMeasurementsProvider_is_measurement_supported)},
- {"native_start_measurement_collection", "(Z)Z",
- reinterpret_cast<void*>(
- android_location_GnssMeasurementsProvider_start_measurement_collection)},
- {"native_stop_measurement_collection", "()Z",
- reinterpret_cast<void*>(
- android_location_GnssMeasurementsProvider_stop_measurement_collection)},
+ /* name, signature, funcPtr */
+ {"native_is_measurement_supported", "()Z",
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_is_measurement_supported)},
+ {"native_start_measurement_collection", "(Z)Z",
+ reinterpret_cast<void*>(
+ android_location_gnss_hal_GnssNative_start_measurement_collection)},
+ {"native_stop_measurement_collection", "()Z",
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_stop_measurement_collection)},
};
static const JNINativeMethod sMeasurementCorrectionsMethods[] = {
- /* name, signature, funcPtr */
- {"native_is_measurement_corrections_supported", "()Z",
- reinterpret_cast<void*>(
- android_location_GnssMeasurementCorrectionsProvider_is_measurement_corrections_supported)},
- {"native_inject_gnss_measurement_corrections",
- "(Landroid/location/GnssMeasurementCorrections;)Z",
- reinterpret_cast<void*>(
- android_location_GnssMeasurementCorrectionsProvider_inject_gnss_measurement_corrections)},
+ /* name, signature, funcPtr */
+ {"native_is_measurement_corrections_supported", "()Z",
+ reinterpret_cast<void*>(
+ android_location_gnss_hal_GnssNative_is_measurement_corrections_supported)},
+ {"native_inject_measurement_corrections",
+ "(Landroid/location/GnssMeasurementCorrections;)Z",
+ reinterpret_cast<void*>(
+ android_location_gnss_hal_GnssNative_inject_measurement_corrections)},
};
static const JNINativeMethod sNavigationMessageMethods[] = {
- /* name, signature, funcPtr */
- {"native_is_navigation_message_supported",
- "()Z",
- reinterpret_cast<void *>(
- android_location_GnssNavigationMessageProvider_is_navigation_message_supported)},
- {"native_start_navigation_message_collection",
- "()Z",
- reinterpret_cast<void *>(
- android_location_GnssNavigationMessageProvider_start_navigation_message_collection)},
- {"native_stop_navigation_message_collection",
- "()Z",
- reinterpret_cast<void *>(
- android_location_GnssNavigationMessageProvider_stop_navigation_message_collection)},
+ /* name, signature, funcPtr */
+ {"native_is_navigation_message_supported", "()Z",
+ reinterpret_cast<void*>(
+ android_location_gnss_hal_GnssNative_is_navigation_message_supported)},
+ {"native_start_navigation_message_collection", "()Z",
+ reinterpret_cast<void*>(
+ android_location_gnss_hal_GnssNative_start_navigation_message_collection)},
+ {"native_stop_navigation_message_collection", "()Z",
+ reinterpret_cast<void*>(
+ android_location_gnss_hal_GnssNative_stop_navigation_message_collection)},
};
static const JNINativeMethod sNetworkConnectivityMethods[] = {
- /* name, signature, funcPtr */
- {"native_is_agps_ril_supported", "()Z",
- reinterpret_cast<void *>(android_location_GnssNetworkConnectivityHandler_is_agps_ril_supported)},
- {"native_update_network_state",
- "(ZIZZLjava/lang/String;JS)V",
- reinterpret_cast<void *>(android_location_GnssNetworkConnectivityHandler_update_network_state)},
- {"native_agps_data_conn_open",
- "(JLjava/lang/String;I)V",
- reinterpret_cast<void *>(android_location_GnssNetworkConnectivityHandler_agps_data_conn_open)},
- {"native_agps_data_conn_closed",
- "()V",
- reinterpret_cast<void *>(android_location_GnssNetworkConnectivityHandler_agps_data_conn_closed)},
- {"native_agps_data_conn_failed",
- "()V",
- reinterpret_cast<void *>(android_location_GnssNetworkConnectivityHandler_agps_data_conn_failed)},
+ /* name, signature, funcPtr */
+ {"native_is_agps_ril_supported", "()Z",
+ reinterpret_cast<void*>(
+ android_location_GnssNetworkConnectivityHandler_is_agps_ril_supported)},
+ {"native_update_network_state", "(ZIZZLjava/lang/String;JS)V",
+ reinterpret_cast<void*>(
+ android_location_GnssNetworkConnectivityHandler_update_network_state)},
+ {"native_agps_data_conn_open", "(JLjava/lang/String;I)V",
+ reinterpret_cast<void*>(
+ android_location_GnssNetworkConnectivityHandler_agps_data_conn_open)},
+ {"native_agps_data_conn_closed", "()V",
+ reinterpret_cast<void*>(
+ android_location_GnssNetworkConnectivityHandler_agps_data_conn_closed)},
+ {"native_agps_data_conn_failed", "()V",
+ reinterpret_cast<void*>(
+ android_location_GnssNetworkConnectivityHandler_agps_data_conn_failed)},
};
static const JNINativeMethod sConfigurationMethods[] = {
@@ -3297,45 +3265,73 @@
};
static const JNINativeMethod sVisibilityControlMethods[] = {
- /* name, signature, funcPtr */
- {"native_enable_nfw_location_access",
- "([Ljava/lang/String;)Z",
- reinterpret_cast<void *>(
- android_location_GnssVisibilityControl_enable_nfw_location_access)},
+ /* name, signature, funcPtr */
+ {"native_enable_nfw_location_access", "([Ljava/lang/String;)Z",
+ reinterpret_cast<void*>(
+ android_location_GnssVisibilityControl_enable_nfw_location_access)},
};
static const JNINativeMethod sPowerIndicationMethods[] = {
/* name, signature, funcPtr */
{"native_request_power_stats", "()V",
- reinterpret_cast<void*>(android_location_GnssLocationProvider_request_power_stats)},
+ reinterpret_cast<void*>(android_location_gnss_hal_GnssNative_request_power_stats)},
};
int register_android_server_location_GnssLocationProvider(JNIEnv* env) {
- jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssAntennaInfoProvider",
- sAntennaInfoMethods, NELEM(sAntennaInfoMethods));
- jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssLocationProvider",
- sMethodsBatching, NELEM(sMethodsBatching));
- jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssGeofenceProvider",
- sGeofenceMethods, NELEM(sGeofenceMethods));
- jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssMeasurementsProvider",
- sMeasurementMethods, NELEM(sMeasurementMethods));
- jniRegisterNativeMethods(env,
- "com/android/server/location/gnss/GnssMeasurementCorrectionsProvider",
- sMeasurementCorrectionsMethods, NELEM(sMeasurementCorrectionsMethods));
- jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssNavigationMessageProvider",
- sNavigationMessageMethods, NELEM(sNavigationMessageMethods));
- jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssNetworkConnectivityHandler",
- sNetworkConnectivityMethods, NELEM(sNetworkConnectivityMethods));
- jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssConfiguration",
- sConfigurationMethods, NELEM(sConfigurationMethods));
- jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssVisibilityControl",
- sVisibilityControlMethods, NELEM(sVisibilityControlMethods));
- jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssPowerIndicationProvider",
- sPowerIndicationMethods, NELEM(sPowerIndicationMethods));
- jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssLocationProvider",
- sLocationProviderMethods, NELEM(sLocationProviderMethods));
- return jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssNative",
- sCoreMethods, NELEM(sCoreMethods));
+ int res;
+
+ res = jniRegisterNativeMethods(env, "com/android/server/location/gnss/hal/GnssNative",
+ sAntennaInfoMethods, NELEM(sAntennaInfoMethods));
+ LOG_FATAL_IF(res < 0, "Unable to register native methods.");
+
+ res = jniRegisterNativeMethods(env, "com/android/server/location/gnss/hal/GnssNative",
+ sBatchingMethods, NELEM(sBatchingMethods));
+ LOG_FATAL_IF(res < 0, "Unable to register native methods.");
+
+ res = jniRegisterNativeMethods(env, "com/android/server/location/gnss/hal/GnssNative",
+ sGeofenceMethods, NELEM(sGeofenceMethods));
+ LOG_FATAL_IF(res < 0, "Unable to register native methods.");
+
+ res = jniRegisterNativeMethods(env, "com/android/server/location/gnss/hal/GnssNative",
+ sMeasurementMethods, NELEM(sMeasurementMethods));
+ LOG_FATAL_IF(res < 0, "Unable to register native methods.");
+
+ res = jniRegisterNativeMethods(env, "com/android/server/location/gnss/hal/GnssNative",
+ sMeasurementCorrectionsMethods,
+ NELEM(sMeasurementCorrectionsMethods));
+ LOG_FATAL_IF(res < 0, "Unable to register native methods.");
+
+ res = jniRegisterNativeMethods(env, "com/android/server/location/gnss/hal/GnssNative",
+ sNavigationMessageMethods, NELEM(sNavigationMessageMethods));
+ LOG_FATAL_IF(res < 0, "Unable to register native methods.");
+
+ res = jniRegisterNativeMethods(env,
+ "com/android/server/location/gnss/"
+ "GnssNetworkConnectivityHandler",
+ sNetworkConnectivityMethods, NELEM(sNetworkConnectivityMethods));
+ LOG_FATAL_IF(res < 0, "Unable to register native methods.");
+
+ res = jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssConfiguration",
+ sConfigurationMethods, NELEM(sConfigurationMethods));
+ LOG_FATAL_IF(res < 0, "Unable to register native methods.");
+
+ res = jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssVisibilityControl",
+ sVisibilityControlMethods, NELEM(sVisibilityControlMethods));
+ LOG_FATAL_IF(res < 0, "Unable to register native methods.");
+
+ res = jniRegisterNativeMethods(env, "com/android/server/location/gnss/hal/GnssNative",
+ sPowerIndicationMethods, NELEM(sPowerIndicationMethods));
+ LOG_FATAL_IF(res < 0, "Unable to register native methods.");
+
+ res = jniRegisterNativeMethods(env, "com/android/server/location/gnss/hal/GnssNative",
+ sLocationProviderMethods, NELEM(sLocationProviderMethods));
+ LOG_FATAL_IF(res < 0, "Unable to register native methods.");
+
+ res = jniRegisterNativeMethods(env, "com/android/server/location/gnss/hal/GnssNative",
+ sCoreMethods, NELEM(sCoreMethods));
+ LOG_FATAL_IF(res < 0, "Unable to register native methods.");
+
+ return 0;
}
} /* namespace android */
diff --git a/services/core/jni/com_android_server_powerstats_PowerStatsService.cpp b/services/core/jni/com_android_server_powerstats_PowerStatsService.cpp
new file mode 100644
index 0000000..f5b851f
--- /dev/null
+++ b/services/core/jni/com_android_server_powerstats_PowerStatsService.cpp
@@ -0,0 +1,440 @@
+/*
+ * 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.
+ */
+
+#define LOG_TAG "PowerStatsService"
+
+#include <android/hardware/power/stats/1.0/IPowerStats.h>
+#include <jni.h>
+#include <nativehelper/JNIHelp.h>
+
+#include <log/log.h>
+
+using android::hardware::hidl_vec;
+using android::hardware::Return;
+using android::hardware::power::stats::V1_0::EnergyData;
+using android::hardware::power::stats::V1_0::RailInfo;
+using android::hardware::power::stats::V1_0::Status;
+
+// ChannelInfo
+static jclass class_CI;
+static jmethodID method_CI_init;
+static jfieldID field_CI_channelId;
+static jfieldID field_CI_channelName;
+
+// EnergyMeasurement
+static jclass class_EM;
+static jmethodID method_EM_init;
+static jfieldID field_EM_channelId;
+static jfieldID field_EM_timestampMs;
+static jfieldID field_EM_durationMs;
+static jfieldID field_EM_energyUWs;
+
+// StateInfo
+static jclass class_SI;
+static jmethodID method_SI_init;
+static jfieldID field_SI_stateId;
+static jfieldID field_SI_stateName;
+
+// PowerEntityInfo
+static jclass class_PEI;
+static jmethodID method_PEI_init;
+static jfieldID field_PEI_powerEntityId;
+static jfieldID field_PEI_powerEntityName;
+static jfieldID field_PEI_states;
+
+// StateResidency
+static jclass class_SR;
+static jmethodID method_SR_init;
+static jfieldID field_SR_stateId;
+static jfieldID field_SR_totalTimeInStateMs;
+static jfieldID field_SR_totalStateEntryCount;
+static jfieldID field_SR_lastEntryTimestampMs;
+
+// StateResidencyResult
+static jclass class_SRR;
+static jmethodID method_SRR_init;
+static jfieldID field_SRR_powerEntityId;
+static jfieldID field_SRR_stateResidencyData;
+
+namespace android {
+
+static std::mutex gPowerStatsHalMutex;
+static sp<android::hardware::power::stats::V1_0::IPowerStats> gPowerStatsHalV1_0_ptr = nullptr;
+
+static void deinitPowerStats() {
+ gPowerStatsHalV1_0_ptr = nullptr;
+}
+
+struct PowerStatsHalDeathRecipient : virtual public hardware::hidl_death_recipient {
+ virtual void serviceDied(uint64_t cookie,
+ const wp<android::hidl::base::V1_0::IBase> &who) override {
+ // The HAL just died. Reset all handles to HAL services.
+ std::lock_guard<std::mutex> lock(gPowerStatsHalMutex);
+ deinitPowerStats();
+ }
+};
+
+sp<PowerStatsHalDeathRecipient> gPowerStatsHalDeathRecipient = new PowerStatsHalDeathRecipient();
+
+static bool connectToPowerStatsHal() {
+ if (gPowerStatsHalV1_0_ptr == nullptr) {
+ gPowerStatsHalV1_0_ptr = android::hardware::power::stats::V1_0::IPowerStats::getService();
+
+ if (gPowerStatsHalV1_0_ptr == nullptr) {
+ ALOGE("Unable to get power.stats HAL service.");
+ return false;
+ }
+
+ // Link death recipient to power.stats service handle
+ hardware::Return<bool> linked =
+ gPowerStatsHalV1_0_ptr->linkToDeath(gPowerStatsHalDeathRecipient, 0);
+ if (!linked.isOk()) {
+ ALOGE("Transaction error in linking to power.stats HAL death: %s",
+ linked.description().c_str());
+ deinitPowerStats();
+ return false;
+ } else if (!linked) {
+ ALOGW("Unable to link to power.stats HAL death notifications");
+ return false;
+ }
+ }
+ return true;
+}
+
+static bool checkResult(const Return<void> &ret, const char *function) {
+ if (!ret.isOk()) {
+ ALOGE("%s failed: requested HAL service not available. Description: %s", function,
+ ret.description().c_str());
+ if (ret.isDeadObject()) {
+ deinitPowerStats();
+ }
+ return false;
+ }
+ return true;
+}
+
+static jobjectArray nativeGetPowerEntityInfo(JNIEnv *env, jclass clazz) {
+ std::lock_guard<std::mutex> lock(gPowerStatsHalMutex);
+
+ if (!connectToPowerStatsHal()) {
+ ALOGE("nativeGetPowerEntityInfo failed to connect to power.stats HAL");
+ return nullptr;
+ }
+
+ jobjectArray powerEntityInfoArray = nullptr;
+ Return<void> ret = gPowerStatsHalV1_0_ptr->getPowerEntityInfo(
+ [&env, &powerEntityInfoArray](auto infos, auto status) {
+ if (status != Status::SUCCESS) {
+ ALOGE("Error getting power entity info");
+ } else {
+ powerEntityInfoArray = env->NewObjectArray(infos.size(), class_PEI, nullptr);
+ for (int i = 0; i < infos.size(); i++) {
+ jstring powerEntityName =
+ env->NewStringUTF(infos[i].powerEntityName.c_str());
+ jobject powerEntityInfo = env->NewObject(class_PEI, method_PEI_init);
+ env->SetIntField(powerEntityInfo, field_PEI_powerEntityId,
+ infos[i].powerEntityId);
+ env->SetObjectField(powerEntityInfo, field_PEI_powerEntityName,
+ powerEntityName);
+ env->SetObjectArrayElement(powerEntityInfoArray, i, powerEntityInfo);
+ env->DeleteLocalRef(powerEntityName);
+ env->DeleteLocalRef(powerEntityInfo);
+ }
+ }
+ });
+ if (!checkResult(ret, __func__)) {
+ return nullptr;
+ }
+
+ ret = gPowerStatsHalV1_0_ptr->getPowerEntityStateInfo(
+ {}, [&env, &powerEntityInfoArray](auto infos, auto status) {
+ if (status != Status::SUCCESS) {
+ ALOGE("Error getting power entity state info");
+ } else {
+ for (int i = 0; i < infos.size(); i++) {
+ jobjectArray stateInfoArray =
+ env->NewObjectArray(infos[i].states.size(), class_SI, nullptr);
+ for (int j = 0; j < infos[i].states.size(); j++) {
+ jstring powerEntityStateName = env->NewStringUTF(
+ infos[i].states[j].powerEntityStateName.c_str());
+ jobject stateInfo = env->NewObject(class_SI, method_SI_init);
+ env->SetIntField(stateInfo, field_SI_stateId,
+ infos[i].states[j].powerEntityStateId);
+ env->SetObjectField(stateInfo, field_SI_stateName,
+ powerEntityStateName);
+ env->SetObjectArrayElement(stateInfoArray, j, stateInfo);
+ env->DeleteLocalRef(powerEntityStateName);
+ env->DeleteLocalRef(stateInfo);
+ }
+
+ for (int j = 0; j < env->GetArrayLength(powerEntityInfoArray); j++) {
+ jobject powerEntityInfo =
+ env->GetObjectArrayElement(powerEntityInfoArray, j);
+ if (env->GetIntField(powerEntityInfo, field_PEI_powerEntityId) ==
+ infos[i].powerEntityId) {
+ env->SetObjectField(powerEntityInfo, field_PEI_states,
+ stateInfoArray);
+ env->SetObjectArrayElement(powerEntityInfoArray, j,
+ powerEntityInfo);
+ break;
+ }
+ }
+ }
+ }
+ });
+ if (!checkResult(ret, __func__)) {
+ return nullptr;
+ }
+
+ return powerEntityInfoArray;
+}
+
+static jobjectArray nativeGetStateResidency(JNIEnv *env, jclass clazz, jintArray powerEntityIds) {
+ std::lock_guard<std::mutex> lock(gPowerStatsHalMutex);
+
+ if (!connectToPowerStatsHal()) {
+ ALOGE("nativeGetStateResidency failed to connect to power.stats HAL");
+ return nullptr;
+ }
+
+ size_t powerEntityIdCount = env->GetArrayLength(powerEntityIds);
+ hidl_vec<uint32_t> powerEntityIdVector(powerEntityIdCount);
+
+ jint *powerEntityIdElements = env->GetIntArrayElements(powerEntityIds, 0);
+ for (int i = 0; i < powerEntityIdCount; i++) {
+ powerEntityIdVector[i] = powerEntityIdElements[i];
+ }
+ env->ReleaseIntArrayElements(powerEntityIds, powerEntityIdElements, 0);
+
+ jobjectArray stateResidencyResultArray = nullptr;
+ Return<void> ret = gPowerStatsHalV1_0_ptr->getPowerEntityStateResidencyData(
+ powerEntityIdVector, [&env, &stateResidencyResultArray](auto results, auto status) {
+ if (status != Status::SUCCESS) {
+ ALOGE("Error getting power entity state residency data");
+ } else {
+ stateResidencyResultArray =
+ env->NewObjectArray(results.size(), class_SRR, nullptr);
+ for (int i = 0; i < results.size(); i++) {
+ jobjectArray stateResidencyArray =
+ env->NewObjectArray(results[i].stateResidencyData.size(), class_SR,
+ nullptr);
+ for (int j = 0; j < results[i].stateResidencyData.size(); j++) {
+ jobject stateResidency = env->NewObject(class_SR, method_SR_init);
+ env->SetIntField(stateResidency, field_SR_stateId,
+ results[i].stateResidencyData[j].powerEntityStateId);
+ env->SetLongField(stateResidency, field_SR_totalTimeInStateMs,
+ results[i].stateResidencyData[j].totalTimeInStateMs);
+ env->SetLongField(stateResidency, field_SR_totalStateEntryCount,
+ results[i]
+ .stateResidencyData[j]
+ .totalStateEntryCount);
+ env->SetLongField(stateResidency, field_SR_lastEntryTimestampMs,
+ results[i]
+ .stateResidencyData[j]
+ .lastEntryTimestampMs);
+ env->SetObjectArrayElement(stateResidencyArray, j, stateResidency);
+ env->DeleteLocalRef(stateResidency);
+ }
+ jobject stateResidencyResult = env->NewObject(class_SRR, method_SRR_init);
+ env->SetIntField(stateResidencyResult, field_SRR_powerEntityId,
+ results[i].powerEntityId);
+ env->SetObjectField(stateResidencyResult, field_SRR_stateResidencyData,
+ stateResidencyArray);
+ env->SetObjectArrayElement(stateResidencyResultArray, i,
+ stateResidencyResult);
+ env->DeleteLocalRef(stateResidencyResult);
+ }
+ }
+ });
+ if (!checkResult(ret, __func__)) {
+ return nullptr;
+ }
+
+ return stateResidencyResultArray;
+}
+
+static jobjectArray nativeGetEnergyMeterInfo(JNIEnv *env, jclass clazz) {
+ std::lock_guard<std::mutex> lock(gPowerStatsHalMutex);
+
+ if (!connectToPowerStatsHal()) {
+ ALOGE("nativeGetEnergyMeterInfo failed to connect to power.stats HAL");
+ return nullptr;
+ }
+
+ jobjectArray channelInfoArray = nullptr;
+ Return<void> ret = gPowerStatsHalV1_0_ptr->getRailInfo(
+ [&env, &channelInfoArray](auto railInfo, auto status) {
+ if (status != Status::SUCCESS) {
+ ALOGW("Error getting rail info");
+ } else {
+ channelInfoArray = env->NewObjectArray(railInfo.size(), class_CI, nullptr);
+ for (int i = 0; i < railInfo.size(); i++) {
+ jstring channelName = env->NewStringUTF(railInfo[i].railName.c_str());
+ jobject channelInfo = env->NewObject(class_CI, method_CI_init);
+ env->SetIntField(channelInfo, field_CI_channelId, railInfo[i].index);
+ env->SetObjectField(channelInfo, field_CI_channelName, channelName);
+ env->SetObjectArrayElement(channelInfoArray, i, channelInfo);
+ env->DeleteLocalRef(channelName);
+ env->DeleteLocalRef(channelInfo);
+ }
+ }
+ });
+
+ if (!checkResult(ret, __func__)) {
+ ALOGE("getRailInfo failed");
+ return nullptr;
+ }
+
+ return channelInfoArray;
+}
+
+static jobjectArray nativeReadEnergyMeters(JNIEnv *env, jclass clazz, jintArray channelIds) {
+ std::lock_guard<std::mutex> lock(gPowerStatsHalMutex);
+
+ if (!connectToPowerStatsHal()) {
+ ALOGE("nativeGetEnergy failed to connect to power.stats HAL");
+ }
+
+ size_t channelIdCount = env->GetArrayLength(channelIds);
+ hidl_vec<uint32_t> channelIdVector(channelIdCount);
+
+ jint *channelIdElements = env->GetIntArrayElements(channelIds, 0);
+ for (int i = 0; i < channelIdCount; i++) {
+ channelIdVector[i] = channelIdElements[i];
+ }
+ env->ReleaseIntArrayElements(channelIds, channelIdElements, 0);
+
+ jobjectArray energyMeasurementArray = nullptr;
+ Return<void> ret =
+ gPowerStatsHalV1_0_ptr
+ ->getEnergyData(channelIdVector,
+ [&env, &energyMeasurementArray](auto energyData, auto status) {
+ if (status != Status::SUCCESS) {
+ ALOGW("Error getting energy data");
+ } else {
+ energyMeasurementArray =
+ env->NewObjectArray(energyData.size(), class_EM,
+ nullptr);
+ for (int i = 0; i < energyData.size(); i++) {
+ jobject energyMeasurement =
+ env->NewObject(class_EM, method_EM_init);
+ env->SetIntField(energyMeasurement,
+ field_EM_channelId,
+ energyData[i].index);
+ env->SetLongField(energyMeasurement,
+ field_EM_timestampMs,
+ energyData[i].timestamp);
+ env->SetLongField(energyMeasurement,
+ field_EM_durationMs, -1);
+ env->SetLongField(energyMeasurement,
+ field_EM_energyUWs,
+ energyData[i].energy);
+ env->SetObjectArrayElement(energyMeasurementArray,
+ i, energyMeasurement);
+ env->DeleteLocalRef(energyMeasurement);
+ }
+ }
+ });
+
+ if (!checkResult(ret, __func__)) {
+ ALOGE("getEnergyData failed");
+ return nullptr;
+ }
+
+ return energyMeasurementArray;
+}
+
+static jboolean nativeInit(JNIEnv *env, jclass clazz) {
+ std::lock_guard<std::mutex> lock(gPowerStatsHalMutex);
+
+ // ChannelInfo
+ jclass temp = env->FindClass("android/hardware/power/stats/ChannelInfo");
+ class_CI = (jclass)env->NewGlobalRef(temp);
+ method_CI_init = env->GetMethodID(class_CI, "<init>", "()V");
+ field_CI_channelId = env->GetFieldID(class_CI, "channelId", "I");
+ field_CI_channelName = env->GetFieldID(class_CI, "channelName", "Ljava/lang/String;");
+
+ // EnergyMeasurement
+ temp = env->FindClass("android/hardware/power/stats/EnergyMeasurement");
+ class_EM = (jclass)env->NewGlobalRef(temp);
+ method_EM_init = env->GetMethodID(class_EM, "<init>", "()V");
+ field_EM_channelId = env->GetFieldID(class_EM, "channelId", "I");
+ field_EM_timestampMs = env->GetFieldID(class_EM, "timestampMs", "J");
+ field_EM_durationMs = env->GetFieldID(class_EM, "durationMs", "J");
+ field_EM_energyUWs = env->GetFieldID(class_EM, "energyUWs", "J");
+
+ // StateInfo
+ temp = env->FindClass("android/hardware/power/stats/StateInfo");
+ class_SI = (jclass)env->NewGlobalRef(temp);
+ method_SI_init = env->GetMethodID(class_SI, "<init>", "()V");
+ field_SI_stateId = env->GetFieldID(class_SI, "stateId", "I");
+ field_SI_stateName = env->GetFieldID(class_SI, "stateName", "Ljava/lang/String;");
+
+ // PowerEntityInfo
+ temp = env->FindClass("android/hardware/power/stats/PowerEntityInfo");
+ class_PEI = (jclass)env->NewGlobalRef(temp);
+ method_PEI_init = env->GetMethodID(class_PEI, "<init>", "()V");
+ field_PEI_powerEntityId = env->GetFieldID(class_PEI, "powerEntityId", "I");
+ field_PEI_powerEntityName = env->GetFieldID(class_PEI, "powerEntityName", "Ljava/lang/String;");
+ field_PEI_states =
+ env->GetFieldID(class_PEI, "states", "[Landroid/hardware/power/stats/StateInfo;");
+
+ // StateResidency
+ temp = env->FindClass("android/hardware/power/stats/StateResidency");
+ class_SR = (jclass)env->NewGlobalRef(temp);
+ method_SR_init = env->GetMethodID(class_SR, "<init>", "()V");
+ field_SR_stateId = env->GetFieldID(class_SR, "stateId", "I");
+ field_SR_totalTimeInStateMs = env->GetFieldID(class_SR, "totalTimeInStateMs", "J");
+ field_SR_totalStateEntryCount = env->GetFieldID(class_SR, "totalStateEntryCount", "J");
+ field_SR_lastEntryTimestampMs = env->GetFieldID(class_SR, "lastEntryTimestampMs", "J");
+
+ // StateResidencyResult
+ temp = env->FindClass("android/hardware/power/stats/StateResidencyResult");
+ class_SRR = (jclass)env->NewGlobalRef(temp);
+ method_SRR_init = env->GetMethodID(class_SRR, "<init>", "()V");
+ field_SRR_powerEntityId = env->GetFieldID(class_SRR, "powerEntityId", "I");
+ field_SRR_stateResidencyData =
+ env->GetFieldID(class_SRR, "stateResidencyData",
+ "[Landroid/hardware/power/stats/StateResidency;");
+
+ if (!connectToPowerStatsHal()) {
+ ALOGE("nativeInit failed to connect to power.stats HAL");
+ return false;
+ }
+
+ return true;
+}
+
+static const JNINativeMethod method_table[] = {
+ {"nativeInit", "()Z", (void *)nativeInit},
+ {"nativeGetPowerEntityInfo", "()[Landroid/hardware/power/stats/PowerEntityInfo;",
+ (void *)nativeGetPowerEntityInfo},
+ {"nativeGetStateResidency", "([I)[Landroid/hardware/power/stats/StateResidencyResult;",
+ (void *)nativeGetStateResidency},
+ {"nativeGetEnergyMeterInfo", "()[Landroid/hardware/power/stats/ChannelInfo;",
+ (void *)nativeGetEnergyMeterInfo},
+ {"nativeReadEnergyMeters", "([I)[Landroid/hardware/power/stats/EnergyMeasurement;",
+ (void *)nativeReadEnergyMeters},
+};
+
+int register_android_server_PowerStatsService(JNIEnv *env) {
+ return jniRegisterNativeMethods(env,
+ "com/android/server/powerstats/"
+ "PowerStatsHALWrapper$PowerStatsHAL10WrapperImpl",
+ method_table, NELEM(method_table));
+}
+
+}; // namespace android
diff --git a/services/core/jni/gnss/Utils.h b/services/core/jni/gnss/Utils.h
index 32f53d0..0938a1b 100644
--- a/services/core/jni/gnss/Utils.h
+++ b/services/core/jni/gnss/Utils.h
@@ -64,6 +64,18 @@
}
template <class T>
+jboolean checkHidlReturn(hardware::Return<sp<T>>& result, const char* errorMessage) {
+ if (!result.isOk()) {
+ logHidlError(result, errorMessage);
+ return JNI_FALSE;
+ } else if ((sp<T>)result == nullptr) {
+ return JNI_FALSE;
+ } else {
+ return JNI_TRUE;
+ }
+}
+
+template <class T>
class JavaMethodHelper {
public:
// Helper function to call setter on a Java object.
diff --git a/services/core/jni/onload.cpp b/services/core/jni/onload.cpp
index 5a0d08a..85ef394 100644
--- a/services/core/jni/onload.cpp
+++ b/services/core/jni/onload.cpp
@@ -29,6 +29,7 @@
int register_android_server_InputManager(JNIEnv* env);
int register_android_server_LightsService(JNIEnv* env);
int register_android_server_PowerManagerService(JNIEnv* env);
+int register_android_server_PowerStatsService(JNIEnv* env);
int register_android_server_storage_AppFuse(JNIEnv* env);
int register_android_server_SerialService(JNIEnv* env);
int register_android_server_SystemServer(JNIEnv* env);
@@ -82,6 +83,7 @@
register_android_server_broadcastradio_BroadcastRadioService(env);
register_android_server_broadcastradio_Tuner(vm, env);
register_android_server_PowerManagerService(env);
+ register_android_server_PowerStatsService(env);
register_android_server_SerialService(env);
register_android_server_InputManager(env);
register_android_server_LightsService(env);
diff --git a/services/core/xsd/display-device-config/display-device-config.xsd b/services/core/xsd/display-device-config/display-device-config.xsd
index d670991..88964b7 100644
--- a/services/core/xsd/display-device-config/display-device-config.xsd
+++ b/services/core/xsd/display-device-config/display-device-config.xsd
@@ -29,6 +29,10 @@
<xs:annotation name="nonnull"/>
<xs:annotation name="final"/>
</xs:element>
+ <xs:element type="nonNegativeDecimal" name="screenBrightnessDefault">
+ <xs:annotation name="nonnull"/>
+ <xs:annotation name="final"/>
+ </xs:element>
<xs:element type="displayQuirks" name="quirks" minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
diff --git a/services/core/xsd/display-device-config/schema/current.txt b/services/core/xsd/display-device-config/schema/current.txt
index e68ca26..6906fda 100644
--- a/services/core/xsd/display-device-config/schema/current.txt
+++ b/services/core/xsd/display-device-config/schema/current.txt
@@ -4,8 +4,10 @@
public class DisplayConfiguration {
ctor public DisplayConfiguration();
method public com.android.server.display.config.DisplayQuirks getQuirks();
+ method @NonNull public final java.math.BigDecimal getScreenBrightnessDefault();
method @NonNull public final com.android.server.display.config.NitsMap getScreenBrightnessMap();
method public void setQuirks(com.android.server.display.config.DisplayQuirks);
+ method public final void setScreenBrightnessDefault(@NonNull java.math.BigDecimal);
method public final void setScreenBrightnessMap(@NonNull com.android.server.display.config.NitsMap);
}
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index f2c65e2..5f6d76be 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -199,7 +199,6 @@
import android.media.IAudioService;
import android.net.ConnectivityManager;
import android.net.IIpConnectivityMetrics;
-import android.net.NetworkUtils;
import android.net.ProxyInfo;
import android.net.Uri;
import android.net.metrics.IpConnectivityLog;
@@ -270,6 +269,7 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
+import com.android.internal.net.NetworkUtilsInternal;
import com.android.internal.notification.SystemNotificationChannels;
import com.android.internal.os.BackgroundThread;
import com.android.internal.statusbar.IStatusBarService;
@@ -285,6 +285,7 @@
import com.android.internal.widget.LockSettingsInternal;
import com.android.internal.widget.LockscreenCredential;
import com.android.internal.widget.PasswordValidationError;
+import com.android.net.module.util.ProxyUtils;
import com.android.server.LocalServices;
import com.android.server.LockGuard;
import com.android.server.PersistentDataBlockManagerInternal;
@@ -4165,6 +4166,43 @@
}
@Override
+ public boolean isActivePasswordSufficientForDeviceRequirement() {
+ if (!mHasFeature) {
+ return true;
+ }
+ final CallerIdentity caller = getCallerIdentity();
+ Preconditions.checkCallAuthorization(isProfileOwner(caller));
+
+ final int profileUserId = caller.getUserId();
+ Preconditions.checkCallingUser(isManagedProfile(profileUserId));
+
+ // This method is always called on the parent DPM instance to check if its password (i.e.
+ // the device password) is sufficient for all explicit password requirement set on it
+ // So retrieve the parent user Id to which the device password belongs.
+ final int parentUser = getProfileParentId(profileUserId);
+ enforceUserUnlocked(parentUser);
+
+ synchronized (getLockObject()) {
+
+ // Combine password policies across the user and its profiles. Profile admins are
+ // excluded since we only want explicit password requirements, while profile admin
+ // requirement are applicable only when the profile has unified challenge.
+ List<ActiveAdmin> admins = getActiveAdminsForUserAndItsManagedProfilesLocked(parentUser,
+ /* shouldIncludeProfileAdmins */ (user) -> false);
+ ArrayList<PasswordMetrics> adminMetrics = new ArrayList<>(admins.size());
+ int maxRequiredComplexity = PASSWORD_COMPLEXITY_NONE;
+ for (ActiveAdmin admin : admins) {
+ adminMetrics.add(admin.mPasswordPolicy.getMinMetrics());
+ maxRequiredComplexity = Math.max(maxRequiredComplexity, admin.mPasswordComplexity);
+ }
+
+ PasswordMetrics metrics = mLockSettingsInternal.getUserPasswordMetrics(parentUser);
+ return PasswordMetrics.validatePasswordMetrics(PasswordMetrics.merge(adminMetrics),
+ maxRequiredComplexity, false, metrics).isEmpty();
+ }
+ }
+
+ @Override
public boolean isUsingUnifiedPassword(ComponentName admin) {
if (!mHasFeature) {
return true;
@@ -6725,7 +6763,8 @@
}
exclusionList = exclusionList.trim();
- ProxyInfo proxyProperties = new ProxyInfo(data[0], proxyPort, exclusionList);
+ ProxyInfo proxyProperties = ProxyInfo.buildDirectProxy(data[0], proxyPort,
+ ProxyUtils.exclusionStringAsList(exclusionList));
if (!proxyProperties.isValid()) {
Slog.e(LOG_TAG, "Invalid proxy properties, ignoring: " + proxyProperties.toString());
return;
@@ -11766,13 +11805,8 @@
}
@Override
- public ComponentName getProfileOwnerAsUser(@UserIdInt int userId) {
- return DevicePolicyManagerService.this.getProfileOwnerAsUser(userId);
- }
-
- @Override
- public int getDeviceOwnerUserId() {
- return DevicePolicyManagerService.this.getDeviceOwnerUserId();
+ public ComponentName getProfileOwnerAsUser(int userHandle) {
+ return DevicePolicyManagerService.this.getProfileOwnerAsUser(userHandle);
}
@Override
@@ -14624,7 +14658,7 @@
return PRIVATE_DNS_SET_NO_ERROR;
case PRIVATE_DNS_MODE_PROVIDER_HOSTNAME:
if (TextUtils.isEmpty(privateDnsHost)
- || !NetworkUtils.isWeaklyValidatedHostname(privateDnsHost)) {
+ || !NetworkUtilsInternal.isWeaklyValidatedHostname(privateDnsHost)) {
throw new IllegalArgumentException(
String.format("Provided hostname %s is not valid", privateDnsHost));
}
diff --git a/services/net/Android.bp b/services/net/Android.bp
index daf1c53..2a29674 100644
--- a/services/net/Android.bp
+++ b/services/net/Android.bp
@@ -57,6 +57,8 @@
visibility: [
"//frameworks/opt/net/wifi/service",
"//frameworks/opt/net/wifi/tests/wifitests",
+ "//packages/modules/Wifi/service",
+ "//packages/modules/Wifi/service/tests/wifitests",
],
}
diff --git a/services/robotests/src/com/android/server/location/gnss/GnssGeofenceProviderTest.java b/services/robotests/src/com/android/server/location/gnss/GnssGeofenceProviderTest.java
deleted file mode 100644
index 48e6ce8..0000000
--- a/services/robotests/src/com/android/server/location/gnss/GnssGeofenceProviderTest.java
+++ /dev/null
@@ -1,155 +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.location.gnss;
-
-import static org.mockito.ArgumentMatchers.anyDouble;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.os.RemoteException;
-import android.platform.test.annotations.Presubmit;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-
-/**
- * Unit tests for {@link GnssGeofenceProvider}.
- */
-@RunWith(RobolectricTestRunner.class)
-@Presubmit
-public class GnssGeofenceProviderTest {
- private static final int GEOFENCE_ID = 12345;
- private static final double LATITUDE = 10.0;
- private static final double LONGITUDE = 20.0;
- private static final double RADIUS = 5.0;
- private static final int LAST_TRANSITION = 0;
- private static final int MONITOR_TRANSITIONS = 0;
- private static final int NOTIFICATION_RESPONSIVENESS = 0;
- private static final int UNKNOWN_TIMER = 0;
- @Mock
- private GnssGeofenceProvider.GnssGeofenceProviderNative mMockNative;
- private GnssGeofenceProvider mTestProvider;
-
- /**
- * Mocks native methods and adds a geofence to the GnssGeofenceProvider.
- */
- @Before
- public void setUp() {
- MockitoAnnotations.initMocks(this);
- when(mMockNative.addGeofence(anyInt(), anyDouble(), anyDouble(), anyDouble(), anyInt(),
- anyInt(), anyInt(), anyInt())).thenReturn(true);
- when(mMockNative.pauseGeofence(anyInt())).thenReturn(true);
- when(mMockNative.removeGeofence(anyInt())).thenReturn(true);
- when(mMockNative.resumeGeofence(anyInt(), anyInt())).thenReturn(true);
- mTestProvider = new GnssGeofenceProvider(mMockNative);
- mTestProvider.addCircularHardwareGeofence(GEOFENCE_ID, LATITUDE,
- LONGITUDE, RADIUS, LAST_TRANSITION, MONITOR_TRANSITIONS,
- NOTIFICATION_RESPONSIVENESS,
- UNKNOWN_TIMER);
- }
-
- /**
- * Verify native add geofence method is called.
- */
- @Test
- public void addGeofence_nativeAdded() {
- verify(mMockNative).addGeofence(eq(GEOFENCE_ID), eq(LATITUDE), eq(LONGITUDE),
- eq(RADIUS), eq(LAST_TRANSITION), eq(MONITOR_TRANSITIONS),
- eq(NOTIFICATION_RESPONSIVENESS),
- eq(UNKNOWN_TIMER));
- }
-
- /**
- * Verify pauseHardwareGeofence calls native pauseGeofence method.
- */
- @Test
- public void pauseGeofence_nativePaused() {
- mTestProvider.pauseHardwareGeofence(GEOFENCE_ID);
- verify(mMockNative).pauseGeofence(eq(GEOFENCE_ID));
- }
-
- /**
- * Verify removeHardwareGeofence calls native removeGeofence method.
- */
- @Test
- public void removeGeofence_nativeRemoved() {
- mTestProvider.removeHardwareGeofence(GEOFENCE_ID);
- verify(mMockNative).removeGeofence(eq(GEOFENCE_ID));
- }
-
- /**
- * Verify resumeHardwareGeofence, called after pauseHardwareGeofence, will call native
- * resumeGeofence method.
- */
- @Test
- public void resumeGeofence_nativeResumed() {
- mTestProvider.pauseHardwareGeofence(GEOFENCE_ID);
- mTestProvider.resumeHardwareGeofence(GEOFENCE_ID, MONITOR_TRANSITIONS);
- verify(mMockNative).resumeGeofence(eq(GEOFENCE_ID), eq(MONITOR_TRANSITIONS));
- }
-
- /**
- * Verify resumeIfStarted method will re-add previously added geofences.
- */
- @Test
- public void addGeofence_restart_added() throws RemoteException {
- mTestProvider.resumeIfStarted();
-
- verify(mMockNative, times(2)).addGeofence(eq(GEOFENCE_ID), eq(LATITUDE), eq(LONGITUDE),
- eq(RADIUS), eq(LAST_TRANSITION), eq(MONITOR_TRANSITIONS),
- eq(NOTIFICATION_RESPONSIVENESS),
- eq(UNKNOWN_TIMER));
- }
-
- /**
- * Verify resumeIfStarted method will not re-add previously added geofences if they have been
- * removed.
- */
- @Test
- public void removeGeofence_restart_notAdded() throws RemoteException {
- mTestProvider.removeHardwareGeofence(GEOFENCE_ID);
- mTestProvider.resumeIfStarted();
-
- verify(mMockNative, times(1)).addGeofence(eq(GEOFENCE_ID), eq(LATITUDE), eq(LONGITUDE),
- eq(RADIUS), eq(LAST_TRANSITION), eq(MONITOR_TRANSITIONS),
- eq(NOTIFICATION_RESPONSIVENESS),
- eq(UNKNOWN_TIMER));
- }
-
- /**
- * Verify resumeIfStarted, called after pauseHardwareGeofence, will re-add previously added
- * geofences, and re-pause geofencing.
- */
- @Test
- public void pauseGeofence_restart_paused() throws RemoteException {
- mTestProvider.pauseHardwareGeofence(GEOFENCE_ID);
- mTestProvider.resumeIfStarted();
-
- verify(mMockNative, times(2)).addGeofence(eq(GEOFENCE_ID), eq(LATITUDE), eq(LONGITUDE),
- eq(RADIUS), eq(LAST_TRANSITION), eq(MONITOR_TRANSITIONS),
- eq(NOTIFICATION_RESPONSIVENESS),
- eq(UNKNOWN_TIMER));
- verify(mMockNative, times(2)).pauseGeofence(eq(GEOFENCE_ID));
- }
-}
diff --git a/services/robotests/src/com/android/server/location/gnss/GnssPositionModeTest.java b/services/robotests/src/com/android/server/location/gnss/GnssPositionModeTest.java
deleted file mode 100644
index e7d3e51..0000000
--- a/services/robotests/src/com/android/server/location/gnss/GnssPositionModeTest.java
+++ /dev/null
@@ -1,76 +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.location.gnss;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import android.platform.test.annotations.Presubmit;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-
-import java.util.HashSet;
-
-/**
- * Unit tests for {@link GnssPositionMode}.
- */
-@RunWith(RobolectricTestRunner.class)
-@Presubmit
-public class GnssPositionModeTest {
-
- private GnssPositionMode mPositionMode1 = createGnssPositionMode(0, 1000);
- private GnssPositionMode mPositionMode2 = createGnssPositionMode(0, 1000);
- private GnssPositionMode mPositionMode3 = createGnssPositionMode(1, 1000);
-
- /**
- * Verifies hashcode method.
- */
- @Test
- public void testHashCode() {
- assertThat(mPositionMode1.hashCode()).isEqualTo(mPositionMode2.hashCode());
- assertThat(mPositionMode1.hashCode()).isNotEqualTo(mPositionMode3.hashCode());
- assertThat(mPositionMode1.hashCode()).isNotEqualTo(mPositionMode3.hashCode());
-
- HashSet<Integer> hashSet = new HashSet<>();
- hashSet.add(mPositionMode1.hashCode());
- hashSet.add(mPositionMode2.hashCode());
- assertThat(hashSet.size()).isEqualTo(1);
- hashSet.add(mPositionMode3.hashCode());
- assertThat(hashSet.size()).isEqualTo(2);
- }
-
- /**
- * Verify that GnssPositionMode objects that return true for equals() also have the same
- * hashcode.
- */
- @Test
- public void checkIfEqualsImpliesSameHashCode() {
- assertTEqualsImpliesSameHashCode(mPositionMode1, mPositionMode2);
- assertTEqualsImpliesSameHashCode(mPositionMode2, mPositionMode3);
- }
-
- private void assertTEqualsImpliesSameHashCode(GnssPositionMode mode1, GnssPositionMode mode2) {
- if (mode1.equals(mode2)) {
- assertThat(mode1.hashCode()).isEqualTo(mode2.hashCode());
- }
- }
-
- private GnssPositionMode createGnssPositionMode(int mode, int minInterval) {
- return new GnssPositionMode(mode, 0, minInterval, 0, 0, true);
- }
-}
diff --git a/services/tests/mockingservicestests/src/com/android/server/alarm/AlarmManagerServiceTest.java b/services/tests/mockingservicestests/src/com/android/server/alarm/AlarmManagerServiceTest.java
index 8e4942e..8edac4f 100644
--- a/services/tests/mockingservicestests/src/com/android/server/alarm/AlarmManagerServiceTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/alarm/AlarmManagerServiceTest.java
@@ -121,6 +121,7 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.concurrent.Executor;
+import java.util.concurrent.atomic.AtomicInteger;
@Presubmit
@RunWith(AndroidJUnit4.class)
@@ -1133,6 +1134,38 @@
}
}
+ /**
+ * This tests that all non wakeup alarms are sent even when the mPendingNonWakeupAlarms gets
+ * modified before the send is complete. This avoids bugs like b/175701084.
+ */
+ @Test
+ public void allNonWakeupAlarmsSentAtomically() throws Exception {
+ final int numAlarms = 5;
+ final AtomicInteger alarmsFired = new AtomicInteger(0);
+ for (int i = 0; i < numAlarms; i++) {
+ final IAlarmListener listener = new IAlarmListener.Stub() {
+ @Override
+ public void doAlarm(IAlarmCompleteListener callback) throws RemoteException {
+ alarmsFired.incrementAndGet();
+ mService.mPendingNonWakeupAlarms.clear();
+ }
+ };
+ setTestAlarmWithListener(ELAPSED_REALTIME, mNowElapsedTest + i + 5, listener);
+ }
+ doReturn(true).when(mService).checkAllowNonWakeupDelayLocked(anyLong());
+ // Advance time past all expirations.
+ mNowElapsedTest += numAlarms + 5;
+ mTestTimer.expire();
+ assertEquals(numAlarms, mService.mPendingNonWakeupAlarms.size());
+
+ // All of these alarms should be sent on interactive state change to true
+ mService.interactiveStateChangedLocked(false);
+ mService.interactiveStateChangedLocked(true);
+
+ assertEquals(numAlarms, alarmsFired.get());
+ assertEquals(0, mService.mPendingNonWakeupAlarms.size());
+ }
+
@Test
public void alarmCountOnPendingNonWakeupAlarmsRemoved() throws Exception {
final int numAlarms = 10;
diff --git a/services/tests/mockingservicestests/src/com/android/server/appop/AppOpsUpgradeTest.java b/services/tests/mockingservicestests/src/com/android/server/appop/AppOpsUpgradeTest.java
index 9f895c6..99693d2 100644
--- a/services/tests/mockingservicestests/src/com/android/server/appop/AppOpsUpgradeTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/appop/AppOpsUpgradeTest.java
@@ -36,7 +36,6 @@
import android.util.Log;
import android.util.SparseArray;
import android.util.TypedXmlPullParser;
-import android.util.TypedXmlSerializer;
import android.util.Xml;
import androidx.test.InstrumentationRegistry;
@@ -53,7 +52,6 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
/**
* Tests app ops version upgrades
@@ -183,8 +181,7 @@
boolean parse() {
try (FileInputStream stream = new FileInputStream(mFile)) {
- TypedXmlPullParser parser = Xml.newFastPullParser();
- parser.setInput(stream, StandardCharsets.UTF_8.name());
+ TypedXmlPullParser parser = Xml.resolvePullParser(stream);
int type;
while ((type = parser.next()) != XmlPullParser.START_TAG
&& type != XmlPullParser.END_DOCUMENT) {
diff --git a/services/tests/mockingservicestests/src/com/android/server/job/controllers/QuotaControllerTest.java b/services/tests/mockingservicestests/src/com/android/server/job/controllers/QuotaControllerTest.java
index 344a19a..05f1ed8 100644
--- a/services/tests/mockingservicestests/src/com/android/server/job/controllers/QuotaControllerTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/job/controllers/QuotaControllerTest.java
@@ -209,7 +209,8 @@
ArgumentCaptor.forClass(BroadcastReceiver.class);
ArgumentCaptor<IUidObserver> uidObserverCaptor =
ArgumentCaptor.forClass(IUidObserver.class);
- mQuotaController = new QuotaController(mJobSchedulerService);
+ mQuotaController = new QuotaController(mJobSchedulerService,
+ mock(BackgroundJobsController.class), mock(ConnectivityController.class));
verify(mContext).registerReceiver(receiverCaptor.capture(), any());
mChargingReceiver = receiverCaptor.getValue();
diff --git a/services/tests/mockingservicestests/src/com/android/server/location/gnss/GnssGeofenceProxyTest.java b/services/tests/mockingservicestests/src/com/android/server/location/gnss/GnssGeofenceProxyTest.java
new file mode 100644
index 0000000..b480f24
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/location/gnss/GnssGeofenceProxyTest.java
@@ -0,0 +1,134 @@
+/*
+ * 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.location.gnss;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.platform.test.annotations.Presubmit;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.server.location.gnss.hal.FakeGnssHal;
+import com.android.server.location.gnss.hal.GnssNative;
+import com.android.server.location.injector.TestInjector;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+import java.util.Objects;
+
+@Presubmit
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class GnssGeofenceProxyTest {
+
+ private static final int GEOFENCE_ID = 12345;
+ private static final double LATITUDE = 10.0;
+ private static final double LONGITUDE = 20.0;
+ private static final double RADIUS = 5.0;
+ private static final int LAST_TRANSITION = 0;
+ private static final int MONITOR_TRANSITIONS = 0;
+ private static final int NOTIFICATION_RESPONSIVENESS = 0;
+ private static final int UNKNOWN_TIMER = 0;
+
+ private @Mock GnssConfiguration mMockConfiguration;
+ private @Mock GnssNative.GeofenceCallbacks mGeofenceCallbacks;
+
+ private FakeGnssHal mFakeHal;
+ private GnssGeofenceProxy mTestProvider;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+
+ mFakeHal = new FakeGnssHal();
+ GnssNative.setGnssHalForTest(mFakeHal);
+
+ GnssNative gnssNative = Objects.requireNonNull(
+ GnssNative.create(new TestInjector(), mMockConfiguration));
+ gnssNative.setGeofenceCallbacks(mGeofenceCallbacks);
+ mTestProvider = new GnssGeofenceProxy(gnssNative);
+ gnssNative.register();
+
+ mTestProvider.addCircularHardwareGeofence(GEOFENCE_ID, LATITUDE, LONGITUDE, RADIUS,
+ LAST_TRANSITION, MONITOR_TRANSITIONS, NOTIFICATION_RESPONSIVENESS, UNKNOWN_TIMER);
+ }
+
+ @Test
+ public void testAddGeofence() {
+ assertThat(mFakeHal.getGeofences()).containsExactly(new FakeGnssHal.GnssHalGeofence(
+ GEOFENCE_ID, LATITUDE, LONGITUDE, RADIUS, LAST_TRANSITION, MONITOR_TRANSITIONS,
+ NOTIFICATION_RESPONSIVENESS, UNKNOWN_TIMER, false));
+ }
+
+ @Test
+ public void testRemoveGeofence() {
+ mTestProvider.removeHardwareGeofence(GEOFENCE_ID);
+
+ assertThat(mFakeHal.getGeofences()).isEmpty();
+ }
+
+ @Test
+ public void testPauseGeofence() {
+ mTestProvider.pauseHardwareGeofence(GEOFENCE_ID);
+
+ assertThat(mFakeHal.getGeofences()).containsExactly(new FakeGnssHal.GnssHalGeofence(
+ GEOFENCE_ID, LATITUDE, LONGITUDE, RADIUS, LAST_TRANSITION, MONITOR_TRANSITIONS,
+ NOTIFICATION_RESPONSIVENESS, UNKNOWN_TIMER, true));
+ }
+
+ @Test
+ public void testResumeGeofence() {
+ mTestProvider.pauseHardwareGeofence(GEOFENCE_ID);
+ mTestProvider.resumeHardwareGeofence(GEOFENCE_ID, MONITOR_TRANSITIONS);
+
+ assertThat(mFakeHal.getGeofences()).containsExactly(new FakeGnssHal.GnssHalGeofence(
+ GEOFENCE_ID, LATITUDE, LONGITUDE, RADIUS, LAST_TRANSITION, MONITOR_TRANSITIONS,
+ NOTIFICATION_RESPONSIVENESS, UNKNOWN_TIMER, false));
+ }
+
+ @Test
+ public void testAddGeofence_restart() {
+ mFakeHal.restartHal();
+
+ assertThat(mFakeHal.getGeofences()).containsExactly(new FakeGnssHal.GnssHalGeofence(
+ GEOFENCE_ID, LATITUDE, LONGITUDE, RADIUS, LAST_TRANSITION, MONITOR_TRANSITIONS,
+ NOTIFICATION_RESPONSIVENESS, UNKNOWN_TIMER, false));
+ }
+
+ @Test
+ public void testRemoveGeofence_restart() {
+ mTestProvider.removeHardwareGeofence(GEOFENCE_ID);
+ mFakeHal.restartHal();
+
+ assertThat(mFakeHal.getGeofences()).isEmpty();
+ }
+
+ @Test
+ public void testPauseGeofence_restart() {
+ mTestProvider.pauseHardwareGeofence(GEOFENCE_ID);
+ mFakeHal.restartHal();
+
+ assertThat(mFakeHal.getGeofences()).containsExactly(new FakeGnssHal.GnssHalGeofence(
+ GEOFENCE_ID, LATITUDE, LONGITUDE, RADIUS, LAST_TRANSITION, MONITOR_TRANSITIONS,
+ NOTIFICATION_RESPONSIVENESS, UNKNOWN_TIMER, true));
+ }
+}
diff --git a/services/tests/mockingservicestests/src/com/android/server/location/gnss/GnssManagerServiceTest.java b/services/tests/mockingservicestests/src/com/android/server/location/gnss/GnssManagerServiceTest.java
deleted file mode 100644
index 2b21cc5..0000000
--- a/services/tests/mockingservicestests/src/com/android/server/location/gnss/GnssManagerServiceTest.java
+++ /dev/null
@@ -1,682 +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.location.gnss;
-
-import static android.app.AppOpsManager.OP_COARSE_LOCATION;
-import static android.app.AppOpsManager.OP_FINE_LOCATION;
-import static android.location.LocationManager.GPS_PROVIDER;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.anyLong;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.ArgumentMatchers.nullable;
-import static org.mockito.Mockito.after;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.timeout;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-import static org.testng.Assert.assertThrows;
-
-import android.Manifest;
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.location.GnssAntennaInfo;
-import android.location.GnssAntennaInfo.SphericalCorrections;
-import android.location.GnssClock;
-import android.location.GnssMeasurementCorrections;
-import android.location.GnssMeasurementRequest;
-import android.location.GnssMeasurementsEvent;
-import android.location.GnssNavigationMessage;
-import android.location.GnssSingleSatCorrection;
-import android.location.IGnssAntennaInfoListener;
-import android.location.IGnssMeasurementsListener;
-import android.location.IGnssNavigationMessageListener;
-import android.location.IGnssStatusListener;
-import android.location.INetInitiatedListener;
-import android.location.LocationManagerInternal;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.IInterface;
-import android.os.Message;
-import android.os.RemoteException;
-
-import com.android.server.LocalServices;
-import com.android.server.location.gnss.GnssAntennaInfoProvider.GnssAntennaInfoProviderNative;
-import com.android.server.location.gnss.GnssMeasurementsProvider.GnssMeasurementProviderNative;
-import com.android.server.location.gnss.GnssNavigationMessageProvider.GnssNavigationMessageProviderNative;
-import com.android.server.location.injector.TestInjector;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.AdditionalMatchers;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.mockito.invocation.InvocationOnMock;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Unit tests for {@link com.android.server.location.gnss.GnssManagerService}.
- */
-public class GnssManagerServiceTest {
-
- private static final long TIMEOUT_MS = 5000;
- private static final long FAILURE_TIMEOUT_MS = 200;
-
- private static final String TEST_PACKAGE = "com.test";
-
- private TestInjector mInjector;
-
- @Mock private Handler mMockHandler;
- @Mock private Context mMockContext;
- @Mock private PackageManager mPackageManager;
- @Mock private LocationManagerInternal mLocationManagerInternal;
- @Mock private GnssNative.GnssNativeInitNative mGnssInitNative;
- @Mock private GnssLocationProvider mMockGnssLocationProvider;
- @Mock private GnssLocationProvider.GnssSystemInfoProvider mMockGnssSystemInfoProvider;
- @Mock private GnssCapabilitiesProvider mMockGnssCapabilitiesProvider;
- @Mock private GnssMeasurementCorrectionsProvider mMockGnssMeasurementCorrectionsProvider;
- @Mock private INetInitiatedListener mNetInitiatedListener;
-
- private GnssMeasurementsProvider mTestGnssMeasurementsProvider;
- private GnssStatusProvider mTestGnssStatusProvider;
- private GnssNavigationMessageProvider mTestGnssNavigationMessageProvider;
- private GnssAntennaInfoProvider mTestGnssAntennaInfoProvider;
-
- private GnssManagerService mGnssManagerService;
-
- @Before
- public void setUp() {
- MockitoAnnotations.initMocks(this);
-
- when(mGnssInitNative.isSupported()).thenReturn(true);
- GnssNative.setInitNativeForTest(mGnssInitNative);
- GnssNative.resetCallbacksForTest();
-
- when(mMockContext.createAttributionContext(anyString())).thenReturn(mMockContext);
- when(mMockContext.getPackageManager()).thenReturn(mPackageManager);
- when(mPackageManager.getPackagesForUid(anyInt())).thenReturn(
- new String[]{TEST_PACKAGE});
-
- mInjector = new TestInjector();
-
- enableLocationPermissions();
-
- LocalServices.addService(LocationManagerInternal.class, mLocationManagerInternal);
-
- // Mock Handler will execute posted runnables immediately
- when(mMockHandler.sendMessageAtTime(any(Message.class), anyLong())).thenAnswer(
- (InvocationOnMock invocation) -> {
- Message msg = (Message) (invocation.getArguments()[0]);
- msg.getCallback().run();
- return null;
- });
-
- // Setup providers
- mTestGnssMeasurementsProvider = createGnssMeasurementsProvider();
- mTestGnssStatusProvider = createGnssStatusListenerHelper();
- mTestGnssNavigationMessageProvider = createGnssNavigationMessageProvider();
- mTestGnssAntennaInfoProvider = createGnssAntennaInfoProvider();
-
- // Setup GnssLocationProvider to return providers
- when(mMockGnssLocationProvider.getGnssStatusProvider()).thenReturn(
- mTestGnssStatusProvider);
- when(mMockGnssLocationProvider.getGnssCapabilitiesProvider()).thenReturn(
- mMockGnssCapabilitiesProvider);
- when(mMockGnssLocationProvider.getGnssSystemInfoProvider()).thenReturn(
- mMockGnssSystemInfoProvider);
- when(mMockGnssLocationProvider.getGnssMeasurementCorrectionsProvider()).thenReturn(
- mMockGnssMeasurementCorrectionsProvider);
- when(mMockGnssLocationProvider.getGnssMeasurementsProvider()).thenReturn(
- mTestGnssMeasurementsProvider);
- when(mMockGnssLocationProvider.getGnssNavigationMessageProvider()).thenReturn(
- mTestGnssNavigationMessageProvider);
- when(mMockGnssLocationProvider.getNetInitiatedListener()).thenReturn(
- mNetInitiatedListener);
- when(mMockGnssLocationProvider.getGnssAntennaInfoProvider()).thenReturn(
- mTestGnssAntennaInfoProvider);
-
- // Create GnssManagerService
- mGnssManagerService = new GnssManagerService(mMockContext, mInjector,
- mMockGnssLocationProvider);
- mGnssManagerService.onSystemReady();
- }
-
- @After
- public void tearDown() {
- LocalServices.removeServiceForTest(LocationManagerInternal.class);
- }
-
- private void overrideAsBinder(IInterface mockListener) {
- IBinder mockBinder = mock(IBinder.class);
- when(mockListener.asBinder()).thenReturn(mockBinder);
- }
-
- private IGnssStatusListener createMockGnssStatusListener() {
- IGnssStatusListener mockListener = mock(IGnssStatusListener.class);
- overrideAsBinder(mockListener);
- return mockListener;
- }
-
- private IGnssMeasurementsListener createMockGnssMeasurementsListener() {
- IGnssMeasurementsListener mockListener = mock(
- IGnssMeasurementsListener.class);
- overrideAsBinder(mockListener);
- return mockListener;
- }
-
- private IGnssAntennaInfoListener createMockGnssAntennaInfoListener() {
- IGnssAntennaInfoListener mockListener = mock(IGnssAntennaInfoListener.class);
- overrideAsBinder(mockListener);
- return mockListener;
- }
-
- private IGnssNavigationMessageListener createMockGnssNavigationMessageListener() {
- IGnssNavigationMessageListener mockListener = mock(IGnssNavigationMessageListener.class);
- overrideAsBinder(mockListener);
- return mockListener;
- }
-
- private GnssMeasurementCorrections createDummyGnssMeasurementCorrections() {
- GnssSingleSatCorrection gnssSingleSatCorrection =
- new GnssSingleSatCorrection.Builder().build();
- return
- new GnssMeasurementCorrections.Builder().setSingleSatelliteCorrectionList(
- Collections.singletonList(gnssSingleSatCorrection)).build();
- }
-
- private static List<GnssAntennaInfo> createDummyGnssAntennaInfos() {
- double carrierFrequencyMHz = 13758.0;
-
- GnssAntennaInfo.PhaseCenterOffset phaseCenterOffset = new
- GnssAntennaInfo.PhaseCenterOffset(
- 4.3d,
- 1.4d,
- 2.10d,
- 2.1d,
- 3.12d,
- 0.5d);
-
- double[][] phaseCenterVariationCorrectionsMillimeters = new double[10][10];
- double[][] phaseCenterVariationCorrectionsUncertaintyMillimeters = new double[10][10];
- SphericalCorrections
- phaseCenterVariationCorrections =
- new SphericalCorrections(
- phaseCenterVariationCorrectionsMillimeters,
- phaseCenterVariationCorrectionsUncertaintyMillimeters);
-
- double[][] signalGainCorrectionsDbi = new double[10][10];
- double[][] signalGainCorrectionsUncertaintyDbi = new double[10][10];
- SphericalCorrections signalGainCorrections = new
- SphericalCorrections(
- signalGainCorrectionsDbi,
- signalGainCorrectionsUncertaintyDbi);
-
- List<GnssAntennaInfo> gnssAntennaInfos = new ArrayList<>();
- gnssAntennaInfos.add(new GnssAntennaInfo.Builder()
- .setCarrierFrequencyMHz(carrierFrequencyMHz)
- .setPhaseCenterOffset(phaseCenterOffset)
- .setPhaseCenterVariationCorrections(phaseCenterVariationCorrections)
- .setSignalGainCorrections(signalGainCorrections)
- .build());
- return gnssAntennaInfos;
- }
-
- private void enableLocationPermissions() {
- Mockito.doThrow(new SecurityException()).when(
- mMockContext).enforceCallingOrSelfPermission(
- AdditionalMatchers.and(
- AdditionalMatchers.not(eq(Manifest.permission.LOCATION_HARDWARE)),
- AdditionalMatchers.not(eq(Manifest.permission.ACCESS_FINE_LOCATION))),
- anyString());
- when(mMockContext.checkPermission(
- eq(android.Manifest.permission.LOCATION_HARDWARE), anyInt(), anyInt())).thenReturn(
- PackageManager.PERMISSION_GRANTED);
- when(mMockContext.checkPermission(
- eq(Manifest.permission.ACCESS_FINE_LOCATION), anyInt(), anyInt())).thenReturn(
- PackageManager.PERMISSION_GRANTED);
- when(mMockContext.checkPermission(
- eq(Manifest.permission.ACCESS_COARSE_LOCATION), anyInt(), anyInt())).thenReturn(
- PackageManager.PERMISSION_GRANTED);
-
- mInjector.getAppOpsHelper().setAppOpAllowed(OP_FINE_LOCATION, TEST_PACKAGE, true);
- mInjector.getAppOpsHelper().setAppOpAllowed(OP_COARSE_LOCATION, TEST_PACKAGE, true);
-
- when(mLocationManagerInternal.isProviderEnabledForUser(eq(GPS_PROVIDER), anyInt()))
- .thenReturn(true);
- }
-
- private void disableLocationPermissions() {
- Mockito.doThrow(new SecurityException()).when(
- mMockContext).enforceCallingOrSelfPermission(anyString(), nullable(String.class));
-
- when(mMockContext.checkPermission(
- anyString(), anyInt(), anyInt())).thenReturn(
- PackageManager.PERMISSION_DENIED);
-
- mInjector.getAppOpsHelper().setAppOpAllowed(OP_FINE_LOCATION, TEST_PACKAGE, false);
- mInjector.getAppOpsHelper().setAppOpAllowed(OP_COARSE_LOCATION, TEST_PACKAGE, false);
-
- when(mLocationManagerInternal.isProviderEnabledForUser(eq(GPS_PROVIDER), anyInt()))
- .thenReturn(false);
- }
-
- private GnssStatusProvider createGnssStatusListenerHelper() {
- return new GnssStatusProvider(mInjector);
- }
-
- private GnssMeasurementsProvider createGnssMeasurementsProvider() {
- GnssMeasurementProviderNative
- mockGnssMeasurementProviderNative = mock(GnssMeasurementProviderNative.class);
- when(mockGnssMeasurementProviderNative.isMeasurementSupported()).thenReturn(
- true);
- return new GnssMeasurementsProvider(mInjector, mockGnssMeasurementProviderNative);
- }
-
- private GnssNavigationMessageProvider createGnssNavigationMessageProvider() {
- GnssNavigationMessageProviderNative mockGnssNavigationMessageProviderNative = mock(
- GnssNavigationMessageProviderNative.class);
- when(mockGnssNavigationMessageProviderNative.isNavigationMessageSupported()).thenReturn(
- true);
- return new GnssNavigationMessageProvider(mInjector,
- mockGnssNavigationMessageProviderNative);
- }
-
- private GnssAntennaInfoProvider createGnssAntennaInfoProvider() {
- GnssAntennaInfoProviderNative mockGnssAntenaInfoProviderNative = mock(
- GnssAntennaInfoProviderNative.class);
- when(mockGnssAntenaInfoProviderNative.isAntennaInfoSupported()).thenReturn(
- true);
- return new GnssAntennaInfoProvider(mInjector, mockGnssAntenaInfoProviderNative);
- }
-
- @Test
- public void getGnssYearOfHardwareTest() {
- final int gnssYearOfHardware = 2012;
- when(mMockGnssSystemInfoProvider.getGnssYearOfHardware()).thenReturn(gnssYearOfHardware);
- enableLocationPermissions();
-
- assertThat(mGnssManagerService.getGnssYearOfHardware()).isEqualTo(gnssYearOfHardware);
- }
-
- @Test
- public void getGnssHardwareModelNameTest() {
- final String gnssHardwareModelName = "hardwarename";
- when(mMockGnssSystemInfoProvider.getGnssHardwareModelName()).thenReturn(
- gnssHardwareModelName);
- enableLocationPermissions();
-
- assertThat(mGnssManagerService.getGnssHardwareModelName()).isEqualTo(
- gnssHardwareModelName);
- }
-
- @Test
- public void getGnssCapabilitiesWithPermissionsTest() {
- final long mGnssCapabilities = 23132L;
- when(mMockGnssCapabilitiesProvider.getGnssCapabilities()).thenReturn(mGnssCapabilities);
- enableLocationPermissions();
-
- assertThat(mGnssManagerService.getGnssCapabilities()).isEqualTo(mGnssCapabilities);
- }
-
- @Test
- public void registerGnssStatusCallbackWithoutPermissionsTest() throws RemoteException {
- final int timeToFirstFix = 20000;
- IGnssStatusListener mockGnssStatusListener = createMockGnssStatusListener();
-
- disableLocationPermissions();
-
- assertThrows(SecurityException.class, () -> mGnssManagerService
- .registerGnssStatusCallback(
- mockGnssStatusListener, TEST_PACKAGE, "abcd123"));
-
- mTestGnssStatusProvider.onFirstFix(timeToFirstFix);
-
- verify(mockGnssStatusListener, after(FAILURE_TIMEOUT_MS).times(0)).onFirstFix(
- timeToFirstFix);
- }
-
- @Test
- public void registerGnssStatusCallbackWithPermissionsTest() throws RemoteException {
- final int timeToFirstFix = 20000;
- IGnssStatusListener mockGnssStatusListener = createMockGnssStatusListener();
-
- enableLocationPermissions();
-
- mGnssManagerService.registerGnssStatusCallback(
- mockGnssStatusListener, TEST_PACKAGE, "abcd123");
-
- mTestGnssStatusProvider.onFirstFix(timeToFirstFix);
-
- verify(mockGnssStatusListener, timeout(TIMEOUT_MS).times(1)).onFirstFix(timeToFirstFix);
- }
-
- @Test
- public void unregisterGnssStatusCallbackWithPermissionsTest() throws RemoteException {
- final int timeToFirstFix = 20000;
- IGnssStatusListener mockGnssStatusListener = createMockGnssStatusListener();
-
- enableLocationPermissions();
-
- mGnssManagerService.registerGnssStatusCallback(
- mockGnssStatusListener, TEST_PACKAGE, "abcd123");
-
- mGnssManagerService.unregisterGnssStatusCallback(mockGnssStatusListener);
-
- mTestGnssStatusProvider.onFirstFix(timeToFirstFix);
-
- verify(mockGnssStatusListener, after(FAILURE_TIMEOUT_MS).times(0)).onFirstFix(
- timeToFirstFix);
- }
-
- @Test
- public void addGnssMeasurementsListenerWithoutPermissionsTest() throws RemoteException {
- IGnssMeasurementsListener mockGnssMeasurementsListener =
- createMockGnssMeasurementsListener();
- GnssMeasurementsEvent gnssMeasurementsEvent = new GnssMeasurementsEvent(new GnssClock(),
- null);
-
- disableLocationPermissions();
-
- assertThrows(SecurityException.class,
- () -> mGnssManagerService.addGnssMeasurementsListener(
- new GnssMeasurementRequest.Builder().build(), mockGnssMeasurementsListener,
- TEST_PACKAGE, null));
-
- mTestGnssMeasurementsProvider.onMeasurementsAvailable(gnssMeasurementsEvent);
- verify(mockGnssMeasurementsListener,
- after(FAILURE_TIMEOUT_MS).times(0)).onGnssMeasurementsReceived(
- gnssMeasurementsEvent);
- }
-
- @Test
- public void addGnssMeasurementsListenerWithPermissionsTest() throws RemoteException {
- IGnssMeasurementsListener mockGnssMeasurementsListener =
- createMockGnssMeasurementsListener();
- GnssMeasurementsEvent gnssMeasurementsEvent = new GnssMeasurementsEvent(new GnssClock(),
- null);
-
- enableLocationPermissions();
-
- mGnssManagerService.addGnssMeasurementsListener(
- new GnssMeasurementRequest.Builder().build(),
- mockGnssMeasurementsListener,
- TEST_PACKAGE, null);
-
- mTestGnssMeasurementsProvider.onMeasurementsAvailable(gnssMeasurementsEvent);
- verify(mockGnssMeasurementsListener,
- timeout(TIMEOUT_MS).times(1)).onGnssMeasurementsReceived(
- gnssMeasurementsEvent);
- }
-
- @Test
- public void injectGnssMeasurementCorrectionsWithoutPermissionsTest() {
- GnssMeasurementCorrections gnssMeasurementCorrections =
- createDummyGnssMeasurementCorrections();
-
- disableLocationPermissions();
-
- assertThrows(SecurityException.class,
- () -> mGnssManagerService.injectGnssMeasurementCorrections(
- gnssMeasurementCorrections));
- verify(mMockGnssMeasurementCorrectionsProvider, times(0))
- .injectGnssMeasurementCorrections(
- gnssMeasurementCorrections);
- }
-
- @Test
- public void injectGnssMeasurementCorrectionsWithPermissionsTest() {
- GnssMeasurementCorrections gnssMeasurementCorrections =
- createDummyGnssMeasurementCorrections();
-
- enableLocationPermissions();
-
- mGnssManagerService.injectGnssMeasurementCorrections(
- gnssMeasurementCorrections);
- verify(mMockGnssMeasurementCorrectionsProvider, times(1))
- .injectGnssMeasurementCorrections(
- gnssMeasurementCorrections);
- }
-
- @Test
- public void removeGnssMeasurementsListenerWithoutPermissionsTest() throws RemoteException {
- IGnssMeasurementsListener mockGnssMeasurementsListener =
- createMockGnssMeasurementsListener();
- GnssMeasurementsEvent gnssMeasurementsEvent = new GnssMeasurementsEvent(new GnssClock(),
- null);
-
- enableLocationPermissions();
-
- mGnssManagerService.addGnssMeasurementsListener(
- new GnssMeasurementRequest.Builder().build(),
- mockGnssMeasurementsListener,
- TEST_PACKAGE, null);
-
- disableLocationPermissions();
-
- mGnssManagerService.removeGnssMeasurementsListener(
- mockGnssMeasurementsListener);
-
- mTestGnssMeasurementsProvider.onMeasurementsAvailable(gnssMeasurementsEvent);
- verify(mockGnssMeasurementsListener,
- after(FAILURE_TIMEOUT_MS).times(0)).onGnssMeasurementsReceived(
- gnssMeasurementsEvent);
- }
-
- @Test
- public void removeGnssMeasurementsListenerWithPermissionsTest() throws RemoteException {
- IGnssMeasurementsListener mockGnssMeasurementsListener =
- createMockGnssMeasurementsListener();
- GnssMeasurementsEvent gnssMeasurementsEvent = new GnssMeasurementsEvent(new GnssClock(),
- null);
-
- enableLocationPermissions();
-
- mGnssManagerService.addGnssMeasurementsListener(
- new GnssMeasurementRequest.Builder().build(),
- mockGnssMeasurementsListener,
- TEST_PACKAGE, null);
-
- disableLocationPermissions();
-
- mGnssManagerService.removeGnssMeasurementsListener(
- mockGnssMeasurementsListener);
-
- mTestGnssMeasurementsProvider.onMeasurementsAvailable(gnssMeasurementsEvent);
- verify(mockGnssMeasurementsListener,
- after(FAILURE_TIMEOUT_MS).times(0)).onGnssMeasurementsReceived(
- gnssMeasurementsEvent);
- }
-
- @Test
- public void addGnssAntennaInfoListenerWithoutPermissionsTest() throws RemoteException {
- IGnssAntennaInfoListener mockGnssAntennaInfoListener =
- createMockGnssAntennaInfoListener();
- List<GnssAntennaInfo> gnssAntennaInfos = createDummyGnssAntennaInfos();
-
- disableLocationPermissions();
-
- assertThrows(SecurityException.class,
- () -> mGnssManagerService.addGnssAntennaInfoListener(
- mockGnssAntennaInfoListener,
- TEST_PACKAGE, null));
-
- mTestGnssAntennaInfoProvider.onGnssAntennaInfoAvailable(gnssAntennaInfos);
- verify(mockGnssAntennaInfoListener, after(FAILURE_TIMEOUT_MS).times(0))
- .onGnssAntennaInfoReceived(gnssAntennaInfos);
- }
-
- @Test
- public void addGnssAntennaInfoListenerWithPermissionsTest() throws RemoteException {
- IGnssAntennaInfoListener mockGnssAntennaInfoListener =
- createMockGnssAntennaInfoListener();
- List<GnssAntennaInfo> gnssAntennaInfos = createDummyGnssAntennaInfos();
-
- enableLocationPermissions();
-
- mGnssManagerService.addGnssAntennaInfoListener(mockGnssAntennaInfoListener,
- TEST_PACKAGE, null);
-
- mTestGnssAntennaInfoProvider.onGnssAntennaInfoAvailable(gnssAntennaInfos);
- verify(mockGnssAntennaInfoListener, timeout(TIMEOUT_MS).times(1))
- .onGnssAntennaInfoReceived(gnssAntennaInfos);
- }
-
- @Test
- public void removeGnssAntennaInfoListenerWithoutPermissionsTest() throws RemoteException {
- IGnssAntennaInfoListener mockGnssAntennaInfoListener =
- createMockGnssAntennaInfoListener();
- List<GnssAntennaInfo> gnssAntennaInfos = createDummyGnssAntennaInfos();
-
- enableLocationPermissions();
-
- mGnssManagerService.addGnssAntennaInfoListener(
- mockGnssAntennaInfoListener,
- TEST_PACKAGE, null);
-
- disableLocationPermissions();
-
- mGnssManagerService.removeGnssAntennaInfoListener(
- mockGnssAntennaInfoListener);
-
- mTestGnssAntennaInfoProvider.onGnssAntennaInfoAvailable(gnssAntennaInfos);
- verify(mockGnssAntennaInfoListener, after(FAILURE_TIMEOUT_MS).times(0))
- .onGnssAntennaInfoReceived(gnssAntennaInfos);
- }
-
- @Test
- public void removeGnssAntennaInfoListenerWithPermissionsTest() throws RemoteException {
- IGnssAntennaInfoListener mockGnssAntennaInfoListener =
- createMockGnssAntennaInfoListener();
- List<GnssAntennaInfo> gnssAntennaInfos = createDummyGnssAntennaInfos();
-
- enableLocationPermissions();
-
- mGnssManagerService.addGnssAntennaInfoListener(
- mockGnssAntennaInfoListener,
- TEST_PACKAGE, null);
-
- mGnssManagerService.removeGnssAntennaInfoListener(
- mockGnssAntennaInfoListener);
-
- mTestGnssAntennaInfoProvider.onGnssAntennaInfoAvailable(gnssAntennaInfos);
- verify(mockGnssAntennaInfoListener,
- after(FAILURE_TIMEOUT_MS).times(0)).onGnssAntennaInfoReceived(
- gnssAntennaInfos);
- }
-
- @Test
- public void addGnssNavigationMessageListenerWithoutPermissionsTest() throws RemoteException {
- IGnssNavigationMessageListener mockGnssNavigationMessageListener =
- createMockGnssNavigationMessageListener();
- GnssNavigationMessage gnssNavigationMessage = new GnssNavigationMessage();
-
- disableLocationPermissions();
-
- assertThrows(SecurityException.class,
- () -> mGnssManagerService.addGnssNavigationMessageListener(
- mockGnssNavigationMessageListener, TEST_PACKAGE, null));
-
- mTestGnssNavigationMessageProvider.onNavigationMessageAvailable(gnssNavigationMessage);
-
- verify(mockGnssNavigationMessageListener,
- after(FAILURE_TIMEOUT_MS).times(0)).onGnssNavigationMessageReceived(
- gnssNavigationMessage);
- }
-
- @Test
- public void addGnssNavigationMessageListenerWithPermissionsTest() throws RemoteException {
- IGnssNavigationMessageListener mockGnssNavigationMessageListener =
- createMockGnssNavigationMessageListener();
- GnssNavigationMessage gnssNavigationMessage = new GnssNavigationMessage();
-
- enableLocationPermissions();
-
- mGnssManagerService.addGnssNavigationMessageListener(
- mockGnssNavigationMessageListener, TEST_PACKAGE, null);
-
- mTestGnssNavigationMessageProvider.onNavigationMessageAvailable(gnssNavigationMessage);
-
- verify(mockGnssNavigationMessageListener,
- timeout(TIMEOUT_MS).times(1)).onGnssNavigationMessageReceived(
- gnssNavigationMessage);
- }
-
- @Test
- public void removeGnssNavigationMessageListenerWithoutPermissionsTest() throws RemoteException {
- IGnssNavigationMessageListener mockGnssNavigationMessageListener =
- createMockGnssNavigationMessageListener();
- GnssNavigationMessage gnssNavigationMessage = new GnssNavigationMessage();
-
- enableLocationPermissions();
-
- mGnssManagerService.addGnssNavigationMessageListener(
- mockGnssNavigationMessageListener, TEST_PACKAGE, null);
-
- disableLocationPermissions();
-
- mGnssManagerService.removeGnssNavigationMessageListener(
- mockGnssNavigationMessageListener);
-
- mTestGnssNavigationMessageProvider.onNavigationMessageAvailable(gnssNavigationMessage);
-
- verify(mockGnssNavigationMessageListener,
- after(FAILURE_TIMEOUT_MS).times(0)).onGnssNavigationMessageReceived(
- gnssNavigationMessage);
- }
-
- @Test
- public void removeGnssNavigationMessageListenerWithPermissionsTest() throws RemoteException {
- IGnssNavigationMessageListener mockGnssNavigationMessageListener =
- createMockGnssNavigationMessageListener();
- GnssNavigationMessage gnssNavigationMessage = new GnssNavigationMessage();
-
- enableLocationPermissions();
-
- mGnssManagerService.addGnssNavigationMessageListener(
- mockGnssNavigationMessageListener, TEST_PACKAGE, null);
-
- mGnssManagerService.removeGnssNavigationMessageListener(
- mockGnssNavigationMessageListener);
-
- mTestGnssNavigationMessageProvider.onNavigationMessageAvailable(gnssNavigationMessage);
-
- verify(mockGnssNavigationMessageListener,
- after(FAILURE_TIMEOUT_MS).times(0)).onGnssNavigationMessageReceived(
- gnssNavigationMessage);
- }
-
- @Test
- public void sendNiResponseWithPermissionsTest() throws RemoteException {
- int notifId = 0;
- int userResponse = 0;
- enableLocationPermissions();
-
- mGnssManagerService.sendNiResponse(notifId, userResponse);
-
- verify(mNetInitiatedListener, times(1)).sendNiResponse(notifId, userResponse);
- }
-}
diff --git a/services/tests/mockingservicestests/src/com/android/server/location/gnss/hal/FakeGnssHal.java b/services/tests/mockingservicestests/src/com/android/server/location/gnss/hal/FakeGnssHal.java
new file mode 100644
index 0000000..675274b
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/location/gnss/hal/FakeGnssHal.java
@@ -0,0 +1,674 @@
+/*
+ * 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.location.gnss.hal;
+
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_LOCATION_HAS_ALTITUDE;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_LOCATION_HAS_BEARING;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_LOCATION_HAS_BEARING_ACCURACY;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_LOCATION_HAS_HORIZONTAL_ACCURACY;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_LOCATION_HAS_LAT_LONG;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_LOCATION_HAS_SPEED;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_LOCATION_HAS_SPEED_ACCURACY;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_LOCATION_HAS_VERTICAL_ACCURACY;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_REALTIME_HAS_TIMESTAMP_NS;
+import static com.android.server.location.gnss.hal.GnssNative.GNSS_REALTIME_HAS_TIME_UNCERTAINTY_NS;
+import static com.android.server.location.gnss.hal.GnssNative.GeofenceCallbacks.GEOFENCE_STATUS_ERROR_ID_EXISTS;
+import static com.android.server.location.gnss.hal.GnssNative.GeofenceCallbacks.GEOFENCE_STATUS_ERROR_ID_UNKNOWN;
+import static com.android.server.location.gnss.hal.GnssNative.GeofenceCallbacks.GEOFENCE_STATUS_OPERATION_SUCCESS;
+import static com.android.server.location.gnss.hal.GnssNative.GeofenceCallbacks.GEOFENCE_TRANSITION_ENTERED;
+import static com.android.server.location.gnss.hal.GnssNative.GeofenceCallbacks.GEOFENCE_TRANSITION_EXITED;
+
+import android.annotation.Nullable;
+import android.location.GnssAntennaInfo;
+import android.location.GnssMeasurementCorrections;
+import android.location.GnssMeasurementsEvent;
+import android.location.GnssNavigationMessage;
+import android.location.Location;
+
+import com.android.server.location.gnss.GnssPowerStats;
+import com.android.server.location.gnss.hal.GnssNative.GnssLocationFlags;
+import com.android.server.location.gnss.hal.GnssNative.GnssRealtimeFlags;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * Fake GNSS HAL for testing.
+ */
+public final class FakeGnssHal extends GnssNative.GnssHal {
+
+ public static class GnssHalPositionMode {
+
+ public final int Mode;
+ public final int Recurrence;
+ public final int MinInterval;
+ public final int PreferredAccuracy;
+ public final int PreferredTime;
+ public final boolean LowPowerMode;
+
+ GnssHalPositionMode() {
+ Mode = 0;
+ Recurrence = 0;
+ MinInterval = 0;
+ PreferredAccuracy = 0;
+ PreferredTime = 0;
+ LowPowerMode = false;
+ }
+
+ public GnssHalPositionMode(int mode, int recurrence, int minInterval, int preferredAccuracy,
+ int preferredTime, boolean lowPowerMode) {
+ Mode = mode;
+ Recurrence = recurrence;
+ MinInterval = minInterval;
+ PreferredAccuracy = preferredAccuracy;
+ PreferredTime = preferredTime;
+ LowPowerMode = lowPowerMode;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+
+ GnssHalPositionMode that = (GnssHalPositionMode) o;
+ return Mode == that.Mode
+ && Recurrence == that.Recurrence
+ && MinInterval == that.MinInterval
+ && PreferredAccuracy == that.PreferredAccuracy
+ && PreferredTime == that.PreferredTime
+ && LowPowerMode == that.LowPowerMode;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(Recurrence, MinInterval);
+ }
+ }
+
+ public static class GnssHalBatchingMode {
+
+ public final long PeriodNanos;
+ public final boolean WakeOnFifoFull;
+
+ GnssHalBatchingMode() {
+ PeriodNanos = 0;
+ WakeOnFifoFull = false;
+ }
+
+ public GnssHalBatchingMode(long periodNanos, boolean wakeOnFifoFull) {
+ PeriodNanos = periodNanos;
+ WakeOnFifoFull = wakeOnFifoFull;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+
+ GnssHalBatchingMode that = (GnssHalBatchingMode) o;
+ return PeriodNanos == that.PeriodNanos
+ && WakeOnFifoFull == that.WakeOnFifoFull;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(PeriodNanos, WakeOnFifoFull);
+ }
+ }
+
+ public static class GnssHalInjectedTime {
+
+ public final long Time;
+ public final long TimeReference;
+ public final int Uncertainty;
+
+ public GnssHalInjectedTime(long time, long timeReference, int uncertainty) {
+ Time = time;
+ TimeReference = timeReference;
+ Uncertainty = uncertainty;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+
+ GnssHalInjectedTime that = (GnssHalInjectedTime) o;
+ return Time == that.Time
+ && TimeReference == that.TimeReference
+ && Uncertainty == that.Uncertainty;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(Time);
+ }
+ }
+
+ public static class GnssHalGeofence {
+
+ public final int GeofenceId;
+ public final Location Center;
+ public final double Radius;
+ public int LastTransition;
+ public int MonitorTransitions;
+ public final int NotificationResponsiveness;
+ public final int UnknownTimer;
+ public boolean Paused;
+
+ public GnssHalGeofence(int geofenceId, double latitude, double longitude, double radius,
+ int lastTransition, int monitorTransitions, int notificationResponsiveness,
+ int unknownTimer, boolean paused) {
+ GeofenceId = geofenceId;
+ Center = new Location("");
+ Center.setLatitude(latitude);
+ Center.setLongitude(longitude);
+ Radius = radius;
+ LastTransition = lastTransition;
+ MonitorTransitions = monitorTransitions;
+ NotificationResponsiveness = notificationResponsiveness;
+ UnknownTimer = unknownTimer;
+ Paused = paused;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+
+ GnssHalGeofence that = (GnssHalGeofence) o;
+ return GeofenceId == that.GeofenceId
+ && Double.compare(that.Radius, Radius) == 0
+ && LastTransition == that.LastTransition
+ && MonitorTransitions == that.MonitorTransitions
+ && NotificationResponsiveness == that.NotificationResponsiveness
+ && UnknownTimer == that.UnknownTimer
+ && Paused == that.Paused
+ && Center.equals(that.Center);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(GeofenceId);
+ }
+ }
+
+ private static class HalState {
+ private boolean mStarted = false;
+ private boolean mBatchingStarted = false;
+ private boolean mNavigationMessagesStarted = false;
+ private boolean mAntennaInfoListeningStarted = false;
+ private boolean mMeasurementCollectionStarted = false;
+ private boolean mMeasurementCollectionFullTracking = false;
+ private GnssHalPositionMode mPositionMode = new GnssHalPositionMode();
+ private GnssHalBatchingMode mBatchingMode = new GnssHalBatchingMode();
+ private final ArrayList<Location> mBatchedLocations = new ArrayList<>();
+ private Location mInjectedLocation = null;
+ private Location mInjectedBestLocation = null;
+ private GnssHalInjectedTime mInjectedTime = null;
+ private GnssMeasurementCorrections mInjectedMeasurementCorrections = null;
+ private final HashMap<Integer, GnssHalGeofence> mGeofences = new HashMap<>();
+ private GnssPowerStats mPowerStats = new GnssPowerStats(0, 0, 0, 0, 0, 0, 0, 0,
+ new double[0]);
+ }
+
+ private @Nullable GnssNative mGnssNative;
+ private HalState mState = new HalState();
+
+ private boolean mIsNavigationMessageCollectionSupported = true;
+ private boolean mIsAntennaInfoListeningSupported = true;
+ private boolean mIsMeasurementSupported = true;
+ private boolean mIsMeasurementCorrectionsSupported = true;
+ private int mBatchSize = 0;
+ private boolean mIsGeofencingSupported = true;
+ private boolean mIsVisibilityControlSupported = true;
+
+ public FakeGnssHal() {}
+
+ public void restartHal() {
+ mState = new HalState();
+ Objects.requireNonNull(mGnssNative).restartHal();
+ }
+
+ public void setIsNavigationMessageCollectionSupported(boolean supported) {
+ mIsNavigationMessageCollectionSupported = supported;
+ }
+
+ public void setIsAntennaInfoListeningSupported(boolean supported) {
+ mIsAntennaInfoListeningSupported = supported;
+ }
+
+ public void setIsMeasurementSupported(boolean supported) {
+ mIsMeasurementSupported = supported;
+ }
+
+ public void setIsMeasurementCorrectionsSupported(boolean supported) {
+ mIsMeasurementCorrectionsSupported = supported;
+ }
+
+ public void setBatchSize(int batchSize) {
+ mBatchSize = batchSize;
+ }
+
+ public void setIsGeofencingSupported(boolean supported) {
+ mIsGeofencingSupported = supported;
+ }
+
+ public void setPowerStats(GnssPowerStats powerStats) {
+ mState.mPowerStats = powerStats;
+ }
+
+ public void setIsVisibilityControlSupported(boolean supported) {
+ mIsVisibilityControlSupported = supported;
+ }
+
+ public GnssHalPositionMode getPositionMode() {
+ return mState.mPositionMode;
+ }
+
+ public void reportLocation(Location location) {
+ if (mState.mStarted) {
+ Objects.requireNonNull(mGnssNative).reportLocation(true, location);
+ }
+ if (mState.mBatchingStarted) {
+ mState.mBatchedLocations.add(location);
+ if (mState.mBatchedLocations.size() >= mBatchSize) {
+ if (mState.mBatchingMode.WakeOnFifoFull) {
+ flushBatch();
+ } else {
+ mState.mBatchedLocations.remove(0);
+ }
+ }
+ }
+ for (GnssHalGeofence geofence : mState.mGeofences.values()) {
+ if (!geofence.Paused) {
+ if (geofence.Center.distanceTo(location) > geofence.Radius) {
+ if (geofence.LastTransition != GEOFENCE_TRANSITION_EXITED) {
+ geofence.LastTransition = GEOFENCE_TRANSITION_EXITED;
+ if ((geofence.MonitorTransitions & GEOFENCE_TRANSITION_EXITED) != 0) {
+ Objects.requireNonNull(mGnssNative).reportGeofenceTransition(
+ geofence.GeofenceId, location, GEOFENCE_TRANSITION_EXITED,
+ location.getTime());
+ }
+ }
+ } else {
+ if (geofence.LastTransition != GEOFENCE_TRANSITION_ENTERED) {
+ geofence.LastTransition = GEOFENCE_TRANSITION_ENTERED;
+ if ((geofence.MonitorTransitions & GEOFENCE_TRANSITION_ENTERED) != 0) {
+ Objects.requireNonNull(mGnssNative).reportGeofenceTransition(
+ geofence.GeofenceId, location, GEOFENCE_TRANSITION_ENTERED,
+ location.getTime());
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public void reportNavigationMessage(GnssNavigationMessage message) {
+ if (mState.mNavigationMessagesStarted) {
+ Objects.requireNonNull(mGnssNative).reportNavigationMessage(message);
+ }
+ }
+
+ public void reportAntennaInfo(List<GnssAntennaInfo> antennaInfos) {
+ if (mState.mAntennaInfoListeningStarted) {
+ Objects.requireNonNull(mGnssNative).reportAntennaInfo(antennaInfos);
+ }
+ }
+
+ public boolean isMeasurementCollectionFullTracking() {
+ return mState.mMeasurementCollectionFullTracking;
+ }
+
+ public void reportMeasurement(GnssMeasurementsEvent event) {
+ if (mState.mMeasurementCollectionStarted) {
+ Objects.requireNonNull(mGnssNative).reportMeasurementData(event);
+ }
+ }
+
+ public GnssHalInjectedTime getLastInjectedTime() {
+ return mState.mInjectedTime;
+ }
+
+ public GnssMeasurementCorrections getLastInjectedCorrections() {
+ return mState.mInjectedMeasurementCorrections;
+ }
+
+ public Collection<GnssHalGeofence> getGeofences() {
+ return mState.mGeofences.values();
+ }
+
+ @Override
+ protected void classInitOnce() {}
+
+ @Override
+ protected boolean isSupported() {
+ return true;
+ }
+
+ @Override
+ protected void initOnce(GnssNative gnssNative, boolean reinitializeGnssServiceHandle) {
+ mGnssNative = Objects.requireNonNull(gnssNative);
+ }
+
+ @Override
+ protected boolean init() {
+ return true;
+ }
+
+ @Override
+ protected void cleanup() {}
+
+ @Override
+ protected boolean start() {
+ mState.mStarted = true;
+ return true;
+ }
+
+ @Override
+ protected boolean stop() {
+ mState.mStarted = false;
+ return true;
+ }
+
+ @Override
+ protected boolean setPositionMode(int mode, int recurrence, int minInterval,
+ int preferredAccuracy, int preferredTime, boolean lowPowerMode) {
+ mState.mPositionMode = new GnssHalPositionMode(mode, recurrence, minInterval,
+ preferredAccuracy, preferredTime, lowPowerMode);
+ return true;
+ }
+
+ @Override
+ protected String getInternalState() {
+ return "DebugState";
+ }
+
+ @Override
+ protected void deleteAidingData(int flags) {}
+
+ @Override
+ protected int readNmea(byte[] buffer, int bufferSize) {
+ return 0;
+ }
+
+ @Override
+ protected void injectLocation(double latitude, double longitude, float accuracy) {
+ mState.mInjectedLocation = new Location("injected");
+ mState.mInjectedLocation.setLatitude(latitude);
+ mState.mInjectedLocation.setLongitude(longitude);
+ mState.mInjectedLocation.setAccuracy(accuracy);
+ }
+
+ @Override
+ protected void injectBestLocation(@GnssLocationFlags int gnssLocationFlags, double latitude,
+ double longitude, double altitude, float speed, float bearing, float horizontalAccuracy,
+ float verticalAccuracy, float speedAccuracy, float bearingAccuracy, long timestamp,
+ @GnssRealtimeFlags int elapsedRealtimeFlags, long elapsedRealtimeNanos,
+ double elapsedRealtimeUncertaintyNanos) {
+ mState.mInjectedBestLocation = new Location("injectedBest");
+ if ((gnssLocationFlags & GNSS_LOCATION_HAS_LAT_LONG) != 0) {
+ mState.mInjectedBestLocation.setLatitude(latitude);
+ mState.mInjectedBestLocation.setLongitude(longitude);
+ }
+ if ((gnssLocationFlags & GNSS_LOCATION_HAS_ALTITUDE) != 0) {
+ mState.mInjectedBestLocation.setAltitude(altitude);
+ }
+ if ((gnssLocationFlags & GNSS_LOCATION_HAS_SPEED) != 0) {
+ mState.mInjectedBestLocation.setSpeed(speed);
+ }
+ if ((gnssLocationFlags & GNSS_LOCATION_HAS_BEARING) != 0) {
+ mState.mInjectedBestLocation.setBearing(bearing);
+ }
+ if ((gnssLocationFlags & GNSS_LOCATION_HAS_HORIZONTAL_ACCURACY) != 0) {
+ mState.mInjectedBestLocation.setAccuracy(horizontalAccuracy);
+ }
+ if ((gnssLocationFlags & GNSS_LOCATION_HAS_VERTICAL_ACCURACY) != 0) {
+ mState.mInjectedBestLocation.setVerticalAccuracyMeters(verticalAccuracy);
+ }
+ if ((gnssLocationFlags & GNSS_LOCATION_HAS_SPEED_ACCURACY) != 0) {
+ mState.mInjectedBestLocation.setSpeedAccuracyMetersPerSecond(speedAccuracy);
+ }
+ if ((gnssLocationFlags & GNSS_LOCATION_HAS_BEARING_ACCURACY) != 0) {
+ mState.mInjectedBestLocation.setBearingAccuracyDegrees(bearingAccuracy);
+ }
+ mState.mInjectedBestLocation.setTime(timestamp);
+ if ((elapsedRealtimeFlags & GNSS_REALTIME_HAS_TIMESTAMP_NS) != 0) {
+ mState.mInjectedBestLocation.setElapsedRealtimeNanos(elapsedRealtimeNanos);
+ }
+ if ((elapsedRealtimeFlags & GNSS_REALTIME_HAS_TIME_UNCERTAINTY_NS) != 0) {
+ mState.mInjectedBestLocation.setElapsedRealtimeUncertaintyNanos(
+ elapsedRealtimeUncertaintyNanos);
+ }
+ }
+
+ @Override
+ protected void injectTime(long time, long timeReference, int uncertainty) {
+ mState.mInjectedTime = new GnssHalInjectedTime(time, timeReference, uncertainty);
+ }
+
+ @Override
+ protected boolean isNavigationMessageCollectionSupported() {
+ return mIsNavigationMessageCollectionSupported;
+ }
+
+ @Override
+ protected boolean startNavigationMessageCollection() {
+ mState.mNavigationMessagesStarted = true;
+ return true;
+ }
+
+ @Override
+ protected boolean stopNavigationMessageCollection() {
+ mState.mNavigationMessagesStarted = false;
+ return true;
+ }
+
+ @Override
+ protected boolean isAntennaInfoListeningSupported() {
+ return mIsAntennaInfoListeningSupported;
+ }
+
+ @Override
+ protected boolean startAntennaInfoListening() {
+ mState.mAntennaInfoListeningStarted = true;
+ return true;
+ }
+
+ @Override
+ protected boolean stopAntennaInfoListening() {
+ mState.mAntennaInfoListeningStarted = false;
+ return true;
+ }
+
+ @Override
+ protected boolean isMeasurementSupported() {
+ return mIsMeasurementSupported;
+ }
+
+ @Override
+ protected boolean startMeasurementCollection(boolean enableFullTracking) {
+ mState.mMeasurementCollectionStarted = true;
+ mState.mMeasurementCollectionFullTracking = enableFullTracking;
+ return true;
+ }
+
+ @Override
+ protected boolean stopMeasurementCollection() {
+ mState.mMeasurementCollectionStarted = false;
+ mState.mMeasurementCollectionFullTracking = false;
+ return true;
+ }
+
+ @Override
+ protected boolean isMeasurementCorrectionsSupported() {
+ return mIsMeasurementCorrectionsSupported;
+ }
+
+ @Override
+ protected boolean injectMeasurementCorrections(GnssMeasurementCorrections corrections) {
+ mState.mInjectedMeasurementCorrections = corrections;
+ return true;
+ }
+
+ @Override
+ protected int getBatchSize() {
+ return mBatchSize;
+ }
+
+ @Override
+ protected boolean initBatching() {
+ return true;
+ }
+
+ @Override
+ protected void cleanupBatching() {}
+
+ @Override
+ protected boolean startBatch(long periodNanos, boolean wakeOnFifoFull) {
+ mState.mBatchingStarted = true;
+ mState.mBatchingMode = new GnssHalBatchingMode(periodNanos, wakeOnFifoFull);
+ return true;
+ }
+
+ @Override
+ protected void flushBatch() {
+ Location[] locations = mState.mBatchedLocations.toArray(new Location[0]);
+ mState.mBatchedLocations.clear();
+ Objects.requireNonNull(mGnssNative).reportLocationBatch(locations);
+ }
+
+ @Override
+ protected void stopBatch() {
+ mState.mBatchingStarted = false;
+ mState.mBatchingMode = new GnssHalBatchingMode();
+ mState.mBatchedLocations.clear();
+ }
+
+ @Override
+ protected boolean isGeofencingSupported() {
+ return mIsGeofencingSupported;
+ }
+
+ @Override
+ protected boolean addGeofence(int geofenceId, double latitude, double longitude, double radius,
+ int lastTransition, int monitorTransitions, int notificationResponsiveness,
+ int unknownTimer) {
+ if (mState.mGeofences.containsKey(geofenceId)) {
+ Objects.requireNonNull(mGnssNative).reportGeofenceAddStatus(geofenceId,
+ GEOFENCE_STATUS_ERROR_ID_EXISTS);
+ } else {
+ mState.mGeofences.put(geofenceId,
+ new GnssHalGeofence(geofenceId, latitude, longitude, radius, lastTransition,
+ monitorTransitions, notificationResponsiveness, unknownTimer, false));
+ Objects.requireNonNull(mGnssNative).reportGeofenceAddStatus(geofenceId,
+ GEOFENCE_STATUS_OPERATION_SUCCESS);
+ }
+ return true;
+ }
+
+ @Override
+ protected boolean resumeGeofence(int geofenceId, int monitorTransitions) {
+ GnssHalGeofence geofence = mState.mGeofences.get(geofenceId);
+ if (geofence != null) {
+ geofence.Paused = false;
+ geofence.MonitorTransitions = monitorTransitions;
+ Objects.requireNonNull(mGnssNative).reportGeofenceAddStatus(geofenceId,
+ GEOFENCE_STATUS_OPERATION_SUCCESS);
+ } else {
+ Objects.requireNonNull(mGnssNative).reportGeofenceAddStatus(geofenceId,
+ GEOFENCE_STATUS_ERROR_ID_UNKNOWN);
+ }
+ return true;
+ }
+
+ @Override
+ protected boolean pauseGeofence(int geofenceId) {
+ GnssHalGeofence geofence = mState.mGeofences.get(geofenceId);
+ if (geofence != null) {
+ geofence.Paused = true;
+ Objects.requireNonNull(mGnssNative).reportGeofenceAddStatus(geofenceId,
+ GEOFENCE_STATUS_OPERATION_SUCCESS);
+ } else {
+ Objects.requireNonNull(mGnssNative).reportGeofenceAddStatus(geofenceId,
+ GEOFENCE_STATUS_ERROR_ID_UNKNOWN);
+ }
+ return true;
+ }
+
+ @Override
+ protected boolean removeGeofence(int geofenceId) {
+ if (mState.mGeofences.remove(geofenceId) != null) {
+ Objects.requireNonNull(mGnssNative).reportGeofenceRemoveStatus(geofenceId,
+ GEOFENCE_STATUS_OPERATION_SUCCESS);
+ } else {
+ Objects.requireNonNull(mGnssNative).reportGeofenceRemoveStatus(geofenceId,
+ GEOFENCE_STATUS_ERROR_ID_UNKNOWN);
+ }
+ return true;
+ }
+
+ @Override
+ protected boolean isGnssVisibilityControlSupported() {
+ return mIsVisibilityControlSupported;
+ }
+
+ @Override
+ protected void sendNiResponse(int notificationId, int userResponse) {}
+
+ @Override
+ protected void requestPowerStats() {
+ Objects.requireNonNull(mGnssNative).reportGnssPowerStats(mState.mPowerStats);
+ }
+
+ @Override
+ protected void setAgpsServer(int type, String hostname, int port) {}
+
+ @Override
+ protected void setAgpsSetId(int type, String setId) {}
+
+ @Override
+ protected void setAgpsReferenceLocationCellId(int type, int mcc, int mnc, int lac, int cid) {}
+
+ @Override
+ protected boolean isPsdsSupported() {
+ return true;
+ }
+
+ @Override
+ protected void injectPsdsData(byte[] data, int length, int psdsType) {}
+}
diff --git a/services/tests/mockingservicestests/src/com/android/server/location/injector/FakeEmergencyHelper.java b/services/tests/mockingservicestests/src/com/android/server/location/injector/FakeEmergencyHelper.java
new file mode 100644
index 0000000..2cf57da
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/location/injector/FakeEmergencyHelper.java
@@ -0,0 +1,36 @@
+/*
+ * 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.location.injector;
+
+/**
+ * Version of EmergencyHelper for testing.
+ */
+public class FakeEmergencyHelper extends EmergencyHelper {
+
+ private boolean mInEmergency;
+
+ public FakeEmergencyHelper() {}
+
+ public void setInEmergency(boolean inEmergency) {
+ mInEmergency = inEmergency;
+ }
+
+ @Override
+ public boolean isInEmergency(long extensionTimeMs) {
+ return mInEmergency;
+ }
+}
diff --git a/services/tests/mockingservicestests/src/com/android/server/location/injector/TestInjector.java b/services/tests/mockingservicestests/src/com/android/server/location/injector/TestInjector.java
index f3c31c2..8e5b16e 100644
--- a/services/tests/mockingservicestests/src/com/android/server/location/injector/TestInjector.java
+++ b/services/tests/mockingservicestests/src/com/android/server/location/injector/TestInjector.java
@@ -28,6 +28,7 @@
private final FakeLocationPowerSaveModeHelper mLocationPowerSaveModeHelper;
private final FakeScreenInteractiveHelper mScreenInteractiveHelper;
private final LocationAttributionHelper mLocationAttributionHelper;
+ private final FakeEmergencyHelper mEmergencyHelper;
private final LocationUsageLogger mLocationUsageLogger;
public TestInjector() {
@@ -41,6 +42,7 @@
mLocationPowerSaveModeHelper = new FakeLocationPowerSaveModeHelper(mLocationEventLog);
mScreenInteractiveHelper = new FakeScreenInteractiveHelper();
mLocationAttributionHelper = new LocationAttributionHelper(mAppOpsHelper);
+ mEmergencyHelper = new FakeEmergencyHelper();
mLocationUsageLogger = new LocationUsageLogger();
}
@@ -90,6 +92,11 @@
}
@Override
+ public EmergencyHelper getEmergencyHelper() {
+ return mEmergencyHelper;
+ }
+
+ @Override
public LocationUsageLogger getLocationUsageLogger() {
return mLocationUsageLogger;
}
diff --git a/services/tests/mockingservicestests/src/com/android/server/location/provider/LocationProviderManagerTest.java b/services/tests/mockingservicestests/src/com/android/server/location/provider/LocationProviderManagerTest.java
index 63b36fc..df7a445 100644
--- a/services/tests/mockingservicestests/src/com/android/server/location/provider/LocationProviderManagerTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/location/provider/LocationProviderManagerTest.java
@@ -66,6 +66,7 @@
import android.location.LocationManagerInternal.ProviderEnabledListener;
import android.location.LocationRequest;
import android.location.LocationResult;
+import android.location.ProviderProperties;
import android.location.util.identity.CallerIdentity;
import android.os.Bundle;
import android.os.ICancellationSignal;
@@ -80,7 +81,6 @@
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
-import com.android.internal.location.ProviderProperties;
import com.android.internal.location.ProviderRequest;
import com.android.server.FgThread;
import com.android.server.LocalServices;
@@ -1016,8 +1016,7 @@
private final ArrayList<Runnable> mFlushCallbacks = new ArrayList<>();
TestProvider(ProviderProperties properties, CallerIdentity identity) {
- super(DIRECT_EXECUTOR, identity);
- setProperties(properties);
+ super(DIRECT_EXECUTOR, identity, properties);
}
public void setProviderAllowed(boolean allowed) {
diff --git a/services/tests/mockingservicestests/src/com/android/server/location/provider/MockableLocationProviderTest.java b/services/tests/mockingservicestests/src/com/android/server/location/provider/MockableLocationProviderTest.java
index bcf65d3..daa8a22 100644
--- a/services/tests/mockingservicestests/src/com/android/server/location/provider/MockableLocationProviderTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/location/provider/MockableLocationProviderTest.java
@@ -15,8 +15,6 @@
*/
package com.android.server.location.provider;
-import static androidx.test.ext.truth.location.LocationSubject.assertThat;
-
import static com.android.internal.location.ProviderRequest.EMPTY_REQUEST;
import static com.google.common.truth.Truth.assertThat;
@@ -29,13 +27,13 @@
import android.location.Criteria;
import android.location.Location;
import android.location.LocationResult;
+import android.location.ProviderProperties;
import android.location.util.identity.CallerIdentity;
import android.platform.test.annotations.Presubmit;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
-import com.android.internal.location.ProviderProperties;
import com.android.internal.location.ProviderRequest;
import com.android.server.location.test.FakeProvider;
import com.android.server.location.test.ProviderListenerCapture;
diff --git a/services/tests/mockingservicestests/src/com/android/server/location/test/FakeProvider.java b/services/tests/mockingservicestests/src/com/android/server/location/test/FakeProvider.java
index 9266d6f..1eb0386 100644
--- a/services/tests/mockingservicestests/src/com/android/server/location/test/FakeProvider.java
+++ b/services/tests/mockingservicestests/src/com/android/server/location/test/FakeProvider.java
@@ -40,7 +40,7 @@
private final FakeProviderInterface mFakeInterface;
public FakeProvider(FakeProviderInterface fakeInterface) {
- super(Runnable::run);
+ super(Runnable::run, null, null);
mFakeInterface = fakeInterface;
}
diff --git a/services/tests/mockingservicestests/src/com/android/server/pm/OWNERS b/services/tests/mockingservicestests/src/com/android/server/pm/OWNERS
new file mode 100644
index 0000000..d825dfd
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/pm/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/pm/OWNERS
diff --git a/services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/netpolicy/uidA-allowlisted-restrict-background-off.xml b/services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/netpolicy/uidA-allowed-restrict-background-off.xml
similarity index 100%
rename from services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/netpolicy/uidA-allowlisted-restrict-background-off.xml
rename to services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/netpolicy/uidA-allowed-restrict-background-off.xml
diff --git a/services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/netpolicy/uidA-allowlisted-restrict-background-on.xml b/services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/netpolicy/uidA-allowed-restrict-background-on.xml
similarity index 100%
rename from services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/netpolicy/uidA-allowlisted-restrict-background-on.xml
rename to services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/netpolicy/uidA-allowed-restrict-background-on.xml
diff --git a/services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/netpolicy/uidA-denylisted-restrict-background-off.xml b/services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/netpolicy/uidA-denied-restrict-background-off.xml
similarity index 100%
rename from services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/netpolicy/uidA-denylisted-restrict-background-off.xml
rename to services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/netpolicy/uidA-denied-restrict-background-off.xml
diff --git a/services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/netpolicy/uidA-denylisted-restrict-background-on.xml b/services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/netpolicy/uidA-denied-restrict-background-on.xml
similarity index 100%
rename from services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/netpolicy/uidA-denylisted-restrict-background-on.xml
rename to services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/netpolicy/uidA-denied-restrict-background-on.xml
diff --git a/services/tests/servicestests/src/com/android/internal/location/timezone/OWNERS b/services/tests/servicestests/src/com/android/internal/location/timezone/OWNERS
new file mode 100644
index 0000000..28aff18
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/internal/location/timezone/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+nfuller@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/appsearch/external/localstorage/AppSearchImplTest.java b/services/tests/servicestests/src/com/android/server/appsearch/external/localstorage/AppSearchImplTest.java
index f36ed4b..f29b059 100644
--- a/services/tests/servicestests/src/com/android/server/appsearch/external/localstorage/AppSearchImplTest.java
+++ b/services/tests/servicestests/src/com/android/server/appsearch/external/localstorage/AppSearchImplTest.java
@@ -75,6 +75,8 @@
SchemaToProtoConverter.toSchemaTypeConfigProto(rewrittenVisibilitySchema.build());
}
+ // TODO(b/175430168) add test to verify reset is working properly.
+
/**
* Ensure that we can rewrite an incoming schema type by adding the database as a prefix. While
* also keeping any other existing schema types that may already be part of Icing's persisted
diff --git a/services/tests/servicestests/src/com/android/server/audio/OWNERS b/services/tests/servicestests/src/com/android/server/audio/OWNERS
new file mode 100644
index 0000000..894a1f5
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/audio/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/audio/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/compat/CompatConfigTest.java b/services/tests/servicestests/src/com/android/server/compat/CompatConfigTest.java
index e588370..8c63bfc 100644
--- a/services/tests/servicestests/src/com/android/server/compat/CompatConfigTest.java
+++ b/services/tests/servicestests/src/com/android/server/compat/CompatConfigTest.java
@@ -190,6 +190,22 @@
}
@Test
+ public void testIsChangeEnabledForInvalidApp() throws Exception {
+ final long disabledChangeId = 1234L;
+ final long enabledChangeId = 1235L;
+ final long targetSdkChangeId = 1236L;
+ CompatConfig compatConfig = CompatConfigBuilder.create(mBuildClassifier, mContext)
+ .addEnabledChangeWithId(enabledChangeId)
+ .addDisabledChangeWithId(disabledChangeId)
+ .addEnableSinceSdkChangeWithId(42, targetSdkChangeId)
+ .build();
+
+ assertThat(compatConfig.isChangeEnabled(enabledChangeId, null)).isTrue();
+ assertThat(compatConfig.isChangeEnabled(disabledChangeId, null)).isFalse();
+ assertThat(compatConfig.isChangeEnabled(targetSdkChangeId, null)).isTrue();
+ }
+
+ @Test
public void testPreventAddOverride() throws Exception {
final long changeId = 1234L;
CompatConfig compatConfig = CompatConfigBuilder.create(mBuildClassifier, mContext)
diff --git a/services/tests/servicestests/src/com/android/server/compat/PlatformCompatTest.java b/services/tests/servicestests/src/com/android/server/compat/PlatformCompatTest.java
index 64014ba..1d3b643 100644
--- a/services/tests/servicestests/src/com/android/server/compat/PlatformCompatTest.java
+++ b/services/tests/servicestests/src/com/android/server/compat/PlatformCompatTest.java
@@ -107,18 +107,20 @@
mCompatConfig = CompatConfigBuilder.create(mBuildClassifier, mContext)
.addEnabledChangeWithId(1L)
.addDisabledChangeWithIdAndName(2L, "change2")
- .addEnableAfterSdkChangeWithIdAndDescription(Build.VERSION_CODES.O, 3L, "desc")
- .addEnableAfterSdkChangeWithId(Build.VERSION_CODES.P, 4L)
- .addEnableAfterSdkChangeWithId(Build.VERSION_CODES.Q, 5L)
- .addEnableAfterSdkChangeWithId(Build.VERSION_CODES.R, 6L)
+ .addEnableSinceSdkChangeWithIdAndDescription(Build.VERSION_CODES.O, 3L, "desc")
+ .addEnableSinceSdkChangeWithId(Build.VERSION_CODES.P, 4L)
+ .addEnableSinceSdkChangeWithId(Build.VERSION_CODES.Q, 5L)
+ .addEnableSinceSdkChangeWithId(Build.VERSION_CODES.R, 6L)
.addLoggingOnlyChangeWithId(7L)
.build();
mPlatformCompat = new PlatformCompat(mContext, mCompatConfig);
assertThat(mPlatformCompat.listUIChanges()).asList().containsExactly(
new CompatibilityChangeInfo(1L, "", -1, -1, false, false, ""),
new CompatibilityChangeInfo(2L, "change2", -1, -1, true, false, ""),
- new CompatibilityChangeInfo(4L, "", Build.VERSION_CODES.P, -1, false, false, ""),
- new CompatibilityChangeInfo(5L, "", Build.VERSION_CODES.Q, -1, false, false, ""));
+ new CompatibilityChangeInfo(5L, "", /*enableAfter*/ -1,
+ /*enableSince*/ Build.VERSION_CODES.Q, false, false, ""),
+ new CompatibilityChangeInfo(6L, "", /*enableAfter*/ -1,
+ /*enableSince*/ Build.VERSION_CODES.R, false, false, ""));
}
@Test
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecConfigTest.java b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecConfigTest.java
index 777713e..798cf85 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecConfigTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecConfigTest.java
@@ -18,13 +18,17 @@
import static com.google.common.truth.Truth.assertThat;
import static junit.framework.Assert.assertTrue;
+import static junit.framework.Assert.fail;
+import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.testng.Assert.assertThrows;
+import android.annotation.NonNull;
import android.content.Context;
import android.hardware.hdmi.HdmiControlManager;
+import android.os.test.TestLooper;
import android.platform.test.annotations.Presubmit;
import android.provider.Settings.Global;
@@ -32,21 +36,30 @@
import androidx.test.filters.SmallTest;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
@SmallTest
@Presubmit
@RunWith(JUnit4.class)
public final class HdmiCecConfigTest {
private static final String TAG = "HdmiCecConfigTest";
+ private static final int TIMEOUT_CONTENT_CHANGE_SEC = 3;
+
+ private final TestLooper mTestLooper = new TestLooper();
+
private Context mContext;
@Mock private HdmiCecConfig.StorageAdapter mStorageAdapter;
+ @Mock private HdmiCecConfig.SettingChangeListener mSettingChangeListener;
@Before
public void setUp() throws Exception {
@@ -1019,4 +1032,119 @@
HdmiControlManager.CEC_SETTING_NAME_SYSTEM_AUDIO_MODE_MUTING,
Integer.toString(HdmiControlManager.SYSTEM_AUDIO_MODE_MUTING_DISABLED));
}
+
+ @Test
+ public void registerChangeListener_SharedPref_BasicSanity() {
+ HdmiCecConfig hdmiCecConfig = HdmiCecConfig.createFromStrings(
+ mContext, mStorageAdapter,
+ "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>"
+ + "<cec-settings>"
+ + " <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>", null);
+ hdmiCecConfig.registerChangeListener(
+ HdmiControlManager.CEC_SETTING_NAME_SYSTEM_AUDIO_MODE_MUTING,
+ mSettingChangeListener);
+ hdmiCecConfig.setIntValue(
+ HdmiControlManager.CEC_SETTING_NAME_SYSTEM_AUDIO_MODE_MUTING,
+ HdmiControlManager.SYSTEM_AUDIO_MODE_MUTING_DISABLED);
+ verify(mSettingChangeListener).onChange(
+ HdmiControlManager.CEC_SETTING_NAME_SYSTEM_AUDIO_MODE_MUTING);
+ }
+
+ @Test
+ public void removeChangeListener_SharedPref_BasicSanity() {
+ HdmiCecConfig hdmiCecConfig = HdmiCecConfig.createFromStrings(
+ mContext, mStorageAdapter,
+ "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>"
+ + "<cec-settings>"
+ + " <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>", null);
+ hdmiCecConfig.registerChangeListener(
+ HdmiControlManager.CEC_SETTING_NAME_SYSTEM_AUDIO_MODE_MUTING,
+ mSettingChangeListener);
+ hdmiCecConfig.removeChangeListener(
+ HdmiControlManager.CEC_SETTING_NAME_SYSTEM_AUDIO_MODE_MUTING,
+ mSettingChangeListener);
+ hdmiCecConfig.setIntValue(
+ HdmiControlManager.CEC_SETTING_NAME_SYSTEM_AUDIO_MODE_MUTING,
+ HdmiControlManager.SYSTEM_AUDIO_MODE_MUTING_DISABLED);
+ verify(mSettingChangeListener, never()).onChange(
+ HdmiControlManager.CEC_SETTING_NAME_SYSTEM_AUDIO_MODE_MUTING);
+ }
+
+ /**
+ * Externally modified Global Settings still need to be supported. This test verifies that
+ * setting change notification is being forwarded to listeners registered via HdmiCecConfig.
+ */
+ @Test
+ @Ignore("b/175381065")
+ public void globalSettingObserver_BasicSanity() throws Exception {
+ CountDownLatch notifyLatch = new CountDownLatch(1);
+ // Get current value of the setting in the system.
+ String originalValue = Global.getString(mContext.getContentResolver(),
+ Global.HDMI_CONTROL_ENABLED);
+ try {
+ HdmiCecConfig hdmiCecConfig = HdmiCecConfig.createFromStrings(
+ mContext, mStorageAdapter,
+ "<?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>"
+ + "</cec-settings>", null);
+ hdmiCecConfig.registerGlobalSettingsObserver(mTestLooper.getLooper());
+ HdmiCecConfig.SettingChangeListener latchUpdateListener =
+ new HdmiCecConfig.SettingChangeListener() {
+ @Override
+ public void onChange(
+ @NonNull @HdmiControlManager.CecSettingName String setting) {
+ notifyLatch.countDown();
+ assertThat(setting).isEqualTo(
+ HdmiControlManager.CEC_SETTING_NAME_HDMI_CEC_ENABLED);
+ }
+ };
+ hdmiCecConfig.registerChangeListener(
+ HdmiControlManager.CEC_SETTING_NAME_HDMI_CEC_ENABLED,
+ latchUpdateListener);
+
+ // Flip the value of the setting.
+ String valueToSet = ((originalValue == null || originalValue.equals("1")) ? "0" : "1");
+ Global.putString(mContext.getContentResolver(), Global.HDMI_CONTROL_ENABLED,
+ valueToSet);
+ assertThat(Global.getString(mContext.getContentResolver(),
+ Global.HDMI_CONTROL_ENABLED)).isEqualTo(valueToSet);
+ mTestLooper.dispatchAll();
+
+ if (!notifyLatch.await(TIMEOUT_CONTENT_CHANGE_SEC, TimeUnit.SECONDS)) {
+ fail("Timed out waiting for the notify callback");
+ }
+ hdmiCecConfig.unregisterGlobalSettingsObserver();
+ } finally {
+ // Restore the previous value of the setting in the system.
+ Global.putString(mContext.getContentResolver(), Global.HDMI_CONTROL_ENABLED,
+ originalValue);
+ }
+ }
}
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 9d300a6..401d6e3 100644
--- a/services/tests/servicestests/src/com/android/server/net/IpConfigStoreTest.java
+++ b/services/tests/servicestests/src/com/android/server/net/IpConfigStoreTest.java
@@ -39,6 +39,7 @@
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.util.Arrays;
/**
* Unit tests for {@link IpConfigStore}
@@ -82,7 +83,8 @@
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");
+ ProxyInfo proxyInfo =
+ ProxyInfo.buildDirectProxy("10.10.10.10", 88, Arrays.asList("host1", "host2"));
IpConfiguration expectedConfig1 = new IpConfiguration(IpAssignment.STATIC,
ProxySettings.STATIC, staticIpConfiguration, proxyInfo);
diff --git a/services/tests/servicestests/src/com/android/server/net/NetworkPolicyManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/net/NetworkPolicyManagerServiceTest.java
index f8043fa..4db7ce2 100644
--- a/services/tests/servicestests/src/com/android/server/net/NetworkPolicyManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/net/NetworkPolicyManagerServiceTest.java
@@ -16,13 +16,18 @@
package com.android.server.net;
+import static android.Manifest.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS;
+import static android.Manifest.permission.NETWORK_STACK;
import static android.net.ConnectivityManager.CONNECTIVITY_ACTION;
import static android.net.ConnectivityManager.TYPE_WIFI;
+import static android.net.INetd.FIREWALL_CHAIN_RESTRICTED;
+import static android.net.INetd.FIREWALL_RULE_ALLOW;
import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_ROAMING;
import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;
import static android.net.NetworkPolicy.LIMIT_DISABLED;
import static android.net.NetworkPolicy.SNOOZE_NEVER;
import static android.net.NetworkPolicy.WARNING_DISABLED;
+import static android.net.NetworkPolicyManager.FIREWALL_RULE_DEFAULT;
import static android.net.NetworkPolicyManager.POLICY_ALLOW_METERED_BACKGROUND;
import static android.net.NetworkPolicyManager.POLICY_NONE;
import static android.net.NetworkPolicyManager.POLICY_REJECT_METERED_BACKGROUND;
@@ -34,6 +39,7 @@
import static android.net.NetworkPolicyManager.RULE_TEMPORARY_ALLOW_METERED;
import static android.net.NetworkPolicyManager.uidPoliciesToString;
import static android.net.NetworkPolicyManager.uidRulesToString;
+import static android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK;
import static android.net.NetworkStats.IFACE_ALL;
import static android.net.NetworkStats.SET_ALL;
import static android.net.NetworkStats.TAG_ALL;
@@ -74,6 +80,7 @@
import static org.mockito.ArgumentMatchers.isA;
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.atLeastOnce;
+import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.mock;
@@ -97,6 +104,7 @@
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
+import android.content.pm.UserInfo;
import android.net.ConnectivityManager;
import android.net.IConnectivityManager;
import android.net.INetworkManagementEventObserver;
@@ -123,6 +131,7 @@
import android.os.SimpleClock;
import android.os.SystemClock;
import android.os.UserHandle;
+import android.os.UserManager;
import android.platform.test.annotations.Presubmit;
import android.telephony.CarrierConfigManager;
import android.telephony.SubscriptionInfo;
@@ -131,6 +140,7 @@
import android.telephony.TelephonyManager;
import android.test.suitebuilder.annotation.MediumTest;
import android.text.TextUtils;
+import android.util.ArrayMap;
import android.util.DataUnit;
import android.util.Log;
import android.util.Pair;
@@ -187,6 +197,7 @@
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Map;
import java.util.TimeZone;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
@@ -240,6 +251,7 @@
private @Mock SubscriptionManager mSubscriptionManager;
private @Mock CarrierConfigManager mCarrierConfigManager;
private @Mock TelephonyManager mTelephonyManager;
+ private @Mock UserManager mUserManager;
private ArgumentCaptor<ConnectivityManager.NetworkCallback> mNetworkCallbackCaptor =
ArgumentCaptor.forClass(ConnectivityManager.NetworkCallback.class);
@@ -351,6 +363,8 @@
return mNotifManager;
case Context.CONNECTIVITY_SERVICE:
return mConnectivityManager;
+ case Context.USER_SERVICE:
+ return mUserManager;
default:
return super.getSystemService(name);
}
@@ -407,11 +421,14 @@
when(mPackageManager.getPackagesForUid(UID_B)).thenReturn(new String[] {PKG_NAME_B});
when(mPackageManager.getPackagesForUid(UID_C)).thenReturn(new String[] {PKG_NAME_C});
when(mPackageManager.getApplicationInfo(eq(PKG_NAME_A), anyInt()))
- .thenReturn(buildApplicationInfo(PKG_NAME_A));
+ .thenReturn(buildApplicationInfo(PKG_NAME_A, UID_A));
when(mPackageManager.getApplicationInfo(eq(PKG_NAME_B), anyInt()))
- .thenReturn(buildApplicationInfo(PKG_NAME_B));
+ .thenReturn(buildApplicationInfo(PKG_NAME_B, UID_B));
when(mPackageManager.getApplicationInfo(eq(PKG_NAME_C), anyInt()))
- .thenReturn(buildApplicationInfo(PKG_NAME_C));
+ .thenReturn(buildApplicationInfo(PKG_NAME_C, UID_C));
+ when(mPackageManager.getInstalledApplications(anyInt())).thenReturn(
+ buildInstalledApplicationInfoList());
+ when(mUserManager.getUsers()).thenReturn(buildUserInfoList());
when(mNetworkManager.isBandwidthControlEnabled()).thenReturn(true);
when(mNetworkManager.setDataSaverModeEnabled(anyBoolean())).thenReturn(true);
doNothing().when(mConnectivityManager)
@@ -479,7 +496,7 @@
}
/**
- * Adds allowlist when restrict background is on - app should receive an intent.
+ * Adds an app to allowlist when restrict background is on - app should receive an intent.
*/
@Test
@NetPolicyXml("restrict-background-on.xml")
@@ -490,7 +507,7 @@
}
/**
- * Adds allowlist when restrict background is off - app should not receive an intent.
+ * Adds an app to allowlist when restrict background is off - app should not receive an intent.
*/
@Test
public void testAddRestrictBackgroundAllowlist_restrictBackgroundOff() throws Exception {
@@ -499,7 +516,7 @@
}
private void addRestrictBackgroundAllowlist(boolean expectIntent) throws Exception {
- assertAllowlistUids();
+ assertRestrictBackgroundAllowedUids();
assertUidPolicy(UID_A, POLICY_NONE);
final FutureIntent futureIntent = newRestrictBackgroundChangedFuture();
@@ -507,7 +524,7 @@
mService.setUidPolicy(UID_A, POLICY_ALLOW_METERED_BACKGROUND);
- assertAllowlistUids(UID_A);
+ assertRestrictBackgroundAllowedUids(UID_A);
assertUidPolicy(UID_A, POLICY_ALLOW_METERED_BACKGROUND);
mPolicyListener.waitAndVerify()
.onUidPoliciesChanged(APP_ID_A, POLICY_ALLOW_METERED_BACKGROUND);
@@ -519,10 +536,10 @@
}
/**
- * Removes allowlist when restrict background is on - app should receive an intent.
+ * Removes an app from allowlist when restrict background is on - app should receive an intent.
*/
@Test
- @NetPolicyXml("uidA-allowlisted-restrict-background-on.xml")
+ @NetPolicyXml("uidA-allowed-restrict-background-on.xml")
public void testRemoveRestrictBackgroundAllowlist_restrictBackgroundOn() throws Exception {
assertRestrictBackgroundOn();
assertRestrictBackgroundChangedReceived(mFutureIntent, null);
@@ -530,10 +547,11 @@
}
/**
- * Removes allowlist when restrict background is off - app should not receive an intent.
+ * Removes an app from allowlist when restrict background is off - app should not
+ * receive an intent.
*/
@Test
- @NetPolicyXml("uidA-allowlisted-restrict-background-off.xml")
+ @NetPolicyXml("uidA-allowed-restrict-background-off.xml")
public void testRemoveRestrictBackgroundAllowlist_restrictBackgroundOff() throws Exception {
assertRestrictBackgroundOff();
removeRestrictBackgroundAllowlist(false);
@@ -688,7 +706,7 @@
}
private void removeRestrictBackgroundAllowlist(boolean expectIntent) throws Exception {
- assertAllowlistUids(UID_A);
+ assertRestrictBackgroundAllowedUids(UID_A);
assertUidPolicy(UID_A, POLICY_ALLOW_METERED_BACKGROUND);
final FutureIntent futureIntent = newRestrictBackgroundChangedFuture();
@@ -696,7 +714,7 @@
mService.setUidPolicy(UID_A, POLICY_NONE);
- assertAllowlistUids();
+ assertRestrictBackgroundAllowedUids();
assertUidPolicy(UID_A, POLICY_NONE);
mPolicyListener.waitAndVerify().onUidPoliciesChanged(APP_ID_A, POLICY_NONE);
if (expectIntent) {
@@ -707,7 +725,7 @@
}
/**
- * Adds denylist when restrict background is on - app should not receive an intent.
+ * Adds an app to denylist when restrict background is on - app should not receive an intent.
*/
@Test
@NetPolicyXml("restrict-background-on.xml")
@@ -718,7 +736,7 @@
}
/**
- * Adds denylist when restrict background is off - app should receive an intent.
+ * Adds an app to denylist when restrict background is off - app should receive an intent.
*/
@Test
public void testAddRestrictBackgroundDenylist_restrictBackgroundOff() throws Exception {
@@ -744,10 +762,11 @@
}
/**
- * Removes denylist when restrict background is on - app should not receive an intent.
+ * Removes an app from denylist when restrict background is on - app should not
+ * receive an intent.
*/
@Test
- @NetPolicyXml("uidA-denylisted-restrict-background-on.xml")
+ @NetPolicyXml("uidA-denied-restrict-background-on.xml")
public void testRemoveRestrictBackgroundDenylist_restrictBackgroundOn() throws Exception {
assertRestrictBackgroundOn();
assertRestrictBackgroundChangedReceived(mFutureIntent, null);
@@ -755,10 +774,11 @@
}
/**
- * Removes denylist when restrict background is off - app should receive an intent.
+ * Removes an app from denylist when restrict background is off - app should
+ * receive an intent.
*/
@Test
- @NetPolicyXml("uidA-denylisted-restrict-background-off.xml")
+ @NetPolicyXml("uidA-denied-restrict-background-off.xml")
public void testRemoveRestrictBackgroundDenylist_restrictBackgroundOff() throws Exception {
assertRestrictBackgroundOff();
removeRestrictBackgroundDenylist(true);
@@ -782,8 +802,8 @@
}
@Test
- @NetPolicyXml("uidA-denylisted-restrict-background-on.xml")
- public void testDenylistedAppIsNotNotifiedWhenRestrictBackgroundIsOn() throws Exception {
+ @NetPolicyXml("uidA-denied-restrict-background-on.xml")
+ public void testDeniedAppIsNotNotifiedWhenRestrictBackgroundIsOn() throws Exception {
assertRestrictBackgroundOn();
assertRestrictBackgroundChangedReceived(mFutureIntent, null);
assertUidPolicy(UID_A, POLICY_REJECT_METERED_BACKGROUND);
@@ -794,11 +814,11 @@
}
@Test
- @NetPolicyXml("uidA-allowlisted-restrict-background-on.xml")
- public void testAllowlistedAppIsNotNotifiedWhenRestrictBackgroundIsOn() throws Exception {
+ @NetPolicyXml("uidA-allowed-restrict-background-on.xml")
+ public void testAllowedAppIsNotNotifiedWhenRestrictBackgroundIsOn() throws Exception {
assertRestrictBackgroundOn();
assertRestrictBackgroundChangedReceived(mFutureIntent, null);
- assertAllowlistUids(UID_A);
+ assertRestrictBackgroundAllowedUids(UID_A);
final FutureIntent futureIntent = newRestrictBackgroundChangedFuture();
setRestrictBackground(true);
@@ -806,11 +826,11 @@
}
@Test
- @NetPolicyXml("uidA-allowlisted-restrict-background-on.xml")
- public void testAllowlistedAppIsNotifiedWhenDenylisted() throws Exception {
+ @NetPolicyXml("uidA-allowed-restrict-background-on.xml")
+ public void testAllowedAppIsNotifiedWhenDenylisted() throws Exception {
assertRestrictBackgroundOn();
assertRestrictBackgroundChangedReceived(mFutureIntent, null);
- assertAllowlistUids(UID_A);
+ assertRestrictBackgroundAllowedUids(UID_A);
final FutureIntent futureIntent = newRestrictBackgroundChangedFuture();
mService.setUidPolicy(UID_A, POLICY_REJECT_METERED_BACKGROUND);
@@ -830,33 +850,33 @@
}
private void restrictBackgroundListsTest() throws Exception {
- // UIds that are allowlisted.
- assertAllowlistUids(UID_A, UID_B, UID_C);
+ // UIds that are in allowlist.
+ assertRestrictBackgroundAllowedUids(UID_A, UID_B, UID_C);
assertUidPolicy(UID_A, POLICY_ALLOW_METERED_BACKGROUND);
assertUidPolicy(UID_B, POLICY_ALLOW_METERED_BACKGROUND);
assertUidPolicy(UID_C, POLICY_ALLOW_METERED_BACKGROUND);
- // UIDs that are denylisted.
+ // UIDs that are in denylist.
assertUidPolicy(UID_D, POLICY_NONE);
assertUidPolicy(UID_E, POLICY_REJECT_METERED_BACKGROUND);
// UIDS that have legacy policies.
assertUidPolicy(UID_F, 2); // POLICY_ALLOW_BACKGROUND_BATTERY_SAVE
- // Remove allowlist.
+ // Remove an uid from allowlist.
mService.setUidPolicy(UID_A, POLICY_NONE);
assertUidPolicy(UID_A, POLICY_NONE);
- assertAllowlistUids(UID_B, UID_C);
+ assertRestrictBackgroundAllowedUids(UID_B, UID_C);
- // Add allowlist when denylisted.
+ // Add an app to allowlist which is currently in denylist.
mService.setUidPolicy(UID_E, POLICY_ALLOW_METERED_BACKGROUND);
assertUidPolicy(UID_E, POLICY_ALLOW_METERED_BACKGROUND);
- assertAllowlistUids(UID_B, UID_C, UID_E);
+ assertRestrictBackgroundAllowedUids(UID_B, UID_C, UID_E);
- // Add denylist when allowlisted.
+ // Add an app to denylist when is currently in allowlist.
mService.setUidPolicy(UID_B, POLICY_REJECT_METERED_BACKGROUND);
assertUidPolicy(UID_B, POLICY_REJECT_METERED_BACKGROUND);
- assertAllowlistUids(UID_C, UID_E);
+ assertRestrictBackgroundAllowedUids(UID_C, UID_E);
}
/**
@@ -865,7 +885,7 @@
@Test
@NetPolicyXml("restrict-background-lists-mixed-format.xml")
public void testRestrictBackgroundLists_mixedFormat() throws Exception {
- assertAllowlistUids(UID_A, UID_C, UID_D);
+ assertRestrictBackgroundAllowedUids(UID_A, UID_C, UID_D);
assertUidPolicy(UID_A, POLICY_ALLOW_METERED_BACKGROUND);
assertUidPolicy(UID_B, POLICY_REJECT_METERED_BACKGROUND); // Denylist prevails.
assertUidPolicy(UID_C, (POLICY_ALLOW_METERED_BACKGROUND | 2));
@@ -1871,6 +1891,66 @@
}
}
+ private void enableRestrictedMode(boolean enable) throws Exception {
+ mService.mRestrictedNetworkingMode = enable;
+ mService.updateRestrictedModeAllowlistUL();
+ verify(mNetworkManager).setFirewallChainEnabled(FIREWALL_CHAIN_RESTRICTED,
+ enable);
+ }
+
+ @Test
+ public void testUpdateRestrictedModeAllowlist() throws Exception {
+ // initialization calls setFirewallChainEnabled, so we want to reset the invocations.
+ clearInvocations(mNetworkManager);
+ expectHasUseRestrictedNetworksPermission(UID_A, true);
+ expectHasUseRestrictedNetworksPermission(UID_B, false);
+
+ Map<Integer, Integer> firewallUidRules = new ArrayMap<>();
+ doAnswer(arg -> {
+ int[] uids = arg.getArgument(1);
+ int[] rules = arg.getArgument(2);
+ assertTrue(uids.length == rules.length);
+
+ for (int i = 0; i < uids.length; ++i) {
+ firewallUidRules.put(uids[i], rules[i]);
+ }
+ return null;
+ }).when(mNetworkManager).setFirewallUidRules(eq(FIREWALL_CHAIN_RESTRICTED),
+ any(int[].class), any(int[].class));
+
+ enableRestrictedMode(true);
+ assertEquals(FIREWALL_RULE_ALLOW, firewallUidRules.get(UID_A).intValue());
+ assertFalse(mService.isUidNetworkingBlocked(UID_A, false));
+ assertTrue(mService.isUidNetworkingBlocked(UID_B, false));
+
+ enableRestrictedMode(false);
+ assertFalse(mService.isUidNetworkingBlocked(UID_A, false));
+ assertFalse(mService.isUidNetworkingBlocked(UID_B, false));
+ }
+
+ @Test
+ public void testUpdateRestrictedModeForUid() throws Exception {
+ // initialization calls setFirewallChainEnabled, so we want to reset the invocations.
+ clearInvocations(mNetworkManager);
+ expectHasUseRestrictedNetworksPermission(UID_A, true);
+ expectHasUseRestrictedNetworksPermission(UID_B, false);
+ enableRestrictedMode(true);
+
+ // UID_D and UID_E are not part of installed applications list, so it won't have any
+ // firewall rules set yet
+ expectHasUseRestrictedNetworksPermission(UID_D, false);
+ mService.updateRestrictedModeForUidUL(UID_D);
+ verify(mNetworkManager).setFirewallUidRule(FIREWALL_CHAIN_RESTRICTED, UID_D,
+ FIREWALL_RULE_DEFAULT);
+ assertTrue(mService.isUidNetworkingBlocked(UID_D, false));
+
+ expectHasUseRestrictedNetworksPermission(UID_E, true);
+ mService.updateRestrictedModeForUidUL(UID_E);
+ verify(mNetworkManager).setFirewallUidRule(FIREWALL_CHAIN_RESTRICTED, UID_E,
+ FIREWALL_RULE_ALLOW);
+ assertFalse(mService.isUidNetworkingBlocked(UID_E, false));
+ }
+
private String formatBlockedStateError(int uid, int rule, boolean metered,
boolean backgroundRestricted) {
return String.format(
@@ -1885,12 +1965,27 @@
.build();
}
- private ApplicationInfo buildApplicationInfo(String label) {
+ private ApplicationInfo buildApplicationInfo(String label, int uid) {
final ApplicationInfo ai = new ApplicationInfo();
ai.nonLocalizedLabel = label;
+ ai.uid = uid;
return ai;
}
+ private List<ApplicationInfo> buildInstalledApplicationInfoList() {
+ final List<ApplicationInfo> installedApps = new ArrayList<>();
+ installedApps.add(buildApplicationInfo(PKG_NAME_A, UID_A));
+ installedApps.add(buildApplicationInfo(PKG_NAME_B, UID_B));
+ installedApps.add(buildApplicationInfo(PKG_NAME_C, UID_C));
+ return installedApps;
+ }
+
+ private List<UserInfo> buildUserInfoList() {
+ final List<UserInfo> users = new ArrayList<>();
+ users.add(new UserInfo(USER_ID, "user1", 0));
+ return users;
+ }
+
private NetworkInfo buildNetworkInfo() {
final NetworkInfo ni = new NetworkInfo(ConnectivityManager.TYPE_MOBILE,
TelephonyManager.NETWORK_TYPE_LTE, null, null);
@@ -1964,6 +2059,15 @@
hasIt ? PackageManager.PERMISSION_GRANTED : PackageManager.PERMISSION_DENIED);
}
+ private void expectHasUseRestrictedNetworksPermission(int uid, boolean hasIt) throws Exception {
+ when(mIpm.checkUidPermission(CONNECTIVITY_USE_RESTRICTED_NETWORKS, uid)).thenReturn(
+ hasIt ? PackageManager.PERMISSION_GRANTED : PackageManager.PERMISSION_DENIED);
+ when(mIpm.checkUidPermission(NETWORK_STACK, uid)).thenReturn(
+ PackageManager.PERMISSION_DENIED);
+ when(mIpm.checkUidPermission(PERMISSION_MAINLINE_NETWORK_STACK, uid)).thenReturn(
+ PackageManager.PERMISSION_DENIED);
+ }
+
private void expectNetworkState(boolean roaming) throws Exception {
when(mCarrierConfigManager.getConfigForSubId(eq(TEST_SUB_ID)))
.thenReturn(mCarrierConfig);
@@ -2040,7 +2144,7 @@
}
}
- private void assertAllowlistUids(int... uids) {
+ private void assertRestrictBackgroundAllowedUids(int... uids) {
assertContainsInAnyOrder(mService.getUidsWithPolicy(POLICY_ALLOW_METERED_BACKGROUND), uids);
}
diff --git a/services/tests/servicestests/src/com/android/server/powerstats/PowerStatsServiceTest.java b/services/tests/servicestests/src/com/android/server/powerstats/PowerStatsServiceTest.java
index b26d1efe..08d4caa 100644
--- a/services/tests/servicestests/src/com/android/server/powerstats/PowerStatsServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/powerstats/PowerStatsServiceTest.java
@@ -209,7 +209,7 @@
}
@Override
- public boolean initialize() {
+ public boolean isInitialized() {
return true;
}
}
diff --git a/services/tests/servicestests/src/com/android/server/tv/tunerresourcemanager/TunerResourceManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/tv/tunerresourcemanager/TunerResourceManagerServiceTest.java
index 1055069..8f7ea87 100644
--- a/services/tests/servicestests/src/com/android/server/tv/tunerresourcemanager/TunerResourceManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/tv/tunerresourcemanager/TunerResourceManagerServiceTest.java
@@ -815,6 +815,14 @@
shareClientId1[0],
400/*priority*/,
0/*niceValue*/);
+ mTunerResourceManagerService.updateClientPriorityInternal(
+ shareClientId1[0],
+ -1/*invalid priority*/,
+ 0/*niceValue*/);
+ assertThat(mTunerResourceManagerService
+ .getClientProfile(shareClientId1[0])
+ .getPriority())
+ .isEqualTo(400);
/**** Init Frontend Resources ****/
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenersTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenersTest.java
new file mode 100644
index 0000000..a093e0d
--- /dev/null
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenersTest.java
@@ -0,0 +1,242 @@
+/*
+ * 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.notification;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+import android.app.INotificationManager;
+import android.content.ComponentName;
+import android.content.pm.IPackageManager;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.content.pm.ServiceInfo;
+import android.service.notification.NotificationListenerFilter;
+import android.util.ArraySet;
+import android.util.Pair;
+import android.util.TypedXmlPullParser;
+import android.util.TypedXmlSerializer;
+import android.util.Xml;
+
+import com.android.server.UiServiceTestCase;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+public class NotificationListenersTest extends UiServiceTestCase {
+
+ @Mock
+ private PackageManager mPm;
+ @Mock
+ private IPackageManager miPm;
+
+ @Mock
+ NotificationManagerService mNm;
+ @Mock
+ private INotificationManager mINm;
+
+ NotificationManagerService.NotificationListeners mListeners;
+
+ private ComponentName mCn1 = new ComponentName("pkg", "pkg.cmp");
+ private ComponentName mCn2 = new ComponentName("pkg2", "pkg2.cmp2");
+
+
+ @Before
+ public void setUp() throws Exception {
+ MockitoAnnotations.initMocks(this);
+ getContext().setMockPackageManager(mPm);
+
+ mListeners = spy(mNm.new NotificationListeners(
+ mContext, new Object(), mock(ManagedServices.UserProfiles.class), miPm));
+ when(mNm.getBinderService()).thenReturn(mINm);
+ }
+
+ @Test
+ public void testReadExtraTag() throws Exception {
+ String xml = "<requested_listeners>"
+ + "<listener component=\"" + mCn1.flattenToString() + "\" user=\"0\">"
+ + "<allowed types=\"7\" />"
+ + "<disallowed pkgs=\"\" />"
+ + "</listener>"
+ + "<listener component=\"" + mCn2.flattenToString() + "\" user=\"10\">"
+ + "<allowed types=\"4\" />"
+ + "<disallowed pkgs=\"something\" />"
+ + "</listener>"
+ + "</requested_listeners>";
+
+ TypedXmlPullParser parser = Xml.newFastPullParser();
+ parser.setInput(new BufferedInputStream(
+ new ByteArrayInputStream(xml.getBytes())), null);
+ parser.nextTag();
+ mListeners.readExtraTag("requested_listeners", parser);
+
+ validateListenersFromXml();
+ }
+
+ @Test
+ public void testWriteExtraTag() throws Exception {
+ NotificationListenerFilter nlf = new NotificationListenerFilter(7, new ArraySet<>());
+ NotificationListenerFilter nlf2 =
+ new NotificationListenerFilter(4, new ArraySet<>(new String[] {"something"}));
+ mListeners.setNotificationListenerFilter(Pair.create(mCn1, 0), nlf);
+ mListeners.setNotificationListenerFilter(Pair.create(mCn2, 10), nlf2);
+
+ TypedXmlSerializer serializer = Xml.newFastSerializer();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ serializer.setOutput(new BufferedOutputStream(baos), "utf-8");
+ serializer.startDocument(null, true);
+ mListeners.writeExtraXmlTags(serializer);
+ serializer.endDocument();
+ serializer.flush();
+
+ TypedXmlPullParser parser = Xml.newFastPullParser();
+ parser.setInput(new BufferedInputStream(
+ new ByteArrayInputStream(baos.toByteArray())), null);
+ parser.nextTag();
+ mListeners.readExtraTag("requested_listeners", parser);
+
+ validateListenersFromXml();
+ }
+
+ private void validateListenersFromXml() {
+ assertThat(mListeners.getNotificationListenerFilter(Pair.create(mCn1, 0)).getTypes())
+ .isEqualTo(7);
+ assertThat(mListeners.getNotificationListenerFilter(Pair.create(mCn1, 0))
+ .getDisallowedPackages())
+ .isEmpty();
+
+ assertThat(mListeners.getNotificationListenerFilter(Pair.create(mCn2, 10)).getTypes())
+ .isEqualTo(4);
+ assertThat(mListeners.getNotificationListenerFilter(Pair.create(mCn2, 10))
+ .getDisallowedPackages())
+ .contains("something");
+ }
+
+ @Test
+ public void testOnUserRemoved() {
+ NotificationListenerFilter nlf = new NotificationListenerFilter(7, new ArraySet<>());
+ NotificationListenerFilter nlf2 =
+ new NotificationListenerFilter(4, new ArraySet<>(new String[] {"something"}));
+ mListeners.setNotificationListenerFilter(Pair.create(mCn1, 0), nlf);
+ mListeners.setNotificationListenerFilter(Pair.create(mCn2, 10), nlf2);
+
+ mListeners.onUserRemoved(0);
+
+ assertThat(mListeners.getNotificationListenerFilter(Pair.create(mCn1, 0))).isNull();
+ assertThat(mListeners.getNotificationListenerFilter(Pair.create(mCn2, 10)).getTypes())
+ .isEqualTo(4);
+ }
+
+ @Test
+ public void testOnUserUnlocked() {
+ // one exists already, say from xml
+ NotificationListenerFilter nlf =
+ new NotificationListenerFilter(4, new ArraySet<>(new String[] {"something"}));
+ mListeners.setNotificationListenerFilter(Pair.create(mCn2, 0), nlf);
+
+ // new service exists or backfilling on upgrade to S
+ ServiceInfo si = new ServiceInfo();
+ si.permission = mListeners.getConfig().bindPermission;
+ si.packageName = "new";
+ si.name = "comp";
+ ResolveInfo ri = new ResolveInfo();
+ ri.serviceInfo = si;
+
+ // incorrect service
+ ServiceInfo si2 = new ServiceInfo();
+ ResolveInfo ri2 = new ResolveInfo();
+ ri2.serviceInfo = si2;
+ si2.packageName = "new2";
+ si2.name = "comp2";
+
+ List<ResolveInfo> ris = new ArrayList<>();
+ ris.add(ri);
+ ris.add(ri2);
+
+ when(mPm.queryIntentServicesAsUser(any(), anyInt(), anyInt())).thenReturn(ris);
+
+ mListeners.onUserUnlocked(0);
+
+ assertThat(mListeners.getNotificationListenerFilter(Pair.create(mCn2, 0)).getTypes())
+ .isEqualTo(4);
+ assertThat(mListeners.getNotificationListenerFilter(Pair.create(mCn2, 0))
+ .getDisallowedPackages())
+ .contains("something");
+
+ assertThat(mListeners.getNotificationListenerFilter(
+ Pair.create(si.getComponentName(), 0)).getTypes())
+ .isEqualTo(7);
+ assertThat(mListeners.getNotificationListenerFilter(Pair.create(si.getComponentName(), 0))
+ .getDisallowedPackages())
+ .isEmpty();
+
+ assertThat(mListeners.getNotificationListenerFilter(Pair.create(si2.getComponentName(), 0)))
+ .isNull();
+
+ }
+
+ @Test
+ public void testOnPackageChanged() {
+ NotificationListenerFilter nlf = new NotificationListenerFilter(7, new ArraySet<>());
+ NotificationListenerFilter nlf2 =
+ new NotificationListenerFilter(4, new ArraySet<>(new String[] {"something"}));
+ mListeners.setNotificationListenerFilter(Pair.create(mCn1, 0), nlf);
+ mListeners.setNotificationListenerFilter(Pair.create(mCn2, 10), nlf2);
+
+ String[] pkgs = new String[] {mCn1.getPackageName()};
+ int[] uids = new int[] {1};
+ mListeners.onPackagesChanged(false, pkgs, uids);
+
+ // not removing; no change
+ assertThat(mListeners.getNotificationListenerFilter(Pair.create(mCn1, 0)).getTypes())
+ .isEqualTo(7);
+ assertThat(mListeners.getNotificationListenerFilter(Pair.create(mCn2, 10)).getTypes())
+ .isEqualTo(4);
+ }
+
+ @Test
+ public void testOnPackageChanged_removing() {
+ NotificationListenerFilter nlf = new NotificationListenerFilter(7, new ArraySet<>());
+ NotificationListenerFilter nlf2 =
+ new NotificationListenerFilter(4, new ArraySet<>(new String[] {"something"}));
+ mListeners.setNotificationListenerFilter(Pair.create(mCn1, 0), nlf);
+ mListeners.setNotificationListenerFilter(Pair.create(mCn2, 0), nlf2);
+
+ String[] pkgs = new String[] {mCn1.getPackageName()};
+ int[] uids = new int[] {1};
+ mListeners.onPackagesChanged(true, pkgs, uids);
+
+ // only mCn1 removed
+ assertThat(mListeners.getNotificationListenerFilter(Pair.create(mCn1, 0))).isNull();
+ assertThat(mListeners.getNotificationListenerFilter(Pair.create(mCn2, 0)).getTypes())
+ .isEqualTo(4);
+ }
+
+}
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 a18bce7..bd622e1 100755
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
@@ -55,6 +55,7 @@
import static android.os.UserHandle.USER_SYSTEM;
import static android.service.notification.Adjustment.KEY_IMPORTANCE;
import static android.service.notification.Adjustment.KEY_USER_SENTIMENT;
+import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_ALERTING;
import static android.service.notification.NotificationListenerService.Ranking.USER_SENTIMENT_NEGATIVE;
import static android.service.notification.NotificationListenerService.Ranking.USER_SENTIMENT_NEUTRAL;
@@ -143,6 +144,7 @@
import android.provider.Settings;
import android.service.notification.Adjustment;
import android.service.notification.ConversationChannelWrapper;
+import android.service.notification.NotificationListenerFilter;
import android.service.notification.NotificationListenerService;
import android.service.notification.NotificationStats;
import android.service.notification.StatusBarNotification;
@@ -269,6 +271,8 @@
@Mock
private NotificationListeners mListeners;
+ @Mock
+ private NotificationListenerFilter mNlf;
@Mock private NotificationAssistants mAssistants;
@Mock private ConditionProviders mConditionProviders;
private ManagedServices.ManagedServiceInfo mListener;
@@ -459,6 +463,10 @@
mPolicyFile.finishWrite(fos);
// Setup managed services
+ when(mNlf.isTypeAllowed(anyInt())).thenReturn(true);
+ when(mNlf.isPackageAllowed(anyString())).thenReturn(true);
+ when(mNlf.isPackageAllowed(null)).thenReturn(true);
+ when(mListeners.getNotificationListenerFilter(any())).thenReturn(mNlf);
mListener = mListeners.new ManagedServiceInfo(
null, new ComponentName(PKG, "test_class"),
UserHandle.getUserId(mUid), true, null, 0);
@@ -3596,7 +3604,7 @@
mService.mNotificationDelegate.onNotificationDirectReplied(r.getKey());
assertTrue(mService.getNotificationRecord(r.getKey()).getStats().hasDirectReplied());
- verify(mAssistants).notifyAssistantNotificationDirectReplyLocked(eq(r.getSbn()));
+ verify(mAssistants).notifyAssistantNotificationDirectReplyLocked(eq(r));
assertEquals(1, mNotificationRecordLogger.numCalls());
assertEquals(NotificationRecordLogger.NotificationEvent.NOTIFICATION_DIRECT_REPLIED,
@@ -3610,14 +3618,14 @@
mService.mNotificationDelegate.onNotificationExpansionChanged(r.getKey(), true, true,
NOTIFICATION_LOCATION_UNKNOWN);
- verify(mAssistants).notifyAssistantExpansionChangedLocked(eq(r.getSbn()), eq(true),
- eq((true)));
+ verify(mAssistants).notifyAssistantExpansionChangedLocked(eq(r.getSbn()),
+ eq(FLAG_FILTER_TYPE_ALERTING), eq(true), eq((true)));
assertTrue(mService.getNotificationRecord(r.getKey()).getStats().hasExpanded());
mService.mNotificationDelegate.onNotificationExpansionChanged(r.getKey(), true, false,
NOTIFICATION_LOCATION_UNKNOWN);
- verify(mAssistants).notifyAssistantExpansionChangedLocked(eq(r.getSbn()), eq(true),
- eq((false)));
+ verify(mAssistants).notifyAssistantExpansionChangedLocked(eq(r.getSbn()),
+ eq(FLAG_FILTER_TYPE_ALERTING), eq(true), eq((false)));
assertTrue(mService.getNotificationRecord(r.getKey()).getStats().hasExpanded());
assertEquals(2, mNotificationRecordLogger.numCalls());
@@ -3635,14 +3643,14 @@
mService.mNotificationDelegate.onNotificationExpansionChanged(r.getKey(), false, true,
NOTIFICATION_LOCATION_UNKNOWN);
assertFalse(mService.getNotificationRecord(r.getKey()).getStats().hasExpanded());
- verify(mAssistants).notifyAssistantExpansionChangedLocked(eq(r.getSbn()), eq(false),
- eq((true)));
+ verify(mAssistants).notifyAssistantExpansionChangedLocked(eq(r.getSbn()),
+ eq(FLAG_FILTER_TYPE_ALERTING), eq(false), eq((true)));
mService.mNotificationDelegate.onNotificationExpansionChanged(r.getKey(), false, false,
NOTIFICATION_LOCATION_UNKNOWN);
assertFalse(mService.getNotificationRecord(r.getKey()).getStats().hasExpanded());
verify(mAssistants).notifyAssistantExpansionChangedLocked(
- eq(r.getSbn()), eq(false), eq((false)));
+ eq(r.getSbn()), eq(FLAG_FILTER_TYPE_ALERTING), eq(false), eq((false)));
}
@Test
@@ -3662,11 +3670,11 @@
final NotificationVisibility nv = NotificationVisibility.obtain(r.getKey(), 1, 2, true);
mService.mNotificationDelegate.onNotificationVisibilityChanged(
new NotificationVisibility[] {nv}, new NotificationVisibility[]{});
- verify(mAssistants).notifyAssistantVisibilityChangedLocked(eq(r.getSbn()), eq(true));
+ verify(mAssistants).notifyAssistantVisibilityChangedLocked(eq(r), eq(true));
assertTrue(mService.getNotificationRecord(r.getKey()).getStats().hasSeen());
mService.mNotificationDelegate.onNotificationVisibilityChanged(
new NotificationVisibility[] {}, new NotificationVisibility[]{nv});
- verify(mAssistants).notifyAssistantVisibilityChangedLocked(eq(r.getSbn()), eq(false));
+ verify(mAssistants).notifyAssistantVisibilityChangedLocked(eq(r), eq(false));
assertTrue(mService.getNotificationRecord(r.getKey()).getStats().hasSeen());
}
@@ -5324,7 +5332,7 @@
r.getKey(), replyIndex, reply, NOTIFICATION_LOCATION_UNKNOWN,
modifiedBeforeSending);
verify(mAssistants).notifyAssistantSuggestedReplySent(
- eq(r.getSbn()), eq(reply), eq(generatedByAssistant));
+ eq(r.getSbn()), eq(FLAG_FILTER_TYPE_ALERTING), eq(reply), eq(generatedByAssistant));
assertEquals(1, mNotificationRecordLogger.numCalls());
assertEquals(NotificationRecordLogger.NotificationEvent.NOTIFICATION_SMART_REPLIED,
mNotificationRecordLogger.event(0));
@@ -5346,7 +5354,7 @@
10, 10, r.getKey(), actionIndex, action, notificationVisibility,
generatedByAssistant);
verify(mAssistants).notifyAssistantActionClicked(
- eq(r.getSbn()), eq(action), eq(generatedByAssistant));
+ eq(r), eq(action), eq(generatedByAssistant));
assertEquals(1, mNotificationRecordLogger.numCalls());
assertEquals(
@@ -5370,7 +5378,7 @@
10, 10, r.getKey(), actionIndex, action, notificationVisibility,
generatedByAssistant);
verify(mAssistants).notifyAssistantActionClicked(
- eq(r.getSbn()), eq(action), eq(generatedByAssistant));
+ eq(r), eq(action), eq(generatedByAssistant));
assertEquals(1, mNotificationRecordLogger.numCalls());
assertEquals(
@@ -7249,7 +7257,7 @@
when(info.enabledAndUserMatches(info.userid)).thenReturn(false);
when(mAssistants.checkServiceTokenLocked(any())).thenReturn(assistant);
- assertFalse(mService.isVisibleToListener(sbn, info));
+ assertFalse(mService.isVisibleToListener(sbn, 0, info));
}
@Test
@@ -7262,7 +7270,7 @@
when(info.enabledAndUserMatches(info.userid)).thenReturn(true);
when(mAssistants.checkServiceTokenLocked(any())).thenReturn(null);
- assertTrue(mService.isVisibleToListener(sbn, info));
+ assertTrue(mService.isVisibleToListener(sbn, 0, info));
}
@Test
@@ -7277,7 +7285,7 @@
when(info.enabledAndUserMatches(info.userid)).thenReturn(true);
when(mAssistants.checkServiceTokenLocked(any())).thenReturn(assistant);
- assertFalse(mService.isVisibleToListener(sbn, info));
+ assertFalse(mService.isVisibleToListener(sbn, 0, info));
}
@Test
@@ -7292,7 +7300,42 @@
when(info.enabledAndUserMatches(info.userid)).thenReturn(true);
when(mAssistants.checkServiceTokenLocked(any())).thenReturn(assistant);
- assertTrue(mService.isVisibleToListener(sbn, info));
+ assertTrue(mService.isVisibleToListener(sbn, 0, info));
+ }
+
+ @Test
+ public void testIsVisibleToListener_mismatchedType() {
+ when(mNlf.isTypeAllowed(anyInt())).thenReturn(false);
+
+ StatusBarNotification sbn = mock(StatusBarNotification.class);
+ when(sbn.getUserId()).thenReturn(10);
+ ManagedServices.ManagedServiceInfo info = mock(ManagedServices.ManagedServiceInfo.class);
+ ManagedServices.ManagedServiceInfo assistant = mock(ManagedServices.ManagedServiceInfo.class);
+ info.userid = 10;
+ when(info.isSameUser(anyInt())).thenReturn(true);
+ when(assistant.isSameUser(anyInt())).thenReturn(true);
+ when(info.enabledAndUserMatches(info.userid)).thenReturn(true);
+ when(mAssistants.checkServiceTokenLocked(any())).thenReturn(assistant);
+
+ assertFalse(mService.isVisibleToListener(sbn, 0, info));
+ }
+
+ @Test
+ public void testIsVisibleToListener_disallowedPackage() {
+ when(mNlf.isPackageAllowed(null)).thenReturn(false);
+
+ StatusBarNotification sbn = mock(StatusBarNotification.class);
+ when(sbn.getUserId()).thenReturn(10);
+ ManagedServices.ManagedServiceInfo info = mock(ManagedServices.ManagedServiceInfo.class);
+ ManagedServices.ManagedServiceInfo assistant =
+ mock(ManagedServices.ManagedServiceInfo.class);
+ info.userid = 10;
+ when(info.isSameUser(anyInt())).thenReturn(true);
+ when(assistant.isSameUser(anyInt())).thenReturn(true);
+ when(info.enabledAndUserMatches(info.userid)).thenReturn(true);
+ when(mAssistants.checkServiceTokenLocked(any())).thenReturn(assistant);
+
+ assertFalse(mService.isVisibleToListener(sbn, 0, info));
}
@Test
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationRecordTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationRecordTest.java
index 976f408..da613e6 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationRecordTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationRecordTest.java
@@ -21,6 +21,9 @@
import static android.app.NotificationManager.IMPORTANCE_LOW;
import static android.service.notification.Adjustment.KEY_IMPORTANCE;
import static android.service.notification.Adjustment.KEY_NOT_CONVERSATION;
+import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_ALERTING;
+import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_CONVERSATIONS;
+import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_SILENT;
import static android.service.notification.NotificationListenerService.Ranking.USER_SENTIMENT_NEGATIVE;
import static android.service.notification.NotificationListenerService.Ranking.USER_SENTIMENT_NEUTRAL;
import static android.service.notification.NotificationListenerService.Ranking.USER_SENTIMENT_POSITIVE;
@@ -910,11 +913,13 @@
record.setAssistantImportance(IMPORTANCE_LOW);
record.calculateImportance();
assertEquals(IMPORTANCE_LOW, record.getImportance());
+ assertEquals(FLAG_FILTER_TYPE_SILENT, record.getNotificationType());
record.updateNotificationChannel(
new NotificationChannel(channelId, "", IMPORTANCE_DEFAULT));
assertEquals(IMPORTANCE_LOW, record.getImportance());
+ assertEquals(FLAG_FILTER_TYPE_SILENT, record.getNotificationType());
}
@Test
@@ -1125,6 +1130,7 @@
record.setShortcutInfo(mock(ShortcutInfo.class));
assertTrue(record.isConversation());
+ assertEquals(FLAG_FILTER_TYPE_CONVERSATIONS, record.getNotificationType());
}
@Test
@@ -1134,6 +1140,7 @@
record.setShortcutInfo(null);
assertTrue(record.isConversation());
+ assertEquals(FLAG_FILTER_TYPE_CONVERSATIONS, record.getNotificationType());
}
@Test
@@ -1144,6 +1151,7 @@
record.setHasSentValidMsg(true);
assertFalse(record.isConversation());
+ assertEquals(FLAG_FILTER_TYPE_ALERTING, record.getNotificationType());
}
@Test
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 801a27d..1700707 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityDisplayTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityDisplayTests.java
@@ -72,7 +72,7 @@
stack.moveToFront("moveStackToFront");
// After moving the stack to front, the previous focused should be the last focused.
- assertTrue(stack.isFocusedStackOnDisplay());
+ assertTrue(stack.isFocusedRootTaskOnDisplay());
assertEquals(prevFocusedStack, taskDisplayAreas.getLastFocusedRootTask());
stack.moveToBack("moveStackToBack", null /* task */);
@@ -96,7 +96,7 @@
pinnedStack.moveToFront("movePinnedStackToFront");
// The focused stack should be the pinned stack.
- assertTrue(pinnedStack.isFocusedStackOnDisplay());
+ assertTrue(pinnedStack.isFocusedRootTaskOnDisplay());
// Create a fullscreen stack and move to front.
final Task fullscreenStack = createFullscreenStackWithSimpleActivityAt(
@@ -104,7 +104,7 @@
fullscreenStack.moveToFront("moveFullscreenStackToFront");
// The focused stack should be the fullscreen stack.
- assertTrue(fullscreenStack.isFocusedStackOnDisplay());
+ assertTrue(fullscreenStack.isFocusedRootTaskOnDisplay());
}
/**
@@ -121,15 +121,15 @@
// Put stack1 and stack2 on top.
stack1.moveToFront("moveStack1ToFront");
stack2.moveToFront("moveStack2ToFront");
- assertTrue(stack2.isFocusedStackOnDisplay());
+ assertTrue(stack2.isFocusedRootTaskOnDisplay());
// Stack1 should be focused after moving stack2 to back.
stack2.moveToBack("moveStack2ToBack", null /* task */);
- assertTrue(stack1.isFocusedStackOnDisplay());
+ assertTrue(stack1.isFocusedRootTaskOnDisplay());
// Stack2 should be focused after removing stack1.
stack1.getDisplayArea().removeRootTask(stack1);
- assertTrue(stack2.isFocusedStackOnDisplay());
+ assertTrue(stack2.isFocusedRootTaskOnDisplay());
}
/**
@@ -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(topPosition - 1, taskDisplayArea.getTaskIndexOf(anotherAlwaysOnTopStack));
+ assertEquals(topPosition - 1, getTaskIndexOf(taskDisplayArea, 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(topPosition - 3, taskDisplayArea.getTaskIndexOf(nonAlwaysOnTopStack));
+ assertEquals(topPosition - 3, getTaskIndexOf(taskDisplayArea, 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(topPosition - 2, taskDisplayArea.getTaskIndexOf(anotherAlwaysOnTopStack));
+ assertEquals(topPosition - 2, getTaskIndexOf(taskDisplayArea, anotherAlwaysOnTopStack));
anotherAlwaysOnTopStack.setAlwaysOnTop(true);
// Ensure always on top state changes properly when windowing mode changes.
anotherAlwaysOnTopStack.setWindowingMode(WINDOWING_MODE_FULLSCREEN);
assertFalse(anotherAlwaysOnTopStack.isAlwaysOnTop());
- assertEquals(topPosition - 2, taskDisplayArea.getTaskIndexOf(anotherAlwaysOnTopStack));
+ assertEquals(topPosition - 2, getTaskIndexOf(taskDisplayArea, anotherAlwaysOnTopStack));
anotherAlwaysOnTopStack.setWindowingMode(WINDOWING_MODE_FREEFORM);
assertTrue(anotherAlwaysOnTopStack.isAlwaysOnTop());
- assertEquals(topPosition - 1, taskDisplayArea.getTaskIndexOf(anotherAlwaysOnTopStack));
+ assertEquals(topPosition - 1, getTaskIndexOf(taskDisplayArea, 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(topPosition - 1, taskDisplayArea.getTaskIndexOf(pinnedStack));
+ assertEquals(topPosition - 1, getTaskIndexOf(taskDisplayArea, pinnedStack));
final Task assistStack = taskDisplayArea.createRootTask(
WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_ASSISTANT, true /* onTop */);
@@ -295,7 +295,7 @@
final boolean isAssistantOnTop = mContext.getResources()
.getBoolean(com.android.internal.R.bool.config_assistantOnTopOfDream);
assertEquals(isAssistantOnTop ? topPosition : topPosition - 4,
- taskDisplayArea.getTaskIndexOf(assistStack));
+ getTaskIndexOf(taskDisplayArea, 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 95a1b61..83cadf3 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
@@ -254,26 +254,26 @@
// Set and apply options for ActivityRecord. Pending options should be cleared
activity.updateOptionsLocked(activityOptions);
- activity.applyOptionsLocked();
- assertNull(activity.pendingOptions);
+ activity.applyOptionsAnimation();
+ assertNull(activity.getOptions());
// Set options for two ActivityRecords in same Task. Apply one ActivityRecord options.
// Pending options should be cleared for both ActivityRecords
ActivityRecord activity2 = new ActivityBuilder(mAtm).setTask(activity.getTask()).build();
activity2.updateOptionsLocked(activityOptions);
activity.updateOptionsLocked(activityOptions);
- activity.applyOptionsLocked();
- assertNull(activity.pendingOptions);
- assertNull(activity2.pendingOptions);
+ activity.applyOptionsAnimation();
+ assertNull(activity.getOptions());
+ assertNull(activity2.getOptions());
// Set options for two ActivityRecords in separate Tasks. Apply one ActivityRecord options.
// Pending options should be cleared for only ActivityRecord that was applied
activity2 = new ActivityBuilder(mAtm).setCreateTask(true).build();
activity2.updateOptionsLocked(activityOptions);
activity.updateOptionsLocked(activityOptions);
- activity.applyOptionsLocked();
- assertNull(activity.pendingOptions);
- assertNotNull(activity2.pendingOptions);
+ activity.applyOptionsAnimation();
+ assertNull(activity.getOptions());
+ assertNotNull(activity2.getOptions());
}
@Test
@@ -653,21 +653,21 @@
public void onAnimationStart(RemoteAnimationTarget[] apps,
RemoteAnimationTarget[] wallpapers,
IRemoteAnimationFinishedCallback finishedCallback) {
-
}
@Override
public void onAnimationCancelled() {
-
}
}, 0, 0));
activity.updateOptionsLocked(opts);
- assertNotNull(activity.takeOptionsLocked(true /* fromClient */));
- assertNotNull(activity.pendingOptions);
+ assertNotNull(activity.takeOptions());
+ assertNull(activity.getOptions());
- activity.updateOptionsLocked(ActivityOptions.makeBasic());
- assertNotNull(activity.takeOptionsLocked(false /* fromClient */));
- assertNull(activity.pendingOptions);
+ final AppTransition appTransition = activity.mDisplayContent.mAppTransition;
+ spyOn(appTransition);
+ activity.applyOptionsAnimation();
+
+ verify(appTransition).overridePendingAppTransitionRemote(any());
}
@Test
@@ -745,7 +745,7 @@
assertEquals("Duplicate finish request must be ignored", FINISH_RESULT_CANCELLED,
activity.finishIfPossible("test", false /* oomAdj */));
assertTrue(activity.finishing);
- assertTrue(activity.isInStackLocked());
+ assertTrue(activity.isInRootTaskLocked());
// Remove activity from task
activity.finishing = false;
@@ -766,7 +766,7 @@
assertEquals("Currently resumed activity must be prepared removal", FINISH_RESULT_REQUESTED,
activity.finishIfPossible("test", false /* oomAdj */));
assertTrue(activity.finishing);
- assertTrue(activity.isInStackLocked());
+ assertTrue(activity.isInRootTaskLocked());
// First request to finish activity must schedule a "destroy" request to the client.
// Activity must be removed from history after the client reports back or after timeout.
@@ -775,7 +775,7 @@
assertEquals("Activity outside of task/stack cannot be finished", FINISH_RESULT_REQUESTED,
activity.finishIfPossible("test", false /* oomAdj */));
assertTrue(activity.finishing);
- assertTrue(activity.isInStackLocked());
+ assertTrue(activity.isInRootTaskLocked());
}
/**
@@ -804,7 +804,7 @@
assertEquals("Activity outside of task/stack cannot be finished", FINISH_RESULT_REMOVED,
activity.finishIfPossible("test", false /* oomAdj */));
assertTrue(activity.finishing);
- assertFalse(activity.isInStackLocked());
+ assertFalse(activity.isInRootTaskLocked());
}
/**
@@ -826,13 +826,13 @@
final Task task2 = new TaskBuilder(mSupervisor).setCreateActivity(true).build();
task2.moveToBack("test", task2.getBottomMostTask());
- assertTrue(task.isTopStackInDisplayArea());
+ assertTrue(task.isTopRootTaskInDisplayArea());
activity.setState(RESUMED, "test");
activity.finishIfPossible(0 /* resultCode */, null /* resultData */,
null /* resultGrants */, "test", false /* oomAdj */);
- assertTrue(task1.isTopStackInDisplayArea());
+ assertTrue(task1.isTopRootTaskInDisplayArea());
}
/**
@@ -854,7 +854,7 @@
.build();
Task topRootableTask = topActivity.getTask();
topRootableTask.moveToFront("test");
- assertTrue(rootTask.isTopStackInDisplayArea());
+ assertTrue(rootTask.isTopRootTaskInDisplayArea());
// Finish top activity and verify the next focusable rootable task has adjusted to top.
topActivity.setState(RESUMED, "test");
@@ -876,7 +876,7 @@
createActivityOnDisplay(true /* defaultDisplay */, null /* process */);
Task topRootableTask = topActivityOnNonTopDisplay.getRootTask();
topRootableTask.moveToFront("test");
- assertTrue(topRootableTask.isTopStackInDisplayArea());
+ assertTrue(topRootableTask.isTopRootTaskInDisplayArea());
assertEquals(topRootableTask, topActivityOnNonTopDisplay.getDisplayArea()
.mPreferredTopFocusableRootTask);
@@ -884,7 +884,7 @@
createActivityOnDisplay(false /* defaultDisplay */, null /* process */);
topRootableTask = secondaryDisplayActivity.getRootTask();
topRootableTask.moveToFront("test");
- assertTrue(topRootableTask.isTopStackInDisplayArea());
+ assertTrue(topRootableTask.isTopRootTaskInDisplayArea());
assertEquals(topRootableTask,
secondaryDisplayActivity.getDisplayArea().mPreferredTopFocusableRootTask);
@@ -1660,8 +1660,8 @@
any() /* window */, any() /* attrs */,
anyInt() /* viewVisibility */, anyInt() /* displayId */,
any() /* requestedVisibility */, any() /* outFrame */,
- any() /* outDisplayCutout */, any() /* outInputChannel */,
- any() /* outInsetsState */, any() /* outActiveControls */);
+ any() /* outInputChannel */, any() /* outInsetsState */,
+ any() /* outActiveControls */);
mAtm.mWindowManager.mStartingSurfaceController
.createTaskSnapshotSurface(activity, snapshot);
} catch (RemoteException ignored) {
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 8ea95ae..8b8617d 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityStackTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityStackTests.java
@@ -167,7 +167,7 @@
null /* task */);
// Assert that stack is at the bottom.
- assertEquals(0, mDefaultTaskDisplayArea.getTaskIndexOf(primarySplitScreen));
+ assertEquals(0, getTaskIndexOf(mDefaultTaskDisplayArea, primarySplitScreen));
// Ensure no longer in splitscreen.
assertEquals(WINDOWING_MODE_FULLSCREEN, primarySplitScreen.getWindowingMode());
@@ -748,10 +748,10 @@
doReturn(false).when(fullscreenStack).isTranslucent(any());
// Ensure that we don't move the home stack if it is already behind the top fullscreen stack
- int homeStackIndex = mDefaultTaskDisplayArea.getTaskIndexOf(homeStack);
+ int homeStackIndex = getTaskIndexOf(mDefaultTaskDisplayArea, homeStack);
assertEquals(fullscreenStack, getRootTaskAbove(homeStack));
mDefaultTaskDisplayArea.moveRootTaskBehindBottomMostVisibleRootTask(homeStack);
- assertEquals(homeStackIndex, mDefaultTaskDisplayArea.getTaskIndexOf(homeStack));
+ assertEquals(homeStackIndex, getTaskIndexOf(mDefaultTaskDisplayArea, homeStack));
}
@Test
@@ -766,10 +766,10 @@
doReturn(true).when(fullscreenStack).isTranslucent(any());
// Ensure that we don't move the home stack if it is already behind the top fullscreen stack
- int homeStackIndex = mDefaultTaskDisplayArea.getTaskIndexOf(homeStack);
+ int homeStackIndex = getTaskIndexOf(mDefaultTaskDisplayArea, homeStack);
assertEquals(fullscreenStack, getRootTaskAbove(homeStack));
mDefaultTaskDisplayArea.moveRootTaskBehindBottomMostVisibleRootTask(homeStack);
- assertEquals(homeStackIndex, mDefaultTaskDisplayArea.getTaskIndexOf(homeStack));
+ assertEquals(homeStackIndex, getTaskIndexOf(mDefaultTaskDisplayArea, homeStack));
}
@Test
@@ -784,10 +784,10 @@
doReturn(false).when(fullscreenStack).isTranslucent(any());
// Ensure we don't move the home stack if it is already on top
- int homeStackIndex = mDefaultTaskDisplayArea.getTaskIndexOf(homeStack);
+ int homeStackIndex = getTaskIndexOf(mDefaultTaskDisplayArea, homeStack);
assertNull(getRootTaskAbove(homeStack));
mDefaultTaskDisplayArea.moveRootTaskBehindBottomMostVisibleRootTask(homeStack);
- assertEquals(homeStackIndex, mDefaultTaskDisplayArea.getTaskIndexOf(homeStack));
+ assertEquals(homeStackIndex, getTaskIndexOf(mDefaultTaskDisplayArea, homeStack));
}
@Test
@@ -853,9 +853,9 @@
doReturn(false).when(fullscreenStack2).isTranslucent(any());
// Ensure we don't move the home stack behind itself
- int homeStackIndex = mDefaultTaskDisplayArea.getTaskIndexOf(homeStack);
+ int homeStackIndex = getTaskIndexOf(mDefaultTaskDisplayArea, homeStack);
mDefaultTaskDisplayArea.moveRootTaskBehindRootTask(homeStack, homeStack);
- assertEquals(homeStackIndex, mDefaultTaskDisplayArea.getTaskIndexOf(homeStack));
+ assertEquals(homeStackIndex, getTaskIndexOf(mDefaultTaskDisplayArea, homeStack));
}
@Test
@@ -1445,7 +1445,7 @@
task.mDisplayContent = display;
doReturn(keyguardGoingAway).when(keyguardController).isKeyguardGoingAway();
doReturn(displaySleeping).when(display).isSleeping();
- doReturn(focusedStack).when(task).isFocusedStackOnDisplay();
+ doReturn(focusedStack).when(task).isFocusedRootTaskOnDisplay();
assertEquals(expected, task.shouldSleepActivities());
}
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 cde866b..e8045e0 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java
@@ -33,7 +33,6 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
-import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
import static android.content.Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.content.Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED;
@@ -84,6 +83,7 @@
import android.os.RemoteException;
import android.platform.test.annotations.Presubmit;
import android.service.voice.IVoiceInteractionSession;
+import android.util.Pair;
import android.view.Gravity;
import androidx.test.filters.SmallTest;
@@ -434,17 +434,12 @@
final ActivityStarter starter = prepareStarter(
FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | FLAG_ACTIVITY_SINGLE_TOP,
false /* mockGetLaunchStack */);
- final ActivityRecord splitPrimaryFocusActivity =
- new ActivityBuilder(mAtm).setCreateTask(true).build();
- final ActivityRecord splitSecondReusableActivity =
- new ActivityBuilder(mAtm).setCreateTask(true).build();
- splitPrimaryFocusActivity.getRootTask()
- .setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
- splitSecondReusableActivity.getRootTask()
- .setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_SECONDARY);
+ final Pair<ActivityRecord, ActivityRecord> activities = createActivitiesInSplit();
+ final ActivityRecord splitPrimaryFocusActivity = activities.first;
+ final ActivityRecord splitSecondReusableActivity = activities.second;
// Set focus back to primary.
- splitPrimaryFocusActivity.getRootTask().moveToFront("testSplitScreenDeliverToTop");
+ splitPrimaryFocusActivity.moveFocusableActivityToTop("testSplitScreenDeliverToTop");
// Start activity and delivered new intent.
starter.getIntent().setComponent(splitSecondReusableActivity.mActivityComponent);
@@ -463,24 +458,15 @@
public void testSplitScreenTaskToFront() {
final ActivityStarter starter = prepareStarter(
FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | FLAG_ACTIVITY_SINGLE_TOP, false);
- final ActivityRecord splitSecondReusableActivity =
- new ActivityBuilder(mAtm).setCreateTask(true).build();
- final ActivityRecord splitSecondTopActivity =
- new ActivityBuilder(mAtm).setCreateTask(true).build();
- final ActivityRecord splitPrimaryFocusActivity =
- new ActivityBuilder(mAtm).setCreateTask(true).build();
- splitPrimaryFocusActivity.getRootTask()
- .setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
- splitSecondReusableActivity.getRootTask()
- .setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_SECONDARY);
- splitSecondTopActivity.getRootTask()
- .setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_SECONDARY);
-
- // Make it on top of split-screen-secondary.
- splitSecondTopActivity.getRootTask().moveToFront("testSplitScreenTaskToFront");
+ final Pair<ActivityRecord, ActivityRecord> activities = createActivitiesInSplit();
+ final ActivityRecord splitPrimaryFocusActivity = activities.first;
+ final ActivityRecord splitSecondReusableActivity = activities.second;
+ final ActivityRecord splitSecondTopActivity = new ActivityBuilder(mAtm).setCreateTask(true)
+ .setParentTask(splitSecondReusableActivity.getRootTask()).build();
+ assertTrue(splitSecondTopActivity.inSplitScreenSecondaryWindowingMode());
// Let primary stack has focus.
- splitPrimaryFocusActivity.getRootTask().moveToFront("testSplitScreenTaskToFront");
+ splitPrimaryFocusActivity.moveFocusableActivityToTop("testSplitScreenTaskToFront");
// Start activity and delivered new intent.
starter.getIntent().setComponent(splitSecondReusableActivity.mActivityComponent);
@@ -491,6 +477,23 @@
assertEquals(START_TASK_TO_FRONT, result);
}
+ /** Returns 2 activities. The first is in primary and the second is in secondary. */
+ private Pair<ActivityRecord, ActivityRecord> createActivitiesInSplit() {
+ final TestSplitOrganizer splitOrg = new TestSplitOrganizer(mAtm);
+ // The fullscreen windowing mode activity will be moved to split-secondary by
+ // TestSplitOrganizer when a split-primary task appears.
+ final ActivityRecord splitSecondActivity =
+ new ActivityBuilder(mAtm).setCreateTask(true).build();
+ final ActivityRecord splitPrimaryActivity = new TaskBuilder(mSupervisor)
+ .setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY).setCreateActivity(true)
+ .build().getTopMostActivity();
+ splitPrimaryActivity.mVisibleRequested = splitSecondActivity.mVisibleRequested = true;
+
+ assertEquals(splitOrg.mPrimary, splitPrimaryActivity.getRootTask());
+ assertEquals(splitOrg.mSecondary, splitSecondActivity.getRootTask());
+ return Pair.create(splitPrimaryActivity, splitSecondActivity);
+ }
+
/**
* Tests activity is cleaned up properly in a task mode violation.
*/
diff --git a/services/tests/wmtests/src/com/android/server/wm/AnimatingActivityRegistryTest.java b/services/tests/wmtests/src/com/android/server/wm/AnimatingActivityRegistryTest.java
index 9d8710d..8871056 100644
--- a/services/tests/wmtests/src/com/android/server/wm/AnimatingActivityRegistryTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/AnimatingActivityRegistryTest.java
@@ -66,7 +66,7 @@
final ActivityRecord activity2 = createAppWindow(activity1.getTask(), ACTIVITY_TYPE_STANDARD,
"activity2").mActivityRecord;
final AnimatingActivityRegistry registry =
- activity1.getStack().getAnimatingActivityRegistry();
+ activity1.getRootTask().getAnimatingActivityRegistry();
activity1.startAnimation(activity1.getPendingTransaction(), mAdapter, false /* hidden */,
ANIMATION_TYPE_APP_TRANSITION);
@@ -89,7 +89,7 @@
final ActivityRecord window2 = createAppWindow(window1.getTask(), ACTIVITY_TYPE_STANDARD,
"window2").mActivityRecord;
final AnimatingActivityRegistry registry =
- window1.getStack().getAnimatingActivityRegistry();
+ window1.getRootTask().getAnimatingActivityRegistry();
window1.startAnimation(window1.getPendingTransaction(), mAdapter, false /* hidden */,
ANIMATION_TYPE_APP_TRANSITION);
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 295c50b..6c824d6 100644
--- a/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java
@@ -188,11 +188,11 @@
// The visibility are already updated, but since forced transition is requested, it will
// be included.
assertEquals(
- new ArraySet<>(new WindowContainer[]{activity1.getStack()}),
+ new ArraySet<>(new WindowContainer[]{activity1.getRootTask()}),
AppTransitionController.getAnimationTargets(
opening, closing, true /* visible */));
assertEquals(
- new ArraySet<>(new WindowContainer[]{activity2.getStack()}),
+ new ArraySet<>(new WindowContainer[]{activity2.getRootTask()}),
AppTransitionController.getAnimationTargets(
opening, closing, false /* visible */));
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayAreaOrganizerTest.java b/services/tests/wmtests/src/com/android/server/wm/DisplayAreaOrganizerTest.java
index 1198ee2..5597be9 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DisplayAreaOrganizerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/DisplayAreaOrganizerTest.java
@@ -17,6 +17,7 @@
package com.android.server.wm;
import static android.view.Display.DEFAULT_DISPLAY;
+import static android.window.DisplayAreaOrganizer.FEATURE_DEFAULT_TASK_CONTAINER;
import static android.window.DisplayAreaOrganizer.FEATURE_ROOT;
import static android.window.DisplayAreaOrganizer.FEATURE_RUNTIME_TASK_CONTAINER_FIRST;
import static android.window.DisplayAreaOrganizer.FEATURE_VENDOR_FIRST;
@@ -117,7 +118,7 @@
}
@Test
- public void testCreateTaskDisplayArea() {
+ public void testCreateTaskDisplayArea_topBelowRoot() {
final String newTdaName = "testTda";
final IDisplayAreaOrganizer organizer = createMockOrganizer(new Binder());
final DisplayAreaAppearedInfo tdaInfo = mOrganizerController.createTaskDisplayArea(
@@ -142,6 +143,30 @@
}
@Test
+ public void testCreateTaskDisplayArea_topBelowAnotherTaskDisplayArea() {
+ final String newTdaName = "testTda";
+ final TaskDisplayArea parentTda = mDisplayContent.getDefaultTaskDisplayArea();
+ final IDisplayAreaOrganizer organizer = createMockOrganizer(new Binder());
+ final DisplayAreaAppearedInfo tdaInfo = mOrganizerController.createTaskDisplayArea(
+ organizer, DEFAULT_DISPLAY, FEATURE_DEFAULT_TASK_CONTAINER, newTdaName);
+
+ final WindowContainer wc = parentTda.getChildAt(parentTda.getChildCount() - 1);
+
+ // A new TaskDisplayArea is created on the top.
+ assertThat(wc).isInstanceOf(TaskDisplayArea.class);
+ assertThat(tdaInfo.getDisplayAreaInfo().displayId).isEqualTo(DEFAULT_DISPLAY);
+ assertThat(tdaInfo.getDisplayAreaInfo().token)
+ .isEqualTo(wc.mRemoteToken.toWindowContainerToken());
+
+ final TaskDisplayArea tda = wc.asTaskDisplayArea();
+
+ assertThat(tda.getName()).isEqualTo(newTdaName);
+ assertThat(tda.mFeatureId).isEqualTo(tdaInfo.getDisplayAreaInfo().featureId);
+ assertThat(tda.mCreatedByOrganizer).isTrue();
+ assertThat(tda.mOrganizer).isEqualTo(organizer);
+ }
+
+ @Test
public void testCreateTaskDisplayArea_incrementalTdaFeatureId() {
final String newTdaName = "testTda";
final IDisplayAreaOrganizer organizer = createMockOrganizer(new Binder());
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 b33bb7b..3306e31 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DisplayAreaPolicyBuilderTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/DisplayAreaPolicyBuilderTest.java
@@ -41,6 +41,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;
@@ -101,6 +102,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..2a55083 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,19 @@
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.assertNotNull;
+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 +42,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 +57,67 @@
*/
@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());
+ assertNotNull(untrustedDisplay.getWindowingLayer());
}
@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 +195,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 b451d9f..69b8ccf 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java
@@ -50,6 +50,7 @@
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR;
import static android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION;
import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
+import static android.window.DisplayAreaOrganizer.FEATURE_WINDOWED_MAGNIFICATION;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.any;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.anyBoolean;
@@ -106,6 +107,7 @@
import android.view.InsetsState;
import android.view.MotionEvent;
import android.view.Surface;
+import android.view.SurfaceControl;
import android.view.SurfaceControl.Transaction;
import android.view.WindowManager;
@@ -1534,6 +1536,22 @@
}
@Test
+ public void testValidWindowingLayer() {
+ final SurfaceControl windowingLayer = mDisplayContent.getWindowingLayer();
+ assertNotNull(windowingLayer);
+
+ final List<DisplayArea<?>> windowedMagnificationAreas =
+ mDisplayContent.mDisplayAreaPolicy.getDisplayAreas(FEATURE_WINDOWED_MAGNIFICATION);
+ if (windowedMagnificationAreas != null) {
+ assertEquals("There should be only one DisplayArea for FEATURE_WINDOWED_MAGNIFICATION",
+ 1, windowedMagnificationAreas.size());
+ assertEquals(windowedMagnificationAreas.get(0).mSurfaceControl, windowingLayer);
+ } else {
+ assertNotEquals(mDisplayContent.mSurfaceControl, windowingLayer);
+ }
+ }
+
+ @Test
public void testFindScrollCaptureTargetWindow_behindWindow() {
DisplayContent display = createNewDisplay();
Task stack = createTaskStackOnDisplay(display);
diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyLayoutTests.java b/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyLayoutTests.java
index 378a0a8..0f03f68 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyLayoutTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyLayoutTests.java
@@ -689,7 +689,7 @@
final InsetsState outState = new InsetsState();
mDisplayPolicy.getLayoutHint(mWindow.mAttrs, null /* windowToken */, outFrame,
- outDisplayCutout, outState, true /* localClient */);
+ outState, true /* localClient */);
assertThat(outFrame, is(outState.getDisplayFrame()));
assertThat(outDisplayCutout, is(new DisplayCutout.ParcelableWrapper()));
@@ -716,8 +716,8 @@
new DisplayCutout.ParcelableWrapper();
final InsetsState outState = new InsetsState();
- mDisplayPolicy.getLayoutHint(mWindow.mAttrs, mWindow.mToken, outFrame, outDisplayCutout,
- outState, true /* localClient */);
+ mDisplayPolicy.getLayoutHint(mWindow.mAttrs, mWindow.mToken, outFrame, outState,
+ true /* localClient */);
assertThat(outFrame, is(taskBounds));
assertThat(outDisplayCutout, is(new DisplayCutout.ParcelableWrapper()));
@@ -756,8 +756,8 @@
new DisplayCutout.ParcelableWrapper();
final InsetsState outState = new InsetsState();
- mDisplayPolicy.getLayoutHint(mWindow.mAttrs, mWindow.mToken, outFrame, outDisplayCutout,
- outState, true /* localClient */);
+ mDisplayPolicy.getLayoutHint(mWindow.mAttrs, mWindow.mToken, outFrame, outState,
+ true /* localClient */);
assertThat(outFrame, is(taskBounds));
assertThat(outDisplayCutout, is(new DisplayCutout.ParcelableWrapper()));
diff --git a/services/tests/wmtests/src/com/android/server/wm/LaunchParamsControllerTests.java b/services/tests/wmtests/src/com/android/server/wm/LaunchParamsControllerTests.java
index 089fd20..61140d6 100644
--- a/services/tests/wmtests/src/com/android/server/wm/LaunchParamsControllerTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/LaunchParamsControllerTests.java
@@ -495,7 +495,7 @@
// We didn't set up the overall environment for this test, so we need to mute the side
// effect of layout passes that loosen the stable frame.
- doNothing().when(display.mDisplayContent.mDisplayFrames).onBeginLayout();
+ doNothing().when(display.mDisplayContent.mDisplayFrames).onBeginLayout(any());
return display;
}
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/RootActivityContainerTests.java b/services/tests/wmtests/src/com/android/server/wm/RootActivityContainerTests.java
index 226c71a..8388f2a 100644
--- a/services/tests/wmtests/src/com/android/server/wm/RootActivityContainerTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/RootActivityContainerTests.java
@@ -236,7 +236,7 @@
doReturn(displaySleeping).when(display).isSleeping();
doReturn(keyguardShowing).when(keyguard).isKeyguardOrAodShowing(anyInt());
- doReturn(isFocusedStack).when(stack).isFocusedStackOnDisplay();
+ doReturn(isFocusedStack).when(stack).isFocusedRootTaskOnDisplay();
doReturn(isFocusedStack ? stack : null).when(display).getFocusedRootTask();
TaskDisplayArea defaultTaskDisplayArea = display.getDefaultTaskDisplayArea();
doReturn(isFocusedStack ? stack : null).when(defaultTaskDisplayArea).getFocusedRootTask();
@@ -251,7 +251,7 @@
final DisplayContent display = mRootWindowContainer.getDefaultDisplay();
final ActivityRecord activity = new ActivityBuilder(mAtm).setCreateTask(true).build();
activity.moveFocusableActivityToTop("test");
- assertTrue(activity.getStack().isFocusedStackOnDisplay());
+ assertTrue(activity.getRootTask().isFocusedRootTaskOnDisplay());
ActivityRecordTests.setRotatedScreenOrientationSilently(activity);
final Configuration rotatedConfig = new Configuration();
@@ -454,7 +454,7 @@
// Assume the task is not at the topmost position (e.g. behind always-on-top stacks) but it
// is the current top focused task.
- assertFalse(rootTask.isTopStackInDisplayArea());
+ assertFalse(rootTask.isTopRootTaskInDisplayArea());
doReturn(rootTask).when(mRootWindowContainer).getTopDisplayFocusedRootTask();
// Use the task as target to resume.
@@ -530,7 +530,7 @@
activity.setState(ActivityState.RESUMED, "test");
// Assume the task is at the topmost position
- assertTrue(rootTask.isTopStackInDisplayArea());
+ assertTrue(rootTask.isTopRootTaskInDisplayArea());
// Use the task as target to resume.
mRootWindowContainer.resumeFocusedTasksTopActivities();
@@ -551,7 +551,7 @@
taskDisplayArea.positionChildAt(POSITION_BOTTOM, rootTask, false /*includingParents*/);
// Assume the task is at the topmost position
- assertFalse(rootTask.isTopStackInDisplayArea());
+ assertFalse(rootTask.isTopRootTaskInDisplayArea());
doReturn(rootTask).when(mRootWindowContainer).getTopDisplayFocusedRootTask();
// Use the task as target to resume.
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskRecordTests.java b/services/tests/wmtests/src/com/android/server/wm/TaskRecordTests.java
index 4a5ff58..184995d 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskRecordTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskRecordTests.java
@@ -82,7 +82,6 @@
import org.junit.runner.RunWith;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
-import org.xmlpull.v1.XmlSerializer;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -138,13 +137,13 @@
final Task task = createTask(1);
spyOn(task);
doReturn(true).when(task).hasChild();
- assertFalse(task.returnsToHomeStack());
+ assertFalse(task.returnsToHomeRootTask());
task.intent = null;
- assertFalse(task.returnsToHomeStack());
+ assertFalse(task.returnsToHomeRootTask());
task.intent = new Intent();
- assertFalse(task.returnsToHomeStack());
+ assertFalse(task.returnsToHomeRootTask());
task.intent.addFlags(FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_TASK_ON_HOME);
- assertTrue(task.returnsToHomeStack());
+ assertTrue(task.returnsToHomeRootTask());
}
/** Ensures that empty bounds cause appBounds to inherit from parent. */
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 4d37eb2..81712c6 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotControllerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotControllerTest.java
@@ -31,6 +31,8 @@
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.app.WindowConfiguration;
@@ -196,8 +198,37 @@
mDisplayContent.mInputMethodWindow.setSurfaceControl(null);
// Verify no NPE happens when calling createTaskSnapshot.
try {
+ final TaskSnapshot.Builder builder = new TaskSnapshot.Builder();
mWm.mTaskSnapshotController.createTaskSnapshot(mAppWindow.mActivityRecord.getTask(),
- 1f /* scaleFraction */, PixelFormat.UNKNOWN, null /* outTaskSize */);
+ 1f /* scaleFraction */, PixelFormat.UNKNOWN, null /* outTaskSize */, builder);
+ } catch (NullPointerException e) {
+ fail("There should be no exception when calling createTaskSnapshot");
+ }
+ }
+
+ @UseTestDisplay(addWindows = {W_ACTIVITY, W_INPUT_METHOD})
+ @Test
+ public void testCreateTaskSnapshotWithIncludingIme() {
+ Task task = mAppWindow.mActivityRecord.getTask();
+ spyOn(task);
+ spyOn(mDisplayContent);
+ spyOn(mDisplayContent.mInputMethodWindow);
+ when(task.getDisplayContent().isImeAttachedToApp()).thenReturn(true);
+ // Intentionally set the IME window is in drawn state.
+ doReturn(true).when(mDisplayContent.mInputMethodWindow).isDrawn();
+ // Verify no NPE happens when calling createTaskSnapshot.
+ try {
+ final TaskSnapshot.Builder builder = new TaskSnapshot.Builder();
+ spyOn(builder);
+ mWm.mTaskSnapshotController.createTaskSnapshot(
+ mAppWindow.mActivityRecord.getTask(), 1f /* scaleFraction */,
+ PixelFormat.UNKNOWN, null /* outTaskSize */, builder);
+ // Verify the builder should includes IME surface.
+ verify(builder).setHasImeSurface(eq(true));
+ builder.setColorSpace(ColorSpace.get(ColorSpace.Named.SRGB));
+ builder.setTaskSize(new Point(100, 100));
+ final TaskSnapshot snapshot = builder.build();
+ assertTrue(snapshot.hasImeSurface());
} catch (NullPointerException e) {
fail("There should be no exception when calling createTaskSnapshot");
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java b/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
index d9a794a..edf7056 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
@@ -207,7 +207,8 @@
// is always false. Low-res snapshots are only created when loading from
// disk.
false /* isLowResolution */,
- mIsRealSnapshot, mWindowingMode, mSystemUiVisibility, mIsTranslucent);
+ mIsRealSnapshot, mWindowingMode, mSystemUiVisibility, mIsTranslucent,
+ false /* hasImeSurface */);
}
}
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotSurfaceTest.java b/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotSurfaceTest.java
index aa638690..d49956a 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotSurfaceTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotSurfaceTest.java
@@ -37,7 +37,6 @@
import static org.mockito.Matchers.eq;
import android.app.ActivityManager.TaskDescription;
-import android.window.TaskSnapshot;
import android.content.ComponentName;
import android.graphics.Canvas;
import android.graphics.Color;
@@ -52,6 +51,7 @@
import android.view.Surface;
import android.view.SurfaceControl;
import android.view.WindowManager;
+import android.window.TaskSnapshot;
import androidx.test.filters.SmallTest;
@@ -102,7 +102,7 @@
ColorSpace.get(ColorSpace.Named.SRGB), ORIENTATION_PORTRAIT,
Surface.ROTATION_0, taskSize, contentInsets, false,
true /* isRealSnapshot */, WINDOWING_MODE_FULLSCREEN,
- 0 /* systemUiVisibility */, false /* isTranslucent */);
+ 0 /* systemUiVisibility */, false /* isTranslucent */, false /* hasImeSurface */);
}
private static TaskDescription createTaskDescription(int background, int statusBar,
@@ -145,7 +145,7 @@
assertThat(surface).isNotNull();
verify(session).addToDisplay(any(), argThat(this::isTrustedOverlay), anyInt(), anyInt(),
- any(), any(), any(), any(), any(), any());
+ any(), any(), any(), any(), any());
}
@Test
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 4a6906b..1607f01 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java
@@ -19,8 +19,6 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
-import static android.view.DisplayCutout.BOUNDS_POSITION_TOP;
-import static android.view.DisplayCutout.fromBoundingRect;
import static android.view.InsetsState.ITYPE_IME;
import static android.view.InsetsState.ITYPE_STATUS_BAR;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
@@ -42,8 +40,6 @@
import androidx.test.filters.FlakyTest;
import androidx.test.filters.SmallTest;
-import com.android.server.wm.utils.WmDisplayCutout;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -258,30 +254,6 @@
}
@Test
- @FlakyTest(bugId = 130388666)
- public void testDisplayCutout() {
- // Regular fullscreen task and window
- WindowState w = createWindow();
- w.mAttrs.gravity = Gravity.LEFT | Gravity.TOP;
-
- final Rect pf = new Rect(0, 0, 1000, 2000);
- // Create a display cutout of size 50x50, aligned top-center
- final WmDisplayCutout cutout = WmDisplayCutout.computeSafeInsets(
- fromBoundingRect(500, 0, 550, 50, BOUNDS_POSITION_TOP),
- pf.width(), pf.height());
-
- final WindowFrames windowFrames = w.getWindowFrames();
- windowFrames.setFrames(pf, pf);
- windowFrames.setDisplayCutout(cutout);
- w.computeFrame();
-
- assertEquals(w.getWmDisplayCutout().getDisplayCutout().getSafeInsetTop(), 50);
- assertEquals(w.getWmDisplayCutout().getDisplayCutout().getSafeInsetBottom(), 0);
- assertEquals(w.getWmDisplayCutout().getDisplayCutout().getSafeInsetLeft(), 0);
- assertEquals(w.getWmDisplayCutout().getDisplayCutout().getSafeInsetRight(), 0);
- }
-
- @Test
public void testFreeformContentInsets() {
removeGlobalMinSizeRestriction();
// fullscreen task doesn't use bounds for computeFrame
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 b7101c8..fe7bdd8 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java
@@ -341,7 +341,7 @@
@Test
public void testSetActivityWindowingMode() {
final ActivityRecord record = makePipableActivity();
- final Task stack = record.getStack();
+ final Task stack = record.getRootTask();
final WindowContainerTransaction t = new WindowContainerTransaction();
t.setWindowingMode(stack.mRemoteToken.toWindowContainerToken(), WINDOWING_MODE_PINNED);
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 76f8207..7db2fc9 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java
@@ -67,14 +67,11 @@
import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.when;
-import android.graphics.Insets;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.os.IBinder;
import android.os.RemoteException;
import android.platform.test.annotations.Presubmit;
-import android.util.Size;
-import android.view.DisplayCutout;
import android.view.InputWindowHandle;
import android.view.InsetsState;
import android.view.SurfaceControl;
@@ -82,8 +79,6 @@
import androidx.test.filters.SmallTest;
-import com.android.server.wm.utils.WmDisplayCutout;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -527,24 +522,6 @@
}
@Test
- public void testDisplayCutoutIsCalculatedRelativeToFrame() {
- final WindowState app = createWindow(null, TYPE_APPLICATION, "app");
- WindowFrames wf = app.getWindowFrames();
- wf.mParentFrame.set(7, 10, 185, 380);
- wf.mDisplayFrame.set(wf.mParentFrame);
- final DisplayCutout cutout = new DisplayCutout(
- Insets.of(0, 15, 0, 22) /* safeInset */,
- null /* boundLeft */,
- new Rect(95, 0, 105, 15),
- null /* boundRight */,
- new Rect(95, 378, 105, 400));
- wf.setDisplayCutout(new WmDisplayCutout(cutout, new Size(200, 400)));
-
- app.computeFrame();
- assertThat(app.getWmDisplayCutout().getDisplayCutout(), is(cutout.inset(7, 10, 5, 20)));
- }
-
- @Test
public void testVisibilityChangeSwitchUser() {
final WindowState window = createWindow(null, TYPE_APPLICATION, "app");
window.mHasSurface = true;
@@ -696,8 +673,8 @@
@Test
public void testCantReceiveTouchWhenNotFocusable() {
final WindowState win0 = createWindow(null, TYPE_APPLICATION, "win0");
- win0.mActivityRecord.getStack().setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
- win0.mActivityRecord.getStack().setFocusable(false);
+ win0.mActivityRecord.getRootTask().setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
+ win0.mActivityRecord.getRootTask().setFocusable(false);
assertFalse(win0.canReceiveTouchInput());
}
@@ -739,6 +716,12 @@
InputMonitor.setInputWindowInfoIfNeeded(transaction, sc, handleWrapper);
verify(transaction, never()).setInputWindowInfo(any(), any());
+ // The rotated bounds have higher priority as the touchable region.
+ final Rect rotatedBounds = new Rect(0, 0, 123, 456);
+ doReturn(rotatedBounds).when(win.mToken).getFixedRotationTransformDisplayBounds();
+ mDisplayContent.getInputMonitor().populateInputWindowHandle(handleWrapper, win);
+ assertEquals(rotatedBounds, handle.touchableRegion.getBounds());
+
// Populate as an overlay to disable the input of window.
InputMonitor.populateOverlayInputInfo(handleWrapper, false /* isVisible */);
// The overlay attributes should be set.
@@ -790,7 +773,7 @@
WindowState sameTokenWindow = createWindow(null, TYPE_BASE_APPLICATION, mAppWindow.mToken,
"SameTokenWindow");
mDisplayContent.setImeLayeringTarget(mAppWindow);
- sameTokenWindow.mActivityRecord.getStack().setWindowingMode(
+ sameTokenWindow.mActivityRecord.getRootTask().setWindowingMode(
WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
assertTrue(sameTokenWindow.needsRelativeLayeringToIme());
sameTokenWindow.removeImmediately();
@@ -803,7 +786,7 @@
WindowState sameTokenWindow = createWindow(null, TYPE_APPLICATION_STARTING,
mAppWindow.mToken, "SameTokenWindow");
mDisplayContent.setImeLayeringTarget(mAppWindow);
- sameTokenWindow.mActivityRecord.getStack().setWindowingMode(
+ sameTokenWindow.mActivityRecord.getRootTask().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 0d31d38..ba5ca2e 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java
@@ -363,6 +363,33 @@
}
}
+ /**
+ * Gets the order of the given {@link Task} as its z-order in the hierarchy below this TDA.
+ * The Task can be a direct child of a child TaskDisplayArea. {@code -1} if not found.
+ */
+ static int getTaskIndexOf(TaskDisplayArea taskDisplayArea, Task task) {
+ int index = 0;
+ final int childCount = taskDisplayArea.getChildCount();
+ for (int i = 0; i < childCount; i++) {
+ final WindowContainer wc = taskDisplayArea.getChildAt(i);
+ if (wc.asTask() != null) {
+ if (wc.asTask() == task) {
+ return index;
+ }
+ index++;
+ } else {
+ final TaskDisplayArea tda = wc.asTaskDisplayArea();
+ final int subIndex = getTaskIndexOf(tda, task);
+ if (subIndex > -1) {
+ return index + subIndex;
+ } else {
+ index += tda.getRootTaskCount();
+ }
+ }
+ }
+ return -1;
+ }
+
/** Creates a {@link TaskDisplayArea} right above the default one. */
static TaskDisplayArea createTaskDisplayArea(DisplayContent displayContent,
WindowManagerService service, String name, int displayAreaFeature) {
@@ -1045,6 +1072,9 @@
spyOn(task);
task.mUserId = mUserId;
Task rootTask = task.getRootTask();
+ if (task != rootTask && !Mockito.mockingDetails(rootTask).isSpy()) {
+ spyOn(rootTask);
+ }
doNothing().when(rootTask).startActivityLocked(
any(), any(), anyBoolean(), anyBoolean(), any());
diff --git a/services/tests/wmtests/src/com/android/server/wm/utils/WmDisplayCutoutTest.java b/services/tests/wmtests/src/com/android/server/wm/utils/WmDisplayCutoutTest.java
index a283476..39976a5 100644
--- a/services/tests/wmtests/src/com/android/server/wm/utils/WmDisplayCutoutTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/utils/WmDisplayCutoutTest.java
@@ -23,10 +23,8 @@
import static android.view.DisplayCutout.NO_CUTOUT;
import static android.view.DisplayCutout.fromBoundingRect;
-import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertThat;
import android.graphics.Insets;
import android.graphics.Rect;
@@ -54,52 +52,6 @@
null /* boundRight */, null /* boundBottom */);
@Test
- public void calculateRelativeTo_top() {
- WmDisplayCutout cutout = WmDisplayCutout.computeSafeInsets(
- fromBoundingRect(0, 0, 100, 20, BOUNDS_POSITION_TOP), 200, 400)
- .calculateRelativeTo(new Rect(5, 5, 95, 195));
-
- assertEquals(new Rect(0, 15, 0, 0), cutout.getDisplayCutout().getSafeInsets());
- }
-
- @Test
- public void calculateRelativeTo_left() {
- WmDisplayCutout cutout = WmDisplayCutout.computeSafeInsets(
- fromBoundingRect(0, 0, 20, 100, BOUNDS_POSITION_LEFT), 400, 200)
- .calculateRelativeTo(new Rect(5, 5, 195, 95));
-
- assertEquals(new Rect(15, 0, 0, 0), cutout.getDisplayCutout().getSafeInsets());
- }
-
- @Test
- public void calculateRelativeTo_bottom() {
- WmDisplayCutout cutout = WmDisplayCutout.computeSafeInsets(
- fromBoundingRect(0, 180, 100, 200, BOUNDS_POSITION_BOTTOM), 100, 200)
- .calculateRelativeTo(new Rect(5, 5, 95, 195));
-
- assertEquals(new Rect(0, 0, 0, 15), cutout.getDisplayCutout().getSafeInsets());
- }
-
- @Test
- public void calculateRelativeTo_right() {
- WmDisplayCutout cutout = WmDisplayCutout.computeSafeInsets(
- fromBoundingRect(180, 0, 200, 100, BOUNDS_POSITION_RIGHT), 200, 100)
- .calculateRelativeTo(new Rect(5, 5, 195, 95));
-
- assertEquals(new Rect(0, 0, 15, 0), cutout.getDisplayCutout().getSafeInsets());
- }
-
- @Test
- public void calculateRelativeTo_bounds() {
- WmDisplayCutout cutout = WmDisplayCutout.computeSafeInsets(
- fromBoundingRect(0, 0, 100, 20, BOUNDS_POSITION_TOP), 200, 400)
- .calculateRelativeTo(new Rect(5, 10, 95, 180));
-
- assertThat(cutout.getDisplayCutout().getBoundingRectTop(),
- equalTo(new Rect(-5, -10, 95, 10)));
- }
-
- @Test
public void computeSafeInsets_cutoutTop() {
WmDisplayCutout cutout = WmDisplayCutout.computeSafeInsets(
fromBoundingRect(80, 0, 120, 20, BOUNDS_POSITION_TOP), 200, 400);
diff --git a/telephony/common/com/android/internal/telephony/TelephonyPermissions.java b/telephony/common/com/android/internal/telephony/TelephonyPermissions.java
index 515d329..48a5ab6 100644
--- a/telephony/common/com/android/internal/telephony/TelephonyPermissions.java
+++ b/telephony/common/com/android/internal/telephony/TelephonyPermissions.java
@@ -405,6 +405,10 @@
*/
public static boolean checkCallingOrSelfUseIccAuthWithDeviceIdentifier(Context context,
String callingPackage, String callingFeatureId, String message) {
+ // The implementation follows PermissionChecker.checkAppOpPermission, but it cannot be
+ // used directly: because it uses noteProxyOpNoThrow which requires the phone process
+ // having the permission, which doesn't make sense since phone process is the ower of
+ // data/action.
// Cannot perform appop check if the calling package is null
if (callingPackage == null) {
return false;
@@ -413,7 +417,17 @@
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;
+ switch (opMode) {
+ case AppOpsManager.MODE_ALLOWED:
+ case AppOpsManager.MODE_FOREGROUND:
+ return true;
+ case AppOpsManager.MODE_DEFAULT:
+ return context.checkCallingOrSelfPermission(
+ Manifest.permission.USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER)
+ == PERMISSION_GRANTED;
+ default:
+ return false;
+ }
}
/**
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index d645e86..56345c0 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -2050,7 +2050,13 @@
* via {@link android.telecom.PhoneAccount#CAPABILITY_VIDEO_CALLING_RELIES_ON_PRESENCE}
* and can choose to hide or show the video calling icon based on whether a contact supports
* video.
+ *
+ * @deprecated No longer used in framework code, however it may still be used by applications
+ * that have not updated their code. This config should still be set to {@code true} if
+ * {@link Ims#KEY_RCS_BULK_CAPABILITY_EXCHANGE_BOOL} is set to {@code true} and
+ * {@link Ims#KEY_ENABLE_PRESENCE_CAPABILITY_EXCHANGE_BOOL} is set to {@code true}.
*/
+ @Deprecated
public static final String KEY_USE_RCS_PRESENCE_BOOL = "use_rcs_presence_bool";
/**
@@ -3866,13 +3872,51 @@
* <p>
* If this key's value is set to false, the procedure for RCS contact capability exchange
* via SIP SUBSCRIBE/NOTIFY will also be disabled internally, and
- * {@link #KEY_USE_RCS_PRESENCE_BOOL} must also be set to false to ensure apps do not
- * improperly think that capability exchange via SIP PUBLISH is enabled.
+ * {@link Ims#KEY_ENABLE_PRESENCE_PUBLISH_BOOL} must also be set to false to ensure
+ * apps do not improperly think that capability exchange via SIP PUBLISH is enabled.
* <p> The default value for this key is {@code false}.
*/
public static final String KEY_ENABLE_PRESENCE_PUBLISH_BOOL =
KEY_PREFIX + "enable_presence_publish_bool";
+ /**
+ * Flag indicating whether or not this carrier supports the exchange of phone numbers with
+ * the carrier's RCS presence server in order to retrieve the RCS capabilities of requested
+ * contacts used in the RCS User Capability Exchange (UCE) procedure. See RCC.71, section 3
+ * for more information.
+ * <p>
+ * When presence is supported, the device uses the SIP SUBSCRIBE/NOTIFY procedure internally
+ * to retrieve the requested RCS capabilities. See
+ * {@link android.telephony.ims.RcsUceAdapter} for more information on how RCS capabilities
+ * can be retrieved from the carrier's network.
+ */
+ public static final String KEY_ENABLE_PRESENCE_CAPABILITY_EXCHANGE_BOOL =
+ KEY_PREFIX + "enable_presence_capability_exchange_bool";
+
+
+ /**
+ * Flag indicating whether or not the carrier expects the RCS UCE service to periodically
+ * refresh the RCS capabilities cache of the user's contacts as well as request the
+ * capabilities of call contacts when the SIM card is first inserted or when a new contact
+ * is added, removed, or modified. This corresponds to the RCC.07 A.19
+ * "DISABLE INITIAL ADDRESS BOOK SCAN" parameter.
+ * <p>
+ * If this flag is disabled, the capabilities cache will not be refreshed internally at all
+ * and will only be updated if the cached capabilities are stale when an application
+ * requests them.
+ */
+ public static final String KEY_RCS_BULK_CAPABILITY_EXCHANGE_BOOL =
+ KEY_PREFIX + "rcs_bulk_capability_exchange_bool";
+
+ /**
+ * Flag indicating whether or not the carrier supports capability exchange with a list of
+ * contacts. When {@code true}, the device will batch together multiple requests and
+ * construct a RLMI document in the SIP SUBSCRIBE request (see RFC 4662). If {@code false},
+ * the request will be split up into one SIP SUBSCRIBE request per contact.
+ */
+ public static final String KEY_ENABLE_PRESENCE_GROUP_SUBSCRIBE_BOOL =
+ KEY_PREFIX + "enable_presence_group_subscribe_bool";
+
private Ims() {}
private static PersistableBundle getDefaults() {
@@ -3880,6 +3924,9 @@
defaults.putInt(KEY_WIFI_OFF_DEFERRING_TIME_MILLIS_INT, 4000);
defaults.putBoolean(KEY_IMS_SINGLE_REGISTRATION_REQUIRED_BOOL, false);
defaults.putBoolean(KEY_ENABLE_PRESENCE_PUBLISH_BOOL, false);
+ defaults.putBoolean(KEY_ENABLE_PRESENCE_CAPABILITY_EXCHANGE_BOOL, false);
+ defaults.putBoolean(KEY_RCS_BULK_CAPABILITY_EXCHANGE_BOOL, false);
+ defaults.putBoolean(KEY_ENABLE_PRESENCE_GROUP_SUBSCRIBE_BOOL, true);
return defaults;
}
}
diff --git a/telephony/java/android/telephony/DataFailCause.java b/telephony/java/android/telephony/DataFailCause.java
index d502da9..99a77ae5 100644
--- a/telephony/java/android/telephony/DataFailCause.java
+++ b/telephony/java/android/telephony/DataFailCause.java
@@ -915,6 +915,8 @@
public static final int IPV6_PREFIX_UNAVAILABLE = 0x8CA;
/** System preference change back to SRAT during handoff */
public static final int HANDOFF_PREFERENCE_CHANGED = 0x8CB;
+ /** Data call fail due to the slice not being allowed for the data call. */
+ public static final int SLICE_REJECTED = 0x8CC;
//IKE error notifications message as specified in 3GPP TS 24.302 (Section 8.1.2.2).
@@ -985,7 +987,7 @@
* the authentication failed.
*/
public static final int IWLAN_IKEV2_AUTH_FAILURE = 0x4001;
- /** IKE message timeout, tunnel setup failed due to no response from EPDG */
+ /** 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;
@@ -1419,6 +1421,7 @@
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(SLICE_REJECTED, "SLICE_REJECTED");
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,
diff --git a/telephony/java/android/telephony/SmsManager.java b/telephony/java/android/telephony/SmsManager.java
index e145fcf..e06dcdb 100644
--- a/telephony/java/android/telephony/SmsManager.java
+++ b/telephony/java/android/telephony/SmsManager.java
@@ -638,7 +638,7 @@
persistMessage, messageId);
} catch (RemoteException e) {
Log.e(TAG, "sendTextMessageInternal: Couldn't send SMS, exception - "
- + e.getMessage() + " id: " + messageId);
+ + e.getMessage() + " " + formatCrossStackMessageId(messageId));
notifySmsError(sentIntent, RESULT_REMOTE_EXCEPTION);
}
}
@@ -658,7 +658,7 @@
persistMessage, messageId);
} catch (RemoteException e) {
Log.e(TAG, "sendTextMessageInternal (no persist): Couldn't send SMS, exception - "
- + e.getMessage() + " id: " + messageId);
+ + e.getMessage() + " " + formatCrossStackMessageId(messageId));
notifySmsError(sentIntent, RESULT_REMOTE_EXCEPTION);
}
}
@@ -1072,8 +1072,7 @@
deliveryIntents, persistMessage, messageId);
} catch (RemoteException e) {
Log.e(TAG, "sendMultipartTextMessageInternal: Couldn't send SMS - "
- + e.getMessage() + " id: "
- + messageId);
+ + e.getMessage() + " " + formatCrossStackMessageId(messageId));
notifySmsError(sentIntents, RESULT_REMOTE_EXCEPTION);
}
}
@@ -1094,7 +1093,7 @@
}
} catch (RemoteException e) {
Log.e(TAG, "sendMultipartTextMessageInternal: Couldn't send SMS - "
- + e.getMessage() + " id: " + messageId);
+ + e.getMessage() + " " + formatCrossStackMessageId(messageId));
notifySmsError(sentIntents, RESULT_REMOTE_EXCEPTION);
}
}
@@ -3150,4 +3149,8 @@
ex.rethrowFromSystemServer();
}
}
+
+ private static String formatCrossStackMessageId(long id) {
+ return "{x-message-id:" + id + "}";
+ }
}
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 31a1249..60389e1 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -8671,6 +8671,77 @@
return Collections.EMPTY_LIST;
}
+ /**
+ * Call composer status OFF from user setting.
+ */
+ public static final int CALL_COMPOSER_STATUS_OFF = 0;
+
+ /**
+ * Call composer status ON from user setting.
+ */
+ public static final int CALL_COMPOSER_STATUS_ON = 1;
+
+ /** @hide */
+ @IntDef(prefix = {"CALL_COMPOSER_STATUS_"},
+ value = {
+ CALL_COMPOSER_STATUS_ON,
+ CALL_COMPOSER_STATUS_OFF,
+ })
+ public @interface CallComposerStatus {}
+
+ /**
+ * Set the user-set status for enriched calling with call composer.
+ *
+ * @param status user-set status for enriched calling with call composer;
+ * it must be a value of either {@link #CALL_COMPOSER_STATUS_ON}
+ * or {@link #CALL_COMPOSER_STATUS_OFF}.
+ *
+ * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the
+ * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultSubscriptionId()}
+ *
+ * @throws IllegalArgumentException if requested state is invalid.
+ * @throws SecurityException if the caller does not have the permission.
+ */
+ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
+ public void setCallComposerStatus(@CallComposerStatus int status) {
+ if (status != CALL_COMPOSER_STATUS_ON && status != CALL_COMPOSER_STATUS_OFF) {
+ throw new IllegalArgumentException("requested status is invalid");
+ }
+ try {
+ ITelephony telephony = getITelephony();
+ if (telephony != null) {
+ telephony.setCallComposerStatus(getSubId(), status);
+ }
+ } catch (RemoteException ex) {
+ Log.e(TAG, "Error calling ITelephony#setCallComposerStatus", ex);
+ ex.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Get the user-set status for enriched calling with call composer.
+ *
+ * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the
+ * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultSubscriptionId()}
+ *
+ * @throws SecurityException if the caller does not have the permission.
+ *
+ * @return the user-set status for enriched calling with call composer either
+ * {@link #CALL_COMPOSER_STATUS_ON} or {@link #CALL_COMPOSER_STATUS_OFF}.
+ */
+ @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
+ public @CallComposerStatus int getCallComposerStatus() {
+ try {
+ ITelephony telephony = getITelephony();
+ if (telephony != null) {
+ return telephony.getCallComposerStatus(getSubId());
+ }
+ } catch (RemoteException ex) {
+ Log.e(TAG, "Error calling ITelephony#getCallComposerStatus", ex);
+ ex.rethrowFromSystemServer();
+ }
+ return CALL_COMPOSER_STATUS_OFF;
+ }
/** @hide */
@SystemApi
@@ -9267,6 +9338,35 @@
}
/**
+ * Get the mobile provisioning url that is used to launch a browser to allow users to manage
+ * their mobile plan.
+ *
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE}.
+ *
+ * TODO: The legacy design only supports single sim design. Ideally, this should support
+ * multi-sim design in current world.
+ *
+ * {@hide}
+ */
+ @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
+ public @Nullable String getMobileProvisioningUrl() {
+ try {
+ final ITelephony service = getITelephony();
+ if (service != null) {
+ return service.getMobileProvisioningUrl();
+ } else {
+ throw new IllegalStateException("telephony service is null.");
+ }
+ } catch (RemoteException ex) {
+ if (!isSystemProcess()) {
+ ex.rethrowAsRuntimeException();
+ }
+ }
+ return null;
+ }
+
+ /**
* Turns mobile data on or off.
* If this object has been created with {@link #createForSubscriptionId}, applies to the given
* subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()}
@@ -13926,7 +14026,8 @@
/**
* Get carrier bandwidth. In case of Dual connected network this will report
- * bandwidth per primary and secondary network.
+ * bandwidth per primary and secondary network. It is possible that
+ * some modems may not fill secondary carrier bandwidth.
* @return CarrierBandwidth with bandwidth of both primary and secondary carrier.
* @throws IllegalStateException if the Telephony process is not currently available.
* @hide
diff --git a/telephony/java/android/telephony/data/DataCallResponse.java b/telephony/java/android/telephony/data/DataCallResponse.java
index 556f2d5..e217e9a 100644
--- a/telephony/java/android/telephony/data/DataCallResponse.java
+++ b/telephony/java/android/telephony/data/DataCallResponse.java
@@ -137,6 +137,7 @@
private final int mPduSessionId;
private final Qos mDefaultQos;
private final List<QosSession> mQosSessions;
+ private final SliceInfo mSliceInfo;
/**
* @param cause Data call fail cause. {@link DataFailCause#NONE} indicates no error.
@@ -187,6 +188,7 @@
mPduSessionId = PDU_SESSION_ID_NOT_SET;
mDefaultQos = null;
mQosSessions = new ArrayList<>();
+ mSliceInfo = null;
}
private DataCallResponse(@DataFailureCause int cause, long suggestedRetryTime, int id,
@@ -195,7 +197,8 @@
@Nullable List<InetAddress> dnsAddresses, @Nullable List<InetAddress> gatewayAddresses,
@Nullable List<InetAddress> pcscfAddresses, int mtu, int mtuV4, int mtuV6,
@HandoverFailureMode int handoverFailureMode, int pduSessionId,
- @Nullable Qos defaultQos, @Nullable List<QosSession> qosSessions) {
+ @Nullable Qos defaultQos, @Nullable List<QosSession> qosSessions,
+ @Nullable SliceInfo sliceInfo) {
mCause = cause;
mSuggestedRetryTime = suggestedRetryTime;
mId = id;
@@ -217,6 +220,7 @@
mPduSessionId = pduSessionId;
mDefaultQos = defaultQos;
mQosSessions = qosSessions;
+ mSliceInfo = sliceInfo;
}
/** @hide */
@@ -244,6 +248,7 @@
mDefaultQos = source.readParcelable(Qos.class.getClassLoader());
mQosSessions = new ArrayList<>();
source.readList(mQosSessions, QosSession.class.getClassLoader());
+ mSliceInfo = source.readParcelable(SliceInfo.class.getClassLoader());
}
/**
@@ -370,7 +375,7 @@
}
/**
- * @return default QOS of the data call received from the network
+ * @return default QOS of the data connection received from the network
*
* @hide
*/
@@ -381,16 +386,24 @@
}
/**
- * @return All the dedicated bearer QOS sessions of the data call received from the network
+ * @return All the dedicated bearer QOS sessions of the data connection received from the
+ * network.
*
* @hide
*/
-
@NonNull
public List<QosSession> getQosSessions() {
return mQosSessions;
}
+ /**
+ * @return The slice info related to this data connection.
+ */
+ @Nullable
+ public SliceInfo getSliceInfo() {
+ return mSliceInfo;
+ }
+
@NonNull
@Override
public String toString() {
@@ -413,6 +426,7 @@
.append(" pduSessionId=").append(getPduSessionId())
.append(" defaultQos=").append(mDefaultQos)
.append(" qosSessions=").append(mQosSessions)
+ .append(" sliceInfo=").append(mSliceInfo)
.append("}");
return sb.toString();
}
@@ -456,7 +470,8 @@
&& mHandoverFailureMode == other.mHandoverFailureMode
&& mPduSessionId == other.mPduSessionId
&& isQosSame
- && isQosSessionsSame;
+ && isQosSessionsSame
+ && Objects.equals(mSliceInfo, other.mSliceInfo);
}
@Override
@@ -464,7 +479,7 @@
return Objects.hash(mCause, mSuggestedRetryTime, mId, mLinkStatus, mProtocolType,
mInterfaceName, mAddresses, mDnsAddresses, mGatewayAddresses, mPcscfAddresses,
mMtu, mMtuV4, mMtuV6, mHandoverFailureMode, mPduSessionId, mDefaultQos,
- mQosSessions);
+ mQosSessions, mSliceInfo);
}
@Override
@@ -499,6 +514,7 @@
dest.writeParcelable(null, flags);
}
dest.writeList(mQosSessions);
+ dest.writeParcelable(mSliceInfo, flags);
}
public static final @android.annotation.NonNull Parcelable.Creator<DataCallResponse> CREATOR =
@@ -582,6 +598,8 @@
private List<QosSession> mQosSessions = new ArrayList<>();
+ private SliceInfo mSliceInfo;
+
/**
* Default constructor for Builder.
*/
@@ -805,6 +823,21 @@
}
/**
+ * The Slice used for this data connection.
+ * <p/>
+ * If a handover occurs from EPDG to 5G,
+ * this is the {@link SliceInfo} used in {@link DataService#setupDataCall}.
+ *
+ * @param sliceInfo the slice info for the data call
+ *
+ * @return The same instance of the builder.
+ */
+ public @NonNull Builder setSliceInfo(@Nullable SliceInfo sliceInfo) {
+ mSliceInfo = sliceInfo;
+ return this;
+ }
+
+ /**
* Build the DataCallResponse.
*
* @return the DataCallResponse object.
@@ -813,7 +846,7 @@
return new DataCallResponse(mCause, mSuggestedRetryTime, mId, mLinkStatus,
mProtocolType, mInterfaceName, mAddresses, mDnsAddresses, mGatewayAddresses,
mPcscfAddresses, mMtu, mMtuV4, mMtuV6, mHandoverFailureMode, mPduSessionId,
- mDefaultQos, mQosSessions);
+ mDefaultQos, mQosSessions, mSliceInfo);
}
}
}
diff --git a/telephony/java/android/telephony/data/DataService.java b/telephony/java/android/telephony/data/DataService.java
index 2ec9651..03c2ef9 100644
--- a/telephony/java/android/telephony/data/DataService.java
+++ b/telephony/java/android/telephony/data/DataService.java
@@ -194,13 +194,19 @@
* The standard range of values are 1-15 while 0 means no pdu session id
* was attached to this call. Reference: 3GPP TS 24.007 section
* 11.2.3.1b.
+ * @param sliceInfo used within the data connection when a handover occurs from EPDG to 5G.
+ * The value is null unless the access network is
+ * {@link android.telephony.AccessNetworkConstants.AccessNetworkType#NGRAN} and a
+ * handover is occurring from EPDG to 5G. If the slice passed is rejected, then
+ * {@link DataCallResponse#getCause()} is
+ * {@link android.telephony.DataFailCause#SLICE_REJECTED}.
* @param callback The result callback for this request.
*/
public void setupDataCall(int accessNetworkType, @NonNull DataProfile dataProfile,
boolean isRoaming, boolean allowRoaming,
@SetupDataReason int reason,
@Nullable LinkProperties linkProperties,
- @IntRange(from = 0, to = 15) int pduSessionId,
+ @IntRange(from = 0, to = 15) int pduSessionId, @Nullable SliceInfo sliceInfo,
@NonNull DataServiceCallback callback) {
/* Call the old version since the new version isn't supported */
setupDataCall(accessNetworkType, dataProfile, isRoaming, allowRoaming, reason,
@@ -392,10 +398,11 @@
public final int reason;
public final LinkProperties linkProperties;
public final int pduSessionId;
+ public final SliceInfo sliceInfo;
public final IDataServiceCallback callback;
SetupDataCallRequest(int accessNetworkType, DataProfile dataProfile, boolean isRoaming,
boolean allowRoaming, int reason, LinkProperties linkProperties,
- int pduSessionId, IDataServiceCallback callback) {
+ int pduSessionId, SliceInfo sliceInfo, IDataServiceCallback callback) {
this.accessNetworkType = accessNetworkType;
this.dataProfile = dataProfile;
this.isRoaming = isRoaming;
@@ -403,6 +410,7 @@
this.linkProperties = linkProperties;
this.reason = reason;
this.pduSessionId = pduSessionId;
+ this.sliceInfo = sliceInfo;
this.callback = callback;
}
}
@@ -513,6 +521,7 @@
setupDataCallRequest.dataProfile, setupDataCallRequest.isRoaming,
setupDataCallRequest.allowRoaming, setupDataCallRequest.reason,
setupDataCallRequest.linkProperties, setupDataCallRequest.pduSessionId,
+ setupDataCallRequest.sliceInfo,
(setupDataCallRequest.callback != null)
? new DataServiceCallback(setupDataCallRequest.callback)
: null);
@@ -676,10 +685,12 @@
@Override
public void setupDataCall(int slotIndex, int accessNetworkType, DataProfile dataProfile,
boolean isRoaming, boolean allowRoaming, int reason,
- LinkProperties linkProperties, int pduSessionId, IDataServiceCallback callback) {
+ LinkProperties linkProperties, int pduSessionId, SliceInfo sliceInfo,
+ IDataServiceCallback callback) {
mHandler.obtainMessage(DATA_SERVICE_REQUEST_SETUP_DATA_CALL, slotIndex, 0,
new SetupDataCallRequest(accessNetworkType, dataProfile, isRoaming,
- allowRoaming, reason, linkProperties, pduSessionId, callback))
+ allowRoaming, reason, linkProperties, pduSessionId, sliceInfo,
+ callback))
.sendToTarget();
}
diff --git a/telephony/java/android/telephony/data/IDataService.aidl b/telephony/java/android/telephony/data/IDataService.aidl
index 3f1f033..e0b9a1a 100644
--- a/telephony/java/android/telephony/data/IDataService.aidl
+++ b/telephony/java/android/telephony/data/IDataService.aidl
@@ -19,6 +19,7 @@
import android.net.LinkProperties;
import android.telephony.data.DataProfile;
import android.telephony.data.IDataServiceCallback;
+import android.telephony.data.SliceInfo;
/**
* {@hide}
@@ -29,7 +30,7 @@
void removeDataServiceProvider(int slotId);
void setupDataCall(int slotId, int accessNetwork, in DataProfile dataProfile, boolean isRoaming,
boolean allowRoaming, int reason, in LinkProperties linkProperties,
- int pduSessionId, IDataServiceCallback callback);
+ int pduSessionId, in SliceInfo sliceInfo, IDataServiceCallback callback);
void deactivateDataCall(int slotId, int cid, int reason, IDataServiceCallback callback);
void setInitialAttachApn(int slotId, in DataProfile dataProfile, boolean isRoaming,
IDataServiceCallback callback);
diff --git a/core/java/android/app/role/RolePrivileges.aidl b/telephony/java/android/telephony/data/SliceInfo.aidl
similarity index 82%
copy from core/java/android/app/role/RolePrivileges.aidl
copy to telephony/java/android/telephony/data/SliceInfo.aidl
index 1561ad4..286ea5e 100644
--- a/core/java/android/app/role/RolePrivileges.aidl
+++ b/telephony/java/android/telephony/data/SliceInfo.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2020 The Android Open Source Project
+ * 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.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
+/** @hide */
+package android.telephony.data;
-package android.app.role;
-
-parcelable RolePrivileges;
+parcelable SliceInfo;
diff --git a/telephony/java/android/telephony/data/SliceInfo.java b/telephony/java/android/telephony/data/SliceInfo.java
new file mode 100644
index 0000000..51857a7
--- /dev/null
+++ b/telephony/java/android/telephony/data/SliceInfo.java
@@ -0,0 +1,342 @@
+/*
+ * 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.data;
+
+import android.annotation.IntDef;
+import android.annotation.IntRange;
+import android.annotation.NonNull;
+import android.annotation.SuppressLint;
+import android.annotation.SystemApi;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.util.Objects;
+
+/**
+ * Represents a S-NSSAI as defined in 3GPP TS 24.501.
+ *
+ * @hide
+ */
+@SystemApi
+public final class SliceInfo implements Parcelable {
+ /**
+ * When set on a Slice Differentiator, this value indicates that there is no corresponding
+ * Slice.
+ */
+ public static final int SLICE_DIFFERENTIATOR_NO_SLICE = -1;
+
+ /**
+ * Indicates that the service type is not present.
+ */
+ public static final int SLICE_SERVICE_TYPE_NONE = 0;
+
+ /**
+ * Slice suitable for the handling of 5G enhanced Mobile Broadband.
+ */
+ public static final int SLICE_SERVICE_TYPE_EMBB = 1;
+
+ /**
+ * Slice suitable for the handling of ultra-reliable low latency communications.
+ */
+ public static final int SLICE_SERVICE_TYPE_URLLC = 2;
+
+ /**
+ * Slice suitable for the handling of massive IoT.
+ */
+ public static final int SLICE_SERVICE_TYPE_MIOT = 3;
+
+ /**
+ * The min acceptable value for a Slice Differentiator
+ */
+ @SuppressLint("MinMaxConstant")
+ public static final int MIN_SLICE_DIFFERENTIATOR = -1;
+
+ /**
+ * The max acceptable value for a Slice Differentiator
+ */
+ @SuppressLint("MinMaxConstant")
+ public static final int MAX_SLICE_DIFFERENTIATOR = 0xFFFFFE;
+
+ /** @hide */
+ @IntDef(prefix = { "SLICE_SERVICE_TYPE_" }, value = {
+ SLICE_SERVICE_TYPE_NONE,
+ SLICE_SERVICE_TYPE_EMBB,
+ SLICE_SERVICE_TYPE_URLLC,
+ SLICE_SERVICE_TYPE_MIOT,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface SliceServiceType {}
+
+
+ @SliceServiceType
+ private final int mSliceServiceType;
+ @IntRange(from = MIN_SLICE_DIFFERENTIATOR, to = MAX_SLICE_DIFFERENTIATOR)
+ private final int mSliceDifferentiator;
+ @SliceServiceType
+ private final int mMappedHplmnSliceServiceType;
+ @IntRange(from = MIN_SLICE_DIFFERENTIATOR, to = MAX_SLICE_DIFFERENTIATOR)
+ private final int mMappedHplmnSliceDifferentiator;
+
+ private SliceInfo(@SliceServiceType int sliceServiceType,
+ int sliceDifferentiator, int mappedHplmnSliceServiceType,
+ int mappedHplmnSliceDifferentiator) {
+ mSliceServiceType = sliceServiceType;
+ mSliceDifferentiator = sliceDifferentiator;
+ mMappedHplmnSliceDifferentiator = mappedHplmnSliceDifferentiator;
+ mMappedHplmnSliceServiceType = mappedHplmnSliceServiceType;
+ }
+
+ /**
+ * The type of service provided by the slice.
+ * <p/>
+ * see: 3GPP TS 24.501 Section 9.11.2.8.
+ */
+ @SliceServiceType
+ public int getSliceServiceType() {
+ return mSliceServiceType;
+ }
+
+ /**
+ * Identifies the slice from others with the same Slice Service Type.
+ * <p/>
+ * Returns {@link #SLICE_DIFFERENTIATOR_NO_SLICE} if {@link #getSliceServiceType} returns
+ * {@link #SLICE_SERVICE_TYPE_NONE}.
+ * <p/>
+ * see: 3GPP TS 24.501 Section 9.11.2.8.
+ */
+ @IntRange(from = MIN_SLICE_DIFFERENTIATOR, to = MAX_SLICE_DIFFERENTIATOR)
+ public int getSliceDifferentiator() {
+ return mSliceDifferentiator;
+ }
+
+ /**
+ * Corresponds to a Slice Info (S-NSSAI) of the HPLMN.
+ * <p/>
+ * see: 3GPP TS 24.501 Section 9.11.2.8.
+ */
+ @SliceServiceType
+ public int getMappedHplmnSliceServiceType() {
+ return mMappedHplmnSliceServiceType;
+ }
+
+ /**
+ * This Slice Differentiator corresponds to a {@link SliceInfo} (S-NSSAI) of the HPLMN;
+ * {@link #getSliceDifferentiator()} is mapped to this value.
+ * <p/>
+ * Returns {@link #SLICE_DIFFERENTIATOR_NO_SLICE} if either of the following are true:
+ * <ul>
+ * <li>{@link #getSliceDifferentiator()} returns {@link #SLICE_DIFFERENTIATOR_NO_SLICE}</li>
+ * <li>{@link #getMappedHplmnSliceServiceType()} returns {@link #SLICE_SERVICE_TYPE_NONE}</li>
+ * </ul>
+ * <p/>
+ * see: 3GPP TS 24.501 Section 9.11.2.8.
+ */
+ @IntRange(from = MIN_SLICE_DIFFERENTIATOR, to = MAX_SLICE_DIFFERENTIATOR)
+ public int getMappedHplmnSliceDifferentiator() {
+ return mMappedHplmnSliceDifferentiator;
+ }
+
+ private SliceInfo(@NonNull Parcel in) {
+ mSliceServiceType = in.readInt();
+ mSliceDifferentiator = in.readInt();
+ mMappedHplmnSliceServiceType = in.readInt();
+ mMappedHplmnSliceDifferentiator = in.readInt();
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(@NonNull Parcel dest, int flags) {
+ dest.writeInt(mSliceServiceType);
+ dest.writeInt(mSliceDifferentiator);
+ dest.writeInt(mMappedHplmnSliceServiceType);
+ dest.writeInt(mMappedHplmnSliceDifferentiator);
+ }
+
+ public static final @android.annotation.NonNull Parcelable.Creator<SliceInfo> CREATOR =
+ new Parcelable.Creator<SliceInfo>() {
+ @Override
+ @NonNull
+ public SliceInfo createFromParcel(@NonNull Parcel source) {
+ return new SliceInfo(source);
+ }
+
+ @Override
+ @NonNull
+ public SliceInfo[] newArray(int size) {
+ return new SliceInfo[size];
+ }
+ };
+
+ @Override
+ public String toString() {
+ return "SliceInfo{"
+ + "mSliceServiceType=" + sliceServiceTypeToString(mSliceServiceType)
+ + ", mSliceDifferentiator=" + mSliceDifferentiator
+ + ", mMappedHplmnSliceServiceType="
+ + sliceServiceTypeToString(mMappedHplmnSliceServiceType)
+ + ", mMappedHplmnSliceDifferentiator=" + mMappedHplmnSliceDifferentiator
+ + '}';
+ }
+
+ private static String sliceServiceTypeToString(@SliceServiceType int sliceServiceType) {
+ switch(sliceServiceType) {
+ case SLICE_SERVICE_TYPE_NONE:
+ return "NONE";
+ case SLICE_SERVICE_TYPE_EMBB:
+ return "EMBB";
+ case SLICE_SERVICE_TYPE_URLLC:
+ return "URLLC";
+ case SLICE_SERVICE_TYPE_MIOT:
+ return "MIOT";
+ default:
+ return Integer.toString(sliceServiceType);
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ SliceInfo sliceInfo = (SliceInfo) o;
+ return mSliceServiceType == sliceInfo.mSliceServiceType
+ && mSliceDifferentiator == sliceInfo.mSliceDifferentiator
+ && mMappedHplmnSliceServiceType == sliceInfo.mMappedHplmnSliceServiceType
+ && mMappedHplmnSliceDifferentiator == sliceInfo.mMappedHplmnSliceDifferentiator;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mSliceServiceType, mSliceDifferentiator, mMappedHplmnSliceServiceType,
+ mMappedHplmnSliceDifferentiator);
+ }
+
+ /**
+ * Provides a convenient way to set the fields of a {@link SliceInfo} when creating a
+ * new instance.
+ *
+ * <p>The example below shows how you might create a new {@code SliceInfo}:
+ *
+ * <pre><code>
+ *
+ * SliceInfo response = new SliceInfo.Builder()
+ * .setSliceServiceType(SLICE_SERVICE_TYPE_URLLC)
+ * .build();
+ * </code></pre>
+ */
+ public static final class Builder {
+ @SliceServiceType
+ private int mSliceServiceType = SLICE_SERVICE_TYPE_NONE;
+ @IntRange(from = MIN_SLICE_DIFFERENTIATOR, to = MAX_SLICE_DIFFERENTIATOR)
+ private int mSliceDifferentiator = SLICE_DIFFERENTIATOR_NO_SLICE;
+ @SliceServiceType
+ private int mMappedHplmnSliceServiceType = SLICE_SERVICE_TYPE_NONE;
+ @IntRange(from = MIN_SLICE_DIFFERENTIATOR, to = MAX_SLICE_DIFFERENTIATOR)
+ private int mMappedHplmnSliceDifferentiator = SLICE_DIFFERENTIATOR_NO_SLICE;
+
+ /**
+ * Default constructor for Builder.
+ */
+ public Builder() {
+ }
+
+ /**
+ * Set the Slice Service Type.
+ *
+ * @return The same instance of the builder.
+ */
+ @NonNull
+ public Builder setSliceServiceType(@SliceServiceType int mSliceServiceType) {
+ this.mSliceServiceType = mSliceServiceType;
+ return this;
+ }
+
+ /**
+ * Set the Slice Differentiator.
+ * <p/>
+ * A value of {@link #SLICE_DIFFERENTIATOR_NO_SLICE} indicates that there is no
+ * corresponding Slice.
+ *
+ * @throws IllegalArgumentException if the parameter is not between
+ * {@link #MIN_SLICE_DIFFERENTIATOR} and {@link #MAX_SLICE_DIFFERENTIATOR}.
+ *
+ * @return The same instance of the builder.
+ */
+ @NonNull
+ public Builder setSliceDifferentiator(
+ @IntRange(from = MIN_SLICE_DIFFERENTIATOR, to = MAX_SLICE_DIFFERENTIATOR)
+ int sliceDifferentiator) {
+ if (sliceDifferentiator < MIN_SLICE_DIFFERENTIATOR
+ || sliceDifferentiator > MAX_SLICE_DIFFERENTIATOR) {
+ throw new IllegalArgumentException("The slice diffentiator value is out of range");
+ }
+ this.mSliceDifferentiator = sliceDifferentiator;
+ return this;
+ }
+
+ /**
+ * Set the HPLMN Slice Service Type.
+ *
+ * @return The same instance of the builder.
+ */
+ @NonNull
+ public Builder setMappedHplmnSliceServiceType(
+ @SliceServiceType int mappedHplmnSliceServiceType) {
+ this.mMappedHplmnSliceServiceType = mappedHplmnSliceServiceType;
+ return this;
+ }
+
+ /**
+ * Set the HPLMN Slice Differentiator.
+ * <p/>
+ * A value of {@link #SLICE_DIFFERENTIATOR_NO_SLICE} indicates that there is no
+ * corresponding Slice of the HPLMN.
+ *
+ * @throws IllegalArgumentException if the parameter is not between
+ * {@link #MIN_SLICE_DIFFERENTIATOR} and {@link #MAX_SLICE_DIFFERENTIATOR}.
+ *
+ * @return The same instance of the builder.
+ */
+ @NonNull
+ public Builder setMappedHplmnSliceDifferentiator(
+ @IntRange(from = MIN_SLICE_DIFFERENTIATOR, to = MAX_SLICE_DIFFERENTIATOR)
+ int mappedHplmnSliceDifferentiator) {
+ if (mappedHplmnSliceDifferentiator < MIN_SLICE_DIFFERENTIATOR
+ || mappedHplmnSliceDifferentiator > MAX_SLICE_DIFFERENTIATOR) {
+ throw new IllegalArgumentException("The slice diffentiator value is out of range");
+ }
+ this.mMappedHplmnSliceDifferentiator = mappedHplmnSliceDifferentiator;
+ return this;
+ }
+
+ /**
+ * Build the {@link SliceInfo}.
+ *
+ * @return the {@link SliceInfo} object.
+ */
+ @NonNull
+ public SliceInfo build() {
+ return new SliceInfo(this.mSliceServiceType, this.mSliceDifferentiator,
+ this.mMappedHplmnSliceServiceType, this.mMappedHplmnSliceDifferentiator);
+ }
+ }
+}
diff --git a/telephony/java/android/telephony/ims/ImsCallProfile.java b/telephony/java/android/telephony/ims/ImsCallProfile.java
index aaa68d6..b15f4ed 100644
--- a/telephony/java/android/telephony/ims/ImsCallProfile.java
+++ b/telephony/java/android/telephony/ims/ImsCallProfile.java
@@ -133,10 +133,26 @@
* the video during voice call.
* conference_avail : Indicates if the session can be extended to the conference.
*/
+
/**
+ * Indicates if the session is for a conference call or not. If not defined, should be
+ * considered {@code false}.
+ * Boolean extra properties - {@code true} / {@code false}.
* @hide
*/
- public static final String EXTRA_CONFERENCE = "conference";
+ @SystemApi
+ public static final String EXTRA_CONFERENCE = "android.telephony.ims.extra.CONFERENCE";
+
+ /**
+ * The previous string of EXTRA_CONFERENCE. Use EXTRA_CONFERENCE whenever possible.
+ * For external app or vendor code backward compatibility, we should always set value for both
+ * EXTRA_CONFERENCE_DEPRECATED and EXTRA_CONFERENCE.
+ *
+ * @deprecated Remove when not needed anymore.
+ *
+ * @hide
+ */
+ public static final String EXTRA_CONFERENCE_DEPRECATED = "conference";
/**
* Boolean extra property set on an {@link ImsCallProfile} to indicate that this call is an
@@ -153,7 +169,25 @@
* @hide
*/
public static final String EXTRA_CALL_MODE_CHANGEABLE = "call_mode_changeable";
+
/**
+ * Indicates if the session can be extended to a conference call. If not defined, should be
+ * considered {@code false}.
+ * Boolean extra properties - {@code true} / {@code false}.
+ * @hide
+ */
+ @SystemApi
+ public static final String EXTRA_EXTENDING_TO_CONFERENCE_SUPPORTED =
+ "android.telephony.ims.extra.EXTENDING_TO_CONFERENCE_SUPPORTED";
+
+ /**
+ * The previous string of EXTRA_EXTENDING_TO_CONFERENCE_SUPPORTED.
+ * Use EXTRA_EXTENDING_TO_CONFERENCE_SUPPORTED whenever possible.
+ * For backward compatibility, we should always set value for both
+ * EXTRA_EXTENDING_TO_CONFERENCE_SUPPORTED and EXTRA_CONFERENCE_AVAIL.
+ *
+ * @deprecated Remove when not needed anymore.
+ *
* @hide
*/
public static final String EXTRA_CONFERENCE_AVAIL = "conference_avail";
diff --git a/telephony/java/android/telephony/ims/ImsCallSession.java b/telephony/java/android/telephony/ims/ImsCallSession.java
index a3efb79..0aff997 100755
--- a/telephony/java/android/telephony/ims/ImsCallSession.java
+++ b/telephony/java/android/telephony/ims/ImsCallSession.java
@@ -101,10 +101,29 @@
*/
public static class Listener {
/**
- * Called when a request is sent out to initiate a new session
- * and 1xx response is received from the network.
+ * Called when the session is initiating.
*
- * @param session the session object that carries out the IMS session
+ * see: {@link ImsCallSessionListener#callSessionInitiating(ImsCallProfile)}
+ */
+ public void callSessionInitiating(ImsCallSession session,
+ ImsCallProfile profile) {
+ // no-op
+ }
+
+ /**
+ * Called when the session failed before initiating was called.
+ *
+ * see: {@link ImsCallSessionListener#callSessionInitiatingFailed(ImsReasonInfo)}
+ */
+ public void callSessionInitiatingFailed(ImsCallSession session,
+ ImsReasonInfo reasonInfo) {
+ // no-op
+ }
+
+ /**
+ * Called when the session is progressing.
+ *
+ * see: {@link ImsCallSessionListener#callSessionProgressing(ImsStreamMediaProfile)}
*/
public void callSessionProgressing(ImsCallSession session,
ImsStreamMediaProfile profile) {
@@ -1179,6 +1198,13 @@
* Notifies the result of the basic session operation (setup / terminate).
*/
@Override
+ public void callSessionInitiating(ImsCallProfile profile) {
+ if (mListener != null) {
+ mListener.callSessionInitiating(ImsCallSession.this, profile);
+ }
+ }
+
+ @Override
public void callSessionProgressing(ImsStreamMediaProfile profile) {
if (mListener != null) {
mListener.callSessionProgressing(ImsCallSession.this, profile);
@@ -1193,6 +1219,13 @@
}
@Override
+ public void callSessionInitiatingFailed(ImsReasonInfo reasonInfo) {
+ if (mListener != null) {
+ mListener.callSessionStartFailed(ImsCallSession.this, reasonInfo);
+ }
+ }
+
+ @Override
public void callSessionInitiatedFailed(ImsReasonInfo reasonInfo) {
if (mListener != null) {
mListener.callSessionStartFailed(ImsCallSession.this, reasonInfo);
diff --git a/telephony/java/android/telephony/ims/ImsCallSessionListener.java b/telephony/java/android/telephony/ims/ImsCallSessionListener.java
index 86bb5d9..db99acf 100644
--- a/telephony/java/android/telephony/ims/ImsCallSessionListener.java
+++ b/telephony/java/android/telephony/ims/ImsCallSessionListener.java
@@ -53,8 +53,45 @@
}
/**
- * A request has been sent out to initiate a new IMS call session and a 1xx response has been
- * received from the network.
+ * Called when the network first begins to establish the call session and is now connecting
+ * to the remote party. This must be called once after {@link ImsCallSessionImplBase#start} and
+ * before any other method on this listener. After this is called,
+ * {@link #callSessionProgressing(ImsStreamMediaProfile)} must be called to communicate any
+ * further updates.
+ * <p/>
+ * Once this is called, {@link #callSessionTerminated} must be called
+ * to end the call session. In the event that the session failed before the remote party
+ * was contacted, {@link #callSessionInitiatingFailed} must be called.
+ *
+ * @param profile the associated {@link ImsCallProfile}.
+ */
+ public void callSessionInitiating(@NonNull ImsCallProfile profile) {
+ try {
+ mListener.callSessionInitiating(profile);
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * The IMS call session establishment has failed while initiating.
+ *
+ * @param reasonInfo {@link ImsReasonInfo} detailing the reason of the IMS call session
+ * establishment failure.
+ */
+ public void callSessionInitiatingFailed(@NonNull ImsReasonInfo reasonInfo) {
+ try {
+ mListener.callSessionInitiatingFailed(reasonInfo);
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Called after the network has contacted the remote party and the call state should move to
+ * ALERTING.
+ *
+ * @param profile the associated {@link ImsCallProfile}.
*/
public void callSessionProgressing(ImsStreamMediaProfile profile) {
try {
@@ -65,7 +102,8 @@
}
/**
- * The IMS call session has been initiated.
+ * Called once the outgoing IMS call session has been begun between the local and remote party.
+ * The call state should move to ACTIVE.
*
* @param profile the associated {@link ImsCallProfile}.
*/
@@ -82,7 +120,12 @@
*
* @param reasonInfo {@link ImsReasonInfo} detailing the reason of the IMS call session
* establishment failure.
+ * @deprecated {@link #callSessionInitiated(ImsCallProfile)} is called immediately after
+ * the session is first started which meant that there was no time in which a call to this
+ * method was technically valid. This method is replaced starting Android S in favor of
+ * {@link #callSessionInitiatingFailed(ImsReasonInfo)}.
*/
+ @Deprecated
public void callSessionInitiatedFailed(ImsReasonInfo reasonInfo) {
try {
mListener.callSessionInitiatedFailed(reasonInfo);
diff --git a/telephony/java/android/telephony/ims/ImsRcsManager.java b/telephony/java/android/telephony/ims/ImsRcsManager.java
index 885ff9b..ad461c0 100644
--- a/telephony/java/android/telephony/ims/ImsRcsManager.java
+++ b/telephony/java/android/telephony/ims/ImsRcsManager.java
@@ -30,7 +30,6 @@
import android.provider.Settings;
import android.telephony.AccessNetworkConstants;
import android.telephony.BinderCacheManager;
-import android.telephony.CarrierConfigManager;
import android.telephony.TelephonyFrameworkInitializer;
import android.telephony.ims.aidl.IImsCapabilityCallback;
import android.telephony.ims.aidl.IImsRcsController;
@@ -62,9 +61,10 @@
* been enabled by the user can be queried using {@link RcsUceAdapter#isUceSettingEnabled()}.
* <p>
* This intent will always be handled by the system, however the application should only send
- * this Intent if the carrier supports RCS contact discovery, which can be queried using the key
- * {@link CarrierConfigManager#KEY_USE_RCS_PRESENCE_BOOL}. Otherwise, the RCS contact discovery
- * opt-in dialog will not be shown.
+ * this Intent if the carrier supports bulk RCS contact exchange, which will be true if either
+ * key {@link android.telephony.CarrierConfigManager.Ims#KEY_RCS_BULK_CAPABILITY_EXCHANGE_BOOL}
+ * or {@link android.telephony.CarrierConfigManager#KEY_USE_RCS_PRESENCE_BOOL} is set to true.
+ * Otherwise, the RCS contact discovery opt-in dialog will not be shown.
* <p>
* Input: A mandatory {@link Settings#EXTRA_SUB_ID} extra containing the subscription that the
* setting will be be shown for.
@@ -396,6 +396,7 @@
* rather the subscription is capable of this service over IMS.
* @see #isAvailable(int)
* @see android.telephony.CarrierConfigManager#KEY_USE_RCS_PRESENCE_BOOL
+ * @see android.telephony.CarrierConfigManager.Ims#KEY_ENABLE_PRESENCE_CAPABILITY_EXCHANGE_BOOL
* @throws ImsException if the IMS service is not available when calling this method.
* See {@link ImsException#getCode()} for more information on the error codes.
* @hide
diff --git a/telephony/java/android/telephony/ims/RcsContactPresenceTuple.java b/telephony/java/android/telephony/ims/RcsContactPresenceTuple.java
index b0aaa92..e4d20e9 100644
--- a/telephony/java/android/telephony/ims/RcsContactPresenceTuple.java
+++ b/telephony/java/android/telephony/ims/RcsContactPresenceTuple.java
@@ -39,6 +39,10 @@
/** The service id of the MMTEL */
public static final String SERVICE_ID_MMTEL = "org.3gpp.urn:urn-7:3gpp-service.ims.icsi.mmtel";
+ /** The service id of the Call Composer */
+ public static final String SERVICE_ID_CALL_COMPOSER =
+ "org.3gpp.urn:urn-7:3gppservice.ims.icsi.gsma.callcomposer";
+
/** The service capabilities is available. */
public static final String TUPLE_BASIC_STATUS_OPEN = "open";
diff --git a/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl b/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl
index ed895b7..ed03752 100644
--- a/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl
+++ b/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl
@@ -37,6 +37,8 @@
/**
* Notifies the result of the basic session operation (setup / terminate).
*/
+ void callSessionInitiating(in ImsCallProfile profile);
+ void callSessionInitiatingFailed(in ImsReasonInfo reasonInfo);
void callSessionProgressing(in ImsStreamMediaProfile profile);
void callSessionInitiated(in ImsCallProfile profile);
void callSessionInitiatedFailed(in ImsReasonInfo reasonInfo);
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index ff240a0..74753ca 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -128,6 +128,15 @@
*/
boolean isRadioOnForSubscriberWithFeature(int subId, String callingPackage, String callingFeatureId);
+ /**
+ * Set the user-set status for enriched calling with call composer.
+ */
+ void setCallComposerStatus(int subId, int status);
+
+ /**
+ * Get the user-set status for enriched calling with call composer.
+ */
+ int getCallComposerStatus(int subId);
/**
* Supply a pin to unlock the SIM for particular subId.
@@ -2360,4 +2369,10 @@
* Gets the config of RCS VoLTE single registration enabled for the carrier/subscription.
*/
boolean getCarrierSingleRegistrationEnabled(int subId);
+
+ /**
+ * Return the mobile provisioning url that is used to launch a browser to allow users to manage
+ * their mobile plan.
+ */
+ String getMobileProvisioningUrl();
}
diff --git a/test-mock/src/android/test/mock/MockContext.java b/test-mock/src/android/test/mock/MockContext.java
index cf3b03c..f7cebd1 100644
--- a/test-mock/src/android/test/mock/MockContext.java
+++ b/test-mock/src/android/test/mock/MockContext.java
@@ -817,6 +817,11 @@
}
@Override
+ public @NonNull Context createWindowContext(Display display, int type, Bundle options) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
public boolean isRestricted() {
throw new UnsupportedOperationException();
}
diff --git a/tests/net/common/java/android/net/NetworkProviderTest.kt b/tests/net/common/java/android/net/NetworkProviderTest.kt
index 77e9f12..bcc9072 100644
--- a/tests/net/common/java/android/net/NetworkProviderTest.kt
+++ b/tests/net/common/java/android/net/NetworkProviderTest.kt
@@ -29,6 +29,7 @@
import com.android.net.module.util.ArrayTrackRecord
import com.android.testutils.DevSdkIgnoreRule.IgnoreUpTo
import com.android.testutils.DevSdkIgnoreRunner
+import com.android.testutils.isDevSdkInRange
import org.junit.After
import org.junit.Before
import org.junit.Test
@@ -173,10 +174,12 @@
@Test
fun testDeclareNetworkRequestUnfulfillable() {
val mockContext = mock(Context::class.java)
- val provider = createNetworkProvider(mockContext)
- // ConnectivityManager not required at creation time
- verifyNoMoreInteractions(mockContext)
doReturn(mCm).`when`(mockContext).getSystemService(Context.CONNECTIVITY_SERVICE)
+ val provider = createNetworkProvider(mockContext)
+ // ConnectivityManager not required at creation time after R
+ if (!isDevSdkInRange(0, Build.VERSION_CODES.R)) {
+ verifyNoMoreInteractions(mockContext)
+ }
mCm.registerNetworkProvider(provider)
diff --git a/tests/net/java/android/net/Ikev2VpnProfileTest.java b/tests/net/java/android/net/Ikev2VpnProfileTest.java
index ada5494..076e41d 100644
--- a/tests/net/java/android/net/Ikev2VpnProfileTest.java
+++ b/tests/net/java/android/net/Ikev2VpnProfileTest.java
@@ -29,6 +29,7 @@
import androidx.test.runner.AndroidJUnit4;
import com.android.internal.net.VpnProfile;
+import com.android.net.module.util.ProxyUtils;
import com.android.org.bouncycastle.x509.X509V1CertificateGenerator;
import org.junit.Before;
@@ -67,7 +68,8 @@
return "fooPackage";
}
};
- private final ProxyInfo mProxy = new ProxyInfo(SERVER_ADDR_STRING, -1, EXCL_LIST);
+ private final ProxyInfo mProxy = ProxyInfo.buildDirectProxy(
+ SERVER_ADDR_STRING, -1, ProxyUtils.exclusionStringAsList(EXCL_LIST));
private X509Certificate mUserCert;
private X509Certificate mServerRootCa;
diff --git a/tests/net/java/android/net/NetworkUtilsTest.java b/tests/net/java/android/net/NetworkUtilsTest.java
index 3158cc8..7748288 100644
--- a/tests/net/java/android/net/NetworkUtilsTest.java
+++ b/tests/net/java/android/net/NetworkUtilsTest.java
@@ -16,24 +16,10 @@
package android.net;
-import static android.system.OsConstants.AF_INET;
-import static android.system.OsConstants.AF_INET6;
-import static android.system.OsConstants.AF_UNIX;
-import static android.system.OsConstants.EPERM;
-import static android.system.OsConstants.SOCK_DGRAM;
-import static android.system.OsConstants.SOCK_STREAM;
-
import static junit.framework.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import android.system.ErrnoException;
-import android.system.Os;
-
import androidx.test.runner.AndroidJUnit4;
-import libcore.io.IoUtils;
-
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -139,50 +125,4 @@
assertEquals(BigInteger.valueOf(7l - 4 + 4 + 16 + 65536),
NetworkUtils.routedIPv6AddressCount(set));
}
-
- private static void expectSocketSuccess(String msg, int domain, int type) {
- try {
- IoUtils.closeQuietly(Os.socket(domain, type, 0));
- } catch (ErrnoException e) {
- fail(msg + e.getMessage());
- }
- }
-
- private static void expectSocketPemissionError(String msg, int domain, int type) {
- try {
- IoUtils.closeQuietly(Os.socket(domain, type, 0));
- fail(msg);
- } catch (ErrnoException e) {
- assertEquals(msg, e.errno, EPERM);
- }
- }
-
- private static void expectHasNetworking() {
- expectSocketSuccess("Creating a UNIX socket should not have thrown ErrnoException",
- AF_UNIX, SOCK_STREAM);
- expectSocketSuccess("Creating a AF_INET socket shouldn't have thrown ErrnoException",
- AF_INET, SOCK_DGRAM);
- expectSocketSuccess("Creating a AF_INET6 socket shouldn't have thrown ErrnoException",
- AF_INET6, SOCK_DGRAM);
- }
-
- private static void expectNoNetworking() {
- expectSocketSuccess("Creating a UNIX socket should not have thrown ErrnoException",
- AF_UNIX, SOCK_STREAM);
- expectSocketPemissionError(
- "Creating a AF_INET socket should have thrown ErrnoException(EPERM)",
- AF_INET, SOCK_DGRAM);
- expectSocketPemissionError(
- "Creating a AF_INET6 socket should have thrown ErrnoException(EPERM)",
- AF_INET6, SOCK_DGRAM);
- }
-
- @Test
- public void testSetAllowNetworkingForProcess() {
- expectHasNetworking();
- NetworkUtils.setAllowNetworkingForProcess(false);
- expectNoNetworking();
- NetworkUtils.setAllowNetworkingForProcess(true);
- expectHasNetworking();
- }
}
diff --git a/tests/net/java/com/android/internal/net/NetworkUtilsInternalTest.java b/tests/net/java/com/android/internal/net/NetworkUtilsInternalTest.java
new file mode 100644
index 0000000..3cfecd5
--- /dev/null
+++ b/tests/net/java/com/android/internal/net/NetworkUtilsInternalTest.java
@@ -0,0 +1,89 @@
+/*
+ * 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.
+ */
+
+package com.android.internal.net;
+
+import static android.system.OsConstants.AF_INET;
+import static android.system.OsConstants.AF_INET6;
+import static android.system.OsConstants.AF_UNIX;
+import static android.system.OsConstants.EPERM;
+import static android.system.OsConstants.SOCK_DGRAM;
+import static android.system.OsConstants.SOCK_STREAM;
+
+import static junit.framework.Assert.assertEquals;
+
+import static org.junit.Assert.fail;
+
+import android.system.ErrnoException;
+import android.system.Os;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import libcore.io.IoUtils;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+@androidx.test.filters.SmallTest
+public class NetworkUtilsInternalTest {
+
+ private static void expectSocketSuccess(String msg, int domain, int type) {
+ try {
+ IoUtils.closeQuietly(Os.socket(domain, type, 0));
+ } catch (ErrnoException e) {
+ fail(msg + e.getMessage());
+ }
+ }
+
+ private static void expectSocketPemissionError(String msg, int domain, int type) {
+ try {
+ IoUtils.closeQuietly(Os.socket(domain, type, 0));
+ fail(msg);
+ } catch (ErrnoException e) {
+ assertEquals(msg, e.errno, EPERM);
+ }
+ }
+
+ private static void expectHasNetworking() {
+ expectSocketSuccess("Creating a UNIX socket should not have thrown ErrnoException",
+ AF_UNIX, SOCK_STREAM);
+ expectSocketSuccess("Creating a AF_INET socket shouldn't have thrown ErrnoException",
+ AF_INET, SOCK_DGRAM);
+ expectSocketSuccess("Creating a AF_INET6 socket shouldn't have thrown ErrnoException",
+ AF_INET6, SOCK_DGRAM);
+ }
+
+ private static void expectNoNetworking() {
+ expectSocketSuccess("Creating a UNIX socket should not have thrown ErrnoException",
+ AF_UNIX, SOCK_STREAM);
+ expectSocketPemissionError(
+ "Creating a AF_INET socket should have thrown ErrnoException(EPERM)",
+ AF_INET, SOCK_DGRAM);
+ expectSocketPemissionError(
+ "Creating a AF_INET6 socket should have thrown ErrnoException(EPERM)",
+ AF_INET6, SOCK_DGRAM);
+ }
+
+ @Test
+ public void testSetAllowNetworkingForProcess() {
+ expectHasNetworking();
+ NetworkUtilsInternal.setAllowNetworkingForProcess(false);
+ expectNoNetworking();
+ NetworkUtilsInternal.setAllowNetworkingForProcess(true);
+ expectHasNetworking();
+ }
+}
diff --git a/tests/net/java/com/android/server/ConnectivityServiceTest.java b/tests/net/java/com/android/server/ConnectivityServiceTest.java
index 20b05b5..35eb6ba 100644
--- a/tests/net/java/com/android/server/ConnectivityServiceTest.java
+++ b/tests/net/java/com/android/server/ConnectivityServiceTest.java
@@ -4742,11 +4742,9 @@
@Test
public void testNetworkCallbackMaximum() {
- // We can only have 99 callbacks, because MultipathPolicyTracker is
- // already one of them.
- final int MAX_REQUESTS = 99;
+ final int MAX_REQUESTS = 100;
final int CALLBACKS = 89;
- final int INTENTS = 10;
+ final int INTENTS = 11;
assertEquals(MAX_REQUESTS, CALLBACKS + INTENTS);
NetworkRequest networkRequest = new NetworkRequest.Builder().build();
@@ -7812,8 +7810,7 @@
@Test
public void testCheckConnectivityDiagnosticsPermissionsNetworkStack() throws Exception {
final NetworkAgentInfo naiWithoutUid =
- new NetworkAgentInfo(
- null, null, null, null, null, new NetworkCapabilities(), 0,
+ new NetworkAgentInfo(null, null, null, null, new NetworkCapabilities(), 0,
mServiceContext, null, null, mService, null, null, null, 0, INVALID_UID);
mServiceContext.setPermission(
@@ -7828,8 +7825,7 @@
@Test
public void testCheckConnectivityDiagnosticsPermissionsWrongUidPackageName() throws Exception {
final NetworkAgentInfo naiWithoutUid =
- new NetworkAgentInfo(
- null, null, null, null, null, new NetworkCapabilities(), 0,
+ new NetworkAgentInfo(null, null, null, null, new NetworkCapabilities(), 0,
mServiceContext, null, null, mService, null, null, null, 0, INVALID_UID);
mServiceContext.setPermission(android.Manifest.permission.NETWORK_STACK, PERMISSION_DENIED);
@@ -7844,8 +7840,7 @@
@Test
public void testCheckConnectivityDiagnosticsPermissionsNoLocationPermission() throws Exception {
final NetworkAgentInfo naiWithoutUid =
- new NetworkAgentInfo(
- null, null, null, null, null, new NetworkCapabilities(), 0,
+ new NetworkAgentInfo(null, null, null, null, new NetworkCapabilities(), 0,
mServiceContext, null, null, mService, null, null, null, 0, INVALID_UID);
mServiceContext.setPermission(android.Manifest.permission.NETWORK_STACK, PERMISSION_DENIED);
@@ -7861,8 +7856,7 @@
public void testCheckConnectivityDiagnosticsPermissionsActiveVpn() throws Exception {
final Network network = new Network(NET_ID);
final NetworkAgentInfo naiWithoutUid =
- new NetworkAgentInfo(
- null, null, network, null, null, new NetworkCapabilities(), 0,
+ new NetworkAgentInfo(null, network, null, null, new NetworkCapabilities(), 0,
mServiceContext, null, null, mService, null, null, null, 0, INVALID_UID);
setupLocationPermissions(Build.VERSION_CODES.Q, true, AppOpsManager.OPSTR_FINE_LOCATION,
@@ -7896,8 +7890,7 @@
final NetworkCapabilities nc = new NetworkCapabilities();
nc.setAdministratorUids(new int[] {Process.myUid()});
final NetworkAgentInfo naiWithUid =
- new NetworkAgentInfo(
- null, null, null, null, null, nc, 0, mServiceContext, null, null,
+ new NetworkAgentInfo(null, null, null, null, nc, 0, mServiceContext, null, null,
mService, null, null, null, 0, INVALID_UID);
setupLocationPermissions(Build.VERSION_CODES.Q, true, AppOpsManager.OPSTR_FINE_LOCATION,
@@ -7916,8 +7909,7 @@
nc.setOwnerUid(Process.myUid());
nc.setAdministratorUids(new int[] {Process.myUid()});
final NetworkAgentInfo naiWithUid =
- new NetworkAgentInfo(
- null, null, null, null, null, nc, 0, mServiceContext, null, null,
+ new NetworkAgentInfo(null, null, null, null, nc, 0, mServiceContext, null, null,
mService, null, null, null, 0, INVALID_UID);
setupLocationPermissions(Build.VERSION_CODES.Q, true, AppOpsManager.OPSTR_FINE_LOCATION,
@@ -8109,7 +8101,16 @@
@Test
public void testDumpDoesNotCrash() {
- StringWriter stringWriter = new StringWriter();
+ // Filing a couple requests prior to testing the dump.
+ final TestNetworkCallback genericNetworkCallback = new TestNetworkCallback();
+ final TestNetworkCallback wifiNetworkCallback = new TestNetworkCallback();
+ final NetworkRequest genericRequest = new NetworkRequest.Builder()
+ .clearCapabilities().build();
+ final NetworkRequest wifiRequest = new NetworkRequest.Builder()
+ .addTransportType(TRANSPORT_WIFI).build();
+ mCm.registerNetworkCallback(genericRequest, genericNetworkCallback);
+ mCm.registerNetworkCallback(wifiRequest, wifiNetworkCallback);
+ final StringWriter stringWriter = new StringWriter();
mService.dump(new FileDescriptor(), new PrintWriter(stringWriter), new String[0]);
@@ -8131,11 +8132,11 @@
mCm.registerNetworkCallback(wifiRequest, wifiNetworkCallback);
mCm.registerNetworkCallback(cellRequest, cellNetworkCallback);
- ConnectivityService.NetworkRequestInfo[] nriOutput = mService.requestsSortedById();
+ final ConnectivityService.NetworkRequestInfo[] nriOutput = mService.requestsSortedById();
assertTrue(nriOutput.length > 1);
for (int i = 0; i < nriOutput.length - 1; i++) {
- boolean isRequestIdInOrder =
+ final boolean isRequestIdInOrder =
nriOutput[i].mRequests.get(0).requestId
< nriOutput[i + 1].mRequests.get(0).requestId;
assertTrue(isRequestIdInOrder);
diff --git a/tests/net/java/com/android/server/NetworkManagementServiceTest.java b/tests/net/java/com/android/server/NetworkManagementServiceTest.java
index ea763d2..13516d7 100644
--- a/tests/net/java/com/android/server/NetworkManagementServiceTest.java
+++ b/tests/net/java/com/android/server/NetworkManagementServiceTest.java
@@ -68,11 +68,12 @@
@SmallTest
public class NetworkManagementServiceTest {
private NetworkManagementService mNMService;
-
@Mock private Context mContext;
@Mock private IBatteryStats.Stub mBatteryStatsService;
@Mock private INetd.Stub mNetdService;
+ private static final int TEST_UID = 111;
+
@NonNull
@Captor
private ArgumentCaptor<INetdUnsolicitedEventListener> mUnsolListenerCaptor;
@@ -165,14 +166,14 @@
/**
* Interface class activity.
*/
- unsolListener.onInterfaceClassActivityChanged(true, 1, 1234, 0);
- expectSoon(observer).interfaceClassDataActivityChanged("1", true, 1234);
+ unsolListener.onInterfaceClassActivityChanged(true, 1, 1234, TEST_UID);
+ expectSoon(observer).interfaceClassDataActivityChanged(1, true, 1234, TEST_UID);
- unsolListener.onInterfaceClassActivityChanged(false, 9, 5678, 0);
- expectSoon(observer).interfaceClassDataActivityChanged("9", false, 5678);
+ unsolListener.onInterfaceClassActivityChanged(false, 9, 5678, TEST_UID);
+ expectSoon(observer).interfaceClassDataActivityChanged(9, false, 5678, TEST_UID);
- unsolListener.onInterfaceClassActivityChanged(false, 9, 4321, 0);
- expectSoon(observer).interfaceClassDataActivityChanged("9", false, 4321);
+ unsolListener.onInterfaceClassActivityChanged(false, 9, 4321, TEST_UID);
+ expectSoon(observer).interfaceClassDataActivityChanged(9, false, 4321, TEST_UID);
/**
* IP address changes.
@@ -222,8 +223,6 @@
assertFalse(mNMService.isFirewallEnabled());
}
- private static final int TEST_UID = 111;
-
@Test
public void testNetworkRestrictedDefault() {
assertFalse(mNMService.isNetworkRestricted(TEST_UID));
@@ -235,23 +234,23 @@
doReturn(true).when(mNetdService).bandwidthEnableDataSaver(anyBoolean());
// Restrict usage of mobile data in background
- mNMService.setUidMeteredNetworkDenylist(TEST_UID, true);
+ mNMService.setUidOnMeteredNetworkDenylist(TEST_UID, true);
assertTrue("Should be true since mobile data usage is restricted",
mNMService.isNetworkRestricted(TEST_UID));
mNMService.setDataSaverModeEnabled(true);
verify(mNetdService).bandwidthEnableDataSaver(true);
- mNMService.setUidMeteredNetworkDenylist(TEST_UID, false);
+ mNMService.setUidOnMeteredNetworkDenylist(TEST_UID, false);
assertTrue("Should be true since data saver is on and the uid is not allowlisted",
mNMService.isNetworkRestricted(TEST_UID));
- mNMService.setUidMeteredNetworkAllowlist(TEST_UID, true);
+ mNMService.setUidOnMeteredNetworkAllowlist(TEST_UID, true);
assertFalse("Should be false since data saver is on and the uid is allowlisted",
mNMService.isNetworkRestricted(TEST_UID));
// remove uid from allowlist and turn datasaver off again
- mNMService.setUidMeteredNetworkAllowlist(TEST_UID, false);
+ mNMService.setUidOnMeteredNetworkAllowlist(TEST_UID, false);
mNMService.setDataSaverModeEnabled(false);
verify(mNetdService).bandwidthEnableDataSaver(false);
assertFalse("Network should not be restricted when data saver is off",
diff --git a/tests/net/java/com/android/server/connectivity/LingerMonitorTest.java b/tests/net/java/com/android/server/connectivity/LingerMonitorTest.java
index aafa18a..96c56e3 100644
--- a/tests/net/java/com/android/server/connectivity/LingerMonitorTest.java
+++ b/tests/net/java/com/android/server/connectivity/LingerMonitorTest.java
@@ -353,7 +353,7 @@
NetworkCapabilities caps = new NetworkCapabilities();
caps.addCapability(0);
caps.addTransportType(transport);
- NetworkAgentInfo nai = new NetworkAgentInfo(null, null, new Network(netId), info, null,
+ NetworkAgentInfo nai = new NetworkAgentInfo(null, new Network(netId), info, null,
caps, 50, mCtx, null, null /* config */, mConnService, mNetd, mDnsResolver, mNMS,
NetworkProvider.ID_NONE, Binder.getCallingUid());
nai.everValidated = true;
diff --git a/tests/net/java/com/android/server/net/NetworkStatsCollectionTest.java b/tests/net/java/com/android/server/net/NetworkStatsCollectionTest.java
index fb0cfc0..89146f9 100644
--- a/tests/net/java/com/android/server/net/NetworkStatsCollectionTest.java
+++ b/tests/net/java/com/android/server/net/NetworkStatsCollectionTest.java
@@ -23,11 +23,11 @@
import static android.net.NetworkStats.UID_ALL;
import static android.net.NetworkStatsHistory.FIELD_ALL;
import static android.net.NetworkTemplate.buildTemplateMobileAll;
-import static android.net.NetworkUtils.multiplySafeByRational;
import static android.os.Process.myUid;
import static android.text.format.DateUtils.HOUR_IN_MILLIS;
import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
+import static com.android.internal.net.NetworkUtilsInternal.multiplySafeByRational;
import static com.android.testutils.MiscAsserts.assertThrows;
import static org.junit.Assert.assertArrayEquals;
diff --git a/tests/net/java/com/android/server/net/NetworkStatsServiceTest.java b/tests/net/java/com/android/server/net/NetworkStatsServiceTest.java
index cd9406c..c783629 100644
--- a/tests/net/java/com/android/server/net/NetworkStatsServiceTest.java
+++ b/tests/net/java/com/android/server/net/NetworkStatsServiceTest.java
@@ -23,6 +23,7 @@
import static android.net.ConnectivityManager.TYPE_WIFI;
import static android.net.ConnectivityManager.TYPE_WIMAX;
import static android.net.NetworkStats.DEFAULT_NETWORK_ALL;
+import static android.net.NetworkStats.DEFAULT_NETWORK_NO;
import static android.net.NetworkStats.DEFAULT_NETWORK_YES;
import static android.net.NetworkStats.IFACE_ALL;
import static android.net.NetworkStats.INTERFACES_ALL;
@@ -917,7 +918,8 @@
public void testMetered() throws Exception {
// pretend that network comes online
expectDefaultSettings();
- NetworkState[] states = new NetworkState[] {buildWifiState(true /* isMetered */)};
+ NetworkState[] states =
+ new NetworkState[] {buildWifiState(true /* isMetered */, TEST_IFACE)};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
@@ -1146,7 +1148,8 @@
public void testStatsProviderUpdateStats() throws Exception {
// Pretend that network comes online.
expectDefaultSettings();
- final NetworkState[] states = new NetworkState[]{buildWifiState(true /* isMetered */)};
+ final NetworkState[] states =
+ new NetworkState[]{buildWifiState(true /* isMetered */, TEST_IFACE)};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
@@ -1206,7 +1209,8 @@
public void testStatsProviderSetAlert() throws Exception {
// Pretend that network comes online.
expectDefaultSettings();
- NetworkState[] states = new NetworkState[]{buildWifiState(true /* isMetered */)};
+ NetworkState[] states =
+ new NetworkState[]{buildWifiState(true /* isMetered */, TEST_IFACE)};
mService.forceUpdateIfaces(NETWORKS_WIFI, states, getActiveIface(states), new VpnInfo[0]);
// Register custom provider and retrieve callback.
@@ -1319,6 +1323,47 @@
assertUidTotal(templateAll, UID_RED, 22L + 35L, 26L + 29L, 19L + 7L, 5L + 11L, 1);
}
+ @Test
+ public void testOperationCount_nonDefault_traffic() throws Exception {
+ // Pretend mobile network comes online, but wifi is the default network.
+ expectDefaultSettings();
+ NetworkState[] states = new NetworkState[]{
+ buildWifiState(true /*isMetered*/, TEST_IFACE2), buildMobile3gState(IMSI_1)};
+ expectNetworkStatsUidDetail(buildEmptyStats());
+ mService.forceUpdateIfaces(NETWORKS_WIFI, states, getActiveIface(states), new VpnInfo[0]);
+
+ // Create some traffic on mobile network.
+ incrementCurrentTime(HOUR_IN_MILLIS);
+ expectNetworkStatsUidDetail(new NetworkStats(getElapsedRealtime(), 4)
+ .insertEntry(TEST_IFACE, UID_RED, SET_DEFAULT, TAG_NONE, METERED_NO, ROAMING_NO,
+ DEFAULT_NETWORK_NO, 2L, 1L, 3L, 4L, 0L)
+ .insertEntry(TEST_IFACE, UID_RED, SET_DEFAULT, TAG_NONE, METERED_NO, ROAMING_NO,
+ DEFAULT_NETWORK_YES, 1L, 3L, 2L, 1L, 0L)
+ .insertEntry(TEST_IFACE, UID_RED, SET_DEFAULT, 0xF00D, 5L, 4L, 1L, 4L, 0L));
+ // Increment operation count, which must have a specific tag.
+ mService.incrementOperationCount(UID_RED, 0xF00D, 2);
+ forcePollAndWaitForIdle();
+
+ // Verify mobile summary is not changed by the operation count.
+ final NetworkTemplate templateMobile =
+ buildTemplateMobileWithRatType(null, NETWORK_TYPE_ALL);
+ final NetworkStats statsMobile = mSession.getSummaryForAllUid(
+ templateMobile, Long.MIN_VALUE, Long.MAX_VALUE, true);
+ assertValues(statsMobile, IFACE_ALL, UID_RED, SET_ALL, TAG_NONE, METERED_ALL, ROAMING_ALL,
+ DEFAULT_NETWORK_ALL, 3L, 4L, 5L, 5L, 0);
+ assertValues(statsMobile, IFACE_ALL, UID_RED, SET_ALL, 0xF00D, METERED_ALL, ROAMING_ALL,
+ DEFAULT_NETWORK_ALL, 5L, 4L, 1L, 4L, 0);
+
+ // Verify the operation count is blamed onto the default network.
+ // TODO: Blame onto the default network is not very reasonable. Consider blame onto the
+ // network that generates the traffic.
+ final NetworkTemplate templateWifi = buildTemplateWifiWildcard();
+ final NetworkStats statsWifi = mSession.getSummaryForAllUid(
+ templateWifi, Long.MIN_VALUE, Long.MAX_VALUE, true);
+ assertValues(statsWifi, IFACE_ALL, UID_RED, SET_ALL, 0xF00D, METERED_ALL, ROAMING_ALL,
+ DEFAULT_NETWORK_ALL, 0L, 0L, 0L, 0L, 2);
+ }
+
private static File getBaseDir(File statsDir) {
File baseDir = new File(statsDir, "netstats");
baseDir.mkdirs();
@@ -1446,14 +1491,14 @@
}
private static NetworkState buildWifiState() {
- return buildWifiState(false);
+ return buildWifiState(false, TEST_IFACE);
}
- private static NetworkState buildWifiState(boolean isMetered) {
+ private static NetworkState buildWifiState(boolean isMetered, @NonNull String iface) {
final NetworkInfo info = new NetworkInfo(TYPE_WIFI, 0, null, null);
info.setDetailedState(DetailedState.CONNECTED, null, null);
final LinkProperties prop = new LinkProperties();
- prop.setInterfaceName(TEST_IFACE);
+ prop.setInterfaceName(iface);
final NetworkCapabilities capabilities = new NetworkCapabilities();
capabilities.setCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED, !isMetered);
capabilities.setCapability(NetworkCapabilities.NET_CAPABILITY_NOT_ROAMING, true);
diff --git a/tests/vcn/java/android/net/vcn/VcnConfigTest.java b/tests/vcn/java/android/net/vcn/VcnConfigTest.java
new file mode 100644
index 0000000..77944de
--- /dev/null
+++ b/tests/vcn/java/android/net/vcn/VcnConfigTest.java
@@ -0,0 +1,83 @@
+/*
+ * 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.vcn;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import android.os.Parcel;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.Collections;
+import java.util.Set;
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class VcnConfigTest {
+ private static final Set<VcnGatewayConnectionConfig> GATEWAY_CONNECTION_CONFIGS =
+ Collections.singleton(VcnGatewayConnectionConfigTest.buildTestConfig());
+
+ // Public visibility for VcnManagementServiceTest
+ public static VcnConfig buildTestConfig() {
+ VcnConfig.Builder builder = new VcnConfig.Builder();
+
+ for (VcnGatewayConnectionConfig gatewayConnectionConfig : GATEWAY_CONNECTION_CONFIGS) {
+ builder.addGatewayConnectionConfig(gatewayConnectionConfig);
+ }
+
+ return builder.build();
+ }
+
+ @Test
+ public void testBuilderRequiresGatewayConnectionConfig() {
+ try {
+ new VcnConfig.Builder().build();
+ fail("Expected exception due to no VcnGatewayConnectionConfigs provided");
+ } catch (IllegalArgumentException e) {
+ }
+ }
+
+ @Test
+ public void testBuilderAndGetters() {
+ final VcnConfig config = buildTestConfig();
+
+ assertEquals(GATEWAY_CONNECTION_CONFIGS, config.getGatewayConnectionConfigs());
+ }
+
+ @Test
+ public void testPersistableBundle() {
+ final VcnConfig config = buildTestConfig();
+
+ assertEquals(config, new VcnConfig(config.toPersistableBundle()));
+ }
+
+ @Test
+ public void testParceling() {
+ final VcnConfig config = buildTestConfig();
+
+ Parcel parcel = Parcel.obtain();
+ config.writeToParcel(parcel, 0);
+ parcel.setDataPosition(0);
+
+ assertEquals(config, VcnConfig.CREATOR.createFromParcel(parcel));
+ }
+}
diff --git a/tests/vcn/java/android/net/vcn/VcnGatewayConnectionConfigTest.java b/tests/vcn/java/android/net/vcn/VcnGatewayConnectionConfigTest.java
new file mode 100644
index 0000000..e98b6ef
--- /dev/null
+++ b/tests/vcn/java/android/net/vcn/VcnGatewayConnectionConfigTest.java
@@ -0,0 +1,143 @@
+/*
+ * 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.vcn;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import android.net.NetworkCapabilities;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.concurrent.TimeUnit;
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class VcnGatewayConnectionConfigTest {
+ private static final int[] EXPOSED_CAPS =
+ new int[] {
+ NetworkCapabilities.NET_CAPABILITY_INTERNET, NetworkCapabilities.NET_CAPABILITY_MMS
+ };
+ private static final int[] UNDERLYING_CAPS = new int[] {NetworkCapabilities.NET_CAPABILITY_DUN};
+ private static final long[] RETRY_INTERVALS_MS =
+ new long[] {
+ TimeUnit.SECONDS.toMillis(5),
+ TimeUnit.SECONDS.toMillis(30),
+ TimeUnit.MINUTES.toMillis(1),
+ TimeUnit.MINUTES.toMillis(5),
+ TimeUnit.MINUTES.toMillis(15),
+ TimeUnit.MINUTES.toMillis(30)
+ };
+ private static final int MAX_MTU = 1360;
+
+ // Package protected for use in VcnConfigTest
+ static VcnGatewayConnectionConfig buildTestConfig() {
+ final VcnGatewayConnectionConfig.Builder builder =
+ new VcnGatewayConnectionConfig.Builder()
+ .setRetryInterval(RETRY_INTERVALS_MS)
+ .setMaxMtu(MAX_MTU);
+
+ for (int caps : EXPOSED_CAPS) {
+ builder.addExposedCapability(caps);
+ }
+
+ for (int caps : UNDERLYING_CAPS) {
+ builder.addRequiredUnderlyingCapability(caps);
+ }
+
+ return builder.build();
+ }
+
+ @Test
+ public void testBuilderRequiresNonEmptyExposedCaps() {
+ try {
+ new VcnGatewayConnectionConfig.Builder()
+ .addRequiredUnderlyingCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
+ .build();
+
+ fail("Expected exception due to invalid exposed capabilities");
+ } catch (IllegalArgumentException e) {
+ }
+ }
+
+ @Test
+ public void testBuilderRequiresNonEmptyUnderlyingCaps() {
+ try {
+ new VcnGatewayConnectionConfig.Builder()
+ .addExposedCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
+ .build();
+
+ fail("Expected exception due to invalid required underlying capabilities");
+ } catch (IllegalArgumentException e) {
+ }
+ }
+
+ @Test
+ public void testBuilderRequiresNonNullRetryInterval() {
+ try {
+ new VcnGatewayConnectionConfig.Builder().setRetryInterval(null);
+ fail("Expected exception due to invalid retryIntervalMs");
+ } catch (IllegalArgumentException e) {
+ }
+ }
+
+ @Test
+ public void testBuilderRequiresNonEmptyRetryInterval() {
+ try {
+ new VcnGatewayConnectionConfig.Builder().setRetryInterval(new long[0]);
+ fail("Expected exception due to invalid retryIntervalMs");
+ } catch (IllegalArgumentException e) {
+ }
+ }
+
+ @Test
+ public void testBuilderRequiresValidMtu() {
+ try {
+ new VcnGatewayConnectionConfig.Builder()
+ .setMaxMtu(VcnGatewayConnectionConfig.MIN_MTU_V6 - 1);
+ fail("Expected exception due to invalid mtu");
+ } catch (IllegalArgumentException e) {
+ }
+ }
+
+ @Test
+ public void testBuilderAndGetters() {
+ final VcnGatewayConnectionConfig config = buildTestConfig();
+
+ for (int cap : EXPOSED_CAPS) {
+ config.hasExposedCapability(cap);
+ }
+ for (int cap : UNDERLYING_CAPS) {
+ config.requiresUnderlyingCapability(cap);
+ }
+
+ assertArrayEquals(RETRY_INTERVALS_MS, config.getRetryIntervalsMs());
+ assertEquals(MAX_MTU, config.getMaxMtu());
+ }
+
+ @Test
+ public void testPersistableBundle() {
+ final VcnGatewayConnectionConfig config = buildTestConfig();
+
+ assertEquals(config, new VcnGatewayConnectionConfig(config.toPersistableBundle()));
+ }
+}
diff --git a/tests/vcn/java/com/android/server/VcnManagementServiceTest.java b/tests/vcn/java/com/android/server/VcnManagementServiceTest.java
index c91fdbf..1cc9532 100644
--- a/tests/vcn/java/com/android/server/VcnManagementServiceTest.java
+++ b/tests/vcn/java/com/android/server/VcnManagementServiceTest.java
@@ -16,42 +16,123 @@
package com.android.server;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import android.content.Context;
import android.net.ConnectivityManager;
+import android.net.vcn.VcnConfig;
+import android.net.vcn.VcnConfigTest;
+import android.os.ParcelUuid;
+import android.os.PersistableBundle;
+import android.os.Process;
+import android.os.UserHandle;
import android.os.test.TestLooper;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyManager;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
+import com.android.server.vcn.util.PersistableBundleUtils;
+
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.io.FileNotFoundException;
+import java.util.Collections;
+import java.util.Map;
+import java.util.UUID;
+
/** Tests for {@link VcnManagementService}. */
@RunWith(AndroidJUnit4.class)
@SmallTest
public class VcnManagementServiceTest {
+ private static final ParcelUuid TEST_UUID_1 = new ParcelUuid(new UUID(0, 0));
+ private static final ParcelUuid TEST_UUID_2 = new ParcelUuid(new UUID(1, 1));
+ private static final VcnConfig TEST_VCN_CONFIG = VcnConfigTest.buildTestConfig();
+ private static final Map<ParcelUuid, VcnConfig> TEST_VCN_CONFIG_MAP =
+ Collections.unmodifiableMap(Collections.singletonMap(TEST_UUID_1, TEST_VCN_CONFIG));
+
+ private static final SubscriptionInfo TEST_SUBSCRIPTION_INFO =
+ new SubscriptionInfo(
+ 1 /* id */,
+ "" /* iccId */,
+ 0 /* simSlotIndex */,
+ "Carrier" /* displayName */,
+ "Carrier" /* carrierName */,
+ 0 /* nameSource */,
+ 255 /* iconTint */,
+ "12345" /* number */,
+ 0 /* roaming */,
+ null /* icon */,
+ "0" /* mcc */,
+ "0" /* mnc */,
+ "0" /* countryIso */,
+ false /* isEmbedded */,
+ null /* nativeAccessRules */,
+ null /* cardString */,
+ false /* isOpportunistic */,
+ TEST_UUID_1.toString() /* groupUUID */,
+ 0 /* carrierId */,
+ 0 /* profileClass */);
+
private final Context mMockContext = mock(Context.class);
private final VcnManagementService.Dependencies mMockDeps =
mock(VcnManagementService.Dependencies.class);
private final TestLooper mTestLooper = new TestLooper();
private final ConnectivityManager mConnMgr = mock(ConnectivityManager.class);
+ private final TelephonyManager mTelMgr = mock(TelephonyManager.class);
+ private final SubscriptionManager mSubMgr = mock(SubscriptionManager.class);
private final VcnManagementService mVcnMgmtSvc;
+ private final PersistableBundleUtils.LockingReadWriteHelper mConfigReadWriteHelper =
+ mock(PersistableBundleUtils.LockingReadWriteHelper.class);
- public VcnManagementServiceTest() {
- doReturn(Context.CONNECTIVITY_SERVICE)
- .when(mMockContext)
- .getSystemServiceName(ConnectivityManager.class);
- doReturn(mConnMgr).when(mMockContext).getSystemService(Context.CONNECTIVITY_SERVICE);
+ public VcnManagementServiceTest() throws Exception {
+ setupSystemService(mConnMgr, Context.CONNECTIVITY_SERVICE, ConnectivityManager.class);
+ setupSystemService(mTelMgr, Context.TELEPHONY_SERVICE, TelephonyManager.class);
+ setupSystemService(
+ mSubMgr, Context.TELEPHONY_SUBSCRIPTION_SERVICE, SubscriptionManager.class);
doReturn(mTestLooper.getLooper()).when(mMockDeps).getLooper();
+ doReturn(Process.FIRST_APPLICATION_UID).when(mMockDeps).getBinderCallingUid();
+ doReturn(mConfigReadWriteHelper)
+ .when(mMockDeps)
+ .newPersistableBundleLockingReadWriteHelper(any());
+
+ final PersistableBundle bundle =
+ PersistableBundleUtils.fromMap(
+ TEST_VCN_CONFIG_MAP,
+ PersistableBundleUtils::fromParcelUuid,
+ VcnConfig::toPersistableBundle);
+ doReturn(bundle).when(mConfigReadWriteHelper).readFromDisk();
+
+ setupMockedCarrierPrivilege(true);
mVcnMgmtSvc = new VcnManagementService(mMockContext, mMockDeps);
}
+ private void setupSystemService(Object service, String name, Class<?> serviceClass) {
+ doReturn(name).when(mMockContext).getSystemServiceName(serviceClass);
+ doReturn(service).when(mMockContext).getSystemService(name);
+ }
+
+ private void setupMockedCarrierPrivilege(boolean isPrivileged) {
+ doReturn(Collections.singletonList(TEST_SUBSCRIPTION_INFO))
+ .when(mSubMgr)
+ .getSubscriptionsInGroup(any());
+ doReturn(isPrivileged)
+ .when(mTelMgr)
+ .hasCarrierPrivileges(eq(TEST_SUBSCRIPTION_INFO.getSubscriptionId()));
+ }
+
@Test
public void testSystemReady() throws Exception {
mVcnMgmtSvc.systemReady();
@@ -59,4 +140,119 @@
verify(mConnMgr)
.registerNetworkProvider(any(VcnManagementService.VcnNetworkProvider.class));
}
+
+ @Test
+ public void testNonSystemServerRealConfigFileAccessPermission() throws Exception {
+ // Attempt to build a real instance of the dependencies, and verify we cannot write to the
+ // file.
+ VcnManagementService.Dependencies deps = new VcnManagementService.Dependencies();
+ PersistableBundleUtils.LockingReadWriteHelper configReadWriteHelper =
+ deps.newPersistableBundleLockingReadWriteHelper(
+ VcnManagementService.VCN_CONFIG_FILE);
+
+ // Even tests should not be able to read/write configs from disk; SELinux policies restrict
+ // it to only the system server.
+ // Reading config should always return null since the file "does not exist", and writing
+ // should throw an IOException.
+ assertNull(configReadWriteHelper.readFromDisk());
+
+ try {
+ configReadWriteHelper.writeToDisk(new PersistableBundle());
+ fail("Expected IOException due to SELinux policy");
+ } catch (FileNotFoundException expected) {
+ }
+ }
+
+ @Test
+ public void testLoadVcnConfigsOnStartup() throws Exception {
+ mTestLooper.dispatchAll();
+
+ assertEquals(TEST_VCN_CONFIG_MAP, mVcnMgmtSvc.getConfigs());
+ verify(mConfigReadWriteHelper).readFromDisk();
+ }
+
+ @Test
+ public void testSetVcnConfigRequiresNonSystemServer() throws Exception {
+ doReturn(Process.SYSTEM_UID).when(mMockDeps).getBinderCallingUid();
+
+ try {
+ mVcnMgmtSvc.setVcnConfig(TEST_UUID_1, VcnConfigTest.buildTestConfig());
+ fail("Expected IllegalStateException exception for system server");
+ } catch (IllegalStateException expected) {
+ }
+ }
+
+ @Test
+ public void testSetVcnConfigRequiresSystemUser() throws Exception {
+ doReturn(UserHandle.getUid(UserHandle.MIN_SECONDARY_USER_ID, Process.FIRST_APPLICATION_UID))
+ .when(mMockDeps)
+ .getBinderCallingUid();
+
+ try {
+ mVcnMgmtSvc.setVcnConfig(TEST_UUID_1, VcnConfigTest.buildTestConfig());
+ fail("Expected security exception for non system user");
+ } catch (SecurityException expected) {
+ }
+ }
+
+ @Test
+ public void testSetVcnConfigRequiresCarrierPrivileges() throws Exception {
+ setupMockedCarrierPrivilege(false);
+
+ try {
+ mVcnMgmtSvc.setVcnConfig(TEST_UUID_1, VcnConfigTest.buildTestConfig());
+ fail("Expected security exception for missing carrier privileges");
+ } catch (SecurityException expected) {
+ }
+ }
+
+ @Test
+ public void testSetVcnConfig() throws Exception {
+ // Use a different UUID to simulate a new VCN config.
+ mVcnMgmtSvc.setVcnConfig(TEST_UUID_2, TEST_VCN_CONFIG);
+ assertEquals(TEST_VCN_CONFIG, mVcnMgmtSvc.getConfigs().get(TEST_UUID_2));
+ verify(mConfigReadWriteHelper).writeToDisk(any(PersistableBundle.class));
+ }
+
+ @Test
+ public void testClearVcnConfigRequiresNonSystemServer() throws Exception {
+ doReturn(Process.SYSTEM_UID).when(mMockDeps).getBinderCallingUid();
+
+ try {
+ mVcnMgmtSvc.clearVcnConfig(TEST_UUID_1);
+ fail("Expected IllegalStateException exception for system server");
+ } catch (IllegalStateException expected) {
+ }
+ }
+
+ @Test
+ public void testClearVcnConfigRequiresSystemUser() throws Exception {
+ doReturn(UserHandle.getUid(UserHandle.MIN_SECONDARY_USER_ID, Process.FIRST_APPLICATION_UID))
+ .when(mMockDeps)
+ .getBinderCallingUid();
+
+ try {
+ mVcnMgmtSvc.clearVcnConfig(TEST_UUID_1);
+ fail("Expected security exception for non system user");
+ } catch (SecurityException expected) {
+ }
+ }
+
+ @Test
+ public void testClearVcnConfigRequiresCarrierPrivileges() throws Exception {
+ setupMockedCarrierPrivilege(false);
+
+ try {
+ mVcnMgmtSvc.clearVcnConfig(TEST_UUID_1);
+ fail("Expected security exception for missing carrier privileges");
+ } catch (SecurityException expected) {
+ }
+ }
+
+ @Test
+ public void testClearVcnConfig() throws Exception {
+ mVcnMgmtSvc.clearVcnConfig(TEST_UUID_1);
+ assertTrue(mVcnMgmtSvc.getConfigs().isEmpty());
+ verify(mConfigReadWriteHelper).writeToDisk(any(PersistableBundle.class));
+ }
}
diff --git a/tests/vcn/java/com/android/server/vcn/TelephonySubscriptionTrackerTest.java b/tests/vcn/java/com/android/server/vcn/TelephonySubscriptionTrackerTest.java
new file mode 100644
index 0000000..17b8f64a
--- /dev/null
+++ b/tests/vcn/java/com/android/server/vcn/TelephonySubscriptionTrackerTest.java
@@ -0,0 +1,333 @@
+/*
+ * 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.vcn;
+
+import static android.telephony.CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED;
+import static android.telephony.CarrierConfigManager.EXTRA_SLOT_INDEX;
+import static android.telephony.CarrierConfigManager.EXTRA_SUBSCRIPTION_INDEX;
+import static android.telephony.SubscriptionManager.INVALID_SIM_SLOT_INDEX;
+import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+
+import static com.android.server.vcn.TelephonySubscriptionTracker.TelephonySubscriptionSnapshot;
+import static com.android.server.vcn.TelephonySubscriptionTracker.TelephonySubscriptionTrackerCallback;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.argThat;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+
+import android.annotation.NonNull;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Handler;
+import android.os.HandlerExecutor;
+import android.os.ParcelUuid;
+import android.os.test.TestLooper;
+import android.telephony.CarrierConfigManager;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
+import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener;
+import android.util.ArraySet;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+/** Tests for TelephonySubscriptionTracker */
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class TelephonySubscriptionTrackerTest {
+ private static final ParcelUuid TEST_PARCEL_UUID = new ParcelUuid(UUID.randomUUID());
+ private static final int TEST_SIM_SLOT_INDEX = 1;
+ private static final int TEST_SUBSCRIPTION_ID_1 = 2;
+ private static final SubscriptionInfo TEST_SUBINFO_1 = mock(SubscriptionInfo.class);
+ private static final int TEST_SUBSCRIPTION_ID_2 = 3;
+ private static final SubscriptionInfo TEST_SUBINFO_2 = mock(SubscriptionInfo.class);
+ private static final Map<Integer, ParcelUuid> TEST_SUBID_TO_GROUP_MAP;
+
+ static {
+ final Map<Integer, ParcelUuid> subIdToGroupMap = new HashMap<>();
+ subIdToGroupMap.put(TEST_SUBSCRIPTION_ID_1, TEST_PARCEL_UUID);
+ subIdToGroupMap.put(TEST_SUBSCRIPTION_ID_2, TEST_PARCEL_UUID);
+ TEST_SUBID_TO_GROUP_MAP = Collections.unmodifiableMap(subIdToGroupMap);
+ }
+
+ @NonNull private final Context mContext;
+ @NonNull private final TestLooper mTestLooper;
+ @NonNull private final Handler mHandler;
+ @NonNull private final TelephonySubscriptionTracker.Dependencies mDeps;
+
+ @NonNull private final SubscriptionManager mSubscriptionManager;
+ @NonNull private final CarrierConfigManager mCarrierConfigManager;
+
+ @NonNull private TelephonySubscriptionTrackerCallback mCallback;
+ @NonNull private TelephonySubscriptionTracker mTelephonySubscriptionTracker;
+
+ public TelephonySubscriptionTrackerTest() {
+ mContext = mock(Context.class);
+ mTestLooper = new TestLooper();
+ mHandler = new Handler(mTestLooper.getLooper());
+ mDeps = mock(TelephonySubscriptionTracker.Dependencies.class);
+
+ mSubscriptionManager = mock(SubscriptionManager.class);
+ mCarrierConfigManager = mock(CarrierConfigManager.class);
+
+ doReturn(Context.TELEPHONY_SUBSCRIPTION_SERVICE)
+ .when(mContext)
+ .getSystemServiceName(SubscriptionManager.class);
+ doReturn(mSubscriptionManager)
+ .when(mContext)
+ .getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
+
+ doReturn(Context.CARRIER_CONFIG_SERVICE)
+ .when(mContext)
+ .getSystemServiceName(CarrierConfigManager.class);
+ doReturn(mCarrierConfigManager)
+ .when(mContext)
+ .getSystemService(Context.CARRIER_CONFIG_SERVICE);
+
+ // subId 1, 2 are in same subGrp, only subId 1 is active
+ doReturn(TEST_PARCEL_UUID).when(TEST_SUBINFO_1).getGroupUuid();
+ doReturn(TEST_PARCEL_UUID).when(TEST_SUBINFO_2).getGroupUuid();
+ doReturn(TEST_SIM_SLOT_INDEX).when(TEST_SUBINFO_1).getSimSlotIndex();
+ doReturn(INVALID_SIM_SLOT_INDEX).when(TEST_SUBINFO_2).getSimSlotIndex();
+ doReturn(TEST_SUBSCRIPTION_ID_1).when(TEST_SUBINFO_1).getSubscriptionId();
+ doReturn(TEST_SUBSCRIPTION_ID_2).when(TEST_SUBINFO_2).getSubscriptionId();
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ mCallback = mock(TelephonySubscriptionTrackerCallback.class);
+ mTelephonySubscriptionTracker =
+ new TelephonySubscriptionTracker(mContext, mHandler, mCallback, mDeps);
+ mTelephonySubscriptionTracker.register();
+
+ doReturn(true).when(mDeps).isConfigForIdentifiedCarrier(any());
+ doReturn(Arrays.asList(TEST_SUBINFO_1, TEST_SUBINFO_2))
+ .when(mSubscriptionManager)
+ .getAllSubscriptionInfoList();
+ }
+
+ private IntentFilter getIntentFilter() {
+ final ArgumentCaptor<IntentFilter> captor = ArgumentCaptor.forClass(IntentFilter.class);
+ verify(mContext).registerReceiver(any(), captor.capture(), any(), any());
+
+ return captor.getValue();
+ }
+
+ private OnSubscriptionsChangedListener getOnSubscriptionsChangedListener() {
+ final ArgumentCaptor<OnSubscriptionsChangedListener> captor =
+ ArgumentCaptor.forClass(OnSubscriptionsChangedListener.class);
+ verify(mSubscriptionManager).addOnSubscriptionsChangedListener(any(), captor.capture());
+
+ return captor.getValue();
+ }
+
+ private Intent buildTestBroadcastIntent(boolean hasValidSubscription) {
+ Intent intent = new Intent(ACTION_CARRIER_CONFIG_CHANGED);
+ intent.putExtra(EXTRA_SLOT_INDEX, TEST_SIM_SLOT_INDEX);
+ intent.putExtra(
+ EXTRA_SUBSCRIPTION_INDEX,
+ hasValidSubscription ? TEST_SUBSCRIPTION_ID_1 : INVALID_SUBSCRIPTION_ID);
+
+ return intent;
+ }
+
+ private TelephonySubscriptionSnapshot buildExpectedSnapshot(Set<ParcelUuid> activeSubGroups) {
+ return buildExpectedSnapshot(TEST_SUBID_TO_GROUP_MAP, activeSubGroups);
+ }
+
+ private TelephonySubscriptionSnapshot buildExpectedSnapshot(
+ Map<Integer, ParcelUuid> subIdToGroupMap, Set<ParcelUuid> activeSubGroups) {
+ return new TelephonySubscriptionSnapshot(subIdToGroupMap, activeSubGroups);
+ }
+
+ private void verifyNoActiveSubscriptions() {
+ verify(mCallback).onNewSnapshot(
+ argThat(snapshot -> snapshot.getActiveSubscriptionGroups().isEmpty()));
+ }
+
+ private void setupReadySubIds() {
+ mTelephonySubscriptionTracker.setReadySubIdsBySlotId(
+ Collections.singletonMap(TEST_SIM_SLOT_INDEX, TEST_SUBSCRIPTION_ID_1));
+ }
+
+ @Test
+ public void testRegister() throws Exception {
+ verify(mContext)
+ .registerReceiver(
+ eq(mTelephonySubscriptionTracker),
+ any(IntentFilter.class),
+ any(),
+ eq(mHandler));
+ final IntentFilter filter = getIntentFilter();
+ assertEquals(1, filter.countActions());
+ assertTrue(filter.hasAction(ACTION_CARRIER_CONFIG_CHANGED));
+
+ verify(mSubscriptionManager)
+ .addOnSubscriptionsChangedListener(any(HandlerExecutor.class), any());
+ assertNotNull(getOnSubscriptionsChangedListener());
+ }
+
+ @Test
+ public void testUnregister() throws Exception {
+ mTelephonySubscriptionTracker.unregister();
+
+ verify(mContext).unregisterReceiver(eq(mTelephonySubscriptionTracker));
+
+ final OnSubscriptionsChangedListener listener = getOnSubscriptionsChangedListener();
+ verify(mSubscriptionManager).removeOnSubscriptionsChangedListener(eq(listener));
+ }
+
+ @Test
+ public void testOnSubscriptionsChangedFired_NoReadySubIds() throws Exception {
+ final OnSubscriptionsChangedListener listener = getOnSubscriptionsChangedListener();
+ listener.onSubscriptionsChanged();
+ mTestLooper.dispatchAll();
+
+ verifyNoActiveSubscriptions();
+ }
+
+ @Test
+ public void testOnSubscriptionsChangedFired_WithReadySubIds() throws Exception {
+ setupReadySubIds();
+
+ final OnSubscriptionsChangedListener listener = getOnSubscriptionsChangedListener();
+ listener.onSubscriptionsChanged();
+ mTestLooper.dispatchAll();
+
+ final Set<ParcelUuid> activeSubGroups = Collections.singleton(TEST_PARCEL_UUID);
+ verify(mCallback).onNewSnapshot(eq(buildExpectedSnapshot(activeSubGroups)));
+ }
+
+ @Test
+ public void testReceiveBroadcast_ConfigReadyWithSubscriptions() throws Exception {
+ mTelephonySubscriptionTracker.onReceive(mContext, buildTestBroadcastIntent(true));
+ mTestLooper.dispatchAll();
+
+ final Set<ParcelUuid> activeSubGroups = Collections.singleton(TEST_PARCEL_UUID);
+ verify(mCallback).onNewSnapshot(eq(buildExpectedSnapshot(activeSubGroups)));
+ }
+
+ @Test
+ public void testReceiveBroadcast_ConfigReadyNoSubscriptions() throws Exception {
+ doReturn(new ArrayList<SubscriptionInfo>())
+ .when(mSubscriptionManager)
+ .getAllSubscriptionInfoList();
+
+ mTelephonySubscriptionTracker.onReceive(mContext, buildTestBroadcastIntent(true));
+ mTestLooper.dispatchAll();
+
+ // Expect an empty snapshot
+ verify(mCallback).onNewSnapshot(
+ eq(buildExpectedSnapshot(Collections.emptyMap(), Collections.emptySet())));
+ }
+
+ @Test
+ public void testReceiveBroadcast_SlotCleared() throws Exception {
+ setupReadySubIds();
+
+ mTelephonySubscriptionTracker.onReceive(mContext, buildTestBroadcastIntent(false));
+ mTestLooper.dispatchAll();
+
+ verifyNoActiveSubscriptions();
+ assertTrue(mTelephonySubscriptionTracker.getReadySubIdsBySlotId().isEmpty());
+ }
+
+ @Test
+ public void testReceiveBroadcast_ConfigNotReady() throws Exception {
+ doReturn(false).when(mDeps).isConfigForIdentifiedCarrier(any());
+
+ mTelephonySubscriptionTracker.onReceive(mContext, buildTestBroadcastIntent(true));
+ mTestLooper.dispatchAll();
+
+ // No interactions expected; config was not loaded
+ verifyNoMoreInteractions(mCallback);
+ }
+
+ @Test
+ public void testSubscriptionsClearedAfterValidTriggersCallbacks() throws Exception {
+ final Set<ParcelUuid> activeSubGroups = Collections.singleton(TEST_PARCEL_UUID);
+
+ mTelephonySubscriptionTracker.onReceive(mContext, buildTestBroadcastIntent(true));
+ mTestLooper.dispatchAll();
+ verify(mCallback).onNewSnapshot(eq(buildExpectedSnapshot(activeSubGroups)));
+ assertNotNull(
+ mTelephonySubscriptionTracker.getReadySubIdsBySlotId().get(TEST_SIM_SLOT_INDEX));
+
+ doReturn(Collections.emptyList()).when(mSubscriptionManager).getAllSubscriptionInfoList();
+ mTelephonySubscriptionTracker.onReceive(mContext, buildTestBroadcastIntent(true));
+ mTestLooper.dispatchAll();
+ verify(mCallback).onNewSnapshot(
+ eq(buildExpectedSnapshot(Collections.emptyMap(), Collections.emptySet())));
+ }
+
+ @Test
+ public void testSlotClearedAfterValidTriggersCallbacks() throws Exception {
+ final Set<ParcelUuid> activeSubGroups = Collections.singleton(TEST_PARCEL_UUID);
+
+ mTelephonySubscriptionTracker.onReceive(mContext, buildTestBroadcastIntent(true));
+ mTestLooper.dispatchAll();
+ verify(mCallback).onNewSnapshot(eq(buildExpectedSnapshot(activeSubGroups)));
+ assertNotNull(
+ mTelephonySubscriptionTracker.getReadySubIdsBySlotId().get(TEST_SIM_SLOT_INDEX));
+
+ mTelephonySubscriptionTracker.onReceive(mContext, buildTestBroadcastIntent(false));
+ mTestLooper.dispatchAll();
+ verify(mCallback).onNewSnapshot(eq(buildExpectedSnapshot(Collections.emptySet())));
+ assertNull(mTelephonySubscriptionTracker.getReadySubIdsBySlotId().get(TEST_SIM_SLOT_INDEX));
+ }
+
+ @Test
+ public void testTelephonySubscriptionSnapshotGetGroupForSubId() throws Exception {
+ final TelephonySubscriptionSnapshot snapshot =
+ new TelephonySubscriptionSnapshot(TEST_SUBID_TO_GROUP_MAP, Collections.emptySet());
+
+ assertEquals(TEST_PARCEL_UUID, snapshot.getGroupForSubId(TEST_SUBSCRIPTION_ID_1));
+ assertEquals(TEST_PARCEL_UUID, snapshot.getGroupForSubId(TEST_SUBSCRIPTION_ID_2));
+ }
+
+ @Test
+ public void testTelephonySubscriptionSnapshotGetAllSubIdsInGroup() throws Exception {
+ final TelephonySubscriptionSnapshot snapshot =
+ new TelephonySubscriptionSnapshot(TEST_SUBID_TO_GROUP_MAP, Collections.emptySet());
+
+ assertEquals(
+ new ArraySet<>(Arrays.asList(TEST_SUBSCRIPTION_ID_1, TEST_SUBSCRIPTION_ID_2)),
+ snapshot.getAllSubIdsInGroup(TEST_PARCEL_UUID));
+ }
+}
diff --git a/tools/aapt2/util/Util.cpp b/tools/aapt2/util/Util.cpp
index 28330db..d7a8e6f 100644
--- a/tools/aapt2/util/Util.cpp
+++ b/tools/aapt2/util/Util.cpp
@@ -548,14 +548,14 @@
}
StringPiece16 GetString16(const android::ResStringPool& pool, size_t idx) {
- if (auto str = pool.stringAt(idx)) {
+ if (auto str = pool.stringAt(idx); str.ok()) {
return *str;
}
return StringPiece16();
}
std::string GetString(const android::ResStringPool& pool, size_t idx) {
- if (auto str = pool.string8At(idx)) {
+ if (auto str = pool.string8At(idx); str.ok()) {
return ModifiedUtf8ToUtf8(str->to_string());
}
return Utf16ToUtf8(GetString16(pool, idx));
diff --git a/tools/validatekeymaps/Main.cpp b/tools/validatekeymaps/Main.cpp
index 950473d..991b280 100644
--- a/tools/validatekeymaps/Main.cpp
+++ b/tools/validatekeymaps/Main.cpp
@@ -96,7 +96,7 @@
case FileType::KEY_LAYOUT: {
base::Result<std::shared_ptr<KeyLayoutMap>> ret = KeyLayoutMap::load(filename);
- if (!ret) {
+ if (!ret.ok()) {
error("Error %s parsing key layout file.\n\n", ret.error().message().c_str());
return false;
}
@@ -106,7 +106,7 @@
case FileType::KEY_CHARACTER_MAP: {
base::Result<std::shared_ptr<KeyCharacterMap>> ret =
KeyCharacterMap::load(filename, KeyCharacterMap::Format::ANY);
- if (!ret) {
+ if (!ret.ok()) {
error("Error %s parsing key character map file.\n\n",
ret.error().message().c_str());
return false;
diff --git a/wifi/Android.bp b/wifi/Android.bp
deleted file mode 100644
index c05f52c..0000000
--- a/wifi/Android.bp
+++ /dev/null
@@ -1,168 +0,0 @@
-// 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.
-
-java_defaults {
- name: "wifi-module-sdk-version-defaults",
- min_sdk_version: "30",
- target_sdk_version: "30",
-}
-
-filegroup {
- name: "framework-wifi-updatable-exported-aidl-sources",
- srcs: ["aidl-export/**/*.aidl"],
- path: "aidl-export",
- visibility: ["//visibility:private"],
-}
-
-filegroup {
- name: "framework-wifi-updatable-java-sources",
- srcs: [
- "java/**/*.java",
- "java/**/*.aidl",
- ],
- exclude_srcs: [
- ":framework-wifi-non-updatable-sources"
- ],
- path: "java",
- visibility: ["//visibility:private"],
-}
-
-filegroup {
- name: "framework-wifi-updatable-sources",
- srcs: [
- ":framework-wifi-updatable-java-sources",
- ":framework-wifi-updatable-exported-aidl-sources",
- ":module-utils-os-aidls",
- ],
-}
-
-filegroup {
- name: "framework-wifi-non-updatable-sources",
- srcs: [
- // TODO(b/146011398) package android.net.wifi is now split amongst 2 jars: framework.jar and
- // framework-wifi.jar. This is not a good idea, should move WifiNetworkScoreCache
- // to a separate package.
- "java/android/net/wifi/SoftApConfToXmlMigrationUtil.java",
- "java/android/net/wifi/WifiNetworkScoreCache.java",
- "java/android/net/wifi/WifiMigration.java",
- "java/android/net/wifi/nl80211/*.java",
- ":libwificond_ipc_aidl",
- ],
-}
-
-filegroup {
- name: "framework-wifi-annotations",
- srcs: ["java/android/net/wifi/WifiAnnotations.java"],
-}
-
-// list of tests that are allowed to access @hide APIs from framework-wifi
-test_access_hidden_api_whitelist = [
- "//frameworks/base/wifi/tests",
- "//frameworks/opt/net/wifi/tests/wifitests:__subpackages__",
-
- "//external/robolectric-shadows:__subpackages__",
- "//frameworks/base/packages/SettingsLib/tests/integ",
- "//external/sl4a:__subpackages__",
-]
-
-// defaults shared between `framework-wifi` & `framework-wifi-pre-jarjar`
-// java_sdk_library `framework-wifi` needs sources to generate stubs, so it cannot reuse
-// `framework-wifi-pre-jarjar`
-java_defaults {
- name: "framework-wifi-defaults",
- defaults: ["wifi-module-sdk-version-defaults"],
- static_libs: [
- "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",
- ":module-utils-os-aidls",
- ],
-}
-
-// wifi-service needs pre-jarjared version of framework-wifi so it can reference copied utility
-// classes before they are renamed.
-java_library {
- name: "framework-wifi-pre-jarjar",
- defaults: ["framework-wifi-defaults"],
- sdk_version: "module_current",
- libs: ["framework-annotations-lib"],
- // java_api_finder must accompany `srcs` (`srcs` defined in `framework-wifi-defaults`)
- plugins: ["java_api_finder"],
- installable: false,
- visibility: [
- "//frameworks/opt/net/wifi/service",
- "//frameworks/opt/net/wifi/tests/wifitests",
- ],
-}
-
-// post-jarjar version of framework-wifi
-java_sdk_library {
- name: "framework-wifi",
- defaults: [
- "framework-module-defaults",
- "framework-wifi-defaults",
- ],
-
- jarjar_rules: ":wifi-jarjar-rules",
-
- installable: true,
- optimize: {
- enabled: false
- },
- hostdex: true, // for hiddenapi check
-
- // Restrict access to implementation library.
- impl_library_visibility: [
- "//frameworks/opt/net/wifi/service:__subpackages__",
- ] + test_access_hidden_api_whitelist,
-
- apex_available: [
- "com.android.wifi",
- "test_com.android.wifi",
- ],
- permitted_packages: [
- "android.hardware.wifi",
- "android.net.wifi",
- // Created by jarjar rules.
- "com.android.wifi.x",
- ],
-}
-
-// defaults for tests that need to build against framework-wifi's @hide APIs
-java_defaults {
- name: "framework-wifi-test-defaults",
- sdk_version: "core_current",
- libs: [
- // order matters: classes in framework-wifi are resolved before framework, meaning
- // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework
- "framework-wifi.impl",
- "framework",
-
- // if sdk_version="" this gets automatically included, but here we need to add manually.
- "framework-res",
- ],
- visibility: test_access_hidden_api_whitelist,
-}
-
-filegroup {
- name: "wifi-jarjar-rules",
- srcs: ["jarjar-rules.txt"],
-}
diff --git a/wifi/MOVED.txt b/wifi/MOVED.txt
new file mode 100644
index 0000000..6ffb23c
--- /dev/null
+++ b/wifi/MOVED.txt
@@ -0,0 +1,8 @@
+Source code and tests for Wifi module APIs have moved to
+packages/modules/Wifi/framework.
+
+- frameworks/base/wifi/java -> packages/modules/Wifi/framework/java
+- frameworks/base/wifi/tests -> packages/modules/Wifi/framework/tests
+
+What remains in frameworks/base/wifi are Wifi APIs that
+are not part of the Wifi module.
diff --git a/wifi/TEST_MAPPING b/wifi/TEST_MAPPING
index 7ddc308..94e4f4d 100644
--- a/wifi/TEST_MAPPING
+++ b/wifi/TEST_MAPPING
@@ -1,22 +1,7 @@
{
- "presubmit-large": [
+ "presubmit": [
{
- "name": "CtsWifiTestCases",
- "options": [
- {
- "exclude-annotation": "android.net.wifi.cts.VirtualDeviceNotSupported"
- }
- ]
- }
- ],
- "mainline-presubmit": [
- {
- "name": "CtsWifiTestCases[com.google.android.wifi.apex]",
- "options": [
- {
- "exclude-annotation": "android.net.wifi.cts.VirtualDeviceNotSupported"
- }
- ]
+ "name": "FrameworksWifiNonUpdatableApiTests"
}
]
}
diff --git a/wifi/aidl-export/android/net/wifi/ScanResult.aidl b/wifi/aidl-export/android/net/wifi/ScanResult.aidl
deleted file mode 100644
index b30689c..0000000
--- a/wifi/aidl-export/android/net/wifi/ScanResult.aidl
+++ /dev/null
@@ -1,19 +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 android.net.wifi;
-
-@JavaOnlyStableParcelable parcelable ScanResult;
diff --git a/wifi/aidl-export/android/net/wifi/SoftApCapability.aidl b/wifi/aidl-export/android/net/wifi/SoftApCapability.aidl
deleted file mode 100644
index bf30709..0000000
--- a/wifi/aidl-export/android/net/wifi/SoftApCapability.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * 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.net.wifi;
-
-parcelable SoftApCapability;
diff --git a/wifi/aidl-export/android/net/wifi/SoftApConfiguration.aidl b/wifi/aidl-export/android/net/wifi/SoftApConfiguration.aidl
deleted file mode 100644
index 1d06f45..0000000
--- a/wifi/aidl-export/android/net/wifi/SoftApConfiguration.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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.net.wifi;
-
-parcelable SoftApConfiguration;
\ No newline at end of file
diff --git a/wifi/aidl-export/android/net/wifi/SoftApInfo.aidl b/wifi/aidl-export/android/net/wifi/SoftApInfo.aidl
deleted file mode 100644
index d4551cf..0000000
--- a/wifi/aidl-export/android/net/wifi/SoftApInfo.aidl
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * 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.net.wifi;
-
-parcelable SoftApInfo;
-
diff --git a/wifi/aidl-export/android/net/wifi/WifiClient.aidl b/wifi/aidl-export/android/net/wifi/WifiClient.aidl
deleted file mode 100644
index accdadd..0000000
--- a/wifi/aidl-export/android/net/wifi/WifiClient.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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.net.wifi;
-
-@JavaOnlyStableParcelable parcelable WifiClient;
\ No newline at end of file
diff --git a/wifi/aidl-export/android/net/wifi/WifiConfiguration.aidl b/wifi/aidl-export/android/net/wifi/WifiConfiguration.aidl
deleted file mode 100644
index 237a74d..0000000
--- a/wifi/aidl-export/android/net/wifi/WifiConfiguration.aidl
+++ /dev/null
@@ -1,19 +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 android.net.wifi;
-
-parcelable WifiConfiguration;
diff --git a/wifi/aidl-export/android/net/wifi/WifiEnterpriseConfig.aidl b/wifi/aidl-export/android/net/wifi/WifiEnterpriseConfig.aidl
deleted file mode 100644
index b0f5f84..0000000
--- a/wifi/aidl-export/android/net/wifi/WifiEnterpriseConfig.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (c) 2013, 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;
-
-parcelable WifiEnterpriseConfig;
diff --git a/wifi/aidl-export/android/net/wifi/WifiInfo.aidl b/wifi/aidl-export/android/net/wifi/WifiInfo.aidl
deleted file mode 100644
index db47f0b..0000000
--- a/wifi/aidl-export/android/net/wifi/WifiInfo.aidl
+++ /dev/null
@@ -1,19 +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 android.net.wifi;
-
-parcelable WifiInfo;
diff --git a/wifi/aidl-export/android/net/wifi/WifiNetworkConnectionStatistics.aidl b/wifi/aidl-export/android/net/wifi/WifiNetworkConnectionStatistics.aidl
deleted file mode 100644
index 5f497e2..0000000
--- a/wifi/aidl-export/android/net/wifi/WifiNetworkConnectionStatistics.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * 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.
- */
-
-package android.net.wifi;
-
-parcelable WifiNetworkConnectionStatistics;
diff --git a/wifi/aidl-export/android/net/wifi/WifiNetworkSuggestion.aidl b/wifi/aidl-export/android/net/wifi/WifiNetworkSuggestion.aidl
deleted file mode 100644
index eb6995f..0000000
--- a/wifi/aidl-export/android/net/wifi/WifiNetworkSuggestion.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * 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.net.wifi;
-
-parcelable WifiNetworkSuggestion;
diff --git a/wifi/aidl-export/android/net/wifi/WifiUsabilityStatsEntry.aidl b/wifi/aidl-export/android/net/wifi/WifiUsabilityStatsEntry.aidl
deleted file mode 100644
index 839af54..0000000
--- a/wifi/aidl-export/android/net/wifi/WifiUsabilityStatsEntry.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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.net.wifi;
-
-parcelable WifiUsabilityStatsEntry;
diff --git a/wifi/aidl-export/android/net/wifi/aware/AwareResources.aidl b/wifi/aidl-export/android/net/wifi/aware/AwareResources.aidl
deleted file mode 100644
index d0bd2dd..0000000
--- a/wifi/aidl-export/android/net/wifi/aware/AwareResources.aidl
+++ /dev/null
@@ -1,19 +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 android.net.wifi.aware;
-
-parcelable AwareResources;
\ No newline at end of file
diff --git a/wifi/aidl-export/android/net/wifi/aware/Characteristics.aidl b/wifi/aidl-export/android/net/wifi/aware/Characteristics.aidl
deleted file mode 100644
index 77305e9..0000000
--- a/wifi/aidl-export/android/net/wifi/aware/Characteristics.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-parcelable Characteristics;
diff --git a/wifi/aidl-export/android/net/wifi/aware/PublishConfig.aidl b/wifi/aidl-export/android/net/wifi/aware/PublishConfig.aidl
deleted file mode 100644
index 2e6dd00..0000000
--- a/wifi/aidl-export/android/net/wifi/aware/PublishConfig.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-parcelable PublishConfig;
diff --git a/wifi/aidl-export/android/net/wifi/aware/SubscribeConfig.aidl b/wifi/aidl-export/android/net/wifi/aware/SubscribeConfig.aidl
deleted file mode 100644
index bd73d5e..0000000
--- a/wifi/aidl-export/android/net/wifi/aware/SubscribeConfig.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-parcelable SubscribeConfig;
diff --git a/wifi/aidl-export/android/net/wifi/hotspot2/OsuProvider.aidl b/wifi/aidl-export/android/net/wifi/hotspot2/OsuProvider.aidl
deleted file mode 100644
index 23d0f22..0000000
--- a/wifi/aidl-export/android/net/wifi/hotspot2/OsuProvider.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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
- */
-
-package android.net.wifi.hotspot2;
-
-parcelable OsuProvider;
diff --git a/wifi/aidl-export/android/net/wifi/hotspot2/PasspointConfiguration.aidl b/wifi/aidl-export/android/net/wifi/hotspot2/PasspointConfiguration.aidl
deleted file mode 100644
index 6b1cea8..0000000
--- a/wifi/aidl-export/android/net/wifi/hotspot2/PasspointConfiguration.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (c) 2016, 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.hotspot2;
-
-parcelable PasspointConfiguration;
diff --git a/wifi/aidl-export/android/net/wifi/hotspot2/pps/Credential.aidl b/wifi/aidl-export/android/net/wifi/hotspot2/pps/Credential.aidl
deleted file mode 100644
index 3d8e833..0000000
--- a/wifi/aidl-export/android/net/wifi/hotspot2/pps/Credential.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (c) 2016, 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.hotspot2.pps;
-
-parcelable Credential;
diff --git a/wifi/aidl-export/android/net/wifi/hotspot2/pps/HomeSp.aidl b/wifi/aidl-export/android/net/wifi/hotspot2/pps/HomeSp.aidl
deleted file mode 100644
index 6d343bd..0000000
--- a/wifi/aidl-export/android/net/wifi/hotspot2/pps/HomeSp.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (c) 2016, 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.hotspot2.pps;
-
-parcelable HomeSp;
diff --git a/wifi/aidl-export/android/net/wifi/p2p/WifiP2pConfig.aidl b/wifi/aidl-export/android/net/wifi/p2p/WifiP2pConfig.aidl
deleted file mode 100644
index ea3b280..0000000
--- a/wifi/aidl-export/android/net/wifi/p2p/WifiP2pConfig.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (c) 2011, 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.p2p;
-
-parcelable WifiP2pConfig;
diff --git a/wifi/aidl-export/android/net/wifi/p2p/WifiP2pDevice.aidl b/wifi/aidl-export/android/net/wifi/p2p/WifiP2pDevice.aidl
deleted file mode 100644
index 8790c6f..0000000
--- a/wifi/aidl-export/android/net/wifi/p2p/WifiP2pDevice.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (c) 2011, 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.p2p;
-
-parcelable WifiP2pDevice;
diff --git a/wifi/aidl-export/android/net/wifi/p2p/WifiP2pDeviceList.aidl b/wifi/aidl-export/android/net/wifi/p2p/WifiP2pDeviceList.aidl
deleted file mode 100644
index 6c79009..0000000
--- a/wifi/aidl-export/android/net/wifi/p2p/WifiP2pDeviceList.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (c) 2011, 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.p2p;
-
-parcelable WifiP2pDeviceList;
diff --git a/wifi/aidl-export/android/net/wifi/p2p/WifiP2pGroup.aidl b/wifi/aidl-export/android/net/wifi/p2p/WifiP2pGroup.aidl
deleted file mode 100644
index 403f2b1..0000000
--- a/wifi/aidl-export/android/net/wifi/p2p/WifiP2pGroup.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (c) 2011, 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.p2p;
-
-parcelable WifiP2pGroup;
diff --git a/wifi/aidl-export/android/net/wifi/p2p/WifiP2pInfo.aidl b/wifi/aidl-export/android/net/wifi/p2p/WifiP2pInfo.aidl
deleted file mode 100644
index a347148..0000000
--- a/wifi/aidl-export/android/net/wifi/p2p/WifiP2pInfo.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (c) 2011, 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.p2p;
-
-parcelable WifiP2pInfo;
diff --git a/wifi/aidl-export/android/net/wifi/p2p/nsd/WifiP2pServiceInfo.aidl b/wifi/aidl-export/android/net/wifi/p2p/nsd/WifiP2pServiceInfo.aidl
deleted file mode 100644
index 57055f7..0000000
--- a/wifi/aidl-export/android/net/wifi/p2p/nsd/WifiP2pServiceInfo.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2012 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.p2p.nsd;
-
-parcelable WifiP2pServiceInfo;
diff --git a/wifi/aidl-export/android/net/wifi/p2p/nsd/WifiP2pServiceRequest.aidl b/wifi/aidl-export/android/net/wifi/p2p/nsd/WifiP2pServiceRequest.aidl
deleted file mode 100644
index e4d28bb..0000000
--- a/wifi/aidl-export/android/net/wifi/p2p/nsd/WifiP2pServiceRequest.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2012 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.p2p.nsd;
-
-parcelable WifiP2pServiceRequest;
diff --git a/wifi/aidl-export/android/net/wifi/rtt/RangingRequest.aidl b/wifi/aidl-export/android/net/wifi/rtt/RangingRequest.aidl
deleted file mode 100644
index 8053c94..0000000
--- a/wifi/aidl-export/android/net/wifi/rtt/RangingRequest.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.rtt;
-
-parcelable RangingRequest;
diff --git a/wifi/aidl-export/android/net/wifi/rtt/RangingResult.aidl b/wifi/aidl-export/android/net/wifi/rtt/RangingResult.aidl
deleted file mode 100644
index ae295a6..0000000
--- a/wifi/aidl-export/android/net/wifi/rtt/RangingResult.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.rtt;
-
-parcelable RangingResult;
diff --git a/wifi/aidl-export/android/net/wifi/rtt/ResponderConfig.aidl b/wifi/aidl-export/android/net/wifi/rtt/ResponderConfig.aidl
deleted file mode 100644
index fd3988a..0000000
--- a/wifi/aidl-export/android/net/wifi/rtt/ResponderConfig.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.rtt;
-
-parcelable ResponderConfig;
diff --git a/wifi/api/current.txt b/wifi/api/current.txt
deleted file mode 100644
index 1ece79a..0000000
--- a/wifi/api/current.txt
+++ /dev/null
@@ -1,1259 +0,0 @@
-// Signature format: 2.0
-package android.net.wifi {
-
- public abstract class EasyConnectStatusCallback {
- field public static final int EASY_CONNECT_EVENT_FAILURE_AUTHENTICATION = -2; // 0xfffffffe
- field public static final int EASY_CONNECT_EVENT_FAILURE_BUSY = -5; // 0xfffffffb
- field public static final int EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK = -10; // 0xfffffff6
- field public static final int EASY_CONNECT_EVENT_FAILURE_CONFIGURATION = -4; // 0xfffffffc
- field public static final int EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION = -11; // 0xfffffff5
- field public static final int EASY_CONNECT_EVENT_FAILURE_ENROLLEE_REJECTED_CONFIGURATION = -12; // 0xfffffff4
- field public static final int EASY_CONNECT_EVENT_FAILURE_GENERIC = -7; // 0xfffffff9
- field public static final int EASY_CONNECT_EVENT_FAILURE_INVALID_NETWORK = -9; // 0xfffffff7
- field public static final int EASY_CONNECT_EVENT_FAILURE_INVALID_URI = -1; // 0xffffffff
- field public static final int EASY_CONNECT_EVENT_FAILURE_NOT_COMPATIBLE = -3; // 0xfffffffd
- field public static final int EASY_CONNECT_EVENT_FAILURE_NOT_SUPPORTED = -8; // 0xfffffff8
- field public static final int EASY_CONNECT_EVENT_FAILURE_TIMEOUT = -6; // 0xfffffffa
- field public static final int EASY_CONNECT_EVENT_FAILURE_URI_GENERATION = -13; // 0xfffffff3
- }
-
- public final class ScanResult implements android.os.Parcelable {
- ctor public ScanResult(@NonNull android.net.wifi.ScanResult);
- ctor public ScanResult();
- method public int describeContents();
- method @NonNull public java.util.List<android.net.wifi.ScanResult.InformationElement> getInformationElements();
- method public int getWifiStandard();
- method public boolean is80211mcResponder();
- method public boolean isPasspointNetwork();
- method public void writeToParcel(android.os.Parcel, int);
- field public String BSSID;
- field public static final int CHANNEL_WIDTH_160MHZ = 3; // 0x3
- field public static final int CHANNEL_WIDTH_20MHZ = 0; // 0x0
- field public static final int CHANNEL_WIDTH_40MHZ = 1; // 0x1
- field public static final int CHANNEL_WIDTH_80MHZ = 2; // 0x2
- field public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 4; // 0x4
- 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
- field public static final int WIFI_STANDARD_UNKNOWN = 0; // 0x0
- field public String capabilities;
- field public int centerFreq0;
- field public int centerFreq1;
- field public int channelWidth;
- field public int frequency;
- field public int level;
- field public CharSequence operatorFriendlyName;
- field public long timestamp;
- field public CharSequence venueName;
- }
-
- public static class ScanResult.InformationElement {
- ctor public ScanResult.InformationElement(@NonNull android.net.wifi.ScanResult.InformationElement);
- method @NonNull public java.nio.ByteBuffer getBytes();
- method public int getId();
- method public int getIdExt();
- }
-
- public final class SoftApConfiguration implements android.os.Parcelable {
- method public int describeContents();
- method @Nullable public android.net.MacAddress getBssid();
- method @Nullable public String getPassphrase();
- method public int getSecurityType();
- method @Nullable public String getSsid();
- method public boolean isHiddenSsid();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.SoftApConfiguration> CREATOR;
- field public static final int SECURITY_TYPE_OPEN = 0; // 0x0
- field public static final int SECURITY_TYPE_WPA2_PSK = 1; // 0x1
- field public static final int SECURITY_TYPE_WPA3_SAE = 3; // 0x3
- field public static final int SECURITY_TYPE_WPA3_SAE_TRANSITION = 2; // 0x2
- }
-
- public enum SupplicantState implements android.os.Parcelable {
- method public int describeContents();
- method public static boolean isValidState(android.net.wifi.SupplicantState);
- method public void writeToParcel(android.os.Parcel, int);
- enum_constant public static final android.net.wifi.SupplicantState ASSOCIATED;
- enum_constant public static final android.net.wifi.SupplicantState ASSOCIATING;
- enum_constant public static final android.net.wifi.SupplicantState AUTHENTICATING;
- enum_constant public static final android.net.wifi.SupplicantState COMPLETED;
- enum_constant public static final android.net.wifi.SupplicantState DISCONNECTED;
- enum_constant public static final android.net.wifi.SupplicantState DORMANT;
- enum_constant public static final android.net.wifi.SupplicantState FOUR_WAY_HANDSHAKE;
- enum_constant public static final android.net.wifi.SupplicantState GROUP_HANDSHAKE;
- enum_constant public static final android.net.wifi.SupplicantState INACTIVE;
- enum_constant public static final android.net.wifi.SupplicantState INTERFACE_DISABLED;
- enum_constant public static final android.net.wifi.SupplicantState INVALID;
- enum_constant public static final android.net.wifi.SupplicantState SCANNING;
- enum_constant public static final android.net.wifi.SupplicantState UNINITIALIZED;
- }
-
- @Deprecated public class WifiConfiguration implements android.os.Parcelable {
- ctor @Deprecated public WifiConfiguration();
- ctor @Deprecated public WifiConfiguration(@NonNull android.net.wifi.WifiConfiguration);
- method public int describeContents();
- method @Deprecated public android.net.ProxyInfo getHttpProxy();
- method @Deprecated @NonNull public String getKey();
- method @Deprecated @NonNull public android.net.MacAddress getRandomizedMacAddress();
- method @Deprecated public boolean isPasspoint();
- method @Deprecated public void setHttpProxy(android.net.ProxyInfo);
- method @Deprecated public void setSecurityParams(int);
- method public void writeToParcel(android.os.Parcel, int);
- field @Deprecated public String BSSID;
- field @Deprecated public String FQDN;
- field @Deprecated public static final int SECURITY_TYPE_EAP = 3; // 0x3
- field @Deprecated public static final int SECURITY_TYPE_EAP_SUITE_B = 5; // 0x5
- field @Deprecated public static final int SECURITY_TYPE_EAP_WPA3_ENTERPRISE = 9; // 0x9
- field @Deprecated public static final int SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT = 5; // 0x5
- field @Deprecated public static final int SECURITY_TYPE_OPEN = 0; // 0x0
- field @Deprecated public static final int SECURITY_TYPE_OWE = 6; // 0x6
- field @Deprecated public static final int SECURITY_TYPE_PSK = 2; // 0x2
- field @Deprecated public static final int SECURITY_TYPE_SAE = 4; // 0x4
- field @Deprecated public static final int SECURITY_TYPE_WAPI_CERT = 8; // 0x8
- field @Deprecated public static final int SECURITY_TYPE_WAPI_PSK = 7; // 0x7
- field @Deprecated public static final int SECURITY_TYPE_WEP = 1; // 0x1
- field @Deprecated public String SSID;
- field @Deprecated @NonNull public java.util.BitSet allowedAuthAlgorithms;
- field @Deprecated @NonNull public java.util.BitSet allowedGroupCiphers;
- field @Deprecated @NonNull public java.util.BitSet allowedGroupManagementCiphers;
- field @Deprecated @NonNull public java.util.BitSet allowedKeyManagement;
- field @Deprecated @NonNull public java.util.BitSet allowedPairwiseCiphers;
- field @Deprecated @NonNull public java.util.BitSet allowedProtocols;
- field @Deprecated @NonNull public java.util.BitSet allowedSuiteBCiphers;
- field @Deprecated public android.net.wifi.WifiEnterpriseConfig enterpriseConfig;
- field @Deprecated public boolean hiddenSSID;
- field @Deprecated public boolean isHomeProviderNetwork;
- field @Deprecated public int networkId;
- field @Deprecated public String preSharedKey;
- field @Deprecated public int priority;
- field @Deprecated public String providerFriendlyName;
- field @Deprecated public long[] roamingConsortiumIds;
- field @Deprecated public int status;
- field @Deprecated public String[] wepKeys;
- field @Deprecated public int wepTxKeyIndex;
- }
-
- @Deprecated public static class WifiConfiguration.AuthAlgorithm {
- field @Deprecated public static final int LEAP = 2; // 0x2
- field @Deprecated public static final int OPEN = 0; // 0x0
- field @Deprecated public static final int SAE = 3; // 0x3
- field @Deprecated public static final int SHARED = 1; // 0x1
- field @Deprecated public static final String[] strings;
- field @Deprecated public static final String varName = "auth_alg";
- }
-
- @Deprecated public static class WifiConfiguration.GroupCipher {
- field @Deprecated public static final int CCMP = 3; // 0x3
- field @Deprecated public static final int GCMP_128 = 7; // 0x7
- field @Deprecated public static final int GCMP_256 = 5; // 0x5
- field @Deprecated public static final int SMS4 = 6; // 0x6
- field @Deprecated public static final int TKIP = 2; // 0x2
- field @Deprecated public static final int WEP104 = 1; // 0x1
- field @Deprecated public static final int WEP40 = 0; // 0x0
- field @Deprecated public static final String[] strings;
- field @Deprecated public static final String varName = "group";
- }
-
- @Deprecated public static class WifiConfiguration.GroupMgmtCipher {
- field @Deprecated public static final int BIP_CMAC_256 = 0; // 0x0
- field @Deprecated public static final int BIP_GMAC_128 = 1; // 0x1
- field @Deprecated public static final int BIP_GMAC_256 = 2; // 0x2
- }
-
- @Deprecated public static class WifiConfiguration.KeyMgmt {
- field @Deprecated public static final int IEEE8021X = 3; // 0x3
- field @Deprecated public static final int NONE = 0; // 0x0
- field @Deprecated public static final int OWE = 9; // 0x9
- field @Deprecated public static final int SAE = 8; // 0x8
- field @Deprecated public static final int SUITE_B_192 = 10; // 0xa
- field @Deprecated public static final int WPA_EAP = 2; // 0x2
- field @Deprecated public static final int WPA_PSK = 1; // 0x1
- field @Deprecated public static final String[] strings;
- field @Deprecated public static final String varName = "key_mgmt";
- }
-
- @Deprecated public static class WifiConfiguration.PairwiseCipher {
- field @Deprecated public static final int CCMP = 2; // 0x2
- field @Deprecated public static final int GCMP_128 = 5; // 0x5
- field @Deprecated public static final int GCMP_256 = 3; // 0x3
- field @Deprecated public static final int NONE = 0; // 0x0
- field @Deprecated public static final int SMS4 = 4; // 0x4
- field @Deprecated public static final int TKIP = 1; // 0x1
- field @Deprecated public static final String[] strings;
- field @Deprecated public static final String varName = "pairwise";
- }
-
- @Deprecated public static class WifiConfiguration.Protocol {
- field @Deprecated public static final int RSN = 1; // 0x1
- field @Deprecated public static final int WAPI = 3; // 0x3
- field @Deprecated public static final int WPA = 0; // 0x0
- field @Deprecated public static final String[] strings;
- field @Deprecated public static final String varName = "proto";
- }
-
- @Deprecated public static class WifiConfiguration.Status {
- field @Deprecated public static final int CURRENT = 0; // 0x0
- field @Deprecated public static final int DISABLED = 1; // 0x1
- field @Deprecated public static final int ENABLED = 2; // 0x2
- field @Deprecated public static final String[] strings;
- }
-
- public class WifiEnterpriseConfig implements android.os.Parcelable {
- ctor public WifiEnterpriseConfig();
- ctor public WifiEnterpriseConfig(android.net.wifi.WifiEnterpriseConfig);
- method public int describeContents();
- method public String getAltSubjectMatch();
- method public String getAnonymousIdentity();
- method @Nullable public java.security.cert.X509Certificate getCaCertificate();
- method @Nullable public java.security.cert.X509Certificate[] getCaCertificates();
- method public java.security.cert.X509Certificate getClientCertificate();
- method @Nullable public java.security.cert.X509Certificate[] getClientCertificateChain();
- method @Nullable public java.security.PrivateKey getClientPrivateKey();
- method public String getDomainSuffixMatch();
- method public int getEapMethod();
- method public String getIdentity();
- method public String getPassword();
- method public int getPhase2Method();
- method public String getPlmn();
- method public String getRealm();
- method @Deprecated public String getSubjectMatch();
- method public boolean isAuthenticationSimBased();
- method public void setAltSubjectMatch(String);
- method public void setAnonymousIdentity(String);
- method public void setCaCertificate(@Nullable java.security.cert.X509Certificate);
- method public void setCaCertificates(@Nullable java.security.cert.X509Certificate[]);
- method public void setClientKeyEntry(java.security.PrivateKey, java.security.cert.X509Certificate);
- method public void setClientKeyEntryWithCertificateChain(java.security.PrivateKey, java.security.cert.X509Certificate[]);
- method public void setDomainSuffixMatch(String);
- method public void setEapMethod(int);
- method public void setIdentity(String);
- method public void setPassword(String);
- method public void setPhase2Method(int);
- method public void setPlmn(String);
- method public void setRealm(String);
- method @Deprecated public void setSubjectMatch(String);
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiEnterpriseConfig> CREATOR;
- field public static final String EXTRA_WAPI_AS_CERTIFICATE_DATA = "android.net.wifi.extra.WAPI_AS_CERTIFICATE_DATA";
- field public static final String EXTRA_WAPI_AS_CERTIFICATE_NAME = "android.net.wifi.extra.WAPI_AS_CERTIFICATE_NAME";
- field public static final String EXTRA_WAPI_USER_CERTIFICATE_DATA = "android.net.wifi.extra.WAPI_USER_CERTIFICATE_DATA";
- field public static final String EXTRA_WAPI_USER_CERTIFICATE_NAME = "android.net.wifi.extra.WAPI_USER_CERTIFICATE_NAME";
- field public static final String WAPI_AS_CERTIFICATE = "WAPIAS_";
- field public static final String WAPI_USER_CERTIFICATE = "WAPIUSR_";
- }
-
- public static final class WifiEnterpriseConfig.Eap {
- field public static final int AKA = 5; // 0x5
- field public static final int AKA_PRIME = 6; // 0x6
- field public static final int NONE = -1; // 0xffffffff
- field public static final int PEAP = 0; // 0x0
- field public static final int PWD = 3; // 0x3
- field public static final int SIM = 4; // 0x4
- field public static final int TLS = 1; // 0x1
- field public static final int TTLS = 2; // 0x2
- field public static final int UNAUTH_TLS = 7; // 0x7
- field public static final int WAPI_CERT = 8; // 0x8
- }
-
- public static final class WifiEnterpriseConfig.Phase2 {
- field public static final int AKA = 6; // 0x6
- field public static final int AKA_PRIME = 7; // 0x7
- field public static final int GTC = 4; // 0x4
- field public static final int MSCHAP = 2; // 0x2
- field public static final int MSCHAPV2 = 3; // 0x3
- field public static final int NONE = 0; // 0x0
- field public static final int PAP = 1; // 0x1
- field public static final int SIM = 5; // 0x5
- }
-
- public class WifiInfo implements android.os.Parcelable {
- method public int describeContents();
- method public String getBSSID();
- method public static android.net.NetworkInfo.DetailedState getDetailedStateOf(android.net.wifi.SupplicantState);
- method public int getFrequency();
- method public boolean getHiddenSSID();
- method public int getIpAddress();
- method public int getLinkSpeed();
- method public String getMacAddress();
- method public int getMaxSupportedRxLinkSpeedMbps();
- method public int getMaxSupportedTxLinkSpeedMbps();
- method public int getNetworkId();
- method @Nullable public String getPasspointFqdn();
- method @Nullable public String getPasspointProviderFriendlyName();
- method public int getRssi();
- method @IntRange(from=0xffffffff) public int getRxLinkSpeedMbps();
- method public String getSSID();
- method public android.net.wifi.SupplicantState getSupplicantState();
- method @IntRange(from=0xffffffff) public int getTxLinkSpeedMbps();
- method public int getWifiStandard();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final String FREQUENCY_UNITS = "MHz";
- field public static final String LINK_SPEED_UNITS = "Mbps";
- field public static final int LINK_SPEED_UNKNOWN = -1; // 0xffffffff
- }
-
- public static final class WifiInfo.Builder {
- ctor public WifiInfo.Builder();
- method @NonNull public android.net.wifi.WifiInfo build();
- method @NonNull public android.net.wifi.WifiInfo.Builder setBssid(@NonNull String);
- method @NonNull public android.net.wifi.WifiInfo.Builder setNetworkId(int);
- method @NonNull public android.net.wifi.WifiInfo.Builder setRssi(int);
- method @NonNull public android.net.wifi.WifiInfo.Builder setSsid(@NonNull byte[]);
- }
-
- public class WifiManager {
- method @Deprecated public int addNetwork(android.net.wifi.WifiConfiguration);
- method @RequiresPermission(android.Manifest.permission.CHANGE_WIFI_STATE) public int addNetworkSuggestions(@NonNull java.util.List<android.net.wifi.WifiNetworkSuggestion>);
- method public void addOrUpdatePasspointConfiguration(android.net.wifi.hotspot2.PasspointConfiguration);
- method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_WIFI_STATE}) public void addSuggestionConnectionStatusListener(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.SuggestionConnectionStatusListener);
- method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public boolean addSuggestionUserApprovalStatusListener(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.SuggestionUserApprovalStatusListener);
- method @Deprecated public static int calculateSignalLevel(int, int);
- method @IntRange(from=0) public int calculateSignalLevel(int);
- method @Deprecated public void cancelWps(android.net.wifi.WifiManager.WpsCallback);
- method public static int compareSignalLevel(int, int);
- method public android.net.wifi.WifiManager.MulticastLock createMulticastLock(String);
- method public android.net.wifi.WifiManager.WifiLock createWifiLock(int, String);
- method @Deprecated public android.net.wifi.WifiManager.WifiLock createWifiLock(String);
- method @Deprecated public boolean disableNetwork(int);
- method @Deprecated public boolean disconnect();
- method @Deprecated public boolean enableNetwork(int, boolean);
- method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_WIFI_STATE}) public java.util.List<android.net.wifi.WifiConfiguration> getConfiguredNetworks();
- method public android.net.wifi.WifiInfo getConnectionInfo();
- method public android.net.DhcpInfo getDhcpInfo();
- method public int getMaxNumberOfNetworkSuggestionsPerApp();
- method @IntRange(from=0) public int getMaxSignalLevel();
- method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public int getNetworkSuggestionUserApprovalStatus();
- method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public java.util.List<android.net.wifi.WifiNetworkSuggestion> getNetworkSuggestions();
- method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public java.util.List<android.net.wifi.hotspot2.PasspointConfiguration> getPasspointConfigurations();
- method public java.util.List<android.net.wifi.ScanResult> getScanResults();
- method public int getWifiState();
- method public boolean is5GHzBandSupported();
- method public boolean is6GHzBandSupported();
- method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public boolean isAutoWakeupEnabled();
- method public boolean isBridgedApConcurrencySupported();
- method @Deprecated public boolean isDeviceToApRttSupported();
- method public boolean isEasyConnectSupported();
- method public boolean isEnhancedOpenSupported();
- method public boolean isEnhancedPowerReportingSupported();
- method public boolean isMultiStaConcurrencySupported();
- method public boolean isP2pSupported();
- method public boolean isPreferredNetworkOffloadSupported();
- method @Deprecated public boolean isScanAlwaysAvailable();
- method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public boolean isScanThrottleEnabled();
- method public boolean isStaApConcurrencySupported();
- method public boolean isStaBridgedApConcurrencySupported();
- method public boolean isTdlsSupported();
- method public boolean isWapiSupported();
- method public boolean isWifiEnabled();
- method public boolean isWifiStandardSupported(int);
- method public boolean isWpa3ApValidationSupported();
- method public boolean isWpa3SaeSupported();
- method public boolean isWpa3SuiteBSupported();
- method @Deprecated public boolean pingSupplicant();
- method @Deprecated public boolean reassociate();
- method @Deprecated public boolean reconnect();
- method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public void registerScanResultsCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.ScanResultsCallback);
- method @Deprecated public boolean removeNetwork(int);
- method @RequiresPermission(android.Manifest.permission.CHANGE_WIFI_STATE) public int removeNetworkSuggestions(@NonNull java.util.List<android.net.wifi.WifiNetworkSuggestion>);
- method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_CARRIER_PROVISIONING}) public void removePasspointConfiguration(String);
- method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public void removeSuggestionConnectionStatusListener(@NonNull android.net.wifi.WifiManager.SuggestionConnectionStatusListener);
- method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public void removeSuggestionUserApprovalStatusListener(@NonNull android.net.wifi.WifiManager.SuggestionUserApprovalStatusListener);
- method @Deprecated public boolean saveConfiguration();
- method public void setTdlsEnabled(java.net.InetAddress, boolean);
- method public void setTdlsEnabledWithMacAddress(String, boolean);
- method @Deprecated public boolean setWifiEnabled(boolean);
- method @RequiresPermission(allOf={android.Manifest.permission.CHANGE_WIFI_STATE, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback, @Nullable android.os.Handler);
- method @Deprecated public boolean startScan();
- method @Deprecated public void startWps(android.net.wifi.WpsInfo, android.net.wifi.WifiManager.WpsCallback);
- method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public void unregisterScanResultsCallback(@NonNull android.net.wifi.WifiManager.ScanResultsCallback);
- method @Deprecated public int updateNetwork(android.net.wifi.WifiConfiguration);
- field public static final String ACTION_PICK_WIFI_NETWORK = "android.net.wifi.PICK_WIFI_NETWORK";
- field public static final String ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE = "android.net.wifi.action.REQUEST_SCAN_ALWAYS_AVAILABLE";
- field public static final String ACTION_WIFI_NETWORK_SUGGESTION_POST_CONNECTION = "android.net.wifi.action.WIFI_NETWORK_SUGGESTION_POST_CONNECTION";
- field public static final String ACTION_WIFI_SCAN_AVAILABILITY_CHANGED = "android.net.wifi.action.WIFI_SCAN_AVAILABILITY_CHANGED";
- field @Deprecated public static final int ERROR_AUTHENTICATING = 1; // 0x1
- field @Deprecated public static final String EXTRA_BSSID = "bssid";
- field public static final String EXTRA_NETWORK_INFO = "networkInfo";
- field public static final String EXTRA_NETWORK_SUGGESTION = "android.net.wifi.extra.NETWORK_SUGGESTION";
- field public static final String EXTRA_NEW_RSSI = "newRssi";
- field @Deprecated public static final String EXTRA_NEW_STATE = "newState";
- field public static final String EXTRA_PREVIOUS_WIFI_STATE = "previous_wifi_state";
- field public static final String EXTRA_RESULTS_UPDATED = "resultsUpdated";
- field public static final String EXTRA_SCAN_AVAILABLE = "android.net.wifi.extra.SCAN_AVAILABLE";
- field @Deprecated public static final String EXTRA_SUPPLICANT_CONNECTED = "connected";
- field @Deprecated public static final String EXTRA_SUPPLICANT_ERROR = "supplicantError";
- field @Deprecated public static final String EXTRA_WIFI_INFO = "wifiInfo";
- field public static final String EXTRA_WIFI_STATE = "wifi_state";
- field public static final String NETWORK_IDS_CHANGED_ACTION = "android.net.wifi.NETWORK_IDS_CHANGED";
- field public static final String NETWORK_STATE_CHANGED_ACTION = "android.net.wifi.STATE_CHANGE";
- field public static final String RSSI_CHANGED_ACTION = "android.net.wifi.RSSI_CHANGED";
- field public static final String SCAN_RESULTS_AVAILABLE_ACTION = "android.net.wifi.SCAN_RESULTS";
- field public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_DUPLICATE = 3; // 0x3
- field public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_EXCEEDS_MAX_PER_APP = 4; // 0x4
- field public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_INVALID = 7; // 0x7
- field public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_NOT_ALLOWED = 6; // 0x6
- field public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_APP_DISALLOWED = 2; // 0x2
- field public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_INTERNAL = 1; // 0x1
- field public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_REMOVE_INVALID = 5; // 0x5
- field public static final int STATUS_NETWORK_SUGGESTIONS_SUCCESS = 0; // 0x0
- field public static final int STATUS_SUGGESTION_APPROVAL_APPROVED_BY_CARRIER_PRIVILEGE = 4; // 0x4
- field public static final int STATUS_SUGGESTION_APPROVAL_APPROVED_BY_USER = 2; // 0x2
- field public static final int STATUS_SUGGESTION_APPROVAL_PENDING = 1; // 0x1
- field public static final int STATUS_SUGGESTION_APPROVAL_REJECTED_BY_USER = 3; // 0x3
- field public static final int STATUS_SUGGESTION_APPROVAL_UNKNOWN = 0; // 0x0
- field public static final int STATUS_SUGGESTION_CONNECTION_FAILURE_ASSOCIATION = 1; // 0x1
- field public static final int STATUS_SUGGESTION_CONNECTION_FAILURE_AUTHENTICATION = 2; // 0x2
- field public static final int STATUS_SUGGESTION_CONNECTION_FAILURE_IP_PROVISIONING = 3; // 0x3
- field public static final int STATUS_SUGGESTION_CONNECTION_FAILURE_UNKNOWN = 0; // 0x0
- field @Deprecated public static final String SUPPLICANT_CONNECTION_CHANGE_ACTION = "android.net.wifi.supplicant.CONNECTION_CHANGE";
- field @Deprecated public static final String SUPPLICANT_STATE_CHANGED_ACTION = "android.net.wifi.supplicant.STATE_CHANGE";
- field public static final String UNKNOWN_SSID = "<unknown ssid>";
- field @Deprecated public static final int WIFI_MODE_FULL = 1; // 0x1
- field public static final int WIFI_MODE_FULL_HIGH_PERF = 3; // 0x3
- field public static final int WIFI_MODE_FULL_LOW_LATENCY = 4; // 0x4
- field @Deprecated public static final int WIFI_MODE_SCAN_ONLY = 2; // 0x2
- field public static final String WIFI_STATE_CHANGED_ACTION = "android.net.wifi.WIFI_STATE_CHANGED";
- field public static final int WIFI_STATE_DISABLED = 1; // 0x1
- field public static final int WIFI_STATE_DISABLING = 0; // 0x0
- field public static final int WIFI_STATE_ENABLED = 3; // 0x3
- field public static final int WIFI_STATE_ENABLING = 2; // 0x2
- field public static final int WIFI_STATE_UNKNOWN = 4; // 0x4
- field @Deprecated public static final int WPS_AUTH_FAILURE = 6; // 0x6
- field @Deprecated public static final int WPS_OVERLAP_ERROR = 3; // 0x3
- field @Deprecated public static final int WPS_TIMED_OUT = 7; // 0x7
- field @Deprecated public static final int WPS_TKIP_ONLY_PROHIBITED = 5; // 0x5
- field @Deprecated public static final int WPS_WEP_PROHIBITED = 4; // 0x4
- }
-
- public static class WifiManager.LocalOnlyHotspotCallback {
- ctor public WifiManager.LocalOnlyHotspotCallback();
- method public void onFailed(int);
- method public void onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation);
- method public void onStopped();
- field public static final int ERROR_GENERIC = 2; // 0x2
- field public static final int ERROR_INCOMPATIBLE_MODE = 3; // 0x3
- field public static final int ERROR_NO_CHANNEL = 1; // 0x1
- field public static final int ERROR_TETHERING_DISALLOWED = 4; // 0x4
- }
-
- public class WifiManager.LocalOnlyHotspotReservation implements java.lang.AutoCloseable {
- method public void close();
- method @NonNull public android.net.wifi.SoftApConfiguration getSoftApConfiguration();
- method @Deprecated @Nullable public android.net.wifi.WifiConfiguration getWifiConfiguration();
- }
-
- public class WifiManager.MulticastLock {
- method public void acquire();
- method public boolean isHeld();
- method public void release();
- method public void setReferenceCounted(boolean);
- }
-
- public abstract static class WifiManager.ScanResultsCallback {
- ctor public WifiManager.ScanResultsCallback();
- method public abstract void onScanResultsAvailable();
- }
-
- public static interface WifiManager.SuggestionConnectionStatusListener {
- method public void onConnectionStatus(@NonNull android.net.wifi.WifiNetworkSuggestion, int);
- }
-
- public static interface WifiManager.SuggestionUserApprovalStatusListener {
- method public void onUserApprovalStatusChange();
- }
-
- public class WifiManager.WifiLock {
- method public void acquire();
- method public boolean isHeld();
- method public void release();
- method public void setReferenceCounted(boolean);
- method public void setWorkSource(android.os.WorkSource);
- }
-
- @Deprecated public abstract static class WifiManager.WpsCallback {
- ctor @Deprecated public WifiManager.WpsCallback();
- method @Deprecated public abstract void onFailed(int);
- method @Deprecated public abstract void onStarted(String);
- method @Deprecated public abstract void onSucceeded();
- }
-
- public final class WifiNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiNetworkSpecifier> CREATOR;
- }
-
- public static final class WifiNetworkSpecifier.Builder {
- ctor public WifiNetworkSpecifier.Builder();
- method @NonNull public android.net.wifi.WifiNetworkSpecifier build();
- method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setBssid(@NonNull android.net.MacAddress);
- method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setBssidPattern(@NonNull android.net.MacAddress, @NonNull android.net.MacAddress);
- method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setIsEnhancedOpen(boolean);
- method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setIsHiddenSsid(boolean);
- method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setSsid(@NonNull String);
- method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setSsidPattern(@NonNull android.os.PatternMatcher);
- method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setWpa2EnterpriseConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
- method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setWpa2Passphrase(@NonNull String);
- method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setWpa3Enterprise192BitModeConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
- method @Deprecated @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setWpa3EnterpriseConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
- method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setWpa3EnterpriseStandardModeConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
- method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setWpa3Passphrase(@NonNull String);
- }
-
- public final class WifiNetworkSuggestion implements android.os.Parcelable {
- method public int describeContents();
- method @Nullable public android.net.MacAddress getBssid();
- method @Nullable public android.net.wifi.WifiEnterpriseConfig getEnterpriseConfig();
- method @Nullable public String getPassphrase();
- method @Nullable public android.net.wifi.hotspot2.PasspointConfiguration getPasspointConfig();
- method @IntRange(from=0) public int getPriority();
- method public int getPriorityGroup();
- method @Nullable public String getSsid();
- method public int getSubscriptionId();
- method public boolean isAppInteractionRequired();
- method public boolean isCarrierMerged();
- method public boolean isCredentialSharedWithUser();
- method public boolean isEnhancedOpen();
- method public boolean isHiddenSsid();
- method public boolean isInitialAutojoinEnabled();
- method public boolean isMetered();
- method public boolean isUntrusted();
- method public boolean isUserInteractionRequired();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiNetworkSuggestion> CREATOR;
- }
-
- public static final class WifiNetworkSuggestion.Builder {
- ctor public WifiNetworkSuggestion.Builder();
- method @NonNull public android.net.wifi.WifiNetworkSuggestion build();
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setBssid(@NonNull android.net.MacAddress);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setCarrierMerged(boolean);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setCredentialSharedWithUser(boolean);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsAppInteractionRequired(boolean);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsEnhancedMacRandomizationEnabled(boolean);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsEnhancedOpen(boolean);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsHiddenSsid(boolean);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsInitialAutojoinEnabled(boolean);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsMetered(boolean);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsUserInteractionRequired(boolean);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setPasspointConfig(@NonNull android.net.wifi.hotspot2.PasspointConfiguration);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setPriority(@IntRange(from=0) int);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setPriorityGroup(int);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setSsid(@NonNull String);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setSubscriptionId(int);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setUntrusted(boolean);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setWapiEnterpriseConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setWapiPassphrase(@NonNull String);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setWpa2EnterpriseConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setWpa2Passphrase(@NonNull String);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setWpa3Enterprise192BitModeConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
- method @Deprecated @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setWpa3EnterpriseConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setWpa3EnterpriseStandardModeConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setWpa3Passphrase(@NonNull String);
- }
-
- public class WpsInfo implements android.os.Parcelable {
- ctor public WpsInfo();
- ctor public WpsInfo(android.net.wifi.WpsInfo);
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
- field public String BSSID;
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WpsInfo> CREATOR;
- field public static final int DISPLAY = 1; // 0x1
- field public static final int INVALID = 4; // 0x4
- field public static final int KEYPAD = 2; // 0x2
- field public static final int LABEL = 3; // 0x3
- field public static final int PBC = 0; // 0x0
- field public String pin;
- field public int setup;
- }
-
-}
-
-package android.net.wifi.aware {
-
- public class AttachCallback {
- ctor public AttachCallback();
- method public void onAttachFailed();
- method public void onAttached(android.net.wifi.aware.WifiAwareSession);
- }
-
- public final class AwareResources implements android.os.Parcelable {
- method public int describeContents();
- method public int getNumOfAvailableDataPaths();
- method public int getNumOfAvailablePublishSessions();
- method public int getNumOfAvailableSubscribeSessions();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.aware.AwareResources> CREATOR;
- }
-
- public final class Characteristics implements android.os.Parcelable {
- method public int describeContents();
- method public int getMaxMatchFilterLength();
- method public int getMaxServiceNameLength();
- method public int getMaxServiceSpecificInfoLength();
- method public int getSupportedCipherSuites();
- method public boolean isInstantCommunicationModeSupported();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.aware.Characteristics> CREATOR;
- field public static final int WIFI_AWARE_CIPHER_SUITE_NCS_SK_128 = 1; // 0x1
- field public static final int WIFI_AWARE_CIPHER_SUITE_NCS_SK_256 = 2; // 0x2
- }
-
- public class DiscoverySession implements java.lang.AutoCloseable {
- method public void close();
- method @Deprecated public android.net.NetworkSpecifier createNetworkSpecifierOpen(@NonNull android.net.wifi.aware.PeerHandle);
- method @Deprecated public android.net.NetworkSpecifier createNetworkSpecifierPassphrase(@NonNull android.net.wifi.aware.PeerHandle, @NonNull String);
- method public void sendMessage(@NonNull android.net.wifi.aware.PeerHandle, int, @Nullable byte[]);
- }
-
- public class DiscoverySessionCallback {
- ctor public DiscoverySessionCallback();
- method public void onMessageReceived(android.net.wifi.aware.PeerHandle, byte[]);
- method public void onMessageSendFailed(int);
- method public void onMessageSendSucceeded(int);
- method public void onPublishStarted(@NonNull android.net.wifi.aware.PublishDiscoverySession);
- method public void onServiceDiscovered(android.net.wifi.aware.PeerHandle, byte[], java.util.List<byte[]>);
- method public void onServiceDiscoveredWithinRange(android.net.wifi.aware.PeerHandle, byte[], java.util.List<byte[]>, int);
- method public void onServiceLost(@NonNull android.net.wifi.aware.PeerHandle, int);
- method public void onSessionConfigFailed();
- method public void onSessionConfigUpdated();
- method public void onSessionTerminated();
- method public void onSubscribeStarted(@NonNull android.net.wifi.aware.SubscribeDiscoverySession);
- }
-
- public class IdentityChangedListener {
- ctor public IdentityChangedListener();
- method public void onIdentityChanged(byte[]);
- }
-
- public final class ParcelablePeerHandle extends android.net.wifi.aware.PeerHandle implements android.os.Parcelable {
- ctor public ParcelablePeerHandle(@NonNull android.net.wifi.aware.PeerHandle);
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.aware.ParcelablePeerHandle> CREATOR;
- }
-
- public class PeerHandle {
- }
-
- public final class PublishConfig implements android.os.Parcelable {
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.aware.PublishConfig> CREATOR;
- field public static final int PUBLISH_TYPE_SOLICITED = 1; // 0x1
- field public static final int PUBLISH_TYPE_UNSOLICITED = 0; // 0x0
- }
-
- public static final class PublishConfig.Builder {
- ctor public PublishConfig.Builder();
- method public android.net.wifi.aware.PublishConfig build();
- method public android.net.wifi.aware.PublishConfig.Builder setMatchFilter(@Nullable java.util.List<byte[]>);
- method public android.net.wifi.aware.PublishConfig.Builder setPublishType(int);
- method public android.net.wifi.aware.PublishConfig.Builder setRangingEnabled(boolean);
- method public android.net.wifi.aware.PublishConfig.Builder setServiceName(@NonNull String);
- method public android.net.wifi.aware.PublishConfig.Builder setServiceSpecificInfo(@Nullable byte[]);
- method public android.net.wifi.aware.PublishConfig.Builder setTerminateNotificationEnabled(boolean);
- method public android.net.wifi.aware.PublishConfig.Builder setTtlSec(int);
- }
-
- public class PublishDiscoverySession extends android.net.wifi.aware.DiscoverySession {
- method public void updatePublish(@NonNull android.net.wifi.aware.PublishConfig);
- }
-
- public final class SubscribeConfig implements android.os.Parcelable {
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.aware.SubscribeConfig> CREATOR;
- field public static final int SUBSCRIBE_TYPE_ACTIVE = 1; // 0x1
- field public static final int SUBSCRIBE_TYPE_PASSIVE = 0; // 0x0
- }
-
- public static final class SubscribeConfig.Builder {
- ctor public SubscribeConfig.Builder();
- method public android.net.wifi.aware.SubscribeConfig build();
- method public android.net.wifi.aware.SubscribeConfig.Builder setMatchFilter(@Nullable java.util.List<byte[]>);
- method public android.net.wifi.aware.SubscribeConfig.Builder setMaxDistanceMm(int);
- method public android.net.wifi.aware.SubscribeConfig.Builder setMinDistanceMm(int);
- method public android.net.wifi.aware.SubscribeConfig.Builder setServiceName(@NonNull String);
- method public android.net.wifi.aware.SubscribeConfig.Builder setServiceSpecificInfo(@Nullable byte[]);
- method public android.net.wifi.aware.SubscribeConfig.Builder setSubscribeType(int);
- method public android.net.wifi.aware.SubscribeConfig.Builder setTerminateNotificationEnabled(boolean);
- method public android.net.wifi.aware.SubscribeConfig.Builder setTtlSec(int);
- }
-
- public class SubscribeDiscoverySession extends android.net.wifi.aware.DiscoverySession {
- method public void updateSubscribe(@NonNull android.net.wifi.aware.SubscribeConfig);
- }
-
- public class WifiAwareManager {
- method public void attach(@NonNull android.net.wifi.aware.AttachCallback, @Nullable android.os.Handler);
- method public void attach(@NonNull android.net.wifi.aware.AttachCallback, @NonNull android.net.wifi.aware.IdentityChangedListener, @Nullable android.os.Handler);
- method @Nullable public android.net.wifi.aware.AwareResources getAvailableAwareResources();
- method @Nullable public android.net.wifi.aware.Characteristics getCharacteristics();
- method public boolean isAvailable();
- method public boolean isDeviceAttached();
- method public boolean isInstantCommunicationModeEnabled();
- field public static final String ACTION_WIFI_AWARE_STATE_CHANGED = "android.net.wifi.aware.action.WIFI_AWARE_STATE_CHANGED";
- field public static final int WIFI_AWARE_DATA_PATH_ROLE_INITIATOR = 0; // 0x0
- field public static final int WIFI_AWARE_DATA_PATH_ROLE_RESPONDER = 1; // 0x1
- field public static final int WIFI_AWARE_DISCOVERY_LOST_REASON_PEER_NOT_VISIBLE = 1; // 0x1
- field public static final int WIFI_AWARE_DISCOVERY_LOST_REASON_UNKNOWN = 0; // 0x0
- }
-
- public final class WifiAwareNetworkInfo implements android.os.Parcelable android.net.TransportInfo {
- method public int describeContents();
- method @Nullable public java.net.Inet6Address getPeerIpv6Addr();
- method public int getPort();
- method public int getTransportProtocol();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.aware.WifiAwareNetworkInfo> CREATOR;
- }
-
- public final class WifiAwareNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.aware.WifiAwareNetworkSpecifier> CREATOR;
- }
-
- public static final class WifiAwareNetworkSpecifier.Builder {
- ctor public WifiAwareNetworkSpecifier.Builder(@NonNull android.net.wifi.aware.DiscoverySession, @NonNull android.net.wifi.aware.PeerHandle);
- method @NonNull public android.net.wifi.aware.WifiAwareNetworkSpecifier build();
- method @NonNull public android.net.wifi.aware.WifiAwareNetworkSpecifier.Builder setPmk(@NonNull byte[]);
- method @NonNull public android.net.wifi.aware.WifiAwareNetworkSpecifier.Builder setPort(@IntRange(from=0, to=65535) int);
- method @NonNull public android.net.wifi.aware.WifiAwareNetworkSpecifier.Builder setPskPassphrase(@NonNull String);
- method @NonNull public android.net.wifi.aware.WifiAwareNetworkSpecifier.Builder setTransportProtocol(@IntRange(from=0, to=255) int);
- }
-
- public class WifiAwareSession implements java.lang.AutoCloseable {
- method public void close();
- method public android.net.NetworkSpecifier createNetworkSpecifierOpen(int, @NonNull byte[]);
- method public android.net.NetworkSpecifier createNetworkSpecifierPassphrase(int, @NonNull byte[], @NonNull String);
- method public void publish(@NonNull android.net.wifi.aware.PublishConfig, @NonNull android.net.wifi.aware.DiscoverySessionCallback, @Nullable android.os.Handler);
- method public void subscribe(@NonNull android.net.wifi.aware.SubscribeConfig, @NonNull android.net.wifi.aware.DiscoverySessionCallback, @Nullable android.os.Handler);
- }
-
-}
-
-package android.net.wifi.hotspot2 {
-
- public final class ConfigParser {
- method public static android.net.wifi.hotspot2.PasspointConfiguration parsePasspointConfig(String, byte[]);
- }
-
- public final class PasspointConfiguration implements android.os.Parcelable {
- ctor public PasspointConfiguration();
- ctor public PasspointConfiguration(android.net.wifi.hotspot2.PasspointConfiguration);
- method public int describeContents();
- method public android.net.wifi.hotspot2.pps.Credential getCredential();
- method public android.net.wifi.hotspot2.pps.HomeSp getHomeSp();
- method public long getSubscriptionExpirationTimeMillis();
- method @NonNull public String getUniqueId();
- method public boolean isOsuProvisioned();
- method public void setCredential(android.net.wifi.hotspot2.pps.Credential);
- method public void setHomeSp(android.net.wifi.hotspot2.pps.HomeSp);
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.hotspot2.PasspointConfiguration> CREATOR;
- }
-
-}
-
-package android.net.wifi.hotspot2.omadm {
-
- public final class PpsMoParser {
- method public static android.net.wifi.hotspot2.PasspointConfiguration parseMoText(String);
- }
-
-}
-
-package android.net.wifi.hotspot2.pps {
-
- public final class Credential implements android.os.Parcelable {
- ctor public Credential();
- ctor public Credential(android.net.wifi.hotspot2.pps.Credential);
- method public int describeContents();
- method public java.security.cert.X509Certificate getCaCertificate();
- method public android.net.wifi.hotspot2.pps.Credential.CertificateCredential getCertCredential();
- method public java.security.cert.X509Certificate[] getClientCertificateChain();
- method public java.security.PrivateKey getClientPrivateKey();
- method public String getRealm();
- method public android.net.wifi.hotspot2.pps.Credential.SimCredential getSimCredential();
- method public android.net.wifi.hotspot2.pps.Credential.UserCredential getUserCredential();
- method public void setCaCertificate(java.security.cert.X509Certificate);
- method public void setCertCredential(android.net.wifi.hotspot2.pps.Credential.CertificateCredential);
- method public void setClientCertificateChain(java.security.cert.X509Certificate[]);
- method public void setClientPrivateKey(java.security.PrivateKey);
- method public void setRealm(String);
- method public void setSimCredential(android.net.wifi.hotspot2.pps.Credential.SimCredential);
- method public void setUserCredential(android.net.wifi.hotspot2.pps.Credential.UserCredential);
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.hotspot2.pps.Credential> CREATOR;
- }
-
- public static final class Credential.CertificateCredential implements android.os.Parcelable {
- ctor public Credential.CertificateCredential();
- ctor public Credential.CertificateCredential(android.net.wifi.hotspot2.pps.Credential.CertificateCredential);
- method public int describeContents();
- method public byte[] getCertSha256Fingerprint();
- method public String getCertType();
- method public void setCertSha256Fingerprint(byte[]);
- method public void setCertType(String);
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.hotspot2.pps.Credential.CertificateCredential> CREATOR;
- }
-
- public static final class Credential.SimCredential implements android.os.Parcelable {
- ctor public Credential.SimCredential();
- ctor public Credential.SimCredential(android.net.wifi.hotspot2.pps.Credential.SimCredential);
- method public int describeContents();
- method public int getEapType();
- method public String getImsi();
- method public void setEapType(int);
- method public void setImsi(String);
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.hotspot2.pps.Credential.SimCredential> CREATOR;
- }
-
- public static final class Credential.UserCredential implements android.os.Parcelable {
- ctor public Credential.UserCredential();
- ctor public Credential.UserCredential(android.net.wifi.hotspot2.pps.Credential.UserCredential);
- method public int describeContents();
- method public int getEapType();
- method public String getNonEapInnerMethod();
- method public String getPassword();
- method public String getUsername();
- method public void setEapType(int);
- method public void setNonEapInnerMethod(String);
- method public void setPassword(String);
- method public void setUsername(String);
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.hotspot2.pps.Credential.UserCredential> CREATOR;
- }
-
- public final class HomeSp implements android.os.Parcelable {
- ctor public HomeSp();
- ctor public HomeSp(android.net.wifi.hotspot2.pps.HomeSp);
- method public int describeContents();
- method public String getFqdn();
- method public String getFriendlyName();
- method @Nullable public long[] getMatchAllOis();
- method @Nullable public long[] getMatchAnyOis();
- method @NonNull public java.util.Collection<java.lang.String> getOtherHomePartnersList();
- method public long[] getRoamingConsortiumOis();
- method public void setFqdn(String);
- method public void setFriendlyName(String);
- method public void setMatchAllOis(@Nullable long[]);
- method public void setMatchAnyOis(@Nullable long[]);
- method public void setOtherHomePartnersList(@NonNull java.util.Collection<java.lang.String>);
- method public void setRoamingConsortiumOis(long[]);
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.hotspot2.pps.HomeSp> CREATOR;
- }
-
-}
-
-package android.net.wifi.p2p {
-
- public class WifiP2pConfig implements android.os.Parcelable {
- ctor public WifiP2pConfig();
- ctor public WifiP2pConfig(android.net.wifi.p2p.WifiP2pConfig);
- method public int describeContents();
- method public int getGroupOwnerBand();
- method public int getNetworkId();
- method @Nullable public String getNetworkName();
- method @Nullable public String getPassphrase();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.p2p.WifiP2pConfig> CREATOR;
- field public static final int GROUP_OWNER_BAND_2GHZ = 1; // 0x1
- field public static final int GROUP_OWNER_BAND_5GHZ = 2; // 0x2
- field public static final int GROUP_OWNER_BAND_AUTO = 0; // 0x0
- field public static final int GROUP_OWNER_INTENT_AUTO = -1; // 0xffffffff
- field public static final int GROUP_OWNER_INTENT_MAX = 15; // 0xf
- field public static final int GROUP_OWNER_INTENT_MIN = 0; // 0x0
- field public String deviceAddress;
- field @IntRange(from=0, to=15) public int groupOwnerIntent;
- field public android.net.wifi.WpsInfo wps;
- }
-
- public static final class WifiP2pConfig.Builder {
- ctor public WifiP2pConfig.Builder();
- method @NonNull public android.net.wifi.p2p.WifiP2pConfig build();
- method @NonNull public android.net.wifi.p2p.WifiP2pConfig.Builder enablePersistentMode(boolean);
- method @NonNull public android.net.wifi.p2p.WifiP2pConfig.Builder setDeviceAddress(@Nullable android.net.MacAddress);
- method @NonNull public android.net.wifi.p2p.WifiP2pConfig.Builder setGroupOperatingBand(int);
- method @NonNull public android.net.wifi.p2p.WifiP2pConfig.Builder setGroupOperatingFrequency(int);
- method @NonNull public android.net.wifi.p2p.WifiP2pConfig.Builder setNetworkName(@NonNull String);
- method @NonNull public android.net.wifi.p2p.WifiP2pConfig.Builder setPassphrase(@NonNull String);
- }
-
- public class WifiP2pDevice implements android.os.Parcelable {
- ctor public WifiP2pDevice();
- ctor public WifiP2pDevice(android.net.wifi.p2p.WifiP2pDevice);
- method public int describeContents();
- method @Nullable public android.net.wifi.p2p.WifiP2pWfdInfo getWfdInfo();
- method public boolean isGroupOwner();
- method public boolean isServiceDiscoveryCapable();
- method public void update(@NonNull android.net.wifi.p2p.WifiP2pDevice);
- method public boolean wpsDisplaySupported();
- method public boolean wpsKeypadSupported();
- method public boolean wpsPbcSupported();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final int AVAILABLE = 3; // 0x3
- field public static final int CONNECTED = 0; // 0x0
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.p2p.WifiP2pDevice> CREATOR;
- field public static final int FAILED = 2; // 0x2
- field public static final int INVITED = 1; // 0x1
- field public static final int UNAVAILABLE = 4; // 0x4
- field public String deviceAddress;
- field public String deviceName;
- field public String primaryDeviceType;
- field public String secondaryDeviceType;
- field public int status;
- }
-
- public class WifiP2pDeviceList implements android.os.Parcelable {
- ctor public WifiP2pDeviceList();
- ctor public WifiP2pDeviceList(android.net.wifi.p2p.WifiP2pDeviceList);
- method public int describeContents();
- method public android.net.wifi.p2p.WifiP2pDevice get(String);
- method public java.util.Collection<android.net.wifi.p2p.WifiP2pDevice> getDeviceList();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.p2p.WifiP2pDeviceList> CREATOR;
- }
-
- public class WifiP2pGroup implements android.os.Parcelable {
- ctor public WifiP2pGroup();
- ctor public WifiP2pGroup(android.net.wifi.p2p.WifiP2pGroup);
- method public int describeContents();
- method public java.util.Collection<android.net.wifi.p2p.WifiP2pDevice> getClientList();
- method public int getFrequency();
- method public String getInterface();
- method public int getNetworkId();
- method public String getNetworkName();
- method public android.net.wifi.p2p.WifiP2pDevice getOwner();
- method public String getPassphrase();
- method public boolean isGroupOwner();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.p2p.WifiP2pGroup> CREATOR;
- field public static final int NETWORK_ID_PERSISTENT = -2; // 0xfffffffe
- field public static final int NETWORK_ID_TEMPORARY = -1; // 0xffffffff
- }
-
- public class WifiP2pInfo implements android.os.Parcelable {
- ctor public WifiP2pInfo();
- ctor public WifiP2pInfo(android.net.wifi.p2p.WifiP2pInfo);
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.p2p.WifiP2pInfo> CREATOR;
- field public boolean groupFormed;
- field public java.net.InetAddress groupOwnerAddress;
- field public boolean isGroupOwner;
- }
-
- public class WifiP2pManager {
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void addLocalService(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.nsd.WifiP2pServiceInfo, android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method public void addServiceRequest(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.nsd.WifiP2pServiceRequest, android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method public void cancelConnect(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method public void clearLocalServices(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method public void clearServiceRequests(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void connect(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pConfig, android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void createGroup(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void createGroup(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @Nullable android.net.wifi.p2p.WifiP2pConfig, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void discoverPeers(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void discoverServices(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method public android.net.wifi.p2p.WifiP2pManager.Channel initialize(android.content.Context, android.os.Looper, android.net.wifi.p2p.WifiP2pManager.ChannelListener);
- method public void removeGroup(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method public void removeLocalService(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.nsd.WifiP2pServiceInfo, android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method public void removeServiceRequest(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.nsd.WifiP2pServiceRequest, android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method public void requestConnectionInfo(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ConnectionInfoListener);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void requestDeviceInfo(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @NonNull android.net.wifi.p2p.WifiP2pManager.DeviceInfoListener);
- method public void requestDiscoveryState(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @NonNull android.net.wifi.p2p.WifiP2pManager.DiscoveryStateListener);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void requestGroupInfo(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.GroupInfoListener);
- method public void requestNetworkInfo(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @NonNull android.net.wifi.p2p.WifiP2pManager.NetworkInfoListener);
- method public void requestP2pState(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @NonNull android.net.wifi.p2p.WifiP2pManager.P2pStateListener);
- method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void requestPeers(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.PeerListListener);
- method public void setDnsSdResponseListeners(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.DnsSdServiceResponseListener, android.net.wifi.p2p.WifiP2pManager.DnsSdTxtRecordListener);
- method public void setServiceResponseListener(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ServiceResponseListener);
- method public void setUpnpServiceResponseListener(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.UpnpServiceResponseListener);
- method public void stopPeerDiscovery(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener);
- field public static final int BUSY = 2; // 0x2
- field public static final int ERROR = 0; // 0x0
- field public static final String EXTRA_DISCOVERY_STATE = "discoveryState";
- field public static final String EXTRA_NETWORK_INFO = "networkInfo";
- field public static final String EXTRA_P2P_DEVICE_LIST = "wifiP2pDeviceList";
- field public static final String EXTRA_WIFI_P2P_DEVICE = "wifiP2pDevice";
- field public static final String EXTRA_WIFI_P2P_GROUP = "p2pGroupInfo";
- field public static final String EXTRA_WIFI_P2P_INFO = "wifiP2pInfo";
- field public static final String EXTRA_WIFI_STATE = "wifi_p2p_state";
- field public static final int NO_SERVICE_REQUESTS = 3; // 0x3
- field public static final int P2P_UNSUPPORTED = 1; // 0x1
- field public static final String WIFI_P2P_CONNECTION_CHANGED_ACTION = "android.net.wifi.p2p.CONNECTION_STATE_CHANGE";
- field public static final String WIFI_P2P_DISCOVERY_CHANGED_ACTION = "android.net.wifi.p2p.DISCOVERY_STATE_CHANGE";
- field public static final int WIFI_P2P_DISCOVERY_STARTED = 2; // 0x2
- field public static final int WIFI_P2P_DISCOVERY_STOPPED = 1; // 0x1
- field public static final String WIFI_P2P_PEERS_CHANGED_ACTION = "android.net.wifi.p2p.PEERS_CHANGED";
- field public static final String WIFI_P2P_STATE_CHANGED_ACTION = "android.net.wifi.p2p.STATE_CHANGED";
- field public static final int WIFI_P2P_STATE_DISABLED = 1; // 0x1
- field public static final int WIFI_P2P_STATE_ENABLED = 2; // 0x2
- field public static final String WIFI_P2P_THIS_DEVICE_CHANGED_ACTION = "android.net.wifi.p2p.THIS_DEVICE_CHANGED";
- }
-
- public static interface WifiP2pManager.ActionListener {
- method public void onFailure(int);
- method public void onSuccess();
- }
-
- public static class WifiP2pManager.Channel implements java.lang.AutoCloseable {
- method public void close();
- }
-
- public static interface WifiP2pManager.ChannelListener {
- method public void onChannelDisconnected();
- }
-
- public static interface WifiP2pManager.ConnectionInfoListener {
- method public void onConnectionInfoAvailable(android.net.wifi.p2p.WifiP2pInfo);
- }
-
- public static interface WifiP2pManager.DeviceInfoListener {
- method public void onDeviceInfoAvailable(@Nullable android.net.wifi.p2p.WifiP2pDevice);
- }
-
- public static interface WifiP2pManager.DiscoveryStateListener {
- method public void onDiscoveryStateAvailable(int);
- }
-
- public static interface WifiP2pManager.DnsSdServiceResponseListener {
- method public void onDnsSdServiceAvailable(String, String, android.net.wifi.p2p.WifiP2pDevice);
- }
-
- public static interface WifiP2pManager.DnsSdTxtRecordListener {
- method public void onDnsSdTxtRecordAvailable(String, java.util.Map<java.lang.String,java.lang.String>, android.net.wifi.p2p.WifiP2pDevice);
- }
-
- public static interface WifiP2pManager.GroupInfoListener {
- method public void onGroupInfoAvailable(android.net.wifi.p2p.WifiP2pGroup);
- }
-
- public static interface WifiP2pManager.NetworkInfoListener {
- method public void onNetworkInfoAvailable(@NonNull android.net.NetworkInfo);
- }
-
- public static interface WifiP2pManager.P2pStateListener {
- method public void onP2pStateAvailable(int);
- }
-
- public static interface WifiP2pManager.PeerListListener {
- method public void onPeersAvailable(android.net.wifi.p2p.WifiP2pDeviceList);
- }
-
- public static interface WifiP2pManager.ServiceResponseListener {
- method public void onServiceAvailable(int, byte[], android.net.wifi.p2p.WifiP2pDevice);
- }
-
- public static interface WifiP2pManager.UpnpServiceResponseListener {
- method public void onUpnpServiceAvailable(java.util.List<java.lang.String>, android.net.wifi.p2p.WifiP2pDevice);
- }
-
- public final class WifiP2pWfdInfo implements android.os.Parcelable {
- ctor public WifiP2pWfdInfo();
- ctor public WifiP2pWfdInfo(@Nullable android.net.wifi.p2p.WifiP2pWfdInfo);
- method public int describeContents();
- method public int getControlPort();
- method public int getDeviceType();
- method public int getMaxThroughput();
- method public boolean isContentProtectionSupported();
- method public boolean isEnabled();
- method public boolean isSessionAvailable();
- method public void setContentProtectionSupported(boolean);
- method public void setControlPort(@IntRange(from=0) int);
- method public boolean setDeviceType(int);
- method public void setEnabled(boolean);
- method public void setMaxThroughput(@IntRange(from=0) int);
- method public void setSessionAvailable(boolean);
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.p2p.WifiP2pWfdInfo> CREATOR;
- field public static final int DEVICE_TYPE_PRIMARY_SINK = 1; // 0x1
- field public static final int DEVICE_TYPE_SECONDARY_SINK = 2; // 0x2
- field public static final int DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK = 3; // 0x3
- field public static final int DEVICE_TYPE_WFD_SOURCE = 0; // 0x0
- }
-
-}
-
-package android.net.wifi.p2p.nsd {
-
- public class WifiP2pDnsSdServiceInfo extends android.net.wifi.p2p.nsd.WifiP2pServiceInfo {
- method public static android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceInfo newInstance(String, String, java.util.Map<java.lang.String,java.lang.String>);
- }
-
- public class WifiP2pDnsSdServiceRequest extends android.net.wifi.p2p.nsd.WifiP2pServiceRequest {
- method public static android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceRequest newInstance();
- method public static android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceRequest newInstance(String);
- method public static android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceRequest newInstance(String, String);
- }
-
- public class WifiP2pServiceInfo implements android.os.Parcelable {
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final int SERVICE_TYPE_ALL = 0; // 0x0
- field public static final int SERVICE_TYPE_BONJOUR = 1; // 0x1
- field public static final int SERVICE_TYPE_UPNP = 2; // 0x2
- field public static final int SERVICE_TYPE_VENDOR_SPECIFIC = 255; // 0xff
- }
-
- public class WifiP2pServiceRequest implements android.os.Parcelable {
- method public int describeContents();
- method public static android.net.wifi.p2p.nsd.WifiP2pServiceRequest newInstance(int, String);
- method public static android.net.wifi.p2p.nsd.WifiP2pServiceRequest newInstance(int);
- method public void writeToParcel(android.os.Parcel, int);
- }
-
- public class WifiP2pUpnpServiceInfo extends android.net.wifi.p2p.nsd.WifiP2pServiceInfo {
- method public static android.net.wifi.p2p.nsd.WifiP2pUpnpServiceInfo newInstance(String, String, java.util.List<java.lang.String>);
- }
-
- public class WifiP2pUpnpServiceRequest extends android.net.wifi.p2p.nsd.WifiP2pServiceRequest {
- method public static android.net.wifi.p2p.nsd.WifiP2pUpnpServiceRequest newInstance();
- method public static android.net.wifi.p2p.nsd.WifiP2pUpnpServiceRequest newInstance(String);
- }
-
-}
-
-package android.net.wifi.rtt {
-
- public class CivicLocationKeys {
- field public static final int ADDITIONAL_CODE = 32; // 0x20
- field public static final int APT = 26; // 0x1a
- field public static final int BOROUGH = 4; // 0x4
- field public static final int BRANCH_ROAD_NAME = 36; // 0x24
- field public static final int BUILDING = 25; // 0x19
- field public static final int CITY = 3; // 0x3
- field public static final int COUNTY = 2; // 0x2
- field public static final int DESK = 33; // 0x21
- field public static final int FLOOR = 27; // 0x1b
- field public static final int GROUP_OF_STREETS = 6; // 0x6
- field public static final int HNO = 19; // 0x13
- field public static final int HNS = 20; // 0x14
- field public static final int LANGUAGE = 0; // 0x0
- field public static final int LMK = 21; // 0x15
- field public static final int LOC = 22; // 0x16
- field public static final int NAM = 23; // 0x17
- field public static final int NEIGHBORHOOD = 5; // 0x5
- field public static final int PCN = 30; // 0x1e
- field public static final int POD = 17; // 0x11
- field public static final int POSTAL_CODE = 24; // 0x18
- field public static final int PO_BOX = 31; // 0x1f
- field public static final int PRD = 16; // 0x10
- field public static final int PRIMARY_ROAD_NAME = 34; // 0x22
- field public static final int ROAD_SECTION = 35; // 0x23
- field public static final int ROOM = 28; // 0x1c
- field public static final int SCRIPT = 128; // 0x80
- field public static final int STATE = 1; // 0x1
- field public static final int STREET_NAME_POST_MODIFIER = 39; // 0x27
- field public static final int STREET_NAME_PRE_MODIFIER = 38; // 0x26
- field public static final int STS = 18; // 0x12
- field public static final int SUBBRANCH_ROAD_NAME = 37; // 0x25
- field public static final int TYPE_OF_PLACE = 29; // 0x1d
- }
-
- 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;
- }
-
- public static final class RangingRequest.Builder {
- ctor public RangingRequest.Builder();
- method public android.net.wifi.rtt.RangingRequest.Builder addAccessPoint(@NonNull android.net.wifi.ScanResult);
- method public android.net.wifi.rtt.RangingRequest.Builder addAccessPoints(@NonNull java.util.List<android.net.wifi.ScanResult>);
- 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 {
- method public int describeContents();
- method public int getDistanceMm();
- method public int getDistanceStdDevMm();
- method @Nullable public android.net.MacAddress getMacAddress();
- method public int getNumAttemptedMeasurements();
- method public int getNumSuccessfulMeasurements();
- method @Nullable public android.net.wifi.aware.PeerHandle getPeerHandle();
- method public long getRangingTimestampMillis();
- method public int getRssi();
- method public int getStatus();
- method @Nullable public android.net.wifi.rtt.ResponderLocation getUnverifiedResponderLocation();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.rtt.RangingResult> CREATOR;
- field public static final int STATUS_FAIL = 1; // 0x1
- field public static final int STATUS_RESPONDER_DOES_NOT_SUPPORT_IEEE80211MC = 2; // 0x2
- field public static final int STATUS_SUCCESS = 0; // 0x0
- }
-
- public abstract class RangingResultCallback {
- ctor public RangingResultCallback();
- method public abstract void onRangingFailure(int);
- method public abstract void onRangingResults(@NonNull java.util.List<android.net.wifi.rtt.RangingResult>);
- field public static final int STATUS_CODE_FAIL = 1; // 0x1
- field public static final int STATUS_CODE_FAIL_RTT_NOT_AVAILABLE = 2; // 0x2
- }
-
- public final class ResponderLocation implements android.os.Parcelable {
- method public int describeContents();
- method public double getAltitude();
- method public int getAltitudeType();
- method public double getAltitudeUncertainty();
- method public java.util.List<android.net.MacAddress> getColocatedBssids();
- method public int getDatum();
- method public int getExpectedToMove();
- method public double getFloorNumber();
- method public double getHeightAboveFloorMeters();
- method public double getHeightAboveFloorUncertaintyMeters();
- method public double getLatitude();
- method public double getLatitudeUncertainty();
- method public int getLciVersion();
- method public double getLongitude();
- method public double getLongitudeUncertainty();
- method @Nullable public String getMapImageMimeType();
- method @Nullable public android.net.Uri getMapImageUri();
- method public boolean getRegisteredLocationAgreementIndication();
- method public boolean isLciSubelementValid();
- method public boolean isZaxisSubelementValid();
- method @Nullable public android.location.Address toCivicLocationAddress();
- method @Nullable public android.util.SparseArray<java.lang.String> toCivicLocationSparseArray();
- method @NonNull public android.location.Location toLocation();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final int ALTITUDE_FLOORS = 2; // 0x2
- field public static final int ALTITUDE_METERS = 1; // 0x1
- field public static final int ALTITUDE_UNDEFINED = 0; // 0x0
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.rtt.ResponderLocation> CREATOR;
- field public static final int DATUM_NAD83_MLLW = 3; // 0x3
- field public static final int DATUM_NAD83_NAV88 = 2; // 0x2
- field public static final int DATUM_UNDEFINED = 0; // 0x0
- field public static final int DATUM_WGS84 = 1; // 0x1
- field public static final int LCI_VERSION_1 = 1; // 0x1
- field public static final int LOCATION_FIXED = 0; // 0x0
- field public static final int LOCATION_MOVEMENT_UNKNOWN = 2; // 0x2
- field public static final int LOCATION_RESERVED = 3; // 0x3
- field public static final int LOCATION_VARIABLE = 1; // 0x1
- }
-
- public class WifiRttManager {
- method public boolean isAvailable();
- method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.CHANGE_WIFI_STATE, android.Manifest.permission.ACCESS_WIFI_STATE}) public void startRanging(@NonNull android.net.wifi.rtt.RangingRequest, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.rtt.RangingResultCallback);
- field public static final String ACTION_WIFI_RTT_STATE_CHANGED = "android.net.wifi.rtt.action.WIFI_RTT_STATE_CHANGED";
- }
-
-}
-
diff --git a/wifi/api/lint-baseline.txt b/wifi/api/lint-baseline.txt
deleted file mode 100644
index 892411f..0000000
--- a/wifi/api/lint-baseline.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-// Baseline format: 1.0
-GenericException: android.net.wifi.WifiManager.LocalOnlyHotspotReservation#finalize():
- Methods must not throw generic exceptions (`java.lang.Throwable`)
-GenericException: android.net.wifi.WifiManager.MulticastLock#finalize():
- Methods must not throw generic exceptions (`java.lang.Throwable`)
-GenericException: android.net.wifi.WifiManager.WifiLock#finalize():
- Methods must not throw generic exceptions (`java.lang.Throwable`)
-
-
-VisiblySynchronized: PsiThisExpression:WifiManager.this:
- Internal locks must not be exposed (synchronizing on this or class is still externally observable): method android.net.wifi.WifiManager.WifiLock.finalize()
-VisiblySynchronized: android.net.wifi.WifiManager.WifiLock#finalize():
- Internal locks must not be exposed (synchronizing on this or class is still externally observable): method android.net.wifi.WifiManager.WifiLock.finalize()
diff --git a/wifi/api/module-lib-current.txt b/wifi/api/module-lib-current.txt
deleted file mode 100644
index d802177..0000000
--- a/wifi/api/module-lib-current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 2.0
diff --git a/wifi/api/module-lib-removed.txt b/wifi/api/module-lib-removed.txt
deleted file mode 100644
index d802177..0000000
--- a/wifi/api/module-lib-removed.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 2.0
diff --git a/wifi/api/removed.txt b/wifi/api/removed.txt
deleted file mode 100644
index d802177..0000000
--- a/wifi/api/removed.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 2.0
diff --git a/wifi/api/system-current.txt b/wifi/api/system-current.txt
deleted file mode 100644
index 257f9d5..0000000
--- a/wifi/api/system-current.txt
+++ /dev/null
@@ -1,1026 +0,0 @@
-// Signature format: 2.0
-package android.net.wifi {
-
- public final class CoexUnsafeChannel implements android.os.Parcelable {
- ctor public CoexUnsafeChannel(int, int);
- ctor public CoexUnsafeChannel(int, int, int);
- method public int getBand();
- method public int getChannel();
- method public int getPowerCapDbm();
- method public boolean isPowerCapAvailable();
- method public void setPowerCapDbm(int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.CoexUnsafeChannel> CREATOR;
- }
-
- public abstract class EasyConnectStatusCallback {
- ctor public EasyConnectStatusCallback();
- method public void onBootstrapUriGenerated(@NonNull String);
- method public abstract void onConfiguratorSuccess(int);
- method public abstract void onEnrolleeSuccess(int);
- method public void onFailure(int);
- method public void onFailure(int, @Nullable String, @NonNull android.util.SparseArray<int[]>, @NonNull int[]);
- method public abstract void onProgress(int);
- field public static final int EASY_CONNECT_EVENT_PROGRESS_AUTHENTICATION_SUCCESS = 0; // 0x0
- field public static final int EASY_CONNECT_EVENT_PROGRESS_CONFIGURATION_ACCEPTED = 3; // 0x3
- field public static final int EASY_CONNECT_EVENT_PROGRESS_CONFIGURATION_SENT_WAITING_RESPONSE = 2; // 0x2
- field public static final int EASY_CONNECT_EVENT_PROGRESS_RESPONSE_PENDING = 1; // 0x1
- field public static final int EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_APPLIED = 1; // 0x1
- field public static final int EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_SENT = 0; // 0x0
- }
-
- @Deprecated public class RttManager {
- method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void disableResponder(android.net.wifi.RttManager.ResponderCallback);
- method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void enableResponder(android.net.wifi.RttManager.ResponderCallback);
- method @Deprecated public android.net.wifi.RttManager.Capabilities getCapabilities();
- method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.net.wifi.RttManager.RttCapabilities getRttCapabilities();
- method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startRanging(android.net.wifi.RttManager.RttParams[], android.net.wifi.RttManager.RttListener);
- method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void stopRanging(android.net.wifi.RttManager.RttListener);
- field @Deprecated public static final int BASE = 160256; // 0x27200
- field @Deprecated public static final int CMD_OP_ABORTED = 160260; // 0x27204
- field @Deprecated public static final int CMD_OP_DISABLE_RESPONDER = 160262; // 0x27206
- field @Deprecated public static final int CMD_OP_ENABLE_RESPONDER = 160261; // 0x27205
- field @Deprecated public static final int CMD_OP_ENALBE_RESPONDER_FAILED = 160264; // 0x27208
- field @Deprecated public static final int CMD_OP_ENALBE_RESPONDER_SUCCEEDED = 160263; // 0x27207
- field @Deprecated public static final int CMD_OP_FAILED = 160258; // 0x27202
- field @Deprecated public static final int CMD_OP_START_RANGING = 160256; // 0x27200
- field @Deprecated public static final int CMD_OP_STOP_RANGING = 160257; // 0x27201
- field @Deprecated public static final int CMD_OP_SUCCEEDED = 160259; // 0x27203
- field @Deprecated public static final String DESCRIPTION_KEY = "android.net.wifi.RttManager.Description";
- field @Deprecated public static final int PREAMBLE_HT = 2; // 0x2
- field @Deprecated public static final int PREAMBLE_LEGACY = 1; // 0x1
- field @Deprecated public static final int PREAMBLE_VHT = 4; // 0x4
- field @Deprecated public static final int REASON_INITIATOR_NOT_ALLOWED_WHEN_RESPONDER_ON = -6; // 0xfffffffa
- field @Deprecated public static final int REASON_INVALID_LISTENER = -3; // 0xfffffffd
- field @Deprecated public static final int REASON_INVALID_REQUEST = -4; // 0xfffffffc
- field @Deprecated public static final int REASON_NOT_AVAILABLE = -2; // 0xfffffffe
- field @Deprecated public static final int REASON_PERMISSION_DENIED = -5; // 0xfffffffb
- field @Deprecated public static final int REASON_UNSPECIFIED = -1; // 0xffffffff
- field @Deprecated public static final int RTT_BW_10_SUPPORT = 2; // 0x2
- field @Deprecated public static final int RTT_BW_160_SUPPORT = 32; // 0x20
- field @Deprecated public static final int RTT_BW_20_SUPPORT = 4; // 0x4
- field @Deprecated public static final int RTT_BW_40_SUPPORT = 8; // 0x8
- field @Deprecated public static final int RTT_BW_5_SUPPORT = 1; // 0x1
- field @Deprecated public static final int RTT_BW_80_SUPPORT = 16; // 0x10
- field @Deprecated public static final int RTT_CHANNEL_WIDTH_10 = 6; // 0x6
- field @Deprecated public static final int RTT_CHANNEL_WIDTH_160 = 3; // 0x3
- field @Deprecated public static final int RTT_CHANNEL_WIDTH_20 = 0; // 0x0
- field @Deprecated public static final int RTT_CHANNEL_WIDTH_40 = 1; // 0x1
- field @Deprecated public static final int RTT_CHANNEL_WIDTH_5 = 5; // 0x5
- field @Deprecated public static final int RTT_CHANNEL_WIDTH_80 = 2; // 0x2
- field @Deprecated public static final int RTT_CHANNEL_WIDTH_80P80 = 4; // 0x4
- field @Deprecated public static final int RTT_CHANNEL_WIDTH_UNSPECIFIED = -1; // 0xffffffff
- field @Deprecated public static final int RTT_PEER_NAN = 5; // 0x5
- field @Deprecated public static final int RTT_PEER_P2P_CLIENT = 4; // 0x4
- field @Deprecated public static final int RTT_PEER_P2P_GO = 3; // 0x3
- field @Deprecated public static final int RTT_PEER_TYPE_AP = 1; // 0x1
- field @Deprecated public static final int RTT_PEER_TYPE_STA = 2; // 0x2
- field @Deprecated public static final int RTT_PEER_TYPE_UNSPECIFIED = 0; // 0x0
- field @Deprecated public static final int RTT_STATUS_ABORTED = 8; // 0x8
- field @Deprecated public static final int RTT_STATUS_FAILURE = 1; // 0x1
- field @Deprecated public static final int RTT_STATUS_FAIL_AP_ON_DIFF_CHANNEL = 6; // 0x6
- field @Deprecated public static final int RTT_STATUS_FAIL_BUSY_TRY_LATER = 12; // 0xc
- field @Deprecated public static final int RTT_STATUS_FAIL_FTM_PARAM_OVERRIDE = 15; // 0xf
- field @Deprecated public static final int RTT_STATUS_FAIL_INVALID_TS = 9; // 0x9
- field @Deprecated public static final int RTT_STATUS_FAIL_NOT_SCHEDULED_YET = 4; // 0x4
- field @Deprecated public static final int RTT_STATUS_FAIL_NO_CAPABILITY = 7; // 0x7
- field @Deprecated public static final int RTT_STATUS_FAIL_NO_RSP = 2; // 0x2
- field @Deprecated public static final int RTT_STATUS_FAIL_PROTOCOL = 10; // 0xa
- field @Deprecated public static final int RTT_STATUS_FAIL_REJECTED = 3; // 0x3
- field @Deprecated public static final int RTT_STATUS_FAIL_SCHEDULE = 11; // 0xb
- field @Deprecated public static final int RTT_STATUS_FAIL_TM_TIMEOUT = 5; // 0x5
- field @Deprecated public static final int RTT_STATUS_INVALID_REQ = 13; // 0xd
- field @Deprecated public static final int RTT_STATUS_NO_WIFI = 14; // 0xe
- field @Deprecated public static final int RTT_STATUS_SUCCESS = 0; // 0x0
- field @Deprecated public static final int RTT_TYPE_11_MC = 4; // 0x4
- field @Deprecated public static final int RTT_TYPE_11_V = 2; // 0x2
- field @Deprecated public static final int RTT_TYPE_ONE_SIDED = 1; // 0x1
- field @Deprecated public static final int RTT_TYPE_TWO_SIDED = 2; // 0x2
- field @Deprecated public static final int RTT_TYPE_UNSPECIFIED = 0; // 0x0
- }
-
- @Deprecated public class RttManager.Capabilities {
- ctor @Deprecated public RttManager.Capabilities();
- field @Deprecated public int supportedPeerType;
- field @Deprecated public int supportedType;
- }
-
- @Deprecated public static class RttManager.ParcelableRttParams implements android.os.Parcelable {
- field @Deprecated @NonNull public android.net.wifi.RttManager.RttParams[] mParams;
- }
-
- @Deprecated public static class RttManager.ParcelableRttResults implements android.os.Parcelable {
- ctor @Deprecated public RttManager.ParcelableRttResults(android.net.wifi.RttManager.RttResult[]);
- field @Deprecated public android.net.wifi.RttManager.RttResult[] mResults;
- }
-
- @Deprecated public abstract static class RttManager.ResponderCallback {
- ctor @Deprecated public RttManager.ResponderCallback();
- method @Deprecated public abstract void onResponderEnableFailure(int);
- method @Deprecated public abstract void onResponderEnabled(android.net.wifi.RttManager.ResponderConfig);
- }
-
- @Deprecated public static class RttManager.ResponderConfig implements android.os.Parcelable {
- ctor @Deprecated public RttManager.ResponderConfig();
- method @Deprecated public int describeContents();
- method @Deprecated public void writeToParcel(android.os.Parcel, int);
- field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.RttManager.ResponderConfig> CREATOR;
- field @Deprecated public int centerFreq0;
- field @Deprecated public int centerFreq1;
- field @Deprecated public int channelWidth;
- field @Deprecated public int frequency;
- field @Deprecated public String macAddress;
- field @Deprecated public int preamble;
- }
-
- @Deprecated public static class RttManager.RttCapabilities implements android.os.Parcelable {
- ctor @Deprecated public RttManager.RttCapabilities();
- field @Deprecated public int bwSupported;
- field @Deprecated public boolean lciSupported;
- field @Deprecated public boolean lcrSupported;
- field @Deprecated public int mcVersion;
- field @Deprecated public boolean oneSidedRttSupported;
- field @Deprecated public int preambleSupported;
- field @Deprecated public boolean responderSupported;
- field @Deprecated public boolean secureRttSupported;
- field @Deprecated public boolean supportedPeerType;
- field @Deprecated public boolean supportedType;
- field @Deprecated public boolean twoSided11McRttSupported;
- }
-
- @Deprecated public static interface RttManager.RttListener {
- method @Deprecated public void onAborted();
- method @Deprecated public void onFailure(int, String);
- method @Deprecated public void onSuccess(android.net.wifi.RttManager.RttResult[]);
- }
-
- @Deprecated public static class RttManager.RttParams {
- ctor @Deprecated public RttManager.RttParams();
- field @Deprecated public boolean LCIRequest;
- field @Deprecated public boolean LCRRequest;
- field @Deprecated public int bandwidth;
- field @Deprecated public String bssid;
- field @Deprecated public int burstTimeout;
- field @Deprecated public int centerFreq0;
- field @Deprecated public int centerFreq1;
- field @Deprecated public int channelWidth;
- field @Deprecated public int deviceType;
- field @Deprecated public int frequency;
- field @Deprecated public int interval;
- field @Deprecated public int numRetriesPerFTMR;
- field @Deprecated public int numRetriesPerMeasurementFrame;
- field @Deprecated public int numSamplesPerBurst;
- field @Deprecated public int num_retries;
- field @Deprecated public int num_samples;
- field @Deprecated public int numberBurst;
- field @Deprecated public int preamble;
- field @Deprecated public int requestType;
- field @Deprecated public boolean secure;
- }
-
- @Deprecated public static class RttManager.RttResult {
- ctor @Deprecated public RttManager.RttResult();
- field @Deprecated public android.net.wifi.RttManager.WifiInformationElement LCI;
- field @Deprecated public android.net.wifi.RttManager.WifiInformationElement LCR;
- field @Deprecated public String bssid;
- field @Deprecated public int burstDuration;
- field @Deprecated public int burstNumber;
- field @Deprecated public int distance;
- field @Deprecated public int distanceSpread;
- field @Deprecated public int distanceStandardDeviation;
- field @Deprecated public int distance_cm;
- field @Deprecated public int distance_sd_cm;
- field @Deprecated public int distance_spread_cm;
- field @Deprecated public int frameNumberPerBurstPeer;
- field @Deprecated public int measurementFrameNumber;
- field @Deprecated public int measurementType;
- field @Deprecated public int negotiatedBurstNum;
- field @Deprecated public int requestType;
- field @Deprecated public int retryAfterDuration;
- field @Deprecated public int rssi;
- field @Deprecated public int rssiSpread;
- field @Deprecated public int rssi_spread;
- field @Deprecated public long rtt;
- field @Deprecated public long rttSpread;
- field @Deprecated public long rttStandardDeviation;
- field @Deprecated public long rtt_ns;
- field @Deprecated public long rtt_sd_ns;
- field @Deprecated public long rtt_spread_ns;
- field @Deprecated public int rxRate;
- field @Deprecated public boolean secure;
- field @Deprecated public int status;
- field @Deprecated public int successMeasurementFrameNumber;
- field @Deprecated public long ts;
- field @Deprecated public int txRate;
- field @Deprecated public int tx_rate;
- }
-
- @Deprecated public static class RttManager.WifiInformationElement {
- ctor @Deprecated public RttManager.WifiInformationElement();
- field @Deprecated public byte[] data;
- field @Deprecated public byte id;
- }
-
- public final class ScanResult implements android.os.Parcelable {
- field public static final int CIPHER_CCMP = 3; // 0x3
- field public static final int CIPHER_GCMP_256 = 4; // 0x4
- field public static final int CIPHER_NONE = 0; // 0x0
- field public static final int CIPHER_NO_GROUP_ADDRESSED = 1; // 0x1
- field public static final int CIPHER_SMS4 = 5; // 0x5
- field public static final int CIPHER_TKIP = 2; // 0x2
- field public static final int KEY_MGMT_EAP = 2; // 0x2
- field public static final int KEY_MGMT_EAP_SHA256 = 6; // 0x6
- field public static final int KEY_MGMT_EAP_SUITE_B_192 = 10; // 0xa
- field public static final int KEY_MGMT_FT_EAP = 4; // 0x4
- field public static final int KEY_MGMT_FT_PSK = 3; // 0x3
- field public static final int KEY_MGMT_FT_SAE = 11; // 0xb
- field public static final int KEY_MGMT_NONE = 0; // 0x0
- field public static final int KEY_MGMT_OSEN = 7; // 0x7
- field public static final int KEY_MGMT_OWE = 9; // 0x9
- field public static final int KEY_MGMT_OWE_TRANSITION = 12; // 0xc
- field public static final int KEY_MGMT_PSK = 1; // 0x1
- field public static final int KEY_MGMT_PSK_SHA256 = 5; // 0x5
- field public static final int KEY_MGMT_SAE = 8; // 0x8
- field public static final int KEY_MGMT_WAPI_CERT = 14; // 0xe
- field public static final int KEY_MGMT_WAPI_PSK = 13; // 0xd
- field public static final int PROTOCOL_NONE = 0; // 0x0
- field public static final int PROTOCOL_OSEN = 3; // 0x3
- field public static final int PROTOCOL_RSN = 2; // 0x2
- field public static final int PROTOCOL_WAPI = 4; // 0x4
- field public static final int PROTOCOL_WPA = 1; // 0x1
- }
-
- public final class SoftApCapability implements android.os.Parcelable {
- method public boolean areFeaturesSupported(long);
- method public int describeContents();
- method public int getMaxSupportedClients();
- method @NonNull public int[] getSupportedChannelList(int);
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.SoftApCapability> CREATOR;
- field public static final long SOFTAP_FEATURE_ACS_OFFLOAD = 1L; // 0x1L
- field public static final long SOFTAP_FEATURE_CLIENT_FORCE_DISCONNECT = 2L; // 0x2L
- field public static final long SOFTAP_FEATURE_MAC_ADDRESS_CUSTOMIZATION = 8L; // 0x8L
- field public static final long SOFTAP_FEATURE_WPA3_SAE = 4L; // 0x4L
- }
-
- public final class SoftApConfiguration implements android.os.Parcelable {
- method @NonNull public java.util.List<android.net.MacAddress> getAllowedClientList();
- method public int getBand();
- method @NonNull public int[] getBands();
- method @NonNull public java.util.List<android.net.MacAddress> getBlockedClientList();
- method public int getChannel();
- method @NonNull public android.util.SparseIntArray getChannels();
- method public int getMacRandomizationSetting();
- method public int getMaxNumberOfClients();
- method public long getShutdownTimeoutMillis();
- method public boolean isAutoShutdownEnabled();
- method public boolean isClientControlByUserEnabled();
- 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
- field public static final int RANDOMIZATION_PERSISTENT = 1; // 0x1
- }
-
- public static final class SoftApConfiguration.Builder {
- ctor public SoftApConfiguration.Builder();
- ctor public SoftApConfiguration.Builder(@NonNull android.net.wifi.SoftApConfiguration);
- method @NonNull public android.net.wifi.SoftApConfiguration build();
- method @NonNull public android.net.wifi.SoftApConfiguration.Builder setAllowedClientList(@NonNull java.util.List<android.net.MacAddress>);
- method @NonNull public android.net.wifi.SoftApConfiguration.Builder setAutoShutdownEnabled(boolean);
- method @NonNull public android.net.wifi.SoftApConfiguration.Builder setBand(int);
- method @NonNull public android.net.wifi.SoftApConfiguration.Builder setBands(@NonNull int[]);
- method @NonNull public android.net.wifi.SoftApConfiguration.Builder setBlockedClientList(@NonNull java.util.List<android.net.MacAddress>);
- method @NonNull public android.net.wifi.SoftApConfiguration.Builder setBssid(@Nullable android.net.MacAddress);
- method @NonNull public android.net.wifi.SoftApConfiguration.Builder setChannel(int, int);
- method @NonNull public android.net.wifi.SoftApConfiguration.Builder setChannels(@NonNull android.util.SparseIntArray);
- method @NonNull public android.net.wifi.SoftApConfiguration.Builder setClientControlByUserEnabled(boolean);
- method @NonNull public android.net.wifi.SoftApConfiguration.Builder setHiddenSsid(boolean);
- method @NonNull public android.net.wifi.SoftApConfiguration.Builder setMacRandomizationSetting(int);
- method @NonNull public android.net.wifi.SoftApConfiguration.Builder setMaxNumberOfClients(@IntRange(from=0) int);
- method @NonNull public android.net.wifi.SoftApConfiguration.Builder setPassphrase(@Nullable String, int);
- method @NonNull public android.net.wifi.SoftApConfiguration.Builder setShutdownTimeoutMillis(@IntRange(from=0) long);
- method @NonNull public android.net.wifi.SoftApConfiguration.Builder setSsid(@Nullable String);
- }
-
- public final class SoftApInfo implements android.os.Parcelable {
- method public int describeContents();
- method public int getBandwidth();
- method @Nullable public android.net.MacAddress getBssid();
- method public int getFrequency();
- method public int getWifiStandard();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- 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;
- }
-
- public final class WifiClient implements android.os.Parcelable {
- method public int describeContents();
- method @NonNull public android.net.MacAddress getMacAddress();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiClient> CREATOR;
- }
-
- @Deprecated public class WifiConfiguration implements android.os.Parcelable {
- method @Deprecated public int getAuthType();
- method @Deprecated @NonNull public android.net.IpConfiguration getIpConfiguration();
- method @Deprecated @NonNull public android.net.wifi.WifiConfiguration.NetworkSelectionStatus getNetworkSelectionStatus();
- method @Deprecated @NonNull public String getPrintableSsid();
- method @Deprecated @NonNull public String getProfileKey();
- method @Deprecated public int getRecentFailureReason();
- method @Deprecated public boolean hasNoInternetAccess();
- method @Deprecated public boolean isEphemeral();
- method @Deprecated public static boolean isMetered(@Nullable android.net.wifi.WifiConfiguration, @Nullable android.net.wifi.WifiInfo);
- method @Deprecated public boolean isNoInternetAccessExpected();
- method @Deprecated public void setIpConfiguration(@Nullable android.net.IpConfiguration);
- method @Deprecated public void setNetworkSelectionStatus(@NonNull android.net.wifi.WifiConfiguration.NetworkSelectionStatus);
- field @Deprecated public static final int INVALID_NETWORK_ID = -1; // 0xffffffff
- field @Deprecated public static final int METERED_OVERRIDE_METERED = 1; // 0x1
- field @Deprecated public static final int METERED_OVERRIDE_NONE = 0; // 0x0
- field @Deprecated public static final int METERED_OVERRIDE_NOT_METERED = 2; // 0x2
- field @Deprecated public static final int RANDOMIZATION_AUTO = 3; // 0x3
- field @Deprecated public static final int RANDOMIZATION_ENHANCED = 2; // 0x2
- field @Deprecated public static final int RANDOMIZATION_NONE = 0; // 0x0
- field @Deprecated public static final int RANDOMIZATION_PERSISTENT = 1; // 0x1
- field @Deprecated public static final int RECENT_FAILURE_AP_UNABLE_TO_HANDLE_NEW_STA = 17; // 0x11
- field @Deprecated public static final int RECENT_FAILURE_DISCONNECTION_AP_BUSY = 1004; // 0x3ec
- field @Deprecated public static final int RECENT_FAILURE_MBO_OCE_DISCONNECT = 1001; // 0x3e9
- field @Deprecated public static final int RECENT_FAILURE_NONE = 0; // 0x0
- field @Deprecated public static final int RECENT_FAILURE_POOR_CHANNEL_CONDITIONS = 1003; // 0x3eb
- field @Deprecated public static final int RECENT_FAILURE_REFUSED_TEMPORARILY = 1002; // 0x3ea
- field @Deprecated public boolean allowAutojoin;
- field @Deprecated public int carrierId;
- field @Deprecated public boolean carrierMerged;
- field @Deprecated public String creatorName;
- field @Deprecated public int creatorUid;
- field @Deprecated public boolean fromWifiNetworkSpecifier;
- field @Deprecated public boolean fromWifiNetworkSuggestion;
- field @Deprecated public String lastUpdateName;
- field @Deprecated public int lastUpdateUid;
- field @Deprecated public int macRandomizationSetting;
- field @Deprecated public boolean meteredHint;
- field @Deprecated public int meteredOverride;
- field @Deprecated public int numAssociation;
- field @Deprecated public int numScorerOverride;
- field @Deprecated public int numScorerOverrideAndSwitchedNetwork;
- field @Deprecated public boolean requirePmf;
- field @Deprecated public boolean shared;
- field @Deprecated public int subscriptionId;
- field @Deprecated public boolean useExternalScores;
- }
-
- @Deprecated public static class WifiConfiguration.KeyMgmt {
- field @Deprecated public static final int WAPI_CERT = 14; // 0xe
- field @Deprecated public static final int WAPI_PSK = 13; // 0xd
- field @Deprecated public static final int WPA2_PSK = 4; // 0x4
- }
-
- @Deprecated public static class WifiConfiguration.NetworkSelectionStatus {
- method @Deprecated public int getDisableReasonCounter(int);
- method @Deprecated public long getDisableTime();
- method @Deprecated public static int getMaxNetworkSelectionDisableReason();
- method @Deprecated public int getNetworkSelectionDisableReason();
- method @Deprecated @Nullable public static String getNetworkSelectionDisableReasonString(int);
- method @Deprecated public int getNetworkSelectionStatus();
- method @Deprecated @NonNull public String getNetworkStatusString();
- method @Deprecated public boolean hasEverConnected();
- field @Deprecated public static final int DISABLED_ASSOCIATION_REJECTION = 1; // 0x1
- field @Deprecated public static final int DISABLED_AUTHENTICATION_FAILURE = 2; // 0x2
- field @Deprecated public static final int DISABLED_AUTHENTICATION_FAILURE_CARRIER_SPECIFIC = 10; // 0xa
- field @Deprecated public static final int DISABLED_AUTHENTICATION_FAILURE_GENERIC = 2; // 0x2
- field @Deprecated public static final int DISABLED_AUTHENTICATION_NO_CREDENTIALS = 5; // 0x5
- field @Deprecated public static final int DISABLED_AUTHENTICATION_NO_SUBSCRIPTION = 9; // 0x9
- field @Deprecated public static final int DISABLED_BY_WIFI_MANAGER = 7; // 0x7
- field @Deprecated public static final int DISABLED_BY_WRONG_PASSWORD = 8; // 0x8
- field @Deprecated public static final int DISABLED_DHCP_FAILURE = 3; // 0x3
- field @Deprecated public static final int DISABLED_NONE = 0; // 0x0
- field @Deprecated public static final int DISABLED_NO_INTERNET_PERMANENT = 6; // 0x6
- field @Deprecated public static final int DISABLED_NO_INTERNET_TEMPORARY = 4; // 0x4
- field @Deprecated public static final int NETWORK_SELECTION_ENABLED = 0; // 0x0
- field @Deprecated public static final int NETWORK_SELECTION_PERMANENTLY_DISABLED = 2; // 0x2
- field @Deprecated public static final int NETWORK_SELECTION_TEMPORARY_DISABLED = 1; // 0x1
- }
-
- @Deprecated public static final class WifiConfiguration.NetworkSelectionStatus.Builder {
- ctor @Deprecated public WifiConfiguration.NetworkSelectionStatus.Builder();
- method @Deprecated @NonNull public android.net.wifi.WifiConfiguration.NetworkSelectionStatus build();
- method @Deprecated @NonNull public android.net.wifi.WifiConfiguration.NetworkSelectionStatus.Builder setNetworkSelectionDisableReason(int);
- method @Deprecated @NonNull public android.net.wifi.WifiConfiguration.NetworkSelectionStatus.Builder setNetworkSelectionStatus(int);
- }
-
- public class WifiEnterpriseConfig implements android.os.Parcelable {
- method @Nullable public String[] getCaCertificateAliases();
- method @NonNull public String getCaPath();
- method @NonNull public String getClientCertificateAlias();
- method public int getOcsp();
- method @NonNull public String getWapiCertSuite();
- method public void setCaCertificateAliases(@Nullable String[]);
- method public void setCaPath(@NonNull String);
- method public void setClientCertificateAlias(@NonNull String);
- method public void setOcsp(int);
- method public void setWapiCertSuite(@NonNull String);
- field public static final int OCSP_NONE = 0; // 0x0
- field public static final int OCSP_REQUEST_CERT_STATUS = 1; // 0x1
- field public static final int OCSP_REQUIRE_ALL_NON_TRUSTED_CERTS_STATUS = 3; // 0x3
- field public static final int OCSP_REQUIRE_CERT_STATUS = 2; // 0x2
- }
-
- public class WifiFrameworkInitializer {
- method public static void registerServiceWrappers();
- }
-
- public class WifiInfo implements android.os.Parcelable {
- method public double getLostTxPacketsPerSecond();
- method @Nullable public String getRequestingPackageName();
- method public double getRetriedTxPacketsPerSecond();
- method public int getScore();
- method public int getSubscriptionId();
- method public double getSuccessfulRxPacketsPerSecond();
- method public double getSuccessfulTxPacketsPerSecond();
- method public boolean isCarrierMerged();
- method public boolean isEphemeral();
- method public boolean isOemPaid();
- method public boolean isOemPrivate();
- method public boolean isOsuAp();
- method public boolean isPasspointAp();
- method public boolean isTrusted();
- method @Nullable public static String sanitizeSsid(@Nullable String);
- field public static final String DEFAULT_MAC_ADDRESS = "02:00:00:00:00:00";
- field public static final int INVALID_RSSI = -127; // 0xffffff81
- }
-
- public class WifiManager {
- method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public void addOnWifiUsabilityStatsListener(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.OnWifiUsabilityStatsListener);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void allowAutojoin(int, boolean);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void allowAutojoinGlobal(boolean);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void allowAutojoinPasspoint(@NonNull String, boolean);
- method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public void clearWifiConnectedNetworkScorer();
- method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void connect(@NonNull android.net.wifi.WifiConfiguration, @Nullable android.net.wifi.WifiManager.ActionListener);
- method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void connect(int, @Nullable android.net.wifi.WifiManager.ActionListener);
- method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void disable(int, @Nullable android.net.wifi.WifiManager.ActionListener);
- method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK}) public void disableEphemeralNetwork(@NonNull String);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void factoryReset();
- method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void forget(int, @Nullable android.net.wifi.WifiManager.ActionListener);
- method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public java.util.List<android.util.Pair<android.net.wifi.WifiConfiguration,java.util.Map<java.lang.Integer,java.util.List<android.net.wifi.ScanResult>>>> getAllMatchingWifiConfigs(@NonNull java.util.List<android.net.wifi.ScanResult>);
- method @RequiresPermission(android.Manifest.permission.WIFI_ACCESS_COEX_UNSAFE_CHANNELS) public int getCoexRestrictions();
- method @NonNull @RequiresPermission(android.Manifest.permission.WIFI_ACCESS_COEX_UNSAFE_CHANNELS) public java.util.Set<android.net.wifi.CoexUnsafeChannel> getCoexUnsafeChannels();
- method @Nullable @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public String getCountryCode();
- method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public android.net.Network getCurrentNetwork();
- method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public String[] getFactoryMacAddresses();
- method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public java.util.Map<android.net.wifi.hotspot2.OsuProvider,java.util.List<android.net.wifi.ScanResult>> getMatchingOsuProviders(@Nullable java.util.List<android.net.wifi.ScanResult>);
- method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public java.util.Map<android.net.wifi.hotspot2.OsuProvider,android.net.wifi.hotspot2.PasspointConfiguration> getMatchingPasspointConfigsForOsuProviders(@NonNull java.util.Set<android.net.wifi.hotspot2.OsuProvider>);
- method @NonNull @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_WIFI_STATE}) public java.util.Map<android.net.wifi.WifiNetworkSuggestion,java.util.List<android.net.wifi.ScanResult>> getMatchingScanResults(@NonNull java.util.List<android.net.wifi.WifiNetworkSuggestion>, @Nullable java.util.List<android.net.wifi.ScanResult>);
- method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_WIFI_STATE, android.Manifest.permission.READ_WIFI_CREDENTIAL}) public java.util.List<android.net.wifi.WifiConfiguration> getPrivilegedConfiguredNetworks();
- method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.OVERRIDE_WIFI_CONFIG}) public android.net.wifi.SoftApConfiguration getSoftApConfiguration();
- method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public void getWifiActivityEnergyInfoAsync(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.OnWifiActivityEnergyInfoListener);
- method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public android.net.wifi.WifiConfiguration getWifiApConfiguration();
- method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public int getWifiApState();
- method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public java.util.List<android.net.wifi.WifiConfiguration> getWifiConfigForMatchedNetworkSuggestionsSharedWithUser(@NonNull java.util.List<android.net.wifi.ScanResult>);
- method public boolean is60GHzBandSupported();
- method public boolean isApMacRandomizationSupported();
- method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public boolean isCarrierNetworkOffloadEnabled(int, boolean);
- method public boolean isConnectedMacRandomizationSupported();
- method @Deprecated public boolean isDeviceToDeviceRttSupported();
- method public boolean isPortableHotspotSupported();
- method public boolean isVerboseLoggingEnabled();
- method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public boolean isWifiApEnabled();
- method public boolean isWifiScannerSupported();
- method @RequiresPermission(android.Manifest.permission.WIFI_ACCESS_COEX_UNSAFE_CHANNELS) public void registerCoexCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.CoexCallback);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void registerNetworkRequestMatchCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.NetworkRequestMatchCallback);
- 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[]);
- method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public byte[] retrieveBackupData();
- method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public byte[] retrieveSoftApBackupData();
- method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void save(@NonNull android.net.wifi.WifiConfiguration, @Nullable android.net.wifi.WifiManager.ActionListener);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setAutoWakeupEnabled(boolean);
- method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void setCarrierNetworkOffloadEnabled(int, boolean, boolean);
- method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_COEX_UNSAFE_CHANNELS) public void setCoexUnsafeChannels(@NonNull java.util.Set<android.net.wifi.CoexUnsafeChannel>, int);
- method @RequiresPermission(android.Manifest.permission.WIFI_SET_DEVICE_MOBILITY_STATE) public void setDeviceMobilityState(int);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setMacRandomizationSettingPasspointEnabled(@NonNull String, boolean);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setPasspointMeteredOverride(@NonNull String, int);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setScanAlwaysAvailable(boolean);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setScanThrottleEnabled(boolean);
- method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.OVERRIDE_WIFI_CONFIG}) public boolean setSoftApConfiguration(@NonNull android.net.wifi.SoftApConfiguration);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setVerboseLoggingEnabled(boolean);
- method @Deprecated @RequiresPermission(android.Manifest.permission.CHANGE_WIFI_STATE) public boolean setWifiApConfiguration(android.net.wifi.WifiConfiguration);
- method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public boolean setWifiConnectedNetworkScorer(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.WifiConnectedNetworkScorer);
- method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startEasyConnectAsConfiguratorInitiator(@NonNull String, int, int, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.EasyConnectStatusCallback);
- method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startEasyConnectAsEnrolleeInitiator(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.EasyConnectStatusCallback);
- method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startEasyConnectAsEnrolleeResponder(@Nullable String, int, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.EasyConnectStatusCallback);
- 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(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(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);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void unregisterTrafficStateCallback(@NonNull android.net.wifi.WifiManager.TrafficStateCallback);
- method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void updateInterfaceIpState(@Nullable String, int);
- method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public void updateWifiUsabilityScore(int, int, int);
- field public static final String ACTION_LINK_CONFIGURATION_CHANGED = "android.net.wifi.LINK_CONFIGURATION_CHANGED";
- field @RequiresPermission(android.Manifest.permission.NETWORK_CARRIER_PROVISIONING) public static final String ACTION_NETWORK_SETTINGS_RESET = "android.net.wifi.action.NETWORK_SETTINGS_RESET";
- field public static final String ACTION_PASSPOINT_LAUNCH_OSU_VIEW = "android.net.wifi.action.PASSPOINT_LAUNCH_OSU_VIEW";
- field public static final String ACTION_REQUEST_DISABLE = "android.net.wifi.action.REQUEST_DISABLE";
- field public static final String ACTION_REQUEST_ENABLE = "android.net.wifi.action.REQUEST_ENABLE";
- field public static final int CHANGE_REASON_ADDED = 0; // 0x0
- field public static final int CHANGE_REASON_CONFIG_CHANGE = 2; // 0x2
- field public static final int CHANGE_REASON_REMOVED = 1; // 0x1
- field public static final int COEX_RESTRICTION_SOFTAP = 2; // 0x2
- field public static final int COEX_RESTRICTION_WIFI_AWARE = 4; // 0x4
- field public static final int COEX_RESTRICTION_WIFI_DIRECT = 1; // 0x1
- field public static final String CONFIGURED_NETWORKS_CHANGED_ACTION = "android.net.wifi.CONFIGURED_NETWORKS_CHANGE";
- field public static final int DEVICE_MOBILITY_STATE_HIGH_MVMT = 1; // 0x1
- field public static final int DEVICE_MOBILITY_STATE_LOW_MVMT = 2; // 0x2
- field public static final int DEVICE_MOBILITY_STATE_STATIONARY = 3; // 0x3
- field public static final int DEVICE_MOBILITY_STATE_UNKNOWN = 0; // 0x0
- field public static final int EASY_CONNECT_CRYPTOGRAPHY_CURVE_BRAINPOOLP256R1 = 3; // 0x3
- field public static final int EASY_CONNECT_CRYPTOGRAPHY_CURVE_BRAINPOOLP384R1 = 4; // 0x4
- field public static final int EASY_CONNECT_CRYPTOGRAPHY_CURVE_BRAINPOOLP512R1 = 5; // 0x5
- field public static final int EASY_CONNECT_CRYPTOGRAPHY_CURVE_DEFAULT = 0; // 0x0
- field public static final int EASY_CONNECT_CRYPTOGRAPHY_CURVE_PRIME256V1 = 0; // 0x0
- field public static final int EASY_CONNECT_CRYPTOGRAPHY_CURVE_SECP384R1 = 1; // 0x1
- field public static final int EASY_CONNECT_CRYPTOGRAPHY_CURVE_SECP521R1 = 2; // 0x2
- field public static final int EASY_CONNECT_DEVICE_INFO_MAXIMUM_LENGTH = 40; // 0x28
- field public static final int EASY_CONNECT_NETWORK_ROLE_AP = 1; // 0x1
- field public static final int EASY_CONNECT_NETWORK_ROLE_STA = 0; // 0x0
- field public static final String EXTRA_CHANGE_REASON = "changeReason";
- field @Deprecated public static final String EXTRA_LINK_PROPERTIES = "android.net.wifi.extra.LINK_PROPERTIES";
- field @Deprecated public static final String EXTRA_MULTIPLE_NETWORKS_CHANGED = "multipleChanges";
- field public static final String EXTRA_OSU_NETWORK = "android.net.wifi.extra.OSU_NETWORK";
- field public static final String EXTRA_PREVIOUS_WIFI_AP_STATE = "previous_wifi_state";
- field public static final String EXTRA_URL = "android.net.wifi.extra.URL";
- field public static final String EXTRA_WIFI_AP_FAILURE_REASON = "android.net.wifi.extra.WIFI_AP_FAILURE_REASON";
- field public static final String EXTRA_WIFI_AP_INTERFACE_NAME = "android.net.wifi.extra.WIFI_AP_INTERFACE_NAME";
- field public static final String EXTRA_WIFI_AP_MODE = "android.net.wifi.extra.WIFI_AP_MODE";
- field public static final String EXTRA_WIFI_AP_STATE = "wifi_state";
- field @Deprecated public static final String EXTRA_WIFI_CONFIGURATION = "wifiConfiguration";
- field public static final String EXTRA_WIFI_CREDENTIAL_EVENT_TYPE = "et";
- field public static final String EXTRA_WIFI_CREDENTIAL_SSID = "ssid";
- field public static final int IFACE_IP_MODE_CONFIGURATION_ERROR = 0; // 0x0
- field public static final int IFACE_IP_MODE_LOCAL_ONLY = 2; // 0x2
- field public static final int IFACE_IP_MODE_TETHERED = 1; // 0x1
- field public static final int IFACE_IP_MODE_UNSPECIFIED = -1; // 0xffffffff
- field public static final int PASSPOINT_HOME_NETWORK = 0; // 0x0
- field public static final int PASSPOINT_ROAMING_NETWORK = 1; // 0x1
- field public static final int SAP_CLIENT_BLOCK_REASON_CODE_BLOCKED_BY_USER = 0; // 0x0
- field public static final int SAP_CLIENT_BLOCK_REASON_CODE_NO_MORE_STAS = 1; // 0x1
- field public static final int SAP_START_FAILURE_GENERAL = 0; // 0x0
- field public static final int SAP_START_FAILURE_NO_CHANNEL = 1; // 0x1
- field public static final int SAP_START_FAILURE_UNSUPPORTED_CONFIGURATION = 2; // 0x2
- field public static final String WIFI_AP_STATE_CHANGED_ACTION = "android.net.wifi.WIFI_AP_STATE_CHANGED";
- field public static final int WIFI_AP_STATE_DISABLED = 11; // 0xb
- field public static final int WIFI_AP_STATE_DISABLING = 10; // 0xa
- field public static final int WIFI_AP_STATE_ENABLED = 13; // 0xd
- field public static final int WIFI_AP_STATE_ENABLING = 12; // 0xc
- field public static final int WIFI_AP_STATE_FAILED = 14; // 0xe
- field public static final String WIFI_CREDENTIAL_CHANGED_ACTION = "android.net.wifi.WIFI_CREDENTIAL_CHANGED";
- field public static final int WIFI_CREDENTIAL_FORGOT = 1; // 0x1
- field public static final int WIFI_CREDENTIAL_SAVED = 0; // 0x0
- }
-
- public static interface WifiManager.ActionListener {
- method public void onFailure(int);
- method public void onSuccess();
- }
-
- public abstract static class WifiManager.CoexCallback {
- ctor public WifiManager.CoexCallback();
- method public abstract void onCoexUnsafeChannelsChanged();
- }
-
- public static interface WifiManager.NetworkRequestMatchCallback {
- method public default void onAbort();
- method public default void onMatch(@NonNull java.util.List<android.net.wifi.ScanResult>);
- method public default void onUserSelectionCallbackRegistration(@NonNull android.net.wifi.WifiManager.NetworkRequestUserSelectionCallback);
- method public default void onUserSelectionConnectFailure(@NonNull android.net.wifi.WifiConfiguration);
- method public default void onUserSelectionConnectSuccess(@NonNull android.net.wifi.WifiConfiguration);
- }
-
- public static interface WifiManager.NetworkRequestUserSelectionCallback {
- method public default void reject();
- method public default void select(@NonNull android.net.wifi.WifiConfiguration);
- }
-
- public static interface WifiManager.OnWifiActivityEnergyInfoListener {
- method public void onWifiActivityEnergyInfo(@Nullable android.os.connectivity.WifiActivityEnergyInfo);
- }
-
- public static interface WifiManager.OnWifiUsabilityStatsListener {
- method public void onWifiUsabilityStats(int, boolean, @NonNull android.net.wifi.WifiUsabilityStatsEntry);
- }
-
- public static interface WifiManager.ScoreUpdateObserver {
- method public void notifyScoreUpdate(int, int);
- method public void triggerUpdateOfWifiUsabilityStats(int);
- }
-
- public static interface WifiManager.SoftApCallback {
- method public default void onBlockedClientConnecting(@NonNull android.net.wifi.WifiClient, int);
- 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);
- }
-
- public static interface WifiManager.TrafficStateCallback {
- method public void onStateChanged(int);
- field public static final int DATA_ACTIVITY_IN = 1; // 0x1
- field public static final int DATA_ACTIVITY_INOUT = 3; // 0x3
- field public static final int DATA_ACTIVITY_NONE = 0; // 0x0
- field public static final int DATA_ACTIVITY_OUT = 2; // 0x2
- }
-
- public static interface WifiManager.WifiConnectedNetworkScorer {
- method public void onSetScoreUpdateObserver(@NonNull android.net.wifi.WifiManager.ScoreUpdateObserver);
- method public void onStart(int);
- method public void onStop(int);
- }
-
- public class WifiNetworkConnectionStatistics implements android.os.Parcelable {
- ctor public WifiNetworkConnectionStatistics(int, int);
- ctor public WifiNetworkConnectionStatistics();
- ctor public WifiNetworkConnectionStatistics(android.net.wifi.WifiNetworkConnectionStatistics);
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiNetworkConnectionStatistics> CREATOR;
- field public int numConnection;
- field public int numUsage;
- }
-
- public final class WifiNetworkSuggestion implements android.os.Parcelable {
- method @NonNull public android.net.wifi.WifiConfiguration getWifiConfiguration();
- method public boolean isOemPaid();
- method public boolean isOemPrivate();
- }
-
- public static final class WifiNetworkSuggestion.Builder {
- method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_CARRIER_PROVISIONING) public android.net.wifi.WifiNetworkSuggestion.Builder setCarrierId(int);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setOemPaid(boolean);
- method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setOemPrivate(boolean);
- }
-
- public class WifiScanner {
- method @Deprecated public void configureWifiChange(int, int, int, int, int, android.net.wifi.WifiScanner.BssidInfo[]);
- method @Deprecated public void configureWifiChange(android.net.wifi.WifiScanner.WifiChangeSettings);
- method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public java.util.List<java.lang.Integer> getAvailableChannels(int);
- method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean getScanResults();
- method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public java.util.List<android.net.wifi.ScanResult> getSingleScanResults();
- method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void registerScanListener(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiScanner.ScanListener);
- method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void setScanningEnabled(boolean);
- method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startBackgroundScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener);
- method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startBackgroundScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener, android.os.WorkSource);
- method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener);
- method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener, android.os.WorkSource);
- method @Deprecated public void startTrackingBssids(android.net.wifi.WifiScanner.BssidInfo[], int, android.net.wifi.WifiScanner.BssidListener);
- method @Deprecated public void startTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
- method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void stopBackgroundScan(android.net.wifi.WifiScanner.ScanListener);
- method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void stopScan(android.net.wifi.WifiScanner.ScanListener);
- method @Deprecated public void stopTrackingBssids(android.net.wifi.WifiScanner.BssidListener);
- method @Deprecated public void stopTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
- method public void unregisterScanListener(@NonNull android.net.wifi.WifiScanner.ScanListener);
- field public static final int MAX_SCAN_PERIOD_MS = 1024000; // 0xfa000
- field public static final int MIN_SCAN_PERIOD_MS = 1000; // 0x3e8
- field public static final int REASON_DUPLICATE_REQEUST = -5; // 0xfffffffb
- field public static final int REASON_INVALID_LISTENER = -2; // 0xfffffffe
- field public static final int REASON_INVALID_REQUEST = -3; // 0xfffffffd
- field public static final int REASON_NOT_AUTHORIZED = -4; // 0xfffffffc
- field public static final int REASON_SUCCEEDED = 0; // 0x0
- field public static final int REASON_UNSPECIFIED = -1; // 0xffffffff
- field @Deprecated public static final int REPORT_EVENT_AFTER_BUFFER_FULL = 0; // 0x0
- field public static final int REPORT_EVENT_AFTER_EACH_SCAN = 1; // 0x1
- field public static final int REPORT_EVENT_FULL_SCAN_RESULT = 2; // 0x2
- field public static final int REPORT_EVENT_NO_BATCH = 4; // 0x4
- field public static final int SCAN_TYPE_HIGH_ACCURACY = 2; // 0x2
- field public static final int SCAN_TYPE_LOW_LATENCY = 0; // 0x0
- field public static final int SCAN_TYPE_LOW_POWER = 1; // 0x1
- field public static final int WIFI_BAND_24_5_6_GHZ = 11; // 0xb
- field public static final int WIFI_BAND_24_5_WITH_DFS_6_GHZ = 15; // 0xf
- field public static final int WIFI_BAND_24_GHZ = 1; // 0x1
- field public static final int WIFI_BAND_5_GHZ = 2; // 0x2
- field public static final int WIFI_BAND_5_GHZ_DFS_ONLY = 4; // 0x4
- field public static final int WIFI_BAND_5_GHZ_WITH_DFS = 6; // 0x6
- field public static final int WIFI_BAND_60_GHZ = 16; // 0x10
- field public static final int WIFI_BAND_6_GHZ = 8; // 0x8
- field public static final int WIFI_BAND_BOTH = 3; // 0x3
- field public static final int WIFI_BAND_BOTH_WITH_DFS = 7; // 0x7
- field public static final int WIFI_BAND_UNSPECIFIED = 0; // 0x0
- }
-
- public static interface WifiScanner.ActionListener {
- method public void onFailure(int, String);
- method public void onSuccess();
- }
-
- @Deprecated public static class WifiScanner.BssidInfo {
- ctor @Deprecated public WifiScanner.BssidInfo();
- field @Deprecated public String bssid;
- field @Deprecated public int frequencyHint;
- field @Deprecated public int high;
- field @Deprecated public int low;
- }
-
- @Deprecated public static interface WifiScanner.BssidListener extends android.net.wifi.WifiScanner.ActionListener {
- method @Deprecated public void onFound(android.net.wifi.ScanResult[]);
- method @Deprecated public void onLost(android.net.wifi.ScanResult[]);
- }
-
- public static class WifiScanner.ChannelSpec {
- ctor public WifiScanner.ChannelSpec(int);
- field public int frequency;
- }
-
- @Deprecated public static class WifiScanner.HotlistSettings implements android.os.Parcelable {
- ctor @Deprecated public WifiScanner.HotlistSettings();
- field @Deprecated public int apLostThreshold;
- field @Deprecated public android.net.wifi.WifiScanner.BssidInfo[] bssidInfos;
- }
-
- public static class WifiScanner.ParcelableScanData implements android.os.Parcelable {
- ctor public WifiScanner.ParcelableScanData(android.net.wifi.WifiScanner.ScanData[]);
- method public android.net.wifi.WifiScanner.ScanData[] getResults();
- field public android.net.wifi.WifiScanner.ScanData[] mResults;
- }
-
- public static class WifiScanner.ParcelableScanResults implements android.os.Parcelable {
- ctor public WifiScanner.ParcelableScanResults(android.net.wifi.ScanResult[]);
- method public android.net.wifi.ScanResult[] getResults();
- field public android.net.wifi.ScanResult[] mResults;
- }
-
- public static class WifiScanner.ScanData implements android.os.Parcelable {
- ctor public WifiScanner.ScanData(int, int, android.net.wifi.ScanResult[]);
- ctor public WifiScanner.ScanData(android.net.wifi.WifiScanner.ScanData);
- method public int getFlags();
- method public int getId();
- method public android.net.wifi.ScanResult[] getResults();
- }
-
- public static interface WifiScanner.ScanListener extends android.net.wifi.WifiScanner.ActionListener {
- method public void onFullResult(android.net.wifi.ScanResult);
- method @Deprecated public void onPeriodChanged(int);
- method public void onResults(android.net.wifi.WifiScanner.ScanData[]);
- }
-
- public static class WifiScanner.ScanSettings implements android.os.Parcelable {
- ctor public WifiScanner.ScanSettings();
- field public int band;
- field public android.net.wifi.WifiScanner.ChannelSpec[] channels;
- field @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public final java.util.List<android.net.wifi.WifiScanner.ScanSettings.HiddenNetwork> hiddenNetworks;
- field public boolean hideFromAppOps;
- field public boolean ignoreLocationSettings;
- field @Deprecated public int maxPeriodInMs;
- field @Deprecated public int maxScansToCache;
- field @Deprecated public int numBssidsPerScan;
- field @Deprecated public int periodInMs;
- field @Deprecated public int reportEvents;
- field @Deprecated public int stepCount;
- field @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public int type;
- }
-
- public static class WifiScanner.ScanSettings.HiddenNetwork {
- ctor public WifiScanner.ScanSettings.HiddenNetwork(@NonNull String);
- field @NonNull public final String ssid;
- }
-
- @Deprecated public static interface WifiScanner.WifiChangeListener extends android.net.wifi.WifiScanner.ActionListener {
- method @Deprecated public void onChanging(android.net.wifi.ScanResult[]);
- method @Deprecated public void onQuiescence(android.net.wifi.ScanResult[]);
- }
-
- @Deprecated public static class WifiScanner.WifiChangeSettings implements android.os.Parcelable {
- ctor @Deprecated public WifiScanner.WifiChangeSettings();
- field @Deprecated public android.net.wifi.WifiScanner.BssidInfo[] bssidInfos;
- field @Deprecated public int lostApSampleSize;
- field @Deprecated public int minApsBreachingThreshold;
- field @Deprecated public int periodInMs;
- field @Deprecated public int rssiSampleSize;
- field @Deprecated public int unchangedSampleSize;
- }
-
- public final class WifiUsabilityStatsEntry implements android.os.Parcelable {
- method public int describeContents();
- method public int getCellularDataNetworkType();
- method public int getCellularSignalStrengthDb();
- method public int getCellularSignalStrengthDbm();
- method public int getLinkSpeedMbps();
- method public int getProbeElapsedTimeSinceLastUpdateMillis();
- method public int getProbeMcsRateSinceLastUpdate();
- method public int getProbeStatusSinceLastUpdate();
- method public int getRssi();
- method public int getRxLinkSpeedMbps();
- method public long getTimeStampMillis();
- method public long getTotalBackgroundScanTimeMillis();
- method public long getTotalBeaconRx();
- method public long getTotalCcaBusyFreqTimeMillis();
- method public long getTotalHotspot2ScanTimeMillis();
- method public long getTotalNanScanTimeMillis();
- method public long getTotalPnoScanTimeMillis();
- method public long getTotalRadioOnFreqTimeMillis();
- method public long getTotalRadioOnTimeMillis();
- method public long getTotalRadioRxTimeMillis();
- method public long getTotalRadioTxTimeMillis();
- method public long getTotalRoamScanTimeMillis();
- method public long getTotalRxSuccess();
- method public long getTotalScanTimeMillis();
- method public long getTotalTxBad();
- method public long getTotalTxRetries();
- method public long getTotalTxSuccess();
- method public boolean isSameRegisteredCell();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiUsabilityStatsEntry> CREATOR;
- field public static final int PROBE_STATUS_FAILURE = 3; // 0x3
- field public static final int PROBE_STATUS_NO_PROBE = 1; // 0x1
- field public static final int PROBE_STATUS_SUCCESS = 2; // 0x2
- field public static final int PROBE_STATUS_UNKNOWN = 0; // 0x0
- }
-
-}
-
-package android.net.wifi.aware {
-
- public class DiscoverySession implements java.lang.AutoCloseable {
- method @Deprecated public android.net.NetworkSpecifier createNetworkSpecifierPmk(@NonNull android.net.wifi.aware.PeerHandle, @NonNull byte[]);
- }
-
- public class WifiAwareManager {
- method public void enableInstantCommunicationMode(boolean);
- }
-
- public class WifiAwareSession implements java.lang.AutoCloseable {
- method public android.net.NetworkSpecifier createNetworkSpecifierPmk(int, @NonNull byte[], @NonNull byte[]);
- }
-
-}
-
-package android.net.wifi.hotspot2 {
-
- public final class OsuProvider implements android.os.Parcelable {
- method public int describeContents();
- method @Nullable public String getFriendlyName();
- method @Nullable public android.net.Uri getServerUri();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.hotspot2.OsuProvider> CREATOR;
- }
-
- public final class PasspointConfiguration implements android.os.Parcelable {
- method public int getMeteredOverride();
- method public boolean isAutojoinEnabled();
- method public boolean isMacRandomizationEnabled();
- }
-
- public abstract class ProvisioningCallback {
- ctor public ProvisioningCallback();
- method public abstract void onProvisioningComplete();
- method public abstract void onProvisioningFailure(int);
- method public abstract void onProvisioningStatus(int);
- field public static final int OSU_FAILURE_ADD_PASSPOINT_CONFIGURATION = 22; // 0x16
- field public static final int OSU_FAILURE_AP_CONNECTION = 1; // 0x1
- field public static final int OSU_FAILURE_INVALID_URL_FORMAT_FOR_OSU = 8; // 0x8
- field public static final int OSU_FAILURE_NO_AAA_SERVER_TRUST_ROOT_NODE = 17; // 0x11
- field public static final int OSU_FAILURE_NO_AAA_TRUST_ROOT_CERTIFICATE = 21; // 0x15
- field public static final int OSU_FAILURE_NO_OSU_ACTIVITY_FOUND = 14; // 0xe
- field public static final int OSU_FAILURE_NO_POLICY_SERVER_TRUST_ROOT_NODE = 19; // 0x13
- field public static final int OSU_FAILURE_NO_PPS_MO = 16; // 0x10
- field public static final int OSU_FAILURE_NO_REMEDIATION_SERVER_TRUST_ROOT_NODE = 18; // 0x12
- field public static final int OSU_FAILURE_OSU_PROVIDER_NOT_FOUND = 23; // 0x17
- field public static final int OSU_FAILURE_PROVISIONING_ABORTED = 6; // 0x6
- field public static final int OSU_FAILURE_PROVISIONING_NOT_AVAILABLE = 7; // 0x7
- field public static final int OSU_FAILURE_RETRIEVE_TRUST_ROOT_CERTIFICATES = 20; // 0x14
- field public static final int OSU_FAILURE_SERVER_CONNECTION = 3; // 0x3
- field public static final int OSU_FAILURE_SERVER_URL_INVALID = 2; // 0x2
- field public static final int OSU_FAILURE_SERVER_VALIDATION = 4; // 0x4
- field public static final int OSU_FAILURE_SERVICE_PROVIDER_VERIFICATION = 5; // 0x5
- field public static final int OSU_FAILURE_SOAP_MESSAGE_EXCHANGE = 11; // 0xb
- field public static final int OSU_FAILURE_START_REDIRECT_LISTENER = 12; // 0xc
- field public static final int OSU_FAILURE_TIMED_OUT_REDIRECT_LISTENER = 13; // 0xd
- field public static final int OSU_FAILURE_UNEXPECTED_COMMAND_TYPE = 9; // 0x9
- field public static final int OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_STATUS = 15; // 0xf
- field public static final int OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_TYPE = 10; // 0xa
- field public static final int OSU_STATUS_AP_CONNECTED = 2; // 0x2
- field public static final int OSU_STATUS_AP_CONNECTING = 1; // 0x1
- field public static final int OSU_STATUS_INIT_SOAP_EXCHANGE = 6; // 0x6
- field public static final int OSU_STATUS_REDIRECT_RESPONSE_RECEIVED = 8; // 0x8
- field public static final int OSU_STATUS_RETRIEVING_TRUST_ROOT_CERTS = 11; // 0xb
- field public static final int OSU_STATUS_SECOND_SOAP_EXCHANGE = 9; // 0x9
- field public static final int OSU_STATUS_SERVER_CONNECTED = 5; // 0x5
- field public static final int OSU_STATUS_SERVER_CONNECTING = 3; // 0x3
- field public static final int OSU_STATUS_SERVER_VALIDATED = 4; // 0x4
- field public static final int OSU_STATUS_THIRD_SOAP_EXCHANGE = 10; // 0xa
- field public static final int OSU_STATUS_WAITING_FOR_REDIRECT_RESPONSE = 7; // 0x7
- }
-
-}
-
-package android.net.wifi.p2p {
-
- public final class WifiP2pGroupList implements android.os.Parcelable {
- method public int describeContents();
- method @NonNull public java.util.List<android.net.wifi.p2p.WifiP2pGroup> getGroupList();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.p2p.WifiP2pGroupList> CREATOR;
- }
-
- public class WifiP2pManager {
- method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.OVERRIDE_WIFI_CONFIG}) public void deletePersistentGroup(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, int, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void factoryReset(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.READ_WIFI_CREDENTIAL}) public void requestPersistentGroupInfo(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @Nullable android.net.wifi.p2p.WifiP2pManager.PersistentGroupInfoListener);
- method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.OVERRIDE_WIFI_CONFIG}) public void setDeviceName(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @NonNull String, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method @RequiresPermission(android.Manifest.permission.CONFIGURE_WIFI_DISPLAY) public void setMiracastMode(int);
- method @RequiresPermission(android.Manifest.permission.CONFIGURE_WIFI_DISPLAY) public void setWfdInfo(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @NonNull android.net.wifi.p2p.WifiP2pWfdInfo, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.OVERRIDE_WIFI_CONFIG}) public void setWifiP2pChannels(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, int, int, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void startListening(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void stopListening(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
- field public static final String ACTION_WIFI_P2P_PERSISTENT_GROUPS_CHANGED = "android.net.wifi.p2p.action.WIFI_P2P_PERSISTENT_GROUPS_CHANGED";
- field public static final int MIRACAST_DISABLED = 0; // 0x0
- field public static final int MIRACAST_SINK = 2; // 0x2
- field public static final int MIRACAST_SOURCE = 1; // 0x1
- }
-
- public static interface WifiP2pManager.PersistentGroupInfoListener {
- method public void onPersistentGroupInfoAvailable(@NonNull android.net.wifi.p2p.WifiP2pGroupList);
- }
-
-}
-
-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);
- }
-
- public final class RangingResult implements android.os.Parcelable {
- method @NonNull public byte[] getLci();
- method @NonNull public byte[] getLcr();
- }
-
- public final class ResponderConfig implements android.os.Parcelable {
- ctor public ResponderConfig(@NonNull android.net.MacAddress, int, boolean, int, int, int, int, int);
- ctor public ResponderConfig(@NonNull android.net.wifi.aware.PeerHandle, int, boolean, int, int, int, int, int);
- method public int describeContents();
- method public static android.net.wifi.rtt.ResponderConfig fromScanResult(android.net.wifi.ScanResult);
- method public static android.net.wifi.rtt.ResponderConfig fromWifiAwarePeerHandleWithDefaults(android.net.wifi.aware.PeerHandle);
- method public static android.net.wifi.rtt.ResponderConfig fromWifiAwarePeerMacAddressWithDefaults(android.net.MacAddress);
- method public void writeToParcel(android.os.Parcel, int);
- field public static final int CHANNEL_WIDTH_160MHZ = 3; // 0x3
- field public static final int CHANNEL_WIDTH_20MHZ = 0; // 0x0
- field public static final int CHANNEL_WIDTH_40MHZ = 1; // 0x1
- field public static final int CHANNEL_WIDTH_80MHZ = 2; // 0x2
- field public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 4; // 0x4
- field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.rtt.ResponderConfig> CREATOR;
- field public static final int PREAMBLE_HE = 3; // 0x3
- field public static final int PREAMBLE_HT = 1; // 0x1
- field public static final int PREAMBLE_LEGACY = 0; // 0x0
- field public static final int PREAMBLE_VHT = 2; // 0x2
- field public static final int RESPONDER_AP = 0; // 0x0
- field public static final int RESPONDER_AWARE = 4; // 0x4
- field public static final int RESPONDER_P2P_CLIENT = 3; // 0x3
- field public static final int RESPONDER_P2P_GO = 2; // 0x2
- field public static final int RESPONDER_STA = 1; // 0x1
- field public final int centerFreq0;
- field public final int centerFreq1;
- field public final int channelWidth;
- field public final int frequency;
- field public final android.net.MacAddress macAddress;
- field public final android.net.wifi.aware.PeerHandle peerHandle;
- field public final int preamble;
- field public final int responderType;
- field public final boolean supports80211mc;
- }
-
- public final class ResponderLocation implements android.os.Parcelable {
- method public boolean getExtraInfoOnAssociationIndication();
- }
-
- public class WifiRttManager {
- method @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE}) public void cancelRanging(@Nullable android.os.WorkSource);
- method @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.CHANGE_WIFI_STATE, android.Manifest.permission.ACCESS_WIFI_STATE}) public void startRanging(@Nullable android.os.WorkSource, @NonNull android.net.wifi.rtt.RangingRequest, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.rtt.RangingResultCallback);
- }
-
-}
-
diff --git a/wifi/api/system-lint-baseline.txt b/wifi/api/system-lint-baseline.txt
deleted file mode 100644
index 9a3b66a..0000000
--- a/wifi/api/system-lint-baseline.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-// Baseline format: 1.0
-MissingGetterMatchingBuilder: android.net.wifi.rtt.RangingRequest.Builder#addResponder(android.net.wifi.rtt.ResponderConfig):
-
-
-
-MissingNullability: android.net.wifi.rtt.RangingRequest.Builder#addResponder(android.net.wifi.rtt.ResponderConfig):
-
-
-
-MutableBareField: android.net.wifi.WifiConfiguration#carrierMerged:
-
-MutableBareField: android.net.wifi.WifiConfiguration#subscriptionId:
- Bare field subscriptionId must be marked final, or moved behind accessors if mutable
diff --git a/wifi/api/system-removed.txt b/wifi/api/system-removed.txt
deleted file mode 100644
index a2d0dff..0000000
--- a/wifi/api/system-removed.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-// Signature format: 2.0
-package android.net.wifi {
-
- @Deprecated public class BatchedScanResult implements android.os.Parcelable {
- ctor public BatchedScanResult();
- ctor public BatchedScanResult(android.net.wifi.BatchedScanResult);
- field public final java.util.List<android.net.wifi.ScanResult> scanResults;
- field public boolean truncated;
- }
-
- public final class ScanResult implements android.os.Parcelable {
- field public boolean untrusted;
- }
-
-}
-
diff --git a/wifi/jarjar-rules.txt b/wifi/jarjar-rules.txt
deleted file mode 100644
index 2331c2f..0000000
--- a/wifi/jarjar-rules.txt
+++ /dev/null
@@ -1,121 +0,0 @@
-## used by service-wifi ##
-
-# Network Stack AIDL interface.
-rule android.net.DataStallReportParcelable* com.android.wifi.x.@0
-rule android.net.DhcpResultsParcelable* com.android.wifi.x.@0
-rule android.net.IIpMemoryStore* com.android.wifi.x.@0
-rule android.net.IIpMemoryStoreCallbacks* com.android.wifi.x.@0
-rule android.net.INetd* com.android.wifi.x.@0
-rule android.net.INetdUnsolicitedEventListener* com.android.wifi.x.@0
-rule android.net.INetworkStackConnector* com.android.wifi.x.@0
-rule android.net.InformationElementParcelable* com.android.wifi.x.@0
-rule android.net.InitialConfigurationParcelable* com.android.wifi.x.@0
-rule android.net.InterfaceConfigurationParcel* com.android.wifi.x.@0
-rule android.net.Layer2InformationParcelable* com.android.wifi.x.@0
-rule android.net.Layer2PacketParcelable* com.android.wifi.x.@0
-rule android.net.MarkMaskParcel* com.android.wifi.x.@0
-rule android.net.NattKeepalivePacketDataParcelable* com.android.wifi.x.@0
-rule android.net.NetworkTestResultParcelable* com.android.wifi.x.@0
-rule android.net.PrivateDnsConfigParcel* com.android.wifi.x.@0
-rule android.net.ProvisioningConfigurationParcelable* com.android.wifi.x.@0
-rule android.net.ResolverParamsParcel* com.android.wifi.x.@0
-rule android.net.RouteInfoParcel* com.android.wifi.x.@0
-rule android.net.ScanResultInfoParcelable* com.android.wifi.x.@0
-rule android.net.TcpKeepalivePacketDataParcelable* com.android.wifi.x.@0
-rule android.net.TetherConfigParcel* com.android.wifi.x.@0
-rule android.net.TetherOffloadRuleParcel* com.android.wifi.x.@0
-rule android.net.TetherStatsParcel* com.android.wifi.x.@0
-rule android.net.UidRangeParcel* com.android.wifi.x.@0
-rule android.net.dhcp.DhcpLeaseParcelable* com.android.wifi.x.@0
-rule android.net.dhcp.DhcpServingParamsParcel* com.android.wifi.x.@0
-rule android.net.ip.IIpClient* com.android.wifi.x.@0
-rule android.net.ip.IIpClientCallbacks* com.android.wifi.x.@0
-rule android.net.ipmemorystore.Blob* com.android.wifi.x.@0
-rule android.net.ipmemorystore.IOnBlobRetrievedListener* com.android.wifi.x.@0
-rule android.net.ipmemorystore.IOnStatusAndCountListener* com.android.wifi.x.@0
-rule android.net.ipmemorystore.IOnStatusListener* com.android.wifi.x.@0
-rule android.net.ipmemorystore.NetworkAttributesParcelable* com.android.wifi.x.@0
-rule android.net.ipmemorystore.SameL3NetworkResponseParcelable* com.android.wifi.x.@0
-rule android.net.ipmemorystore.StatusParcelable* com.android.wifi.x.@0
-rule android.net.networkstack.aidl.** com.android.wifi.x.@0
-
-# Net utils (includes Network Stack helper classes).
-rule android.net.DhcpResults* com.android.wifi.x.@0
-rule android.net.InterfaceConfiguration* com.android.wifi.x.@0
-rule android.net.IpMemoryStore* com.android.wifi.x.@0
-rule android.net.NetworkMonitorManager* com.android.wifi.x.@0
-rule android.net.NetworkFactory* com.android.wifi.x.@0
-rule android.net.ip.IpClientCallbacks* com.android.wifi.x.@0
-rule android.net.ip.IpClientManager* com.android.wifi.x.@0
-rule android.net.ip.IpClientUtil* com.android.wifi.x.@0
-rule android.net.ipmemorystore.NetworkAttributes* com.android.wifi.x.@0
-rule android.net.ipmemorystore.OnBlobRetrievedListener* com.android.wifi.x.@0
-rule android.net.ipmemorystore.OnDeleteStatusListener* com.android.wifi.x.@0
-rule android.net.ipmemorystore.OnStatusListener* com.android.wifi.x.@0
-rule android.net.ipmemorystore.Status* com.android.wifi.x.@0
-rule android.net.networkstack.ModuleNetworkStackClient* com.android.wifi.x.@0
-rule android.net.networkstack.NetworkStackClientBase* com.android.wifi.x.@0
-rule android.net.shared.InetAddressUtils* com.android.wifi.x.@0
-rule android.net.shared.InitialConfiguration* com.android.wifi.x.@0
-rule android.net.shared.IpConfigurationParcelableUtil* com.android.wifi.x.@0
-rule android.net.shared.Layer2Information* com.android.wifi.x.@0
-rule android.net.shared.LinkPropertiesParcelableUtil* com.android.wifi.x.@0
-rule android.net.shared.NetdUtils* com.android.wifi.x.@0
-rule android.net.shared.NetworkMonitorUtils* com.android.wifi.x.@0
-rule android.net.shared.ParcelableUtil* com.android.wifi.x.@0
-rule android.net.shared.PrivateDnsConfig* com.android.wifi.x.@0
-rule android.net.shared.ProvisioningConfiguration* com.android.wifi.x.@0
-rule android.net.shared.RouteUtils* com.android.wifi.x.@0
-rule android.net.util.KeepalivePacketDataUtil* com.android.wifi.x.@0
-rule android.net.util.NetworkConstants* com.android.wifi.x.@0
-rule android.net.util.InterfaceParams* com.android.wifi.x.@0
-rule android.net.util.SharedLog* com.android.wifi.x.@0
-rule android.net.util.NetUtils* com.android.wifi.x.@0
-
-rule androidx.annotation.** com.android.wifi.x.@0
-
-# We don't jar-jar the entire package because, we still use some classes (like
-# AsyncChannel in com.android.internal.util) from these packages which are not
-# inside our jar (currently in framework.jar, but will be in wifisdk.jar in the future).
-rule com.android.internal.util.FastXmlSerializer* com.android.wifi.x.@0
-rule com.android.internal.util.HexDump* com.android.wifi.x.@0
-rule com.android.internal.util.IState* com.android.wifi.x.@0
-rule com.android.internal.util.MessageUtils* com.android.wifi.x.@0
-rule com.android.internal.util.State* com.android.wifi.x.@0
-rule com.android.internal.util.StateMachine* com.android.wifi.x.@0
-rule com.android.internal.util.WakeupMessage* com.android.wifi.x.@0
-
-rule android.util.BackupUtils* com.android.wifi.x.@0
-rule android.util.LocalLog* com.android.wifi.x.@0
-rule android.util.Rational* com.android.wifi.x.@0
-
-# Use our statically linked bouncy castle library
-rule org.bouncycastle.** com.android.wifi.x.@0
-# Use our statically linked protobuf library
-rule com.google.protobuf.** com.android.wifi.x.@0
-# use statically linked SystemMessageProto
-rule com.android.internal.messages.SystemMessageProto* com.android.wifi.x.@0
-# Use our statically linked PlatformProperties library
-rule android.sysprop.** com.android.wifi.x.@0
-# Use our statically linked HIDL stubs
-# Note: android.hardware.wifi.** is used by various wifi feature flags. This unfortunately is also the namespace
-# used by vendor HAL stubs. So, this rule is intentionally weird to try and filter the vendor HAL stubs only.
-rule android.hardware.wifi.V** com.android.wifi.x.@0
-rule android.hardware.wifi.supplicant.** com.android.wifi.x.@0
-rule android.hardware.wifi.hostapd.** com.android.wifi.x.@0
-rule android.hidl.** com.android.wifi.x.@0
-# Use our statically linked ksoap2
-rule org.ksoap2.** com.android.wifi.x.@0
-# Use our statically linked nanohttpd
-rule fi.iki.elonen.** com.android.wifi.x.@0
-
-## used by both framework-wifi and service-wifi ##
-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
-rule com.android.internal.util.AsyncService* com.android.wifi.x.@0
-rule com.android.internal.util.Preconditions* com.android.wifi.x.@0
-rule com.android.internal.util.Protocol* com.android.wifi.x.@0
-
-rule com.android.net.module.util.** com.android.wifi.x.@0
-rule com.android.modules.utils.** com.android.wifi.x.@0
diff --git a/wifi/java/Android.bp b/wifi/java/Android.bp
new file mode 100644
index 0000000..b35b4be
--- /dev/null
+++ b/wifi/java/Android.bp
@@ -0,0 +1,35 @@
+// 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.
+
+// This directory contains framework Wifi APIs that are not part of the Wifi module (i.e. not
+// updatable), and are generally only called by the Wifi module.
+
+// necessary since we only want the `path` property to only refer to these files
+filegroup {
+ name: "framework-wifi-non-updatable-sources-internal",
+ srcs: ["src/**/*.java"],
+ path: "src",
+ visibility: ["//visibility:private"],
+}
+
+filegroup {
+ name: "framework-wifi-non-updatable-sources",
+ srcs: [
+ // TODO(b/146011398) package android.net.wifi is now split amongst 2 jars: framework.jar and
+ // framework-wifi.jar. This is not a good idea, should move WifiNetworkScoreCache
+ // to a separate package.
+ ":framework-wifi-non-updatable-sources-internal",
+ ":libwificond_ipc_aidl",
+ ],
+}
diff --git a/wifi/java/android/net/wifi/AnqpInformationElement.java b/wifi/java/android/net/wifi/AnqpInformationElement.java
deleted file mode 100644
index 47b7129..0000000
--- a/wifi/java/android/net/wifi/AnqpInformationElement.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2016 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;
-
-/**
- * This object contains the payload of an ANQP element.
- * Vendor id is the vendor ID for the element, or 0 if it is an 802.11(u) element.
- * Hotspot 2.0 uses the WFA Vendor ID which is 0x506f9a
- * The payload contains the bytes of the payload, starting after the length octet(s).
- * @hide
- */
-public class AnqpInformationElement {
- public static final int HOTSPOT20_VENDOR_ID = 0x506f9a;
-
- public static final int ANQP_QUERY_LIST = 256;
- public static final int ANQP_CAPABILITY_LIST = 257;
- public static final int ANQP_VENUE_NAME = 258;
- public static final int ANQP_EMERGENCY_NUMBER = 259;
- public static final int ANQP_NWK_AUTH_TYPE = 260;
- public static final int ANQP_ROAMING_CONSORTIUM = 261;
- public static final int ANQP_IP_ADDR_AVAILABILITY = 262;
- public static final int ANQP_NAI_REALM = 263;
- public static final int ANQP_3GPP_NETWORK = 264;
- public static final int ANQP_GEO_LOC = 265;
- public static final int ANQP_CIVIC_LOC = 266;
- public static final int ANQP_LOC_URI = 267;
- public static final int ANQP_DOM_NAME = 268;
- public static final int ANQP_EMERGENCY_ALERT = 269;
- public static final int ANQP_TDLS_CAP = 270;
- public static final int ANQP_EMERGENCY_NAI = 271;
- public static final int ANQP_NEIGHBOR_REPORT = 272;
- public static final int ANQP_VENDOR_SPEC = 56797;
-
- public static final int HS_QUERY_LIST = 1;
- public static final int HS_CAPABILITY_LIST = 2;
- public static final int HS_FRIENDLY_NAME = 3;
- public static final int HS_WAN_METRICS = 4;
- public static final int HS_CONN_CAPABILITY = 5;
- public static final int HS_NAI_HOME_REALM_QUERY = 6;
- public static final int HS_OPERATING_CLASS = 7;
- public static final int HS_OSU_PROVIDERS = 8;
- public static final int HS_ICON_REQUEST = 10;
- public static final int HS_ICON_FILE = 11;
-
- private final int mVendorId;
- private final int mElementId;
- private final byte[] mPayload;
-
- public AnqpInformationElement(int vendorId, int elementId, byte[] payload) {
- mVendorId = vendorId;
- mElementId = elementId;
- mPayload = payload;
- }
-
- public int getVendorId() {
- return mVendorId;
- }
-
- public int getElementId() {
- return mElementId;
- }
-
- public byte[] getPayload() {
- return mPayload;
- }
-}
diff --git a/wifi/java/android/net/wifi/BatchedScanResult.java b/wifi/java/android/net/wifi/BatchedScanResult.java
deleted file mode 100644
index ed8845dd..0000000
--- a/wifi/java/android/net/wifi/BatchedScanResult.java
+++ /dev/null
@@ -1,97 +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 android.net.wifi;
-
-import android.os.Parcelable;
-import android.annotation.SystemApi;
-import android.os.Parcel;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Describes the Results of a batched set of wifi scans where the firmware performs many
- * scans and stores the timestamped results without waking the main processor each time.
- * @hide
- * @removed
- */
-@Deprecated
-@SystemApi
-public class BatchedScanResult implements Parcelable {
- private static final String TAG = "BatchedScanResult";
-
- /** Inidcates this scan was interrupted and may only have partial results. */
- public boolean truncated;
-
- /** The result of this particular scan. */
- public final List<ScanResult> scanResults = new ArrayList<ScanResult>();
-
-
- public BatchedScanResult() {
- }
-
- public BatchedScanResult(BatchedScanResult source) {
- truncated = source.truncated;
- for (ScanResult s : source.scanResults) scanResults.add(new ScanResult(s));
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
-
- sb.append("BatchedScanResult: ").
- append("truncated: ").append(String.valueOf(truncated)).
- append("scanResults: [");
- for (ScanResult s : scanResults) {
- sb.append(" <").append(s.toString()).append("> ");
- }
- sb.append(" ]");
- return sb.toString();
- }
-
- /** Implement the Parcelable interface {@hide} */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(truncated ? 1 : 0);
- dest.writeInt(scanResults.size());
- for (ScanResult s : scanResults) {
- s.writeToParcel(dest, flags);
- }
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final @android.annotation.NonNull Creator<BatchedScanResult> CREATOR =
- new Creator<BatchedScanResult>() {
- public BatchedScanResult createFromParcel(Parcel in) {
- BatchedScanResult result = new BatchedScanResult();
- result.truncated = (in.readInt() == 1);
- int count = in.readInt();
- while (count-- > 0) {
- result.scanResults.add(ScanResult.CREATOR.createFromParcel(in));
- }
- return result;
- }
-
- public BatchedScanResult[] newArray(int size) {
- return new BatchedScanResult[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/CoexUnsafeChannel.java b/wifi/java/android/net/wifi/CoexUnsafeChannel.java
deleted file mode 100644
index 3f9efa0..0000000
--- a/wifi/java/android/net/wifi/CoexUnsafeChannel.java
+++ /dev/null
@@ -1,176 +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 android.net.wifi;
-
-import static android.net.wifi.WifiScanner.WIFI_BAND_24_GHZ;
-import static android.net.wifi.WifiScanner.WIFI_BAND_5_GHZ;
-import static android.net.wifi.WifiScanner.WIFI_BAND_6_GHZ;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SystemApi;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.util.Objects;
-
-/**
- * Data structure class representing a Wi-Fi channel that would cause interference to/receive
- * interference from the active cellular channels and should be avoided.
- *
- * If {@link #isPowerCapAvailable()} is {@code true}, then a valid power cap value is available
- * through {@link #getPowerCapDbm()} to be used if this channel cannot be avoided. If {@code false},
- * then {@link #getPowerCapDbm()} throws an IllegalStateException and the channel will not need to
- * cap its power.
- *
- * @hide
- */
-@SystemApi
-public final class CoexUnsafeChannel implements Parcelable {
- private @WifiAnnotations.WifiBandBasic int mBand;
- private int mChannel;
- private boolean mIsPowerCapAvailable = false;
- private int mPowerCapDbm;
-
- /**
- * Constructor for a CoexUnsafeChannel with no power cap specified.
- * @param band One of {@link WifiAnnotations.WifiBandBasic}
- * @param channel Channel number
- */
- public CoexUnsafeChannel(@WifiAnnotations.WifiBandBasic int band, int channel) {
- mBand = band;
- mChannel = channel;
- }
-
- /**
- * Constructor for a CoexUnsafeChannel with power cap specified.
- * @param band One of {@link WifiAnnotations.WifiBandBasic}
- * @param channel Channel number
- * @param powerCapDbm Power cap in dBm
- */
- public CoexUnsafeChannel(@WifiAnnotations.WifiBandBasic int band, int channel,
- int powerCapDbm) {
- mBand = band;
- mChannel = channel;
- setPowerCapDbm(powerCapDbm);
- }
-
- /** Returns the Wi-Fi band of this channel as one of {@link WifiAnnotations.WifiBandBasic} */
- public @WifiAnnotations.WifiBandBasic int getBand() {
- return mBand;
- }
-
- /** Returns the channel number of this channel. */
- public int getChannel() {
- return mChannel;
- }
-
- /** Returns {@code true} if {@link #getPowerCapDbm()} is a valid value, else {@code false} */
- public boolean isPowerCapAvailable() {
- return mIsPowerCapAvailable;
- }
-
- /**
- * Returns the power cap of this channel in dBm. Throws IllegalStateException if
- * {@link #isPowerCapAvailable()} is {@code false}.
- */
- public int getPowerCapDbm() {
- if (!mIsPowerCapAvailable) {
- throw new IllegalStateException("getPowerCapDbm called but power cap is unavailable");
- }
- return mPowerCapDbm;
- }
-
- /** Set the power cap of this channel. */
- public void setPowerCapDbm(int powerCapDbm) {
- mIsPowerCapAvailable = true;
- mPowerCapDbm = powerCapDbm;
- }
-
- @Override
- public boolean equals(@Nullable Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- CoexUnsafeChannel that = (CoexUnsafeChannel) o;
- return mBand == that.mBand
- && mChannel == that.mChannel
- && mIsPowerCapAvailable == that.mIsPowerCapAvailable
- && mPowerCapDbm == that.mPowerCapDbm;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mBand, mChannel, mIsPowerCapAvailable, mPowerCapDbm);
- }
-
- @Override
- public String toString() {
- StringBuilder sj = new StringBuilder("CoexUnsafeChannel{");
- sj.append(mChannel);
- sj.append(", ");
- if (mBand == WIFI_BAND_24_GHZ) {
- sj.append("2.4GHz");
- } else if (mBand == WIFI_BAND_5_GHZ) {
- sj.append("5GHz");
- } else if (mBand == WIFI_BAND_6_GHZ) {
- sj.append("6GHz");
- } else {
- sj.append("UNKNOWN BAND");
- }
- if (mIsPowerCapAvailable) {
- sj.append(", ").append(mPowerCapDbm).append("dBm");
- }
- sj.append('}');
- return sj.toString();
- }
-
- /** Implement the Parcelable interface {@hide} */
- @Override
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(mBand);
- dest.writeInt(mChannel);
- dest.writeBoolean(mIsPowerCapAvailable);
- if (mIsPowerCapAvailable) {
- dest.writeInt(mPowerCapDbm);
- }
- }
-
- /** Implement the Parcelable interface */
- public static final @NonNull Creator<CoexUnsafeChannel> CREATOR =
- new Creator<CoexUnsafeChannel>() {
- public CoexUnsafeChannel createFromParcel(Parcel in) {
- final int band = in.readInt();
- final int channel = in.readInt();
- final boolean isPowerCapAvailable = in.readBoolean();
- if (isPowerCapAvailable) {
- final int powerCapDbm = in.readInt();
- return new CoexUnsafeChannel(band, channel, powerCapDbm);
- }
- return new CoexUnsafeChannel(band, channel);
- }
-
- public CoexUnsafeChannel[] newArray(int size) {
- return new CoexUnsafeChannel[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/EAPConstants.java b/wifi/java/android/net/wifi/EAPConstants.java
deleted file mode 100644
index b5f7c94..0000000
--- a/wifi/java/android/net/wifi/EAPConstants.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Copyright (c) 2016, 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;
-
-/**
- * Utility class containing EAP (Extensible Authentication Protocol) Related constants.
- *
- * @hide
- */
-public final class EAPConstants {
- // Constant definition for EAP types. Refer to
- // http://www.iana.org/assignments/eap-numbers/eap-numbers.xhtml for more info.
- public static final int EAP_MD5 = 4;
- public static final int EAP_OTP = 5;
- public static final int EAP_RSA = 9;
- public static final int EAP_KEA = 11;
- public static final int EAP_KEA_VALIDATE = 12;
- public static final int EAP_TLS = 13;
- public static final int EAP_LEAP = 17;
- public static final int EAP_SIM = 18;
- public static final int EAP_TTLS = 21;
- public static final int EAP_AKA = 23;
- public static final int EAP_3Com = 24;
- public static final int EAP_MSCHAPv2 = 26;
- public static final int EAP_PEAP = 29;
- public static final int EAP_POTP = 32;
- public static final int EAP_ActiontecWireless = 35;
- public static final int EAP_HTTPDigest = 38;
- public static final int EAP_SPEKE = 41;
- public static final int EAP_MOBAC = 42;
- public static final int EAP_FAST = 43;
- public static final int EAP_ZLXEAP = 44;
- public static final int EAP_Link = 45;
- public static final int EAP_PAX = 46;
- public static final int EAP_PSK = 47;
- public static final int EAP_SAKE = 48;
- public static final int EAP_IKEv2 = 49;
- public static final int EAP_AKA_PRIME = 50;
- public static final int EAP_GPSK = 51;
- public static final int EAP_PWD = 52;
- public static final int EAP_EKE = 53;
- public static final int EAP_TEAP = 55;
-}
diff --git a/wifi/java/android/net/wifi/EasyConnectStatusCallback.java b/wifi/java/android/net/wifi/EasyConnectStatusCallback.java
deleted file mode 100644
index ee70255..0000000
--- a/wifi/java/android/net/wifi/EasyConnectStatusCallback.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * 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.net.wifi;
-
-import android.annotation.IntDef;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SystemApi;
-import android.util.SparseArray;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.util.concurrent.Executor;
-
-/**
- * Easy Connect (DPP) Status Callback. Use this callback to get status updates (success, failure,
- * progress) from the Easy Connect operations.
- */
-public abstract class EasyConnectStatusCallback {
- /**
- * Easy Connect R1 Success event: Configuration sent (Configurator mode). This is the last
- * and final Easy Connect event when either the local device or remote device implement R1.
- * If both devices implement R2, this event will never be received, and the
- * {@link #EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_APPLIED} will be received.
- * @hide
- */
- @SystemApi
- public static final int EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_SENT = 0;
-
- /**
- * Easy Connect R2 Success event: Configuration applied by Enrollee (Configurator mode).
- * This is the last and final Easy Connect event when both the local device and remote device
- * implement R2. If either the local device or remote device implement R1, this event will never
- * be received, and the {@link #EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_SENT} will be received.
- * @hide
- */
- @SystemApi
- public static final int EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_APPLIED = 1;
-
- /** @hide */
- @IntDef(prefix = {"EASY_CONNECT_EVENT_SUCCESS_"}, value = {
- EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_SENT,
- EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_APPLIED,
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface EasyConnectSuccessStatusCode {
- }
-
- /**
- * Easy Connect Progress event: Initial authentication with peer succeeded.
- * @hide
- */
- @SystemApi
- public static final int EASY_CONNECT_EVENT_PROGRESS_AUTHENTICATION_SUCCESS = 0;
-
- /**
- * Easy Connect Progress event: Peer requires more time to process bootstrapping.
- * @hide
- */
- @SystemApi
- public static final int EASY_CONNECT_EVENT_PROGRESS_RESPONSE_PENDING = 1;
-
- /**
- * Easy Connect R2 Progress event: Configuration sent to Enrollee, waiting for response
- * @hide
- */
- @SystemApi
- public static final int EASY_CONNECT_EVENT_PROGRESS_CONFIGURATION_SENT_WAITING_RESPONSE = 2;
-
- /**
- * Easy Connect R2 Progress event: Configuration accepted by Enrollee, waiting for response
- * @hide
- */
- @SystemApi
- public static final int EASY_CONNECT_EVENT_PROGRESS_CONFIGURATION_ACCEPTED = 3;
-
- /** @hide */
- @IntDef(prefix = {"EASY_CONNECT_EVENT_PROGRESS_"}, value = {
- EASY_CONNECT_EVENT_PROGRESS_AUTHENTICATION_SUCCESS,
- EASY_CONNECT_EVENT_PROGRESS_RESPONSE_PENDING,
- EASY_CONNECT_EVENT_PROGRESS_CONFIGURATION_SENT_WAITING_RESPONSE,
- EASY_CONNECT_EVENT_PROGRESS_CONFIGURATION_ACCEPTED,
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface EasyConnectProgressStatusCode {
- }
-
- /**
- * Easy Connect Failure event: Scanned QR code is either not a Easy Connect URI, or the Easy
- * Connect URI has errors.
- */
- public static final int EASY_CONNECT_EVENT_FAILURE_INVALID_URI = -1;
-
- /**
- * Easy Connect Failure event: Bootstrapping/Authentication initialization process failure.
- */
- public static final int EASY_CONNECT_EVENT_FAILURE_AUTHENTICATION = -2;
-
- /**
- * Easy Connect Failure event: Both devices are implementing the same role and are incompatible.
- */
- public static final int EASY_CONNECT_EVENT_FAILURE_NOT_COMPATIBLE = -3;
-
- /**
- * Easy Connect Failure event: Configuration process has failed due to malformed message.
- */
- public static final int EASY_CONNECT_EVENT_FAILURE_CONFIGURATION = -4;
-
- /**
- * Easy Connect Failure event: Easy Connect request while in another Easy Connect exchange.
- */
- public static final int EASY_CONNECT_EVENT_FAILURE_BUSY = -5;
-
- /**
- * Easy Connect Failure event: No response from the peer.
- */
- public static final int EASY_CONNECT_EVENT_FAILURE_TIMEOUT = -6;
-
- /**
- * Easy Connect Failure event: General protocol failure.
- */
- public static final int EASY_CONNECT_EVENT_FAILURE_GENERIC = -7;
-
- /**
- * Easy Connect Failure event: Feature or option is not supported.
- */
- public static final int EASY_CONNECT_EVENT_FAILURE_NOT_SUPPORTED = -8;
-
- /**
- * Easy Connect Failure event: Invalid network provided to Easy Connect configurator.
- * Network must either be WPA3-Personal (SAE) or WPA2-Personal (PSK).
- */
- public static final int EASY_CONNECT_EVENT_FAILURE_INVALID_NETWORK = -9;
-
- /**
- * Easy Connect R2 Failure event: Enrollee cannot find the network.
- */
- public static final int EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK = -10;
-
- /**
- * Easy Connect R2 Failure event: Enrollee failed to authenticate with the network.
- */
- public static final int EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION = -11;
-
- /**
- * Easy Connect R2 Failure event: Enrollee rejected the configuration.
- */
- public static final int EASY_CONNECT_EVENT_FAILURE_ENROLLEE_REJECTED_CONFIGURATION = -12;
-
- /**
- * Easy Connect Failure event: System failed to generate DPP URI.
- */
- public static final int EASY_CONNECT_EVENT_FAILURE_URI_GENERATION = -13;
-
- /** @hide */
- @IntDef(prefix = {"EASY_CONNECT_EVENT_FAILURE_"}, value = {
- EASY_CONNECT_EVENT_FAILURE_INVALID_URI,
- EASY_CONNECT_EVENT_FAILURE_AUTHENTICATION,
- EASY_CONNECT_EVENT_FAILURE_NOT_COMPATIBLE,
- EASY_CONNECT_EVENT_FAILURE_CONFIGURATION,
- EASY_CONNECT_EVENT_FAILURE_BUSY,
- EASY_CONNECT_EVENT_FAILURE_TIMEOUT,
- EASY_CONNECT_EVENT_FAILURE_GENERIC,
- EASY_CONNECT_EVENT_FAILURE_NOT_SUPPORTED,
- EASY_CONNECT_EVENT_FAILURE_INVALID_NETWORK,
- EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK,
- EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION,
- EASY_CONNECT_EVENT_FAILURE_ENROLLEE_REJECTED_CONFIGURATION,
- EASY_CONNECT_EVENT_FAILURE_URI_GENERATION,
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface EasyConnectFailureStatusCode {
- }
-
- /** @hide */
- @SystemApi
- public EasyConnectStatusCallback() {
- // Fully-static utility classes must not have constructor
- }
-
- /**
- * Called when local Easy Connect Enrollee successfully receives a new Wi-Fi configuration from
- * the
- * peer Easy Connect configurator. This callback marks the successful end of the Easy Connect
- * current Easy Connect
- * session, and no further callbacks will be called. This callback is the successful outcome
- * of a Easy Connect flow starting with
- * {@link WifiManager#startEasyConnectAsEnrolleeInitiator(String, Executor,
- * EasyConnectStatusCallback)} .
- *
- * @param newNetworkId New Wi-Fi configuration with a network ID received from the configurator
- * @hide
- */
- @SystemApi
- public abstract void onEnrolleeSuccess(int newNetworkId);
-
- /**
- * Called when a Easy Connect success event takes place, except for when configuration is
- * received from an external Configurator. The callback onSuccessConfigReceived will be used in
- * this case. This callback marks the successful end of the current Easy Connect session, and no
- * further callbacks will be called. This callback is the successful outcome of a Easy Connect
- * flow starting with {@link WifiManager#startEasyConnectAsConfiguratorInitiator(String, int,
- * int, Executor,EasyConnectStatusCallback)}.
- *
- * @param code Easy Connect success status code.
- * @hide
- */
- @SystemApi
- public abstract void onConfiguratorSuccess(@EasyConnectSuccessStatusCode int code);
-
- /**
- * Called when a Easy Connect Failure event takes place. This callback marks the unsuccessful
- * end of the current Easy Connect session, and no further callbacks will be called.
- *
- * @param code Easy Connect failure status code.
- * @hide
- */
- @SystemApi
- public void onFailure(@EasyConnectFailureStatusCode int code) {}
-
- /**
- * Called when a Easy Connect Failure event takes place. This callback marks the unsuccessful
- * end of the current Easy Connect session, and no further callbacks will be called.
- *
- * Note: Easy Connect (DPP) R2, provides additional details for the Configurator when the
- * remote Enrollee is unable to connect to a network. The ssid, channelList and bandList
- * inputs are initialized only for the EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK failure
- * code, and the ssid and bandList are initialized for the
- * EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION failure code.
- *
- * @param code Easy Connect failure status code.
- * @param ssid SSID of the network the Enrollee tried to connect to.
- * @param channelListArray List of Global Operating classes and channel sets the Enrollee used
- * to scan to find the network, see the "DPP Connection Status Object"
- * section in the specification for the format, and Table E-4 in
- * IEEE Std 802.11-2016 - Global operating classes for more details.
- * The sparse array key is the Global Operating class, and the value
- * is an integer array of Wi-Fi channels.
- * @param operatingClassArray Array of bands the Enrollee supports as expressed as the Global
- * Operating Class, see Table E-4 in IEEE Std 802.11-2016 - Global
- * operating classes.
- * @hide
- */
- @SystemApi
- public void onFailure(@EasyConnectFailureStatusCode int code, @Nullable String ssid,
- @NonNull SparseArray<int[]> channelListArray, @NonNull int[] operatingClassArray) {
- onFailure(code);
- }
-
- /**
- * Called when Easy Connect events that indicate progress take place. Can be used by UI elements
- * to show progress.
- *
- * @param code Easy Connect progress status code.
- * @hide
- */
- @SystemApi
- public abstract void onProgress(@EasyConnectProgressStatusCode int code);
-
- /**
- * Called when local Easy Connect Responder successfully generates a DPP URI from
- * the supplicant. This callback is the first successful outcome
- * of a Easy Connect Responder flow starting with
- * {@link WifiManager#startEasyConnectAsEnrolleeResponder(String, int, Executor,
- * EasyConnectStatusCallback)} .
- *
- * @param uri DPP URI from the supplicant.
- * @hide
- */
- @SystemApi
- public void onBootstrapUriGenerated(@NonNull String uri) {};
-}
diff --git a/wifi/java/android/net/wifi/IActionListener.aidl b/wifi/java/android/net/wifi/IActionListener.aidl
deleted file mode 100644
index faa0901..0000000
--- a/wifi/java/android/net/wifi/IActionListener.aidl
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.net.wifi;
-
-/**
- * Interface for generic wifi callbacks.
- * @hide
- */
-oneway interface IActionListener
-{
- void onSuccess();
- void onFailure(int reason);
-}
diff --git a/wifi/java/android/net/wifi/ICoexCallback.aidl b/wifi/java/android/net/wifi/ICoexCallback.aidl
deleted file mode 100644
index 89e4c4b..0000000
--- a/wifi/java/android/net/wifi/ICoexCallback.aidl
+++ /dev/null
@@ -1,26 +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 android.net.wifi;
-
-/**
- * Interface for Wi-Fi/cellular coex callback.
- * @hide
- */
-oneway interface ICoexCallback
-{
- void onCoexUnsafeChannelsChanged();
-}
diff --git a/wifi/java/android/net/wifi/IDppCallback.aidl b/wifi/java/android/net/wifi/IDppCallback.aidl
deleted file mode 100644
index dcbe8468..0000000
--- a/wifi/java/android/net/wifi/IDppCallback.aidl
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.net.wifi;
-
-/**
- * Interface for DPP callback.
- *
- * @hide
- */
-oneway interface IDppCallback
-{
- /**
- * Called when local DPP Enrollee successfully receives a new Wi-Fi configuratrion from the
- * peer DPP configurator.
- */
- void onSuccessConfigReceived(int newNetworkId);
-
- /**
- * Called when DPP success events take place, except for when configuration is received from
- * an external Configurator. The callback onSuccessConfigReceived will be used in this case.
- */
- void onSuccess(int status);
-
- /**
- * Called when DPP Failure events take place.
- */
- void onFailure(int status, String ssid, String channelList, in int[] bandArray);
-
- /**
- * Called when DPP events that indicate progress take place. Can be used by UI elements
- * to show progress.
- */
- void onProgress(int status);
-
- /**
- * Called when local DPP Responder successfully generates a URI.
- */
- void onBootstrapUriGenerated(String uri);
-
-}
diff --git a/wifi/java/android/net/wifi/ILocalOnlyHotspotCallback.aidl b/wifi/java/android/net/wifi/ILocalOnlyHotspotCallback.aidl
deleted file mode 100644
index b567f29..0000000
--- a/wifi/java/android/net/wifi/ILocalOnlyHotspotCallback.aidl
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * 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.net.wifi;
-
-import android.net.wifi.SoftApConfiguration;
-
-/**
- * Communicates LOHS status back to the application process.
- *
- * @hide
- */
-oneway interface ILocalOnlyHotspotCallback {
- void onHotspotStarted(in SoftApConfiguration config);
- void onHotspotStopped();
- void onHotspotFailed(int reason);
-}
diff --git a/wifi/java/android/net/wifi/INetworkRequestMatchCallback.aidl b/wifi/java/android/net/wifi/INetworkRequestMatchCallback.aidl
deleted file mode 100644
index d14ec57..0000000
--- a/wifi/java/android/net/wifi/INetworkRequestMatchCallback.aidl
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.net.wifi;
-
-import android.net.wifi.INetworkRequestUserSelectionCallback;
-import android.net.wifi.ScanResult;
-import android.net.wifi.WifiConfiguration;
-
-/**
- * Interface for network request match callback.
- *
- * @hide
- */
-oneway interface INetworkRequestMatchCallback
-{
- void onUserSelectionCallbackRegistration(in INetworkRequestUserSelectionCallback userSelectionCallback);
-
- void onAbort();
-
- void onMatch(in List<ScanResult> scanResults);
-
- void onUserSelectionConnectSuccess(in WifiConfiguration wificonfiguration);
-
- void onUserSelectionConnectFailure(in WifiConfiguration wificonfiguration);
-}
diff --git a/wifi/java/android/net/wifi/INetworkRequestUserSelectionCallback.aidl b/wifi/java/android/net/wifi/INetworkRequestUserSelectionCallback.aidl
deleted file mode 100644
index 524cefb..0000000
--- a/wifi/java/android/net/wifi/INetworkRequestUserSelectionCallback.aidl
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.net.wifi;
-
-import android.net.wifi.WifiConfiguration;
-
-/**
- * Interface for providing user selection in response to
- * network request match callback.
- * @hide
- */
-oneway interface INetworkRequestUserSelectionCallback
-{
- void select(in WifiConfiguration wificonfiguration);
-
- void reject();
-}
diff --git a/wifi/java/android/net/wifi/IOnWifiActivityEnergyInfoListener.aidl b/wifi/java/android/net/wifi/IOnWifiActivityEnergyInfoListener.aidl
deleted file mode 100644
index 7e25fd8a..0000000
--- a/wifi/java/android/net/wifi/IOnWifiActivityEnergyInfoListener.aidl
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.net.wifi;
-
-import android.os.connectivity.WifiActivityEnergyInfo;
-
-/**
- * Interface for Wi-Fi activity energy info listener.
- *
- * @hide
- */
-oneway interface IOnWifiActivityEnergyInfoListener
-{
- /**
- * Service to manager callback providing current Wi-Fi activity energy info.
- * @param info the Wi-Fi activity energy info
- */
- void onWifiActivityEnergyInfo(in WifiActivityEnergyInfo info);
-}
diff --git a/wifi/java/android/net/wifi/IOnWifiUsabilityStatsListener.aidl b/wifi/java/android/net/wifi/IOnWifiUsabilityStatsListener.aidl
deleted file mode 100644
index 4687f30..0000000
--- a/wifi/java/android/net/wifi/IOnWifiUsabilityStatsListener.aidl
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.net.wifi;
-
-import android.net.wifi.WifiUsabilityStatsEntry;
-
-/**
- * Interface for Wi-Fi usability stats listener.
- *
- * @hide
- */
-oneway interface IOnWifiUsabilityStatsListener
-{
- /**
- * Service to manager callback providing current Wi-Fi usability stats.
- *
- * @param seqNum The sequence number of stats, used to derive the timing of updated Wi-Fi
- * usability statistics, set by framework and shall be incremented by one
- * after each update.
- * @param isSameBssidAndFreq The flag to indicate whether the BSSID and the frequency of
- * network stays the same or not relative to the last update of
- * Wi-Fi usability stats.
- * @param stats The updated Wi-Fi usability statistics.
- */
- void onWifiUsabilityStats(int seqNum, boolean isSameBssidAndFreq,
- in WifiUsabilityStatsEntry stats);
-}
diff --git a/wifi/java/android/net/wifi/IScanResultsCallback.aidl b/wifi/java/android/net/wifi/IScanResultsCallback.aidl
deleted file mode 100644
index 56f6025..0000000
--- a/wifi/java/android/net/wifi/IScanResultsCallback.aidl
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.net.wifi;
-
-/**
- * Interface for Wi-Fi scan result available callback.
- *
- * @hide
- */
-oneway interface IScanResultsCallback
-{
- void onScanResultsAvailable();
-}
diff --git a/wifi/java/android/net/wifi/IScanResultsListener.aidl b/wifi/java/android/net/wifi/IScanResultsListener.aidl
deleted file mode 100644
index e7eaddd..0000000
--- a/wifi/java/android/net/wifi/IScanResultsListener.aidl
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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.net.wifi;
-
-/** @hide */
-
-oneway interface IScanResultsListener
-{
- void onScanResultsAvailable();
-}
diff --git a/wifi/java/android/net/wifi/ISoftApCallback.aidl b/wifi/java/android/net/wifi/ISoftApCallback.aidl
deleted file mode 100644
index a28a8fb..0000000
--- a/wifi/java/android/net/wifi/ISoftApCallback.aidl
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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.net.wifi;
-import android.net.wifi.SoftApCapability;
-import android.net.wifi.SoftApInfo;
-
-import android.net.wifi.WifiClient;
-
-/**
- * Interface for Soft AP callback.
- *
- * @hide
- */
-oneway interface ISoftApCallback
-{
- /**
- * Service to manager callback providing current soft AP state. The possible
- * parameter values listed are defined in WifiManager.java
- *
- * @param state new AP state. One of WIFI_AP_STATE_DISABLED,
- * WIFI_AP_STATE_DISABLING, WIFI_AP_STATE_ENABLED,
- * WIFI_AP_STATE_ENABLING, WIFI_AP_STATE_FAILED
- * @param failureReason reason when in failed state. One of
- * SAP_START_FAILURE_GENERAL, SAP_START_FAILURE_NO_CHANNEL
- */
- void onStateChanged(int state, int failureReason);
-
- /**
- * Service to manager callback providing connected client's information.
- *
- * @param clients the currently connected clients
- */
- void onConnectedClientsChanged(in List<WifiClient> clients);
-
- /**
- * Service to manager callback providing information of softap.
- *
- * @param softApInfo is the softap information. {@link SoftApInfo}
- */
- 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.
- *
- * @param capability is the softap capability. {@link SoftApCapability}
- */
- void onCapabilityChanged(in SoftApCapability capability);
-
- /**
- * Service to manager callback providing blocked client of softap with specific reason code.
- *
- * @param client the currently blocked client.
- * @param blockedReason one of blocked reason from {@link WifiManager.SapClientBlockedReason}
- */
- void onBlockedClientConnecting(in WifiClient client, int blockedReason);
-}
diff --git a/wifi/java/android/net/wifi/ISuggestionConnectionStatusListener.aidl b/wifi/java/android/net/wifi/ISuggestionConnectionStatusListener.aidl
deleted file mode 100644
index b49e49b..0000000
--- a/wifi/java/android/net/wifi/ISuggestionConnectionStatusListener.aidl
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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.net.wifi;
-
-import android.net.wifi.WifiNetworkSuggestion;
-
-/**
- * Interface for suggestion network connection listener.
- *
- * @hide
- */
-oneway interface ISuggestionConnectionStatusListener
-{
- void onConnectionStatus(in WifiNetworkSuggestion wifiNetworkSuggestion, int failureReason);
-}
diff --git a/wifi/java/android/net/wifi/ISuggestionUserApprovalStatusListener.aidl b/wifi/java/android/net/wifi/ISuggestionUserApprovalStatusListener.aidl
deleted file mode 100644
index 5aa3a90..0000000
--- a/wifi/java/android/net/wifi/ISuggestionUserApprovalStatusListener.aidl
+++ /dev/null
@@ -1,27 +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 android.net.wifi;
-
-/**
- * Interface for suggestion user approval status listener.
- *
- * @hide
- */
-oneway interface ISuggestionUserApprovalStatusListener
-{
- void onUserApprovalStatusChange();
-}
diff --git a/wifi/java/android/net/wifi/ITrafficStateCallback.aidl b/wifi/java/android/net/wifi/ITrafficStateCallback.aidl
deleted file mode 100644
index 0c8e777..0000000
--- a/wifi/java/android/net/wifi/ITrafficStateCallback.aidl
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.net.wifi;
-
-/**
- * Interface for Traffic state callback.
- *
- * @hide
- */
-oneway interface ITrafficStateCallback
-{
- /**
- * Callback invoked to inform clients about the current traffic state.
- *
- * @param state One of the values: {@link #DATA_ACTIVITY_NONE}, {@link #DATA_ACTIVITY_IN},
- * {@link #DATA_ACTIVITY_OUT} & {@link #DATA_ACTIVITY_INOUT}.
- * @hide
- */
- void onStateChanged(int state);
-}
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
deleted file mode 100644
index 23f47ef..0000000
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ /dev/null
@@ -1,312 +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 android.net.wifi;
-
-import android.net.wifi.hotspot2.OsuProvider;
-import android.net.wifi.hotspot2.PasspointConfiguration;
-import android.net.wifi.hotspot2.IProvisioningCallback;
-
-import android.net.DhcpInfo;
-import android.net.Network;
-import android.net.wifi.CoexUnsafeChannel;
-import android.net.wifi.IActionListener;
-import android.net.wifi.ICoexCallback;
-import android.net.wifi.IDppCallback;
-import android.net.wifi.ILocalOnlyHotspotCallback;
-import android.net.wifi.INetworkRequestMatchCallback;
-import android.net.wifi.IOnWifiActivityEnergyInfoListener;
-import android.net.wifi.IOnWifiUsabilityStatsListener;
-import android.net.wifi.IScanResultsCallback;
-import android.net.wifi.ISoftApCallback;
-import android.net.wifi.ISuggestionConnectionStatusListener;
-import android.net.wifi.ISuggestionUserApprovalStatusListener;
-import android.net.wifi.ITrafficStateCallback;
-import android.net.wifi.IWifiConnectedNetworkScorer;
-import android.net.wifi.ScanResult;
-import android.net.wifi.SoftApConfiguration;
-import android.net.wifi.WifiConfiguration;
-import android.net.wifi.WifiInfo;
-import android.net.wifi.WifiNetworkSuggestion;
-
-import android.os.Messenger;
-import android.os.ResultReceiver;
-import android.os.WorkSource;
-
-import com.android.modules.utils.ParceledListSlice;
-
-/**
- * Interface that allows controlling and querying Wi-Fi connectivity.
- *
- * {@hide}
- */
-interface IWifiManager
-{
- long getSupportedFeatures();
-
- oneway void getWifiActivityEnergyInfoAsync(in IOnWifiActivityEnergyInfoListener listener);
-
- ParceledListSlice getConfiguredNetworks(String packageName, String featureId);
-
- ParceledListSlice getPrivilegedConfiguredNetworks(String packageName, String featureId);
-
- Map getAllMatchingFqdnsForScanResults(in List<ScanResult> scanResult);
-
- Map getMatchingOsuProviders(in List<ScanResult> scanResult);
-
- Map getMatchingPasspointConfigsForOsuProviders(in List<OsuProvider> osuProviders);
-
- int addOrUpdateNetwork(in WifiConfiguration config, String packageName);
-
- boolean addOrUpdatePasspointConfiguration(in PasspointConfiguration config, String packageName);
-
- boolean removePasspointConfiguration(in String fqdn, String packageName);
-
- List<PasspointConfiguration> getPasspointConfigurations(in String packageName);
-
- List<WifiConfiguration> getWifiConfigsForPasspointProfiles(in List<String> fqdnList);
-
- void queryPasspointIcon(long bssid, String fileName);
-
- int matchProviderWithCurrentNetwork(String fqdn);
-
- boolean removeNetwork(int netId, String packageName);
-
- boolean enableNetwork(int netId, boolean disableOthers, String packageName);
-
- boolean disableNetwork(int netId, String packageName);
-
- void allowAutojoinGlobal(boolean choice);
-
- void allowAutojoin(int netId, boolean choice);
-
- void allowAutojoinPasspoint(String fqdn, boolean enableAutoJoin);
-
- void setMacRandomizationSettingPasspointEnabled(String fqdn, boolean enable);
-
- void setPasspointMeteredOverride(String fqdn, int meteredOverride);
-
- boolean startScan(String packageName, String featureId);
-
- List<ScanResult> getScanResults(String callingPackage, String callingFeatureId);
-
- boolean disconnect(String packageName);
-
- boolean reconnect(String packageName);
-
- boolean reassociate(String packageName);
-
- WifiInfo getConnectionInfo(String callingPackage, String callingFeatureId);
-
- boolean setWifiEnabled(String packageName, boolean enable);
-
- int getWifiEnabledState();
-
- String getCountryCode();
-
- boolean is5GHzBandSupported();
-
- boolean is6GHzBandSupported();
-
- boolean is60GHzBandSupported();
-
- boolean isWifiStandardSupported(int standard);
-
- DhcpInfo getDhcpInfo();
-
- void setScanAlwaysAvailable(boolean isAvailable, String packageName);
-
- boolean isScanAlwaysAvailable();
-
- boolean acquireWifiLock(IBinder lock, int lockType, String tag, in WorkSource ws);
-
- void updateWifiLockWorkSource(IBinder lock, in WorkSource ws);
-
- boolean releaseWifiLock(IBinder lock);
-
- void initializeMulticastFiltering();
-
- boolean isMulticastEnabled();
-
- void acquireMulticastLock(IBinder binder, String tag);
-
- void releaseMulticastLock(String tag);
-
- void updateInterfaceIpState(String ifaceName, int mode);
-
- boolean isDefaultCoexAlgorithmEnabled();
-
- void setCoexUnsafeChannels(in List<CoexUnsafeChannel> unsafeChannels, int mandatoryRestrictions);
-
- List<CoexUnsafeChannel> getCoexUnsafeChannels();
-
- int getCoexRestrictions();
-
- void registerCoexCallback(in ICoexCallback callback);
-
- void unregisterCoexCallback(in ICoexCallback callback);
-
- boolean startSoftAp(in WifiConfiguration wifiConfig, String packageName);
-
- boolean startTetheredHotspot(in SoftApConfiguration softApConfig, String packageName);
-
- boolean stopSoftAp();
-
- int startLocalOnlyHotspot(in ILocalOnlyHotspotCallback callback, String packageName,
- String featureId, in SoftApConfiguration customConfig);
-
- void stopLocalOnlyHotspot();
-
- void startWatchLocalOnlyHotspot(in ILocalOnlyHotspotCallback callback);
-
- void stopWatchLocalOnlyHotspot();
-
- @UnsupportedAppUsage
- int getWifiApEnabledState();
-
- @UnsupportedAppUsage
- WifiConfiguration getWifiApConfiguration();
-
- SoftApConfiguration getSoftApConfiguration();
-
- boolean setWifiApConfiguration(in WifiConfiguration wifiConfig, String packageName);
-
- boolean setSoftApConfiguration(in SoftApConfiguration softApConfig, String packageName);
-
- void notifyUserOfApBandConversion(String packageName);
-
- void enableTdls(String remoteIPAddress, boolean enable);
-
- void enableTdlsWithMacAddress(String remoteMacAddress, boolean enable);
-
- String getCurrentNetworkWpsNfcConfigurationToken();
-
- void enableVerboseLogging(int verbose);
-
- int getVerboseLoggingLevel();
-
- void disableEphemeralNetwork(String SSID, String packageName);
-
- void factoryReset(String packageName);
-
- @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
- Network getCurrentNetwork();
-
- byte[] retrieveBackupData();
-
- void restoreBackupData(in byte[] data);
-
- byte[] retrieveSoftApBackupData();
-
- SoftApConfiguration restoreSoftApBackupData(in byte[] data);
-
- void restoreSupplicantBackupData(in byte[] supplicantData, in byte[] ipConfigData);
-
- void startSubscriptionProvisioning(in OsuProvider provider, in IProvisioningCallback callback);
-
- void registerSoftApCallback(in IBinder binder, in ISoftApCallback callback, int callbackIdentifier);
-
- void unregisterSoftApCallback(int callbackIdentifier);
-
- void addOnWifiUsabilityStatsListener(in IBinder binder, in IOnWifiUsabilityStatsListener listener, int listenerIdentifier);
-
- void removeOnWifiUsabilityStatsListener(int listenerIdentifier);
-
- void registerTrafficStateCallback(in IBinder binder, in ITrafficStateCallback callback, int callbackIdentifier);
-
- void unregisterTrafficStateCallback(int callbackIdentifier);
-
- void registerNetworkRequestMatchCallback(in IBinder binder, in INetworkRequestMatchCallback callback, int callbackIdentifier);
-
- void unregisterNetworkRequestMatchCallback(int callbackIdentifier);
-
- int addNetworkSuggestions(in List<WifiNetworkSuggestion> networkSuggestions, in String packageName,
- in String featureId);
-
- int removeNetworkSuggestions(in List<WifiNetworkSuggestion> networkSuggestions, in String packageName);
-
- List<WifiNetworkSuggestion> getNetworkSuggestions(in String packageName);
-
- String[] getFactoryMacAddresses();
-
- void setDeviceMobilityState(int state);
-
- void startDppAsConfiguratorInitiator(in IBinder binder, in String enrolleeUri,
- int selectedNetworkId, int netRole, in IDppCallback callback);
-
- void startDppAsEnrolleeInitiator(in IBinder binder, in String configuratorUri,
- in IDppCallback callback);
-
- void startDppAsEnrolleeResponder(in IBinder binder, in String deviceInfo, int curve,
- in IDppCallback callback);
-
- void stopDppSession();
-
- void updateWifiUsabilityScore(int seqNum, int score, int predictionHorizonSec);
-
- oneway void connect(in WifiConfiguration config, int netId, in IActionListener listener);
-
- oneway void save(in WifiConfiguration config, in IActionListener listener);
-
- oneway void forget(int netId, in IActionListener listener);
-
- void registerScanResultsCallback(in IScanResultsCallback callback);
-
- void unregisterScanResultsCallback(in IScanResultsCallback callback);
-
- void registerSuggestionConnectionStatusListener(in IBinder binder, in ISuggestionConnectionStatusListener listener, int listenerIdentifier, String packageName, String featureId);
-
- void unregisterSuggestionConnectionStatusListener(int listenerIdentifier, String packageName);
-
- int calculateSignalLevel(int rssi);
-
- List<WifiConfiguration> getWifiConfigForMatchedNetworkSuggestionsSharedWithUser(in List<ScanResult> scanResults);
-
- boolean setWifiConnectedNetworkScorer(in IBinder binder, in IWifiConnectedNetworkScorer scorer);
-
- void clearWifiConnectedNetworkScorer();
-
- /**
- * Return the Map of {@link WifiNetworkSuggestion} and the list of <ScanResult>
- */
- Map getMatchingScanResults(in List<WifiNetworkSuggestion> networkSuggestions, in List<ScanResult> scanResults, String callingPackage, String callingFeatureId);
-
- void setScanThrottleEnabled(boolean enable);
-
- boolean isScanThrottleEnabled();
-
- Map getAllMatchingPasspointProfilesForScanResults(in List<ScanResult> scanResult);
-
- void setAutoWakeupEnabled(boolean enable);
-
- boolean isAutoWakeupEnabled();
-
- int getNetworkSuggestionUserApprovalStatus(String packageName);
-
- void startTemporarilyDisablingAllNonCarrierMergedWifi(int subId);
-
- void stopTemporarilyDisablingAllNonCarrierMergedWifi();
-
- void setCarrierNetworkOffloadEnabled(int subscriptionId, boolean merged, boolean enabled);
-
- boolean isCarrierNetworkOffloadEnabled(int subscriptionId, boolean merged);
-
- void restartWifiSubsystem(String reason);
-
- boolean addSuggestionUserApprovalStatusListener(in IBinder binder, in ISuggestionUserApprovalStatusListener listener, int listenerIdentifier, String packageName, String featureId);
-
- void removeSuggestionUserApprovalStatusListener(int listenerIdentifier, String packageName);
-}
diff --git a/wifi/java/android/net/wifi/IWifiScanner.aidl b/wifi/java/android/net/wifi/IWifiScanner.aidl
deleted file mode 100644
index 485f5ce..0000000
--- a/wifi/java/android/net/wifi/IWifiScanner.aidl
+++ /dev/null
@@ -1,30 +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 android.net.wifi;
-
-import android.os.Messenger;
-import android.os.Bundle;
-
-/**
- * {@hide}
- */
-interface IWifiScanner
-{
- Messenger getMessenger();
-
- Bundle getAvailableChannels(int band, String packageName, String featureId);
-}
diff --git a/wifi/java/android/net/wifi/ParcelUtil.java b/wifi/java/android/net/wifi/ParcelUtil.java
deleted file mode 100644
index a26877d..0000000
--- a/wifi/java/android/net/wifi/ParcelUtil.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/**
- * Copyright (c) 2016, 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.os.Parcel;
-
-import java.io.ByteArrayInputStream;
-import java.security.KeyFactory;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.cert.CertificateEncodingException;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.PKCS8EncodedKeySpec;
-
-/**
- * Provides utilities for writing/reading a non-Parcelable objects to/from
- * a Parcel object.
- *
- * @hide
- */
-public class ParcelUtil {
- /**
- * Write a PrivateKey object |key| to the specified Parcel |dest|.
- *
- * Below is the data format:
- * |algorithm| -> String of algorithm name
- * |endcodedKey| -> byte[] of key data
- *
- * For a null PrivateKey object, a null string will be written to |algorithm| and
- * |encodedKey| will be skipped. Since a PrivateKey can only be constructed with
- * a valid algorithm String.
- *
- * @param dest Parcel object to write to
- * @param key PrivateKey object to read from.
- */
- public static void writePrivateKey(Parcel dest, PrivateKey key) {
- if (key == null) {
- dest.writeString(null);
- return;
- }
-
- dest.writeString(key.getAlgorithm());
- dest.writeByteArray(key.getEncoded());
- }
-
- /**
- * Read/create a PrivateKey object from a specified Parcel object |in|.
- *
- * Refer to the function above for the expected data format.
- *
- * @param in Parcel object to read from
- * @return a PrivateKey object or null
- */
- public static PrivateKey readPrivateKey(Parcel in) {
- String algorithm = in.readString();
- if (algorithm == null) {
- return null;
- }
-
- byte[] userKeyBytes = in.createByteArray();
- try {
- KeyFactory keyFactory = KeyFactory.getInstance(algorithm);
- return keyFactory.generatePrivate(new PKCS8EncodedKeySpec(userKeyBytes));
- } catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
- return null;
- }
- }
-
- /**
- * Write a X509Certificate object |cert| to a Parcel object |dest|.
- * The data being written to the Parcel is just a byte[] of the encoded certificate data.
- *
- * @param dest Parcel object to write to
- * @param cert X509Certificate object to read from
- */
- public static void writeCertificate(Parcel dest, X509Certificate cert) {
- byte[] certBytes = null;
- if (cert != null) {
- try {
- certBytes = cert.getEncoded();
- } catch (CertificateEncodingException e) {
- /* empty, write null. */
- }
- }
- dest.writeByteArray(certBytes);
- }
-
- /**
- * Read/create a X509Certificate object from a specified Parcel object |in|.
- *
- * @param in Parcel object to read from
- * @return a X509Certficate object or null
- */
- public static X509Certificate readCertificate(Parcel in) {
- byte[] certBytes = in.createByteArray();
- if (certBytes == null) {
- return null;
- }
-
- try {
- CertificateFactory cFactory = CertificateFactory.getInstance("X.509");
- return (X509Certificate) cFactory
- .generateCertificate(new ByteArrayInputStream(certBytes));
- } catch (CertificateException e) {
- return null;
- }
- }
-
- /**
- * Write an array of X509Certificate objects |certs| to a Parcel object |dest|.
- * The data being written to the Parcel are consist of an integer indicating
- * the size of the array and the certificates data. Certificates data will be
- * skipped for a null array or size of 0 array.
- *
- * @param dest Parcel object to write to
- * @param certs array of X509Certificate objects to read from
- */
- public static void writeCertificates(Parcel dest, X509Certificate[] certs) {
- if (certs == null || certs.length == 0) {
- dest.writeInt(0);
- return;
- }
-
- dest.writeInt(certs.length);
- for (int i = 0; i < certs.length; i++) {
- writeCertificate(dest, certs[i]);
- }
- }
-
- /**
- * Read/create an array of X509Certificate objects from a specified Parcel object |in|.
- *
- * @param in Parcel object to read from
- * @return X509Certficate[] or null
- */
- public static X509Certificate[] readCertificates(Parcel in) {
- int length = in.readInt();
- if (length == 0) {
- return null;
- }
-
- X509Certificate[] certs = new X509Certificate[length];
- for (int i = 0; i < length; i++) {
- certs[i] = readCertificate(in);
- }
- return certs;
- }
-}
diff --git a/wifi/java/android/net/wifi/RttManager.aidl b/wifi/java/android/net/wifi/RttManager.aidl
deleted file mode 100644
index 9479cf0..0000000
--- a/wifi/java/android/net/wifi/RttManager.aidl
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * 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.
- */
-
-package android.net.wifi;
-
-parcelable RttManager.RttCapabilities;
-parcelable RttManager.ParcelableRttResults;
-parcelable RttManager.ParcelableRttParams;
diff --git a/wifi/java/android/net/wifi/RttManager.java b/wifi/java/android/net/wifi/RttManager.java
deleted file mode 100644
index 034defb..0000000
--- a/wifi/java/android/net/wifi/RttManager.java
+++ /dev/null
@@ -1,1233 +0,0 @@
-package android.net.wifi;
-
-import android.Manifest;
-import android.annotation.NonNull;
-import android.annotation.RequiresPermission;
-import android.annotation.SuppressLint;
-import android.annotation.SystemApi;
-import android.annotation.SystemService;
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.net.wifi.rtt.RangingRequest;
-import android.net.wifi.rtt.RangingResult;
-import android.net.wifi.rtt.RangingResultCallback;
-import android.net.wifi.rtt.WifiRttManager;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.os.SystemClock;
-import android.util.Log;
-
-import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.util.Protocol;
-
-import java.util.List;
-
-/** @hide */
-@SystemApi
-@Deprecated
-@SystemService(Context.WIFI_RTT_SERVICE)
-public class RttManager {
-
- private static final boolean DBG = false;
- private static final String TAG = "RttManager";
-
- /** @deprecated It is Not supported anymore. */
- @Deprecated
- public static final int RTT_TYPE_UNSPECIFIED = 0;
-
- public static final int RTT_TYPE_ONE_SIDED = 1;
- public static final int RTT_TYPE_TWO_SIDED = 2;
-
- /** @deprecated It is not supported anymore. */
- @Deprecated
- public static final int RTT_TYPE_11_V = 2;
-
- /** @deprecated It is not supported anymore. */
- @Deprecated
- public static final int RTT_TYPE_11_MC = 4;
-
- /** @deprecated It is not supported anymore. */
- @Deprecated
- public static final int RTT_PEER_TYPE_UNSPECIFIED = 0;
-
- public static final int RTT_PEER_TYPE_AP = 1;
- public static final int RTT_PEER_TYPE_STA = 2; /* requires NAN */
- public static final int RTT_PEER_P2P_GO = 3;
- public static final int RTT_PEER_P2P_CLIENT = 4;
- public static final int RTT_PEER_NAN = 5;
-
- /**
- * @deprecated It is not supported anymore.
- * Use {@link android.net.wifi.RttManager#RTT_BW_20_SUPPORT} API.
- */
- @Deprecated
- public static final int RTT_CHANNEL_WIDTH_20 = 0;
-
- /**
- * @deprecated It is not supported anymore.
- * Use {@link android.net.wifi.RttManager#RTT_BW_40_SUPPORT} API.
- */
- @Deprecated
- public static final int RTT_CHANNEL_WIDTH_40 = 1;
-
- /**
- * @deprecated It is not supported anymore.
- * Use {@link android.net.wifi.RttManager#RTT_BW_80_SUPPORT} API.
- */
- @Deprecated
- public static final int RTT_CHANNEL_WIDTH_80 = 2;
-
- /**@deprecated It is not supported anymore.
- * Use {@link android.net.wifi.RttManager#RTT_BW_160_SUPPORT} API.
- */
- @Deprecated
- public static final int RTT_CHANNEL_WIDTH_160 = 3;
-
- /**@deprecated not supported anymore*/
- @Deprecated
- public static final int RTT_CHANNEL_WIDTH_80P80 = 4;
-
- /**@deprecated It is not supported anymore.
- * Use {@link android.net.wifi.RttManager#RTT_BW_5_SUPPORT} API.
- */
- @Deprecated
- public static final int RTT_CHANNEL_WIDTH_5 = 5;
-
- /**@deprecated It is not supported anymore.
- * Use {@link android.net.wifi.RttManager#RTT_BW_10_SUPPORT} API.
- */
- @Deprecated
- public static final int RTT_CHANNEL_WIDTH_10 = 6;
-
- /** @deprecated channel info must be specified. */
- @Deprecated
- public static final int RTT_CHANNEL_WIDTH_UNSPECIFIED = -1;
-
- public static final int RTT_STATUS_SUCCESS = 0;
- /** General failure*/
- public static final int RTT_STATUS_FAILURE = 1;
- /** Destination does not respond to RTT request*/
- public static final int RTT_STATUS_FAIL_NO_RSP = 2;
- /** RTT request is rejected by the destination. Double side RTT only*/
- public static final int RTT_STATUS_FAIL_REJECTED = 3;
- /** */
- public static final int RTT_STATUS_FAIL_NOT_SCHEDULED_YET = 4;
- /** Timing measurement timeout*/
- public static final int RTT_STATUS_FAIL_TM_TIMEOUT = 5;
- /** Destination is on a different channel from the RTT Request*/
- public static final int RTT_STATUS_FAIL_AP_ON_DIFF_CHANNEL = 6;
- /** This type of Ranging is not support by Hardware*/
- public static final int RTT_STATUS_FAIL_NO_CAPABILITY = 7;
- /** Request abort fro uncertain reason*/
- public static final int RTT_STATUS_ABORTED = 8;
- /** The T1-T4 or TOD/TOA Timestamp is illegal*/
- public static final int RTT_STATUS_FAIL_INVALID_TS = 9;
- /** 11mc protocol level failed, eg, unrecognized FTMR/FTM frame*/
- public static final int RTT_STATUS_FAIL_PROTOCOL = 10;
- /** Request can not be scheduled by hardware*/
- public static final int RTT_STATUS_FAIL_SCHEDULE = 11;
- /** destination is busy now, you can try after a specified time from destination*/
- public static final int RTT_STATUS_FAIL_BUSY_TRY_LATER = 12;
- /** Bad Request argument*/
- public static final int RTT_STATUS_INVALID_REQ = 13;
- /** Wifi is not enabled*/
- public static final int RTT_STATUS_NO_WIFI = 14;
- /** Responder overrides param info, cannot range with new params 2-side RTT only*/
- public static final int RTT_STATUS_FAIL_FTM_PARAM_OVERRIDE = 15;
-
- public static final int REASON_UNSPECIFIED = -1;
- public static final int REASON_NOT_AVAILABLE = -2;
- public static final int REASON_INVALID_LISTENER = -3;
- public static final int REASON_INVALID_REQUEST = -4;
- /** Do not have required permission */
- public static final int REASON_PERMISSION_DENIED = -5;
- /** Ranging failed because responder role is enabled in STA mode.*/
- public static final int
- REASON_INITIATOR_NOT_ALLOWED_WHEN_RESPONDER_ON = -6;
-
- public static final String DESCRIPTION_KEY = "android.net.wifi.RttManager.Description";
-
- /**
- * RTT BW supported bit mask, used as RTT param bandWidth too
- */
- public static final int RTT_BW_5_SUPPORT = 0x01;
- public static final int RTT_BW_10_SUPPORT = 0x02;
- public static final int RTT_BW_20_SUPPORT = 0x04;
- public static final int RTT_BW_40_SUPPORT = 0x08;
- public static final int RTT_BW_80_SUPPORT = 0x10;
- public static final int RTT_BW_160_SUPPORT = 0x20;
-
- /**
- * RTT Preamble Support bit mask
- */
- public static final int PREAMBLE_LEGACY = 0x01;
- public static final int PREAMBLE_HT = 0x02;
- public static final int PREAMBLE_VHT = 0x04;
-
- /** @deprecated Use the new {@link android.net.wifi.RttManager.RttCapabilities} API */
- @Deprecated
- public class Capabilities {
- public int supportedType;
- public int supportedPeerType;
- }
-
- /** @deprecated Use the new {@link android.net.wifi.RttManager#getRttCapabilities()} API.*/
- @Deprecated
- @SuppressLint("RequiresPermission")
- public Capabilities getCapabilities() {
- throw new UnsupportedOperationException(
- "getCapabilities is not supported in the adaptation layer");
- }
-
- /**
- * This class describe the RTT capability of the Hardware
- */
- @Deprecated
- public static class RttCapabilities implements Parcelable {
- /** @deprecated It is not supported*/
- @Deprecated
- public boolean supportedType;
- /** @deprecated It is not supported*/
- @Deprecated
- public boolean supportedPeerType;
- //1-sided rtt measurement is supported
- public boolean oneSidedRttSupported;
- //11mc 2-sided rtt measurement is supported
- public boolean twoSided11McRttSupported;
- //location configuration information supported
- public boolean lciSupported;
- //location civic records supported
- public boolean lcrSupported;
- //preamble supported, see bit mask definition above
- public int preambleSupported;
- //RTT bandwidth supported
- public int bwSupported;
- // Whether STA responder role is supported.
- public boolean responderSupported;
-
- /** Whether the secure RTT protocol is supported. */
- public boolean secureRttSupported;
-
- /** Draft 11mc version supported, including major and minor version. e.g, draft 4.3 is 43 */
- public int mcVersion;
-
- @NonNull
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("oneSidedRtt ").
- append(oneSidedRttSupported ? "is Supported. " : "is not supported. ").
- append("twoSided11McRtt ").
- append(twoSided11McRttSupported ? "is Supported. " : "is not supported. ").
- append("lci ").
- append(lciSupported ? "is Supported. " : "is not supported. ").
- append("lcr ").
- append(lcrSupported ? "is Supported. " : "is not supported. ");
-
- if ((preambleSupported & PREAMBLE_LEGACY) != 0) {
- sb.append("Legacy ");
- }
-
- if ((preambleSupported & PREAMBLE_HT) != 0) {
- sb.append("HT ");
- }
-
- if ((preambleSupported & PREAMBLE_VHT) != 0) {
- sb.append("VHT ");
- }
-
- sb.append("is supported. ");
-
- if ((bwSupported & RTT_BW_5_SUPPORT) != 0) {
- sb.append("5 MHz ");
- }
-
- if ((bwSupported & RTT_BW_10_SUPPORT) != 0) {
- sb.append("10 MHz ");
- }
-
- if ((bwSupported & RTT_BW_20_SUPPORT) != 0) {
- sb.append("20 MHz ");
- }
-
- if ((bwSupported & RTT_BW_40_SUPPORT) != 0) {
- sb.append("40 MHz ");
- }
-
- if ((bwSupported & RTT_BW_80_SUPPORT) != 0) {
- sb.append("80 MHz ");
- }
-
- if ((bwSupported & RTT_BW_160_SUPPORT) != 0) {
- sb.append("160 MHz ");
- }
-
- sb.append("is supported.");
-
- sb.append(" STA responder role is ")
- .append(responderSupported ? "supported" : "not supported");
- sb.append(" Secure RTT protocol is ")
- .append(secureRttSupported ? "supported" : "not supported");
- sb.append(" 11mc version is " + mcVersion);
-
- return sb.toString();
- }
- /** Implement the Parcelable interface {@hide} */
- @Override
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(oneSidedRttSupported ? 1 : 0);
- dest.writeInt(twoSided11McRttSupported ? 1 : 0);
- dest.writeInt(lciSupported ? 1 : 0);
- dest.writeInt(lcrSupported ? 1 : 0);
- dest.writeInt(preambleSupported);
- dest.writeInt(bwSupported);
- dest.writeInt(responderSupported ? 1 : 0);
- dest.writeInt(secureRttSupported ? 1 : 0);
- dest.writeInt(mcVersion);
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final @android.annotation.NonNull Creator<RttCapabilities> CREATOR =
- new Creator<RttCapabilities>() {
- @Override
- public RttCapabilities createFromParcel(Parcel in) {
- RttCapabilities capabilities = new RttCapabilities();
- capabilities.oneSidedRttSupported = (in.readInt() == 1);
- capabilities.twoSided11McRttSupported = (in.readInt() == 1);
- capabilities.lciSupported = (in.readInt() == 1);
- capabilities.lcrSupported = (in.readInt() == 1);
- capabilities.preambleSupported = in.readInt();
- capabilities.bwSupported = in.readInt();
- capabilities.responderSupported = (in.readInt() == 1);
- capabilities.secureRttSupported = (in.readInt() == 1);
- capabilities.mcVersion = in.readInt();
- return capabilities;
- }
- /** Implement the Parcelable interface {@hide} */
- @Override
- public RttCapabilities[] newArray(int size) {
- return new RttCapabilities[size];
- }
- };
- }
-
- /**
- * This method is deprecated. Please use the {@link WifiRttManager} API.
- */
- @RequiresPermission(Manifest.permission.LOCATION_HARDWARE)
- public RttCapabilities getRttCapabilities() {
- return mRttCapabilities;
- }
-
- /** specifies parameters for RTT request */
- @Deprecated
- public static class RttParams {
- /**
- * type of destination device being ranged
- * currently only support RTT_PEER_TYPE_AP
- * Range:RTT_PEER_TYPE_xxxx Default value:RTT_PEER_TYPE_AP
- */
- public int deviceType;
-
- /**
- * type of RTT measurement method. Need check scan result and RttCapabilities first
- * Range: RTT_TYPE_ONE_SIDED or RTT_TYPE_TWO_SIDED
- * Default value: RTT_TYPE_ONE_SIDED
- */
- public int requestType;
-
- /**
- * Whether the secure RTT protocol needs to be used for ranging this peer device.
- */
- public boolean secure;
-
- /**
- * mac address of the device being ranged
- * Default value: null
- */
- public String bssid;
-
- /**
- * The primary control channel over which the client is
- * communicating with the AP.Same as ScanResult.frequency
- * Default value: 0
- */
- public int frequency;
-
- /**
- * channel width of the destination AP. Same as ScanResult.channelWidth
- * Default value: 0
- */
- public int channelWidth;
-
- /**
- * Not used if the AP bandwidth is 20 MHz
- * If the AP use 40, 80 or 160 MHz, this is the center frequency
- * if the AP use 80 + 80 MHz, this is the center frequency of the first segment
- * same as ScanResult.centerFreq0
- * Default value: 0
- */
- public int centerFreq0;
-
- /**
- * Only used if the AP bandwidth is 80 + 80 MHz
- * if the AP use 80 + 80 MHz, this is the center frequency of the second segment
- * same as ScanResult.centerFreq1
- * Default value: 0
- */
- public int centerFreq1;
-
- /**
- * number of samples to be taken
- * @deprecated Use the new {@link android.net.wifi.RttManager.RttParams#numSamplesPerBurst}
- */
- @Deprecated
- public int num_samples;
-
- /**
- * number of retries if a sample fails
- * @deprecated
- * Use {@link android.net.wifi.RttManager.RttParams#numRetriesPerMeasurementFrame} API.
- */
- @Deprecated
- public int num_retries;
-
- /** Number of burst in exp , 2^x. 0 means single shot measurement, range 0-15
- * Currently only single shot is supported
- * Default value: 0
- */
- public int numberBurst;
-
- /**
- * valid only if numberBurst > 1, interval between burst(100ms).
- * Range : 0-31, 0--means no specific
- * Default value: 0
- */
- public int interval;
-
- /**
- * number of samples to be taken in one burst
- * Range: 1-31
- * Default value: 8
- */
- public int numSamplesPerBurst;
-
- /** number of retries for each measurement frame if a sample fails
- * Only used by single side RTT,
- * Range 0 - 3 Default value: 0
- */
- public int numRetriesPerMeasurementFrame;
-
- /**
- * number of retries for FTMR frame (control frame) if it fails.
- * Only used by 80211MC double side RTT
- * Range: 0-3 Default Value : 0
- */
- public int numRetriesPerFTMR;
-
- /**
- * Request LCI information, only available when choose double side RTT measurement
- * need check RttCapabilties first.
- * Default value: false
- * */
- public boolean LCIRequest;
-
- /**
- * Request LCR information, only available when choose double side RTT measurement
- * need check RttCapabilties first.
- * Default value: false
- * */
- public boolean LCRRequest;
-
- /**
- * Timeout for each burst, (250 * 2^x) us,
- * Range 1-11 and 15. 15 means no control Default value: 15
- * */
- public int burstTimeout;
-
- /** preamble used for RTT measurement
- * Range: PREAMBLE_LEGACY, PREAMBLE_HT, PREAMBLE_VHT
- * Default value: PREAMBLE_HT
- */
- public int preamble;
-
- /** bandWidth used for RTT measurement.User need verify the highest BW the destination
- * support (from scan result etc) before set this value. Wider channels result usually give
- * better accuracy. However, the frame loss can increase too.
- * should be one of RTT_BW_5_SUPPORT to RTT_BW_160_SUPPORT. However, need check
- * RttCapabilities firstto verify HW support this bandwidth.
- * Default value:RTT_BW_20_SUPPORT
- */
- public int bandwidth;
-
- public RttParams() {
- //provide initial value for RttParams
- deviceType = RTT_PEER_TYPE_AP;
- requestType = RTT_TYPE_ONE_SIDED;
- numberBurst = 0;
- numSamplesPerBurst = 8;
- numRetriesPerMeasurementFrame = 0;
- numRetriesPerFTMR = 0;
- burstTimeout = 15;
- preamble = PREAMBLE_HT;
- bandwidth = RTT_BW_20_SUPPORT;
- }
-
- /**
- * {@hide}
- */
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("deviceType=" + deviceType);
- sb.append(", requestType=" + requestType);
- sb.append(", secure=" + secure);
- sb.append(", bssid=" + bssid);
- sb.append(", frequency=" + frequency);
- sb.append(", channelWidth=" + channelWidth);
- sb.append(", centerFreq0=" + centerFreq0);
- sb.append(", centerFreq1=" + centerFreq1);
- sb.append(", num_samples=" + num_samples);
- sb.append(", num_retries=" + num_retries);
- sb.append(", numberBurst=" + numberBurst);
- sb.append(", interval=" + interval);
- sb.append(", numSamplesPerBurst=" + numSamplesPerBurst);
- sb.append(", numRetriesPerMeasurementFrame=" + numRetriesPerMeasurementFrame);
- sb.append(", numRetriesPerFTMR=" + numRetriesPerFTMR);
- sb.append(", LCIRequest=" + LCIRequest);
- sb.append(", LCRRequest=" + LCRRequest);
- sb.append(", burstTimeout=" + burstTimeout);
- sb.append(", preamble=" + preamble);
- sb.append(", bandwidth=" + bandwidth);
- return sb.toString();
- }
- }
-
- /** pseudo-private class used to parcel arguments */
- @Deprecated
- public static class ParcelableRttParams implements Parcelable {
-
- @NonNull
- public RttParams mParams[];
-
- /**
- * @hide
- */
- @VisibleForTesting
- public ParcelableRttParams(RttParams[] params) {
- mParams = (params == null ? new RttParams[0] : params);
- }
-
- /** Implement the Parcelable interface {@hide} */
- @Override
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(mParams.length);
-
- for (RttParams params : mParams) {
- dest.writeInt(params.deviceType);
- dest.writeInt(params.requestType);
- dest.writeByte(params.secure ? (byte) 1 : 0);
- dest.writeString(params.bssid);
- dest.writeInt(params.channelWidth);
- dest.writeInt(params.frequency);
- dest.writeInt(params.centerFreq0);
- dest.writeInt(params.centerFreq1);
- dest.writeInt(params.numberBurst);
- dest.writeInt(params.interval);
- dest.writeInt(params.numSamplesPerBurst);
- dest.writeInt(params.numRetriesPerMeasurementFrame);
- dest.writeInt(params.numRetriesPerFTMR);
- dest.writeInt(params.LCIRequest ? 1 : 0);
- dest.writeInt(params.LCRRequest ? 1 : 0);
- dest.writeInt(params.burstTimeout);
- dest.writeInt(params.preamble);
- dest.writeInt(params.bandwidth);
- }
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final @android.annotation.NonNull Creator<ParcelableRttParams> CREATOR =
- new Creator<ParcelableRttParams>() {
- @Override
- public ParcelableRttParams createFromParcel(Parcel in) {
-
- int num = in.readInt();
- RttParams params[] = new RttParams[num];
- for (int i = 0; i < num; i++) {
- params[i] = new RttParams();
- params[i].deviceType = in.readInt();
- params[i].requestType = in.readInt();
- params[i].secure = (in.readByte() != 0);
- params[i].bssid = in.readString();
- params[i].channelWidth = in.readInt();
- params[i].frequency = in.readInt();
- params[i].centerFreq0 = in.readInt();
- params[i].centerFreq1 = in.readInt();
- params[i].numberBurst = in.readInt();
- params[i].interval = in.readInt();
- params[i].numSamplesPerBurst = in.readInt();
- params[i].numRetriesPerMeasurementFrame = in.readInt();
- params[i].numRetriesPerFTMR = in.readInt();
- params[i].LCIRequest = (in.readInt() == 1);
- params[i].LCRRequest = (in.readInt() == 1);
- params[i].burstTimeout = in.readInt();
- params[i].preamble = in.readInt();
- params[i].bandwidth = in.readInt();
- }
-
- ParcelableRttParams parcelableParams = new ParcelableRttParams(params);
- return parcelableParams;
- }
-
- @Override
- public ParcelableRttParams[] newArray(int size) {
- return new ParcelableRttParams[size];
- }
- };
- }
-
- @Deprecated
- public static class WifiInformationElement {
- /** Information Element ID 0xFF means element is invalid. */
- public byte id;
- public byte[] data;
- }
- /** specifies RTT results */
- @Deprecated
- public static class RttResult {
- /** mac address of the device being ranged. */
- public String bssid;
-
- /** # of burst for this measurement. */
- public int burstNumber;
-
- /** total number of measurement frames attempted in this measurement. */
- public int measurementFrameNumber;
-
- /** total successful number of measurement frames in this measurement. */
- public int successMeasurementFrameNumber;
-
- /**
- * Maximum number of frames per burst supported by peer. Two side RTT only
- * Valid only if less than request
- */
- public int frameNumberPerBurstPeer;
-
- /** status of the request */
- public int status;
-
- /**
- * type of the request used
- * @deprecated Use {@link android.net.wifi.RttManager.RttResult#measurementType}
- */
- @Deprecated
- public int requestType;
-
- /** RTT measurement method type used, should be one of RTT_TYPE_ONE_SIDED or
- * RTT_TYPE_TWO_SIDED.
- */
- public int measurementType;
-
- /**
- * only valid when status == RTT_STATUS_FAIL_BUSY_TRY_LATER
- * please retry RTT measurement after this duration since peer indicate busy at ths moment
- * Unit S Range:1-31
- */
- public int retryAfterDuration;
-
- /** timestamp of completion, in microsecond since boot. */
- public long ts;
-
- /** average RSSI observed, unit of 0.5 dB. */
- public int rssi;
-
- /**
- * RSSI spread (i.e. max - min)
- * @deprecated Use {@link android.net.wifi.RttManager.RttResult#rssiSpread} API.
- */
- @Deprecated
- public int rssi_spread;
-
- /**RSSI spread (i.e. max - min), unit of 0.5 dB. */
- public int rssiSpread;
-
- /**
- * average transmit rate
- * @deprecated Use {@link android.net.wifi.RttManager.RttResult#txRate} API.
- */
- @Deprecated
- public int tx_rate;
-
- /** average transmit rate. Unit (kbps). */
- public int txRate;
-
- /** average receiving rate Unit (kbps). */
- public int rxRate;
-
- /**
- * average round trip time in nano second
- * @deprecated Use {@link android.net.wifi.RttManager.RttResult#rtt} API.
- */
- @Deprecated
- public long rtt_ns;
-
- /** average round trip time in picoseconds. */
- public long rtt;
-
- /**
- * standard deviation observed in round trip time
- * @deprecated Use {@link android.net.wifi.RttManager.RttResult#rttStandardDeviation} API.
- */
- @Deprecated
- public long rtt_sd_ns;
-
- /** standard deviation of RTT in picoseconds. */
- public long rttStandardDeviation;
-
- /**
- * spread (i.e. max - min) round trip time
- * @deprecated Use {@link android.net.wifi.RttManager.RttResult#rttSpread} API.
- */
- @Deprecated
- public long rtt_spread_ns;
-
- /** spread (i.e. max - min) RTT in picoseconds. */
- public long rttSpread;
-
- /**
- * average distance in centimeter, computed based on rtt_ns
- * @deprecated use {@link android.net.wifi.RttManager.RttResult#distance} API.
- */
- @Deprecated
- public int distance_cm;
-
- /** average distance in cm, computed based on rtt. */
- public int distance;
-
- /**
- * standard deviation observed in distance
- * @deprecated
- * Use {@link .android.net.wifi.RttManager.RttResult#distanceStandardDeviation} API.
- */
- @Deprecated
- public int distance_sd_cm;
-
- /** standard deviation observed in distance in cm. */
- public int distanceStandardDeviation;
-
- /**
- * spread (i.e. max - min) distance
- * @deprecated Use {@link android.net.wifi.RttManager.RttResult#distanceSpread} API.
- */
- @Deprecated
- public int distance_spread_cm;
-
- /** spread (i.e. max - min) distance in cm. */
- public int distanceSpread;
-
- /** the duration of this measurement burst, unit ms. */
- public int burstDuration;
-
- /** Burst number supported by peer after negotiation, 2side RTT only*/
- public int negotiatedBurstNum;
-
- /** LCI information Element, only available for double side RTT. */
- public WifiInformationElement LCI;
-
- /** LCR information Element, only available to double side RTT. */
- public WifiInformationElement LCR;
-
- /**
- * Whether the secure RTT protocol was used for ranging.
- */
- public boolean secure;
- }
-
-
- /** pseudo-private class used to parcel results. */
- @Deprecated
- public static class ParcelableRttResults implements Parcelable {
-
- public RttResult mResults[];
-
- public ParcelableRttResults(RttResult[] results) {
- mResults = results;
- }
-
- /**
- * {@hide}
- */
- public String toString() {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < mResults.length; ++i) {
- sb.append("[" + i + "]: ");
- sb.append("bssid=" + mResults[i].bssid);
- sb.append(", burstNumber=" + mResults[i].burstNumber);
- sb.append(", measurementFrameNumber=" + mResults[i].measurementFrameNumber);
- sb.append(", successMeasurementFrameNumber="
- + mResults[i].successMeasurementFrameNumber);
- sb.append(", frameNumberPerBurstPeer=" + mResults[i].frameNumberPerBurstPeer);
- sb.append(", status=" + mResults[i].status);
- sb.append(", requestType=" + mResults[i].requestType);
- sb.append(", measurementType=" + mResults[i].measurementType);
- sb.append(", retryAfterDuration=" + mResults[i].retryAfterDuration);
- sb.append(", ts=" + mResults[i].ts);
- sb.append(", rssi=" + mResults[i].rssi);
- sb.append(", rssi_spread=" + mResults[i].rssi_spread);
- sb.append(", rssiSpread=" + mResults[i].rssiSpread);
- sb.append(", tx_rate=" + mResults[i].tx_rate);
- sb.append(", txRate=" + mResults[i].txRate);
- sb.append(", rxRate=" + mResults[i].rxRate);
- sb.append(", rtt_ns=" + mResults[i].rtt_ns);
- sb.append(", rtt=" + mResults[i].rtt);
- sb.append(", rtt_sd_ns=" + mResults[i].rtt_sd_ns);
- sb.append(", rttStandardDeviation=" + mResults[i].rttStandardDeviation);
- sb.append(", rtt_spread_ns=" + mResults[i].rtt_spread_ns);
- sb.append(", rttSpread=" + mResults[i].rttSpread);
- sb.append(", distance_cm=" + mResults[i].distance_cm);
- sb.append(", distance=" + mResults[i].distance);
- sb.append(", distance_sd_cm=" + mResults[i].distance_sd_cm);
- sb.append(", distanceStandardDeviation=" + mResults[i].distanceStandardDeviation);
- sb.append(", distance_spread_cm=" + mResults[i].distance_spread_cm);
- sb.append(", distanceSpread=" + mResults[i].distanceSpread);
- sb.append(", burstDuration=" + mResults[i].burstDuration);
- sb.append(", negotiatedBurstNum=" + mResults[i].negotiatedBurstNum);
- sb.append(", LCI=" + mResults[i].LCI);
- sb.append(", LCR=" + mResults[i].LCR);
- sb.append(", secure=" + mResults[i].secure);
- }
- return sb.toString();
- }
-
- /** Implement the Parcelable interface {@hide} */
- @Override
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- if (mResults != null) {
- dest.writeInt(mResults.length);
- for (RttResult result : mResults) {
- dest.writeString(result.bssid);
- dest.writeInt(result.burstNumber);
- dest.writeInt(result.measurementFrameNumber);
- dest.writeInt(result.successMeasurementFrameNumber);
- dest.writeInt(result.frameNumberPerBurstPeer);
- dest.writeInt(result.status);
- dest.writeInt(result.measurementType);
- dest.writeInt(result.retryAfterDuration);
- dest.writeLong(result.ts);
- dest.writeInt(result.rssi);
- dest.writeInt(result.rssiSpread);
- dest.writeInt(result.txRate);
- dest.writeLong(result.rtt);
- dest.writeLong(result.rttStandardDeviation);
- dest.writeLong(result.rttSpread);
- dest.writeInt(result.distance);
- dest.writeInt(result.distanceStandardDeviation);
- dest.writeInt(result.distanceSpread);
- dest.writeInt(result.burstDuration);
- dest.writeInt(result.negotiatedBurstNum);
- dest.writeByte(result.LCI.id);
- if (result.LCI.id != (byte) 0xFF) {
- dest.writeByte((byte)result.LCI.data.length);
- dest.writeByteArray(result.LCI.data);
- }
- dest.writeByte(result.LCR.id);
- if (result.LCR.id != (byte) 0xFF) {
- dest.writeByte((byte) result.LCR.data.length);
- dest.writeByteArray(result.LCR.data);
- }
- dest.writeByte(result.secure ? (byte) 1 : 0);
- }
- } else {
- dest.writeInt(0);
- }
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final @android.annotation.NonNull Creator<ParcelableRttResults> CREATOR =
- new Creator<ParcelableRttResults>() {
- @Override
- public ParcelableRttResults createFromParcel(Parcel in) {
-
- int num = in.readInt();
-
- if (num == 0) {
- return new ParcelableRttResults(null);
- }
-
- RttResult results[] = new RttResult[num];
- for (int i = 0; i < num; i++) {
- results[i] = new RttResult();
- results[i].bssid = in.readString();
- results[i].burstNumber = in.readInt();
- results[i].measurementFrameNumber = in.readInt();
- results[i].successMeasurementFrameNumber = in.readInt();
- results[i].frameNumberPerBurstPeer = in.readInt();
- results[i].status = in.readInt();
- results[i].measurementType = in.readInt();
- results[i].retryAfterDuration = in.readInt();
- results[i].ts = in.readLong();
- results[i].rssi = in.readInt();
- results[i].rssiSpread = in.readInt();
- results[i].txRate = in.readInt();
- results[i].rtt = in.readLong();
- results[i].rttStandardDeviation = in.readLong();
- results[i].rttSpread = in.readLong();
- results[i].distance = in.readInt();
- results[i].distanceStandardDeviation = in.readInt();
- results[i].distanceSpread = in.readInt();
- results[i].burstDuration = in.readInt();
- results[i].negotiatedBurstNum = in.readInt();
- results[i].LCI = new WifiInformationElement();
- results[i].LCI.id = in.readByte();
- if (results[i].LCI.id != (byte) 0xFF) {
- byte length = in.readByte();
- results[i].LCI.data = new byte[length];
- in.readByteArray(results[i].LCI.data);
- }
- results[i].LCR = new WifiInformationElement();
- results[i].LCR.id = in.readByte();
- if (results[i].LCR.id != (byte) 0xFF) {
- byte length = in.readByte();
- results[i].LCR.data = new byte[length];
- in.readByteArray(results[i].LCR.data);
- }
- results[i].secure = (in.readByte() != 0);
- }
-
- ParcelableRttResults parcelableResults = new ParcelableRttResults(results);
- return parcelableResults;
- }
-
- @Override
- public ParcelableRttResults[] newArray(int size) {
- return new ParcelableRttResults[size];
- }
- };
- }
-
- @Deprecated
- public static interface RttListener {
- public void onSuccess(RttResult[] results);
- public void onFailure(int reason, String description);
- public void onAborted();
- }
-
- /**
- * Request to start an RTT ranging
- * <p>
- * This method is deprecated. Please use the
- * {@link WifiRttManager#startRanging(RangingRequest, java.util.concurrent.Executor, RangingResultCallback)}
- * API.
- *
- * @param params -- RTT request Parameters
- * @param listener -- Call back to inform RTT result
- * @exception throw IllegalArgumentException when params are illegal
- * throw IllegalStateException when RttCapabilities do not exist
- */
- @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
- public void startRanging(RttParams[] params, RttListener listener) {
- Log.i(TAG, "Send RTT request to RTT Service");
-
- if (!mNewService.isAvailable()) {
- listener.onFailure(REASON_NOT_AVAILABLE, "");
- return;
- }
-
- RangingRequest.Builder builder = new RangingRequest.Builder();
- for (RttParams rttParams : params) {
- if (rttParams.deviceType != RTT_PEER_TYPE_AP) {
- listener.onFailure(REASON_INVALID_REQUEST, "Only AP peers are supported");
- return;
- }
-
- ScanResult reconstructed = new ScanResult();
- reconstructed.BSSID = rttParams.bssid;
- if (rttParams.requestType == RTT_TYPE_TWO_SIDED) {
- reconstructed.setFlag(ScanResult.FLAG_80211mc_RESPONDER);
- }
- reconstructed.channelWidth = rttParams.channelWidth;
- reconstructed.frequency = rttParams.frequency;
- reconstructed.centerFreq0 = rttParams.centerFreq0;
- reconstructed.centerFreq1 = rttParams.centerFreq1;
- builder.addResponder(
- android.net.wifi.rtt.ResponderConfig.fromScanResult(reconstructed));
- }
- try {
- mNewService.startRanging(builder.build(),
- mContext.getMainExecutor(),
- new RangingResultCallback() {
- @Override
- public void onRangingFailure(int code) {
- int localCode = REASON_UNSPECIFIED;
- if (code == STATUS_CODE_FAIL_RTT_NOT_AVAILABLE) {
- localCode = REASON_NOT_AVAILABLE;
- }
- listener.onFailure(localCode, "");
- }
-
- @Override
- public void onRangingResults(List<RangingResult> results) {
- RttResult[] legacyResults = new RttResult[results.size()];
- int i = 0;
- for (RangingResult result : results) {
- legacyResults[i] = new RttResult();
- legacyResults[i].status = result.getStatus();
- legacyResults[i].bssid = result.getMacAddress().toString();
- if (result.getStatus() == RangingResult.STATUS_SUCCESS) {
- legacyResults[i].distance = result.getDistanceMm() / 10;
- legacyResults[i].distanceStandardDeviation =
- result.getDistanceStdDevMm() / 10;
- legacyResults[i].rssi = result.getRssi() * -2;
- legacyResults[i].ts = result.getRangingTimestampMillis() * 1000;
- legacyResults[i].measurementFrameNumber =
- result.getNumAttemptedMeasurements();
- legacyResults[i].successMeasurementFrameNumber =
- result.getNumSuccessfulMeasurements();
- } else {
- // just in case legacy API needed some relatively real timestamp
- legacyResults[i].ts = SystemClock.elapsedRealtime() * 1000;
- }
- i++;
- }
- listener.onSuccess(legacyResults);
- }
- });
- } catch (IllegalArgumentException e) {
- Log.e(TAG, "startRanging: invalid arguments - " + e);
- listener.onFailure(REASON_INVALID_REQUEST, e.getMessage());
- } catch (SecurityException e) {
- Log.e(TAG, "startRanging: security exception - " + e);
- listener.onFailure(REASON_PERMISSION_DENIED, e.getMessage());
- }
- }
-
- /**
- * This method is deprecated and performs no function. Please use the {@link WifiRttManager}
- * API.
- */
- @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
- public void stopRanging(RttListener listener) {
- Log.e(TAG, "stopRanging: unsupported operation - nop");
- }
-
- /**
- * Callbacks for responder operations.
- * <p>
- * A {@link ResponderCallback} is the handle to the calling client. {@link RttManager} will keep
- * a reference to the callback for the entire period when responder is enabled. The same
- * callback as used in enabling responder needs to be passed for disabling responder.
- * The client can freely destroy or reuse the callback after {@link RttManager#disableResponder}
- * is called.
- */
- @Deprecated
- public abstract static class ResponderCallback {
- /** Callback when responder is enabled. */
- public abstract void onResponderEnabled(ResponderConfig config);
- /** Callback when enabling responder failed. */
- public abstract void onResponderEnableFailure(int reason);
- // TODO: consider adding onResponderAborted once it's supported.
- }
-
- /**
- * Enable Wi-Fi RTT responder mode on the device. The enabling result will be delivered via
- * {@code callback}.
- * <p>
- * Note calling this method with the same callback when the responder is already enabled won't
- * change the responder state, a cached {@link ResponderConfig} from the last enabling will be
- * returned through the callback.
- * <p>
- * This method is deprecated and will throw an {@link UnsupportedOperationException}
- * exception. Please use the {@link WifiRttManager} API to perform a Wi-Fi Aware peer-to-peer
- * ranging.
- *
- * @param callback Callback for responder enabling/disabling result.
- * @throws IllegalArgumentException If {@code callback} is null.
- */
- @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
- public void enableResponder(ResponderCallback callback) {
- throw new UnsupportedOperationException(
- "enableResponder is not supported in the adaptation layer");
- }
-
- /**
- * Disable Wi-Fi RTT responder mode on the device. The {@code callback} needs to be the
- * same one used in {@link #enableResponder(ResponderCallback)}.
- * <p>
- * Calling this method when responder isn't enabled won't have any effect. The callback can be
- * reused for enabling responder after this method is called.
- * <p>
- * This method is deprecated and will throw an {@link UnsupportedOperationException}
- * exception. Please use the {@link WifiRttManager} API to perform a Wi-Fi Aware peer-to-peer
- * ranging.
- *
- * @param callback The same callback used for enabling responder.
- * @throws IllegalArgumentException If {@code callback} is null.
- */
- @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
- public void disableResponder(ResponderCallback callback) {
- throw new UnsupportedOperationException(
- "disableResponder is not supported in the adaptation layer");
- }
-
- /**
- * Configuration used for RTT responder mode. The configuration information can be used by a
- * peer device to range the responder.
- *
- * @see ScanResult
- */
- @Deprecated
- public static class ResponderConfig implements Parcelable {
-
- // TODO: make all fields final once we can get mac address from responder HAL APIs.
- /**
- * Wi-Fi mac address used for responder mode.
- */
- public String macAddress = "";
-
- /**
- * The primary 20 MHz frequency (in MHz) of the channel where responder is enabled.
- * @see ScanResult#frequency
- */
- public int frequency;
-
- /**
- * Center frequency of the channel where responder is enabled on. Only in use when channel
- * width is at least 40MHz.
- * @see ScanResult#centerFreq0
- */
- public int centerFreq0;
-
- /**
- * Center frequency of the second segment when channel width is 80 + 80 MHz.
- * @see ScanResult#centerFreq1
- */
- public int centerFreq1;
-
- /**
- * Width of the channel where responder is enabled on.
- * @see ScanResult#channelWidth
- */
- public int channelWidth;
-
- /**
- * Preamble supported by responder.
- */
- public int preamble;
-
- @NonNull
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("macAddress = ").append(macAddress)
- .append(" frequency = ").append(frequency)
- .append(" centerFreq0 = ").append(centerFreq0)
- .append(" centerFreq1 = ").append(centerFreq1)
- .append(" channelWidth = ").append(channelWidth)
- .append(" preamble = ").append(preamble);
- return builder.toString();
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(macAddress);
- dest.writeInt(frequency);
- dest.writeInt(centerFreq0);
- dest.writeInt(centerFreq1);
- dest.writeInt(channelWidth);
- dest.writeInt(preamble);
- }
-
- /** Implement {@link Parcelable} interface */
- public static final @android.annotation.NonNull Parcelable.Creator<ResponderConfig> CREATOR =
- new Parcelable.Creator<ResponderConfig>() {
- @Override
- public ResponderConfig createFromParcel(Parcel in) {
- ResponderConfig config = new ResponderConfig();
- config.macAddress = in.readString();
- config.frequency = in.readInt();
- config.centerFreq0 = in.readInt();
- config.centerFreq1 = in.readInt();
- config.channelWidth = in.readInt();
- config.preamble = in.readInt();
- return config;
- }
-
- @Override
- public ResponderConfig[] newArray(int size) {
- return new ResponderConfig[size];
- }
- };
-
- }
-
- /* private methods */
- public static final int BASE = Protocol.BASE_WIFI_RTT_MANAGER;
-
- public static final int CMD_OP_START_RANGING = BASE + 0;
- public static final int CMD_OP_STOP_RANGING = BASE + 1;
- public static final int CMD_OP_FAILED = BASE + 2;
- public static final int CMD_OP_SUCCEEDED = BASE + 3;
- public static final int CMD_OP_ABORTED = BASE + 4;
- public static final int CMD_OP_ENABLE_RESPONDER = BASE + 5;
- public static final int CMD_OP_DISABLE_RESPONDER = BASE + 6;
- public static final int
- CMD_OP_ENALBE_RESPONDER_SUCCEEDED = BASE + 7;
- public static final int
- CMD_OP_ENALBE_RESPONDER_FAILED = BASE + 8;
- /** @hide */
- public static final int CMD_OP_REG_BINDER = BASE + 9;
-
- private final WifiRttManager mNewService;
- private final Context mContext;
- private RttCapabilities mRttCapabilities;
-
- /**
- * Create a new WifiScanner instance.
- * Applications will almost always want to use
- * {@link android.content.Context#getSystemService Context.getSystemService()} to retrieve
- * the standard {@link android.content.Context#WIFI_RTT_SERVICE Context.WIFI_RTT_SERVICE}.
- * @param service the new WifiRttManager service
- *
- * @hide
- */
- public RttManager(@NonNull Context context, @NonNull WifiRttManager service) {
- mNewService = service;
- mContext = context;
-
- boolean rttSupported = context.getPackageManager().hasSystemFeature(
- PackageManager.FEATURE_WIFI_RTT);
-
- mRttCapabilities = new RttCapabilities();
- mRttCapabilities.oneSidedRttSupported = rttSupported;
- mRttCapabilities.twoSided11McRttSupported = rttSupported;
- mRttCapabilities.lciSupported = false;
- mRttCapabilities.lcrSupported = false;
- mRttCapabilities.preambleSupported = PREAMBLE_HT | PREAMBLE_VHT;
- mRttCapabilities.bwSupported = RTT_BW_40_SUPPORT | RTT_BW_80_SUPPORT;
- mRttCapabilities.responderSupported = false;
- mRttCapabilities.secureRttSupported = false;
- }
-}
-
diff --git a/wifi/java/android/net/wifi/ScanResult.java b/wifi/java/android/net/wifi/ScanResult.java
deleted file mode 100644
index 9f8ecf1..0000000
--- a/wifi/java/android/net/wifi/ScanResult.java
+++ /dev/null
@@ -1,1223 +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 android.net.wifi;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SystemApi;
-import android.compat.annotation.UnsupportedAppUsage;
-import android.net.wifi.WifiAnnotations.ChannelWidth;
-import android.net.wifi.WifiAnnotations.WifiStandard;
-import android.os.Build;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * Describes information about a detected access point. In addition
- * to the attributes described here, the supplicant keeps track of
- * {@code quality}, {@code noise}, and {@code maxbitrate} attributes,
- * but does not currently report them to external clients.
- */
-public final class ScanResult implements Parcelable {
- /**
- * The network name.
- */
- public String SSID;
-
- /**
- * Ascii encoded SSID. This will replace SSID when we deprecate it. @hide
- */
- @UnsupportedAppUsage
- public WifiSsid wifiSsid;
-
- /**
- * The address of the access point.
- */
- public String BSSID;
-
- /**
- * The HESSID from the beacon.
- * @hide
- */
- @UnsupportedAppUsage
- public long hessid;
-
- /**
- * The ANQP Domain ID from the Hotspot 2.0 Indication element, if present.
- * @hide
- */
- @UnsupportedAppUsage
- public int anqpDomainId;
-
- /*
- * This field is equivalent to the |flags|, rather than the |capabilities| field
- * of the per-BSS scan results returned by WPA supplicant. See the definition of
- * |struct wpa_bss| in wpa_supplicant/bss.h for more details.
- */
- /**
- * Describes the authentication, key management, and encryption schemes
- * supported by the access point.
- */
- public String capabilities;
-
- /**
- * The interface name on which the scan result was received.
- * @hide
- */
- public String ifaceName;
-
- /**
- * @hide
- * No security protocol.
- */
- @SystemApi
- public static final int PROTOCOL_NONE = 0;
- /**
- * @hide
- * Security protocol type: WPA version 1.
- */
- @SystemApi
- public static final int PROTOCOL_WPA = 1;
- /**
- * @hide
- * Security protocol type: RSN, for WPA version 2, and version 3.
- */
- @SystemApi
- public static final int PROTOCOL_RSN = 2;
- /**
- * @hide
- * Security protocol type:
- * OSU Server-only authenticated layer 2 Encryption Network.
- * Used for Hotspot 2.0.
- */
- @SystemApi
- public static final int PROTOCOL_OSEN = 3;
-
- /**
- * @hide
- * Security protocol type: WAPI.
- */
- @SystemApi
- public static final int PROTOCOL_WAPI = 4;
-
- /**
- * @hide
- * No security key management scheme.
- */
- @SystemApi
- public static final int KEY_MGMT_NONE = 0;
- /**
- * @hide
- * Security key management scheme: PSK.
- */
- @SystemApi
- public static final int KEY_MGMT_PSK = 1;
- /**
- * @hide
- * Security key management scheme: EAP.
- */
- @SystemApi
- public static final int KEY_MGMT_EAP = 2;
- /**
- * @hide
- * Security key management scheme: FT_PSK.
- */
- @SystemApi
- public static final int KEY_MGMT_FT_PSK = 3;
- /**
- * @hide
- * Security key management scheme: FT_EAP.
- */
- @SystemApi
- public static final int KEY_MGMT_FT_EAP = 4;
- /**
- * @hide
- * Security key management scheme: PSK_SHA256
- */
- @SystemApi
- public static final int KEY_MGMT_PSK_SHA256 = 5;
- /**
- * @hide
- * Security key management scheme: EAP_SHA256.
- */
- @SystemApi
- public static final int KEY_MGMT_EAP_SHA256 = 6;
- /**
- * @hide
- * Security key management scheme: OSEN.
- * Used for Hotspot 2.0.
- */
- @SystemApi
- public static final int KEY_MGMT_OSEN = 7;
- /**
- * @hide
- * Security key management scheme: SAE.
- */
- @SystemApi
- public static final int KEY_MGMT_SAE = 8;
- /**
- * @hide
- * Security key management scheme: OWE.
- */
- @SystemApi
- public static final int KEY_MGMT_OWE = 9;
- /**
- * @hide
- * Security key management scheme: SUITE_B_192.
- */
- @SystemApi
- public static final int KEY_MGMT_EAP_SUITE_B_192 = 10;
- /**
- * @hide
- * Security key management scheme: FT_SAE.
- */
- @SystemApi
- public static final int KEY_MGMT_FT_SAE = 11;
- /**
- * @hide
- * Security key management scheme: OWE in transition mode.
- */
- @SystemApi
- public static final int KEY_MGMT_OWE_TRANSITION = 12;
- /**
- * @hide
- * Security key management scheme: WAPI_PSK.
- */
- @SystemApi
- public static final int KEY_MGMT_WAPI_PSK = 13;
- /**
- * @hide
- * Security key management scheme: WAPI_CERT.
- */
- @SystemApi
- public static final int KEY_MGMT_WAPI_CERT = 14;
-
- /**
- * @hide
- * Security key management scheme: FILS_SHA256.
- */
- public static final int KEY_MGMT_FILS_SHA256 = 15;
- /**
- * @hide
- * Security key management scheme: FILS_SHA384.
- */
- public static final int KEY_MGMT_FILS_SHA384 = 16;
- /**
- * @hide
- * No cipher suite.
- */
- @SystemApi
- public static final int CIPHER_NONE = 0;
- /**
- * @hide
- * No group addressed, only used for group data cipher.
- */
- @SystemApi
- public static final int CIPHER_NO_GROUP_ADDRESSED = 1;
- /**
- * @hide
- * Cipher suite: TKIP
- */
- @SystemApi
- public static final int CIPHER_TKIP = 2;
- /**
- * @hide
- * Cipher suite: CCMP
- */
- @SystemApi
- public static final int CIPHER_CCMP = 3;
- /**
- * @hide
- * Cipher suite: GCMP
- */
- @SystemApi
- public static final int CIPHER_GCMP_256 = 4;
- /**
- * @hide
- * Cipher suite: SMS4
- */
- @SystemApi
- public static final int CIPHER_SMS4 = 5;
-
- /**
- * The detected signal level in dBm, also known as the RSSI.
- *
- * <p>Use {@link android.net.wifi.WifiManager#calculateSignalLevel} to convert this number into
- * an absolute signal level which can be displayed to a user.
- */
- public int level;
- /**
- * The primary 20 MHz frequency (in MHz) of the channel over which the client is communicating
- * with the access point.
- */
- public int frequency;
-
- /**
- * AP Channel bandwidth is 20 MHZ
- */
- public static final int CHANNEL_WIDTH_20MHZ = 0;
- /**
- * AP Channel bandwidth is 40 MHZ
- */
- public static final int CHANNEL_WIDTH_40MHZ = 1;
- /**
- * AP Channel bandwidth is 80 MHZ
- */
- public static final int CHANNEL_WIDTH_80MHZ = 2;
- /**
- * AP Channel bandwidth is 160 MHZ
- */
- public static final int CHANNEL_WIDTH_160MHZ = 3;
- /**
- * AP Channel bandwidth is 160 MHZ, but 80MHZ + 80MHZ
- */
- public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 4;
-
- /**
- * Wi-Fi unknown standard
- */
- public static final int WIFI_STANDARD_UNKNOWN = 0;
-
- /**
- * Wi-Fi 802.11a/b/g
- */
- public static final int WIFI_STANDARD_LEGACY = 1;
-
- /**
- * Wi-Fi 802.11n
- */
- public static final int WIFI_STANDARD_11N = 4;
-
- /**
- * Wi-Fi 802.11ac
- */
- public static final int WIFI_STANDARD_11AC = 5;
-
- /**
- * Wi-Fi 802.11ax
- */
- 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;
-
- /**
- * return the AP wifi standard.
- */
- public @WifiStandard int getWifiStandard() {
- return mWifiStandard;
- }
-
- /**
- * sets the AP wifi standard.
- * @hide
- */
- public void setWifiStandard(@WifiStandard int standard) {
- mWifiStandard = standard;
- }
-
- /**
- * Convert Wi-Fi standard to string
- */
- private static @Nullable String wifiStandardToString(@WifiStandard int standard) {
- switch(standard) {
- case WIFI_STANDARD_LEGACY:
- return "legacy";
- case WIFI_STANDARD_11N:
- return "11n";
- case WIFI_STANDARD_11AC:
- return "11ac";
- case WIFI_STANDARD_11AX:
- return "11ax";
- case WIFI_STANDARD_11AD:
- return "11ad";
- case WIFI_STANDARD_UNKNOWN:
- return "unknown";
- }
- return null;
- }
-
- /**
- * AP Channel bandwidth; one of {@link #CHANNEL_WIDTH_20MHZ}, {@link #CHANNEL_WIDTH_40MHZ},
- * {@link #CHANNEL_WIDTH_80MHZ}, {@link #CHANNEL_WIDTH_160MHZ}
- * or {@link #CHANNEL_WIDTH_80MHZ_PLUS_MHZ}.
- */
- public @ChannelWidth int channelWidth;
-
- /**
- * Not used if the AP bandwidth is 20 MHz
- * If the AP use 40, 80 or 160 MHz, this is the center frequency (in MHz)
- * if the AP use 80 + 80 MHz, this is the center frequency of the first segment (in MHz)
- */
- public int centerFreq0;
-
- /**
- * Only used if the AP bandwidth is 80 + 80 MHz
- * if the AP use 80 + 80 MHz, this is the center frequency of the second segment (in MHz)
- */
- public int centerFreq1;
-
- /**
- * @deprecated use is80211mcResponder() instead
- * @hide
- */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public boolean is80211McRTTResponder;
-
- /**
- * timestamp in microseconds (since boot) when
- * this result was last seen.
- */
- public long timestamp;
-
- /**
- * Timestamp representing date when this result was last seen, in milliseconds from 1970
- * {@hide}
- */
- @UnsupportedAppUsage
- public long seen;
-
- /**
- * On devices with multiple hardware radio chains, this class provides metadata about
- * each radio chain that was used to receive this scan result (probe response or beacon).
- * {@hide}
- */
- public static class RadioChainInfo {
- /** Vendor defined id for a radio chain. */
- public int id;
- /** Detected signal level in dBm (also known as the RSSI) on this radio chain. */
- public int level;
-
- @Override
- public String toString() {
- return "RadioChainInfo: id=" + id + ", level=" + level;
- }
-
- @Override
- public boolean equals(Object otherObj) {
- if (this == otherObj) {
- return true;
- }
- if (!(otherObj instanceof RadioChainInfo)) {
- return false;
- }
- RadioChainInfo other = (RadioChainInfo) otherObj;
- return id == other.id && level == other.level;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, level);
- }
- };
-
- /**
- * Information about the list of the radio chains used to receive this scan result
- * (probe response or beacon).
- *
- * For Example: On devices with 2 hardware radio chains, this list could hold 1 or 2
- * entries based on whether this scan result was received using one or both the chains.
- * {@hide}
- */
- public RadioChainInfo[] radioChainInfos;
-
- /**
- * Status indicating the scan result does not correspond to a user's saved configuration
- * @hide
- * @removed
- */
- @SystemApi
- public boolean untrusted;
-
- /**
- * Number of time autojoin used it
- * @hide
- */
- @UnsupportedAppUsage
- public int numUsage;
-
- /**
- * The approximate distance to the AP in centimeter, if available. Else
- * {@link UNSPECIFIED}.
- * {@hide}
- */
- @UnsupportedAppUsage
- public int distanceCm;
-
- /**
- * The standard deviation of the distance to the access point, if available.
- * Else {@link UNSPECIFIED}.
- * {@hide}
- */
- @UnsupportedAppUsage
- public int distanceSdCm;
-
- /** {@hide} */
- public static final long FLAG_PASSPOINT_NETWORK = 0x0000000000000001;
-
- /** {@hide} */
- public static final long FLAG_80211mc_RESPONDER = 0x0000000000000002;
-
- /*
- * These flags are specific to the ScanResult class, and are not related to the |flags|
- * field of the per-BSS scan results from WPA supplicant.
- */
- /**
- * Defines flags; such as {@link #FLAG_PASSPOINT_NETWORK}.
- * {@hide}
- */
- @UnsupportedAppUsage
- public long flags;
-
- /**
- * sets a flag in {@link #flags} field
- * @param flag flag to set
- * @hide
- */
- public void setFlag(long flag) {
- flags |= flag;
- }
-
- /**
- * clears a flag in {@link #flags} field
- * @param flag flag to set
- * @hide
- */
- public void clearFlag(long flag) {
- flags &= ~flag;
- }
-
- public boolean is80211mcResponder() {
- return (flags & FLAG_80211mc_RESPONDER) != 0;
- }
-
- public boolean isPasspointNetwork() {
- return (flags & FLAG_PASSPOINT_NETWORK) != 0;
- }
-
- /**
- * Indicates venue name (such as 'San Francisco Airport') published by access point; only
- * available on Passpoint network and if published by access point.
- */
- public CharSequence venueName;
-
- /**
- * Indicates Passpoint operator name published by access point.
- */
- public CharSequence operatorFriendlyName;
-
- /**
- * {@hide}
- */
- public final static int UNSPECIFIED = -1;
-
- /**
- * 2.4 GHz band first channel number
- * @hide
- */
- public static final int BAND_24_GHZ_FIRST_CH_NUM = 1;
- /**
- * 2.4 GHz band last channel number
- * @hide
- */
- public static final int BAND_24_GHZ_LAST_CH_NUM = 14;
- /**
- * 2.4 GHz band frequency of first channel in MHz
- * @hide
- */
- public static final int BAND_24_GHZ_START_FREQ_MHZ = 2412;
- /**
- * 2.4 GHz band frequency of last channel in MHz
- * @hide
- */
- public static final int BAND_24_GHZ_END_FREQ_MHZ = 2484;
-
- /**
- * 5 GHz band first channel number
- * @hide
- */
- public static final int BAND_5_GHZ_FIRST_CH_NUM = 32;
- /**
- * 5 GHz band last channel number
- * @hide
- */
- public static final int BAND_5_GHZ_LAST_CH_NUM = 173;
- /**
- * 5 GHz band frequency of first channel in MHz
- * @hide
- */
- public static final int BAND_5_GHZ_START_FREQ_MHZ = 5160;
- /**
- * 5 GHz band frequency of last channel in MHz
- * @hide
- */
- public static final int BAND_5_GHZ_END_FREQ_MHZ = 5865;
-
- /**
- * 6 GHz band first channel number
- * @hide
- */
- public static final int BAND_6_GHZ_FIRST_CH_NUM = 1;
- /**
- * 6 GHz band last channel number
- * @hide
- */
- public static final int BAND_6_GHZ_LAST_CH_NUM = 233;
- /**
- * 6 GHz band frequency of first channel in MHz
- * @hide
- */
- public static final int BAND_6_GHZ_START_FREQ_MHZ = 5955;
- /**
- * 6 GHz band frequency of last channel in MHz
- * @hide
- */
- public static final int BAND_6_GHZ_END_FREQ_MHZ = 7115;
-
- /**
- * 6 GHz band operating class 136 channel 2 center frequency in MHz
- * @hide
- */
- public static final int BAND_6_GHZ_OP_CLASS_136_CH_2_FREQ_MHZ = 5935;
-
- /**
- * 60 GHz band first channel number
- * @hide
- */
- public static final int BAND_60_GHZ_FIRST_CH_NUM = 1;
- /**
- * 60 GHz band last channel number
- * @hide
- */
- public static final int BAND_60_GHZ_LAST_CH_NUM = 6;
- /**
- * 60 GHz band frequency of first channel in MHz
- * @hide
- */
- public static final int BAND_60_GHZ_START_FREQ_MHZ = 58320;
- /**
- * 60 GHz band frequency of last channel in MHz
- * @hide
- */
- public static final int BAND_60_GHZ_END_FREQ_MHZ = 70200;
-
- /**
- * Utility function to check if a frequency within 2.4 GHz band
- * @param freqMhz frequency in MHz
- * @return true if within 2.4GHz, false otherwise
- *
- * @hide
- */
- public static boolean is24GHz(int freqMhz) {
- return freqMhz >= BAND_24_GHZ_START_FREQ_MHZ && freqMhz <= BAND_24_GHZ_END_FREQ_MHZ;
- }
-
- /**
- * Utility function to check if a frequency within 5 GHz band
- * @param freqMhz frequency in MHz
- * @return true if within 5GHz, false otherwise
- *
- * @hide
- */
- public static boolean is5GHz(int freqMhz) {
- return freqMhz >= BAND_5_GHZ_START_FREQ_MHZ && freqMhz <= BAND_5_GHZ_END_FREQ_MHZ;
- }
-
- /**
- * Utility function to check if a frequency within 6 GHz band
- * @param freqMhz
- * @return true if within 6GHz, false otherwise
- *
- * @hide
- */
- public static boolean is6GHz(int freqMhz) {
- if (freqMhz == BAND_6_GHZ_OP_CLASS_136_CH_2_FREQ_MHZ) {
- return true;
- }
- return (freqMhz >= BAND_6_GHZ_START_FREQ_MHZ && freqMhz <= BAND_6_GHZ_END_FREQ_MHZ);
- }
-
- /**
- * Utility function to check if a frequency within 60 GHz band
- * @param freqMhz
- * @return true if within 60GHz, false otherwise
- *
- * @hide
- */
- public static boolean is60GHz(int freqMhz) {
- return freqMhz >= BAND_60_GHZ_START_FREQ_MHZ && freqMhz <= BAND_60_GHZ_END_FREQ_MHZ;
- }
-
- /**
- * Utility function to convert channel number/band to frequency in MHz
- * @param channel number to convert
- * @param band of channel to convert
- * @return center frequency in Mhz of the channel, {@link UNSPECIFIED} if no match
- *
- * @hide
- */
- public static int convertChannelToFrequencyMhz(int channel, @WifiScanner.WifiBand int band) {
- if (band == WifiScanner.WIFI_BAND_24_GHZ) {
- // Special case
- if (channel == 14) {
- return 2484;
- } else if (channel >= BAND_24_GHZ_FIRST_CH_NUM && channel <= BAND_24_GHZ_LAST_CH_NUM) {
- return ((channel - BAND_24_GHZ_FIRST_CH_NUM) * 5) + BAND_24_GHZ_START_FREQ_MHZ;
- } else {
- return UNSPECIFIED;
- }
- }
- if (band == WifiScanner.WIFI_BAND_5_GHZ) {
- if (channel >= BAND_5_GHZ_FIRST_CH_NUM && channel <= BAND_5_GHZ_LAST_CH_NUM) {
- return ((channel - BAND_5_GHZ_FIRST_CH_NUM) * 5) + BAND_5_GHZ_START_FREQ_MHZ;
- } else {
- return UNSPECIFIED;
- }
- }
- if (band == WifiScanner.WIFI_BAND_6_GHZ) {
- if (channel >= BAND_6_GHZ_FIRST_CH_NUM && channel <= BAND_6_GHZ_LAST_CH_NUM) {
- if (channel == 2) {
- return BAND_6_GHZ_OP_CLASS_136_CH_2_FREQ_MHZ;
- }
- return ((channel - BAND_6_GHZ_FIRST_CH_NUM) * 5) + BAND_6_GHZ_START_FREQ_MHZ;
- } else {
- 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;
- }
-
- /**
- * Utility function to convert frequency in MHz to channel number
- * @param freqMhz frequency in MHz
- * @return channel number associated with given frequency, {@link UNSPECIFIED} if no match
- *
- * @hide
- */
- public static int convertFrequencyMhzToChannel(int freqMhz) {
- // Special case
- if (freqMhz == 2484) {
- return 14;
- } else if (is24GHz(freqMhz)) {
- return (freqMhz - BAND_24_GHZ_START_FREQ_MHZ) / 5 + BAND_24_GHZ_FIRST_CH_NUM;
- } else if (is5GHz(freqMhz)) {
- return ((freqMhz - BAND_5_GHZ_START_FREQ_MHZ) / 5) + BAND_5_GHZ_FIRST_CH_NUM;
- } else if (is6GHz(freqMhz)) {
- if (freqMhz == BAND_6_GHZ_OP_CLASS_136_CH_2_FREQ_MHZ) {
- return 2;
- }
- return ((freqMhz - BAND_6_GHZ_START_FREQ_MHZ) / 5) + BAND_6_GHZ_FIRST_CH_NUM;
- }
-
- return UNSPECIFIED;
- }
-
- /**
- * @hide
- */
- public boolean is24GHz() {
- return ScanResult.is24GHz(frequency);
- }
-
- /**
- * @hide
- */
- public boolean is5GHz() {
- return ScanResult.is5GHz(frequency);
- }
-
- /**
- * @hide
- */
- public boolean is6GHz() {
- return ScanResult.is6GHz(frequency);
- }
-
- /**
- * @hide
- */
- public boolean is60GHz() {
- return ScanResult.is60GHz(frequency);
- }
-
- /**
- * @hide
- * anqp lines from supplicant BSS response
- */
- @UnsupportedAppUsage
- public List<String> anqpLines;
-
- /**
- * information elements from beacon.
- */
- public static class InformationElement {
- /** @hide */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int EID_SSID = 0;
- /** @hide */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int EID_SUPPORTED_RATES = 1;
- /** @hide */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int EID_TIM = 5;
- /** @hide */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int EID_BSS_LOAD = 11;
- /** @hide */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int EID_ERP = 42;
- /** @hide */
- public static final int EID_HT_CAPABILITIES = 45;
- /** @hide */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int EID_RSN = 48;
- /** @hide */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int EID_EXTENDED_SUPPORTED_RATES = 50;
- /** @hide */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int EID_HT_OPERATION = 61;
- /** @hide */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int EID_INTERWORKING = 107;
- /** @hide */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int EID_ROAMING_CONSORTIUM = 111;
- /** @hide */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int EID_EXTENDED_CAPS = 127;
- /** @hide */
- public static final int EID_VHT_CAPABILITIES = 191;
- /** @hide */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int EID_VHT_OPERATION = 192;
- /** @hide */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int EID_VSA = 221;
- /** @hide */
- public static final int EID_EXTENSION_PRESENT = 255;
-
- // Extension IDs
- /** @hide */
- public static final int EID_EXT_HE_CAPABILITIES = 35;
- /** @hide */
- public static final int EID_EXT_HE_OPERATION = 36;
-
- /** @hide */
- @UnsupportedAppUsage
- public int id;
- /** @hide */
- public int idExt;
-
- /** @hide */
- @UnsupportedAppUsage
- public byte[] bytes;
-
- /** @hide */
- public InformationElement() {
- }
-
- public InformationElement(@NonNull InformationElement rhs) {
- this.id = rhs.id;
- this.idExt = rhs.idExt;
- this.bytes = rhs.bytes.clone();
- }
-
- /**
- * The element ID of the information element. Defined in the IEEE 802.11-2016 spec
- * Table 9-77.
- */
- public int getId() {
- return id;
- }
-
- /**
- * The element ID Extension of the information element. Defined in the IEEE 802.11-2016 spec
- * Table 9-77.
- */
- public int getIdExt() {
- return idExt;
- }
-
- /**
- * Get the specific content of the information element.
- */
- @NonNull
- public ByteBuffer getBytes() {
- return ByteBuffer.wrap(bytes).asReadOnlyBuffer();
- }
- }
-
- /**
- * information elements found in the beacon.
- * @hide
- */
- @UnsupportedAppUsage
- public InformationElement[] informationElements;
- /**
- * Get all information elements found in the beacon.
- */
- @NonNull
- public List<InformationElement> getInformationElements() {
- return Collections.unmodifiableList(Arrays.asList(informationElements));
- }
-
- /** ANQP response elements.
- * @hide
- */
- public AnqpInformationElement[] anqpElements;
-
- /** {@hide} */
- public ScanResult(WifiSsid wifiSsid, String BSSID, long hessid, int anqpDomainId,
- byte[] osuProviders, String caps, int level, int frequency, long tsf) {
- this.wifiSsid = wifiSsid;
- this.SSID = (wifiSsid != null) ? wifiSsid.toString() : WifiManager.UNKNOWN_SSID;
- this.BSSID = BSSID;
- this.hessid = hessid;
- this.anqpDomainId = anqpDomainId;
- if (osuProviders != null) {
- this.anqpElements = new AnqpInformationElement[1];
- this.anqpElements[0] =
- new AnqpInformationElement(AnqpInformationElement.HOTSPOT20_VENDOR_ID,
- AnqpInformationElement.HS_OSU_PROVIDERS, osuProviders);
- }
- this.capabilities = caps;
- this.level = level;
- this.frequency = frequency;
- this.timestamp = tsf;
- this.distanceCm = UNSPECIFIED;
- this.distanceSdCm = UNSPECIFIED;
- this.channelWidth = UNSPECIFIED;
- this.centerFreq0 = UNSPECIFIED;
- this.centerFreq1 = UNSPECIFIED;
- this.flags = 0;
- this.radioChainInfos = null;
- this.mWifiStandard = WIFI_STANDARD_UNKNOWN;
- }
-
- /** {@hide} */
- public ScanResult(WifiSsid wifiSsid, String BSSID, String caps, int level, int frequency,
- long tsf, int distCm, int distSdCm) {
- this.wifiSsid = wifiSsid;
- this.SSID = (wifiSsid != null) ? wifiSsid.toString() : WifiManager.UNKNOWN_SSID;
- this.BSSID = BSSID;
- this.capabilities = caps;
- this.level = level;
- this.frequency = frequency;
- this.timestamp = tsf;
- this.distanceCm = distCm;
- this.distanceSdCm = distSdCm;
- this.channelWidth = UNSPECIFIED;
- this.centerFreq0 = UNSPECIFIED;
- this.centerFreq1 = UNSPECIFIED;
- this.flags = 0;
- this.radioChainInfos = null;
- this.mWifiStandard = WIFI_STANDARD_UNKNOWN;
- }
-
- /** {@hide} */
- public ScanResult(String Ssid, String BSSID, long hessid, int anqpDomainId, String caps,
- int level, int frequency,
- long tsf, int distCm, int distSdCm, int channelWidth, int centerFreq0, int centerFreq1,
- boolean is80211McRTTResponder) {
- this.SSID = Ssid;
- this.BSSID = BSSID;
- this.hessid = hessid;
- this.anqpDomainId = anqpDomainId;
- this.capabilities = caps;
- this.level = level;
- this.frequency = frequency;
- this.timestamp = tsf;
- this.distanceCm = distCm;
- this.distanceSdCm = distSdCm;
- this.channelWidth = channelWidth;
- this.centerFreq0 = centerFreq0;
- this.centerFreq1 = centerFreq1;
- if (is80211McRTTResponder) {
- this.flags = FLAG_80211mc_RESPONDER;
- } else {
- this.flags = 0;
- }
- this.radioChainInfos = null;
- this.mWifiStandard = WIFI_STANDARD_UNKNOWN;
- }
-
- /** {@hide} */
- public ScanResult(WifiSsid wifiSsid, String Ssid, String BSSID, long hessid, int anqpDomainId,
- String caps, int level,
- int frequency, long tsf, int distCm, int distSdCm, int channelWidth,
- int centerFreq0, int centerFreq1, boolean is80211McRTTResponder) {
- this(Ssid, BSSID, hessid, anqpDomainId, caps, level, frequency, tsf, distCm,
- distSdCm, channelWidth, centerFreq0, centerFreq1, is80211McRTTResponder);
- this.wifiSsid = wifiSsid;
- }
-
- /** copy constructor */
- public ScanResult(@NonNull ScanResult source) {
- if (source != null) {
- wifiSsid = source.wifiSsid;
- SSID = source.SSID;
- BSSID = source.BSSID;
- hessid = source.hessid;
- anqpDomainId = source.anqpDomainId;
- informationElements = source.informationElements;
- anqpElements = source.anqpElements;
- capabilities = source.capabilities;
- level = source.level;
- frequency = source.frequency;
- channelWidth = source.channelWidth;
- centerFreq0 = source.centerFreq0;
- centerFreq1 = source.centerFreq1;
- timestamp = source.timestamp;
- distanceCm = source.distanceCm;
- distanceSdCm = source.distanceSdCm;
- seen = source.seen;
- untrusted = source.untrusted;
- numUsage = source.numUsage;
- venueName = source.venueName;
- operatorFriendlyName = source.operatorFriendlyName;
- flags = source.flags;
- radioChainInfos = source.radioChainInfos;
- this.mWifiStandard = source.mWifiStandard;
- this.ifaceName = source.ifaceName;
- }
- }
-
- /** Construct an empty scan result. */
- public ScanResult() {
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- String none = "<none>";
-
- sb.append("SSID: ")
- .append(wifiSsid == null ? WifiManager.UNKNOWN_SSID : wifiSsid)
- .append(", BSSID: ")
- .append(BSSID == null ? none : BSSID)
- .append(", capabilities: ")
- .append(capabilities == null ? none : capabilities)
- .append(", level: ")
- .append(level)
- .append(", frequency: ")
- .append(frequency)
- .append(", timestamp: ")
- .append(timestamp);
- sb.append(", distance: ").append((distanceCm != UNSPECIFIED ? distanceCm : "?")).
- append("(cm)");
- sb.append(", distanceSd: ").append((distanceSdCm != UNSPECIFIED ? distanceSdCm : "?")).
- append("(cm)");
-
- sb.append(", passpoint: ");
- sb.append(((flags & FLAG_PASSPOINT_NETWORK) != 0) ? "yes" : "no");
- sb.append(", ChannelBandwidth: ").append(channelWidth);
- sb.append(", centerFreq0: ").append(centerFreq0);
- sb.append(", centerFreq1: ").append(centerFreq1);
- sb.append(", standard: ").append(wifiStandardToString(mWifiStandard));
- sb.append(", 80211mcResponder: ");
- sb.append(((flags & FLAG_80211mc_RESPONDER) != 0) ? "is supported" : "is not supported");
- sb.append(", Radio Chain Infos: ").append(Arrays.toString(radioChainInfos));
- sb.append(", interface name: ").append(ifaceName);
- return sb.toString();
- }
-
- /** Implement the Parcelable interface {@hide} */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public void writeToParcel(Parcel dest, int flags) {
- if (wifiSsid != null) {
- dest.writeInt(1);
- wifiSsid.writeToParcel(dest, flags);
- } else {
- dest.writeInt(0);
- }
- dest.writeString(SSID);
- dest.writeString(BSSID);
- dest.writeLong(hessid);
- dest.writeInt(anqpDomainId);
- dest.writeString(capabilities);
- dest.writeInt(level);
- dest.writeInt(frequency);
- dest.writeLong(timestamp);
- dest.writeInt(distanceCm);
- dest.writeInt(distanceSdCm);
- dest.writeInt(channelWidth);
- dest.writeInt(centerFreq0);
- dest.writeInt(centerFreq1);
- dest.writeInt(mWifiStandard);
- dest.writeLong(seen);
- dest.writeInt(untrusted ? 1 : 0);
- dest.writeInt(numUsage);
- dest.writeString((venueName != null) ? venueName.toString() : "");
- dest.writeString((operatorFriendlyName != null) ? operatorFriendlyName.toString() : "");
- dest.writeLong(this.flags);
-
- if (informationElements != null) {
- dest.writeInt(informationElements.length);
- for (int i = 0; i < informationElements.length; i++) {
- dest.writeInt(informationElements[i].id);
- dest.writeInt(informationElements[i].idExt);
- dest.writeInt(informationElements[i].bytes.length);
- dest.writeByteArray(informationElements[i].bytes);
- }
- } else {
- dest.writeInt(0);
- }
-
- if (anqpLines != null) {
- dest.writeInt(anqpLines.size());
- for (int i = 0; i < anqpLines.size(); i++) {
- dest.writeString(anqpLines.get(i));
- }
- }
- else {
- dest.writeInt(0);
- }
- if (anqpElements != null) {
- dest.writeInt(anqpElements.length);
- for (AnqpInformationElement element : anqpElements) {
- dest.writeInt(element.getVendorId());
- dest.writeInt(element.getElementId());
- dest.writeInt(element.getPayload().length);
- dest.writeByteArray(element.getPayload());
- }
- } else {
- dest.writeInt(0);
- }
-
- if (radioChainInfos != null) {
- dest.writeInt(radioChainInfos.length);
- for (int i = 0; i < radioChainInfos.length; i++) {
- dest.writeInt(radioChainInfos[i].id);
- dest.writeInt(radioChainInfos[i].level);
- }
- } else {
- dest.writeInt(0);
- }
- dest.writeString((ifaceName != null) ? ifaceName.toString() : "");
- }
-
- /** Implement the Parcelable interface */
- public static final @NonNull Creator<ScanResult> CREATOR =
- new Creator<ScanResult>() {
- public ScanResult createFromParcel(Parcel in) {
- WifiSsid wifiSsid = null;
- if (in.readInt() == 1) {
- wifiSsid = WifiSsid.CREATOR.createFromParcel(in);
- }
- ScanResult sr = new ScanResult(
- wifiSsid,
- in.readString(), /* SSID */
- in.readString(), /* BSSID */
- in.readLong(), /* HESSID */
- in.readInt(), /* ANQP Domain ID */
- in.readString(), /* capabilities */
- in.readInt(), /* level */
- in.readInt(), /* frequency */
- in.readLong(), /* timestamp */
- in.readInt(), /* distanceCm */
- in.readInt(), /* distanceSdCm */
- in.readInt(), /* channelWidth */
- in.readInt(), /* centerFreq0 */
- in.readInt(), /* centerFreq1 */
- false /* rtt responder,
- fixed with flags below */
- );
-
- sr.mWifiStandard = in.readInt();
- sr.seen = in.readLong();
- sr.untrusted = in.readInt() != 0;
- sr.numUsage = in.readInt();
- sr.venueName = in.readString();
- sr.operatorFriendlyName = in.readString();
- sr.flags = in.readLong();
- int n = in.readInt();
- if (n != 0) {
- sr.informationElements = new InformationElement[n];
- for (int i = 0; i < n; i++) {
- sr.informationElements[i] = new InformationElement();
- sr.informationElements[i].id = in.readInt();
- sr.informationElements[i].idExt = in.readInt();
- int len = in.readInt();
- sr.informationElements[i].bytes = new byte[len];
- in.readByteArray(sr.informationElements[i].bytes);
- }
- }
-
- n = in.readInt();
- if (n != 0) {
- sr.anqpLines = new ArrayList<String>();
- for (int i = 0; i < n; i++) {
- sr.anqpLines.add(in.readString());
- }
- }
- n = in.readInt();
- if (n != 0) {
- sr.anqpElements = new AnqpInformationElement[n];
- for (int i = 0; i < n; i++) {
- int vendorId = in.readInt();
- int elementId = in.readInt();
- int len = in.readInt();
- byte[] payload = new byte[len];
- in.readByteArray(payload);
- sr.anqpElements[i] =
- new AnqpInformationElement(vendorId, elementId, payload);
- }
- }
- n = in.readInt();
- if (n != 0) {
- sr.radioChainInfos = new RadioChainInfo[n];
- for (int i = 0; i < n; i++) {
- sr.radioChainInfos[i] = new RadioChainInfo();
- sr.radioChainInfos[i].id = in.readInt();
- sr.radioChainInfos[i].level = in.readInt();
- }
- }
- sr.ifaceName = in.readString();
- return sr;
- }
-
- public ScanResult[] newArray(int size) {
- return new ScanResult[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/SecurityParams.java b/wifi/java/android/net/wifi/SecurityParams.java
deleted file mode 100644
index 0ab6f57..0000000
--- a/wifi/java/android/net/wifi/SecurityParams.java
+++ /dev/null
@@ -1,824 +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 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
deleted file mode 100644
index 6f72f0b..0000000
--- a/wifi/java/android/net/wifi/SoftApCapability.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * 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.net.wifi;
-
-import android.annotation.LongDef;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SystemApi;
-import android.net.wifi.SoftApConfiguration.BandType;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import com.android.modules.utils.build.SdkLevel;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.util.Arrays;
-import java.util.Objects;
-
-/**
- * A class representing capability of the SoftAp.
- * {@see WifiManager}
- *
- * @hide
- */
-@SystemApi
-public final class SoftApCapability implements Parcelable {
-
- private static final String TAG = "SoftApCapability";
- private static final int[] EMPTY_INT_ARRAY = new int[0];
- /**
- * Support for automatic channel selection in driver (ACS).
- * Driver will auto select best channel based on interference to optimize performance.
- *
- * flag when {@link R.bool.config_wifi_softap_acs_supported} is true.
- *
- * <p>
- * Use {@link WifiManager.SoftApCallback#onInfoChanged(SoftApInfo)} and
- * {@link SoftApInfo#getFrequency} and {@link SoftApInfo#getBandwidth} to get
- * driver channel selection result.
- */
- public static final long SOFTAP_FEATURE_ACS_OFFLOAD = 1 << 0;
-
- /**
- * Support for client force disconnect.
- * flag when {@link R.bool.config_wifiSofapClientForceDisconnectSupported} is true
- *
- * <p>
- * Several Soft AP client control features, e.g. specifying the maximum number of
- * Soft AP clients, only work when this feature support is present.
- * Check feature support before invoking
- * {@link SoftApConfiguration.Builder#setMaxNumberOfClients(int)}
- */
- public static final long SOFTAP_FEATURE_CLIENT_FORCE_DISCONNECT = 1 << 1;
-
- /**
- * Support for WPA3 Simultaneous Authentication of Equals (WPA3-SAE).
- *
- * flag when {@link config_wifi_softap_sae_supported} is true.
- */
- public static final long SOFTAP_FEATURE_WPA3_SAE = 1 << 2;
-
- /**
- * Support for MAC address customization.
- * flag when {@link R.bool.config_wifiSoftapMacAddressCustomizationSupported} is true
- *
- * <p>
- * Check feature support before invoking
- * {@link SoftApConfiguration.Builder#setBssid(MadAddress)} or
- * {@link SoftApConfiguration.Builder#setMacRandomizationSetting(int)} with
- * {@link SoftApConfiguration.RANDOMIZATION_PERSISTENT}
- */
- public static final long SOFTAP_FEATURE_MAC_ADDRESS_CUSTOMIZATION = 1 << 3;
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @LongDef(flag = true, prefix = { "SOFTAP_FEATURE_" }, value = {
- SOFTAP_FEATURE_ACS_OFFLOAD,
- SOFTAP_FEATURE_CLIENT_FORCE_DISCONNECT,
- SOFTAP_FEATURE_WPA3_SAE,
- SOFTAP_FEATURE_MAC_ADDRESS_CUSTOMIZATION,
- })
- public @interface HotspotFeatures {}
-
- private @HotspotFeatures long mSupportedFeatures = 0;
-
- private int mMaximumSupportedClientNumber;
-
- /**
- * A list storing supported 2.4G channels.
- */
- private int[] mSupportedChannelListIn24g = EMPTY_INT_ARRAY;
-
- /**
- * A list storing supported 5G channels.
- */
- private int[] mSupportedChannelListIn5g = EMPTY_INT_ARRAY;
-
- /**
- * A list storing supported 6G channels.
- */
- 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() {
- return mMaximumSupportedClientNumber;
- }
-
- /**
- * Set the maximum supported client numbers which AP resides on.
- *
- * @param maxClient maximum supported client numbers for the softap.
- * @hide
- */
- public void setMaxSupportedClients(int maxClient) {
- mMaximumSupportedClientNumber = maxClient;
- }
-
- /**
- * Returns true when all of the queried features are supported, otherwise false.
- *
- * @param features One or combination of the following features:
- * {@link #SOFTAP_FEATURE_ACS_OFFLOAD}, {@link #SOFTAP_FEATURE_CLIENT_FORCE_DISCONNECT} or
- * {@link #SOFTAP_FEATURE_WPA3_SAE}.
- */
- public boolean areFeaturesSupported(@HotspotFeatures long features) {
- return (mSupportedFeatures & features) == features;
- }
-
- /**
- * Set supported channel list in target band type.
- *
- * @param band One of the following band types:
- * {@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.
- *
- * @throws IllegalArgumentException when band type is invalid.
- * @hide
- */
- public boolean setSupportedChannelList(@BandType int band,
- @Nullable int[] supportedChannelList) {
- if (supportedChannelList == null) return false;
- switch (band) {
- case SoftApConfiguration.BAND_2GHZ:
- mSupportedChannelListIn24g = supportedChannelList;
- break;
- case SoftApConfiguration.BAND_5GHZ:
- mSupportedChannelListIn5g = supportedChannelList;
- break;
- case SoftApConfiguration.BAND_6GHZ:
- mSupportedChannelListIn6g = supportedChannelList;
- break;
- case SoftApConfiguration.BAND_60GHZ:
- mSupportedChannelListIn60g = supportedChannelList;
- break;
- default:
- throw new IllegalArgumentException("Invalid band: " + band);
- }
- return true;
- }
-
- /**
- * Returns a list of the supported channels in the given band.
- * The result depends on the on the country code that has been set.
- * Can be used to set the channel of the AP with the
- * {@link SoftapConfiguration.Builder#setChannel(int, int)} API.
- *
- * @param band One of the following band types:
- * {@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.
- */
- @NonNull
- public int[] getSupportedChannelList(@BandType int band) {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- switch (band) {
- case SoftApConfiguration.BAND_2GHZ:
- return mSupportedChannelListIn24g;
- case SoftApConfiguration.BAND_5GHZ:
- return mSupportedChannelListIn5g;
- case SoftApConfiguration.BAND_6GHZ:
- return mSupportedChannelListIn6g;
- case SoftApConfiguration.BAND_60GHZ:
- return mSupportedChannelListIn60g;
- default:
- throw new IllegalArgumentException("Invalid band: " + band);
- }
- }
-
- /**
- * @hide
- */
- public SoftApCapability(@Nullable SoftApCapability source) {
- if (source != null) {
- mSupportedFeatures = source.mSupportedFeatures;
- mMaximumSupportedClientNumber = source.mMaximumSupportedClientNumber;
- mSupportedChannelListIn24g = source.mSupportedChannelListIn24g;
- mSupportedChannelListIn5g = source.mSupportedChannelListIn5g;
- mSupportedChannelListIn6g = source.mSupportedChannelListIn6g;
- mSupportedChannelListIn60g = source.mSupportedChannelListIn60g;
- }
- }
-
- /**
- * Constructor with combination of the feature.
- * Zero to no supported feature.
- *
- * @param features One or combination of the following features:
- * {@link #SOFTAP_FEATURE_ACS_OFFLOAD}, {@link #SOFTAP_FEATURE_CLIENT_FORCE_DISCONNECT} or
- * {@link #SOFTAP_FEATURE_WPA3_SAE}.
- * @hide
- */
- public SoftApCapability(@HotspotFeatures long features) {
- mSupportedFeatures = features;
- }
-
- @Override
- /** Implement the Parcelable interface. */
- public int describeContents() {
- return 0;
- }
-
- @Override
- /** Implement the Parcelable interface */
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- dest.writeLong(mSupportedFeatures);
- dest.writeInt(mMaximumSupportedClientNumber);
- dest.writeIntArray(mSupportedChannelListIn24g);
- dest.writeIntArray(mSupportedChannelListIn5g);
- dest.writeIntArray(mSupportedChannelListIn6g);
- dest.writeIntArray(mSupportedChannelListIn60g);
- }
-
- @NonNull
- /** Implement the Parcelable interface */
- public static final Creator<SoftApCapability> CREATOR = new Creator<SoftApCapability>() {
- public SoftApCapability createFromParcel(Parcel in) {
- SoftApCapability capability = new SoftApCapability(in.readLong());
- capability.mMaximumSupportedClientNumber = in.readInt();
- 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;
- }
-
- public SoftApCapability[] newArray(int size) {
- return new SoftApCapability[size];
- }
- };
-
- @NonNull
- @Override
- public String toString() {
- StringBuilder sbuf = new StringBuilder();
- sbuf.append("SupportedFeatures=").append(mSupportedFeatures);
- sbuf.append("MaximumSupportedClientNumber=").append(mMaximumSupportedClientNumber);
- sbuf.append("SupportedChannelListIn24g")
- .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();
- }
-
- @Override
- public boolean equals(@NonNull Object o) {
- if (this == o) return true;
- if (!(o instanceof SoftApCapability)) return false;
- SoftApCapability capability = (SoftApCapability) o;
- return mSupportedFeatures == capability.mSupportedFeatures
- && mMaximumSupportedClientNumber == capability.mMaximumSupportedClientNumber
- && Arrays.equals(mSupportedChannelListIn24g, capability.mSupportedChannelListIn24g)
- && Arrays.equals(mSupportedChannelListIn5g, capability.mSupportedChannelListIn5g)
- && Arrays.equals(mSupportedChannelListIn6g, capability.mSupportedChannelListIn6g)
- && Arrays.equals(mSupportedChannelListIn60g, capability.mSupportedChannelListIn60g);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mSupportedFeatures, mMaximumSupportedClientNumber,
- Arrays.hashCode(mSupportedChannelListIn24g),
- Arrays.hashCode(mSupportedChannelListIn5g),
- Arrays.hashCode(mSupportedChannelListIn6g),
- Arrays.hashCode(mSupportedChannelListIn60g));
- }
-}
diff --git a/wifi/java/android/net/wifi/SoftApConfiguration.java b/wifi/java/android/net/wifi/SoftApConfiguration.java
deleted file mode 100644
index d36acb7..0000000
--- a/wifi/java/android/net/wifi/SoftApConfiguration.java
+++ /dev/null
@@ -1,1279 +0,0 @@
-/*
- * 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.net.wifi;
-
-import android.annotation.IntDef;
-import android.annotation.IntRange;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SystemApi;
-import android.net.MacAddress;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.text.TextUtils;
-import android.util.Log;
-import android.util.SparseIntArray;
-
-import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.util.Preconditions;
-import com.android.modules.utils.build.SdkLevel;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * Configuration for a soft access point (a.k.a. Soft AP, SAP, Hotspot).
- *
- * This is input for the framework provided by a client app, i.e. it exposes knobs to instruct the
- * framework how it should configure a hotspot.
- *
- * System apps can use this to configure a tethered hotspot using
- * {@code WifiManager#startTetheredHotspot(SoftApConfiguration)} and
- * {@code WifiManager#setSoftApConfiguration(SoftApConfiguration)}
- * or local-only hotspot using
- * {@code WifiManager#startLocalOnlyHotspot(SoftApConfiguration, Executor,
- * WifiManager.LocalOnlyHotspotCallback)}.
- *
- * Instances of this class are immutable; use {@link SoftApConfiguration.Builder} and its methods to
- * create a new instance.
- *
- */
-public final class SoftApConfiguration implements Parcelable {
-
- private static final String TAG = "SoftApConfiguration";
-
- @VisibleForTesting
- static final int PSK_MIN_LEN = 8;
-
- @VisibleForTesting
- static final int PSK_MAX_LEN = 63;
-
- /**
- * 2GHz band.
- * @hide
- */
- @SystemApi
- public static final int BAND_2GHZ = 1 << 0;
-
- /**
- * 5GHz band.
- * @hide
- */
- @SystemApi
- public static final int BAND_5GHZ = 1 << 1;
-
- /**
- * 6GHz band.
- * @hide
- */
- @SystemApi
- 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
- *
- * @deprecated The bands are a bit mask - use any combination of {@code BAND_},
- * for instance {@code BAND_2GHZ | BAND_5GHZ | BAND_6GHZ}.
- */
- @SystemApi
- public static final int BAND_ANY = BAND_2GHZ | BAND_5GHZ | BAND_6GHZ;
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(flag = true, prefix = { "BAND_TYPE_" }, value = {
- BAND_2GHZ,
- BAND_5GHZ,
- BAND_6GHZ,
- BAND_60GHZ,
- })
- public @interface BandType {}
-
- private static boolean isBandValid(@BandType int band) {
- 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;
- private static final int MAX_CH_2G_BAND = 14;
- private static final int MIN_CH_5G_BAND = 34;
- 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;
-
-
-
- private static boolean isChannelBandPairValid(int channel, @BandType int band) {
- switch (band) {
- case BAND_2GHZ:
- if (channel < MIN_CH_2G_BAND || channel > MAX_CH_2G_BAND) {
- return false;
- }
- break;
-
- case BAND_5GHZ:
- if (channel < MIN_CH_5G_BAND || channel > MAX_CH_5G_BAND) {
- return false;
- }
- break;
-
- case BAND_6GHZ:
- if (channel < MIN_CH_6G_BAND || channel > MAX_CH_6G_BAND) {
- return false;
- }
- break;
-
- case BAND_60GHZ:
- if (channel < MIN_CH_60G_BAND || channel > MAX_CH_60G_BAND) {
- return false;
- }
- break;
-
- default:
- return false;
- }
- return true;
- }
-
- /**
- * SSID for the AP, or null for a framework-determined SSID.
- */
- private final @Nullable String mSsid;
-
- /**
- * BSSID for the AP, or null to use a framework-determined BSSID.
- */
- private final @Nullable MacAddress mBssid;
-
- /**
- * Pre-shared key for WPA2-PSK or WPA3-SAE-Transition or WPA3-SAE encryption which depends on
- * the security type.
- */
- private final @Nullable String mPassphrase;
-
- /**
- * This is a network that does not broadcast its SSID, so an
- * SSID-specific probe request must be used for scans.
- */
- private final boolean mHiddenSsid;
-
- /**
- * The operating channels of the dual APs.
- *
- * The SparseIntArray that consists the band and the channel of matching the band.
- */
- @NonNull
- private final SparseIntArray mChannels;
-
- /**
- * The maximim allowed number of clients that can associate to the AP.
- */
- private final int mMaxNumberOfClients;
-
- /**
- * The operating security type of the AP.
- * One of the following security types:
- * {@link #SECURITY_TYPE_OPEN},
- * {@link #SECURITY_TYPE_WPA2_PSK},
- * {@link #SECURITY_TYPE_WPA3_SAE_TRANSITION},
- * {@link #SECURITY_TYPE_WPA3_SAE}
- */
- private final @SecurityType int mSecurityType;
-
- /**
- * The flag to indicate client need to authorize by user
- * when client is connecting to AP.
- */
- private final boolean mClientControlByUser;
-
- /**
- * The list of blocked client that can't associate to the AP.
- */
- private final List<MacAddress> mBlockedClientList;
-
- /**
- * The list of allowed client that can associate to the AP.
- */
- private final List<MacAddress> mAllowedClientList;
-
- /**
- * Whether auto shutdown of soft AP is enabled or not.
- */
- private final boolean mAutoShutdownEnabled;
-
- /**
- * Delay in milliseconds before shutting down soft AP when
- * there are no connected devices.
- */
- private final long mShutdownTimeoutMillis;
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = {"RANDOMIZATION_"}, value = {
- RANDOMIZATION_NONE,
- RANDOMIZATION_PERSISTENT})
- public @interface MacRandomizationSetting {}
-
- /**
- * Use factory MAC as BSSID for the AP
- * @hide
- */
- @SystemApi
- public static final int RANDOMIZATION_NONE = 0;
- /**
- * Generate a randomized MAC as BSSID for the AP
- * @hide
- */
- @SystemApi
- public static final int RANDOMIZATION_PERSISTENT = 1;
-
- /**
- * Level of MAC randomization for the AP BSSID.
- * @hide
- */
- @MacRandomizationSetting
- private int mMacRandomizationSetting;
-
-
- /**
- * THe definition of security type OPEN.
- */
- public static final int SECURITY_TYPE_OPEN = 0;
-
- /**
- * The definition of security type WPA2-PSK.
- */
- public static final int SECURITY_TYPE_WPA2_PSK = 1;
-
- /**
- * The definition of security type WPA3-SAE Transition mode.
- */
- public static final int SECURITY_TYPE_WPA3_SAE_TRANSITION = 2;
-
- /**
- * The definition of security type WPA3-SAE.
- */
- public static final int SECURITY_TYPE_WPA3_SAE = 3;
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = { "SECURITY_TYPE_" }, value = {
- SECURITY_TYPE_OPEN,
- SECURITY_TYPE_WPA2_PSK,
- SECURITY_TYPE_WPA3_SAE_TRANSITION,
- SECURITY_TYPE_WPA3_SAE,
- })
- public @interface SecurityType {}
-
- /** Private constructor for Builder and Parcelable implementation. */
- private SoftApConfiguration(@Nullable String ssid, @Nullable MacAddress bssid,
- @Nullable String passphrase, boolean hiddenSsid, @NonNull SparseIntArray channels,
- @SecurityType int securityType, int maxNumberOfClients, boolean shutdownTimeoutEnabled,
- long shutdownTimeoutMillis, boolean clientControlByUser,
- @NonNull List<MacAddress> blockedList, @NonNull List<MacAddress> allowedList,
- int macRandomizationSetting) {
- mSsid = ssid;
- mBssid = bssid;
- mPassphrase = passphrase;
- mHiddenSsid = hiddenSsid;
- if (channels.size() != 0) {
- mChannels = channels.clone();
- } else {
- mChannels = new SparseIntArray(1);
- mChannels.put(BAND_2GHZ, 0);
- }
- mSecurityType = securityType;
- mMaxNumberOfClients = maxNumberOfClients;
- mAutoShutdownEnabled = shutdownTimeoutEnabled;
- mShutdownTimeoutMillis = shutdownTimeoutMillis;
- mClientControlByUser = clientControlByUser;
- mBlockedClientList = new ArrayList<>(blockedList);
- mAllowedClientList = new ArrayList<>(allowedList);
- mMacRandomizationSetting = macRandomizationSetting;
- }
-
- @Override
- public boolean equals(Object otherObj) {
- if (this == otherObj) {
- return true;
- }
- if (!(otherObj instanceof SoftApConfiguration)) {
- return false;
- }
- SoftApConfiguration other = (SoftApConfiguration) otherObj;
- return Objects.equals(mSsid, other.mSsid)
- && Objects.equals(mBssid, other.mBssid)
- && Objects.equals(mPassphrase, other.mPassphrase)
- && mHiddenSsid == other.mHiddenSsid
- && mChannels.toString().equals(other.mChannels.toString())
- && mSecurityType == other.mSecurityType
- && mMaxNumberOfClients == other.mMaxNumberOfClients
- && mAutoShutdownEnabled == other.mAutoShutdownEnabled
- && mShutdownTimeoutMillis == other.mShutdownTimeoutMillis
- && mClientControlByUser == other.mClientControlByUser
- && Objects.equals(mBlockedClientList, other.mBlockedClientList)
- && Objects.equals(mAllowedClientList, other.mAllowedClientList)
- && mMacRandomizationSetting == other.mMacRandomizationSetting;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mSsid, mBssid, mPassphrase, mHiddenSsid,
- mChannels.toString(), mSecurityType, mMaxNumberOfClients, mAutoShutdownEnabled,
- mShutdownTimeoutMillis, mClientControlByUser, mBlockedClientList,
- mAllowedClientList, mMacRandomizationSetting);
- }
-
- @Override
- public String toString() {
- StringBuilder sbuf = new StringBuilder();
- sbuf.append("ssid = ").append(mSsid);
- if (mBssid != null) sbuf.append(" \n bssid = ").append(mBssid.toString());
- sbuf.append(" \n Passphrase = ").append(
- TextUtils.isEmpty(mPassphrase) ? "<empty>" : "<non-empty>");
- sbuf.append(" \n HiddenSsid = ").append(mHiddenSsid);
- sbuf.append(" \n Channels = ").append(mChannels);
- sbuf.append(" \n SecurityType = ").append(getSecurityType());
- sbuf.append(" \n MaxClient = ").append(mMaxNumberOfClients);
- sbuf.append(" \n AutoShutdownEnabled = ").append(mAutoShutdownEnabled);
- sbuf.append(" \n ShutdownTimeoutMillis = ").append(mShutdownTimeoutMillis);
- sbuf.append(" \n ClientControlByUser = ").append(mClientControlByUser);
- sbuf.append(" \n BlockedClientList = ").append(mBlockedClientList);
- sbuf.append(" \n AllowedClientList= ").append(mAllowedClientList);
- sbuf.append(" \n MacRandomizationSetting = ").append(mMacRandomizationSetting);
- return sbuf.toString();
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- dest.writeString(mSsid);
- dest.writeParcelable(mBssid, flags);
- dest.writeString(mPassphrase);
- dest.writeBoolean(mHiddenSsid);
- writeSparseIntArray(dest, mChannels);
- dest.writeInt(mSecurityType);
- dest.writeInt(mMaxNumberOfClients);
- dest.writeBoolean(mAutoShutdownEnabled);
- dest.writeLong(mShutdownTimeoutMillis);
- dest.writeBoolean(mClientControlByUser);
- dest.writeTypedList(mBlockedClientList);
- dest.writeTypedList(mAllowedClientList);
- dest.writeInt(mMacRandomizationSetting);
- }
-
- /* Reference from frameworks/base/core/java/android/os/Parcel.java */
- private static void writeSparseIntArray(@NonNull Parcel dest,
- @Nullable SparseIntArray val) {
- if (val == null) {
- dest.writeInt(-1);
- return;
- }
- int n = val.size();
- dest.writeInt(n);
- int i = 0;
- while (i < n) {
- dest.writeInt(val.keyAt(i));
- dest.writeInt(val.valueAt(i));
- i++;
- }
- }
-
-
- /* Reference from frameworks/base/core/java/android/os/Parcel.java */
- @NonNull
- private static SparseIntArray readSparseIntArray(@NonNull Parcel in) {
- int n = in.readInt();
- if (n < 0) {
- return new SparseIntArray();
- }
- SparseIntArray sa = new SparseIntArray(n);
- while (n > 0) {
- int key = in.readInt();
- int value = in.readInt();
- sa.append(key, value);
- n--;
- }
- return sa;
- }
-
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @NonNull
- public static final Creator<SoftApConfiguration> CREATOR = new Creator<SoftApConfiguration>() {
- @Override
- public SoftApConfiguration createFromParcel(Parcel in) {
- return new SoftApConfiguration(
- in.readString(),
- in.readParcelable(MacAddress.class.getClassLoader()),
- in.readString(), in.readBoolean(), readSparseIntArray(in), in.readInt(),
- in.readInt(), in.readBoolean(), in.readLong(), in.readBoolean(),
- in.createTypedArrayList(MacAddress.CREATOR),
- in.createTypedArrayList(MacAddress.CREATOR), in.readInt());
- }
-
- @Override
- public SoftApConfiguration[] newArray(int size) {
- return new SoftApConfiguration[size];
- }
- };
-
- /**
- * Return String set to be the SSID for the AP.
- * See also {@link Builder#setSsid(String)}.
- */
- @Nullable
- public String getSsid() {
- return mSsid;
- }
-
- /**
- * Returns MAC address set to be BSSID for the AP.
- * See also {@link Builder#setBssid(MacAddress)}.
- */
- @Nullable
- public MacAddress getBssid() {
- return mBssid;
- }
-
- /**
- * Returns String set to be passphrase for current AP.
- * See also {@link Builder#setPassphrase(String, int)}.
- */
- @Nullable
- public String getPassphrase() {
- return mPassphrase;
- }
-
- /**
- * Returns Boolean set to be indicate hidden (true: doesn't broadcast its SSID) or
- * not (false: broadcasts its SSID) for the AP.
- * See also {@link Builder#setHiddenSsid(boolean)}.
- */
- public boolean isHiddenSsid() {
- return mHiddenSsid;
- }
-
- /**
- * Returns band type set to be the band for the AP.
- *
- * One or combination of {@code BAND_}, for instance
- * {@link #BAND_2GHZ}, {@link #BAND_5GHZ}, or {@code BAND_2GHZ | BAND_5GHZ}.
- *
- * Note: Returns the lowest band when more than one band is set.
- * Use {@link #getBands()} to get dual bands setting.
- *
- * See also {@link Builder#setBand(int)}.
- *
- * @hide
- */
- @SystemApi
- public @BandType int getBand() {
- return mChannels.keyAt(0);
- }
-
- /**
- * Returns a sorted array in ascending order that consists of the configured band types
- * for the APs.
- *
- * The band type is one or combination of {@code BAND_}, for instance
- * {@link #BAND_2GHZ}, {@link #BAND_5GHZ}, or {@code BAND_2GHZ | BAND_5GHZ}.
- *
- * Note: return array may only include one band when current setting is single AP mode.
- * See also {@link Builder#setBands(int[])}.
- *
- * @hide
- */
- @SystemApi
- public @NonNull int[] getBands() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- int[] bands = new int[mChannels.size()];
- for (int i = 0; i < bands.length; i++) {
- bands[i] = mChannels.keyAt(i);
- }
- return bands;
- }
-
- /**
- * Returns Integer set to be the channel for the AP.
- *
- * Note: Returns the channel which associated to the lowest band if more than one channel
- * is set. Use {@link Builder#getChannels()} to get dual channel setting.
- * See also {@link Builder#setChannel(int, int)}.
- *
- * @hide
- */
- @SystemApi
- public int getChannel() {
- return mChannels.valueAt(0);
- }
-
-
- /**
- * Returns SparseIntArray (key: {@code BandType} , value: channel) that consists of
- * the configured bands and channels for the AP(s).
- *
- * Note: return array may only include one channel when current setting is single AP mode.
- * See also {@link Builder#setChannels(SparseIntArray)}.
- *
- * @hide
- */
- @SystemApi
- public @NonNull SparseIntArray getChannels() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- return mChannels.clone();
- }
-
- /**
- * Get security type params which depends on which security passphrase to set.
- *
- * @return One of:
- * {@link #SECURITY_TYPE_OPEN},
- * {@link #SECURITY_TYPE_WPA2_PSK},
- * {@link #SECURITY_TYPE_WPA3_SAE_TRANSITION},
- * {@link #SECURITY_TYPE_WPA3_SAE}
- */
- public @SecurityType int getSecurityType() {
- return mSecurityType;
- }
-
- /**
- * Returns the maximum number of clients that can associate to the AP.
- * See also {@link Builder#setMaxNumberOfClients(int)}.
- *
- * @hide
- */
- @SystemApi
- public int getMaxNumberOfClients() {
- return mMaxNumberOfClients;
- }
-
- /**
- * Returns whether auto shutdown is enabled or not.
- * The Soft AP will shutdown when there are no devices associated to it for
- * the timeout duration. See also {@link Builder#setAutoShutdownEnabled(boolean)}.
- *
- * @hide
- */
- @SystemApi
- public boolean isAutoShutdownEnabled() {
- return mAutoShutdownEnabled;
- }
-
- /**
- * Returns the shutdown timeout in milliseconds.
- * The Soft AP will shutdown when there are no devices associated to it for
- * the timeout duration. See also {@link Builder#setShutdownTimeoutMillis(long)}.
- *
- * @hide
- */
- @SystemApi
- public long getShutdownTimeoutMillis() {
- return mShutdownTimeoutMillis;
- }
-
- /**
- * Returns a flag indicating whether clients need to be pre-approved by the user.
- * (true: authorization required) or not (false: not required).
- * See also {@link Builder#setClientControlByUserEnabled(Boolean)}.
- *
- * @hide
- */
- @SystemApi
- public boolean isClientControlByUserEnabled() {
- return mClientControlByUser;
- }
-
- /**
- * Returns List of clients which aren't allowed to associate to the AP.
- *
- * Clients are configured using {@link Builder#setBlockedClientList(List)}
- *
- * @hide
- */
- @NonNull
- @SystemApi
- public List<MacAddress> getBlockedClientList() {
- return mBlockedClientList;
- }
-
- /**
- * List of clients which are allowed to associate to the AP.
- * Clients are configured using {@link Builder#setAllowedClientList(List)}
- *
- * @hide
- */
- @NonNull
- @SystemApi
- public List<MacAddress> getAllowedClientList() {
- return mAllowedClientList;
- }
-
- /**
- * Returns the level of MAC randomization for the AP BSSID.
- * See also {@link Builder#setMacRandomizationSetting(int)}.
- *
- * @hide
- */
- @SystemApi
- @MacRandomizationSetting
- public int getMacRandomizationSetting() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- return mMacRandomizationSetting;
- }
-
- /**
- * Returns a {@link WifiConfiguration} representation of this {@link SoftApConfiguration}.
- * Note that SoftApConfiguration may contain configuration which is cannot be represented
- * by the legacy WifiConfiguration, in such cases a null will be returned.
- *
- * <li> SoftAp band in {@link WifiConfiguration.apBand} only supports
- * 2GHz, 5GHz, 2GHz+5GHz bands, so conversion is limited to these bands. </li>
- *
- * <li> SoftAp security type in {@link WifiConfiguration.KeyMgmt} only supports
- * NONE, WPA2_PSK, so conversion is limited to these security type.</li>
- * @hide
- */
- @Nullable
- @SystemApi
- public WifiConfiguration toWifiConfiguration() {
- WifiConfiguration wifiConfig = new WifiConfiguration();
- wifiConfig.SSID = mSsid;
- wifiConfig.preSharedKey = mPassphrase;
- wifiConfig.hiddenSSID = mHiddenSsid;
- wifiConfig.apChannel = getChannel();
- switch (mSecurityType) {
- case SECURITY_TYPE_OPEN:
- wifiConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
- break;
- case SECURITY_TYPE_WPA2_PSK:
- case SECURITY_TYPE_WPA3_SAE_TRANSITION:
- wifiConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA2_PSK);
- break;
- default:
- Log.e(TAG, "Convert fail, unsupported security type :" + mSecurityType);
- return null;
- }
-
- switch (getBand()) {
- case BAND_2GHZ:
- wifiConfig.apBand = WifiConfiguration.AP_BAND_2GHZ;
- break;
- case BAND_5GHZ:
- wifiConfig.apBand = WifiConfiguration.AP_BAND_5GHZ;
- break;
- case BAND_2GHZ | BAND_5GHZ:
- wifiConfig.apBand = WifiConfiguration.AP_BAND_ANY;
- break;
- case BAND_ANY:
- wifiConfig.apBand = WifiConfiguration.AP_BAND_ANY;
- break;
- default:
- Log.e(TAG, "Convert fail, unsupported band setting :" + getBand());
- return null;
- }
- return wifiConfig;
- }
-
- /**
- * Builds a {@link SoftApConfiguration}, which allows an app to configure various aspects of a
- * Soft AP.
- *
- * All fields are optional. By default, SSID and BSSID are automatically chosen by the
- * framework, and an open network is created.
- *
- * @hide
- */
- @SystemApi
- public static final class Builder {
- private String mSsid;
- private MacAddress mBssid;
- private String mPassphrase;
- private boolean mHiddenSsid;
- private SparseIntArray mChannels;
- private int mMaxNumberOfClients;
- private int mSecurityType;
- private boolean mAutoShutdownEnabled;
- private long mShutdownTimeoutMillis;
- private boolean mClientControlByUser;
- private List<MacAddress> mBlockedClientList;
- private List<MacAddress> mAllowedClientList;
- private int mMacRandomizationSetting;
-
- /**
- * Constructs a Builder with default values (see {@link Builder}).
- */
- public Builder() {
- mSsid = null;
- mBssid = null;
- mPassphrase = null;
- mHiddenSsid = false;
- mChannels = new SparseIntArray(1);
- mChannels.put(BAND_2GHZ, 0);
- mMaxNumberOfClients = 0;
- mSecurityType = SECURITY_TYPE_OPEN;
- mAutoShutdownEnabled = true; // enabled by default.
- mShutdownTimeoutMillis = 0;
- mClientControlByUser = false;
- mBlockedClientList = new ArrayList<>();
- mAllowedClientList = new ArrayList<>();
- mMacRandomizationSetting = RANDOMIZATION_PERSISTENT;
- }
-
- /**
- * Constructs a Builder initialized from an existing {@link SoftApConfiguration} instance.
- */
- public Builder(@NonNull SoftApConfiguration other) {
- Objects.requireNonNull(other);
-
- mSsid = other.mSsid;
- mBssid = other.mBssid;
- mPassphrase = other.mPassphrase;
- mHiddenSsid = other.mHiddenSsid;
- mChannels = other.mChannels.clone();
- mMaxNumberOfClients = other.mMaxNumberOfClients;
- mSecurityType = other.mSecurityType;
- mAutoShutdownEnabled = other.mAutoShutdownEnabled;
- mShutdownTimeoutMillis = other.mShutdownTimeoutMillis;
- mClientControlByUser = other.mClientControlByUser;
- mBlockedClientList = new ArrayList<>(other.mBlockedClientList);
- mAllowedClientList = new ArrayList<>(other.mAllowedClientList);
- mMacRandomizationSetting = other.mMacRandomizationSetting;
- }
-
- /**
- * Builds the {@link SoftApConfiguration}.
- *
- * @return A new {@link SoftApConfiguration}, as configured by previous method calls.
- */
- @NonNull
- public SoftApConfiguration build() {
- for (MacAddress client : mAllowedClientList) {
- if (mBlockedClientList.contains(client)) {
- throw new IllegalArgumentException("A MacAddress exist in both client list");
- }
- }
- return new SoftApConfiguration(mSsid, mBssid, mPassphrase,
- mHiddenSsid, mChannels, mSecurityType, mMaxNumberOfClients,
- mAutoShutdownEnabled, mShutdownTimeoutMillis, mClientControlByUser,
- mBlockedClientList, mAllowedClientList, mMacRandomizationSetting);
- }
-
- /**
- * Specifies an SSID for the AP.
- * <p>
- * Null SSID only support when configure a local-only hotspot.
- * <p>
- * <li>If not set, defaults to null.</li>
- *
- * @param ssid SSID of valid Unicode characters, or null to have the SSID automatically
- * chosen by the framework.
- * @return Builder for chaining.
- * @throws IllegalArgumentException when the SSID is empty or not valid Unicode.
- */
- @NonNull
- public Builder setSsid(@Nullable String ssid) {
- if (ssid != null) {
- Preconditions.checkStringNotEmpty(ssid);
- Preconditions.checkArgument(StandardCharsets.UTF_8.newEncoder().canEncode(ssid));
- }
- mSsid = ssid;
- return this;
- }
-
- /**
- * Specifies a BSSID for the AP.
- * <p>
- * <li>If not set, defaults to null.</li>
- *
- * If multiple bands are requested via {@link #setBands(int[])} or
- * {@link #setChannels(SparseIntArray)}, HAL will derive 2 MAC addresses since framework
- * only sends down 1 MAC address.
- *
- * An example (but different implementation may perform a different mapping):
- * <li>MAC address 1: copy value of MAC address,
- * and set byte 1 = (0xFF - BSSID[1])</li>
- * <li>MAC address 2: copy value of MAC address,
- * and set byte 2 = (0xFF - BSSID[2])</li>
- *
- * Example BSSID argument: e2:38:60:c4:0e:b7
- * Derived MAC address 1: e2:c7:60:c4:0e:b7
- * Derived MAC address 2: e2:38:9f:c4:0e:b7
- *
- * <p>
- * Use {@link WifiManager.SoftApCallback#onCapabilityChanged(SoftApCapability)} and
- * {@link SoftApCapability#areFeaturesSupported(long)}
- * with {@link SoftApCapability.SOFTAP_FEATURE_MAC_ADDRESS_CUSTOMIZATION} to determine
- * whether or not this feature is supported.
- *
- * @param bssid BSSID, or null to have the BSSID chosen by the framework. The caller is
- * responsible for avoiding collisions.
- * @return Builder for chaining.
- * @throws IllegalArgumentException when the given BSSID is the all-zero
- * , multicast or broadcast MAC address.
- */
- @NonNull
- public Builder setBssid(@Nullable MacAddress bssid) {
- if (bssid != null) {
- Preconditions.checkArgument(!bssid.equals(WifiManager.ALL_ZEROS_MAC_ADDRESS));
- if (bssid.getAddressType() != MacAddress.TYPE_UNICAST) {
- throw new IllegalArgumentException("bssid doesn't support "
- + "multicast or broadcast mac address");
- }
- }
- mBssid = bssid;
- return this;
- }
-
- /**
- * Specifies that this AP should use specific security type with the given ASCII passphrase.
- *
- * @param securityType One of the following security types:
- * {@link #SECURITY_TYPE_OPEN},
- * {@link #SECURITY_TYPE_WPA2_PSK},
- * {@link #SECURITY_TYPE_WPA3_SAE_TRANSITION},
- * {@link #SECURITY_TYPE_WPA3_SAE}.
- * @param passphrase The passphrase to use for sepcific {@code securityType} configuration
- * or null with {@link #SECURITY_TYPE_OPEN}.
- *
- * @return Builder for chaining.
- * @throws IllegalArgumentException when the passphrase length is invalid and
- * {@code securityType} is not {@link #SECURITY_TYPE_OPEN}
- * or non-null passphrase and {@code securityType} is
- * {@link #SECURITY_TYPE_OPEN}.
- */
- @NonNull
- public Builder setPassphrase(@Nullable String passphrase, @SecurityType int securityType) {
- if (securityType == SECURITY_TYPE_OPEN) {
- if (passphrase != null) {
- throw new IllegalArgumentException(
- "passphrase should be null when security type is open");
- }
- } else {
- Preconditions.checkStringNotEmpty(passphrase);
- if (securityType == SECURITY_TYPE_WPA2_PSK
- || securityType == SECURITY_TYPE_WPA3_SAE_TRANSITION) {
- if (passphrase.length() < PSK_MIN_LEN || passphrase.length() > PSK_MAX_LEN) {
- throw new IllegalArgumentException(
- "Password size must be at least " + PSK_MIN_LEN
- + " and no more than " + PSK_MAX_LEN
- + " for WPA2_PSK and WPA3_SAE_TRANSITION Mode");
- }
- }
- }
- mSecurityType = securityType;
- mPassphrase = passphrase;
- return this;
- }
-
- /**
- * Specifies whether the AP is hidden (doesn't broadcast its SSID) or
- * not (broadcasts its SSID).
- * <p>
- * <li>If not set, defaults to false (i.e not a hidden network).</li>
- *
- * @param hiddenSsid true for a hidden SSID, false otherwise.
- * @return Builder for chaining.
- */
- @NonNull
- public Builder setHiddenSsid(boolean hiddenSsid) {
- mHiddenSsid = hiddenSsid;
- return this;
- }
-
- /**
- * Specifies the band for the AP.
- * <p>
- * <li>If not set, defaults to {@link #BAND_2GHZ}.</li>
- *
- * @param band One or combination of the following band type:
- * {@link #BAND_2GHZ}, {@link #BAND_5GHZ}, {@link #BAND_6GHZ}.
- * @return Builder for chaining.
- * @throws IllegalArgumentException when an invalid band type is provided.
- */
- @NonNull
- public Builder setBand(@BandType int band) {
- if (!isBandValid(band)) {
- throw new IllegalArgumentException("Invalid band type: " + band);
- }
- mChannels = new SparseIntArray(1);
- mChannels.put(band, 0);
- return this;
- }
-
- /**
- * Specifies the bands for the APs.
- * If more than 1 band is set, this will bring up concurrent APs.
- * on the requested bands (if possible).
- * <p>
- *
- * Use {@link WifiManager#isBridgedApConcurrencySupported()} to determine
- * whether or not concurrent APs are supported.
- *
- * @param bands Array of the {@link #BandType}.
- * @return Builder for chaining.
- * @throws IllegalArgumentException when more than 2 bands are set or an invalid band type
- * is provided.
- */
- @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");
- }
- SparseIntArray channels = new SparseIntArray(bands.length);
- for (int val : bands) {
- if (!isBandValid(val)) {
- throw new IllegalArgumentException("Invalid band type: " + val);
- }
- channels.put(val, 0);
- }
- mChannels = channels;
- return this;
- }
-
-
- /**
- * Specifies the channel and associated band for the AP.
- *
- * The channel which AP resides on. Valid channels are country dependent.
- * The {@link SoftApCapability#getSupportedChannelList(int)} can be used to obtain
- * valid channels.
- *
- * <p>
- * If not set, the default for the channel is the special value 0 which has the
- * framework auto-select a valid channel from the band configured with
- * {@link #setBand(int)}.
- *
- * The channel auto selection will be offloaded to driver when
- * {@link SoftApCapability#areFeaturesSupported(long)}
- * with {@link SoftApCapability.SOFTAP_FEATURE_ACS_OFFLOAD}
- * return true. The driver will auto select the best channel (e.g. best performance)
- * based on environment interference. Check {@link SoftApCapability} for more detail.
- *
- * The API contains (band, channel) input since the 6GHz band uses the same channel
- * numbering scheme as is used in the 2.4GHz and 5GHz band. Therefore, both are needed to
- * uniquely identify individual channels.
- *
- * <p>
- * @param channel operating channel of the AP.
- * @param band containing this channel.
- * @return Builder for chaining.
- * @throws IllegalArgumentException when the invalid channel or band type is configured.
- */
- @NonNull
- public Builder setChannel(int channel, @BandType int band) {
- if (!isChannelBandPairValid(channel, band)) {
- throw new IllegalArgumentException("Invalid channel(" + channel
- + ") & band (" + band + ") configured");
- }
- mChannels = new SparseIntArray(1);
- mChannels.put(band, channel);
- return this;
- }
-
- /**
- * Specifies the channels and associated bands for the APs.
- *
- * When more than 1 channel is set, this will bring up concurrent APs on the requested
- * channels and bands (if possible).
- *
- * Valid channels are country dependent.
- * The {@link SoftApCapability#getSupportedChannelList(int)} can be used to obtain
- * valid channels in each band.
- *
- * Use {@link WifiManager#isBridgedApConcurrencySupported()} to determine
- * whether or not concurrent APs are supported.
- *
- * <p>
- * If not set, the default for the channel is the special value 0 which has the framework
- * auto-select a valid channel from the band configured with {@link #setBands(int[])}.
- *
- * The channel auto selection will be offloaded to driver when
- * {@link SoftApCapability#areFeaturesSupported(long)}
- * with {@link SoftApCapability.SOFTAP_FEATURE_ACS_OFFLOAD}
- * returns true. The driver will auto select the best channel (e.g. best performance)
- * based on environment interference. Check {@link SoftApCapability} for more detail.
- *
- * The API contains (band, channel) input since the 6GHz band uses the same channel
- * numbering scheme as is used in the 2.4GHz and 5GHz band. Therefore, both are needed to
- * uniquely identify individual channels.
- *
- * <p>
- * @param channels SparseIntArray (key: {@code #BandType} , value: channel) consists of
- * {@code BAND_} and corresponding channel.
- * @return Builder for chaining.
- * @throws IllegalArgumentException when more than 2 channels are set or the invalid
- * channel or band type is configured.
- */
- @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");
- }
- for (int i = 0; i < channels.size(); i++) {
- int channel = channels.valueAt(i);
- int band = channels.keyAt(i);
- if (channel == 0) {
- if (!isBandValid(band)) {
- throw new IllegalArgumentException("Invalid band type: " + band);
- }
- } else {
- if (!isChannelBandPairValid(channel, band)) {
- throw new IllegalArgumentException("Invalid channel(" + channel
- + ") & band (" + band + ") configured");
- }
- }
- }
- mChannels = channels.clone();
- return this;
- }
-
-
- /**
- * Specifies the maximum number of clients that can associate to the AP.
- *
- * The maximum number of clients (STAs) which can associate to the AP.
- * The AP will reject association from any clients above this number.
- * Specify a value of 0 to have the framework automatically use the maximum number
- * which the device can support (based on hardware and carrier constraints).
- * <p>
- * Use {@link WifiManager.SoftApCallback#onCapabilityChanged(SoftApCapability)} and
- * {@link SoftApCapability#getMaxSupportedClients} to get the maximum number of clients
- * which the device supports (based on hardware and carrier constraints).
- *
- * <p>
- * <li>If not set, defaults to 0.</li>
- *
- * This method requires HAL support. If the method is used to set a
- * non-zero {@code maxNumberOfClients} value then
- * {@link WifiManager#startTetheredHotspot} will report error code
- * {@link WifiManager#SAP_START_FAILURE_UNSUPPORTED_CONFIGURATION}.
- *
- * <p>
- * Use {@link WifiManager.SoftApCallback#onCapabilityChanged(SoftApCapability)} and
- * {@link SoftApCapability#areFeaturesSupported(long)}
- * with {@link SoftApCapability.SOFTAP_FEATURE_CLIENT_FORCE_DISCONNECT} to determine whether
- * or not this feature is supported.
- *
- * @param maxNumberOfClients maximum client number of the AP.
- * @return Builder for chaining.
- */
- @NonNull
- public Builder setMaxNumberOfClients(@IntRange(from = 0) int maxNumberOfClients) {
- if (maxNumberOfClients < 0) {
- throw new IllegalArgumentException("maxNumberOfClients should be not negative");
- }
- mMaxNumberOfClients = maxNumberOfClients;
- return this;
- }
-
- /**
- * Specifies whether auto shutdown is enabled or not.
- * The Soft AP will shut down when there are no devices connected to it for
- * the timeout duration.
- *
- * <p>
- * <li>If not set, defaults to true</li>
- *
- * @param enable true to enable, false to disable.
- * @return Builder for chaining.
- *
- * @see #setShutdownTimeoutMillis(long)
- */
- @NonNull
- public Builder setAutoShutdownEnabled(boolean enable) {
- mAutoShutdownEnabled = enable;
- return this;
- }
-
- /**
- * Specifies the shutdown timeout in milliseconds.
- * The Soft AP will shut down when there are no devices connected to it for
- * the timeout duration.
- *
- * Specify a value of 0 to have the framework automatically use default timeout
- * setting which defined in {@link R.integer.config_wifi_framework_soft_ap_timeout_delay}
- *
- * <p>
- * <li>If not set, defaults to 0</li>
- * <li>The shut down timeout will apply when {@link #setAutoShutdownEnabled(boolean)} is
- * set to true</li>
- *
- * @param timeoutMillis milliseconds of the timeout delay.
- * @return Builder for chaining.
- *
- * @see #setAutoShutdownEnabled(boolean)
- */
- @NonNull
- public Builder setShutdownTimeoutMillis(@IntRange(from = 0) long timeoutMillis) {
- if (timeoutMillis < 0) {
- throw new IllegalArgumentException("Invalid timeout value");
- }
- mShutdownTimeoutMillis = timeoutMillis;
- return this;
- }
-
- /**
- * Configure the Soft AP to require manual user control of client association.
- * If disabled (the default) then any client which isn't in the blocked list
- * {@link #getBlockedClientList()} can associate to this Soft AP using the
- * correct credentials until the Soft AP capacity is reached (capacity is hardware, carrier,
- * or user limited - using {@link #setMaxNumberOfClients(int)}).
- *
- * If manual user control is enabled then clients will be accepted, rejected, or require
- * a user approval based on the configuration provided by
- * {@link #setBlockedClientList(List)} and {@link #setAllowedClientList(List)}.
- *
- * <p>
- * This method requires HAL support. HAL support can be determined using
- * {@link WifiManager.SoftApCallback#onCapabilityChanged(SoftApCapability)} and
- * {@link SoftApCapability#areFeaturesSupported(long)}
- * with {@link SoftApCapability.SOFTAP_FEATURE_CLIENT_FORCE_DISCONNECT}
- *
- * <p>
- * If the method is called on a device without HAL support then starting the soft AP
- * using {@link WifiManager#startTetheredHotspot(SoftApConfiguration)} will fail with
- * {@link WifiManager#SAP_START_FAILURE_UNSUPPORTED_CONFIGURATION}.
- *
- * <p>
- * <li>If not set, defaults to false (i.e The authoriztion is not required).</li>
- *
- * @param enabled true for enabling the control by user, false otherwise.
- * @return Builder for chaining.
- */
- @NonNull
- public Builder setClientControlByUserEnabled(boolean enabled) {
- mClientControlByUser = enabled;
- return this;
- }
-
-
- /**
- * This method together with {@link setClientControlByUserEnabled(boolean)} control client
- * connections to the AP. If client control by user is disabled using the above method then
- * this API has no effect and clients are allowed to associate to the AP (within limit of
- * max number of clients).
- *
- * If client control by user is enabled then this API configures the list of clients
- * which are explicitly allowed. These are auto-accepted.
- *
- * All other clients which attempt to associate, whose MAC addresses are on neither list,
- * are:
- * <ul>
- * <li>Rejected</li>
- * <li>A callback {@link WifiManager.SoftApCallback#onBlockedClientConnecting(WifiClient)}
- * is issued (which allows the user to add them to the allowed client list if desired).<li>
- * </ul>
- *
- * @param allowedClientList list of clients which are allowed to associate to the AP
- * without user pre-approval.
- * @return Builder for chaining.
- */
- @NonNull
- public Builder setAllowedClientList(@NonNull List<MacAddress> allowedClientList) {
- mAllowedClientList = new ArrayList<>(allowedClientList);
- return this;
- }
-
- /**
- * This API configures the list of clients which are blocked and cannot associate
- * to the Soft AP.
- *
- * <p>
- * This method requires HAL support. HAL support can be determined using
- * {@link WifiManager.SoftApCallback#onCapabilityChanged(SoftApCapability)} and
- * {@link SoftApCapability#areFeaturesSupported(long)}
- * with {@link SoftApCapability.SOFTAP_FEATURE_CLIENT_FORCE_DISCONNECT}
- *
- * <p>
- * If the method is called on a device without HAL support then starting the soft AP
- * using {@link WifiManager#startTetheredHotspot(SoftApConfiguration)} will fail with
- * {@link WifiManager#SAP_START_FAILURE_UNSUPPORTED_CONFIGURATION}.
- *
- * @param blockedClientList list of clients which are not allowed to associate to the AP.
- * @return Builder for chaining.
- */
- @NonNull
- public Builder setBlockedClientList(@NonNull List<MacAddress> blockedClientList) {
- mBlockedClientList = new ArrayList<>(blockedClientList);
- return this;
- }
-
- /**
- * Specifies the level of MAC randomization for the AP BSSID.
- * The Soft AP BSSID will be randomized only if the BSSID isn't set
- * {@link #setBssid(MacAddress)} and this method is either uncalled
- * or called with {@link #RANDOMIZATION_PERSISTENT}.
- *
- * <p>
- * <li>If not set, defaults to {@link #RANDOMIZATION_PERSISTENT}</li>
- *
- * <p>
- * Requires HAL support when set to {@link #RANDOMIZATION_PERSISTENT}.
- * Use {@link WifiManager.SoftApCallback#onCapabilityChanged(SoftApCapability)} and
- * {@link SoftApCapability#areFeaturesSupported(long)}
- * with {@link SoftApCapability.SOFTAP_FEATURE_MAC_ADDRESS_CUSTOMIZATION} to determine
- * whether or not this feature is supported.
- *
- * @param macRandomizationSetting One of the following setting:
- * {@link #RANDOMIZATION_NONE} or {@link #RANDOMIZATION_PERSISTENT}.
- * @return Builder for chaining.
- *
- * @see #setBssid(MacAddress)
- */
- @NonNull
- public Builder setMacRandomizationSetting(
- @MacRandomizationSetting int macRandomizationSetting) {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- mMacRandomizationSetting = macRandomizationSetting;
- return this;
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/SoftApInfo.java b/wifi/java/android/net/wifi/SoftApInfo.java
deleted file mode 100644
index e42e786..0000000
--- a/wifi/java/android/net/wifi/SoftApInfo.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * 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.net.wifi;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SystemApi;
-import android.net.MacAddress;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import com.android.internal.util.Preconditions;
-import com.android.modules.utils.build.SdkLevel;
-
-import java.util.Objects;
-
-/**
- * A class representing information about SoftAp.
- * {@see WifiManager}
- *
- * @hide
- */
-@SystemApi
-public final class SoftApInfo implements Parcelable {
-
- /**
- * AP Channel bandwidth is invalid.
- *
- * @see #getBandwidth()
- */
- public static final int CHANNEL_WIDTH_INVALID = 0;
-
- /**
- * AP Channel bandwidth is 20 MHZ but no HT.
- *
- * @see #getBandwidth()
- */
- public static final int CHANNEL_WIDTH_20MHZ_NOHT = 1;
-
- /**
- * AP Channel bandwidth is 20 MHZ.
- *
- * @see #getBandwidth()
- */
- public static final int CHANNEL_WIDTH_20MHZ = 2;
-
- /**
- * AP Channel bandwidth is 40 MHZ.
- *
- * @see #getBandwidth()
- */
- public static final int CHANNEL_WIDTH_40MHZ = 3;
-
- /**
- * AP Channel bandwidth is 80 MHZ.
- *
- * @see #getBandwidth()
- */
- public static final int CHANNEL_WIDTH_80MHZ = 4;
-
- /**
- * AP Channel bandwidth is 160 MHZ, but 80MHZ + 80MHZ.
- *
- * @see #getBandwidth()
- */
- public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 5;
-
- /**
- * AP Channel bandwidth is 160 MHZ.
- *
- * @see #getBandwidth()
- */
- 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;
-
- @WifiAnnotations.Bandwidth
- private int mBandwidth = CHANNEL_WIDTH_INVALID;
-
- /** The MAC Address which AP resides on. */
- @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.
- */
- private @WifiAnnotations.WifiStandard int mWifiStandard = ScanResult.WIFI_STANDARD_UNKNOWN;
-
- /**
- * Get the frequency which AP resides on.
- */
- public int getFrequency() {
- return mFrequency;
- }
-
- /**
- * Set the frequency which AP resides on.
- * @hide
- */
- public void setFrequency(int freq) {
- mFrequency = freq;
- }
-
- /**
- * Get AP Channel bandwidth.
- *
- * @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}, {@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() {
- return mBandwidth;
- }
-
- /**
- * Set AP Channel bandwidth.
- * @hide
- */
- public void setBandwidth(@WifiAnnotations.Bandwidth int bandwidth) {
- mBandwidth = bandwidth;
- }
-
- /**
- * Get the MAC address (BSSID) of the AP. Null when AP disabled.
- */
- @Nullable
- public MacAddress getBssid() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- return mBssid;
- }
-
- /**
- * Set the MAC address which AP resides on.
- * <p>
- * <li>If not set, defaults to null.</li>
- * @param bssid BSSID, The caller is responsible for avoiding collisions.
- * @throws IllegalArgumentException when the given BSSID is the all-zero or broadcast MAC
- * address.
- *
- * @hide
- */
- public void setBssid(@Nullable MacAddress bssid) {
- if (bssid != null) {
- Preconditions.checkArgument(!bssid.equals(WifiManager.ALL_ZEROS_MAC_ADDRESS));
- Preconditions.checkArgument(!bssid.equals(MacAddress.BROADCAST_ADDRESS));
- }
- mBssid = bssid;
- }
-
- /**
- * Set the operational mode of the AP.
- *
- * @param wifiStandard values from {@link ScanResult}'s {@code WIFI_STANDARD_}
- * @hide
- */
- public void setWifiStandard(@WifiAnnotations.WifiStandard int wifiStandard) {
- mWifiStandard = wifiStandard;
- }
-
- /**
- * Get the operational mode of the AP.
- * @return valid values from {@link ScanResult}'s {@code WIFI_STANDARD_}
- */
- public @WifiAnnotations.WifiStandard int getWifiStandard() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- return mWifiStandard;
- }
-
- /**
- * Set the AP instance identifier.
- * @hide
- */
- 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;
- }
-
- /**
- * @hide
- */
- public SoftApInfo(@Nullable SoftApInfo source) {
- if (source != null) {
- mFrequency = source.mFrequency;
- mBandwidth = source.mBandwidth;
- mBssid = source.mBssid;
- mWifiStandard = source.mWifiStandard;
- mApInstanceIdentifier = source.mApInstanceIdentifier;
- }
- }
-
- /**
- * @hide
- */
- public SoftApInfo() {
- }
-
- @Override
- /** Implement the Parcelable interface. */
- public int describeContents() {
- return 0;
- }
-
- @Override
- /** Implement the Parcelable interface */
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- dest.writeInt(mFrequency);
- dest.writeInt(mBandwidth);
- dest.writeParcelable(mBssid, flags);
- dest.writeInt(mWifiStandard);
- dest.writeString(mApInstanceIdentifier);
- }
-
- @NonNull
- /** Implement the Parcelable interface */
- public static final Creator<SoftApInfo> CREATOR = new Creator<SoftApInfo>() {
- public SoftApInfo createFromParcel(Parcel in) {
- SoftApInfo info = new SoftApInfo();
- info.mFrequency = in.readInt();
- info.mBandwidth = in.readInt();
- info.mBssid = in.readParcelable(MacAddress.class.getClassLoader());
- info.mWifiStandard = in.readInt();
- info.mApInstanceIdentifier = in.readString();
- return info;
- }
-
- public SoftApInfo[] newArray(int size) {
- return new SoftApInfo[size];
- }
- };
-
- @NonNull
- @Override
- public String toString() {
- StringBuilder sbuf = new StringBuilder();
- sbuf.append("SoftApInfo{");
- sbuf.append("bandwidth= ").append(mBandwidth);
- 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();
- }
-
- @Override
- public boolean equals(@NonNull Object o) {
- if (this == o) return true;
- if (!(o instanceof SoftApInfo)) return false;
- SoftApInfo softApInfo = (SoftApInfo) o;
- return mFrequency == softApInfo.mFrequency
- && mBandwidth == softApInfo.mBandwidth
- && Objects.equals(mBssid, softApInfo.mBssid)
- && mWifiStandard == softApInfo.mWifiStandard
- && Objects.equals(mApInstanceIdentifier, softApInfo.mApInstanceIdentifier);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mFrequency, mBandwidth, mBssid, mWifiStandard, mApInstanceIdentifier);
- }
-}
diff --git a/wifi/java/android/net/wifi/SupplicantState.java b/wifi/java/android/net/wifi/SupplicantState.java
deleted file mode 100644
index de7e2b5..0000000
--- a/wifi/java/android/net/wifi/SupplicantState.java
+++ /dev/null
@@ -1,265 +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 android.net.wifi;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-/**
- * From <code>defs.h</code> in <code>wpa_supplicant</code>.
- * <p/>
- * These enumeration values are used to indicate the current wpa_supplicant
- * state. This is more fine-grained than most users will be interested in.
- * In general, it is better to use
- * {@link android.net.NetworkInfo.State NetworkInfo.State}.
- * <p/>
- * Note, the order of these enum constants must match the numerical values of the
- * state constants in <code>defs.h</code> in <code>wpa_supplicant</code>.
- */
-public enum SupplicantState implements Parcelable {
- /**
- * This state indicates that client is not associated, but is likely to
- * start looking for an access point. This state is entered when a
- * connection is lost.
- */
- DISCONNECTED,
-
- /**
- * Interface is disabled
- * <p/>
- * This state is entered if the network interface is disabled.
- * wpa_supplicant refuses any new operations that would
- * use the radio until the interface has been enabled.
- */
- INTERFACE_DISABLED,
-
- /**
- * Inactive state (wpa_supplicant disabled).
- * <p/>
- * This state is entered if there are no enabled networks in the
- * configuration. wpa_supplicant is not trying to associate with a new
- * network and external interaction (e.g., ctrl_iface call to add or
- * enable a network) is needed to start association.
- */
- INACTIVE,
-
- /**
- * Scanning for a network.
- * <p/>
- * This state is entered when wpa_supplicant starts scanning for a
- * network.
- */
- SCANNING,
-
- /**
- * Trying to authenticate with a BSS/SSID
- * <p/>
- * This state is entered when wpa_supplicant has found a suitable BSS
- * to authenticate with and the driver is configured to try to
- * authenticate with this BSS.
- */
- AUTHENTICATING,
-
- /**
- * Trying to associate with a BSS/SSID.
- * <p/>
- * This state is entered when wpa_supplicant has found a suitable BSS
- * to associate with and the driver is configured to try to associate
- * with this BSS in ap_scan=1 mode. When using ap_scan=2 mode, this
- * state is entered when the driver is configured to try to associate
- * with a network using the configured SSID and security policy.
- */
- ASSOCIATING,
-
- /**
- * Association completed.
- * <p/>
- * This state is entered when the driver reports that association has
- * been successfully completed with an AP. If IEEE 802.1X is used
- * (with or without WPA/WPA2), wpa_supplicant remains in this state
- * until the IEEE 802.1X/EAPOL authentication has been completed.
- */
- ASSOCIATED,
-
- /**
- * WPA 4-Way Key Handshake in progress.
- * <p/>
- * This state is entered when WPA/WPA2 4-Way Handshake is started. In
- * case of WPA-PSK, this happens when receiving the first EAPOL-Key
- * frame after association. In case of WPA-EAP, this state is entered
- * when the IEEE 802.1X/EAPOL authentication has been completed.
- */
- FOUR_WAY_HANDSHAKE,
-
- /**
- * WPA Group Key Handshake in progress.
- * <p/>
- * This state is entered when 4-Way Key Handshake has been completed
- * (i.e., when the supplicant sends out message 4/4) and when Group
- * Key rekeying is started by the AP (i.e., when supplicant receives
- * message 1/2).
- */
- GROUP_HANDSHAKE,
-
- /**
- * All authentication completed.
- * <p/>
- * This state is entered when the full authentication process is
- * completed. In case of WPA2, this happens when the 4-Way Handshake is
- * successfully completed. With WPA, this state is entered after the
- * Group Key Handshake; with IEEE 802.1X (non-WPA) connection is
- * completed after dynamic keys are received (or if not used, after
- * the EAP authentication has been completed). With static WEP keys and
- * plaintext connections, this state is entered when an association
- * has been completed.
- * <p/>
- * This state indicates that the supplicant has completed its
- * processing for the association phase and that data connection is
- * fully configured. Note, however, that there may not be any IP
- * address associated with the connection yet. Typically, a DHCP
- * request needs to be sent at this point to obtain an address.
- */
- COMPLETED,
-
- /**
- * An Android-added state that is reported when a client issues an
- * explicit DISCONNECT command. In such a case, the supplicant is
- * not only dissociated from the current access point (as for the
- * DISCONNECTED state above), but it also does not attempt to connect
- * to any access point until a RECONNECT or REASSOCIATE command
- * is issued by the client.
- */
- DORMANT,
-
- /**
- * No connection to wpa_supplicant.
- * <p/>
- * This is an additional pseudo-state to handle the case where
- * wpa_supplicant is not running and/or we have not been able
- * to establish a connection to it.
- */
- UNINITIALIZED,
-
- /**
- * A pseudo-state that should normally never be seen.
- */
- INVALID;
-
- /**
- * Returns {@code true} if the supplicant state is valid and {@code false}
- * otherwise.
- * @param state The supplicant state
- * @return {@code true} if the supplicant state is valid and {@code false}
- * otherwise.
- */
- public static boolean isValidState(SupplicantState state) {
- return state != UNINITIALIZED && state != INVALID;
- }
-
-
- /** Supplicant associating or authenticating is considered a handshake state {@hide} */
- public static boolean isHandshakeState(SupplicantState state) {
- switch(state) {
- case AUTHENTICATING:
- case ASSOCIATING:
- case ASSOCIATED:
- case FOUR_WAY_HANDSHAKE:
- case GROUP_HANDSHAKE:
- return true;
- case COMPLETED:
- case DISCONNECTED:
- case INTERFACE_DISABLED:
- case INACTIVE:
- case SCANNING:
- case DORMANT:
- case UNINITIALIZED:
- case INVALID:
- return false;
- default:
- throw new IllegalArgumentException("Unknown supplicant state");
- }
- }
-
- /** @hide */
- public static boolean isConnecting(SupplicantState state) {
- switch(state) {
- case AUTHENTICATING:
- case ASSOCIATING:
- case ASSOCIATED:
- case FOUR_WAY_HANDSHAKE:
- case GROUP_HANDSHAKE:
- case COMPLETED:
- return true;
- case DISCONNECTED:
- case INTERFACE_DISABLED:
- case INACTIVE:
- case SCANNING:
- case DORMANT:
- case UNINITIALIZED:
- case INVALID:
- return false;
- default:
- throw new IllegalArgumentException("Unknown supplicant state");
- }
- }
-
- /** @hide */
- public static boolean isDriverActive(SupplicantState state) {
- switch(state) {
- case DISCONNECTED:
- case DORMANT:
- case INACTIVE:
- case AUTHENTICATING:
- case ASSOCIATING:
- case ASSOCIATED:
- case SCANNING:
- case FOUR_WAY_HANDSHAKE:
- case GROUP_HANDSHAKE:
- case COMPLETED:
- return true;
- case INTERFACE_DISABLED:
- case UNINITIALIZED:
- case INVALID:
- return false;
- default:
- throw new IllegalArgumentException("Unknown supplicant state");
- }
- }
-
- /** Implement the Parcelable interface {@hide} */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(name());
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final @android.annotation.NonNull Creator<SupplicantState> CREATOR =
- new Creator<SupplicantState>() {
- public SupplicantState createFromParcel(Parcel in) {
- return SupplicantState.valueOf(in.readString());
- }
-
- public SupplicantState[] newArray(int size) {
- return new SupplicantState[size];
- }
- };
-
-}
diff --git a/wifi/java/android/net/wifi/SynchronousExecutor.java b/wifi/java/android/net/wifi/SynchronousExecutor.java
deleted file mode 100644
index 9926b1b..0000000
--- a/wifi/java/android/net/wifi/SynchronousExecutor.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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.net.wifi;
-
-import java.util.concurrent.Executor;
-
-/**
- * An executor implementation that runs synchronously on the current thread.
- * @hide
- */
-public class SynchronousExecutor implements Executor {
- @Override
- public void execute(Runnable r) {
- r.run();
- }
-}
diff --git a/wifi/java/android/net/wifi/WifiAnnotations.java b/wifi/java/android/net/wifi/WifiAnnotations.java
deleted file mode 100644
index 807b40b..0000000
--- a/wifi/java/android/net/wifi/WifiAnnotations.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * 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.net.wifi;
-
-import android.annotation.IntDef;
-import android.annotation.StringDef;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * Wifi annotations meant to be statically linked into client modules, since they cannot be
- * exposed as @SystemApi.
- *
- * e.g. {@link IntDef}, {@link StringDef}
- *
- * @hide
- */
-public final class WifiAnnotations {
- private WifiAnnotations() {}
-
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = {"SCAN_TYPE_"}, value = {
- WifiScanner.SCAN_TYPE_LOW_LATENCY,
- WifiScanner.SCAN_TYPE_LOW_POWER,
- WifiScanner.SCAN_TYPE_HIGH_ACCURACY})
- public @interface ScanType {}
-
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = {"WIFI_BAND_"}, value = {
- WifiScanner.WIFI_BAND_UNSPECIFIED,
- WifiScanner.WIFI_BAND_24_GHZ,
- WifiScanner.WIFI_BAND_5_GHZ,
- WifiScanner.WIFI_BAND_5_GHZ_DFS_ONLY,
- WifiScanner.WIFI_BAND_6_GHZ})
- public @interface WifiBandBasic {}
-
- @IntDef(prefix = { "CHANNEL_WIDTH_" }, value = {
- SoftApInfo.CHANNEL_WIDTH_INVALID,
- SoftApInfo.CHANNEL_WIDTH_20MHZ_NOHT,
- SoftApInfo.CHANNEL_WIDTH_20MHZ,
- SoftApInfo.CHANNEL_WIDTH_40MHZ,
- 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 {}
-
- @IntDef(prefix = { "CHANNEL_WIDTH_" }, value = {
- ScanResult.CHANNEL_WIDTH_20MHZ,
- ScanResult.CHANNEL_WIDTH_40MHZ,
- ScanResult.CHANNEL_WIDTH_80MHZ,
- ScanResult.CHANNEL_WIDTH_160MHZ,
- ScanResult.CHANNEL_WIDTH_80MHZ_PLUS_MHZ,
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface ChannelWidth{}
-
- @IntDef(prefix = { "WIFI_STANDARD_" }, value = {
- ScanResult.WIFI_STANDARD_UNKNOWN,
- ScanResult.WIFI_STANDARD_LEGACY,
- ScanResult.WIFI_STANDARD_11N,
- ScanResult.WIFI_STANDARD_11AC,
- ScanResult.WIFI_STANDARD_11AX,
- ScanResult.WIFI_STANDARD_11AD,
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface WifiStandard{}
-
- @IntDef(prefix = { "PROTOCOL_" }, value = {
- ScanResult.PROTOCOL_NONE,
- ScanResult.PROTOCOL_WPA,
- ScanResult.PROTOCOL_RSN,
- ScanResult.PROTOCOL_OSEN,
- ScanResult.PROTOCOL_WAPI
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface Protocol {}
-
- @IntDef(prefix = { "KEY_MGMT_" }, value = {
- ScanResult.KEY_MGMT_NONE,
- ScanResult.KEY_MGMT_PSK,
- ScanResult.KEY_MGMT_EAP,
- ScanResult.KEY_MGMT_FT_PSK,
- ScanResult.KEY_MGMT_FT_EAP,
- ScanResult.KEY_MGMT_PSK_SHA256,
- ScanResult.KEY_MGMT_EAP_SHA256,
- ScanResult.KEY_MGMT_OSEN,
- ScanResult.KEY_MGMT_SAE,
- ScanResult.KEY_MGMT_OWE,
- ScanResult.KEY_MGMT_EAP_SUITE_B_192,
- ScanResult.KEY_MGMT_FT_SAE,
- ScanResult.KEY_MGMT_OWE_TRANSITION,
- ScanResult.KEY_MGMT_WAPI_PSK,
- ScanResult.KEY_MGMT_WAPI_CERT
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface KeyMgmt {}
-
- @IntDef(prefix = { "CIPHER_" }, value = {
- ScanResult.CIPHER_NONE,
- ScanResult.CIPHER_NO_GROUP_ADDRESSED,
- ScanResult.CIPHER_TKIP,
- ScanResult.CIPHER_CCMP,
- ScanResult.CIPHER_GCMP_256,
- ScanResult.CIPHER_SMS4
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface Cipher {}
-}
diff --git a/wifi/java/android/net/wifi/WifiClient.java b/wifi/java/android/net/wifi/WifiClient.java
deleted file mode 100644
index 85e2b33..0000000
--- a/wifi/java/android/net/wifi/WifiClient.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * 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.net.wifi;
-
-import android.annotation.NonNull;
-import android.annotation.SystemApi;
-import android.net.MacAddress;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.util.Objects;
-
-/** @hide */
-@SystemApi
-public final class WifiClient implements Parcelable {
-
- private final MacAddress mMacAddress;
-
- /** The identifier of the AP instance which the client connected. */
- private final String mApInstanceIdentifier;
-
- /**
- * The mac address of this client.
- */
- @NonNull
- public MacAddress getMacAddress() {
- 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, @NonNull String apInstanceIdentifier) {
- Objects.requireNonNull(macAddress, "mMacAddress must not be null.");
-
- this.mMacAddress = macAddress;
- this.mApInstanceIdentifier = apInstanceIdentifier;
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- dest.writeParcelable(mMacAddress, flags);
- dest.writeString(mApInstanceIdentifier);
- }
-
- @NonNull
- public static final Creator<WifiClient> CREATOR = new Creator<WifiClient>() {
- public WifiClient createFromParcel(Parcel in) {
- return new WifiClient(in);
- }
-
- public WifiClient[] newArray(int size) {
- return new WifiClient[size];
- }
- };
-
- @NonNull
- @Override
- public String toString() {
- return "WifiClient{"
- + "mMacAddress=" + mMacAddress
- + "mApInstanceIdentifier=" + mApInstanceIdentifier
- + '}';
- }
-
- @Override
- public boolean equals(@NonNull Object o) {
- if (this == o) return true;
- if (!(o instanceof WifiClient)) return false;
- WifiClient client = (WifiClient) o;
- return Objects.equals(mMacAddress, client.mMacAddress)
- && mApInstanceIdentifier.equals(client.mApInstanceIdentifier);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mMacAddress, mApInstanceIdentifier);
- }
-}
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
deleted file mode 100644
index ba4a54f..0000000
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ /dev/null
@@ -1,3675 +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 android.net.wifi;
-
-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;
-import android.net.IpConfiguration;
-import android.net.IpConfiguration.ProxySettings;
-import android.net.MacAddress;
-import android.net.NetworkSpecifier;
-import android.net.ProxyInfo;
-import android.net.StaticIpConfiguration;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.os.SystemClock;
-import android.os.UserHandle;
-import android.telephony.SubscriptionInfo;
-import android.telephony.SubscriptionManager;
-import android.telephony.TelephonyManager;
-import android.text.TextUtils;
-import android.util.Log;
-import android.util.SparseArray;
-
-import com.android.internal.annotations.VisibleForTesting;
-import com.android.net.module.util.MacAddressUtils;
-
-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
- * security configuration.
- *
- * @deprecated Use {@link WifiNetworkSpecifier.Builder} to create {@link NetworkSpecifier} and
- * {@link WifiNetworkSuggestion.Builder} to create {@link WifiNetworkSuggestion}. This will become a
- * system use only object in the future.
- */
-@Deprecated
-public class WifiConfiguration implements Parcelable {
- private static final String TAG = "WifiConfiguration";
- /**
- * Current Version of the Backup Serializer.
- */
- private static final int BACKUP_VERSION = 3;
- /** {@hide} */
- public static final String ssidVarName = "ssid";
- /** {@hide} */
- public static final String bssidVarName = "bssid";
- /** {@hide} */
- public static final String pskVarName = "psk";
- /** {@hide} */
- @Deprecated
- @UnsupportedAppUsage
- public static final String[] wepKeyVarNames = { "wep_key0", "wep_key1", "wep_key2", "wep_key3" };
- /** {@hide} */
- @Deprecated
- public static final String wepTxKeyIdxVarName = "wep_tx_keyidx";
- /** {@hide} */
- public static final String priorityVarName = "priority";
- /** {@hide} */
- public static final String hiddenSSIDVarName = "scan_ssid";
- /** {@hide} */
- public static final String pmfVarName = "ieee80211w";
- /** {@hide} */
- public static final String updateIdentiferVarName = "update_identifier";
- /**
- * The network ID for an invalid network.
- *
- * @hide
- */
- @SystemApi
- public static final int INVALID_NETWORK_ID = -1;
- /** {@hide} */
- public static final int LOCAL_ONLY_NETWORK_ID = -2;
-
- /** {@hide} */
- private String mPasspointManagementObjectTree;
- /** {@hide} */
- private static final int MAXIMUM_RANDOM_MAC_GENERATION_RETRY = 3;
-
- /**
- * Recognized key management schemes.
- */
- public static class KeyMgmt {
- private KeyMgmt() { }
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(value = {
- NONE,
- WPA_PSK,
- WPA_EAP,
- IEEE8021X,
- WPA2_PSK,
- OSEN,
- FT_PSK,
- FT_EAP,
- SAE,
- OWE,
- SUITE_B_192,
- WPA_PSK_SHA256,
- WPA_EAP_SHA256,
- WAPI_PSK,
- WAPI_CERT,
- FILS_SHA256,
- FILS_SHA384})
- public @interface KeyMgmtScheme {}
-
- /** WPA is not used; plaintext or static WEP could be used. */
- public static final int NONE = 0;
- /** WPA pre-shared key (requires {@code preSharedKey} to be specified). */
- public static final int WPA_PSK = 1;
- /** WPA using EAP authentication. Generally used with an external authentication server. */
- public static final int WPA_EAP = 2;
- /**
- * IEEE 802.1X using EAP authentication and (optionally) dynamically
- * generated WEP keys.
- */
- public static final int IEEE8021X = 3;
-
- /**
- * WPA2 pre-shared key for use with soft access point
- * (requires {@code preSharedKey} to be specified).
- * @hide
- */
- @SystemApi
- public static final int WPA2_PSK = 4;
- /**
- * Hotspot 2.0 r2 OSEN:
- * @hide
- */
- public static final int OSEN = 5;
-
- /**
- * IEEE 802.11r Fast BSS Transition with PSK authentication.
- * @hide
- */
- public static final int FT_PSK = 6;
-
- /**
- * IEEE 802.11r Fast BSS Transition with EAP authentication.
- * @hide
- */
- public static final int FT_EAP = 7;
-
- /**
- * Simultaneous Authentication of Equals
- */
- public static final int SAE = 8;
-
- /**
- * Opportunististic Wireless Encryption
- */
- public static final int OWE = 9;
-
- /**
- * SUITE_B_192 192 bit level
- */
- public static final int SUITE_B_192 = 10;
-
- /**
- * WPA pre-shared key with stronger SHA256-based algorithms.
- * @hide
- */
- public static final int WPA_PSK_SHA256 = 11;
-
- /**
- * WPA using EAP authentication with stronger SHA256-based algorithms.
- * @hide
- */
- public static final int WPA_EAP_SHA256 = 12;
-
- /**
- * WAPI pre-shared key (requires {@code preSharedKey} to be specified).
- * @hide
- */
- @SystemApi
- public static final int WAPI_PSK = 13;
-
- /**
- * WAPI certificate to be specified.
- * @hide
- */
- @SystemApi
- public static final int WAPI_CERT = 14;
-
- /**
- * IEEE 802.11ai FILS SK with SHA256
- * @hide
- */
- public static final int FILS_SHA256 = 15;
- /**
- * IEEE 802.11ai FILS SK with SHA384:
- * @hide
- */
- public static final int FILS_SHA384 = 16;
-
- public static final String varName = "key_mgmt";
-
- public static final String[] strings = { "NONE", "WPA_PSK", "WPA_EAP",
- "IEEE8021X", "WPA2_PSK", "OSEN", "FT_PSK", "FT_EAP",
- "SAE", "OWE", "SUITE_B_192", "WPA_PSK_SHA256", "WPA_EAP_SHA256",
- "WAPI_PSK", "WAPI_CERT", "FILS_SHA256", "FILS_SHA384" };
- }
-
- /**
- * Recognized security protocols.
- */
- public static class Protocol {
- private Protocol() { }
-
- /** WPA/IEEE 802.11i/D3.0
- * @deprecated Due to security and performance limitations, use of WPA-1 networks
- * is discouraged. WPA-2 (RSN) should be used instead. */
- @Deprecated
- public static final int WPA = 0;
- /** RSN WPA2/WPA3/IEEE 802.11i */
- public static final int RSN = 1;
- /** HS2.0 r2 OSEN
- * @hide
- */
- public static final int OSEN = 2;
-
- /**
- * WAPI Protocol
- */
- 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" };
- }
-
- /**
- * Recognized IEEE 802.11 authentication algorithms.
- */
- public static class AuthAlgorithm {
- private AuthAlgorithm() { }
-
- /** Open System authentication (required for WPA/WPA2) */
- public static final int OPEN = 0;
- /** Shared Key authentication (requires static WEP keys)
- * @deprecated Due to security and performance limitations, use of WEP networks
- * is discouraged. */
- @Deprecated
- public static final int SHARED = 1;
- /** LEAP/Network EAP (only used with LEAP) */
- public static final int LEAP = 2;
-
- /** 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" };
- }
-
- /**
- * Recognized pairwise ciphers for WPA.
- */
- public static class PairwiseCipher {
- private PairwiseCipher() { }
-
- /** Use only Group keys (deprecated) */
- public static final int NONE = 0;
- /** Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
- * @deprecated Due to security and performance limitations, use of WPA-1 networks
- * is discouraged. WPA-2 (RSN) should be used instead. */
- @Deprecated
- public static final int TKIP = 1;
- /** AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0] */
- public static final int CCMP = 2;
- /**
- * AES in Galois/Counter Mode
- */
- public static final int GCMP_256 = 3;
- /**
- * SMS4 cipher for WAPI
- */
- public static final int SMS4 = 4;
-
- /**
- * AES in Galois/Counter Mode with a 128-bit integrity key
- */
- 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";
-
- public static final String[] strings = { "NONE", "TKIP", "CCMP", "GCMP_256", "SMS4",
- "GCMP_128" };
- }
-
- /**
- * Recognized group ciphers.
- * <pre>
- * CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
- * TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
- * WEP104 = WEP (Wired Equivalent Privacy) with 104-bit key
- * WEP40 = WEP (Wired Equivalent Privacy) with 40-bit key (original 802.11)
- * GCMP_256 = AES in Galois/Counter Mode
- * </pre>
- */
- public static class GroupCipher {
- private GroupCipher() { }
-
- /** WEP40 = WEP (Wired Equivalent Privacy) with 40-bit key (original 802.11)
- * @deprecated Due to security and performance limitations, use of WEP networks
- * is discouraged. */
- @Deprecated
- public static final int WEP40 = 0;
- /** WEP104 = WEP (Wired Equivalent Privacy) with 104-bit key
- * @deprecated Due to security and performance limitations, use of WEP networks
- * is discouraged. */
- @Deprecated
- public static final int WEP104 = 1;
- /** Temporal Key Integrity Protocol [IEEE 802.11i/D7.0] */
- public static final int TKIP = 2;
- /** AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0] */
- public static final int CCMP = 3;
- /** Hotspot 2.0 r2 OSEN
- * @hide
- */
- public static final int GTK_NOT_USED = 4;
- /**
- * AES in Galois/Counter Mode
- */
- public static final int GCMP_256 = 5;
- /**
- * SMS4 cipher for WAPI
- */
- public static final int SMS4 = 6;
- /**
- * AES in Galois/Counter Mode with a 128-bit integrity key
- */
- 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 =
- { /* deprecated */ "WEP40", /* deprecated */ "WEP104",
- "TKIP", "CCMP", "GTK_NOT_USED", "GCMP_256",
- "SMS4", "GCMP_128" };
- }
-
- /**
- * Recognized group management ciphers.
- * <pre>
- * BIP_CMAC_256 = Cipher-based Message Authentication Code 256 bits
- * BIP_GMAC_128 = Galois Message Authentication Code 128 bits
- * BIP_GMAC_256 = Galois Message Authentication Code 256 bits
- * </pre>
- */
- public static class GroupMgmtCipher {
- private GroupMgmtCipher() { }
-
- /** CMAC-256 = Cipher-based Message Authentication Code */
- public static final int BIP_CMAC_256 = 0;
-
- /** GMAC-128 = Galois Message Authentication Code */
- public static final int BIP_GMAC_128 = 1;
-
- /** 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";
-
- /** @hide */
- @SuppressLint("AllUpper")
- public static final @NonNull String[] strings = { "BIP_CMAC_256",
- "BIP_GMAC_128", "BIP_GMAC_256"};
- }
-
- /**
- * Recognized suiteB ciphers.
- * <pre>
- * ECDHE_ECDSA
- * ECDHE_RSA
- * </pre>
- * @hide
- */
- public static class SuiteBCipher {
- private SuiteBCipher() { }
-
- /** Diffie-Hellman with Elliptic Curve_ECDSA signature */
- public static final int ECDHE_ECDSA = 0;
-
- /** 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";
-
- /** @hide */
- @SuppressLint("AllUpper")
- public static final String[] strings = { "ECDHE_ECDSA", "ECDHE_RSA" };
- }
-
- /** Possible status of a network configuration. */
- public static class Status {
- private Status() { }
-
- /** this is the network we are currently connected to */
- public static final int CURRENT = 0;
- /** supplicant will not attempt to use this network */
- public static final int DISABLED = 1;
- /** supplicant will consider this network available for association */
- public static final int ENABLED = 2;
-
- public static final String[] strings = { "current", "disabled", "enabled" };
- }
-
- /** Security type for an open network. */
- public static final int SECURITY_TYPE_OPEN = 0;
- /** Security type for a WEP network. */
- public static final int SECURITY_TYPE_WEP = 1;
- /** Security type for a PSK network. */
- public static final int SECURITY_TYPE_PSK = 2;
- /** Security type for an EAP network. */
- public static final int SECURITY_TYPE_EAP = 3;
- /** Security type for an SAE network. */
- public static final int SECURITY_TYPE_SAE = 4;
- /**
- * Security type for a WPA3-Enterprise in 192-bit security network.
- * This is the same as {@link #SECURITY_TYPE_EAP_SUITE_B} and uses the same value.
- */
- public static final int SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT = 5;
- /**
- * Security type for a WPA3-Enterprise in 192-bit security network.
- * @deprecated Use the {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT} constant
- * (which is the same value).
- */
- @Deprecated
- public static final int SECURITY_TYPE_EAP_SUITE_B =
- SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT;
- /** Security type for an OWE network. */
- public static final int SECURITY_TYPE_OWE = 6;
- /** Security type for a WAPI PSK network. */
- public static final int SECURITY_TYPE_WAPI_PSK = 7;
- /** Security type for a WAPI Certificate network. */
- 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.
- * @hide
- */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = { "SECURITY_TYPE_" }, value = {
- SECURITY_TYPE_OPEN,
- SECURITY_TYPE_WEP,
- SECURITY_TYPE_PSK,
- SECURITY_TYPE_EAP,
- SECURITY_TYPE_SAE,
- SECURITY_TYPE_EAP_SUITE_B,
- SECURITY_TYPE_OWE,
- SECURITY_TYPE_WAPI_PSK,
- 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},
- * {@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 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:
- params = SecurityParams.createOpenParams();
- break;
- case SECURITY_TYPE_WEP:
- params = SecurityParams.createWepParams();
- break;
- case SECURITY_TYPE_PSK:
- params = SecurityParams.createWpaWpa2PersonalParams();
- break;
- case SECURITY_TYPE_EAP:
- params = SecurityParams.createWpaWpa2EnterpriseParams();
- break;
- case SECURITY_TYPE_SAE:
- 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
- // duplicate case label errors.
- case SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT:
- params = SecurityParams.createWpa3Enterprise192BitParams();
- break;
- case SECURITY_TYPE_OWE:
- params = SecurityParams.createEnhancedOpenParams();
- break;
- case SECURITY_TYPE_WAPI_PSK:
- params = SecurityParams.createWapiPskParams();
- break;
- case SECURITY_TYPE_WAPI_CERT:
- params = SecurityParams.createWapiCertParams();
- break;
- case SECURITY_TYPE_EAP_WPA3_ENTERPRISE:
- 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 */
- public static final int UNKNOWN_UID = -1;
-
- /**
- * The ID number that the supplicant uses to identify this
- * network configuration entry. This must be passed as an argument
- * to most calls into the supplicant.
- */
- public int networkId;
-
- // Fixme We need remove this field to use only Quality network selection status only
- /**
- * The current status of this network configuration entry.
- * @see Status
- */
- public int status;
-
- /**
- * The network's SSID. Can either be a UTF-8 string,
- * which must be enclosed in double quotation marks
- * (e.g., {@code "MyNetwork"}), or a string of
- * hex digits, which are not enclosed in quotes
- * (e.g., {@code 01a243f405}).
- */
- public String SSID;
-
- /**
- * When set, this network configuration entry should only be used when
- * associating with the AP having the specified BSSID. The value is
- * a string in the format of an Ethernet MAC address, e.g.,
- * <code>XX:XX:XX:XX:XX:XX</code> where each <code>X</code> is a hex digit.
- */
- public String BSSID;
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = {"AP_BAND_"}, value = {
- AP_BAND_2GHZ,
- AP_BAND_5GHZ,
- AP_BAND_ANY})
- public @interface ApBand {}
-
- /**
- * 2GHz band.
- * @hide
- */
- public static final int AP_BAND_2GHZ = 0;
-
- /**
- * 5GHz band.
- * @hide
- */
- public static final int AP_BAND_5GHZ = 1;
-
- /**
- * 60GHz band
- * @hide
- */
- public static final int AP_BAND_60GHZ = 2;
-
- /**
- * Device is allowed to choose the optimal band (2Ghz or 5Ghz) based on device capability,
- * operating country code and current radio conditions.
- * @hide
- */
- public static final int AP_BAND_ANY = -1;
-
- /**
- * The band which the AP resides on.
- * One of {@link #AP_BAND_2GHZ}, {@link #AP_BAND_5GHZ}, or {@link #AP_BAND_ANY}.
- * By default, {@link #AP_BAND_2GHZ} is chosen.
- *
- * @hide
- */
- @UnsupportedAppUsage
- @ApBand
- public int apBand = AP_BAND_2GHZ;
-
- /**
- * The channel which AP resides on,currently, US only
- * 2G 1-11
- * 5G 36,40,44,48,149,153,157,161,165
- * 0 - find a random available channel according to the apBand
- * @hide
- */
- @UnsupportedAppUsage
- public int apChannel = 0;
-
- /**
- * Pre-shared key for use with WPA-PSK. Either an ASCII string enclosed in
- * double quotation marks (e.g., {@code "abcdefghij"} for PSK passphrase or
- * a string of 64 hex digits for raw PSK.
- * <p/>
- * When the value of this key is read, the actual key is
- * not returned, just a "*" if the key has a value, or the null
- * string otherwise.
- */
- public String preSharedKey;
-
- /**
- * Four WEP keys. For each of the four values, provide either an ASCII
- * string enclosed in double quotation marks (e.g., {@code "abcdef"}),
- * a string of hex digits (e.g., {@code 0102030405}), or an empty string
- * (e.g., {@code ""}).
- * <p/>
- * When the value of one of these keys is read, the actual key is
- * not returned, just a "*" if the key has a value, or the null
- * string otherwise.
- * @deprecated Due to security and performance limitations, use of WEP networks
- * is discouraged.
- */
- @Deprecated
- public String[] wepKeys;
-
- /** Default WEP key index, ranging from 0 to 3.
- * @deprecated Due to security and performance limitations, use of WEP networks
- * is discouraged. */
- @Deprecated
- public int wepTxKeyIndex;
-
- /**
- * Priority determines the preference given to a network by {@code wpa_supplicant}
- * when choosing an access point with which to associate.
- * @deprecated This field does not exist anymore.
- */
- @Deprecated
- public int priority;
-
- /**
- * This is a network that does not broadcast its SSID, so an
- * SSID-specific probe request must be used for scans.
- */
- public boolean hiddenSSID;
-
- /**
- * True if the network requires Protected Management Frames (PMF), false otherwise.
- * @hide
- */
- @SystemApi
- public boolean requirePmf;
-
- /**
- * Update identifier, for Passpoint network.
- * @hide
- */
- public String updateIdentifier;
-
- /**
- * The set of key management protocols supported by this configuration.
- * See {@link KeyMgmt} for descriptions of the values.
- * Defaults to WPA-PSK WPA-EAP.
- */
- @NonNull
- public BitSet allowedKeyManagement;
- /**
- * The set of security protocols supported by this configuration.
- * See {@link Protocol} for descriptions of the values.
- * Defaults to WPA RSN.
- */
- @NonNull
- public BitSet allowedProtocols;
- /**
- * The set of authentication protocols supported by this configuration.
- * See {@link AuthAlgorithm} for descriptions of the values.
- * Defaults to automatic selection.
- */
- @NonNull
- public BitSet allowedAuthAlgorithms;
- /**
- * The set of pairwise ciphers for WPA supported by this configuration.
- * See {@link PairwiseCipher} for descriptions of the values.
- * Defaults to CCMP TKIP.
- */
- @NonNull
- public BitSet allowedPairwiseCiphers;
- /**
- * The set of group ciphers supported by this configuration.
- * See {@link GroupCipher} for descriptions of the values.
- * Defaults to CCMP TKIP WEP104 WEP40.
- */
- @NonNull
- public BitSet allowedGroupCiphers;
- /**
- * The set of group management ciphers supported by this configuration.
- * See {@link GroupMgmtCipher} for descriptions of the values.
- */
- @NonNull
- public BitSet allowedGroupManagementCiphers;
- /**
- * 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.
- */
- @NonNull
- public BitSet allowedSuiteBCiphers;
- /**
- * The enterprise configuration details specifying the EAP method,
- * certificates and other settings associated with the EAP.
- */
- public WifiEnterpriseConfig enterpriseConfig;
-
- /**
- * Fully qualified domain name of a Passpoint configuration
- */
- public String FQDN;
-
- /**
- * Name of Passpoint credential provider
- */
- public String providerFriendlyName;
-
- /**
- * Flag indicating if this network is provided by a home Passpoint provider or a roaming
- * Passpoint provider. This flag will be {@code true} if this network is provided by
- * a home Passpoint provider and {@code false} if is provided by a roaming Passpoint provider
- * or is a non-Passpoint network.
- */
- public boolean isHomeProviderNetwork;
-
- /**
- * Roaming Consortium Id list for Passpoint credential; identifies a set of networks where
- * Passpoint credential will be considered valid
- */
- public long[] roamingConsortiumIds;
-
- /**
- * True if this network configuration is visible to and usable by other users on the
- * same device, false otherwise.
- *
- * @hide
- */
- @SystemApi
- public boolean shared;
-
- /**
- * @hide
- */
- @NonNull
- @UnsupportedAppUsage
- private IpConfiguration mIpConfiguration;
-
- /**
- * @hide
- * dhcp server MAC address if known
- */
- public String dhcpServer;
-
- /**
- * @hide
- * default Gateway MAC address if known
- */
- @UnsupportedAppUsage
- public String defaultGwMacAddress;
-
- /**
- * @hide
- * last time we connected, this configuration had validated internet access
- */
- @UnsupportedAppUsage
- public boolean validatedInternetAccess;
-
- /**
- * @hide
- * The number of beacon intervals between Delivery Traffic Indication Maps (DTIM)
- * This value is populated from scan results that contain Beacon Frames, which are infrequent.
- * The value is not guaranteed to be set or current (Although it SHOULDNT change once set)
- * Valid values are from 1 - 255. Initialized here as 0, use this to check if set.
- */
- public int dtimInterval = 0;
-
- /**
- * Flag indicating if this configuration represents a legacy Passpoint configuration
- * (Release N or older). This is used for migrating Passpoint configuration from N to O.
- * This will no longer be needed after O.
- * @hide
- */
- public boolean isLegacyPasspointConfig = false;
- /**
- * @hide
- * Uid of app creating the configuration
- */
- @SystemApi
- public int creatorUid;
-
- /**
- * @hide
- * Uid of last app issuing a connection related command
- */
- @UnsupportedAppUsage
- public int lastConnectUid;
-
- /**
- * @hide
- * Uid of last app modifying the configuration
- */
- @SystemApi
- public int lastUpdateUid;
-
- /**
- * @hide
- * Universal name for app creating the configuration
- * see {@link PackageManager#getNameForUid(int)}
- */
- @SystemApi
- public String creatorName;
-
- /**
- * @hide
- * Universal name for app updating the configuration
- * see {@link PackageManager#getNameForUid(int)}
- */
- @SystemApi
- public String lastUpdateName;
-
- /**
- * The carrier ID identifies the operator who provides this network configuration.
- * see {@link TelephonyManager#getSimCarrierId()}
- * @hide
- */
- @SystemApi
- public int carrierId = TelephonyManager.UNKNOWN_CARRIER_ID;
-
- /**
- * The subscription ID identifies the SIM card for which this network configuration is valid.
- * See {@link SubscriptionInfo#getSubscriptionId()}
- * @hide
- */
- @SystemApi
- public int subscriptionId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
-
- /**
- * @hide
- * Auto-join is allowed by user for this network.
- * Default true.
- */
- @SystemApi
- public boolean allowAutojoin = true;
-
- /** @hide **/
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
- public static int INVALID_RSSI = -127;
-
- /**
- * @hide
- * Number of reports indicating no Internet Access
- */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public int numNoInternetAccessReports;
-
- /**
- * @hide
- * The WiFi configuration is considered to have no internet access for purpose of autojoining
- * if there has been a report of it having no internet access, and, it never have had
- * internet access in the past.
- */
- @SystemApi
- public boolean hasNoInternetAccess() {
- return numNoInternetAccessReports > 0 && !validatedInternetAccess;
- }
-
- /**
- * The WiFi configuration is expected not to have Internet access (e.g., a wireless printer, a
- * Chromecast hotspot, etc.). This will be set if the user explicitly confirms a connection to
- * this configuration and selects "don't ask again".
- * @hide
- */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public boolean noInternetAccessExpected;
-
- /**
- * The WiFi configuration is expected not to have Internet access (e.g., a wireless printer, a
- * Chromecast hotspot, etc.). This will be set if the user explicitly confirms a connection to
- * this configuration and selects "don't ask again".
- * @hide
- */
- @SystemApi
- public boolean isNoInternetAccessExpected() {
- return noInternetAccessExpected;
- }
-
- /**
- * This Wifi configuration is expected for OSU(Online Sign Up) of Passpoint Release 2.
- * @hide
- */
- public boolean osu;
-
- /**
- * @hide
- * Last time the system was connected to this configuration.
- */
- public long lastConnected;
-
- /**
- * @hide
- * Last time the system was disconnected to this configuration.
- */
- public long lastDisconnected;
-
- /**
- * Set if the configuration was self added by the framework
- * This boolean is cleared if we get a connect/save/ update or
- * any wifiManager command that indicate the user interacted with the configuration
- * since we will now consider that the configuration belong to him.
- * @deprecated only kept for @UnsupportedAppUsage
- * @hide
- */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public boolean selfAdded;
-
- /**
- * Peer WifiConfiguration this WifiConfiguration was added for
- * @hide
- */
- public String peerWifiConfiguration;
-
- /**
- * @hide
- * Indicate that a WifiConfiguration is temporary and should not be saved
- * nor considered by AutoJoin.
- */
- public boolean ephemeral;
-
- /**
- * @hide
- * Indicate that a WifiConfiguration is temporary and should not be saved
- * nor considered by AutoJoin.
- */
- @SystemApi
- public boolean isEphemeral() {
- return ephemeral;
- }
-
- /**
- * Indicate whether the network is trusted or not. Networks are considered trusted
- * if the user explicitly allowed this network connection.
- * This bit can be used by suggestion network, see
- * {@link WifiNetworkSuggestion.Builder#setUntrusted(boolean)}
- * @hide
- */
- public boolean trusted;
-
- /**
- * Indicate whether the network is oem paid or not. Networks are considered oem paid
- * if the corresponding connection is only available to system apps.
- *
- * This bit can only be used by suggestion network, see
- * {@link WifiNetworkSuggestion.Builder#setOemPaid(boolean)}
- * @hide
- */
- public boolean oemPaid;
-
-
- /**
- * Indicate whether the network is oem private or not. Networks are considered oem private
- * if the corresponding connection is only available to system apps.
- *
- * This bit can only be used by suggestion network, see
- * {@link WifiNetworkSuggestion.Builder#setOemPrivate(boolean)}
- * @hide
- */
- public boolean oemPrivate;
-
- /**
- * Indicate whether or not the network is a carrier merged network.
- * This bit can only be used by suggestion network, see
- * {@link WifiNetworkSuggestion.Builder#setCarrierMerged(boolean)}
- * @hide
- */
- @SystemApi
- public boolean carrierMerged;
-
- /**
- * True if this Wifi configuration is created from a {@link WifiNetworkSuggestion},
- * false otherwise.
- *
- * @hide
- */
- @SystemApi
- public boolean fromWifiNetworkSuggestion;
-
- /**
- * True if this Wifi configuration is created from a {@link WifiNetworkSpecifier},
- * false otherwise.
- *
- * @hide
- */
- @SystemApi
- public boolean fromWifiNetworkSpecifier;
-
- /**
- * True if the creator of this configuration has expressed that it
- * should be considered metered, false otherwise.
- *
- * @see #isMetered(WifiConfiguration, WifiInfo)
- *
- * @hide
- */
- @SystemApi
- public boolean meteredHint;
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = {"METERED_OVERRIDE_"}, value = {
- METERED_OVERRIDE_NONE,
- METERED_OVERRIDE_METERED,
- METERED_OVERRIDE_NOT_METERED})
- public @interface MeteredOverride {}
-
- /**
- * No metered override.
- * @hide
- */
- @SystemApi
- public static final int METERED_OVERRIDE_NONE = 0;
- /**
- * Override network to be metered.
- * @hide
- */
- @SystemApi
- public static final int METERED_OVERRIDE_METERED = 1;
- /**
- * Override network to be unmetered.
- * @hide
- */
- @SystemApi
- public static final int METERED_OVERRIDE_NOT_METERED = 2;
-
- /**
- * Indicates if the end user has expressed an explicit opinion about the
- * meteredness of this network, such as through the Settings app.
- * This value is one of {@link #METERED_OVERRIDE_NONE}, {@link #METERED_OVERRIDE_METERED},
- * or {@link #METERED_OVERRIDE_NOT_METERED}.
- * <p>
- * This should always override any values from {@link #meteredHint} or
- * {@link WifiInfo#getMeteredHint()}.
- *
- * By default this field is set to {@link #METERED_OVERRIDE_NONE}.
- *
- * @see #isMetered(WifiConfiguration, WifiInfo)
- * @hide
- */
- @SystemApi
- @MeteredOverride
- public int meteredOverride = METERED_OVERRIDE_NONE;
-
- /**
- * Blend together all the various opinions to decide if the given network
- * should be considered metered or not.
- *
- * @hide
- */
- @SystemApi
- public static boolean isMetered(@Nullable WifiConfiguration config, @Nullable WifiInfo info) {
- boolean metered = false;
- if (info != null && info.getMeteredHint()) {
- metered = true;
- }
- if (config != null && config.meteredHint) {
- metered = true;
- }
- if (config != null
- && config.meteredOverride == WifiConfiguration.METERED_OVERRIDE_METERED) {
- metered = true;
- }
- if (config != null
- && config.meteredOverride == WifiConfiguration.METERED_OVERRIDE_NOT_METERED) {
- metered = false;
- }
- return metered;
- }
-
- /** 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;
- }
-
- /**
- * @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();
- }
-
- /**
- * @hide
- * Setting this value will force scan results associated with this configuration to
- * be included in the bucket of networks that are externally scored.
- * If not set, associated scan results will be treated as legacy saved networks and
- * will take precedence over networks in the scored category.
- */
- @SystemApi
- public boolean useExternalScores;
-
- /**
- * @hide
- * Number of time the scorer overrode a the priority based choice, when comparing two
- * WifiConfigurations, note that since comparing WifiConfiguration happens very often
- * potentially at every scan, this number might become very large, even on an idle
- * system.
- */
- @SystemApi
- public int numScorerOverride;
-
- /**
- * @hide
- * Number of time the scorer overrode a the priority based choice, and the comparison
- * triggered a network switch
- */
- @SystemApi
- public int numScorerOverrideAndSwitchedNetwork;
-
- /**
- * @hide
- * Number of time we associated to this configuration.
- */
- @SystemApi
- public int numAssociation;
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = {"RANDOMIZATION_"}, value = {
- RANDOMIZATION_NONE,
- RANDOMIZATION_PERSISTENT,
- RANDOMIZATION_ENHANCED,
- RANDOMIZATION_AUTO})
- public @interface MacRandomizationSetting {}
-
- /**
- * Use factory MAC when connecting to this network
- * @hide
- */
- @SystemApi
- public static final int RANDOMIZATION_NONE = 0;
- /**
- * Generate a randomized MAC once and reuse it for all connections to this network
- * @hide
- */
- @SystemApi
- public static final int RANDOMIZATION_PERSISTENT = 1;
-
- /**
- * Use a randomly generated MAC address for connections to this network.
- * This option does not persist the randomized MAC address.
- * @hide
- */
- @SystemApi
- public static final int RANDOMIZATION_ENHANCED = 2;
-
- /**
- * Let the wifi framework automatically decide the MAC randomization strategy.
- * @hide
- */
- @SystemApi
- public static final int RANDOMIZATION_AUTO = 3;
-
- /**
- * Level of MAC randomization for this network.
- * One of {@link #RANDOMIZATION_NONE}, {@link #RANDOMIZATION_AUTO},
- * {@link #RANDOMIZATION_PERSISTENT} or {@link #RANDOMIZATION_ENHANCED}.
- * By default this field is set to {@link #RANDOMIZATION_AUTO}.
- * @hide
- */
- @SystemApi
- @MacRandomizationSetting
- public int macRandomizationSetting = RANDOMIZATION_AUTO;
-
- /**
- * @hide
- * Randomized MAC address to use with this particular network
- */
- @NonNull
- private MacAddress mRandomizedMacAddress;
-
- /**
- * @hide
- * The wall clock time of when |mRandomizedMacAddress| should be re-randomized in enhanced
- * MAC randomization mode.
- */
- public long randomizedMacExpirationTimeMs = 0;
-
- /**
- * The wall clock time of when |mRandomizedMacAddress| is last modified.
- * @hide
- */
- public long randomizedMacLastModifiedTimeMs = 0;
-
- /**
- * @hide
- * Checks if the given MAC address can be used for Connected Mac Randomization
- * by verifying that it is non-null, unicast, locally assigned, and not default mac.
- * @param mac MacAddress to check
- * @return true if mac is good to use
- */
- public static boolean isValidMacAddressForRandomization(MacAddress mac) {
- return mac != null && !MacAddressUtils.isMulticastAddress(mac) && mac.isLocallyAssigned()
- && !MacAddress.fromString(WifiInfo.DEFAULT_MAC_ADDRESS).equals(mac);
- }
-
- /**
- * Returns MAC address set to be the local randomized MAC address.
- * Depending on user preference, the device may or may not use the returned MAC address for
- * connections to this network.
- * <p>
- * Information is restricted to Device Owner, Profile Owner, and Carrier apps
- * (which will only obtain addresses for configurations which they create). Other callers
- * will receive a default "02:00:00:00:00:00" MAC address.
- */
- public @NonNull MacAddress getRandomizedMacAddress() {
- return mRandomizedMacAddress;
- }
-
- /**
- * @hide
- * @param mac MacAddress to change into
- */
- public void setRandomizedMacAddress(@NonNull MacAddress mac) {
- if (mac == null) {
- Log.e(TAG, "setRandomizedMacAddress received null MacAddress.");
- return;
- }
- mRandomizedMacAddress = mac;
- }
-
- /** @hide
- * Boost given to RSSI on a home network for the purpose of calculating the score
- * This adds stickiness to home networks, as defined by:
- * - less than 4 known BSSIDs
- * - PSK only
- * - TODO: add a test to verify that all BSSIDs are behind same gateway
- ***/
- public static final int HOME_NETWORK_RSSI_BOOST = 5;
-
- /**
- * This class is used to contain all the information and API used for quality network selection.
- * @hide
- */
- @SystemApi
- public static class NetworkSelectionStatus {
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = "NETWORK_SELECTION_",
- value = {
- NETWORK_SELECTION_ENABLED,
- NETWORK_SELECTION_TEMPORARY_DISABLED,
- NETWORK_SELECTION_PERMANENTLY_DISABLED})
- public @interface NetworkEnabledStatus {}
- /**
- * This network will be considered as a potential candidate to connect to during network
- * selection.
- */
- public static final int NETWORK_SELECTION_ENABLED = 0;
- /**
- * This network was temporary disabled. May be re-enabled after a time out.
- */
- public static final int NETWORK_SELECTION_TEMPORARY_DISABLED = 1;
- /**
- * This network was permanently disabled.
- */
- public static final int NETWORK_SELECTION_PERMANENTLY_DISABLED = 2;
- /**
- * Maximum Network selection status
- * @hide
- */
- public static final int NETWORK_SELECTION_STATUS_MAX = 3;
-
- /**
- * Quality network selection status String (for debug purpose). Use Quality network
- * selection status value as index to extec the corresponding debug string
- * @hide
- */
- public static final String[] QUALITY_NETWORK_SELECTION_STATUS = {
- "NETWORK_SELECTION_ENABLED",
- "NETWORK_SELECTION_TEMPORARY_DISABLED",
- "NETWORK_SELECTION_PERMANENTLY_DISABLED"};
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = "DISABLED_", value = {
- DISABLED_NONE,
- DISABLED_ASSOCIATION_REJECTION,
- DISABLED_AUTHENTICATION_FAILURE,
- DISABLED_DHCP_FAILURE,
- DISABLED_NO_INTERNET_TEMPORARY,
- DISABLED_AUTHENTICATION_NO_CREDENTIALS,
- DISABLED_NO_INTERNET_PERMANENT,
- DISABLED_BY_WIFI_MANAGER,
- DISABLED_BY_WRONG_PASSWORD,
- DISABLED_AUTHENTICATION_NO_SUBSCRIPTION,
- DISABLED_AUTHENTICATION_FAILURE_GENERIC,
- DISABLED_AUTHENTICATION_FAILURE_CARRIER_SPECIFIC})
- public @interface NetworkSelectionDisableReason {}
-
- // Quality Network disabled reasons
- /** Default value. Means not disabled. */
- public static final int DISABLED_NONE = 0;
- /**
- * The starting index for network selection disabled reasons.
- * @hide
- */
- public static final int NETWORK_SELECTION_DISABLED_STARTING_INDEX = 1;
- /** This network is temporarily disabled because of multiple association rejections. */
- public static final int DISABLED_ASSOCIATION_REJECTION = 1;
- /** This network is disabled due to generic authentication failure. */
- public static final int DISABLED_AUTHENTICATION_FAILURE_GENERIC = 2;
- /** Separate DISABLED_AUTHENTICATION_FAILURE into DISABLED_AUTHENTICATION_FAILURE_GENERIC
- * and DISABLED_AUTHENTICATION_FAILURE_CARRIER_SPECIFIC
- * @deprecated Use the {@link #DISABLED_AUTHENTICATION_FAILURE_GENERIC} constant
- * (which is the same value).
- */
- @Deprecated
- public static final int DISABLED_AUTHENTICATION_FAILURE =
- DISABLED_AUTHENTICATION_FAILURE_GENERIC;
- /** This network is temporarily disabled because of multiple DHCP failure. */
- public static final int DISABLED_DHCP_FAILURE = 3;
- /** This network is temporarily disabled because it has no Internet access. */
- public static final int DISABLED_NO_INTERNET_TEMPORARY = 4;
- /** This network is permanently disabled due to absence of user credentials */
- public static final int DISABLED_AUTHENTICATION_NO_CREDENTIALS = 5;
- /**
- * This network is permanently disabled because it has no Internet access and the user does
- * not want to stay connected.
- */
- public static final int DISABLED_NO_INTERNET_PERMANENT = 6;
- /** This network is permanently disabled due to WifiManager disabling it explicitly. */
- public static final int DISABLED_BY_WIFI_MANAGER = 7;
- /** This network is permanently disabled due to wrong password. */
- public static final int DISABLED_BY_WRONG_PASSWORD = 8;
- /** This network is permanently disabled because service is not subscribed. */
- public static final int DISABLED_AUTHENTICATION_NO_SUBSCRIPTION = 9;
- /** This network is disabled due to carrier specific EAP failure. */
- public static final int DISABLED_AUTHENTICATION_FAILURE_CARRIER_SPECIFIC = 10;
- /**
- * All other disable reasons should be strictly less than this value.
- * @hide
- */
- public static final int NETWORK_SELECTION_DISABLED_MAX = 11;
-
- /**
- * Get an integer that is equal to the maximum integer value of all the
- * DISABLED_* reasons
- * e.g. {@link #DISABLED_NONE}, {@link #DISABLED_ASSOCIATION_REJECTION}, etc.
- *
- * All DISABLED_* constants will be contiguous in the range
- * 0, 1, 2, 3, ..., getMaxNetworkSelectionDisableReasons()
- *
- * <br />
- * For example, this can be used to iterate through all the network selection
- * disable reasons like so:
- * <pre>{@code
- * for (int reason = 0; reason <= getMaxNetworkSelectionDisableReasons(); reason++) {
- * ...
- * }
- * }</pre>
- */
- public static int getMaxNetworkSelectionDisableReason() {
- return NETWORK_SELECTION_DISABLED_MAX - 1;
- }
-
- /**
- * Contains info about disable reasons.
- * @hide
- */
- public static final class DisableReasonInfo {
- /**
- * String representation for the disable reason.
- * Note that these strings are persisted in
- * {@link
- * com.android.server.wifi.util.XmlUtil.NetworkSelectionStatusXmlUtil#writeToXml},
- * so do not change the string values to maintain backwards compatibility.
- */
- public final String mReasonStr;
- /**
- * Network Selection disable reason threshold, used to debounce network failures before
- * we disable them.
- */
- public final int mDisableThreshold;
- /**
- * Network Selection disable timeout for the error. After the timeout milliseconds,
- * enable the network again.
- * If this is set to Integer.MAX_VALUE, the network will be permanently disabled until
- * the next time the user manually connects to it.
- */
- public final int mDisableTimeoutMillis;
-
- /**
- * Constructor
- * @param reasonStr string representation of the error
- * @param disableThreshold number of failures before we disable the network
- * @param disableTimeoutMillis the timeout, in milliseconds, before we re-enable the
- * network after disabling it
- */
- public DisableReasonInfo(String reasonStr, int disableThreshold,
- int disableTimeoutMillis) {
- mReasonStr = reasonStr;
- mDisableThreshold = disableThreshold;
- mDisableTimeoutMillis = disableTimeoutMillis;
- }
- }
-
- /**
- * Quality network selection disable reason infos.
- * @hide
- */
- public static final SparseArray<DisableReasonInfo> DISABLE_REASON_INFOS =
- buildDisableReasonInfos();
-
- private static SparseArray<DisableReasonInfo> buildDisableReasonInfos() {
- SparseArray<DisableReasonInfo> reasons = new SparseArray<>();
-
- reasons.append(DISABLED_NONE,
- new DisableReasonInfo(
- // Note that these strings are persisted in
- // XmlUtil.NetworkSelectionStatusXmlUtil#writeToXml,
- // so do not change the string values to maintain backwards
- // compatibility.
- "NETWORK_SELECTION_ENABLE",
- -1,
- Integer.MAX_VALUE));
-
- reasons.append(DISABLED_ASSOCIATION_REJECTION,
- new DisableReasonInfo(
- // Note that there is a space at the end of this string. Cannot fix
- // since this string is persisted.
- "NETWORK_SELECTION_DISABLED_ASSOCIATION_REJECTION ",
- 5,
- 5 * 60 * 1000));
-
- reasons.append(DISABLED_AUTHENTICATION_FAILURE,
- new DisableReasonInfo(
- "NETWORK_SELECTION_DISABLED_AUTHENTICATION_FAILURE",
- 5,
- 5 * 60 * 1000));
-
- reasons.append(DISABLED_DHCP_FAILURE,
- new DisableReasonInfo(
- "NETWORK_SELECTION_DISABLED_DHCP_FAILURE",
- 5,
- 5 * 60 * 1000));
-
- reasons.append(DISABLED_NO_INTERNET_TEMPORARY,
- new DisableReasonInfo(
- "NETWORK_SELECTION_DISABLED_NO_INTERNET_TEMPORARY",
- 1,
- 10 * 60 * 1000));
-
- reasons.append(DISABLED_AUTHENTICATION_NO_CREDENTIALS,
- new DisableReasonInfo(
- "NETWORK_SELECTION_DISABLED_AUTHENTICATION_NO_CREDENTIALS",
- 1,
- Integer.MAX_VALUE));
-
- reasons.append(DISABLED_NO_INTERNET_PERMANENT,
- new DisableReasonInfo(
- "NETWORK_SELECTION_DISABLED_NO_INTERNET_PERMANENT",
- 1,
- Integer.MAX_VALUE));
-
- reasons.append(DISABLED_BY_WIFI_MANAGER,
- new DisableReasonInfo(
- "NETWORK_SELECTION_DISABLED_BY_WIFI_MANAGER",
- 1,
- Integer.MAX_VALUE));
-
- reasons.append(DISABLED_BY_WRONG_PASSWORD,
- new DisableReasonInfo(
- "NETWORK_SELECTION_DISABLED_BY_WRONG_PASSWORD",
- 1,
- Integer.MAX_VALUE));
-
- reasons.append(DISABLED_AUTHENTICATION_NO_SUBSCRIPTION,
- new DisableReasonInfo(
- "NETWORK_SELECTION_DISABLED_AUTHENTICATION_NO_SUBSCRIPTION",
- 1,
- Integer.MAX_VALUE));
-
- reasons.append(DISABLED_AUTHENTICATION_FAILURE_GENERIC,
- new DisableReasonInfo(
- "NETWORK_SELECTION_DISABLED_AUTHENTICATION_FAILURE_GENERIC",
- 5,
- 5 * 60 * 1000));
-
- reasons.append(DISABLED_AUTHENTICATION_FAILURE_CARRIER_SPECIFIC,
- new DisableReasonInfo(
- "NETWORK_SELECTION_DISABLED_AUTHENTICATION_FAILURE_CARRIER_SPECIFIC",
- 1,
- Integer.MAX_VALUE));
-
- return reasons;
- }
-
- /**
- * Get the {@link NetworkSelectionDisableReason} int code by its string value.
- * @return the NetworkSelectionDisableReason int code corresponding to the reason string,
- * or -1 if the reason string is unrecognized.
- * @hide
- */
- @NetworkSelectionDisableReason
- public static int getDisableReasonByString(@NonNull String reasonString) {
- for (int i = 0; i < DISABLE_REASON_INFOS.size(); i++) {
- int key = DISABLE_REASON_INFOS.keyAt(i);
- DisableReasonInfo value = DISABLE_REASON_INFOS.valueAt(i);
- if (value != null && TextUtils.equals(reasonString, value.mReasonStr)) {
- return key;
- }
- }
- Log.e(TAG, "Unrecognized network disable reason: " + reasonString);
- return -1;
- }
-
- /**
- * Invalid time stamp for network selection disable
- * @hide
- */
- public static final long INVALID_NETWORK_SELECTION_DISABLE_TIMESTAMP = -1L;
-
- /**
- * This constant indicates the current configuration has connect choice set
- */
- private static final int CONNECT_CHOICE_EXISTS = 1;
-
- /**
- * This constant indicates the current configuration does not have connect choice set
- */
- private static final int CONNECT_CHOICE_NOT_EXISTS = -1;
-
- // fields for QualityNetwork Selection
- /**
- * Network selection status, should be in one of three status: enable, temporaily disabled
- * or permanently disabled
- */
- @NetworkEnabledStatus
- private int mStatus;
-
- /**
- * Reason for disable this network
- */
- @NetworkSelectionDisableReason
- private int mNetworkSelectionDisableReason;
-
- /**
- * Last time we temporarily disabled the configuration
- */
- private long mTemporarilyDisabledTimestamp = INVALID_NETWORK_SELECTION_DISABLE_TIMESTAMP;
-
- /**
- * counter for each Network selection disable reason
- */
- private int[] mNetworkSeclectionDisableCounter = new int[NETWORK_SELECTION_DISABLED_MAX];
-
- /**
- * Connect Choice over this configuration
- *
- * When current wifi configuration is visible to the user but user explicitly choose to
- * connect to another network X, the another networks X's configure key will be stored here.
- * We will consider user has a preference of X over this network. And in the future,
- * network selection will always give X a higher preference over this configuration.
- * configKey is : "SSID"-WEP-WPA_PSK-WPA_EAP
- */
- 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
- */
- private ScanResult mCandidate;
-
- /**
- * Used to cache the score of the current temporary candidate during the network
- * selection procedure.
- */
- private int mCandidateScore;
-
- /**
- * Indicate whether this network is visible in latest Qualified Network Selection. This
- * means there is scan result found related to this Configuration and meet the minimum
- * requirement. The saved network need not join latest Qualified Network Selection. For
- * example, it is disabled. True means network is visible in latest Qualified Network
- * Selection and false means network is invisible
- */
- private boolean mSeenInLastQualifiedNetworkSelection;
-
- /**
- * Boolean indicating if we have ever successfully connected to this network.
- *
- * This value will be set to true upon a successful connection.
- * This value will be set to false if a previous value was not stored in the config or if
- * the credentials are updated (ex. a password change).
- */
- private boolean mHasEverConnected;
-
- /**
- * Boolean indicating if captive portal has never been detected on this network.
- *
- * This should be true by default, for newly created WifiConfigurations until a captive
- * portal is detected.
- */
- private boolean mHasNeverDetectedCaptivePortal = true;
-
- /**
- * set whether this network is visible in latest Qualified Network Selection
- * @param seen value set to candidate
- * @hide
- */
- public void setSeenInLastQualifiedNetworkSelection(boolean seen) {
- mSeenInLastQualifiedNetworkSelection = seen;
- }
-
- /**
- * get whether this network is visible in latest Qualified Network Selection
- * @return returns true -- network is visible in latest Qualified Network Selection
- * false -- network is invisible in latest Qualified Network Selection
- * @hide
- */
- public boolean getSeenInLastQualifiedNetworkSelection() {
- return mSeenInLastQualifiedNetworkSelection;
- }
- /**
- * set the temporary candidate of current network selection procedure
- * @param scanCandidate {@link ScanResult} the candidate set to mCandidate
- * @hide
- */
- public void setCandidate(ScanResult scanCandidate) {
- mCandidate = scanCandidate;
- }
-
- /**
- * get the temporary candidate of current network selection procedure
- * @return returns {@link ScanResult} temporary candidate of current network selection
- * procedure
- * @hide
- */
- public ScanResult getCandidate() {
- return mCandidate;
- }
-
- /**
- * set the score of the temporary candidate of current network selection procedure
- * @param score value set to mCandidateScore
- * @hide
- */
- public void setCandidateScore(int score) {
- mCandidateScore = score;
- }
-
- /**
- * get the score of the temporary candidate of current network selection procedure
- * @return returns score of the temporary candidate of current network selection procedure
- * @hide
- */
- public int getCandidateScore() {
- return mCandidateScore;
- }
-
- /**
- * get user preferred choice over this configuration
- * @return returns configKey of user preferred choice over this configuration
- * @hide
- */
- public String getConnectChoice() {
- return mConnectChoice;
- }
-
- /**
- * set user preferred choice over this configuration
- * @param newConnectChoice, the configKey of user preferred choice over this configuration
- * @hide
- */
- public void setConnectChoice(String newConnectChoice) {
- 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() {
- return QUALITY_NETWORK_SELECTION_STATUS[mStatus];
- }
-
- /** @hide */
- public void setHasEverConnected(boolean value) {
- mHasEverConnected = value;
- }
-
- /** True if the device has ever connected to this network, false otherwise. */
- public boolean hasEverConnected() {
- return mHasEverConnected;
- }
-
- /**
- * Set whether a captive portal has never been detected on this network.
- * @hide
- */
- public void setHasNeverDetectedCaptivePortal(boolean value) {
- mHasNeverDetectedCaptivePortal = value;
- }
-
- /** @hide */
- public boolean hasNeverDetectedCaptivePortal() {
- return mHasNeverDetectedCaptivePortal;
- }
-
- /** @hide */
- public NetworkSelectionStatus() {
- // previously stored configs will not have this parameter, so we default to false.
- mHasEverConnected = false;
- }
-
- /**
- * NetworkSelectionStatus exports an immutable public API.
- * However, test code has a need to construct a NetworkSelectionStatus in a specific state.
- * (Note that mocking using Mockito does not work if the object needs to be parceled and
- * unparceled.)
- * Export a @SystemApi Builder to allow tests to construct a NetworkSelectionStatus object
- * in the desired state, without sacrificing NetworkSelectionStatus's immutability.
- */
- @VisibleForTesting
- public static final class Builder {
- private final NetworkSelectionStatus mNetworkSelectionStatus =
- new NetworkSelectionStatus();
-
- /**
- * Set the current network selection status.
- * One of:
- * {@link #NETWORK_SELECTION_ENABLED},
- * {@link #NETWORK_SELECTION_TEMPORARY_DISABLED},
- * {@link #NETWORK_SELECTION_PERMANENTLY_DISABLED}
- * @see NetworkSelectionStatus#getNetworkSelectionStatus()
- */
- @NonNull
- public Builder setNetworkSelectionStatus(@NetworkEnabledStatus int status) {
- mNetworkSelectionStatus.setNetworkSelectionStatus(status);
- return this;
- }
-
- /**
- *
- * Set the current network's disable reason.
- * One of the {@link #DISABLED_NONE} or DISABLED_* constants.
- * e.g. {@link #DISABLED_ASSOCIATION_REJECTION}.
- * @see NetworkSelectionStatus#getNetworkSelectionDisableReason()
- */
- @NonNull
- public Builder setNetworkSelectionDisableReason(
- @NetworkSelectionDisableReason int reason) {
- mNetworkSelectionStatus.setNetworkSelectionDisableReason(reason);
- return this;
- }
-
- /**
- * Build a NetworkSelectionStatus object.
- */
- @NonNull
- public NetworkSelectionStatus build() {
- NetworkSelectionStatus status = new NetworkSelectionStatus();
- status.copy(mNetworkSelectionStatus);
- return status;
- }
- }
-
- /**
- * Get the network disable reason string for a reason code (for debugging).
- * @param reason specific error reason. One of the {@link #DISABLED_NONE} or
- * DISABLED_* constants e.g. {@link #DISABLED_ASSOCIATION_REJECTION}.
- * @return network disable reason string, or null if the reason is invalid.
- */
- @Nullable
- public static String getNetworkSelectionDisableReasonString(
- @NetworkSelectionDisableReason int reason) {
- DisableReasonInfo info = DISABLE_REASON_INFOS.get(reason);
- if (info == null) {
- return null;
- } else {
- return info.mReasonStr;
- }
- }
- /**
- * get current network disable reason
- * @return current network disable reason in String (for debug purpose)
- * @hide
- */
- public String getNetworkSelectionDisableReasonString() {
- return getNetworkSelectionDisableReasonString(mNetworkSelectionDisableReason);
- }
-
- /**
- * Get the current network network selection status.
- * One of:
- * {@link #NETWORK_SELECTION_ENABLED},
- * {@link #NETWORK_SELECTION_TEMPORARY_DISABLED},
- * {@link #NETWORK_SELECTION_PERMANENTLY_DISABLED}
- */
- @NetworkEnabledStatus
- public int getNetworkSelectionStatus() {
- return mStatus;
- }
-
- /**
- * True if the current network is enabled to join network selection, false otherwise.
- * @hide
- */
- public boolean isNetworkEnabled() {
- return mStatus == NETWORK_SELECTION_ENABLED;
- }
-
- /**
- * @return whether current network is temporary disabled
- * @hide
- */
- public boolean isNetworkTemporaryDisabled() {
- return mStatus == NETWORK_SELECTION_TEMPORARY_DISABLED;
- }
-
- /**
- * True if the current network is permanently disabled, false otherwise.
- * @hide
- */
- public boolean isNetworkPermanentlyDisabled() {
- return mStatus == NETWORK_SELECTION_PERMANENTLY_DISABLED;
- }
-
- /**
- * set current network selection status
- * @param status network selection status to set
- * @hide
- */
- public void setNetworkSelectionStatus(int status) {
- if (status >= 0 && status < NETWORK_SELECTION_STATUS_MAX) {
- mStatus = status;
- }
- }
-
- /**
- * Returns the current network's disable reason.
- * One of the {@link #DISABLED_NONE} or DISABLED_* constants
- * e.g. {@link #DISABLED_ASSOCIATION_REJECTION}.
- */
- @NetworkSelectionDisableReason
- public int getNetworkSelectionDisableReason() {
- return mNetworkSelectionDisableReason;
- }
-
- /**
- * set Network disable reason
- * @param reason Network disable reason
- * @hide
- */
- public void setNetworkSelectionDisableReason(@NetworkSelectionDisableReason int reason) {
- if (reason >= 0 && reason < NETWORK_SELECTION_DISABLED_MAX) {
- mNetworkSelectionDisableReason = reason;
- } else {
- throw new IllegalArgumentException("Illegal reason value: " + reason);
- }
- }
-
- /**
- * @param timeStamp Set when current network is disabled in millisecond since January 1,
- * 1970 00:00:00.0 UTC
- * @hide
- */
- public void setDisableTime(long timeStamp) {
- mTemporarilyDisabledTimestamp = timeStamp;
- }
-
- /**
- * Returns when the current network was disabled, in milliseconds since January 1,
- * 1970 00:00:00.0 UTC.
- */
- public long getDisableTime() {
- return mTemporarilyDisabledTimestamp;
- }
-
- /**
- * Get the disable counter of a specific reason.
- * @param reason specific failure reason. One of the {@link #DISABLED_NONE} or
- * DISABLED_* constants e.g. {@link #DISABLED_ASSOCIATION_REJECTION}.
- * @exception IllegalArgumentException for invalid reason
- * @return counter number for specific error reason.
- */
- public int getDisableReasonCounter(@NetworkSelectionDisableReason int reason) {
- if (reason >= DISABLED_NONE && reason < NETWORK_SELECTION_DISABLED_MAX) {
- return mNetworkSeclectionDisableCounter[reason];
- } else {
- throw new IllegalArgumentException("Illegal reason value: " + reason);
- }
- }
-
- /**
- * set the counter of a specific failure reason
- * @param reason reason for disable error
- * @param value the counter value for this specific reason
- * @exception throw IllegalArgumentException for illegal input
- * @hide
- */
- public void setDisableReasonCounter(int reason, int value) {
- if (reason >= DISABLED_NONE && reason < NETWORK_SELECTION_DISABLED_MAX) {
- mNetworkSeclectionDisableCounter[reason] = value;
- } else {
- throw new IllegalArgumentException("Illegal reason value: " + reason);
- }
- }
-
- /**
- * increment the counter of a specific failure reason
- * @param reason a specific failure reason
- * @exception throw IllegalArgumentException for illegal input
- * @hide
- */
- public void incrementDisableReasonCounter(int reason) {
- if (reason >= DISABLED_NONE && reason < NETWORK_SELECTION_DISABLED_MAX) {
- mNetworkSeclectionDisableCounter[reason]++;
- } else {
- throw new IllegalArgumentException("Illegal reason value: " + reason);
- }
- }
-
- /**
- * clear the counter of a specific failure reason
- * @param reason a specific failure reason
- * @exception throw IllegalArgumentException for illegal input
- * @hide
- */
- public void clearDisableReasonCounter(int reason) {
- if (reason >= DISABLED_NONE && reason < NETWORK_SELECTION_DISABLED_MAX) {
- mNetworkSeclectionDisableCounter[reason] = DISABLED_NONE;
- } else {
- throw new IllegalArgumentException("Illegal reason value: " + reason);
- }
- }
-
- /**
- * clear all the failure reason counters
- * @hide
- */
- public void clearDisableReasonCounter() {
- Arrays.fill(mNetworkSeclectionDisableCounter, DISABLED_NONE);
- }
-
- /**
- * BSSID for connection to this network (through network selection procedure)
- */
- private String mNetworkSelectionBSSID;
-
- /**
- * get current network Selection BSSID
- * @return current network Selection BSSID
- * @hide
- */
- public String getNetworkSelectionBSSID() {
- return mNetworkSelectionBSSID;
- }
-
- /**
- * set network Selection BSSID
- * @param bssid The target BSSID for assocaition
- * @hide
- */
- public void setNetworkSelectionBSSID(String bssid) {
- mNetworkSelectionBSSID = bssid;
- }
-
- /** @hide */
- public void copy(NetworkSelectionStatus source) {
- mStatus = source.mStatus;
- mNetworkSelectionDisableReason = source.mNetworkSelectionDisableReason;
- for (int index = DISABLED_NONE; index < NETWORK_SELECTION_DISABLED_MAX;
- index++) {
- mNetworkSeclectionDisableCounter[index] =
- source.mNetworkSeclectionDisableCounter[index];
- }
- mTemporarilyDisabledTimestamp = source.mTemporarilyDisabledTimestamp;
- mNetworkSelectionBSSID = source.mNetworkSelectionBSSID;
- setSeenInLastQualifiedNetworkSelection(source.getSeenInLastQualifiedNetworkSelection());
- setCandidate(source.getCandidate());
- setCandidateScore(source.getCandidateScore());
- setConnectChoice(source.getConnectChoice());
- setConnectChoiceRssi(source.getConnectChoiceRssi());
- setHasEverConnected(source.hasEverConnected());
- setHasNeverDetectedCaptivePortal(source.hasNeverDetectedCaptivePortal());
- }
-
- /** @hide */
- public void writeToParcel(Parcel dest) {
- dest.writeInt(getNetworkSelectionStatus());
- dest.writeInt(getNetworkSelectionDisableReason());
- for (int index = DISABLED_NONE; index < NETWORK_SELECTION_DISABLED_MAX;
- index++) {
- dest.writeInt(getDisableReasonCounter(index));
- }
- dest.writeLong(getDisableTime());
- dest.writeString(getNetworkSelectionBSSID());
- if (getConnectChoice() != null) {
- dest.writeInt(CONNECT_CHOICE_EXISTS);
- dest.writeString(getConnectChoice());
- dest.writeInt(getConnectChoiceRssi());
- } else {
- dest.writeInt(CONNECT_CHOICE_NOT_EXISTS);
- }
- dest.writeInt(hasEverConnected() ? 1 : 0);
- dest.writeInt(hasNeverDetectedCaptivePortal() ? 1 : 0);
- }
-
- /** @hide */
- public void readFromParcel(Parcel in) {
- setNetworkSelectionStatus(in.readInt());
- setNetworkSelectionDisableReason(in.readInt());
- for (int index = DISABLED_NONE; index < NETWORK_SELECTION_DISABLED_MAX;
- index++) {
- setDisableReasonCounter(index, in.readInt());
- }
- setDisableTime(in.readLong());
- setNetworkSelectionBSSID(in.readString());
- if (in.readInt() == CONNECT_CHOICE_EXISTS) {
- setConnectChoice(in.readString());
- setConnectChoiceRssi(in.readInt());
- } else {
- setConnectChoice(null);
- }
- setHasEverConnected(in.readInt() != 0);
- setHasNeverDetectedCaptivePortal(in.readInt() != 0);
- }
- }
-
- /**
- * @hide
- * network selection related member
- */
- private NetworkSelectionStatus mNetworkSelectionStatus = new NetworkSelectionStatus();
-
- /**
- * This class is intended to store extra failure reason information for the most recent
- * connection attempt, so that it may be surfaced to the settings UI
- * @hide
- */
- // TODO(b/148626966): called by SUW via reflection, remove once SUW is updated
- public static class RecentFailure {
-
- private RecentFailure() {}
-
- /**
- * Association Rejection Status code (NONE for success/non-association-rejection-fail)
- */
- @RecentFailureReason
- private int mAssociationStatus = RECENT_FAILURE_NONE;
- private long mLastUpdateTimeSinceBootMillis;
-
- /**
- * @param status the association status code for the recent failure
- */
- public void setAssociationStatus(@RecentFailureReason int status,
- long updateTimeSinceBootMs) {
- mAssociationStatus = status;
- mLastUpdateTimeSinceBootMillis = updateTimeSinceBootMs;
- }
- /**
- * Sets the RecentFailure to NONE
- */
- public void clear() {
- mAssociationStatus = RECENT_FAILURE_NONE;
- mLastUpdateTimeSinceBootMillis = 0;
- }
- /**
- * Get the recent failure code. One of {@link #RECENT_FAILURE_NONE},
- * {@link #RECENT_FAILURE_AP_UNABLE_TO_HANDLE_NEW_STA},
- * {@link #RECENT_FAILURE_MBO_OCE_DISCONNECT},
- * {@link #RECENT_FAILURE_REFUSED_TEMPORARILY},
- * {@link #RECENT_FAILURE_POOR_CHANNEL_CONDITIONS}.
- * {@link #RECENT_FAILURE_DISCONNECTION_AP_BUSY}
- */
- @RecentFailureReason
- public int getAssociationStatus() {
- return mAssociationStatus;
- }
-
- /**
- * Get the timestamp the failure status is last updated, in milliseconds since boot.
- */
- public long getLastUpdateTimeSinceBootMillis() {
- return mLastUpdateTimeSinceBootMillis;
- }
- }
-
- /**
- * RecentFailure member
- * @hide
- */
- // TODO(b/148626966): called by SUW via reflection, once SUW is updated, make private and
- // rename to mRecentFailure
- @NonNull
- public final RecentFailure recentFailure = new RecentFailure();
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = "RECENT_FAILURE_", value = {
- RECENT_FAILURE_NONE,
- RECENT_FAILURE_AP_UNABLE_TO_HANDLE_NEW_STA,
- RECENT_FAILURE_MBO_OCE_DISCONNECT,
- RECENT_FAILURE_REFUSED_TEMPORARILY,
- RECENT_FAILURE_POOR_CHANNEL_CONDITIONS,
- RECENT_FAILURE_DISCONNECTION_AP_BUSY
- })
- public @interface RecentFailureReason {}
-
- /**
- * No recent failure, or no specific reason given for the recent connection failure
- * @hide
- */
- @SystemApi
- public static final int RECENT_FAILURE_NONE = 0;
- /**
- * Connection to this network recently failed due to Association Rejection Status 17
- * (AP is full)
- * @hide
- */
- @SystemApi
- public static final int RECENT_FAILURE_AP_UNABLE_TO_HANDLE_NEW_STA = 17;
-
- /**
- * This network recently disconnected as a result of MBO/OCE.
- * @hide
- */
- @SystemApi
- public static final int RECENT_FAILURE_MBO_OCE_DISCONNECT = 1001;
-
- /**
- * Failed to connect because the association is rejected by the AP.
- * IEEE 802.11 association status code 30.
- * @hide
- */
- @SystemApi
- public static final int RECENT_FAILURE_REFUSED_TEMPORARILY = 1002;
-
- /**
- * Failed to connect because of excess frame loss and/or poor channel conditions.
- * IEEE 802.11 association status code 34.
- * @hide
- */
- @SystemApi
- public static final int RECENT_FAILURE_POOR_CHANNEL_CONDITIONS = 1003;
-
- /**
- * Disconnected by the AP because the AP can't handle all the associated stations.
- * IEEE 802.11 disconnection reason code 5.
- * @hide
- */
- @SystemApi
- public static final int RECENT_FAILURE_DISCONNECTION_AP_BUSY = 1004;
-
- /**
- * Get the failure reason for the most recent connection attempt, or
- * {@link #RECENT_FAILURE_NONE} if there was no failure.
- *
- * Failure reasons include:
- * {@link #RECENT_FAILURE_AP_UNABLE_TO_HANDLE_NEW_STA}
- * {@link #RECENT_FAILURE_MBO_OCE_DISCONNECT}
- * {@link #RECENT_FAILURE_REFUSED_TEMPORARILY}
- * {@link #RECENT_FAILURE_POOR_CHANNEL_CONDITIONS}
- * {@link #RECENT_FAILURE_DISCONNECTION_AP_BUSY}
- * @hide
- */
- @RecentFailureReason
- @SystemApi
- public int getRecentFailureReason() {
- return recentFailure.getAssociationStatus();
- }
-
- /**
- * Get the network selection status.
- * @hide
- */
- @NonNull
- @SystemApi
- public NetworkSelectionStatus getNetworkSelectionStatus() {
- return mNetworkSelectionStatus;
- }
-
- /**
- * Set the network selection status.
- * @hide
- */
- @SystemApi
- public void setNetworkSelectionStatus(@NonNull NetworkSelectionStatus status) {
- mNetworkSelectionStatus = status;
- }
-
- /**
- * @hide
- * Linked Configurations: represent the set of Wificonfigurations that are equivalent
- * regarding roaming and auto-joining.
- * The linked configuration may or may not have same SSID, and may or may not have same
- * credentials.
- * For instance, linked configurations will have same defaultGwMacAddress or same dhcp server.
- */
- public HashMap<String, Integer> linkedConfigurations;
-
- public WifiConfiguration() {
- networkId = INVALID_NETWORK_ID;
- SSID = null;
- BSSID = null;
- FQDN = null;
- roamingConsortiumIds = new long[0];
- priority = 0;
- hiddenSSID = false;
- allowedKeyManagement = new BitSet();
- allowedProtocols = new BitSet();
- allowedAuthAlgorithms = new BitSet();
- allowedPairwiseCiphers = new BitSet();
- allowedGroupCiphers = new BitSet();
- allowedGroupManagementCiphers = new BitSet();
- allowedSuiteBCiphers = new BitSet();
- wepKeys = new String[4];
- for (int i = 0; i < wepKeys.length; i++) {
- wepKeys[i] = null;
- }
- enterpriseConfig = new WifiEnterpriseConfig();
- ephemeral = false;
- osu = false;
- trusted = true; // Networks are considered trusted by default.
- oemPaid = false;
- oemPrivate = false;
- carrierMerged = false;
- fromWifiNetworkSuggestion = false;
- fromWifiNetworkSpecifier = false;
- meteredHint = false;
- meteredOverride = METERED_OVERRIDE_NONE;
- useExternalScores = false;
- validatedInternetAccess = false;
- mIpConfiguration = new IpConfiguration();
- lastUpdateUid = -1;
- creatorUid = -1;
- shared = true;
- dtimInterval = 0;
- mRandomizedMacAddress = MacAddress.fromString(WifiInfo.DEFAULT_MAC_ADDRESS);
- }
-
- /**
- * Identify if this configuration represents a Passpoint network
- */
- public boolean isPasspoint() {
- return !TextUtils.isEmpty(FQDN)
- && !TextUtils.isEmpty(providerFriendlyName)
- && enterpriseConfig != null
- && enterpriseConfig.getEapMethod() != WifiEnterpriseConfig.Eap.NONE
- && !TextUtils.isEmpty(mPasspointUniqueId);
- }
-
- /**
- * Helper function, identify if a configuration is linked
- * @hide
- */
- public boolean isLinked(WifiConfiguration config) {
- if (config != null) {
- if (config.linkedConfigurations != null && linkedConfigurations != null) {
- if (config.linkedConfigurations.get(getKey()) != null
- && linkedConfigurations.get(config.getKey()) != null) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Helper function, idenfity if a configuration should be treated as an enterprise network
- * @hide
- */
- @UnsupportedAppUsage
- public boolean isEnterprise() {
- boolean hasEnterpriseSecurityType = mSecurityParamsList.stream()
- .anyMatch(params -> params.isEnterpriseSecurityType());
- return (hasEnterpriseSecurityType
- && enterpriseConfig != null
- && enterpriseConfig.getEapMethod() != WifiEnterpriseConfig.Eap.NONE);
- }
-
- private static String logTimeOfDay(long millis) {
- Calendar c = Calendar.getInstance();
- if (millis >= 0) {
- c.setTimeInMillis(millis);
- return String.format("%tm-%td %tH:%tM:%tS.%tL", c, c, c, c, c, c);
- } else {
- return Long.toString(millis);
- }
- }
-
- @Override
- public String toString() {
- StringBuilder sbuf = new StringBuilder();
- if (this.status == WifiConfiguration.Status.CURRENT) {
- sbuf.append("* ");
- } else if (this.status == WifiConfiguration.Status.DISABLED) {
- sbuf.append("- DSBLE ");
- }
- sbuf.append("ID: ").append(this.networkId).append(" SSID: ").append(this.SSID).
- append(" PROVIDER-NAME: ").append(this.providerFriendlyName).
- append(" BSSID: ").append(this.BSSID).append(" FQDN: ").append(this.FQDN)
- .append(" HOME-PROVIDER-NETWORK: ").append(this.isHomeProviderNetwork)
- .append(" PRIO: ").append(this.priority)
- .append(" HIDDEN: ").append(this.hiddenSSID)
- .append(" PMF: ").append(this.requirePmf)
- .append("CarrierId: ").append(this.carrierId)
- .append('\n');
-
-
- sbuf.append(" NetworkSelectionStatus ")
- .append(mNetworkSelectionStatus.getNetworkStatusString())
- .append("\n");
- if (mNetworkSelectionStatus.getNetworkSelectionDisableReason() > 0) {
- sbuf.append(" mNetworkSelectionDisableReason ")
- .append(mNetworkSelectionStatus.getNetworkSelectionDisableReasonString())
- .append("\n");
-
- for (int index = NetworkSelectionStatus.DISABLED_NONE;
- index < NetworkSelectionStatus.NETWORK_SELECTION_DISABLED_MAX; index++) {
- if (mNetworkSelectionStatus.getDisableReasonCounter(index) != 0) {
- sbuf.append(
- NetworkSelectionStatus.getNetworkSelectionDisableReasonString(index))
- .append(" counter:")
- .append(mNetworkSelectionStatus.getDisableReasonCounter(index))
- .append("\n");
- }
- }
- }
- 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");
- sbuf.append(" hasNeverDetectedCaptivePortal: ")
- .append(mNetworkSelectionStatus.hasNeverDetectedCaptivePortal()).append("\n");
-
- if (this.numAssociation > 0) {
- sbuf.append(" numAssociation ").append(this.numAssociation).append("\n");
- }
- if (this.numNoInternetAccessReports > 0) {
- sbuf.append(" numNoInternetAccessReports ");
- sbuf.append(this.numNoInternetAccessReports).append("\n");
- }
- if (this.validatedInternetAccess) sbuf.append(" validatedInternetAccess");
- if (this.ephemeral) sbuf.append(" ephemeral");
- if (this.osu) sbuf.append(" osu");
- if (this.trusted) sbuf.append(" trusted");
- if (this.oemPaid) sbuf.append(" oemPaid");
- if (this.oemPrivate) sbuf.append(" oemPrivate");
- if (this.carrierMerged) sbuf.append(" carrierMerged");
- if (this.fromWifiNetworkSuggestion) sbuf.append(" fromWifiNetworkSuggestion");
- if (this.fromWifiNetworkSpecifier) sbuf.append(" fromWifiNetworkSpecifier");
- if (this.meteredHint) sbuf.append(" meteredHint");
- if (this.useExternalScores) sbuf.append(" useExternalScores");
- if (this.validatedInternetAccess || this.ephemeral || this.trusted || this.oemPaid
- || this.oemPrivate || this.carrierMerged || this.fromWifiNetworkSuggestion
- || this.fromWifiNetworkSpecifier || this.meteredHint || this.useExternalScores) {
- sbuf.append("\n");
- }
- if (this.meteredOverride != METERED_OVERRIDE_NONE) {
- sbuf.append(" meteredOverride ").append(meteredOverride).append("\n");
- }
- sbuf.append(" macRandomizationSetting: ").append(macRandomizationSetting).append("\n");
- sbuf.append(" mRandomizedMacAddress: ").append(mRandomizedMacAddress).append("\n");
- sbuf.append(" randomizedMacExpirationTimeMs: ")
- .append(randomizedMacExpirationTimeMs == 0 ? "<none>"
- : logTimeOfDay(randomizedMacExpirationTimeMs)).append("\n");
- sbuf.append(" randomizedMacLastModifiedTimeMs: ")
- .append(randomizedMacLastModifiedTimeMs == 0 ? "<none>"
- : logTimeOfDay(randomizedMacLastModifiedTimeMs)).append("\n");
- sbuf.append(" KeyMgmt:");
- for (int k = 0; k < this.allowedKeyManagement.size(); k++) {
- if (this.allowedKeyManagement.get(k)) {
- sbuf.append(" ");
- if (k < KeyMgmt.strings.length) {
- sbuf.append(KeyMgmt.strings[k]);
- } else {
- sbuf.append("??");
- }
- }
- }
- sbuf.append(" Protocols:");
- for (int p = 0; p < this.allowedProtocols.size(); p++) {
- if (this.allowedProtocols.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 < this.allowedAuthAlgorithms.size(); a++) {
- if (this.allowedAuthAlgorithms.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 < this.allowedPairwiseCiphers.size(); pc++) {
- if (this.allowedPairwiseCiphers.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 < this.allowedGroupCiphers.size(); gc++) {
- if (this.allowedGroupCiphers.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 < this.allowedGroupManagementCiphers.size(); gmc++) {
- if (this.allowedGroupManagementCiphers.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 < this.allowedSuiteBCiphers.size(); sbc++) {
- if (this.allowedSuiteBCiphers.get(sbc)) {
- sbuf.append(" ");
- if (sbc < SuiteBCipher.strings.length) {
- sbuf.append(SuiteBCipher.strings[sbc]);
- } else {
- sbuf.append("??");
- }
- }
- }
- sbuf.append('\n').append(" PSK/SAE: ");
- if (this.preSharedKey != null) {
- sbuf.append('*');
- }
-
- sbuf.append("\nSecurityParams List:\n");
- mSecurityParamsList.stream()
- .forEach(params -> sbuf.append(params.toString()));
-
- sbuf.append("\nEnterprise config:\n");
- sbuf.append(enterpriseConfig);
-
- sbuf.append("IP config:\n");
- sbuf.append(mIpConfiguration.toString());
-
- if (mNetworkSelectionStatus.getNetworkSelectionBSSID() != null) {
- sbuf.append(" networkSelectionBSSID="
- + mNetworkSelectionStatus.getNetworkSelectionBSSID());
- }
- long now_ms = SystemClock.elapsedRealtime();
- if (mNetworkSelectionStatus.getDisableTime() != NetworkSelectionStatus
- .INVALID_NETWORK_SELECTION_DISABLE_TIMESTAMP) {
- sbuf.append('\n');
- long diff = now_ms - mNetworkSelectionStatus.getDisableTime();
- if (diff <= 0) {
- sbuf.append(" blackListed since <incorrect>");
- } else {
- sbuf.append(" blackListed: ").append(Long.toString(diff / 1000)).append("sec ");
- }
- }
- if (creatorUid != 0) sbuf.append(" cuid=" + creatorUid);
- if (creatorName != null) sbuf.append(" cname=" + creatorName);
- if (lastUpdateUid != 0) sbuf.append(" luid=" + lastUpdateUid);
- if (lastUpdateName != null) sbuf.append(" lname=" + lastUpdateName);
- if (updateIdentifier != null) sbuf.append(" updateIdentifier=" + updateIdentifier);
- sbuf.append(" lcuid=" + lastConnectUid);
- sbuf.append(" allowAutojoin=" + allowAutojoin);
- sbuf.append(" noInternetAccessExpected=" + noInternetAccessExpected);
- sbuf.append(" mostRecentlyConnected=" + isMostRecentlyConnected);
-
- sbuf.append(" ");
-
- if (this.lastConnected != 0) {
- sbuf.append('\n');
- sbuf.append("lastConnected: ").append(logTimeOfDay(this.lastConnected));
- sbuf.append(" ");
- }
- sbuf.append('\n');
- if (this.linkedConfigurations != null) {
- for (String key : this.linkedConfigurations.keySet()) {
- sbuf.append(" linked: ").append(key);
- sbuf.append('\n');
- }
- }
- sbuf.append("recentFailure: ").append("Association Rejection code: ")
- .append(recentFailure.getAssociationStatus()).append(", last update time: ")
- .append(recentFailure.getLastUpdateTimeSinceBootMillis()).append("\n");
- return sbuf.toString();
- }
-
- /**
- * Get the SSID in a human-readable format, with all additional formatting removed
- * e.g. quotation marks around the SSID, "P" prefix
- * @hide
- */
- @NonNull
- @SystemApi
- public String getPrintableSsid() {
- if (SSID == null) return "";
- final int length = SSID.length();
- if (length > 2 && (SSID.charAt(0) == '"') && SSID.charAt(length - 1) == '"') {
- return SSID.substring(1, length - 1);
- }
-
- /* The ascii-encoded string format is P"<ascii-encoded-string>"
- * The decoding is implemented in the supplicant for a newly configured
- * network.
- */
- if (length > 3 && (SSID.charAt(0) == 'P') && (SSID.charAt(1) == '"') &&
- (SSID.charAt(length-1) == '"')) {
- WifiSsid wifiSsid = WifiSsid.createFromAsciiEncoded(
- SSID.substring(2, length - 1));
- return wifiSsid.toString();
- }
- return SSID;
- }
-
- /**
- * Get an identifier for associating credentials with this config
- * @param current configuration contains values for additional fields
- * that are not part of this configuration. Used
- * when a config with some fields is passed by an application.
- * @throws IllegalStateException if config is invalid for key id generation
- * @hide
- */
- public String getKeyIdForCredentials(WifiConfiguration current) {
- String keyMgmt = "";
-
- try {
- // Get current config details for fields that are not initialized
- if (TextUtils.isEmpty(SSID)) SSID = current.SSID;
- if (allowedKeyManagement.cardinality() == 0) {
- allowedKeyManagement = current.allowedKeyManagement;
- }
- if (allowedKeyManagement.get(KeyMgmt.WPA_EAP)) {
- keyMgmt += KeyMgmt.strings[KeyMgmt.WPA_EAP];
- }
- if (allowedKeyManagement.get(KeyMgmt.OSEN)) {
- keyMgmt += KeyMgmt.strings[KeyMgmt.OSEN];
- }
- if (allowedKeyManagement.get(KeyMgmt.IEEE8021X)) {
- keyMgmt += KeyMgmt.strings[KeyMgmt.IEEE8021X];
- }
- if (allowedKeyManagement.get(KeyMgmt.SUITE_B_192)) {
- keyMgmt += KeyMgmt.strings[KeyMgmt.SUITE_B_192];
- }
- if (allowedKeyManagement.get(KeyMgmt.WAPI_CERT)) {
- keyMgmt += KeyMgmt.strings[KeyMgmt.WAPI_CERT];
- }
-
- if (TextUtils.isEmpty(keyMgmt)) {
- throw new IllegalStateException("Not an EAP network");
- }
- String keyId = trimStringForKeyId(SSID) + "_" + keyMgmt + "_"
- + trimStringForKeyId(enterpriseConfig.getKeyId(current != null
- ? current.enterpriseConfig : null));
-
- if (!fromWifiNetworkSuggestion) {
- return keyId;
- }
- return keyId + "_" + trimStringForKeyId(BSSID) + "_" + trimStringForKeyId(creatorName);
- } catch (NullPointerException e) {
- throw new IllegalStateException("Invalid config details");
- }
- }
-
- private String trimStringForKeyId(String string) {
- if (string == null) {
- return "";
- }
- // Remove quotes and spaces
- return string.replace("\"", "").replace(" ", "");
- }
-
- 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);
- }
- }
-
- /**
- * Get the authentication type of the network.
- * @return One of the {@link KeyMgmt} constants. e.g. {@link KeyMgmt#WPA2_PSK}.
- * @hide
- */
- @SystemApi
- @KeyMgmt.KeyMgmtScheme
- public int getAuthType() {
- if (allowedKeyManagement.cardinality() > 1) {
- if (allowedKeyManagement.get(KeyMgmt.WPA_EAP)) {
- if (allowedKeyManagement.cardinality() == 2
- && allowedKeyManagement.get(KeyMgmt.IEEE8021X)) {
- return KeyMgmt.WPA_EAP;
- }
- if (allowedKeyManagement.cardinality() == 3
- && allowedKeyManagement.get(KeyMgmt.IEEE8021X)
- && allowedKeyManagement.get(KeyMgmt.SUITE_B_192)) {
- return KeyMgmt.SUITE_B_192;
- }
- }
- throw new IllegalStateException("Invalid auth type set: " + allowedKeyManagement);
- }
- if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) {
- return KeyMgmt.WPA_PSK;
- } else if (allowedKeyManagement.get(KeyMgmt.WPA2_PSK)) {
- return KeyMgmt.WPA2_PSK;
- } else if (allowedKeyManagement.get(KeyMgmt.WPA_EAP)) {
- return KeyMgmt.WPA_EAP;
- } else if (allowedKeyManagement.get(KeyMgmt.IEEE8021X)) {
- return KeyMgmt.IEEE8021X;
- } else if (allowedKeyManagement.get(KeyMgmt.SAE)) {
- return KeyMgmt.SAE;
- } else if (allowedKeyManagement.get(KeyMgmt.OWE)) {
- return KeyMgmt.OWE;
- } else if (allowedKeyManagement.get(KeyMgmt.SUITE_B_192)) {
- return KeyMgmt.SUITE_B_192;
- } else if (allowedKeyManagement.get(KeyMgmt.WAPI_PSK)) {
- return KeyMgmt.WAPI_PSK;
- } else if (allowedKeyManagement.get(KeyMgmt.WAPI_CERT)) {
- return KeyMgmt.WAPI_CERT;
- }
- return KeyMgmt.NONE;
- }
-
- /**
- * Return a String that can be used to uniquely identify this WifiConfiguration.
- * <br />
- * Note: Do not persist this value! This value is not guaranteed to remain backwards compatible.
- */
- @NonNull
- public String getKey() {
- // Passpoint ephemeral networks have their unique identifier set. Return it as is to be
- // able to match internally.
- if (mPasspointUniqueId != null) {
- return mPasspointUniqueId;
- }
-
- String key = getSsidAndSecurityTypeString();
- if (!shared) {
- key += "-" + UserHandle.getUserHandleForUid(creatorUid).getIdentifier();
- }
-
- return key;
- }
-
- /**
- * Get a unique key which represent this Wi-Fi network. If two profiles are for
- * the same Wi-Fi network, but from different provider, they would have the same key.
- * @hide
- */
- public String getNetworkKey() {
- // Passpoint ephemeral networks have their unique identifier set. Return it as is to be
- // able to match internally.
- if (mPasspointUniqueId != null) {
- return mPasspointUniqueId;
- }
-
- String key = SSID + getDefaultSecurityType();
- if (!shared) {
- key += "-" + UserHandle.getUserHandleForUid(creatorUid).getIdentifier();
- }
-
- return key;
- }
-
- /** @hide
- * return the SSID + security type in String format.
- */
- public String getSsidAndSecurityTypeString() {
- String key;
- if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) {
- key = SSID + KeyMgmt.strings[KeyMgmt.WPA_PSK];
- } else if (allowedKeyManagement.get(KeyMgmt.WPA_EAP)
- || allowedKeyManagement.get(KeyMgmt.IEEE8021X)) {
- key = SSID + KeyMgmt.strings[KeyMgmt.WPA_EAP];
- } else if (wepTxKeyIndex >= 0 && wepTxKeyIndex < wepKeys.length
- && wepKeys[wepTxKeyIndex] != null) {
- key = SSID + "WEP";
- } else if (allowedKeyManagement.get(KeyMgmt.OWE)) {
- key = SSID + KeyMgmt.strings[KeyMgmt.OWE];
- } else if (allowedKeyManagement.get(KeyMgmt.SAE)) {
- key = SSID + KeyMgmt.strings[KeyMgmt.SAE];
- } else if (allowedKeyManagement.get(KeyMgmt.SUITE_B_192)) {
- key = SSID + KeyMgmt.strings[KeyMgmt.SUITE_B_192];
- } else if (allowedKeyManagement.get(KeyMgmt.WAPI_PSK)) {
- key = SSID + KeyMgmt.strings[KeyMgmt.WAPI_PSK];
- } else if (allowedKeyManagement.get(KeyMgmt.WAPI_CERT)) {
- key = SSID + KeyMgmt.strings[KeyMgmt.WAPI_CERT];
- } else if (allowedKeyManagement.get(KeyMgmt.OSEN)) {
- key = SSID + KeyMgmt.strings[KeyMgmt.OSEN];
- } else {
- key = SSID + KeyMgmt.strings[KeyMgmt.NONE];
- }
- return key;
- }
-
- /**
- * Get the IpConfiguration object associated with this WifiConfiguration.
- * @hide
- */
- @NonNull
- @SystemApi
- public IpConfiguration getIpConfiguration() {
- return new IpConfiguration(mIpConfiguration);
- }
-
- /**
- * Set the {@link IpConfiguration} for this network.
- * @param ipConfiguration the {@link IpConfiguration} to set, or null to use the default
- * constructor {@link IpConfiguration#IpConfiguration()}.
- * @hide
- */
- @SystemApi
- public void setIpConfiguration(@Nullable IpConfiguration ipConfiguration) {
- if (ipConfiguration == null) ipConfiguration = new IpConfiguration();
- mIpConfiguration = ipConfiguration;
- }
-
- /**
- * Get the {@link StaticIpConfiguration} for this network.
- * @return the {@link StaticIpConfiguration}, or null if unset.
- * @hide
- */
- @Nullable
- @UnsupportedAppUsage
- public StaticIpConfiguration getStaticIpConfiguration() {
- return mIpConfiguration.getStaticIpConfiguration();
- }
-
- /** @hide */
- @UnsupportedAppUsage
- public void setStaticIpConfiguration(StaticIpConfiguration staticIpConfiguration) {
- mIpConfiguration.setStaticIpConfiguration(staticIpConfiguration);
- }
-
- /**
- * Get the {@link IpConfiguration.IpAssignment} for this network.
- * @hide
- */
- @NonNull
- @UnsupportedAppUsage
- public IpConfiguration.IpAssignment getIpAssignment() {
- return mIpConfiguration.getIpAssignment();
- }
-
- /** @hide */
- @UnsupportedAppUsage
- public void setIpAssignment(IpConfiguration.IpAssignment ipAssignment) {
- mIpConfiguration.setIpAssignment(ipAssignment);
- }
-
- /**
- * Get the {@link IpConfiguration.ProxySettings} for this network.
- * @hide
- */
- @NonNull
- @UnsupportedAppUsage
- public IpConfiguration.ProxySettings getProxySettings() {
- return mIpConfiguration.getProxySettings();
- }
-
- /** @hide */
- @UnsupportedAppUsage
- public void setProxySettings(IpConfiguration.ProxySettings proxySettings) {
- mIpConfiguration.setProxySettings(proxySettings);
- }
-
- /**
- * Returns the HTTP proxy used by this object.
- * @return a {@link ProxyInfo httpProxy} representing the proxy specified by this
- * WifiConfiguration, or {@code null} if no proxy is specified.
- */
- public ProxyInfo getHttpProxy() {
- if (mIpConfiguration.getProxySettings() == IpConfiguration.ProxySettings.NONE) {
- return null;
- }
- return new ProxyInfo(mIpConfiguration.getHttpProxy());
- }
-
- /**
- * Set the {@link ProxyInfo} for this WifiConfiguration. This method should only be used by a
- * device owner or profile owner. When other apps attempt to save a {@link WifiConfiguration}
- * with modified proxy settings, the methods {@link WifiManager#addNetwork} and
- * {@link WifiManager#updateNetwork} fail and return {@code -1}.
- *
- * @param httpProxy {@link ProxyInfo} representing the httpProxy to be used by this
- * WifiConfiguration. Setting this to {@code null} will explicitly set no
- * proxy, removing any proxy that was previously set.
- * @exception IllegalArgumentException for invalid httpProxy
- */
- public void setHttpProxy(ProxyInfo httpProxy) {
- if (httpProxy == null) {
- mIpConfiguration.setProxySettings(IpConfiguration.ProxySettings.NONE);
- mIpConfiguration.setHttpProxy(null);
- return;
- }
- ProxyInfo httpProxyCopy;
- ProxySettings proxySettingCopy;
- if (!Uri.EMPTY.equals(httpProxy.getPacFileUrl())) {
- proxySettingCopy = IpConfiguration.ProxySettings.PAC;
- // Construct a new PAC URL Proxy
- httpProxyCopy = ProxyInfo.buildPacProxy(httpProxy.getPacFileUrl(), httpProxy.getPort());
- } else {
- proxySettingCopy = IpConfiguration.ProxySettings.STATIC;
- // Construct a new HTTP Proxy
- httpProxyCopy = ProxyInfo.buildDirectProxy(httpProxy.getHost(), httpProxy.getPort(),
- Arrays.asList(httpProxy.getExclusionList()));
- }
- if (!httpProxyCopy.isValid()) {
- throw new IllegalArgumentException("Invalid ProxyInfo: " + httpProxyCopy.toString());
- }
- mIpConfiguration.setProxySettings(proxySettingCopy);
- mIpConfiguration.setHttpProxy(httpProxyCopy);
- }
-
- /**
- * Set the {@link ProxySettings} and {@link ProxyInfo} for this network.
- * @hide
- */
- @UnsupportedAppUsage
- public void setProxy(@NonNull ProxySettings settings, @NonNull ProxyInfo proxy) {
- mIpConfiguration.setProxySettings(settings);
- mIpConfiguration.setHttpProxy(proxy);
- }
-
- /** Implement the Parcelable interface {@hide} */
- public int describeContents() {
- return 0;
- }
-
- /** @hide */
- public void setPasspointManagementObjectTree(String passpointManagementObjectTree) {
- mPasspointManagementObjectTree = passpointManagementObjectTree;
- }
-
- /** @hide */
- public String getMoTree() {
- return mPasspointManagementObjectTree;
- }
-
- /** Copy constructor */
- public WifiConfiguration(@NonNull WifiConfiguration source) {
- if (source != null) {
- networkId = source.networkId;
- status = source.status;
- SSID = source.SSID;
- BSSID = source.BSSID;
- FQDN = source.FQDN;
- roamingConsortiumIds = source.roamingConsortiumIds.clone();
- providerFriendlyName = source.providerFriendlyName;
- isHomeProviderNetwork = source.isHomeProviderNetwork;
- preSharedKey = source.preSharedKey;
-
- mNetworkSelectionStatus.copy(source.getNetworkSelectionStatus());
- apBand = source.apBand;
- apChannel = source.apChannel;
-
- wepKeys = new String[4];
- for (int i = 0; i < wepKeys.length; i++) {
- wepKeys[i] = source.wepKeys[i];
- }
-
- wepTxKeyIndex = source.wepTxKeyIndex;
- priority = source.priority;
- hiddenSSID = source.hiddenSSID;
- allowedKeyManagement = (BitSet) source.allowedKeyManagement.clone();
- allowedProtocols = (BitSet) source.allowedProtocols.clone();
- allowedAuthAlgorithms = (BitSet) source.allowedAuthAlgorithms.clone();
- allowedPairwiseCiphers = (BitSet) source.allowedPairwiseCiphers.clone();
- 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;
-
- mIpConfiguration = new IpConfiguration(source.mIpConfiguration);
-
- if ((source.linkedConfigurations != null)
- && (source.linkedConfigurations.size() > 0)) {
- linkedConfigurations = new HashMap<String, Integer>();
- linkedConfigurations.putAll(source.linkedConfigurations);
- }
- validatedInternetAccess = source.validatedInternetAccess;
- isLegacyPasspointConfig = source.isLegacyPasspointConfig;
- ephemeral = source.ephemeral;
- osu = source.osu;
- trusted = source.trusted;
- oemPaid = source.oemPaid;
- oemPrivate = source.oemPrivate;
- carrierMerged = source.carrierMerged;
- fromWifiNetworkSuggestion = source.fromWifiNetworkSuggestion;
- fromWifiNetworkSpecifier = source.fromWifiNetworkSpecifier;
- meteredHint = source.meteredHint;
- meteredOverride = source.meteredOverride;
- useExternalScores = source.useExternalScores;
-
- lastConnectUid = source.lastConnectUid;
- lastUpdateUid = source.lastUpdateUid;
- creatorUid = source.creatorUid;
- creatorName = source.creatorName;
- lastUpdateName = source.lastUpdateName;
- peerWifiConfiguration = source.peerWifiConfiguration;
-
- lastConnected = source.lastConnected;
- lastDisconnected = source.lastDisconnected;
- numScorerOverride = source.numScorerOverride;
- numScorerOverrideAndSwitchedNetwork = source.numScorerOverrideAndSwitchedNetwork;
- numAssociation = source.numAssociation;
- allowAutojoin = source.allowAutojoin;
- numNoInternetAccessReports = source.numNoInternetAccessReports;
- noInternetAccessExpected = source.noInternetAccessExpected;
- shared = source.shared;
- recentFailure.setAssociationStatus(source.recentFailure.getAssociationStatus(),
- source.recentFailure.getLastUpdateTimeSinceBootMillis());
- mRandomizedMacAddress = source.mRandomizedMacAddress;
- macRandomizationSetting = source.macRandomizationSetting;
- randomizedMacExpirationTimeMs = source.randomizedMacExpirationTimeMs;
- randomizedMacLastModifiedTimeMs = source.randomizedMacLastModifiedTimeMs;
- requirePmf = source.requirePmf;
- updateIdentifier = source.updateIdentifier;
- carrierId = source.carrierId;
- subscriptionId = source.subscriptionId;
- mPasspointUniqueId = source.mPasspointUniqueId;
- }
- }
-
- /** Implement the Parcelable interface {@hide} */
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(networkId);
- dest.writeInt(status);
- mNetworkSelectionStatus.writeToParcel(dest);
- dest.writeString(SSID);
- dest.writeString(BSSID);
- dest.writeInt(apBand);
- dest.writeInt(apChannel);
- dest.writeString(FQDN);
- dest.writeString(providerFriendlyName);
- dest.writeInt(isHomeProviderNetwork ? 1 : 0);
- dest.writeInt(roamingConsortiumIds.length);
- for (long roamingConsortiumId : roamingConsortiumIds) {
- dest.writeLong(roamingConsortiumId);
- }
- dest.writeString(preSharedKey);
- for (String wepKey : wepKeys) {
- dest.writeString(wepKey);
- }
- dest.writeInt(wepTxKeyIndex);
- dest.writeInt(priority);
- dest.writeInt(hiddenSSID ? 1 : 0);
- dest.writeInt(requirePmf ? 1 : 0);
- dest.writeString(updateIdentifier);
-
- writeBitSet(dest, allowedKeyManagement);
- writeBitSet(dest, allowedProtocols);
- writeBitSet(dest, allowedAuthAlgorithms);
- writeBitSet(dest, allowedPairwiseCiphers);
- writeBitSet(dest, allowedGroupCiphers);
- 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);
- dest.writeString(dhcpServer);
- dest.writeString(defaultGwMacAddress);
- dest.writeInt(validatedInternetAccess ? 1 : 0);
- dest.writeInt(isLegacyPasspointConfig ? 1 : 0);
- dest.writeInt(ephemeral ? 1 : 0);
- dest.writeInt(trusted ? 1 : 0);
- dest.writeInt(oemPaid ? 1 : 0);
- dest.writeInt(oemPrivate ? 1 : 0);
- dest.writeInt(carrierMerged ? 1 : 0);
- dest.writeInt(fromWifiNetworkSuggestion ? 1 : 0);
- dest.writeInt(fromWifiNetworkSpecifier ? 1 : 0);
- dest.writeInt(meteredHint ? 1 : 0);
- dest.writeInt(meteredOverride);
- dest.writeInt(useExternalScores ? 1 : 0);
- dest.writeInt(creatorUid);
- dest.writeInt(lastConnectUid);
- dest.writeInt(lastUpdateUid);
- dest.writeString(creatorName);
- dest.writeString(lastUpdateName);
- dest.writeInt(numScorerOverride);
- dest.writeInt(numScorerOverrideAndSwitchedNetwork);
- dest.writeInt(numAssociation);
- dest.writeBoolean(allowAutojoin);
- dest.writeInt(numNoInternetAccessReports);
- dest.writeInt(noInternetAccessExpected ? 1 : 0);
- dest.writeInt(shared ? 1 : 0);
- dest.writeString(mPasspointManagementObjectTree);
- dest.writeInt(recentFailure.getAssociationStatus());
- dest.writeLong(recentFailure.getLastUpdateTimeSinceBootMillis());
- dest.writeParcelable(mRandomizedMacAddress, flags);
- dest.writeInt(macRandomizationSetting);
- dest.writeInt(osu ? 1 : 0);
- dest.writeLong(randomizedMacExpirationTimeMs);
- dest.writeLong(randomizedMacLastModifiedTimeMs);
- dest.writeInt(carrierId);
- dest.writeString(mPasspointUniqueId);
- dest.writeInt(subscriptionId);
- }
-
- /** Implement the Parcelable interface {@hide} */
- @UnsupportedAppUsage
- public static final @android.annotation.NonNull Creator<WifiConfiguration> CREATOR =
- new Creator<WifiConfiguration>() {
- public WifiConfiguration createFromParcel(Parcel in) {
- WifiConfiguration config = new WifiConfiguration();
- config.networkId = in.readInt();
- config.status = in.readInt();
- config.mNetworkSelectionStatus.readFromParcel(in);
- config.SSID = in.readString();
- config.BSSID = in.readString();
- config.apBand = in.readInt();
- config.apChannel = in.readInt();
- config.FQDN = in.readString();
- config.providerFriendlyName = in.readString();
- config.isHomeProviderNetwork = in.readInt() != 0;
- int numRoamingConsortiumIds = in.readInt();
- config.roamingConsortiumIds = new long[numRoamingConsortiumIds];
- for (int i = 0; i < numRoamingConsortiumIds; i++) {
- config.roamingConsortiumIds[i] = in.readLong();
- }
- config.preSharedKey = in.readString();
- for (int i = 0; i < config.wepKeys.length; i++) {
- config.wepKeys[i] = in.readString();
- }
- config.wepTxKeyIndex = in.readInt();
- config.priority = in.readInt();
- config.hiddenSSID = in.readInt() != 0;
- config.requirePmf = in.readInt() != 0;
- config.updateIdentifier = in.readString();
-
- config.allowedKeyManagement = readBitSet(in);
- config.allowedProtocols = readBitSet(in);
- config.allowedAuthAlgorithms = readBitSet(in);
- config.allowedPairwiseCiphers = readBitSet(in);
- config.allowedGroupCiphers = readBitSet(in);
- 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();
- config.defaultGwMacAddress = in.readString();
- config.validatedInternetAccess = in.readInt() != 0;
- config.isLegacyPasspointConfig = in.readInt() != 0;
- config.ephemeral = in.readInt() != 0;
- config.trusted = in.readInt() != 0;
- config.oemPaid = in.readInt() != 0;
- config.oemPrivate = in.readInt() != 0;
- config.carrierMerged = in.readInt() != 0;
- config.fromWifiNetworkSuggestion = in.readInt() != 0;
- config.fromWifiNetworkSpecifier = in.readInt() != 0;
- config.meteredHint = in.readInt() != 0;
- config.meteredOverride = in.readInt();
- config.useExternalScores = in.readInt() != 0;
- config.creatorUid = in.readInt();
- config.lastConnectUid = in.readInt();
- config.lastUpdateUid = in.readInt();
- config.creatorName = in.readString();
- config.lastUpdateName = in.readString();
- config.numScorerOverride = in.readInt();
- config.numScorerOverrideAndSwitchedNetwork = in.readInt();
- config.numAssociation = in.readInt();
- config.allowAutojoin = in.readBoolean();
- config.numNoInternetAccessReports = in.readInt();
- config.noInternetAccessExpected = in.readInt() != 0;
- config.shared = in.readInt() != 0;
- config.mPasspointManagementObjectTree = in.readString();
- config.recentFailure.setAssociationStatus(in.readInt(), in.readLong());
- config.mRandomizedMacAddress = in.readParcelable(null);
- config.macRandomizationSetting = in.readInt();
- config.osu = in.readInt() != 0;
- config.randomizedMacExpirationTimeMs = in.readLong();
- config.randomizedMacLastModifiedTimeMs = in.readLong();
- config.carrierId = in.readInt();
- config.mPasspointUniqueId = in.readString();
- config.subscriptionId = in.readInt();
- return config;
- }
-
- public WifiConfiguration[] newArray(int size) {
- return new WifiConfiguration[size];
- }
- };
-
- /**
- * Passpoint Unique identifier
- * @hide
- */
- private String mPasspointUniqueId = null;
-
- /**
- * Set the Passpoint unique identifier
- * @param uniqueId Passpoint unique identifier to be set
- * @hide
- */
- public void setPasspointUniqueId(String uniqueId) {
- mPasspointUniqueId = uniqueId;
- }
-
- /**
- * Set the Passpoint unique identifier
- * @hide
- */
- public String getPasspointUniqueId() {
- return mPasspointUniqueId;
- }
-
- /**
- * If network is one of the most recently connected.
- * For framework internal use only. Do not parcel.
- * @hide
- */
- public boolean isMostRecentlyConnected = false;
-
- /**
- * Whether the key mgmt indicates if the WifiConfiguration needs a preSharedKey or not.
- * @return true if preSharedKey is needed, false otherwise.
- * @hide
- */
- public boolean needsPreSharedKey() {
- return mSecurityParamsList.stream()
- .anyMatch(params -> params.isSecurityType(SECURITY_TYPE_PSK)
- || params.isSecurityType(SECURITY_TYPE_SAE)
- || params.isSecurityType(SECURITY_TYPE_WAPI_PSK));
- }
-
- /**
- * Get a unique key which represent this Wi-Fi configuration profile. If two profiles are for
- * the same Wi-Fi network, but from different providers (apps, carriers, or data subscriptions),
- * they would have different keys.
- * @return a unique key which represent this profile.
- * @hide
- */
- @SystemApi
- @NonNull public String getProfileKey() {
- if (mPasspointUniqueId != null) {
- return mPasspointUniqueId;
- }
-
- String key = SSID + getDefaultSecurityType();
- if (!shared) {
- key += "-" + UserHandle.getUserHandleForUid(creatorUid).getIdentifier();
- }
- if (fromWifiNetworkSuggestion) {
- key += "_" + creatorName + "-" + carrierId + "-" + subscriptionId;
- }
-
- return key;
- }
-
- /**
- * Get the default security type string.
- * @hide
- */
- public String getDefaultSecurityType() {
- String key;
- if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) {
- key = KeyMgmt.strings[KeyMgmt.WPA_PSK];
- } else if (allowedKeyManagement.get(KeyMgmt.WPA_EAP)
- || allowedKeyManagement.get(KeyMgmt.IEEE8021X)) {
- key = KeyMgmt.strings[KeyMgmt.WPA_EAP];
- } else if (wepTxKeyIndex >= 0 && wepTxKeyIndex < wepKeys.length
- && wepKeys[wepTxKeyIndex] != null) {
- key = "WEP";
- } else if (allowedKeyManagement.get(KeyMgmt.OWE)) {
- key = KeyMgmt.strings[KeyMgmt.OWE];
- } else if (allowedKeyManagement.get(KeyMgmt.SAE)) {
- key = KeyMgmt.strings[KeyMgmt.SAE];
- } else if (allowedKeyManagement.get(KeyMgmt.SUITE_B_192)) {
- key = KeyMgmt.strings[KeyMgmt.SUITE_B_192];
- } else if (allowedKeyManagement.get(KeyMgmt.WAPI_PSK)) {
- key = KeyMgmt.strings[KeyMgmt.WAPI_PSK];
- } else if (allowedKeyManagement.get(KeyMgmt.WAPI_CERT)) {
- key = KeyMgmt.strings[KeyMgmt.WAPI_CERT];
- } else if (allowedKeyManagement.get(KeyMgmt.OSEN)) {
- key = KeyMgmt.strings[KeyMgmt.OSEN];
- } else {
- key = KeyMgmt.strings[KeyMgmt.NONE];
- }
- return key;
- }
-
-}
diff --git a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
deleted file mode 100644
index e127ea9..0000000
--- a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
+++ /dev/null
@@ -1,1514 +0,0 @@
-/*
- * Copyright (C) 2013 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.annotation.Nullable;
-import android.annotation.SystemApi;
-import android.compat.annotation.UnsupportedAppUsage;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.text.TextUtils;
-import android.util.Log;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.nio.charset.StandardCharsets;
-import java.security.PrivateKey;
-import java.security.cert.X509Certificate;
-import java.security.interfaces.ECPublicKey;
-import java.security.interfaces.RSAPublicKey;
-import java.security.spec.ECParameterSpec;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Enterprise configuration details for Wi-Fi. Stores details about the EAP method
- * and any associated credentials.
- */
-public class WifiEnterpriseConfig implements Parcelable {
-
- /** Key prefix for WAPI AS certificates. */
- public static final String WAPI_AS_CERTIFICATE = "WAPIAS_";
-
- /** Key prefix for WAPI user certificates. */
- public static final String WAPI_USER_CERTIFICATE = "WAPIUSR_";
-
- /**
- * Intent extra: name for WAPI AS certificates
- */
- public static final String EXTRA_WAPI_AS_CERTIFICATE_NAME =
- "android.net.wifi.extra.WAPI_AS_CERTIFICATE_NAME";
-
- /**
- * Intent extra: data for WAPI AS certificates
- */
- public static final String EXTRA_WAPI_AS_CERTIFICATE_DATA =
- "android.net.wifi.extra.WAPI_AS_CERTIFICATE_DATA";
-
- /**
- * Intent extra: name for WAPI USER certificates
- */
- public static final String EXTRA_WAPI_USER_CERTIFICATE_NAME =
- "android.net.wifi.extra.WAPI_USER_CERTIFICATE_NAME";
-
- /**
- * Intent extra: data for WAPI USER certificates
- */
- public static final String EXTRA_WAPI_USER_CERTIFICATE_DATA =
- "android.net.wifi.extra.WAPI_USER_CERTIFICATE_DATA";
-
- /** @hide */
- public static final String EMPTY_VALUE = "NULL";
- /** @hide */
- public static final String EAP_KEY = "eap";
- /** @hide */
- public static final String PHASE2_KEY = "phase2";
- /** @hide */
- public static final String IDENTITY_KEY = "identity";
- /** @hide */
- public static final String ANON_IDENTITY_KEY = "anonymous_identity";
- /** @hide */
- public static final String PASSWORD_KEY = "password";
- /** @hide */
- public static final String SUBJECT_MATCH_KEY = "subject_match";
- /** @hide */
- public static final String ALTSUBJECT_MATCH_KEY = "altsubject_match";
- /** @hide */
- public static final String DOM_SUFFIX_MATCH_KEY = "domain_suffix_match";
- /** @hide */
- public static final String OPP_KEY_CACHING = "proactive_key_caching";
- /** @hide */
- public static final String EAP_ERP = "eap_erp";
- /** @hide */
- public static final String OCSP = "ocsp";
-
- /**
- * String representing the keystore OpenSSL ENGINE's ID.
- * @hide
- */
- public static final String ENGINE_ID_KEYSTORE = "keystore";
-
- /**
- * String representing the keystore URI used for wpa_supplicant.
- * @hide
- */
- public static final String KEYSTORE_URI = "keystore://";
-
- /**
- * String representing the keystore URI used for wpa_supplicant,
- * Unlike #KEYSTORE_URI, this supports a list of space-delimited aliases
- * @hide
- */
- public static final String KEYSTORES_URI = "keystores://";
-
- /**
- * String to set the engine value to when it should be enabled.
- * @hide
- */
- public static final String ENGINE_ENABLE = "1";
-
- /**
- * String to set the engine value to when it should be disabled.
- * @hide
- */
- public static final String ENGINE_DISABLE = "0";
-
- /**
- * Key prefix for CA certificates.
- * Note: copied from {@link android.security.Credentials#CA_CERTIFICATE} since it is @hide.
- */
- private static final String CA_CERTIFICATE = "CACERT_";
- /**
- * Key prefix for user certificates.
- * Note: copied from {@link android.security.Credentials#USER_CERTIFICATE} since it is @hide.
- */
- private static final String USER_CERTIFICATE = "USRCERT_";
- /**
- * Key prefix for user private and secret keys.
- * Note: copied from {@link android.security.Credentials#USER_PRIVATE_KEY} since it is @hide.
- */
- private static final String USER_PRIVATE_KEY = "USRPKEY_";
-
- /** @hide */
- public static final String CA_CERT_PREFIX = KEYSTORE_URI + CA_CERTIFICATE;
- /** @hide */
- public static final String CLIENT_CERT_PREFIX = KEYSTORE_URI + USER_CERTIFICATE;
- /** @hide */
- public static final String CLIENT_CERT_KEY = "client_cert";
- /** @hide */
- public static final String CA_CERT_KEY = "ca_cert";
- /** @hide */
- public static final String CA_PATH_KEY = "ca_path";
- /** @hide */
- public static final String ENGINE_KEY = "engine";
- /** @hide */
- public static final String ENGINE_ID_KEY = "engine_id";
- /** @hide */
- public static final String PRIVATE_KEY_ID_KEY = "key_id";
- /** @hide */
- public static final String REALM_KEY = "realm";
- /** @hide */
- public static final String PLMN_KEY = "plmn";
- /** @hide */
- public static final String CA_CERT_ALIAS_DELIMITER = " ";
- /** @hide */
- public static final String WAPI_CERT_SUITE_KEY = "wapi_cert_suite";
-
- /**
- * Do not use OCSP stapling (TLS certificate status extension)
- * @hide
- */
- @SystemApi
- public static final int OCSP_NONE = 0;
-
- /**
- * Try to use OCSP stapling, but not require response
- * @hide
- */
- @SystemApi
- public static final int OCSP_REQUEST_CERT_STATUS = 1;
-
- /**
- * Require valid OCSP stapling response
- * @hide
- */
- @SystemApi
- public static final int OCSP_REQUIRE_CERT_STATUS = 2;
-
- /**
- * Require valid OCSP stapling response for all not-trusted certificates in the server
- * certificate chain
- * @hide
- */
- @SystemApi
- public static final int OCSP_REQUIRE_ALL_NON_TRUSTED_CERTS_STATUS = 3;
-
- /** @hide */
- @IntDef(prefix = {"OCSP_"}, value = {
- OCSP_NONE,
- OCSP_REQUEST_CERT_STATUS,
- OCSP_REQUIRE_CERT_STATUS,
- OCSP_REQUIRE_ALL_NON_TRUSTED_CERTS_STATUS
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface Ocsp {}
-
- /**
- * Whether to use/require OCSP (Online Certificate Status Protocol) to check server certificate.
- * @hide
- */
- private @Ocsp int mOcsp = OCSP_NONE;
-
- // Fields to copy verbatim from wpa_supplicant.
- private static final String[] SUPPLICANT_CONFIG_KEYS = new String[] {
- IDENTITY_KEY,
- ANON_IDENTITY_KEY,
- PASSWORD_KEY,
- CLIENT_CERT_KEY,
- CA_CERT_KEY,
- SUBJECT_MATCH_KEY,
- ENGINE_KEY,
- ENGINE_ID_KEY,
- PRIVATE_KEY_ID_KEY,
- ALTSUBJECT_MATCH_KEY,
- DOM_SUFFIX_MATCH_KEY,
- CA_PATH_KEY
- };
-
- /**
- * Fields that have unquoted values in {@link #mFields}.
- */
- private static final List<String> UNQUOTED_KEYS = Arrays.asList(ENGINE_KEY, OPP_KEY_CACHING,
- EAP_ERP);
-
- @UnsupportedAppUsage
- private HashMap<String, String> mFields = new HashMap<String, String>();
- private X509Certificate[] mCaCerts;
- private PrivateKey mClientPrivateKey;
- private X509Certificate[] mClientCertificateChain;
- private int mEapMethod = Eap.NONE;
- private int mPhase2Method = Phase2.NONE;
- private boolean mIsAppInstalledDeviceKeyAndCert = false;
- private boolean mIsAppInstalledCaCert = false;
-
- private static final String TAG = "WifiEnterpriseConfig";
-
- public WifiEnterpriseConfig() {
- // Do not set defaults so that the enterprise fields that are not changed
- // by API are not changed underneath
- // This is essential because an app may not have all fields like password
- // available. It allows modification of subset of fields.
-
- }
-
- /**
- * Copy over the contents of the source WifiEnterpriseConfig object over to this object.
- *
- * @param source Source WifiEnterpriseConfig object.
- * @param ignoreMaskedPassword Set to true to ignore masked password field, false otherwise.
- * @param mask if |ignoreMaskedPassword| is set, check if the incoming password field is set
- * to this value.
- */
- private void copyFrom(WifiEnterpriseConfig source, boolean ignoreMaskedPassword, String mask) {
- for (String key : source.mFields.keySet()) {
- if (ignoreMaskedPassword && key.equals(PASSWORD_KEY)
- && TextUtils.equals(source.mFields.get(key), mask)) {
- continue;
- }
- mFields.put(key, source.mFields.get(key));
- }
- if (source.mCaCerts != null) {
- mCaCerts = Arrays.copyOf(source.mCaCerts, source.mCaCerts.length);
- } else {
- mCaCerts = null;
- }
- mClientPrivateKey = source.mClientPrivateKey;
- if (source.mClientCertificateChain != null) {
- mClientCertificateChain = Arrays.copyOf(
- source.mClientCertificateChain,
- source.mClientCertificateChain.length);
- } else {
- mClientCertificateChain = null;
- }
- mEapMethod = source.mEapMethod;
- mPhase2Method = source.mPhase2Method;
- mIsAppInstalledDeviceKeyAndCert = source.mIsAppInstalledDeviceKeyAndCert;
- mIsAppInstalledCaCert = source.mIsAppInstalledCaCert;
- mOcsp = source.mOcsp;
- }
-
- /**
- * Copy constructor.
- * This copies over all the fields verbatim (does not ignore masked password fields).
- *
- * @param source Source WifiEnterpriseConfig object.
- */
- public WifiEnterpriseConfig(WifiEnterpriseConfig source) {
- copyFrom(source, false, "");
- }
-
- /**
- * Copy fields from the provided external WifiEnterpriseConfig.
- * This is needed to handle the WifiEnterpriseConfig objects which were sent by apps with the
- * password field masked.
- *
- * @param externalConfig External WifiEnterpriseConfig object.
- * @param mask String mask to compare against.
- * @hide
- */
- public void copyFromExternal(WifiEnterpriseConfig externalConfig, String mask) {
- copyFrom(externalConfig, true, convertToQuotedString(mask));
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(mFields.size());
- for (Map.Entry<String, String> entry : mFields.entrySet()) {
- dest.writeString(entry.getKey());
- dest.writeString(entry.getValue());
- }
-
- dest.writeInt(mEapMethod);
- dest.writeInt(mPhase2Method);
- ParcelUtil.writeCertificates(dest, mCaCerts);
- ParcelUtil.writePrivateKey(dest, mClientPrivateKey);
- ParcelUtil.writeCertificates(dest, mClientCertificateChain);
- dest.writeBoolean(mIsAppInstalledDeviceKeyAndCert);
- dest.writeBoolean(mIsAppInstalledCaCert);
- dest.writeInt(mOcsp);
- }
-
- public static final @android.annotation.NonNull Creator<WifiEnterpriseConfig> CREATOR =
- new Creator<WifiEnterpriseConfig>() {
- @Override
- public WifiEnterpriseConfig createFromParcel(Parcel in) {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- int count = in.readInt();
- for (int i = 0; i < count; i++) {
- String key = in.readString();
- String value = in.readString();
- enterpriseConfig.mFields.put(key, value);
- }
-
- enterpriseConfig.mEapMethod = in.readInt();
- enterpriseConfig.mPhase2Method = in.readInt();
- enterpriseConfig.mCaCerts = ParcelUtil.readCertificates(in);
- enterpriseConfig.mClientPrivateKey = ParcelUtil.readPrivateKey(in);
- enterpriseConfig.mClientCertificateChain = ParcelUtil.readCertificates(in);
- enterpriseConfig.mIsAppInstalledDeviceKeyAndCert = in.readBoolean();
- enterpriseConfig.mIsAppInstalledCaCert = in.readBoolean();
- enterpriseConfig.mOcsp = in.readInt();
- return enterpriseConfig;
- }
-
- @Override
- public WifiEnterpriseConfig[] newArray(int size) {
- return new WifiEnterpriseConfig[size];
- }
- };
-
- /** The Extensible Authentication Protocol method used */
- public static final class Eap {
- /** No EAP method used. Represents an empty config */
- public static final int NONE = -1;
- /** Protected EAP */
- public static final int PEAP = 0;
- /** EAP-Transport Layer Security */
- public static final int TLS = 1;
- /** EAP-Tunneled Transport Layer Security */
- public static final int TTLS = 2;
- /** EAP-Password */
- public static final int PWD = 3;
- /** EAP-Subscriber Identity Module [RFC-4186] */
- public static final int SIM = 4;
- /** EAP-Authentication and Key Agreement [RFC-4187] */
- public static final int AKA = 5;
- /** EAP-Authentication and Key Agreement Prime [RFC-5448] */
- public static final int AKA_PRIME = 6;
- /** Hotspot 2.0 r2 OSEN */
- public static final int UNAUTH_TLS = 7;
- /** WAPI Certificate */
- public static final int WAPI_CERT = 8;
- /** @hide */
- public static final String[] strings =
- { "PEAP", "TLS", "TTLS", "PWD", "SIM", "AKA", "AKA'", "WFA-UNAUTH-TLS",
- "WAPI_CERT" };
-
- /** Prevent initialization */
- private Eap() {}
- }
-
- /** The inner authentication method used */
- public static final class Phase2 {
- public static final int NONE = 0;
- /** Password Authentication Protocol */
- public static final int PAP = 1;
- /** Microsoft Challenge Handshake Authentication Protocol */
- public static final int MSCHAP = 2;
- /** Microsoft Challenge Handshake Authentication Protocol v2 */
- public static final int MSCHAPV2 = 3;
- /** Generic Token Card */
- public static final int GTC = 4;
- /** EAP-Subscriber Identity Module [RFC-4186] */
- public static final int SIM = 5;
- /** EAP-Authentication and Key Agreement [RFC-4187] */
- public static final int AKA = 6;
- /** EAP-Authentication and Key Agreement Prime [RFC-5448] */
- public static final int AKA_PRIME = 7;
- private static final String AUTH_PREFIX = "auth=";
- private static final String AUTHEAP_PREFIX = "autheap=";
- /** @hide */
- public static final String[] strings = {EMPTY_VALUE, "PAP", "MSCHAP",
- "MSCHAPV2", "GTC", "SIM", "AKA", "AKA'" };
-
- /** Prevent initialization */
- private Phase2() {}
- }
-
- // Loader and saver interfaces for exchanging data with wpa_supplicant.
- // TODO: Decouple this object (which is just a placeholder of the configuration)
- // from the implementation that knows what wpa_supplicant wants.
- /**
- * Interface used for retrieving supplicant configuration from WifiEnterpriseConfig
- * @hide
- */
- public interface SupplicantSaver {
- /**
- * Set a value within wpa_supplicant configuration
- * @param key index to set within wpa_supplciant
- * @param value the value for the key
- * @return true if successful; false otherwise
- */
- boolean saveValue(String key, String value);
- }
-
- /**
- * Interface used for populating a WifiEnterpriseConfig from supplicant configuration
- * @hide
- */
- public interface SupplicantLoader {
- /**
- * Returns a value within wpa_supplicant configuration
- * @param key index to set within wpa_supplciant
- * @return string value if successful; null otherwise
- */
- String loadValue(String key);
- }
-
- /**
- * Internal use only; supply field values to wpa_supplicant config. The configuration
- * process aborts on the first failed call on {@code saver}.
- * @param saver proxy for setting configuration in wpa_supplciant
- * @return whether the save succeeded on all attempts
- * @hide
- */
- public boolean saveToSupplicant(SupplicantSaver saver) {
- if (!isEapMethodValid()) {
- return false;
- }
-
- // wpa_supplicant can update the anonymous identity for these kinds of networks after
- // framework reads them, so make sure the framework doesn't try to overwrite them.
- boolean shouldNotWriteAnonIdentity = mEapMethod == WifiEnterpriseConfig.Eap.SIM
- || mEapMethod == WifiEnterpriseConfig.Eap.AKA
- || mEapMethod == WifiEnterpriseConfig.Eap.AKA_PRIME;
- for (String key : mFields.keySet()) {
- if (shouldNotWriteAnonIdentity && ANON_IDENTITY_KEY.equals(key)) {
- continue;
- }
- if (!saver.saveValue(key, mFields.get(key))) {
- return false;
- }
- }
-
- if (!saver.saveValue(EAP_KEY, Eap.strings[mEapMethod])) {
- return false;
- }
-
- if (mEapMethod != Eap.TLS && mEapMethod != Eap.UNAUTH_TLS && mPhase2Method != Phase2.NONE) {
- boolean is_autheap = mEapMethod == Eap.TTLS && mPhase2Method == Phase2.GTC;
- String prefix = is_autheap ? Phase2.AUTHEAP_PREFIX : Phase2.AUTH_PREFIX;
- String value = convertToQuotedString(prefix + Phase2.strings[mPhase2Method]);
- return saver.saveValue(PHASE2_KEY, value);
- } else if (mPhase2Method == Phase2.NONE) {
- // By default, send a null phase 2 to clear old configuration values.
- return saver.saveValue(PHASE2_KEY, null);
- } else {
- Log.e(TAG, "WiFi enterprise configuration is invalid as it supplies a "
- + "phase 2 method but the phase1 method does not support it.");
- return false;
- }
- }
-
- /**
- * Internal use only; retrieve configuration from wpa_supplicant config.
- * @param loader proxy for retrieving configuration keys from wpa_supplicant
- * @hide
- */
- public void loadFromSupplicant(SupplicantLoader loader) {
- for (String key : SUPPLICANT_CONFIG_KEYS) {
- String value = loader.loadValue(key);
- if (value == null) {
- mFields.put(key, EMPTY_VALUE);
- } else {
- mFields.put(key, value);
- }
- }
- String eapMethod = loader.loadValue(EAP_KEY);
- mEapMethod = getStringIndex(Eap.strings, eapMethod, Eap.NONE);
-
- String phase2Method = removeDoubleQuotes(loader.loadValue(PHASE2_KEY));
- // Remove "auth=" or "autheap=" prefix.
- if (phase2Method.startsWith(Phase2.AUTH_PREFIX)) {
- phase2Method = phase2Method.substring(Phase2.AUTH_PREFIX.length());
- } else if (phase2Method.startsWith(Phase2.AUTHEAP_PREFIX)) {
- phase2Method = phase2Method.substring(Phase2.AUTHEAP_PREFIX.length());
- }
- mPhase2Method = getStringIndex(Phase2.strings, phase2Method, Phase2.NONE);
- }
-
- /**
- * Set the EAP authentication method.
- * @param eapMethod is one {@link Eap#PEAP}, {@link Eap#TLS}, {@link Eap#TTLS} or
- * {@link Eap#PWD}
- * @throws IllegalArgumentException on an invalid eap method
- */
- public void setEapMethod(int eapMethod) {
- switch (eapMethod) {
- /** Valid methods */
- case Eap.WAPI_CERT:
- mEapMethod = eapMethod;
- setPhase2Method(Phase2.NONE);
- break;
- case Eap.TLS:
- case Eap.UNAUTH_TLS:
- setPhase2Method(Phase2.NONE);
- /* fall through */
- case Eap.PEAP:
- case Eap.PWD:
- case Eap.TTLS:
- case Eap.SIM:
- case Eap.AKA:
- case Eap.AKA_PRIME:
- mEapMethod = eapMethod;
- setFieldValue(OPP_KEY_CACHING, "1");
- break;
- default:
- throw new IllegalArgumentException("Unknown EAP method");
- }
- }
-
- /**
- * Get the eap method.
- * @return eap method configured
- */
- public int getEapMethod() {
- return mEapMethod;
- }
-
- /**
- * Set Phase 2 authentication method. Sets the inner authentication method to be used in
- * phase 2 after setting up a secure channel
- * @param phase2Method is the inner authentication method and can be one of {@link Phase2#NONE},
- * {@link Phase2#PAP}, {@link Phase2#MSCHAP}, {@link Phase2#MSCHAPV2},
- * {@link Phase2#GTC}
- * @throws IllegalArgumentException on an invalid phase2 method
- *
- */
- public void setPhase2Method(int phase2Method) {
- switch (phase2Method) {
- case Phase2.NONE:
- case Phase2.PAP:
- case Phase2.MSCHAP:
- case Phase2.MSCHAPV2:
- case Phase2.GTC:
- case Phase2.SIM:
- case Phase2.AKA:
- case Phase2.AKA_PRIME:
- mPhase2Method = phase2Method;
- break;
- default:
- throw new IllegalArgumentException("Unknown Phase 2 method");
- }
- }
-
- /**
- * Get the phase 2 authentication method.
- * @return a phase 2 method defined at {@link Phase2}
- * */
- public int getPhase2Method() {
- return mPhase2Method;
- }
-
- /**
- * Set the identity
- * @param identity
- */
- public void setIdentity(String identity) {
- setFieldValue(IDENTITY_KEY, identity, "");
- }
-
- /**
- * Get the identity
- * @return the identity
- */
- public String getIdentity() {
- return getFieldValue(IDENTITY_KEY);
- }
-
- /**
- * Set anonymous identity. This is used as the unencrypted identity with
- * certain EAP types
- * @param anonymousIdentity the anonymous identity
- */
- public void setAnonymousIdentity(String anonymousIdentity) {
- setFieldValue(ANON_IDENTITY_KEY, anonymousIdentity);
- }
-
- /**
- * Get the anonymous identity
- * @return anonymous identity
- */
- public String getAnonymousIdentity() {
- return getFieldValue(ANON_IDENTITY_KEY);
- }
-
- /**
- * Set the password.
- * @param password the password
- */
- public void setPassword(String password) {
- setFieldValue(PASSWORD_KEY, password);
- }
-
- /**
- * Get the password.
- *
- * Returns locally set password value. For networks fetched from
- * framework, returns "*".
- */
- public String getPassword() {
- return getFieldValue(PASSWORD_KEY);
- }
-
- /**
- * Encode a CA certificate alias so it does not contain illegal character.
- * @hide
- */
- public static String encodeCaCertificateAlias(String alias) {
- byte[] bytes = alias.getBytes(StandardCharsets.UTF_8);
- StringBuilder sb = new StringBuilder(bytes.length * 2);
- for (byte o : bytes) {
- sb.append(String.format("%02x", o & 0xFF));
- }
- return sb.toString();
- }
-
- /**
- * Decode a previously-encoded CA certificate alias.
- * @hide
- */
- public static String decodeCaCertificateAlias(String alias) {
- byte[] data = new byte[alias.length() >> 1];
- for (int n = 0, position = 0; n < alias.length(); n += 2, position++) {
- data[position] = (byte) Integer.parseInt(alias.substring(n, n + 2), 16);
- }
- try {
- return new String(data, StandardCharsets.UTF_8);
- } catch (NumberFormatException e) {
- e.printStackTrace();
- return alias;
- }
- }
-
- /**
- * Set CA certificate alias.
- *
- * <p> See the {@link android.security.KeyChain} for details on installing or choosing
- * a certificate
- * </p>
- * @param alias identifies the certificate
- * @hide
- */
- @UnsupportedAppUsage
- public void setCaCertificateAlias(String alias) {
- setFieldValue(CA_CERT_KEY, alias, CA_CERT_PREFIX);
- }
-
- /**
- * Set CA certificate aliases. When creating installing the corresponding certificate to
- * the keystore, please use alias encoded by {@link #encodeCaCertificateAlias(String)}.
- *
- * <p> See the {@link android.security.KeyChain} for details on installing or choosing
- * a certificate.
- * </p>
- * @param aliases identifies the certificate. Can be null to indicate the absence of a
- * certificate.
- * @hide
- */
- @SystemApi
- public void setCaCertificateAliases(@Nullable String[] aliases) {
- if (aliases == null) {
- setFieldValue(CA_CERT_KEY, null, CA_CERT_PREFIX);
- } else if (aliases.length == 1) {
- // Backwards compatibility: use the original cert prefix if setting only one alias.
- setCaCertificateAlias(aliases[0]);
- } else {
- // Use KEYSTORES_URI which supports multiple aliases.
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < aliases.length; i++) {
- if (i > 0) {
- sb.append(CA_CERT_ALIAS_DELIMITER);
- }
- sb.append(encodeCaCertificateAlias(CA_CERTIFICATE + aliases[i]));
- }
- setFieldValue(CA_CERT_KEY, sb.toString(), KEYSTORES_URI);
- }
- }
-
- /**
- * Get CA certificate alias
- * @return alias to the CA certificate
- * @hide
- */
- @UnsupportedAppUsage
- public String getCaCertificateAlias() {
- return getFieldValue(CA_CERT_KEY, CA_CERT_PREFIX);
- }
-
- /**
- * Get CA certificate aliases.
- * @return alias to the CA certificate, or null if unset.
- * @hide
- */
- @Nullable
- @SystemApi
- public String[] getCaCertificateAliases() {
- String value = getFieldValue(CA_CERT_KEY);
- if (value.startsWith(CA_CERT_PREFIX)) {
- // Backwards compatibility: parse the original alias prefix.
- return new String[] {getFieldValue(CA_CERT_KEY, CA_CERT_PREFIX)};
- } else if (value.startsWith(KEYSTORES_URI)) {
- String values = value.substring(KEYSTORES_URI.length());
-
- String[] aliases = TextUtils.split(values, CA_CERT_ALIAS_DELIMITER);
- for (int i = 0; i < aliases.length; i++) {
- aliases[i] = decodeCaCertificateAlias(aliases[i]);
- if (aliases[i].startsWith(CA_CERTIFICATE)) {
- aliases[i] = aliases[i].substring(CA_CERTIFICATE.length());
- }
- }
- return aliases.length != 0 ? aliases : null;
- } else {
- return TextUtils.isEmpty(value) ? null : new String[] {value};
- }
- }
-
- /**
- * Specify a X.509 certificate that identifies the server.
- *
- * <p>A default name is automatically assigned to the certificate and used
- * with this configuration. The framework takes care of installing the
- * certificate when the config is saved and removing the certificate when
- * the config is removed.
- *
- * Note: If no certificate is set for an Enterprise configuration, either by not calling this
- * API (or the {@link #setCaCertificates(X509Certificate[])}, or by calling it with null, then
- * the server certificate validation is skipped - which means that the connection is not secure.
- *
- * @param cert X.509 CA certificate
- * @throws IllegalArgumentException if not a CA certificate
- */
- public void setCaCertificate(@Nullable X509Certificate cert) {
- if (cert != null) {
- if (cert.getBasicConstraints() >= 0) {
- mIsAppInstalledCaCert = true;
- mCaCerts = new X509Certificate[] {cert};
- } else {
- mCaCerts = null;
- throw new IllegalArgumentException("Not a CA certificate");
- }
- } else {
- mCaCerts = null;
- }
- }
-
- /**
- * Get CA certificate. If multiple CA certificates are configured previously,
- * return the first one.
- * @return X.509 CA certificate
- */
- @Nullable public X509Certificate getCaCertificate() {
- if (mCaCerts != null && mCaCerts.length > 0) {
- return mCaCerts[0];
- } else {
- return null;
- }
- }
-
- /**
- * Specify a list of X.509 certificates that identifies the server. The validation
- * passes if the CA of server certificate matches one of the given certificates.
-
- * <p>Default names are automatically assigned to the certificates and used
- * with this configuration. The framework takes care of installing the
- * certificates when the config is saved and removing the certificates when
- * the config is removed.
- *
- * Note: If no certificates are set for an Enterprise configuration, either by not calling this
- * API (or the {@link #setCaCertificate(X509Certificate)}, or by calling it with null, then the
- * server certificate validation is skipped - which means that the
- * connection is not secure.
- *
- * @param certs X.509 CA certificates
- * @throws IllegalArgumentException if any of the provided certificates is
- * not a CA certificate
- */
- public void setCaCertificates(@Nullable X509Certificate[] certs) {
- if (certs != null) {
- X509Certificate[] newCerts = new X509Certificate[certs.length];
- for (int i = 0; i < certs.length; i++) {
- if (certs[i].getBasicConstraints() >= 0) {
- newCerts[i] = certs[i];
- } else {
- mCaCerts = null;
- throw new IllegalArgumentException("Not a CA certificate");
- }
- }
- mCaCerts = newCerts;
- mIsAppInstalledCaCert = true;
- } else {
- mCaCerts = null;
- }
- }
-
- /**
- * Get CA certificates.
- */
- @Nullable public X509Certificate[] getCaCertificates() {
- if (mCaCerts != null && mCaCerts.length > 0) {
- return mCaCerts;
- } else {
- return null;
- }
- }
-
- /**
- * @hide
- */
- public void resetCaCertificate() {
- mCaCerts = null;
- }
-
- /**
- * Set the ca_path directive on wpa_supplicant.
- *
- * From wpa_supplicant documentation:
- *
- * Directory path for CA certificate files (PEM). This path may contain
- * multiple CA certificates in OpenSSL format. Common use for this is to
- * point to system trusted CA list which is often installed into directory
- * like /etc/ssl/certs. If configured, these certificates are added to the
- * list of trusted CAs. ca_cert may also be included in that case, but it is
- * not required.
- *
- * Note: If no certificate path is set for an Enterprise configuration, either by not calling
- * this API, or by calling it with null, and no certificate is set by
- * {@link #setCaCertificate(X509Certificate)} or {@link #setCaCertificates(X509Certificate[])},
- * then the server certificate validation is skipped - which means that the connection is not
- * secure.
- *
- * @param path The path for CA certificate files, or empty string to clear.
- * @hide
- */
- @SystemApi
- public void setCaPath(@NonNull String path) {
- setFieldValue(CA_PATH_KEY, path);
- }
-
- /**
- * Get the ca_path directive from wpa_supplicant.
- * @return The path for CA certificate files, or an empty string if unset.
- * @hide
- */
- @NonNull
- @SystemApi
- public String getCaPath() {
- return getFieldValue(CA_PATH_KEY);
- }
-
- /**
- * Set Client certificate alias.
- *
- * <p> See the {@link android.security.KeyChain} for details on installing or choosing
- * a certificate
- * </p>
- * @param alias identifies the certificate, or empty string to clear.
- * @hide
- */
- @SystemApi
- public void setClientCertificateAlias(@NonNull String alias) {
- setFieldValue(CLIENT_CERT_KEY, alias, CLIENT_CERT_PREFIX);
- setFieldValue(PRIVATE_KEY_ID_KEY, alias, USER_PRIVATE_KEY);
- // Also, set engine parameters
- if (TextUtils.isEmpty(alias)) {
- setFieldValue(ENGINE_KEY, ENGINE_DISABLE);
- setFieldValue(ENGINE_ID_KEY, "");
- } else {
- setFieldValue(ENGINE_KEY, ENGINE_ENABLE);
- setFieldValue(ENGINE_ID_KEY, ENGINE_ID_KEYSTORE);
- }
- }
-
- /**
- * Get client certificate alias.
- * @return alias to the client certificate, or an empty string if unset.
- * @hide
- */
- @NonNull
- @SystemApi
- public String getClientCertificateAlias() {
- return getFieldValue(CLIENT_CERT_KEY, CLIENT_CERT_PREFIX);
- }
-
- /**
- * Specify a private key and client certificate for client authorization.
- *
- * <p>A default name is automatically assigned to the key entry and used
- * with this configuration. The framework takes care of installing the
- * key entry when the config is saved and removing the key entry when
- * the config is removed.
-
- * @param privateKey a PrivateKey instance for the end certificate.
- * @param clientCertificate an X509Certificate representing the end certificate.
- * @throws IllegalArgumentException for an invalid key or certificate.
- */
- public void setClientKeyEntry(PrivateKey privateKey, X509Certificate clientCertificate) {
- X509Certificate[] clientCertificates = null;
- if (clientCertificate != null) {
- clientCertificates = new X509Certificate[] {clientCertificate};
- }
- setClientKeyEntryWithCertificateChain(privateKey, clientCertificates);
- }
-
- /**
- * Specify a private key and client certificate chain for client authorization.
- *
- * <p>A default name is automatically assigned to the key entry and used
- * with this configuration. The framework takes care of installing the
- * key entry when the config is saved and removing the key entry when
- * the config is removed.
- *
- * @param privateKey a PrivateKey instance for the end certificate.
- * @param clientCertificateChain an array of X509Certificate instances which starts with
- * end certificate and continues with additional CA certificates necessary to
- * link the end certificate with some root certificate known by the authenticator.
- * @throws IllegalArgumentException for an invalid key or certificate.
- */
- public void setClientKeyEntryWithCertificateChain(PrivateKey privateKey,
- X509Certificate[] clientCertificateChain) {
- X509Certificate[] newCerts = null;
- if (clientCertificateChain != null && clientCertificateChain.length > 0) {
- // We validate that this is a well formed chain that starts
- // with an end-certificate and is followed by CA certificates.
- // We don't validate that each following certificate verifies
- // the previous. https://en.wikipedia.org/wiki/Chain_of_trust
- //
- // Basic constraints is an X.509 extension type that defines
- // whether a given certificate is allowed to sign additional
- // certificates and what path length restrictions may exist.
- // We use this to judge whether the certificate is an end
- // certificate or a CA certificate.
- // https://cryptography.io/en/latest/x509/reference/
- if (clientCertificateChain[0].getBasicConstraints() != -1) {
- throw new IllegalArgumentException(
- "First certificate in the chain must be a client end certificate");
- }
-
- for (int i = 1; i < clientCertificateChain.length; i++) {
- if (clientCertificateChain[i].getBasicConstraints() == -1) {
- throw new IllegalArgumentException(
- "All certificates following the first must be CA certificates");
- }
- }
- newCerts = Arrays.copyOf(clientCertificateChain,
- clientCertificateChain.length);
-
- if (privateKey == null) {
- throw new IllegalArgumentException("Client cert without a private key");
- }
- if (privateKey.getEncoded() == null) {
- throw new IllegalArgumentException("Private key cannot be encoded");
- }
- }
-
- mClientPrivateKey = privateKey;
- mClientCertificateChain = newCerts;
- mIsAppInstalledDeviceKeyAndCert = true;
- }
-
- /**
- * Get client certificate
- *
- * @return X.509 client certificate
- */
- public X509Certificate getClientCertificate() {
- if (mClientCertificateChain != null && mClientCertificateChain.length > 0) {
- return mClientCertificateChain[0];
- } else {
- return null;
- }
- }
-
- /**
- * Get the complete client certificate chain in the same order as it was last supplied.
- *
- * <p>If the chain was last supplied by a call to
- * {@link #setClientKeyEntry(java.security.PrivateKey, java.security.cert.X509Certificate)}
- * with a non-null * certificate instance, a single-element array containing the certificate
- * will be * returned. If {@link #setClientKeyEntryWithCertificateChain(
- * java.security.PrivateKey, java.security.cert.X509Certificate[])} was last called with a
- * non-empty array, this array will be returned in the same order as it was supplied.
- * Otherwise, {@code null} will be returned.
- *
- * @return X.509 client certificates
- */
- @Nullable public X509Certificate[] getClientCertificateChain() {
- if (mClientCertificateChain != null && mClientCertificateChain.length > 0) {
- return mClientCertificateChain;
- } else {
- return null;
- }
- }
-
- /**
- * @hide
- */
- public void resetClientKeyEntry() {
- mClientPrivateKey = null;
- mClientCertificateChain = null;
- }
-
- /**
- * Get the client private key as supplied in {@link #setClientKeyEntryWithCertificateChain}, or
- * null if unset.
- */
- @Nullable
- public PrivateKey getClientPrivateKey() {
- return mClientPrivateKey;
- }
-
- /**
- * Set subject match (deprecated). This is the substring to be matched against the subject of
- * the authentication server certificate.
- * @param subjectMatch substring to be matched
- * @deprecated in favor of altSubjectMatch
- */
- public void setSubjectMatch(String subjectMatch) {
- setFieldValue(SUBJECT_MATCH_KEY, subjectMatch);
- }
-
- /**
- * Get subject match (deprecated)
- * @return the subject match string
- * @deprecated in favor of altSubjectMatch
- */
- public String getSubjectMatch() {
- return getFieldValue(SUBJECT_MATCH_KEY);
- }
-
- /**
- * Set alternate subject match. This is the substring to be matched against the
- * alternate subject of the authentication server certificate.
- *
- * Note: If no alternate subject is set for an Enterprise configuration, either by not calling
- * this API, or by calling it with null, or not setting domain suffix match using the
- * {@link #setDomainSuffixMatch(String)}, then the server certificate validation is incomplete -
- * which means that the connection is not secure.
- *
- * @param altSubjectMatch substring to be matched, for example
- * DNS:server.example.com;EMAIL:server@example.com
- */
- public void setAltSubjectMatch(String altSubjectMatch) {
- setFieldValue(ALTSUBJECT_MATCH_KEY, altSubjectMatch);
- }
-
- /**
- * Get alternate subject match
- * @return the alternate subject match string
- */
- public String getAltSubjectMatch() {
- return getFieldValue(ALTSUBJECT_MATCH_KEY);
- }
-
- /**
- * Set the domain_suffix_match directive on wpa_supplicant. This is the parameter to use
- * for Hotspot 2.0 defined matching of AAA server certs per WFA HS2.0 spec, section 7.3.3.2,
- * second paragraph.
- *
- * <p>From wpa_supplicant documentation:
- * <p>Constraint for server domain name. If set, this FQDN is used as a suffix match requirement
- * for the AAAserver certificate in SubjectAltName dNSName element(s). If a matching dNSName is
- * found, this constraint is met.
- * <p>Suffix match here means that the host/domain name is compared one label at a time starting
- * from the top-level domain and all the labels in domain_suffix_match shall be included in the
- * certificate. The certificate may include additional sub-level labels in addition to the
- * required labels.
- * <p>More than one match string can be provided by using semicolons to separate the strings
- * (e.g., example.org;example.com). When multiple strings are specified, a match with any one of
- * the values is considered a sufficient match for the certificate, i.e., the conditions are
- * ORed ogether.
- * <p>For example, domain_suffix_match=example.com would match test.example.com but would not
- * match test-example.com.
- *
- * Note: If no domain suffix is set for an Enterprise configuration, either by not calling this
- * API, or by calling it with null, or not setting alternate subject match using the
- * {@link #setAltSubjectMatch(String)}, then the server certificate
- * validation is incomplete - which means that the connection is not secure.
- *
- * @param domain The domain value
- */
- public void setDomainSuffixMatch(String domain) {
- setFieldValue(DOM_SUFFIX_MATCH_KEY, domain);
- }
-
- /**
- * Get the domain_suffix_match value. See setDomSuffixMatch.
- * @return The domain value.
- */
- public String getDomainSuffixMatch() {
- return getFieldValue(DOM_SUFFIX_MATCH_KEY);
- }
-
- /**
- * Set realm for Passpoint credential; realm identifies a set of networks where your
- * Passpoint credential can be used
- * @param realm the realm
- */
- public void setRealm(String realm) {
- setFieldValue(REALM_KEY, realm);
- }
-
- /**
- * Get realm for Passpoint credential; see {@link #setRealm(String)} for more information
- * @return the realm
- */
- public String getRealm() {
- return getFieldValue(REALM_KEY);
- }
-
- /**
- * Set plmn (Public Land Mobile Network) of the provider of Passpoint credential
- * @param plmn the plmn value derived from mcc (mobile country code) & mnc (mobile network code)
- */
- public void setPlmn(String plmn) {
- setFieldValue(PLMN_KEY, plmn);
- }
-
- /**
- * Get plmn (Public Land Mobile Network) for Passpoint credential; see {@link #setPlmn
- * (String)} for more information
- * @return the plmn
- */
- public String getPlmn() {
- return getFieldValue(PLMN_KEY);
- }
-
- /** See {@link WifiConfiguration#getKeyIdForCredentials} @hide */
- public String getKeyId(WifiEnterpriseConfig current) {
- // If EAP method is not initialized, use current config details
- if (mEapMethod == Eap.NONE) {
- return (current != null) ? current.getKeyId(null) : EMPTY_VALUE;
- }
- if (!isEapMethodValid()) {
- return EMPTY_VALUE;
- }
- return Eap.strings[mEapMethod] + "_" + Phase2.strings[mPhase2Method];
- }
-
- private String removeDoubleQuotes(String string) {
- if (TextUtils.isEmpty(string)) return "";
- int length = string.length();
- if ((length > 1) && (string.charAt(0) == '"')
- && (string.charAt(length - 1) == '"')) {
- return string.substring(1, length - 1);
- }
- return string;
- }
-
- private String convertToQuotedString(String string) {
- return "\"" + string + "\"";
- }
-
- /**
- * Returns the index at which the toBeFound string is found in the array.
- * @param arr array of strings
- * @param toBeFound string to be found
- * @param defaultIndex default index to be returned when string is not found
- * @return the index into array
- */
- private int getStringIndex(String arr[], String toBeFound, int defaultIndex) {
- if (TextUtils.isEmpty(toBeFound)) return defaultIndex;
- for (int i = 0; i < arr.length; i++) {
- if (toBeFound.equals(arr[i])) return i;
- }
- return defaultIndex;
- }
-
- /**
- * Returns the field value for the key with prefix removed.
- * @param key into the hash
- * @param prefix is the prefix that the value may have
- * @return value
- * @hide
- */
- private String getFieldValue(String key, String prefix) {
- // TODO: Should raise an exception if |key| is EAP_KEY or PHASE2_KEY since
- // neither of these keys should be retrieved in this manner.
- String value = mFields.get(key);
- // Uninitialized or known to be empty after reading from supplicant
- if (TextUtils.isEmpty(value) || EMPTY_VALUE.equals(value)) return "";
-
- value = removeDoubleQuotes(value);
- if (value.startsWith(prefix)) {
- return value.substring(prefix.length());
- } else {
- return value;
- }
- }
-
- /**
- * Returns the field value for the key.
- * @param key into the hash
- * @return value
- * @hide
- */
- public String getFieldValue(String key) {
- return getFieldValue(key, "");
- }
-
- /**
- * Set a value with an optional prefix at key
- * @param key into the hash
- * @param value to be set
- * @param prefix an optional value to be prefixed to actual value
- * @hide
- */
- private void setFieldValue(String key, String value, String prefix) {
- // TODO: Should raise an exception if |key| is EAP_KEY or PHASE2_KEY since
- // neither of these keys should be set in this manner.
- if (TextUtils.isEmpty(value)) {
- mFields.put(key, EMPTY_VALUE);
- } else {
- String valueToSet;
- if (!UNQUOTED_KEYS.contains(key)) {
- valueToSet = convertToQuotedString(prefix + value);
- } else {
- valueToSet = prefix + value;
- }
- mFields.put(key, valueToSet);
- }
- }
-
- /**
- * Set a value at key
- * @param key into the hash
- * @param value to be set
- * @hide
- */
- public void setFieldValue(String key, String value) {
- setFieldValue(key, value, "");
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- for (String key : mFields.keySet()) {
- // Don't display password in toString().
- String value = PASSWORD_KEY.equals(key) ? "<removed>" : mFields.get(key);
- sb.append(key).append(" ").append(value).append("\n");
- }
- if (mEapMethod >= 0 && mEapMethod < Eap.strings.length) {
- sb.append("eap_method: ").append(Eap.strings[mEapMethod]).append("\n");
- }
- if (mPhase2Method > 0 && mPhase2Method < Phase2.strings.length) {
- sb.append("phase2_method: ").append(Phase2.strings[mPhase2Method]).append("\n");
- }
- sb.append(" ocsp: ").append(mOcsp).append("\n");
- return sb.toString();
- }
-
- /**
- * Returns whether the EAP method data is valid, i.e., whether mEapMethod and mPhase2Method
- * are valid indices into {@code Eap.strings[]} and {@code Phase2.strings[]} respectively.
- */
- private boolean isEapMethodValid() {
- if (mEapMethod == Eap.NONE) {
- Log.e(TAG, "WiFi enterprise configuration is invalid as it supplies no EAP method.");
- return false;
- }
- if (mEapMethod < 0 || mEapMethod >= Eap.strings.length) {
- Log.e(TAG, "mEapMethod is invald for WiFi enterprise configuration: " + mEapMethod);
- return false;
- }
- if (mPhase2Method < 0 || mPhase2Method >= Phase2.strings.length) {
- Log.e(TAG, "mPhase2Method is invald for WiFi enterprise configuration: "
- + mPhase2Method);
- return false;
- }
- return true;
- }
-
- /**
- * Check if certificate was installed by an app, or manually (not by an app). If true,
- * certificate and keys will be removed from key storage when this network is removed. If not,
- * then certificates and keys remain persistent until the user manually removes them.
- *
- * @return true if certificate was installed by an app, false if certificate was installed
- * manually by the user.
- * @hide
- */
- public boolean isAppInstalledDeviceKeyAndCert() {
- return mIsAppInstalledDeviceKeyAndCert;
- }
-
- /**
- * Initialize the value of the app installed device key and cert flag.
- *
- * @param isAppInstalledDeviceKeyAndCert true or false
- * @hide
- */
- public void initIsAppInstalledDeviceKeyAndCert(boolean isAppInstalledDeviceKeyAndCert) {
- mIsAppInstalledDeviceKeyAndCert = isAppInstalledDeviceKeyAndCert;
- }
-
- /**
- * Check if CA certificate was installed by an app, or manually (not by an app). If true,
- * CA certificate will be removed from key storage when this network is removed. If not,
- * then certificates and keys remain persistent until the user manually removes them.
- *
- * @return true if CA certificate was installed by an app, false if CA certificate was installed
- * manually by the user.
- * @hide
- */
- public boolean isAppInstalledCaCert() {
- return mIsAppInstalledCaCert;
- }
-
- /**
- * Initialize the value of the app installed root CA cert flag.
- *
- * @param isAppInstalledCaCert true or false
- * @hide
- */
- public void initIsAppInstalledCaCert(boolean isAppInstalledCaCert) {
- mIsAppInstalledCaCert = isAppInstalledCaCert;
- }
-
- /**
- * Set the OCSP type.
- * @param ocsp is one of {@link ##OCSP_NONE}, {@link #OCSP_REQUEST_CERT_STATUS},
- * {@link #OCSP_REQUIRE_CERT_STATUS} or
- * {@link #OCSP_REQUIRE_ALL_NON_TRUSTED_CERTS_STATUS}
- * @throws IllegalArgumentException if the OCSP type is invalid
- * @hide
- */
- @SystemApi
- public void setOcsp(@Ocsp int ocsp) {
- if (ocsp >= OCSP_NONE && ocsp <= OCSP_REQUIRE_ALL_NON_TRUSTED_CERTS_STATUS) {
- mOcsp = ocsp;
- } else {
- throw new IllegalArgumentException("Invalid OCSP type.");
- }
- }
-
- /**
- * Get the OCSP type.
- * @hide
- */
- @SystemApi
- public @Ocsp int getOcsp() {
- return mOcsp;
- }
-
- /**
- * Utility method to determine whether the configuration's authentication method is SIM-based.
- *
- * @return true if the credential information requires SIM card for current authentication
- * method, otherwise it returns false.
- */
- public boolean isAuthenticationSimBased() {
- if (mEapMethod == Eap.SIM || mEapMethod == Eap.AKA || mEapMethod == Eap.AKA_PRIME) {
- return true;
- }
- if (mEapMethod == Eap.PEAP) {
- return mPhase2Method == Phase2.SIM || mPhase2Method == Phase2.AKA
- || mPhase2Method == Phase2.AKA_PRIME;
- }
- return false;
- }
-
- /**
- * Set the WAPI certificate suite name on wpa_supplicant.
- *
- * If this field is not specified, WAPI-CERT uses ASU ID from WAI packet
- * as the certificate suite name automatically.
- *
- * @param wapiCertSuite The name for WAPI certificate suite, or empty string to clear.
- * @hide
- */
- @SystemApi
- public void setWapiCertSuite(@NonNull String wapiCertSuite) {
- setFieldValue(WAPI_CERT_SUITE_KEY, wapiCertSuite);
- }
-
- /**
- * Get the WAPI certificate suite name
- * @return the certificate suite name
- * @hide
- */
- @NonNull
- @SystemApi
- public String getWapiCertSuite() {
- return getFieldValue(WAPI_CERT_SUITE_KEY);
- }
-
- /**
- * Method determines whether the Enterprise configuration is insecure. An insecure
- * configuration is one where EAP method requires a CA certification, i.e. PEAP, TLS, or
- * TTLS, and any of the following conditions are met:
- * - Both certificate and CA path are not configured.
- * - Both alternative subject match and domain suffix match are not set.
- *
- * Note: this method does not exhaustively check security of the configuration - i.e. a return
- * value of {@code false} is not a guarantee that the configuration is secure.
- * @hide
- */
- public boolean isInsecure() {
- if (mEapMethod != Eap.PEAP && mEapMethod != Eap.TLS && mEapMethod != Eap.TTLS) {
- return false;
- }
- if (TextUtils.isEmpty(getAltSubjectMatch())
- && TextUtils.isEmpty(getDomainSuffixMatch())) {
- // Both subject and domain match are not set, it's insecure.
- return true;
- }
- if (mIsAppInstalledCaCert) {
- // CA certificate is installed by App, it's secure.
- return false;
- }
- if (getCaCertificateAliases() != null) {
- // CA certificate alias from keyStore is set, it's secure.
- return false;
- }
- return TextUtils.isEmpty(getCaPath());
- }
-
- /**
- * Check if a given certificate Get the Suite-B cipher from the certificate
- *
- * @param x509Certificate Certificate to process
- * @return true if the certificate OID matches the Suite-B requirements for RSA or ECDSA
- * certificates, or false otherwise.
- * @hide
- */
- public static boolean isSuiteBCipherCert(@Nullable X509Certificate x509Certificate) {
- if (x509Certificate == null) {
- return false;
- }
- final String sigAlgOid = x509Certificate.getSigAlgOID();
-
- // Wi-Fi alliance requires the use of both ECDSA secp384r1 and RSA 3072 certificates
- // in WPA3-Enterprise 192-bit security networks, which are also known as Suite-B-192
- // networks, even though NSA Suite-B-192 mandates ECDSA only. The use of the term
- // Suite-B was already coined in the IEEE 802.11-2016 specification for
- // AKM 00-0F-AC but the test plan for WPA3-Enterprise 192-bit for APs mandates
- // support for both RSA and ECDSA, and for STAs it mandates ECDSA and optionally
- // RSA. In order to be compatible with all WPA3-Enterprise 192-bit deployments,
- // we are supporting both types here.
- if (sigAlgOid.equals("1.2.840.113549.1.1.12")) {
- // sha384WithRSAEncryption
- if (x509Certificate.getPublicKey() instanceof RSAPublicKey) {
- final RSAPublicKey rsaPublicKey = (RSAPublicKey) x509Certificate.getPublicKey();
- if (rsaPublicKey.getModulus() != null
- && rsaPublicKey.getModulus().bitLength() >= 3072) {
- return true;
- }
- }
- } else if (sigAlgOid.equals("1.2.840.10045.4.3.3")) {
- // ecdsa-with-SHA384
- if (x509Certificate.getPublicKey() instanceof ECPublicKey) {
- final ECPublicKey ecPublicKey = (ECPublicKey) x509Certificate.getPublicKey();
- final ECParameterSpec ecParameterSpec = ecPublicKey.getParams();
-
- if (ecParameterSpec != null && ecParameterSpec.getOrder() != null
- && ecParameterSpec.getOrder().bitLength() >= 384) {
- return true;
- }
- }
- }
- return false;
- }
-}
diff --git a/wifi/java/android/net/wifi/WifiFrameworkInitializer.java b/wifi/java/android/net/wifi/WifiFrameworkInitializer.java
deleted file mode 100644
index 1507199..0000000
--- a/wifi/java/android/net/wifi/WifiFrameworkInitializer.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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.net.wifi;
-
-import android.annotation.SystemApi;
-import android.app.SystemServiceRegistry;
-import android.content.Context;
-import android.net.wifi.aware.IWifiAwareManager;
-import android.net.wifi.aware.WifiAwareManager;
-import android.net.wifi.p2p.IWifiP2pManager;
-import android.net.wifi.p2p.WifiP2pManager;
-import android.net.wifi.rtt.IWifiRttManager;
-import android.net.wifi.rtt.WifiRttManager;
-import android.os.HandlerThread;
-import android.os.Looper;
-
-/**
- * Class for performing registration for all Wifi services.
- *
- * @hide
- */
-@SystemApi
-public class WifiFrameworkInitializer {
-
- /**
- * A class implementing the lazy holder idiom: the unique static instance
- * of {@link #INSTANCE} is instantiated in a thread-safe way (guaranteed by
- * the language specs) the first time that NoPreloadHolder is referenced in getInstanceLooper().
- *
- * This is necessary because we can't spawn a new thread in {@link #registerServiceWrappers()}.
- * {@link #registerServiceWrappers()} is called during the Zygote phase, which disallows
- * spawning new threads. Naming the class "NoPreloadHolder" ensures that the classloader will
- * not preload this class, inadvertently spawning the thread too early.
- */
- private static class NoPreloadHolder {
- private static final HandlerThread INSTANCE = createInstance();
-
- private static HandlerThread createInstance() {
- HandlerThread thread = new HandlerThread("WifiManagerThread");
- thread.start();
- return thread;
- }
- }
-
- private static Looper getInstanceLooper() {
- return NoPreloadHolder.INSTANCE.getLooper();
- }
-
- private WifiFrameworkInitializer() {}
-
- /**
- * Called by {@link SystemServiceRegistry}'s static initializer and registers all Wifi services
- * to {@link Context}, so that {@link Context#getSystemService} can return them.
- *
- * @throws IllegalStateException if this is called from anywhere besides
- * {@link SystemServiceRegistry}
- */
- public static void registerServiceWrappers() {
- SystemServiceRegistry.registerContextAwareService(
- Context.WIFI_SERVICE,
- WifiManager.class,
- (context, serviceBinder) -> {
- IWifiManager service = IWifiManager.Stub.asInterface(serviceBinder);
- return new WifiManager(context, service, getInstanceLooper());
- }
- );
- SystemServiceRegistry.registerStaticService(
- Context.WIFI_P2P_SERVICE,
- WifiP2pManager.class,
- serviceBinder -> {
- IWifiP2pManager service = IWifiP2pManager.Stub.asInterface(serviceBinder);
- return new WifiP2pManager(service);
- }
- );
- SystemServiceRegistry.registerContextAwareService(
- Context.WIFI_AWARE_SERVICE,
- WifiAwareManager.class,
- (context, serviceBinder) -> {
- IWifiAwareManager service = IWifiAwareManager.Stub.asInterface(serviceBinder);
- return new WifiAwareManager(context, service);
- }
- );
- SystemServiceRegistry.registerContextAwareService(
- Context.WIFI_SCANNING_SERVICE,
- WifiScanner.class,
- (context, serviceBinder) -> {
- IWifiScanner service = IWifiScanner.Stub.asInterface(serviceBinder);
- return new WifiScanner(context, service, getInstanceLooper());
- }
- );
- SystemServiceRegistry.registerContextAwareService(
- Context.WIFI_RTT_RANGING_SERVICE,
- WifiRttManager.class,
- (context, serviceBinder) -> {
- IWifiRttManager service = IWifiRttManager.Stub.asInterface(serviceBinder);
- return new WifiRttManager(context, service);
- }
- );
- SystemServiceRegistry.registerContextAwareService(
- Context.WIFI_RTT_SERVICE,
- RttManager.class,
- context -> {
- WifiRttManager wifiRttManager = context.getSystemService(WifiRttManager.class);
- return new RttManager(context, wifiRttManager);
- }
- );
- }
-}
diff --git a/wifi/java/android/net/wifi/WifiInfo.java b/wifi/java/android/net/wifi/WifiInfo.java
deleted file mode 100644
index 6bd1ce5..0000000
--- a/wifi/java/android/net/wifi/WifiInfo.java
+++ /dev/null
@@ -1,1175 +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 android.net.wifi;
-
-import android.annotation.IntRange;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SystemApi;
-import android.compat.annotation.UnsupportedAppUsage;
-import android.net.NetworkInfo.DetailedState;
-import android.os.Build;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.telephony.SubscriptionManager;
-import android.text.TextUtils;
-
-import com.android.modules.utils.build.SdkLevel;
-import com.android.net.module.util.Inet4AddressUtils;
-
-import java.net.Inet4Address;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.EnumMap;
-import java.util.Locale;
-
-/**
- * Describes the state of any Wi-Fi connection that is active or
- * is in the process of being set up.
- */
-public class WifiInfo implements Parcelable {
- private static final String TAG = "WifiInfo";
- /**
- * This is the map described in the Javadoc comment above. The positions
- * of the elements of the array must correspond to the ordinal values
- * of <code>DetailedState</code>.
- */
- private static final EnumMap<SupplicantState, DetailedState> stateMap =
- new EnumMap<SupplicantState, DetailedState>(SupplicantState.class);
-
- /**
- * Default MAC address reported to a client that does not have the
- * android.permission.LOCAL_MAC_ADDRESS permission.
- *
- * @hide
- */
- @SystemApi
- public static final String DEFAULT_MAC_ADDRESS = "02:00:00:00:00:00";
-
- static {
- stateMap.put(SupplicantState.DISCONNECTED, DetailedState.DISCONNECTED);
- stateMap.put(SupplicantState.INTERFACE_DISABLED, DetailedState.DISCONNECTED);
- stateMap.put(SupplicantState.INACTIVE, DetailedState.IDLE);
- stateMap.put(SupplicantState.SCANNING, DetailedState.SCANNING);
- stateMap.put(SupplicantState.AUTHENTICATING, DetailedState.CONNECTING);
- stateMap.put(SupplicantState.ASSOCIATING, DetailedState.CONNECTING);
- stateMap.put(SupplicantState.ASSOCIATED, DetailedState.CONNECTING);
- stateMap.put(SupplicantState.FOUR_WAY_HANDSHAKE, DetailedState.AUTHENTICATING);
- stateMap.put(SupplicantState.GROUP_HANDSHAKE, DetailedState.AUTHENTICATING);
- stateMap.put(SupplicantState.COMPLETED, DetailedState.OBTAINING_IPADDR);
- stateMap.put(SupplicantState.DORMANT, DetailedState.DISCONNECTED);
- stateMap.put(SupplicantState.UNINITIALIZED, DetailedState.IDLE);
- stateMap.put(SupplicantState.INVALID, DetailedState.FAILED);
- }
-
- private SupplicantState mSupplicantState;
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
- private String mBSSID;
- @UnsupportedAppUsage
- private WifiSsid mWifiSsid;
- private int mNetworkId;
-
- /**
- * Used to indicate that the RSSI is invalid, for example if no RSSI measurements are available
- * yet.
- * @hide
- */
- @SystemApi
- public static final int INVALID_RSSI = -127;
-
- /** @hide **/
- public static final int MIN_RSSI = -126;
-
- /** @hide **/
- public static final int MAX_RSSI = 200;
-
-
- /**
- * Received Signal Strength Indicator
- */
- private int mRssi;
-
- /**
- * Wi-Fi standard for the connection
- */
- private @WifiAnnotations.WifiStandard int mWifiStandard;
-
- /**
- * The unit in which links speeds are expressed.
- */
- public static final String LINK_SPEED_UNITS = "Mbps";
- private int mLinkSpeed;
-
- /**
- * Constant for unknown link speed.
- */
- public static final int LINK_SPEED_UNKNOWN = -1;
-
- /**
- * Tx(transmit) Link speed in Mbps
- */
- private int mTxLinkSpeed;
-
- /**
- * Max supported Tx(transmit) link speed in Mbps
- */
- private int mMaxSupportedTxLinkSpeed;
-
- /**
- * Rx(receive) Link speed in Mbps
- */
- private int mRxLinkSpeed;
-
- /**
- * Max supported Rx(receive) link speed in Mbps
- */
- private int mMaxSupportedRxLinkSpeed;
-
- /**
- * Frequency in MHz
- */
- public static final String FREQUENCY_UNITS = "MHz";
- private int mFrequency;
-
- @UnsupportedAppUsage
- private InetAddress mIpAddress;
- @UnsupportedAppUsage
- private String mMacAddress = DEFAULT_MAC_ADDRESS;
-
- /**
- * Whether the network is ephemeral or not.
- */
- private boolean mEphemeral;
-
- /**
- * Whether the network is trusted or not.
- */
- private boolean mTrusted;
-
- /**
- * Whether the network is oem paid or not.
- */
- private boolean mOemPaid;
-
- /**
- * Whether the network is oem private or not.
- */
- private boolean mOemPrivate;
-
- /**
- * Whether the network is a carrier merged network.
- */
- private boolean mCarrierMerged;
-
- /**
- * OSU (Online Sign Up) AP for Passpoint R2.
- */
- private boolean mOsuAp;
-
- /**
- * Fully qualified domain name of a Passpoint configuration
- */
- private String mFqdn;
-
- /**
- * Name of Passpoint credential provider
- */
- private String mProviderFriendlyName;
-
- /**
- * If connected to a network suggestion or specifier, store the package name of the app,
- * else null.
- */
- private String mRequestingPackageName;
-
- /**
- * Identify which Telephony subscription provides this network.
- */
- private int mSubscriptionId;
-
- /**
- * Running total count of lost (not ACKed) transmitted unicast data packets.
- * @hide
- */
- public long txBad;
- /**
- * Running total count of transmitted unicast data retry packets.
- * @hide
- */
- public long txRetries;
- /**
- * Running total count of successfully transmitted (ACKed) unicast data packets.
- * @hide
- */
- public long txSuccess;
- /**
- * Running total count of received unicast data packets.
- * @hide
- */
- public long rxSuccess;
-
- private double mLostTxPacketsPerSecond;
-
- /**
- * Average rate of lost transmitted packets, in units of packets per second.
- * @hide
- */
- @SystemApi
- public double getLostTxPacketsPerSecond() {
- return mLostTxPacketsPerSecond;
- }
-
- /** @hide */
- public void setLostTxPacketsPerSecond(double lostTxPacketsPerSecond) {
- mLostTxPacketsPerSecond = lostTxPacketsPerSecond;
- }
-
- private double mTxRetriedTxPacketsPerSecond;
-
- /**
- * Average rate of transmitted retry packets, in units of packets per second.
- * @hide
- */
- @SystemApi
- public double getRetriedTxPacketsPerSecond() {
- return mTxRetriedTxPacketsPerSecond;
- }
-
- /** @hide */
- public void setRetriedTxPacketsRate(double txRetriedTxPacketsPerSecond) {
- mTxRetriedTxPacketsPerSecond = txRetriedTxPacketsPerSecond;
- }
-
- private double mSuccessfulTxPacketsPerSecond;
-
- /**
- * Average rate of successfully transmitted unicast packets, in units of packets per second.
- * @hide
- */
- @SystemApi
- public double getSuccessfulTxPacketsPerSecond() {
- return mSuccessfulTxPacketsPerSecond;
- }
-
- /** @hide */
- public void setSuccessfulTxPacketsPerSecond(double successfulTxPacketsPerSecond) {
- mSuccessfulTxPacketsPerSecond = successfulTxPacketsPerSecond;
- }
-
- private double mSuccessfulRxPacketsPerSecond;
-
- /**
- * Average rate of received unicast data packets, in units of packets per second.
- * @hide
- */
- @SystemApi
- public double getSuccessfulRxPacketsPerSecond() {
- return mSuccessfulRxPacketsPerSecond;
- }
-
- /** @hide */
- public void setSuccessfulRxPacketsPerSecond(double successfulRxPacketsPerSecond) {
- mSuccessfulRxPacketsPerSecond = successfulRxPacketsPerSecond;
- }
-
- /** @hide */
- @UnsupportedAppUsage
- public int score;
-
- /**
- * The current Wifi score.
- * NOTE: this value should only be used for debugging purposes. Do not rely on this value for
- * any computations. The meaning of this value can and will change at any time without warning.
- * @hide
- */
- @SystemApi
- public int getScore() {
- return score;
- }
-
- /** @hide */
- public void setScore(int score) {
- this.score = score;
- }
-
- /**
- * Flag indicating that AP has hinted that upstream connection is metered,
- * and sensitive to heavy data transfers.
- */
- private boolean mMeteredHint;
-
- /**
- * Passpoint unique key
- */
- private String mPasspointUniqueId;
-
- /** @hide */
- @UnsupportedAppUsage
- public WifiInfo() {
- mWifiSsid = null;
- mBSSID = null;
- mNetworkId = -1;
- mSupplicantState = SupplicantState.UNINITIALIZED;
- mRssi = INVALID_RSSI;
- mLinkSpeed = LINK_SPEED_UNKNOWN;
- mFrequency = -1;
- mSubscriptionId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
- }
-
- /** @hide */
- public void reset() {
- setInetAddress(null);
- setBSSID(null);
- setSSID(null);
- setNetworkId(-1);
- setRssi(INVALID_RSSI);
- setLinkSpeed(LINK_SPEED_UNKNOWN);
- setTxLinkSpeedMbps(LINK_SPEED_UNKNOWN);
- setRxLinkSpeedMbps(LINK_SPEED_UNKNOWN);
- setMaxSupportedTxLinkSpeedMbps(LINK_SPEED_UNKNOWN);
- setMaxSupportedRxLinkSpeedMbps(LINK_SPEED_UNKNOWN);
- setFrequency(-1);
- setMeteredHint(false);
- setEphemeral(false);
- setTrusted(false);
- setOemPaid(false);
- setOemPrivate(false);
- setCarrierMerged(false);
- setOsuAp(false);
- setRequestingPackageName(null);
- setFQDN(null);
- setProviderFriendlyName(null);
- setPasspointUniqueId(null);
- setSubscriptionId(SubscriptionManager.INVALID_SUBSCRIPTION_ID);
- txBad = 0;
- txSuccess = 0;
- rxSuccess = 0;
- txRetries = 0;
- mLostTxPacketsPerSecond = 0;
- mSuccessfulTxPacketsPerSecond = 0;
- mSuccessfulRxPacketsPerSecond = 0;
- mTxRetriedTxPacketsPerSecond = 0;
- score = 0;
- }
-
- /**
- * Copy constructor
- * @hide
- */
- public WifiInfo(WifiInfo source) {
- if (source != null) {
- mSupplicantState = source.mSupplicantState;
- mBSSID = source.mBSSID;
- mWifiSsid = source.mWifiSsid;
- mNetworkId = source.mNetworkId;
- mRssi = source.mRssi;
- mLinkSpeed = source.mLinkSpeed;
- mTxLinkSpeed = source.mTxLinkSpeed;
- mRxLinkSpeed = source.mRxLinkSpeed;
- mFrequency = source.mFrequency;
- mIpAddress = source.mIpAddress;
- mMacAddress = source.mMacAddress;
- mMeteredHint = source.mMeteredHint;
- mEphemeral = source.mEphemeral;
- mTrusted = source.mTrusted;
- mOemPaid = source.mOemPaid;
- mOemPrivate = source.mOemPrivate;
- mCarrierMerged = source.mCarrierMerged;
- mRequestingPackageName =
- source.mRequestingPackageName;
- mOsuAp = source.mOsuAp;
- mFqdn = source.mFqdn;
- mProviderFriendlyName = source.mProviderFriendlyName;
- mSubscriptionId = source.mSubscriptionId;
- txBad = source.txBad;
- txRetries = source.txRetries;
- txSuccess = source.txSuccess;
- rxSuccess = source.rxSuccess;
- mLostTxPacketsPerSecond = source.mLostTxPacketsPerSecond;
- mTxRetriedTxPacketsPerSecond = source.mTxRetriedTxPacketsPerSecond;
- mSuccessfulTxPacketsPerSecond = source.mSuccessfulTxPacketsPerSecond;
- mSuccessfulRxPacketsPerSecond = source.mSuccessfulRxPacketsPerSecond;
- score = source.score;
- mWifiStandard = source.mWifiStandard;
- mMaxSupportedTxLinkSpeed = source.mMaxSupportedTxLinkSpeed;
- mMaxSupportedRxLinkSpeed = source.mMaxSupportedRxLinkSpeed;
- mPasspointUniqueId = source.mPasspointUniqueId;
- }
- }
-
- /** Builder for WifiInfo */
- public static final class Builder {
- private final WifiInfo mWifiInfo = new WifiInfo();
-
- /**
- * Set the SSID, in the form of a raw byte array.
- * @see WifiInfo#getSSID()
- */
- @NonNull
- public Builder setSsid(@NonNull byte[] ssid) {
- mWifiInfo.setSSID(WifiSsid.createFromByteArray(ssid));
- return this;
- }
-
- /**
- * Set the BSSID.
- * @see WifiInfo#getBSSID()
- */
- @NonNull
- public Builder setBssid(@NonNull String bssid) {
- mWifiInfo.setBSSID(bssid);
- return this;
- }
-
- /**
- * Set the RSSI, in dBm.
- * @see WifiInfo#getRssi()
- */
- @NonNull
- public Builder setRssi(int rssi) {
- mWifiInfo.setRssi(rssi);
- return this;
- }
-
- /**
- * Set the network ID.
- * @see WifiInfo#getNetworkId()
- */
- @NonNull
- public Builder setNetworkId(int networkId) {
- mWifiInfo.setNetworkId(networkId);
- return this;
- }
-
- /**
- * Build a WifiInfo object.
- */
- @NonNull
- public WifiInfo build() {
- return new WifiInfo(mWifiInfo);
- }
- }
-
- /** @hide */
- public void setSSID(WifiSsid wifiSsid) {
- mWifiSsid = wifiSsid;
- }
-
- /**
- * Returns the service set identifier (SSID) of the current 802.11 network.
- * <p>
- * If the SSID can be decoded as UTF-8, it will be returned surrounded by double
- * quotation marks. Otherwise, it is returned as a string of hex digits.
- * The SSID may be {@link WifiManager#UNKNOWN_SSID}, if there is no network currently connected
- * or if the caller has insufficient permissions to access the SSID.
- * </p>
- * <p>
- * Prior to {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}, this method
- * always returned the SSID with no quotes around it.
- * </p>
- *
- * @return the SSID.
- */
- public String getSSID() {
- if (mWifiSsid != null) {
- String unicode = mWifiSsid.toString();
- if (!TextUtils.isEmpty(unicode)) {
- return "\"" + unicode + "\"";
- } else {
- String hex = mWifiSsid.getHexString();
- return (hex != null) ? hex : WifiManager.UNKNOWN_SSID;
- }
- }
- return WifiManager.UNKNOWN_SSID;
- }
-
- /** @hide */
- @UnsupportedAppUsage
- public WifiSsid getWifiSsid() {
- return mWifiSsid;
- }
-
- /** @hide */
- @UnsupportedAppUsage
- public void setBSSID(String BSSID) {
- mBSSID = BSSID;
- }
-
- /**
- * Return the basic service set identifier (BSSID) of the current access point.
- * <p>
- * The BSSID may be
- * <lt>{@code null}, if there is no network currently connected.</lt>
- * <lt>{@code "02:00:00:00:00:00"}, if the caller has insufficient permissions to access the
- * BSSID.<lt>
- * </p>
- *
- * @return the BSSID, in the form of a six-byte MAC address: {@code XX:XX:XX:XX:XX:XX}
- */
- public String getBSSID() {
- return mBSSID;
- }
-
- /**
- * Returns the received signal strength indicator of the current 802.11
- * network, in dBm.
- *
- * <p>Use {@link android.net.wifi.WifiManager#calculateSignalLevel} to convert this number into
- * an absolute signal level which can be displayed to a user.
- *
- * @return the RSSI.
- */
- public int getRssi() {
- return mRssi;
- }
-
- /** @hide */
- @UnsupportedAppUsage
- public void setRssi(int rssi) {
- if (rssi < INVALID_RSSI)
- rssi = INVALID_RSSI;
- if (rssi > MAX_RSSI)
- rssi = MAX_RSSI;
- mRssi = rssi;
- }
-
- /**
- * Sets the Wi-Fi standard
- * @hide
- */
- public void setWifiStandard(@WifiAnnotations.WifiStandard int wifiStandard) {
- mWifiStandard = wifiStandard;
- }
-
- /**
- * Get connection Wi-Fi standard
- * @return the connection Wi-Fi standard
- */
- public @WifiAnnotations.WifiStandard int getWifiStandard() {
- return mWifiStandard;
- }
-
- /**
- * Returns the current link speed in {@link #LINK_SPEED_UNITS}.
- * @return the link speed or {@link #LINK_SPEED_UNKNOWN} if link speed is unknown.
- * @see #LINK_SPEED_UNITS
- * @see #LINK_SPEED_UNKNOWN
- */
- public int getLinkSpeed() {
- return mLinkSpeed;
- }
-
- /** @hide */
- @UnsupportedAppUsage
- public void setLinkSpeed(int linkSpeed) {
- mLinkSpeed = linkSpeed;
- }
-
- /**
- * Returns the current transmit link speed in Mbps.
- * @return the Tx link speed or {@link #LINK_SPEED_UNKNOWN} if link speed is unknown.
- * @see #LINK_SPEED_UNKNOWN
- */
- @IntRange(from = -1)
- public int getTxLinkSpeedMbps() {
- return mTxLinkSpeed;
- }
-
- /**
- * Returns the maximum supported transmit link speed in Mbps
- * @return the max supported tx link speed or {@link #LINK_SPEED_UNKNOWN} if link speed is
- * unknown. @see #LINK_SPEED_UNKNOWN
- */
- public int getMaxSupportedTxLinkSpeedMbps() {
- return mMaxSupportedTxLinkSpeed;
- }
-
- /**
- * Update the last transmitted packet bit rate in Mbps.
- * @hide
- */
- public void setTxLinkSpeedMbps(int txLinkSpeed) {
- mTxLinkSpeed = txLinkSpeed;
- }
-
- /**
- * Set the maximum supported transmit link speed in Mbps
- * @hide
- */
- public void setMaxSupportedTxLinkSpeedMbps(int maxSupportedTxLinkSpeed) {
- mMaxSupportedTxLinkSpeed = maxSupportedTxLinkSpeed;
- }
-
- /**
- * Returns the current receive link speed in Mbps.
- * @return the Rx link speed or {@link #LINK_SPEED_UNKNOWN} if link speed is unknown.
- * @see #LINK_SPEED_UNKNOWN
- */
- @IntRange(from = -1)
- public int getRxLinkSpeedMbps() {
- return mRxLinkSpeed;
- }
-
- /**
- * Returns the maximum supported receive link speed in Mbps
- * @return the max supported Rx link speed or {@link #LINK_SPEED_UNKNOWN} if link speed is
- * unknown. @see #LINK_SPEED_UNKNOWN
- */
- public int getMaxSupportedRxLinkSpeedMbps() {
- return mMaxSupportedRxLinkSpeed;
- }
-
- /**
- * Update the last received packet bit rate in Mbps.
- * @hide
- */
- public void setRxLinkSpeedMbps(int rxLinkSpeed) {
- mRxLinkSpeed = rxLinkSpeed;
- }
-
- /**
- * Set the maximum supported receive link speed in Mbps
- * @hide
- */
- public void setMaxSupportedRxLinkSpeedMbps(int maxSupportedRxLinkSpeed) {
- mMaxSupportedRxLinkSpeed = maxSupportedRxLinkSpeed;
- }
-
- /**
- * Returns the current frequency in {@link #FREQUENCY_UNITS}.
- * @return the frequency.
- * @see #FREQUENCY_UNITS
- */
- public int getFrequency() {
- return mFrequency;
- }
-
- /** @hide */
- public void setFrequency(int frequency) {
- this.mFrequency = frequency;
- }
-
- /**
- * @hide
- */
- public boolean is24GHz() {
- return ScanResult.is24GHz(mFrequency);
- }
-
- /**
- * @hide
- */
- @UnsupportedAppUsage
- public boolean is5GHz() {
- return ScanResult.is5GHz(mFrequency);
- }
-
- /**
- * @hide
- */
- public boolean is6GHz() {
- return ScanResult.is6GHz(mFrequency);
- }
-
- /**
- * Record the MAC address of the WLAN interface
- * @param macAddress the MAC address in {@code XX:XX:XX:XX:XX:XX} form
- * @hide
- */
- @UnsupportedAppUsage
- public void setMacAddress(String macAddress) {
- this.mMacAddress = macAddress;
- }
-
- public String getMacAddress() {
- return mMacAddress;
- }
-
- /**
- * @return true if {@link #getMacAddress()} has a real MAC address.
- *
- * @hide
- */
- public boolean hasRealMacAddress() {
- return mMacAddress != null && !DEFAULT_MAC_ADDRESS.equals(mMacAddress);
- }
-
- /**
- * Indicates if we've dynamically detected this active network connection as
- * being metered.
- *
- * @see WifiConfiguration#isMetered(WifiConfiguration, WifiInfo)
- * @hide
- */
- public void setMeteredHint(boolean meteredHint) {
- mMeteredHint = meteredHint;
- }
-
- /** {@hide} */
- @UnsupportedAppUsage
- public boolean getMeteredHint() {
- return mMeteredHint;
- }
-
- /** {@hide} */
- public void setEphemeral(boolean ephemeral) {
- mEphemeral = ephemeral;
- }
-
- /**
- * Returns true if the current Wifi network is ephemeral, false otherwise.
- * An ephemeral network is a network that is temporary and not persisted in the system.
- * Ephemeral networks cannot be forgotten, only disabled with
- * {@link WifiManager#disableEphemeralNetwork(String)}.
- *
- * @hide
- */
- @SystemApi
- public boolean isEphemeral() {
- return mEphemeral;
- }
-
- /** {@hide} */
- public void setTrusted(boolean trusted) {
- mTrusted = trusted;
- }
-
- /**
- * Returns true if the current Wifi network is a trusted network, false otherwise.
- * @see WifiNetworkSuggestion.Builder#setUntrusted(boolean).
- * {@hide}
- */
- @SystemApi
- public boolean isTrusted() {
- return mTrusted;
- }
-
- /** {@hide} */
- public void setOemPaid(boolean oemPaid) {
- mOemPaid = oemPaid;
- }
-
- /**
- * Returns true if the current Wifi network is an oem paid network, false otherwise.
- * @see WifiNetworkSuggestion.Builder#setOemPaid(boolean).
- * {@hide}
- */
- @SystemApi
- public boolean isOemPaid() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- return mOemPaid;
- }
-
- /** {@hide} */
- public void setOemPrivate(boolean oemPrivate) {
- mOemPrivate = oemPrivate;
- }
-
- /**
- * Returns true if the current Wifi network is an oem private network, false otherwise.
- * @see WifiNetworkSuggestion.Builder#setOemPrivate(boolean).
- * {@hide}
- */
- @SystemApi
- public boolean isOemPrivate() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- return mOemPrivate;
- }
-
- /**
- * {@hide}
- */
- public void setCarrierMerged(boolean carrierMerged) {
- mCarrierMerged = carrierMerged;
- }
-
- /**
- * Returns true if the current Wifi network is a carrier merged network, false otherwise.
- * @see WifiNetworkSuggestion.Builder#setCarrierMerged(boolean).
- * {@hide}
- */
- @SystemApi
- public boolean isCarrierMerged() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- return mCarrierMerged;
- }
-
-
- /** {@hide} */
- public void setOsuAp(boolean osuAp) {
- mOsuAp = osuAp;
- }
-
- /** {@hide} */
- @SystemApi
- public boolean isOsuAp() {
- return mOsuAp;
- }
-
- /** {@hide} */
- @SystemApi
- public boolean isPasspointAp() {
- return mFqdn != null && mProviderFriendlyName != null;
- }
-
- /** {@hide} */
- public void setFQDN(@Nullable String fqdn) {
- mFqdn = fqdn;
- }
-
- /**
- * Returns the Fully Qualified Domain Name of the network if it is a Passpoint network.
- * <p>
- * The FQDN may be
- * <lt>{@code null} if no network currently connected, currently connected network is not
- * passpoint network or the caller has insufficient permissions to access the FQDN.</lt>
- * </p>
- */
- public @Nullable String getPasspointFqdn() {
- return mFqdn;
- }
-
- /** {@hide} */
- public void setProviderFriendlyName(@Nullable String providerFriendlyName) {
- mProviderFriendlyName = providerFriendlyName;
- }
-
- /**
- * Returns the Provider Friendly Name of the network if it is a Passpoint network.
- * <p>
- * The Provider Friendly Name may be
- * <lt>{@code null} if no network currently connected, currently connected network is not
- * passpoint network or the caller has insufficient permissions to access the Provider Friendly
- * Name. </lt>
- * </p>
- */
- public @Nullable String getPasspointProviderFriendlyName() {
- return mProviderFriendlyName;
- }
-
- /** {@hide} */
- public void setRequestingPackageName(@Nullable String packageName) {
- mRequestingPackageName = packageName;
- }
-
- /**
- * If this network was created in response to an app request (e.g. through Network Suggestion
- * or Network Specifier), return the package name of the app that made the request.
- * Null otherwise.
- * @hide
- */
- @SystemApi
- public @Nullable String getRequestingPackageName() {
- return mRequestingPackageName;
- }
-
- /** {@hide} */
- public void setSubscriptionId(int subId) {
- mSubscriptionId = subId;
- }
-
- /**
- * If this network is provisioned by a carrier, returns subscription Id corresponding to the
- * associated SIM on the device. If this network is not provisioned by a carrier, returns
- * {@link android.telephony.SubscriptionManager#INVALID_SUBSCRIPTION_ID}
- *
- * @see WifiNetworkSuggestion.Builder#setSubscriptionId(int)
- * @see android.telephony.SubscriptionInfo#getSubscriptionId()
- * {@hide}
- */
- @SystemApi
- public int getSubscriptionId() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- return mSubscriptionId;
- }
-
-
- /** @hide */
- @UnsupportedAppUsage
- public void setNetworkId(int id) {
- mNetworkId = id;
- }
-
- /**
- * Each configured network has a unique small integer ID, used to identify
- * the network. This method returns the ID for the currently connected network.
- * <p>
- * The networkId may be {@code -1} if there is no currently connected network or if the caller
- * has insufficient permissions to access the network ID.
- * </p>
- *
- * @return the network ID.
- */
- public int getNetworkId() {
- return mNetworkId;
- }
-
- /**
- * Return the detailed state of the supplicant's negotiation with an
- * access point, in the form of a {@link SupplicantState SupplicantState} object.
- * @return the current {@link SupplicantState SupplicantState}
- */
- public SupplicantState getSupplicantState() {
- return mSupplicantState;
- }
-
- /** @hide */
- @UnsupportedAppUsage
- public void setSupplicantState(SupplicantState state) {
- mSupplicantState = state;
- }
-
- /** @hide */
- public void setInetAddress(InetAddress address) {
- mIpAddress = address;
- }
-
- public int getIpAddress() {
- int result = 0;
- if (mIpAddress instanceof Inet4Address) {
- result = Inet4AddressUtils.inet4AddressToIntHTL((Inet4Address) mIpAddress);
- }
- return result;
- }
-
- /**
- * @return {@code true} if this network does not broadcast its SSID, so an
- * SSID-specific probe request must be used for scans.
- */
- public boolean getHiddenSSID() {
- if (mWifiSsid == null) return false;
- return mWifiSsid.isHidden();
- }
-
- /**
- * Map a supplicant state into a fine-grained network connectivity state.
- * @param suppState the supplicant state
- * @return the corresponding {@link DetailedState}
- */
- public static DetailedState getDetailedStateOf(SupplicantState suppState) {
- return stateMap.get(suppState);
- }
-
- /**
- * Set the <code>SupplicantState</code> from the string name
- * of the state.
- * @param stateName the name of the state, as a <code>String</code> returned
- * in an event sent by {@code wpa_supplicant}.
- */
- @UnsupportedAppUsage
- void setSupplicantState(String stateName) {
- mSupplicantState = valueOf(stateName);
- }
-
- static SupplicantState valueOf(String stateName) {
- if ("4WAY_HANDSHAKE".equalsIgnoreCase(stateName))
- return SupplicantState.FOUR_WAY_HANDSHAKE;
- else {
- try {
- return SupplicantState.valueOf(stateName.toUpperCase(Locale.ROOT));
- } catch (IllegalArgumentException e) {
- return SupplicantState.INVALID;
- }
- }
- }
-
- /**
- * Remove double quotes (") surrounding a SSID string, if present. Otherwise, return the
- * string unmodified. Return null if the input string was null.
- * @hide
- */
- @Nullable
- @SystemApi
- public static String sanitizeSsid(@Nullable String string) {
- return removeDoubleQuotes(string);
- }
-
- /** @hide */
- @UnsupportedAppUsage
- @Nullable
- public static String removeDoubleQuotes(@Nullable String string) {
- if (string == null) return null;
- final int length = string.length();
- if ((length > 1) && (string.charAt(0) == '"') && (string.charAt(length - 1) == '"')) {
- return string.substring(1, length - 1);
- }
- return string;
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- String none = "<none>";
-
- sb.append("SSID: ").append(mWifiSsid == null ? WifiManager.UNKNOWN_SSID : mWifiSsid)
- .append(", BSSID: ").append(mBSSID == null ? none : mBSSID)
- .append(", MAC: ").append(mMacAddress == null ? none : mMacAddress)
- .append(", Supplicant state: ")
- .append(mSupplicantState == null ? none : mSupplicantState)
- .append(", Wi-Fi standard: ").append(mWifiStandard)
- .append(", RSSI: ").append(mRssi)
- .append(", Link speed: ").append(mLinkSpeed).append(LINK_SPEED_UNITS)
- .append(", Tx Link speed: ").append(mTxLinkSpeed).append(LINK_SPEED_UNITS)
- .append(", Max Supported Tx Link speed: ")
- .append(mMaxSupportedTxLinkSpeed).append(LINK_SPEED_UNITS)
- .append(", Rx Link speed: ").append(mRxLinkSpeed).append(LINK_SPEED_UNITS)
- .append(", Max Supported Rx Link speed: ")
- .append(mMaxSupportedRxLinkSpeed).append(LINK_SPEED_UNITS)
- .append(", Frequency: ").append(mFrequency).append(FREQUENCY_UNITS)
- .append(", Net ID: ").append(mNetworkId)
- .append(", Metered hint: ").append(mMeteredHint)
- .append(", score: ").append(Integer.toString(score));
- return sb.toString();
- }
-
- /** Implement the Parcelable interface {@hide} */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(mNetworkId);
- dest.writeInt(mRssi);
- dest.writeInt(mLinkSpeed);
- dest.writeInt(mTxLinkSpeed);
- dest.writeInt(mRxLinkSpeed);
- dest.writeInt(mFrequency);
- if (mIpAddress != null) {
- dest.writeByte((byte)1);
- dest.writeByteArray(mIpAddress.getAddress());
- } else {
- dest.writeByte((byte)0);
- }
- if (mWifiSsid != null) {
- dest.writeInt(1);
- mWifiSsid.writeToParcel(dest, flags);
- } else {
- dest.writeInt(0);
- }
- dest.writeString(mBSSID);
- dest.writeString(mMacAddress);
- dest.writeInt(mMeteredHint ? 1 : 0);
- dest.writeInt(mEphemeral ? 1 : 0);
- dest.writeInt(mTrusted ? 1 : 0);
- dest.writeInt(mOemPaid ? 1 : 0);
- dest.writeInt(mOemPrivate ? 1 : 0);
- dest.writeInt(mCarrierMerged ? 1 : 0);
- dest.writeInt(score);
- dest.writeLong(txSuccess);
- dest.writeDouble(mSuccessfulTxPacketsPerSecond);
- dest.writeLong(txRetries);
- dest.writeDouble(mTxRetriedTxPacketsPerSecond);
- dest.writeLong(txBad);
- dest.writeDouble(mLostTxPacketsPerSecond);
- dest.writeLong(rxSuccess);
- dest.writeDouble(mSuccessfulRxPacketsPerSecond);
- mSupplicantState.writeToParcel(dest, flags);
- dest.writeInt(mOsuAp ? 1 : 0);
- dest.writeString(mRequestingPackageName);
- dest.writeString(mFqdn);
- dest.writeString(mProviderFriendlyName);
- dest.writeInt(mWifiStandard);
- dest.writeInt(mMaxSupportedTxLinkSpeed);
- dest.writeInt(mMaxSupportedRxLinkSpeed);
- dest.writeString(mPasspointUniqueId);
- dest.writeInt(mSubscriptionId);
- }
-
- /** Implement the Parcelable interface {@hide} */
- @UnsupportedAppUsage
- public static final @android.annotation.NonNull Creator<WifiInfo> CREATOR =
- new Creator<WifiInfo>() {
- public WifiInfo createFromParcel(Parcel in) {
- WifiInfo info = new WifiInfo();
- info.setNetworkId(in.readInt());
- info.setRssi(in.readInt());
- info.setLinkSpeed(in.readInt());
- info.setTxLinkSpeedMbps(in.readInt());
- info.setRxLinkSpeedMbps(in.readInt());
- info.setFrequency(in.readInt());
- if (in.readByte() == 1) {
- try {
- info.setInetAddress(InetAddress.getByAddress(in.createByteArray()));
- } catch (UnknownHostException e) {}
- }
- if (in.readInt() == 1) {
- info.mWifiSsid = WifiSsid.CREATOR.createFromParcel(in);
- }
- info.mBSSID = in.readString();
- info.mMacAddress = in.readString();
- info.mMeteredHint = in.readInt() != 0;
- info.mEphemeral = in.readInt() != 0;
- info.mTrusted = in.readInt() != 0;
- info.mOemPaid = in.readInt() != 0;
- info.mOemPrivate = in.readInt() != 0;
- info.mCarrierMerged = in.readInt() != 0;
- info.score = in.readInt();
- info.txSuccess = in.readLong();
- info.mSuccessfulTxPacketsPerSecond = in.readDouble();
- info.txRetries = in.readLong();
- info.mTxRetriedTxPacketsPerSecond = in.readDouble();
- info.txBad = in.readLong();
- info.mLostTxPacketsPerSecond = in.readDouble();
- info.rxSuccess = in.readLong();
- info.mSuccessfulRxPacketsPerSecond = in.readDouble();
- info.mSupplicantState = SupplicantState.CREATOR.createFromParcel(in);
- info.mOsuAp = in.readInt() != 0;
- info.mRequestingPackageName = in.readString();
- info.mFqdn = in.readString();
- info.mProviderFriendlyName = in.readString();
- info.mWifiStandard = in.readInt();
- info.mMaxSupportedTxLinkSpeed = in.readInt();
- info.mMaxSupportedRxLinkSpeed = in.readInt();
- info.mPasspointUniqueId = in.readString();
- info.mSubscriptionId = in.readInt();
- return info;
- }
-
- public WifiInfo[] newArray(int size) {
- return new WifiInfo[size];
- }
- };
-
- /**
- * Set the Passpoint unique identifier for the current connection
- *
- * @param passpointUniqueId Unique identifier
- * @hide
- */
- public void setPasspointUniqueId(@Nullable String passpointUniqueId) {
- mPasspointUniqueId = passpointUniqueId;
- }
-
- /**
- * Get the Passpoint unique identifier for the current connection
- *
- * @return Passpoint unique identifier
- * @hide
- */
- public @Nullable String getPasspointUniqueId() {
- return mPasspointUniqueId;
- }
-}
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
deleted file mode 100644
index 6496cc7..0000000
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ /dev/null
@@ -1,6999 +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 android.net.wifi;
-
-import static android.Manifest.permission.ACCESS_FINE_LOCATION;
-import static android.Manifest.permission.ACCESS_WIFI_STATE;
-import static android.Manifest.permission.READ_WIFI_CREDENTIAL;
-
-import android.annotation.CallbackExecutor;
-import android.annotation.IntDef;
-import android.annotation.IntRange;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.RequiresPermission;
-import android.annotation.SdkConstant;
-import android.annotation.SdkConstant.SdkConstantType;
-import android.annotation.SuppressLint;
-import android.annotation.SystemApi;
-import android.annotation.SystemService;
-import android.app.ActivityManager;
-import android.compat.annotation.UnsupportedAppUsage;
-import android.content.Context;
-import android.net.ConnectivityManager;
-import android.net.DhcpInfo;
-import android.net.MacAddress;
-import android.net.Network;
-import android.net.NetworkStack;
-import android.net.wifi.hotspot2.IProvisioningCallback;
-import android.net.wifi.hotspot2.OsuProvider;
-import android.net.wifi.hotspot2.PasspointConfiguration;
-import android.net.wifi.hotspot2.ProvisioningCallback;
-import android.os.Binder;
-import android.os.Build;
-import android.os.Handler;
-import android.os.HandlerExecutor;
-import android.os.IBinder;
-import android.os.Looper;
-import android.os.RemoteException;
-import android.os.WorkSource;
-import android.os.connectivity.WifiActivityEnergyInfo;
-import android.telephony.SubscriptionInfo;
-import android.telephony.TelephonyManager;
-import android.text.TextUtils;
-import android.util.CloseGuard;
-import android.util.Log;
-import android.util.Pair;
-import android.util.SparseArray;
-
-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;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.ref.Reference;
-import java.lang.ref.WeakReference;
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.concurrent.Executor;
-
-/**
- * This class provides the primary API for managing all aspects of Wi-Fi
- * connectivity.
- * <p>
- * On releases before {@link android.os.Build.VERSION_CODES#N}, this object
- * should only be obtained from an {@linkplain Context#getApplicationContext()
- * application context}, and not from any other derived context to avoid memory
- * leaks within the calling process.
- * <p>
- * It deals with several categories of items:
- * </p>
- * <ul>
- * <li>The list of configured networks. The list can be viewed and updated, and
- * attributes of individual entries can be modified.</li>
- * <li>The currently active Wi-Fi network, if any. Connectivity can be
- * established or torn down, and dynamic information about the state of the
- * network can be queried.</li>
- * <li>Results of access point scans, containing enough information to make
- * decisions about what access point to connect to.</li>
- * <li>It defines the names of various Intent actions that are broadcast upon
- * any sort of change in Wi-Fi state.
- * </ul>
- * <p>
- * This is the API to use when performing Wi-Fi specific operations. To perform
- * operations that pertain to network connectivity at an abstract level, use
- * {@link android.net.ConnectivityManager}.
- * </p>
- */
-@SystemService(Context.WIFI_SERVICE)
-public class WifiManager {
-
- private static final String TAG = "WifiManager";
- // Supplicant error codes:
- /**
- * The error code if there was a problem authenticating.
- * @deprecated This is no longer supported.
- */
- @Deprecated
- public static final int ERROR_AUTHENTICATING = 1;
-
- /**
- * The reason code if there is no error during authentication.
- * It could also imply that there no authentication in progress,
- * this reason code also serves as a reset value.
- * @deprecated This is no longer supported.
- * @hide
- */
- @Deprecated
- public static final int ERROR_AUTH_FAILURE_NONE = 0;
-
- /**
- * The reason code if there was a timeout authenticating.
- * @deprecated This is no longer supported.
- * @hide
- */
- @Deprecated
- public static final int ERROR_AUTH_FAILURE_TIMEOUT = 1;
-
- /**
- * The reason code if there was a wrong password while
- * authenticating.
- * @deprecated This is no longer supported.
- * @hide
- */
- @Deprecated
- public static final int ERROR_AUTH_FAILURE_WRONG_PSWD = 2;
-
- /**
- * The reason code if there was EAP failure while
- * authenticating.
- * @deprecated This is no longer supported.
- * @hide
- */
- @Deprecated
- public static final int ERROR_AUTH_FAILURE_EAP_FAILURE = 3;
-
- /** @hide */
- public static final int NETWORK_SUGGESTIONS_MAX_PER_APP_LOW_RAM = 256;
-
- /** @hide */
- public static final int NETWORK_SUGGESTIONS_MAX_PER_APP_HIGH_RAM = 1024;
-
- /**
- * Reason code if all of the network suggestions were successfully added or removed.
- */
- public static final int STATUS_NETWORK_SUGGESTIONS_SUCCESS = 0;
-
- /**
- * Reason code if there was an internal error in the platform while processing the addition or
- * removal of suggestions.
- */
- public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_INTERNAL = 1;
-
- /**
- * Reason code if the user has disallowed "android:change_wifi_state" app-ops from the app.
- * @see android.app.AppOpsManager#unsafeCheckOp(String, int, String).
- */
- public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_APP_DISALLOWED = 2;
-
- /**
- * Reason code if one or more of the network suggestions added already exists in platform's
- * database.
- * Note: this code will not be returned with Android 11 as in-place modification is allowed,
- * please check {@link #addNetworkSuggestions(List)}.
- * @see WifiNetworkSuggestion#equals(Object)
- */
- public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_DUPLICATE = 3;
-
- /**
- * Reason code if the number of network suggestions provided by the app crosses the max
- * threshold set per app.
- * The framework will reject all suggestions provided by {@link #addNetworkSuggestions(List)} if
- * the total size exceeds the limit.
- * @see #getMaxNumberOfNetworkSuggestionsPerApp()
- */
- public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_EXCEEDS_MAX_PER_APP = 4;
-
- /**
- * Reason code if one or more of the network suggestions removed does not exist in platform's
- * database.
- * The framework won't remove any suggestions if one or more of suggestions provided
- * by {@link #removeNetworkSuggestions(List)} does not exist in database.
- * @see WifiNetworkSuggestion#equals(Object)
- */
- public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_REMOVE_INVALID = 5;
-
- /**
- * Reason code if one or more of the network suggestions added is not allowed.
- * The framework will reject all suggestions provided by {@link #addNetworkSuggestions(List)}
- * if one or more of them is not allowed.
- * This error may be caused by suggestion is using SIM-based encryption method, but calling app
- * is not carrier privileged.
- */
- public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_NOT_ALLOWED = 6;
-
- /**
- * Reason code if one or more of the network suggestions added is invalid. Framework will reject
- * all the suggestions in the list.
- * The framework will reject all suggestions provided by {@link #addNetworkSuggestions(List)}
- * if one or more of them is invalid.
- * Please use {@link WifiNetworkSuggestion.Builder} to create network suggestions.
- */
- public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_INVALID = 7;
-
- /** @hide */
- @IntDef(prefix = { "STATUS_NETWORK_SUGGESTIONS_" }, value = {
- STATUS_NETWORK_SUGGESTIONS_SUCCESS,
- STATUS_NETWORK_SUGGESTIONS_ERROR_INTERNAL,
- STATUS_NETWORK_SUGGESTIONS_ERROR_APP_DISALLOWED,
- STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_DUPLICATE,
- STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_EXCEEDS_MAX_PER_APP,
- STATUS_NETWORK_SUGGESTIONS_ERROR_REMOVE_INVALID,
- STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_NOT_ALLOWED,
- STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_INVALID,
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface NetworkSuggestionsStatusCode {}
-
- /**
- * Reason code if suggested network connection attempt failed with an unknown failure.
- */
- public static final int STATUS_SUGGESTION_CONNECTION_FAILURE_UNKNOWN = 0;
- /**
- * Reason code if suggested network connection attempt failed with association failure.
- */
- public static final int STATUS_SUGGESTION_CONNECTION_FAILURE_ASSOCIATION = 1;
- /**
- * Reason code if suggested network connection attempt failed with an authentication failure.
- */
- public static final int STATUS_SUGGESTION_CONNECTION_FAILURE_AUTHENTICATION = 2;
- /**
- * Reason code if suggested network connection attempt failed with an IP provision failure.
- */
- public static final int STATUS_SUGGESTION_CONNECTION_FAILURE_IP_PROVISIONING = 3;
-
- /** @hide */
- @IntDef(prefix = {"STATUS_SUGGESTION_CONNECTION_FAILURE_"},
- value = {STATUS_SUGGESTION_CONNECTION_FAILURE_UNKNOWN,
- STATUS_SUGGESTION_CONNECTION_FAILURE_ASSOCIATION,
- STATUS_SUGGESTION_CONNECTION_FAILURE_AUTHENTICATION,
- STATUS_SUGGESTION_CONNECTION_FAILURE_IP_PROVISIONING
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface SuggestionConnectionStatusCode {}
-
- /**
- * Status code if suggestion approval status is unknown, an App which hasn't made any
- * suggestions will get this code.
- */
- public static final int STATUS_SUGGESTION_APPROVAL_UNKNOWN = 0;
-
- /**
- * Status code if the calling app is still pending user approval for suggestions.
- */
- public static final int STATUS_SUGGESTION_APPROVAL_PENDING = 1;
-
- /**
- * Status code if the calling app got the user approval for suggestions.
- */
- public static final int STATUS_SUGGESTION_APPROVAL_APPROVED_BY_USER = 2;
-
- /**
- * Status code if the calling app suggestions were rejected by the user.
- */
- public static final int STATUS_SUGGESTION_APPROVAL_REJECTED_BY_USER = 3;
-
- /**
- * Status code if the calling app was approved by virtue of being a carrier privileged app.
- * @see TelephonyManager#hasCarrierPrivileges().
- */
- public static final int STATUS_SUGGESTION_APPROVAL_APPROVED_BY_CARRIER_PRIVILEGE = 4;
-
- /** @hide */
- @IntDef(prefix = {"STATUS_SUGGESTION_APPROVAL_"},
- value = {STATUS_SUGGESTION_APPROVAL_UNKNOWN,
- STATUS_SUGGESTION_APPROVAL_PENDING,
- STATUS_SUGGESTION_APPROVAL_APPROVED_BY_USER,
- STATUS_SUGGESTION_APPROVAL_REJECTED_BY_USER,
- STATUS_SUGGESTION_APPROVAL_APPROVED_BY_CARRIER_PRIVILEGE
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface SuggestionUserApprovalStatus {}
-
- /**
- * Broadcast intent action indicating whether Wi-Fi scanning is currently available.
- * Available extras:
- * - {@link #EXTRA_SCAN_AVAILABLE}
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String ACTION_WIFI_SCAN_AVAILABILITY_CHANGED =
- "android.net.wifi.action.WIFI_SCAN_AVAILABILITY_CHANGED";
-
- /**
- * A boolean extra indicating whether scanning is currently available.
- * Sent in the broadcast {@link #ACTION_WIFI_SCAN_AVAILABILITY_CHANGED}.
- * Its value is true if scanning is currently available, false otherwise.
- */
- public static final String EXTRA_SCAN_AVAILABLE = "android.net.wifi.extra.SCAN_AVAILABLE";
-
- /**
- * Broadcast intent action indicating that the credential of a Wi-Fi network
- * has been changed. One extra provides the ssid of the network. Another
- * extra provides the event type, whether the credential is saved or forgot.
- * @hide
- */
- @SystemApi
- public static final String WIFI_CREDENTIAL_CHANGED_ACTION =
- "android.net.wifi.WIFI_CREDENTIAL_CHANGED";
- /** @hide */
- @SystemApi
- public static final String EXTRA_WIFI_CREDENTIAL_EVENT_TYPE = "et";
- /** @hide */
- @SystemApi
- public static final String EXTRA_WIFI_CREDENTIAL_SSID = "ssid";
- /** @hide */
- @SystemApi
- public static final int WIFI_CREDENTIAL_SAVED = 0;
- /** @hide */
- @SystemApi
- public static final int WIFI_CREDENTIAL_FORGOT = 1;
-
- /** @hide */
- @SystemApi
- public static final int PASSPOINT_HOME_NETWORK = 0;
-
- /** @hide */
- @SystemApi
- public static final int PASSPOINT_ROAMING_NETWORK = 1;
-
- /**
- * Broadcast intent action indicating that a Passpoint provider icon has been received.
- *
- * Included extras:
- * {@link #EXTRA_BSSID_LONG}
- * {@link #EXTRA_FILENAME}
- * {@link #EXTRA_ICON}
- *
- * Receiver Required Permission: android.Manifest.permission.ACCESS_WIFI_STATE
- *
- * <p>Note: The broadcast is only delivered to registered receivers - no manifest registered
- * components will be launched.
- *
- * @hide
- */
- public static final String ACTION_PASSPOINT_ICON = "android.net.wifi.action.PASSPOINT_ICON";
- /**
- * BSSID of an AP in long representation. The {@link #EXTRA_BSSID} contains BSSID in
- * String representation.
- *
- * Retrieve with {@link android.content.Intent#getLongExtra(String, long)}.
- *
- * @hide
- */
- public static final String EXTRA_BSSID_LONG = "android.net.wifi.extra.BSSID_LONG";
- /**
- * Icon data.
- *
- * Retrieve with {@link android.content.Intent#getParcelableExtra(String)} and cast into
- * {@link android.graphics.drawable.Icon}.
- *
- * @hide
- */
- public static final String EXTRA_ICON = "android.net.wifi.extra.ICON";
- /**
- * Name of a file.
- *
- * Retrieve with {@link android.content.Intent#getStringExtra(String)}.
- *
- * @hide
- */
- public static final String EXTRA_FILENAME = "android.net.wifi.extra.FILENAME";
-
- /**
- * Broadcast intent action indicating a Passpoint OSU Providers List element has been received.
- *
- * Included extras:
- * {@link #EXTRA_BSSID_LONG}
- * {@link #EXTRA_ANQP_ELEMENT_DATA}
- *
- * Receiver Required Permission: android.Manifest.permission.ACCESS_WIFI_STATE
- *
- * <p>Note: The broadcast is only delivered to registered receivers - no manifest registered
- * components will be launched.
- *
- * @hide
- */
- public static final String ACTION_PASSPOINT_OSU_PROVIDERS_LIST =
- "android.net.wifi.action.PASSPOINT_OSU_PROVIDERS_LIST";
- /**
- * Raw binary data of an ANQP (Access Network Query Protocol) element.
- *
- * Retrieve with {@link android.content.Intent#getByteArrayExtra(String)}.
- *
- * @hide
- */
- public static final String EXTRA_ANQP_ELEMENT_DATA =
- "android.net.wifi.extra.ANQP_ELEMENT_DATA";
-
- /**
- * Broadcast intent action indicating that a Passpoint Deauth Imminent frame has been received.
- *
- * Included extras:
- * {@link #EXTRA_BSSID_LONG}
- * {@link #EXTRA_ESS}
- * {@link #EXTRA_DELAY}
- * {@link #EXTRA_URL}
- *
- * Receiver Required Permission: android.Manifest.permission.ACCESS_WIFI_STATE
- *
- * <p>Note: The broadcast is only delivered to registered receivers - no manifest registered
- * components will be launched.
- *
- * @hide
- */
- public static final String ACTION_PASSPOINT_DEAUTH_IMMINENT =
- "android.net.wifi.action.PASSPOINT_DEAUTH_IMMINENT";
- /**
- * Flag indicating BSS (Basic Service Set) or ESS (Extended Service Set). This will be set to
- * {@code true} for ESS.
- *
- * Retrieve with {@link android.content.Intent#getBooleanExtra(String, boolean)}.
- *
- * @hide
- */
- public static final String EXTRA_ESS = "android.net.wifi.extra.ESS";
- /**
- * Delay in seconds.
- *
- * Retrieve with {@link android.content.Intent#getIntExtra(String, int)}.
- *
- * @hide
- */
- public static final String EXTRA_DELAY = "android.net.wifi.extra.DELAY";
-
- /**
- * Broadcast intent action indicating a Passpoint subscription remediation frame has been
- * received.
- *
- * Included extras:
- * {@link #EXTRA_BSSID_LONG}
- * {@link #EXTRA_SUBSCRIPTION_REMEDIATION_METHOD}
- * {@link #EXTRA_URL}
- *
- * Receiver Required Permission: android.Manifest.permission.ACCESS_WIFI_STATE
- *
- * <p>Note: The broadcast is only delivered to registered receivers - no manifest registered
- * components will be launched.
- *
- * @hide
- */
- public static final String ACTION_PASSPOINT_SUBSCRIPTION_REMEDIATION =
- "android.net.wifi.action.PASSPOINT_SUBSCRIPTION_REMEDIATION";
- /**
- * The protocol supported by the subscription remediation server. The possible values are:
- * 0 - OMA DM
- * 1 - SOAP XML SPP
- *
- * Retrieve with {@link android.content.Intent#getIntExtra(String, int)}.
- *
- * @hide
- */
- public static final String EXTRA_SUBSCRIPTION_REMEDIATION_METHOD =
- "android.net.wifi.extra.SUBSCRIPTION_REMEDIATION_METHOD";
-
- /**
- * Activity Action: Receiver should launch Passpoint OSU (Online Sign Up) view.
- * Included extras:
- *
- * {@link #EXTRA_OSU_NETWORK}: {@link Network} instance associated with OSU AP.
- * {@link #EXTRA_URL}: String representation of a server URL used for OSU process.
- *
- * @hide
- */
- @SystemApi
- @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
- public static final String ACTION_PASSPOINT_LAUNCH_OSU_VIEW =
- "android.net.wifi.action.PASSPOINT_LAUNCH_OSU_VIEW";
-
- /**
- * The lookup key for a {@link android.net.Network} associated with a Passpoint OSU server.
- * Included in the {@link #ACTION_PASSPOINT_LAUNCH_OSU_VIEW} broadcast.
- *
- * Retrieve with {@link android.content.Intent#getParcelableExtra(String)}.
- *
- * @hide
- */
- @SystemApi
- public static final String EXTRA_OSU_NETWORK = "android.net.wifi.extra.OSU_NETWORK";
-
- /**
- * String representation of an URL for Passpoint OSU.
- * Included in the {@link #ACTION_PASSPOINT_LAUNCH_OSU_VIEW} broadcast.
- *
- * Retrieve with {@link android.content.Intent#getStringExtra(String)}.
- *
- * @hide
- */
- @SystemApi
- public static final String EXTRA_URL = "android.net.wifi.extra.URL";
-
- /**
- * Broadcast intent action indicating that Wi-Fi has been enabled, disabled,
- * enabling, disabling, or unknown. One extra provides this state as an int.
- * Another extra provides the previous state, if available. No network-related
- * permissions are required to subscribe to this broadcast.
- *
- * <p class="note">This broadcast is not delivered to manifest receivers in
- * applications that target API version 26 or later.
- *
- * @see #EXTRA_WIFI_STATE
- * @see #EXTRA_PREVIOUS_WIFI_STATE
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String WIFI_STATE_CHANGED_ACTION =
- "android.net.wifi.WIFI_STATE_CHANGED";
- /**
- * The lookup key for an int that indicates whether Wi-Fi is enabled,
- * disabled, enabling, disabling, or unknown. Retrieve it with
- * {@link android.content.Intent#getIntExtra(String,int)}.
- *
- * @see #WIFI_STATE_DISABLED
- * @see #WIFI_STATE_DISABLING
- * @see #WIFI_STATE_ENABLED
- * @see #WIFI_STATE_ENABLING
- * @see #WIFI_STATE_UNKNOWN
- */
- public static final String EXTRA_WIFI_STATE = "wifi_state";
- /**
- * The previous Wi-Fi state.
- *
- * @see #EXTRA_WIFI_STATE
- */
- public static final String EXTRA_PREVIOUS_WIFI_STATE = "previous_wifi_state";
-
- /**
- * Wi-Fi is currently being disabled. The state will change to {@link #WIFI_STATE_DISABLED} if
- * it finishes successfully.
- *
- * @see #WIFI_STATE_CHANGED_ACTION
- * @see #getWifiState()
- */
- public static final int WIFI_STATE_DISABLING = 0;
- /**
- * Wi-Fi is disabled.
- *
- * @see #WIFI_STATE_CHANGED_ACTION
- * @see #getWifiState()
- */
- public static final int WIFI_STATE_DISABLED = 1;
- /**
- * Wi-Fi is currently being enabled. The state will change to {@link #WIFI_STATE_ENABLED} if
- * it finishes successfully.
- *
- * @see #WIFI_STATE_CHANGED_ACTION
- * @see #getWifiState()
- */
- public static final int WIFI_STATE_ENABLING = 2;
- /**
- * Wi-Fi is enabled.
- *
- * @see #WIFI_STATE_CHANGED_ACTION
- * @see #getWifiState()
- */
- public static final int WIFI_STATE_ENABLED = 3;
- /**
- * Wi-Fi is in an unknown state. This state will occur when an error happens while enabling
- * or disabling.
- *
- * @see #WIFI_STATE_CHANGED_ACTION
- * @see #getWifiState()
- */
- public static final int WIFI_STATE_UNKNOWN = 4;
-
- /**
- * Broadcast intent action indicating that Wi-Fi AP has been enabled, disabled,
- * enabling, disabling, or failed.
- *
- * @hide
- */
- @SystemApi
- public static final String WIFI_AP_STATE_CHANGED_ACTION =
- "android.net.wifi.WIFI_AP_STATE_CHANGED";
-
- /**
- * The lookup key for an int that indicates whether Wi-Fi AP is enabled,
- * disabled, enabling, disabling, or failed. Retrieve it with
- * {@link android.content.Intent#getIntExtra(String,int)}.
- *
- * @see #WIFI_AP_STATE_DISABLED
- * @see #WIFI_AP_STATE_DISABLING
- * @see #WIFI_AP_STATE_ENABLED
- * @see #WIFI_AP_STATE_ENABLING
- * @see #WIFI_AP_STATE_FAILED
- *
- * @hide
- */
- @SystemApi
- public static final String EXTRA_WIFI_AP_STATE = "wifi_state";
-
- /**
- * An extra containing the int error code for Soft AP start failure.
- * Can be obtained from the {@link #WIFI_AP_STATE_CHANGED_ACTION} using
- * {@link android.content.Intent#getIntExtra}.
- * This extra will only be attached if {@link #EXTRA_WIFI_AP_STATE} is
- * attached and is equal to {@link #WIFI_AP_STATE_FAILED}.
- *
- * The error code will be one of:
- * {@link #SAP_START_FAILURE_GENERAL},
- * {@link #SAP_START_FAILURE_NO_CHANNEL},
- * {@link #SAP_START_FAILURE_UNSUPPORTED_CONFIGURATION}
- *
- * @hide
- */
- @SystemApi
- public static final String EXTRA_WIFI_AP_FAILURE_REASON =
- "android.net.wifi.extra.WIFI_AP_FAILURE_REASON";
- /**
- * The previous Wi-Fi state.
- *
- * @see #EXTRA_WIFI_AP_STATE
- *
- * @hide
- */
- @SystemApi
- public static final String EXTRA_PREVIOUS_WIFI_AP_STATE = "previous_wifi_state";
- /**
- * The lookup key for a String extra that stores the interface name used for the Soft AP.
- * This extra is included in the broadcast {@link #WIFI_AP_STATE_CHANGED_ACTION}.
- * Retrieve its value with {@link android.content.Intent#getStringExtra(String)}.
- *
- * @hide
- */
- @SystemApi
- public static final String EXTRA_WIFI_AP_INTERFACE_NAME =
- "android.net.wifi.extra.WIFI_AP_INTERFACE_NAME";
- /**
- * The lookup key for an int extra that stores the intended IP mode for this Soft AP.
- * One of {@link #IFACE_IP_MODE_TETHERED} or {@link #IFACE_IP_MODE_LOCAL_ONLY}.
- * This extra is included in the broadcast {@link #WIFI_AP_STATE_CHANGED_ACTION}.
- * Retrieve its value with {@link android.content.Intent#getIntExtra(String, int)}.
- *
- * @hide
- */
- @SystemApi
- public static final String EXTRA_WIFI_AP_MODE = "android.net.wifi.extra.WIFI_AP_MODE";
-
- /** @hide */
- @IntDef(flag = false, prefix = { "WIFI_AP_STATE_" }, value = {
- WIFI_AP_STATE_DISABLING,
- WIFI_AP_STATE_DISABLED,
- WIFI_AP_STATE_ENABLING,
- WIFI_AP_STATE_ENABLED,
- WIFI_AP_STATE_FAILED,
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface WifiApState {}
-
- /**
- * Wi-Fi AP is currently being disabled. The state will change to
- * {@link #WIFI_AP_STATE_DISABLED} if it finishes successfully.
- *
- * @see #WIFI_AP_STATE_CHANGED_ACTION
- * @see #getWifiApState()
- *
- * @hide
- */
- @SystemApi
- public static final int WIFI_AP_STATE_DISABLING = 10;
- /**
- * Wi-Fi AP is disabled.
- *
- * @see #WIFI_AP_STATE_CHANGED_ACTION
- * @see #getWifiState()
- *
- * @hide
- */
- @SystemApi
- public static final int WIFI_AP_STATE_DISABLED = 11;
- /**
- * Wi-Fi AP is currently being enabled. The state will change to
- * {@link #WIFI_AP_STATE_ENABLED} if it finishes successfully.
- *
- * @see #WIFI_AP_STATE_CHANGED_ACTION
- * @see #getWifiApState()
- *
- * @hide
- */
- @SystemApi
- public static final int WIFI_AP_STATE_ENABLING = 12;
- /**
- * Wi-Fi AP is enabled.
- *
- * @see #WIFI_AP_STATE_CHANGED_ACTION
- * @see #getWifiApState()
- *
- * @hide
- */
- @SystemApi
- public static final int WIFI_AP_STATE_ENABLED = 13;
- /**
- * Wi-Fi AP is in a failed state. This state will occur when an error occurs during
- * enabling or disabling
- *
- * @see #WIFI_AP_STATE_CHANGED_ACTION
- * @see #getWifiApState()
- *
- * @hide
- */
- @SystemApi
- public static final int WIFI_AP_STATE_FAILED = 14;
-
- /** @hide */
- @IntDef(flag = false, prefix = { "SAP_START_FAILURE_" }, value = {
- SAP_START_FAILURE_GENERAL,
- SAP_START_FAILURE_NO_CHANNEL,
- SAP_START_FAILURE_UNSUPPORTED_CONFIGURATION,
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface SapStartFailure {}
-
- /**
- * All other reasons for AP start failure besides {@link #SAP_START_FAILURE_NO_CHANNEL} and
- * {@link #SAP_START_FAILURE_UNSUPPORTED_CONFIGURATION}.
- *
- * @hide
- */
- @SystemApi
- public static final int SAP_START_FAILURE_GENERAL= 0;
-
- /**
- * If Wi-Fi AP start failed, this reason code means that no legal channel exists on user
- * selected band due to regulatory constraints.
- *
- * @hide
- */
- @SystemApi
- public static final int SAP_START_FAILURE_NO_CHANNEL = 1;
-
- /**
- * If Wi-Fi AP start failed, this reason code means that the specified configuration
- * is not supported by the current HAL version.
- *
- * @hide
- */
- @SystemApi
- public static final int SAP_START_FAILURE_UNSUPPORTED_CONFIGURATION = 2;
-
-
- /** @hide */
- @IntDef(flag = false, prefix = { "SAP_CLIENT_BLOCKED_REASON_" }, value = {
- SAP_CLIENT_BLOCK_REASON_CODE_BLOCKED_BY_USER,
- SAP_CLIENT_BLOCK_REASON_CODE_NO_MORE_STAS,
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface SapClientBlockedReason {}
-
- /**
- * If Soft Ap client is blocked, this reason code means that client doesn't exist in the
- * specified configuration {@link SoftApConfiguration.Builder#setBlockedClientList(List)}
- * and {@link SoftApConfiguration.Builder#setAllowedClientList(List)}
- * and the {@link SoftApConfiguration.Builder#setClientControlByUserEnabled(boolean)}
- * is configured as well.
- * @hide
- */
- @SystemApi
- public static final int SAP_CLIENT_BLOCK_REASON_CODE_BLOCKED_BY_USER = 0;
-
- /**
- * If Soft Ap client is blocked, this reason code means that no more clients can be
- * associated to this AP since it reached maximum capacity. The maximum capacity is
- * the minimum of {@link SoftApConfiguration.Builder#setMaxNumberOfClients(int)} and
- * {@link SoftApCapability#getMaxSupportedClients} which get from
- * {@link WifiManager.SoftApCallback#onCapabilityChanged(SoftApCapability)}.
- *
- * @hide
- */
- @SystemApi
- public static final int SAP_CLIENT_BLOCK_REASON_CODE_NO_MORE_STAS = 1;
-
- /**
- * Client disconnected for unspecified reason. This could for example be because the AP is being
- * shut down.
- * @hide
- */
- public static final int SAP_CLIENT_DISCONNECT_REASON_CODE_UNSPECIFIED = 2;
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = {"IFACE_IP_MODE_"}, value = {
- IFACE_IP_MODE_UNSPECIFIED,
- IFACE_IP_MODE_CONFIGURATION_ERROR,
- IFACE_IP_MODE_TETHERED,
- IFACE_IP_MODE_LOCAL_ONLY})
- public @interface IfaceIpMode {}
-
- /**
- * Interface IP mode unspecified.
- *
- * @see #updateInterfaceIpState(String, int)
- *
- * @hide
- */
- @SystemApi
- public static final int IFACE_IP_MODE_UNSPECIFIED = -1;
-
- /**
- * Interface IP mode for configuration error.
- *
- * @see #updateInterfaceIpState(String, int)
- *
- * @hide
- */
- @SystemApi
- public static final int IFACE_IP_MODE_CONFIGURATION_ERROR = 0;
-
- /**
- * Interface IP mode for tethering.
- *
- * @see #updateInterfaceIpState(String, int)
- *
- * @hide
- */
- @SystemApi
- public static final int IFACE_IP_MODE_TETHERED = 1;
-
- /**
- * Interface IP mode for Local Only Hotspot.
- *
- * @see #updateInterfaceIpState(String, int)
- *
- * @hide
- */
- @SystemApi
- public static final int IFACE_IP_MODE_LOCAL_ONLY = 2;
-
- /**
- * Broadcast intent action indicating that the wifi network settings
- * had been reset.
- *
- * Note: This intent is sent as a directed broadcast to each manifest registered receiver.
- * Intent will not be received by dynamically registered receivers.
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_CARRIER_PROVISIONING)
- public static final String ACTION_NETWORK_SETTINGS_RESET =
- "android.net.wifi.action.NETWORK_SETTINGS_RESET";
-
- /**
- * Broadcast intent action indicating that a connection to the supplicant has
- * been established (and it is now possible
- * to perform Wi-Fi operations) or the connection to the supplicant has been
- * lost. One extra provides the connection state as a boolean, where {@code true}
- * means CONNECTED.
- * @deprecated This is no longer supported.
- * @see #EXTRA_SUPPLICANT_CONNECTED
- */
- @Deprecated
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String SUPPLICANT_CONNECTION_CHANGE_ACTION =
- "android.net.wifi.supplicant.CONNECTION_CHANGE";
- /**
- * The lookup key for a boolean that indicates whether a connection to
- * the supplicant daemon has been gained or lost. {@code true} means
- * a connection now exists.
- * Retrieve it with {@link android.content.Intent#getBooleanExtra(String,boolean)}.
- * @deprecated This is no longer supported.
- */
- @Deprecated
- public static final String EXTRA_SUPPLICANT_CONNECTED = "connected";
- /**
- * Broadcast intent action indicating that the state of Wi-Fi connectivity
- * has changed. An extra provides the new state
- * in the form of a {@link android.net.NetworkInfo} object. No network-related
- * permissions are required to subscribe to this broadcast.
- *
- * <p class="note">This broadcast is not delivered to manifest receivers in
- * applications that target API version 26 or later.
- * @see #EXTRA_NETWORK_INFO
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String NETWORK_STATE_CHANGED_ACTION = "android.net.wifi.STATE_CHANGE";
- /**
- * The lookup key for a {@link android.net.NetworkInfo} object associated with the
- * Wi-Fi network. Retrieve with
- * {@link android.content.Intent#getParcelableExtra(String)}.
- */
- public static final String EXTRA_NETWORK_INFO = "networkInfo";
- /**
- * The lookup key for a String giving the BSSID of the access point to which
- * we are connected. No longer used.
- */
- @Deprecated
- public static final String EXTRA_BSSID = "bssid";
- /**
- * The lookup key for a {@link android.net.wifi.WifiInfo} object giving the
- * information about the access point to which we are connected.
- * No longer used.
- */
- @Deprecated
- public static final String EXTRA_WIFI_INFO = "wifiInfo";
- /**
- * Broadcast intent action indicating that the state of establishing a connection to
- * an access point has changed.One extra provides the new
- * {@link SupplicantState}. Note that the supplicant state is Wi-Fi specific, and
- * is not generally the most useful thing to look at if you are just interested in
- * the overall state of connectivity.
- * @see #EXTRA_NEW_STATE
- * @see #EXTRA_SUPPLICANT_ERROR
- * @deprecated This is no longer supported.
- */
- @Deprecated
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String SUPPLICANT_STATE_CHANGED_ACTION =
- "android.net.wifi.supplicant.STATE_CHANGE";
- /**
- * The lookup key for a {@link SupplicantState} describing the new state
- * Retrieve with
- * {@link android.content.Intent#getParcelableExtra(String)}.
- * @deprecated This is no longer supported.
- */
- @Deprecated
- public static final String EXTRA_NEW_STATE = "newState";
-
- /**
- * The lookup key for a {@link SupplicantState} describing the supplicant
- * error code if any
- * Retrieve with
- * {@link android.content.Intent#getIntExtra(String, int)}.
- * @see #ERROR_AUTHENTICATING
- * @deprecated This is no longer supported.
- */
- @Deprecated
- public static final String EXTRA_SUPPLICANT_ERROR = "supplicantError";
-
- /**
- * The lookup key for a {@link SupplicantState} describing the supplicant
- * error reason if any
- * Retrieve with
- * {@link android.content.Intent#getIntExtra(String, int)}.
- * @see #ERROR_AUTH_FAILURE_#REASON_CODE
- * @deprecated This is no longer supported.
- * @hide
- */
- @Deprecated
- public static final String EXTRA_SUPPLICANT_ERROR_REASON = "supplicantErrorReason";
-
- /**
- * Broadcast intent action indicating that the configured networks changed.
- * This can be as a result of adding/updating/deleting a network.
- * <br />
- * {@link #EXTRA_CHANGE_REASON} contains whether the configuration was added/changed/removed.
- * {@link #EXTRA_WIFI_CONFIGURATION} is never set beginning in
- * {@link android.os.Build.VERSION_CODES#R}.
- * {@link #EXTRA_MULTIPLE_NETWORKS_CHANGED} is set for backwards compatibility reasons, but
- * its value is always true beginning in {@link android.os.Build.VERSION_CODES#R}, even if only
- * a single network changed.
- * <br />
- * The {@link android.Manifest.permission#ACCESS_WIFI_STATE ACCESS_WIFI_STATE} permission is
- * required to receive this broadcast.
- *
- * @hide
- */
- @SystemApi
- public static final String CONFIGURED_NETWORKS_CHANGED_ACTION =
- "android.net.wifi.CONFIGURED_NETWORKS_CHANGE";
- /**
- * The lookup key for a {@link android.net.wifi.WifiConfiguration} object representing
- * the changed Wi-Fi configuration when the {@link #CONFIGURED_NETWORKS_CHANGED_ACTION}
- * broadcast is sent.
- * @deprecated This extra is never set beginning in {@link android.os.Build.VERSION_CODES#R},
- * regardless of the target SDK version. Use {@link #getConfiguredNetworks} to get the full list
- * of configured networks.
- * @hide
- */
- @Deprecated
- @SystemApi
- public static final String EXTRA_WIFI_CONFIGURATION = "wifiConfiguration";
- /**
- * Multiple network configurations have changed.
- * @see #CONFIGURED_NETWORKS_CHANGED_ACTION
- * @deprecated This extra's value is always true beginning in
- * {@link android.os.Build.VERSION_CODES#R}, regardless of the target SDK version.
- * @hide
- */
- @Deprecated
- @SystemApi
- public static final String EXTRA_MULTIPLE_NETWORKS_CHANGED = "multipleChanges";
- /**
- * The lookup key for an integer indicating the reason a Wi-Fi network configuration
- * has changed. One of {@link #CHANGE_REASON_ADDED}, {@link #CHANGE_REASON_REMOVED},
- * {@link #CHANGE_REASON_CONFIG_CHANGE}.
- *
- * @see #CONFIGURED_NETWORKS_CHANGED_ACTION
- * @hide
- */
- @SystemApi
- public static final String EXTRA_CHANGE_REASON = "changeReason";
- /**
- * The configuration is new and was added.
- * @hide
- */
- @SystemApi
- public static final int CHANGE_REASON_ADDED = 0;
- /**
- * The configuration was removed and is no longer present in the system's list of
- * configured networks.
- * @hide
- */
- @SystemApi
- public static final int CHANGE_REASON_REMOVED = 1;
- /**
- * The configuration has changed as a result of explicit action or because the system
- * took an automated action such as disabling a malfunctioning configuration.
- * @hide
- */
- @SystemApi
- public static final int CHANGE_REASON_CONFIG_CHANGE = 2;
- /**
- * An access point scan has completed, and results are available.
- * Call {@link #getScanResults()} to obtain the results.
- * The broadcast intent may contain an extra field with the key {@link #EXTRA_RESULTS_UPDATED}
- * and a {@code boolean} value indicating if the scan was successful.
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String SCAN_RESULTS_AVAILABLE_ACTION = "android.net.wifi.SCAN_RESULTS";
-
- /**
- * Lookup key for a {@code boolean} extra in intent {@link #SCAN_RESULTS_AVAILABLE_ACTION}
- * representing if the scan was successful or not.
- * Scans may fail for multiple reasons, these may include:
- * <ol>
- * <li>An app requested too many scans in a certain period of time.
- * This may lead to additional scan request rejections via "scan throttling" for both
- * foreground and background apps.
- * Note: Apps holding android.Manifest.permission.NETWORK_SETTINGS permission are
- * exempted from scan throttling.
- * </li>
- * <li>The device is idle and scanning is disabled.</li>
- * <li>Wifi hardware reported a scan failure.</li>
- * </ol>
- * @return true scan was successful, results are updated
- * @return false scan was not successful, results haven't been updated since previous scan
- */
- public static final String EXTRA_RESULTS_UPDATED = "resultsUpdated";
-
- /**
- * A batch of access point scans has been completed and the results areavailable.
- * Call {@link #getBatchedScanResults()} to obtain the results.
- * @deprecated This API is nolonger supported.
- * Use {@link android.net.wifi.WifiScanner} API
- * @hide
- */
- @Deprecated
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String BATCHED_SCAN_RESULTS_AVAILABLE_ACTION =
- "android.net.wifi.BATCHED_RESULTS";
-
- /**
- * The RSSI (signal strength) has changed.
- *
- * Receiver Required Permission: android.Manifest.permission.ACCESS_WIFI_STATE
- * @see #EXTRA_NEW_RSSI
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String RSSI_CHANGED_ACTION = "android.net.wifi.RSSI_CHANGED";
- /**
- * The lookup key for an {@code int} giving the new RSSI in dBm.
- */
- public static final String EXTRA_NEW_RSSI = "newRssi";
-
- /**
- * @see #ACTION_LINK_CONFIGURATION_CHANGED
- * @hide
- */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final String LINK_CONFIGURATION_CHANGED_ACTION =
- "android.net.wifi.LINK_CONFIGURATION_CHANGED";
-
- /**
- * Broadcast intent action indicating that the link configuration changed on wifi.
- * <br /> No permissions are required to listen to this broadcast.
- * @hide
- */
- @SystemApi
- public static final String ACTION_LINK_CONFIGURATION_CHANGED =
- // should be android.net.wifi.action.LINK_CONFIGURATION_CHANGED, but due to
- // @UnsupportedAppUsage leaving it as android.net.wifi.LINK_CONFIGURATION_CHANGED.
- LINK_CONFIGURATION_CHANGED_ACTION;
-
- /**
- * The lookup key for a {@link android.net.LinkProperties} object associated with the
- * Wi-Fi network.
- * Included in the {@link #ACTION_LINK_CONFIGURATION_CHANGED} broadcast.
- *
- * Retrieve with {@link android.content.Intent#getParcelableExtra(String)}.
- *
- * @deprecated this extra is no longer populated.
- *
- * @hide
- */
- @Deprecated
- @SystemApi
- public static final String EXTRA_LINK_PROPERTIES = "android.net.wifi.extra.LINK_PROPERTIES";
-
- /**
- * The lookup key for a {@link android.net.NetworkCapabilities} object associated with the
- * Wi-Fi network. Retrieve with
- * {@link android.content.Intent#getParcelableExtra(String)}.
- * @hide
- */
- public static final String EXTRA_NETWORK_CAPABILITIES = "networkCapabilities";
-
- /**
- * The network IDs of the configured networks could have changed.
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String NETWORK_IDS_CHANGED_ACTION = "android.net.wifi.NETWORK_IDS_CHANGED";
-
- /**
- * Activity Action: Show a system activity that allows the user to enable
- * scans to be available even with Wi-Fi turned off.
- *
- * <p>Notification of the result of this activity is posted using the
- * {@link android.app.Activity#onActivityResult} callback. The
- * <code>resultCode</code>
- * will be {@link android.app.Activity#RESULT_OK} if scan always mode has
- * been turned on or {@link android.app.Activity#RESULT_CANCELED} if the user
- * has rejected the request or an error has occurred.
- */
- @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
- public static final String ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE =
- "android.net.wifi.action.REQUEST_SCAN_ALWAYS_AVAILABLE";
-
- /**
- * Activity Action: Pick a Wi-Fi network to connect to.
- * <p>Input: Nothing.
- * <p>Output: Nothing.
- */
- @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
- public static final String ACTION_PICK_WIFI_NETWORK = "android.net.wifi.PICK_WIFI_NETWORK";
-
- /**
- * Activity Action: Receiver should show UI to get user approval to enable WiFi.
- * <p>Input: {@link android.content.Intent#EXTRA_PACKAGE_NAME} string extra with
- * the name of the app requesting the action.
- * <p>Output: Nothing.
- * <p>No permissions are required to send this action.
- * @hide
- */
- @SystemApi
- @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
- public static final String ACTION_REQUEST_ENABLE = "android.net.wifi.action.REQUEST_ENABLE";
-
- /**
- * Activity Action: Receiver should show UI to get user approval to disable WiFi.
- * <p>Input: {@link android.content.Intent#EXTRA_PACKAGE_NAME} string extra with
- * the name of the app requesting the action.
- * <p>Output: Nothing.
- * <p>No permissions are required to send this action.
- * @hide
- */
- @SystemApi
- @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
- public static final String ACTION_REQUEST_DISABLE = "android.net.wifi.action.REQUEST_DISABLE";
-
- /**
- * Directed broadcast intent action indicating that the device has connected to one of the
- * network suggestions provided by the app. This will be sent post connection to a network
- * which was created with {@link WifiNetworkSuggestion.Builder#setIsAppInteractionRequired(
- * boolean)}
- * flag set.
- * <p>
- * Note: The broadcast is sent to the app only if it holds
- * {@link android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION} permission.
- *
- * @see #EXTRA_NETWORK_SUGGESTION
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String ACTION_WIFI_NETWORK_SUGGESTION_POST_CONNECTION =
- "android.net.wifi.action.WIFI_NETWORK_SUGGESTION_POST_CONNECTION";
- /**
- * Sent as as a part of {@link #ACTION_WIFI_NETWORK_SUGGESTION_POST_CONNECTION} that holds
- * an instance of {@link WifiNetworkSuggestion} corresponding to the connected network.
- */
- public static final String EXTRA_NETWORK_SUGGESTION =
- "android.net.wifi.extra.NETWORK_SUGGESTION";
-
- /**
- * Internally used Wi-Fi lock mode representing the case were no locks are held.
- * @hide
- */
- public static final int WIFI_MODE_NO_LOCKS_HELD = 0;
-
- /**
- * In this Wi-Fi lock mode, Wi-Fi will be kept active,
- * and will behave normally, i.e., it will attempt to automatically
- * establish a connection to a remembered access point that is
- * within range, and will do periodic scans if there are remembered
- * access points but none are in range.
- *
- * @deprecated This API is non-functional and will have no impact.
- */
- @Deprecated
- public static final int WIFI_MODE_FULL = 1;
-
- /**
- * In this Wi-Fi lock mode, Wi-Fi will be kept active,
- * but the only operation that will be supported is initiation of
- * scans, and the subsequent reporting of scan results. No attempts
- * will be made to automatically connect to remembered access points,
- * nor will periodic scans be automatically performed looking for
- * remembered access points. Scans must be explicitly requested by
- * an application in this mode.
- *
- * @deprecated This API is non-functional and will have no impact.
- */
- @Deprecated
- public static final int WIFI_MODE_SCAN_ONLY = 2;
-
- /**
- * In this Wi-Fi lock mode, Wi-Fi will not go to power save.
- * This results in operating with low packet latency.
- * The lock is only active when the device is connected to an access point.
- * The lock is active even when the device screen is off or the acquiring application is
- * running in the background.
- * This mode will consume more power and hence should be used only
- * when there is a need for this tradeoff.
- * <p>
- * An example use case is when a voice connection needs to be
- * kept active even after the device screen goes off.
- * Holding a {@link #WIFI_MODE_FULL_HIGH_PERF} lock for the
- * duration of the voice call may improve the call quality.
- * <p>
- * When there is no support from the hardware, the {@link #WIFI_MODE_FULL_HIGH_PERF}
- * lock will have no impact.
- */
- public static final int WIFI_MODE_FULL_HIGH_PERF = 3;
-
- /**
- * In this Wi-Fi lock mode, Wi-Fi will operate with a priority to achieve low latency.
- * {@link #WIFI_MODE_FULL_LOW_LATENCY} lock has the following limitations:
- * <ol>
- * <li>The lock is only active when the device is connected to an access point.</li>
- * <li>The lock is only active when the screen is on.</li>
- * <li>The lock is only active when the acquiring app is running in the foreground.</li>
- * </ol>
- * Low latency mode optimizes for reduced packet latency,
- * and as a result other performance measures may suffer when there are trade-offs to make:
- * <ol>
- * <li>Battery life may be reduced.</li>
- * <li>Throughput may be reduced.</li>
- * <li>Frequency of Wi-Fi scanning may be reduced. This may result in: </li>
- * <ul>
- * <li>The device may not roam or switch to the AP with highest signal quality.</li>
- * <li>Location accuracy may be reduced.</li>
- * </ul>
- * </ol>
- * <p>
- * Example use cases are real time gaming or virtual reality applications where
- * low latency is a key factor for user experience.
- * <p>
- * Note: For an app which acquires both {@link #WIFI_MODE_FULL_LOW_LATENCY} and
- * {@link #WIFI_MODE_FULL_HIGH_PERF} locks, {@link #WIFI_MODE_FULL_LOW_LATENCY}
- * lock will be effective when app is running in foreground and screen is on,
- * while the {@link #WIFI_MODE_FULL_HIGH_PERF} lock will take effect otherwise.
- */
- public static final int WIFI_MODE_FULL_LOW_LATENCY = 4;
-
-
- /** Anything worse than or equal to this will show 0 bars. */
- @UnsupportedAppUsage
- private static final int MIN_RSSI = -100;
-
- /** Anything better than or equal to this will show the max bars. */
- @UnsupportedAppUsage
- private static final int MAX_RSSI = -55;
-
- /**
- * Number of RSSI levels used in the framework to initiate {@link #RSSI_CHANGED_ACTION}
- * broadcast, where each level corresponds to a range of RSSI values.
- * The {@link #RSSI_CHANGED_ACTION} broadcast will only fire if the RSSI
- * change is significant enough to change the RSSI signal level.
- * @hide
- */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int RSSI_LEVELS = 5;
-
- //TODO (b/146346676): This needs to be removed, not used in the code.
- /**
- * Auto settings in the driver. The driver could choose to operate on both
- * 2.4 GHz and 5 GHz or make a dynamic decision on selecting the band.
- * @hide
- */
- @UnsupportedAppUsage
- public static final int WIFI_FREQUENCY_BAND_AUTO = 0;
-
- /**
- * Operation on 5 GHz alone
- * @hide
- */
- @UnsupportedAppUsage
- public static final int WIFI_FREQUENCY_BAND_5GHZ = 1;
-
- /**
- * Operation on 2.4 GHz alone
- * @hide
- */
- @UnsupportedAppUsage
- public static final int WIFI_FREQUENCY_BAND_2GHZ = 2;
-
- /** @hide */
- public static final boolean DEFAULT_POOR_NETWORK_AVOIDANCE_ENABLED = false;
-
- /**
- * Maximum number of active locks we allow.
- * This limit was added to prevent apps from creating a ridiculous number
- * of locks and crashing the system by overflowing the global ref table.
- */
- private static final int MAX_ACTIVE_LOCKS = 50;
-
- /** Indicates an invalid SSID. */
- public static final String UNKNOWN_SSID = "<unknown ssid>";
-
- /** @hide */
- public static final MacAddress ALL_ZEROS_MAC_ADDRESS =
- MacAddress.fromString("00:00:00:00:00:00");
-
- /* Number of currently active WifiLocks and MulticastLocks */
- @UnsupportedAppUsage
- private int mActiveLockCount;
-
- private Context mContext;
- @UnsupportedAppUsage
- IWifiManager mService;
- private final int mTargetSdkVersion;
-
- private Looper mLooper;
- private boolean mVerboseLoggingEnabled = false;
-
- private final Object mLock = new Object(); // lock guarding access to the following vars
- @GuardedBy("mLock")
- private LocalOnlyHotspotCallbackProxy mLOHSCallbackProxy;
- @GuardedBy("mLock")
- private LocalOnlyHotspotObserverProxy mLOHSObserverProxy;
-
- /**
- * Create a new WifiManager instance.
- * Applications will almost always want to use
- * {@link android.content.Context#getSystemService Context.getSystemService} to retrieve
- * the standard {@link android.content.Context#WIFI_SERVICE Context.WIFI_SERVICE}.
- *
- * @param context the application context
- * @param service the Binder interface
- * @param looper the Looper used to deliver callbacks
- * @hide - hide this because it takes in a parameter of type IWifiManager, which
- * is a system private class.
- */
- public WifiManager(@NonNull Context context, @NonNull IWifiManager service,
- @NonNull Looper looper) {
- mContext = context;
- mService = service;
- mLooper = looper;
- mTargetSdkVersion = context.getApplicationInfo().targetSdkVersion;
- updateVerboseLoggingEnabledFromService();
- }
-
- /**
- * Return a list of all the networks configured for the current foreground
- * user.
- *
- * Not all fields of WifiConfiguration are returned. Only the following
- * fields are filled in:
- * <ul>
- * <li>networkId</li>
- * <li>SSID</li>
- * <li>BSSID</li>
- * <li>priority</li>
- * <li>allowedProtocols</li>
- * <li>allowedKeyManagement</li>
- * <li>allowedAuthAlgorithms</li>
- * <li>allowedPairwiseCiphers</li>
- * <li>allowedGroupCiphers</li>
- * <li>status</li>
- * </ul>
- * @return a list of network configurations in the form of a list
- * of {@link WifiConfiguration} objects.
- *
- * @deprecated
- * a) See {@link WifiNetworkSpecifier.Builder#build()} for new
- * mechanism to trigger connection to a Wi-Fi network.
- * b) See {@link #addNetworkSuggestions(List)},
- * {@link #removeNetworkSuggestions(List)} for new API to add Wi-Fi networks for consideration
- * when auto-connecting to wifi.
- * <b>Compatibility Note:</b> For applications targeting
- * {@link android.os.Build.VERSION_CODES#Q} or above, this API will always fail and return an
- * empty list.
- * <p>
- * Deprecation Exemptions:
- * <ul>
- * <li>Device Owner (DO), Profile Owner (PO) and system apps will have access to the full list.
- * <li>Callers with Carrier privilege will receive a restricted list only containing
- * configurations which they created.
- * </ul>
- */
- @Deprecated
- @RequiresPermission(allOf = {ACCESS_FINE_LOCATION, ACCESS_WIFI_STATE})
- public List<WifiConfiguration> getConfiguredNetworks() {
- try {
- ParceledListSlice<WifiConfiguration> parceledList =
- mService.getConfiguredNetworks(mContext.getOpPackageName(),
- mContext.getAttributionTag());
- if (parceledList == null) {
- return Collections.emptyList();
- }
- return parceledList.getList();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /** @hide */
- @SystemApi
- @RequiresPermission(allOf = {ACCESS_FINE_LOCATION, ACCESS_WIFI_STATE, READ_WIFI_CREDENTIAL})
- public List<WifiConfiguration> getPrivilegedConfiguredNetworks() {
- try {
- ParceledListSlice<WifiConfiguration> parceledList =
- mService.getPrivilegedConfiguredNetworks(mContext.getOpPackageName(),
- mContext.getAttributionTag());
- if (parceledList == null) {
- return Collections.emptyList();
- }
- return parceledList.getList();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Returns a list of all matching WifiConfigurations for a given list of ScanResult.
- *
- * An empty list will be returned when no configurations are installed or if no configurations
- * match the ScanResult.
- *
- * @param scanResults a list of scanResult that represents the BSSID
- * @return List that consists of {@link WifiConfiguration} and corresponding scanResults per
- * network type({@link #PASSPOINT_HOME_NETWORK} and {@link #PASSPOINT_ROAMING_NETWORK}).
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD
- })
- @NonNull
- public List<Pair<WifiConfiguration, Map<Integer, List<ScanResult>>>> getAllMatchingWifiConfigs(
- @NonNull List<ScanResult> scanResults) {
- List<Pair<WifiConfiguration, Map<Integer, List<ScanResult>>>> configs = new ArrayList<>();
- try {
- Map<String, Map<Integer, List<ScanResult>>> results =
- mService.getAllMatchingPasspointProfilesForScanResults(scanResults);
- if (results.isEmpty()) {
- return configs;
- }
- List<WifiConfiguration> wifiConfigurations =
- mService.getWifiConfigsForPasspointProfiles(
- new ArrayList<>(results.keySet()));
- for (WifiConfiguration configuration : wifiConfigurations) {
- Map<Integer, List<ScanResult>> scanResultsPerNetworkType =
- results.get(configuration.getProfileKey());
- if (scanResultsPerNetworkType != null) {
- configs.add(Pair.create(configuration, scanResultsPerNetworkType));
- }
- }
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
-
- return configs;
- }
-
- /**
- * Retrieve a list of {@link WifiConfiguration} for available {@link WifiNetworkSuggestion}
- * matching the given list of {@link ScanResult}.
- *
- * An available {@link WifiNetworkSuggestion} must satisfy:
- * <ul>
- * <li> Matching one of the {@link ScanResult} from the given list.
- * <li> and {@link WifiNetworkSuggestion.Builder#setIsUserAllowedToManuallyConnect(boolean)} set
- * to true.
- * </ul>
- *
- * @param scanResults a list of scanResult.
- * @return a list of @link WifiConfiguration} for available {@link WifiNetworkSuggestion}
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD
- })
- @NonNull
- public List<WifiConfiguration> getWifiConfigForMatchedNetworkSuggestionsSharedWithUser(
- @NonNull List<ScanResult> scanResults) {
- try {
- return mService.getWifiConfigForMatchedNetworkSuggestionsSharedWithUser(scanResults);
- } catch (RemoteException e) {
- throw e.rethrowAsRuntimeException();
- }
- }
-
- /**
- * Returns a list of unique Hotspot 2.0 OSU (Online Sign-Up) providers associated with a given
- * list of ScanResult.
- *
- * An empty list will be returned if no match is found.
- *
- * @param scanResults a list of ScanResult
- * @return Map that consists {@link OsuProvider} and a list of matching {@link ScanResult}
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD
- })
- @NonNull
- public Map<OsuProvider, List<ScanResult>> getMatchingOsuProviders(
- @Nullable List<ScanResult> scanResults) {
- if (scanResults == null) {
- return new HashMap<>();
- }
- try {
- return mService.getMatchingOsuProviders(scanResults);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Returns the matching Passpoint R2 configurations for given OSU (Online Sign-Up) providers.
- *
- * Given a list of OSU providers, this only returns OSU providers that already have Passpoint R2
- * configurations in the device.
- * An empty map will be returned when there is no matching Passpoint R2 configuration for the
- * given OsuProviders.
- *
- * @param osuProviders a set of {@link OsuProvider}
- * @return Map that consists of {@link OsuProvider} and matching {@link PasspointConfiguration}.
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD
- })
- @NonNull
- public Map<OsuProvider, PasspointConfiguration> getMatchingPasspointConfigsForOsuProviders(
- @NonNull Set<OsuProvider> osuProviders) {
- try {
- return mService.getMatchingPasspointConfigsForOsuProviders(
- new ArrayList<>(osuProviders));
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Add a new network description to the set of configured networks.
- * The {@code networkId} field of the supplied configuration object
- * is ignored.
- * <p/>
- * The new network will be marked DISABLED by default. To enable it,
- * called {@link #enableNetwork}.
- *
- * @param config the set of variables that describe the configuration,
- * contained in a {@link WifiConfiguration} object.
- * If the {@link WifiConfiguration} has an Http Proxy set
- * the calling app must be System, or be provisioned as the Profile or Device Owner.
- * @return the ID of the newly created network description. This is used in
- * other operations to specified the network to be acted upon.
- * Returns {@code -1} on failure.
- *
- * @deprecated
- * a) See {@link WifiNetworkSpecifier.Builder#build()} for new
- * mechanism to trigger connection to a Wi-Fi network.
- * b) See {@link #addNetworkSuggestions(List)},
- * {@link #removeNetworkSuggestions(List)} for new API to add Wi-Fi networks for consideration
- * when auto-connecting to wifi.
- * <b>Compatibility Note:</b> For applications targeting
- * {@link android.os.Build.VERSION_CODES#Q} or above, this API will always fail and return
- * {@code -1}.
- * <p>
- * Deprecation Exemptions:
- * <ul>
- * <li>Device Owner (DO), Profile Owner (PO) and system apps.
- * </ul>
- */
- @Deprecated
- public int addNetwork(WifiConfiguration config) {
- if (config == null) {
- return -1;
- }
- config.networkId = -1;
- return addOrUpdateNetwork(config);
- }
-
- /**
- * Update the network description of an existing configured network.
- *
- * @param config the set of variables that describe the configuration,
- * contained in a {@link WifiConfiguration} object. It may
- * be sparse, so that only the items that are being changed
- * are non-<code>null</code>. The {@code networkId} field
- * must be set to the ID of the existing network being updated.
- * If the {@link WifiConfiguration} has an Http Proxy set
- * the calling app must be System, or be provisioned as the Profile or Device Owner.
- * @return Returns the {@code networkId} of the supplied
- * {@code WifiConfiguration} on success.
- * <br/>
- * Returns {@code -1} on failure, including when the {@code networkId}
- * field of the {@code WifiConfiguration} does not refer to an
- * existing network.
- *
- * @deprecated
- * a) See {@link WifiNetworkSpecifier.Builder#build()} for new
- * mechanism to trigger connection to a Wi-Fi network.
- * b) See {@link #addNetworkSuggestions(List)},
- * {@link #removeNetworkSuggestions(List)} for new API to add Wi-Fi networks for consideration
- * when auto-connecting to wifi.
- * <b>Compatibility Note:</b> For applications targeting
- * {@link android.os.Build.VERSION_CODES#Q} or above, this API will always fail and return
- * {@code -1}.
- * <p>
- * Deprecation Exemptions:
- * <ul>
- * <li>Device Owner (DO), Profile Owner (PO) and system apps.
- * </ul>
- */
- @Deprecated
- public int updateNetwork(WifiConfiguration config) {
- if (config == null || config.networkId < 0) {
- return -1;
- }
- return addOrUpdateNetwork(config);
- }
-
- /**
- * Internal method for doing the RPC that creates a new network description
- * or updates an existing one.
- *
- * @param config The possibly sparse object containing the variables that
- * are to set or updated in the network description.
- * @return the ID of the network on success, {@code -1} on failure.
- */
- private int addOrUpdateNetwork(WifiConfiguration config) {
- try {
- return mService.addOrUpdateNetwork(config, mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Interface for indicating user selection from the list of networks presented in the
- * {@link NetworkRequestMatchCallback#onMatch(List)}.
- *
- * The platform will implement this callback and pass it along with the
- * {@link NetworkRequestMatchCallback#onUserSelectionCallbackRegistration(
- * NetworkRequestUserSelectionCallback)}. The UI component handling
- * {@link NetworkRequestMatchCallback} will invoke {@link #select(WifiConfiguration)} or
- * {@link #reject()} to return the user's selection back to the platform via this callback.
- * @hide
- */
- @SystemApi
- public interface NetworkRequestUserSelectionCallback {
- /**
- * User selected this network to connect to.
- * @param wifiConfiguration WifiConfiguration object corresponding to the network
- * user selected.
- */
- @SuppressLint("CallbackMethodName")
- default void select(@NonNull WifiConfiguration wifiConfiguration) {}
-
- /**
- * User rejected the app's request.
- */
- @SuppressLint("CallbackMethodName")
- default void reject() {}
- }
-
- /**
- * Interface for network request callback. Should be implemented by applications and passed when
- * calling {@link #registerNetworkRequestMatchCallback(Executor,
- * WifiManager.NetworkRequestMatchCallback)}.
- *
- * This is meant to be implemented by a UI component to present the user with a list of networks
- * matching the app's request. The user is allowed to pick one of these networks to connect to
- * or reject the request by the app.
- * @hide
- */
- @SystemApi
- public interface NetworkRequestMatchCallback {
- /**
- * Invoked to register a callback to be invoked to convey user selection. The callback
- * object passed in this method is to be invoked by the UI component after the service sends
- * a list of matching scan networks using {@link #onMatch(List)} and user picks a network
- * from that list.
- *
- * @param userSelectionCallback Callback object to send back the user selection.
- */
- default void onUserSelectionCallbackRegistration(
- @NonNull NetworkRequestUserSelectionCallback userSelectionCallback) {}
-
- /**
- * Invoked when the active network request is aborted, either because
- * <li> The app released the request, OR</li>
- * <li> Request was overridden by a new request</li>
- * This signals the end of processing for the current request and should stop the UI
- * component. No subsequent calls from the UI component will be handled by the platform.
- */
- default void onAbort() {}
-
- /**
- * Invoked when a network request initiated by an app matches some networks in scan results.
- * This may be invoked multiple times for a single network request as the platform finds new
- * matching networks in scan results.
- *
- * @param scanResults List of {@link ScanResult} objects corresponding to the networks
- * matching the request.
- */
- default void onMatch(@NonNull List<ScanResult> scanResults) {}
-
- /**
- * Invoked on a successful connection with the network that the user selected
- * via {@link NetworkRequestUserSelectionCallback}.
- *
- * @param wifiConfiguration WifiConfiguration object corresponding to the network that the
- * user selected.
- */
- default void onUserSelectionConnectSuccess(@NonNull WifiConfiguration wifiConfiguration) {}
-
- /**
- * Invoked on failure to establish connection with the network that the user selected
- * via {@link NetworkRequestUserSelectionCallback}.
- *
- * @param wifiConfiguration WifiConfiguration object corresponding to the network
- * user selected.
- */
- default void onUserSelectionConnectFailure(@NonNull WifiConfiguration wifiConfiguration) {}
- }
-
- /**
- * Callback proxy for NetworkRequestUserSelectionCallback objects.
- * @hide
- */
- private class NetworkRequestUserSelectionCallbackProxy implements
- NetworkRequestUserSelectionCallback {
- private final INetworkRequestUserSelectionCallback mCallback;
-
- NetworkRequestUserSelectionCallbackProxy(
- INetworkRequestUserSelectionCallback callback) {
- mCallback = callback;
- }
-
- @Override
- public void select(@NonNull WifiConfiguration wifiConfiguration) {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "NetworkRequestUserSelectionCallbackProxy: select "
- + "wificonfiguration: " + wifiConfiguration);
- }
- try {
- mCallback.select(wifiConfiguration);
- } catch (RemoteException e) {
- Log.e(TAG, "Failed to invoke onSelected", e);
- throw e.rethrowFromSystemServer();
- }
- }
-
- @Override
- public void reject() {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "NetworkRequestUserSelectionCallbackProxy: reject");
- }
- try {
- mCallback.reject();
- } catch (RemoteException e) {
- Log.e(TAG, "Failed to invoke onRejected", e);
- throw e.rethrowFromSystemServer();
- }
- }
- }
-
- /**
- * Callback proxy for NetworkRequestMatchCallback objects.
- * @hide
- */
- private class NetworkRequestMatchCallbackProxy extends INetworkRequestMatchCallback.Stub {
- private final Executor mExecutor;
- private final NetworkRequestMatchCallback mCallback;
-
- NetworkRequestMatchCallbackProxy(Executor executor, NetworkRequestMatchCallback callback) {
- mExecutor = executor;
- mCallback = callback;
- }
-
- @Override
- public void onUserSelectionCallbackRegistration(
- INetworkRequestUserSelectionCallback userSelectionCallback) {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "NetworkRequestMatchCallbackProxy: "
- + "onUserSelectionCallbackRegistration callback: " + userSelectionCallback);
- }
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> {
- mCallback.onUserSelectionCallbackRegistration(
- new NetworkRequestUserSelectionCallbackProxy(userSelectionCallback));
- });
- }
-
- @Override
- public void onAbort() {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "NetworkRequestMatchCallbackProxy: onAbort");
- }
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> {
- mCallback.onAbort();
- });
- }
-
- @Override
- public void onMatch(List<ScanResult> scanResults) {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "NetworkRequestMatchCallbackProxy: onMatch scanResults: "
- + scanResults);
- }
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> {
- mCallback.onMatch(scanResults);
- });
- }
-
- @Override
- public void onUserSelectionConnectSuccess(WifiConfiguration wifiConfiguration) {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "NetworkRequestMatchCallbackProxy: onUserSelectionConnectSuccess "
- + " wificonfiguration: " + wifiConfiguration);
- }
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> {
- mCallback.onUserSelectionConnectSuccess(wifiConfiguration);
- });
- }
-
- @Override
- public void onUserSelectionConnectFailure(WifiConfiguration wifiConfiguration) {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "NetworkRequestMatchCallbackProxy: onUserSelectionConnectFailure"
- + " wificonfiguration: " + wifiConfiguration);
- }
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> {
- mCallback.onUserSelectionConnectFailure(wifiConfiguration);
- });
- }
- }
-
- /**
- * Registers a callback for NetworkRequest matches. See {@link NetworkRequestMatchCallback}.
- * Caller can unregister a previously registered callback using
- * {@link #unregisterNetworkRequestMatchCallback(NetworkRequestMatchCallback)}
- * <p>
- * Applications should have the
- * {@link android.Manifest.permission#NETWORK_SETTINGS} permission. Callers
- * without the permission will trigger a {@link java.lang.SecurityException}.
- * <p>
- *
- * @param executor The Executor on whose thread to execute the callbacks of the {@code callback}
- * object.
- * @param callback Callback for network match events to register.
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void registerNetworkRequestMatchCallback(@NonNull @CallbackExecutor Executor executor,
- @NonNull NetworkRequestMatchCallback callback) {
- if (executor == null) throw new IllegalArgumentException("executor cannot be null");
- if (callback == null) throw new IllegalArgumentException("callback cannot be null");
- Log.v(TAG, "registerNetworkRequestMatchCallback: callback=" + callback
- + ", executor=" + executor);
-
- Binder binder = new Binder();
- try {
- mService.registerNetworkRequestMatchCallback(
- binder, new NetworkRequestMatchCallbackProxy(executor, callback),
- callback.hashCode());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Unregisters a callback for NetworkRequest matches. See {@link NetworkRequestMatchCallback}.
- * <p>
- * Applications should have the
- * {@link android.Manifest.permission#NETWORK_SETTINGS} permission. Callers
- * without the permission will trigger a {@link java.lang.SecurityException}.
- * <p>
- *
- * @param callback Callback for network match events to unregister.
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void unregisterNetworkRequestMatchCallback(
- @NonNull NetworkRequestMatchCallback callback) {
- if (callback == null) throw new IllegalArgumentException("callback cannot be null");
- Log.v(TAG, "unregisterNetworkRequestMatchCallback: callback=" + callback);
-
- try {
- mService.unregisterNetworkRequestMatchCallback(callback.hashCode());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Provide a list of network suggestions to the device. See {@link WifiNetworkSuggestion}
- * for a detailed explanation of the parameters.
- * When the device decides to connect to one of the provided network suggestions, platform sends
- * a directed broadcast {@link #ACTION_WIFI_NETWORK_SUGGESTION_POST_CONNECTION} to the app if
- * the network was created with
- * {@link WifiNetworkSuggestion.Builder#setIsAppInteractionRequired(boolean)} flag set and the
- * app holds {@link android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION}
- * permission.
- *<p>
- * NOTE:
- * <li> These networks are just a suggestion to the platform. The platform will ultimately
- * decide on which network the device connects to. </li>
- * <li> When an app is uninstalled or disabled, all its suggested networks are discarded.
- * If the device is currently connected to a suggested network which is being removed then the
- * device will disconnect from that network.</li>
- * <li> If user reset network settings, all added suggestions will be discarded. Apps can use
- * {@link #getNetworkSuggestions()} to check if their suggestions are in the device.</li>
- * <li> In-place modification of existing suggestions are allowed.
- * <li> If the provided suggestions include any previously provided suggestions by the app,
- * previous suggestions will be updated.</li>
- * <li>If one of the provided suggestions marks a previously unmetered suggestion as metered and
- * the device is currently connected to that suggested network, then the device will disconnect
- * from that network. The system will immediately re-evaluate all the network candidates
- * and possibly reconnect back to the same suggestion. This disconnect is to make sure that any
- * traffic flowing over unmetered networks isn't accidentally continued over a metered network.
- * </li>
- * </li>
- *
- * @param networkSuggestions List of network suggestions provided by the app.
- * @return Status code for the operation. One of the STATUS_NETWORK_SUGGESTIONS_ values.
- * @throws {@link SecurityException} if the caller is missing required permissions.
- * @see WifiNetworkSuggestion#equals(Object)
- */
- @RequiresPermission(android.Manifest.permission.CHANGE_WIFI_STATE)
- public @NetworkSuggestionsStatusCode int addNetworkSuggestions(
- @NonNull List<WifiNetworkSuggestion> networkSuggestions) {
- try {
- return mService.addNetworkSuggestions(
- networkSuggestions, mContext.getOpPackageName(), mContext.getAttributionTag());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Remove some or all of the network suggestions that were previously provided by the app.
- * If one of the suggestions being removed was used to establish connection to the current
- * network, then the device will immediately disconnect from that network.
- *
- * See {@link WifiNetworkSuggestion} for a detailed explanation of the parameters.
- * See {@link WifiNetworkSuggestion#equals(Object)} for the equivalence evaluation used.
- *
- * @param networkSuggestions List of network suggestions to be removed. Pass an empty list
- * to remove all the previous suggestions provided by the app.
- * @return Status code for the operation. One of the STATUS_NETWORK_SUGGESTIONS_ values.
- * Any matching suggestions are removed from the device and will not be considered for any
- * further connection attempts.
- */
- @RequiresPermission(android.Manifest.permission.CHANGE_WIFI_STATE)
- public @NetworkSuggestionsStatusCode int removeNetworkSuggestions(
- @NonNull List<WifiNetworkSuggestion> networkSuggestions) {
- try {
- return mService.removeNetworkSuggestions(
- networkSuggestions, mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Get all network suggestions provided by the calling app.
- * See {@link #addNetworkSuggestions(List)}
- * See {@link #removeNetworkSuggestions(List)}
- * @return a list of {@link WifiNetworkSuggestion}
- */
- @RequiresPermission(ACCESS_WIFI_STATE)
- public @NonNull List<WifiNetworkSuggestion> getNetworkSuggestions() {
- try {
- return mService.getNetworkSuggestions(mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowAsRuntimeException();
- }
- }
-
- /**
- * Returns the max number of network suggestions that are allowed per app on the device.
- * @see #addNetworkSuggestions(List)
- * @see #removeNetworkSuggestions(List)
- */
- public int getMaxNumberOfNetworkSuggestionsPerApp() {
- return getMaxNumberOfNetworkSuggestionsPerApp(
- mContext.getSystemService(ActivityManager.class).isLowRamDevice());
- }
-
- /** @hide */
- public static int getMaxNumberOfNetworkSuggestionsPerApp(boolean isLowRamDevice) {
- return isLowRamDevice
- ? NETWORK_SUGGESTIONS_MAX_PER_APP_LOW_RAM
- : NETWORK_SUGGESTIONS_MAX_PER_APP_HIGH_RAM;
- }
-
- /**
- * Get the Suggestion approval status of the calling app. When an app makes suggestions using
- * the {@link #addNetworkSuggestions(List)} API they may trigger a user approval flow. This API
- * provides the current approval status.
- *
- * @return Status code for the user approval. One of the STATUS_SUGGESTION_APPROVAL_ values.
- * @throws {@link SecurityException} if the caller is missing required permissions.
- */
- @RequiresPermission(ACCESS_WIFI_STATE)
- public @SuggestionUserApprovalStatus int getNetworkSuggestionUserApprovalStatus() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- try {
- return mService.getNetworkSuggestionUserApprovalStatus(mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowAsRuntimeException();
- }
- }
-
- /**
- * Add or update a Passpoint configuration. The configuration provides a credential
- * for connecting to Passpoint networks that are operated by the Passpoint
- * service provider specified in the configuration.
- *
- * Each configuration is uniquely identified by a unique key which depends on the contents of
- * the configuration. This allows the caller to install multiple profiles with the same FQDN
- * (Fully qualified domain name). Therefore, in order to update an existing profile, it is
- * first required to remove it using {@link WifiManager#removePasspointConfiguration(String)}.
- * Otherwise, a new profile will be added with both configuration.
- *
- * @param config The Passpoint configuration to be added
- * @throws IllegalArgumentException if configuration is invalid or Passpoint is not enabled on
- * the device.
- *
- * Deprecated for general app usage - except DO/PO apps.
- * See {@link WifiNetworkSuggestion.Builder#setPasspointConfig(PasspointConfiguration)} to
- * create a passpoint suggestion.
- * See {@link #addNetworkSuggestions(List)}, {@link #removeNetworkSuggestions(List)} for new
- * API to add Wi-Fi networks for consideration when auto-connecting to wifi.
- * <b>Compatibility Note:</b> For applications targeting
- * {@link android.os.Build.VERSION_CODES#R} or above, this API will always fail and throw
- * {@link IllegalArgumentException}.
- * <p>
- * Deprecation Exemptions:
- * <ul>
- * <li>Device Owner (DO), Profile Owner (PO) and system apps.
- * </ul>
- */
- public void addOrUpdatePasspointConfiguration(PasspointConfiguration config) {
- try {
- if (!mService.addOrUpdatePasspointConfiguration(config, mContext.getOpPackageName())) {
- throw new IllegalArgumentException();
- }
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Remove the Passpoint configuration identified by its FQDN (Fully Qualified Domain Name) added
- * by the caller.
- *
- * @param fqdn The FQDN of the Passpoint configuration added by the caller to be removed
- * @throws IllegalArgumentException if no configuration is associated with the given FQDN or
- * Passpoint is not enabled on the device.
- * @deprecated This will be non-functional in a future release.
- */
- @Deprecated
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_CARRIER_PROVISIONING
- })
- public void removePasspointConfiguration(String fqdn) {
- try {
- if (!mService.removePasspointConfiguration(fqdn, mContext.getOpPackageName())) {
- throw new IllegalArgumentException();
- }
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Return the list of installed Passpoint configurations added by the caller.
- *
- * An empty list will be returned when no configurations are installed.
- *
- * @return A list of {@link PasspointConfiguration} added by the caller
- * @deprecated This will be non-functional in a future release.
- */
- @Deprecated
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD
- })
- public List<PasspointConfiguration> getPasspointConfigurations() {
- try {
- return mService.getPasspointConfigurations(mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Query for a Hotspot 2.0 release 2 OSU icon file. An {@link #ACTION_PASSPOINT_ICON} intent
- * will be broadcasted once the request is completed. The presence of the intent extra
- * {@link #EXTRA_ICON} will indicate the result of the request.
- * A missing intent extra {@link #EXTRA_ICON} will indicate a failure.
- *
- * @param bssid The BSSID of the AP
- * @param fileName Name of the icon file (remote file) to query from the AP
- *
- * @throws UnsupportedOperationException if Passpoint is not enabled on the device.
- * @hide
- */
- public void queryPasspointIcon(long bssid, String fileName) {
- try {
- mService.queryPasspointIcon(bssid, fileName);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Match the currently associated network against the SP matching the given FQDN
- * @param fqdn FQDN of the SP
- * @return ordinal [HomeProvider, RoamingProvider, Incomplete, None, Declined]
- * @hide
- */
- public int matchProviderWithCurrentNetwork(String fqdn) {
- try {
- return mService.matchProviderWithCurrentNetwork(fqdn);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Remove the specified network from the list of configured networks.
- * This may result in the asynchronous delivery of state change
- * events.
- *
- * Applications are not allowed to remove networks created by other
- * applications.
- *
- * @param netId the ID of the network as returned by {@link #addNetwork} or {@link
- * #getConfiguredNetworks}.
- * @return {@code true} if the operation succeeded
- *
- * @deprecated
- * a) See {@link WifiNetworkSpecifier.Builder#build()} for new
- * mechanism to trigger connection to a Wi-Fi network.
- * b) See {@link #addNetworkSuggestions(List)},
- * {@link #removeNetworkSuggestions(List)} for new API to add Wi-Fi networks for consideration
- * when auto-connecting to wifi.
- * <b>Compatibility Note:</b> For applications targeting
- * {@link android.os.Build.VERSION_CODES#Q} or above, this API will always fail and return
- * {@code false}.
- * <p>
- * Deprecation Exemptions:
- * <ul>
- * <li>Device Owner (DO), Profile Owner (PO) and system apps.
- * </ul>
- */
- @Deprecated
- public boolean removeNetwork(int netId) {
- try {
- return mService.removeNetwork(netId, mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Allow a previously configured network to be associated with. If
- * <code>attemptConnect</code> is true, an attempt to connect to the selected
- * network is initiated. This may result in the asynchronous delivery
- * of state change events.
- * <p>
- * <b>Note:</b> Network communication may not use Wi-Fi even if Wi-Fi is connected;
- * traffic may instead be sent through another network, such as cellular data,
- * Bluetooth tethering, or Ethernet. For example, traffic will never use a
- * Wi-Fi network that does not provide Internet access (e.g. a wireless
- * printer), if another network that does offer Internet access (e.g.
- * cellular data) is available. Applications that need to ensure that their
- * network traffic uses Wi-Fi should use APIs such as
- * {@link Network#bindSocket(java.net.Socket)},
- * {@link Network#openConnection(java.net.URL)}, or
- * {@link ConnectivityManager#bindProcessToNetwork} to do so.
- *
- * Applications are not allowed to enable networks created by other
- * applications.
- *
- * @param netId the ID of the network as returned by {@link #addNetwork} or {@link
- * #getConfiguredNetworks}.
- * @param attemptConnect The way to select a particular network to connect to is specify
- * {@code true} for this parameter.
- * @return {@code true} if the operation succeeded
- *
- * @deprecated
- * a) See {@link WifiNetworkSpecifier.Builder#build()} for new
- * mechanism to trigger connection to a Wi-Fi network.
- * b) See {@link #addNetworkSuggestions(List)},
- * {@link #removeNetworkSuggestions(List)} for new API to add Wi-Fi networks for consideration
- * when auto-connecting to wifi.
- * <b>Compatibility Note:</b> For applications targeting
- * {@link android.os.Build.VERSION_CODES#Q} or above, this API will always fail and return
- * {@code false}.
- * Deprecation Exemptions:
- * <ul>
- * <li>Device Owner (DO), Profile Owner (PO) and system apps.
- * </ul>
- */
- @Deprecated
- public boolean enableNetwork(int netId, boolean attemptConnect) {
- try {
- return mService.enableNetwork(netId, attemptConnect, mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Disable a configured network. The specified network will not be
- * a candidate for associating. This may result in the asynchronous
- * delivery of state change events.
- *
- * Applications are not allowed to disable networks created by other
- * applications.
- *
- * @param netId the ID of the network as returned by {@link #addNetwork} or {@link
- * #getConfiguredNetworks}.
- * @return {@code true} if the operation succeeded
- *
- * @deprecated
- * a) See {@link WifiNetworkSpecifier.Builder#build()} for new
- * mechanism to trigger connection to a Wi-Fi network.
- * b) See {@link #addNetworkSuggestions(List)},
- * {@link #removeNetworkSuggestions(List)} for new API to add Wi-Fi networks for consideration
- * when auto-connecting to wifi.
- * <b>Compatibility Note:</b> For applications targeting
- * {@link android.os.Build.VERSION_CODES#Q} or above, this API will always fail and return
- * {@code false}.
- * <p>
- * Deprecation Exemptions:
- * <ul>
- * <li>Device Owner (DO), Profile Owner (PO) and system apps.
- * </ul>
- */
- @Deprecated
- public boolean disableNetwork(int netId) {
- try {
- return mService.disableNetwork(netId, mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Disassociate from the currently active access point. This may result
- * in the asynchronous delivery of state change events.
- * @return {@code true} if the operation succeeded
- *
- * @deprecated
- * a) See {@link WifiNetworkSpecifier.Builder#build()} for new
- * mechanism to trigger connection to a Wi-Fi network.
- * b) See {@link #addNetworkSuggestions(List)},
- * {@link #removeNetworkSuggestions(List)} for new API to add Wi-Fi networks for consideration
- * when auto-connecting to wifi.
- * <b>Compatibility Note:</b> For applications targeting
- * {@link android.os.Build.VERSION_CODES#Q} or above, this API will always fail and return
- * {@code false}.
- * <p>
- * Deprecation Exemptions:
- * <ul>
- * <li>Device Owner (DO), Profile Owner (PO) and system apps.
- * </ul>
- */
- @Deprecated
- public boolean disconnect() {
- try {
- return mService.disconnect(mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Reconnect to the currently active access point, if we are currently
- * disconnected. This may result in the asynchronous delivery of state
- * change events.
- * @return {@code true} if the operation succeeded
- *
- * @deprecated
- * a) See {@link WifiNetworkSpecifier.Builder#build()} for new
- * mechanism to trigger connection to a Wi-Fi network.
- * b) See {@link #addNetworkSuggestions(List)},
- * {@link #removeNetworkSuggestions(List)} for new API to add Wi-Fi networks for consideration
- * when auto-connecting to wifi.
- * <b>Compatibility Note:</b> For applications targeting
- * {@link android.os.Build.VERSION_CODES#Q} or above, this API will always fail and return
- * {@code false}.
- * <p>
- * Deprecation Exemptions:
- * <ul>
- * <li>Device Owner (DO), Profile Owner (PO) and system apps.
- * </ul>
- */
- @Deprecated
- public boolean reconnect() {
- try {
- return mService.reconnect(mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Reconnect to the currently active access point, even if we are already
- * connected. This may result in the asynchronous delivery of state
- * change events.
- * @return {@code true} if the operation succeeded
- *
- * @deprecated
- * a) See {@link WifiNetworkSpecifier.Builder#build()} for new
- * mechanism to trigger connection to a Wi-Fi network.
- * b) See {@link #addNetworkSuggestions(List)},
- * {@link #removeNetworkSuggestions(List)} for new API to add Wi-Fi networks for consideration
- * when auto-connecting to wifi.
- * <b>Compatibility Note:</b> For applications targeting
- * {@link android.os.Build.VERSION_CODES#Q} or above, this API will always return false.
- */
- @Deprecated
- public boolean reassociate() {
- try {
- return mService.reassociate(mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Check that the supplicant daemon is responding to requests.
- * @return {@code true} if we were able to communicate with the supplicant and
- * it returned the expected response to the PING message.
- * @deprecated Will return the output of {@link #isWifiEnabled()} instead.
- */
- @Deprecated
- public boolean pingSupplicant() {
- return isWifiEnabled();
- }
-
- /** @hide */
- public static final long WIFI_FEATURE_INFRA = 0x0001L; // Basic infrastructure mode
- /** @hide */
- public static final long WIFI_FEATURE_PASSPOINT = 0x0004L; // Support for GAS/ANQP
- /** @hide */
- public static final long WIFI_FEATURE_P2P = 0x0008L; // Wifi-Direct
- /** @hide */
- public static final long WIFI_FEATURE_MOBILE_HOTSPOT = 0x0010L; // Soft AP
- /** @hide */
- public static final long WIFI_FEATURE_SCANNER = 0x0020L; // WifiScanner APIs
- /** @hide */
- public static final long WIFI_FEATURE_AWARE = 0x0040L; // Wi-Fi AWare networking
- /** @hide */
- public static final long WIFI_FEATURE_D2D_RTT = 0x0080L; // Device-to-device RTT
- /** @hide */
- public static final long WIFI_FEATURE_D2AP_RTT = 0x0100L; // Device-to-AP RTT
- /** @hide */
- public static final long WIFI_FEATURE_BATCH_SCAN = 0x0200L; // Batched Scan (deprecated)
- /** @hide */
- public static final long WIFI_FEATURE_PNO = 0x0400L; // Preferred network offload
- /** @hide */
- public static final long WIFI_FEATURE_ADDITIONAL_STA = 0x0800L; // Support for two STAs
- /** @hide */
- public static final long WIFI_FEATURE_TDLS = 0x1000L; // Tunnel directed link setup
- /** @hide */
- public static final long WIFI_FEATURE_TDLS_OFFCHANNEL = 0x2000L; // TDLS off channel
- /** @hide */
- public static final long WIFI_FEATURE_EPR = 0x4000L; // Enhanced power reporting
- /** @hide */
- public static final long WIFI_FEATURE_AP_STA = 0x8000L; // AP STA Concurrency
- /** @hide */
- public static final long WIFI_FEATURE_LINK_LAYER_STATS = 0x10000L; // Link layer stats
- /** @hide */
- public static final long WIFI_FEATURE_LOGGER = 0x20000L; // WiFi Logger
- /** @hide */
- public static final long WIFI_FEATURE_HAL_EPNO = 0x40000L; // Enhanced PNO
- /** @hide */
- public static final long WIFI_FEATURE_RSSI_MONITOR = 0x80000L; // RSSI Monitor
- /** @hide */
- public static final long WIFI_FEATURE_MKEEP_ALIVE = 0x100000L; // mkeep_alive
- /** @hide */
- public static final long WIFI_FEATURE_CONFIG_NDO = 0x200000L; // ND offload
- /** @hide */
- public static final long WIFI_FEATURE_TRANSMIT_POWER = 0x400000L; // Capture transmit power
- /** @hide */
- public static final long WIFI_FEATURE_CONTROL_ROAMING = 0x800000L; // Control firmware roaming
- /** @hide */
- public static final long WIFI_FEATURE_IE_WHITELIST = 0x1000000L; // Probe IE white listing
- /** @hide */
- public static final long WIFI_FEATURE_SCAN_RAND = 0x2000000L; // Random MAC & Probe seq
- /** @hide */
- public static final long WIFI_FEATURE_TX_POWER_LIMIT = 0x4000000L; // Set Tx power limit
- /** @hide */
- public static final long WIFI_FEATURE_WPA3_SAE = 0x8000000L; // WPA3-Personal SAE
- /** @hide */
- public static final long WIFI_FEATURE_WPA3_SUITE_B = 0x10000000L; // WPA3-Enterprise Suite-B
- /** @hide */
- public static final long WIFI_FEATURE_OWE = 0x20000000L; // Enhanced Open
- /** @hide */
- public static final long WIFI_FEATURE_LOW_LATENCY = 0x40000000L; // Low Latency modes
- /** @hide */
- public static final long WIFI_FEATURE_DPP = 0x80000000L; // DPP (Easy-Connect)
- /** @hide */
- public static final long WIFI_FEATURE_P2P_RAND_MAC = 0x100000000L; // Random P2P MAC
- /** @hide */
- public static final long WIFI_FEATURE_CONNECTED_RAND_MAC = 0x200000000L; // Random STA MAC
- /** @hide */
- public static final long WIFI_FEATURE_AP_RAND_MAC = 0x400000000L; // Random AP MAC
- /** @hide */
- public static final long WIFI_FEATURE_MBO = 0x800000000L; // MBO Support
- /** @hide */
- public static final long WIFI_FEATURE_OCE = 0x1000000000L; // OCE Support
- /** @hide */
- public static final long WIFI_FEATURE_WAPI = 0x2000000000L; // WAPI
- /** @hide */
- public static final long WIFI_FEATURE_INFRA_60G = 0x4000000000L; // 60 GHz Band Support
-
- /** @hide */
- public static final long WIFI_FEATURE_FILS_SHA256 = 0x4000000000L; // FILS-SHA256
-
- /** @hide */
- public static final long WIFI_FEATURE_FILS_SHA384 = 0x8000000000L; // FILS-SHA384
-
- /** @hide */
- public static final long WIFI_FEATURE_SAE_PK = 0x10000000000L; // SAE-PK
-
- /** @hide */
- public static final long WIFI_FEATURE_STA_BRIDGED_AP = 0x20000000000L; // STA + Bridged AP
-
- /** @hide */
- public static final long WIFI_FEATURE_BRIDGED_AP = 0x40000000000L; // Bridged AP
-
- private long getSupportedFeatures() {
- try {
- return mService.getSupportedFeatures();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- private boolean isFeatureSupported(long feature) {
- return (getSupportedFeatures() & feature) == feature;
- }
-
- /**
- * @return true if this adapter supports Passpoint
- * @hide
- */
- public boolean isPasspointSupported() {
- return isFeatureSupported(WIFI_FEATURE_PASSPOINT);
- }
-
- /**
- * @return true if this adapter supports WifiP2pManager (Wi-Fi Direct)
- */
- public boolean isP2pSupported() {
- return isFeatureSupported(WIFI_FEATURE_P2P);
- }
-
- /**
- * @return true if this adapter supports portable Wi-Fi hotspot
- * @hide
- */
- @SystemApi
- public boolean isPortableHotspotSupported() {
- return isFeatureSupported(WIFI_FEATURE_MOBILE_HOTSPOT);
- }
-
- /**
- * @return true if this adapter supports WifiScanner APIs
- * @hide
- */
- @SystemApi
- public boolean isWifiScannerSupported() {
- return isFeatureSupported(WIFI_FEATURE_SCANNER);
- }
-
- /**
- * @return true if this adapter supports Neighbour Awareness Network APIs
- * @hide
- */
- public boolean isWifiAwareSupported() {
- return isFeatureSupported(WIFI_FEATURE_AWARE);
- }
-
- /**
- * Query whether the device supports Station (STA) + Access point (AP) concurrency or not.
- *
- * @return true if this device supports STA + AP concurrency, false otherwise.
- */
- public boolean isStaApConcurrencySupported() {
- return isFeatureSupported(WIFI_FEATURE_AP_STA);
- }
-
- /**
- * Query whether the device supports 2 or more concurrent stations (STA) or not.
- *
- * @return true if this device supports multiple STA concurrency, false otherwise.
- */
- public boolean isMultiStaConcurrencySupported() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- return isFeatureSupported(WIFI_FEATURE_ADDITIONAL_STA);
- }
-
- /**
- * @deprecated Please use {@link android.content.pm.PackageManager#hasSystemFeature(String)}
- * with {@link android.content.pm.PackageManager#FEATURE_WIFI_RTT} and
- * {@link android.content.pm.PackageManager#FEATURE_WIFI_AWARE}.
- *
- * @return true if this adapter supports Device-to-device RTT
- * @hide
- */
- @Deprecated
- @SystemApi
- public boolean isDeviceToDeviceRttSupported() {
- return isFeatureSupported(WIFI_FEATURE_D2D_RTT);
- }
-
- /**
- * @deprecated Please use {@link android.content.pm.PackageManager#hasSystemFeature(String)}
- * with {@link android.content.pm.PackageManager#FEATURE_WIFI_RTT}.
- *
- * @return true if this adapter supports Device-to-AP RTT
- */
- @Deprecated
- public boolean isDeviceToApRttSupported() {
- return isFeatureSupported(WIFI_FEATURE_D2AP_RTT);
- }
-
- /**
- * @return true if this adapter supports offloaded connectivity scan
- */
- public boolean isPreferredNetworkOffloadSupported() {
- return isFeatureSupported(WIFI_FEATURE_PNO);
- }
-
- /**
- * @return true if this adapter supports Tunnel Directed Link Setup
- */
- public boolean isTdlsSupported() {
- return isFeatureSupported(WIFI_FEATURE_TDLS);
- }
-
- /**
- * @return true if this adapter supports Off Channel Tunnel Directed Link Setup
- * @hide
- */
- public boolean isOffChannelTdlsSupported() {
- return isFeatureSupported(WIFI_FEATURE_TDLS_OFFCHANNEL);
- }
-
- /**
- * @return true if this adapter supports advanced power/performance counters
- */
- public boolean isEnhancedPowerReportingSupported() {
- return isFeatureSupported(WIFI_FEATURE_LINK_LAYER_STATS);
- }
-
- /**
- * @return true if this device supports connected MAC randomization.
- * @hide
- */
- @SystemApi
- public boolean isConnectedMacRandomizationSupported() {
- return isFeatureSupported(WIFI_FEATURE_CONNECTED_RAND_MAC);
- }
-
- /**
- * @return true if this device supports connected MAC randomization.
- * @hide
- */
- @SystemApi
- public boolean isApMacRandomizationSupported() {
- return isFeatureSupported(WIFI_FEATURE_AP_RAND_MAC);
- }
-
- /**
- * Check if the chipset supports 5GHz band.
- * @return {@code true} if supported, {@code false} otherwise.
- */
- public boolean is5GHzBandSupported() {
- try {
- return mService.is5GHzBandSupported();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Check if the chipset supports the 60GHz frequency band.
- *
- * @return {@code true} if supported, {@code false} otherwise.
- * @hide
- */
- @SystemApi
- public boolean is60GHzBandSupported() {
- try {
- return mService.is60GHzBandSupported();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Check if the chipset supports 6GHz band.
- * @return {@code true} if supported, {@code false} otherwise.
- */
- public boolean is6GHzBandSupported() {
- try {
- return mService.is6GHzBandSupported();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Check if the chipset supports a certain Wi-Fi standard.
- * @param standard the IEEE 802.11 standard to check on.
- * valid values from {@link ScanResult}'s {@code WIFI_STANDARD_}
- * @return {@code true} if supported, {@code false} otherwise.
- */
- public boolean isWifiStandardSupported(@WifiAnnotations.WifiStandard int standard) {
- try {
- return mService.isWifiStandardSupported(standard);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Query whether the device supports Station (STA) + Bridged access point (AP)
- * concurrency or not.
- *
- * The bridged AP support means that the device supports AP + AP concurrency with the 2 APs
- * bridged together.
- *
- * See {@link SoftApConfiguration.Builder#setBands(int[])}
- * or {@link SoftApConfiguration.Builder#setChannels(SparseIntArray)} to configure bridged AP
- * when the bridged AP supported.
- *
- * @return true if this device supports STA + bridged AP concurrency, false otherwise.
- */
- public boolean isStaBridgedApConcurrencySupported() {
- return isFeatureSupported(WIFI_FEATURE_STA_BRIDGED_AP);
- }
-
- /**
- * Query whether the device supports Bridged Access point (AP) concurrency or not.
- *
- * The bridged AP support means that the device supports AP + AP concurrency with the 2 APs
- * bridged together.
- *
- * See {@link SoftApConfiguration.Builder#setBands(int[])}
- * or {@link SoftApConfiguration.Builder#setChannels(SparseIntArray)} to configure bridged AP
- * when the bridged AP supported.
- *
- * @return true if this device supports bridged AP concurrency, false otherwise.
- */
- public boolean isBridgedApConcurrencySupported() {
- return isFeatureSupported(WIFI_FEATURE_BRIDGED_AP);
- }
-
-
- /**
- * Interface for Wi-Fi activity energy info listener. Should be implemented by applications and
- * set when calling {@link WifiManager#getWifiActivityEnergyInfoAsync}.
- *
- * @hide
- */
- @SystemApi
- public interface OnWifiActivityEnergyInfoListener {
- /**
- * Called when Wi-Fi activity energy info is available.
- * Note: this listener is triggered at most once for each call to
- * {@link #getWifiActivityEnergyInfoAsync}.
- *
- * @param info the latest {@link WifiActivityEnergyInfo}, or null if unavailable.
- */
- void onWifiActivityEnergyInfo(@Nullable WifiActivityEnergyInfo info);
- }
-
- private static class OnWifiActivityEnergyInfoProxy
- extends IOnWifiActivityEnergyInfoListener.Stub {
- private final Object mLock = new Object();
- @Nullable @GuardedBy("mLock") private Executor mExecutor;
- @Nullable @GuardedBy("mLock") private OnWifiActivityEnergyInfoListener mListener;
-
- OnWifiActivityEnergyInfoProxy(Executor executor,
- OnWifiActivityEnergyInfoListener listener) {
- mExecutor = executor;
- mListener = listener;
- }
-
- @Override
- public void onWifiActivityEnergyInfo(WifiActivityEnergyInfo info) {
- Executor executor;
- OnWifiActivityEnergyInfoListener listener;
- synchronized (mLock) {
- if (mExecutor == null || mListener == null) {
- return;
- }
- executor = mExecutor;
- listener = mListener;
- // null out to allow garbage collection, prevent triggering listener more than once
- mExecutor = null;
- mListener = null;
- }
- Binder.clearCallingIdentity();
- executor.execute(() -> listener.onWifiActivityEnergyInfo(info));
- }
- }
-
- /**
- * Request to get the current {@link WifiActivityEnergyInfo} asynchronously.
- * Note: This method will return null if {@link #isEnhancedPowerReportingSupported()} returns
- * false.
- *
- * @param executor the executor that the listener will be invoked on
- * @param listener the listener that will receive the {@link WifiActivityEnergyInfo} object
- * when it becomes available. The listener will be triggered at most once for
- * each call to this method.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(ACCESS_WIFI_STATE)
- public void getWifiActivityEnergyInfoAsync(
- @NonNull @CallbackExecutor Executor executor,
- @NonNull OnWifiActivityEnergyInfoListener listener) {
- Objects.requireNonNull(executor, "executor cannot be null");
- Objects.requireNonNull(listener, "listener cannot be null");
- try {
- mService.getWifiActivityEnergyInfoAsync(
- new OnWifiActivityEnergyInfoProxy(executor, listener));
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Request a scan for access points. Returns immediately. The availability
- * of the results is made known later by means of an asynchronous event sent
- * on completion of the scan.
- * <p>
- * To initiate a Wi-Fi scan, declare the
- * {@link android.Manifest.permission#CHANGE_WIFI_STATE}
- * permission in the manifest, and perform these steps:
- * </p>
- * <ol style="1">
- * <li>Invoke the following method:
- * {@code ((WifiManager) getSystemService(WIFI_SERVICE)).startScan()}</li>
- * <li>
- * Register a BroadcastReceiver to listen to
- * {@code SCAN_RESULTS_AVAILABLE_ACTION}.</li>
- * <li>When a broadcast is received, call:
- * {@code ((WifiManager) getSystemService(WIFI_SERVICE)).getScanResults()}</li>
- * </ol>
- * @return {@code true} if the operation succeeded, i.e., the scan was initiated.
- * @deprecated The ability for apps to trigger scan requests will be removed in a future
- * release.
- */
- @Deprecated
- public boolean startScan() {
- return startScan(null);
- }
-
- /** @hide */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS)
- public boolean startScan(WorkSource workSource) {
- try {
- String packageName = mContext.getOpPackageName();
- String attributionTag = mContext.getAttributionTag();
- return mService.startScan(packageName, attributionTag);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * WPS has been deprecated from Client mode operation.
- *
- * @return null
- * @hide
- * @deprecated This API is deprecated
- */
- public String getCurrentNetworkWpsNfcConfigurationToken() {
- return null;
- }
-
- /**
- * Return dynamic information about the current Wi-Fi connection, if any is active.
- * <p>
- * In the connected state, access to the SSID and BSSID requires
- * the same permissions as {@link #getScanResults}. If such access is not allowed,
- * {@link WifiInfo#getSSID} will return {@link #UNKNOWN_SSID} and
- * {@link WifiInfo#getBSSID} will return {@code "02:00:00:00:00:00"}.
- * {@link WifiInfo#getPasspointFqdn()} will return null.
- * {@link WifiInfo#getPasspointProviderFriendlyName()} will return null.
- *
- * @return the Wi-Fi information, contained in {@link WifiInfo}.
- */
- public WifiInfo getConnectionInfo() {
- try {
- return mService.getConnectionInfo(mContext.getOpPackageName(),
- mContext.getAttributionTag());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Return the results of the latest access point scan.
- * @return the list of access points found in the most recent scan. An app must hold
- * {@link android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION} permission
- * in order to get valid results.
- */
- public List<ScanResult> getScanResults() {
- try {
- return mService.getScanResults(mContext.getOpPackageName(),
- mContext.getAttributionTag());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Get the filtered ScanResults which match the network configurations specified by the
- * {@code networkSuggestionsToMatch}. Suggestions which use {@link WifiConfiguration} use
- * SSID and the security type to match. Suggestions which use {@link PasspointConfigration}
- * use the matching rules of Hotspot 2.0.
- * @param networkSuggestionsToMatch The list of {@link WifiNetworkSuggestion} to match against.
- * These may or may not be suggestions which are installed on the device.
- * @param scanResults The scan results to be filtered. Optional - if not provided(empty list),
- * the Wi-Fi service will use the most recent scan results which the system has.
- * @return The map of {@link WifiNetworkSuggestion} to the list of {@link ScanResult}
- * corresponding to networks which match them.
- * @hide
- */
- @SystemApi
- @RequiresPermission(allOf = {ACCESS_FINE_LOCATION, ACCESS_WIFI_STATE})
- @NonNull
- public Map<WifiNetworkSuggestion, List<ScanResult>> getMatchingScanResults(
- @NonNull List<WifiNetworkSuggestion> networkSuggestionsToMatch,
- @Nullable List<ScanResult> scanResults) {
- if (networkSuggestionsToMatch == null) {
- throw new IllegalArgumentException("networkSuggestions must not be null.");
- }
- try {
- return mService.getMatchingScanResults(
- networkSuggestionsToMatch, scanResults,
- mContext.getOpPackageName(), mContext.getAttributionTag());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Set if scanning is always available.
- *
- * If set to {@code true}, apps can issue {@link #startScan} and fetch scan results
- * even when Wi-Fi is turned off.
- *
- * @param isAvailable true to enable, false to disable.
- * @hide
- * @see #isScanAlwaysAvailable()
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void setScanAlwaysAvailable(boolean isAvailable) {
- try {
- mService.setScanAlwaysAvailable(isAvailable, mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Check if scanning is always available.
- *
- * If this return {@code true}, apps can issue {@link #startScan} and fetch scan results
- * even when Wi-Fi is turned off.
- *
- * To change this setting, see {@link #ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE}.
- * @deprecated The ability for apps to trigger scan requests will be removed in a future
- * release.
- */
- @Deprecated
- public boolean isScanAlwaysAvailable() {
- try {
- return mService.isScanAlwaysAvailable();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Tell the device to persist the current list of configured networks.
- * <p>
- * Note: It is possible for this method to change the network IDs of
- * existing networks. You should assume the network IDs can be different
- * after calling this method.
- *
- * @return {@code false}.
- * @deprecated There is no need to call this method -
- * {@link #addNetwork(WifiConfiguration)}, {@link #updateNetwork(WifiConfiguration)}
- * and {@link #removeNetwork(int)} already persist the configurations automatically.
- */
- @Deprecated
- public boolean saveConfiguration() {
- return false;
- }
-
- /**
- * Get the country code.
- * @return the country code in ISO 3166 alpha-2 (2-letter) uppercase format, or null if
- * there is no country code configured.
- * @hide
- */
- @Nullable
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public String getCountryCode() {
- try {
- return mService.getCountryCode();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Return the DHCP-assigned addresses from the last successful DHCP request,
- * if any.
- * @return the DHCP information
- */
- public DhcpInfo getDhcpInfo() {
- try {
- return mService.getDhcpInfo();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Enable or disable Wi-Fi.
- * <p>
- * Applications must have the {@link android.Manifest.permission#CHANGE_WIFI_STATE}
- * permission to toggle wifi.
- *
- * @param enabled {@code true} to enable, {@code false} to disable.
- * @return {@code false} if the request cannot be satisfied; {@code true} indicates that wifi is
- * either already in the requested state, or in progress toward the requested state.
- * @throws {@link java.lang.SecurityException} if the caller is missing required permissions.
- *
- * @deprecated Starting with Build.VERSION_CODES#Q, applications are not allowed to
- * enable/disable Wi-Fi.
- * <b>Compatibility Note:</b> For applications targeting
- * {@link android.os.Build.VERSION_CODES#Q} or above, this API will always fail and return
- * {@code false}. If apps are targeting an older SDK ({@link android.os.Build.VERSION_CODES#P}
- * or below), they can continue to use this API.
- * <p>
- * Deprecation Exemptions:
- * <ul>
- * <li>Device Owner (DO), Profile Owner (PO) and system apps.
- * </ul>
- */
- @Deprecated
- public boolean setWifiEnabled(boolean enabled) {
- try {
- return mService.setWifiEnabled(mContext.getOpPackageName(), enabled);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * 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},
- * {@link #WIFI_STATE_ENABLING}, {@link #WIFI_STATE_UNKNOWN}
- * @see #isWifiEnabled()
- */
- public int getWifiState() {
- try {
- return mService.getWifiEnabledState();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Return whether Wi-Fi is enabled or disabled.
- * @return {@code true} if Wi-Fi is enabled
- * @see #getWifiState()
- */
- public boolean isWifiEnabled() {
- return getWifiState() == WIFI_STATE_ENABLED;
- }
-
- /**
- * Calculates the level of the signal. This should be used any time a signal
- * is being shown.
- *
- * @param rssi The power of the signal measured in RSSI.
- * @param numLevels The number of levels to consider in the calculated level.
- * @return A level of the signal, given in the range of 0 to numLevels-1 (both inclusive).
- * @deprecated Callers should use {@link #calculateSignalLevel(int)} instead to get the
- * signal level using the system default RSSI thresholds, or otherwise compute the RSSI level
- * themselves using their own formula.
- */
- @Deprecated
- public static int calculateSignalLevel(int rssi, int numLevels) {
- if (rssi <= MIN_RSSI) {
- return 0;
- } else if (rssi >= MAX_RSSI) {
- return numLevels - 1;
- } else {
- float inputRange = (MAX_RSSI - MIN_RSSI);
- float outputRange = (numLevels - 1);
- return (int)((float)(rssi - MIN_RSSI) * outputRange / inputRange);
- }
- }
-
- /**
- * Given a raw RSSI, return the RSSI signal quality rating using the system default RSSI
- * quality rating thresholds.
- * @param rssi a raw RSSI value, in dBm, usually between -55 and -90
- * @return the RSSI signal quality rating, in the range
- * [0, {@link #getMaxSignalLevel()}], where 0 is the lowest (worst signal) RSSI
- * rating and {@link #getMaxSignalLevel()} is the highest (best signal) RSSI rating.
- */
- @IntRange(from = 0)
- public int calculateSignalLevel(int rssi) {
- try {
- return mService.calculateSignalLevel(rssi);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Get the system default maximum signal level.
- * This is the maximum RSSI level returned by {@link #calculateSignalLevel(int)}.
- */
- @IntRange(from = 0)
- public int getMaxSignalLevel() {
- return calculateSignalLevel(Integer.MAX_VALUE);
- }
-
- /**
- * Compares two signal strengths.
- *
- * @param rssiA The power of the first signal measured in RSSI.
- * @param rssiB The power of the second signal measured in RSSI.
- * @return Returns <0 if the first signal is weaker than the second signal,
- * 0 if the two signals have the same strength, and >0 if the first
- * signal is stronger than the second signal.
- */
- public static int compareSignalLevel(int rssiA, int rssiB) {
- return rssiA - rssiB;
- }
-
- /**
- * Call allowing ConnectivityService to update WifiService with interface mode changes.
- *
- * @param ifaceName String name of the updated interface, or null to represent all interfaces
- * @param mode int representing the new mode, one of:
- * {@link #IFACE_IP_MODE_TETHERED},
- * {@link #IFACE_IP_MODE_LOCAL_ONLY},
- * {@link #IFACE_IP_MODE_CONFIGURATION_ERROR},
- * {@link #IFACE_IP_MODE_UNSPECIFIED}
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_STACK,
- NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK
- })
- public void updateInterfaceIpState(@Nullable String ifaceName, @IfaceIpMode int mode) {
- try {
- mService.updateInterfaceIpState(ifaceName, mode);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /* Wi-Fi/Cellular Coex */
-
- /**
- * Mandatory coex restriction flag for Wi-Fi Direct.
- *
- * @see #setCoexUnsafeChannels(Set, int)
- *
- * @hide
- */
- @SystemApi
- public static final int COEX_RESTRICTION_WIFI_DIRECT = 0x1 << 0;
-
- /**
- * Mandatory coex restriction flag for SoftAP
- *
- * @see #setCoexUnsafeChannels(Set, int)
- *
- * @hide
- */
- @SystemApi
- public static final int COEX_RESTRICTION_SOFTAP = 0x1 << 1;
-
- /**
- * Mandatory coex restriction flag for Wi-Fi Aware.
- *
- * @see #setCoexUnsafeChannels(Set, int)
- *
- * @hide
- */
- @SystemApi
- public static final int COEX_RESTRICTION_WIFI_AWARE = 0x1 << 2;
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(flag = true, prefix = {"COEX_RESTRICTION_"}, value = {
- COEX_RESTRICTION_WIFI_DIRECT,
- COEX_RESTRICTION_SOFTAP,
- COEX_RESTRICTION_WIFI_AWARE
- })
- public @interface CoexRestriction {}
-
- /**
- * @return {@code true} if the default coex algorithm is enabled. {@code false} otherwise.
- *
- * @hide
- */
- public boolean isDefaultCoexAlgorithmEnabled() {
- try {
- return mService.isDefaultCoexAlgorithmEnabled();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Specify the set of {@link CoexUnsafeChannel} to propagate through the framework for
- * Wi-Fi/Cellular coex channel avoidance if the default algorithm is disabled via overlay
- * (i.e. config_wifiCoexDefaultAlgorithmEnabled = false). Otherwise do nothing.
- *
- * @param unsafeChannels Set of {@link CoexUnsafeChannel} to avoid.
- * @param restrictions Bitmap of {@link CoexRestriction} specifying the mandatory restricted
- * uses of the specified channels. If any restrictions are set, then the
- * supplied CoexUnsafeChannels will be completely avoided for the
- * specified modes, rather than be avoided with best effort.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_COEX_UNSAFE_CHANNELS)
- public void setCoexUnsafeChannels(@NonNull Set<CoexUnsafeChannel> unsafeChannels,
- int restrictions) {
- if (unsafeChannels == null) {
- throw new IllegalArgumentException("unsafeChannels must not be null");
- }
- try {
- mService.setCoexUnsafeChannels(new ArrayList<>(unsafeChannels), restrictions);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Returns the set of current {@link CoexUnsafeChannel} being used for Wi-Fi/Cellular coex
- * channel avoidance.
- *
- * This returns the set calculated by the default algorithm if
- * config_wifiCoexDefaultAlgorithmEnabled is {@code true}. Otherwise, returns the set supplied
- * in {@link #setCoexUnsafeChannels(Set, int)}.
- *
- * If any {@link CoexRestriction} flags are set in {@link #getCoexRestrictions()}, then the
- * CoexUnsafeChannels should be totally avoided (i.e. not best effort) for the Wi-Fi modes
- * specified by the flags.
- *
- * @return Set of current CoexUnsafeChannels.
- *
- * @hide
- */
- @NonNull
- @SystemApi
- @RequiresPermission(android.Manifest.permission.WIFI_ACCESS_COEX_UNSAFE_CHANNELS)
- public Set<CoexUnsafeChannel> getCoexUnsafeChannels() {
- try {
- return new HashSet<>(mService.getCoexUnsafeChannels());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Returns the current coex restrictions being used for Wi-Fi/Cellular coex
- * channel avoidance.
- *
- * This returns the restrictions calculated by the default algorithm if
- * config_wifiCoexDefaultAlgorithmEnabled is {@code true}. Otherwise, returns the value supplied
- * in {@link #setCoexUnsafeChannels(Set, int)}.
- *
- * @return int containing a bitwise-OR combination of {@link CoexRestriction}.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.WIFI_ACCESS_COEX_UNSAFE_CHANNELS)
- public int getCoexRestrictions() {
- try {
- return mService.getCoexRestrictions();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Registers a CoexCallback to listen on the current CoexUnsafeChannels and restrictions being
- * used for Wi-Fi/cellular coex channel avoidance.
- * @param executor Executor to execute listener callback on
- * @param callback CoexCallback to register
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.WIFI_ACCESS_COEX_UNSAFE_CHANNELS)
- public void registerCoexCallback(
- @NonNull @CallbackExecutor Executor executor, @NonNull CoexCallback callback) {
- if (executor == null) throw new IllegalArgumentException("executor must not be null");
- if (callback == null) throw new IllegalArgumentException("callback must not be null");
- CoexCallback.CoexCallbackProxy proxy = callback.getProxy();
- proxy.initProxy(executor, callback);
- try {
- mService.registerCoexCallback(proxy);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Unregisters a CoexCallback from listening on the current CoexUnsafeChannels and restrictions
- * being used for Wi-Fi/cellular coex channel avoidance.
- * @param callback CoexCallback to unregister
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.WIFI_ACCESS_COEX_UNSAFE_CHANNELS)
- public void unregisterCoexCallback(@NonNull CoexCallback callback) {
- if (callback == null) throw new IllegalArgumentException("callback must not be null");
- CoexCallback.CoexCallbackProxy proxy = callback.getProxy();
- try {
- mService.unregisterCoexCallback(proxy);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- } finally {
- proxy.cleanUpProxy();
- }
- }
-
- /**
- * Abstract callback class for applications to receive updates about current CoexUnsafeChannels
- * for Wi-Fi/Cellular coex channel avoidance.
- *
- * @hide
- */
- @SystemApi
- public abstract static class CoexCallback {
- private final CoexCallbackProxy mCoexCallbackProxy;
-
- public CoexCallback() {
- mCoexCallbackProxy = new CoexCallbackProxy();
- }
-
- /*package*/ @NonNull
- CoexCallbackProxy getProxy() {
- return mCoexCallbackProxy;
- }
-
- /**
- * Indicates that the current CoexUnsafeChannels or restrictions have changed.
- * Clients should call {@link #getCoexUnsafeChannels()} and {@link #getCoexRestrictions()}
- * to get the updated values.
- */
- public abstract void onCoexUnsafeChannelsChanged();
-
- /**
- * Callback proxy for CoexCallback objects.
- */
- private static class CoexCallbackProxy extends ICoexCallback.Stub {
- private final Object mLock = new Object();
- @Nullable @GuardedBy("mLock") private Executor mExecutor;
- @Nullable @GuardedBy("mLock") private CoexCallback mCallback;
-
- CoexCallbackProxy() {
- mExecutor = null;
- mCallback = null;
- }
-
- /*package*/ void initProxy(@NonNull Executor executor,
- @NonNull CoexCallback callback) {
- synchronized (mLock) {
- mExecutor = executor;
- mCallback = callback;
- }
- }
-
- /*package*/ void cleanUpProxy() {
- synchronized (mLock) {
- mExecutor = null;
- mCallback = null;
- }
- }
-
- @Override
- public void onCoexUnsafeChannelsChanged() {
- Executor executor;
- CoexCallback callback;
- synchronized (mLock) {
- executor = mExecutor;
- callback = mCallback;
- }
- if (executor == null || callback == null) {
- return;
- }
- Binder.clearCallingIdentity();
- executor.execute(callback::onCoexUnsafeChannelsChanged);
- }
- }
- }
-
- /**
- * Start Soft AP (hotspot) mode for tethering purposes with the specified configuration.
- * Note that starting Soft AP mode may disable station mode operation if the device does not
- * support concurrency.
- * @param wifiConfig SSID, security and channel details as part of WifiConfiguration, or null to
- * use the persisted Soft AP configuration that was previously set using
- * {@link #setWifiApConfiguration(WifiConfiguration)}.
- * @return {@code true} if the operation succeeded, {@code false} otherwise
- *
- * @hide
- */
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_STACK,
- NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK
- })
- public boolean startSoftAp(@Nullable WifiConfiguration wifiConfig) {
- try {
- return mService.startSoftAp(wifiConfig, mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Start Soft AP (hotspot) mode for tethering purposes with the specified configuration.
- * Note that starting Soft AP mode may disable station mode operation if the device does not
- * support concurrency.
- * @param softApConfig A valid SoftApConfiguration specifying the configuration of the SAP,
- * or null to use the persisted Soft AP configuration that was previously
- * set using {@link #setSoftApConfiguration(softApConfiguration)}.
- * @return {@code true} if the operation succeeded, {@code false} otherwise
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_STACK,
- NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK
- })
- public boolean startTetheredHotspot(@Nullable SoftApConfiguration softApConfig) {
- try {
- return mService.startTetheredHotspot(softApConfig, mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
-
- /**
- * Stop SoftAp mode.
- * Note that stopping softap mode will restore the previous wifi mode.
- * @return {@code true} if the operation succeeds, {@code false} otherwise
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_STACK,
- NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK
- })
- public boolean stopSoftAp() {
- try {
- return mService.stopSoftAp();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Request a local only hotspot that an application can use to communicate between co-located
- * devices connected to the created WiFi hotspot. The network created by this method will not
- * have Internet access. Each application can make a single request for the hotspot, but
- * multiple applications could be requesting the hotspot at the same time. When multiple
- * applications have successfully registered concurrently, they will be sharing the underlying
- * hotspot. {@link LocalOnlyHotspotCallback#onStarted(LocalOnlyHotspotReservation)} is called
- * when the hotspot is ready for use by the application.
- * <p>
- * Each application can make a single active call to this method. The {@link
- * LocalOnlyHotspotCallback#onStarted(LocalOnlyHotspotReservation)} callback supplies the
- * requestor with a {@link LocalOnlyHotspotReservation} that contains a
- * {@link SoftApConfiguration} with the SSID, security type and credentials needed to connect
- * to the hotspot. Communicating this information is up to the application.
- * <p>
- * If the LocalOnlyHotspot cannot be created, the {@link LocalOnlyHotspotCallback#onFailed(int)}
- * method will be called. Example failures include errors bringing up the network or if
- * there is an incompatible operating mode. For example, if the user is currently using Wifi
- * Tethering to provide an upstream to another device, LocalOnlyHotspot will not start due to
- * an incompatible mode. The possible error codes include:
- * {@link LocalOnlyHotspotCallback#ERROR_NO_CHANNEL},
- * {@link LocalOnlyHotspotCallback#ERROR_GENERIC},
- * {@link LocalOnlyHotspotCallback#ERROR_INCOMPATIBLE_MODE} and
- * {@link LocalOnlyHotspotCallback#ERROR_TETHERING_DISALLOWED}.
- * <p>
- * Internally, requests will be tracked to prevent the hotspot from being torn down while apps
- * are still using it. The {@link LocalOnlyHotspotReservation} object passed in the {@link
- * LocalOnlyHotspotCallback#onStarted(LocalOnlyHotspotReservation)} call should be closed when
- * the LocalOnlyHotspot is no longer needed using {@link LocalOnlyHotspotReservation#close()}.
- * Since the hotspot may be shared among multiple applications, removing the final registered
- * application request will trigger the hotspot teardown. This means that applications should
- * not listen to broadcasts containing wifi state to determine if the hotspot was stopped after
- * they are done using it. Additionally, once {@link LocalOnlyHotspotReservation#close()} is
- * called, applications will not receive callbacks of any kind.
- * <p>
- * Applications should be aware that the user may also stop the LocalOnlyHotspot through the
- * Settings UI; it is not guaranteed to stay up as long as there is a requesting application.
- * The requestors will be notified of this case via
- * {@link LocalOnlyHotspotCallback#onStopped()}. Other cases may arise where the hotspot is
- * torn down (Emergency mode, etc). Application developers should be aware that it can stop
- * unexpectedly, but they will receive a notification if they have properly registered.
- * <p>
- * Applications should also be aware that this network will be shared with other applications.
- * Applications are responsible for protecting their data on this network (e.g., TLS).
- * <p>
- * Applications need to have the following permissions to start LocalOnlyHotspot: {@link
- * android.Manifest.permission#CHANGE_WIFI_STATE} and {@link
- * android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION}. Callers without
- * the permissions will trigger a {@link java.lang.SecurityException}.
- * <p>
- * @param callback LocalOnlyHotspotCallback for the application to receive updates about
- * operating status.
- * @param handler Handler to be used for callbacks. If the caller passes a null Handler, the
- * main thread will be used.
- */
- @RequiresPermission(allOf = {
- android.Manifest.permission.CHANGE_WIFI_STATE,
- android.Manifest.permission.ACCESS_FINE_LOCATION})
- public void startLocalOnlyHotspot(LocalOnlyHotspotCallback callback,
- @Nullable Handler handler) {
- Executor executor = handler == null ? null : new HandlerExecutor(handler);
- startLocalOnlyHotspotInternal(null, executor, callback);
- }
-
- /**
- * Starts a local-only hotspot with a specific configuration applied. See
- * {@link #startLocalOnlyHotspot(LocalOnlyHotspotCallback, Handler)}.
- *
- * Applications need either {@link android.Manifest.permission#NETWORK_SETUP_WIZARD} or
- * {@link android.Manifest.permission#NETWORK_SETTINGS} to call this method.
- *
- * Since custom configuration settings may be incompatible with each other, the hotspot started
- * through this method cannot coexist with another hotspot created through
- * startLocalOnlyHotspot. If this is attempted, the first hotspot request wins and others
- * receive {@link LocalOnlyHotspotCallback#ERROR_GENERIC} through
- * {@link LocalOnlyHotspotCallback#onFailed}.
- *
- * @param config Custom configuration for the hotspot. See {@link SoftApConfiguration}.
- * @param executor Executor to run callback methods on, or null to use the main thread.
- * @param callback Callback object for updates about hotspot status, or null for no updates.
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD})
- public void startLocalOnlyHotspot(@NonNull SoftApConfiguration config,
- @Nullable Executor executor,
- @Nullable LocalOnlyHotspotCallback callback) {
- Objects.requireNonNull(config);
- startLocalOnlyHotspotInternal(config, executor, callback);
- }
-
- /**
- * Common implementation of both configurable and non-configurable LOHS.
- *
- * @param config App-specified configuration, or null. When present, additional privileges are
- * required, and the hotspot cannot be shared with other clients.
- * @param executor Executor to run callback methods on, or null to use the main thread.
- * @param callback Callback object for updates about hotspot status, or null for no updates.
- */
- private void startLocalOnlyHotspotInternal(
- @Nullable SoftApConfiguration config,
- @Nullable Executor executor,
- @Nullable LocalOnlyHotspotCallback callback) {
- if (executor == null) {
- executor = mContext.getMainExecutor();
- }
- synchronized (mLock) {
- LocalOnlyHotspotCallbackProxy proxy =
- new LocalOnlyHotspotCallbackProxy(this, executor, callback);
- try {
- String packageName = mContext.getOpPackageName();
- String featureId = mContext.getAttributionTag();
- int returnCode = mService.startLocalOnlyHotspot(proxy, packageName, featureId,
- config);
- if (returnCode != LocalOnlyHotspotCallback.REQUEST_REGISTERED) {
- // Send message to the proxy to make sure we call back on the correct thread
- proxy.onHotspotFailed(returnCode);
- return;
- }
- mLOHSCallbackProxy = proxy;
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
- }
-
- /**
- * Cancels a pending local only hotspot request. This can be used by the calling application to
- * cancel the existing request if the provided callback has not been triggered. Calling this
- * method will be equivalent to closing the returned LocalOnlyHotspotReservation, but it is not
- * explicitly required.
- * <p>
- * When cancelling this request, application developers should be aware that there may still be
- * outstanding local only hotspot requests and the hotspot may still start, or continue running.
- * Additionally, if a callback was registered, it will no longer be triggered after calling
- * cancel.
- *
- * @hide
- */
- @UnsupportedAppUsage
- public void cancelLocalOnlyHotspotRequest() {
- synchronized (mLock) {
- stopLocalOnlyHotspot();
- }
- }
-
- /**
- * Method used to inform WifiService that the LocalOnlyHotspot is no longer needed. This
- * method is used by WifiManager to release LocalOnlyHotspotReservations held by calling
- * applications and removes the internal tracking for the hotspot request. When all requesting
- * applications are finished using the hotspot, it will be stopped and WiFi will return to the
- * previous operational mode.
- *
- * This method should not be called by applications. Instead, they should call the close()
- * method on their LocalOnlyHotspotReservation.
- */
- private void stopLocalOnlyHotspot() {
- synchronized (mLock) {
- if (mLOHSCallbackProxy == null) {
- // nothing to do, the callback was already cleaned up.
- return;
- }
- mLOHSCallbackProxy = null;
- try {
- mService.stopLocalOnlyHotspot();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
- }
-
- /**
- * Allow callers (Settings UI) to watch LocalOnlyHotspot state changes. Callers will
- * receive a {@link LocalOnlyHotspotSubscription} object as a parameter of the
- * {@link LocalOnlyHotspotObserver#onRegistered(LocalOnlyHotspotSubscription)}. The registered
- * callers will receive the {@link LocalOnlyHotspotObserver#onStarted(SoftApConfiguration)} and
- * {@link LocalOnlyHotspotObserver#onStopped()} callbacks.
- * <p>
- * Applications should have the
- * {@link android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION}
- * permission. Callers without the permission will trigger a
- * {@link java.lang.SecurityException}.
- * <p>
- * @param observer LocalOnlyHotspotObserver callback.
- * @param handler Handler to use for callbacks
- *
- * @hide
- */
- public void watchLocalOnlyHotspot(LocalOnlyHotspotObserver observer,
- @Nullable Handler handler) {
- Executor executor = handler == null ? mContext.getMainExecutor()
- : new HandlerExecutor(handler);
- synchronized (mLock) {
- mLOHSObserverProxy =
- new LocalOnlyHotspotObserverProxy(this, executor, observer);
- try {
- mService.startWatchLocalOnlyHotspot(mLOHSObserverProxy);
- mLOHSObserverProxy.registered();
- } catch (RemoteException e) {
- mLOHSObserverProxy = null;
- throw e.rethrowFromSystemServer();
- }
- }
- }
-
- /**
- * Allow callers to stop watching LocalOnlyHotspot state changes. After calling this method,
- * applications will no longer receive callbacks.
- *
- * @hide
- */
- public void unregisterLocalOnlyHotspotObserver() {
- synchronized (mLock) {
- if (mLOHSObserverProxy == null) {
- // nothing to do, the callback was already cleaned up
- return;
- }
- mLOHSObserverProxy = null;
- try {
- mService.stopWatchLocalOnlyHotspot();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
- }
-
- /**
- * Gets the tethered Wi-Fi hotspot enabled state.
- * @return One of {@link #WIFI_AP_STATE_DISABLED},
- * {@link #WIFI_AP_STATE_DISABLING}, {@link #WIFI_AP_STATE_ENABLED},
- * {@link #WIFI_AP_STATE_ENABLING}, {@link #WIFI_AP_STATE_FAILED}
- * @see #isWifiApEnabled()
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE)
- public int getWifiApState() {
- try {
- return mService.getWifiApEnabledState();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Return whether tethered Wi-Fi AP is enabled or disabled.
- * @return {@code true} if tethered Wi-Fi AP is enabled
- * @see #getWifiApState()
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE)
- public boolean isWifiApEnabled() {
- return getWifiApState() == WIFI_AP_STATE_ENABLED;
- }
-
- /**
- * Gets the tethered Wi-Fi AP Configuration.
- * @return AP details in WifiConfiguration
- *
- * Note that AP detail may contain configuration which is cannot be represented
- * by the legacy WifiConfiguration, in such cases a null will be returned.
- *
- * @deprecated This API is deprecated. Use {@link #getSoftApConfiguration()} instead.
- * @hide
- */
- @Nullable
- @SystemApi
- @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE)
- @Deprecated
- public WifiConfiguration getWifiApConfiguration() {
- try {
- return mService.getWifiApConfiguration();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Gets the Wi-Fi tethered AP Configuration.
- * @return AP details in {@link SoftApConfiguration}
- *
- * @hide
- */
- @NonNull
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.OVERRIDE_WIFI_CONFIG
- })
- public SoftApConfiguration getSoftApConfiguration() {
- try {
- return mService.getSoftApConfiguration();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Sets the tethered Wi-Fi AP Configuration.
- * @return {@code true} if the operation succeeded, {@code false} otherwise
- *
- * @deprecated This API is deprecated. Use {@link #setSoftApConfiguration(SoftApConfiguration)}
- * instead.
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.CHANGE_WIFI_STATE)
- @Deprecated
- public boolean setWifiApConfiguration(WifiConfiguration wifiConfig) {
- try {
- return mService.setWifiApConfiguration(wifiConfig, mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Sets the tethered Wi-Fi AP Configuration.
- *
- * If the API is called while the tethered soft AP is enabled, the configuration will apply to
- * the current soft AP if the new configuration only includes
- * {@link SoftApConfiguration.Builder#setMaxNumberOfClients(int)}
- * or {@link SoftApConfiguration.Builder#setShutdownTimeoutMillis(long)}
- * or {@link SoftApConfiguration.Builder#setClientControlByUserEnabled(boolean)}
- * or {@link SoftApConfiguration.Builder#setBlockedClientList(List)}
- * or {@link SoftApConfiguration.Builder#setAllowedClientList(List)}
- *
- * Otherwise, the configuration changes will be applied when the Soft AP is next started
- * (the framework will not stop/start the AP).
- *
- * @param softApConfig A valid SoftApConfiguration specifying the configuration of the SAP.
- * @return {@code true} if the operation succeeded, {@code false} otherwise
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.OVERRIDE_WIFI_CONFIG
- })
- public boolean setSoftApConfiguration(@NonNull SoftApConfiguration softApConfig) {
- try {
- return mService.setSoftApConfiguration(
- softApConfig, mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Enable/Disable TDLS on a specific local route.
- *
- * <p>
- * TDLS enables two wireless endpoints to talk to each other directly
- * without going through the access point that is managing the local
- * network. It saves bandwidth and improves quality of the link.
- * </p>
- * <p>
- * This API enables/disables the option of using TDLS. If enabled, the
- * underlying hardware is free to use TDLS or a hop through the access
- * point. If disabled, existing TDLS session is torn down and
- * hardware is restricted to use access point for transferring wireless
- * packets. Default value for all routes is 'disabled', meaning restricted
- * to use access point for transferring packets.
- * </p>
- *
- * @param remoteIPAddress IP address of the endpoint to setup TDLS with
- * @param enable true = setup and false = tear down TDLS
- */
- public void setTdlsEnabled(InetAddress remoteIPAddress, boolean enable) {
- try {
- mService.enableTdls(remoteIPAddress.getHostAddress(), enable);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Similar to {@link #setTdlsEnabled(InetAddress, boolean) }, except
- * this version allows you to specify remote endpoint with a MAC address.
- * @param remoteMacAddress MAC address of the remote endpoint such as 00:00:0c:9f:f2:ab
- * @param enable true = setup and false = tear down TDLS
- */
- public void setTdlsEnabledWithMacAddress(String remoteMacAddress, boolean enable) {
- try {
- mService.enableTdlsWithMacAddress(remoteMacAddress, enable);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Passed with {@link ActionListener#onFailure}.
- * Indicates that the operation failed due to an internal error.
- * @hide
- */
- public static final int ERROR = 0;
-
- /**
- * Passed with {@link ActionListener#onFailure}.
- * Indicates that the operation is already in progress
- * @hide
- */
- public static final int IN_PROGRESS = 1;
-
- /**
- * Passed with {@link ActionListener#onFailure}.
- * Indicates that the operation failed because the framework is busy and
- * unable to service the request
- * @hide
- */
- public static final int BUSY = 2;
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef({ERROR, IN_PROGRESS, BUSY})
- public @interface ActionListenerFailureReason {}
-
- /* WPS specific errors */
- /** WPS overlap detected
- * @deprecated This is deprecated
- */
- public static final int WPS_OVERLAP_ERROR = 3;
- /** WEP on WPS is prohibited
- * @deprecated This is deprecated
- */
- public static final int WPS_WEP_PROHIBITED = 4;
- /** TKIP only prohibited
- * @deprecated This is deprecated
- */
- public static final int WPS_TKIP_ONLY_PROHIBITED = 5;
- /** Authentication failure on WPS
- * @deprecated This is deprecated
- */
- public static final int WPS_AUTH_FAILURE = 6;
- /** WPS timed out
- * @deprecated This is deprecated
- */
- public static final int WPS_TIMED_OUT = 7;
-
- /**
- * Passed with {@link ActionListener#onFailure}.
- * Indicates that the operation failed due to invalid inputs
- * @hide
- */
- public static final int INVALID_ARGS = 8;
-
- /**
- * Passed with {@link ActionListener#onFailure}.
- * Indicates that the operation failed due to user permissions.
- * @hide
- */
- public static final int NOT_AUTHORIZED = 9;
-
- /**
- * Interface for callback invocation on an application action
- * @hide
- */
- @SystemApi
- public interface ActionListener {
- /**
- * The operation succeeded.
- */
- void onSuccess();
- /**
- * The operation failed.
- * @param reason The reason for failure depends on the operation.
- */
- void onFailure(@ActionListenerFailureReason int reason);
- }
-
- /** Interface for callback invocation on a start WPS action
- * @deprecated This is deprecated
- */
- public static abstract class WpsCallback {
-
- /** WPS start succeeded
- * @deprecated This API is deprecated
- */
- public abstract void onStarted(String pin);
-
- /** WPS operation completed successfully
- * @deprecated This API is deprecated
- */
- public abstract void onSucceeded();
-
- /**
- * WPS operation failed
- * @param reason The reason for failure could be one of
- * {@link #WPS_TKIP_ONLY_PROHIBITED}, {@link #WPS_OVERLAP_ERROR},
- * {@link #WPS_WEP_PROHIBITED}, {@link #WPS_TIMED_OUT} or {@link #WPS_AUTH_FAILURE}
- * and some generic errors.
- * @deprecated This API is deprecated
- */
- public abstract void onFailed(int reason);
- }
-
- /**
- * Base class for soft AP callback. Should be extended by applications and set when calling
- * {@link WifiManager#registerSoftApCallback(Executor, SoftApCallback)}.
- *
- * @hide
- */
- @SystemApi
- public interface SoftApCallback {
- /**
- * Called when soft AP state changes.
- *
- * @param state the new AP state. One of {@link #WIFI_AP_STATE_DISABLED},
- * {@link #WIFI_AP_STATE_DISABLING}, {@link #WIFI_AP_STATE_ENABLED},
- * {@link #WIFI_AP_STATE_ENABLING}, {@link #WIFI_AP_STATE_FAILED}
- * @param failureReason reason when in failed state. One of
- * {@link #SAP_START_FAILURE_GENERAL},
- * {@link #SAP_START_FAILURE_NO_CHANNEL},
- * {@link #SAP_START_FAILURE_UNSUPPORTED_CONFIGURATION}
- */
- default void onStateChanged(@WifiApState int state, @SapStartFailure int failureReason) {}
-
- /**
- * Called when the connected clients to soft AP changes.
- *
- * @param clients the currently connected clients
- */
- default void onConnectedClientsChanged(@NonNull List<WifiClient> clients) {}
-
- /**
- * 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) {
- // Do nothing: can be updated to add SoftApInfo details (e.g. channel) to the UI.
- }
-
- /**
- * 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}
- */
- default void onCapabilityChanged(@NonNull SoftApCapability softApCapability) {
- // Do nothing: can be updated to add SoftApCapability details (e.g. meximum supported
- // client number) to the UI.
- }
-
- /**
- * Called when client trying to connect but device blocked the client with specific reason.
- *
- * Can be used to ask user to update client to allowed list or blocked list
- * when reason is {@link SAP_CLIENT_BLOCK_REASON_CODE_BLOCKED_BY_USER}, or
- * indicate the block due to maximum supported client number limitation when reason is
- * {@link SAP_CLIENT_BLOCK_REASON_CODE_NO_MORE_STAS}.
- *
- * @param client the currently blocked client.
- * @param blockedReason one of blocked reason from {@link SapClientBlockedReason}
- */
- default void onBlockedClientConnecting(@NonNull WifiClient client,
- @SapClientBlockedReason int blockedReason) {
- // Do nothing: can be used to ask user to update client to allowed list or blocked list.
- }
- }
-
- /**
- * Callback proxy for SoftApCallback objects.
- *
- * @hide
- */
- private class SoftApCallbackProxy extends ISoftApCallback.Stub {
- private final Executor mExecutor;
- private final SoftApCallback mCallback;
-
- SoftApCallbackProxy(Executor executor, SoftApCallback callback) {
- mExecutor = executor;
- mCallback = callback;
- }
-
- @Override
- public void onStateChanged(int state, int failureReason) {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "SoftApCallbackProxy: onStateChanged: state=" + state
- + ", failureReason=" + failureReason);
- }
-
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> {
- mCallback.onStateChanged(state, failureReason);
- });
- }
-
- @Override
- public void onConnectedClientsChanged(List<WifiClient> clients) {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "SoftApCallbackProxy: onConnectedClientsChanged: clients="
- + clients.size() + " clients");
- }
-
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> {
- mCallback.onConnectedClientsChanged(clients);
- });
- }
-
- @Override
- public void onInfoChanged(SoftApInfo softApInfo) {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "SoftApCallbackProxy: onInfoChange: softApInfo=" + softApInfo);
- }
-
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> {
- mCallback.onInfoChanged(softApInfo);
- });
- }
-
- @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="
- + capability);
- }
-
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> {
- mCallback.onCapabilityChanged(capability);
- });
- }
-
- @Override
- public void onBlockedClientConnecting(@NonNull WifiClient client, int blockedReason) {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "SoftApCallbackProxy: onBlockedClientConnecting: client=" + client
- + " with reason = " + blockedReason);
- }
-
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> {
- mCallback.onBlockedClientConnecting(client, blockedReason);
- });
- }
- }
-
- /**
- * Registers a callback for Soft AP. See {@link SoftApCallback}. Caller will receive the
- * following callbacks on registration:
- * <ul>
- * <li> {@link SoftApCallback#onStateChanged(int, int)}</li>
- * <li> {@link SoftApCallback#onConnectedClientsChanged(List<WifiClient>)}</li>
- * <li> {@link SoftApCallback#onInfoChanged(SoftApInfo)}</li>
- * <li> {@link SoftApCallback#onCapabilityChanged(SoftApCapability)}</li>
- * </ul>
- * These will be dispatched on registration to provide the caller with the current state
- * (and are not an indication of any current change). Note that receiving an immediate
- * WIFI_AP_STATE_FAILED value for soft AP state indicates that the latest attempt to start
- * soft AP has failed. Caller can unregister a previously registered callback using
- * {@link #unregisterSoftApCallback}
- * <p>
- * Applications should have the
- * {@link android.Manifest.permission#NETWORK_SETTINGS NETWORK_SETTINGS} permission. Callers
- * without the permission will trigger a {@link java.lang.SecurityException}.
- * <p>
- *
- * @param executor The Executor on whose thread to execute the callbacks of the {@code callback}
- * object.
- * @param callback Callback for soft AP events
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void registerSoftApCallback(@NonNull @CallbackExecutor Executor executor,
- @NonNull SoftApCallback callback) {
- if (executor == null) throw new IllegalArgumentException("executor cannot be null");
- if (callback == null) throw new IllegalArgumentException("callback cannot be null");
- Log.v(TAG, "registerSoftApCallback: callback=" + callback + ", executor=" + executor);
-
- Binder binder = new Binder();
- try {
- mService.registerSoftApCallback(
- binder, new SoftApCallbackProxy(executor, callback), callback.hashCode());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Allow callers to unregister a previously registered callback. After calling this method,
- * applications will no longer receive soft AP events.
- *
- * @param callback Callback to unregister for soft AP events
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void unregisterSoftApCallback(@NonNull SoftApCallback callback) {
- if (callback == null) throw new IllegalArgumentException("callback cannot be null");
- Log.v(TAG, "unregisterSoftApCallback: callback=" + callback);
-
- try {
- mService.unregisterSoftApCallback(callback.hashCode());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * LocalOnlyHotspotReservation that contains the {@link SoftApConfiguration} for the active
- * LocalOnlyHotspot request.
- * <p>
- * Applications requesting LocalOnlyHotspot for sharing will receive an instance of the
- * LocalOnlyHotspotReservation in the
- * {@link LocalOnlyHotspotCallback#onStarted(LocalOnlyHotspotReservation)} call. This
- * reservation contains the relevant {@link SoftApConfiguration}.
- * When an application is done with the LocalOnlyHotspot, they should call {@link
- * LocalOnlyHotspotReservation#close()}. Once this happens, the application will not receive
- * any further callbacks. If the LocalOnlyHotspot is stopped due to a
- * user triggered mode change, applications will be notified via the {@link
- * LocalOnlyHotspotCallback#onStopped()} callback.
- */
- public class LocalOnlyHotspotReservation implements AutoCloseable {
-
- private final CloseGuard mCloseGuard = new CloseGuard();
- private final SoftApConfiguration mSoftApConfig;
- private final WifiConfiguration mWifiConfig;
- private boolean mClosed = false;
-
- /** @hide */
- @VisibleForTesting
- public LocalOnlyHotspotReservation(SoftApConfiguration config) {
- mSoftApConfig = config;
- mWifiConfig = config.toWifiConfiguration();
- mCloseGuard.open("close");
- }
-
- /**
- * Returns the {@link WifiConfiguration} of the current Local Only Hotspot (LOHS).
- * May be null if hotspot enabled and security type is not
- * {@code WifiConfiguration.KeyMgmt.None} or {@code WifiConfiguration.KeyMgmt.WPA2_PSK}.
- *
- * @deprecated Use {@code WifiManager#getSoftApConfiguration()} to get the
- * LOHS configuration.
- */
- @Deprecated
- @Nullable
- public WifiConfiguration getWifiConfiguration() {
- return mWifiConfig;
- }
-
- /**
- * Returns the {@link SoftApConfiguration} of the current Local Only Hotspot (LOHS).
- */
- @NonNull
- public SoftApConfiguration getSoftApConfiguration() {
- return mSoftApConfig;
- }
-
- @Override
- public void close() {
- try {
- synchronized (mLock) {
- if (!mClosed) {
- mClosed = true;
- stopLocalOnlyHotspot();
- mCloseGuard.close();
- }
- }
- } catch (Exception e) {
- Log.e(TAG, "Failed to stop Local Only Hotspot.");
- } finally {
- Reference.reachabilityFence(this);
- }
- }
-
- @Override
- protected void finalize() throws Throwable {
- try {
- if (mCloseGuard != null) {
- mCloseGuard.warnIfOpen();
- }
- close();
- } finally {
- super.finalize();
- }
- }
- }
-
- /**
- * Callback class for applications to receive updates about the LocalOnlyHotspot status.
- */
- public static class LocalOnlyHotspotCallback {
- /** @hide */
- public static final int REQUEST_REGISTERED = 0;
-
- public static final int ERROR_NO_CHANNEL = 1;
- public static final int ERROR_GENERIC = 2;
- public static final int ERROR_INCOMPATIBLE_MODE = 3;
- public static final int ERROR_TETHERING_DISALLOWED = 4;
-
- /** LocalOnlyHotspot start succeeded. */
- public void onStarted(LocalOnlyHotspotReservation reservation) {};
-
- /**
- * LocalOnlyHotspot stopped.
- * <p>
- * The LocalOnlyHotspot can be disabled at any time by the user. When this happens,
- * applications will be notified that it was stopped. This will not be invoked when an
- * application calls {@link LocalOnlyHotspotReservation#close()}.
- */
- public void onStopped() {};
-
- /**
- * LocalOnlyHotspot failed to start.
- * <p>
- * Applications can attempt to call
- * {@link WifiManager#startLocalOnlyHotspot(LocalOnlyHotspotCallback, Handler)} again at
- * a later time.
- * <p>
- * @param reason The reason for failure could be one of: {@link
- * #ERROR_TETHERING_DISALLOWED}, {@link #ERROR_INCOMPATIBLE_MODE},
- * {@link #ERROR_NO_CHANNEL}, or {@link #ERROR_GENERIC}.
- */
- public void onFailed(int reason) { };
- }
-
- /**
- * Callback proxy for LocalOnlyHotspotCallback objects.
- */
- private static class LocalOnlyHotspotCallbackProxy extends ILocalOnlyHotspotCallback.Stub {
- private final WeakReference<WifiManager> mWifiManager;
- private final Executor mExecutor;
- private final LocalOnlyHotspotCallback mCallback;
-
- /**
- * Constructs a {@link LocalOnlyHotspotCallbackProxy} using the specified executor. All
- * callbacks will run using the given executor.
- *
- * @param manager WifiManager
- * @param executor Executor for delivering callbacks.
- * @param callback LocalOnlyHotspotCallback to notify the calling application, or null.
- */
- LocalOnlyHotspotCallbackProxy(
- @NonNull WifiManager manager,
- @NonNull Executor executor,
- @Nullable LocalOnlyHotspotCallback callback) {
- mWifiManager = new WeakReference<>(manager);
- mExecutor = executor;
- mCallback = callback;
- }
-
- @Override
- public void onHotspotStarted(SoftApConfiguration config) {
- WifiManager manager = mWifiManager.get();
- if (manager == null) return;
-
- if (config == null) {
- Log.e(TAG, "LocalOnlyHotspotCallbackProxy: config cannot be null.");
- onHotspotFailed(LocalOnlyHotspotCallback.ERROR_GENERIC);
- return;
- }
- final LocalOnlyHotspotReservation reservation =
- manager.new LocalOnlyHotspotReservation(config);
- if (mCallback == null) return;
- mExecutor.execute(() -> mCallback.onStarted(reservation));
- }
-
- @Override
- public void onHotspotStopped() {
- WifiManager manager = mWifiManager.get();
- if (manager == null) return;
-
- Log.w(TAG, "LocalOnlyHotspotCallbackProxy: hotspot stopped");
- if (mCallback == null) return;
- mExecutor.execute(() -> mCallback.onStopped());
- }
-
- @Override
- public void onHotspotFailed(int reason) {
- WifiManager manager = mWifiManager.get();
- if (manager == null) return;
-
- Log.w(TAG, "LocalOnlyHotspotCallbackProxy: failed to start. reason: "
- + reason);
- if (mCallback == null) return;
- mExecutor.execute(() -> mCallback.onFailed(reason));
- }
- }
-
- /**
- * LocalOnlyHotspotSubscription that is an AutoCloseable object for tracking applications
- * watching for LocalOnlyHotspot changes.
- *
- * @hide
- */
- public class LocalOnlyHotspotSubscription implements AutoCloseable {
- private final CloseGuard mCloseGuard = new CloseGuard();
-
- /** @hide */
- @VisibleForTesting
- public LocalOnlyHotspotSubscription() {
- mCloseGuard.open("close");
- }
-
- @Override
- public void close() {
- try {
- unregisterLocalOnlyHotspotObserver();
- mCloseGuard.close();
- } catch (Exception e) {
- Log.e(TAG, "Failed to unregister LocalOnlyHotspotObserver.");
- } finally {
- Reference.reachabilityFence(this);
- }
- }
-
- @Override
- protected void finalize() throws Throwable {
- try {
- if (mCloseGuard != null) {
- mCloseGuard.warnIfOpen();
- }
- close();
- } finally {
- super.finalize();
- }
- }
- }
-
- /**
- * Class to notify calling applications that watch for changes in LocalOnlyHotspot of updates.
- *
- * @hide
- */
- public static class LocalOnlyHotspotObserver {
- /**
- * Confirm registration for LocalOnlyHotspotChanges by returning a
- * LocalOnlyHotspotSubscription.
- */
- public void onRegistered(LocalOnlyHotspotSubscription subscription) {};
-
- /**
- * LocalOnlyHotspot started with the supplied config.
- */
- public void onStarted(SoftApConfiguration config) {};
-
- /**
- * LocalOnlyHotspot stopped.
- */
- public void onStopped() {};
- }
-
- /**
- * Callback proxy for LocalOnlyHotspotObserver objects.
- */
- private static class LocalOnlyHotspotObserverProxy extends ILocalOnlyHotspotCallback.Stub {
- private final WeakReference<WifiManager> mWifiManager;
- private final Executor mExecutor;
- private final LocalOnlyHotspotObserver mObserver;
-
- /**
- * Constructs a {@link LocalOnlyHotspotObserverProxy} using the specified looper.
- * All callbacks will be delivered on the thread of the specified looper.
- *
- * @param manager WifiManager
- * @param executor Executor for delivering callbacks
- * @param observer LocalOnlyHotspotObserver to notify the calling application.
- */
- LocalOnlyHotspotObserverProxy(WifiManager manager, Executor executor,
- final LocalOnlyHotspotObserver observer) {
- mWifiManager = new WeakReference<>(manager);
- mExecutor = executor;
- mObserver = observer;
- }
-
- public void registered() throws RemoteException {
- WifiManager manager = mWifiManager.get();
- if (manager == null) return;
-
- mExecutor.execute(() ->
- mObserver.onRegistered(manager.new LocalOnlyHotspotSubscription()));
- }
-
- @Override
- public void onHotspotStarted(SoftApConfiguration config) {
- WifiManager manager = mWifiManager.get();
- if (manager == null) return;
-
- if (config == null) {
- Log.e(TAG, "LocalOnlyHotspotObserverProxy: config cannot be null.");
- return;
- }
- mExecutor.execute(() -> mObserver.onStarted(config));
- }
-
- @Override
- public void onHotspotStopped() {
- WifiManager manager = mWifiManager.get();
- if (manager == null) return;
-
- mExecutor.execute(() -> mObserver.onStopped());
- }
-
- @Override
- public void onHotspotFailed(int reason) {
- // do nothing
- }
- }
-
- /**
- * Callback proxy for ActionListener objects.
- */
- private class ActionListenerProxy extends IActionListener.Stub {
- private final String mActionTag;
- private final Handler mHandler;
- private final ActionListener mCallback;
-
- ActionListenerProxy(String actionTag, Looper looper, ActionListener callback) {
- mActionTag = actionTag;
- mHandler = new Handler(looper);
- mCallback = callback;
- }
-
- @Override
- public void onSuccess() {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "ActionListenerProxy:" + mActionTag + ": onSuccess");
- }
- mHandler.post(() -> {
- mCallback.onSuccess();
- });
- }
-
- @Override
- public void onFailure(@ActionListenerFailureReason int reason) {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "ActionListenerProxy:" + mActionTag + ": onFailure=" + reason);
- }
- mHandler.post(() -> {
- mCallback.onFailure(reason);
- });
- }
- }
-
- private void connectInternal(@Nullable WifiConfiguration config, int networkId,
- @Nullable ActionListener listener) {
- ActionListenerProxy listenerProxy = null;
- if (listener != null) {
- listenerProxy = new ActionListenerProxy("connect", mLooper, listener);
- }
- try {
- mService.connect(config, networkId, listenerProxy);
- } catch (RemoteException e) {
- if (listenerProxy != null) listenerProxy.onFailure(ERROR);
- } catch (SecurityException e) {
- if (listenerProxy != null) listenerProxy.onFailure(NOT_AUTHORIZED);
- }
- }
-
- /**
- * Connect to a network with the given configuration. The network also
- * gets added to the list of configured networks for the foreground user.
- *
- * For a new network, this function is used instead of a
- * sequence of addNetwork(), enableNetwork(), and reconnect()
- *
- * @param config the set of variables that describe the configuration,
- * contained in a {@link WifiConfiguration} object.
- * @param listener for callbacks on success or failure. Can be null.
- * @throws IllegalStateException if the WifiManager instance needs to be
- * initialized again
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD,
- android.Manifest.permission.NETWORK_STACK
- })
- public void connect(@NonNull WifiConfiguration config, @Nullable ActionListener listener) {
- if (config == null) throw new IllegalArgumentException("config cannot be null");
- connectInternal(config, WifiConfiguration.INVALID_NETWORK_ID, listener);
- }
-
- /**
- * Connect to a network with the given networkId.
- *
- * This function is used instead of a enableNetwork() and reconnect()
- *
- * <li> This API will cause reconnect if the credentials of the current active
- * connection has been changed.</li>
- * <li> This API will cause reconnect if the current active connection is marked metered.</li>
- *
- * @param networkId the ID of the network as returned by {@link #addNetwork} or {@link
- * getConfiguredNetworks}.
- * @param listener for callbacks on success or failure. Can be null.
- * @throws IllegalStateException if the WifiManager instance needs to be
- * initialized again
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD,
- android.Manifest.permission.NETWORK_STACK
- })
- public void connect(int networkId, @Nullable ActionListener listener) {
- if (networkId < 0) throw new IllegalArgumentException("Network id cannot be negative");
- connectInternal(null, networkId, listener);
- }
-
- /**
- * Temporarily disable autojoin for all currently visible and provisioned (saved, suggested)
- * wifi networks except merged carrier networks from the provided subscription ID.
- *
- * Disabled networks will get automatically re-enabled when they are out of range for a period
- * of time, or after the maximum disable duration specified in the framework.
- *
- * Calling {@link #stopTemporarilyDisablingAllNonCarrierMergedWifi()} will immediately re-enable
- * autojoin on all disabled networks.
- *
- * @param subscriptionId the subscription ID of the carrier whose merged wifi networks won't be
- * disabled {@link android.telephony.SubscriptionInfo#getSubscriptionId()}
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD})
- public void startTemporarilyDisablingAllNonCarrierMergedWifi(int subscriptionId) {
- try {
- mService.startTemporarilyDisablingAllNonCarrierMergedWifi(subscriptionId);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Re-enable autojoin for all non carrier merged wifi networks temporarily disconnected by
- * {@link #startTemporarilyDisablingAllNonCarrierMergedWifi(int)}.
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD})
- public void stopTemporarilyDisablingAllNonCarrierMergedWifi() {
- try {
- mService.stopTemporarilyDisablingAllNonCarrierMergedWifi();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Save the given network to the list of configured networks for the
- * foreground user. If the network already exists, the configuration
- * is updated. Any new network is enabled by default.
- *
- * For a new network, this function is used instead of a
- * sequence of addNetwork() and enableNetwork().
- *
- * For an existing network, it accomplishes the task of updateNetwork()
- *
- * <li> This API will cause reconnect if the credentials of the current active
- * connection has been changed.</li>
- * <li> This API will cause disconnect if the current active connection is marked metered.</li>
- *
- * @param config the set of variables that describe the configuration,
- * contained in a {@link WifiConfiguration} object.
- * @param listener for callbacks on success or failure. Can be null.
- * @throws IllegalStateException if the WifiManager instance needs to be
- * initialized again
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD,
- android.Manifest.permission.NETWORK_STACK
- })
- public void save(@NonNull WifiConfiguration config, @Nullable ActionListener listener) {
- if (config == null) throw new IllegalArgumentException("config cannot be null");
- ActionListenerProxy listenerProxy = null;
- if (listener != null) {
- listenerProxy = new ActionListenerProxy("save", mLooper, listener);
- }
- try {
- mService.save(config, listenerProxy);
- } catch (RemoteException e) {
- if (listenerProxy != null) listenerProxy.onFailure(ERROR);
- } catch (SecurityException e) {
- if (listenerProxy != null) listenerProxy.onFailure(NOT_AUTHORIZED);
- }
- }
-
- /**
- * Delete the network from the list of configured networks for the
- * foreground user.
- *
- * This function is used instead of a sequence of removeNetwork()
- *
- * @param config the set of variables that describe the configuration,
- * contained in a {@link WifiConfiguration} object.
- * @param listener for callbacks on success or failure. Can be null.
- * @throws IllegalStateException if the WifiManager instance needs to be
- * initialized again
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD,
- android.Manifest.permission.NETWORK_STACK
- })
- public void forget(int netId, @Nullable ActionListener listener) {
- if (netId < 0) throw new IllegalArgumentException("Network id cannot be negative");
- ActionListenerProxy listenerProxy = null;
- if (listener != null) {
- listenerProxy = new ActionListenerProxy("forget", mLooper, listener);
- }
- try {
- mService.forget(netId, listenerProxy);
- } catch (RemoteException e) {
- if (listenerProxy != null) listenerProxy.onFailure(ERROR);
- } catch (SecurityException e) {
- if (listenerProxy != null) listenerProxy.onFailure(NOT_AUTHORIZED);
- }
- }
-
- /**
- * Disable network
- *
- * @param netId is the network Id
- * @param listener for callbacks on success or failure. Can be null.
- * @throws IllegalStateException if the WifiManager instance needs to be
- * initialized again
- * @deprecated This API is deprecated. Use {@link #disableNetwork(int)} instead.
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD,
- android.Manifest.permission.NETWORK_STACK
- })
- @Deprecated
- public void disable(int netId, @Nullable ActionListener listener) {
- if (netId < 0) throw new IllegalArgumentException("Network id cannot be negative");
- // Simple wrapper which forwards the call to disableNetwork. This is a temporary
- // implementation until we can remove this API completely.
- boolean status = disableNetwork(netId);
- if (listener != null) {
- if (status) {
- listener.onSuccess();
- } else {
- listener.onFailure(ERROR);
- }
- }
- }
-
- /**
- * Enable/disable auto-join globally.
- *
- * @param allowAutojoin true to allow auto-join, false to disallow auto-join
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void allowAutojoinGlobal(boolean allowAutojoin) {
- try {
- mService.allowAutojoinGlobal(allowAutojoin);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
-
- /**
- * Sets the user choice for allowing auto-join to a network.
- * The updated choice will be made available through the updated config supplied by the
- * CONFIGURED_NETWORKS_CHANGED broadcast.
- *
- * @param netId the id of the network to allow/disallow auto-join for.
- * @param allowAutojoin true to allow auto-join, false to disallow auto-join
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void allowAutojoin(int netId, boolean allowAutojoin) {
- try {
- mService.allowAutojoin(netId, allowAutojoin);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Configure auto-join settings for a Passpoint profile.
- *
- * @param fqdn the FQDN (fully qualified domain name) of the passpoint profile.
- * @param allowAutojoin true to enable auto-join, false to disable auto-join.
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void allowAutojoinPasspoint(@NonNull String fqdn, boolean allowAutojoin) {
- try {
- mService.allowAutojoinPasspoint(fqdn, allowAutojoin);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Configure MAC randomization setting for a Passpoint profile.
- * MAC randomization is enabled by default.
- *
- * @param fqdn the FQDN (fully qualified domain name) of the passpoint profile.
- * @param enable true to enable MAC randomization, false to disable MAC randomization.
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void setMacRandomizationSettingPasspointEnabled(@NonNull String fqdn, boolean enable) {
- try {
- mService.setMacRandomizationSettingPasspointEnabled(fqdn, enable);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Sets the user's choice of metered override for a Passpoint profile.
- *
- * @param fqdn the FQDN (fully qualified domain name) of the passpoint profile.
- * @param meteredOverride One of three values: {@link WifiConfiguration#METERED_OVERRIDE_NONE},
- * {@link WifiConfiguration#METERED_OVERRIDE_METERED},
- * {@link WifiConfiguration#METERED_OVERRIDE_NOT_METERED}
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void setPasspointMeteredOverride(@NonNull String fqdn,
- @WifiConfiguration.MeteredOverride int meteredOverride) {
- try {
- mService.setPasspointMeteredOverride(fqdn, meteredOverride);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Temporarily disable a network. Should always trigger with user disconnect network.
- *
- * @param network Input can be SSID or FQDN. And caller must ensure that the SSID passed thru
- * this API matched the WifiConfiguration.SSID rules, and thus be surrounded by
- * quotes.
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_STACK
- })
- public void disableEphemeralNetwork(@NonNull String network) {
- if (TextUtils.isEmpty(network)) {
- throw new IllegalArgumentException("SSID cannot be null or empty!");
- }
- try {
- mService.disableEphemeralNetwork(network, mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * WPS suport has been deprecated from Client mode and this method will immediately trigger
- * {@link WpsCallback#onFailed(int)} with a generic error.
- *
- * @param config WPS configuration (does not support {@link WpsInfo#LABEL})
- * @param listener for callbacks on success or failure. Can be null.
- * @throws IllegalStateException if the WifiManager instance needs to be initialized again
- * @deprecated This API is deprecated
- */
- public void startWps(WpsInfo config, WpsCallback listener) {
- if (listener != null ) {
- listener.onFailed(ERROR);
- }
- }
-
- /**
- * WPS support has been deprecated from Client mode and this method will immediately trigger
- * {@link WpsCallback#onFailed(int)} with a generic error.
- *
- * @param listener for callbacks on success or failure. Can be null.
- * @throws IllegalStateException if the WifiManager instance needs to be initialized again
- * @deprecated This API is deprecated
- */
- public void cancelWps(WpsCallback listener) {
- if (listener != null) {
- listener.onFailed(ERROR);
- }
- }
-
- /**
- * Allows an application to keep the Wi-Fi radio awake.
- * Normally the Wi-Fi radio may turn off when the user has not used the device in a while.
- * Acquiring a WifiLock will keep the radio on until the lock is released. Multiple
- * applications may hold WifiLocks, and the radio will only be allowed to turn off when no
- * WifiLocks are held in any application.
- * <p>
- * Before using a WifiLock, consider carefully if your application requires Wi-Fi access, or
- * could function over a mobile network, if available. A program that needs to download large
- * files should hold a WifiLock to ensure that the download will complete, but a program whose
- * network usage is occasional or low-bandwidth should not hold a WifiLock to avoid adversely
- * affecting battery life.
- * <p>
- * Note that WifiLocks cannot override the user-level "Wi-Fi Enabled" setting, nor Airplane
- * Mode. They simply keep the radio from turning off when Wi-Fi is already on but the device
- * is idle.
- * <p>
- * Any application using a WifiLock must request the {@code android.permission.WAKE_LOCK}
- * permission in an {@code <uses-permission>} element of the application's manifest.
- */
- public class WifiLock {
- private String mTag;
- private final IBinder mBinder;
- private int mRefCount;
- int mLockType;
- private boolean mRefCounted;
- private boolean mHeld;
- private WorkSource mWorkSource;
-
- private WifiLock(int lockType, String tag) {
- mTag = tag;
- mLockType = lockType;
- mBinder = new Binder();
- mRefCount = 0;
- mRefCounted = true;
- mHeld = false;
- }
-
- /**
- * Locks the Wi-Fi radio on until {@link #release} is called.
- *
- * If this WifiLock is reference-counted, each call to {@code acquire} will increment the
- * reference count, and the radio will remain locked as long as the reference count is
- * above zero.
- *
- * If this WifiLock is not reference-counted, the first call to {@code acquire} will lock
- * the radio, but subsequent calls will be ignored. Only one call to {@link #release}
- * will be required, regardless of the number of times that {@code acquire} is called.
- */
- public void acquire() {
- synchronized (mBinder) {
- if (mRefCounted ? (++mRefCount == 1) : (!mHeld)) {
- try {
- mService.acquireWifiLock(mBinder, mLockType, mTag, mWorkSource);
- synchronized (WifiManager.this) {
- if (mActiveLockCount >= MAX_ACTIVE_LOCKS) {
- mService.releaseWifiLock(mBinder);
- throw new UnsupportedOperationException(
- "Exceeded maximum number of wifi locks");
- }
- mActiveLockCount++;
- }
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- mHeld = true;
- }
- }
- }
-
- /**
- * Unlocks the Wi-Fi radio, allowing it to turn off when the device is idle.
- *
- * If this WifiLock is reference-counted, each call to {@code release} will decrement the
- * reference count, and the radio will be unlocked only when the reference count reaches
- * zero. If the reference count goes below zero (that is, if {@code release} is called
- * a greater number of times than {@link #acquire}), an exception is thrown.
- *
- * If this WifiLock is not reference-counted, the first call to {@code release} (after
- * the radio was locked using {@link #acquire}) will unlock the radio, and subsequent
- * calls will be ignored.
- */
- public void release() {
- synchronized (mBinder) {
- if (mRefCounted ? (--mRefCount == 0) : (mHeld)) {
- try {
- mService.releaseWifiLock(mBinder);
- synchronized (WifiManager.this) {
- mActiveLockCount--;
- }
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- mHeld = false;
- }
- if (mRefCount < 0) {
- throw new RuntimeException("WifiLock under-locked " + mTag);
- }
- }
- }
-
- /**
- * Controls whether this is a reference-counted or non-reference-counted WifiLock.
- *
- * Reference-counted WifiLocks keep track of the number of calls to {@link #acquire} and
- * {@link #release}, and only allow the radio to sleep when every call to {@link #acquire}
- * has been balanced with a call to {@link #release}. Non-reference-counted WifiLocks
- * lock the radio whenever {@link #acquire} is called and it is unlocked, and unlock the
- * radio whenever {@link #release} is called and it is locked.
- *
- * @param refCounted true if this WifiLock should keep a reference count
- */
- public void setReferenceCounted(boolean refCounted) {
- mRefCounted = refCounted;
- }
-
- /**
- * Checks whether this WifiLock is currently held.
- *
- * @return true if this WifiLock is held, false otherwise
- */
- public boolean isHeld() {
- synchronized (mBinder) {
- return mHeld;
- }
- }
-
- public void setWorkSource(WorkSource ws) {
- synchronized (mBinder) {
- if (ws != null && ws.isEmpty()) {
- ws = null;
- }
- boolean changed = true;
- if (ws == null) {
- mWorkSource = null;
- } else {
- ws = ws.withoutNames();
- if (mWorkSource == null) {
- changed = mWorkSource != null;
- mWorkSource = new WorkSource(ws);
- } else {
- changed = !mWorkSource.equals(ws);
- if (changed) {
- mWorkSource.set(ws);
- }
- }
- }
- if (changed && mHeld) {
- try {
- mService.updateWifiLockWorkSource(mBinder, mWorkSource);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
- }
- }
-
- public String toString() {
- String s1, s2, s3;
- synchronized (mBinder) {
- s1 = Integer.toHexString(System.identityHashCode(this));
- s2 = mHeld ? "held; " : "";
- if (mRefCounted) {
- s3 = "refcounted: refcount = " + mRefCount;
- } else {
- s3 = "not refcounted";
- }
- return "WifiLock{ " + s1 + "; " + s2 + s3 + " }";
- }
- }
-
- @Override
- protected void finalize() throws Throwable {
- super.finalize();
- synchronized (mBinder) {
- if (mHeld) {
- try {
- mService.releaseWifiLock(mBinder);
- synchronized (WifiManager.this) {
- mActiveLockCount--;
- }
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
- }
- }
- }
-
- /**
- * Creates a new WifiLock.
- *
- * @param lockType the type of lock to create. See {@link #WIFI_MODE_FULL_HIGH_PERF}
- * and {@link #WIFI_MODE_FULL_LOW_LATENCY} for descriptions of the types of Wi-Fi locks.
- * @param tag a tag for the WifiLock to identify it in debugging messages. This string is
- * never shown to the user under normal conditions, but should be descriptive
- * enough to identify your application and the specific WifiLock within it, if it
- * holds multiple WifiLocks.
- *
- * @return a new, unacquired WifiLock with the given tag.
- *
- * @see WifiLock
- */
- public WifiLock createWifiLock(int lockType, String tag) {
- return new WifiLock(lockType, tag);
- }
-
- /**
- * Creates a new WifiLock.
- *
- * @param tag a tag for the WifiLock to identify it in debugging messages. This string is
- * never shown to the user under normal conditions, but should be descriptive
- * enough to identify your application and the specific WifiLock within it, if it
- * holds multiple WifiLocks.
- *
- * @return a new, unacquired WifiLock with the given tag.
- *
- * @see WifiLock
- *
- * @deprecated This API is non-functional.
- */
- @Deprecated
- public WifiLock createWifiLock(String tag) {
- return new WifiLock(WIFI_MODE_FULL, tag);
- }
-
- /**
- * Create a new MulticastLock
- *
- * @param tag a tag for the MulticastLock to identify it in debugging
- * messages. This string is never shown to the user under
- * normal conditions, but should be descriptive enough to
- * identify your application and the specific MulticastLock
- * within it, if it holds multiple MulticastLocks.
- *
- * @return a new, unacquired MulticastLock with the given tag.
- *
- * @see MulticastLock
- */
- public MulticastLock createMulticastLock(String tag) {
- return new MulticastLock(tag);
- }
-
- /**
- * Allows an application to receive Wifi Multicast packets.
- * Normally the Wifi stack filters out packets not explicitly
- * addressed to this device. Acquring a MulticastLock will
- * cause the stack to receive packets addressed to multicast
- * addresses. Processing these extra packets can cause a noticeable
- * battery drain and should be disabled when not needed.
- */
- public class MulticastLock {
- private String mTag;
- private final IBinder mBinder;
- private int mRefCount;
- private boolean mRefCounted;
- private boolean mHeld;
-
- private MulticastLock(String tag) {
- mTag = tag;
- mBinder = new Binder();
- mRefCount = 0;
- mRefCounted = true;
- mHeld = false;
- }
-
- /**
- * Locks Wifi Multicast on until {@link #release} is called.
- *
- * If this MulticastLock is reference-counted each call to
- * {@code acquire} will increment the reference count, and the
- * wifi interface will receive multicast packets as long as the
- * reference count is above zero.
- *
- * If this MulticastLock is not reference-counted, the first call to
- * {@code acquire} will turn on the multicast packets, but subsequent
- * calls will be ignored. Only one call to {@link #release} will
- * be required, regardless of the number of times that {@code acquire}
- * is called.
- *
- * Note that other applications may also lock Wifi Multicast on.
- * Only they can relinquish their lock.
- *
- * Also note that applications cannot leave Multicast locked on.
- * When an app exits or crashes, any Multicast locks will be released.
- */
- public void acquire() {
- synchronized (mBinder) {
- if (mRefCounted ? (++mRefCount == 1) : (!mHeld)) {
- try {
- mService.acquireMulticastLock(mBinder, mTag);
- synchronized (WifiManager.this) {
- if (mActiveLockCount >= MAX_ACTIVE_LOCKS) {
- mService.releaseMulticastLock(mTag);
- throw new UnsupportedOperationException(
- "Exceeded maximum number of wifi locks");
- }
- mActiveLockCount++;
- }
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- mHeld = true;
- }
- }
- }
-
- /**
- * Unlocks Wifi Multicast, restoring the filter of packets
- * not addressed specifically to this device and saving power.
- *
- * If this MulticastLock is reference-counted, each call to
- * {@code release} will decrement the reference count, and the
- * multicast packets will only stop being received when the reference
- * count reaches zero. If the reference count goes below zero (that
- * is, if {@code release} is called a greater number of times than
- * {@link #acquire}), an exception is thrown.
- *
- * If this MulticastLock is not reference-counted, the first call to
- * {@code release} (after the radio was multicast locked using
- * {@link #acquire}) will unlock the multicast, and subsequent calls
- * will be ignored.
- *
- * Note that if any other Wifi Multicast Locks are still outstanding
- * this {@code release} call will not have an immediate effect. Only
- * when all applications have released all their Multicast Locks will
- * the Multicast filter be turned back on.
- *
- * Also note that when an app exits or crashes all of its Multicast
- * Locks will be automatically released.
- */
- public void release() {
- synchronized (mBinder) {
- if (mRefCounted ? (--mRefCount == 0) : (mHeld)) {
- try {
- mService.releaseMulticastLock(mTag);
- synchronized (WifiManager.this) {
- mActiveLockCount--;
- }
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- mHeld = false;
- }
- if (mRefCount < 0) {
- throw new RuntimeException("MulticastLock under-locked "
- + mTag);
- }
- }
- }
-
- /**
- * Controls whether this is a reference-counted or non-reference-
- * counted MulticastLock.
- *
- * Reference-counted MulticastLocks keep track of the number of calls
- * to {@link #acquire} and {@link #release}, and only stop the
- * reception of multicast packets when every call to {@link #acquire}
- * has been balanced with a call to {@link #release}. Non-reference-
- * counted MulticastLocks allow the reception of multicast packets
- * whenever {@link #acquire} is called and stop accepting multicast
- * packets whenever {@link #release} is called.
- *
- * @param refCounted true if this MulticastLock should keep a reference
- * count
- */
- public void setReferenceCounted(boolean refCounted) {
- mRefCounted = refCounted;
- }
-
- /**
- * Checks whether this MulticastLock is currently held.
- *
- * @return true if this MulticastLock is held, false otherwise
- */
- public boolean isHeld() {
- synchronized (mBinder) {
- return mHeld;
- }
- }
-
- public String toString() {
- String s1, s2, s3;
- synchronized (mBinder) {
- s1 = Integer.toHexString(System.identityHashCode(this));
- s2 = mHeld ? "held; " : "";
- if (mRefCounted) {
- s3 = "refcounted: refcount = " + mRefCount;
- } else {
- s3 = "not refcounted";
- }
- return "MulticastLock{ " + s1 + "; " + s2 + s3 + " }";
- }
- }
-
- @Override
- protected void finalize() throws Throwable {
- super.finalize();
- setReferenceCounted(false);
- release();
- }
- }
-
- /**
- * Check multicast filter status.
- *
- * @return true if multicast packets are allowed.
- *
- * @hide pending API council approval
- */
- public boolean isMulticastEnabled() {
- try {
- return mService.isMulticastEnabled();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Initialize the multicast filtering to 'on'
- * @hide no intent to publish
- */
- @UnsupportedAppUsage
- public boolean initializeMulticastFiltering() {
- try {
- mService.initializeMulticastFiltering();
- return true;
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Set Wi-Fi verbose logging level from developer settings.
- *
- * @param enable true to enable verbose logging, false to disable.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void setVerboseLoggingEnabled(boolean enable) {
- enableVerboseLogging(enable ? 1 : 0);
- }
-
- /** @hide */
- @UnsupportedAppUsage(
- maxTargetSdk = Build.VERSION_CODES.Q,
- publicAlternatives = "Use {@code #setVerboseLoggingEnabled(boolean)} instead."
- )
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void enableVerboseLogging (int verbose) {
- try {
- mService.enableVerboseLogging(verbose);
- } catch (Exception e) {
- //ignore any failure here
- Log.e(TAG, "enableVerboseLogging " + e.toString());
- }
- }
-
- /**
- * Get the persisted Wi-Fi verbose logging level, set by
- * {@link #setVerboseLoggingEnabled(boolean)}.
- * No permissions are required to call this method.
- *
- * @return true to indicate that verbose logging is enabled, false to indicate that verbose
- * logging is disabled.
- *
- * @hide
- */
- @SystemApi
- public boolean isVerboseLoggingEnabled() {
- return getVerboseLoggingLevel() > 0;
- }
-
- /** @hide */
- // TODO(b/145484145): remove once SUW stops calling this via reflection
- @UnsupportedAppUsage(
- maxTargetSdk = Build.VERSION_CODES.Q,
- publicAlternatives = "Use {@code #isVerboseLoggingEnabled()} instead."
- )
- public int getVerboseLoggingLevel() {
- try {
- return mService.getVerboseLoggingLevel();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Removes all saved Wi-Fi networks, Passpoint configurations, ephemeral networks, Network
- * Requests, and Network Suggestions.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void factoryReset() {
- try {
- mService.factoryReset(mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Get {@link Network} object of current wifi network, or null if not connected.
- * @hide
- */
- @Nullable
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD
- })
- public Network getCurrentNetwork() {
- try {
- return mService.getCurrentNetwork();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Deprecated
- * returns false
- * @hide
- * @deprecated
- */
- public boolean setEnableAutoJoinWhenAssociated(boolean enabled) {
- return false;
- }
-
- /**
- * Deprecated
- * returns false
- * @hide
- * @deprecated
- */
- public boolean getEnableAutoJoinWhenAssociated() {
- return false;
- }
-
- /**
- * Returns a byte stream representing the data that needs to be backed up to save the
- * current Wifi state.
- * This Wifi state can be restored by calling {@link #restoreBackupData(byte[])}.
- * @hide
- */
- @NonNull
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public byte[] retrieveBackupData() {
- try {
- return mService.retrieveBackupData();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Restore state from the backed up data.
- * @param data byte stream in the same format produced by {@link #retrieveBackupData()}
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void restoreBackupData(@NonNull byte[] data) {
- try {
- mService.restoreBackupData(data);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Returns a byte stream representing the data that needs to be backed up to save the
- * current soft ap config data.
- *
- * This soft ap config can be restored by calling {@link #restoreSoftApBackupData(byte[])}
- * @hide
- */
- @NonNull
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public byte[] retrieveSoftApBackupData() {
- try {
- return mService.retrieveSoftApBackupData();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Returns soft ap config from the backed up data or null if data is invalid.
- * @param data byte stream in the same format produced by {@link #retrieveSoftApBackupData()}
- *
- * @hide
- */
- @Nullable
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public SoftApConfiguration restoreSoftApBackupData(@NonNull byte[] data) {
- try {
- return mService.restoreSoftApBackupData(data);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Restore state from the older version of back up data.
- * The old backup data was essentially a backup of wpa_supplicant.conf
- * and ipconfig.txt file.
- * @param supplicantData bytes representing wpa_supplicant.conf
- * @param ipConfigData bytes representing ipconfig.txt
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void restoreSupplicantBackupData(
- @NonNull byte[] supplicantData, @NonNull byte[] ipConfigData) {
- try {
- mService.restoreSupplicantBackupData(supplicantData, ipConfigData);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Start subscription provisioning flow
- *
- * @param provider {@link OsuProvider} to provision with
- * @param executor the Executor on which to run the callback.
- * @param callback {@link ProvisioningCallback} for updates regarding provisioning flow
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD
- })
- public void startSubscriptionProvisioning(@NonNull OsuProvider provider,
- @NonNull @CallbackExecutor Executor executor, @NonNull ProvisioningCallback callback) {
- // Verify arguments
- if (executor == null) {
- throw new IllegalArgumentException("executor must not be null");
- }
- if (callback == null) {
- throw new IllegalArgumentException("callback must not be null");
- }
- try {
- mService.startSubscriptionProvisioning(provider,
- new ProvisioningCallbackProxy(executor, callback));
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Helper class to support OSU Provisioning callbacks
- */
- private static class ProvisioningCallbackProxy extends IProvisioningCallback.Stub {
- private final Executor mExecutor;
- private final ProvisioningCallback mCallback;
-
- ProvisioningCallbackProxy(Executor executor, ProvisioningCallback callback) {
- mExecutor = executor;
- mCallback = callback;
- }
-
- @Override
- public void onProvisioningStatus(int status) {
- mExecutor.execute(() -> mCallback.onProvisioningStatus(status));
- }
-
- @Override
- public void onProvisioningFailure(int status) {
- mExecutor.execute(() -> mCallback.onProvisioningFailure(status));
- }
-
- @Override
- public void onProvisioningComplete() {
- mExecutor.execute(() -> mCallback.onProvisioningComplete());
- }
- }
-
- /**
- * Interface for Traffic state callback. Should be extended by applications and set when
- * calling {@link #registerTrafficStateCallback(Executor, WifiManager.TrafficStateCallback)}.
- * @hide
- */
- @SystemApi
- public interface TrafficStateCallback {
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = {"DATA_ACTIVITY_"}, value = {
- DATA_ACTIVITY_NONE,
- DATA_ACTIVITY_IN,
- DATA_ACTIVITY_OUT,
- DATA_ACTIVITY_INOUT})
- @interface DataActivity {}
-
- // Lowest bit indicates data reception and the second lowest bit indicates data transmitted
- /** No data in or out */
- int DATA_ACTIVITY_NONE = 0x00;
- /** Data in, no data out */
- int DATA_ACTIVITY_IN = 0x01;
- /** Data out, no data in */
- int DATA_ACTIVITY_OUT = 0x02;
- /** Data in and out */
- int DATA_ACTIVITY_INOUT = 0x03;
-
- /**
- * Callback invoked to inform clients about the current traffic state.
- *
- * @param state One of the values: {@link #DATA_ACTIVITY_NONE}, {@link #DATA_ACTIVITY_IN},
- * {@link #DATA_ACTIVITY_OUT} & {@link #DATA_ACTIVITY_INOUT}.
- */
- void onStateChanged(@DataActivity int state);
- }
-
- /**
- * Callback proxy for TrafficStateCallback objects.
- *
- * @hide
- */
- private class TrafficStateCallbackProxy extends ITrafficStateCallback.Stub {
- private final Executor mExecutor;
- private final TrafficStateCallback mCallback;
-
- TrafficStateCallbackProxy(Executor executor, TrafficStateCallback callback) {
- mExecutor = executor;
- mCallback = callback;
- }
-
- @Override
- public void onStateChanged(int state) {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "TrafficStateCallbackProxy: onStateChanged state=" + state);
- }
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> {
- mCallback.onStateChanged(state);
- });
- }
- }
-
- /**
- * Registers a callback for monitoring traffic state. See {@link TrafficStateCallback}. These
- * callbacks will be invoked periodically by platform to inform clients about the current
- * traffic state. Caller can unregister a previously registered callback using
- * {@link #unregisterTrafficStateCallback(TrafficStateCallback)}
- * <p>
- * Applications should have the
- * {@link android.Manifest.permission#NETWORK_SETTINGS NETWORK_SETTINGS} permission. Callers
- * without the permission will trigger a {@link java.lang.SecurityException}.
- * <p>
- *
- * @param executor The Executor on whose thread to execute the callbacks of the {@code callback}
- * object.
- * @param callback Callback for traffic state events
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void registerTrafficStateCallback(@NonNull @CallbackExecutor Executor executor,
- @NonNull TrafficStateCallback callback) {
- if (executor == null) throw new IllegalArgumentException("executor cannot be null");
- if (callback == null) throw new IllegalArgumentException("callback cannot be null");
- Log.v(TAG, "registerTrafficStateCallback: callback=" + callback + ", executor=" + executor);
-
- Binder binder = new Binder();
- try {
- mService.registerTrafficStateCallback(
- binder, new TrafficStateCallbackProxy(executor, callback), callback.hashCode());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Allow callers to unregister a previously registered callback. After calling this method,
- * applications will no longer receive traffic state notifications.
- *
- * @param callback Callback to unregister for traffic state events
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void unregisterTrafficStateCallback(@NonNull TrafficStateCallback callback) {
- if (callback == null) throw new IllegalArgumentException("callback cannot be null");
- Log.v(TAG, "unregisterTrafficStateCallback: callback=" + callback);
-
- try {
- mService.unregisterTrafficStateCallback(callback.hashCode());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Helper method to update the local verbose logging flag based on the verbose logging
- * level from wifi service.
- */
- private void updateVerboseLoggingEnabledFromService() {
- mVerboseLoggingEnabled = isVerboseLoggingEnabled();
- }
-
- /**
- * @return true if this device supports WPA3-Personal SAE
- */
- public boolean isWpa3SaeSupported() {
- return isFeatureSupported(WIFI_FEATURE_WPA3_SAE);
- }
-
- /**
- * @return true if this device supports WPA3-Enterprise Suite-B-192
- */
- public boolean isWpa3SuiteBSupported() {
- return isFeatureSupported(WIFI_FEATURE_WPA3_SUITE_B);
- }
-
- /**
- * @return true if this device supports Wi-Fi Enhanced Open (OWE)
- */
- public boolean isEnhancedOpenSupported() {
- return isFeatureSupported(WIFI_FEATURE_OWE);
- }
-
- /**
- * Wi-Fi Easy Connect (DPP) introduces standardized mechanisms to simplify the provisioning and
- * configuration of Wi-Fi devices.
- * For more details, visit <a href="https://www.wi-fi.org/">https://www.wi-fi.org/</a> and
- * search for "Easy Connect" or "Device Provisioning Protocol specification".
- *
- * @return true if this device supports Wi-Fi Easy-connect (Device Provisioning Protocol)
- */
- public boolean isEasyConnectSupported() {
- return isFeatureSupported(WIFI_FEATURE_DPP);
- }
-
- /**
- * @return true if this device supports WAPI.
- */
- public boolean isWapiSupported() {
- return isFeatureSupported(WIFI_FEATURE_WAPI);
- }
-
- /**
- * @return true if this device supports WPA3 AP validation.
- */
- public boolean isWpa3ApValidationSupported() {
- return isFeatureSupported(WIFI_FEATURE_SAE_PK);
- }
-
- /**
- * Gets the factory Wi-Fi MAC addresses.
- * @return Array of String representing Wi-Fi MAC addresses sorted lexically or an empty Array
- * if failed.
- * @hide
- */
- @NonNull
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public String[] getFactoryMacAddresses() {
- try {
- return mService.getFactoryMacAddresses();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = {"DEVICE_MOBILITY_STATE_"}, value = {
- DEVICE_MOBILITY_STATE_UNKNOWN,
- DEVICE_MOBILITY_STATE_HIGH_MVMT,
- DEVICE_MOBILITY_STATE_LOW_MVMT,
- DEVICE_MOBILITY_STATE_STATIONARY})
- public @interface DeviceMobilityState {}
-
- /**
- * Unknown device mobility state
- *
- * @see #setDeviceMobilityState(int)
- *
- * @hide
- */
- @SystemApi
- public static final int DEVICE_MOBILITY_STATE_UNKNOWN = 0;
-
- /**
- * High movement device mobility state.
- * e.g. on a bike, in a motor vehicle
- *
- * @see #setDeviceMobilityState(int)
- *
- * @hide
- */
- @SystemApi
- public static final int DEVICE_MOBILITY_STATE_HIGH_MVMT = 1;
-
- /**
- * Low movement device mobility state.
- * e.g. walking, running
- *
- * @see #setDeviceMobilityState(int)
- *
- * @hide
- */
- @SystemApi
- public static final int DEVICE_MOBILITY_STATE_LOW_MVMT = 2;
-
- /**
- * Stationary device mobility state
- *
- * @see #setDeviceMobilityState(int)
- *
- * @hide
- */
- @SystemApi
- public static final int DEVICE_MOBILITY_STATE_STATIONARY = 3;
-
- /**
- * Updates the device mobility state. Wifi uses this information to adjust the interval between
- * Wifi scans in order to balance power consumption with scan accuracy.
- * The default mobility state when the device boots is {@link #DEVICE_MOBILITY_STATE_UNKNOWN}.
- * This API should be called whenever there is a change in the mobility state.
- * @param state the updated device mobility state
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.WIFI_SET_DEVICE_MOBILITY_STATE)
- public void setDeviceMobilityState(@DeviceMobilityState int state) {
- try {
- mService.setDeviceMobilityState(state);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /* Easy Connect - AKA Device Provisioning Protocol (DPP) */
-
- /**
- * Easy Connect Network role: Station.
- *
- * @hide
- */
- @SystemApi
- public static final int EASY_CONNECT_NETWORK_ROLE_STA = 0;
-
- /**
- * Easy Connect Network role: Access Point.
- *
- * @hide
- */
- @SystemApi
- public static final int EASY_CONNECT_NETWORK_ROLE_AP = 1;
-
- /** @hide */
- @IntDef(prefix = {"EASY_CONNECT_NETWORK_ROLE_"}, value = {
- EASY_CONNECT_NETWORK_ROLE_STA,
- EASY_CONNECT_NETWORK_ROLE_AP,
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface EasyConnectNetworkRole {
- }
-
- /**
- * Easy Connect Device information maximum allowed length.
- *
- * @hide
- */
- @SystemApi
- public static final int EASY_CONNECT_DEVICE_INFO_MAXIMUM_LENGTH = 40;
-
- /**
- * Easy Connect Cryptography Curve name: prime256v1
- *
- * @hide
- */
- @SystemApi
- public static final int EASY_CONNECT_CRYPTOGRAPHY_CURVE_PRIME256V1 = 0;
-
- /**
- * Easy Connect Cryptography Curve name: secp384r1
- *
- * @hide
- */
- @SystemApi
- public static final int EASY_CONNECT_CRYPTOGRAPHY_CURVE_SECP384R1 = 1;
-
- /**
- * Easy Connect Cryptography Curve name: secp521r1
- *
- * @hide
- */
- @SystemApi
- public static final int EASY_CONNECT_CRYPTOGRAPHY_CURVE_SECP521R1 = 2;
-
-
- /**
- * Easy Connect Cryptography Curve name: brainpoolP256r1
- *
- * @hide
- */
- @SystemApi
- public static final int EASY_CONNECT_CRYPTOGRAPHY_CURVE_BRAINPOOLP256R1 = 3;
-
-
- /**
- * Easy Connect Cryptography Curve name: brainpoolP384r1
- *
- * @hide
- */
- @SystemApi
- public static final int EASY_CONNECT_CRYPTOGRAPHY_CURVE_BRAINPOOLP384R1 = 4;
-
-
- /**
- * Easy Connect Cryptography Curve name: brainpoolP512r1
- *
- * @hide
- */
- @SystemApi
- public static final int EASY_CONNECT_CRYPTOGRAPHY_CURVE_BRAINPOOLP512R1 = 5;
-
- /**
- * Easy Connect Cryptography Curve name: default
- * This allows framework to choose manadatory curve prime256v1.
- *
- * @hide
- */
- @SystemApi
- public static final int EASY_CONNECT_CRYPTOGRAPHY_CURVE_DEFAULT =
- EASY_CONNECT_CRYPTOGRAPHY_CURVE_PRIME256V1;
-
- /** @hide */
- @IntDef(prefix = {"EASY_CONNECT_CRYPTOGRAPHY_CURVE_"}, value = {
- EASY_CONNECT_CRYPTOGRAPHY_CURVE_DEFAULT,
- EASY_CONNECT_CRYPTOGRAPHY_CURVE_PRIME256V1,
- EASY_CONNECT_CRYPTOGRAPHY_CURVE_SECP384R1,
- EASY_CONNECT_CRYPTOGRAPHY_CURVE_SECP521R1,
- EASY_CONNECT_CRYPTOGRAPHY_CURVE_BRAINPOOLP256R1,
- EASY_CONNECT_CRYPTOGRAPHY_CURVE_BRAINPOOLP384R1,
- EASY_CONNECT_CRYPTOGRAPHY_CURVE_BRAINPOOLP512R1,
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface EasyConnectCryptographyCurve {
- }
-
- /**
- * Start Easy Connect (DPP) in Configurator-Initiator role. The current device will initiate
- * Easy Connect bootstrapping with a peer, and configure the peer with the SSID and password of
- * the specified network using the Easy Connect protocol on an encrypted link.
- *
- * @param enrolleeUri URI of the Enrollee obtained separately (e.g. QR code scanning)
- * @param selectedNetworkId Selected network ID to be sent to the peer
- * @param enrolleeNetworkRole The network role of the enrollee
- * @param callback Callback for status updates
- * @param executor The Executor on which to run the callback.
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD})
- public void startEasyConnectAsConfiguratorInitiator(@NonNull String enrolleeUri,
- int selectedNetworkId, @EasyConnectNetworkRole int enrolleeNetworkRole,
- @NonNull @CallbackExecutor Executor executor,
- @NonNull EasyConnectStatusCallback callback) {
- Binder binder = new Binder();
- try {
- mService.startDppAsConfiguratorInitiator(binder, enrolleeUri, selectedNetworkId,
- enrolleeNetworkRole, new EasyConnectCallbackProxy(executor, callback));
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Start Easy Connect (DPP) in Enrollee-Initiator role. The current device will initiate Easy
- * Connect bootstrapping with a peer, and receive the SSID and password from the peer
- * configurator.
- *
- * @param configuratorUri URI of the Configurator obtained separately (e.g. QR code scanning)
- * @param callback Callback for status updates
- * @param executor The Executor on which to run the callback.
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD})
- public void startEasyConnectAsEnrolleeInitiator(@NonNull String configuratorUri,
- @NonNull @CallbackExecutor Executor executor,
- @NonNull EasyConnectStatusCallback callback) {
- Binder binder = new Binder();
- try {
- mService.startDppAsEnrolleeInitiator(binder, configuratorUri,
- new EasyConnectCallbackProxy(executor, callback));
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Start Easy Connect (DPP) in Enrollee-Responder role.
- * The device will:
- * 1. Generate a DPP bootstrap URI and return it using the
- * {@link EasyConnectStatusCallback#onBootstrapUriGenerated(String)} method.
- * 2. Start DPP as a Responder, waiting for an Initiator device to start the DPP
- * authentication process.
- * The caller should use the URI provided in step #1, for instance display it as a QR code
- * or communicate it in some other way to the initiator device.
- *
- * @param deviceInfo Device specific information to add to the DPP URI. This field allows
- * the users of the configurators to identify the device.
- * Optional - if not provided or in case of an empty string,
- * Info field (I:) will be skipped in the generated DPP URI.
- * Allowed Range of ASCII characters in deviceInfo - %x20-7E.
- * semicolon and space are not allowed.
- * Due to the limitation of maximum allowed characters in QR code,
- * framework limits to a max of
- * {@link #EASY_CONNECT_DEVICE_INFO_MAXIMUM_LENGTH} characters in
- * deviceInfo.
- * Violation of these rules will result in an exception.
- * @param curve Elliptic curve cryptography used to generate DPP
- * public/private key pair. If application is not interested in a
- * specific curve, choose default curve
- * {@link #EASY_CONNECT_CRYPTOGRAPHY_CURVE_DEFAULT}.
- * @param callback Callback for status updates
- * @param executor The Executor on which to run the callback.
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD})
- public void startEasyConnectAsEnrolleeResponder(@Nullable String deviceInfo,
- @EasyConnectCryptographyCurve int curve,
- @NonNull @CallbackExecutor Executor executor,
- @NonNull EasyConnectStatusCallback callback) {
- Binder binder = new Binder();
- try {
- mService.startDppAsEnrolleeResponder(binder, deviceInfo, curve,
- new EasyConnectCallbackProxy(executor, callback));
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Stop or abort a current Easy Connect (DPP) session. This call, once processed, will
- * terminate any ongoing transaction, and clean up all associated resources. Caller should not
- * expect any callbacks once this call is made. However, due to the asynchronous nature of
- * this call, a callback may be fired if it was already pending in the queue.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD})
- public void stopEasyConnectSession() {
- try {
- /* Request lower layers to stop/abort and clear resources */
- mService.stopDppSession();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Helper class to support Easy Connect (DPP) callbacks
- *
- * @hide
- */
- private static class EasyConnectCallbackProxy extends IDppCallback.Stub {
- private final Executor mExecutor;
- private final EasyConnectStatusCallback mEasyConnectStatusCallback;
-
- EasyConnectCallbackProxy(Executor executor,
- EasyConnectStatusCallback easyConnectStatusCallback) {
- mExecutor = executor;
- mEasyConnectStatusCallback = easyConnectStatusCallback;
- }
-
- @Override
- public void onSuccessConfigReceived(int newNetworkId) {
- Log.d(TAG, "Easy Connect onSuccessConfigReceived callback");
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> {
- mEasyConnectStatusCallback.onEnrolleeSuccess(newNetworkId);
- });
- }
-
- @Override
- public void onSuccess(int status) {
- Log.d(TAG, "Easy Connect onSuccess callback");
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> {
- mEasyConnectStatusCallback.onConfiguratorSuccess(status);
- });
- }
-
- @Override
- public void onFailure(int status, String ssid, String channelList,
- int[] operatingClassArray) {
- Log.d(TAG, "Easy Connect onFailure callback");
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> {
- SparseArray<int[]> channelListArray = parseDppChannelList(channelList);
- mEasyConnectStatusCallback.onFailure(status, ssid, channelListArray,
- operatingClassArray);
- });
- }
-
- @Override
- public void onProgress(int status) {
- Log.d(TAG, "Easy Connect onProgress callback");
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> {
- mEasyConnectStatusCallback.onProgress(status);
- });
- }
-
- @Override
- public void onBootstrapUriGenerated(String uri) {
- Log.d(TAG, "Easy Connect onBootstrapUriGenerated callback");
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> {
- mEasyConnectStatusCallback.onBootstrapUriGenerated(uri);
- });
- }
- }
-
- /**
- * Interface for Wi-Fi usability statistics listener. Should be implemented by applications and
- * set when calling {@link WifiManager#addOnWifiUsabilityStatsListener(Executor,
- * OnWifiUsabilityStatsListener)}.
- *
- * @hide
- */
- @SystemApi
- public interface OnWifiUsabilityStatsListener {
- /**
- * Called when Wi-Fi usability statistics is updated.
- *
- * @param seqNum The sequence number of statistics, used to derive the timing of updated
- * Wi-Fi usability statistics, set by framework and incremented by one after
- * each update.
- * @param isSameBssidAndFreq The flag to indicate whether the BSSID and the frequency of
- * network stays the same or not relative to the last update of
- * Wi-Fi usability stats.
- * @param stats The updated Wi-Fi usability statistics.
- */
- void onWifiUsabilityStats(int seqNum, boolean isSameBssidAndFreq,
- @NonNull WifiUsabilityStatsEntry stats);
- }
-
- /**
- * Adds a listener for Wi-Fi usability statistics. See {@link OnWifiUsabilityStatsListener}.
- * Multiple listeners can be added. Callers will be invoked periodically by framework to
- * inform clients about the current Wi-Fi usability statistics. Callers can remove a previously
- * added listener using {@link removeOnWifiUsabilityStatsListener}.
- *
- * @param executor The executor on which callback will be invoked.
- * @param listener Listener for Wifi usability statistics.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE)
- public void addOnWifiUsabilityStatsListener(@NonNull @CallbackExecutor Executor executor,
- @NonNull OnWifiUsabilityStatsListener listener) {
- if (executor == null) throw new IllegalArgumentException("executor cannot be null");
- if (listener == null) throw new IllegalArgumentException("listener cannot be null");
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "addOnWifiUsabilityStatsListener: listener=" + listener);
- }
- try {
- mService.addOnWifiUsabilityStatsListener(new Binder(),
- new IOnWifiUsabilityStatsListener.Stub() {
- @Override
- public void onWifiUsabilityStats(int seqNum, boolean isSameBssidAndFreq,
- WifiUsabilityStatsEntry stats) {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "OnWifiUsabilityStatsListener: "
- + "onWifiUsabilityStats: seqNum=" + seqNum);
- }
- Binder.clearCallingIdentity();
- executor.execute(() -> listener.onWifiUsabilityStats(
- seqNum, isSameBssidAndFreq, stats));
- }
- },
- listener.hashCode()
- );
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Allow callers to remove a previously registered listener. After calling this method,
- * applications will no longer receive Wi-Fi usability statistics.
- *
- * @param listener Listener to remove the Wi-Fi usability statistics.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE)
- public void removeOnWifiUsabilityStatsListener(@NonNull OnWifiUsabilityStatsListener listener) {
- if (listener == null) throw new IllegalArgumentException("listener cannot be null");
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "removeOnWifiUsabilityStatsListener: listener=" + listener);
- }
- try {
- mService.removeOnWifiUsabilityStatsListener(listener.hashCode());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Provide a Wi-Fi usability score information to be recorded (but not acted upon) by the
- * framework. The Wi-Fi usability score is derived from {@link OnWifiUsabilityStatsListener}
- * where a score is matched to Wi-Fi usability statistics using the sequence number. The score
- * is used to quantify whether Wi-Fi is usable in a future time.
- *
- * @param seqNum Sequence number of the Wi-Fi usability score.
- * @param score The Wi-Fi usability score, expected range: [0, 100].
- * @param predictionHorizonSec Prediction horizon of the Wi-Fi usability score in second,
- * expected range: [0, 30].
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE)
- public void updateWifiUsabilityScore(int seqNum, int score, int predictionHorizonSec) {
- try {
- mService.updateWifiUsabilityScore(seqNum, score, predictionHorizonSec);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Abstract class for scan results callback. Should be extended by applications and set when
- * calling {@link WifiManager#registerScanResultsCallback(Executor, ScanResultsCallback)}.
- */
- public abstract static class ScanResultsCallback {
- private final ScanResultsCallbackProxy mScanResultsCallbackProxy;
-
- public ScanResultsCallback() {
- mScanResultsCallbackProxy = new ScanResultsCallbackProxy();
- }
-
- /**
- * Called when new scan results are available.
- * Clients should use {@link WifiManager#getScanResults()} to get the scan results.
- */
- public abstract void onScanResultsAvailable();
-
- /*package*/ @NonNull ScanResultsCallbackProxy getProxy() {
- return mScanResultsCallbackProxy;
- }
-
- private static class ScanResultsCallbackProxy extends IScanResultsCallback.Stub {
- private final Object mLock = new Object();
- @Nullable @GuardedBy("mLock") private Executor mExecutor;
- @Nullable @GuardedBy("mLock") private ScanResultsCallback mCallback;
-
- ScanResultsCallbackProxy() {
- mCallback = null;
- mExecutor = null;
- }
-
- /*package*/ void initProxy(@NonNull Executor executor,
- @NonNull ScanResultsCallback callback) {
- synchronized (mLock) {
- mExecutor = executor;
- mCallback = callback;
- }
- }
-
- /*package*/ void cleanUpProxy() {
- synchronized (mLock) {
- mExecutor = null;
- mCallback = null;
- }
- }
-
- @Override
- public void onScanResultsAvailable() {
- ScanResultsCallback callback;
- Executor executor;
- synchronized (mLock) {
- executor = mExecutor;
- callback = mCallback;
- }
- if (callback == null || executor == null) {
- return;
- }
- Binder.clearCallingIdentity();
- executor.execute(callback::onScanResultsAvailable);
- }
- }
- }
-
- /**
- * Register a callback for Scan Results. See {@link ScanResultsCallback}.
- * Caller will receive the event when scan results are available.
- * Caller should use {@link WifiManager#getScanResults()} requires
- * {@link android.Manifest.permission#ACCESS_FINE_LOCATION} to get the scan results.
- * Caller can remove a previously registered callback using
- * {@link WifiManager#unregisterScanResultsCallback(ScanResultsCallback)}
- * Same caller can add multiple listeners.
- * <p>
- * Applications should have the
- * {@link android.Manifest.permission#ACCESS_WIFI_STATE} permission. Callers
- * without the permission will trigger a {@link java.lang.SecurityException}.
- * <p>
- *
- * @param executor The executor to execute the callback of the {@code callback} object.
- * @param callback callback for Scan Results events
- */
-
- @RequiresPermission(ACCESS_WIFI_STATE)
- public void registerScanResultsCallback(@NonNull @CallbackExecutor Executor executor,
- @NonNull ScanResultsCallback callback) {
- if (executor == null) throw new IllegalArgumentException("executor cannot be null");
- if (callback == null) throw new IllegalArgumentException("callback cannot be null");
-
- Log.v(TAG, "registerScanResultsCallback: callback=" + callback
- + ", executor=" + executor);
- ScanResultsCallback.ScanResultsCallbackProxy proxy = callback.getProxy();
- proxy.initProxy(executor, callback);
- try {
- mService.registerScanResultsCallback(proxy);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Allow callers to unregister a previously registered callback. After calling this method,
- * applications will no longer receive Scan Results events.
- *
- * @param callback callback to unregister for Scan Results events
- */
- @RequiresPermission(ACCESS_WIFI_STATE)
- public void unregisterScanResultsCallback(@NonNull ScanResultsCallback callback) {
- if (callback == null) throw new IllegalArgumentException("callback cannot be null");
- Log.v(TAG, "unregisterScanResultsCallback: Callback=" + callback);
- ScanResultsCallback.ScanResultsCallbackProxy proxy = callback.getProxy();
- try {
- mService.unregisterScanResultsCallback(proxy);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- } finally {
- proxy.cleanUpProxy();
- }
- }
-
- /**
- * Interface for suggestion connection status listener.
- * Should be implemented by applications and set when calling
- * {@link WifiManager#addSuggestionConnectionStatusListener(
- * Executor, SuggestionConnectionStatusListener)}.
- */
- public interface SuggestionConnectionStatusListener {
-
- /**
- * Called when the framework attempted to connect to a suggestion provided by the
- * registering app, but the connection to the suggestion failed.
- * @param wifiNetworkSuggestion The suggestion which failed to connect.
- * @param failureReason the connection failure reason code. One of
- * {@link #STATUS_SUGGESTION_CONNECTION_FAILURE_ASSOCIATION},
- * {@link #STATUS_SUGGESTION_CONNECTION_FAILURE_AUTHENTICATION},
- * {@link #STATUS_SUGGESTION_CONNECTION_FAILURE_IP_PROVISIONING}
- * {@link #STATUS_SUGGESTION_CONNECTION_FAILURE_UNKNOWN}
- */
- void onConnectionStatus(
- @NonNull WifiNetworkSuggestion wifiNetworkSuggestion,
- @SuggestionConnectionStatusCode int failureReason);
- }
-
- private class SuggestionConnectionStatusListenerProxy extends
- ISuggestionConnectionStatusListener.Stub {
- private final Executor mExecutor;
- private final SuggestionConnectionStatusListener mListener;
-
- SuggestionConnectionStatusListenerProxy(@NonNull Executor executor,
- @NonNull SuggestionConnectionStatusListener listener) {
- mExecutor = executor;
- mListener = listener;
- }
-
- @Override
- public void onConnectionStatus(@NonNull WifiNetworkSuggestion wifiNetworkSuggestion,
- int failureReason) {
- mExecutor.execute(() ->
- mListener.onConnectionStatus(wifiNetworkSuggestion, failureReason));
- }
-
- }
-
- /**
- * Add a listener for suggestion networks. See {@link SuggestionConnectionStatusListener}.
- * Caller will receive the event when suggested network have connection failure.
- * Caller can remove a previously registered listener using
- * {@link WifiManager#removeSuggestionConnectionStatusListener(
- * SuggestionConnectionStatusListener)}
- * Same caller can add multiple listeners to monitor the event.
- * <p>
- * Applications should have the
- * {@link android.Manifest.permission#ACCESS_FINE_LOCATION} and
- * {@link android.Manifest.permission#ACCESS_WIFI_STATE} permissions.
- * Callers without the permission will trigger a {@link java.lang.SecurityException}.
- * <p>
- *
- * @param executor The executor to execute the listener of the {@code listener} object.
- * @param listener listener for suggestion network connection failure.
- */
- @RequiresPermission(allOf = {ACCESS_FINE_LOCATION, ACCESS_WIFI_STATE})
- public void addSuggestionConnectionStatusListener(@NonNull @CallbackExecutor Executor executor,
- @NonNull SuggestionConnectionStatusListener listener) {
- if (listener == null) throw new IllegalArgumentException("Listener cannot be null");
- if (executor == null) throw new IllegalArgumentException("Executor cannot be null");
- Log.v(TAG, "addSuggestionConnectionStatusListener listener=" + listener
- + ", executor=" + executor);
- try {
- mService.registerSuggestionConnectionStatusListener(new Binder(),
- new SuggestionConnectionStatusListenerProxy(executor, listener),
- listener.hashCode(), mContext.getOpPackageName(), mContext.getAttributionTag());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
-
- }
-
- /**
- * Allow callers to remove a previously registered listener. After calling this method,
- * applications will no longer receive suggestion connection events through that listener.
- *
- * @param listener listener to remove.
- */
- @RequiresPermission(ACCESS_WIFI_STATE)
- public void removeSuggestionConnectionStatusListener(
- @NonNull SuggestionConnectionStatusListener listener) {
- if (listener == null) throw new IllegalArgumentException("Listener cannot be null");
- Log.v(TAG, "removeSuggestionConnectionStatusListener: listener=" + listener);
- try {
- mService.unregisterSuggestionConnectionStatusListener(listener.hashCode(),
- mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Parse the list of channels the DPP enrollee reports when it fails to find an AP.
- *
- * @param channelList List of channels in the format defined in the DPP specification.
- * @return A parsed sparse array, where the operating class is the key.
- * @hide
- */
- @VisibleForTesting
- public static SparseArray<int[]> parseDppChannelList(String channelList) {
- SparseArray<int[]> channelListArray = new SparseArray<>();
-
- if (TextUtils.isEmpty(channelList)) {
- return channelListArray;
- }
- StringTokenizer str = new StringTokenizer(channelList, ",");
- String classStr = null;
- List<Integer> channelsInClass = new ArrayList<>();
-
- try {
- while (str.hasMoreElements()) {
- String cur = str.nextToken();
-
- /**
- * Example for a channel list:
- *
- * 81/1,2,3,4,5,6,7,8,9,10,11,115/36,40,44,48,118/52,56,60,64,121/100,104,108,112,
- * 116,120,124,128,132,136,140,0/144,124/149,153,157,161,125/165
- *
- * Detect operating class by the delimiter of '/' and use a string tokenizer with
- * ',' as a delimiter.
- */
- int classDelim = cur.indexOf('/');
- if (classDelim != -1) {
- if (classStr != null) {
- // Store the last channel array in the sparse array, where the operating
- // class is the key (as an integer).
- int[] channelsArray = new int[channelsInClass.size()];
- for (int i = 0; i < channelsInClass.size(); i++) {
- channelsArray[i] = channelsInClass.get(i);
- }
- channelListArray.append(Integer.parseInt(classStr), channelsArray);
- channelsInClass = new ArrayList<>();
- }
-
- // Init a new operating class and store the first channel
- classStr = cur.substring(0, classDelim);
- String channelStr = cur.substring(classDelim + 1);
- channelsInClass.add(Integer.parseInt(channelStr));
- } else {
- if (classStr == null) {
- // Invalid format
- Log.e(TAG, "Cannot parse DPP channel list");
- return new SparseArray<>();
- }
- channelsInClass.add(Integer.parseInt(cur));
- }
- }
-
- // Store the last array
- if (classStr != null) {
- int[] channelsArray = new int[channelsInClass.size()];
- for (int i = 0; i < channelsInClass.size(); i++) {
- channelsArray[i] = channelsInClass.get(i);
- }
- channelListArray.append(Integer.parseInt(classStr), channelsArray);
- }
- return channelListArray;
- } catch (NumberFormatException e) {
- Log.e(TAG, "Cannot parse DPP channel list");
- return new SparseArray<>();
- }
- }
-
- /**
- * Callback interface for framework to receive network status updates and trigger of updating
- * {@link WifiUsabilityStatsEntry}.
- *
- * @hide
- */
- @SystemApi
- public interface ScoreUpdateObserver {
- /**
- * Called by applications to indicate network status.
- *
- * @param sessionId The ID to indicate current Wi-Fi network connection obtained from
- * {@link WifiConnectedNetworkScorer#onStart(int)}.
- * @param score The score representing link quality of current Wi-Fi network connection.
- * Populated by connected network scorer in applications..
- */
- void notifyScoreUpdate(int sessionId, int score);
-
- /**
- * Called by applications to trigger an update of {@link WifiUsabilityStatsEntry}.
- * To receive update applications need to add WifiUsabilityStatsEntry listener. See
- * {@link addOnWifiUsabilityStatsListener(Executor, OnWifiUsabilityStatsListener)}.
- *
- * @param sessionId The ID to indicate current Wi-Fi network connection obtained from
- * {@link WifiConnectedNetworkScorer#onStart(int)}.
- */
- void triggerUpdateOfWifiUsabilityStats(int sessionId);
- }
-
- /**
- * Callback proxy for {@link ScoreUpdateObserver} objects.
- *
- * @hide
- */
- private class ScoreUpdateObserverProxy implements ScoreUpdateObserver {
- private final IScoreUpdateObserver mScoreUpdateObserver;
-
- private ScoreUpdateObserverProxy(IScoreUpdateObserver observer) {
- mScoreUpdateObserver = observer;
- }
-
- @Override
- public void notifyScoreUpdate(int sessionId, int score) {
- try {
- mScoreUpdateObserver.notifyScoreUpdate(sessionId, score);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- @Override
- public void triggerUpdateOfWifiUsabilityStats(int sessionId) {
- try {
- mScoreUpdateObserver.triggerUpdateOfWifiUsabilityStats(sessionId);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
- }
-
- /**
- * Interface for Wi-Fi connected network scorer. Should be implemented by applications and set
- * when calling
- * {@link WifiManager#setWifiConnectedNetworkScorer(Executor, WifiConnectedNetworkScorer)}.
- *
- * @hide
- */
- @SystemApi
- public interface WifiConnectedNetworkScorer {
- /**
- * Called by framework to indicate the start of a network connection.
- * @param sessionId The ID to indicate current Wi-Fi network connection.
- */
- void onStart(int sessionId);
-
- /**
- * Called by framework to indicate the end of a network connection.
- * @param sessionId The ID to indicate current Wi-Fi network connection obtained from
- * {@link WifiConnectedNetworkScorer#onStart(int)}.
- */
- void onStop(int sessionId);
-
- /**
- * Framework sets callback for score change events after application sets its scorer.
- * @param observerImpl The instance for {@link WifiManager#ScoreUpdateObserver}. Should be
- * implemented and instantiated by framework.
- */
- void onSetScoreUpdateObserver(@NonNull ScoreUpdateObserver observerImpl);
- }
-
- /**
- * Callback proxy for {@link WifiConnectedNetworkScorer} objects.
- *
- * @hide
- */
- private class WifiConnectedNetworkScorerProxy extends IWifiConnectedNetworkScorer.Stub {
- private Executor mExecutor;
- private WifiConnectedNetworkScorer mScorer;
-
- WifiConnectedNetworkScorerProxy(Executor executor, WifiConnectedNetworkScorer scorer) {
- mExecutor = executor;
- mScorer = scorer;
- }
-
- @Override
- public void onStart(int sessionId) {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "WifiConnectedNetworkScorer: " + "onStart: sessionId=" + sessionId);
- }
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> mScorer.onStart(sessionId));
- }
-
- @Override
- public void onStop(int sessionId) {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "WifiConnectedNetworkScorer: " + "onStop: sessionId=" + sessionId);
- }
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> mScorer.onStop(sessionId));
- }
-
- @Override
- public void onSetScoreUpdateObserver(IScoreUpdateObserver observerImpl) {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "WifiConnectedNetworkScorer: "
- + "onSetScoreUpdateObserver: observerImpl=" + observerImpl);
- }
- Binder.clearCallingIdentity();
- mExecutor.execute(() -> mScorer.onSetScoreUpdateObserver(
- new ScoreUpdateObserverProxy(observerImpl)));
- }
- }
-
- /**
- * Set a callback for Wi-Fi connected network scorer. See {@link WifiConnectedNetworkScorer}.
- * Only a single scorer can be set. Caller will be invoked periodically by framework to inform
- * client about start and stop of Wi-Fi connection. Caller can clear a previously set scorer
- * using {@link clearWifiConnectedNetworkScorer()}.
- *
- * @param executor The executor on which callback will be invoked.
- * @param scorer Scorer for Wi-Fi network implemented by application.
- * @return true Scorer is set successfully.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE)
- public boolean setWifiConnectedNetworkScorer(@NonNull @CallbackExecutor Executor executor,
- @NonNull WifiConnectedNetworkScorer scorer) {
- if (executor == null) throw new IllegalArgumentException("executor cannot be null");
- if (scorer == null) throw new IllegalArgumentException("scorer cannot be null");
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "setWifiConnectedNetworkScorer: scorer=" + scorer);
- }
- try {
- return mService.setWifiConnectedNetworkScorer(new Binder(),
- new WifiConnectedNetworkScorerProxy(executor, scorer));
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Allow caller to clear a previously set scorer. After calling this method,
- * client will no longer receive information about start and stop of Wi-Fi connection.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE)
- public void clearWifiConnectedNetworkScorer() {
- if (mVerboseLoggingEnabled) {
- Log.v(TAG, "clearWifiConnectedNetworkScorer");
- }
- try {
- mService.clearWifiConnectedNetworkScorer();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Enable/disable wifi scan throttling from 3rd party apps.
- *
- * <p>
- * The throttling limits for apps are described in
- * <a href="Wi-Fi Scan Throttling">
- * https://developer.android.com/guide/topics/connectivity/wifi-scan#wifi-scan-throttling</a>
- * </p>
- *
- * @param enable true to allow scan throttling, false to disallow scan throttling.
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void setScanThrottleEnabled(boolean enable) {
- try {
- mService.setScanThrottleEnabled(enable);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Get the persisted Wi-Fi scan throttle state. Defaults to true, unless changed by the user via
- * Developer options.
- *
- * <p>
- * The throttling limits for apps are described in
- * <a href="Wi-Fi Scan Throttling">
- * https://developer.android.com/guide/topics/connectivity/wifi-scan#wifi-scan-throttling</a>
- * </p>
- *
- * @return true to indicate that scan throttling is enabled, false to indicate that scan
- * throttling is disabled.
- */
- @RequiresPermission(ACCESS_WIFI_STATE)
- public boolean isScanThrottleEnabled() {
- try {
- return mService.isScanThrottleEnabled();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Enable/disable wifi auto wakeup feature.
- *
- * <p>
- * The feature is described in
- * <a href="Wi-Fi Turn on automatically">
- * https://source.android.com/devices/tech/connect/wifi-infrastructure
- * #turn_on_wi-fi_automatically
- * </a>
- *
- * @param enable true to enable, false to disable.
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void setAutoWakeupEnabled(boolean enable) {
- try {
- mService.setAutoWakeupEnabled(enable);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Get the persisted Wi-Fi auto wakeup feature state. Defaults to false, unless changed by the
- * user via Settings.
- *
- * <p>
- * The feature is described in
- * <a href="Wi-Fi Turn on automatically">
- * https://source.android.com/devices/tech/connect/wifi-infrastructure
- * #turn_on_wi-fi_automatically
- * </a>
- *
- * @return true to indicate that wakeup feature is enabled, false to indicate that wakeup
- * feature is disabled.
- */
- @RequiresPermission(ACCESS_WIFI_STATE)
- public boolean isAutoWakeupEnabled() {
- try {
- return mService.isAutoWakeupEnabled();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Sets the state of carrier offload on merged or unmerged networks for specified subscription.
- *
- * <p>
- * When a subscription's carrier network offload is disabled, all network suggestions related to
- * this subscription will not be considered for auto join.
- * <p>
- * If calling app want disable all carrier network offload from a specified subscription, should
- * call this API twice to disable both merged and unmerged carrier network suggestions.
- *
- * @param subscriptionId See {@link SubscriptionInfo#getSubscriptionId()}.
- * @param merged True for carrier merged network, false otherwise.
- * See {@link WifiNetworkSuggestion.Builder#setCarrierMerged(boolean)}
- * @param enabled True for enable carrier network offload, false otherwise.
- * @see #isCarrierNetworkOffloadEnabled(int, boolean)
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD})
- public void setCarrierNetworkOffloadEnabled(int subscriptionId, boolean merged,
- boolean enabled) {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- try {
- mService.setCarrierNetworkOffloadEnabled(subscriptionId, merged, enabled);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Get the carrier network offload state for merged or unmerged networks for specified
- * subscription.
- * @param subscriptionId subscription ID see {@link SubscriptionInfo#getSubscriptionId()}
- * @param merged True for carrier merged network, false otherwise.
- * See {@link WifiNetworkSuggestion.Builder#setCarrierMerged(boolean)}
- * @return True to indicate that carrier network offload is enabled, false otherwise.
- * @see #setCarrierNetworkOffloadEnabled(int, boolean, boolean)
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_SETUP_WIZARD})
- public boolean isCarrierNetworkOffloadEnabled(int subscriptionId, boolean merged) {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- try {
- return mService.isCarrierNetworkOffloadEnabled(subscriptionId, merged);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Interface for network suggestion user approval status change listener.
- * Should be implemented by applications and registered using
- * {@link #addSuggestionUserApprovalStatusListener(Executor,
- * SuggestionUserApprovalStatusListener)} (
- */
- public interface SuggestionUserApprovalStatusListener {
-
- /**
- * Called when the user approval status of the App has changed. The current status can be
- * queried by {@link #getNetworkSuggestionUserApprovalStatus()}
- */
- void onUserApprovalStatusChange();
- }
-
- private class SuggestionUserApprovalStatusListenerProxy extends
- ISuggestionUserApprovalStatusListener.Stub {
- private final Executor mExecutor;
- private final SuggestionUserApprovalStatusListener mListener;
-
- SuggestionUserApprovalStatusListenerProxy(@NonNull Executor executor,
- @NonNull SuggestionUserApprovalStatusListener listener) {
- mExecutor = executor;
- mListener = listener;
- }
-
- @Override
- public void onUserApprovalStatusChange() {
- mExecutor.execute(() -> mListener.onUserApprovalStatusChange());
- }
-
- }
-
- /**
- * Add a listener for Wi-Fi network suggestion user approval status.
- * See {@link SuggestionUserApprovalStatusListener}.
- * Caller will receive a callback when the user approval status of the caller has changed.
- * Caller can remove a previously registered listener using
- * {@link WifiManager#removeSuggestionUserApprovalStatusListener(
- * SuggestionUserApprovalStatusListener)}
- * A caller can add multiple listeners to monitor the event.
- * @param executor The executor to execute the listener of the {@code listener} object.
- * @param listener listener for suggestion user approval status changes.
- * @return true if succeed otherwise false.
- */
- @RequiresPermission(ACCESS_WIFI_STATE)
- public boolean addSuggestionUserApprovalStatusListener(
- @NonNull @CallbackExecutor Executor executor,
- @NonNull SuggestionUserApprovalStatusListener listener) {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- if (listener == null) throw new IllegalArgumentException("Listener cannot be null");
- if (executor == null) throw new IllegalArgumentException("Executor cannot be null");
- Log.v(TAG, "addSuggestionUserApprovalStatusListener listener=" + listener
- + ", executor=" + executor);
- try {
- return mService.addSuggestionUserApprovalStatusListener(new Binder(),
- new SuggestionUserApprovalStatusListenerProxy(executor, listener),
- listener.hashCode(), mContext.getOpPackageName(), mContext.getAttributionTag());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
-
- }
-
- /**
- * Allow callers to remove a previously registered listener using
- * {@link #addSuggestionUserApprovalStatusListener(Executor,
- * SuggestionUserApprovalStatusListener)}. After calling this method,
- * applications will no longer receive network suggestion user approval status change through
- * that listener.
- *
- * @param listener listener to remove.
- */
- @RequiresPermission(ACCESS_WIFI_STATE)
- public void removeSuggestionUserApprovalStatusListener(
- @NonNull SuggestionUserApprovalStatusListener listener) {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- if (listener == null) throw new IllegalArgumentException("Listener cannot be null");
- Log.v(TAG, "removeSuggestionUserApprovalStatusListener: listener=" + listener);
- try {
- mService.removeSuggestionUserApprovalStatusListener(listener.hashCode(),
- mContext.getOpPackageName());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
-}
diff --git a/wifi/java/android/net/wifi/WifiNetworkAgentSpecifier.java b/wifi/java/android/net/wifi/WifiNetworkAgentSpecifier.java
deleted file mode 100644
index 0d13805..0000000
--- a/wifi/java/android/net/wifi/WifiNetworkAgentSpecifier.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * 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.net.wifi;
-
-import static com.android.internal.util.Preconditions.checkNotNull;
-import static com.android.internal.util.Preconditions.checkState;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.net.MacAddress;
-import android.net.MatchAllNetworkSpecifier;
-import android.net.NetworkRequest;
-import android.net.NetworkSpecifier;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.util.Objects;
-
-/**
- * Network specifier object used by wifi's {@link android.net.NetworkAgent}.
- * @hide
- */
-public final class WifiNetworkAgentSpecifier extends NetworkSpecifier implements Parcelable {
- /**
- * Security credentials for the currently connected network.
- */
- private final WifiConfiguration mWifiConfiguration;
-
- public WifiNetworkAgentSpecifier(@NonNull WifiConfiguration wifiConfiguration) {
- checkNotNull(wifiConfiguration);
-
- mWifiConfiguration = wifiConfiguration;
- }
-
- /**
- * @hide
- */
- public static final @android.annotation.NonNull Creator<WifiNetworkAgentSpecifier> CREATOR =
- new Creator<WifiNetworkAgentSpecifier>() {
- @Override
- public WifiNetworkAgentSpecifier createFromParcel(@NonNull Parcel in) {
- WifiConfiguration wifiConfiguration = in.readParcelable(null);
- return new WifiNetworkAgentSpecifier(wifiConfiguration);
- }
-
- @Override
- public WifiNetworkAgentSpecifier[] newArray(int size) {
- return new WifiNetworkAgentSpecifier[size];
- }
- };
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- dest.writeParcelable(mWifiConfiguration, flags);
- }
-
- @Override
- public boolean canBeSatisfiedBy(@Nullable NetworkSpecifier other) {
- if (this == other) {
- return true;
- }
- // Any generic requests should be satisifed by a specific wifi network.
- if (other == null || other instanceof MatchAllNetworkSpecifier) {
- return true;
- }
- if (other instanceof WifiNetworkSpecifier) {
- return satisfiesNetworkSpecifier((WifiNetworkSpecifier) other);
- }
- return equals(other);
- }
-
- /**
- * Match {@link WifiNetworkSpecifier} in app's {@link NetworkRequest} with the
- * {@link WifiNetworkAgentSpecifier} in wifi platform's {@link android.net.NetworkAgent}.
- */
- public boolean satisfiesNetworkSpecifier(@NonNull WifiNetworkSpecifier ns) {
- // None of these should be null by construction.
- // {@link WifiNetworkSpecifier.Builder} enforces non-null in {@link WifiNetworkSpecifier}.
- // {@link WifiNetworkFactory} ensures non-null in {@link WifiNetworkAgentSpecifier}.
- checkNotNull(ns);
- checkNotNull(ns.ssidPatternMatcher);
- checkNotNull(ns.bssidPatternMatcher);
- checkNotNull(ns.wifiConfiguration.allowedKeyManagement);
- checkNotNull(this.mWifiConfiguration.SSID);
- checkNotNull(this.mWifiConfiguration.BSSID);
- checkNotNull(this.mWifiConfiguration.allowedKeyManagement);
-
- final String ssidWithQuotes = this.mWifiConfiguration.SSID;
- checkState(ssidWithQuotes.startsWith("\"") && ssidWithQuotes.endsWith("\""));
- final String ssidWithoutQuotes = ssidWithQuotes.substring(1, ssidWithQuotes.length() - 1);
- if (!ns.ssidPatternMatcher.match(ssidWithoutQuotes)) {
- return false;
- }
- final MacAddress bssid = MacAddress.fromString(this.mWifiConfiguration.BSSID);
- final MacAddress matchBaseAddress = ns.bssidPatternMatcher.first;
- final MacAddress matchMask = ns.bssidPatternMatcher.second;
- if (!bssid.matches(matchBaseAddress, matchMask)) {
- return false;
- }
- if (!ns.wifiConfiguration.allowedKeyManagement.equals(
- this.mWifiConfiguration.allowedKeyManagement)) {
- return false;
- }
- return true;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(
- mWifiConfiguration.SSID,
- mWifiConfiguration.BSSID,
- mWifiConfiguration.allowedKeyManagement);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!(obj instanceof WifiNetworkAgentSpecifier)) {
- return false;
- }
- WifiNetworkAgentSpecifier lhs = (WifiNetworkAgentSpecifier) obj;
- return Objects.equals(this.mWifiConfiguration.SSID, lhs.mWifiConfiguration.SSID)
- && Objects.equals(this.mWifiConfiguration.BSSID, lhs.mWifiConfiguration.BSSID)
- && Objects.equals(this.mWifiConfiguration.allowedKeyManagement,
- lhs.mWifiConfiguration.allowedKeyManagement);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("WifiNetworkAgentSpecifier [");
- sb.append("WifiConfiguration=")
- .append(", SSID=").append(mWifiConfiguration.SSID)
- .append(", BSSID=").append(mWifiConfiguration.BSSID)
- .append("]");
- return sb.toString();
- }
-
- @Override
- public NetworkSpecifier redact() {
- return null;
- }
-}
diff --git a/wifi/java/android/net/wifi/WifiNetworkConnectionStatistics.java b/wifi/java/android/net/wifi/WifiNetworkConnectionStatistics.java
deleted file mode 100644
index 95b2e77..0000000
--- a/wifi/java/android/net/wifi/WifiNetworkConnectionStatistics.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi;
-
-import android.annotation.NonNull;
-import android.annotation.SystemApi;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-/**
- * Connection Statistics For a WiFi Network.
- * @hide
- */
-@SystemApi
-public class WifiNetworkConnectionStatistics implements Parcelable {
- private static final String TAG = "WifiNetworkConnnectionStatistics";
-
- public int numConnection;
- public int numUsage;
-
- public WifiNetworkConnectionStatistics(int connection, int usage) {
- numConnection = connection;
- numUsage = usage;
- }
-
- public WifiNetworkConnectionStatistics() { }
-
- @NonNull
- @Override
- public String toString() {
- StringBuilder sbuf = new StringBuilder();
- sbuf.append("c=").append(numConnection);
- sbuf.append(" u=").append(numUsage);
- return sbuf.toString();
- }
-
-
- /** copy constructor*/
- public WifiNetworkConnectionStatistics(WifiNetworkConnectionStatistics source) {
- numConnection = source.numConnection;
- numUsage = source.numUsage;
- }
-
- /** Implement the Parcelable interface */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface */
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(numConnection);
- dest.writeInt(numUsage);
- }
-
- /** Implement the Parcelable interface */
- public static final @android.annotation.NonNull Creator<WifiNetworkConnectionStatistics> CREATOR =
- new Creator<WifiNetworkConnectionStatistics>() {
- public WifiNetworkConnectionStatistics createFromParcel(Parcel in) {
- int numConnection = in.readInt();
- int numUsage = in.readInt();
- WifiNetworkConnectionStatistics stats =
- new WifiNetworkConnectionStatistics(numConnection, numUsage);
- return stats;
- }
-
- public WifiNetworkConnectionStatistics[] newArray(int size) {
- return new WifiNetworkConnectionStatistics[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/WifiNetworkSpecifier.java b/wifi/java/android/net/wifi/WifiNetworkSpecifier.java
deleted file mode 100644
index be3b45d..0000000
--- a/wifi/java/android/net/wifi/WifiNetworkSpecifier.java
+++ /dev/null
@@ -1,655 +0,0 @@
-/*
- * 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.net.wifi;
-
-import static com.android.internal.util.Preconditions.checkNotNull;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.net.MacAddress;
-import android.net.NetworkRequest;
-import android.net.NetworkSpecifier;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.os.PatternMatcher;
-import android.text.TextUtils;
-import android.util.Pair;
-
-import java.nio.charset.CharsetEncoder;
-import java.nio.charset.StandardCharsets;
-import java.util.Objects;
-
-/**
- * Network specifier object used to request a local Wi-Fi network. Apps should use the
- * {@link WifiNetworkSpecifier.Builder} class to create an instance.
- */
-public final class WifiNetworkSpecifier extends NetworkSpecifier implements Parcelable {
- private static final String TAG = "WifiNetworkSpecifier";
-
- /**
- * Builder used to create {@link WifiNetworkSpecifier} objects.
- */
- public static final class Builder {
- private static final String MATCH_ALL_SSID_PATTERN_PATH = ".*";
- private static final String MATCH_EMPTY_SSID_PATTERN_PATH = "";
- private static final Pair<MacAddress, MacAddress> MATCH_NO_BSSID_PATTERN1 =
- new Pair<>(MacAddress.BROADCAST_ADDRESS, MacAddress.BROADCAST_ADDRESS);
- private static final Pair<MacAddress, MacAddress> MATCH_NO_BSSID_PATTERN2 =
- new Pair<>(WifiManager.ALL_ZEROS_MAC_ADDRESS, MacAddress.BROADCAST_ADDRESS);
- private static final Pair<MacAddress, MacAddress> MATCH_ALL_BSSID_PATTERN =
- new Pair<>(WifiManager.ALL_ZEROS_MAC_ADDRESS, WifiManager.ALL_ZEROS_MAC_ADDRESS);
- private static final MacAddress MATCH_EXACT_BSSID_PATTERN_MASK =
- MacAddress.BROADCAST_ADDRESS;
-
- /**
- * Set WPA Enterprise type according to certificate security level.
- * This is for backward compatibility in R.
- */
- private static final int WPA3_ENTERPRISE_AUTO = 0;
- /** Set WPA Enterprise type to standard mode only. */
- private static final int WPA3_ENTERPRISE_STANDARD = 1;
- /** Set WPA Enterprise type to 192 bit mode only. */
- private static final int WPA3_ENTERPRISE_192_BIT = 2;
-
- /**
- * SSID pattern match specified by the app.
- */
- private @Nullable PatternMatcher mSsidPatternMatcher;
- /**
- * BSSID pattern match specified by the app.
- * Pair of <BaseAddress, Mask>.
- */
- private @Nullable Pair<MacAddress, MacAddress> mBssidPatternMatcher;
- /**
- * Whether this is an OWE network or not.
- */
- private boolean mIsEnhancedOpen;
- /**
- * Pre-shared key for use with WPA-PSK networks.
- */
- private @Nullable String mWpa2PskPassphrase;
- /**
- * Pre-shared key for use with WPA3-SAE networks.
- */
- private @Nullable String mWpa3SaePassphrase;
- /**
- * The enterprise configuration details specifying the EAP method,
- * certificates and other settings associated with the WPA/WPA2-Enterprise networks.
- */
- private @Nullable WifiEnterpriseConfig mWpa2EnterpriseConfig;
- /**
- * The enterprise configuration details specifying the EAP method,
- * certificates and other settings associated with the WPA3-Enterprise networks.
- */
- private @Nullable WifiEnterpriseConfig mWpa3EnterpriseConfig;
- /**
- * Indicate what type this WPA3-Enterprise network is.
- */
- private int mWpa3EnterpriseType = WPA3_ENTERPRISE_AUTO;
- /**
- * This is a network that does not broadcast its SSID, so an
- * SSID-specific probe request must be used for scans.
- */
- private boolean mIsHiddenSSID;
-
- public Builder() {
- mSsidPatternMatcher = null;
- mBssidPatternMatcher = null;
- mIsEnhancedOpen = false;
- mWpa2PskPassphrase = null;
- mWpa3SaePassphrase = null;
- mWpa2EnterpriseConfig = null;
- mWpa3EnterpriseConfig = null;
- mIsHiddenSSID = false;
- }
-
- /**
- * Set the unicode SSID match pattern to use for filtering networks from scan results.
- * <p>
- * <li>Overrides any previous value set using {@link #setSsid(String)} or
- * {@link #setSsidPattern(PatternMatcher)}.</li>
- *
- * @param ssidPattern Instance of {@link PatternMatcher} containing the UTF-8 encoded
- * string pattern to use for matching the network's SSID.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setSsidPattern(@NonNull PatternMatcher ssidPattern) {
- checkNotNull(ssidPattern);
- mSsidPatternMatcher = ssidPattern;
- return this;
- }
-
- /**
- * Set the unicode SSID for the network.
- * <p>
- * <li>Sets the SSID to use for filtering networks from scan results. Will only match
- * networks whose SSID is identical to the UTF-8 encoding of the specified value.</li>
- * <li>Overrides any previous value set using {@link #setSsid(String)} or
- * {@link #setSsidPattern(PatternMatcher)}.</li>
- *
- * @param ssid The SSID of the network. It must be valid Unicode.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- * @throws IllegalArgumentException if the SSID is not valid unicode.
- */
- public @NonNull Builder setSsid(@NonNull String ssid) {
- checkNotNull(ssid);
- final CharsetEncoder unicodeEncoder = StandardCharsets.UTF_8.newEncoder();
- if (!unicodeEncoder.canEncode(ssid)) {
- throw new IllegalArgumentException("SSID is not a valid unicode string");
- }
- mSsidPatternMatcher = new PatternMatcher(ssid, PatternMatcher.PATTERN_LITERAL);
- return this;
- }
-
- /**
- * Set the BSSID match pattern to use for filtering networks from scan results.
- * Will match all networks with BSSID which satisfies the following:
- * {@code BSSID & mask == baseAddress}.
- * <p>
- * <li>Overrides any previous value set using {@link #setBssid(MacAddress)} or
- * {@link #setBssidPattern(MacAddress, MacAddress)}.</li>
- *
- * @param baseAddress Base address for BSSID pattern.
- * @param mask Mask for BSSID pattern.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setBssidPattern(
- @NonNull MacAddress baseAddress, @NonNull MacAddress mask) {
- checkNotNull(baseAddress);
- checkNotNull(mask);
- mBssidPatternMatcher = Pair.create(baseAddress, mask);
- return this;
- }
-
- /**
- * Set the BSSID to use for filtering networks from scan results. Will only match network
- * whose BSSID is identical to the specified value.
- * <p>
- * <li>Sets the BSSID to use for filtering networks from scan results. Will only match
- * networks whose BSSID is identical to specified value.</li>
- * <li>Overrides any previous value set using {@link #setBssid(MacAddress)} or
- * {@link #setBssidPattern(MacAddress, MacAddress)}.</li>
- *
- * @param bssid BSSID of the network.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setBssid(@NonNull MacAddress bssid) {
- checkNotNull(bssid);
- mBssidPatternMatcher = Pair.create(bssid, MATCH_EXACT_BSSID_PATTERN_MASK);
- return this;
- }
-
- /**
- * Specifies whether this represents an Enhanced Open (OWE) network.
- *
- * @param isEnhancedOpen {@code true} to indicate that the network uses enhanced open,
- * {@code false} otherwise.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setIsEnhancedOpen(boolean isEnhancedOpen) {
- mIsEnhancedOpen = isEnhancedOpen;
- return this;
- }
-
- /**
- * Set the ASCII WPA2 passphrase for this network. Needed for authenticating to
- * WPA2-PSK networks.
- *
- * @param passphrase passphrase of the network.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- * @throws IllegalArgumentException if the passphrase is not ASCII encodable.
- */
- public @NonNull Builder setWpa2Passphrase(@NonNull String passphrase) {
- checkNotNull(passphrase);
- final CharsetEncoder asciiEncoder = StandardCharsets.US_ASCII.newEncoder();
- if (!asciiEncoder.canEncode(passphrase)) {
- throw new IllegalArgumentException("passphrase not ASCII encodable");
- }
- mWpa2PskPassphrase = passphrase;
- return this;
- }
-
- /**
- * Set the ASCII WPA3 passphrase for this network. Needed for authenticating to WPA3-SAE
- * networks.
- *
- * @param passphrase passphrase of the network.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- * @throws IllegalArgumentException if the passphrase is not ASCII encodable.
- */
- public @NonNull Builder setWpa3Passphrase(@NonNull String passphrase) {
- checkNotNull(passphrase);
- final CharsetEncoder asciiEncoder = StandardCharsets.US_ASCII.newEncoder();
- if (!asciiEncoder.canEncode(passphrase)) {
- throw new IllegalArgumentException("passphrase not ASCII encodable");
- }
- mWpa3SaePassphrase = passphrase;
- return this;
- }
-
- /**
- * Set the associated enterprise configuration for this network. Needed for authenticating
- * to WPA2-EAP networks. See {@link WifiEnterpriseConfig} for description.
- *
- * @param enterpriseConfig Instance of {@link WifiEnterpriseConfig}.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setWpa2EnterpriseConfig(
- @NonNull WifiEnterpriseConfig enterpriseConfig) {
- checkNotNull(enterpriseConfig);
- mWpa2EnterpriseConfig = new WifiEnterpriseConfig(enterpriseConfig);
- return this;
- }
-
- /**
- * Set the associated enterprise configuration for this network. Needed for authenticating
- * to WPA3-Enterprise networks (standard and 192-bit security). See
- * {@link WifiEnterpriseConfig} for description. For 192-bit security networks, both the
- * client and CA certificates must be provided, and must be of type of either
- * sha384WithRSAEncryption (OID 1.2.840.113549.1.1.12) or ecdsa-with-SHA384
- * (OID 1.2.840.10045.4.3.3).
- *
- * @deprecated use {@link #setWpa3EnterpriseStandardModeConfig(WifiEnterpriseConfig)} or
- * {@link #setWpa3Enterprise192BitModeConfig(WifiEnterpriseConfig)} to specify
- * WPA3-Enterprise type explicitly.
- *
- * @param enterpriseConfig Instance of {@link WifiEnterpriseConfig}.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- @Deprecated
- public @NonNull Builder setWpa3EnterpriseConfig(
- @NonNull WifiEnterpriseConfig enterpriseConfig) {
- checkNotNull(enterpriseConfig);
- mWpa3EnterpriseConfig = new WifiEnterpriseConfig(enterpriseConfig);
- return this;
- }
-
- /**
- * Set the associated enterprise configuration for this network. Needed for authenticating
- * to standard WPA3-Enterprise networks. See {@link WifiEnterpriseConfig} for description.
- * For WPA3-Enterprise in 192-bit security mode networks,
- * see {@link #setWpa3Enterprise192BitModeConfig(WifiEnterpriseConfig)} for description.
- *
- * @param enterpriseConfig Instance of {@link WifiEnterpriseConfig}.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setWpa3EnterpriseStandardModeConfig(
- @NonNull WifiEnterpriseConfig enterpriseConfig) {
- checkNotNull(enterpriseConfig);
- mWpa3EnterpriseConfig = new WifiEnterpriseConfig(enterpriseConfig);
- mWpa3EnterpriseType = WPA3_ENTERPRISE_STANDARD;
- return this;
- }
-
- /**
- * Set the associated enterprise configuration for this network. Needed for authenticating
- * to WPA3-Enterprise in 192-bit security mode networks. See {@link WifiEnterpriseConfig}
- * for description. Both the client and CA certificates must be provided,
- * and must be of type of either sha384WithRSAEncryption with key length of 3072bit or
- * more (OID 1.2.840.113549.1.1.12), or ecdsa-with-SHA384 with key length of 384bit or
- * more (OID 1.2.840.10045.4.3.3).
- *
- * @param enterpriseConfig Instance of {@link WifiEnterpriseConfig}.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- * @throws IllegalArgumentException if the EAP type or certificates do not
- * meet 192-bit mode requirements.
- */
- public @NonNull Builder setWpa3Enterprise192BitModeConfig(
- @NonNull WifiEnterpriseConfig enterpriseConfig) {
- checkNotNull(enterpriseConfig);
- if (enterpriseConfig.getEapMethod() != WifiEnterpriseConfig.Eap.TLS) {
- throw new IllegalArgumentException("The 192-bit mode network type must be TLS");
- }
- if (!WifiEnterpriseConfig.isSuiteBCipherCert(
- enterpriseConfig.getClientCertificate())) {
- throw new IllegalArgumentException(
- "The client certificate does not meet 192-bit mode requirements.");
- }
- if (!WifiEnterpriseConfig.isSuiteBCipherCert(
- enterpriseConfig.getCaCertificate())) {
- throw new IllegalArgumentException(
- "The CA certificate does not meet 192-bit mode requirements.");
- }
-
- mWpa3EnterpriseConfig = new WifiEnterpriseConfig(enterpriseConfig);
- mWpa3EnterpriseType = WPA3_ENTERPRISE_192_BIT;
- return this;
- }
-
- /**
- * Specifies whether this represents a hidden network.
- * <p>
- * <li>Setting this disallows the usage of {@link #setSsidPattern(PatternMatcher)} since
- * hidden networks need to be explicitly probed for.</li>
- * <li>If not set, defaults to false (i.e not a hidden network).</li>
- *
- * @param isHiddenSsid {@code true} to indicate that the network is hidden, {@code false}
- * otherwise.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setIsHiddenSsid(boolean isHiddenSsid) {
- mIsHiddenSSID = isHiddenSsid;
- return this;
- }
-
- private void setSecurityParamsInWifiConfiguration(
- @NonNull WifiConfiguration configuration) {
- if (!TextUtils.isEmpty(mWpa2PskPassphrase)) { // WPA-PSK network.
- configuration.setSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
- // WifiConfiguration.preSharedKey needs quotes around ASCII password.
- configuration.preSharedKey = "\"" + mWpa2PskPassphrase + "\"";
- } else if (!TextUtils.isEmpty(mWpa3SaePassphrase)) { // WPA3-SAE network.
- configuration.setSecurityParams(WifiConfiguration.SECURITY_TYPE_SAE);
- // WifiConfiguration.preSharedKey needs quotes around ASCII password.
- configuration.preSharedKey = "\"" + mWpa3SaePassphrase + "\"";
- } else if (mWpa2EnterpriseConfig != null) { // WPA-EAP network
- configuration.setSecurityParams(WifiConfiguration.SECURITY_TYPE_EAP);
- configuration.enterpriseConfig = mWpa2EnterpriseConfig;
- } else if (mWpa3EnterpriseConfig != null) { // WPA3-Enterprise
- if (mWpa3EnterpriseType == WPA3_ENTERPRISE_AUTO
- && mWpa3EnterpriseConfig.getEapMethod() == WifiEnterpriseConfig.Eap.TLS
- && WifiEnterpriseConfig.isSuiteBCipherCert(
- mWpa3EnterpriseConfig.getClientCertificate())
- && WifiEnterpriseConfig.isSuiteBCipherCert(
- mWpa3EnterpriseConfig.getCaCertificate())) {
- // WPA3-Enterprise in 192-bit security mode
- configuration.setSecurityParams(
- WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT);
- } else if (mWpa3EnterpriseType == WPA3_ENTERPRISE_192_BIT) {
- // WPA3-Enterprise in 192-bit security mode
- configuration.setSecurityParams(
- WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT);
- } else {
- // WPA3-Enterprise
- configuration.setSecurityParams(
- WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE);
- }
- configuration.enterpriseConfig = mWpa3EnterpriseConfig;
- } else if (mIsEnhancedOpen) { // OWE network
- configuration.setSecurityParams(WifiConfiguration.SECURITY_TYPE_OWE);
- } else { // Open network
- configuration.setSecurityParams(WifiConfiguration.SECURITY_TYPE_OPEN);
- }
- }
-
- /**
- * Helper method to build WifiConfiguration object from the builder.
- * @return Instance of {@link WifiConfiguration}.
- */
- private WifiConfiguration buildWifiConfiguration() {
- final WifiConfiguration wifiConfiguration = new WifiConfiguration();
- // WifiConfiguration.SSID needs quotes around unicode SSID.
- if (mSsidPatternMatcher.getType() == PatternMatcher.PATTERN_LITERAL) {
- wifiConfiguration.SSID = "\"" + mSsidPatternMatcher.getPath() + "\"";
- }
- if (mBssidPatternMatcher.second == MATCH_EXACT_BSSID_PATTERN_MASK) {
- wifiConfiguration.BSSID = mBssidPatternMatcher.first.toString();
- }
- setSecurityParamsInWifiConfiguration(wifiConfiguration);
- wifiConfiguration.hiddenSSID = mIsHiddenSSID;
- return wifiConfiguration;
- }
-
- private boolean hasSetAnyPattern() {
- return mSsidPatternMatcher != null || mBssidPatternMatcher != null;
- }
-
- private void setMatchAnyPatternIfUnset() {
- if (mSsidPatternMatcher == null) {
- mSsidPatternMatcher = new PatternMatcher(MATCH_ALL_SSID_PATTERN_PATH,
- PatternMatcher.PATTERN_SIMPLE_GLOB);
- }
- if (mBssidPatternMatcher == null) {
- mBssidPatternMatcher = MATCH_ALL_BSSID_PATTERN;
- }
- }
-
- private boolean hasSetMatchNonePattern() {
- if (mSsidPatternMatcher.getType() != PatternMatcher.PATTERN_PREFIX
- && mSsidPatternMatcher.getPath().equals(MATCH_EMPTY_SSID_PATTERN_PATH)) {
- return true;
- }
- if (mBssidPatternMatcher.equals(MATCH_NO_BSSID_PATTERN1)) {
- return true;
- }
- if (mBssidPatternMatcher.equals(MATCH_NO_BSSID_PATTERN2)) {
- return true;
- }
- return false;
- }
-
- private boolean hasSetMatchAllPattern() {
- if ((mSsidPatternMatcher.match(MATCH_EMPTY_SSID_PATTERN_PATH))
- && mBssidPatternMatcher.equals(MATCH_ALL_BSSID_PATTERN)) {
- return true;
- }
- return false;
- }
-
- private void validateSecurityParams() {
- int numSecurityTypes = 0;
- numSecurityTypes += mIsEnhancedOpen ? 1 : 0;
- numSecurityTypes += !TextUtils.isEmpty(mWpa2PskPassphrase) ? 1 : 0;
- numSecurityTypes += !TextUtils.isEmpty(mWpa3SaePassphrase) ? 1 : 0;
- numSecurityTypes += mWpa2EnterpriseConfig != null ? 1 : 0;
- numSecurityTypes += mWpa3EnterpriseConfig != null ? 1 : 0;
- if (numSecurityTypes > 1) {
- throw new IllegalStateException("only one of setIsEnhancedOpen, setWpa2Passphrase,"
- + "setWpa3Passphrase, setWpa2EnterpriseConfig or setWpa3EnterpriseConfig"
- + " can be invoked for network specifier");
- }
- }
-
- /**
- * Create a specifier object used to request a local Wi-Fi network. The generated
- * {@link NetworkSpecifier} should be used in
- * {@link NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)} when building
- * the {@link NetworkRequest}. These specifiers can only be used to request a local wifi
- * network (i.e no internet capability). So, the device will not switch it's default route
- * to wifi if there are other transports (cellular for example) available.
- *<p>
- * Note: Apps can set a combination of network match params:
- * <li> SSID Pattern using {@link #setSsidPattern(PatternMatcher)} OR Specific SSID using
- * {@link #setSsid(String)}. </li>
- * AND/OR
- * <li> BSSID Pattern using {@link #setBssidPattern(MacAddress, MacAddress)} OR Specific
- * BSSID using {@link #setBssid(MacAddress)} </li>
- * to trigger connection to a network that matches the set params.
- * The system will find the set of networks matching the request and present the user
- * with a system dialog which will allow the user to select a specific Wi-Fi network to
- * connect to or to deny the request.
- *</p>
- *
- * For example:
- * To connect to an open network with a SSID prefix of "test" and a BSSID OUI of "10:03:23":
- *
- * <pre>{@code
- * final NetworkSpecifier specifier =
- * new Builder()
- * .setSsidPattern(new PatternMatcher("test", PatterMatcher.PATTERN_PREFIX))
- * .setBssidPattern(MacAddress.fromString("10:03:23:00:00:00"),
- * MacAddress.fromString("ff:ff:ff:00:00:00"))
- * .build()
- * final NetworkRequest request =
- * new NetworkRequest.Builder()
- * .addTransportType(NetworkCapabilities.TRANSPORT_WIFI)
- * .removeCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
- * .setNetworkSpecifier(specifier)
- * .build();
- * final ConnectivityManager connectivityManager =
- * context.getSystemService(Context.CONNECTIVITY_SERVICE);
- * final NetworkCallback networkCallback = new NetworkCallback() {
- * ...
- * {@literal @}Override
- * void onAvailable(...) {}
- * // etc.
- * };
- * connectivityManager.requestNetwork(request, networkCallback);
- * }</pre>
- *
- * @return Instance of {@link NetworkSpecifier}.
- * @throws IllegalStateException on invalid params set.
- */
- public @NonNull WifiNetworkSpecifier build() {
- if (!hasSetAnyPattern()) {
- throw new IllegalStateException("one of setSsidPattern/setSsid/setBssidPattern/"
- + "setBssid should be invoked for specifier");
- }
- setMatchAnyPatternIfUnset();
- if (hasSetMatchNonePattern()) {
- throw new IllegalStateException("cannot set match-none pattern for specifier");
- }
- if (hasSetMatchAllPattern()) {
- throw new IllegalStateException("cannot set match-all pattern for specifier");
- }
- if (mIsHiddenSSID && mSsidPatternMatcher.getType() != PatternMatcher.PATTERN_LITERAL) {
- throw new IllegalStateException("setSsid should also be invoked when "
- + "setIsHiddenSsid is invoked for network specifier");
- }
- validateSecurityParams();
-
- return new WifiNetworkSpecifier(
- mSsidPatternMatcher,
- mBssidPatternMatcher,
- buildWifiConfiguration());
- }
- }
-
- /**
- * SSID pattern match specified by the app.
- * @hide
- */
- public final PatternMatcher ssidPatternMatcher;
-
- /**
- * BSSID pattern match specified by the app.
- * Pair of <BaseAddress, Mask>.
- * @hide
- */
- public final Pair<MacAddress, MacAddress> bssidPatternMatcher;
-
- /**
- * Security credentials for the network.
- * <p>
- * Note: {@link WifiConfiguration#SSID} & {@link WifiConfiguration#BSSID} fields from
- * WifiConfiguration are not used. Instead we use the {@link #ssidPatternMatcher} &
- * {@link #bssidPatternMatcher} fields embedded directly
- * within {@link WifiNetworkSpecifier}.
- * @hide
- */
- public final WifiConfiguration wifiConfiguration;
-
- /** @hide */
- public WifiNetworkSpecifier() throws IllegalAccessException {
- throw new IllegalAccessException("Use the builder to create an instance");
- }
-
- /** @hide */
- public WifiNetworkSpecifier(@NonNull PatternMatcher ssidPatternMatcher,
- @NonNull Pair<MacAddress, MacAddress> bssidPatternMatcher,
- @NonNull WifiConfiguration wifiConfiguration) {
- checkNotNull(ssidPatternMatcher);
- checkNotNull(bssidPatternMatcher);
- checkNotNull(wifiConfiguration);
-
- this.ssidPatternMatcher = ssidPatternMatcher;
- this.bssidPatternMatcher = bssidPatternMatcher;
- this.wifiConfiguration = wifiConfiguration;
- }
-
- public static final @NonNull Creator<WifiNetworkSpecifier> CREATOR =
- new Creator<WifiNetworkSpecifier>() {
- @Override
- public WifiNetworkSpecifier createFromParcel(Parcel in) {
- PatternMatcher ssidPatternMatcher = in.readParcelable(/* classLoader */null);
- MacAddress baseAddress = in.readParcelable(null);
- MacAddress mask = in.readParcelable(null);
- Pair<MacAddress, MacAddress> bssidPatternMatcher =
- Pair.create(baseAddress, mask);
- WifiConfiguration wifiConfiguration = in.readParcelable(null);
- return new WifiNetworkSpecifier(ssidPatternMatcher, bssidPatternMatcher,
- wifiConfiguration);
- }
-
- @Override
- public WifiNetworkSpecifier[] newArray(int size) {
- return new WifiNetworkSpecifier[size];
- }
- };
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeParcelable(ssidPatternMatcher, flags);
- dest.writeParcelable(bssidPatternMatcher.first, flags);
- dest.writeParcelable(bssidPatternMatcher.second, flags);
- dest.writeParcelable(wifiConfiguration, flags);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(
- ssidPatternMatcher.getPath(), ssidPatternMatcher.getType(), bssidPatternMatcher,
- wifiConfiguration.allowedKeyManagement);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!(obj instanceof WifiNetworkSpecifier)) {
- return false;
- }
- WifiNetworkSpecifier lhs = (WifiNetworkSpecifier) obj;
- return Objects.equals(this.ssidPatternMatcher.getPath(),
- lhs.ssidPatternMatcher.getPath())
- && Objects.equals(this.ssidPatternMatcher.getType(),
- lhs.ssidPatternMatcher.getType())
- && Objects.equals(this.bssidPatternMatcher,
- lhs.bssidPatternMatcher)
- && Objects.equals(this.wifiConfiguration.allowedKeyManagement,
- lhs.wifiConfiguration.allowedKeyManagement);
- }
-
- @Override
- public String toString() {
- return new StringBuilder()
- .append("WifiNetworkSpecifier [")
- .append(", SSID Match pattern=").append(ssidPatternMatcher)
- .append(", BSSID Match pattern=").append(bssidPatternMatcher)
- .append(", SSID=").append(wifiConfiguration.SSID)
- .append(", BSSID=").append(wifiConfiguration.BSSID)
- .append("]")
- .toString();
- }
-
- /** @hide */
- @Override
- public boolean canBeSatisfiedBy(NetworkSpecifier other) {
- if (other instanceof WifiNetworkAgentSpecifier) {
- return ((WifiNetworkAgentSpecifier) other).satisfiesNetworkSpecifier(this);
- }
- // Specific requests are checked for equality although testing for equality of 2 patterns do
- // not make much sense!
- return equals(other);
- }
-}
diff --git a/wifi/java/android/net/wifi/WifiNetworkSuggestion.java b/wifi/java/android/net/wifi/WifiNetworkSuggestion.java
deleted file mode 100644
index b7450c5..0000000
--- a/wifi/java/android/net/wifi/WifiNetworkSuggestion.java
+++ /dev/null
@@ -1,1406 +0,0 @@
-/*
- * 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.net.wifi;
-
-import static com.android.internal.util.Preconditions.checkNotNull;
-
-import android.annotation.IntRange;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.RequiresPermission;
-import android.annotation.SystemApi;
-import android.net.MacAddress;
-import android.net.NetworkCapabilities;
-import android.net.NetworkRequest;
-import android.net.wifi.hotspot2.PasspointConfiguration;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.telephony.SubscriptionInfo;
-import android.telephony.SubscriptionManager;
-import android.telephony.TelephonyManager;
-import android.text.TextUtils;
-
-import com.android.modules.utils.build.SdkLevel;
-
-import java.nio.charset.CharsetEncoder;
-import java.nio.charset.StandardCharsets;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * The Network Suggestion object is used to provide a Wi-Fi network for consideration when
- * auto-connecting to networks. Apps cannot directly create this object, they must use
- * {@link WifiNetworkSuggestion.Builder#build()} to obtain an instance of this object.
- *<p>
- * Apps can provide a list of such networks to the platform using
- * {@link WifiManager#addNetworkSuggestions(List)}.
- */
-public final class WifiNetworkSuggestion implements Parcelable {
- /**
- * Builder used to create {@link WifiNetworkSuggestion} objects.
- */
- public static final class Builder {
- private static final int UNASSIGNED_PRIORITY = -1;
-
- /**
- * Set WPA Enterprise type according to certificate security level.
- * This is for backward compatibility in R.
- */
- private static final int WPA3_ENTERPRISE_AUTO = 0;
- /** Set WPA Enterprise type to standard mode only. */
- private static final int WPA3_ENTERPRISE_STANDARD = 1;
- /** Set WPA Enterprise type to 192 bit mode only. */
- private static final int WPA3_ENTERPRISE_192_BIT = 2;
-
- /**
- * SSID of the network.
- */
- private String mSsid;
- /**
- * Optional BSSID within the network.
- */
- private MacAddress mBssid;
- /**
- * Whether this is an OWE network or not.
- */
- private boolean mIsEnhancedOpen;
- /**
- * Pre-shared key for use with WPA-PSK networks.
- */
- private @Nullable String mWpa2PskPassphrase;
- /**
- * Pre-shared key for use with WPA3-SAE networks.
- */
- private @Nullable String mWpa3SaePassphrase;
- /**
- * The enterprise configuration details specifying the EAP method,
- * certificates and other settings associated with the WPA/WPA2-Enterprise networks.
- */
- private @Nullable WifiEnterpriseConfig mWpa2EnterpriseConfig;
- /**
- * The enterprise configuration details specifying the EAP method,
- * certificates and other settings associated with the WPA3-Enterprise networks.
- */
- private @Nullable WifiEnterpriseConfig mWpa3EnterpriseConfig;
- /**
- * Indicate what type this WPA3-Enterprise network is.
- */
- private int mWpa3EnterpriseType = WPA3_ENTERPRISE_AUTO;
- /**
- * The passpoint config for use with Hotspot 2.0 network
- */
- private @Nullable PasspointConfiguration mPasspointConfiguration;
- /**
- * This is a network that does not broadcast its SSID, so an
- * SSID-specific probe request must be used for scans.
- */
- private boolean mIsHiddenSSID;
- /**
- * Whether app needs to log in to captive portal to obtain Internet access.
- */
- private boolean mIsAppInteractionRequired;
- /**
- * Whether user needs to log in to captive portal to obtain Internet access.
- */
- private boolean mIsUserInteractionRequired;
- /**
- * Whether this network is metered or not.
- */
- private int mMeteredOverride;
- /**
- * Priority of this network among other network suggestions from same priority group
- * provided by the app.
- * The lower the number, the higher the priority (i.e value of 0 = highest priority).
- */
- private int mPriority;
- /**
- * Priority group ID, while suggestion priority will only effect inside the priority group.
- */
- private int mPriorityGroup;
-
- /**
- * The carrier ID identifies the operator who provides this network configuration.
- * see {@link TelephonyManager#getSimCarrierId()}
- */
- private int mCarrierId;
-
- /**
- * The Subscription ID identifies the SIM card for which this network configuration is
- * valid.
- */
- private int mSubscriptionId;
-
- /**
- * Whether this network is shared credential with user to allow user manually connect.
- */
- private boolean mIsSharedWithUser;
-
- /**
- * Whether the setCredentialSharedWithUser have been called.
- */
- private boolean mIsSharedWithUserSet;
-
- /**
- * Whether this network is initialized with auto-join enabled (the default) or not.
- */
- private boolean mIsInitialAutojoinEnabled;
-
- /**
- * Pre-shared key for use with WAPI-PSK networks.
- */
- private @Nullable String mWapiPskPassphrase;
-
- /**
- * The enterprise configuration details specifying the EAP method,
- * certificates and other settings associated with the WAPI networks.
- */
- private @Nullable WifiEnterpriseConfig mWapiEnterpriseConfig;
-
- /**
- * Whether this network will be brought up as untrusted (TRUSTED capability bit removed).
- */
- private boolean mIsNetworkUntrusted;
-
- /**
- * Whether this network will be brought up as OEM paid (OEM_PAID capability bit added).
- */
- private boolean mIsNetworkOemPaid;
-
- /**
- * Whether this network will be brought up as OEM private (OEM_PRIVATE capability bit
- * added).
- */
- private boolean mIsNetworkOemPrivate;
-
- /**
- * Whether this network is a carrier merged network.
- */
- private boolean mIsCarrierMerged;
-
- /**
- * Whether this network will use enhanced MAC randomization.
- */
- private boolean mIsEnhancedMacRandomizationEnabled;
-
- public Builder() {
- mSsid = null;
- mBssid = null;
- mIsEnhancedOpen = false;
- mWpa2PskPassphrase = null;
- mWpa3SaePassphrase = null;
- mWpa2EnterpriseConfig = null;
- mWpa3EnterpriseConfig = null;
- mPasspointConfiguration = null;
- mIsHiddenSSID = false;
- mIsAppInteractionRequired = false;
- mIsUserInteractionRequired = false;
- mMeteredOverride = WifiConfiguration.METERED_OVERRIDE_NONE;
- mIsSharedWithUser = true;
- mIsSharedWithUserSet = false;
- mIsInitialAutojoinEnabled = true;
- mPriority = UNASSIGNED_PRIORITY;
- mCarrierId = TelephonyManager.UNKNOWN_CARRIER_ID;
- mWapiPskPassphrase = null;
- mWapiEnterpriseConfig = null;
- mIsNetworkUntrusted = false;
- mIsNetworkOemPaid = false;
- mIsNetworkOemPrivate = false;
- mIsCarrierMerged = false;
- mPriorityGroup = 0;
- mIsEnhancedMacRandomizationEnabled = false;
- mSubscriptionId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
- }
-
- /**
- * Set the unicode SSID for the network.
- * <p>
- * <li>Overrides any previous value set using {@link #setSsid(String)}.</li>
- *
- * @param ssid The SSID of the network. It must be valid Unicode.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- * @throws IllegalArgumentException if the SSID is not valid unicode.
- */
- public @NonNull Builder setSsid(@NonNull String ssid) {
- checkNotNull(ssid);
- final CharsetEncoder unicodeEncoder = StandardCharsets.UTF_8.newEncoder();
- if (!unicodeEncoder.canEncode(ssid)) {
- throw new IllegalArgumentException("SSID is not a valid unicode string");
- }
- mSsid = new String(ssid);
- return this;
- }
-
- /**
- * Set the BSSID to use for filtering networks from scan results. Will only match network
- * whose BSSID is identical to the specified value.
- * <p>
- * <li Sets a specific BSSID for the network suggestion. If set, only the specified BSSID
- * with the specified SSID will be considered for connection.
- * <li>If set, only the specified BSSID with the specified SSID will be considered for
- * connection.</li>
- * <li>If not set, all BSSIDs with the specified SSID will be considered for connection.
- * </li>
- * <li>Overrides any previous value set using {@link #setBssid(MacAddress)}.</li>
- *
- * @param bssid BSSID of the network.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setBssid(@NonNull MacAddress bssid) {
- checkNotNull(bssid);
- mBssid = MacAddress.fromBytes(bssid.toByteArray());
- return this;
- }
-
- /**
- * Specifies whether this represents an Enhanced Open (OWE) network.
- *
- * @param isEnhancedOpen {@code true} to indicate that the network used enhanced open,
- * {@code false} otherwise.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setIsEnhancedOpen(boolean isEnhancedOpen) {
- mIsEnhancedOpen = isEnhancedOpen;
- return this;
- }
-
- /**
- * Set the ASCII WPA2 passphrase for this network. Needed for authenticating to
- * WPA2-PSK networks.
- *
- * @param passphrase passphrase of the network.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- * @throws IllegalArgumentException if the passphrase is not ASCII encodable.
- */
- public @NonNull Builder setWpa2Passphrase(@NonNull String passphrase) {
- checkNotNull(passphrase);
- final CharsetEncoder asciiEncoder = StandardCharsets.US_ASCII.newEncoder();
- if (!asciiEncoder.canEncode(passphrase)) {
- throw new IllegalArgumentException("passphrase not ASCII encodable");
- }
- mWpa2PskPassphrase = passphrase;
- return this;
- }
-
- /**
- * Set the ASCII WPA3 passphrase for this network. Needed for authenticating to WPA3-SAE
- * networks.
- *
- * @param passphrase passphrase of the network.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- * @throws IllegalArgumentException if the passphrase is not ASCII encodable.
- */
- public @NonNull Builder setWpa3Passphrase(@NonNull String passphrase) {
- checkNotNull(passphrase);
- final CharsetEncoder asciiEncoder = StandardCharsets.US_ASCII.newEncoder();
- if (!asciiEncoder.canEncode(passphrase)) {
- throw new IllegalArgumentException("passphrase not ASCII encodable");
- }
- mWpa3SaePassphrase = passphrase;
- return this;
- }
-
- /**
- * Set the associated enterprise configuration for this network. Needed for authenticating
- * to WPA2 enterprise networks. See {@link WifiEnterpriseConfig} for description.
- *
- * @param enterpriseConfig Instance of {@link WifiEnterpriseConfig}.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- * @throws IllegalArgumentException if configuration CA certificate or
- * AltSubjectMatch/DomainSuffixMatch is not set.
- */
- public @NonNull Builder setWpa2EnterpriseConfig(
- @NonNull WifiEnterpriseConfig enterpriseConfig) {
- checkNotNull(enterpriseConfig);
- if (enterpriseConfig.isInsecure()) {
- throw new IllegalArgumentException("Enterprise configuration is insecure");
- }
- mWpa2EnterpriseConfig = new WifiEnterpriseConfig(enterpriseConfig);
- return this;
- }
-
- /**
- * Set the associated enterprise configuration for this network. Needed for authenticating
- * to WPA3-Enterprise networks (standard and 192-bit security). See
- * {@link WifiEnterpriseConfig} for description. For 192-bit security networks, both the
- * client and CA certificates must be provided, and must be of type of either
- * sha384WithRSAEncryption (OID 1.2.840.113549.1.1.12) or ecdsa-with-SHA384
- * (OID 1.2.840.10045.4.3.3).
- *
- * @deprecated use {@link #setWpa3EnterpriseStandardModeConfig(WifiEnterpriseConfig)} or
- * {@link #setWpa3Enterprise192BitModeConfig(WifiEnterpriseConfig)} to specify
- * WPA3-Enterprise type explicitly.
- *
- * @param enterpriseConfig Instance of {@link WifiEnterpriseConfig}.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- * @throws IllegalArgumentException if configuration CA certificate or
- * AltSubjectMatch/DomainSuffixMatch is not set.
- */
- @Deprecated
- public @NonNull Builder setWpa3EnterpriseConfig(
- @NonNull WifiEnterpriseConfig enterpriseConfig) {
- checkNotNull(enterpriseConfig);
- if (enterpriseConfig.isInsecure()) {
- throw new IllegalArgumentException("Enterprise configuration is insecure");
- }
- mWpa3EnterpriseConfig = new WifiEnterpriseConfig(enterpriseConfig);
- return this;
- }
-
- /**
- * Set the associated enterprise configuration for this network. Needed for authenticating
- * to WPA3-Enterprise standard networks. See {@link WifiEnterpriseConfig} for description.
- * For WPA3-Enterprise in 192-bit security mode networks,
- * see {@link #setWpa3Enterprise192BitModeConfig(WifiEnterpriseConfig)} for description.
- *
- * @param enterpriseConfig Instance of {@link WifiEnterpriseConfig}.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- * @throws IllegalArgumentException if configuration CA certificate or
- * AltSubjectMatch/DomainSuffixMatch is not set.
- */
- public @NonNull Builder setWpa3EnterpriseStandardModeConfig(
- @NonNull WifiEnterpriseConfig enterpriseConfig) {
- checkNotNull(enterpriseConfig);
- if (enterpriseConfig.isInsecure()) {
- throw new IllegalArgumentException("Enterprise configuration is insecure");
- }
- mWpa3EnterpriseConfig = new WifiEnterpriseConfig(enterpriseConfig);
- mWpa3EnterpriseType = WPA3_ENTERPRISE_STANDARD;
- return this;
- }
-
- /**
- * Set the associated enterprise configuration for this network. Needed for authenticating
- * to WPA3-Enterprise in 192-bit security mode networks. See {@link WifiEnterpriseConfig}
- * for description. Both the client and CA certificates must be provided,
- * and must be of type of either sha384WithRSAEncryption with key length of 3072bit or
- * more (OID 1.2.840.113549.1.1.12), or ecdsa-with-SHA384 with key length of 384bit or
- * more (OID 1.2.840.10045.4.3.3).
- *
- * @param enterpriseConfig Instance of {@link WifiEnterpriseConfig}.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- * @throws IllegalArgumentException if the EAP type or certificates do not
- * meet 192-bit mode requirements.
- */
- public @NonNull Builder setWpa3Enterprise192BitModeConfig(
- @NonNull WifiEnterpriseConfig enterpriseConfig) {
- checkNotNull(enterpriseConfig);
- if (enterpriseConfig.getEapMethod() != WifiEnterpriseConfig.Eap.TLS) {
- throw new IllegalArgumentException("The 192-bit mode network type must be TLS");
- }
- if (!WifiEnterpriseConfig.isSuiteBCipherCert(
- enterpriseConfig.getClientCertificate())) {
- throw new IllegalArgumentException(
- "The client certificate does not meet 192-bit mode requirements.");
- }
- if (!WifiEnterpriseConfig.isSuiteBCipherCert(
- enterpriseConfig.getCaCertificate())) {
- throw new IllegalArgumentException(
- "The CA certificate does not meet 192-bit mode requirements.");
- }
-
- mWpa3EnterpriseConfig = new WifiEnterpriseConfig(enterpriseConfig);
- mWpa3EnterpriseType = WPA3_ENTERPRISE_192_BIT;
- return this;
- }
-
- /**
- * Set the associated Passpoint configuration for this network. Needed for authenticating
- * to Hotspot 2.0 networks. See {@link PasspointConfiguration} for description.
- *
- * @param passpointConfig Instance of {@link PasspointConfiguration}.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- * @throws IllegalArgumentException if passpoint configuration is invalid.
- */
- public @NonNull Builder setPasspointConfig(
- @NonNull PasspointConfiguration passpointConfig) {
- checkNotNull(passpointConfig);
- if (!passpointConfig.validate()) {
- throw new IllegalArgumentException("Passpoint configuration is invalid");
- }
- mPasspointConfiguration = passpointConfig;
- return this;
- }
-
- /**
- * Set the carrier ID of the network operator. The carrier ID associates a Suggested
- * network with a specific carrier (and therefore SIM). The carrier ID must be provided
- * for any network which uses the SIM-based authentication: e.g. EAP-SIM, EAP-AKA,
- * EAP-AKA', and EAP-PEAP with SIM-based phase 2 authentication.
- * @param carrierId see {@link TelephonyManager#getSimCarrierId()}.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_CARRIER_PROVISIONING)
- public @NonNull Builder setCarrierId(int carrierId) {
- mCarrierId = carrierId;
- return this;
- }
-
- /**
- * Set the subscription ID of the SIM card for which this suggestion is targeted.
- * The suggestion will only apply to that SIM card.
- * <p>
- * The subscription ID must belong to a carrier ID which meets either of the following
- * conditions:
- * <li>The carrier ID specified by the cross carrier provider, or</li>
- * <li>The carrier ID which is used to validate the suggesting carrier-privileged app, see
- * {@link TelephonyManager#hasCarrierPrivileges()}</li>
- *
- * @param subId subscription ID see {@link SubscriptionInfo#getSubscriptionId()}
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setSubscriptionId(int subId) {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- mSubscriptionId = subId;
- return this;
- }
-
- /**
- * Set the priority group ID, {@link #setPriority(int)} will only impact the network
- * suggestions from the same priority group within the same app.
- *
- * @param priorityGroup priority group id, if not set default is 0.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setPriorityGroup(int priorityGroup) {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- mPriorityGroup = priorityGroup;
- return this;
- }
-
- /**
- * Set the ASCII WAPI passphrase for this network. Needed for authenticating to
- * WAPI-PSK networks.
- *
- * @param passphrase passphrase of the network.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- * @throws IllegalArgumentException if the passphrase is not ASCII encodable.
- *
- */
- public @NonNull Builder setWapiPassphrase(@NonNull String passphrase) {
- checkNotNull(passphrase);
- final CharsetEncoder asciiEncoder = StandardCharsets.US_ASCII.newEncoder();
- if (!asciiEncoder.canEncode(passphrase)) {
- throw new IllegalArgumentException("passphrase not ASCII encodable");
- }
- mWapiPskPassphrase = passphrase;
- return this;
- }
-
- /**
- * Set the associated enterprise configuration for this network. Needed for authenticating
- * to WAPI-CERT networks. See {@link WifiEnterpriseConfig} for description.
- *
- * @param enterpriseConfig Instance of {@link WifiEnterpriseConfig}.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setWapiEnterpriseConfig(
- @NonNull WifiEnterpriseConfig enterpriseConfig) {
- checkNotNull(enterpriseConfig);
- mWapiEnterpriseConfig = new WifiEnterpriseConfig(enterpriseConfig);
- return this;
- }
-
- /**
- * Specifies whether this represents a hidden network.
- * <p>
- * <li>If not set, defaults to false (i.e not a hidden network).</li>
- *
- * @param isHiddenSsid {@code true} to indicate that the network is hidden, {@code false}
- * otherwise.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setIsHiddenSsid(boolean isHiddenSsid) {
- mIsHiddenSSID = isHiddenSsid;
- return this;
- }
-
- /**
- * Specifies the MAC randomization method.
- * <p>
- * Suggested networks will never use the device (factory) MAC address to associate to the
- * network - instead they use a locally generated random MAC address. This method controls
- * the strategy for generating the random MAC address:
- * <li> Persisted MAC randomization (false - the default): generates the MAC address from a
- * secret seed and information from the Wi-Fi configuration (SSID or Passpoint profile).
- * This means that the same generated MAC address will be used for each subsequent
- * association. </li>
- * <li> Enhanced MAC randomization (true): periodically generates a new MAC
- * address for new connections. Under this option, the randomized MAC address should change
- * if the suggestion is removed and then added back. </li>
- *
- * @param enabled {@code true} to periodically change the randomized MAC address.
- * {@code false} to use the same randomized MAC for all connections to this
- * network.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setIsEnhancedMacRandomizationEnabled(boolean enabled) {
- mIsEnhancedMacRandomizationEnabled = enabled;
- return this;
- }
-
- /**
- * Specifies whether the app needs to log in to a captive portal to obtain Internet access.
- * <p>
- * This will dictate if the directed broadcast
- * {@link WifiManager#ACTION_WIFI_NETWORK_SUGGESTION_POST_CONNECTION} will be sent to the
- * app after successfully connecting to the network.
- * Use this for captive portal type networks where the app needs to authenticate the user
- * before the device can access the network.
- * <p>
- * <li>If not set, defaults to false (i.e no app interaction required).</li>
- *
- * @param isAppInteractionRequired {@code true} to indicate that app interaction is
- * required, {@code false} otherwise.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setIsAppInteractionRequired(boolean isAppInteractionRequired) {
- mIsAppInteractionRequired = isAppInteractionRequired;
- return this;
- }
-
- /**
- * Specifies whether the user needs to log in to a captive portal to obtain Internet access.
- * <p>
- * <li>If not set, defaults to false (i.e no user interaction required).</li>
- *
- * @param isUserInteractionRequired {@code true} to indicate that user interaction is
- * required, {@code false} otherwise.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setIsUserInteractionRequired(boolean isUserInteractionRequired) {
- mIsUserInteractionRequired = isUserInteractionRequired;
- return this;
- }
-
- /**
- * Specify the priority of this network among other network suggestions provided by the same
- * app (priorities have no impact on suggestions by different apps) and within the same
- * priority group, see {@link #setPriorityGroup(int)}.
- * The higher the number, the higher the priority (i.e value of 0 = lowest priority).
- * <p>
- * <li>If not set, defaults a lower priority than any assigned priority.</li>
- *
- * @param priority Integer number representing the priority among suggestions by the app.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- * @throws IllegalArgumentException if the priority value is negative.
- */
- public @NonNull Builder setPriority(@IntRange(from = 0) int priority) {
- if (priority < 0) {
- throw new IllegalArgumentException("Invalid priority value " + priority);
- }
- mPriority = priority;
- return this;
- }
-
- /**
- * Specifies whether this network is metered.
- * <p>
- * <li>If not set, defaults to detect automatically.</li>
- *
- * @param isMetered {@code true} to indicate that the network is metered, {@code false}
- * for not metered.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setIsMetered(boolean isMetered) {
- if (isMetered) {
- mMeteredOverride = WifiConfiguration.METERED_OVERRIDE_METERED;
- } else {
- mMeteredOverride = WifiConfiguration.METERED_OVERRIDE_NOT_METERED;
- }
- return this;
- }
-
- /**
- * Specifies whether the network credentials provided with this suggestion can be used by
- * the user to explicitly (manually) connect to this network. If true this network will
- * appear in the Wi-Fi Picker (in Settings) and the user will be able to select and connect
- * to it with the provided credentials. If false, the user will need to enter network
- * credentials and the resulting configuration will become a user saved network.
- * <p>
- * <li>Note: Only valid for secure (non-open) networks.
- * <li>If not set, defaults to true (i.e. allow user to manually connect) for secure
- * networks and false for open networks.</li>
- *
- * @param isShared {@code true} to indicate that the credentials may be used by the user to
- * manually connect to the network, {@code false} otherwise.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setCredentialSharedWithUser(boolean isShared) {
- mIsSharedWithUser = isShared;
- mIsSharedWithUserSet = true;
- return this;
- }
-
- /**
- * Specifies whether the suggestion is created with auto-join enabled or disabled. The
- * user may modify the auto-join configuration of a suggestion directly once the device
- * associates to the network.
- * <p>
- * If auto-join is initialized as disabled the user may still be able to manually connect
- * to the network. Therefore, disabling auto-join only makes sense if
- * {@link #setCredentialSharedWithUser(boolean)} is set to true (the default) which
- * itself implies a secure (non-open) network.
- * <p>
- * If not set, defaults to true (i.e. auto-join is initialized as enabled).
- *
- * @param enabled true for initializing with auto-join enabled (the default), false to
- * initializing with auto-join disabled.
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setIsInitialAutojoinEnabled(boolean enabled) {
- mIsInitialAutojoinEnabled = enabled;
- return this;
- }
-
- /**
- * Specifies whether the system will bring up the network (if selected) as untrusted. An
- * untrusted network has its {@link NetworkCapabilities#NET_CAPABILITY_TRUSTED}
- * capability removed. The Wi-Fi network selection process may use this information to
- * influence priority of the suggested network for Wi-Fi network selection (most likely to
- * reduce it). The connectivity service may use this information to influence the overall
- * network configuration of the device.
- * <p>
- * <li> These suggestions are only considered for network selection if a
- * {@link NetworkRequest} without {@link NetworkCapabilities#NET_CAPABILITY_TRUSTED}
- * capability is filed.
- * <li> An untrusted network's credentials may not be shared with the user using
- * {@link #setCredentialSharedWithUser(boolean)}.</li>
- * <li> If not set, defaults to false (i.e. network is trusted).</li>
- *
- * @param isUntrusted Boolean indicating whether the network should be brought up untrusted
- * (if true) or trusted (if false).
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setUntrusted(boolean isUntrusted) {
- mIsNetworkUntrusted = isUntrusted;
- return this;
- }
-
- /**
- * Specifies whether the system will bring up the network (if selected) as OEM paid. An
- * OEM paid network has {@link NetworkCapabilities#NET_CAPABILITY_OEM_PAID} capability
- * added.
- * Note:
- * <li>The connectivity service may use this information to influence the overall
- * network configuration of the device. This network is typically only available to system
- * apps.
- * <li>On devices which do not support concurrent connection (indicated via
- * {@link WifiManager#isMultiStaConcurrencySupported()}, Wi-Fi network selection process may
- * use this information to influence priority of the suggested network for Wi-Fi network
- * selection (most likely to reduce it).
- * <li>On devices which support more than 1 concurrent connections (indicated via
- * {@link WifiManager#isMultiStaConcurrencySupported()}, these OEM paid networks will be
- * brought up as a secondary concurrent connection (primary connection will be used
- * for networks available to the user and all apps.
- * <p>
- * <li> An OEM paid network's credentials may not be shared with the user using
- * {@link #setCredentialSharedWithUser(boolean)}.</li>
- * <li> These suggestions are only considered for network selection if a
- * {@link NetworkRequest} with {@link NetworkCapabilities#NET_CAPABILITY_OEM_PAID}
- * capability is filed.
- * <li> Each suggestion can have both {@link #setOemPaid(boolean)} and
- * {@link #setOemPrivate(boolean)} set if the app wants these suggestions considered
- * for creating either an OEM paid network or OEM private network determined based on
- * the {@link NetworkRequest} that is active.
- * <li> If not set, defaults to false (i.e. network is not OEM paid).</li>
- *
- * @param isOemPaid Boolean indicating whether the network should be brought up as OEM paid
- * (if true) or not OEM paid (if false).
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- * @hide
- */
- @SystemApi
- public @NonNull Builder setOemPaid(boolean isOemPaid) {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- mIsNetworkOemPaid = isOemPaid;
- return this;
- }
-
- /**
- * Specifies whether the system will bring up the network (if selected) as OEM private. An
- * OEM private network has {@link NetworkCapabilities#NET_CAPABILITY_OEM_PRIVATE} capability
- * added.
- * Note:
- * <li>The connectivity service may use this information to influence the overall
- * network configuration of the device. This network is typically only available to system
- * apps.
- * <li>On devices which do not support concurrent connection (indicated via
- * {@link WifiManager#isMultiStaConcurrencySupported()}, Wi-Fi network selection process may
- * use this information to influence priority of the suggested network for Wi-Fi network
- * selection (most likely to reduce it).
- * <li>On devices which support more than 1 concurrent connections (indicated via
- * {@link WifiManager#isMultiStaConcurrencySupported()}, these OEM private networks will be
- * brought up as a secondary concurrent connection (primary connection will be used
- * for networks available to the user and all apps.
- * <p>
- * <li> An OEM private network's credentials may not be shared with the user using
- * {@link #setCredentialSharedWithUser(boolean)}.</li>
- * <li> These suggestions are only considered for network selection if a
- * {@link NetworkRequest} with {@link NetworkCapabilities#NET_CAPABILITY_OEM_PRIVATE}
- * capability is filed.
- * <li> Each suggestion can have both {@link #setOemPaid(boolean)} and
- * {@link #setOemPrivate(boolean)} set if the app wants these suggestions considered
- * for creating either an OEM paid network or OEM private network determined based on
- * the {@link NetworkRequest} that is active.
- * <li> If not set, defaults to false (i.e. network is not OEM private).</li>
- *
- * @param isOemPrivate Boolean indicating whether the network should be brought up as OEM
- * private (if true) or not OEM private (if false).
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- * @hide
- */
- @SystemApi
- public @NonNull Builder setOemPrivate(boolean isOemPrivate) {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- mIsNetworkOemPrivate = isOemPrivate;
- return this;
- }
-
- /**
- * Specifies whether the suggestion represents a carrier merged network. A carrier merged
- * Wi-Fi network is treated as part of the mobile carrier network. Such configuration may
- * impact the user interface and data usage accounting.
- * <p>
- * <li>A suggestion marked as carrier merged must be metered enterprise network with a valid
- * subscription Id set.
- * @see #setIsMetered(boolean)
- * @see #setSubscriptionId(int)
- * @see #setWpa2EnterpriseConfig(WifiEnterpriseConfig)
- * @see #setWpa3Enterprise192BitModeConfig(WifiEnterpriseConfig)
- * @see #setWpa3EnterpriseStandardModeConfig(WifiEnterpriseConfig)
- * @see #setPasspointConfig(PasspointConfiguration)
- * </li>
- * <li>If not set, defaults to false (i.e. not a carrier merged network.)</li>
- * </p>
- * @param isCarrierMerged Boolean indicating whether the network is treated a carrier
- * merged network (if true) or non-merged network (if false);
- * @return Instance of {@link Builder} to enable chaining of the builder method.
- */
- public @NonNull Builder setCarrierMerged(boolean isCarrierMerged) {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- mIsCarrierMerged = isCarrierMerged;
- return this;
- }
-
- private void setSecurityParamsInWifiConfiguration(
- @NonNull WifiConfiguration configuration) {
- if (!TextUtils.isEmpty(mWpa2PskPassphrase)) { // WPA-PSK network.
- configuration.setSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
- // WifiConfiguration.preSharedKey needs quotes around ASCII password.
- configuration.preSharedKey = "\"" + mWpa2PskPassphrase + "\"";
- } else if (!TextUtils.isEmpty(mWpa3SaePassphrase)) { // WPA3-SAE network.
- configuration.setSecurityParams(WifiConfiguration.SECURITY_TYPE_SAE);
- // WifiConfiguration.preSharedKey needs quotes around ASCII password.
- configuration.preSharedKey = "\"" + mWpa3SaePassphrase + "\"";
- } else if (mWpa2EnterpriseConfig != null) { // WPA-EAP network
- configuration.setSecurityParams(WifiConfiguration.SECURITY_TYPE_EAP);
- configuration.enterpriseConfig = mWpa2EnterpriseConfig;
- } else if (mWpa3EnterpriseConfig != null) { // WPA3-Enterprise
- if (mWpa3EnterpriseType == WPA3_ENTERPRISE_AUTO
- && mWpa3EnterpriseConfig.getEapMethod() == WifiEnterpriseConfig.Eap.TLS
- && WifiEnterpriseConfig.isSuiteBCipherCert(
- mWpa3EnterpriseConfig.getClientCertificate())
- && WifiEnterpriseConfig.isSuiteBCipherCert(
- mWpa3EnterpriseConfig.getCaCertificate())) {
- // WPA3-Enterprise in 192-bit security mode
- configuration.setSecurityParams(
- WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT);
- } else if (mWpa3EnterpriseType == WPA3_ENTERPRISE_192_BIT) {
- // WPA3-Enterprise in 192-bit security mode
- configuration.setSecurityParams(
- WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT);
- } else {
- // WPA3-Enterprise
- configuration.setSecurityParams(
- WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE);
- }
- configuration.enterpriseConfig = mWpa3EnterpriseConfig;
- } else if (mIsEnhancedOpen) { // OWE network
- configuration.setSecurityParams(WifiConfiguration.SECURITY_TYPE_OWE);
- } else if (!TextUtils.isEmpty(mWapiPskPassphrase)) { // WAPI-PSK network.
- configuration.setSecurityParams(WifiConfiguration.SECURITY_TYPE_WAPI_PSK);
- // WifiConfiguration.preSharedKey needs quotes around ASCII password.
- configuration.preSharedKey = "\"" + mWapiPskPassphrase + "\"";
- } else if (mWapiEnterpriseConfig != null) { // WAPI-CERT network
- configuration.setSecurityParams(WifiConfiguration.SECURITY_TYPE_WAPI_CERT);
- configuration.enterpriseConfig = mWapiEnterpriseConfig;
- } else { // Open network
- configuration.setSecurityParams(WifiConfiguration.SECURITY_TYPE_OPEN);
- }
- }
-
- /**
- * Helper method to build WifiConfiguration object from the builder.
- * @return Instance of {@link WifiConfiguration}.
- */
- private WifiConfiguration buildWifiConfiguration() {
- final WifiConfiguration wifiConfiguration = new WifiConfiguration();
- // WifiConfiguration.SSID needs quotes around unicode SSID.
- wifiConfiguration.SSID = "\"" + mSsid + "\"";
- if (mBssid != null) {
- wifiConfiguration.BSSID = mBssid.toString();
- }
-
- setSecurityParamsInWifiConfiguration(wifiConfiguration);
-
- wifiConfiguration.hiddenSSID = mIsHiddenSSID;
- wifiConfiguration.priority = mPriority;
- wifiConfiguration.meteredOverride = mMeteredOverride;
- wifiConfiguration.carrierId = mCarrierId;
- wifiConfiguration.trusted = !mIsNetworkUntrusted;
- wifiConfiguration.oemPaid = mIsNetworkOemPaid;
- wifiConfiguration.oemPrivate = mIsNetworkOemPrivate;
- wifiConfiguration.carrierMerged = mIsCarrierMerged;
- wifiConfiguration.macRandomizationSetting = mIsEnhancedMacRandomizationEnabled
- ? WifiConfiguration.RANDOMIZATION_ENHANCED
- : WifiConfiguration.RANDOMIZATION_PERSISTENT;
- wifiConfiguration.subscriptionId = mSubscriptionId;
- return wifiConfiguration;
- }
-
- private void validateSecurityParams() {
- int numSecurityTypes = 0;
- numSecurityTypes += mIsEnhancedOpen ? 1 : 0;
- numSecurityTypes += !TextUtils.isEmpty(mWpa2PskPassphrase) ? 1 : 0;
- numSecurityTypes += !TextUtils.isEmpty(mWpa3SaePassphrase) ? 1 : 0;
- numSecurityTypes += !TextUtils.isEmpty(mWapiPskPassphrase) ? 1 : 0;
- numSecurityTypes += mWpa2EnterpriseConfig != null ? 1 : 0;
- numSecurityTypes += mWpa3EnterpriseConfig != null ? 1 : 0;
- numSecurityTypes += mWapiEnterpriseConfig != null ? 1 : 0;
- numSecurityTypes += mPasspointConfiguration != null ? 1 : 0;
- if (numSecurityTypes > 1) {
- throw new IllegalStateException("only one of setIsEnhancedOpen, setWpa2Passphrase,"
- + " setWpa3Passphrase, setWpa2EnterpriseConfig, setWpa3EnterpriseConfig"
- + " setWapiPassphrase, setWapiCertSuite, setIsWapiCertSuiteAuto"
- + " or setPasspointConfig can be invoked for network suggestion");
- }
- }
-
- private WifiConfiguration buildWifiConfigurationForPasspoint() {
- WifiConfiguration wifiConfiguration = new WifiConfiguration();
- wifiConfiguration.FQDN = mPasspointConfiguration.getHomeSp().getFqdn();
- wifiConfiguration.setPasspointUniqueId(mPasspointConfiguration.getUniqueId());
- wifiConfiguration.priority = mPriority;
- wifiConfiguration.meteredOverride = mMeteredOverride;
- wifiConfiguration.trusted = !mIsNetworkUntrusted;
- wifiConfiguration.oemPaid = mIsNetworkOemPaid;
- wifiConfiguration.oemPrivate = mIsNetworkOemPrivate;
- wifiConfiguration.carrierMerged = mIsCarrierMerged;
- wifiConfiguration.subscriptionId = mSubscriptionId;
- mPasspointConfiguration.setCarrierId(mCarrierId);
- mPasspointConfiguration.setSubscriptionId(mSubscriptionId);
- mPasspointConfiguration.setMeteredOverride(wifiConfiguration.meteredOverride);
- mPasspointConfiguration.setOemPrivate(mIsNetworkOemPrivate);
- mPasspointConfiguration.setOemPaid(mIsNetworkOemPaid);
- mPasspointConfiguration.setCarrierMerged(mIsCarrierMerged);
- wifiConfiguration.macRandomizationSetting = mIsEnhancedMacRandomizationEnabled
- ? WifiConfiguration.RANDOMIZATION_ENHANCED
- : WifiConfiguration.RANDOMIZATION_PERSISTENT;
- return wifiConfiguration;
- }
-
- /**
- * Create a network suggestion object for use in
- * {@link WifiManager#addNetworkSuggestions(List)}.
- *
- *<p class="note">
- * <b>Note:</b> Apps can set a combination of SSID using {@link #setSsid(String)} and BSSID
- * using {@link #setBssid(MacAddress)} to provide more fine grained network suggestions to
- * the platform.
- * </p>
- *
- * For example:
- * To provide credentials for one open, one WPA2, one WPA3 network with their
- * corresponding SSID's and one with Passpoint config:
- *
- * <pre>{@code
- * final WifiNetworkSuggestion suggestion1 =
- * new Builder()
- * .setSsid("test111111")
- * .build();
- * final WifiNetworkSuggestion suggestion2 =
- * new Builder()
- * .setSsid("test222222")
- * .setWpa2Passphrase("test123456")
- * .build();
- * final WifiNetworkSuggestion suggestion3 =
- * new Builder()
- * .setSsid("test333333")
- * .setWpa3Passphrase("test6789")
- * .build();
- * final PasspointConfiguration passpointConfig= new PasspointConfiguration();
- * // configure passpointConfig to include a valid Passpoint configuration
- * final WifiNetworkSuggestion suggestion4 =
- * new Builder()
- * .setPasspointConfig(passpointConfig)
- * .build();
- * final List<WifiNetworkSuggestion> suggestionsList =
- * new ArrayList<WifiNetworkSuggestion> { {
- * add(suggestion1);
- * add(suggestion2);
- * add(suggestion3);
- * add(suggestion4);
- * } };
- * final WifiManager wifiManager =
- * context.getSystemService(Context.WIFI_SERVICE);
- * wifiManager.addNetworkSuggestions(suggestionsList);
- * // ...
- * }</pre>
- *
- * @return Instance of {@link WifiNetworkSuggestion}
- * @throws IllegalStateException on invalid params set
- * @see WifiNetworkSuggestion
- */
- public @NonNull WifiNetworkSuggestion build() {
- validateSecurityParams();
- WifiConfiguration wifiConfiguration;
- if (mPasspointConfiguration != null) {
- if (mSsid != null) {
- throw new IllegalStateException("setSsid should not be invoked for suggestion "
- + "with Passpoint configuration");
- }
- if (mIsHiddenSSID) {
- throw new IllegalStateException("setIsHiddenSsid should not be invoked for "
- + "suggestion with Passpoint configuration");
- }
- wifiConfiguration = buildWifiConfigurationForPasspoint();
- mPasspointConfiguration.setEnhancedMacRandomizationEnabled(
- mIsEnhancedMacRandomizationEnabled);
- } else {
- if (mSsid == null) {
- throw new IllegalStateException("setSsid should be invoked for suggestion");
- }
- if (TextUtils.isEmpty(mSsid)) {
- throw new IllegalStateException("invalid ssid for suggestion");
- }
- if (mBssid != null
- && (mBssid.equals(MacAddress.BROADCAST_ADDRESS)
- || mBssid.equals(WifiManager.ALL_ZEROS_MAC_ADDRESS))) {
- throw new IllegalStateException("invalid bssid for suggestion");
- }
- wifiConfiguration = buildWifiConfiguration();
- if (wifiConfiguration.isOpenNetwork()) {
- if (mIsSharedWithUserSet && mIsSharedWithUser) {
- throw new IllegalStateException("Open network should not be "
- + "setCredentialSharedWithUser to true");
- }
- mIsSharedWithUser = false;
- }
- }
- if (!mIsSharedWithUser && !mIsInitialAutojoinEnabled) {
- throw new IllegalStateException("Should have not a network with both "
- + "setCredentialSharedWithUser and "
- + "setIsAutojoinEnabled set to false");
- }
- if (mIsNetworkUntrusted) {
- if (mIsSharedWithUserSet && mIsSharedWithUser) {
- throw new IllegalStateException("Should not be both"
- + "setCredentialSharedWithUser and +"
- + "setUntrusted to true");
- }
- mIsSharedWithUser = false;
- }
- if (mIsNetworkOemPaid) {
- if (mIsSharedWithUserSet && mIsSharedWithUser) {
- throw new IllegalStateException("Should not be both"
- + "setCredentialSharedWithUser and +"
- + "setOemPaid to true");
- }
- mIsSharedWithUser = false;
- }
- if (mIsNetworkOemPrivate) {
- if (mIsSharedWithUserSet && mIsSharedWithUser) {
- throw new IllegalStateException("Should not be both"
- + "setCredentialSharedWithUser and +"
- + "setOemPrivate to true");
- }
- mIsSharedWithUser = false;
- }
- if (mIsCarrierMerged) {
- if (mSubscriptionId == SubscriptionManager.INVALID_SUBSCRIPTION_ID
- || mMeteredOverride != WifiConfiguration.METERED_OVERRIDE_METERED
- || !isEnterpriseSuggestion()) {
- throw new IllegalStateException("A carrier merged network must be a metered, "
- + "enterprise network with valid subscription Id");
- }
- }
- return new WifiNetworkSuggestion(
- wifiConfiguration,
- mPasspointConfiguration,
- mIsAppInteractionRequired,
- mIsUserInteractionRequired,
- mIsSharedWithUser,
- mIsInitialAutojoinEnabled,
- mPriorityGroup);
- }
-
- private boolean isEnterpriseSuggestion() {
- return !(mWpa2EnterpriseConfig == null && mWpa3EnterpriseConfig == null
- && mWapiEnterpriseConfig == null && mPasspointConfiguration == null);
- }
- }
-
-
-
- /**
- * Network configuration for the provided network.
- * @hide
- */
- @NonNull
- public final WifiConfiguration wifiConfiguration;
-
- /**
- * Passpoint configuration for the provided network.
- * @hide
- */
- @Nullable
- public final PasspointConfiguration passpointConfiguration;
-
- /**
- * Whether app needs to log in to captive portal to obtain Internet access.
- * @hide
- */
- public final boolean isAppInteractionRequired;
-
- /**
- * Whether user needs to log in to captive portal to obtain Internet access.
- * @hide
- */
- public final boolean isUserInteractionRequired;
-
- /**
- * Whether app share credential with the user, allow user use provided credential to
- * connect network manually.
- * @hide
- */
- public final boolean isUserAllowedToManuallyConnect;
-
- /**
- * Whether the suggestion will be initialized as auto-joined or not.
- * @hide
- */
- public final boolean isInitialAutoJoinEnabled;
-
- /**
- * Priority group ID.
- * @hide
- */
- public final int priorityGroup;
-
- /** @hide */
- public WifiNetworkSuggestion() {
- this.wifiConfiguration = new WifiConfiguration();
- this.passpointConfiguration = null;
- this.isAppInteractionRequired = false;
- this.isUserInteractionRequired = false;
- this.isUserAllowedToManuallyConnect = true;
- this.isInitialAutoJoinEnabled = true;
- this.priorityGroup = 0;
- }
-
- /** @hide */
- public WifiNetworkSuggestion(@NonNull WifiConfiguration networkConfiguration,
- @Nullable PasspointConfiguration passpointConfiguration,
- boolean isAppInteractionRequired,
- boolean isUserInteractionRequired,
- boolean isUserAllowedToManuallyConnect,
- boolean isInitialAutoJoinEnabled, int priorityGroup) {
- checkNotNull(networkConfiguration);
- this.wifiConfiguration = networkConfiguration;
- this.passpointConfiguration = passpointConfiguration;
-
- this.isAppInteractionRequired = isAppInteractionRequired;
- this.isUserInteractionRequired = isUserInteractionRequired;
- this.isUserAllowedToManuallyConnect = isUserAllowedToManuallyConnect;
- this.isInitialAutoJoinEnabled = isInitialAutoJoinEnabled;
- this.priorityGroup = priorityGroup;
- }
-
- public static final @NonNull Creator<WifiNetworkSuggestion> CREATOR =
- new Creator<WifiNetworkSuggestion>() {
- @Override
- public WifiNetworkSuggestion createFromParcel(Parcel in) {
- return new WifiNetworkSuggestion(
- in.readParcelable(null), // wifiConfiguration
- in.readParcelable(null), // PasspointConfiguration
- in.readBoolean(), // isAppInteractionRequired
- in.readBoolean(), // isUserInteractionRequired
- in.readBoolean(), // isSharedCredentialWithUser
- in.readBoolean(), // isAutojoinEnabled
- in.readInt() // priorityGroup
- );
- }
-
- @Override
- public WifiNetworkSuggestion[] newArray(int size) {
- return new WifiNetworkSuggestion[size];
- }
- };
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeParcelable(wifiConfiguration, flags);
- dest.writeParcelable(passpointConfiguration, flags);
- dest.writeBoolean(isAppInteractionRequired);
- dest.writeBoolean(isUserInteractionRequired);
- dest.writeBoolean(isUserAllowedToManuallyConnect);
- dest.writeBoolean(isInitialAutoJoinEnabled);
- dest.writeInt(priorityGroup);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(wifiConfiguration.SSID, wifiConfiguration.BSSID,
- wifiConfiguration.getDefaultSecurityType(),
- wifiConfiguration.getPasspointUniqueId(),
- wifiConfiguration.subscriptionId, wifiConfiguration.carrierId);
- }
-
- /**
- * Equals for network suggestions.
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!(obj instanceof WifiNetworkSuggestion)) {
- return false;
- }
- WifiNetworkSuggestion lhs = (WifiNetworkSuggestion) obj;
- if (this.passpointConfiguration == null ^ lhs.passpointConfiguration == null) {
- return false;
- }
-
- return TextUtils.equals(this.wifiConfiguration.SSID, lhs.wifiConfiguration.SSID)
- && TextUtils.equals(this.wifiConfiguration.BSSID, lhs.wifiConfiguration.BSSID)
- && TextUtils.equals(this.wifiConfiguration.getDefaultSecurityType(),
- lhs.wifiConfiguration.getDefaultSecurityType())
- && TextUtils.equals(this.wifiConfiguration.getPasspointUniqueId(),
- lhs.wifiConfiguration.getPasspointUniqueId())
- && this.wifiConfiguration.carrierId == lhs.wifiConfiguration.carrierId
- && this.wifiConfiguration.subscriptionId == lhs.wifiConfiguration.subscriptionId;
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("WifiNetworkSuggestion[ ")
- .append("SSID=").append(wifiConfiguration.SSID)
- .append(", BSSID=").append(wifiConfiguration.BSSID)
- .append(", FQDN=").append(wifiConfiguration.FQDN)
- .append(", isAppInteractionRequired=").append(isAppInteractionRequired)
- .append(", isUserInteractionRequired=").append(isUserInteractionRequired)
- .append(", isCredentialSharedWithUser=").append(isUserAllowedToManuallyConnect)
- .append(", isInitialAutoJoinEnabled=").append(isInitialAutoJoinEnabled)
- .append(", isUnTrusted=").append(!wifiConfiguration.trusted)
- .append(", isOemPaid=").append(wifiConfiguration.oemPaid)
- .append(", isOemPrivate=").append(wifiConfiguration.oemPrivate)
- .append(", isCarrierMerged").append(wifiConfiguration.carrierMerged)
- .append(", priorityGroup=").append(priorityGroup)
- .append(" ]");
- return sb.toString();
- }
-
- /**
- * Get the {@link WifiConfiguration} associated with this Suggestion.
- * @hide
- */
- @SystemApi
- @NonNull
- public WifiConfiguration getWifiConfiguration() {
- return wifiConfiguration;
- }
-
- /**
- * Get the BSSID, or null if unset.
- * @see Builder#setBssid(MacAddress)
- */
- @Nullable
- public MacAddress getBssid() {
- if (wifiConfiguration.BSSID == null) {
- return null;
- }
- return MacAddress.fromString(wifiConfiguration.BSSID);
- }
-
- /** @see Builder#setCredentialSharedWithUser(boolean) */
- public boolean isCredentialSharedWithUser() {
- return isUserAllowedToManuallyConnect;
- }
-
- /** @see Builder#setIsAppInteractionRequired(boolean) */
- public boolean isAppInteractionRequired() {
- return isAppInteractionRequired;
- }
-
- /** @see Builder#setIsEnhancedOpen(boolean) */
- public boolean isEnhancedOpen() {
- return wifiConfiguration.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.OWE);
- }
-
- /** @see Builder#setIsHiddenSsid(boolean) */
- public boolean isHiddenSsid() {
- return wifiConfiguration.hiddenSSID;
- }
-
- /** @see Builder#setIsInitialAutojoinEnabled(boolean) */
- public boolean isInitialAutojoinEnabled() {
- return isInitialAutoJoinEnabled;
- }
-
- /** @see Builder#setIsMetered(boolean) */
- public boolean isMetered() {
- return wifiConfiguration.meteredOverride == WifiConfiguration.METERED_OVERRIDE_METERED;
- }
-
- /** @see Builder#setIsUserInteractionRequired(boolean) */
- public boolean isUserInteractionRequired() {
- return isUserInteractionRequired;
- }
-
- /**
- * Get the {@link PasspointConfiguration} associated with this Suggestion, or null if this
- * Suggestion is not for a Passpoint network.
- */
- @Nullable
- public PasspointConfiguration getPasspointConfig() {
- return passpointConfiguration;
- }
-
- /** @see Builder#setPriority(int) */
- @IntRange(from = 0)
- public int getPriority() {
- return wifiConfiguration.priority;
- }
-
- /**
- * Return the SSID of the network, or null if this is a Passpoint network.
- * @see Builder#setSsid(String)
- */
- @Nullable
- public String getSsid() {
- if (wifiConfiguration.SSID == null) {
- return null;
- }
- return WifiInfo.sanitizeSsid(wifiConfiguration.SSID);
- }
-
- /** @see Builder#setUntrusted(boolean) */
- public boolean isUntrusted() {
- return !wifiConfiguration.trusted;
- }
-
- /**
- * @see Builder#setOemPaid(boolean)
- * @hide
- */
- @SystemApi
- public boolean isOemPaid() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- return wifiConfiguration.oemPaid;
- }
-
- /**
- * @see Builder#setOemPrivate(boolean)
- * @hide
- */
- @SystemApi
- public boolean isOemPrivate() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- return wifiConfiguration.oemPrivate;
- }
-
- /**
- * @see Builder#setCarrierMerged(boolean)
- */
- public boolean isCarrierMerged() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- return wifiConfiguration.carrierMerged;
- }
-
- /**
- * Get the WifiEnterpriseConfig, or null if unset.
- * @see Builder#setWapiEnterpriseConfig(WifiEnterpriseConfig)
- * @see Builder#setWpa2EnterpriseConfig(WifiEnterpriseConfig)
- * @see Builder#setWpa3EnterpriseConfig(WifiEnterpriseConfig)
- */
- @Nullable
- public WifiEnterpriseConfig getEnterpriseConfig() {
- if (!wifiConfiguration.isEnterprise()) {
- return null;
- }
- return wifiConfiguration.enterpriseConfig;
- }
-
- /**
- * Get the passphrase, or null if unset.
- * @see Builder#setWapiPassphrase(String)
- * @see Builder#setWpa2Passphrase(String)
- * @see Builder#setWpa3Passphrase(String)
- */
- @Nullable
- public String getPassphrase() {
- if (wifiConfiguration.preSharedKey == null) {
- return null;
- }
- return WifiInfo.removeDoubleQuotes(wifiConfiguration.preSharedKey);
- }
-
- /**
- * @see Builder#setPriorityGroup(int)
- */
- public int getPriorityGroup() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- return priorityGroup;
- }
-
- /**
- * @see Builder#setSubscriptionId(int)
- */
- public int getSubscriptionId() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- return wifiConfiguration.subscriptionId;
- }
-}
diff --git a/wifi/java/android/net/wifi/WifiScanner.java b/wifi/java/android/net/wifi/WifiScanner.java
deleted file mode 100644
index 7c051f0..0000000
--- a/wifi/java/android/net/wifi/WifiScanner.java
+++ /dev/null
@@ -1,1704 +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 android.net.wifi;
-
-import android.Manifest;
-import android.annotation.CallbackExecutor;
-import android.annotation.IntDef;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.RequiresPermission;
-import android.annotation.SuppressLint;
-import android.annotation.SystemApi;
-import android.annotation.SystemService;
-import android.content.Context;
-import android.os.Binder;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.Message;
-import android.os.Messenger;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.os.RemoteException;
-import android.os.WorkSource;
-import android.text.TextUtils;
-import android.util.Log;
-import android.util.SparseArray;
-
-import com.android.internal.util.AsyncChannel;
-import com.android.internal.util.Protocol;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
-import java.util.concurrent.Executor;
-
-/**
- * This class provides a way to scan the Wifi universe around the device
- * @hide
- */
-@SystemApi
-@SystemService(Context.WIFI_SCANNING_SERVICE)
-public class WifiScanner {
-
- /** @hide */
- public static final int WIFI_BAND_INDEX_24_GHZ = 0;
- /** @hide */
- public static final int WIFI_BAND_INDEX_5_GHZ = 1;
- /** @hide */
- public static final int WIFI_BAND_INDEX_5_GHZ_DFS_ONLY = 2;
- /** @hide */
- public static final int WIFI_BAND_INDEX_6_GHZ = 3;
- /** @hide */
- public static final int WIFI_BAND_INDEX_60_GHZ = 4;
- /** @hide */
- public static final int WIFI_BAND_COUNT = 5;
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = {"WIFI_BAND_INDEX_"}, value = {
- WIFI_BAND_INDEX_24_GHZ,
- WIFI_BAND_INDEX_5_GHZ,
- WIFI_BAND_INDEX_5_GHZ_DFS_ONLY,
- WIFI_BAND_INDEX_6_GHZ,
- WIFI_BAND_INDEX_60_GHZ})
- public @interface WifiBandIndex {}
-
- /** no band specified; use channel list instead */
- public static final int WIFI_BAND_UNSPECIFIED = 0;
- /** 2.4 GHz band */
- public static final int WIFI_BAND_24_GHZ = 1 << WIFI_BAND_INDEX_24_GHZ;
- /** 5 GHz band excluding DFS channels */
- public static final int WIFI_BAND_5_GHZ = 1 << WIFI_BAND_INDEX_5_GHZ;
- /** DFS channels from 5 GHz band only */
- public static final int WIFI_BAND_5_GHZ_DFS_ONLY = 1 << WIFI_BAND_INDEX_5_GHZ_DFS_ONLY;
- /** 6 GHz band */
- public static final int WIFI_BAND_6_GHZ = 1 << WIFI_BAND_INDEX_6_GHZ;
- /** 60 GHz band */
- public static final int WIFI_BAND_60_GHZ = 1 << WIFI_BAND_INDEX_60_GHZ;
-
- /**
- * Combination of bands
- * Note that those are only the common band combinations,
- * other combinations can be created by combining any of the basic bands above
- */
- /** Both 2.4 GHz band and 5 GHz band; no DFS channels */
- public static final int WIFI_BAND_BOTH = WIFI_BAND_24_GHZ | WIFI_BAND_5_GHZ;
- /**
- * 2.4Ghz band + DFS channels from 5 GHz band only
- * @hide
- */
- public static final int WIFI_BAND_24_GHZ_WITH_5GHZ_DFS =
- WIFI_BAND_24_GHZ | WIFI_BAND_5_GHZ_DFS_ONLY;
- /** 5 GHz band including DFS channels */
- public static final int WIFI_BAND_5_GHZ_WITH_DFS = WIFI_BAND_5_GHZ | WIFI_BAND_5_GHZ_DFS_ONLY;
- /** Both 2.4 GHz band and 5 GHz band; with DFS channels */
- public static final int WIFI_BAND_BOTH_WITH_DFS =
- WIFI_BAND_24_GHZ | WIFI_BAND_5_GHZ | WIFI_BAND_5_GHZ_DFS_ONLY;
- /** 2.4 GHz band and 5 GHz band (no DFS channels) and 6 GHz */
- public static final int WIFI_BAND_24_5_6_GHZ = WIFI_BAND_BOTH | WIFI_BAND_6_GHZ;
- /** 2.4 GHz band and 5 GHz band; with DFS channels and 6 GHz */
- public static final int WIFI_BAND_24_5_WITH_DFS_6_GHZ =
- WIFI_BAND_BOTH_WITH_DFS | WIFI_BAND_6_GHZ;
- /** @hide */
- public static final int WIFI_BAND_24_5_6_60_GHZ =
- WIFI_BAND_24_5_6_GHZ | WIFI_BAND_60_GHZ;
- /** @hide */
- public static final int WIFI_BAND_24_5_WITH_DFS_6_60_GHZ =
- WIFI_BAND_24_5_6_60_GHZ | WIFI_BAND_5_GHZ_DFS_ONLY;
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = {"WIFI_BAND_"}, value = {
- WIFI_BAND_UNSPECIFIED,
- WIFI_BAND_24_GHZ,
- WIFI_BAND_5_GHZ,
- WIFI_BAND_BOTH,
- WIFI_BAND_5_GHZ_DFS_ONLY,
- WIFI_BAND_24_GHZ_WITH_5GHZ_DFS,
- WIFI_BAND_5_GHZ_WITH_DFS,
- WIFI_BAND_BOTH_WITH_DFS,
- WIFI_BAND_6_GHZ,
- WIFI_BAND_24_5_6_GHZ,
- WIFI_BAND_24_5_WITH_DFS_6_GHZ,
- WIFI_BAND_60_GHZ,
- WIFI_BAND_24_5_6_60_GHZ,
- WIFI_BAND_24_5_WITH_DFS_6_60_GHZ})
- public @interface WifiBand {}
-
- /**
- * All bands
- * @hide
- */
- public static final int WIFI_BAND_ALL = (1 << WIFI_BAND_COUNT) - 1;
-
- /** Minimum supported scanning period */
- public static final int MIN_SCAN_PERIOD_MS = 1000;
- /** Maximum supported scanning period */
- public static final int MAX_SCAN_PERIOD_MS = 1024000;
-
- /** No Error */
- public static final int REASON_SUCCEEDED = 0;
- /** Unknown error */
- public static final int REASON_UNSPECIFIED = -1;
- /** Invalid listener */
- public static final int REASON_INVALID_LISTENER = -2;
- /** Invalid request */
- public static final int REASON_INVALID_REQUEST = -3;
- /** Invalid request */
- public static final int REASON_NOT_AUTHORIZED = -4;
- /** An outstanding request with the same listener hasn't finished yet. */
- public static final int REASON_DUPLICATE_REQEUST = -5;
-
- /** @hide */
- public static final String GET_AVAILABLE_CHANNELS_EXTRA = "Channels";
-
- /**
- * Generic action callback invocation interface
- * @hide
- */
- @SystemApi
- public static interface ActionListener {
- public void onSuccess();
- public void onFailure(int reason, String description);
- }
-
- /**
- * Test if scan is a full scan. i.e. scanning all available bands.
- * For backward compatibility, since some apps don't include 6GHz in their requests yet,
- * lacking 6GHz band does not cause the result to be false.
- *
- * @param bandScanned bands that are fully scanned
- * @param excludeDfs when true, DFS band is excluded from the check
- * @return true if all bands are scanned, false otherwise
- *
- * @hide
- */
- public static boolean isFullBandScan(@WifiBand int bandScanned, boolean excludeDfs) {
- return (bandScanned | WIFI_BAND_6_GHZ | WIFI_BAND_60_GHZ
- | (excludeDfs ? WIFI_BAND_5_GHZ_DFS_ONLY : 0))
- == WIFI_BAND_ALL;
- }
-
- /**
- * Returns a list of all the possible channels for the given band(s).
- *
- * @param band one of the WifiScanner#WIFI_BAND_* constants, e.g. {@link #WIFI_BAND_24_GHZ}
- * @return a list of all the frequencies, in MHz, for the given band(s) e.g. channel 1 is
- * 2412, or null if an error occurred.
- *
- * @hide
- */
- @SystemApi
- @NonNull
- @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
- public List<Integer> getAvailableChannels(int band) {
- try {
- Bundle bundle = mService.getAvailableChannels(band, mContext.getOpPackageName(),
- mContext.getAttributionTag());
- List<Integer> channels = bundle.getIntegerArrayList(GET_AVAILABLE_CHANNELS_EXTRA);
- return channels == null ? new ArrayList<>() : channels;
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * provides channel specification for scanning
- */
- public static class ChannelSpec {
- /**
- * channel frequency in MHz; for example channel 1 is specified as 2412
- */
- public int frequency;
- /**
- * if true, scan this channel in passive fashion.
- * This flag is ignored on DFS channel specification.
- * @hide
- */
- public boolean passive; /* ignored on DFS channels */
- /**
- * how long to dwell on this channel
- * @hide
- */
- public int dwellTimeMS; /* not supported for now */
-
- /**
- * default constructor for channel spec
- */
- public ChannelSpec(int frequency) {
- this.frequency = frequency;
- passive = false;
- dwellTimeMS = 0;
- }
- }
-
- /**
- * reports {@link ScanListener#onResults} when underlying buffers are full
- * this is simply the lack of the {@link #REPORT_EVENT_AFTER_EACH_SCAN} flag
- * @deprecated It is not supported anymore.
- */
- @Deprecated
- public static final int REPORT_EVENT_AFTER_BUFFER_FULL = 0;
- /**
- * reports {@link ScanListener#onResults} after each scan
- */
- public static final int REPORT_EVENT_AFTER_EACH_SCAN = (1 << 0);
- /**
- * reports {@link ScanListener#onFullResult} whenever each beacon is discovered
- */
- public static final int REPORT_EVENT_FULL_SCAN_RESULT = (1 << 1);
- /**
- * Do not place scans in the chip's scan history buffer
- */
- public static final int REPORT_EVENT_NO_BATCH = (1 << 2);
-
- /**
- * Optimize the scan for lower latency.
- * @see ScanSettings#type
- */
- public static final int SCAN_TYPE_LOW_LATENCY = 0;
- /**
- * Optimize the scan for lower power usage.
- * @see ScanSettings#type
- */
- public static final int SCAN_TYPE_LOW_POWER = 1;
- /**
- * Optimize the scan for higher accuracy.
- * @see ScanSettings#type
- */
- public static final int SCAN_TYPE_HIGH_ACCURACY = 2;
-
- /** {@hide} */
- public static final String SCAN_PARAMS_SCAN_SETTINGS_KEY = "ScanSettings";
- /** {@hide} */
- public static final String SCAN_PARAMS_WORK_SOURCE_KEY = "WorkSource";
- /** {@hide} */
- public static final String REQUEST_PACKAGE_NAME_KEY = "PackageName";
- /** {@hide} */
- public static final String REQUEST_FEATURE_ID_KEY = "FeatureId";
-
- /**
- * scan configuration parameters to be sent to {@link #startBackgroundScan}
- */
- public static class ScanSettings implements Parcelable {
- /** Hidden network to be scanned for. */
- public static class HiddenNetwork {
- /** SSID of the network */
- @NonNull
- public final String ssid;
-
- /** Default constructor for HiddenNetwork. */
- public HiddenNetwork(@NonNull String ssid) {
- this.ssid = ssid;
- }
- }
-
- /** one of the WIFI_BAND values */
- public int band;
- /** list of channels; used when band is set to WIFI_BAND_UNSPECIFIED */
- public ChannelSpec[] channels;
- /**
- * List of hidden networks to scan for. Explicit probe requests are sent out for such
- * networks during scan. Only valid for single scan requests.
- */
- @NonNull
- @RequiresPermission(android.Manifest.permission.NETWORK_STACK)
- public final List<HiddenNetwork> hiddenNetworks = new ArrayList<>();
- /**
- * period of background scan; in millisecond, 0 => single shot scan
- * @deprecated Background scan support has always been hardware vendor dependent. This
- * support may not be present on newer devices. Use {@link #startScan(ScanSettings,
- * ScanListener)} instead for single scans.
- */
- @Deprecated
- public int periodInMs;
- /**
- * must have a valid REPORT_EVENT value
- * @deprecated Background scan support has always been hardware vendor dependent. This
- * support may not be present on newer devices. Use {@link #startScan(ScanSettings,
- * ScanListener)} instead for single scans.
- */
- @Deprecated
- public int reportEvents;
- /**
- * defines number of bssids to cache from each scan
- * @deprecated Background scan support has always been hardware vendor dependent. This
- * support may not be present on newer devices. Use {@link #startScan(ScanSettings,
- * ScanListener)} instead for single scans.
- */
- @Deprecated
- public int numBssidsPerScan;
- /**
- * defines number of scans to cache; use it with REPORT_EVENT_AFTER_BUFFER_FULL
- * to wake up at fixed interval
- * @deprecated Background scan support has always been hardware vendor dependent. This
- * support may not be present on newer devices. Use {@link #startScan(ScanSettings,
- * ScanListener)} instead for single scans.
- */
- @Deprecated
- public int maxScansToCache;
- /**
- * if maxPeriodInMs is non zero or different than period, then this bucket is
- * a truncated binary exponential backoff bucket and the scan period will grow
- * exponentially as per formula: actual_period(N) = period * (2 ^ (N/stepCount))
- * to maxPeriodInMs
- * @deprecated Background scan support has always been hardware vendor dependent. This
- * support may not be present on newer devices. Use {@link #startScan(ScanSettings,
- * ScanListener)} instead for single scans.
- */
- @Deprecated
- public int maxPeriodInMs;
- /**
- * for truncated binary exponential back off bucket, number of scans to perform
- * for a given period
- * @deprecated Background scan support has always been hardware vendor dependent. This
- * support may not be present on newer devices. Use {@link #startScan(ScanSettings,
- * ScanListener)} instead for single scans.
- */
- @Deprecated
- public int stepCount;
- /**
- * Flag to indicate if the scan settings are targeted for PNO scan.
- * {@hide}
- */
- public boolean isPnoScan;
- /**
- * Indicate the type of scan to be performed by the wifi chip.
- *
- * On devices with multiple hardware radio chains (and hence different modes of scan),
- * this type serves as an indication to the hardware on what mode of scan to perform.
- * Only apps holding {@link android.Manifest.permission.NETWORK_STACK} permission can set
- * this value.
- *
- * Note: This serves as an intent and not as a stipulation, the wifi chip
- * might honor or ignore the indication based on the current radio conditions. Always
- * use the {@link ScanResult#radioChainInfos} to figure out the radio chain configuration
- * used to receive the corresponding scan result.
- *
- * One of {@link #SCAN_TYPE_LOW_LATENCY}, {@link #SCAN_TYPE_LOW_POWER},
- * {@link #SCAN_TYPE_HIGH_ACCURACY}.
- * Default value: {@link #SCAN_TYPE_LOW_LATENCY}.
- */
- @WifiAnnotations.ScanType
- @RequiresPermission(android.Manifest.permission.NETWORK_STACK)
- public int type = SCAN_TYPE_LOW_LATENCY;
- /**
- * This scan request may ignore location settings while receiving scans. This should only
- * be used in emergency situations.
- * {@hide}
- */
- @SystemApi
- public boolean ignoreLocationSettings;
- /**
- * This scan request will be hidden from app-ops noting for location information. This
- * should only be used by FLP/NLP module on the device which is using the scan results to
- * compute results for behalf on their clients. FLP/NLP module using this flag should ensure
- * that they note in app-ops the eventual delivery of location information computed using
- * these results to their client .
- * {@hide}
- */
- @SystemApi
- public boolean hideFromAppOps;
-
- /** Implement the Parcelable interface {@hide} */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(band);
- dest.writeInt(periodInMs);
- dest.writeInt(reportEvents);
- dest.writeInt(numBssidsPerScan);
- dest.writeInt(maxScansToCache);
- dest.writeInt(maxPeriodInMs);
- dest.writeInt(stepCount);
- dest.writeInt(isPnoScan ? 1 : 0);
- dest.writeInt(type);
- dest.writeInt(ignoreLocationSettings ? 1 : 0);
- dest.writeInt(hideFromAppOps ? 1 : 0);
- if (channels != null) {
- dest.writeInt(channels.length);
- for (int i = 0; i < channels.length; i++) {
- dest.writeInt(channels[i].frequency);
- dest.writeInt(channels[i].dwellTimeMS);
- dest.writeInt(channels[i].passive ? 1 : 0);
- }
- } else {
- dest.writeInt(0);
- }
- dest.writeInt(hiddenNetworks.size());
- for (HiddenNetwork hiddenNetwork : hiddenNetworks) {
- dest.writeString(hiddenNetwork.ssid);
- }
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final @NonNull Creator<ScanSettings> CREATOR =
- new Creator<ScanSettings>() {
- public ScanSettings createFromParcel(Parcel in) {
- ScanSettings settings = new ScanSettings();
- settings.band = in.readInt();
- settings.periodInMs = in.readInt();
- settings.reportEvents = in.readInt();
- settings.numBssidsPerScan = in.readInt();
- settings.maxScansToCache = in.readInt();
- settings.maxPeriodInMs = in.readInt();
- settings.stepCount = in.readInt();
- settings.isPnoScan = in.readInt() == 1;
- settings.type = in.readInt();
- settings.ignoreLocationSettings = in.readInt() == 1;
- settings.hideFromAppOps = in.readInt() == 1;
- int num_channels = in.readInt();
- settings.channels = new ChannelSpec[num_channels];
- for (int i = 0; i < num_channels; i++) {
- int frequency = in.readInt();
- ChannelSpec spec = new ChannelSpec(frequency);
- spec.dwellTimeMS = in.readInt();
- spec.passive = in.readInt() == 1;
- settings.channels[i] = spec;
- }
- int numNetworks = in.readInt();
- settings.hiddenNetworks.clear();
- for (int i = 0; i < numNetworks; i++) {
- String ssid = in.readString();
- settings.hiddenNetworks.add(new HiddenNetwork(ssid));
- }
- return settings;
- }
-
- public ScanSettings[] newArray(int size) {
- return new ScanSettings[size];
- }
- };
- }
-
- /**
- * all the information garnered from a single scan
- */
- public static class ScanData implements Parcelable {
- /** scan identifier */
- private int mId;
- /** additional information about scan
- * 0 => no special issues encountered in the scan
- * non-zero => scan was truncated, so results may not be complete
- */
- private int mFlags;
- /**
- * Indicates the buckets that were scanned to generate these results.
- * This is not relevant to WifiScanner API users and is used internally.
- * {@hide}
- */
- private int mBucketsScanned;
- /**
- * Bands scanned. One of the WIFI_BAND values.
- * Will be {@link #WIFI_BAND_UNSPECIFIED} if the list of channels do not fully cover
- * any of the bands.
- * {@hide}
- */
- private int mBandScanned;
- /** all scan results discovered in this scan, sorted by timestamp in ascending order */
- private final List<ScanResult> mResults;
-
- ScanData() {
- mResults = new ArrayList<>();
- }
-
- public ScanData(int id, int flags, ScanResult[] results) {
- mId = id;
- mFlags = flags;
- mResults = new ArrayList<>(Arrays.asList(results));
- }
-
- /** {@hide} */
- public ScanData(int id, int flags, int bucketsScanned, int bandScanned,
- ScanResult[] results) {
- this(id, flags, bucketsScanned, bandScanned, new ArrayList<>(Arrays.asList(results)));
- }
-
- /** {@hide} */
- public ScanData(int id, int flags, int bucketsScanned, int bandScanned,
- List<ScanResult> results) {
- mId = id;
- mFlags = flags;
- mBucketsScanned = bucketsScanned;
- mBandScanned = bandScanned;
- mResults = results;
- }
-
- public ScanData(ScanData s) {
- mId = s.mId;
- mFlags = s.mFlags;
- mBucketsScanned = s.mBucketsScanned;
- mBandScanned = s.mBandScanned;
- mResults = new ArrayList<>();
- for (ScanResult scanResult : s.mResults) {
- mResults.add(new ScanResult(scanResult));
- }
- }
-
- public int getId() {
- return mId;
- }
-
- public int getFlags() {
- return mFlags;
- }
-
- /** {@hide} */
- public int getBucketsScanned() {
- return mBucketsScanned;
- }
-
- /** {@hide} */
- public int getBandScanned() {
- return mBandScanned;
- }
-
- public ScanResult[] getResults() {
- return mResults.toArray(new ScanResult[0]);
- }
-
- /** {@hide} */
- public void addResults(@NonNull ScanResult[] newResults) {
- for (ScanResult result : newResults) {
- mResults.add(new ScanResult(result));
- }
- }
-
- /** {@hide} */
- public void addResults(@NonNull ScanData s) {
- mBandScanned |= s.mBandScanned;
- mFlags |= s.mFlags;
- addResults(s.getResults());
- }
-
- /** {@hide} */
- public boolean isFullBandScanResults() {
- return (mBandScanned & WifiScanner.WIFI_BAND_24_GHZ) != 0
- && (mBandScanned & WifiScanner.WIFI_BAND_5_GHZ) != 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(mId);
- dest.writeInt(mFlags);
- dest.writeInt(mBucketsScanned);
- dest.writeInt(mBandScanned);
- dest.writeParcelableList(mResults, 0);
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final @NonNull Creator<ScanData> CREATOR =
- new Creator<ScanData>() {
- public ScanData createFromParcel(Parcel in) {
- int id = in.readInt();
- int flags = in.readInt();
- int bucketsScanned = in.readInt();
- int bandScanned = in.readInt();
- List<ScanResult> results = new ArrayList<>();
- in.readParcelableList(results, ScanResult.class.getClassLoader());
- return new ScanData(id, flags, bucketsScanned, bandScanned, results);
- }
-
- public ScanData[] newArray(int size) {
- return new ScanData[size];
- }
- };
- }
-
- public static class ParcelableScanData implements Parcelable {
-
- public ScanData mResults[];
-
- public ParcelableScanData(ScanData[] results) {
- mResults = results;
- }
-
- public ScanData[] getResults() {
- return mResults;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public void writeToParcel(Parcel dest, int flags) {
- if (mResults != null) {
- dest.writeInt(mResults.length);
- for (int i = 0; i < mResults.length; i++) {
- ScanData result = mResults[i];
- result.writeToParcel(dest, flags);
- }
- } else {
- dest.writeInt(0);
- }
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final @NonNull Creator<ParcelableScanData> CREATOR =
- new Creator<ParcelableScanData>() {
- public ParcelableScanData createFromParcel(Parcel in) {
- int n = in.readInt();
- ScanData results[] = new ScanData[n];
- for (int i = 0; i < n; i++) {
- results[i] = ScanData.CREATOR.createFromParcel(in);
- }
- return new ParcelableScanData(results);
- }
-
- public ParcelableScanData[] newArray(int size) {
- return new ParcelableScanData[size];
- }
- };
- }
-
- public static class ParcelableScanResults implements Parcelable {
-
- public ScanResult mResults[];
-
- public ParcelableScanResults(ScanResult[] results) {
- mResults = results;
- }
-
- public ScanResult[] getResults() {
- return mResults;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public void writeToParcel(Parcel dest, int flags) {
- if (mResults != null) {
- dest.writeInt(mResults.length);
- for (int i = 0; i < mResults.length; i++) {
- ScanResult result = mResults[i];
- result.writeToParcel(dest, flags);
- }
- } else {
- dest.writeInt(0);
- }
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final @NonNull Creator<ParcelableScanResults> CREATOR =
- new Creator<ParcelableScanResults>() {
- public ParcelableScanResults createFromParcel(Parcel in) {
- int n = in.readInt();
- ScanResult results[] = new ScanResult[n];
- for (int i = 0; i < n; i++) {
- results[i] = ScanResult.CREATOR.createFromParcel(in);
- }
- return new ParcelableScanResults(results);
- }
-
- public ParcelableScanResults[] newArray(int size) {
- return new ParcelableScanResults[size];
- }
- };
- }
-
- /** {@hide} */
- public static final String PNO_PARAMS_PNO_SETTINGS_KEY = "PnoSettings";
- /** {@hide} */
- public static final String PNO_PARAMS_SCAN_SETTINGS_KEY = "ScanSettings";
- /**
- * PNO scan configuration parameters to be sent to {@link #startPnoScan}.
- * Note: This structure needs to be in sync with |wifi_epno_params| struct in gscan HAL API.
- * {@hide}
- */
- public static class PnoSettings implements Parcelable {
- /**
- * Pno network to be added to the PNO scan filtering.
- * {@hide}
- */
- public static class PnoNetwork {
- /*
- * Pno flags bitmask to be set in {@link #PnoNetwork.flags}
- */
- /** Whether directed scan needs to be performed (for hidden SSIDs) */
- public static final byte FLAG_DIRECTED_SCAN = (1 << 0);
- /** Whether PNO event shall be triggered if the network is found on A band */
- public static final byte FLAG_A_BAND = (1 << 1);
- /** Whether PNO event shall be triggered if the network is found on G band */
- public static final byte FLAG_G_BAND = (1 << 2);
- /**
- * Whether strict matching is required
- * If required then the firmware must store the network's SSID and not just a hash
- */
- public static final byte FLAG_STRICT_MATCH = (1 << 3);
- /**
- * If this SSID should be considered the same network as the currently connected
- * one for scoring.
- */
- public static final byte FLAG_SAME_NETWORK = (1 << 4);
-
- /*
- * Code for matching the beacon AUTH IE - additional codes. Bitmask to be set in
- * {@link #PnoNetwork.authBitField}
- */
- /** Open Network */
- public static final byte AUTH_CODE_OPEN = (1 << 0);
- /** WPA_PSK or WPA2PSK */
- public static final byte AUTH_CODE_PSK = (1 << 1);
- /** any EAPOL */
- public static final byte AUTH_CODE_EAPOL = (1 << 2);
-
- /** SSID of the network */
- public String ssid;
- /** Bitmask of the FLAG_XXX */
- public byte flags = 0;
- /** Bitmask of the ATUH_XXX */
- public byte authBitField = 0;
- /** frequencies on which the particular network needs to be scanned for */
- public int[] frequencies = {};
-
- /**
- * default constructor for PnoNetwork
- */
- public PnoNetwork(String ssid) {
- this.ssid = ssid;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(ssid, flags, authBitField);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!(obj instanceof PnoNetwork)) {
- return false;
- }
- PnoNetwork lhs = (PnoNetwork) obj;
- return TextUtils.equals(this.ssid, lhs.ssid)
- && this.flags == lhs.flags
- && this.authBitField == lhs.authBitField;
- }
- }
-
- /** Connected vs Disconnected PNO flag {@hide} */
- public boolean isConnected;
- /** Minimum 5GHz RSSI for a BSSID to be considered */
- public int min5GHzRssi;
- /** Minimum 2.4GHz RSSI for a BSSID to be considered */
- public int min24GHzRssi;
- /** Minimum 6GHz RSSI for a BSSID to be considered */
- public int min6GHzRssi;
- /** Pno Network filter list */
- public PnoNetwork[] networkList;
-
- /** Implement the Parcelable interface {@hide} */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(isConnected ? 1 : 0);
- dest.writeInt(min5GHzRssi);
- dest.writeInt(min24GHzRssi);
- dest.writeInt(min6GHzRssi);
- if (networkList != null) {
- dest.writeInt(networkList.length);
- for (int i = 0; i < networkList.length; i++) {
- dest.writeString(networkList[i].ssid);
- dest.writeByte(networkList[i].flags);
- dest.writeByte(networkList[i].authBitField);
- dest.writeIntArray(networkList[i].frequencies);
- }
- } else {
- dest.writeInt(0);
- }
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final @NonNull Creator<PnoSettings> CREATOR =
- new Creator<PnoSettings>() {
- public PnoSettings createFromParcel(Parcel in) {
- PnoSettings settings = new PnoSettings();
- settings.isConnected = in.readInt() == 1;
- settings.min5GHzRssi = in.readInt();
- settings.min24GHzRssi = in.readInt();
- settings.min6GHzRssi = in.readInt();
- int numNetworks = in.readInt();
- settings.networkList = new PnoNetwork[numNetworks];
- for (int i = 0; i < numNetworks; i++) {
- String ssid = in.readString();
- PnoNetwork network = new PnoNetwork(ssid);
- network.flags = in.readByte();
- network.authBitField = in.readByte();
- network.frequencies = in.createIntArray();
- settings.networkList[i] = network;
- }
- return settings;
- }
-
- public PnoSettings[] newArray(int size) {
- return new PnoSettings[size];
- }
- };
-
- }
-
- /**
- * interface to get scan events on; specify this on {@link #startBackgroundScan} or
- * {@link #startScan}
- */
- public interface ScanListener extends ActionListener {
- /**
- * Framework co-ordinates scans across multiple apps; so it may not give exactly the
- * same period requested. If period of a scan is changed; it is reported by this event.
- * @deprecated Background scan support has always been hardware vendor dependent. This
- * support may not be present on newer devices. Use {@link #startScan(ScanSettings,
- * ScanListener)} instead for single scans.
- */
- @Deprecated
- public void onPeriodChanged(int periodInMs);
- /**
- * reports results retrieved from background scan and single shot scans
- */
- public void onResults(ScanData[] results);
- /**
- * reports full scan result for each access point found in scan
- */
- public void onFullResult(ScanResult fullScanResult);
- }
-
- /**
- * interface to get PNO scan events on; specify this on {@link #startDisconnectedPnoScan} and
- * {@link #startConnectedPnoScan}.
- * {@hide}
- */
- public interface PnoScanListener extends ScanListener {
- /**
- * Invoked when one of the PNO networks are found in scan results.
- */
- void onPnoNetworkFound(ScanResult[] results);
- }
-
- /**
- * Enable/Disable wifi scanning.
- *
- * @param enable set to true to enable scanning, set to false to disable all types of scanning.
- *
- * @see WifiManager#ACTION_WIFI_SCAN_AVAILABILITY_CHANGED
- * {@hide}
- */
- @SystemApi
- @RequiresPermission(Manifest.permission.NETWORK_STACK)
- public void setScanningEnabled(boolean enable) {
- validateChannel();
- mAsyncChannel.sendMessage(enable ? CMD_ENABLE : CMD_DISABLE);
- }
-
- /**
- * Register a listener that will receive results from all single scans.
- * Either the {@link ScanListener#onSuccess()} or {@link ScanListener#onFailure(int, String)}
- * method will be called once when the listener is registered.
- * Afterwards (assuming onSuccess was called), all subsequent single scan results will be
- * delivered to the listener. It is possible that onFullResult will not be called for all
- * results of the first scan if the listener was registered during the scan.
- *
- * @param executor the Executor on which to run the callback.
- * @param listener specifies the object to report events to. This object is also treated as a
- * key for this request, and must also be specified to cancel the request.
- * Multiple requests should also not share this object.
- */
- @RequiresPermission(Manifest.permission.NETWORK_STACK)
- public void registerScanListener(@NonNull @CallbackExecutor Executor executor,
- @NonNull ScanListener listener) {
- Objects.requireNonNull(executor, "executor cannot be null");
- Objects.requireNonNull(listener, "listener cannot be null");
- int key = addListener(listener, executor);
- if (key == INVALID_KEY) return;
- validateChannel();
- mAsyncChannel.sendMessage(CMD_REGISTER_SCAN_LISTENER, 0, key);
- }
-
- /**
- * Overload of {@link #registerScanListener(Executor, ScanListener)} that executes the callback
- * synchronously.
- * @hide
- */
- @RequiresPermission(Manifest.permission.NETWORK_STACK)
- public void registerScanListener(@NonNull ScanListener listener) {
- registerScanListener(new SynchronousExecutor(), listener);
- }
-
- /**
- * Deregister a listener for ongoing single scans
- * @param listener specifies which scan to cancel; must be same object as passed in {@link
- * #registerScanListener}
- */
- public void unregisterScanListener(@NonNull ScanListener listener) {
- Objects.requireNonNull(listener, "listener cannot be null");
- int key = removeListener(listener);
- if (key == INVALID_KEY) return;
- validateChannel();
- mAsyncChannel.sendMessage(CMD_DEREGISTER_SCAN_LISTENER, 0, key);
- }
-
- /** start wifi scan in background
- * @param settings specifies various parameters for the scan; for more information look at
- * {@link ScanSettings}
- * @param listener specifies the object to report events to. This object is also treated as a
- * key for this scan, and must also be specified to cancel the scan. Multiple
- * scans should also not share this object.
- */
- @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
- public void startBackgroundScan(ScanSettings settings, ScanListener listener) {
- startBackgroundScan(settings, listener, null);
- }
-
- /** start wifi scan in background
- * @param settings specifies various parameters for the scan; for more information look at
- * {@link ScanSettings}
- * @param workSource WorkSource to blame for power usage
- * @param listener specifies the object to report events to. This object is also treated as a
- * key for this scan, and must also be specified to cancel the scan. Multiple
- * scans should also not share this object.
- * @deprecated Background scan support has always been hardware vendor dependent. This support
- * may not be present on newer devices. Use {@link #startScan(ScanSettings, ScanListener)}
- * instead for single scans.
- */
- @Deprecated
- @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
- public void startBackgroundScan(ScanSettings settings, ScanListener listener,
- WorkSource workSource) {
- Objects.requireNonNull(listener, "listener cannot be null");
- int key = addListener(listener);
- if (key == INVALID_KEY) return;
- validateChannel();
- Bundle scanParams = new Bundle();
- scanParams.putParcelable(SCAN_PARAMS_SCAN_SETTINGS_KEY, settings);
- scanParams.putParcelable(SCAN_PARAMS_WORK_SOURCE_KEY, workSource);
- scanParams.putString(REQUEST_PACKAGE_NAME_KEY, mContext.getOpPackageName());
- scanParams.putString(REQUEST_FEATURE_ID_KEY, mContext.getAttributionTag());
- mAsyncChannel.sendMessage(CMD_START_BACKGROUND_SCAN, 0, key, scanParams);
- }
-
- /**
- * stop an ongoing wifi scan
- * @param listener specifies which scan to cancel; must be same object as passed in {@link
- * #startBackgroundScan}
- * @deprecated Background scan support has always been hardware vendor dependent. This support
- * may not be present on newer devices. Use {@link #startScan(ScanSettings, ScanListener)}
- * instead for single scans.
- */
- @Deprecated
- @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
- public void stopBackgroundScan(ScanListener listener) {
- Objects.requireNonNull(listener, "listener cannot be null");
- int key = removeListener(listener);
- if (key == INVALID_KEY) return;
- validateChannel();
- Bundle scanParams = new Bundle();
- scanParams.putString(REQUEST_PACKAGE_NAME_KEY, mContext.getOpPackageName());
- scanParams.putString(REQUEST_FEATURE_ID_KEY, mContext.getAttributionTag());
- mAsyncChannel.sendMessage(CMD_STOP_BACKGROUND_SCAN, 0, key, scanParams);
- }
-
- /**
- * reports currently available scan results on appropriate listeners
- * @return true if all scan results were reported correctly
- * @deprecated Background scan support has always been hardware vendor dependent. This support
- * may not be present on newer devices. Use {@link #startScan(ScanSettings, ScanListener)}
- * instead for single scans.
- */
- @Deprecated
- @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
- public boolean getScanResults() {
- validateChannel();
- Bundle scanParams = new Bundle();
- scanParams.putString(REQUEST_PACKAGE_NAME_KEY, mContext.getOpPackageName());
- scanParams.putString(REQUEST_FEATURE_ID_KEY, mContext.getAttributionTag());
- Message reply =
- mAsyncChannel.sendMessageSynchronously(CMD_GET_SCAN_RESULTS, 0, 0, scanParams);
- return reply.what == CMD_OP_SUCCEEDED;
- }
-
- /**
- * starts a single scan and reports results asynchronously
- * @param settings specifies various parameters for the scan; for more information look at
- * {@link ScanSettings}
- * @param listener specifies the object to report events to. This object is also treated as a
- * key for this scan, and must also be specified to cancel the scan. Multiple
- * scans should also not share this object.
- */
- @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
- public void startScan(ScanSettings settings, ScanListener listener) {
- startScan(settings, listener, null);
- }
-
- /**
- * starts a single scan and reports results asynchronously
- * @param settings specifies various parameters for the scan; for more information look at
- * {@link ScanSettings}
- * @param listener specifies the object to report events to. This object is also treated as a
- * key for this scan, and must also be specified to cancel the scan. Multiple
- * scans should also not share this object.
- * @param workSource WorkSource to blame for power usage
- */
- @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
- public void startScan(ScanSettings settings, ScanListener listener, WorkSource workSource) {
- startScan(settings, null, listener, workSource);
- }
-
- /**
- * starts a single scan and reports results asynchronously
- * @param settings specifies various parameters for the scan; for more information look at
- * {@link ScanSettings}
- * @param executor the Executor on which to run the callback.
- * @param listener specifies the object to report events to. This object is also treated as a
- * key for this scan, and must also be specified to cancel the scan. Multiple
- * scans should also not share this object.
- * @param workSource WorkSource to blame for power usage
- * @hide
- */
- @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
- public void startScan(ScanSettings settings, @Nullable @CallbackExecutor Executor executor,
- ScanListener listener, WorkSource workSource) {
- Objects.requireNonNull(listener, "listener cannot be null");
- int key = addListener(listener, executor);
- if (key == INVALID_KEY) return;
- validateChannel();
- Bundle scanParams = new Bundle();
- scanParams.putParcelable(SCAN_PARAMS_SCAN_SETTINGS_KEY, settings);
- scanParams.putParcelable(SCAN_PARAMS_WORK_SOURCE_KEY, workSource);
- scanParams.putString(REQUEST_PACKAGE_NAME_KEY, mContext.getOpPackageName());
- scanParams.putString(REQUEST_FEATURE_ID_KEY, mContext.getAttributionTag());
- mAsyncChannel.sendMessage(CMD_START_SINGLE_SCAN, 0, key, scanParams);
- }
-
- /**
- * stops an ongoing single shot scan; only useful after {@link #startScan} if onResults()
- * hasn't been called on the listener, ignored otherwise
- * @param listener
- */
- @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
- public void stopScan(ScanListener listener) {
- Objects.requireNonNull(listener, "listener cannot be null");
- int key = removeListener(listener);
- if (key == INVALID_KEY) return;
- validateChannel();
- Bundle scanParams = new Bundle();
- scanParams.putString(REQUEST_PACKAGE_NAME_KEY, mContext.getOpPackageName());
- scanParams.putString(REQUEST_FEATURE_ID_KEY, mContext.getAttributionTag());
- mAsyncChannel.sendMessage(CMD_STOP_SINGLE_SCAN, 0, key, scanParams);
- }
-
- /**
- * Retrieve the most recent scan results from a single scan request.
- */
- @NonNull
- @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
- public List<ScanResult> getSingleScanResults() {
- validateChannel();
- Bundle scanParams = new Bundle();
- scanParams.putString(REQUEST_PACKAGE_NAME_KEY, mContext.getOpPackageName());
- scanParams.putString(REQUEST_FEATURE_ID_KEY, mContext.getAttributionTag());
- Message reply = mAsyncChannel.sendMessageSynchronously(CMD_GET_SINGLE_SCAN_RESULTS, 0, 0,
- scanParams);
- if (reply.what == WifiScanner.CMD_OP_SUCCEEDED) {
- return Arrays.asList(((ParcelableScanResults) reply.obj).getResults());
- }
- OperationResult result = (OperationResult) reply.obj;
- Log.e(TAG, "Error retrieving SingleScan results reason: " + result.reason
- + " description: " + result.description);
- return new ArrayList<>();
- }
-
- private void startPnoScan(ScanSettings scanSettings, PnoSettings pnoSettings, int key) {
- // Bundle up both the settings and send it across.
- Bundle pnoParams = new Bundle();
- // Set the PNO scan flag.
- scanSettings.isPnoScan = true;
- pnoParams.putParcelable(PNO_PARAMS_SCAN_SETTINGS_KEY, scanSettings);
- pnoParams.putParcelable(PNO_PARAMS_PNO_SETTINGS_KEY, pnoSettings);
- mAsyncChannel.sendMessage(CMD_START_PNO_SCAN, 0, key, pnoParams);
- }
- /**
- * Start wifi connected PNO scan
- * @param scanSettings specifies various parameters for the scan; for more information look at
- * {@link ScanSettings}
- * @param pnoSettings specifies various parameters for PNO; for more information look at
- * {@link PnoSettings}
- * @param executor the Executor on which to run the callback.
- * @param listener specifies the object to report events to. This object is also treated as a
- * key for this scan, and must also be specified to cancel the scan. Multiple
- * scans should also not share this object.
- * {@hide}
- */
- public void startConnectedPnoScan(ScanSettings scanSettings, PnoSettings pnoSettings,
- @NonNull @CallbackExecutor Executor executor, PnoScanListener listener) {
- Objects.requireNonNull(listener, "listener cannot be null");
- Objects.requireNonNull(pnoSettings, "pnoSettings cannot be null");
- int key = addListener(listener, executor);
- if (key == INVALID_KEY) return;
- validateChannel();
- pnoSettings.isConnected = true;
- startPnoScan(scanSettings, pnoSettings, key);
- }
- /**
- * Start wifi disconnected PNO scan
- * @param scanSettings specifies various parameters for the scan; for more information look at
- * {@link ScanSettings}
- * @param pnoSettings specifies various parameters for PNO; for more information look at
- * {@link PnoSettings}
- * @param listener specifies the object to report events to. This object is also treated as a
- * key for this scan, and must also be specified to cancel the scan. Multiple
- * scans should also not share this object.
- * {@hide}
- */
- @RequiresPermission(android.Manifest.permission.NETWORK_STACK)
- public void startDisconnectedPnoScan(ScanSettings scanSettings, PnoSettings pnoSettings,
- @NonNull @CallbackExecutor Executor executor, PnoScanListener listener) {
- Objects.requireNonNull(listener, "listener cannot be null");
- Objects.requireNonNull(pnoSettings, "pnoSettings cannot be null");
- int key = addListener(listener, executor);
- if (key == INVALID_KEY) return;
- validateChannel();
- pnoSettings.isConnected = false;
- startPnoScan(scanSettings, pnoSettings, key);
- }
- /**
- * Stop an ongoing wifi PNO scan
- * @param listener specifies which scan to cancel; must be same object as passed in {@link
- * #startPnoScan}
- * {@hide}
- */
- @RequiresPermission(android.Manifest.permission.NETWORK_STACK)
- public void stopPnoScan(ScanListener listener) {
- Objects.requireNonNull(listener, "listener cannot be null");
- int key = removeListener(listener);
- if (key == INVALID_KEY) return;
- validateChannel();
- mAsyncChannel.sendMessage(CMD_STOP_PNO_SCAN, 0, key);
- }
-
- /** specifies information about an access point of interest */
- @Deprecated
- public static class BssidInfo {
- /** bssid of the access point; in XX:XX:XX:XX:XX:XX format */
- public String bssid;
- /** low signal strength threshold; more information at {@link ScanResult#level} */
- public int low; /* minimum RSSI */
- /** high signal threshold; more information at {@link ScanResult#level} */
- public int high; /* maximum RSSI */
- /** channel frequency (in KHz) where you may find this BSSID */
- public int frequencyHint;
- }
-
- /** @hide */
- @SystemApi
- @Deprecated
- public static class WifiChangeSettings implements Parcelable {
- public int rssiSampleSize; /* sample size for RSSI averaging */
- public int lostApSampleSize; /* samples to confirm AP's loss */
- public int unchangedSampleSize; /* samples to confirm no change */
- public int minApsBreachingThreshold; /* change threshold to trigger event */
- public int periodInMs; /* scan period in millisecond */
- public BssidInfo[] bssidInfos;
-
- /** Implement the Parcelable interface {@hide} */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public void writeToParcel(Parcel dest, int flags) {
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final @NonNull Creator<WifiChangeSettings> CREATOR =
- new Creator<WifiChangeSettings>() {
- public WifiChangeSettings createFromParcel(Parcel in) {
- return new WifiChangeSettings();
- }
-
- public WifiChangeSettings[] newArray(int size) {
- return new WifiChangeSettings[size];
- }
- };
-
- }
-
- /** configure WifiChange detection
- * @param rssiSampleSize number of samples used for RSSI averaging
- * @param lostApSampleSize number of samples to confirm an access point's loss
- * @param unchangedSampleSize number of samples to confirm there are no changes
- * @param minApsBreachingThreshold minimum number of access points that need to be
- * out of range to detect WifiChange
- * @param periodInMs indicates period of scan to find changes
- * @param bssidInfos access points to watch
- */
- @Deprecated
- @SuppressLint("RequiresPermission")
- public void configureWifiChange(
- int rssiSampleSize, /* sample size for RSSI averaging */
- int lostApSampleSize, /* samples to confirm AP's loss */
- int unchangedSampleSize, /* samples to confirm no change */
- int minApsBreachingThreshold, /* change threshold to trigger event */
- int periodInMs, /* period of scan */
- BssidInfo[] bssidInfos /* signal thresholds to cross */
- )
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * interface to get wifi change events on; use this on {@link #startTrackingWifiChange}
- */
- @Deprecated
- public interface WifiChangeListener extends ActionListener {
- /** indicates that changes were detected in wifi environment
- * @param results indicate the access points that exhibited change
- */
- public void onChanging(ScanResult[] results); /* changes are found */
- /** indicates that no wifi changes are being detected for a while
- * @param results indicate the access points that are bing monitored for change
- */
- public void onQuiescence(ScanResult[] results); /* changes settled down */
- }
-
- /**
- * track changes in wifi environment
- * @param listener object to report events on; this object must be unique and must also be
- * provided on {@link #stopTrackingWifiChange}
- */
- @Deprecated
- @SuppressLint("RequiresPermission")
- public void startTrackingWifiChange(WifiChangeListener listener) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * stop tracking changes in wifi environment
- * @param listener object that was provided to report events on {@link
- * #stopTrackingWifiChange}
- */
- @Deprecated
- @SuppressLint("RequiresPermission")
- public void stopTrackingWifiChange(WifiChangeListener listener) {
- throw new UnsupportedOperationException();
- }
-
- /** @hide */
- @SystemApi
- @Deprecated
- @SuppressLint("RequiresPermission")
- public void configureWifiChange(WifiChangeSettings settings) {
- throw new UnsupportedOperationException();
- }
-
- /** interface to receive hotlist events on; use this on {@link #setHotlist} */
- @Deprecated
- public static interface BssidListener extends ActionListener {
- /** indicates that access points were found by on going scans
- * @param results list of scan results, one for each access point visible currently
- */
- public void onFound(ScanResult[] results);
- /** indicates that access points were missed by on going scans
- * @param results list of scan results, for each access point that is not visible anymore
- */
- public void onLost(ScanResult[] results);
- }
-
- /** @hide */
- @SystemApi
- @Deprecated
- public static class HotlistSettings implements Parcelable {
- public BssidInfo[] bssidInfos;
- public int apLostThreshold;
-
- /** Implement the Parcelable interface {@hide} */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public void writeToParcel(Parcel dest, int flags) {
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final @NonNull Creator<HotlistSettings> CREATOR =
- new Creator<HotlistSettings>() {
- public HotlistSettings createFromParcel(Parcel in) {
- HotlistSettings settings = new HotlistSettings();
- return settings;
- }
-
- public HotlistSettings[] newArray(int size) {
- return new HotlistSettings[size];
- }
- };
- }
-
- /**
- * set interesting access points to find
- * @param bssidInfos access points of interest
- * @param apLostThreshold number of scans needed to indicate that AP is lost
- * @param listener object provided to report events on; this object must be unique and must
- * also be provided on {@link #stopTrackingBssids}
- */
- @Deprecated
- @SuppressLint("RequiresPermission")
- public void startTrackingBssids(BssidInfo[] bssidInfos,
- int apLostThreshold, BssidListener listener) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * remove tracking of interesting access points
- * @param listener same object provided in {@link #startTrackingBssids}
- */
- @Deprecated
- @SuppressLint("RequiresPermission")
- public void stopTrackingBssids(BssidListener listener) {
- throw new UnsupportedOperationException();
- }
-
-
- /* private members and methods */
-
- private static final String TAG = "WifiScanner";
- private static final boolean DBG = false;
-
- /* commands for Wifi Service */
- private static final int BASE = Protocol.BASE_WIFI_SCANNER;
-
- /** @hide */
- public static final int CMD_START_BACKGROUND_SCAN = BASE + 2;
- /** @hide */
- public static final int CMD_STOP_BACKGROUND_SCAN = BASE + 3;
- /** @hide */
- public static final int CMD_GET_SCAN_RESULTS = BASE + 4;
- /** @hide */
- public static final int CMD_SCAN_RESULT = BASE + 5;
- /** @hide */
- public static final int CMD_OP_SUCCEEDED = BASE + 17;
- /** @hide */
- public static final int CMD_OP_FAILED = BASE + 18;
- /** @hide */
- public static final int CMD_FULL_SCAN_RESULT = BASE + 20;
- /** @hide */
- public static final int CMD_START_SINGLE_SCAN = BASE + 21;
- /** @hide */
- public static final int CMD_STOP_SINGLE_SCAN = BASE + 22;
- /** @hide */
- public static final int CMD_SINGLE_SCAN_COMPLETED = BASE + 23;
- /** @hide */
- public static final int CMD_START_PNO_SCAN = BASE + 24;
- /** @hide */
- public static final int CMD_STOP_PNO_SCAN = BASE + 25;
- /** @hide */
- public static final int CMD_PNO_NETWORK_FOUND = BASE + 26;
- /** @hide */
- public static final int CMD_REGISTER_SCAN_LISTENER = BASE + 27;
- /** @hide */
- public static final int CMD_DEREGISTER_SCAN_LISTENER = BASE + 28;
- /** @hide */
- public static final int CMD_GET_SINGLE_SCAN_RESULTS = BASE + 29;
- /** @hide */
- public static final int CMD_ENABLE = BASE + 30;
- /** @hide */
- public static final int CMD_DISABLE = BASE + 31;
-
- private Context mContext;
- private IWifiScanner mService;
-
- private static final int INVALID_KEY = 0;
- private int mListenerKey = 1;
-
- private final SparseArray mListenerMap = new SparseArray();
- private final SparseArray<Executor> mExecutorMap = new SparseArray<>();
- private final Object mListenerMapLock = new Object();
-
- private AsyncChannel mAsyncChannel;
- private final Handler mInternalHandler;
-
- /**
- * Create a new WifiScanner instance.
- * Applications will almost always want to use
- * {@link android.content.Context#getSystemService Context.getSystemService()} to retrieve
- * the standard {@link android.content.Context#WIFI_SERVICE Context.WIFI_SERVICE}.
- *
- * @param context the application context
- * @param service the Binder interface for {@link Context#WIFI_SCANNING_SERVICE}
- * @param looper the Looper used to deliver callbacks
- *
- * @hide
- */
- public WifiScanner(@NonNull Context context, @NonNull IWifiScanner service,
- @NonNull Looper looper) {
- mContext = context;
- mService = service;
-
- Messenger messenger = null;
- try {
- messenger = mService.getMessenger();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
-
- if (messenger == null) {
- throw new IllegalStateException("getMessenger() returned null! This is invalid.");
- }
-
- mAsyncChannel = new AsyncChannel();
-
- mInternalHandler = new ServiceHandler(looper);
- mAsyncChannel.connectSync(mContext, mInternalHandler, messenger);
- // We cannot use fullyConnectSync because it sends the FULL_CONNECTION message
- // synchronously, which causes WifiScanningService to receive the wrong replyTo value.
- mAsyncChannel.sendMessage(AsyncChannel.CMD_CHANNEL_FULL_CONNECTION);
- }
-
- private void validateChannel() {
- if (mAsyncChannel == null) throw new IllegalStateException(
- "No permission to access and change wifi or a bad initialization");
- }
-
- private int addListener(ActionListener listener) {
- return addListener(listener, null);
- }
-
- // Add a listener into listener map. If the listener already exists, return INVALID_KEY and
- // send an error message to internal handler; Otherwise add the listener to the listener map and
- // return the key of the listener.
- private int addListener(ActionListener listener, Executor executor) {
- synchronized (mListenerMapLock) {
- boolean keyExists = (getListenerKey(listener) != INVALID_KEY);
- // Note we need to put the listener into listener map even if it's a duplicate as the
- // internal handler will need the key to find the listener. In case of duplicates,
- // removing duplicate key logic will be handled in internal handler.
- int key = putListener(listener);
- if (keyExists) {
- if (DBG) Log.d(TAG, "listener key already exists");
- OperationResult operationResult = new OperationResult(REASON_DUPLICATE_REQEUST,
- "Outstanding request with same key not stopped yet");
- Message message = Message.obtain(mInternalHandler, CMD_OP_FAILED, 0, key,
- operationResult);
- message.sendToTarget();
- return INVALID_KEY;
- } else {
- mExecutorMap.put(key, executor);
- return key;
- }
- }
- }
-
- private int putListener(Object listener) {
- if (listener == null) return INVALID_KEY;
- int key;
- synchronized (mListenerMapLock) {
- do {
- key = mListenerKey++;
- } while (key == INVALID_KEY);
- mListenerMap.put(key, listener);
- }
- return key;
- }
-
- private static class ListenerWithExecutor {
- @Nullable final Object mListener;
- @Nullable final Executor mExecutor;
-
- ListenerWithExecutor(@Nullable Object listener, @Nullable Executor executor) {
- mListener = listener;
- mExecutor = executor;
- }
- }
-
- private ListenerWithExecutor getListenerWithExecutor(int key) {
- if (key == INVALID_KEY) return new ListenerWithExecutor(null, null);
- synchronized (mListenerMapLock) {
- Object listener = mListenerMap.get(key);
- Executor executor = mExecutorMap.get(key);
- return new ListenerWithExecutor(listener, executor);
- }
- }
-
- private int getListenerKey(Object listener) {
- if (listener == null) return INVALID_KEY;
- synchronized (mListenerMapLock) {
- int index = mListenerMap.indexOfValue(listener);
- if (index == -1) {
- return INVALID_KEY;
- } else {
- return mListenerMap.keyAt(index);
- }
- }
- }
-
- private Object removeListener(int key) {
- if (key == INVALID_KEY) return null;
- synchronized (mListenerMapLock) {
- Object listener = mListenerMap.get(key);
- mListenerMap.remove(key);
- mExecutorMap.remove(key);
- return listener;
- }
- }
-
- private int removeListener(Object listener) {
- int key = getListenerKey(listener);
- if (key == INVALID_KEY) {
- Log.e(TAG, "listener cannot be found");
- return key;
- }
- synchronized (mListenerMapLock) {
- mListenerMap.remove(key);
- mExecutorMap.remove(key);
- return key;
- }
- }
-
- /** @hide */
- public static class OperationResult implements Parcelable {
- public int reason;
- public String description;
-
- public OperationResult(int reason, String description) {
- this.reason = reason;
- this.description = description;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(reason);
- dest.writeString(description);
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final @NonNull Creator<OperationResult> CREATOR =
- new Creator<OperationResult>() {
- public OperationResult createFromParcel(Parcel in) {
- int reason = in.readInt();
- String description = in.readString();
- return new OperationResult(reason, description);
- }
-
- public OperationResult[] newArray(int size) {
- return new OperationResult[size];
- }
- };
- }
-
- private class ServiceHandler extends Handler {
- ServiceHandler(Looper looper) {
- super(looper);
- }
- @Override
- public void handleMessage(Message msg) {
- switch (msg.what) {
- case AsyncChannel.CMD_CHANNEL_FULLY_CONNECTED:
- return;
- case AsyncChannel.CMD_CHANNEL_DISCONNECTED:
- Log.e(TAG, "Channel connection lost");
- // This will cause all further async API calls on the WifiManager
- // to fail and throw an exception
- mAsyncChannel = null;
- getLooper().quit();
- return;
- }
-
- ListenerWithExecutor listenerWithExecutor = getListenerWithExecutor(msg.arg2);
- Object listener = listenerWithExecutor.mListener;
-
- if (listener == null) {
- if (DBG) Log.d(TAG, "invalid listener key = " + msg.arg2);
- return;
- } else {
- if (DBG) Log.d(TAG, "listener key = " + msg.arg2);
- }
-
- Executor executor = listenerWithExecutor.mExecutor;
- if (executor == null) {
- executor = new SynchronousExecutor();
- }
-
- switch (msg.what) {
- /* ActionListeners grouped together */
- case CMD_OP_SUCCEEDED: {
- ActionListener actionListener = (ActionListener) listener;
- Binder.clearCallingIdentity();
- executor.execute(actionListener::onSuccess);
- } break;
- case CMD_OP_FAILED: {
- OperationResult result = (OperationResult) msg.obj;
- ActionListener actionListener = (ActionListener) listener;
- removeListener(msg.arg2);
- Binder.clearCallingIdentity();
- executor.execute(() ->
- actionListener.onFailure(result.reason, result.description));
- } break;
- case CMD_SCAN_RESULT: {
- ScanListener scanListener = (ScanListener) listener;
- ParcelableScanData parcelableScanData = (ParcelableScanData) msg.obj;
- Binder.clearCallingIdentity();
- executor.execute(() -> scanListener.onResults(parcelableScanData.getResults()));
- } break;
- case CMD_FULL_SCAN_RESULT: {
- ScanResult result = (ScanResult) msg.obj;
- ScanListener scanListener = ((ScanListener) listener);
- Binder.clearCallingIdentity();
- executor.execute(() -> scanListener.onFullResult(result));
- } break;
- case CMD_SINGLE_SCAN_COMPLETED: {
- if (DBG) Log.d(TAG, "removing listener for single scan");
- removeListener(msg.arg2);
- } break;
- case CMD_PNO_NETWORK_FOUND: {
- PnoScanListener pnoScanListener = (PnoScanListener) listener;
- ParcelableScanResults parcelableScanResults = (ParcelableScanResults) msg.obj;
- Binder.clearCallingIdentity();
- executor.execute(() ->
- pnoScanListener.onPnoNetworkFound(parcelableScanResults.getResults()));
- } break;
- default: {
- if (DBG) Log.d(TAG, "Ignoring message " + msg.what);
- } break;
- }
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/WifiSsid.java b/wifi/java/android/net/wifi/WifiSsid.java
deleted file mode 100644
index 704ae81..0000000
--- a/wifi/java/android/net/wifi/WifiSsid.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Copyright (C) 2012 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.NonNull;
-import android.annotation.Nullable;
-import android.compat.annotation.UnsupportedAppUsage;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.io.ByteArrayOutputStream;
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CoderResult;
-import java.nio.charset.CodingErrorAction;
-import java.util.Arrays;
-import java.util.Locale;
-
-/**
- * Stores SSID octets and handles conversion.
- *
- * For Ascii encoded string, any octet < 32 or > 127 is encoded as
- * a "\x" followed by the hex representation of the octet.
- * Exception chars are ", \, \e, \n, \r, \t which are escaped by a \
- * See src/utils/common.c for the implementation in the supplicant.
- *
- * @hide
- */
-public final class WifiSsid implements Parcelable {
- private static final String TAG = "WifiSsid";
-
- @UnsupportedAppUsage
- public final ByteArrayOutputStream octets = new ByteArrayOutputStream(32);
-
- private static final int HEX_RADIX = 16;
-
- @UnsupportedAppUsage
- public static final String NONE = WifiManager.UNKNOWN_SSID;
-
- private WifiSsid() {
- }
-
- /**
- * Create a WifiSsid from a raw byte array. If the byte array is null, return an empty WifiSsid
- * object.
- */
- @NonNull
- public static WifiSsid createFromByteArray(@Nullable byte[] ssid) {
- WifiSsid wifiSsid = new WifiSsid();
- if (ssid != null) {
- wifiSsid.octets.write(ssid, 0 /* the start offset */, ssid.length);
- }
- return wifiSsid;
- }
-
- @UnsupportedAppUsage
- public static WifiSsid createFromAsciiEncoded(String asciiEncoded) {
- WifiSsid a = new WifiSsid();
- a.convertToBytes(asciiEncoded);
- return a;
- }
-
- public static WifiSsid createFromHex(String hexStr) {
- WifiSsid a = new WifiSsid();
- if (hexStr == null) return a;
-
- if (hexStr.startsWith("0x") || hexStr.startsWith("0X")) {
- hexStr = hexStr.substring(2);
- }
-
- for (int i = 0; i < hexStr.length()-1; i += 2) {
- int val;
- try {
- val = Integer.parseInt(hexStr.substring(i, i + 2), HEX_RADIX);
- } catch(NumberFormatException e) {
- val = 0;
- }
- a.octets.write(val);
- }
- return a;
- }
-
- /* This function is equivalent to printf_decode() at src/utils/common.c in
- * the supplicant */
- private void convertToBytes(String asciiEncoded) {
- int i = 0;
- int val = 0;
- while (i< asciiEncoded.length()) {
- char c = asciiEncoded.charAt(i);
- switch (c) {
- case '\\':
- i++;
- switch(asciiEncoded.charAt(i)) {
- case '\\':
- octets.write('\\');
- i++;
- break;
- case '"':
- octets.write('"');
- i++;
- break;
- case 'n':
- octets.write('\n');
- i++;
- break;
- case 'r':
- octets.write('\r');
- i++;
- break;
- case 't':
- octets.write('\t');
- i++;
- break;
- case 'e':
- octets.write(27); //escape char
- i++;
- break;
- case 'x':
- i++;
- try {
- val = Integer.parseInt(asciiEncoded.substring(i, i + 2), HEX_RADIX);
- } catch (NumberFormatException e) {
- val = -1;
- } catch (StringIndexOutOfBoundsException e) {
- val = -1;
- }
- if (val < 0) {
- val = Character.digit(asciiEncoded.charAt(i), HEX_RADIX);
- if (val < 0) break;
- octets.write(val);
- i++;
- } else {
- octets.write(val);
- i += 2;
- }
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- val = asciiEncoded.charAt(i) - '0';
- i++;
- if (asciiEncoded.charAt(i) >= '0' && asciiEncoded.charAt(i) <= '7') {
- val = val * 8 + asciiEncoded.charAt(i) - '0';
- i++;
- }
- if (asciiEncoded.charAt(i) >= '0' && asciiEncoded.charAt(i) <= '7') {
- val = val * 8 + asciiEncoded.charAt(i) - '0';
- i++;
- }
- octets.write(val);
- break;
- default:
- break;
- }
- break;
- default:
- octets.write(c);
- i++;
- break;
- }
- }
- }
-
- /**
- * Converts this SSID to an unquoted UTF-8 String representation.
- * @return the SSID string, or {@link WifiManager#UNKNOWN_SSID} if there was an error.
- */
- @Override
- public String toString() {
- byte[] ssidBytes = octets.toByteArray();
- // Supplicant returns \x00\x00\x00\x00\x00\x00\x00\x00 hex string
- // for a hidden access point. Make sure we maintain the previous
- // behavior of returning empty string for this case.
- if (octets.size() <= 0 || isArrayAllZeroes(ssidBytes)) return "";
- // TODO: Handle conversion to other charsets upon failure
- Charset charset = Charset.forName("UTF-8");
- CharsetDecoder decoder = charset.newDecoder()
- .onMalformedInput(CodingErrorAction.REPLACE)
- .onUnmappableCharacter(CodingErrorAction.REPLACE);
- CharBuffer out = CharBuffer.allocate(32);
-
- CoderResult result = decoder.decode(ByteBuffer.wrap(ssidBytes), out, true);
- out.flip();
- if (result.isError()) {
- return WifiManager.UNKNOWN_SSID;
- }
- return out.toString();
- }
-
- @Override
- public boolean equals(Object thatObject) {
- if (this == thatObject) {
- return true;
- }
- if (!(thatObject instanceof WifiSsid)) {
- return false;
- }
- WifiSsid that = (WifiSsid) thatObject;
- return Arrays.equals(octets.toByteArray(), that.octets.toByteArray());
- }
-
- @Override
- public int hashCode() {
- return Arrays.hashCode(octets.toByteArray());
- }
-
- private boolean isArrayAllZeroes(byte[] ssidBytes) {
- for (int i = 0; i< ssidBytes.length; i++) {
- if (ssidBytes[i] != 0) return false;
- }
- return true;
- }
-
- /** @hide */
- public boolean isHidden() {
- return isArrayAllZeroes(octets.toByteArray());
- }
-
- /** @hide */
- @UnsupportedAppUsage
- public byte[] getOctets() {
- return octets.toByteArray();
- }
-
- /** @hide */
- public String getHexString() {
- String out = "0x";
- byte[] ssidbytes = getOctets();
- for (int i = 0; i < octets.size(); i++) {
- out += String.format(Locale.US, "%02x", ssidbytes[i]);
- }
- return (octets.size() > 0) ? out : null;
- }
-
- /** Implement the Parcelable interface */
- @Override
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface */
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- dest.writeInt(octets.size());
- dest.writeByteArray(octets.toByteArray());
- }
-
- /** Implement the Parcelable interface */
- @UnsupportedAppUsage
- public static final @NonNull Creator<WifiSsid> CREATOR =
- new Creator<WifiSsid>() {
- @Override
- public WifiSsid createFromParcel(Parcel in) {
- WifiSsid ssid = new WifiSsid();
- int length = in.readInt();
- byte[] b = new byte[length];
- in.readByteArray(b);
- ssid.octets.write(b, 0, length);
- return ssid;
- }
-
- @Override
- public WifiSsid[] newArray(int size) {
- return new WifiSsid[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/WifiUsabilityStatsEntry.java b/wifi/java/android/net/wifi/WifiUsabilityStatsEntry.java
deleted file mode 100644
index 8f3635f..0000000
--- a/wifi/java/android/net/wifi/WifiUsabilityStatsEntry.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- * 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.net.wifi;
-
-import android.annotation.IntDef;
-import android.annotation.SystemApi;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import android.telephony.Annotation.NetworkType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * This class makes a subset of
- * com.android.server.wifi.nano.WifiMetricsProto.WifiUsabilityStatsEntry parcelable.
- *
- * @hide
- */
-@SystemApi
-public final class WifiUsabilityStatsEntry implements Parcelable {
- /** {@hide} */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = {"PROBE_STATUS_"}, value = {
- PROBE_STATUS_UNKNOWN,
- PROBE_STATUS_NO_PROBE,
- PROBE_STATUS_SUCCESS,
- PROBE_STATUS_FAILURE})
- public @interface ProbeStatus {}
-
- /** Link probe status is unknown */
- public static final int PROBE_STATUS_UNKNOWN = 0;
- /** Link probe is not triggered */
- public static final int PROBE_STATUS_NO_PROBE = 1;
- /** Link probe is triggered and the result is success */
- public static final int PROBE_STATUS_SUCCESS = 2;
- /** Link probe is triggered and the result is failure */
- public static final int PROBE_STATUS_FAILURE = 3;
-
- /** Absolute milliseconds from device boot when these stats were sampled */
- private final long mTimeStampMillis;
- /** The RSSI (in dBm) at the sample time */
- private final int mRssi;
- /** Link speed at the sample time in Mbps */
- private final int mLinkSpeedMbps;
- /** The total number of tx success counted from the last radio chip reset */
- private final long mTotalTxSuccess;
- /** The total number of MPDU data packet retries counted from the last radio chip reset */
- private final long mTotalTxRetries;
- /** The total number of tx bad counted from the last radio chip reset */
- private final long mTotalTxBad;
- /** The total number of rx success counted from the last radio chip reset */
- private final long mTotalRxSuccess;
- /** The total time the wifi radio is on in ms counted from the last radio chip reset */
- private final long mTotalRadioOnTimeMillis;
- /** The total time the wifi radio is doing tx in ms counted from the last radio chip reset */
- private final long mTotalRadioTxTimeMillis;
- /** The total time the wifi radio is doing rx in ms counted from the last radio chip reset */
- private final long mTotalRadioRxTimeMillis;
- /** The total time spent on all types of scans in ms counted from the last radio chip reset */
- private final long mTotalScanTimeMillis;
- /** The total time spent on nan scans in ms counted from the last radio chip reset */
- private final long mTotalNanScanTimeMillis;
- /** The total time spent on background scans in ms counted from the last radio chip reset */
- private final long mTotalBackgroundScanTimeMillis;
- /** The total time spent on roam scans in ms counted from the last radio chip reset */
- private final long mTotalRoamScanTimeMillis;
- /** The total time spent on pno scans in ms counted from the last radio chip reset */
- private final long mTotalPnoScanTimeMillis;
- /** The total time spent on hotspot2.0 scans and GAS exchange in ms counted from the last radio
- * chip reset */
- private final long mTotalHotspot2ScanTimeMillis;
- /** The total time CCA is on busy status on the current frequency in ms counted from the last
- * radio chip reset */
- private final long mTotalCcaBusyFreqTimeMillis;
- /** The total radio on time on the current frequency from the last radio chip reset */
- private final long mTotalRadioOnFreqTimeMillis;
- /** The total number of beacons received from the last radio chip reset */
- private final long mTotalBeaconRx;
- /** The status of link probe since last stats update */
- @ProbeStatus private final int mProbeStatusSinceLastUpdate;
- /** The elapsed time of the most recent link probe since last stats update */
- private final int mProbeElapsedTimeSinceLastUpdateMillis;
- /** The MCS rate of the most recent link probe since last stats update */
- private final int mProbeMcsRateSinceLastUpdate;
- /** Rx link speed at the sample time in Mbps */
- private final int mRxLinkSpeedMbps;
- private final @NetworkType int mCellularDataNetworkType;
- private final int mCellularSignalStrengthDbm;
- private final int mCellularSignalStrengthDb;
- private final boolean mIsSameRegisteredCell;
-
- /** Constructor function {@hide} */
- public WifiUsabilityStatsEntry(long timeStampMillis, int rssi, int linkSpeedMbps,
- long totalTxSuccess, long totalTxRetries, long totalTxBad, long totalRxSuccess,
- long totalRadioOnTimeMillis, long totalRadioTxTimeMillis, long totalRadioRxTimeMillis,
- long totalScanTimeMillis, long totalNanScanTimeMillis,
- long totalBackgroundScanTimeMillis,
- long totalRoamScanTimeMillis, long totalPnoScanTimeMillis,
- long totalHotspot2ScanTimeMillis,
- long totalCcaBusyFreqTimeMillis, long totalRadioOnFreqTimeMillis, long totalBeaconRx,
- @ProbeStatus int probeStatusSinceLastUpdate, int probeElapsedTimeSinceLastUpdateMillis,
- int probeMcsRateSinceLastUpdate, int rxLinkSpeedMbps,
- @NetworkType int cellularDataNetworkType,
- int cellularSignalStrengthDbm, int cellularSignalStrengthDb,
- boolean isSameRegisteredCell) {
- mTimeStampMillis = timeStampMillis;
- mRssi = rssi;
- mLinkSpeedMbps = linkSpeedMbps;
- mTotalTxSuccess = totalTxSuccess;
- mTotalTxRetries = totalTxRetries;
- mTotalTxBad = totalTxBad;
- mTotalRxSuccess = totalRxSuccess;
- mTotalRadioOnTimeMillis = totalRadioOnTimeMillis;
- mTotalRadioTxTimeMillis = totalRadioTxTimeMillis;
- mTotalRadioRxTimeMillis = totalRadioRxTimeMillis;
- mTotalScanTimeMillis = totalScanTimeMillis;
- mTotalNanScanTimeMillis = totalNanScanTimeMillis;
- mTotalBackgroundScanTimeMillis = totalBackgroundScanTimeMillis;
- mTotalRoamScanTimeMillis = totalRoamScanTimeMillis;
- mTotalPnoScanTimeMillis = totalPnoScanTimeMillis;
- mTotalHotspot2ScanTimeMillis = totalHotspot2ScanTimeMillis;
- mTotalCcaBusyFreqTimeMillis = totalCcaBusyFreqTimeMillis;
- mTotalRadioOnFreqTimeMillis = totalRadioOnFreqTimeMillis;
- mTotalBeaconRx = totalBeaconRx;
- mProbeStatusSinceLastUpdate = probeStatusSinceLastUpdate;
- mProbeElapsedTimeSinceLastUpdateMillis = probeElapsedTimeSinceLastUpdateMillis;
- mProbeMcsRateSinceLastUpdate = probeMcsRateSinceLastUpdate;
- mRxLinkSpeedMbps = rxLinkSpeedMbps;
- mCellularDataNetworkType = cellularDataNetworkType;
- mCellularSignalStrengthDbm = cellularSignalStrengthDbm;
- mCellularSignalStrengthDb = cellularSignalStrengthDb;
- mIsSameRegisteredCell = isSameRegisteredCell;
- }
-
- /** Implement the Parcelable interface */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeLong(mTimeStampMillis);
- dest.writeInt(mRssi);
- dest.writeInt(mLinkSpeedMbps);
- dest.writeLong(mTotalTxSuccess);
- dest.writeLong(mTotalTxRetries);
- dest.writeLong(mTotalTxBad);
- dest.writeLong(mTotalRxSuccess);
- dest.writeLong(mTotalRadioOnTimeMillis);
- dest.writeLong(mTotalRadioTxTimeMillis);
- dest.writeLong(mTotalRadioRxTimeMillis);
- dest.writeLong(mTotalScanTimeMillis);
- dest.writeLong(mTotalNanScanTimeMillis);
- dest.writeLong(mTotalBackgroundScanTimeMillis);
- dest.writeLong(mTotalRoamScanTimeMillis);
- dest.writeLong(mTotalPnoScanTimeMillis);
- dest.writeLong(mTotalHotspot2ScanTimeMillis);
- dest.writeLong(mTotalCcaBusyFreqTimeMillis);
- dest.writeLong(mTotalRadioOnFreqTimeMillis);
- dest.writeLong(mTotalBeaconRx);
- dest.writeInt(mProbeStatusSinceLastUpdate);
- dest.writeInt(mProbeElapsedTimeSinceLastUpdateMillis);
- dest.writeInt(mProbeMcsRateSinceLastUpdate);
- dest.writeInt(mRxLinkSpeedMbps);
- dest.writeInt(mCellularDataNetworkType);
- dest.writeInt(mCellularSignalStrengthDbm);
- dest.writeInt(mCellularSignalStrengthDb);
- dest.writeBoolean(mIsSameRegisteredCell);
- }
-
- /** Implement the Parcelable interface */
- public static final @android.annotation.NonNull Creator<WifiUsabilityStatsEntry> CREATOR =
- new Creator<WifiUsabilityStatsEntry>() {
- public WifiUsabilityStatsEntry createFromParcel(Parcel in) {
- return new WifiUsabilityStatsEntry(
- in.readLong(), in.readInt(),
- in.readInt(), in.readLong(), in.readLong(),
- in.readLong(), in.readLong(), in.readLong(),
- in.readLong(), in.readLong(), in.readLong(),
- in.readLong(), in.readLong(), in.readLong(),
- in.readLong(), in.readLong(), in.readLong(),
- in.readLong(), in.readLong(), in.readInt(),
- in.readInt(), in.readInt(), in.readInt(),
- in.readInt(), in.readInt(), in.readInt(),
- in.readBoolean()
- );
- }
-
- public WifiUsabilityStatsEntry[] newArray(int size) {
- return new WifiUsabilityStatsEntry[size];
- }
- };
-
- /** Absolute milliseconds from device boot when these stats were sampled */
- public long getTimeStampMillis() {
- return mTimeStampMillis;
- }
-
- /** The RSSI (in dBm) at the sample time */
- public int getRssi() {
- return mRssi;
- }
-
- /** Link speed at the sample time in Mbps */
- public int getLinkSpeedMbps() {
- return mLinkSpeedMbps;
- }
-
- /** The total number of tx success counted from the last radio chip reset */
- public long getTotalTxSuccess() {
- return mTotalTxSuccess;
- }
-
- /** The total number of MPDU data packet retries counted from the last radio chip reset */
- public long getTotalTxRetries() {
- return mTotalTxRetries;
- }
-
- /** The total number of tx bad counted from the last radio chip reset */
- public long getTotalTxBad() {
- return mTotalTxBad;
- }
-
- /** The total number of rx success counted from the last radio chip reset */
- public long getTotalRxSuccess() {
- return mTotalRxSuccess;
- }
-
- /** The total time the wifi radio is on in ms counted from the last radio chip reset */
- public long getTotalRadioOnTimeMillis() {
- return mTotalRadioOnTimeMillis;
- }
-
- /** The total time the wifi radio is doing tx in ms counted from the last radio chip reset */
- public long getTotalRadioTxTimeMillis() {
- return mTotalRadioTxTimeMillis;
- }
-
- /** The total time the wifi radio is doing rx in ms counted from the last radio chip reset */
- public long getTotalRadioRxTimeMillis() {
- return mTotalRadioRxTimeMillis;
- }
-
- /** The total time spent on all types of scans in ms counted from the last radio chip reset */
- public long getTotalScanTimeMillis() {
- return mTotalScanTimeMillis;
- }
-
- /** The total time spent on nan scans in ms counted from the last radio chip reset */
- public long getTotalNanScanTimeMillis() {
- return mTotalNanScanTimeMillis;
- }
-
- /** The total time spent on background scans in ms counted from the last radio chip reset */
- public long getTotalBackgroundScanTimeMillis() {
- return mTotalBackgroundScanTimeMillis;
- }
-
- /** The total time spent on roam scans in ms counted from the last radio chip reset */
- public long getTotalRoamScanTimeMillis() {
- return mTotalRoamScanTimeMillis;
- }
-
- /** The total time spent on pno scans in ms counted from the last radio chip reset */
- public long getTotalPnoScanTimeMillis() {
- return mTotalPnoScanTimeMillis;
- }
-
- /** The total time spent on hotspot2.0 scans and GAS exchange in ms counted from the last radio
- * chip reset */
- public long getTotalHotspot2ScanTimeMillis() {
- return mTotalHotspot2ScanTimeMillis;
- }
-
- /** The total time CCA is on busy status on the current frequency in ms counted from the last
- * radio chip reset */
- public long getTotalCcaBusyFreqTimeMillis() {
- return mTotalCcaBusyFreqTimeMillis;
- }
-
- /** The total radio on time on the current frequency from the last radio chip reset */
- public long getTotalRadioOnFreqTimeMillis() {
- return mTotalRadioOnFreqTimeMillis;
- }
-
- /** The total number of beacons received from the last radio chip reset */
- public long getTotalBeaconRx() {
- return mTotalBeaconRx;
- }
-
- /** The status of link probe since last stats update */
- @ProbeStatus public int getProbeStatusSinceLastUpdate() {
- return mProbeStatusSinceLastUpdate;
- }
-
- /** The elapsed time of the most recent link probe since last stats update */
- public int getProbeElapsedTimeSinceLastUpdateMillis() {
- return mProbeElapsedTimeSinceLastUpdateMillis;
- }
-
- /** The MCS rate of the most recent link probe since last stats update */
- public int getProbeMcsRateSinceLastUpdate() {
- return mProbeMcsRateSinceLastUpdate;
- }
-
- /** Rx link speed at the sample time in Mbps */
- public int getRxLinkSpeedMbps() {
- return mRxLinkSpeedMbps;
- }
-
- /** Cellular data network type currently in use on the device for data transmission */
- @NetworkType public int getCellularDataNetworkType() {
- return mCellularDataNetworkType;
- }
-
- /**
- * Cellular signal strength in dBm, NR: CsiRsrp, LTE: Rsrp, WCDMA/TDSCDMA: Rscp,
- * CDMA: Rssi, EVDO: Rssi, GSM: Rssi
- */
- public int getCellularSignalStrengthDbm() {
- return mCellularSignalStrengthDbm;
- }
-
- /**
- * Cellular signal strength in dB, NR: CsiSinr, LTE: Rsrq, WCDMA: EcNo, TDSCDMA: invalid,
- * CDMA: Ecio, EVDO: SNR, GSM: invalid
- */
- public int getCellularSignalStrengthDb() {
- return mCellularSignalStrengthDb;
- }
-
- /** Whether the primary registered cell of current entry is same as that of previous entry */
- public boolean isSameRegisteredCell() {
- return mIsSameRegisteredCell;
- }
-}
diff --git a/wifi/java/android/net/wifi/WpsInfo.java b/wifi/java/android/net/wifi/WpsInfo.java
deleted file mode 100644
index 689ace5b..0000000
--- a/wifi/java/android/net/wifi/WpsInfo.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2011 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.os.Parcel;
-import android.os.Parcelable;
-
-/**
- * A class representing Wi-Fi Protected Setup
- *
- * {@see android.net.wifi.p2p.WifiP2pConfig}
- */
-public class WpsInfo implements Parcelable {
-
- /** Push button configuration */
- public static final int PBC = 0;
- /** Display pin method configuration - pin is generated and displayed on device */
- public static final int DISPLAY = 1;
- /** Keypad pin method configuration - pin is entered on device */
- public static final int KEYPAD = 2;
- /** Label pin method configuration - pin is labelled on device */
- public static final int LABEL = 3;
- /** Invalid configuration */
- public static final int INVALID = 4;
-
- /** Wi-Fi Protected Setup. www.wi-fi.org/wifi-protected-setup has details */
- public int setup;
-
- /** Passed with pin method KEYPAD */
- public String BSSID;
-
- /** Passed with pin method configuration */
- public String pin;
-
- public WpsInfo() {
- setup = INVALID;
- BSSID = null;
- pin = null;
- }
-
- public String toString() {
- StringBuffer sbuf = new StringBuffer();
- sbuf.append(" setup: ").append(setup);
- sbuf.append('\n');
- sbuf.append(" BSSID: ").append(BSSID);
- sbuf.append('\n');
- sbuf.append(" pin: ").append(pin);
- sbuf.append('\n');
- return sbuf.toString();
- }
-
- /** Implement the Parcelable interface */
- public int describeContents() {
- return 0;
- }
-
- /* Copy constructor */
- public WpsInfo(WpsInfo source) {
- if (source != null) {
- setup = source.setup;
- BSSID = source.BSSID;
- pin = source.pin;
- }
- }
-
- /** Implement the Parcelable interface */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(setup);
- dest.writeString(BSSID);
- dest.writeString(pin);
- }
-
- /** Implement the Parcelable interface */
- public static final @android.annotation.NonNull Creator<WpsInfo> CREATOR =
- new Creator<WpsInfo>() {
- public WpsInfo createFromParcel(Parcel in) {
- WpsInfo config = new WpsInfo();
- config.setup = in.readInt();
- config.BSSID = in.readString();
- config.pin = in.readString();
- return config;
- }
-
- public WpsInfo[] newArray(int size) {
- return new WpsInfo[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/aware/AttachCallback.java b/wifi/java/android/net/wifi/aware/AttachCallback.java
deleted file mode 100644
index c368b46..0000000
--- a/wifi/java/android/net/wifi/aware/AttachCallback.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-/**
- * Base class for Aware attach callbacks. Should be extended by applications and set when calling
- * {@link WifiAwareManager#attach(AttachCallback, android.os.Handler)}. These are callbacks
- * applying to the Aware connection as a whole - not to specific publish or subscribe sessions -
- * for that see {@link DiscoverySessionCallback}.
- */
-public class AttachCallback {
- /**
- * Called when Aware attach operation
- * {@link WifiAwareManager#attach(AttachCallback, android.os.Handler)}
- * is completed and that we can now start discovery sessions or connections.
- *
- * @param session The Aware object on which we can execute further Aware operations - e.g.
- * discovery, connections.
- */
- public void onAttached(WifiAwareSession session) {
- /* empty */
- }
-
- /**
- * Called when Aware attach operation
- * {@link WifiAwareManager#attach(AttachCallback, android.os.Handler)} failed.
- */
- public void onAttachFailed() {
- /* empty */
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/AwareResources.java b/wifi/java/android/net/wifi/aware/AwareResources.java
deleted file mode 100644
index cee1f40..0000000
--- a/wifi/java/android/net/wifi/aware/AwareResources.java
+++ /dev/null
@@ -1,146 +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 android.net.wifi.aware;
-
-import android.annotation.NonNull;
-import android.os.Handler;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-/**
- * The resources of the Aware service.
- */
-public final class AwareResources implements Parcelable {
- /**
- * Number of the NDPs are available.
- */
- private int mNumOfAvailableNdps;
-
- /**
- * Number of the publish sessions are available.
- */
- private int mNumOfAvailablePublishSessions;
-
- /**
- * Number of the subscribe sessions are available.
- */
- private int mNumOfAvailableSubscribeSessions;
-
- /**
- * @hide : should not be created by apps
- */
- public AwareResources() {
- }
-
- /**
- * Return the number of Aware data-paths (also known as NDPs - NAN Data Paths) which an app
- * could create. Please refer to the {@link WifiAwareNetworkSpecifier} to create
- * a Network Specifier and request a data-path.
- * <p>
- * Note that these resources aren't reserved - other apps could use them by the time you
- * attempt to create a data-path.
- * </p>
- * @return A Non-negative integer, number of data-paths that could be created.
- */
- public int getNumOfAvailableDataPaths() {
- return mNumOfAvailableNdps;
- }
-
- /**
- * Return the number of Aware publish sessions which an app could create. Please refer to the
- * {@link WifiAwareSession#publish(PublishConfig, DiscoverySessionCallback, Handler)}
- * to create a publish session.
- * <p>
- * Note that these resources aren't reserved - other apps could use them by the time you
- * attempt to create a publish session.
- * </p>
- * @return A Non-negative integer, number of publish sessions that could be created.
- */
- public int getNumOfAvailablePublishSessions() {
- return mNumOfAvailablePublishSessions;
- }
-
- /**
- * Return the number of Aware subscribe sessions which an app could create. Please refer to the
- * {@link WifiAwareSession#subscribe(SubscribeConfig, DiscoverySessionCallback, Handler)}
- * to create a publish session.
- * <p>
- * Note that these resources aren't reserved - other apps could use them by the time you
- * attempt to create a subscribe session.
- * </p>
- * @return A Non-negative integer, number of subscribe sessions that could be created.
- */
- public int getNumOfAvailableSubscribeSessions() {
- return mNumOfAvailableSubscribeSessions;
- }
-
- /**
- * Set the number of the available NDPs.
- * @hide
- * @param numOfAvailableNdps Number of available NDPs.
- */
- public void setNumOfAvailableDataPaths(int numOfAvailableNdps) {
- mNumOfAvailableNdps = numOfAvailableNdps;
- }
-
- /**
- * Set the number of the available publish sessions.
- * @hide
- * @param numOfAvailablePublishSessions Number of available publish sessions.
- */
- public void setNumOfAvailablePublishSessions(int numOfAvailablePublishSessions) {
- mNumOfAvailablePublishSessions = numOfAvailablePublishSessions;
- }
-
- /**
- * Set the number of the available subscribe sessions.
- * @hide
- * @param numOfAvailableSubscribeSessions Number of available subscribe sessions.
- */
- public void setNumOfAvailableSubscribeSessions(int numOfAvailableSubscribeSessions) {
- mNumOfAvailableSubscribeSessions = numOfAvailableSubscribeSessions;
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- dest.writeInt(mNumOfAvailableNdps);
- dest.writeInt(mNumOfAvailablePublishSessions);
- dest.writeInt(mNumOfAvailableSubscribeSessions);
- }
-
- public static final @android.annotation.NonNull Creator<AwareResources> CREATOR =
- new Creator<AwareResources>() {
- @Override
- public AwareResources createFromParcel(Parcel in) {
- AwareResources awareResources = new AwareResources();
- awareResources.setNumOfAvailableDataPaths(in.readInt());
- awareResources.setNumOfAvailablePublishSessions(in.readInt());
- awareResources.setNumOfAvailableSubscribeSessions(in.readInt());
- return awareResources;
- }
-
- @Override
- public AwareResources[] newArray(int size) {
- return new AwareResources[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/aware/Characteristics.java b/wifi/java/android/net/wifi/aware/Characteristics.java
deleted file mode 100644
index 9bdda7f..0000000
--- a/wifi/java/android/net/wifi/aware/Characteristics.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import android.annotation.IntDef;
-import android.os.Bundle;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import com.android.modules.utils.build.SdkLevel;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * The characteristics of the Wi-Fi Aware implementation.
- */
-public final class Characteristics implements Parcelable {
- /** @hide */
- public static final String KEY_MAX_SERVICE_NAME_LENGTH = "key_max_service_name_length";
- /** @hide */
- public static final String KEY_MAX_SERVICE_SPECIFIC_INFO_LENGTH =
- "key_max_service_specific_info_length";
- /** @hide */
- public static final String KEY_MAX_MATCH_FILTER_LENGTH = "key_max_match_filter_length";
- /** @hide */
- public static final String KEY_SUPPORTED_CIPHER_SUITES = "key_supported_cipher_suites";
- /** @hide */
- public static final String KEY_IS_INSTANT_COMMUNICATION_MODE_SUPPORTED =
- "key_is_instant_communication_mode_supported";
-
- private Bundle mCharacteristics = new Bundle();
-
- /** @hide : should not be created by apps */
- public Characteristics(Bundle characteristics) {
- mCharacteristics = characteristics;
- }
-
- /**
- * Returns the maximum string length that can be used to specify a Aware service name. Restricts
- * the parameters of the {@link PublishConfig.Builder#setServiceName(String)} and
- * {@link SubscribeConfig.Builder#setServiceName(String)}.
- *
- * @return A positive integer, maximum string length of Aware service name.
- */
- public int getMaxServiceNameLength() {
- return mCharacteristics.getInt(KEY_MAX_SERVICE_NAME_LENGTH);
- }
-
- /**
- * Returns the maximum length of byte array that can be used to specify a Aware service specific
- * information field: the arbitrary load used in discovery or the message length of Aware
- * message exchange. Restricts the parameters of the
- * {@link PublishConfig.Builder#setServiceSpecificInfo(byte[])},
- * {@link SubscribeConfig.Builder#setServiceSpecificInfo(byte[])}, and
- * {@link DiscoverySession#sendMessage(PeerHandle, int, byte[])}
- * variants.
- *
- * @return A positive integer, maximum length of byte array for Aware messaging.
- */
- public int getMaxServiceSpecificInfoLength() {
- return mCharacteristics.getInt(KEY_MAX_SERVICE_SPECIFIC_INFO_LENGTH);
- }
-
- /**
- * Returns the maximum length of byte array that can be used to specify a Aware match filter.
- * Restricts the parameters of the
- * {@link PublishConfig.Builder#setMatchFilter(java.util.List)} and
- * {@link SubscribeConfig.Builder#setMatchFilter(java.util.List)}.
- *
- * @return A positive integer, maximum length of byte array for Aware discovery match filter.
- */
- public int getMaxMatchFilterLength() {
- return mCharacteristics.getInt(KEY_MAX_MATCH_FILTER_LENGTH);
- }
-
- /**
- * Check if instant communication mode is supported by device.
- * @return True if supported, false otherwise.
- */
- public boolean isInstantCommunicationModeSupported() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- return mCharacteristics.getBoolean(KEY_IS_INSTANT_COMMUNICATION_MODE_SUPPORTED);
- }
-
- /** @hide */
- @IntDef(flag = true, prefix = { "WIFI_AWARE_CIPHER_SUITE_" }, value = {
- WIFI_AWARE_CIPHER_SUITE_NCS_SK_128,
- WIFI_AWARE_CIPHER_SUITE_NCS_SK_256,
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface WifiAwareCipherSuites {}
-
- /**
- * Wi-Fi Aware supported ciphier suite representing NCS SK 128: 128 bit shared-key.
- */
- public static final int WIFI_AWARE_CIPHER_SUITE_NCS_SK_128 = 1 << 0;
-
- /**
- * Wi-Fi Aware supported ciphier suite representing NCS SK 256: 256 bit shared-key.
- */
- public static final int WIFI_AWARE_CIPHER_SUITE_NCS_SK_256 = 1 << 1;
-
- /**
- * Returns the set of cipher suites supported by the device for use in Wi-Fi Aware data-paths.
- * The device automatically picks the strongest cipher suite when initiating a data-path setup.
- *
- * @return A set of flags from {@link #WIFI_AWARE_CIPHER_SUITE_NCS_SK_128}, or
- * {@link #WIFI_AWARE_CIPHER_SUITE_NCS_SK_256}.
- */
- public @WifiAwareCipherSuites int getSupportedCipherSuites() {
- return mCharacteristics.getInt(KEY_SUPPORTED_CIPHER_SUITES);
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeBundle(mCharacteristics);
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- public static final @android.annotation.NonNull Creator<Characteristics> CREATOR =
- new Creator<Characteristics>() {
- @Override
- public Characteristics createFromParcel(Parcel in) {
- Characteristics c = new Characteristics(in.readBundle());
- return c;
- }
-
- @Override
- public Characteristics[] newArray(int size) {
- return new Characteristics[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/aware/ConfigRequest.aidl b/wifi/java/android/net/wifi/aware/ConfigRequest.aidl
deleted file mode 100644
index 68a7c85..0000000
--- a/wifi/java/android/net/wifi/aware/ConfigRequest.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-parcelable ConfigRequest;
diff --git a/wifi/java/android/net/wifi/aware/ConfigRequest.java b/wifi/java/android/net/wifi/aware/ConfigRequest.java
deleted file mode 100644
index 61ab92c..0000000
--- a/wifi/java/android/net/wifi/aware/ConfigRequest.java
+++ /dev/null
@@ -1,385 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.util.Arrays;
-
-/**
- * Defines a request object to configure a Wi-Fi Aware network. Built using
- * {@link ConfigRequest.Builder}. Configuration is requested using
- * {@link WifiAwareManager#attach(AttachCallback, android.os.Handler)}.
- * Note that the actual achieved configuration may be different from the
- * requested configuration - since different applications may request different
- * configurations.
- *
- * @hide
- */
-public final class ConfigRequest implements Parcelable {
- /**
- * Lower range of possible cluster ID.
- */
- public static final int CLUSTER_ID_MIN = 0;
-
- /**
- * Upper range of possible cluster ID.
- */
- public static final int CLUSTER_ID_MAX = 0xFFFF;
-
- /**
- * Indices for configuration variables which are specified per band.
- */
- public static final int NAN_BAND_24GHZ = 0;
- public static final int NAN_BAND_5GHZ = 1;
- public static final int NAN_BAND_6GHZ = 2;
-
- /**
- * Magic values for Discovery Window (DW) interval configuration
- */
- public static final int DW_INTERVAL_NOT_INIT = -1;
- public static final int DW_DISABLE = 0; // only valid for 5GHz
-
- /**
- * Indicates whether 5G band support is requested.
- */
- public final boolean mSupport5gBand;
-
- /**
- * Indicates whether 6G band support is requested.
- */
- public final boolean mSupport6gBand;
-
- /**
- * Specifies the desired master preference.
- */
- public final int mMasterPreference;
-
- /**
- * Specifies the desired lower range of the cluster ID. Must be lower then
- * {@link ConfigRequest#mClusterHigh}.
- */
- public final int mClusterLow;
-
- /**
- * Specifies the desired higher range of the cluster ID. Must be higher then
- * {@link ConfigRequest#mClusterLow}.
- */
- public final int mClusterHigh;
-
- /**
- * Specifies the discovery window interval for the device on NAN_BAND_*.
- */
- public final int mDiscoveryWindowInterval[];
-
- private ConfigRequest(boolean support5gBand, boolean support6gBand, int masterPreference,
- int clusterLow, int clusterHigh, int[] discoveryWindowInterval) {
- mSupport5gBand = support5gBand;
- mSupport6gBand = support6gBand;
- mMasterPreference = masterPreference;
- mClusterLow = clusterLow;
- mClusterHigh = clusterHigh;
- mDiscoveryWindowInterval = discoveryWindowInterval;
- }
-
- @Override
- public String toString() {
- return "ConfigRequest [mSupport5gBand=" + mSupport5gBand
- + ", mSupport6gBand=" + mSupport6gBand
- + ", mMasterPreference=" + mMasterPreference
- + ", mClusterLow=" + mClusterLow
- + ", mClusterHigh=" + mClusterHigh
- + ", mDiscoveryWindowInterval=" + Arrays.toString(mDiscoveryWindowInterval) + "]";
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(mSupport5gBand ? 1 : 0);
- dest.writeInt(mSupport6gBand ? 1 : 0);
- dest.writeInt(mMasterPreference);
- dest.writeInt(mClusterLow);
- dest.writeInt(mClusterHigh);
- dest.writeIntArray(mDiscoveryWindowInterval);
- }
-
- public static final @android.annotation.NonNull Creator<ConfigRequest> CREATOR = new Creator<ConfigRequest>() {
- @Override
- public ConfigRequest[] newArray(int size) {
- return new ConfigRequest[size];
- }
-
- @Override
- public ConfigRequest createFromParcel(Parcel in) {
- boolean support5gBand = in.readInt() != 0;
- boolean support6gBand = in.readInt() != 0;
- int masterPreference = in.readInt();
- int clusterLow = in.readInt();
- int clusterHigh = in.readInt();
- int discoveryWindowInterval[] = in.createIntArray();
-
- return new ConfigRequest(support5gBand, support6gBand, masterPreference, clusterLow,
- clusterHigh, discoveryWindowInterval);
- }
- };
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
-
- if (!(o instanceof ConfigRequest)) {
- return false;
- }
-
- ConfigRequest lhs = (ConfigRequest) o;
-
- return mSupport5gBand == lhs.mSupport5gBand
- && mSupport6gBand == lhs.mSupport6gBand
- && mMasterPreference == lhs.mMasterPreference
- && mClusterLow == lhs.mClusterLow && mClusterHigh == lhs.mClusterHigh
- && Arrays.equals(mDiscoveryWindowInterval, lhs.mDiscoveryWindowInterval);
- }
-
- @Override
- public int hashCode() {
- int result = 17;
-
- result = 31 * result + (mSupport5gBand ? 1 : 0);
- result = 31 * result + (mSupport6gBand ? 1 : 0);
- result = 31 * result + mMasterPreference;
- result = 31 * result + mClusterLow;
- result = 31 * result + mClusterHigh;
- result = 31 * result + Arrays.hashCode(mDiscoveryWindowInterval);
-
- return result;
- }
-
- /**
- * Verifies that the contents of the ConfigRequest are valid. Otherwise
- * throws an IllegalArgumentException.
- */
- public void validate() throws IllegalArgumentException {
- if (mMasterPreference < 0) {
- throw new IllegalArgumentException(
- "Master Preference specification must be non-negative");
- }
- if (mMasterPreference == 1 || mMasterPreference == 255 || mMasterPreference > 255) {
- throw new IllegalArgumentException("Master Preference specification must not "
- + "exceed 255 or use 1 or 255 (reserved values)");
- }
- if (mClusterLow < CLUSTER_ID_MIN) {
- throw new IllegalArgumentException("Cluster specification must be non-negative");
- }
- if (mClusterLow > CLUSTER_ID_MAX) {
- throw new IllegalArgumentException("Cluster specification must not exceed 0xFFFF");
- }
- if (mClusterHigh < CLUSTER_ID_MIN) {
- throw new IllegalArgumentException("Cluster specification must be non-negative");
- }
- if (mClusterHigh > CLUSTER_ID_MAX) {
- throw new IllegalArgumentException("Cluster specification must not exceed 0xFFFF");
- }
- if (mClusterLow > mClusterHigh) {
- throw new IllegalArgumentException(
- "Invalid argument combination - must have Cluster Low <= Cluster High");
- }
- if (mDiscoveryWindowInterval.length != 3) {
- throw new IllegalArgumentException(
- "Invalid discovery window interval: must have 3 elements (2.4 & 5 & 6");
- }
- if (mDiscoveryWindowInterval[NAN_BAND_24GHZ] != DW_INTERVAL_NOT_INIT &&
- (mDiscoveryWindowInterval[NAN_BAND_24GHZ] < 1 // valid for 2.4GHz: [1-5]
- || mDiscoveryWindowInterval[NAN_BAND_24GHZ] > 5)) {
- throw new IllegalArgumentException(
- "Invalid discovery window interval for 2.4GHz: valid is UNSET or [1,5]");
- }
- if (mDiscoveryWindowInterval[NAN_BAND_5GHZ] != DW_INTERVAL_NOT_INIT &&
- (mDiscoveryWindowInterval[NAN_BAND_5GHZ] < 0 // valid for 5GHz: [0-5]
- || mDiscoveryWindowInterval[NAN_BAND_5GHZ] > 5)) {
- throw new IllegalArgumentException(
- "Invalid discovery window interval for 5GHz: valid is UNSET or [0,5]");
- }
- if (mDiscoveryWindowInterval[NAN_BAND_6GHZ] != DW_INTERVAL_NOT_INIT
- && (mDiscoveryWindowInterval[NAN_BAND_6GHZ] < 0 // valid for 6GHz: [0-5]
- || mDiscoveryWindowInterval[NAN_BAND_6GHZ] > 5)) {
- throw new IllegalArgumentException(
- "Invalid discovery window interval for 6GHz: valid is UNSET or [0,5]");
- }
- }
-
- /**
- * Builder used to build {@link ConfigRequest} objects.
- */
- public static final class Builder {
- private boolean mSupport5gBand = true;
- private boolean mSupport6gBand = false;
- private int mMasterPreference = 0;
- private int mClusterLow = CLUSTER_ID_MIN;
- private int mClusterHigh = CLUSTER_ID_MAX;
- private int[] mDiscoveryWindowInterval = {DW_INTERVAL_NOT_INIT, DW_INTERVAL_NOT_INIT,
- DW_INTERVAL_NOT_INIT};
-
- /**
- * Specify whether 5G band support is required in this request. Disabled by default.
- *
- * @param support5gBand Support for 5G band is required.
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setSupport5gBand(boolean support5gBand) {
- mSupport5gBand = support5gBand;
- return this;
- }
-
- /**
- * Specify whether 6G band support is required in this request. Disabled by default.
- *
- * @param support6gBand Support for 6G band is required.
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setSupport6gBand(boolean support6gBand) {
- mSupport6gBand = support6gBand;
- return this;
- }
-
- /**
- * Specify the Master Preference requested. The permitted range is 0 (the default) to
- * 255 with 1 and 255 excluded (reserved).
- *
- * @param masterPreference The requested master preference
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setMasterPreference(int masterPreference) {
- if (masterPreference < 0) {
- throw new IllegalArgumentException(
- "Master Preference specification must be non-negative");
- }
- if (masterPreference == 1 || masterPreference == 255 || masterPreference > 255) {
- throw new IllegalArgumentException("Master Preference specification must not "
- + "exceed 255 or use 1 or 255 (reserved values)");
- }
-
- mMasterPreference = masterPreference;
- return this;
- }
-
- /**
- * The Cluster ID is generated randomly for new Aware networks. Specify
- * the lower range of the cluster ID. The upper range is specified using
- * the {@link ConfigRequest.Builder#setClusterHigh(int)}. The permitted
- * range is 0 (the default) to the value specified by
- * {@link ConfigRequest.Builder#setClusterHigh(int)}. Equality of Low and High is
- * permitted which restricts the Cluster ID to the specified value.
- *
- * @param clusterLow The lower range of the generated cluster ID.
- *
- * @return The builder to facilitate chaining
- * {@code builder.setClusterLow(..).setClusterHigh(..)}.
- */
- public Builder setClusterLow(int clusterLow) {
- if (clusterLow < CLUSTER_ID_MIN) {
- throw new IllegalArgumentException("Cluster specification must be non-negative");
- }
- if (clusterLow > CLUSTER_ID_MAX) {
- throw new IllegalArgumentException("Cluster specification must not exceed 0xFFFF");
- }
-
- mClusterLow = clusterLow;
- return this;
- }
-
- /**
- * The Cluster ID is generated randomly for new Aware networks. Specify
- * the lower upper of the cluster ID. The lower range is specified using
- * the {@link ConfigRequest.Builder#setClusterLow(int)}. The permitted
- * range is the value specified by
- * {@link ConfigRequest.Builder#setClusterLow(int)} to 0xFFFF (the default). Equality of
- * Low and High is permitted which restricts the Cluster ID to the specified value.
- *
- * @param clusterHigh The upper range of the generated cluster ID.
- *
- * @return The builder to facilitate chaining
- * {@code builder.setClusterLow(..).setClusterHigh(..)}.
- */
- public Builder setClusterHigh(int clusterHigh) {
- if (clusterHigh < CLUSTER_ID_MIN) {
- throw new IllegalArgumentException("Cluster specification must be non-negative");
- }
- if (clusterHigh > CLUSTER_ID_MAX) {
- throw new IllegalArgumentException("Cluster specification must not exceed 0xFFFF");
- }
-
- mClusterHigh = clusterHigh;
- return this;
- }
-
- /**
- * The discovery window interval specifies the discovery windows in which the device will be
- * awake. The configuration enables trading off latency vs. power (higher interval means
- * higher discovery latency but lower power).
- *
- * @param band Either {@link #NAN_BAND_24GHZ} or {@link #NAN_BAND_5GHZ} or
- * {@link #NAN_BAND_6GHZ}.
- * @param interval A value of 1, 2, 3, 4, or 5 indicating an interval of 2^(interval-1). For
- * the 5GHz band a value of 0 indicates that the device will not be awake
- * for any discovery windows.
- *
- * @return The builder itself to facilitate chaining operations
- * {@code builder.setDiscoveryWindowInterval(...).setMasterPreference(...)}.
- */
- public Builder setDiscoveryWindowInterval(int band, int interval) {
- if (band != NAN_BAND_24GHZ && band != NAN_BAND_5GHZ && band != NAN_BAND_6GHZ) {
- throw new IllegalArgumentException("Invalid band value");
- }
- if ((band == NAN_BAND_24GHZ && (interval < 1 || interval > 5))
- || (band == NAN_BAND_5GHZ && (interval < 0 || interval > 5))
- || (band == NAN_BAND_6GHZ && (interval < 0 || interval > 5))) {
- throw new IllegalArgumentException(
- "Invalid interval value: 2.4 GHz [1,5] or 5GHz/6GHz [0,5]");
- }
-
- mDiscoveryWindowInterval[band] = interval;
- return this;
- }
-
- /**
- * Build {@link ConfigRequest} given the current requests made on the
- * builder.
- */
- public ConfigRequest build() {
- if (mClusterLow > mClusterHigh) {
- throw new IllegalArgumentException(
- "Invalid argument combination - must have Cluster Low <= Cluster High");
- }
-
- return new ConfigRequest(mSupport5gBand, mSupport6gBand, mMasterPreference, mClusterLow,
- mClusterHigh, mDiscoveryWindowInterval);
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/DiscoverySession.java b/wifi/java/android/net/wifi/aware/DiscoverySession.java
deleted file mode 100644
index 4d92ae1..0000000
--- a/wifi/java/android/net/wifi/aware/DiscoverySession.java
+++ /dev/null
@@ -1,431 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SystemApi;
-import android.net.NetworkSpecifier;
-import android.util.CloseGuard;
-import android.util.Log;
-
-import com.android.internal.annotations.VisibleForTesting;
-
-import java.lang.ref.Reference;
-import java.lang.ref.WeakReference;
-
-/**
- * A class representing a single publish or subscribe Aware session. This object
- * will not be created directly - only its child classes are available:
- * {@link PublishDiscoverySession} and {@link SubscribeDiscoverySession}. This
- * class provides functionality common to both publish and subscribe discovery sessions:
- * <ul>
- * <li>Sending messages: {@link #sendMessage(PeerHandle, int, byte[])} method.
- * <li>Creating a network-specifier when requesting a Aware connection using
- * {@link WifiAwareNetworkSpecifier.Builder}.
- * </ul>
- * <p>
- * The {@link #close()} method must be called to destroy discovery sessions once they are
- * no longer needed.
- */
-public class DiscoverySession implements AutoCloseable {
- private static final String TAG = "DiscoverySession";
- private static final boolean DBG = false;
- private static final boolean VDBG = false; // STOPSHIP if true
-
- private static final int MAX_SEND_RETRY_COUNT = 5;
-
- /** @hide */
- protected WeakReference<WifiAwareManager> mMgr;
- /** @hide */
- protected final int mClientId;
- /** @hide */
- protected final int mSessionId;
- /** @hide */
- protected boolean mTerminated = false;
-
- private final CloseGuard mCloseGuard = new CloseGuard();
-
- /**
- * Return the maximum permitted retry count when sending messages using
- * {@link #sendMessage(PeerHandle, int, byte[], int)}.
- *
- * @return Maximum retry count when sending messages.
- *
- * @hide
- */
- public static int getMaxSendRetryCount() {
- return MAX_SEND_RETRY_COUNT;
- }
-
- /** @hide */
- public DiscoverySession(WifiAwareManager manager, int clientId, int sessionId) {
- if (VDBG) {
- Log.v(TAG, "New discovery session created: manager=" + manager + ", clientId="
- + clientId + ", sessionId=" + sessionId);
- }
-
- mMgr = new WeakReference<>(manager);
- mClientId = clientId;
- mSessionId = sessionId;
-
- mCloseGuard.open("close");
- }
-
- /**
- * Destroy the publish or subscribe session - free any resources, and stop
- * transmitting packets on-air (for an active session) or listening for
- * matches (for a passive session). The session may not be used for any
- * additional operations after its destruction.
- * <p>
- * This operation must be done on a session which is no longer needed. Otherwise system
- * resources will continue to be utilized until the application exits. The only
- * exception is a session for which we received a termination callback,
- * {@link DiscoverySessionCallback#onSessionTerminated()}.
- */
- @Override
- public void close() {
- WifiAwareManager mgr = mMgr.get();
- if (mgr == null) {
- Log.w(TAG, "destroy: called post GC on WifiAwareManager");
- return;
- }
- mgr.terminateSession(mClientId, mSessionId);
- mTerminated = true;
- mMgr.clear();
- mCloseGuard.close();
- Reference.reachabilityFence(this);
- }
-
- /**
- * Sets the status of the session to terminated - i.e. an indication that
- * already terminated rather than executing a termination.
- *
- * @hide
- */
- public void setTerminated() {
- if (mTerminated) {
- Log.w(TAG, "terminate: already terminated.");
- return;
- }
-
- mTerminated = true;
- mMgr.clear();
- mCloseGuard.close();
- }
-
- /** @hide */
- @Override
- protected void finalize() throws Throwable {
- try {
- if (mCloseGuard != null) {
- mCloseGuard.warnIfOpen();
- }
-
- if (!mTerminated) {
- close();
- }
- } finally {
- super.finalize();
- }
- }
-
- /**
- * Access the client ID of the Aware session.
- *
- * Note: internal visibility for testing.
- *
- * @return The internal client ID.
- *
- * @hide
- */
- @VisibleForTesting
- public int getClientId() {
- return mClientId;
- }
-
- /**
- * Access the discovery session ID of the Aware session.
- *
- * Note: internal visibility for testing.
- *
- * @return The internal discovery session ID.
- *
- * @hide
- */
- @VisibleForTesting
- public int getSessionId() {
- return mSessionId;
- }
-
- /**
- * Sends a message to the specified destination. Aware messages are transmitted in the context
- * of a discovery session - executed subsequent to a publish/subscribe
- * {@link DiscoverySessionCallback#onServiceDiscovered(PeerHandle,
- * byte[], java.util.List)} event.
- * <p>
- * Aware messages are not guaranteed delivery. Callbacks on
- * {@link DiscoverySessionCallback} indicate message was transmitted successfully,
- * {@link DiscoverySessionCallback#onMessageSendSucceeded(int)}, or transmission
- * failed (possibly after several retries) -
- * {@link DiscoverySessionCallback#onMessageSendFailed(int)}.
- * <p>
- * The peer will get a callback indicating a message was received using
- * {@link DiscoverySessionCallback#onMessageReceived(PeerHandle,
- * byte[])}.
- *
- * @param peerHandle The peer's handle for the message. Must be a result of an
- * {@link DiscoverySessionCallback#onServiceDiscovered(PeerHandle,
- * byte[], java.util.List)} or
- * {@link DiscoverySessionCallback#onMessageReceived(PeerHandle,
- * byte[])} events.
- * @param messageId An arbitrary integer used by the caller to identify the message. The same
- * integer ID will be returned in the callbacks indicating message send success or
- * failure. The {@code messageId} is not used internally by the Aware service - it
- * can be arbitrary and non-unique.
- * @param message The message to be transmitted.
- * @param retryCount An integer specifying how many additional service-level (as opposed to PHY
- * or MAC level) retries should be attempted if there is no ACK from the receiver
- * (note: no retransmissions are attempted in other failure cases). A value of 0
- * indicates no retries. Max permitted value is {@link #getMaxSendRetryCount()}.
- *
- * @hide
- */
- public void sendMessage(@NonNull PeerHandle peerHandle, int messageId,
- @Nullable byte[] message, int retryCount) {
- if (mTerminated) {
- Log.w(TAG, "sendMessage: called on terminated session");
- return;
- }
-
- WifiAwareManager mgr = mMgr.get();
- if (mgr == null) {
- Log.w(TAG, "sendMessage: called post GC on WifiAwareManager");
- return;
- }
-
- mgr.sendMessage(mClientId, mSessionId, peerHandle, message, messageId, retryCount);
- }
-
- /**
- * Sends a message to the specified destination. Aware messages are transmitted in the context
- * of a discovery session - executed subsequent to a publish/subscribe
- * {@link DiscoverySessionCallback#onServiceDiscovered(PeerHandle,
- * byte[], java.util.List)} event.
- * <p>
- * Aware messages are not guaranteed delivery. Callbacks on
- * {@link DiscoverySessionCallback} indicate message was transmitted successfully,
- * {@link DiscoverySessionCallback#onMessageSendSucceeded(int)}, or transmission
- * failed (possibly after several retries) -
- * {@link DiscoverySessionCallback#onMessageSendFailed(int)}.
- * <p>
- * The peer will get a callback indicating a message was received using
- * {@link DiscoverySessionCallback#onMessageReceived(PeerHandle,
- * byte[])}.
- *
- * @param peerHandle The peer's handle for the message. Must be a result of an
- * {@link DiscoverySessionCallback#onServiceDiscovered(PeerHandle,
- * byte[], java.util.List)} or
- * {@link DiscoverySessionCallback#onMessageReceived(PeerHandle,
- * byte[])} events.
- * @param messageId An arbitrary integer used by the caller to identify the message. The same
- * integer ID will be returned in the callbacks indicating message send success or
- * failure. The {@code messageId} is not used internally by the Aware service - it
- * can be arbitrary and non-unique.
- * @param message The message to be transmitted.
- */
- public void sendMessage(@NonNull PeerHandle peerHandle, int messageId,
- @Nullable byte[] message) {
- sendMessage(peerHandle, messageId, message, 0);
- }
-
- /**
- * Create a {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)} for
- * an unencrypted WiFi Aware connection (link) to the specified peer. The
- * {@link android.net.NetworkRequest.Builder#addTransportType(int)} should be set to
- * {@link android.net.NetworkCapabilities#TRANSPORT_WIFI_AWARE}.
- * <p>
- * This method should be used when setting up a connection with a peer discovered through Aware
- * discovery or communication (in such scenarios the MAC address of the peer is shielded by
- * an opaque peer ID handle). If an Aware connection is needed to a peer discovered using other
- * OOB (out-of-band) mechanism then use the alternative
- * {@link WifiAwareSession#createNetworkSpecifierOpen(int, byte[])} method - which uses the
- * peer's MAC address.
- * <p>
- * Note: per the Wi-Fi Aware specification the roles are fixed - a Subscriber is an INITIATOR
- * and a Publisher is a RESPONDER.
- * <p>
- * To set up an encrypted link use the
- * {@link #createNetworkSpecifierPassphrase(PeerHandle, String)} API.
- * @deprecated Use the replacement {@link WifiAwareNetworkSpecifier.Builder}.
- *
- * @param peerHandle The peer's handle obtained through
- * {@link DiscoverySessionCallback#onServiceDiscovered(PeerHandle, byte[], java.util.List)}
- * or
- * {@link DiscoverySessionCallback#onMessageReceived(PeerHandle, byte[])}.
- * On a RESPONDER this value is used to gate the acceptance of a connection
- * request from only that peer.
- *
- * @return A {@link NetworkSpecifier} to be used to construct
- * {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)} to pass to
- * {@link android.net.ConnectivityManager#requestNetwork(android.net.NetworkRequest,
- * android.net.ConnectivityManager.NetworkCallback)}
- * [or other varieties of that API].
- */
- @Deprecated
- public NetworkSpecifier createNetworkSpecifierOpen(@NonNull PeerHandle peerHandle) {
- if (mTerminated) {
- Log.w(TAG, "createNetworkSpecifierOpen: called on terminated session");
- return null;
- }
-
- WifiAwareManager mgr = mMgr.get();
- if (mgr == null) {
- Log.w(TAG, "createNetworkSpecifierOpen: called post GC on WifiAwareManager");
- return null;
- }
-
- int role = this instanceof SubscribeDiscoverySession
- ? WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_INITIATOR
- : WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_RESPONDER;
-
- return mgr.createNetworkSpecifier(mClientId, role, mSessionId, peerHandle, null, null);
- }
-
- /**
- * Create a {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)} for
- * an encrypted WiFi Aware connection (link) to the specified peer. The
- * {@link android.net.NetworkRequest.Builder#addTransportType(int)} should be set to
- * {@link android.net.NetworkCapabilities#TRANSPORT_WIFI_AWARE}.
- * <p>
- * This method should be used when setting up a connection with a peer discovered through Aware
- * discovery or communication (in such scenarios the MAC address of the peer is shielded by
- * an opaque peer ID handle). If an Aware connection is needed to a peer discovered using other
- * OOB (out-of-band) mechanism then use the alternative
- * {@link WifiAwareSession#createNetworkSpecifierPassphrase(int, byte[], String)} method -
- * which uses the peer's MAC address.
- * <p>
- * Note: per the Wi-Fi Aware specification the roles are fixed - a Subscriber is an INITIATOR
- * and a Publisher is a RESPONDER.
- * @deprecated Use the replacement {@link WifiAwareNetworkSpecifier.Builder}.
- *
- * @param peerHandle The peer's handle obtained through
- * {@link DiscoverySessionCallback#onServiceDiscovered(PeerHandle,
- * byte[], java.util.List)} or
- * {@link DiscoverySessionCallback#onMessageReceived(PeerHandle,
- * byte[])}. On a RESPONDER this value is used to gate the acceptance of a connection request
- * from only that peer.
- * @param passphrase The passphrase to be used to encrypt the link. The PMK is generated from
- * the passphrase. Use the
- * {@link #createNetworkSpecifierOpen(PeerHandle)} API to
- * specify an open (unencrypted) link.
- *
- * @return A {@link NetworkSpecifier} to be used to construct
- * {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)} to pass to
- * {@link android.net.ConnectivityManager#requestNetwork(android.net.NetworkRequest,
- * android.net.ConnectivityManager.NetworkCallback)}
- * [or other varieties of that API].
- */
- @Deprecated
- public NetworkSpecifier createNetworkSpecifierPassphrase(
- @NonNull PeerHandle peerHandle, @NonNull String passphrase) {
- if (!WifiAwareUtils.validatePassphrase(passphrase)) {
- throw new IllegalArgumentException("Passphrase must meet length requirements");
- }
-
- if (mTerminated) {
- Log.w(TAG, "createNetworkSpecifierPassphrase: called on terminated session");
- return null;
- }
-
- WifiAwareManager mgr = mMgr.get();
- if (mgr == null) {
- Log.w(TAG, "createNetworkSpecifierPassphrase: called post GC on WifiAwareManager");
- return null;
- }
-
- int role = this instanceof SubscribeDiscoverySession
- ? WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_INITIATOR
- : WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_RESPONDER;
-
- return mgr.createNetworkSpecifier(mClientId, role, mSessionId, peerHandle, null,
- passphrase);
- }
-
- /**
- * Create a {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)} for
- * an encrypted WiFi Aware connection (link) to the specified peer. The
- * {@link android.net.NetworkRequest.Builder#addTransportType(int)} should be set to
- * {@link android.net.NetworkCapabilities#TRANSPORT_WIFI_AWARE}.
- * <p>
- * This method should be used when setting up a connection with a peer discovered through Aware
- * discovery or communication (in such scenarios the MAC address of the peer is shielded by
- * an opaque peer ID handle). If an Aware connection is needed to a peer discovered using other
- * OOB (out-of-band) mechanism then use the alternative
- * {@link WifiAwareSession#createNetworkSpecifierPmk(int, byte[], byte[])} method - which uses
- * the peer's MAC address.
- * <p>
- * Note: per the Wi-Fi Aware specification the roles are fixed - a Subscriber is an INITIATOR
- * and a Publisher is a RESPONDER.
- * @deprecated Use the replacement {@link WifiAwareNetworkSpecifier.Builder}.
- *
- * @param peerHandle The peer's handle obtained through
- * {@link DiscoverySessionCallback#onServiceDiscovered(PeerHandle,
- * byte[], java.util.List)} or
- * {@link DiscoverySessionCallback#onMessageReceived(PeerHandle,
- * byte[])}. On a RESPONDER this value is used to gate the acceptance of a connection request
- * from only that peer.
- * @param pmk A PMK (pairwise master key, see IEEE 802.11i) specifying the key to use for
- * encrypting the data-path. Use the
- * {@link #createNetworkSpecifierPassphrase(PeerHandle, String)} to specify a
- * Passphrase or {@link #createNetworkSpecifierOpen(PeerHandle)} to specify an
- * open (unencrypted) link.
- *
- * @return A {@link NetworkSpecifier} to be used to construct
- * {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)} to pass to
- * {@link android.net.ConnectivityManager#requestNetwork(android.net.NetworkRequest,
- * android.net.ConnectivityManager.NetworkCallback)}
- * [or other varieties of that API].
- *
- * @hide
- */
- @Deprecated
- @SystemApi
- public NetworkSpecifier createNetworkSpecifierPmk(@NonNull PeerHandle peerHandle,
- @NonNull byte[] pmk) {
- if (!WifiAwareUtils.validatePmk(pmk)) {
- throw new IllegalArgumentException("PMK must 32 bytes");
- }
-
- if (mTerminated) {
- Log.w(TAG, "createNetworkSpecifierPmk: called on terminated session");
- return null;
- }
-
- WifiAwareManager mgr = mMgr.get();
- if (mgr == null) {
- Log.w(TAG, "createNetworkSpecifierPmk: called post GC on WifiAwareManager");
- return null;
- }
-
- int role = this instanceof SubscribeDiscoverySession
- ? WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_INITIATOR
- : WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_RESPONDER;
-
- return mgr.createNetworkSpecifier(mClientId, role, mSessionId, peerHandle, pmk, null);
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/DiscoverySessionCallback.java b/wifi/java/android/net/wifi/aware/DiscoverySessionCallback.java
deleted file mode 100644
index da8e17e..0000000
--- a/wifi/java/android/net/wifi/aware/DiscoverySessionCallback.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import android.annotation.NonNull;
-
-import java.util.List;
-
-/**
- * Base class for Aware session events callbacks. Should be extended by
- * applications wanting notifications. The callbacks are set when a
- * publish or subscribe session is created using
- * {@link WifiAwareSession#publish(PublishConfig, DiscoverySessionCallback,
- * android.os.Handler)} or
- * {@link WifiAwareSession#subscribe(SubscribeConfig, DiscoverySessionCallback,
- * android.os.Handler)}.
- * <p>
- * A single callback is set at session creation - it cannot be replaced.
- */
-public class DiscoverySessionCallback {
- /**
- * Called when a publish operation is started successfully in response to a
- * {@link WifiAwareSession#publish(PublishConfig, DiscoverySessionCallback,
- * android.os.Handler)} operation.
- *
- * @param session The {@link PublishDiscoverySession} used to control the
- * discovery session.
- */
- public void onPublishStarted(@NonNull PublishDiscoverySession session) {
- /* empty */
- }
-
- /**
- * Called when a subscribe operation is started successfully in response to a
- * {@link WifiAwareSession#subscribe(SubscribeConfig, DiscoverySessionCallback,
- * android.os.Handler)} operation.
- *
- * @param session The {@link SubscribeDiscoverySession} used to control the
- * discovery session.
- */
- public void onSubscribeStarted(@NonNull SubscribeDiscoverySession session) {
- /* empty */
- }
-
- /**
- * Called when a publish or subscribe discovery session configuration update request
- * succeeds. Called in response to
- * {@link PublishDiscoverySession#updatePublish(PublishConfig)} or
- * {@link SubscribeDiscoverySession#updateSubscribe(SubscribeConfig)}.
- */
- public void onSessionConfigUpdated() {
- /* empty */
- }
-
- /**
- * Called when a publish or subscribe discovery session cannot be created:
- * {@link WifiAwareSession#publish(PublishConfig, DiscoverySessionCallback,
- * android.os.Handler)} or
- * {@link WifiAwareSession#subscribe(SubscribeConfig, DiscoverySessionCallback,
- * android.os.Handler)}, or when a configuration update fails:
- * {@link PublishDiscoverySession#updatePublish(PublishConfig)} or
- * {@link SubscribeDiscoverySession#updateSubscribe(SubscribeConfig)}.
- * <p>
- * For discovery session updates failure leaves the session running with its previous
- * configuration - the discovery session is not terminated.
- */
- public void onSessionConfigFailed() {
- /* empty */
- }
-
- /**
- * Called when a discovery session (publish or subscribe) terminates. Termination may be due
- * to user-request (either directly through {@link DiscoverySession#close()} or
- * application-specified expiration, e.g. {@link PublishConfig.Builder#setTtlSec(int)}
- * or {@link SubscribeConfig.Builder#setTtlSec(int)}).
- */
- public void onSessionTerminated() {
- /* empty */
- }
-
- /**
- * Called when a discovery (publish or subscribe) operation results in a
- * service discovery.
- * <p>
- * Note that this method and
- * {@link #onServiceDiscoveredWithinRange(PeerHandle, byte[], List, int)} may be called
- * multiple times per service discovery.
- *
- * @param peerHandle An opaque handle to the peer matching our discovery operation.
- * @param serviceSpecificInfo The service specific information (arbitrary
- * byte array) provided by the peer as part of its discovery
- * configuration.
- * @param matchFilter The filter which resulted in this service discovery. For
- * {@link PublishConfig#PUBLISH_TYPE_UNSOLICITED},
- * {@link SubscribeConfig#SUBSCRIBE_TYPE_PASSIVE} discovery sessions this is the publisher's
- * match filter. For {@link PublishConfig#PUBLISH_TYPE_SOLICITED},
- * {@link SubscribeConfig#SUBSCRIBE_TYPE_ACTIVE} discovery sessions this
- * is the subscriber's match filter.
- */
- public void onServiceDiscovered(PeerHandle peerHandle,
- byte[] serviceSpecificInfo, List<byte[]> matchFilter) {
- /* empty */
- }
-
- /**
- * Called when a discovery (publish or subscribe) operation results in a
- * service discovery. Called when a Subscribe service was configured with a range requirement
- * {@link SubscribeConfig.Builder#setMinDistanceMm(int)} and/or
- * {@link SubscribeConfig.Builder#setMaxDistanceMm(int)} and the Publish service was configured
- * with {@link PublishConfig.Builder#setRangingEnabled(boolean)}.
- * <p>
- * If either Publisher or Subscriber does not enable Ranging, or if Ranging is temporarily
- * disabled by the underlying device, service discovery proceeds without ranging and the
- * {@link #onServiceDiscovered(PeerHandle, byte[], List)} is called.
- * <p>
- * Note that this method and {@link #onServiceDiscovered(PeerHandle, byte[], List)} may be
- * called multiple times per service discovery.
- *
- * @param peerHandle An opaque handle to the peer matching our discovery operation.
- * @param serviceSpecificInfo The service specific information (arbitrary
- * byte array) provided by the peer as part of its discovery
- * configuration.
- * @param matchFilter The filter which resulted in this service discovery. For
- * {@link PublishConfig#PUBLISH_TYPE_UNSOLICITED},
- * {@link SubscribeConfig#SUBSCRIBE_TYPE_PASSIVE} discovery sessions this is the publisher's
- * match filter. For {@link PublishConfig#PUBLISH_TYPE_SOLICITED},
- * {@link SubscribeConfig#SUBSCRIBE_TYPE_ACTIVE} discovery sessions this
- * is the subscriber's match filter.
- * @param distanceMm The measured distance to the Publisher in mm. Note: the measured distance
- * may be negative for very close devices.
- */
- public void onServiceDiscoveredWithinRange(PeerHandle peerHandle,
- byte[] serviceSpecificInfo, List<byte[]> matchFilter, int distanceMm) {
- /* empty */
- }
-
- /**
- * Called in response to
- * {@link DiscoverySession#sendMessage(PeerHandle, int, byte[])}
- * when a message is transmitted successfully - i.e. when it was received successfully by the
- * peer (corresponds to an ACK being received).
- * <p>
- * Note that either this callback or
- * {@link DiscoverySessionCallback#onMessageSendFailed(int)} will be
- * received - never both.
- *
- * @param messageId The arbitrary message ID specified when sending the message.
- */
- public void onMessageSendSucceeded(@SuppressWarnings("unused") int messageId) {
- /* empty */
- }
-
- /**
- * Called when message transmission initiated with
- * {@link DiscoverySession#sendMessage(PeerHandle, int, byte[])} fails. E.g. when no ACK is
- * received from the peer.
- * <p>
- * Note that either this callback or
- * {@link DiscoverySessionCallback#onMessageSendSucceeded(int)} will be received
- * - never both.
- *
- * @param messageId The arbitrary message ID specified when sending the message.
- */
- public void onMessageSendFailed(@SuppressWarnings("unused") int messageId) {
- /* empty */
- }
-
- /**
- * Called when a message is received from a discovery session peer - in response to the
- * peer's {@link DiscoverySession#sendMessage(PeerHandle, int, byte[])}.
- *
- * @param peerHandle An opaque handle to the peer matching our discovery operation.
- * @param message A byte array containing the message.
- */
- public void onMessageReceived(PeerHandle peerHandle, byte[] message) {
- /* empty */
- }
-
- /**
- * Called when the discovered service is not available. All further operations on this
- * discovery session will fail. If the service is available again,
- * {@link #onServiceDiscovered(PeerHandle, byte[], List)} or
- * {@link #onServiceDiscoveredWithinRange(PeerHandle, byte[], List, int)} will be called.
- *
- * @param peerHandle An opaque handle to the peer matching our discovery operation.
- * @param reason Discovered service lost reason code. One of
- * {@link WifiAwareManager#WIFI_AWARE_DISCOVERY_LOST_REASON_PEER_NOT_VISIBLE},
- * {@link WifiAwareManager#WIFI_AWARE_DISCOVERY_LOST_REASON_UNKNOWN
- */
- public void onServiceLost(@NonNull PeerHandle peerHandle,
- @WifiAwareManager.DiscoveryLostReasonCode int reason) {
- /* empty */
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/IWifiAwareDiscoverySessionCallback.aidl b/wifi/java/android/net/wifi/aware/IWifiAwareDiscoverySessionCallback.aidl
deleted file mode 100644
index e3e7c8e..0000000
--- a/wifi/java/android/net/wifi/aware/IWifiAwareDiscoverySessionCallback.aidl
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-/**
- * Callback interface that WifiAwareManager implements
- *
- * {@hide}
- */
-oneway interface IWifiAwareDiscoverySessionCallback
-{
- void onSessionStarted(int discoverySessionId);
- void onSessionConfigSuccess();
- void onSessionConfigFail(int reason);
- void onSessionTerminated(int reason);
-
- void onMatch(int peerId, in byte[] serviceSpecificInfo, in byte[] matchFilter);
- void onMatchWithDistance(int peerId, in byte[] serviceSpecificInfo, in byte[] matchFilter,
- int distanceMm);
-
- void onMessageSendSuccess(int messageId);
- void onMessageSendFail(int messageId, int reason);
- void onMessageReceived(int peerId, in byte[] message);
- void onMatchExpired(int peerId);
-}
diff --git a/wifi/java/android/net/wifi/aware/IWifiAwareEventCallback.aidl b/wifi/java/android/net/wifi/aware/IWifiAwareEventCallback.aidl
deleted file mode 100644
index b646567..0000000
--- a/wifi/java/android/net/wifi/aware/IWifiAwareEventCallback.aidl
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import android.net.wifi.aware.ConfigRequest;
-
-/**
- * Callback interface that WifiAwareManager implements
- *
- * {@hide}
- */
-oneway interface IWifiAwareEventCallback
-{
- void onConnectSuccess(int clientId);
- void onConnectFail(int reason);
- void onIdentityChanged(in byte[] mac);
-}
diff --git a/wifi/java/android/net/wifi/aware/IWifiAwareMacAddressProvider.aidl b/wifi/java/android/net/wifi/aware/IWifiAwareMacAddressProvider.aidl
deleted file mode 100644
index 0e7289c..0000000
--- a/wifi/java/android/net/wifi/aware/IWifiAwareMacAddressProvider.aidl
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.aware;
-
-/**
- * Callback for IWifiAwareManager.getMacAddressFromPeerHandle
- *
- * @hide
- */
-oneway interface IWifiAwareMacAddressProvider
-{
- void macAddress(in Map peerIdToMacMap);
-}
diff --git a/wifi/java/android/net/wifi/aware/IWifiAwareManager.aidl b/wifi/java/android/net/wifi/aware/IWifiAwareManager.aidl
deleted file mode 100644
index c90c4d8..0000000
--- a/wifi/java/android/net/wifi/aware/IWifiAwareManager.aidl
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import android.app.PendingIntent;
-
-import android.net.wifi.aware.ConfigRequest;
-import android.net.wifi.aware.IWifiAwareDiscoverySessionCallback;
-import android.net.wifi.aware.IWifiAwareEventCallback;
-import android.net.wifi.aware.IWifiAwareMacAddressProvider;
-import android.net.wifi.aware.PublishConfig;
-import android.net.wifi.aware.SubscribeConfig;
-import android.net.wifi.aware.Characteristics;
-import android.net.wifi.aware.AwareResources;
-
-/**
- * Interface that WifiAwareService implements
- *
- * {@hide}
- */
-interface IWifiAwareManager
-{
- // Aware API
- boolean isUsageEnabled();
- Characteristics getCharacteristics();
- AwareResources getAvailableAwareResources();
- boolean isDeviceAttached();
- void enableInstantCommunicationMode(in String callingPackage, boolean enable);
- boolean isInstantCommunicationModeEnabled();
-
- // client API
- void connect(in IBinder binder, in String callingPackage, in String callingFeatureId,
- in IWifiAwareEventCallback callback, in ConfigRequest configRequest,
- boolean notifyOnIdentityChanged);
- void disconnect(int clientId, in IBinder binder);
-
- void publish(in String callingPackage, in String callingFeatureId, int clientId,
- in PublishConfig publishConfig, in IWifiAwareDiscoverySessionCallback callback);
- void subscribe(in String callingPackage, in String callingFeatureId, int clientId,
- in SubscribeConfig subscribeConfig, in IWifiAwareDiscoverySessionCallback callback);
-
- // session API
- void updatePublish(int clientId, int discoverySessionId, in PublishConfig publishConfig);
- void updateSubscribe(int clientId, int discoverySessionId, in SubscribeConfig subscribeConfig);
- void sendMessage(int clientId, int discoverySessionId, int peerId, in byte[] message,
- int messageId, int retryCount);
- void terminateSession(int clientId, int discoverySessionId);
-
- // internal APIs: intended to be used between System Services (restricted permissions)
- void requestMacAddresses(int uid, in List peerIds, in IWifiAwareMacAddressProvider callback);
-}
diff --git a/wifi/java/android/net/wifi/aware/IdentityChangedListener.java b/wifi/java/android/net/wifi/aware/IdentityChangedListener.java
deleted file mode 100644
index a8b19b3..0000000
--- a/wifi/java/android/net/wifi/aware/IdentityChangedListener.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-/**
- * Base class for a listener which is called with the MAC address of the Aware interface whenever
- * it is changed. Change may be due to device joining a cluster, starting a cluster, or discovery
- * interface change (addresses are randomized at regular intervals). The implication is that
- * peers you've been communicating with may no longer recognize you and you need to re-establish
- * your identity - e.g. by starting a discovery session. This actual MAC address of the
- * interface may also be useful if the application uses alternative (non-Aware) discovery but needs
- * to set up a Aware connection. The provided Aware discovery interface MAC address can then be used
- * in {@link WifiAwareSession#createNetworkSpecifierOpen(int, byte[])} or
- * {@link WifiAwareSession#createNetworkSpecifierPassphrase(int, byte[], String)}.
- */
-public class IdentityChangedListener {
- /**
- * @param mac The MAC address of the Aware discovery interface. The application must have the
- * {@link android.Manifest.permission#ACCESS_FINE_LOCATION} to get the actual MAC address,
- * otherwise all 0's will be provided.
- */
- public void onIdentityChanged(byte[] mac) {
- /* empty */
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/ParcelablePeerHandle.java b/wifi/java/android/net/wifi/aware/ParcelablePeerHandle.java
deleted file mode 100644
index ca473db..0000000
--- a/wifi/java/android/net/wifi/aware/ParcelablePeerHandle.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.net.wifi.aware;
-
-import android.annotation.NonNull;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-/**
- * A Parcelable {@link PeerHandle}. Can be constructed from a {@code PeerHandle} and then passed
- * to any of the APIs which take a {@code PeerHandle} as inputs.
- */
-public final class ParcelablePeerHandle extends PeerHandle implements Parcelable {
- /**
- * Construct a parcelable version of {@link PeerHandle}.
- *
- * @param peerHandle The {@link PeerHandle} to be made parcelable.
- */
- public ParcelablePeerHandle(@NonNull PeerHandle peerHandle) {
- super(peerHandle.peerId);
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(peerId);
- }
-
- public static final @android.annotation.NonNull Creator<ParcelablePeerHandle> CREATOR =
- new Creator<ParcelablePeerHandle>() {
- @Override
- public ParcelablePeerHandle[] newArray(int size) {
- return new ParcelablePeerHandle[size];
- }
-
- @Override
- public ParcelablePeerHandle createFromParcel(Parcel in) {
- int peerHandle = in.readInt();
- return new ParcelablePeerHandle(new PeerHandle(peerHandle));
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/aware/PeerHandle.java b/wifi/java/android/net/wifi/aware/PeerHandle.java
deleted file mode 100644
index 422e177..0000000
--- a/wifi/java/android/net/wifi/aware/PeerHandle.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-/**
- * Opaque object used to represent a Wi-Fi Aware peer. Obtained from discovery sessions in
- * {@link DiscoverySessionCallback#onServiceDiscovered(PeerHandle, byte[], java.util.List)} or
- * received messages in {@link DiscoverySessionCallback#onMessageReceived(PeerHandle, byte[])}, and
- * used when sending messages e,g, {@link DiscoverySession#sendMessage(PeerHandle, int, byte[])},
- * or when configuring a network link to a peer, e.g.
- * {@link DiscoverySession#createNetworkSpecifierOpen(PeerHandle)} or
- * {@link DiscoverySession#createNetworkSpecifierPassphrase(PeerHandle, String)}.
- * <p>
- * Note that while a {@code PeerHandle} can be used to track a particular peer (i.e. you can compare
- * the values received from subsequent messages) - it is good practice not to rely on it. Instead
- * use an application level peer identifier encoded in the message,
- * {@link DiscoverySession#sendMessage(PeerHandle, int, byte[])}, and/or in the Publish
- * configuration's service-specific information field,
- * {@link PublishConfig.Builder#setServiceSpecificInfo(byte[])}, or match filter,
- * {@link PublishConfig.Builder#setMatchFilter(java.util.List)}.
- * <p>A parcelable handle object is available with {@link ParcelablePeerHandle}.
- */
-public class PeerHandle {
- /** @hide */
- public PeerHandle(int peerId) {
- this.peerId = peerId;
- }
-
- /** @hide */
- public int peerId;
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
-
- if (!(o instanceof PeerHandle)) {
- return false;
- }
-
- return peerId == ((PeerHandle) o).peerId;
- }
-
- @Override
- public int hashCode() {
- return peerId;
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/PublishConfig.java b/wifi/java/android/net/wifi/aware/PublishConfig.java
deleted file mode 100644
index a8844c1..0000000
--- a/wifi/java/android/net/wifi/aware/PublishConfig.java
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import android.annotation.IntDef;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.net.wifi.util.HexEncoding;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * Defines the configuration of a Aware publish session. Built using
- * {@link PublishConfig.Builder}. A publish session is created using
- * {@link WifiAwareSession#publish(PublishConfig, DiscoverySessionCallback,
- * android.os.Handler)} or updated using
- * {@link PublishDiscoverySession#updatePublish(PublishConfig)}.
- */
-public final class PublishConfig implements Parcelable {
- /** @hide */
- @IntDef({
- PUBLISH_TYPE_UNSOLICITED, PUBLISH_TYPE_SOLICITED })
- @Retention(RetentionPolicy.SOURCE)
- public @interface PublishTypes {
- }
-
- /**
- * Defines an unsolicited publish session - a publish session where the publisher is
- * advertising itself by broadcasting on-the-air. An unsolicited publish session is paired
- * with an passive subscribe session {@link SubscribeConfig#SUBSCRIBE_TYPE_PASSIVE}.
- * Configuration is done using {@link PublishConfig.Builder#setPublishType(int)}.
- */
- public static final int PUBLISH_TYPE_UNSOLICITED = 0;
-
- /**
- * Defines a solicited publish session - a publish session which is silent, waiting for a
- * matching active subscribe session - and responding to it in unicast. A
- * solicited publish session is paired with an active subscribe session
- * {@link SubscribeConfig#SUBSCRIBE_TYPE_ACTIVE}. Configuration is done using
- * {@link PublishConfig.Builder#setPublishType(int)}.
- */
- public static final int PUBLISH_TYPE_SOLICITED = 1;
-
- /** @hide */
- public final byte[] mServiceName;
-
- /** @hide */
- public final byte[] mServiceSpecificInfo;
-
- /** @hide */
- public final byte[] mMatchFilter;
-
- /** @hide */
- public final int mPublishType;
-
- /** @hide */
- public final int mTtlSec;
-
- /** @hide */
- public final boolean mEnableTerminateNotification;
-
- /** @hide */
- public final boolean mEnableRanging;
-
- /** @hide */
- public PublishConfig(byte[] serviceName, byte[] serviceSpecificInfo, byte[] matchFilter,
- int publishType, int ttlSec, boolean enableTerminateNotification,
- boolean enableRanging) {
- mServiceName = serviceName;
- mServiceSpecificInfo = serviceSpecificInfo;
- mMatchFilter = matchFilter;
- mPublishType = publishType;
- mTtlSec = ttlSec;
- mEnableTerminateNotification = enableTerminateNotification;
- mEnableRanging = enableRanging;
- }
-
- @Override
- public String toString() {
- return "PublishConfig [mServiceName='" + (mServiceName == null ? "<null>" : String.valueOf(
- HexEncoding.encode(mServiceName))) + ", mServiceName.length=" + (
- mServiceName == null ? 0 : mServiceName.length) + ", mServiceSpecificInfo='" + (
- (mServiceSpecificInfo == null) ? "<null>" : String.valueOf(
- HexEncoding.encode(mServiceSpecificInfo)))
- + ", mServiceSpecificInfo.length=" + (mServiceSpecificInfo == null ? 0
- : mServiceSpecificInfo.length) + ", mMatchFilter="
- + (new TlvBufferUtils.TlvIterable(0, 1, mMatchFilter)).toString()
- + ", mMatchFilter.length=" + (mMatchFilter == null ? 0 : mMatchFilter.length)
- + ", mPublishType=" + mPublishType + ", mTtlSec=" + mTtlSec
- + ", mEnableTerminateNotification=" + mEnableTerminateNotification
- + ", mEnableRanging=" + mEnableRanging + "]";
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeByteArray(mServiceName);
- dest.writeByteArray(mServiceSpecificInfo);
- dest.writeByteArray(mMatchFilter);
- dest.writeInt(mPublishType);
- dest.writeInt(mTtlSec);
- dest.writeInt(mEnableTerminateNotification ? 1 : 0);
- dest.writeInt(mEnableRanging ? 1 : 0);
- }
-
- public static final @android.annotation.NonNull Creator<PublishConfig> CREATOR = new Creator<PublishConfig>() {
- @Override
- public PublishConfig[] newArray(int size) {
- return new PublishConfig[size];
- }
-
- @Override
- public PublishConfig createFromParcel(Parcel in) {
- byte[] serviceName = in.createByteArray();
- byte[] ssi = in.createByteArray();
- byte[] matchFilter = in.createByteArray();
- int publishType = in.readInt();
- int ttlSec = in.readInt();
- boolean enableTerminateNotification = in.readInt() != 0;
- boolean enableRanging = in.readInt() != 0;
-
- return new PublishConfig(serviceName, ssi, matchFilter, publishType,
- ttlSec, enableTerminateNotification, enableRanging);
- }
- };
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
-
- if (!(o instanceof PublishConfig)) {
- return false;
- }
-
- PublishConfig lhs = (PublishConfig) o;
-
- return Arrays.equals(mServiceName, lhs.mServiceName) && Arrays.equals(mServiceSpecificInfo,
- lhs.mServiceSpecificInfo) && Arrays.equals(mMatchFilter, lhs.mMatchFilter)
- && mPublishType == lhs.mPublishType
- && mTtlSec == lhs.mTtlSec
- && mEnableTerminateNotification == lhs.mEnableTerminateNotification
- && mEnableRanging == lhs.mEnableRanging;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(Arrays.hashCode(mServiceName), Arrays.hashCode(mServiceSpecificInfo),
- Arrays.hashCode(mMatchFilter), mPublishType, mTtlSec, mEnableTerminateNotification,
- mEnableRanging);
- }
-
- /**
- * Verifies that the contents of the PublishConfig are valid. Otherwise
- * throws an IllegalArgumentException.
- *
- * @hide
- */
- public void assertValid(Characteristics characteristics, boolean rttSupported)
- throws IllegalArgumentException {
- WifiAwareUtils.validateServiceName(mServiceName);
-
- if (!TlvBufferUtils.isValid(mMatchFilter, 0, 1)) {
- throw new IllegalArgumentException(
- "Invalid txFilter configuration - LV fields do not match up to length");
- }
- if (mPublishType < PUBLISH_TYPE_UNSOLICITED || mPublishType > PUBLISH_TYPE_SOLICITED) {
- throw new IllegalArgumentException("Invalid publishType - " + mPublishType);
- }
- if (mTtlSec < 0) {
- throw new IllegalArgumentException("Invalid ttlSec - must be non-negative");
- }
-
- if (characteristics != null) {
- int maxServiceNameLength = characteristics.getMaxServiceNameLength();
- if (maxServiceNameLength != 0 && mServiceName.length > maxServiceNameLength) {
- throw new IllegalArgumentException(
- "Service name longer than supported by device characteristics");
- }
- int maxServiceSpecificInfoLength = characteristics.getMaxServiceSpecificInfoLength();
- if (maxServiceSpecificInfoLength != 0 && mServiceSpecificInfo != null
- && mServiceSpecificInfo.length > maxServiceSpecificInfoLength) {
- throw new IllegalArgumentException(
- "Service specific info longer than supported by device characteristics");
- }
- int maxMatchFilterLength = characteristics.getMaxMatchFilterLength();
- if (maxMatchFilterLength != 0 && mMatchFilter != null
- && mMatchFilter.length > maxMatchFilterLength) {
- throw new IllegalArgumentException(
- "Match filter longer than supported by device characteristics");
- }
- }
-
- if (!rttSupported && mEnableRanging) {
- throw new IllegalArgumentException("Ranging is not supported");
- }
- }
-
- /**
- * Builder used to build {@link PublishConfig} objects.
- */
- public static final class Builder {
- private byte[] mServiceName;
- private byte[] mServiceSpecificInfo;
- private byte[] mMatchFilter;
- private int mPublishType = PUBLISH_TYPE_UNSOLICITED;
- private int mTtlSec = 0;
- private boolean mEnableTerminateNotification = true;
- private boolean mEnableRanging = false;
-
- /**
- * Specify the service name of the publish session. The actual on-air
- * value is a 6 byte hashed representation of this string.
- * <p>
- * The Service Name is a UTF-8 encoded string from 1 to 255 bytes in length.
- * The only acceptable single-byte UTF-8 symbols for a Service Name are alphanumeric
- * values (A-Z, a-z, 0-9), the hyphen ('-'), and the period ('.'). All valid multi-byte
- * UTF-8 characters are acceptable in a Service Name.
- * <p>
- * Must be called - an empty ServiceName is not valid.
- *
- * @param serviceName The service name for the publish session.
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setServiceName(@NonNull String serviceName) {
- if (serviceName == null) {
- throw new IllegalArgumentException("Invalid service name - must be non-null");
- }
- mServiceName = serviceName.getBytes(StandardCharsets.UTF_8);
- return this;
- }
-
- /**
- * Specify service specific information for the publish session. This is
- * a free-form byte array available to the application to send
- * additional information as part of the discovery operation - it
- * will not be used to determine whether a publish/subscribe match
- * occurs.
- * <p>
- * Optional. Empty by default.
- *
- * @param serviceSpecificInfo A byte-array for the service-specific
- * information field.
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setServiceSpecificInfo(@Nullable byte[] serviceSpecificInfo) {
- mServiceSpecificInfo = serviceSpecificInfo;
- return this;
- }
-
- /**
- * The match filter for a publish session. Used to determine whether a service
- * discovery occurred - in addition to relying on the service name.
- * <p>
- * Optional. Empty by default.
- *
- * @param matchFilter A list of match filter entries (each of which is an arbitrary byte
- * array).
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setMatchFilter(@Nullable List<byte[]> matchFilter) {
- mMatchFilter = new TlvBufferUtils.TlvConstructor(0, 1).allocateAndPut(
- matchFilter).getArray();
- return this;
- }
-
- /**
- * Specify the type of the publish session: solicited (aka active - publish
- * packets are transmitted over-the-air), or unsolicited (aka passive -
- * no publish packets are transmitted, a match is made against an active
- * subscribe session whose packets are transmitted over-the-air).
- *
- * @param publishType Publish session type:
- * {@link PublishConfig#PUBLISH_TYPE_SOLICITED} or
- * {@link PublishConfig#PUBLISH_TYPE_UNSOLICITED} (the default).
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setPublishType(@PublishTypes int publishType) {
- if (publishType < PUBLISH_TYPE_UNSOLICITED || publishType > PUBLISH_TYPE_SOLICITED) {
- throw new IllegalArgumentException("Invalid publishType - " + publishType);
- }
- mPublishType = publishType;
- return this;
- }
-
- /**
- * Sets the time interval (in seconds) an unsolicited (
- * {@link PublishConfig.Builder#setPublishType(int)}) publish session
- * will be alive - broadcasting a packet. When the TTL is reached
- * an event will be generated for
- * {@link DiscoverySessionCallback#onSessionTerminated()} [unless
- * {@link #setTerminateNotificationEnabled(boolean)} disables the callback].
- * <p>
- * Optional. 0 by default - indicating the session doesn't terminate on its own.
- * Session will be terminated when {@link DiscoverySession#close()} is
- * called.
- *
- * @param ttlSec Lifetime of a publish session in seconds.
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setTtlSec(int ttlSec) {
- if (ttlSec < 0) {
- throw new IllegalArgumentException("Invalid ttlSec - must be non-negative");
- }
- mTtlSec = ttlSec;
- return this;
- }
-
- /**
- * Configure whether a publish terminate notification
- * {@link DiscoverySessionCallback#onSessionTerminated()} is reported
- * back to the callback.
- *
- * @param enable If true the terminate callback will be called when the
- * publish is terminated. Otherwise it will not be called.
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setTerminateNotificationEnabled(boolean enable) {
- mEnableTerminateNotification = enable;
- return this;
- }
-
- /**
- * Configure whether the publish discovery session supports ranging and allows peers to
- * measure distance to it. This API is used in conjunction with
- * {@link SubscribeConfig.Builder#setMinDistanceMm(int)} and
- * {@link SubscribeConfig.Builder#setMaxDistanceMm(int)} to specify a minimum and/or
- * maximum distance at which discovery will be triggered.
- * <p>
- * Optional. Disabled by default - i.e. any peer attempt to measure distance to this device
- * will be refused and discovery will proceed without ranging constraints.
- * <p>
- * The device must support Wi-Fi RTT for this feature to be used. Feature support is checked
- * as described in {@link android.net.wifi.rtt}.
- *
- * @param enable If true, ranging is supported on request of the peer.
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setRangingEnabled(boolean enable) {
- mEnableRanging = enable;
- return this;
- }
-
- /**
- * Build {@link PublishConfig} given the current requests made on the
- * builder.
- */
- public PublishConfig build() {
- return new PublishConfig(mServiceName, mServiceSpecificInfo, mMatchFilter, mPublishType,
- mTtlSec, mEnableTerminateNotification, mEnableRanging);
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/PublishDiscoverySession.java b/wifi/java/android/net/wifi/aware/PublishDiscoverySession.java
deleted file mode 100644
index 1c99c87..0000000
--- a/wifi/java/android/net/wifi/aware/PublishDiscoverySession.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import android.annotation.NonNull;
-import android.util.Log;
-
-/**
- * A class representing a Aware publish session. Created when
- * {@link WifiAwareSession#publish(PublishConfig, DiscoverySessionCallback,
- * android.os.Handler)} is called and a discovery session is created and returned in
- * {@link DiscoverySessionCallback#onPublishStarted(PublishDiscoverySession)}. See
- * baseline functionality of all discovery sessions in {@link DiscoverySession}. This
- * object allows updating an existing/running publish discovery session using
- * {@link #updatePublish(PublishConfig)}.
- */
-public class PublishDiscoverySession extends DiscoverySession {
- private static final String TAG = "PublishDiscoverySession";
-
- /** @hide */
- public PublishDiscoverySession(WifiAwareManager manager, int clientId, int sessionId) {
- super(manager, clientId, sessionId);
- }
-
- /**
- * Re-configure the currently active publish session. The
- * {@link DiscoverySessionCallback} is not replaced - the same listener used
- * at creation is still used. The results of the configuration are returned using
- * {@link DiscoverySessionCallback}:
- * <ul>
- * <li>{@link DiscoverySessionCallback#onSessionConfigUpdated()}: configuration
- * update succeeded.
- * <li>{@link DiscoverySessionCallback#onSessionConfigFailed()}: configuration
- * update failed. The publish discovery session is still running using its previous
- * configuration (i.e. update failure does not terminate the session).
- * </ul>
- *
- * @param publishConfig The new discovery publish session configuration ({@link PublishConfig}).
- */
- public void updatePublish(@NonNull PublishConfig publishConfig) {
- if (mTerminated) {
- Log.w(TAG, "updatePublish: called on terminated session");
- return;
- } else {
- WifiAwareManager mgr = mMgr.get();
- if (mgr == null) {
- Log.w(TAG, "updatePublish: called post GC on WifiAwareManager");
- return;
- }
-
- mgr.updatePublish(mClientId, mSessionId, publishConfig);
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/SubscribeConfig.java b/wifi/java/android/net/wifi/aware/SubscribeConfig.java
deleted file mode 100644
index 76780f4..0000000
--- a/wifi/java/android/net/wifi/aware/SubscribeConfig.java
+++ /dev/null
@@ -1,497 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import android.annotation.IntDef;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.net.wifi.util.HexEncoding;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * Defines the configuration of a Aware subscribe session. Built using
- * {@link SubscribeConfig.Builder}. Subscribe is done using
- * {@link WifiAwareSession#subscribe(SubscribeConfig, DiscoverySessionCallback,
- * android.os.Handler)} or
- * {@link SubscribeDiscoverySession#updateSubscribe(SubscribeConfig)}.
- */
-public final class SubscribeConfig implements Parcelable {
- /** @hide */
- @IntDef({
- SUBSCRIBE_TYPE_PASSIVE, SUBSCRIBE_TYPE_ACTIVE })
- @Retention(RetentionPolicy.SOURCE)
- public @interface SubscribeTypes {
- }
-
- /**
- * Defines a passive subscribe session - a subscribe session where
- * subscribe packets are not transmitted over-the-air and the device listens
- * and matches to transmitted publish packets. Configuration is done using
- * {@link SubscribeConfig.Builder#setSubscribeType(int)}.
- */
- public static final int SUBSCRIBE_TYPE_PASSIVE = 0;
-
- /**
- * Defines an active subscribe session - a subscribe session where
- * subscribe packets are transmitted over-the-air. Configuration is done
- * using {@link SubscribeConfig.Builder#setSubscribeType(int)}.
- */
- public static final int SUBSCRIBE_TYPE_ACTIVE = 1;
-
- /** @hide */
- public final byte[] mServiceName;
-
- /** @hide */
- public final byte[] mServiceSpecificInfo;
-
- /** @hide */
- public final byte[] mMatchFilter;
-
- /** @hide */
- public final int mSubscribeType;
-
- /** @hide */
- public final int mTtlSec;
-
- /** @hide */
- public final boolean mEnableTerminateNotification;
-
- /** @hide */
- public final boolean mMinDistanceMmSet;
-
- /** @hide */
- public final int mMinDistanceMm;
-
- /** @hide */
- public final boolean mMaxDistanceMmSet;
-
- /** @hide */
- public final int mMaxDistanceMm;
-
- /** @hide */
- public SubscribeConfig(byte[] serviceName, byte[] serviceSpecificInfo, byte[] matchFilter,
- int subscribeType, int ttlSec, boolean enableTerminateNotification,
- boolean minDistanceMmSet, int minDistanceMm, boolean maxDistanceMmSet,
- int maxDistanceMm) {
- mServiceName = serviceName;
- mServiceSpecificInfo = serviceSpecificInfo;
- mMatchFilter = matchFilter;
- mSubscribeType = subscribeType;
- mTtlSec = ttlSec;
- mEnableTerminateNotification = enableTerminateNotification;
- mMinDistanceMm = minDistanceMm;
- mMinDistanceMmSet = minDistanceMmSet;
- mMaxDistanceMm = maxDistanceMm;
- mMaxDistanceMmSet = maxDistanceMmSet;
- }
-
- @Override
- public String toString() {
- return "SubscribeConfig [mServiceName='" + (mServiceName == null ? "<null>"
- : String.valueOf(HexEncoding.encode(mServiceName))) + ", mServiceName.length=" + (
- mServiceName == null ? 0 : mServiceName.length) + ", mServiceSpecificInfo='" + (
- (mServiceSpecificInfo == null) ? "<null>" : String.valueOf(
- HexEncoding.encode(mServiceSpecificInfo)))
- + ", mServiceSpecificInfo.length=" + (mServiceSpecificInfo == null ? 0
- : mServiceSpecificInfo.length) + ", mMatchFilter="
- + (new TlvBufferUtils.TlvIterable(0, 1, mMatchFilter)).toString()
- + ", mMatchFilter.length=" + (mMatchFilter == null ? 0 : mMatchFilter.length)
- + ", mSubscribeType=" + mSubscribeType + ", mTtlSec=" + mTtlSec
- + ", mEnableTerminateNotification=" + mEnableTerminateNotification
- + ", mMinDistanceMm=" + mMinDistanceMm
- + ", mMinDistanceMmSet=" + mMinDistanceMmSet
- + ", mMaxDistanceMm=" + mMaxDistanceMm
- + ", mMaxDistanceMmSet=" + mMaxDistanceMmSet + "]";
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeByteArray(mServiceName);
- dest.writeByteArray(mServiceSpecificInfo);
- dest.writeByteArray(mMatchFilter);
- dest.writeInt(mSubscribeType);
- dest.writeInt(mTtlSec);
- dest.writeInt(mEnableTerminateNotification ? 1 : 0);
- dest.writeInt(mMinDistanceMm);
- dest.writeInt(mMinDistanceMmSet ? 1 : 0);
- dest.writeInt(mMaxDistanceMm);
- dest.writeInt(mMaxDistanceMmSet ? 1 : 0);
- }
-
- public static final @android.annotation.NonNull Creator<SubscribeConfig> CREATOR = new Creator<SubscribeConfig>() {
- @Override
- public SubscribeConfig[] newArray(int size) {
- return new SubscribeConfig[size];
- }
-
- @Override
- public SubscribeConfig createFromParcel(Parcel in) {
- byte[] serviceName = in.createByteArray();
- byte[] ssi = in.createByteArray();
- byte[] matchFilter = in.createByteArray();
- int subscribeType = in.readInt();
- int ttlSec = in.readInt();
- boolean enableTerminateNotification = in.readInt() != 0;
- int minDistanceMm = in.readInt();
- boolean minDistanceMmSet = in.readInt() != 0;
- int maxDistanceMm = in.readInt();
- boolean maxDistanceMmSet = in.readInt() != 0;
-
- return new SubscribeConfig(serviceName, ssi, matchFilter, subscribeType, ttlSec,
- enableTerminateNotification, minDistanceMmSet, minDistanceMm, maxDistanceMmSet,
- maxDistanceMm);
- }
- };
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
-
- if (!(o instanceof SubscribeConfig)) {
- return false;
- }
-
- SubscribeConfig lhs = (SubscribeConfig) o;
-
- if (!(Arrays.equals(mServiceName, lhs.mServiceName) && Arrays.equals(
- mServiceSpecificInfo, lhs.mServiceSpecificInfo) && Arrays.equals(mMatchFilter,
- lhs.mMatchFilter) && mSubscribeType == lhs.mSubscribeType && mTtlSec == lhs.mTtlSec
- && mEnableTerminateNotification == lhs.mEnableTerminateNotification
- && mMinDistanceMmSet == lhs.mMinDistanceMmSet
- && mMaxDistanceMmSet == lhs.mMaxDistanceMmSet)) {
- return false;
- }
-
- if (mMinDistanceMmSet && mMinDistanceMm != lhs.mMinDistanceMm) {
- return false;
- }
-
- if (mMaxDistanceMmSet && mMaxDistanceMm != lhs.mMaxDistanceMm) {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = Objects.hash(Arrays.hashCode(mServiceName),
- Arrays.hashCode(mServiceSpecificInfo), Arrays.hashCode(mMatchFilter),
- mSubscribeType, mTtlSec, mEnableTerminateNotification, mMinDistanceMmSet,
- mMaxDistanceMmSet);
-
- if (mMinDistanceMmSet) {
- result = Objects.hash(result, mMinDistanceMm);
- }
- if (mMaxDistanceMmSet) {
- result = Objects.hash(result, mMaxDistanceMm);
- }
-
- return result;
- }
-
- /**
- * Verifies that the contents of the SubscribeConfig are valid. Otherwise
- * throws an IllegalArgumentException.
- *
- * @hide
- */
- public void assertValid(Characteristics characteristics, boolean rttSupported)
- throws IllegalArgumentException {
- WifiAwareUtils.validateServiceName(mServiceName);
-
- if (!TlvBufferUtils.isValid(mMatchFilter, 0, 1)) {
- throw new IllegalArgumentException(
- "Invalid matchFilter configuration - LV fields do not match up to length");
- }
- if (mSubscribeType < SUBSCRIBE_TYPE_PASSIVE || mSubscribeType > SUBSCRIBE_TYPE_ACTIVE) {
- throw new IllegalArgumentException("Invalid subscribeType - " + mSubscribeType);
- }
- if (mTtlSec < 0) {
- throw new IllegalArgumentException("Invalid ttlSec - must be non-negative");
- }
-
- if (characteristics != null) {
- int maxServiceNameLength = characteristics.getMaxServiceNameLength();
- if (maxServiceNameLength != 0 && mServiceName.length > maxServiceNameLength) {
- throw new IllegalArgumentException(
- "Service name longer than supported by device characteristics");
- }
- int maxServiceSpecificInfoLength = characteristics.getMaxServiceSpecificInfoLength();
- if (maxServiceSpecificInfoLength != 0 && mServiceSpecificInfo != null
- && mServiceSpecificInfo.length > maxServiceSpecificInfoLength) {
- throw new IllegalArgumentException(
- "Service specific info longer than supported by device characteristics");
- }
- int maxMatchFilterLength = characteristics.getMaxMatchFilterLength();
- if (maxMatchFilterLength != 0 && mMatchFilter != null
- && mMatchFilter.length > maxMatchFilterLength) {
- throw new IllegalArgumentException(
- "Match filter longer than supported by device characteristics");
- }
- }
-
- if (mMinDistanceMmSet && mMinDistanceMm < 0) {
- throw new IllegalArgumentException("Minimum distance must be non-negative");
- }
- if (mMaxDistanceMmSet && mMaxDistanceMm < 0) {
- throw new IllegalArgumentException("Maximum distance must be non-negative");
- }
- if (mMinDistanceMmSet && mMaxDistanceMmSet && mMaxDistanceMm <= mMinDistanceMm) {
- throw new IllegalArgumentException(
- "Maximum distance must be greater than minimum distance");
- }
-
- if (!rttSupported && (mMinDistanceMmSet || mMaxDistanceMmSet)) {
- throw new IllegalArgumentException("Ranging is not supported");
- }
- }
-
- /**
- * Builder used to build {@link SubscribeConfig} objects.
- */
- public static final class Builder {
- private byte[] mServiceName;
- private byte[] mServiceSpecificInfo;
- private byte[] mMatchFilter;
- private int mSubscribeType = SUBSCRIBE_TYPE_PASSIVE;
- private int mTtlSec = 0;
- private boolean mEnableTerminateNotification = true;
- private boolean mMinDistanceMmSet = false;
- private int mMinDistanceMm;
- private boolean mMaxDistanceMmSet = false;
- private int mMaxDistanceMm;
-
- /**
- * Specify the service name of the subscribe session. The actual on-air
- * value is a 6 byte hashed representation of this string.
- * <p>
- * The Service Name is a UTF-8 encoded string from 1 to 255 bytes in length.
- * The only acceptable single-byte UTF-8 symbols for a Service Name are alphanumeric
- * values (A-Z, a-z, 0-9), the hyphen ('-'), and the period ('.'). All valid multi-byte
- * UTF-8 characters are acceptable in a Service Name.
- * <p>
- * Must be called - an empty ServiceName is not valid.
- *
- * @param serviceName The service name for the subscribe session.
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setServiceName(@NonNull String serviceName) {
- if (serviceName == null) {
- throw new IllegalArgumentException("Invalid service name - must be non-null");
- }
- mServiceName = serviceName.getBytes(StandardCharsets.UTF_8);
- return this;
- }
-
- /**
- * Specify service specific information for the subscribe session. This is
- * a free-form byte array available to the application to send
- * additional information as part of the discovery operation - i.e. it
- * will not be used to determine whether a publish/subscribe match
- * occurs.
- * <p>
- * Optional. Empty by default.
- *
- * @param serviceSpecificInfo A byte-array for the service-specific
- * information field.
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setServiceSpecificInfo(@Nullable byte[] serviceSpecificInfo) {
- mServiceSpecificInfo = serviceSpecificInfo;
- return this;
- }
-
- /**
- * The match filter for a subscribe session. Used to determine whether a service
- * discovery occurred - in addition to relying on the service name.
- * <p>
- * Optional. Empty by default.
- *
- * @param matchFilter A list of match filter entries (each of which is an arbitrary byte
- * array).
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setMatchFilter(@Nullable List<byte[]> matchFilter) {
- mMatchFilter = new TlvBufferUtils.TlvConstructor(0, 1).allocateAndPut(
- matchFilter).getArray();
- return this;
- }
-
- /**
- * Sets the type of the subscribe session: active (subscribe packets are
- * transmitted over-the-air), or passive (no subscribe packets are
- * transmitted, a match is made against a solicited/active publish
- * session whose packets are transmitted over-the-air).
- *
- * @param subscribeType Subscribe session type:
- * {@link SubscribeConfig#SUBSCRIBE_TYPE_ACTIVE} or
- * {@link SubscribeConfig#SUBSCRIBE_TYPE_PASSIVE}.
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setSubscribeType(@SubscribeTypes int subscribeType) {
- if (subscribeType < SUBSCRIBE_TYPE_PASSIVE || subscribeType > SUBSCRIBE_TYPE_ACTIVE) {
- throw new IllegalArgumentException("Invalid subscribeType - " + subscribeType);
- }
- mSubscribeType = subscribeType;
- return this;
- }
-
- /**
- * Sets the time interval (in seconds) an active (
- * {@link SubscribeConfig.Builder#setSubscribeType(int)}) subscribe session
- * will be alive - i.e. broadcasting a packet. When the TTL is reached
- * an event will be generated for
- * {@link DiscoverySessionCallback#onSessionTerminated()}.
- * <p>
- * Optional. 0 by default - indicating the session doesn't terminate on its own.
- * Session will be terminated when {@link DiscoverySession#close()} is
- * called.
- *
- * @param ttlSec Lifetime of a subscribe session in seconds.
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setTtlSec(int ttlSec) {
- if (ttlSec < 0) {
- throw new IllegalArgumentException("Invalid ttlSec - must be non-negative");
- }
- mTtlSec = ttlSec;
- return this;
- }
-
- /**
- * Configure whether a subscribe terminate notification
- * {@link DiscoverySessionCallback#onSessionTerminated()} is reported
- * back to the callback.
- *
- * @param enable If true the terminate callback will be called when the
- * subscribe is terminated. Otherwise it will not be called.
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setTerminateNotificationEnabled(boolean enable) {
- mEnableTerminateNotification = enable;
- return this;
- }
-
- /**
- * Configure the minimum distance to a discovered publisher at which to trigger a discovery
- * notification. I.e. discovery will be triggered if we've found a matching publisher
- * (based on the other criteria in this configuration) <b>and</b> the distance to the
- * publisher is larger than the value specified in this API. Can be used in conjunction with
- * {@link #setMaxDistanceMm(int)} to specify a geofence, i.e. discovery with min <=
- * distance <= max.
- * <p>
- * For ranging to be used in discovery it must also be enabled on the publisher using
- * {@link PublishConfig.Builder#setRangingEnabled(boolean)}. However, ranging may
- * not be available or enabled on the publisher or may be temporarily disabled on either
- * subscriber or publisher - in such cases discovery will proceed without ranging.
- * <p>
- * When ranging is enabled and available on both publisher and subscriber and a service
- * is discovered based on geofence constraints the
- * {@link DiscoverySessionCallback#onServiceDiscoveredWithinRange(PeerHandle, byte[], List, int)}
- * is called, otherwise the
- * {@link DiscoverySessionCallback#onServiceDiscovered(PeerHandle, byte[], List)}
- * is called.
- * <p>
- * The device must support Wi-Fi RTT for this feature to be used. Feature support is checked
- * as described in {@link android.net.wifi.rtt}.
- *
- * @param minDistanceMm Minimum distance, in mm, to the publisher above which to trigger
- * discovery.
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setMinDistanceMm(int minDistanceMm) {
- mMinDistanceMm = minDistanceMm;
- mMinDistanceMmSet = true;
- return this;
- }
-
- /**
- * Configure the maximum distance to a discovered publisher at which to trigger a discovery
- * notification. I.e. discovery will be triggered if we've found a matching publisher
- * (based on the other criteria in this configuration) <b>and</b> the distance to the
- * publisher is smaller than the value specified in this API. Can be used in conjunction
- * with {@link #setMinDistanceMm(int)} to specify a geofence, i.e. discovery with min <=
- * distance <= max.
- * <p>
- * For ranging to be used in discovery it must also be enabled on the publisher using
- * {@link PublishConfig.Builder#setRangingEnabled(boolean)}. However, ranging may
- * not be available or enabled on the publisher or may be temporarily disabled on either
- * subscriber or publisher - in such cases discovery will proceed without ranging.
- * <p>
- * When ranging is enabled and available on both publisher and subscriber and a service
- * is discovered based on geofence constraints the
- * {@link DiscoverySessionCallback#onServiceDiscoveredWithinRange(PeerHandle, byte[], List, int)}
- * is called, otherwise the
- * {@link DiscoverySessionCallback#onServiceDiscovered(PeerHandle, byte[], List)}
- * is called.
- * <p>
- * The device must support Wi-Fi RTT for this feature to be used. Feature support is checked
- * as described in {@link android.net.wifi.rtt}.
- *
- * @param maxDistanceMm Maximum distance, in mm, to the publisher below which to trigger
- * discovery.
- *
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder setMaxDistanceMm(int maxDistanceMm) {
- mMaxDistanceMm = maxDistanceMm;
- mMaxDistanceMmSet = true;
- return this;
- }
-
- /**
- * Build {@link SubscribeConfig} given the current requests made on the
- * builder.
- */
- public SubscribeConfig build() {
- return new SubscribeConfig(mServiceName, mServiceSpecificInfo, mMatchFilter,
- mSubscribeType, mTtlSec, mEnableTerminateNotification,
- mMinDistanceMmSet, mMinDistanceMm, mMaxDistanceMmSet, mMaxDistanceMm);
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/SubscribeDiscoverySession.java b/wifi/java/android/net/wifi/aware/SubscribeDiscoverySession.java
deleted file mode 100644
index ca88a90..0000000
--- a/wifi/java/android/net/wifi/aware/SubscribeDiscoverySession.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import android.annotation.NonNull;
-import android.util.Log;
-
-/**
- * A class representing a Aware subscribe session. Created when
- * {@link WifiAwareSession#subscribe(SubscribeConfig,
- * DiscoverySessionCallback, android.os.Handler)}
- * is called and a discovery session is created and returned in
- * {@link DiscoverySessionCallback#onSubscribeStarted(SubscribeDiscoverySession)}.
- * See baseline functionality of all discovery sessions in {@link DiscoverySession}.
- * This object allows updating an existing/running subscribe discovery session using
- * {@link #updateSubscribe(SubscribeConfig)}.
- */
-public class SubscribeDiscoverySession extends DiscoverySession {
- private static final String TAG = "SubscribeDiscSession";
-
- /**
- * {@hide}
- */
- public SubscribeDiscoverySession(WifiAwareManager manager, int clientId,
- int sessionId) {
- super(manager, clientId, sessionId);
- }
-
- /**
- * Re-configure the currently active subscribe session. The
- * {@link DiscoverySessionCallback} is not replaced - the same listener used
- * at creation is still used. The results of the configuration are returned using
- * {@link DiscoverySessionCallback}:
- * <ul>
- * <li>{@link DiscoverySessionCallback#onSessionConfigUpdated()}: configuration
- * update succeeded.
- * <li>{@link DiscoverySessionCallback#onSessionConfigFailed()}: configuration
- * update failed. The subscribe discovery session is still running using its previous
- * configuration (i.e. update failure does not terminate the session).
- * </ul>
- *
- * @param subscribeConfig The new discovery subscribe session configuration
- * ({@link SubscribeConfig}).
- */
- public void updateSubscribe(@NonNull SubscribeConfig subscribeConfig) {
- if (mTerminated) {
- Log.w(TAG, "updateSubscribe: called on terminated session");
- return;
- } else {
- WifiAwareManager mgr = mMgr.get();
- if (mgr == null) {
- Log.w(TAG, "updateSubscribe: called post GC on WifiAwareManager");
- return;
- }
-
- mgr.updateSubscribe(mClientId, mSessionId, subscribeConfig);
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/TlvBufferUtils.java b/wifi/java/android/net/wifi/aware/TlvBufferUtils.java
deleted file mode 100644
index 2d3cc1e..0000000
--- a/wifi/java/android/net/wifi/aware/TlvBufferUtils.java
+++ /dev/null
@@ -1,714 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import android.annotation.Nullable;
-
-import java.nio.BufferOverflowException;
-import java.nio.ByteOrder;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-
-/**
- * Utility class to construct and parse byte arrays using the TLV format -
- * Type/Length/Value format. The utilities accept a configuration of the size of
- * the Type field and the Length field. A Type field size of 0 is allowed -
- * allowing usage for LV (no T) array formats.
- *
- * @hide
- */
-public class TlvBufferUtils {
- private TlvBufferUtils() {
- // no reason to ever create this class
- }
-
- /**
- * Utility class to construct byte arrays using the TLV format -
- * Type/Length/Value.
- * <p>
- * A constructor is created specifying the size of the Type (T) and Length
- * (L) fields. A specification of zero size T field is allowed - resulting
- * in LV type format.
- * <p>
- * The byte array is either provided (using
- * {@link TlvConstructor#wrap(byte[])}) or allocated (using
- * {@link TlvConstructor#allocate(int)}).
- * <p>
- * Values are added to the structure using the {@code TlvConstructor.put*()}
- * methods.
- * <p>
- * The final byte array is obtained using {@link TlvConstructor#getArray()}.
- */
- public static class TlvConstructor {
- private int mTypeSize;
- private int mLengthSize;
- private ByteOrder mByteOrder = ByteOrder.BIG_ENDIAN;
-
- private byte[] mArray;
- private int mArrayLength;
- private int mPosition;
-
- /**
- * Define a TLV constructor with the specified size of the Type (T) and
- * Length (L) fields.
- *
- * @param typeSize Number of bytes used for the Type (T) field. Values
- * of 0, 1, or 2 bytes are allowed. A specification of 0
- * bytes implies that the field being constructed has the LV
- * format rather than the TLV format.
- * @param lengthSize Number of bytes used for the Length (L) field.
- * Values of 1 or 2 bytes are allowed.
- */
- public TlvConstructor(int typeSize, int lengthSize) {
- if (typeSize < 0 || typeSize > 2 || lengthSize <= 0 || lengthSize > 2) {
- throw new IllegalArgumentException(
- "Invalid sizes - typeSize=" + typeSize + ", lengthSize=" + lengthSize);
- }
- mTypeSize = typeSize;
- mLengthSize = lengthSize;
- mPosition = 0;
- }
-
- /**
- * Configure the TLV constructor to use a particular byte order. Should be
- * {@link ByteOrder#BIG_ENDIAN} (the default at construction) or
- * {@link ByteOrder#LITTLE_ENDIAN}.
- *
- * @return The constructor to facilitate chaining
- * {@code ctr.putXXX(..).putXXX(..)}.
- */
- public TlvConstructor setByteOrder(ByteOrder byteOrder) {
- mByteOrder = byteOrder;
- return this;
- }
-
- /**
- * Set the byte array to be used to construct the TLV.
- *
- * @param array Byte array to be formatted.
- * @return The constructor to facilitate chaining
- * {@code ctr.putXXX(..).putXXX(..)}.
- */
- public TlvConstructor wrap(@Nullable byte[] array) {
- mArray = array;
- mArrayLength = (array == null) ? 0 : array.length;
- mPosition = 0;
- return this;
- }
-
- /**
- * Allocates a new byte array to be used ot construct a TLV.
- *
- * @param capacity The size of the byte array to be allocated.
- * @return The constructor to facilitate chaining
- * {@code ctr.putXXX(..).putXXX(..)}.
- */
- public TlvConstructor allocate(int capacity) {
- mArray = new byte[capacity];
- mArrayLength = capacity;
- mPosition = 0;
- return this;
- }
-
- /**
- * Creates a TLV array (of the previously specified Type and Length sizes) from the input
- * list. Allocates an array matching the contents (and required Type and Length
- * fields), copies the contents, and set the Length fields. The Type field is set to 0.
- *
- * @param list A list of fields to be added to the TLV buffer.
- * @return The constructor of the TLV.
- */
- public TlvConstructor allocateAndPut(@Nullable List<byte[]> list) {
- if (list != null) {
- int size = 0;
- for (byte[] field : list) {
- size += mTypeSize + mLengthSize;
- if (field != null) {
- size += field.length;
- }
- }
- allocate(size);
- for (byte[] field : list) {
- putByteArray(0, field);
- }
- }
- return this;
- }
-
- /**
- * Copies a byte into the TLV with the indicated type. For an LV
- * formatted structure (i.e. typeLength=0 in {@link TlvConstructor
- * TlvConstructor(int, int)} ) the type field is ignored.
- *
- * @param type The value to be placed into the Type field.
- * @param b The byte to be inserted into the structure.
- * @return The constructor to facilitate chaining
- * {@code ctr.putXXX(..).putXXX(..)}.
- */
- public TlvConstructor putByte(int type, byte b) {
- checkLength(1);
- addHeader(type, 1);
- mArray[mPosition++] = b;
- return this;
- }
-
- /**
- * Copies a raw byte into the TLV buffer - without a type or a length.
- *
- * @param b The byte to be inserted into the structure.
- * @return The constructor to facilitate chaining {@code cts.putXXX(..).putXXX(..)}.
- */
- public TlvConstructor putRawByte(byte b) {
- checkRawLength(1);
- mArray[mPosition++] = b;
- return this;
- }
-
- /**
- * Copies a byte array into the TLV with the indicated type. For an LV
- * formatted structure (i.e. typeLength=0 in {@link TlvConstructor
- * TlvConstructor(int, int)} ) the type field is ignored.
- *
- * @param type The value to be placed into the Type field.
- * @param array The array to be copied into the TLV structure.
- * @param offset Start copying from the array at the specified offset.
- * @param length Copy the specified number (length) of bytes from the
- * array.
- * @return The constructor to facilitate chaining
- * {@code ctr.putXXX(..).putXXX(..)}.
- */
- public TlvConstructor putByteArray(int type, @Nullable byte[] array, int offset,
- int length) {
- checkLength(length);
- addHeader(type, length);
- if (length != 0) {
- System.arraycopy(array, offset, mArray, mPosition, length);
- }
- mPosition += length;
- return this;
- }
-
- /**
- * Copies a byte array into the TLV with the indicated type. For an LV
- * formatted structure (i.e. typeLength=0 in {@link TlvConstructor
- * TlvConstructor(int, int)} ) the type field is ignored.
- *
- * @param type The value to be placed into the Type field.
- * @param array The array to be copied (in full) into the TLV structure.
- * @return The constructor to facilitate chaining
- * {@code ctr.putXXX(..).putXXX(..)}.
- */
- public TlvConstructor putByteArray(int type, @Nullable byte[] array) {
- return putByteArray(type, array, 0, (array == null) ? 0 : array.length);
- }
-
- /**
- * Copies a byte array into the TLV - without a type or a length.
- *
- * @param array The array to be copied (in full) into the TLV structure.
- * @return The constructor to facilitate chaining
- * {@code ctr.putXXX(..).putXXX(..)}.
- */
- public TlvConstructor putRawByteArray(@Nullable byte[] array) {
- if (array == null) return this;
-
- checkRawLength(array.length);
- System.arraycopy(array, 0, mArray, mPosition, array.length);
- mPosition += array.length;
- return this;
- }
-
- /**
- * Places a zero length element (i.e. Length field = 0) into the TLV.
- * For an LV formatted structure (i.e. typeLength=0 in
- * {@link TlvConstructor TlvConstructor(int, int)} ) the type field is
- * ignored.
- *
- * @param type The value to be placed into the Type field.
- * @return The constructor to facilitate chaining
- * {@code ctr.putXXX(..).putXXX(..)}.
- */
- public TlvConstructor putZeroLengthElement(int type) {
- checkLength(0);
- addHeader(type, 0);
- return this;
- }
-
- /**
- * Copies short into the TLV with the indicated type. For an LV
- * formatted structure (i.e. typeLength=0 in {@link TlvConstructor
- * TlvConstructor(int, int)} ) the type field is ignored.
- *
- * @param type The value to be placed into the Type field.
- * @param data The short to be inserted into the structure.
- * @return The constructor to facilitate chaining
- * {@code ctr.putXXX(..).putXXX(..)}.
- */
- public TlvConstructor putShort(int type, short data) {
- checkLength(2);
- addHeader(type, 2);
- pokeShort(mArray, mPosition, data, mByteOrder);
- mPosition += 2;
- return this;
- }
-
- /**
- * Copies integer into the TLV with the indicated type. For an LV
- * formatted structure (i.e. typeLength=0 in {@link TlvConstructor
- * TlvConstructor(int, int)} ) the type field is ignored.
- *
- * @param type The value to be placed into the Type field.
- * @param data The integer to be inserted into the structure.
- * @return The constructor to facilitate chaining
- * {@code ctr.putXXX(..).putXXX(..)}.
- */
- public TlvConstructor putInt(int type, int data) {
- checkLength(4);
- addHeader(type, 4);
- pokeInt(mArray, mPosition, data, mByteOrder);
- mPosition += 4;
- return this;
- }
-
- /**
- * Copies a String's byte representation into the TLV with the indicated
- * type. For an LV formatted structure (i.e. typeLength=0 in
- * {@link TlvConstructor TlvConstructor(int, int)} ) the type field is
- * ignored.
- *
- * @param type The value to be placed into the Type field.
- * @param data The string whose bytes are to be inserted into the
- * structure.
- * @return The constructor to facilitate chaining
- * {@code ctr.putXXX(..).putXXX(..)}.
- */
- public TlvConstructor putString(int type, @Nullable String data) {
- byte[] bytes = null;
- int length = 0;
- if (data != null) {
- bytes = data.getBytes();
- length = bytes.length;
- }
- return putByteArray(type, bytes, 0, length);
- }
-
- /**
- * Returns the constructed TLV formatted byte-array. This array is a copy of the wrapped
- * or allocated array - truncated to just the significant bytes - i.e. those written into
- * the (T)LV.
- *
- * @return The byte array containing the TLV formatted structure.
- */
- public byte[] getArray() {
- return Arrays.copyOf(mArray, getActualLength());
- }
-
- /**
- * Returns the size of the TLV formatted portion of the wrapped or
- * allocated byte array. The array itself is returned with
- * {@link TlvConstructor#getArray()}.
- *
- * @return The size of the TLV formatted portion of the byte array.
- */
- private int getActualLength() {
- return mPosition;
- }
-
- private void checkLength(int dataLength) {
- if (mPosition + mTypeSize + mLengthSize + dataLength > mArrayLength) {
- throw new BufferOverflowException();
- }
- }
-
- private void checkRawLength(int dataLength) {
- if (mPosition + dataLength > mArrayLength) {
- throw new BufferOverflowException();
- }
- }
-
- private void addHeader(int type, int length) {
- if (mTypeSize == 1) {
- mArray[mPosition] = (byte) type;
- } else if (mTypeSize == 2) {
- pokeShort(mArray, mPosition, (short) type, mByteOrder);
- }
- mPosition += mTypeSize;
-
- if (mLengthSize == 1) {
- mArray[mPosition] = (byte) length;
- } else if (mLengthSize == 2) {
- pokeShort(mArray, mPosition, (short) length, mByteOrder);
- }
- mPosition += mLengthSize;
- }
- }
-
- /**
- * Utility class used when iterating over a TLV formatted byte-array. Use
- * {@link TlvIterable} to iterate over array. A {@link TlvElement}
- * represents each entry in a TLV formatted byte-array.
- */
- public static class TlvElement {
- /**
- * The Type (T) field of the current TLV element. Note that for LV
- * formatted byte-arrays (i.e. TLV whose Type/T size is 0) the value of
- * this field is undefined.
- */
- public int type;
-
- /**
- * The Length (L) field of the current TLV element.
- */
- public int length;
-
- /**
- * Control of the endianess of the TLV element - true for big-endian, false for little-
- * endian.
- */
- public ByteOrder byteOrder = ByteOrder.BIG_ENDIAN;
-
- /**
- * The Value (V) field - a raw byte array representing the current TLV
- * element where the entry starts at {@link TlvElement#offset}.
- */
- private byte[] mRefArray;
-
- /**
- * The offset to be used into {@link TlvElement#mRefArray} to access the
- * raw data representing the current TLV element.
- */
- public int offset;
-
- private TlvElement(int type, int length, @Nullable byte[] refArray, int offset) {
- this.type = type;
- this.length = length;
- mRefArray = refArray;
- this.offset = offset;
-
- if (offset + length > refArray.length) {
- throw new BufferOverflowException();
- }
- }
-
- /**
- * Return the raw byte array of the Value (V) field.
- *
- * @return The Value (V) field as a byte array.
- */
- public byte[] getRawData() {
- return Arrays.copyOfRange(mRefArray, offset, offset + length);
- }
-
- /**
- * Utility function to return a byte representation of a TLV element of
- * length 1. Note: an attempt to call this function on a TLV item whose
- * {@link TlvElement#length} is != 1 will result in an exception.
- *
- * @return byte representation of current TLV element.
- */
- public byte getByte() {
- if (length != 1) {
- throw new IllegalArgumentException(
- "Accesing a byte from a TLV element of length " + length);
- }
- return mRefArray[offset];
- }
-
- /**
- * Utility function to return a short representation of a TLV element of
- * length 2. Note: an attempt to call this function on a TLV item whose
- * {@link TlvElement#length} is != 2 will result in an exception.
- *
- * @return short representation of current TLV element.
- */
- public short getShort() {
- if (length != 2) {
- throw new IllegalArgumentException(
- "Accesing a short from a TLV element of length " + length);
- }
- return peekShort(mRefArray, offset, byteOrder);
- }
-
- /**
- * Utility function to return an integer representation of a TLV element
- * of length 4. Note: an attempt to call this function on a TLV item
- * whose {@link TlvElement#length} is != 4 will result in an exception.
- *
- * @return integer representation of current TLV element.
- */
- public int getInt() {
- if (length != 4) {
- throw new IllegalArgumentException(
- "Accesing an int from a TLV element of length " + length);
- }
- return peekInt(mRefArray, offset, byteOrder);
- }
-
- /**
- * Utility function to return a String representation of a TLV element.
- *
- * @return String repersentation of the current TLV element.
- */
- public String getString() {
- return new String(mRefArray, offset, length);
- }
- }
-
- /**
- * Utility class to iterate over a TLV formatted byte-array.
- */
- public static class TlvIterable implements Iterable<TlvElement> {
- private int mTypeSize;
- private int mLengthSize;
- private ByteOrder mByteOrder = ByteOrder.BIG_ENDIAN;
- private byte[] mArray;
- private int mArrayLength;
-
- /**
- * Constructs a TlvIterable object - specifying the format of the TLV
- * (the sizes of the Type and Length fields), and the byte array whose
- * data is to be parsed.
- *
- * @param typeSize Number of bytes used for the Type (T) field. Valid
- * values are 0 (i.e. indicating the format is LV rather than
- * TLV), 1, and 2 bytes.
- * @param lengthSize Number of bytes used for the Length (L) field.
- * Values values are 1 or 2 bytes.
- * @param array The TLV formatted byte-array to parse.
- */
- public TlvIterable(int typeSize, int lengthSize, @Nullable byte[] array) {
- if (typeSize < 0 || typeSize > 2 || lengthSize <= 0 || lengthSize > 2) {
- throw new IllegalArgumentException(
- "Invalid sizes - typeSize=" + typeSize + ", lengthSize=" + lengthSize);
- }
- mTypeSize = typeSize;
- mLengthSize = lengthSize;
- mArray = array;
- mArrayLength = (array == null) ? 0 : array.length;
- }
-
- /**
- * Configure the TLV iterator to use little-endian byte ordering.
- */
- public void setByteOrder(ByteOrder byteOrder) {
- mByteOrder = byteOrder;
- }
-
- /**
- * Prints out a parsed representation of the TLV-formatted byte array.
- * Whenever possible bytes, shorts, and integer are printed out (for
- * fields whose length is 1, 2, or 4 respectively).
- */
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
-
- builder.append("[");
- boolean first = true;
- for (TlvElement tlv : this) {
- if (!first) {
- builder.append(",");
- }
- first = false;
- builder.append(" (");
- if (mTypeSize != 0) {
- builder.append("T=" + tlv.type + ",");
- }
- builder.append("L=" + tlv.length + ") ");
- if (tlv.length == 0) {
- builder.append("<null>");
- } else if (tlv.length == 1) {
- builder.append(tlv.getByte());
- } else if (tlv.length == 2) {
- builder.append(tlv.getShort());
- } else if (tlv.length == 4) {
- builder.append(tlv.getInt());
- } else {
- builder.append("<bytes>");
- }
- if (tlv.length != 0) {
- builder.append(" (S='" + tlv.getString() + "')");
- }
- }
- builder.append("]");
-
- return builder.toString();
- }
-
- /**
- * Returns a List with the raw contents (no types) of the iterator.
- */
- public List<byte[]> toList() {
- List<byte[]> list = new ArrayList<>();
- for (TlvElement tlv : this) {
- list.add(Arrays.copyOfRange(tlv.mRefArray, tlv.offset, tlv.offset + tlv.length));
- }
-
- return list;
- }
-
- /**
- * Returns an iterator to step through a TLV formatted byte-array. The
- * individual elements returned by the iterator are {@link TlvElement}.
- */
- @Override
- public Iterator<TlvElement> iterator() {
- return new Iterator<TlvElement>() {
- private int mOffset = 0;
-
- @Override
- public boolean hasNext() {
- return mOffset < mArrayLength;
- }
-
- @Override
- public TlvElement next() {
- if (!hasNext()) {
- throw new NoSuchElementException();
- }
-
- int type = 0;
- if (mTypeSize == 1) {
- type = mArray[mOffset];
- } else if (mTypeSize == 2) {
- type = peekShort(mArray, mOffset, mByteOrder);
- }
- mOffset += mTypeSize;
-
- int length = 0;
- if (mLengthSize == 1) {
- length = mArray[mOffset];
- } else if (mLengthSize == 2) {
- length = peekShort(mArray, mOffset, mByteOrder);
- }
- mOffset += mLengthSize;
-
- TlvElement tlv = new TlvElement(type, length, mArray, mOffset);
- tlv.byteOrder = mByteOrder;
- mOffset += length;
- return tlv;
- }
-
- @Override
- public void remove() {
- throw new UnsupportedOperationException();
- }
- };
- }
- }
-
- /**
- * Validates that a (T)LV array is constructed correctly. I.e. that its specified Length
- * fields correctly fill the specified length (and do not overshoot). Uses big-endian
- * byte ordering.
- *
- * @param array The (T)LV array to verify.
- * @param typeSize The size (in bytes) of the type field. Valid values are 0, 1, or 2.
- * @param lengthSize The size (in bytes) of the length field. Valid values are 1 or 2.
- * @return A boolean indicating whether the array is valid (true) or invalid (false).
- */
- public static boolean isValid(@Nullable byte[] array, int typeSize, int lengthSize) {
- return isValidEndian(array, typeSize, lengthSize, ByteOrder.BIG_ENDIAN);
- }
-
- /**
- * Validates that a (T)LV array is constructed correctly. I.e. that its specified Length
- * fields correctly fill the specified length (and do not overshoot).
- *
- * @param array The (T)LV array to verify.
- * @param typeSize The size (in bytes) of the type field. Valid values are 0, 1, or 2.
- * @param lengthSize The size (in bytes) of the length field. Valid values are 1 or 2.
- * @param byteOrder The endianness of the byte array: {@link ByteOrder#BIG_ENDIAN} or
- * {@link ByteOrder#LITTLE_ENDIAN}.
- * @return A boolean indicating whether the array is valid (true) or invalid (false).
- */
- public static boolean isValidEndian(@Nullable byte[] array, int typeSize, int lengthSize,
- ByteOrder byteOrder) {
- if (typeSize < 0 || typeSize > 2) {
- throw new IllegalArgumentException(
- "Invalid arguments - typeSize must be 0, 1, or 2: typeSize=" + typeSize);
- }
- if (lengthSize <= 0 || lengthSize > 2) {
- throw new IllegalArgumentException(
- "Invalid arguments - lengthSize must be 1 or 2: lengthSize=" + lengthSize);
- }
- if (array == null) {
- return true;
- }
-
- int nextTlvIndex = 0;
- while (nextTlvIndex + typeSize + lengthSize <= array.length) {
- nextTlvIndex += typeSize;
- if (lengthSize == 1) {
- nextTlvIndex += lengthSize + array[nextTlvIndex];
- } else {
- nextTlvIndex += lengthSize + peekShort(array, nextTlvIndex, byteOrder);
- }
- }
-
- return nextTlvIndex == array.length;
- }
-
- private static void pokeShort(byte[] dst, int offset, short value, ByteOrder order) {
- if (order == ByteOrder.BIG_ENDIAN) {
- dst[offset++] = (byte) ((value >> 8) & 0xff);
- dst[offset ] = (byte) ((value >> 0) & 0xff);
- } else {
- dst[offset++] = (byte) ((value >> 0) & 0xff);
- dst[offset ] = (byte) ((value >> 8) & 0xff);
- }
- }
-
- private static void pokeInt(byte[] dst, int offset, int value, ByteOrder order) {
- if (order == ByteOrder.BIG_ENDIAN) {
- dst[offset++] = (byte) ((value >> 24) & 0xff);
- dst[offset++] = (byte) ((value >> 16) & 0xff);
- dst[offset++] = (byte) ((value >> 8) & 0xff);
- dst[offset ] = (byte) ((value >> 0) & 0xff);
- } else {
- dst[offset++] = (byte) ((value >> 0) & 0xff);
- dst[offset++] = (byte) ((value >> 8) & 0xff);
- dst[offset++] = (byte) ((value >> 16) & 0xff);
- dst[offset ] = (byte) ((value >> 24) & 0xff);
- }
- }
-
- private static short peekShort(byte[] src, int offset, ByteOrder order) {
- if (order == ByteOrder.BIG_ENDIAN) {
- return (short) ((src[offset] << 8) | (src[offset + 1] & 0xff));
- } else {
- return (short) ((src[offset + 1] << 8) | (src[offset] & 0xff));
- }
- }
-
- private static int peekInt(byte[] src, int offset, ByteOrder order) {
- if (order == ByteOrder.BIG_ENDIAN) {
- return ((src[offset++] & 0xff) << 24)
- | ((src[offset++] & 0xff) << 16)
- | ((src[offset++] & 0xff) << 8)
- | ((src[offset ] & 0xff) << 0);
- } else {
- return ((src[offset++] & 0xff) << 0)
- | ((src[offset++] & 0xff) << 8)
- | ((src[offset++] & 0xff) << 16)
- | ((src[offset ] & 0xff) << 24);
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/WifiAwareAgentNetworkSpecifier.java b/wifi/java/android/net/wifi/aware/WifiAwareAgentNetworkSpecifier.java
deleted file mode 100644
index 9ae3bd0..0000000
--- a/wifi/java/android/net/wifi/aware/WifiAwareAgentNetworkSpecifier.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.aware;
-
-import android.net.NetworkSpecifier;
-import android.net.wifi.util.HexEncoding;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.util.Log;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.StringJoiner;
-
-/**
- * A network specifier object used to represent the capabilities of an network agent. A collection
- * of multiple WifiAwareNetworkSpecifier objects whose matching critiera (satisfiedBy) is an OR:
- * a match on any of the network specifiers in the collection is a match.
- *
- * This class is not intended for use in network requests.
- *
- * @hide
- */
-public class WifiAwareAgentNetworkSpecifier extends NetworkSpecifier implements Parcelable {
- private static final String TAG = "WifiAwareAgentNs";
-
- private static final boolean VDBG = false; // STOPSHIP if true
-
- private Set<ByteArrayWrapper> mNetworkSpecifiers = new HashSet<>();
- private MessageDigest mDigester;
-
- public WifiAwareAgentNetworkSpecifier() {
- initialize();
- }
-
- public WifiAwareAgentNetworkSpecifier(WifiAwareNetworkSpecifier ns) {
- initialize();
- mNetworkSpecifiers.add(convert(ns));
- }
-
- public WifiAwareAgentNetworkSpecifier(WifiAwareNetworkSpecifier[] nss) {
- initialize();
- for (WifiAwareNetworkSpecifier ns : nss) {
- mNetworkSpecifiers.add(convert(ns));
- }
- }
-
- public boolean isEmpty() {
- return mNetworkSpecifiers.isEmpty();
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeArray(mNetworkSpecifiers.toArray());
- }
-
- public static final @android.annotation.NonNull Creator<WifiAwareAgentNetworkSpecifier> CREATOR =
- new Creator<WifiAwareAgentNetworkSpecifier>() {
- @Override
- public WifiAwareAgentNetworkSpecifier createFromParcel(Parcel in) {
- WifiAwareAgentNetworkSpecifier agentNs = new WifiAwareAgentNetworkSpecifier();
- Object[] objs = in.readArray(null);
- for (Object obj : objs) {
- agentNs.mNetworkSpecifiers.add((ByteArrayWrapper) obj);
- }
- return agentNs;
- }
-
- @Override
- public WifiAwareAgentNetworkSpecifier[] newArray(int size) {
- return new WifiAwareAgentNetworkSpecifier[size];
- }
- };
-
- @Override
- public int hashCode() {
- return mNetworkSpecifiers.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof WifiAwareAgentNetworkSpecifier)) {
- return false;
- }
- return mNetworkSpecifiers.equals(((WifiAwareAgentNetworkSpecifier) obj).mNetworkSpecifiers);
- }
-
- @Override
- public String toString() {
- StringJoiner sj = new StringJoiner(",");
- for (ByteArrayWrapper baw: mNetworkSpecifiers) {
- sj.add(baw.toString());
- }
- return sj.toString();
- }
-
- @Override
- public boolean canBeSatisfiedBy(NetworkSpecifier other) {
- if (!(other instanceof WifiAwareAgentNetworkSpecifier)) {
- return false;
- }
- WifiAwareAgentNetworkSpecifier otherNs = (WifiAwareAgentNetworkSpecifier) other;
-
- // called as old.satifiedBy(new): satisfied if old contained in new
- for (ByteArrayWrapper baw: mNetworkSpecifiers) {
- if (!otherNs.mNetworkSpecifiers.contains(baw)) {
- return false;
- }
- }
-
- return true;
- }
-
- public boolean satisfiesAwareNetworkSpecifier(WifiAwareNetworkSpecifier ns) {
- if (VDBG) Log.v(TAG, "satisfiesAwareNetworkSpecifier: ns=" + ns);
- ByteArrayWrapper nsBytes = convert(ns);
- return mNetworkSpecifiers.contains(nsBytes);
- }
-
- @Override
- public NetworkSpecifier redact() {
- return null;
- }
-
- private void initialize() {
- try {
- mDigester = MessageDigest.getInstance("SHA-256");
- } catch (NoSuchAlgorithmException e) {
- Log.e(TAG, "Can not instantiate a SHA-256 digester!? Will match nothing.");
- return;
- }
- }
-
- private ByteArrayWrapper convert(WifiAwareNetworkSpecifier ns) {
- if (mDigester == null) {
- return null;
- }
-
- Parcel parcel = Parcel.obtain();
- ns.writeToParcel(parcel, 0);
- byte[] bytes = parcel.marshall();
-
- mDigester.reset();
- mDigester.update(bytes);
- return new ByteArrayWrapper(mDigester.digest());
- }
-
- private static class ByteArrayWrapper implements Parcelable {
- private byte[] mData;
-
- ByteArrayWrapper(byte[] data) {
- mData = data;
- }
-
- @Override
- public int hashCode() {
- return Arrays.hashCode(mData);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof ByteArrayWrapper)) {
- return false;
- }
- return Arrays.equals(((ByteArrayWrapper) obj).mData, mData);
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeByteArray(mData);
- }
-
- public static final @android.annotation.NonNull Creator<ByteArrayWrapper> CREATOR =
- new Creator<ByteArrayWrapper>() {
- @Override
- public ByteArrayWrapper createFromParcel(Parcel in) {
- return new ByteArrayWrapper(in.createByteArray());
- }
-
- @Override
- public ByteArrayWrapper[] newArray(int size) {
- return new ByteArrayWrapper[size];
- }
- };
-
- @Override
- public String toString() {
- return new String(HexEncoding.encode(mData));
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/WifiAwareManager.java b/wifi/java/android/net/wifi/aware/WifiAwareManager.java
deleted file mode 100644
index 540bf2a7..0000000
--- a/wifi/java/android/net/wifi/aware/WifiAwareManager.java
+++ /dev/null
@@ -1,938 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import android.annotation.IntDef;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.RequiresPermission;
-import android.annotation.SdkConstant;
-import android.annotation.SdkConstant.SdkConstantType;
-import android.annotation.SystemApi;
-import android.annotation.SystemService;
-import android.content.Context;
-import android.net.ConnectivityManager;
-import android.net.NetworkRequest;
-import android.net.NetworkSpecifier;
-import android.net.wifi.util.HexEncoding;
-import android.os.Binder;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.Message;
-import android.os.RemoteException;
-import android.util.Log;
-
-import com.android.modules.utils.build.SdkLevel;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.ref.WeakReference;
-import java.nio.BufferOverflowException;
-import java.util.List;
-
-/**
- * This class provides the primary API for managing Wi-Fi Aware operations:
- * discovery and peer-to-peer data connections.
- * <p>
- * The class provides access to:
- * <ul>
- * <li>Initialize a Aware cluster (peer-to-peer synchronization). Refer to
- * {@link #attach(AttachCallback, Handler)}.
- * <li>Create discovery sessions (publish or subscribe sessions). Refer to
- * {@link WifiAwareSession#publish(PublishConfig, DiscoverySessionCallback, Handler)} and
- * {@link WifiAwareSession#subscribe(SubscribeConfig, DiscoverySessionCallback, Handler)}.
- * <li>Create a Aware network specifier to be used with
- * {@link ConnectivityManager#requestNetwork(NetworkRequest, ConnectivityManager.NetworkCallback)}
- * to set-up a Aware connection with a peer. Refer to {@link WifiAwareNetworkSpecifier.Builder}.
- * </ul>
- * <p>
- * Aware may not be usable when Wi-Fi is disabled (and other conditions). To validate that
- * the functionality is available use the {@link #isAvailable()} function. To track
- * changes in Aware usability register for the {@link #ACTION_WIFI_AWARE_STATE_CHANGED}
- * broadcast. Note that this broadcast is not sticky - you should register for it and then
- * check the above API to avoid a race condition.
- * <p>
- * An application must use {@link #attach(AttachCallback, Handler)} to initialize a
- * Aware cluster - before making any other Aware operation. Aware cluster membership is a
- * device-wide operation - the API guarantees that the device is in a cluster or joins a
- * Aware cluster (or starts one if none can be found). Information about attach success (or
- * failure) are returned in callbacks of {@link AttachCallback}. Proceed with Aware
- * discovery or connection setup only after receiving confirmation that Aware attach
- * succeeded - {@link AttachCallback#onAttached(WifiAwareSession)}. When an
- * application is finished using Aware it <b>must</b> use the
- * {@link WifiAwareSession#close()} API to indicate to the Aware service that the device
- * may detach from the Aware cluster. The device will actually disable Aware once the last
- * application detaches.
- * <p>
- * Once a Aware attach is confirmed use the
- * {@link WifiAwareSession#publish(PublishConfig, DiscoverySessionCallback, Handler)}
- * or
- * {@link WifiAwareSession#subscribe(SubscribeConfig, DiscoverySessionCallback,
- * Handler)} to create publish or subscribe Aware discovery sessions. Events are called on the
- * provided callback object {@link DiscoverySessionCallback}. Specifically, the
- * {@link DiscoverySessionCallback#onPublishStarted(PublishDiscoverySession)}
- * and
- * {@link DiscoverySessionCallback#onSubscribeStarted(
- *SubscribeDiscoverySession)}
- * return {@link PublishDiscoverySession} and
- * {@link SubscribeDiscoverySession}
- * objects respectively on which additional session operations can be performed, e.g. updating
- * the session {@link PublishDiscoverySession#updatePublish(PublishConfig)} and
- * {@link SubscribeDiscoverySession#updateSubscribe(SubscribeConfig)}. Sessions can
- * also be used to send messages using the
- * {@link DiscoverySession#sendMessage(PeerHandle, int, byte[])} APIs. When an
- * application is finished with a discovery session it <b>must</b> terminate it using the
- * {@link DiscoverySession#close()} API.
- * <p>
- * Creating connections between Aware devices is managed by the standard
- * {@link ConnectivityManager#requestNetwork(NetworkRequest,
- * ConnectivityManager.NetworkCallback)}.
- * The {@link NetworkRequest} object should be constructed with:
- * <ul>
- * <li>{@link NetworkRequest.Builder#addTransportType(int)} of
- * {@link android.net.NetworkCapabilities#TRANSPORT_WIFI_AWARE}.
- * <li>{@link NetworkRequest.Builder#setNetworkSpecifier(String)} using
- * {@link WifiAwareNetworkSpecifier.Builder}.
- * </ul>
- */
-@SystemService(Context.WIFI_AWARE_SERVICE)
-public class WifiAwareManager {
- private static final String TAG = "WifiAwareManager";
- private static final boolean DBG = false;
- private static final boolean VDBG = false; // STOPSHIP if true
-
- /**
- * Broadcast intent action to indicate that the state of Wi-Fi Aware availability has changed.
- * Use the {@link #isAvailable()} to query the current status.
- * This broadcast is <b>not</b> sticky, use the {@link #isAvailable()} API after registering
- * the broadcast to check the current state of Wi-Fi Aware.
- * <p>Note: The broadcast is only delivered to registered receivers - no manifest registered
- * components will be launched.
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String ACTION_WIFI_AWARE_STATE_CHANGED =
- "android.net.wifi.aware.action.WIFI_AWARE_STATE_CHANGED";
-
- /** @hide */
- @IntDef({
- WIFI_AWARE_DATA_PATH_ROLE_INITIATOR, WIFI_AWARE_DATA_PATH_ROLE_RESPONDER})
- @Retention(RetentionPolicy.SOURCE)
- public @interface DataPathRole {
- }
-
- /**
- * Connection creation role is that of INITIATOR. Used to create a network specifier string
- * when requesting a Aware network.
- *
- * @see WifiAwareSession#createNetworkSpecifierOpen(int, byte[])
- * @see WifiAwareSession#createNetworkSpecifierPassphrase(int, byte[], String)
- */
- public static final int WIFI_AWARE_DATA_PATH_ROLE_INITIATOR = 0;
-
- /**
- * Connection creation role is that of RESPONDER. Used to create a network specifier string
- * when requesting a Aware network.
- *
- * @see WifiAwareSession#createNetworkSpecifierOpen(int, byte[])
- * @see WifiAwareSession#createNetworkSpecifierPassphrase(int, byte[], String)
- */
- public static final int WIFI_AWARE_DATA_PATH_ROLE_RESPONDER = 1;
-
- /** @hide */
- @IntDef({
- WIFI_AWARE_DISCOVERY_LOST_REASON_UNKNOWN,
- WIFI_AWARE_DISCOVERY_LOST_REASON_PEER_NOT_VISIBLE})
- @Retention(RetentionPolicy.SOURCE)
- public @interface DiscoveryLostReasonCode {
- }
-
- /**
- * Reason code provided in {@link DiscoverySessionCallback#onServiceLost(PeerHandle, int)}
- * indicating that the service was lost for unknown reason.
- */
- public static final int WIFI_AWARE_DISCOVERY_LOST_REASON_UNKNOWN = 0;
-
- /**
- * Reason code provided in {@link DiscoverySessionCallback#onServiceLost(PeerHandle, int)}
- * indicating that the service advertised by the peer is no longer visible. This may be because
- * the peer is out of range or because the peer stopped advertising this service.
- */
- public static final int WIFI_AWARE_DISCOVERY_LOST_REASON_PEER_NOT_VISIBLE = 1;
-
- private final Context mContext;
- private final IWifiAwareManager mService;
-
- private final Object mLock = new Object(); // lock access to the following vars
-
- /** @hide */
- public WifiAwareManager(@NonNull Context context, @NonNull IWifiAwareManager service) {
- mContext = context;
- mService = service;
- }
-
- /**
- * Returns the current status of Aware API: whether or not Aware is available. To track
- * changes in the state of Aware API register for the
- * {@link #ACTION_WIFI_AWARE_STATE_CHANGED} broadcast.
- *
- * @return A boolean indicating whether the app can use the Aware API at this time (true) or
- * not (false).
- */
- public boolean isAvailable() {
- try {
- return mService.isUsageEnabled();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Return the current status of the Aware service: whether ot not the device is already attached
- * to an Aware cluster. To attach to an Aware cluster, please use
- * {@link #attach(AttachCallback, Handler)} or
- * {@link #attach(AttachCallback, IdentityChangedListener, Handler)}.
- * @return A boolean indicating whether the device is attached to a cluster at this time (true)
- * or not (false).
- */
- public boolean isDeviceAttached() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- try {
- return mService.isDeviceAttached();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Enable the Wifi Aware Instant communication mode. If the device doesn't support this feature
- * calling this API will result no action.
- * @see Characteristics#isInstantCommunicationModeSupported()
- * @param enable true for enable, false otherwise.
- * @hide
- */
- @SystemApi
- public void enableInstantCommunicationMode(boolean enable) {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- try {
- mService.enableInstantCommunicationMode(mContext.getOpPackageName(), enable);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Return the current status of the Wifi Aware instant communication mode.
- * If the device doesn't support this feature, return will always be false.
- * @see Characteristics#isInstantCommunicationModeSupported()
- * @return true if it is enabled, false otherwise.
- */
- public boolean isInstantCommunicationModeEnabled() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- try {
- return mService.isInstantCommunicationModeEnabled();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Returns the characteristics of the Wi-Fi Aware interface: a set of parameters which specify
- * limitations on configurations, e.g. the maximum service name length.
- *
- * @return An object specifying configuration limitations of Aware.
- */
- public @Nullable Characteristics getCharacteristics() {
- try {
- return mService.getCharacteristics();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Return the available resources of the Wi-Fi aware service: a set of parameters which specify
- * limitations on service usage, e.g the number of data-paths which could be created..
- *
- * @return An object specifying the currently available resource of the Wi-Fi Aware service.
- */
- public @Nullable AwareResources getAvailableAwareResources() {
- if (!SdkLevel.isAtLeastS()) {
- throw new UnsupportedOperationException();
- }
- try {
- return mService.getAvailableAwareResources();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Attach to the Wi-Fi Aware service - enabling the application to create discovery sessions or
- * create connections to peers. The device will attach to an existing cluster if it can find
- * one or create a new cluster (if it is the first to enable Aware in its vicinity). Results
- * (e.g. successful attach to a cluster) are provided to the {@code attachCallback} object.
- * An application <b>must</b> call {@link WifiAwareSession#close()} when done with the
- * Wi-Fi Aware object.
- * <p>
- * Note: a Aware cluster is a shared resource - if the device is already attached to a cluster
- * then this function will simply indicate success immediately using the same {@code
- * attachCallback}.
- *
- * @param attachCallback A callback for attach events, extended from
- * {@link AttachCallback}.
- * @param handler The Handler on whose thread to execute the callbacks of the {@code
- * attachCallback} object. If a null is provided then the application's main thread will be
- * used.
- */
- public void attach(@NonNull AttachCallback attachCallback, @Nullable Handler handler) {
- attach(handler, null, attachCallback, null);
- }
-
- /**
- * Attach to the Wi-Fi Aware service - enabling the application to create discovery sessions or
- * create connections to peers. The device will attach to an existing cluster if it can find
- * one or create a new cluster (if it is the first to enable Aware in its vicinity). Results
- * (e.g. successful attach to a cluster) are provided to the {@code attachCallback} object.
- * An application <b>must</b> call {@link WifiAwareSession#close()} when done with the
- * Wi-Fi Aware object.
- * <p>
- * Note: a Aware cluster is a shared resource - if the device is already attached to a cluster
- * then this function will simply indicate success immediately using the same {@code
- * attachCallback}.
- * <p>
- * This version of the API attaches a listener to receive the MAC address of the Aware interface
- * on startup and whenever it is updated (it is randomized at regular intervals for privacy).
- * The application must have the {@link android.Manifest.permission#ACCESS_FINE_LOCATION}
- * permission to execute this attach request. Otherwise, use the
- * {@link #attach(AttachCallback, Handler)} version. Note that aside from permission
- * requirements this listener will wake up the host at regular intervals causing higher power
- * consumption, do not use it unless the information is necessary (e.g. for OOB discovery).
- *
- * @param attachCallback A callback for attach events, extended from
- * {@link AttachCallback}.
- * @param identityChangedListener A listener for changed identity, extended from
- * {@link IdentityChangedListener}.
- * @param handler The Handler on whose thread to execute the callbacks of the {@code
- * attachCallback} and {@code identityChangedListener} objects. If a null is provided then the
- * application's main thread will be used.
- */
- public void attach(@NonNull AttachCallback attachCallback,
- @NonNull IdentityChangedListener identityChangedListener,
- @Nullable Handler handler) {
- attach(handler, null, attachCallback, identityChangedListener);
- }
-
- /** @hide */
- public void attach(Handler handler, ConfigRequest configRequest,
- AttachCallback attachCallback,
- IdentityChangedListener identityChangedListener) {
- if (VDBG) {
- Log.v(TAG, "attach(): handler=" + handler + ", callback=" + attachCallback
- + ", configRequest=" + configRequest + ", identityChangedListener="
- + identityChangedListener);
- }
-
- if (attachCallback == null) {
- throw new IllegalArgumentException("Null callback provided");
- }
-
- synchronized (mLock) {
- Looper looper = (handler == null) ? Looper.getMainLooper() : handler.getLooper();
-
- try {
- Binder binder = new Binder();
- mService.connect(binder, mContext.getOpPackageName(), mContext.getAttributionTag(),
- new WifiAwareEventCallbackProxy(this, looper, binder, attachCallback,
- identityChangedListener), configRequest,
- identityChangedListener != null);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
- }
-
- /** @hide */
- public void disconnect(int clientId, Binder binder) {
- if (VDBG) Log.v(TAG, "disconnect()");
-
- try {
- mService.disconnect(clientId, binder);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /** @hide */
- public void publish(int clientId, Looper looper, PublishConfig publishConfig,
- DiscoverySessionCallback callback) {
- if (VDBG) Log.v(TAG, "publish(): clientId=" + clientId + ", config=" + publishConfig);
-
- if (callback == null) {
- throw new IllegalArgumentException("Null callback provided");
- }
-
- try {
- mService.publish(mContext.getOpPackageName(), mContext.getAttributionTag(), clientId,
- publishConfig,
- new WifiAwareDiscoverySessionCallbackProxy(this, looper, true, callback,
- clientId));
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /** @hide */
- public void updatePublish(int clientId, int sessionId, PublishConfig publishConfig) {
- if (VDBG) {
- Log.v(TAG, "updatePublish(): clientId=" + clientId + ",sessionId=" + sessionId
- + ", config=" + publishConfig);
- }
-
- try {
- mService.updatePublish(clientId, sessionId, publishConfig);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /** @hide */
- public void subscribe(int clientId, Looper looper, SubscribeConfig subscribeConfig,
- DiscoverySessionCallback callback) {
- if (VDBG) {
- if (VDBG) {
- Log.v(TAG,
- "subscribe(): clientId=" + clientId + ", config=" + subscribeConfig);
- }
- }
-
- if (callback == null) {
- throw new IllegalArgumentException("Null callback provided");
- }
-
- try {
- mService.subscribe(mContext.getOpPackageName(), mContext.getAttributionTag(), clientId,
- subscribeConfig,
- new WifiAwareDiscoverySessionCallbackProxy(this, looper, false, callback,
- clientId));
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /** @hide */
- public void updateSubscribe(int clientId, int sessionId, SubscribeConfig subscribeConfig) {
- if (VDBG) {
- Log.v(TAG, "updateSubscribe(): clientId=" + clientId + ",sessionId=" + sessionId
- + ", config=" + subscribeConfig);
- }
-
- try {
- mService.updateSubscribe(clientId, sessionId, subscribeConfig);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /** @hide */
- public void terminateSession(int clientId, int sessionId) {
- if (VDBG) {
- Log.d(TAG,
- "terminateSession(): clientId=" + clientId + ", sessionId=" + sessionId);
- }
-
- try {
- mService.terminateSession(clientId, sessionId);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /** @hide */
- public void sendMessage(int clientId, int sessionId, PeerHandle peerHandle, byte[] message,
- int messageId, int retryCount) {
- if (peerHandle == null) {
- throw new IllegalArgumentException(
- "sendMessage: invalid peerHandle - must be non-null");
- }
-
- if (VDBG) {
- Log.v(TAG, "sendMessage(): clientId=" + clientId + ", sessionId=" + sessionId
- + ", peerHandle=" + peerHandle.peerId + ", messageId="
- + messageId + ", retryCount=" + retryCount);
- }
-
- try {
- mService.sendMessage(clientId, sessionId, peerHandle.peerId, message, messageId,
- retryCount);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /** @hide */
- @RequiresPermission(android.Manifest.permission.NETWORK_STACK)
- public void requestMacAddresses(int uid, List<Integer> peerIds,
- IWifiAwareMacAddressProvider callback) {
- try {
- mService.requestMacAddresses(uid, peerIds, callback);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /** @hide */
- public NetworkSpecifier createNetworkSpecifier(int clientId, int role, int sessionId,
- @NonNull PeerHandle peerHandle, @Nullable byte[] pmk, @Nullable String passphrase) {
- if (VDBG) {
- Log.v(TAG, "createNetworkSpecifier: role=" + role + ", sessionId=" + sessionId
- + ", peerHandle=" + ((peerHandle == null) ? peerHandle : peerHandle.peerId)
- + ", pmk=" + ((pmk == null) ? "null" : "non-null")
- + ", passphrase=" + ((passphrase == null) ? "null" : "non-null"));
- }
-
- if (!WifiAwareUtils.isLegacyVersion(mContext, Build.VERSION_CODES.Q)) {
- throw new UnsupportedOperationException(
- "API deprecated - use WifiAwareNetworkSpecifier.Builder");
- }
-
- if (role != WIFI_AWARE_DATA_PATH_ROLE_INITIATOR
- && role != WIFI_AWARE_DATA_PATH_ROLE_RESPONDER) {
- throw new IllegalArgumentException(
- "createNetworkSpecifier: Invalid 'role' argument when creating a network "
- + "specifier");
- }
- if (role == WIFI_AWARE_DATA_PATH_ROLE_INITIATOR || !WifiAwareUtils.isLegacyVersion(mContext,
- Build.VERSION_CODES.P)) {
- if (peerHandle == null) {
- throw new IllegalArgumentException(
- "createNetworkSpecifier: Invalid peer handle - cannot be null");
- }
- }
-
- return new WifiAwareNetworkSpecifier(
- (peerHandle == null) ? WifiAwareNetworkSpecifier.NETWORK_SPECIFIER_TYPE_IB_ANY_PEER
- : WifiAwareNetworkSpecifier.NETWORK_SPECIFIER_TYPE_IB,
- role,
- clientId,
- sessionId,
- peerHandle != null ? peerHandle.peerId : 0, // 0 is an invalid peer ID
- null, // peerMac (not used in this method)
- pmk,
- passphrase,
- 0, // no port info for deprecated IB APIs
- -1); // no transport info for deprecated IB APIs
- }
-
- /** @hide */
- public NetworkSpecifier createNetworkSpecifier(int clientId, @DataPathRole int role,
- @NonNull byte[] peer, @Nullable byte[] pmk, @Nullable String passphrase) {
- if (VDBG) {
- Log.v(TAG, "createNetworkSpecifier: role=" + role
- + ", pmk=" + ((pmk == null) ? "null" : "non-null")
- + ", passphrase=" + ((passphrase == null) ? "null" : "non-null"));
- }
-
- if (role != WIFI_AWARE_DATA_PATH_ROLE_INITIATOR
- && role != WIFI_AWARE_DATA_PATH_ROLE_RESPONDER) {
- throw new IllegalArgumentException(
- "createNetworkSpecifier: Invalid 'role' argument when creating a network "
- + "specifier");
- }
- if (role == WIFI_AWARE_DATA_PATH_ROLE_INITIATOR || !WifiAwareUtils.isLegacyVersion(mContext,
- Build.VERSION_CODES.P)) {
- if (peer == null) {
- throw new IllegalArgumentException(
- "createNetworkSpecifier: Invalid peer MAC - cannot be null");
- }
- }
- if (peer != null && peer.length != 6) {
- throw new IllegalArgumentException("createNetworkSpecifier: Invalid peer MAC address");
- }
-
- return new WifiAwareNetworkSpecifier(
- (peer == null) ? WifiAwareNetworkSpecifier.NETWORK_SPECIFIER_TYPE_OOB_ANY_PEER
- : WifiAwareNetworkSpecifier.NETWORK_SPECIFIER_TYPE_OOB,
- role,
- clientId,
- 0, // 0 is an invalid session ID
- 0, // 0 is an invalid peer ID
- peer,
- pmk,
- passphrase,
- 0, // no port info for OOB APIs
- -1); // no transport protocol info for OOB APIs
- }
-
- private static class WifiAwareEventCallbackProxy extends IWifiAwareEventCallback.Stub {
- private static final int CALLBACK_CONNECT_SUCCESS = 0;
- private static final int CALLBACK_CONNECT_FAIL = 1;
- private static final int CALLBACK_IDENTITY_CHANGED = 2;
-
- private final Handler mHandler;
- private final WeakReference<WifiAwareManager> mAwareManager;
- private final Binder mBinder;
- private final Looper mLooper;
-
- /**
- * Constructs a {@link AttachCallback} using the specified looper.
- * All callbacks will delivered on the thread of the specified looper.
- *
- * @param looper The looper on which to execute the callbacks.
- */
- WifiAwareEventCallbackProxy(WifiAwareManager mgr, Looper looper, Binder binder,
- final AttachCallback attachCallback,
- final IdentityChangedListener identityChangedListener) {
- mAwareManager = new WeakReference<>(mgr);
- mLooper = looper;
- mBinder = binder;
-
- if (VDBG) Log.v(TAG, "WifiAwareEventCallbackProxy ctor: looper=" + looper);
- mHandler = new Handler(looper) {
- @Override
- public void handleMessage(Message msg) {
- if (DBG) {
- Log.d(TAG, "WifiAwareEventCallbackProxy: What=" + msg.what + ", msg="
- + msg);
- }
-
- WifiAwareManager mgr = mAwareManager.get();
- if (mgr == null) {
- Log.w(TAG, "WifiAwareEventCallbackProxy: handleMessage post GC");
- return;
- }
-
- switch (msg.what) {
- case CALLBACK_CONNECT_SUCCESS:
- attachCallback.onAttached(
- new WifiAwareSession(mgr, mBinder, msg.arg1));
- break;
- case CALLBACK_CONNECT_FAIL:
- mAwareManager.clear();
- attachCallback.onAttachFailed();
- break;
- case CALLBACK_IDENTITY_CHANGED:
- if (identityChangedListener == null) {
- Log.e(TAG, "CALLBACK_IDENTITY_CHANGED: null listener.");
- } else {
- identityChangedListener.onIdentityChanged((byte[]) msg.obj);
- }
- break;
- }
- }
- };
- }
-
- @Override
- public void onConnectSuccess(int clientId) {
- if (VDBG) Log.v(TAG, "onConnectSuccess");
-
- Message msg = mHandler.obtainMessage(CALLBACK_CONNECT_SUCCESS);
- msg.arg1 = clientId;
- mHandler.sendMessage(msg);
- }
-
- @Override
- public void onConnectFail(int reason) {
- if (VDBG) Log.v(TAG, "onConnectFail: reason=" + reason);
-
- Message msg = mHandler.obtainMessage(CALLBACK_CONNECT_FAIL);
- msg.arg1 = reason;
- mHandler.sendMessage(msg);
- }
-
- @Override
- public void onIdentityChanged(byte[] mac) {
- if (VDBG) Log.v(TAG, "onIdentityChanged: mac=" + new String(HexEncoding.encode(mac)));
-
- Message msg = mHandler.obtainMessage(CALLBACK_IDENTITY_CHANGED);
- msg.obj = mac;
- mHandler.sendMessage(msg);
- }
- }
-
- private static class WifiAwareDiscoverySessionCallbackProxy extends
- IWifiAwareDiscoverySessionCallback.Stub {
- private static final int CALLBACK_SESSION_STARTED = 0;
- private static final int CALLBACK_SESSION_CONFIG_SUCCESS = 1;
- private static final int CALLBACK_SESSION_CONFIG_FAIL = 2;
- private static final int CALLBACK_SESSION_TERMINATED = 3;
- private static final int CALLBACK_MATCH = 4;
- private static final int CALLBACK_MESSAGE_SEND_SUCCESS = 5;
- private static final int CALLBACK_MESSAGE_SEND_FAIL = 6;
- private static final int CALLBACK_MESSAGE_RECEIVED = 7;
- private static final int CALLBACK_MATCH_WITH_DISTANCE = 8;
- private static final int CALLBACK_MATCH_EXPIRED = 9;
-
- private static final String MESSAGE_BUNDLE_KEY_MESSAGE = "message";
- private static final String MESSAGE_BUNDLE_KEY_MESSAGE2 = "message2";
-
- private final WeakReference<WifiAwareManager> mAwareManager;
- private final boolean mIsPublish;
- private final DiscoverySessionCallback mOriginalCallback;
- private final int mClientId;
-
- private final Handler mHandler;
- private DiscoverySession mSession;
-
- WifiAwareDiscoverySessionCallbackProxy(WifiAwareManager mgr, Looper looper,
- boolean isPublish, DiscoverySessionCallback originalCallback,
- int clientId) {
- mAwareManager = new WeakReference<>(mgr);
- mIsPublish = isPublish;
- mOriginalCallback = originalCallback;
- mClientId = clientId;
-
- if (VDBG) {
- Log.v(TAG, "WifiAwareDiscoverySessionCallbackProxy ctor: isPublish=" + isPublish);
- }
-
- mHandler = new Handler(looper) {
- @Override
- public void handleMessage(Message msg) {
- if (DBG) Log.d(TAG, "What=" + msg.what + ", msg=" + msg);
-
- if (mAwareManager.get() == null) {
- Log.w(TAG, "WifiAwareDiscoverySessionCallbackProxy: handleMessage post GC");
- return;
- }
-
- switch (msg.what) {
- case CALLBACK_SESSION_STARTED:
- onProxySessionStarted(msg.arg1);
- break;
- case CALLBACK_SESSION_CONFIG_SUCCESS:
- mOriginalCallback.onSessionConfigUpdated();
- break;
- case CALLBACK_SESSION_CONFIG_FAIL:
- mOriginalCallback.onSessionConfigFailed();
- if (mSession == null) {
- /*
- * creation failed (as opposed to update
- * failing)
- */
- mAwareManager.clear();
- }
- break;
- case CALLBACK_SESSION_TERMINATED:
- onProxySessionTerminated(msg.arg1);
- break;
- case CALLBACK_MATCH:
- case CALLBACK_MATCH_WITH_DISTANCE:
- {
- List<byte[]> matchFilter = null;
- byte[] arg = msg.getData().getByteArray(MESSAGE_BUNDLE_KEY_MESSAGE2);
- try {
- matchFilter = new TlvBufferUtils.TlvIterable(0, 1, arg).toList();
- } catch (BufferOverflowException e) {
- matchFilter = null;
- Log.e(TAG, "onServiceDiscovered: invalid match filter byte array '"
- + new String(HexEncoding.encode(arg))
- + "' - cannot be parsed: e=" + e);
- }
- if (msg.what == CALLBACK_MATCH) {
- mOriginalCallback.onServiceDiscovered(new PeerHandle(msg.arg1),
- msg.getData().getByteArray(MESSAGE_BUNDLE_KEY_MESSAGE),
- matchFilter);
- } else {
- mOriginalCallback.onServiceDiscoveredWithinRange(
- new PeerHandle(msg.arg1),
- msg.getData().getByteArray(MESSAGE_BUNDLE_KEY_MESSAGE),
- matchFilter, msg.arg2);
- }
- break;
- }
- case CALLBACK_MESSAGE_SEND_SUCCESS:
- mOriginalCallback.onMessageSendSucceeded(msg.arg1);
- break;
- case CALLBACK_MESSAGE_SEND_FAIL:
- mOriginalCallback.onMessageSendFailed(msg.arg1);
- break;
- case CALLBACK_MESSAGE_RECEIVED:
- mOriginalCallback.onMessageReceived(new PeerHandle(msg.arg1),
- (byte[]) msg.obj);
- break;
- case CALLBACK_MATCH_EXPIRED:
- if (!SdkLevel.isAtLeastS()) {
- break;
- }
- mOriginalCallback
- .onServiceLost(new PeerHandle(msg.arg1),
- WIFI_AWARE_DISCOVERY_LOST_REASON_PEER_NOT_VISIBLE);
- break;
- }
- }
- };
- }
-
- @Override
- public void onSessionStarted(int sessionId) {
- if (VDBG) Log.v(TAG, "onSessionStarted: sessionId=" + sessionId);
-
- Message msg = mHandler.obtainMessage(CALLBACK_SESSION_STARTED);
- msg.arg1 = sessionId;
- mHandler.sendMessage(msg);
- }
-
- @Override
- public void onSessionConfigSuccess() {
- if (VDBG) Log.v(TAG, "onSessionConfigSuccess");
-
- Message msg = mHandler.obtainMessage(CALLBACK_SESSION_CONFIG_SUCCESS);
- mHandler.sendMessage(msg);
- }
-
- @Override
- public void onSessionConfigFail(int reason) {
- if (VDBG) Log.v(TAG, "onSessionConfigFail: reason=" + reason);
-
- Message msg = mHandler.obtainMessage(CALLBACK_SESSION_CONFIG_FAIL);
- msg.arg1 = reason;
- mHandler.sendMessage(msg);
- }
-
- @Override
- public void onSessionTerminated(int reason) {
- if (VDBG) Log.v(TAG, "onSessionTerminated: reason=" + reason);
-
- Message msg = mHandler.obtainMessage(CALLBACK_SESSION_TERMINATED);
- msg.arg1 = reason;
- mHandler.sendMessage(msg);
- }
-
- private void onMatchCommon(int messageType, int peerId, byte[] serviceSpecificInfo,
- byte[] matchFilter, int distanceMm) {
- Bundle data = new Bundle();
- data.putByteArray(MESSAGE_BUNDLE_KEY_MESSAGE, serviceSpecificInfo);
- data.putByteArray(MESSAGE_BUNDLE_KEY_MESSAGE2, matchFilter);
-
- Message msg = mHandler.obtainMessage(messageType);
- msg.arg1 = peerId;
- msg.arg2 = distanceMm;
- msg.setData(data);
- mHandler.sendMessage(msg);
- }
-
- @Override
- public void onMatch(int peerId, byte[] serviceSpecificInfo, byte[] matchFilter) {
- if (VDBG) Log.v(TAG, "onMatch: peerId=" + peerId);
-
- onMatchCommon(CALLBACK_MATCH, peerId, serviceSpecificInfo, matchFilter, 0);
- }
-
- @Override
- public void onMatchWithDistance(int peerId, byte[] serviceSpecificInfo, byte[] matchFilter,
- int distanceMm) {
- if (VDBG) {
- Log.v(TAG, "onMatchWithDistance: peerId=" + peerId + ", distanceMm=" + distanceMm);
- }
-
- onMatchCommon(CALLBACK_MATCH_WITH_DISTANCE, peerId, serviceSpecificInfo, matchFilter,
- distanceMm);
- }
- @Override
- public void onMatchExpired(int peerId) {
- if (VDBG) {
- Log.v(TAG, "onMatchExpired: peerId=" + peerId);
- }
- Message msg = mHandler.obtainMessage(CALLBACK_MATCH_EXPIRED);
- msg.arg1 = peerId;
- mHandler.sendMessage(msg);
- }
-
- @Override
- public void onMessageSendSuccess(int messageId) {
- if (VDBG) Log.v(TAG, "onMessageSendSuccess");
-
- Message msg = mHandler.obtainMessage(CALLBACK_MESSAGE_SEND_SUCCESS);
- msg.arg1 = messageId;
- mHandler.sendMessage(msg);
- }
-
- @Override
- public void onMessageSendFail(int messageId, int reason) {
- if (VDBG) Log.v(TAG, "onMessageSendFail: reason=" + reason);
-
- Message msg = mHandler.obtainMessage(CALLBACK_MESSAGE_SEND_FAIL);
- msg.arg1 = messageId;
- msg.arg2 = reason;
- mHandler.sendMessage(msg);
- }
-
- @Override
- public void onMessageReceived(int peerId, byte[] message) {
- if (VDBG) {
- Log.v(TAG, "onMessageReceived: peerId=" + peerId);
- }
-
- Message msg = mHandler.obtainMessage(CALLBACK_MESSAGE_RECEIVED);
- msg.arg1 = peerId;
- msg.obj = message;
- mHandler.sendMessage(msg);
- }
-
- /*
- * Proxied methods
- */
- public void onProxySessionStarted(int sessionId) {
- if (VDBG) Log.v(TAG, "Proxy: onSessionStarted: sessionId=" + sessionId);
- if (mSession != null) {
- Log.e(TAG,
- "onSessionStarted: sessionId=" + sessionId + ": session already created!?");
- throw new IllegalStateException(
- "onSessionStarted: sessionId=" + sessionId + ": session already created!?");
- }
-
- WifiAwareManager mgr = mAwareManager.get();
- if (mgr == null) {
- Log.w(TAG, "onProxySessionStarted: mgr GC'd");
- return;
- }
-
- if (mIsPublish) {
- PublishDiscoverySession session = new PublishDiscoverySession(mgr,
- mClientId, sessionId);
- mSession = session;
- mOriginalCallback.onPublishStarted(session);
- } else {
- SubscribeDiscoverySession
- session = new SubscribeDiscoverySession(mgr, mClientId, sessionId);
- mSession = session;
- mOriginalCallback.onSubscribeStarted(session);
- }
- }
-
- public void onProxySessionTerminated(int reason) {
- if (VDBG) Log.v(TAG, "Proxy: onSessionTerminated: reason=" + reason);
- if (mSession != null) {
- mSession.setTerminated();
- mSession = null;
- } else {
- Log.w(TAG, "Proxy: onSessionTerminated called but mSession is null!?");
- }
- mAwareManager.clear();
- mOriginalCallback.onSessionTerminated();
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/WifiAwareNetworkInfo.java b/wifi/java/android/net/wifi/aware/WifiAwareNetworkInfo.java
deleted file mode 100644
index 60fe604..0000000
--- a/wifi/java/android/net/wifi/aware/WifiAwareNetworkInfo.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * 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.net.wifi.aware;
-
-import android.annotation.Nullable;
-import android.net.NetworkCapabilities;
-import android.net.TransportInfo;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.net.Inet6Address;
-import java.net.NetworkInterface;
-import java.net.SocketException;
-import java.net.UnknownHostException;
-import java.util.Objects;
-
-/**
- * Wi-Fi Aware-specific network information. The information can be extracted from the
- * {@link android.net.NetworkCapabilities} of the network using
- * {@link NetworkCapabilities#getTransportInfo()}.
- * The {@link NetworkCapabilities} is provided by the connectivity service to apps, e.g. received
- * through the
- * {@link android.net.ConnectivityManager.NetworkCallback#onCapabilitiesChanged(android.net.Network,
- * android.net.NetworkCapabilities)} callback.
- * <p>
- * The Wi-Fi Aware-specific network information include the peer's scoped link-local IPv6 address
- * for the Wi-Fi Aware link, as well as (optionally) the port and transport protocol specified by
- * the peer.
- * The scoped link-local IPv6, port, and transport protocol can then be used to create a
- * {@link java.net.Socket} connection to the peer.
- * <p>
- * Note: these are the peer's IPv6 and port information - not the local device's!
- */
-public final class WifiAwareNetworkInfo implements TransportInfo, Parcelable {
- private Inet6Address mIpv6Addr;
- private int mPort = 0; // a value of 0 is considered invalid
- private int mTransportProtocol = -1; // a value of -1 is considered invalid
-
- /** @hide */
- public WifiAwareNetworkInfo(Inet6Address ipv6Addr) {
- mIpv6Addr = ipv6Addr;
- }
-
- /** @hide */
- public WifiAwareNetworkInfo(Inet6Address ipv6Addr, int port, int transportProtocol) {
- mIpv6Addr = ipv6Addr;
- mPort = port;
- mTransportProtocol = transportProtocol;
- }
-
- /**
- * Get the scoped link-local IPv6 address of the Wi-Fi Aware peer (not of the local device!).
- *
- * @return An IPv6 address.
- */
- @Nullable
- public Inet6Address getPeerIpv6Addr() {
- return mIpv6Addr;
- }
-
- /**
- * Get the port number to be used to create a network connection to the Wi-Fi Aware peer.
- * The port information is provided by the app running on the peer which requested the
- * connection, using the {@link WifiAwareNetworkSpecifier.Builder#setPort(int)}.
- *
- * @return A port number on the peer. A value of 0 indicates that no port was specified by the
- * peer.
- */
- public int getPort() {
- return mPort;
- }
-
- /**
- * Get the transport protocol to be used to communicate over a network connection to the Wi-Fi
- * Aware peer. The transport protocol is provided by the app running on the peer which requested
- * the connection, using the
- * {@link WifiAwareNetworkSpecifier.Builder#setTransportProtocol(int)}.
- * <p>
- * The transport protocol number is assigned by the Internet Assigned Numbers Authority
- * (IANA) https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml.
- *
- * @return A transport protocol id. A value of -1 indicates that no transport protocol was
- * specified by the peer.
- */
- public int getTransportProtocol() {
- return mTransportProtocol;
- }
-
- // parcelable methods
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeByteArray(mIpv6Addr.getAddress());
- NetworkInterface ni = mIpv6Addr.getScopedInterface();
- dest.writeString(ni == null ? null : ni.getName());
- dest.writeInt(mPort);
- dest.writeInt(mTransportProtocol);
- }
-
- public static final @android.annotation.NonNull Creator<WifiAwareNetworkInfo> CREATOR =
- new Creator<WifiAwareNetworkInfo>() {
- @Override
- public WifiAwareNetworkInfo createFromParcel(Parcel in) {
- byte[] addr = in.createByteArray();
- String interfaceName = in.readString();
- int port = in.readInt();
- int transportProtocol = in.readInt();
- Inet6Address ipv6Addr;
- try {
- NetworkInterface ni = null;
- if (interfaceName != null) {
- try {
- ni = NetworkInterface.getByName(interfaceName);
- } catch (SocketException e) {
- e.printStackTrace();
- }
- }
- ipv6Addr = Inet6Address.getByAddress(null, addr, ni);
- } catch (UnknownHostException e) {
- e.printStackTrace();
- return new WifiAwareNetworkInfo(null);
- }
- return new WifiAwareNetworkInfo(ipv6Addr, port, transportProtocol);
- }
-
- @Override
- public WifiAwareNetworkInfo[] newArray(int size) {
- return new WifiAwareNetworkInfo[size];
- }
- };
-
-
- // object methods
-
- @Override
- public String toString() {
- return new StringBuilder("AwareNetworkInfo: IPv6=").append(mIpv6Addr).append(
- ", port=").append(mPort).append(", transportProtocol=").append(
- mTransportProtocol).toString();
- }
-
- /** @hide */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (!(obj instanceof WifiAwareNetworkInfo)) {
- return false;
- }
-
- WifiAwareNetworkInfo lhs = (WifiAwareNetworkInfo) obj;
- return Objects.equals(mIpv6Addr, lhs.mIpv6Addr) && mPort == lhs.mPort
- && mTransportProtocol == lhs.mTransportProtocol;
- }
-
- /** @hide */
- @Override
- public int hashCode() {
- return Objects.hash(mIpv6Addr, mPort, mTransportProtocol);
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/WifiAwareNetworkSpecifier.java b/wifi/java/android/net/wifi/aware/WifiAwareNetworkSpecifier.java
deleted file mode 100644
index 3547750..0000000
--- a/wifi/java/android/net/wifi/aware/WifiAwareNetworkSpecifier.java
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.aware;
-
-import static android.net.wifi.aware.WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_INITIATOR;
-
-import android.annotation.IntRange;
-import android.annotation.NonNull;
-import android.net.NetworkSpecifier;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.text.TextUtils;
-
-import java.util.Arrays;
-import java.util.Objects;
-
-/**
- * Network specifier object used to request a Wi-Fi Aware network. Apps should use the
- * {@link WifiAwareNetworkSpecifier.Builder} class to create an instance.
- */
-public final class WifiAwareNetworkSpecifier extends NetworkSpecifier implements Parcelable {
- /**
- * TYPE: in band, specific peer: role, client_id, session_id, peer_id, pmk/passphrase optional
- * @hide
- */
- public static final int NETWORK_SPECIFIER_TYPE_IB = 0;
-
- /**
- * TYPE: in band, any peer: role, client_id, session_id, pmk/passphrase optional
- * [only permitted for RESPONDER]
- * @hide
- */
- public static final int NETWORK_SPECIFIER_TYPE_IB_ANY_PEER = 1;
-
- /**
- * TYPE: out-of-band: role, client_id, peer_mac, pmk/passphrase optional
- * @hide
- */
- public static final int NETWORK_SPECIFIER_TYPE_OOB = 2;
-
- /**
- * TYPE: out-of-band, any peer: role, client_id, pmk/passphrase optional
- * [only permitted for RESPONDER]
- * @hide
- */
- public static final int NETWORK_SPECIFIER_TYPE_OOB_ANY_PEER = 3;
-
- /** @hide */
- public static final int NETWORK_SPECIFIER_TYPE_MAX_VALID = NETWORK_SPECIFIER_TYPE_OOB_ANY_PEER;
-
- /**
- * One of the NETWORK_SPECIFIER_TYPE_* constants. The type of the network specifier object.
- * @hide
- */
- public final int type;
-
- /**
- * The role of the device: WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_INITIATOR or
- * WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_RESPONDER.
- * @hide
- */
- public final int role;
-
- /**
- * The client ID of the device.
- * @hide
- */
- public final int clientId;
-
- /**
- * The session ID in which context to request a data-path. Only relevant for IB requests.
- * @hide
- */
- public final int sessionId;
-
- /**
- * The peer ID of the device which the data-path should be connected to. Only relevant for
- * IB requests (i.e. not IB_ANY_PEER or OOB*).
- * @hide
- */
- public final int peerId;
-
- /**
- * The peer MAC address of the device which the data-path should be connected to. Only relevant
- * for OB requests (i.e. not OOB_ANY_PEER or IB*).
- * @hide
- */
- public final byte[] peerMac;
-
- /**
- * The PMK of the requested data-path. Can be null. Only one or none of pmk or passphrase should
- * be specified.
- * @hide
- */
- public final byte[] pmk;
-
- /**
- * The Passphrase of the requested data-path. Can be null. Only one or none of the pmk or
- * passphrase should be specified.
- * @hide
- */
- public final String passphrase;
-
- /**
- * The port information to be used for this link. This information will be communicated to the
- * peer as part of the layer 2 link setup.
- *
- * Information only allowed on secure links since a single layer-2 link is set up for all
- * requestors. Therefore if multiple apps on a single device request links to the same peer
- * device they all get the same link. However, the link is only set up on the first request -
- * hence only the first can transmit the port information. But we don't want to expose that
- * information to other apps. Limiting to secure links would (usually) imply single app usage.
- *
- * @hide
- */
- public final int port;
-
- /**
- * The transport protocol information to be used for this link. This information will be
- * communicated to the peer as part of the layer 2 link setup.
- *
- * Information only allowed on secure links since a single layer-2 link is set up for all
- * requestors. Therefore if multiple apps on a single device request links to the same peer
- * device they all get the same link. However, the link is only set up on the first request -
- * hence only the first can transmit the port information. But we don't want to expose that
- * information to other apps. Limiting to secure links would (usually) imply single app usage.
- *
- * @hide
- */
- public final int transportProtocol;
-
- /** @hide */
- public WifiAwareNetworkSpecifier(int type, int role, int clientId, int sessionId, int peerId,
- byte[] peerMac, byte[] pmk, String passphrase, int port, int transportProtocol) {
- this.type = type;
- this.role = role;
- this.clientId = clientId;
- this.sessionId = sessionId;
- this.peerId = peerId;
- this.peerMac = peerMac;
- this.pmk = pmk;
- this.passphrase = passphrase;
- this.port = port;
- this.transportProtocol = transportProtocol;
- }
-
- public static final @android.annotation.NonNull Creator<WifiAwareNetworkSpecifier> CREATOR =
- new Creator<WifiAwareNetworkSpecifier>() {
- @Override
- public WifiAwareNetworkSpecifier createFromParcel(Parcel in) {
- return new WifiAwareNetworkSpecifier(
- in.readInt(), // type
- in.readInt(), // role
- in.readInt(), // clientId
- in.readInt(), // sessionId
- in.readInt(), // peerId
- in.createByteArray(), // peerMac
- in.createByteArray(), // pmk
- in.readString(), // passphrase
- in.readInt(), // port
- in.readInt()); // transportProtocol
- }
-
- @Override
- public WifiAwareNetworkSpecifier[] newArray(int size) {
- return new WifiAwareNetworkSpecifier[size];
- }
- };
-
- /**
- * Indicates whether the network specifier specifies an OOB (out-of-band) data-path - i.e. a
- * data-path created without a corresponding Aware discovery session.
- *
- * @hide
- */
- public boolean isOutOfBand() {
- return type == NETWORK_SPECIFIER_TYPE_OOB || type == NETWORK_SPECIFIER_TYPE_OOB_ANY_PEER;
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(type);
- dest.writeInt(role);
- dest.writeInt(clientId);
- dest.writeInt(sessionId);
- dest.writeInt(peerId);
- dest.writeByteArray(peerMac);
- dest.writeByteArray(pmk);
- dest.writeString(passphrase);
- dest.writeInt(port);
- dest.writeInt(transportProtocol);
- }
-
- /** @hide */
- @Override
- public boolean canBeSatisfiedBy(NetworkSpecifier other) {
- // MatchAllNetworkSpecifier is taken care in NetworkCapabilities#satisfiedBySpecifier.
- if (other instanceof WifiAwareAgentNetworkSpecifier) {
- return ((WifiAwareAgentNetworkSpecifier) other).satisfiesAwareNetworkSpecifier(this);
- }
- return equals(other);
- }
-
- /** @hide */
- @Override
- public int hashCode() {
- return Objects.hash(type, role, clientId, sessionId, peerId, Arrays.hashCode(peerMac),
- Arrays.hashCode(pmk), passphrase, port, transportProtocol);
- }
-
- /** @hide */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (!(obj instanceof WifiAwareNetworkSpecifier)) {
- return false;
- }
-
- WifiAwareNetworkSpecifier lhs = (WifiAwareNetworkSpecifier) obj;
-
- return type == lhs.type
- && role == lhs.role
- && clientId == lhs.clientId
- && sessionId == lhs.sessionId
- && peerId == lhs.peerId
- && Arrays.equals(peerMac, lhs.peerMac)
- && Arrays.equals(pmk, lhs.pmk)
- && Objects.equals(passphrase, lhs.passphrase)
- && port == lhs.port
- && transportProtocol == lhs.transportProtocol;
- }
-
- /** @hide */
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("WifiAwareNetworkSpecifier [");
- sb.append("type=").append(type)
- .append(", role=").append(role)
- .append(", clientId=").append(clientId)
- .append(", sessionId=").append(sessionId)
- .append(", peerId=").append(peerId)
- // masking potential PII (although low impact information)
- .append(", peerMac=").append((peerMac == null) ? "<null>" : "<non-null>")
- // masking PII
- .append(", pmk=").append((pmk == null) ? "<null>" : "<non-null>")
- // masking PII
- .append(", passphrase=").append((passphrase == null) ? "<null>" : "<non-null>")
- .append(", port=").append(port).append(", transportProtocol=")
- .append(transportProtocol)
- .append("]");
- return sb.toString();
- }
-
- /**
- * A builder class for a Wi-Fi Aware network specifier to set up an Aware connection with a
- * peer.
- */
- public static final class Builder {
- private DiscoverySession mDiscoverySession;
- private PeerHandle mPeerHandle;
- private String mPskPassphrase;
- private byte[] mPmk;
- private int mPort = 0; // invalid value
- private int mTransportProtocol = -1; // invalid value
-
- /**
- * Create a builder for {@link WifiAwareNetworkSpecifier} used in requests to set up a
- * Wi-Fi Aware connection with a peer.
- *
- * @param discoverySession A Wi-Fi Aware discovery session in whose context the connection
- * is created.
- * @param peerHandle The handle of the peer to which the Wi-Fi Aware connection is
- * requested. The peer is discovered through Wi-Fi Aware discovery. The
- * handle can be obtained through
- * {@link DiscoverySessionCallback#onServiceDiscovered(PeerHandle, byte[], java.util.List)}
- * or
- * {@link DiscoverySessionCallback#onMessageReceived(PeerHandle, byte[])}.
- */
- public Builder(@NonNull DiscoverySession discoverySession, @NonNull PeerHandle peerHandle) {
- if (discoverySession == null) {
- throw new IllegalArgumentException("Non-null discoverySession required");
- }
- if (peerHandle == null) {
- throw new IllegalArgumentException("Non-null peerHandle required");
- }
- mDiscoverySession = discoverySession;
- mPeerHandle = peerHandle;
- }
-
- /**
- * Configure the PSK Passphrase for the Wi-Fi Aware connection being requested. This method
- * is optional - if not called, then an Open (unencrypted) connection will be created.
- *
- * @param pskPassphrase The (optional) passphrase to be used to encrypt the link. Use the
- * {@link #setPmk(byte[])} to specify a PMK.
- * @return the current {@link Builder} builder, enabling chaining of builder
- * methods.
- */
- public @NonNull Builder setPskPassphrase(@NonNull String pskPassphrase) {
- if (!WifiAwareUtils.validatePassphrase(pskPassphrase)) {
- throw new IllegalArgumentException("Passphrase must meet length requirements");
- }
- mPskPassphrase = pskPassphrase;
- return this;
- }
-
- /**
- * Configure the PMK for the Wi-Fi Aware connection being requested. This method
- * is optional - if not called, then an Open (unencrypted) connection will be created.
- *
- * @param pmk A PMK (pairwise master key, see IEEE 802.11i) specifying the key to use for
- * encrypting the data-path. Use the {@link #setPskPassphrase(String)} to
- * specify a Passphrase.
- * @return the current {@link Builder} builder, enabling chaining of builder
- * methods.
- */
- public @NonNull Builder setPmk(@NonNull byte[] pmk) {
- if (!WifiAwareUtils.validatePmk(pmk)) {
- throw new IllegalArgumentException("PMK must 32 bytes");
- }
- mPmk = pmk;
- return this;
- }
-
- /**
- * Configure the port number which will be used to create a connection over this link. This
- * configuration should only be done on the server device, e.g. the device creating the
- * {@link java.net.ServerSocket}.
- * <p>Notes:
- * <ul>
- * <li>The server device must be the Publisher device!
- * <li>The port information can only be specified on secure links, specified using
- * {@link #setPskPassphrase(String)} or {@link #setPmk(byte[])}.
- * </ul>
- *
- * @param port A positive integer indicating the port to be used for communication.
- * @return the current {@link Builder} builder, enabling chaining of builder
- * methods.
- */
- public @NonNull Builder setPort(@IntRange(from = 0, to = 65535) int port) {
- if (port <= 0 || port > 65535) {
- throw new IllegalArgumentException("The port must be a positive value (0, 65535]");
- }
- mPort = port;
- return this;
- }
-
- /**
- * Configure the transport protocol which will be used to create a connection over this
- * link. This configuration should only be done on the server device, e.g. the device
- * creating the {@link java.net.ServerSocket} for TCP.
- * <p>Notes:
- * <ul>
- * <li>The server device must be the Publisher device!
- * <li>The transport protocol information can only be specified on secure links,
- * specified using {@link #setPskPassphrase(String)} or {@link #setPmk(byte[])}.
- * </ul>
- * The transport protocol number is assigned by the Internet Assigned Numbers Authority
- * (IANA) https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml.
- *
- * @param transportProtocol The transport protocol to be used for communication.
- * @return the current {@link Builder} builder, enabling chaining of builder
- * methods.
- */
- public @NonNull
- Builder setTransportProtocol(@IntRange(from = 0, to = 255) int transportProtocol) {
- if (transportProtocol < 0 || transportProtocol > 255) {
- throw new IllegalArgumentException(
- "The transport protocol must be in range [0, 255]");
- }
- mTransportProtocol = transportProtocol;
- return this;
- }
-
- /**
- * Create a {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)}
- * for a WiFi Aware connection (link) to the specified peer. The
- * {@link android.net.NetworkRequest.Builder#addTransportType(int)} should be set to
- * {@link android.net.NetworkCapabilities#TRANSPORT_WIFI_AWARE}.
- * <p> The default builder constructor will initialize a NetworkSpecifier which requests an
- * open (non-encrypted) link. To request an encrypted link use the
- * {@link #setPskPassphrase(String)} or {@link #setPmk(byte[])} builder methods.
- *
- * @return A {@link NetworkSpecifier} to be used to construct
- * {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)} to pass
- * to {@link android.net.ConnectivityManager#requestNetwork(android.net.NetworkRequest,
- * android.net.ConnectivityManager.NetworkCallback)}
- * [or other varieties of that API].
- */
- public @NonNull WifiAwareNetworkSpecifier build() {
- if (mDiscoverySession == null) {
- throw new IllegalStateException("Null discovery session!?");
- }
- if (mPeerHandle == null) {
- throw new IllegalStateException("Null peerHandle!?");
- }
- if (mPskPassphrase != null & mPmk != null) {
- throw new IllegalStateException(
- "Can only specify a Passphrase or a PMK - not both!");
- }
-
- int role = mDiscoverySession instanceof SubscribeDiscoverySession
- ? WIFI_AWARE_DATA_PATH_ROLE_INITIATOR
- : WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_RESPONDER;
-
- if (mPort != 0 || mTransportProtocol != -1) {
- if (role != WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_RESPONDER) {
- throw new IllegalStateException(
- "Port and transport protocol information can only "
- + "be specified on the Publisher device (which is the server");
- }
- if (TextUtils.isEmpty(mPskPassphrase) && mPmk == null) {
- throw new IllegalStateException("Port and transport protocol information can "
- + "only be specified on a secure link");
- }
- }
-
- return new WifiAwareNetworkSpecifier(
- WifiAwareNetworkSpecifier.NETWORK_SPECIFIER_TYPE_IB, role,
- mDiscoverySession.mClientId, mDiscoverySession.mSessionId, mPeerHandle.peerId,
- null, mPmk, mPskPassphrase, mPort, mTransportProtocol);
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/WifiAwareSession.java b/wifi/java/android/net/wifi/aware/WifiAwareSession.java
deleted file mode 100644
index fe0872c..0000000
--- a/wifi/java/android/net/wifi/aware/WifiAwareSession.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SystemApi;
-import android.net.NetworkSpecifier;
-import android.os.Binder;
-import android.os.Handler;
-import android.os.Looper;
-import android.util.CloseGuard;
-import android.util.Log;
-
-import com.android.internal.annotations.VisibleForTesting;
-
-import java.lang.ref.Reference;
-import java.lang.ref.WeakReference;
-
-/**
- * This class represents a Wi-Fi Aware session - an attachment to the Wi-Fi Aware service through
- * which the app can execute discovery operations.
- */
-public class WifiAwareSession implements AutoCloseable {
- private static final String TAG = "WifiAwareSession";
- private static final boolean DBG = false;
- private static final boolean VDBG = false; // STOPSHIP if true
-
- private final WeakReference<WifiAwareManager> mMgr;
- private final Binder mBinder;
- private final int mClientId;
-
- private boolean mTerminated = true;
- private final CloseGuard mCloseGuard = new CloseGuard();
-
- /** @hide */
- public WifiAwareSession(WifiAwareManager manager, Binder binder, int clientId) {
- if (VDBG) Log.v(TAG, "New session created: manager=" + manager + ", clientId=" + clientId);
-
- mMgr = new WeakReference<>(manager);
- mBinder = binder;
- mClientId = clientId;
- mTerminated = false;
-
- mCloseGuard.open("close");
- }
-
- /**
- * Destroy the Wi-Fi Aware service session and, if no other applications are attached to Aware,
- * also disable Aware. This method destroys all outstanding operations - i.e. all publish and
- * subscribes are terminated, and any outstanding data-links are shut-down. However, it is
- * good practice to destroy these discovery sessions and connections explicitly before a
- * session-wide destroy.
- * <p>
- * An application may re-attach after a destroy using
- * {@link WifiAwareManager#attach(AttachCallback, Handler)} .
- */
- @Override
- public void close() {
- WifiAwareManager mgr = mMgr.get();
- if (mgr == null) {
- Log.w(TAG, "destroy: called post GC on WifiAwareManager");
- return;
- }
- mgr.disconnect(mClientId, mBinder);
- mTerminated = true;
- mMgr.clear();
- mCloseGuard.close();
- Reference.reachabilityFence(this);
- }
-
- /** @hide */
- @Override
- protected void finalize() throws Throwable {
- try {
- if (mCloseGuard != null) {
- mCloseGuard.warnIfOpen();
- }
-
- if (!mTerminated) {
- close();
- }
- } finally {
- super.finalize();
- }
- }
-
- /**
- * Access the client ID of the Aware session.
- *
- * Note: internal visibility for testing.
- *
- * @return The internal client ID.
- *
- * @hide
- */
- @VisibleForTesting
- public int getClientId() {
- return mClientId;
- }
-
- /**
- * Issue a request to the Aware service to create a new Aware publish discovery session, using
- * the specified {@code publishConfig} configuration. The results of the publish operation
- * are routed to the callbacks of {@link DiscoverySessionCallback}:
- * <ul>
- * <li>
- * {@link DiscoverySessionCallback#onPublishStarted(
- *PublishDiscoverySession)}
- * is called when the publish session is created and provides a handle to the session.
- * Further operations on the publish session can be executed on that object.
- * <li>{@link DiscoverySessionCallback#onSessionConfigFailed()} is called if the
- * publish operation failed.
- * </ul>
- * <p>
- * Other results of the publish session operations will also be routed to callbacks
- * on the {@code callback} object. The resulting publish session can be modified using
- * {@link PublishDiscoverySession#updatePublish(PublishConfig)}.
- * <p>
- * An application must use the {@link DiscoverySession#close()} to
- * terminate the publish discovery session once it isn't needed. This will free
- * resources as well terminate any on-air transmissions.
- * <p>The application must have the {@link android.Manifest.permission#ACCESS_FINE_LOCATION}
- * permission to start a publish discovery session.
- *
- * @param publishConfig The {@link PublishConfig} specifying the
- * configuration of the requested publish session.
- * @param callback A {@link DiscoverySessionCallback} derived object to be used for
- * session event callbacks.
- * @param handler The Handler on whose thread to execute the callbacks of the {@code
- * callback} object. If a null is provided then the application's main thread will be used.
- */
- public void publish(@NonNull PublishConfig publishConfig,
- @NonNull DiscoverySessionCallback callback, @Nullable Handler handler) {
- WifiAwareManager mgr = mMgr.get();
- if (mgr == null) {
- Log.e(TAG, "publish: called post GC on WifiAwareManager");
- return;
- }
- if (mTerminated) {
- Log.e(TAG, "publish: called after termination");
- return;
- }
- mgr.publish(mClientId, (handler == null) ? Looper.getMainLooper() : handler.getLooper(),
- publishConfig, callback);
- }
-
- /**
- * Issue a request to the Aware service to create a new Aware subscribe discovery session, using
- * the specified {@code subscribeConfig} configuration. The results of the subscribe
- * operation are routed to the callbacks of {@link DiscoverySessionCallback}:
- * <ul>
- * <li>
- * {@link DiscoverySessionCallback#onSubscribeStarted(
- *SubscribeDiscoverySession)}
- * is called when the subscribe session is created and provides a handle to the session.
- * Further operations on the subscribe session can be executed on that object.
- * <li>{@link DiscoverySessionCallback#onSessionConfigFailed()} is called if the
- * subscribe operation failed.
- * </ul>
- * <p>
- * Other results of the subscribe session operations will also be routed to callbacks
- * on the {@code callback} object. The resulting subscribe session can be modified using
- * {@link SubscribeDiscoverySession#updateSubscribe(SubscribeConfig)}.
- * <p>
- * An application must use the {@link DiscoverySession#close()} to
- * terminate the subscribe discovery session once it isn't needed. This will free
- * resources as well terminate any on-air transmissions.
- * <p>The application must have the {@link android.Manifest.permission#ACCESS_FINE_LOCATION}
- * permission to start a subscribe discovery session.
- *
- * @param subscribeConfig The {@link SubscribeConfig} specifying the
- * configuration of the requested subscribe session.
- * @param callback A {@link DiscoverySessionCallback} derived object to be used for
- * session event callbacks.
- * @param handler The Handler on whose thread to execute the callbacks of the {@code
- * callback} object. If a null is provided then the application's main thread will be used.
- */
- public void subscribe(@NonNull SubscribeConfig subscribeConfig,
- @NonNull DiscoverySessionCallback callback, @Nullable Handler handler) {
- WifiAwareManager mgr = mMgr.get();
- if (mgr == null) {
- Log.e(TAG, "publish: called post GC on WifiAwareManager");
- return;
- }
- if (mTerminated) {
- Log.e(TAG, "publish: called after termination");
- return;
- }
- mgr.subscribe(mClientId, (handler == null) ? Looper.getMainLooper() : handler.getLooper(),
- subscribeConfig, callback);
- }
-
- /**
- * Create a {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)} for
- * an unencrypted WiFi Aware connection (link) to the specified peer. The
- * {@link android.net.NetworkRequest.Builder#addTransportType(int)} should be set to
- * {@link android.net.NetworkCapabilities#TRANSPORT_WIFI_AWARE}.
- * <p>
- * This API is targeted for applications which can obtain the peer MAC address using OOB
- * (out-of-band) discovery. Aware discovery does not provide the MAC address of the peer -
- * when using Aware discovery use the alternative network specifier method -
- * {@link android.net.wifi.aware.WifiAwareNetworkSpecifier.Builder}.
- * <p>
- * To set up an encrypted link use the
- * {@link #createNetworkSpecifierPassphrase(int, byte[], String)} API.
- *
- * @param role The role of this device:
- * {@link WifiAwareManager#WIFI_AWARE_DATA_PATH_ROLE_INITIATOR} or
- * {@link WifiAwareManager#WIFI_AWARE_DATA_PATH_ROLE_RESPONDER}
- * @param peer The MAC address of the peer's Aware discovery interface. On a RESPONDER this
- * value is used to gate the acceptance of a connection request from only that
- * peer.
- *
- * @return A {@link NetworkSpecifier} to be used to construct
- * {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)} to pass to
- * {@link android.net.ConnectivityManager#requestNetwork(android.net.NetworkRequest,
- * android.net.ConnectivityManager.NetworkCallback)}
- * [or other varieties of that API].
- */
- public NetworkSpecifier createNetworkSpecifierOpen(
- @WifiAwareManager.DataPathRole int role, @NonNull byte[] peer) {
- WifiAwareManager mgr = mMgr.get();
- if (mgr == null) {
- Log.e(TAG, "createNetworkSpecifierOpen: called post GC on WifiAwareManager");
- return null;
- }
- if (mTerminated) {
- Log.e(TAG, "createNetworkSpecifierOpen: called after termination");
- return null;
- }
- return mgr.createNetworkSpecifier(mClientId, role, peer, null, null);
- }
-
- /**
- * Create a {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)} for
- * an encrypted WiFi Aware connection (link) to the specified peer. The
- * {@link android.net.NetworkRequest.Builder#addTransportType(int)} should be set to
- * {@link android.net.NetworkCapabilities#TRANSPORT_WIFI_AWARE}.
- * <p>
- * This API is targeted for applications which can obtain the peer MAC address using OOB
- * (out-of-band) discovery. Aware discovery does not provide the MAC address of the peer -
- * when using Aware discovery use the alternative network specifier method -
- * {@link android.net.wifi.aware.WifiAwareNetworkSpecifier.Builder}.
- *
- * @param role The role of this device:
- * {@link WifiAwareManager#WIFI_AWARE_DATA_PATH_ROLE_INITIATOR} or
- * {@link WifiAwareManager#WIFI_AWARE_DATA_PATH_ROLE_RESPONDER}
- * @param peer The MAC address of the peer's Aware discovery interface. On a RESPONDER this
- * value is used to gate the acceptance of a connection request from only that
- * peer.
- * @param passphrase The passphrase to be used to encrypt the link. The PMK is generated from
- * the passphrase. Use {@link #createNetworkSpecifierOpen(int, byte[])} to
- * specify an open (unencrypted) link.
- *
- * @return A {@link NetworkSpecifier} to be used to construct
- * {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)} to pass to
- * {@link android.net.ConnectivityManager#requestNetwork(android.net.NetworkRequest,
- * android.net.ConnectivityManager.NetworkCallback)}
- * [or other varieties of that API].
- */
- public NetworkSpecifier createNetworkSpecifierPassphrase(
- @WifiAwareManager.DataPathRole int role, @NonNull byte[] peer,
- @NonNull String passphrase) {
- WifiAwareManager mgr = mMgr.get();
- if (mgr == null) {
- Log.e(TAG, "createNetworkSpecifierPassphrase: called post GC on WifiAwareManager");
- return null;
- }
- if (mTerminated) {
- Log.e(TAG, "createNetworkSpecifierPassphrase: called after termination");
- return null;
- }
- if (!WifiAwareUtils.validatePassphrase(passphrase)) {
- throw new IllegalArgumentException("Passphrase must meet length requirements");
- }
-
- return mgr.createNetworkSpecifier(mClientId, role, peer, null, passphrase);
- }
-
- /**
- * Create a {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)} for
- * an encrypted WiFi Aware connection (link) to the specified peer. The
- * {@link android.net.NetworkRequest.Builder#addTransportType(int)} should be set to
- * {@link android.net.NetworkCapabilities#TRANSPORT_WIFI_AWARE}.
- * <p>
- * This API is targeted for applications which can obtain the peer MAC address using OOB
- * (out-of-band) discovery. Aware discovery does not provide the MAC address of the peer -
- * when using Aware discovery use the alternative network specifier method -
- * {@link android.net.wifi.aware.WifiAwareNetworkSpecifier.Builder}.
- *
- * @param role The role of this device:
- * {@link WifiAwareManager#WIFI_AWARE_DATA_PATH_ROLE_INITIATOR} or
- * {@link WifiAwareManager#WIFI_AWARE_DATA_PATH_ROLE_RESPONDER}
- * @param peer The MAC address of the peer's Aware discovery interface. On a RESPONDER this
- * value is used to gate the acceptance of a connection request from only that
- * peer.
- * @param pmk A PMK (pairwise master key, see IEEE 802.11i) specifying the key to use for
- * encrypting the data-path. Use the
- * {@link #createNetworkSpecifierPassphrase(int, byte[], String)} to specify a
- * Passphrase or {@link #createNetworkSpecifierOpen(int, byte[])} to specify an
- * open (unencrypted) link.
- *
- * @return A {@link NetworkSpecifier} to be used to construct
- * {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)} to pass to
- * {@link android.net.ConnectivityManager#requestNetwork(android.net.NetworkRequest,
- * android.net.ConnectivityManager.NetworkCallback)}
- * [or other varieties of that API].
- *
- * @hide
- */
- @SystemApi
- public NetworkSpecifier createNetworkSpecifierPmk(
- @WifiAwareManager.DataPathRole int role, @NonNull byte[] peer, @NonNull byte[] pmk) {
- WifiAwareManager mgr = mMgr.get();
- if (mgr == null) {
- Log.e(TAG, "createNetworkSpecifierPmk: called post GC on WifiAwareManager");
- return null;
- }
- if (mTerminated) {
- Log.e(TAG, "createNetworkSpecifierPmk: called after termination");
- return null;
- }
- if (!WifiAwareUtils.validatePmk(pmk)) {
- throw new IllegalArgumentException("PMK must 32 bytes");
- }
- return mgr.createNetworkSpecifier(mClientId, role, peer, pmk, null);
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/WifiAwareUtils.java b/wifi/java/android/net/wifi/aware/WifiAwareUtils.java
deleted file mode 100644
index 3ece93d..0000000
--- a/wifi/java/android/net/wifi/aware/WifiAwareUtils.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.hardware.wifi.V1_0.Constants;
-
-/**
- * Provides utilities for the Wifi Aware manager/service.
- *
- * @hide
- */
-public class WifiAwareUtils {
- /**
- * Per spec: The Service Name is a UTF-8 encoded string from 1 to 255 bytes in length. The
- * only acceptable single-byte UTF-8 symbols for a Service Name are alphanumeric values (A-Z,
- * a-z, 0-9), the hyphen ('-'), and the period ('.'). All valid multi-byte UTF-8 characters
- * are acceptable in a Service Name.
- */
- public static void validateServiceName(byte[] serviceNameData) throws IllegalArgumentException {
- if (serviceNameData == null) {
- throw new IllegalArgumentException("Invalid service name - null");
- }
-
- if (serviceNameData.length < 1 || serviceNameData.length > 255) {
- throw new IllegalArgumentException("Invalid service name length - must be between "
- + "1 and 255 bytes (UTF-8 encoding)");
- }
-
- int index = 0;
- while (index < serviceNameData.length) {
- byte b = serviceNameData[index];
- if ((b & 0x80) == 0x00) {
- if (!((b >= '0' && b <= '9') || (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z')
- || b == '-' || b == '.')) {
- throw new IllegalArgumentException("Invalid service name - illegal characters,"
- + " allowed = (0-9, a-z,A-Z, -, .)");
- }
- }
- ++index;
- }
- }
-
- /**
- * Validates that the passphrase is a non-null string of the right size (per the HAL min/max
- * length parameters).
- *
- * @param passphrase Passphrase to test
- * @return true if passphrase is valid, false if not
- */
- public static boolean validatePassphrase(String passphrase) {
- if (passphrase == null
- || passphrase.length() < Constants.NanParamSizeLimits.MIN_PASSPHRASE_LENGTH
- || passphrase.length() > Constants.NanParamSizeLimits.MAX_PASSPHRASE_LENGTH) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Validates that the PMK is a non-null byte array of the right size (32 bytes per spec).
- *
- * @param pmk PMK to test
- * @return true if PMK is valid, false if not
- */
- public static boolean validatePmk(byte[] pmk) {
- if (pmk == null || pmk.length != 32) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Returns true if the App version is older than minVersion.
- */
- public static boolean isLegacyVersion(Context context, int minVersion) {
- try {
- if (context.getPackageManager().getApplicationInfo(context.getOpPackageName(), 0)
- .targetSdkVersion < minVersion) {
- return true;
- }
- } catch (PackageManager.NameNotFoundException e) {
- // In case of exception, assume known app (more strict checking)
- // Note: This case will never happen since checkPackage is
- // called to verify valididity before checking App's version.
- }
- return false;
- }
-}
diff --git a/wifi/java/android/net/wifi/aware/package.html b/wifi/java/android/net/wifi/aware/package.html
deleted file mode 100644
index c4f2e1f..0000000
--- a/wifi/java/android/net/wifi/aware/package.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<HTML>
-<BODY>
-<p>Provides classes which allow applications to use Wi-Fi Aware to discover peers and create
- connections to them.</p>
-<p>Using the Wi-Fi Aware APIs, applications can advertise services, discover peers which are
- advertising services, and connect to them.
- Wi-Fi Aware is independent of Wi-Fi infrastructure (i.e. a device may or may
- not be associated with an AP concurrent to using Wi-Fi Aware). </p>
-<p>The primary entry point to Wi-Fi Aware capabilities is the
- {@link android.net.wifi.aware.WifiAwareManager} class, which is acquired by calling
- {@link android.content.Context#getSystemService(String)
- Context.getSystemService(Context.WIFI_AWARE_SERVICE)}</p>
-
-<p>Some APIs may require the following user permissions:</p>
-<ul>
- <li>{@link android.Manifest.permission#ACCESS_WIFI_STATE}</li>
- <li>{@link android.Manifest.permission#CHANGE_WIFI_STATE}</li>
- <li>{@link android.Manifest.permission#ACCESS_FINE_LOCATION}</li>
-</ul>
-
-<p class="note"><strong>Note:</strong> Not all Android-powered devices support Wi-Fi Aware
- functionality.
- If your application only works with Wi-Fi Aware (i.e. it should only be installed on devices which
- support Wi-Fi Aware), declare so with a <a
- href="{@docRoot}guide/topics/manifest/uses-feature-element.html">
- {@code <uses-feature>}</a>
- element in the manifest file:</p>
-<pre>
-<manifest ...>
- <uses-feature android:name="android.hardware.wifi.aware" />
- ...
-</manifest>
-</pre>
-<p>Alternatively, if you application does not require Wi-Fi Aware but can take advantage of it if
- available, you can perform
- the check at run-time in your code using {@link
- android.content.pm.PackageManager#hasSystemFeature(String)} with {@link
- android.content.pm.PackageManager#FEATURE_WIFI_AWARE}:</p>
-<pre>
- getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI_AWARE)
-</pre>
-</BODY>
-</HTML>
diff --git a/wifi/java/android/net/wifi/hotspot2/ConfigParser.java b/wifi/java/android/net/wifi/hotspot2/ConfigParser.java
deleted file mode 100644
index bb01365..0000000
--- a/wifi/java/android/net/wifi/hotspot2/ConfigParser.java
+++ /dev/null
@@ -1,486 +0,0 @@
-/**
- * Copyright (c) 2016, 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.hotspot2;
-
-import android.net.wifi.hotspot2.omadm.PpsMoParser;
-import android.text.TextUtils;
-import android.util.Base64;
-import android.util.Log;
-import android.util.Pair;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
-import java.nio.charset.StandardCharsets;
-import java.security.GeneralSecurityException;
-import java.security.KeyStore;
-import java.security.PrivateKey;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Utility class for building PasspointConfiguration from an installation file.
- */
-public final class ConfigParser {
- private static final String TAG = "ConfigParser";
-
- // Header names.
- private static final String CONTENT_TYPE = "Content-Type";
- private static final String CONTENT_TRANSFER_ENCODING = "Content-Transfer-Encoding";
-
- // MIME types.
- private static final String TYPE_MULTIPART_MIXED = "multipart/mixed";
- private static final String TYPE_WIFI_CONFIG = "application/x-wifi-config";
- private static final String TYPE_PASSPOINT_PROFILE = "application/x-passpoint-profile";
- private static final String TYPE_CA_CERT = "application/x-x509-ca-cert";
- private static final String TYPE_PKCS12 = "application/x-pkcs12";
-
- private static final String ENCODING_BASE64 = "base64";
- private static final String BOUNDARY = "boundary=";
-
- /**
- * Class represent a MIME (Multipurpose Internet Mail Extension) part.
- */
- private static class MimePart {
- /**
- * Content type of the part.
- */
- public String type = null;
-
- /**
- * Decoded data.
- */
- public byte[] data = null;
-
- /**
- * Flag indicating if this is the last part (ending with --{boundary}--).
- */
- public boolean isLast = false;
- }
-
- /**
- * Class represent the MIME (Multipurpose Internet Mail Extension) header.
- */
- private static class MimeHeader {
- /**
- * Content type.
- */
- public String contentType = null;
-
- /**
- * Boundary string (optional), only applies for the outter MIME header.
- */
- public String boundary = null;
-
- /**
- * Encoding type.
- */
- public String encodingType = null;
- }
-
- /**
- * @hide
- */
- public ConfigParser() {}
-
- /**
- * Parse the Hotspot 2.0 Release 1 configuration data into a {@link PasspointConfiguration}
- * object. The configuration data is a base64 encoded MIME multipart data. Below is
- * the format of the decoded message:
- *
- * Content-Type: multipart/mixed; boundary={boundary}
- * Content-Transfer-Encoding: base64
- * [Skip uninterested headers]
- *
- * --{boundary}
- * Content-Type: application/x-passpoint-profile
- * Content-Transfer-Encoding: base64
- *
- * [base64 encoded Passpoint profile data]
- * --{boundary}
- * Content-Type: application/x-x509-ca-cert
- * Content-Transfer-Encoding: base64
- *
- * [base64 encoded X509 CA certificate data]
- * --{boundary}
- * Content-Type: application/x-pkcs12
- * Content-Transfer-Encoding: base64
- *
- * [base64 encoded PKCS#12 ASN.1 structure containing client certificate chain]
- * --{boundary}
- *
- * @param mimeType MIME type of the encoded data.
- * @param data A base64 encoded MIME multipart message containing the Passpoint profile
- * (required), CA (Certificate Authority) certificate (optional), and client
- * certificate chain (optional).
- * @return {@link PasspointConfiguration}
- */
- public static PasspointConfiguration parsePasspointConfig(String mimeType, byte[] data) {
- // Verify MIME type.
- if (!TextUtils.equals(mimeType, TYPE_WIFI_CONFIG)) {
- Log.e(TAG, "Unexpected MIME type: " + mimeType);
- return null;
- }
-
- try {
- // Decode the data.
- byte[] decodedData = Base64.decode(new String(data, StandardCharsets.ISO_8859_1),
- Base64.DEFAULT);
- Map<String, byte[]> mimeParts = parseMimeMultipartMessage(new LineNumberReader(
- new InputStreamReader(new ByteArrayInputStream(decodedData),
- StandardCharsets.ISO_8859_1)));
- return createPasspointConfig(mimeParts);
- } catch (IOException | IllegalArgumentException e) {
- Log.e(TAG, "Failed to parse installation file: " + e.getMessage());
- return null;
- }
- }
-
- /**
- * Create a {@link PasspointConfiguration} object from list of MIME (Multipurpose Internet
- * Mail Extension) parts.
- *
- * @param mimeParts Map of content type and content data.
- * @return {@link PasspointConfiguration}
- * @throws IOException
- */
- private static PasspointConfiguration createPasspointConfig(Map<String, byte[]> mimeParts)
- throws IOException {
- byte[] profileData = mimeParts.get(TYPE_PASSPOINT_PROFILE);
- if (profileData == null) {
- throw new IOException("Missing Passpoint Profile");
- }
-
- PasspointConfiguration config = PpsMoParser.parseMoText(new String(profileData));
- if (config == null) {
- throw new IOException("Failed to parse Passpoint profile");
- }
-
- // Credential is needed for storing the certificates and private client key.
- if (config.getCredential() == null) {
- throw new IOException("Passpoint profile missing credential");
- }
-
- // Don't allow the installer to make changes to the update identifier. This is an
- // indicator of an R2 (or newer) network.
- if (config.getUpdateIdentifier() != Integer.MIN_VALUE) {
- config.setUpdateIdentifier(Integer.MIN_VALUE);
- }
-
- // Parse CA (Certificate Authority) certificate.
- byte[] caCertData = mimeParts.get(TYPE_CA_CERT);
- if (caCertData != null) {
- try {
- config.getCredential().setCaCertificate(parseCACert(caCertData));
- } catch (CertificateException e) {
- throw new IOException("Failed to parse CA Certificate");
- }
- }
-
- // Parse PKCS12 data for client private key and certificate chain.
- byte[] pkcs12Data = mimeParts.get(TYPE_PKCS12);
- if (pkcs12Data != null) {
- try {
- Pair<PrivateKey, List<X509Certificate>> clientKey = parsePkcs12(pkcs12Data);
- config.getCredential().setClientPrivateKey(clientKey.first);
- config.getCredential().setClientCertificateChain(
- clientKey.second.toArray(new X509Certificate[clientKey.second.size()]));
- } catch(GeneralSecurityException | IOException e) {
- throw new IOException("Failed to parse PCKS12 string");
- }
- }
- return config;
- }
-
- /**
- * Parse a MIME (Multipurpose Internet Mail Extension) multipart message from the given
- * input stream.
- *
- * @param in The input stream for reading the message data
- * @return A map of a content type and content data pair
- * @throws IOException
- */
- private static Map<String, byte[]> parseMimeMultipartMessage(LineNumberReader in)
- throws IOException {
- // Parse the outer MIME header.
- MimeHeader header = parseHeaders(in);
- if (!TextUtils.equals(header.contentType, TYPE_MULTIPART_MIXED)) {
- throw new IOException("Invalid content type: " + header.contentType);
- }
- if (TextUtils.isEmpty(header.boundary)) {
- throw new IOException("Missing boundary string");
- }
- if (!TextUtils.equals(header.encodingType, ENCODING_BASE64)) {
- throw new IOException("Unexpected encoding: " + header.encodingType);
- }
-
- // Read pass the first boundary string.
- for (;;) {
- String line = in.readLine();
- if (line == null) {
- throw new IOException("Unexpected EOF before first boundary @ " +
- in.getLineNumber());
- }
- if (line.equals("--" + header.boundary)) {
- break;
- }
- }
-
- // Parse each MIME part.
- Map<String, byte[]> mimeParts = new HashMap<>();
- boolean isLast = false;
- do {
- MimePart mimePart = parseMimePart(in, header.boundary);
- mimeParts.put(mimePart.type, mimePart.data);
- isLast = mimePart.isLast;
- } while(!isLast);
- return mimeParts;
- }
-
- /**
- * Parse a MIME (Multipurpose Internet Mail Extension) part. We expect the data to
- * be encoded in base64.
- *
- * @param in Input stream to read the data from
- * @param boundary Boundary string indicate the end of the part
- * @return {@link MimePart}
- * @throws IOException
- */
- private static MimePart parseMimePart(LineNumberReader in, String boundary)
- throws IOException {
- MimeHeader header = parseHeaders(in);
- // Expect encoding type to be base64.
- if (!TextUtils.equals(header.encodingType, ENCODING_BASE64)) {
- throw new IOException("Unexpected encoding type: " + header.encodingType);
- }
-
- // Check for a valid content type.
- if (!TextUtils.equals(header.contentType, TYPE_PASSPOINT_PROFILE) &&
- !TextUtils.equals(header.contentType, TYPE_CA_CERT) &&
- !TextUtils.equals(header.contentType, TYPE_PKCS12)) {
- throw new IOException("Unexpected content type: " + header.contentType);
- }
-
- StringBuilder text = new StringBuilder();
- boolean isLast = false;
- String partBoundary = "--" + boundary;
- String endBoundary = partBoundary + "--";
- for (;;) {
- String line = in.readLine();
- if (line == null) {
- throw new IOException("Unexpected EOF file in body @ " + in.getLineNumber());
- }
- // Check for boundary line.
- if (line.startsWith(partBoundary)) {
- if (line.equals(endBoundary)) {
- isLast = true;
- }
- break;
- }
- text.append(line);
- }
-
- MimePart part = new MimePart();
- part.type = header.contentType;
- part.data = Base64.decode(text.toString(), Base64.DEFAULT);
- part.isLast = isLast;
- return part;
- }
-
- /**
- * Parse a MIME (Multipurpose Internet Mail Extension) header from the input stream.
- * @param in Input stream to read from.
- * @return {@link MimeHeader}
- * @throws IOException
- */
- private static MimeHeader parseHeaders(LineNumberReader in)
- throws IOException {
- MimeHeader header = new MimeHeader();
-
- // Read the header from the input stream.
- Map<String, String> headers = readHeaders(in);
-
- // Parse each header.
- for (Map.Entry<String, String> entry : headers.entrySet()) {
- switch (entry.getKey()) {
- case CONTENT_TYPE:
- Pair<String, String> value = parseContentType(entry.getValue());
- header.contentType = value.first;
- header.boundary = value.second;
- break;
- case CONTENT_TRANSFER_ENCODING:
- header.encodingType = entry.getValue();
- break;
- default:
- Log.d(TAG, "Ignore header: " + entry.getKey());
- break;
- }
- }
- return header;
- }
-
- /**
- * Parse the Content-Type header value. The value will contain the content type string and
- * an optional boundary string separated by a ";". Below are examples of valid Content-Type
- * header value:
- * multipart/mixed; boundary={boundary}
- * application/x-passpoint-profile
- *
- * @param contentType The Content-Type value string
- * @return A pair of content type and boundary string
- * @throws IOException
- */
- private static Pair<String, String> parseContentType(String contentType) throws IOException {
- String[] attributes = contentType.split(";");
- String type = null;
- String boundary = null;
-
- if (attributes.length < 1) {
- throw new IOException("Invalid Content-Type: " + contentType);
- }
-
- // The type is always the first attribute.
- type = attributes[0].trim();
- // Look for boundary string from the rest of the attributes.
- for (int i = 1; i < attributes.length; i++) {
- String attribute = attributes[i].trim();
- if (!attribute.startsWith(BOUNDARY)) {
- Log.d(TAG, "Ignore Content-Type attribute: " + attributes[i]);
- continue;
- }
- boundary = attribute.substring(BOUNDARY.length());
- // Remove the leading and trailing quote if present.
- if (boundary.length() > 1 && boundary.startsWith("\"") && boundary.endsWith("\"")) {
- boundary = boundary.substring(1, boundary.length()-1);
- }
- }
-
- return new Pair<String, String>(type, boundary);
- }
-
- /**
- * Read the headers from the given input stream. The header section is terminated by
- * an empty line.
- *
- * @param in The input stream to read from
- * @return Map of key-value pairs.
- * @throws IOException
- */
- private static Map<String, String> readHeaders(LineNumberReader in)
- throws IOException {
- Map<String, String> headers = new HashMap<>();
- String line;
- String name = null;
- StringBuilder value = null;
- for (;;) {
- line = in.readLine();
- if (line == null) {
- throw new IOException("Missing line @ " + in.getLineNumber());
- }
-
- // End of headers section.
- if (line.length() == 0 || line.trim().length() == 0) {
- // Save the previous header line.
- if (name != null) {
- headers.put(name, value.toString());
- }
- break;
- }
-
- int nameEnd = line.indexOf(':');
- if (nameEnd < 0) {
- if (value != null) {
- // Continuation line for the header value.
- value.append(' ').append(line.trim());
- } else {
- throw new IOException("Bad header line: '" + line + "' @ " +
- in.getLineNumber());
- }
- } else {
- // New header line detected, make sure it doesn't start with a whitespace.
- if (Character.isWhitespace(line.charAt(0))) {
- throw new IOException("Illegal blank prefix in header line '" + line +
- "' @ " + in.getLineNumber());
- }
-
- if (name != null) {
- // Save the previous header line.
- headers.put(name, value.toString());
- }
-
- // Setup the current header line.
- name = line.substring(0, nameEnd).trim();
- value = new StringBuilder();
- value.append(line.substring(nameEnd+1).trim());
- }
- }
- return headers;
- }
-
- /**
- * Parse a CA (Certificate Authority) certificate data and convert it to a
- * X509Certificate object.
- *
- * @param octets Certificate data
- * @return X509Certificate
- * @throws CertificateException
- */
- private static X509Certificate parseCACert(byte[] octets) throws CertificateException {
- CertificateFactory factory = CertificateFactory.getInstance("X.509");
- return (X509Certificate) factory.generateCertificate(new ByteArrayInputStream(octets));
- }
-
- private static Pair<PrivateKey, List<X509Certificate>> parsePkcs12(byte[] octets)
- throws GeneralSecurityException, IOException {
- KeyStore ks = KeyStore.getInstance("PKCS12");
- ByteArrayInputStream in = new ByteArrayInputStream(octets);
- ks.load(in, new char[0]);
- in.close();
-
- // Only expects one set of key and certificate chain.
- if (ks.size() != 1) {
- throw new IOException("Unexpected key size: " + ks.size());
- }
-
- String alias = ks.aliases().nextElement();
- if (alias == null) {
- throw new IOException("No alias found");
- }
-
- PrivateKey clientKey = (PrivateKey) ks.getKey(alias, null);
- List<X509Certificate> clientCertificateChain = null;
- Certificate[] chain = ks.getCertificateChain(alias);
- if (chain != null) {
- clientCertificateChain = new ArrayList<>();
- for (Certificate certificate : chain) {
- if (!(certificate instanceof X509Certificate)) {
- throw new IOException("Unexpceted certificate type: " +
- certificate.getClass());
- }
- clientCertificateChain.add((X509Certificate) certificate);
- }
- }
- return new Pair<PrivateKey, List<X509Certificate>>(clientKey, clientCertificateChain);
- }
-}
diff --git a/wifi/java/android/net/wifi/hotspot2/IProvisioningCallback.aidl b/wifi/java/android/net/wifi/hotspot2/IProvisioningCallback.aidl
deleted file mode 100644
index a6bdd5b6..0000000
--- a/wifi/java/android/net/wifi/hotspot2/IProvisioningCallback.aidl
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.hotspot2;
-
-/**
- * Interface for Provisioning callback.
- *
- * @hide
- */
-oneway interface IProvisioningCallback
-{
- /**
- * Service to manager callback providing failure notification
- */
- void onProvisioningFailure(int status);
-
- /**
- * Service to manager callback providing Provisioning status
- */
- void onProvisioningStatus(int status);
-
- /**
- * Service to manager callback providing completion of Provisioning/Remediation flow
- */
- void onProvisioningComplete();
-}
-
diff --git a/wifi/java/android/net/wifi/hotspot2/OsuProvider.java b/wifi/java/android/net/wifi/hotspot2/OsuProvider.java
deleted file mode 100644
index f0a0607..0000000
--- a/wifi/java/android/net/wifi/hotspot2/OsuProvider.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * 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
- */
-
-package android.net.wifi.hotspot2;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SystemApi;
-import android.net.Uri;
-import android.net.wifi.WifiSsid;
-import android.os.Bundle;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.text.TextUtils;
-
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * Contained information for a Hotspot 2.0 OSU (Online Sign-Up provider).
- *
- * @hide
- */
-@SystemApi
-public final class OsuProvider implements Parcelable {
- /**
- * OSU (Online Sign-Up) method: OMA DM (Open Mobile Alliance Device Management).
- * For more info, refer to Section 8.3 of the Hotspot 2.0 Release 2 Technical Specification.
- * @hide
- */
- public static final int METHOD_OMA_DM = 0;
-
- /**
- * OSU (Online Sign-Up) method: SOAP XML SPP (Subscription Provisioning Protocol).
- * For more info, refer to Section 8.4 of the Hotspot 2.0 Release 2 Technical Specification.
- * @hide
- */
- public static final int METHOD_SOAP_XML_SPP = 1;
-
- /**
- * SSID of the network to connect for service sign-up.
- */
- private WifiSsid mOsuSsid;
-
- /**
- * Map of friendly names expressed as different language for the OSU provider.
- */
- private final Map<String, String> mFriendlyNames;
-
- /**
- * Description of the OSU provider.
- */
- private final String mServiceDescription;
-
- /**
- * URI to browse to for service sign-up.
- */
- private final Uri mServerUri;
-
- /**
- * Network Access Identifier used for authenticating with the OSU network when OSEN is used.
- */
- private final String mNetworkAccessIdentifier;
-
- /**
- * List of OSU (Online Sign-Up) method supported.
- */
- private final List<Integer> mMethodList;
-
- /** @hide */
- public OsuProvider(String osuSsid, Map<String, String> friendlyNames,
- String serviceDescription, Uri serverUri, String nai, List<Integer> methodList) {
- this(WifiSsid.createFromByteArray(osuSsid.getBytes(StandardCharsets.UTF_8)),
- friendlyNames, serviceDescription, serverUri, nai, methodList);
- }
-
- /** @hide */
- public OsuProvider(WifiSsid osuSsid, Map<String, String> friendlyNames,
- String serviceDescription, Uri serverUri, String nai, List<Integer> methodList) {
- mOsuSsid = osuSsid;
- mFriendlyNames = friendlyNames;
- mServiceDescription = serviceDescription;
- mServerUri = serverUri;
- mNetworkAccessIdentifier = nai;
- if (methodList == null) {
- mMethodList = new ArrayList<>();
- } else {
- mMethodList = new ArrayList<>(methodList);
- }
- }
-
- /**
- * Copy constructor.
- *
- * @param source The source to copy from
- * @hide
- */
- public OsuProvider(OsuProvider source) {
- if (source == null) {
- mOsuSsid = null;
- mFriendlyNames = null;
- mServiceDescription = null;
- mServerUri = null;
- mNetworkAccessIdentifier = null;
- mMethodList = new ArrayList<>();
- return;
- }
-
- mOsuSsid = source.mOsuSsid;
- mFriendlyNames = source.mFriendlyNames;
- mServiceDescription = source.mServiceDescription;
- mServerUri = source.mServerUri;
- mNetworkAccessIdentifier = source.mNetworkAccessIdentifier;
- if (source.mMethodList == null) {
- mMethodList = new ArrayList<>();
- } else {
- mMethodList = new ArrayList<>(source.mMethodList);
- }
- }
-
- /** @hide */
- public WifiSsid getOsuSsid() {
- return mOsuSsid;
- }
-
- /** @hide */
- public void setOsuSsid(WifiSsid osuSsid) {
- mOsuSsid = osuSsid;
- }
-
- /**
- * Return the friendly Name for current language from the list of friendly names of OSU
- * provider.
- *
- * The string matching the default locale will be returned if it is found, otherwise the string
- * in english or the first string in the list will be returned if english is not found.
- * A null will be returned if the list is empty.
- *
- * @return String matching the default locale, null otherwise
- */
- public @Nullable String getFriendlyName() {
- if (mFriendlyNames == null || mFriendlyNames.isEmpty()) return null;
- String lang = Locale.getDefault().getLanguage();
- String friendlyName = mFriendlyNames.get(lang);
- if (friendlyName != null) {
- return friendlyName;
- }
- friendlyName = mFriendlyNames.get("en");
- if (friendlyName != null) {
- return friendlyName;
- }
- return mFriendlyNames.get(mFriendlyNames.keySet().stream().findFirst().get());
- }
-
- /** @hide */
- public Map<String, String> getFriendlyNameList() {
- return mFriendlyNames;
- }
-
- /** @hide */
- public String getServiceDescription() {
- return mServiceDescription;
- }
-
- public @Nullable Uri getServerUri() {
- return mServerUri;
- }
-
- /** @hide */
- public String getNetworkAccessIdentifier() {
- return mNetworkAccessIdentifier;
- }
-
- /** @hide */
- public List<Integer> getMethodList() {
- return mMethodList;
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeParcelable(mOsuSsid, flags);
- dest.writeString(mServiceDescription);
- dest.writeParcelable(mServerUri, flags);
- dest.writeString(mNetworkAccessIdentifier);
- dest.writeList(mMethodList);
- Bundle bundle = new Bundle();
- bundle.putSerializable("friendlyNameMap", (HashMap<String, String>) mFriendlyNames);
- dest.writeBundle(bundle);
- }
-
- @Override
- public boolean equals(@Nullable Object thatObject) {
- if (this == thatObject) {
- return true;
- }
- if (!(thatObject instanceof OsuProvider)) {
- return false;
- }
- OsuProvider that = (OsuProvider) thatObject;
- return Objects.equals(mOsuSsid, that.mOsuSsid)
- && Objects.equals(mFriendlyNames, that.mFriendlyNames)
- && TextUtils.equals(mServiceDescription, that.mServiceDescription)
- && Objects.equals(mServerUri, that.mServerUri)
- && TextUtils.equals(mNetworkAccessIdentifier, that.mNetworkAccessIdentifier)
- && Objects.equals(mMethodList, that.mMethodList);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mOsuSsid, mServiceDescription, mFriendlyNames,
- mServerUri, mNetworkAccessIdentifier, mMethodList);
- }
-
- @NonNull
- @Override
- public String toString() {
- return "OsuProvider{mOsuSsid=" + mOsuSsid
- + " mFriendlyNames=" + mFriendlyNames
- + " mServiceDescription=" + mServiceDescription
- + " mServerUri=" + mServerUri
- + " mNetworkAccessIdentifier=" + mNetworkAccessIdentifier
- + " mMethodList=" + mMethodList;
- }
-
- public static final @android.annotation.NonNull Creator<OsuProvider> CREATOR =
- new Creator<OsuProvider>() {
- @Override
- public OsuProvider createFromParcel(Parcel in) {
- WifiSsid osuSsid = in.readParcelable(null);
- String serviceDescription = in.readString();
- Uri serverUri = in.readParcelable(null);
- String nai = in.readString();
- List<Integer> methodList = new ArrayList<>();
- in.readList(methodList, null);
- Bundle bundle = in.readBundle();
- Map<String, String> friendlyNamesMap = (HashMap) bundle.getSerializable(
- "friendlyNameMap");
- return new OsuProvider(osuSsid, friendlyNamesMap, serviceDescription,
- serverUri, nai, methodList);
- }
-
- @Override
- public OsuProvider[] newArray(int size) {
- return new OsuProvider[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java b/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java
deleted file mode 100644
index 006fbaa..0000000
--- a/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java
+++ /dev/null
@@ -1,1075 +0,0 @@
-/**
- * Copyright (c) 2016, 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.hotspot2;
-
-import static android.net.wifi.WifiConfiguration.METERED_OVERRIDE_NONE;
-import static android.net.wifi.WifiConfiguration.MeteredOverride;
-
-import android.annotation.CurrentTimeMillisLong;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SystemApi;
-import android.net.wifi.hotspot2.pps.Credential;
-import android.net.wifi.hotspot2.pps.HomeSp;
-import android.net.wifi.hotspot2.pps.Policy;
-import android.net.wifi.hotspot2.pps.UpdateParameter;
-import android.os.Bundle;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.telephony.SubscriptionInfo;
-import android.telephony.SubscriptionManager;
-import android.telephony.TelephonyManager;
-import android.text.TextUtils;
-import android.util.Log;
-
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * Class representing Passpoint configuration. This contains configurations specified in
- * PerProviderSubscription (PPS) Management Object (MO) tree.
- *
- * For more info, refer to Hotspot 2.0 PPS MO defined in section 9.1 of the Hotspot 2.0
- * Release 2 Technical Specification.
- */
-public final class PasspointConfiguration implements Parcelable {
- private static final String TAG = "PasspointConfiguration";
-
- /**
- * Number of bytes for certificate SHA-256 fingerprint byte array.
- */
- private static final int CERTIFICATE_SHA256_BYTES = 32;
-
- /**
- * Maximum bytes for URL string.
- */
- private static final int MAX_URL_BYTES = 1023;
-
- /**
- * Integer value used for indicating null value in the Parcel.
- */
- private static final int NULL_VALUE = -1;
-
- /**
- * Configurations under HomeSp subtree.
- */
- private HomeSp mHomeSp = null;
-
- /**
- * Set the Home SP (Service Provider) information.
- *
- * @param homeSp The Home SP information to set to
- */
- public void setHomeSp(HomeSp homeSp) { mHomeSp = homeSp; }
- /**
- * Get the Home SP (Service Provider) information.
- *
- * @return Home SP information
- */
- public HomeSp getHomeSp() { return mHomeSp; }
-
- /**
- * Configurations under AAAServerTrustedNames subtree.
- */
- private String[] mAaaServerTrustedNames = null;
- /**
- * Set the AAA server trusted names information.
- *
- * @param aaaServerTrustedNames The AAA server trusted names information to set to
- * @hide
- */
- public void setAaaServerTrustedNames(@Nullable String[] aaaServerTrustedNames) {
- mAaaServerTrustedNames = aaaServerTrustedNames;
- }
- /**
- * Get the AAA server trusted names information.
- *
- * @return AAA server trusted names information
- * @hide
- */
- public @Nullable String[] getAaaServerTrustedNames() {
- return mAaaServerTrustedNames;
- }
-
- /**
- * Configurations under Credential subtree.
- */
- private Credential mCredential = null;
- /**
- * Set the credential information.
- *
- * @param credential The credential information to set to
- */
- public void setCredential(Credential credential) {
- mCredential = credential;
- }
- /**
- * Get the credential information.
- *
- * @return credential information
- */
- public Credential getCredential() {
- return mCredential;
- }
-
- /**
- * Configurations under Policy subtree.
- */
- private Policy mPolicy = null;
- /**
- * @hide
- */
- public void setPolicy(Policy policy) {
- mPolicy = policy;
- }
- /**
- * @hide
- */
- public Policy getPolicy() {
- return mPolicy;
- }
-
- /**
- * Meta data for performing subscription update.
- */
- private UpdateParameter mSubscriptionUpdate = null;
- /**
- * @hide
- */
- public void setSubscriptionUpdate(UpdateParameter subscriptionUpdate) {
- mSubscriptionUpdate = subscriptionUpdate;
- }
- /**
- * @hide
- */
- public UpdateParameter getSubscriptionUpdate() {
- return mSubscriptionUpdate;
- }
-
- /**
- * List of HTTPS URL for retrieving trust root certificate and the corresponding SHA-256
- * fingerprint of the certificate. The certificates are used for verifying AAA server's
- * identity during EAP authentication.
- */
- private Map<String, byte[]> mTrustRootCertList = null;
- /**
- * @hide
- */
- public void setTrustRootCertList(Map<String, byte[]> trustRootCertList) {
- mTrustRootCertList = trustRootCertList;
- }
- /**
- * @hide
- */
- public Map<String, byte[]> getTrustRootCertList() {
- return mTrustRootCertList;
- }
-
- /**
- * Set by the subscription server, updated every time the configuration is updated by
- * the subscription server.
- *
- * Use Integer.MIN_VALUE to indicate unset value.
- */
- private int mUpdateIdentifier = Integer.MIN_VALUE;
- /**
- * @hide
- */
- public void setUpdateIdentifier(int updateIdentifier) {
- mUpdateIdentifier = updateIdentifier;
- }
- /**
- * @hide
- */
- public int getUpdateIdentifier() {
- return mUpdateIdentifier;
- }
-
- /**
- * The priority of the credential.
- *
- * Use Integer.MIN_VALUE to indicate unset value.
- */
- private int mCredentialPriority = Integer.MIN_VALUE;
- /**
- * @hide
- */
- public void setCredentialPriority(int credentialPriority) {
- mCredentialPriority = credentialPriority;
- }
- /**
- * @hide
- */
- public int getCredentialPriority() {
- return mCredentialPriority;
- }
-
- /**
- * The time this subscription is created. It is in the format of number
- * of milliseconds since January 1, 1970, 00:00:00 GMT.
- *
- * Use Long.MIN_VALUE to indicate unset value.
- */
- private long mSubscriptionCreationTimeInMillis = Long.MIN_VALUE;
- /**
- * @hide
- */
- public void setSubscriptionCreationTimeInMillis(long subscriptionCreationTimeInMillis) {
- mSubscriptionCreationTimeInMillis = subscriptionCreationTimeInMillis;
- }
- /**
- * @hide
- */
- public long getSubscriptionCreationTimeInMillis() {
- return mSubscriptionCreationTimeInMillis;
- }
-
- /**
- * The time this subscription will expire. It is in the format of number
- * of milliseconds since January 1, 1970, 00:00:00 GMT.
- *
- * Use Long.MIN_VALUE to indicate unset value.
- */
- private long mSubscriptionExpirationTimeMillis = Long.MIN_VALUE;
- /**
- * @hide
- */
- public void setSubscriptionExpirationTimeInMillis(long subscriptionExpirationTimeInMillis) {
- mSubscriptionExpirationTimeMillis = subscriptionExpirationTimeInMillis;
- }
- /**
- * Utility method to get the time this subscription will expire. It is in the format of number
- * of milliseconds since January 1, 1970, 00:00:00 GMT.
- *
- * @return The time this subscription will expire, or Long.MIN_VALUE to indicate unset value
- */
- @CurrentTimeMillisLong
- public long getSubscriptionExpirationTimeMillis() {
- return mSubscriptionExpirationTimeMillis;
- }
-
- /**
- * The type of the subscription. This is defined by the provider and the value is provider
- * specific.
- */
- private String mSubscriptionType = null;
- /**
- * @hide
- */
- public void setSubscriptionType(String subscriptionType) {
- mSubscriptionType = subscriptionType;
- }
- /**
- * @hide
- */
- public String getSubscriptionType() {
- return mSubscriptionType;
- }
-
- /**
- * The time period for usage statistics accumulation. A value of zero means that usage
- * statistics are not accumulated on a periodic basis (e.g., a one-time limit for
- * “pay as you go” - PAYG service). A non-zero value specifies the usage interval in minutes.
- */
- private long mUsageLimitUsageTimePeriodInMinutes = Long.MIN_VALUE;
- /**
- * @hide
- */
- public void setUsageLimitUsageTimePeriodInMinutes(long usageLimitUsageTimePeriodInMinutes) {
- mUsageLimitUsageTimePeriodInMinutes = usageLimitUsageTimePeriodInMinutes;
- }
- /**
- * @hide
- */
- public long getUsageLimitUsageTimePeriodInMinutes() {
- return mUsageLimitUsageTimePeriodInMinutes;
- }
-
- /**
- * The time at which usage statistic accumulation begins. It is in the format of number
- * of milliseconds since January 1, 1970, 00:00:00 GMT.
- *
- * Use Long.MIN_VALUE to indicate unset value.
- */
- private long mUsageLimitStartTimeInMillis = Long.MIN_VALUE;
- /**
- * @hide
- */
- public void setUsageLimitStartTimeInMillis(long usageLimitStartTimeInMillis) {
- mUsageLimitStartTimeInMillis = usageLimitStartTimeInMillis;
- }
- /**
- * @hide
- */
- public long getUsageLimitStartTimeInMillis() {
- return mUsageLimitStartTimeInMillis;
- }
-
- /**
- * The cumulative data limit in megabytes for the {@link #usageLimitUsageTimePeriodInMinutes}.
- * A value of zero indicate unlimited data usage.
- *
- * Use Long.MIN_VALUE to indicate unset value.
- */
- private long mUsageLimitDataLimit = Long.MIN_VALUE;
- /**
- * @hide
- */
- public void setUsageLimitDataLimit(long usageLimitDataLimit) {
- mUsageLimitDataLimit = usageLimitDataLimit;
- }
- /**
- * @hide
- */
- public long getUsageLimitDataLimit() {
- return mUsageLimitDataLimit;
- }
-
- /**
- * The cumulative time limit in minutes for the {@link #usageLimitUsageTimePeriodInMinutes}.
- * A value of zero indicate unlimited time usage.
- */
- private long mUsageLimitTimeLimitInMinutes = Long.MIN_VALUE;
- /**
- * @hide
- */
- public void setUsageLimitTimeLimitInMinutes(long usageLimitTimeLimitInMinutes) {
- mUsageLimitTimeLimitInMinutes = usageLimitTimeLimitInMinutes;
- }
- /**
- * @hide
- */
- public long getUsageLimitTimeLimitInMinutes() {
- return mUsageLimitTimeLimitInMinutes;
- }
-
- /**
- * The map of OSU service provider names whose each element is presented in different
- * languages for the service provider, which is used for finding a matching
- * PasspointConfiguration with a given service provider name.
- */
- private Map<String, String> mServiceFriendlyNames = null;
-
- /**
- * @hide
- */
- public void setServiceFriendlyNames(Map<String, String> serviceFriendlyNames) {
- mServiceFriendlyNames = serviceFriendlyNames;
- }
-
- /**
- * @hide
- */
- public Map<String, String> getServiceFriendlyNames() {
- return mServiceFriendlyNames;
- }
-
- /**
- * Return the friendly Name for current language from the list of friendly names of OSU
- * provider.
- * The string matching the default locale will be returned if it is found, otherwise the
- * first string in the list will be returned. A null will be returned if the list is empty.
- *
- * @return String matching the default locale, null otherwise
- * @hide
- */
- public String getServiceFriendlyName() {
- if (mServiceFriendlyNames == null || mServiceFriendlyNames.isEmpty()) return null;
- String lang = Locale.getDefault().getLanguage();
- String friendlyName = mServiceFriendlyNames.get(lang);
- if (friendlyName != null) {
- return friendlyName;
- }
- friendlyName = mServiceFriendlyNames.get("en");
- if (friendlyName != null) {
- return friendlyName;
- }
- return mServiceFriendlyNames.get(mServiceFriendlyNames.keySet().stream().findFirst().get());
- }
-
- /**
- * The carrier ID identifies the operator who provides this network configuration.
- * see {@link TelephonyManager#getSimCarrierId()}
- */
- private int mCarrierId = TelephonyManager.UNKNOWN_CARRIER_ID;
-
- /**
- * The subscription ID identifies the SIM card who provides this network configuration.
- * See {@link SubscriptionInfo#getSubscriptionId()}
- */
- private int mSubscriptionId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
-
- /**
- * Set the carrier ID associated with current configuration.
- * @param carrierId {@code mCarrierId}
- * @hide
- */
- public void setCarrierId(int carrierId) {
- this.mCarrierId = carrierId;
- }
-
- /**
- * Get the carrier ID associated with current configuration.
- * @return {@code mCarrierId}
- * @hide
- */
- public int getCarrierId() {
- return mCarrierId;
- }
-
- /**
- * Set the subscription ID associated with current configuration.
- * @param subscriptionId {@code mSubscriptionId}
- * @hide
- */
- public void setSubscriptionId(int subscriptionId) {
- this.mSubscriptionId = subscriptionId;
- }
-
- /**
- * Get the carrier ID associated with current configuration.
- * @return {@code mSubscriptionId}
- * @hide
- */
- public int getSubscriptionId() {
- return mSubscriptionId;
- }
-
- /**
- * The auto-join configuration specifies whether or not the Passpoint Configuration is
- * considered for auto-connection. If true then yes, if false then it isn't considered as part
- * of auto-connection - but can still be manually connected to.
- */
- private boolean mIsAutojoinEnabled = true;
-
- /**
- * The mac randomization setting specifies whether a randomized or device MAC address will
- * be used to connect to the passpoint network. If true, a randomized MAC will be used.
- * Otherwise, the device MAC address will be used.
- */
- private boolean mIsMacRandomizationEnabled = true;
-
- /**
- * Whether this passpoint configuration should use enhanced MAC randomization.
- */
- private boolean mIsEnhancedMacRandomizationEnabled = false;
-
-
- /**
- * Indicate whether the network is oem paid or not. Networks are considered oem paid
- * if the corresponding connection is only available to system apps.
- * @hide
- */
- private boolean mIsOemPaid;
-
- /**
- * Indicate whether the network is oem private or not. Networks are considered oem private
- * if the corresponding connection is only available to system apps.
- * @hide
- */
- private boolean mIsOemPrivate;
-
- /**
- * Indicate whether or not the network is a carrier merged network.
- * @hide
- */
- private boolean mIsCarrierMerged;
-
- /**
- * Indicates if the end user has expressed an explicit opinion about the
- * meteredness of this network, such as through the Settings app.
- * This value is one of {@link #METERED_OVERRIDE_NONE}, {@link #METERED_OVERRIDE_METERED},
- * or {@link #METERED_OVERRIDE_NOT_METERED}.
- * <p>
- * This should always override any values from {@link WifiInfo#getMeteredHint()}.
- *
- * By default this field is set to {@link #METERED_OVERRIDE_NONE}.
- */
- private int mMeteredOverride = METERED_OVERRIDE_NONE;
-
- /**
- * Configures the auto-association status of this Passpoint configuration. A value of true
- * indicates that the configuration will be considered for auto-connection, a value of false
- * indicates that only manual connection will work - the framework will not auto-associate to
- * this Passpoint network.
- *
- * @param autojoinEnabled true to be considered for framework auto-connection, false otherwise.
- * @hide
- */
- public void setAutojoinEnabled(boolean autojoinEnabled) {
- mIsAutojoinEnabled = autojoinEnabled;
- }
-
- /**
- * Configures the MAC randomization setting for this Passpoint configuration.
- * If set to true, the framework will use a randomized MAC address to connect to this Passpoint
- * network. Otherwise, the framework will use the device MAC address.
- *
- * @param enabled true to use randomized MAC address, false to use device MAC address.
- * @hide
- */
- public void setMacRandomizationEnabled(boolean enabled) {
- mIsMacRandomizationEnabled = enabled;
- }
-
- /**
- * This setting is only applicable if MAC randomization is enabled.
- * If set to true, the framework will periodically generate new MAC addresses for new
- * connections.
- * If set to false (the default), the framework will use the same locally generated MAC address
- * for connections to this passpoint configuration.
- * @param enabled true to use enhanced MAC randomization, false to use persistent MAC
- * randomization.
- * @hide
- */
- public void setEnhancedMacRandomizationEnabled(boolean enabled) {
- mIsEnhancedMacRandomizationEnabled = enabled;
- }
-
- /**
- * Sets the metered override setting for this Passpoint configuration.
- *
- * @param meteredOverride One of the values in {@link MeteredOverride}
- * @hide
- */
- public void setMeteredOverride(@MeteredOverride int meteredOverride) {
- mMeteredOverride = meteredOverride;
- }
-
- /**
- * Indicates whether the Passpoint configuration may be auto-connected to by the framework. A
- * value of true indicates that auto-connection can happen, a value of false indicates that it
- * cannot. However, even when auto-connection is not possible manual connection by the user is
- * possible.
- *
- * @return the auto-join configuration: true for auto-connection (or join) enabled, false
- * otherwise.
- * @hide
- */
- @SystemApi
- public boolean isAutojoinEnabled() {
- return mIsAutojoinEnabled;
- }
-
- /**
- * Indicates whether the user chose this configuration to be treated as metered or not.
- *
- * @return One of the values in {@link MeteredOverride}
- * @hide
- */
- @SystemApi
- @MeteredOverride
- public int getMeteredOverride() {
- return mMeteredOverride;
- }
-
- /**
- * Indicates whether a randomized MAC address or device MAC address will be used for
- * connections to this Passpoint network. If true, a randomized MAC address will be used.
- * Otherwise, the device MAC address will be used.
- *
- * @return true for MAC randomization enabled. False for disabled.
- * @hide
- */
- @SystemApi
- public boolean isMacRandomizationEnabled() {
- return mIsMacRandomizationEnabled;
- }
-
- /**
- * When MAC randomization is enabled, this indicates whether enhanced MAC randomization or
- * persistent MAC randomization will be used for connections to this Passpoint network.
- * If true, the MAC address used for connections will periodically change. Otherwise, the same
- * locally generated MAC will be used for all connections to this passpoint configuration.
- *
- * @return true for enhanced MAC randomization enabled. False for disabled.
- * @hide
- */
- public boolean isEnhancedMacRandomizationEnabled() {
- return mIsEnhancedMacRandomizationEnabled;
- }
-
- /**
- * Set whether the network is oem paid or not.
- * @hide
- */
- public void setOemPaid(boolean isOemPaid) {
- mIsOemPaid = isOemPaid;
- }
-
- /**
- * Get whether the network is oem paid or not.
- * @hide
- */
- public boolean isOemPaid() {
- return mIsOemPaid;
- }
-
- /**
- * Set whether the network is oem private or not.
- * @hide
- */
- public void setOemPrivate(boolean isOemPrivate) {
- mIsOemPrivate = isOemPrivate;
- }
-
- /**
- * Get whether the network is oem private or not.
- * @hide
- */
- public boolean isOemPrivate() {
- return mIsOemPrivate;
- }
-
- /**
- * Set whether the network is carrier merged or not.
- * @hide
- */
- public void setCarrierMerged(boolean isCarrierMerged) {
- mIsCarrierMerged = isCarrierMerged;
- }
-
- /**
- * Get whether the network is carrier merged or not.
- * @hide
- */
- public boolean isCarrierMerged() {
- return mIsCarrierMerged;
- }
-
- /**
- * Constructor for creating PasspointConfiguration with default values.
- */
- public PasspointConfiguration() {}
-
- /**
- * Copy constructor.
- *
- * @param source The source to copy from
- */
- public PasspointConfiguration(PasspointConfiguration source) {
- if (source == null) {
- return;
- }
-
- if (source.mHomeSp != null) {
- mHomeSp = new HomeSp(source.mHomeSp);
- }
- if (source.mCredential != null) {
- mCredential = new Credential(source.mCredential);
- }
- if (source.mPolicy != null) {
- mPolicy = new Policy(source.mPolicy);
- }
- if (source.mTrustRootCertList != null) {
- mTrustRootCertList = Collections.unmodifiableMap(source.mTrustRootCertList);
- }
- if (source.mSubscriptionUpdate != null) {
- mSubscriptionUpdate = new UpdateParameter(source.mSubscriptionUpdate);
- }
- mUpdateIdentifier = source.mUpdateIdentifier;
- mCredentialPriority = source.mCredentialPriority;
- mSubscriptionCreationTimeInMillis = source.mSubscriptionCreationTimeInMillis;
- mSubscriptionExpirationTimeMillis = source.mSubscriptionExpirationTimeMillis;
- mSubscriptionType = source.mSubscriptionType;
- mUsageLimitDataLimit = source.mUsageLimitDataLimit;
- mUsageLimitStartTimeInMillis = source.mUsageLimitStartTimeInMillis;
- mUsageLimitTimeLimitInMinutes = source.mUsageLimitTimeLimitInMinutes;
- mUsageLimitUsageTimePeriodInMinutes = source.mUsageLimitUsageTimePeriodInMinutes;
- mServiceFriendlyNames = source.mServiceFriendlyNames;
- mAaaServerTrustedNames = source.mAaaServerTrustedNames;
- mCarrierId = source.mCarrierId;
- mSubscriptionId = source.mSubscriptionId;
- mIsAutojoinEnabled = source.mIsAutojoinEnabled;
- mIsMacRandomizationEnabled = source.mIsMacRandomizationEnabled;
- mIsEnhancedMacRandomizationEnabled = source.mIsEnhancedMacRandomizationEnabled;
- mMeteredOverride = source.mMeteredOverride;
- mIsCarrierMerged = source.mIsCarrierMerged;
- mIsOemPaid = source.mIsOemPaid;
- mIsOemPrivate = source.mIsOemPrivate;
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeParcelable(mHomeSp, flags);
- dest.writeParcelable(mCredential, flags);
- dest.writeParcelable(mPolicy, flags);
- dest.writeParcelable(mSubscriptionUpdate, flags);
- writeTrustRootCerts(dest, mTrustRootCertList);
- dest.writeInt(mUpdateIdentifier);
- dest.writeInt(mCredentialPriority);
- dest.writeLong(mSubscriptionCreationTimeInMillis);
- dest.writeLong(mSubscriptionExpirationTimeMillis);
- dest.writeString(mSubscriptionType);
- dest.writeLong(mUsageLimitUsageTimePeriodInMinutes);
- dest.writeLong(mUsageLimitStartTimeInMillis);
- dest.writeLong(mUsageLimitDataLimit);
- dest.writeLong(mUsageLimitTimeLimitInMinutes);
- dest.writeStringArray(mAaaServerTrustedNames);
- Bundle bundle = new Bundle();
- bundle.putSerializable("serviceFriendlyNames",
- (HashMap<String, String>) mServiceFriendlyNames);
- dest.writeBundle(bundle);
- dest.writeInt(mCarrierId);
- dest.writeBoolean(mIsAutojoinEnabled);
- dest.writeBoolean(mIsMacRandomizationEnabled);
- dest.writeBoolean(mIsEnhancedMacRandomizationEnabled);
- dest.writeInt(mMeteredOverride);
- dest.writeInt(mSubscriptionId);
- dest.writeBoolean(mIsCarrierMerged);
- dest.writeBoolean(mIsOemPaid);
- dest.writeBoolean(mIsOemPrivate);
- }
-
- @Override
- public boolean equals(Object thatObject) {
- if (this == thatObject) {
- return true;
- }
- if (!(thatObject instanceof PasspointConfiguration)) {
- return false;
- }
- PasspointConfiguration that = (PasspointConfiguration) thatObject;
- return (mHomeSp == null ? that.mHomeSp == null : mHomeSp.equals(that.mHomeSp))
- && (mAaaServerTrustedNames == null ? that.mAaaServerTrustedNames == null
- : Arrays.equals(mAaaServerTrustedNames, that.mAaaServerTrustedNames))
- && (mCredential == null ? that.mCredential == null
- : mCredential.equals(that.mCredential))
- && (mPolicy == null ? that.mPolicy == null : mPolicy.equals(that.mPolicy))
- && (mSubscriptionUpdate == null ? that.mSubscriptionUpdate == null
- : mSubscriptionUpdate.equals(that.mSubscriptionUpdate))
- && isTrustRootCertListEquals(mTrustRootCertList, that.mTrustRootCertList)
- && mUpdateIdentifier == that.mUpdateIdentifier
- && mCredentialPriority == that.mCredentialPriority
- && mSubscriptionCreationTimeInMillis == that.mSubscriptionCreationTimeInMillis
- && mSubscriptionExpirationTimeMillis == that.mSubscriptionExpirationTimeMillis
- && TextUtils.equals(mSubscriptionType, that.mSubscriptionType)
- && mUsageLimitUsageTimePeriodInMinutes == that.mUsageLimitUsageTimePeriodInMinutes
- && mUsageLimitStartTimeInMillis == that.mUsageLimitStartTimeInMillis
- && mUsageLimitDataLimit == that.mUsageLimitDataLimit
- && mUsageLimitTimeLimitInMinutes == that.mUsageLimitTimeLimitInMinutes
- && mCarrierId == that.mCarrierId
- && mSubscriptionId == that.mSubscriptionId
- && mIsOemPrivate == that.mIsOemPrivate
- && mIsOemPaid == that.mIsOemPaid
- && mIsCarrierMerged == that.mIsCarrierMerged
- && mIsAutojoinEnabled == that.mIsAutojoinEnabled
- && mIsMacRandomizationEnabled == that.mIsMacRandomizationEnabled
- && mIsEnhancedMacRandomizationEnabled == that.mIsEnhancedMacRandomizationEnabled
- && mMeteredOverride == that.mMeteredOverride
- && (mServiceFriendlyNames == null ? that.mServiceFriendlyNames == null
- : mServiceFriendlyNames.equals(that.mServiceFriendlyNames));
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mHomeSp, mCredential, mPolicy, mSubscriptionUpdate, mTrustRootCertList,
- mUpdateIdentifier, mCredentialPriority, mSubscriptionCreationTimeInMillis,
- mSubscriptionExpirationTimeMillis, mUsageLimitUsageTimePeriodInMinutes,
- mUsageLimitStartTimeInMillis, mUsageLimitDataLimit, mUsageLimitTimeLimitInMinutes,
- mServiceFriendlyNames, mCarrierId, mIsAutojoinEnabled, mIsMacRandomizationEnabled,
- mIsEnhancedMacRandomizationEnabled, mMeteredOverride, mSubscriptionId,
- mIsCarrierMerged, mIsOemPaid, mIsOemPrivate);
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("UpdateIdentifier: ").append(mUpdateIdentifier).append("\n");
- builder.append("CredentialPriority: ").append(mCredentialPriority).append("\n");
- builder.append("SubscriptionCreationTime: ").append(
- mSubscriptionCreationTimeInMillis != Long.MIN_VALUE
- ? new Date(mSubscriptionCreationTimeInMillis) : "Not specified").append("\n");
- builder.append("SubscriptionExpirationTime: ").append(
- mSubscriptionExpirationTimeMillis != Long.MIN_VALUE
- ? new Date(mSubscriptionExpirationTimeMillis) : "Not specified").append("\n");
- builder.append("UsageLimitStartTime: ").append(mUsageLimitStartTimeInMillis != Long.MIN_VALUE
- ? new Date(mUsageLimitStartTimeInMillis) : "Not specified").append("\n");
- builder.append("UsageTimePeriod: ").append(mUsageLimitUsageTimePeriodInMinutes)
- .append("\n");
- builder.append("UsageLimitDataLimit: ").append(mUsageLimitDataLimit).append("\n");
- builder.append("UsageLimitTimeLimit: ").append(mUsageLimitTimeLimitInMinutes).append("\n");
- builder.append("Provisioned by a subscription server: ")
- .append(isOsuProvisioned() ? "Yes" : "No").append("\n");
- if (mHomeSp != null) {
- builder.append("HomeSP Begin ---\n");
- builder.append(mHomeSp);
- builder.append("HomeSP End ---\n");
- }
- if (mCredential != null) {
- builder.append("Credential Begin ---\n");
- builder.append(mCredential);
- builder.append("Credential End ---\n");
- }
- if (mPolicy != null) {
- builder.append("Policy Begin ---\n");
- builder.append(mPolicy);
- builder.append("Policy End ---\n");
- }
- if (mSubscriptionUpdate != null) {
- builder.append("SubscriptionUpdate Begin ---\n");
- builder.append(mSubscriptionUpdate);
- builder.append("SubscriptionUpdate End ---\n");
- }
- if (mTrustRootCertList != null) {
- builder.append("TrustRootCertServers: ").append(mTrustRootCertList.keySet())
- .append("\n");
- }
- if (mAaaServerTrustedNames != null) {
- builder.append("AAAServerTrustedNames: ")
- .append(String.join(";", mAaaServerTrustedNames)).append("\n");
- }
- if (mServiceFriendlyNames != null) {
- builder.append("ServiceFriendlyNames: ").append(mServiceFriendlyNames);
- }
- builder.append("CarrierId:" + mCarrierId);
- builder.append("SubscriptionId:" + mSubscriptionId);
- builder.append("IsAutojoinEnabled:" + mIsAutojoinEnabled);
- builder.append("mIsMacRandomizationEnabled:" + mIsMacRandomizationEnabled);
- builder.append("mIsEnhancedMacRandomizationEnabled:" + mIsEnhancedMacRandomizationEnabled);
- builder.append("mMeteredOverride:" + mMeteredOverride);
- builder.append("mIsCarrierMerged:" + mIsCarrierMerged);
- builder.append("mIsOemPaid:" + mIsOemPaid);
- builder.append("mIsOemPrivate" + mIsOemPrivate);
- return builder.toString();
- }
-
- /**
- * Validate the R1 configuration data.
- *
- * @return true on success or false on failure
- * @hide
- */
- public boolean validate() {
- // Optional: PerProviderSubscription/<X+>/SubscriptionUpdate
- if (mSubscriptionUpdate != null && !mSubscriptionUpdate.validate()) {
- return false;
- }
- return validateForCommonR1andR2();
- }
-
- /**
- * Validate the R2 configuration data.
- *
- * @return true on success or false on failure
- * @hide
- */
- public boolean validateForR2() {
- // Required: PerProviderSubscription/UpdateIdentifier
- if (mUpdateIdentifier == Integer.MIN_VALUE) {
- return false;
- }
-
- // Required: PerProviderSubscription/<X+>/SubscriptionUpdate
- if (mSubscriptionUpdate == null || !mSubscriptionUpdate.validate()) {
- return false;
- }
- return validateForCommonR1andR2();
- }
-
- private boolean validateForCommonR1andR2() {
- // Required: PerProviderSubscription/<X+>/HomeSP
- if (mHomeSp == null || !mHomeSp.validate()) {
- return false;
- }
-
- // Required: PerProviderSubscription/<X+>/Credential
- if (mCredential == null || !mCredential.validate()) {
- return false;
- }
-
- // Optional: PerProviderSubscription/<X+>/Policy
- if (mPolicy != null && !mPolicy.validate()) {
- return false;
- }
-
- if (mTrustRootCertList != null) {
- for (Map.Entry<String, byte[]> entry : mTrustRootCertList.entrySet()) {
- String url = entry.getKey();
- byte[] certFingerprint = entry.getValue();
- if (TextUtils.isEmpty(url)) {
- Log.d(TAG, "Empty URL");
- return false;
- }
- if (url.getBytes(StandardCharsets.UTF_8).length > MAX_URL_BYTES) {
- Log.d(TAG, "URL bytes exceeded the max: "
- + url.getBytes(StandardCharsets.UTF_8).length);
- return false;
- }
-
- if (certFingerprint == null) {
- Log.d(TAG, "Fingerprint not specified");
- return false;
- }
- if (certFingerprint.length != CERTIFICATE_SHA256_BYTES) {
- Log.d(TAG, "Incorrect size of trust root certificate SHA-256 fingerprint: "
- + certFingerprint.length);
- return false;
- }
- }
- }
- return true;
- }
-
- public static final @android.annotation.NonNull Creator<PasspointConfiguration> CREATOR =
- new Creator<PasspointConfiguration>() {
- @Override
- public PasspointConfiguration createFromParcel(Parcel in) {
- PasspointConfiguration config = new PasspointConfiguration();
- config.setHomeSp(in.readParcelable(null));
- config.setCredential(in.readParcelable(null));
- config.setPolicy(in.readParcelable(null));
- config.setSubscriptionUpdate(in.readParcelable(null));
- config.setTrustRootCertList(readTrustRootCerts(in));
- config.setUpdateIdentifier(in.readInt());
- config.setCredentialPriority(in.readInt());
- config.setSubscriptionCreationTimeInMillis(in.readLong());
- config.setSubscriptionExpirationTimeInMillis(in.readLong());
- config.setSubscriptionType(in.readString());
- config.setUsageLimitUsageTimePeriodInMinutes(in.readLong());
- config.setUsageLimitStartTimeInMillis(in.readLong());
- config.setUsageLimitDataLimit(in.readLong());
- config.setUsageLimitTimeLimitInMinutes(in.readLong());
- config.setAaaServerTrustedNames(in.createStringArray());
- Bundle bundle = in.readBundle();
- Map<String, String> friendlyNamesMap = (HashMap) bundle.getSerializable(
- "serviceFriendlyNames");
- config.setServiceFriendlyNames(friendlyNamesMap);
- config.mCarrierId = in.readInt();
- config.mIsAutojoinEnabled = in.readBoolean();
- config.mIsMacRandomizationEnabled = in.readBoolean();
- config.mIsEnhancedMacRandomizationEnabled = in.readBoolean();
- config.mMeteredOverride = in.readInt();
- config.mSubscriptionId = in.readInt();
- config.mIsCarrierMerged = in.readBoolean();
- config.mIsOemPaid = in.readBoolean();
- config.mIsOemPrivate = in.readBoolean();
-
- return config;
- }
-
- @Override
- public PasspointConfiguration[] newArray(int size) {
- return new PasspointConfiguration[size];
- }
-
- /**
- * Helper function for reading trust root certificate info list from a Parcel.
- *
- * @param in The Parcel to read from
- * @return The list of trust root certificate URL with the corresponding certificate
- * fingerprint
- */
- private Map<String, byte[]> readTrustRootCerts(Parcel in) {
- int size = in.readInt();
- if (size == NULL_VALUE) {
- return null;
- }
- Map<String, byte[]> trustRootCerts = new HashMap<>(size);
- for (int i = 0; i < size; i++) {
- String key = in.readString();
- byte[] value = in.createByteArray();
- trustRootCerts.put(key, value);
- }
- return trustRootCerts;
- }
- };
-
- /**
- * Helper function for writing trust root certificate information list.
- *
- * @param dest The Parcel to write to
- * @param trustRootCerts The list of trust root certificate URL with the corresponding
- * certificate fingerprint
- */
- private static void writeTrustRootCerts(Parcel dest, Map<String, byte[]> trustRootCerts) {
- if (trustRootCerts == null) {
- dest.writeInt(NULL_VALUE);
- return;
- }
- dest.writeInt(trustRootCerts.size());
- for (Map.Entry<String, byte[]> entry : trustRootCerts.entrySet()) {
- dest.writeString(entry.getKey());
- dest.writeByteArray(entry.getValue());
- }
- }
-
- /**
- * Helper function for comparing two trust root certificate list. Cannot use Map#equals
- * method since the value type (byte[]) doesn't override equals method.
- *
- * @param list1 The first trust root certificate list
- * @param list2 The second trust root certificate list
- * @return true if the two list are equal
- */
- private static boolean isTrustRootCertListEquals(Map<String, byte[]> list1,
- Map<String, byte[]> list2) {
- if (list1 == null || list2 == null) {
- return list1 == list2;
- }
- if (list1.size() != list2.size()) {
- return false;
- }
- for (Map.Entry<String, byte[]> entry : list1.entrySet()) {
- if (!Arrays.equals(entry.getValue(), list2.get(entry.getKey()))) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Indicates if the Passpoint Configuration was provisioned by a subscription (OSU) server,
- * which means that it's an R2 (or R3) profile.
- *
- * @return true if the Passpoint Configuration was provisioned by a subscription server.
- */
- public boolean isOsuProvisioned() {
- return getUpdateIdentifier() != Integer.MIN_VALUE;
- }
-
- /**
- * Get a unique identifier for a PasspointConfiguration object. The identifier depends on the
- * configuration that identify the service provider under the HomeSp subtree, and on the
- * credential configuration under the Credential subtree.
- * The method throws an {@link IllegalStateException} if the configuration under HomeSp subtree
- * or the configuration under Credential subtree are not initialized.
- *
- * @return A unique identifier
- */
- public @NonNull String getUniqueId() {
- if (mCredential == null || mHomeSp == null || TextUtils.isEmpty(mHomeSp.getFqdn())) {
- throw new IllegalStateException("Credential or HomeSP are not initialized");
- }
-
- StringBuilder sb = new StringBuilder();
- sb.append(String.format("%s_%x%x", mHomeSp.getFqdn(), mHomeSp.getUniqueId(),
- mCredential.getUniqueId()));
- return sb.toString();
- }
-}
diff --git a/wifi/java/android/net/wifi/hotspot2/ProvisioningCallback.java b/wifi/java/android/net/wifi/hotspot2/ProvisioningCallback.java
deleted file mode 100644
index 1d499b6..0000000
--- a/wifi/java/android/net/wifi/hotspot2/ProvisioningCallback.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.hotspot2;
-
-import android.annotation.SystemApi;
-import android.net.wifi.WifiManager;
-import android.os.Handler;
-
-/**
- * Base class for provisioning callbacks. Should be extended by applications and set when calling
- * {@link WifiManager#startSubscriptionProvisioning(OsuProvider, ProvisioningCallback, Handler)}.
- *
- * @hide
- */
-@SystemApi
-public abstract class ProvisioningCallback {
-
- /**
- * The reason code for Provisioning Failure due to connection failure to OSU AP.
- */
- public static final int OSU_FAILURE_AP_CONNECTION = 1;
-
- /**
- * The reason code for invalid server URL address.
- */
- public static final int OSU_FAILURE_SERVER_URL_INVALID = 2;
-
- /**
- * The reason code for provisioning failure due to connection failure to the server.
- */
- public static final int OSU_FAILURE_SERVER_CONNECTION = 3;
-
- /**
- * The reason code for provisioning failure due to invalid server certificate.
- */
- public static final int OSU_FAILURE_SERVER_VALIDATION = 4;
-
- /**
- * The reason code for provisioning failure due to invalid service provider.
- */
- public static final int OSU_FAILURE_SERVICE_PROVIDER_VERIFICATION = 5;
-
- /**
- * The reason code for provisioning failure when a provisioning flow is aborted.
- */
- public static final int OSU_FAILURE_PROVISIONING_ABORTED = 6;
-
- /**
- * The reason code for provisioning failure when a provisioning flow is not possible.
- */
- public static final int OSU_FAILURE_PROVISIONING_NOT_AVAILABLE = 7;
-
- /**
- * The reason code for provisioning failure due to invalid web url format for an OSU web page.
- */
- public static final int OSU_FAILURE_INVALID_URL_FORMAT_FOR_OSU = 8;
-
- /**
- * The reason code for provisioning failure when a command received is not the expected command
- * type.
- */
- public static final int OSU_FAILURE_UNEXPECTED_COMMAND_TYPE = 9;
-
- /**
- * The reason code for provisioning failure when a SOAP message is not the expected message
- * type.
- */
- public static final int OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_TYPE = 10;
-
- /**
- * The reason code for provisioning failure when a SOAP message exchange fails.
- */
- public static final int OSU_FAILURE_SOAP_MESSAGE_EXCHANGE = 11;
-
- /**
- * The reason code for provisioning failure when a redirect listener fails to start.
- */
- public static final int OSU_FAILURE_START_REDIRECT_LISTENER = 12;
-
- /**
- * The reason code for provisioning failure when a redirect listener timed out to receive a HTTP
- * redirect response.
- */
- public static final int OSU_FAILURE_TIMED_OUT_REDIRECT_LISTENER = 13;
-
- /**
- * The reason code for provisioning failure when there is no OSU activity to listen to
- * {@link WifiManager#ACTION_PASSPOINT_LAUNCH_OSU_VIEW} intent.
- */
- public static final int OSU_FAILURE_NO_OSU_ACTIVITY_FOUND = 14;
-
- /**
- * The reason code for provisioning failure when the status of a SOAP message is not the
- * expected message status.
- */
- public static final int OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_STATUS = 15;
-
- /**
- * The reason code for provisioning failure when there is no PPS MO.
- * MO.
- */
- public static final int OSU_FAILURE_NO_PPS_MO = 16;
-
- /**
- * The reason code for provisioning failure when there is no AAAServerTrustRoot node in a PPS
- * MO.
- */
- public static final int OSU_FAILURE_NO_AAA_SERVER_TRUST_ROOT_NODE = 17;
-
- /**
- * The reason code for provisioning failure when there is no TrustRoot node for remediation
- * server in a PPS MO.
- */
- public static final int OSU_FAILURE_NO_REMEDIATION_SERVER_TRUST_ROOT_NODE = 18;
-
- /**
- * The reason code for provisioning failure when there is no TrustRoot node for policy server in
- * a PPS MO.
- */
- public static final int OSU_FAILURE_NO_POLICY_SERVER_TRUST_ROOT_NODE = 19;
-
- /**
- * The reason code for provisioning failure when failing to retrieve trust root certificates
- * used for validating server certificate for AAA, Remediation and Policy server.
- */
- public static final int OSU_FAILURE_RETRIEVE_TRUST_ROOT_CERTIFICATES = 20;
-
- /**
- * The reason code for provisioning failure when there is no trust root certificate for AAA
- * server.
- */
- public static final int OSU_FAILURE_NO_AAA_TRUST_ROOT_CERTIFICATE = 21;
-
- /**
- * The reason code for provisioning failure when a {@link PasspointConfiguration} is failed to
- * install.
- */
- public static final int OSU_FAILURE_ADD_PASSPOINT_CONFIGURATION = 22;
-
- /**
- * The reason code for provisioning failure when an {@link OsuProvider} is not found for
- * provisioning.
- */
- public static final int OSU_FAILURE_OSU_PROVIDER_NOT_FOUND = 23;
-
- /**
- * The status code for provisioning flow to indicate connecting to OSU AP
- */
- public static final int OSU_STATUS_AP_CONNECTING = 1;
-
- /**
- * The status code for provisioning flow to indicate the OSU AP is connected.
- */
- public static final int OSU_STATUS_AP_CONNECTED = 2;
-
- /**
- * The status code for provisioning flow to indicate connecting to the server.
- */
- public static final int OSU_STATUS_SERVER_CONNECTING = 3;
-
- /**
- * The status code for provisioning flow to indicate the server certificate is validated.
- */
- public static final int OSU_STATUS_SERVER_VALIDATED = 4;
-
- /**
- * The status code for provisioning flow to indicate the server is connected
- */
- public static final int OSU_STATUS_SERVER_CONNECTED = 5;
-
- /**
- * The status code for provisioning flow to indicate starting the first SOAP exchange.
- */
- public static final int OSU_STATUS_INIT_SOAP_EXCHANGE = 6;
-
- /**
- * The status code for provisioning flow to indicate waiting for a HTTP redirect response.
- */
- public static final int OSU_STATUS_WAITING_FOR_REDIRECT_RESPONSE = 7;
-
- /**
- * The status code for provisioning flow to indicate a HTTP redirect response is received.
- */
- public static final int OSU_STATUS_REDIRECT_RESPONSE_RECEIVED = 8;
-
- /**
- * The status code for provisioning flow to indicate starting the second SOAP exchange.
- */
- public static final int OSU_STATUS_SECOND_SOAP_EXCHANGE = 9;
-
- /**
- * The status code for provisioning flow to indicate starting the third SOAP exchange.
- */
- public static final int OSU_STATUS_THIRD_SOAP_EXCHANGE = 10;
-
- /**
- * The status code for provisioning flow to indicate starting a step retrieving trust root
- * certs.
- */
- public static final int OSU_STATUS_RETRIEVING_TRUST_ROOT_CERTS = 11;
-
- /**
- * Provisioning status for OSU failure
- *
- * @param status indicates error condition
- */
- public abstract void onProvisioningFailure(int status);
-
- /**
- * Provisioning status when OSU is in progress
- *
- * @param status indicates status of OSU flow
- */
- public abstract void onProvisioningStatus(int status);
-
- /**
- * Provisioning complete when provisioning/remediation flow completes
- */
- public abstract void onProvisioningComplete();
-}
-
diff --git a/wifi/java/android/net/wifi/hotspot2/omadm/PpsMoParser.java b/wifi/java/android/net/wifi/hotspot2/omadm/PpsMoParser.java
deleted file mode 100644
index ae60ed4..0000000
--- a/wifi/java/android/net/wifi/hotspot2/omadm/PpsMoParser.java
+++ /dev/null
@@ -1,1787 +0,0 @@
-/**
- * Copyright (c) 2016, 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.hotspot2.omadm;
-
-import android.net.wifi.hotspot2.PasspointConfiguration;
-import android.net.wifi.hotspot2.pps.Credential;
-import android.net.wifi.hotspot2.pps.HomeSp;
-import android.net.wifi.hotspot2.pps.Policy;
-import android.net.wifi.hotspot2.pps.UpdateParameter;
-import android.text.TextUtils;
-import android.util.Log;
-import android.util.Pair;
-
-import org.xml.sax.SAXException;
-
-import java.io.IOException;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Utility class for converting OMA-DM (Open Mobile Alliance's Device Management)
- * PPS-MO (PerProviderSubscription Management Object) XML tree to a
- * {@link PasspointConfiguration} object.
- *
- * Currently this only supports PerProviderSubscription/HomeSP and
- * PerProviderSubscription/Credential subtree for Hotspot 2.0 Release 1 support.
- *
- * For more info, refer to Hotspot 2.0 PPS MO defined in section 9.1 of the Hotspot 2.0
- * Release 2 Technical Specification.
- *
- * Below is a sample XML string for a Release 1 PPS MO tree:
- *
- * <MgmtTree xmlns="syncml:dmddf1.2">
- * <VerDTD>1.2</VerDTD>
- * <Node>
- * <NodeName>PerProviderSubscription</NodeName>
- * <RTProperties>
- * <Type>
- * <DDFName>urn:wfa:mo:hotspot2dot0perprovidersubscription:1.0</DDFName>
- * </Type>
- * </RTProperties>
- * <Node>
- * <NodeName>i001</NodeName>
- * <Node>
- * <NodeName>HomeSP</NodeName>
- * <Node>
- * <NodeName>FriendlyName</NodeName>
- * <Value>Century House</Value>
- * </Node>
- * <Node>
- * <NodeName>FQDN</NodeName>
- * <Value>mi6.co.uk</Value>
- * </Node>
- * <Node>
- * <NodeName>RoamingConsortiumOI</NodeName>
- * <Value>112233,445566</Value>
- * </Node>
- * </Node>
- * <Node>
- * <NodeName>Credential</NodeName>
- * <Node>
- * <NodeName>Realm</NodeName>
- * <Value>shaken.stirred.com</Value>
- * </Node>
- * <Node>
- * <NodeName>UsernamePassword</NodeName>
- * <Node>
- * <NodeName>Username</NodeName>
- * <Value>james</Value>
- * </Node>
- * <Node>
- * <NodeName>Password</NodeName>
- * <Value>Ym9uZDAwNw==</Value>
- * </Node>
- * <Node>
- * <NodeName>EAPMethod</NodeName>
- * <Node>
- * <NodeName>EAPType</NodeName>
- * <Value>21</Value>
- * </Node>
- * <Node>
- * <NodeName>InnerMethod</NodeName>
- * <Value>MS-CHAP-V2</Value>
- * </Node>
- * </Node>
- * </Node>
- * </Node>
- * </Node>
- * </Node>
- * </MgmtTree>
- */
-public final class PpsMoParser {
- private static final String TAG = "PpsMoParser";
-
- /**
- * XML tags expected in the PPS MO (PerProviderSubscription Management Object) XML tree.
- */
- private static final String TAG_MANAGEMENT_TREE = "MgmtTree";
- private static final String TAG_VER_DTD = "VerDTD";
- private static final String TAG_NODE = "Node";
- private static final String TAG_NODE_NAME = "NodeName";
- private static final String TAG_RT_PROPERTIES = "RTProperties";
- private static final String TAG_TYPE = "Type";
- private static final String TAG_DDF_NAME = "DDFName";
- private static final String TAG_VALUE = "Value";
-
- /**
- * Name for PerProviderSubscription node.
- */
- private static final String NODE_PER_PROVIDER_SUBSCRIPTION = "PerProviderSubscription";
-
- /**
- * Fields under PerProviderSubscription.
- */
- private static final String NODE_UPDATE_IDENTIFIER = "UpdateIdentifier";
- private static final String NODE_AAA_SERVER_TRUST_ROOT = "AAAServerTrustRoot";
- private static final String NODE_SUBSCRIPTION_UPDATE = "SubscriptionUpdate";
- private static final String NODE_SUBSCRIPTION_PARAMETER = "SubscriptionParameters";
- private static final String NODE_TYPE_OF_SUBSCRIPTION = "TypeOfSubscription";
- private static final String NODE_USAGE_LIMITS = "UsageLimits";
- private static final String NODE_DATA_LIMIT = "DataLimit";
- private static final String NODE_START_DATE = "StartDate";
- private static final String NODE_TIME_LIMIT = "TimeLimit";
- private static final String NODE_USAGE_TIME_PERIOD = "UsageTimePeriod";
- private static final String NODE_CREDENTIAL_PRIORITY = "CredentialPriority";
- private static final String NODE_EXTENSION = "Extension";
-
- /**
- * Fields under Extension/Android subtree.
- */
- /*
- * This node is used to put Android specific extension nodes and must be put
- * under "Extension" node. Nodes with unknown names are allowed under this subtree.
- * If there is any new node added in later release, it won't break older release parsing.
- * <p>
- * Ex:
- * <Node>
- * <NodeName>Extension</NodeName>
- * <Node>
- * <NodeName>Android</NodeName>
- * <Node>
- * <NodeName>AndroidSpecificAttribute</NodeName>
- * <Value>AndroidSpecificValue</Value>
- * </Node>
- * <Node>
- * <NodeName>AndroidSpecificAttribute2</NodeName>
- * <Value>AndroidSpecificValue2</Value>
- * </Node>
- * </Node>
- * </Node>
- */
- private static final String NODE_VENDOR_ANDROID = "Android";
- /*
- * This node describes AAA server trusted names. The trusted name must be put in
- * a leaf named "FQDN". More than one trusted names can be provided by using
- * semicolons to separate the strings (e.g., example.org;example.com).
- * <p>
- * Ex:
- * <Node>
- * <NodeName>AAAServerTrustedNames</NodeName>
- * <Node>
- * <NodeName>FQDN</NodeName>
- * <Value>trusted.com;auth.net</Value>
- * </Node>
- * <Node>
- */
- private static final String NODE_AAA_SERVER_TRUSTED_NAMES = "AAAServerTrustedNames";
-
- /**
- * Fields under HomeSP subtree.
- */
- private static final String NODE_HOMESP = "HomeSP";
- private static final String NODE_FQDN = "FQDN";
- private static final String NODE_FRIENDLY_NAME = "FriendlyName";
- private static final String NODE_ROAMING_CONSORTIUM_OI = "RoamingConsortiumOI";
- private static final String NODE_NETWORK_ID = "NetworkID";
- private static final String NODE_SSID = "SSID";
- private static final String NODE_HESSID = "HESSID";
- private static final String NODE_ICON_URL = "IconURL";
- private static final String NODE_HOME_OI_LIST = "HomeOIList";
- private static final String NODE_HOME_OI = "HomeOI";
- private static final String NODE_HOME_OI_REQUIRED = "HomeOIRequired";
- private static final String NODE_OTHER_HOME_PARTNERS = "OtherHomePartners";
-
- /**
- * Fields under Credential subtree.
- */
- private static final String NODE_CREDENTIAL = "Credential";
- private static final String NODE_CREATION_DATE = "CreationDate";
- private static final String NODE_EXPIRATION_DATE = "ExpirationDate";
- private static final String NODE_USERNAME_PASSWORD = "UsernamePassword";
- private static final String NODE_USERNAME = "Username";
- private static final String NODE_PASSWORD = "Password";
- private static final String NODE_MACHINE_MANAGED = "MachineManaged";
- private static final String NODE_SOFT_TOKEN_APP = "SoftTokenApp";
- private static final String NODE_ABLE_TO_SHARE = "AbleToShare";
- private static final String NODE_EAP_METHOD = "EAPMethod";
- private static final String NODE_EAP_TYPE = "EAPType";
- private static final String NODE_VENDOR_ID = "VendorId";
- private static final String NODE_VENDOR_TYPE = "VendorType";
- private static final String NODE_INNER_EAP_TYPE = "InnerEAPType";
- private static final String NODE_INNER_VENDOR_ID = "InnerVendorID";
- private static final String NODE_INNER_VENDOR_TYPE = "InnerVendorType";
- private static final String NODE_INNER_METHOD = "InnerMethod";
- private static final String NODE_DIGITAL_CERTIFICATE = "DigitalCertificate";
- private static final String NODE_CERTIFICATE_TYPE = "CertificateType";
- private static final String NODE_CERT_SHA256_FINGERPRINT = "CertSHA256Fingerprint";
- private static final String NODE_REALM = "Realm";
- private static final String NODE_SIM = "SIM";
- private static final String NODE_SIM_IMSI = "IMSI";
- private static final String NODE_CHECK_AAA_SERVER_CERT_STATUS = "CheckAAAServerCertStatus";
-
- /**
- * Fields under Policy subtree.
- */
- private static final String NODE_POLICY = "Policy";
- private static final String NODE_PREFERRED_ROAMING_PARTNER_LIST =
- "PreferredRoamingPartnerList";
- private static final String NODE_FQDN_MATCH = "FQDN_Match";
- private static final String NODE_PRIORITY = "Priority";
- private static final String NODE_COUNTRY = "Country";
- private static final String NODE_MIN_BACKHAUL_THRESHOLD = "MinBackhaulThreshold";
- private static final String NODE_NETWORK_TYPE = "NetworkType";
- private static final String NODE_DOWNLINK_BANDWIDTH = "DLBandwidth";
- private static final String NODE_UPLINK_BANDWIDTH = "ULBandwidth";
- private static final String NODE_POLICY_UPDATE = "PolicyUpdate";
- private static final String NODE_UPDATE_INTERVAL = "UpdateInterval";
- private static final String NODE_UPDATE_METHOD = "UpdateMethod";
- private static final String NODE_RESTRICTION = "Restriction";
- private static final String NODE_URI = "URI";
- private static final String NODE_TRUST_ROOT = "TrustRoot";
- private static final String NODE_CERT_URL = "CertURL";
- private static final String NODE_SP_EXCLUSION_LIST = "SPExclusionList";
- private static final String NODE_REQUIRED_PROTO_PORT_TUPLE = "RequiredProtoPortTuple";
- private static final String NODE_IP_PROTOCOL = "IPProtocol";
- private static final String NODE_PORT_NUMBER = "PortNumber";
- private static final String NODE_MAXIMUM_BSS_LOAD_VALUE = "MaximumBSSLoadValue";
- private static final String NODE_OTHER = "Other";
-
- /**
- * URN (Unique Resource Name) for PerProviderSubscription Management Object Tree.
- */
- private static final String PPS_MO_URN =
- "urn:wfa:mo:hotspot2dot0-perprovidersubscription:1.0";
-
- /**
- * Exception for generic parsing errors.
- */
- private static class ParsingException extends Exception {
- public ParsingException(String message) {
- super(message);
- }
- }
-
- /**
- * Class representing a node within the PerProviderSubscription tree.
- * This is used to flatten out and eliminate the extra layering in the XMLNode tree,
- * to make the data parsing easier and cleaner.
- *
- * A PPSNode can be an internal or a leaf node, but not both.
- *
- */
- private static abstract class PPSNode {
- private final String mName;
- public PPSNode(String name) {
- mName = name;
- }
-
- /**
- * @return the name of the node
- */
- public String getName() {
- return mName;
- }
-
- /**
- * Applies for internal node only.
- *
- * @return the list of children nodes.
- */
- public abstract List<PPSNode> getChildren();
-
- /**
- * Applies for leaf node only.
- *
- * @return the string value of the node
- */
- public abstract String getValue();
-
- /**
- * @return a flag indicating if this is a leaf or an internal node
- */
- public abstract boolean isLeaf();
- }
-
- /**
- * Class representing a leaf node in a PPS (PerProviderSubscription) tree.
- */
- private static class LeafNode extends PPSNode {
- private final String mValue;
- public LeafNode(String nodeName, String value) {
- super(nodeName);
- mValue = value;
- }
-
- @Override
- public String getValue() {
- return mValue;
- }
-
- @Override
- public List<PPSNode> getChildren() {
- return null;
- }
-
- @Override
- public boolean isLeaf() {
- return true;
- }
- }
-
- /**
- * Class representing an internal node in a PPS (PerProviderSubscription) tree.
- */
- private static class InternalNode extends PPSNode {
- private final List<PPSNode> mChildren;
- public InternalNode(String nodeName, List<PPSNode> children) {
- super(nodeName);
- mChildren = children;
- }
-
- @Override
- public String getValue() {
- return null;
- }
-
- @Override
- public List<PPSNode> getChildren() {
- return mChildren;
- }
-
- @Override
- public boolean isLeaf() {
- return false;
- }
- }
-
- /**
- * @hide
- */
- public PpsMoParser() {}
-
- /**
- * Convert a XML string representation of a PPS MO (PerProviderSubscription
- * Management Object) tree to a {@link PasspointConfiguration} object.
- *
- * @param xmlString XML string representation of a PPS MO tree
- * @return {@link PasspointConfiguration} or null
- */
- public static PasspointConfiguration parseMoText(String xmlString) {
- // Convert the XML string to a XML tree.
- XMLParser xmlParser = new XMLParser();
- XMLNode root = null;
- try {
- root = xmlParser.parse(xmlString);
- } catch(IOException | SAXException e) {
- return null;
- }
- if (root == null) {
- return null;
- }
-
- // Verify root node is a "MgmtTree" node.
- if (root.getTag() != TAG_MANAGEMENT_TREE) {
- Log.e(TAG, "Root is not a MgmtTree");
- return null;
- }
-
- String verDtd = null; // Used for detecting duplicate VerDTD element.
- PasspointConfiguration config = null;
- for (XMLNode child : root.getChildren()) {
- switch(child.getTag()) {
- case TAG_VER_DTD:
- if (verDtd != null) {
- Log.e(TAG, "Duplicate VerDTD element");
- return null;
- }
- verDtd = child.getText();
- break;
- case TAG_NODE:
- if (config != null) {
- Log.e(TAG, "Unexpected multiple Node element under MgmtTree");
- return null;
- }
- try {
- config = parsePpsNode(child);
- } catch (ParsingException e) {
- Log.e(TAG, e.getMessage());
- return null;
- }
- break;
- default:
- Log.e(TAG, "Unknown node: " + child.getTag());
- return null;
- }
- }
- return config;
- }
-
- /**
- * Parse a PerProviderSubscription node. Below is the format of the XML tree (with
- * each XML element represent a node in the tree):
- *
- * <Node>
- * <NodeName>PerProviderSubscription</NodeName>
- * <RTProperties>
- * ...
- * </RTPProperties>
- * <Node>
- * <NodeName>UpdateIdentifier</NodeName>
- * <Value>...</Value>
- * </Node>
- * <Node>
- * ...
- * </Node>
- * </Node>
- *
- * @param node XMLNode that contains PerProviderSubscription node.
- * @return PasspointConfiguration or null
- * @throws ParsingException
- */
- private static PasspointConfiguration parsePpsNode(XMLNode node)
- throws ParsingException {
- PasspointConfiguration config = null;
- String nodeName = null;
- int updateIdentifier = Integer.MIN_VALUE;
- for (XMLNode child : node.getChildren()) {
- switch (child.getTag()) {
- case TAG_NODE_NAME:
- if (nodeName != null) {
- throw new ParsingException("Duplicate NodeName: " + child.getText());
- }
- nodeName = child.getText();
- if (!TextUtils.equals(nodeName, NODE_PER_PROVIDER_SUBSCRIPTION)) {
- throw new ParsingException("Unexpected NodeName: " + nodeName);
- }
- break;
- case TAG_NODE:
- // A node can be either an UpdateIdentifier node or a PerProviderSubscription
- // instance node. Flatten out the XML tree first by converting it to a PPS
- // tree to reduce the complexity of the parsing code.
- PPSNode ppsNodeRoot = buildPpsNode(child);
- if (TextUtils.equals(ppsNodeRoot.getName(), NODE_UPDATE_IDENTIFIER)) {
- if (updateIdentifier != Integer.MIN_VALUE) {
- throw new ParsingException("Multiple node for UpdateIdentifier");
- }
- updateIdentifier = parseInteger(getPpsNodeValue(ppsNodeRoot));
- } else {
- // Only one PerProviderSubscription instance is expected and allowed.
- if (config != null) {
- throw new ParsingException("Multiple PPS instance");
- }
- config = parsePpsInstance(ppsNodeRoot);
- }
- break;
- case TAG_RT_PROPERTIES:
- // Parse and verify URN stored in the RT (Run Time) Properties.
- String urn = parseUrn(child);
- if (!TextUtils.equals(urn, PPS_MO_URN)) {
- throw new ParsingException("Unknown URN: " + urn);
- }
- break;
- default:
- throw new ParsingException("Unknown tag under PPS node: " + child.getTag());
- }
- }
- if (config != null && updateIdentifier != Integer.MIN_VALUE) {
- config.setUpdateIdentifier(updateIdentifier);
- }
- return config;
- }
-
- /**
- * Parse the URN stored in the RTProperties. Below is the format of the RTPProperties node:
- *
- * <RTProperties>
- * <Type>
- * <DDFName>urn:...</DDFName>
- * </Type>
- * </RTProperties>
- *
- * @param node XMLNode that contains RTProperties node.
- * @return URN String of URN.
- * @throws ParsingException
- */
- private static String parseUrn(XMLNode node) throws ParsingException {
- if (node.getChildren().size() != 1)
- throw new ParsingException("Expect RTPProperties node to only have one child");
-
- XMLNode typeNode = node.getChildren().get(0);
- if (typeNode.getChildren().size() != 1) {
- throw new ParsingException("Expect Type node to only have one child");
- }
- if (!TextUtils.equals(typeNode.getTag(), TAG_TYPE)) {
- throw new ParsingException("Unexpected tag for Type: " + typeNode.getTag());
- }
-
- XMLNode ddfNameNode = typeNode.getChildren().get(0);
- if (!ddfNameNode.getChildren().isEmpty()) {
- throw new ParsingException("Expect DDFName node to have no child");
- }
- if (!TextUtils.equals(ddfNameNode.getTag(), TAG_DDF_NAME)) {
- throw new ParsingException("Unexpected tag for DDFName: " + ddfNameNode.getTag());
- }
-
- return ddfNameNode.getText();
- }
-
- /**
- * Convert a XML tree represented by XMLNode to a PPS (PerProviderSubscription) instance tree
- * represented by PPSNode. This flattens out the XML tree to allow easier and cleaner parsing
- * of the PPS configuration data. Only three types of XML tag are expected: "NodeName",
- * "Node", and "Value".
- *
- * The original XML tree (each XML element represent a node):
- *
- * <Node>
- * <NodeName>root</NodeName>
- * <Node>
- * <NodeName>child1</NodeName>
- * <Value>value1</Value>
- * </Node>
- * <Node>
- * <NodeName>child2</NodeName>
- * <Node>
- * <NodeName>grandchild1</NodeName>
- * ...
- * </Node>
- * </Node>
- * ...
- * </Node>
- *
- * The converted PPS tree:
- *
- * [root] --- [child1, value1]
- * |
- * ---------[child2] --------[grandchild1] --- ...
- *
- * @param node XMLNode pointed to the root of a XML tree
- * @return PPSNode pointing to the root of a PPS tree
- * @throws ParsingException
- */
- private static PPSNode buildPpsNode(XMLNode node) throws ParsingException {
- String nodeName = null;
- String nodeValue = null;
- List<PPSNode> childNodes = new ArrayList<PPSNode>();
- // Names of parsed child nodes, use for detecting multiple child nodes with the same name.
- Set<String> parsedNodes = new HashSet<String>();
-
- for (XMLNode child : node.getChildren()) {
- String tag = child.getTag();
- if (TextUtils.equals(tag, TAG_NODE_NAME)) {
- if (nodeName != null) {
- throw new ParsingException("Duplicate NodeName node");
- }
- nodeName = child.getText();
- } else if (TextUtils.equals(tag, TAG_NODE)) {
- PPSNode ppsNode = buildPpsNode(child);
- if (parsedNodes.contains(ppsNode.getName())) {
- throw new ParsingException("Duplicate node: " + ppsNode.getName());
- }
- parsedNodes.add(ppsNode.getName());
- childNodes.add(ppsNode);
- } else if (TextUtils.equals(tag, TAG_VALUE)) {
- if (nodeValue != null) {
- throw new ParsingException("Duplicate Value node");
- }
- nodeValue = child.getText();
- } else {
- throw new ParsingException("Unknown tag: " + tag);
- }
- }
-
- if (nodeName == null) {
- throw new ParsingException("Invalid node: missing NodeName");
- }
- if (nodeValue == null && childNodes.size() == 0) {
- throw new ParsingException("Invalid node: " + nodeName +
- " missing both value and children");
- }
- if (nodeValue != null && childNodes.size() > 0) {
- throw new ParsingException("Invalid node: " + nodeName +
- " contained both value and children");
- }
-
- if (nodeValue != null) {
- return new LeafNode(nodeName, nodeValue);
- }
- return new InternalNode(nodeName, childNodes);
- }
-
- /**
- * Return the value of a PPSNode. An exception will be thrown if the given node
- * is not a leaf node.
- *
- * @param node PPSNode to retrieve the value from
- * @return String representing the value of the node
- * @throws ParsingException
- */
- private static String getPpsNodeValue(PPSNode node) throws ParsingException {
- if (!node.isLeaf()) {
- throw new ParsingException("Cannot get value from a non-leaf node: " + node.getName());
- }
- return node.getValue();
- }
-
- /**
- * Parse a PPS (PerProviderSubscription) configurations from a PPS tree.
- *
- * @param root PPSNode representing the root of the PPS tree
- * @return PasspointConfiguration
- * @throws ParsingException
- */
- private static PasspointConfiguration parsePpsInstance(PPSNode root)
- throws ParsingException {
- if (root.isLeaf()) {
- throw new ParsingException("Leaf node not expected for PPS instance");
- }
-
- PasspointConfiguration config = new PasspointConfiguration();
- for (PPSNode child : root.getChildren()) {
- switch(child.getName()) {
- case NODE_HOMESP:
- config.setHomeSp(parseHomeSP(child));
- break;
- case NODE_CREDENTIAL:
- config.setCredential(parseCredential(child));
- break;
- case NODE_POLICY:
- config.setPolicy(parsePolicy(child));
- break;
- case NODE_AAA_SERVER_TRUST_ROOT:
- config.setTrustRootCertList(parseAAAServerTrustRootList(child));
- break;
- case NODE_SUBSCRIPTION_UPDATE:
- config.setSubscriptionUpdate(parseUpdateParameter(child));
- break;
- case NODE_SUBSCRIPTION_PARAMETER:
- parseSubscriptionParameter(child, config);
- break;
- case NODE_CREDENTIAL_PRIORITY:
- config.setCredentialPriority(parseInteger(getPpsNodeValue(child)));
- break;
- case NODE_EXTENSION:
- // All vendor specific information will be under this node.
- parseExtension(child, config);
- break;
- default:
- throw new ParsingException("Unknown node: " + child.getName());
- }
- }
- return config;
- }
-
- /**
- * Parse configurations under PerProviderSubscription/HomeSP subtree.
- *
- * @param node PPSNode representing the root of the PerProviderSubscription/HomeSP subtree
- * @return HomeSP
- * @throws ParsingException
- */
- private static HomeSp parseHomeSP(PPSNode node) throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for HomeSP");
- }
-
- HomeSp homeSp = new HomeSp();
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_FQDN:
- homeSp.setFqdn(getPpsNodeValue(child));
- break;
- case NODE_FRIENDLY_NAME:
- homeSp.setFriendlyName(getPpsNodeValue(child));
- break;
- case NODE_ROAMING_CONSORTIUM_OI:
- homeSp.setRoamingConsortiumOis(
- parseRoamingConsortiumOI(getPpsNodeValue(child)));
- break;
- case NODE_ICON_URL:
- homeSp.setIconUrl(getPpsNodeValue(child));
- break;
- case NODE_NETWORK_ID:
- homeSp.setHomeNetworkIds(parseNetworkIds(child));
- break;
- case NODE_HOME_OI_LIST:
- Pair<List<Long>, List<Long>> homeOIs = parseHomeOIList(child);
- homeSp.setMatchAllOis(convertFromLongList(homeOIs.first));
- homeSp.setMatchAnyOis(convertFromLongList(homeOIs.second));
- break;
- case NODE_OTHER_HOME_PARTNERS:
- homeSp.setOtherHomePartners(parseOtherHomePartners(child));
- break;
- default:
- throw new ParsingException("Unknown node under HomeSP: " + child.getName());
- }
- }
- return homeSp;
- }
-
- /**
- * Parse the roaming consortium OI string, which contains a list of OIs separated by ",".
- *
- * @param oiStr string containing list of OIs (Organization Identifiers) separated by ","
- * @return long[]
- * @throws ParsingException
- */
- private static long[] parseRoamingConsortiumOI(String oiStr)
- throws ParsingException {
- String[] oiStrArray = oiStr.split(",");
- long[] oiArray = new long[oiStrArray.length];
- for (int i = 0; i < oiStrArray.length; i++) {
- oiArray[i] = parseLong(oiStrArray[i], 16);
- }
- return oiArray;
- }
-
- /**
- * Parse configurations under PerProviderSubscription/HomeSP/NetworkID subtree.
- *
- * @param node PPSNode representing the root of the PerProviderSubscription/HomeSP/NetworkID
- * subtree
- * @return HashMap<String, Long> representing list of <SSID, HESSID> pair.
- * @throws ParsingException
- */
- static private Map<String, Long> parseNetworkIds(PPSNode node)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for NetworkID");
- }
-
- Map<String, Long> networkIds = new HashMap<>();
- for (PPSNode child : node.getChildren()) {
- Pair<String, Long> networkId = parseNetworkIdInstance(child);
- networkIds.put(networkId.first, networkId.second);
- }
- return networkIds;
- }
-
- /**
- * Parse configurations under PerProviderSubscription/HomeSP/NetworkID/<X+> subtree.
- * The instance name (<X+>) is irrelevant and must be unique for each instance, which
- * is verified when the PPS tree is constructed {@link #buildPpsNode}.
- *
- * @param node PPSNode representing the root of the
- * PerProviderSubscription/HomeSP/NetworkID/<X+> subtree
- * @return Pair<String, Long> representing <SSID, HESSID> pair.
- * @throws ParsingException
- */
- static private Pair<String, Long> parseNetworkIdInstance(PPSNode node)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for NetworkID instance");
- }
-
- String ssid = null;
- Long hessid = null;
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_SSID:
- ssid = getPpsNodeValue(child);
- break;
- case NODE_HESSID:
- hessid = parseLong(getPpsNodeValue(child), 16);
- break;
- default:
- throw new ParsingException("Unknown node under NetworkID instance: " +
- child.getName());
- }
- }
- if (ssid == null)
- throw new ParsingException("NetworkID instance missing SSID");
-
- return new Pair<String, Long>(ssid, hessid);
- }
-
- /**
- * Parse configurations under PerProviderSubscription/HomeSP/HomeOIList subtree.
- *
- * @param node PPSNode representing the root of the PerProviderSubscription/HomeSP/HomeOIList
- * subtree
- * @return Pair<List<Long>, List<Long>> containing both MatchAllOIs and MatchAnyOIs list.
- * @throws ParsingException
- */
- private static Pair<List<Long>, List<Long>> parseHomeOIList(PPSNode node)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for HomeOIList");
- }
-
- List<Long> matchAllOIs = new ArrayList<Long>();
- List<Long> matchAnyOIs = new ArrayList<Long>();
- for (PPSNode child : node.getChildren()) {
- Pair<Long, Boolean> homeOI = parseHomeOIInstance(child);
- if (homeOI.second.booleanValue()) {
- matchAllOIs.add(homeOI.first);
- } else {
- matchAnyOIs.add(homeOI.first);
- }
- }
- return new Pair<List<Long>, List<Long>>(matchAllOIs, matchAnyOIs);
- }
-
- /**
- * Parse configurations under PerProviderSubscription/HomeSP/HomeOIList/<X+> subtree.
- * The instance name (<X+>) is irrelevant and must be unique for each instance, which
- * is verified when the PPS tree is constructed {@link #buildPpsNode}.
- *
- * @param node PPSNode representing the root of the
- * PerProviderSubscription/HomeSP/HomeOIList/<X+> subtree
- * @return Pair<Long, Boolean> containing a HomeOI and a HomeOIRequired flag
- * @throws ParsingException
- */
- private static Pair<Long, Boolean> parseHomeOIInstance(PPSNode node) throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for HomeOI instance");
- }
-
- Long oi = null;
- Boolean required = null;
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_HOME_OI:
- try {
- oi = Long.valueOf(getPpsNodeValue(child), 16);
- } catch (NumberFormatException e) {
- throw new ParsingException("Invalid HomeOI: " + getPpsNodeValue(child));
- }
- break;
- case NODE_HOME_OI_REQUIRED:
- required = Boolean.valueOf(getPpsNodeValue(child));
- break;
- default:
- throw new ParsingException("Unknown node under NetworkID instance: " +
- child.getName());
- }
- }
- if (oi == null) {
- throw new ParsingException("HomeOI instance missing OI field");
- }
- if (required == null) {
- throw new ParsingException("HomeOI instance missing required field");
- }
- return new Pair<Long, Boolean>(oi, required);
- }
-
- /**
- * Parse configurations under PerProviderSubscription/HomeSP/OtherHomePartners subtree.
- * This contains a list of FQDN (Fully Qualified Domain Name) that are considered
- * home partners.
- *
- * @param node PPSNode representing the root of the
- * PerProviderSubscription/HomeSP/OtherHomePartners subtree
- * @return String[] list of partner's FQDN
- * @throws ParsingException
- */
- private static String[] parseOtherHomePartners(PPSNode node) throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for OtherHomePartners");
- }
- List<String> otherHomePartners = new ArrayList<String>();
- for (PPSNode child : node.getChildren()) {
- String fqdn = parseOtherHomePartnerInstance(child);
- otherHomePartners.add(fqdn);
- }
- return otherHomePartners.toArray(new String[otherHomePartners.size()]);
- }
-
- /**
- * Parse configurations under PerProviderSubscription/HomeSP/OtherHomePartners/<X+> subtree.
- * The instance name (<X+>) is irrelevant and must be unique for each instance, which
- * is verified when the PPS tree is constructed {@link #buildPpsNode}.
- *
- * @param node PPSNode representing the root of the
- * PerProviderSubscription/HomeSP/OtherHomePartners/<X+> subtree
- * @return String FQDN of the partner
- * @throws ParsingException
- */
- private static String parseOtherHomePartnerInstance(PPSNode node) throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for OtherHomePartner instance");
- }
- String fqdn = null;
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_FQDN:
- fqdn = getPpsNodeValue(child);
- break;
- default:
- throw new ParsingException(
- "Unknown node under OtherHomePartner instance: " + child.getName());
- }
- }
- if (fqdn == null) {
- throw new ParsingException("OtherHomePartner instance missing FQDN field");
- }
- return fqdn;
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Credential subtree.
- *
- * @param node PPSNode representing the root of the PerProviderSubscription/Credential subtree
- * @return Credential
- * @throws ParsingException
- */
- private static Credential parseCredential(PPSNode node) throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for Credential");
- }
-
- Credential credential = new Credential();
- for (PPSNode child: node.getChildren()) {
- switch (child.getName()) {
- case NODE_CREATION_DATE:
- credential.setCreationTimeInMillis(parseDate(getPpsNodeValue(child)));
- break;
- case NODE_EXPIRATION_DATE:
- credential.setExpirationTimeInMillis(parseDate(getPpsNodeValue(child)));
- break;
- case NODE_USERNAME_PASSWORD:
- credential.setUserCredential(parseUserCredential(child));
- break;
- case NODE_DIGITAL_CERTIFICATE:
- credential.setCertCredential(parseCertificateCredential(child));
- break;
- case NODE_REALM:
- credential.setRealm(getPpsNodeValue(child));
- break;
- case NODE_CHECK_AAA_SERVER_CERT_STATUS:
- credential.setCheckAaaServerCertStatus(
- Boolean.parseBoolean(getPpsNodeValue(child)));
- break;
- case NODE_SIM:
- credential.setSimCredential(parseSimCredential(child));
- break;
- default:
- throw new ParsingException("Unknown node under Credential: " +
- child.getName());
- }
- }
- return credential;
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Credential/UsernamePassword subtree.
- *
- * @param node PPSNode representing the root of the
- * PerProviderSubscription/Credential/UsernamePassword subtree
- * @return Credential.UserCredential
- * @throws ParsingException
- */
- private static Credential.UserCredential parseUserCredential(PPSNode node)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for UsernamePassword");
- }
-
- Credential.UserCredential userCred = new Credential.UserCredential();
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_USERNAME:
- userCred.setUsername(getPpsNodeValue(child));
- break;
- case NODE_PASSWORD:
- userCred.setPassword(getPpsNodeValue(child));
- break;
- case NODE_MACHINE_MANAGED:
- userCred.setMachineManaged(Boolean.parseBoolean(getPpsNodeValue(child)));
- break;
- case NODE_SOFT_TOKEN_APP:
- userCred.setSoftTokenApp(getPpsNodeValue(child));
- break;
- case NODE_ABLE_TO_SHARE:
- userCred.setAbleToShare(Boolean.parseBoolean(getPpsNodeValue(child)));
- break;
- case NODE_EAP_METHOD:
- parseEAPMethod(child, userCred);
- break;
- default:
- throw new ParsingException("Unknown node under UsernamePassword: "
- + child.getName());
- }
- }
- return userCred;
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Credential/UsernamePassword/EAPMethod
- * subtree.
- *
- * @param node PPSNode representing the root of the
- * PerProviderSubscription/Credential/UsernamePassword/EAPMethod subtree
- * @param userCred UserCredential to be updated with EAP method values.
- * @throws ParsingException
- */
- private static void parseEAPMethod(PPSNode node, Credential.UserCredential userCred)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for EAPMethod");
- }
-
- for (PPSNode child : node.getChildren()) {
- switch(child.getName()) {
- case NODE_EAP_TYPE:
- userCred.setEapType(parseInteger(getPpsNodeValue(child)));
- break;
- case NODE_INNER_METHOD:
- userCred.setNonEapInnerMethod(getPpsNodeValue(child));
- break;
- case NODE_VENDOR_ID:
- case NODE_VENDOR_TYPE:
- case NODE_INNER_EAP_TYPE:
- case NODE_INNER_VENDOR_ID:
- case NODE_INNER_VENDOR_TYPE:
- // Only EAP-TTLS is currently supported for user credential, which doesn't
- // use any of these parameters.
- Log.d(TAG, "Ignore unsupported EAP method parameter: " + child.getName());
- break;
- default:
- throw new ParsingException("Unknown node under EAPMethod: " + child.getName());
- }
- }
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Credential/DigitalCertificate subtree.
- *
- * @param node PPSNode representing the root of the
- * PerProviderSubscription/Credential/DigitalCertificate subtree
- * @return Credential.CertificateCredential
- * @throws ParsingException
- */
- private static Credential.CertificateCredential parseCertificateCredential(PPSNode node)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for CertificateCredential");
- }
-
- Credential.CertificateCredential certCred = new Credential.CertificateCredential();
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_CERTIFICATE_TYPE:
- certCred.setCertType(getPpsNodeValue(child));
- break;
- case NODE_CERT_SHA256_FINGERPRINT:
- certCred.setCertSha256Fingerprint(parseHexString(getPpsNodeValue(child)));
- break;
- default:
- throw new ParsingException("Unknown node under CertificateCredential: "
- + child.getName());
- }
- }
- return certCred;
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Credential/SIM subtree.
- *
- * @param node PPSNode representing the root of the PerProviderSubscription/Credential/SIM
- * subtree
- * @return Credential.SimCredential
- * @throws ParsingException
- */
- private static Credential.SimCredential parseSimCredential(PPSNode node)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for SimCredential");
- }
-
- Credential.SimCredential simCred = new Credential.SimCredential();
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_SIM_IMSI:
- simCred.setImsi(getPpsNodeValue(child));
- break;
- case NODE_EAP_TYPE:
- simCred.setEapType(parseInteger(getPpsNodeValue(child)));
- break;
- default:
- throw new ParsingException("Unknown node under SimCredential: "
- + child.getName());
- }
- }
- return simCred;
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Policy subtree.
- *
- * @param node PPSNode representing the root of the PerProviderSubscription/Policy subtree
- * @return {@link Policy}
- * @throws ParsingException
- */
- private static Policy parsePolicy(PPSNode node) throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for Policy");
- }
-
- Policy policy = new Policy();
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_PREFERRED_ROAMING_PARTNER_LIST:
- policy.setPreferredRoamingPartnerList(parsePreferredRoamingPartnerList(child));
- break;
- case NODE_MIN_BACKHAUL_THRESHOLD:
- parseMinBackhaulThreshold(child, policy);
- break;
- case NODE_POLICY_UPDATE:
- policy.setPolicyUpdate(parseUpdateParameter(child));
- break;
- case NODE_SP_EXCLUSION_LIST:
- policy.setExcludedSsidList(parseSpExclusionList(child));
- break;
- case NODE_REQUIRED_PROTO_PORT_TUPLE:
- policy.setRequiredProtoPortMap(parseRequiredProtoPortTuple(child));
- break;
- case NODE_MAXIMUM_BSS_LOAD_VALUE:
- policy.setMaximumBssLoadValue(parseInteger(getPpsNodeValue(child)));
- break;
- default:
- throw new ParsingException("Unknown node under Policy: " + child.getName());
- }
- }
- return policy;
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Policy/PreferredRoamingPartnerList
- * subtree.
- *
- * @param node PPSNode representing the root of the
- * PerProviderSubscription/Policy/PreferredRoamingPartnerList subtree
- * @return List of {@link Policy#RoamingPartner}
- * @throws ParsingException
- */
- private static List<Policy.RoamingPartner> parsePreferredRoamingPartnerList(PPSNode node)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for PreferredRoamingPartnerList");
- }
- List<Policy.RoamingPartner> partnerList = new ArrayList<>();
- for (PPSNode child : node.getChildren()) {
- partnerList.add(parsePreferredRoamingPartner(child));
- }
- return partnerList;
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Policy/PreferredRoamingPartnerList/<X+>
- * subtree.
- *
- * @param node PPSNode representing the root of the
- * PerProviderSubscription/Policy/PreferredRoamingPartnerList/<X+> subtree
- * @return {@link Policy#RoamingPartner}
- * @throws ParsingException
- */
- private static Policy.RoamingPartner parsePreferredRoamingPartner(PPSNode node)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for PreferredRoamingPartner "
- + "instance");
- }
-
- Policy.RoamingPartner roamingPartner = new Policy.RoamingPartner();
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_FQDN_MATCH:
- // FQDN_Match field is in the format of "[FQDN],[MatchInfo]", where [MatchInfo]
- // is either "exactMatch" for exact match of FQDN or "includeSubdomains" for
- // matching all FQDNs with the same sub-domain.
- String fqdnMatch = getPpsNodeValue(child);
- String[] fqdnMatchArray = fqdnMatch.split(",");
- if (fqdnMatchArray.length != 2) {
- throw new ParsingException("Invalid FQDN_Match: " + fqdnMatch);
- }
- roamingPartner.setFqdn(fqdnMatchArray[0]);
- if (TextUtils.equals(fqdnMatchArray[1], "exactMatch")) {
- roamingPartner.setFqdnExactMatch(true);
- } else if (TextUtils.equals(fqdnMatchArray[1], "includeSubdomains")) {
- roamingPartner.setFqdnExactMatch(false);
- } else {
- throw new ParsingException("Invalid FQDN_Match: " + fqdnMatch);
- }
- break;
- case NODE_PRIORITY:
- roamingPartner.setPriority(parseInteger(getPpsNodeValue(child)));
- break;
- case NODE_COUNTRY:
- roamingPartner.setCountries(getPpsNodeValue(child));
- break;
- default:
- throw new ParsingException("Unknown node under PreferredRoamingPartnerList "
- + "instance " + child.getName());
- }
- }
- return roamingPartner;
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Policy/MinBackhaulThreshold subtree
- * into the given policy.
- *
- * @param node PPSNode representing the root of the
- * PerProviderSubscription/Policy/MinBackhaulThreshold subtree
- * @param policy The policy to store the MinBackhualThreshold configuration
- * @throws ParsingException
- */
- private static void parseMinBackhaulThreshold(PPSNode node, Policy policy)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for MinBackhaulThreshold");
- }
- for (PPSNode child : node.getChildren()) {
- parseMinBackhaulThresholdInstance(child, policy);
- }
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Policy/MinBackhaulThreshold/<X+> subtree
- * into the given policy.
- *
- * @param node PPSNode representing the root of the
- * PerProviderSubscription/Policy/MinBackhaulThreshold/<X+> subtree
- * @param policy The policy to store the MinBackhaulThreshold configuration
- * @throws ParsingException
- */
- private static void parseMinBackhaulThresholdInstance(PPSNode node, Policy policy)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for MinBackhaulThreshold instance");
- }
- String networkType = null;
- long downlinkBandwidth = Long.MIN_VALUE;
- long uplinkBandwidth = Long.MIN_VALUE;
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_NETWORK_TYPE:
- networkType = getPpsNodeValue(child);
- break;
- case NODE_DOWNLINK_BANDWIDTH:
- downlinkBandwidth = parseLong(getPpsNodeValue(child), 10);
- break;
- case NODE_UPLINK_BANDWIDTH:
- uplinkBandwidth = parseLong(getPpsNodeValue(child), 10);
- break;
- default:
- throw new ParsingException("Unknown node under MinBackhaulThreshold instance "
- + child.getName());
- }
- }
- if (networkType == null) {
- throw new ParsingException("Missing NetworkType field");
- }
-
- if (TextUtils.equals(networkType, "home")) {
- policy.setMinHomeDownlinkBandwidth(downlinkBandwidth);
- policy.setMinHomeUplinkBandwidth(uplinkBandwidth);
- } else if (TextUtils.equals(networkType, "roaming")) {
- policy.setMinRoamingDownlinkBandwidth(downlinkBandwidth);
- policy.setMinRoamingUplinkBandwidth(uplinkBandwidth);
- } else {
- throw new ParsingException("Invalid network type: " + networkType);
- }
- }
-
- /**
- * Parse update parameters. This contained configurations from either
- * PerProviderSubscription/Policy/PolicyUpdate or PerProviderSubscription/SubscriptionUpdate
- * subtree.
- *
- * @param node PPSNode representing the root of the PerProviderSubscription/Policy/PolicyUpdate
- * or PerProviderSubscription/SubscriptionUpdate subtree
- * @return {@link UpdateParameter}
- * @throws ParsingException
- */
- private static UpdateParameter parseUpdateParameter(PPSNode node)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for Update Parameters");
- }
-
- UpdateParameter updateParam = new UpdateParameter();
- for (PPSNode child : node.getChildren()) {
- switch(child.getName()) {
- case NODE_UPDATE_INTERVAL:
- updateParam.setUpdateIntervalInMinutes(parseLong(getPpsNodeValue(child), 10));
- break;
- case NODE_UPDATE_METHOD:
- updateParam.setUpdateMethod(getPpsNodeValue(child));
- break;
- case NODE_RESTRICTION:
- updateParam.setRestriction(getPpsNodeValue(child));
- break;
- case NODE_URI:
- updateParam.setServerUri(getPpsNodeValue(child));
- break;
- case NODE_USERNAME_PASSWORD:
- Pair<String, String> usernamePassword = parseUpdateUserCredential(child);
- updateParam.setUsername(usernamePassword.first);
- updateParam.setBase64EncodedPassword(usernamePassword.second);
- break;
- case NODE_TRUST_ROOT:
- Pair<String, byte[]> trustRoot = parseTrustRoot(child);
- updateParam.setTrustRootCertUrl(trustRoot.first);
- updateParam.setTrustRootCertSha256Fingerprint(trustRoot.second);
- break;
- case NODE_OTHER:
- Log.d(TAG, "Ignore unsupported paramter: " + child.getName());
- break;
- default:
- throw new ParsingException("Unknown node under Update Parameters: "
- + child.getName());
- }
- }
- return updateParam;
- }
-
- /**
- * Parse username and password parameters associated with policy or subscription update.
- * This contained configurations under either
- * PerProviderSubscription/Policy/PolicyUpdate/UsernamePassword or
- * PerProviderSubscription/SubscriptionUpdate/UsernamePassword subtree.
- *
- * @param node PPSNode representing the root of the UsernamePassword subtree
- * @return Pair of username and password
- * @throws ParsingException
- */
- private static Pair<String, String> parseUpdateUserCredential(PPSNode node)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for UsernamePassword");
- }
-
- String username = null;
- String password = null;
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_USERNAME:
- username = getPpsNodeValue(child);
- break;
- case NODE_PASSWORD:
- password = getPpsNodeValue(child);
- break;
- default:
- throw new ParsingException("Unknown node under UsernamePassword: "
- + child.getName());
- }
- }
- return Pair.create(username, password);
- }
-
- /**
- * Parse the trust root parameters associated with policy update, subscription update, or AAA
- * server trust root.
- *
- * This contained configurations under either
- * PerProviderSubscription/Policy/PolicyUpdate/TrustRoot or
- * PerProviderSubscription/SubscriptionUpdate/TrustRoot or
- * PerProviderSubscription/AAAServerTrustRoot/<X+> subtree.
- *
- * @param node PPSNode representing the root of the TrustRoot subtree
- * @return Pair of Certificate URL and fingerprint
- * @throws ParsingException
- */
- private static Pair<String, byte[]> parseTrustRoot(PPSNode node)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for TrustRoot");
- }
-
- String certUrl = null;
- byte[] certFingerprint = null;
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_CERT_URL:
- certUrl = getPpsNodeValue(child);
- break;
- case NODE_CERT_SHA256_FINGERPRINT:
- certFingerprint = parseHexString(getPpsNodeValue(child));
- break;
- default:
- throw new ParsingException("Unknown node under TrustRoot: "
- + child.getName());
- }
- }
- return Pair.create(certUrl, certFingerprint);
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Policy/SPExclusionList subtree.
- *
- * @param node PPSNode representing the root of the
- * PerProviderSubscription/Policy/SPExclusionList subtree
- * @return Array of excluded SSIDs
- * @throws ParsingException
- */
- private static String[] parseSpExclusionList(PPSNode node) throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for SPExclusionList");
- }
- List<String> ssidList = new ArrayList<>();
- for (PPSNode child : node.getChildren()) {
- ssidList.add(parseSpExclusionInstance(child));
- }
- return ssidList.toArray(new String[ssidList.size()]);
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Policy/SPExclusionList/<X+> subtree.
- *
- * @param node PPSNode representing the root of the
- * PerProviderSubscription/Policy/SPExclusionList/<X+> subtree
- * @return String
- * @throws ParsingException
- */
- private static String parseSpExclusionInstance(PPSNode node) throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for SPExclusion instance");
- }
- String ssid = null;
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_SSID:
- ssid = getPpsNodeValue(child);
- break;
- default:
- throw new ParsingException("Unknown node under SPExclusion instance");
- }
- }
- return ssid;
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Policy/RequiredProtoPortTuple subtree.
- *
- * @param node PPSNode representing the root of the
- * PerProviderSubscription/Policy/RequiredProtoPortTuple subtree
- * @return Map of IP Protocol to Port Number tuples
- * @throws ParsingException
- */
- private static Map<Integer, String> parseRequiredProtoPortTuple(PPSNode node)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for RequiredProtoPortTuple");
- }
- Map<Integer, String> protoPortTupleMap = new HashMap<>();
- for (PPSNode child : node.getChildren()) {
- Pair<Integer, String> protoPortTuple = parseProtoPortTuple(child);
- protoPortTupleMap.put(protoPortTuple.first, protoPortTuple.second);
- }
- return protoPortTupleMap;
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Policy/RequiredProtoPortTuple/<X+>
- * subtree.
- *
- * @param node PPSNode representing the root of the
- * PerProviderSubscription/Policy/RequiredProtoPortTuple/<X+> subtree
- * @return Pair of IP Protocol to Port Number tuple
- * @throws ParsingException
- */
- private static Pair<Integer, String> parseProtoPortTuple(PPSNode node)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for RequiredProtoPortTuple "
- + "instance");
- }
- int proto = Integer.MIN_VALUE;
- String ports = null;
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_IP_PROTOCOL:
- proto = parseInteger(getPpsNodeValue(child));
- break;
- case NODE_PORT_NUMBER:
- ports = getPpsNodeValue(child);
- break;
- default:
- throw new ParsingException("Unknown node under RequiredProtoPortTuple instance"
- + child.getName());
- }
- }
- if (proto == Integer.MIN_VALUE) {
- throw new ParsingException("Missing IPProtocol field");
- }
- if (ports == null) {
- throw new ParsingException("Missing PortNumber field");
- }
- return Pair.create(proto, ports);
- }
-
- /**
- * Parse configurations under PerProviderSubscription/AAAServerTrustRoot subtree.
- *
- * @param node PPSNode representing the root of PerProviderSubscription/AAAServerTrustRoot
- * subtree
- * @return Map of certificate URL with the corresponding certificate fingerprint
- * @throws ParsingException
- */
- private static Map<String, byte[]> parseAAAServerTrustRootList(PPSNode node)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for AAAServerTrustRoot");
- }
- Map<String, byte[]> certList = new HashMap<>();
- for (PPSNode child : node.getChildren()) {
- Pair<String, byte[]> certTuple = parseTrustRoot(child);
- certList.put(certTuple.first, certTuple.second);
- }
- return certList;
- }
-
- /**
- * Parse configurations under PerProviderSubscription/SubscriptionParameter subtree.
- *
- * @param node PPSNode representing the root of PerProviderSubscription/SubscriptionParameter
- * subtree
- * @param config Instance of {@link PasspointConfiguration}
- * @throws ParsingException
- */
- private static void parseSubscriptionParameter(PPSNode node, PasspointConfiguration config)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for SubscriptionParameter");
- }
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_CREATION_DATE:
- config.setSubscriptionCreationTimeInMillis(parseDate(getPpsNodeValue(child)));
- break;
- case NODE_EXPIRATION_DATE:
- config.setSubscriptionExpirationTimeInMillis(parseDate(getPpsNodeValue(child)));
- break;
- case NODE_TYPE_OF_SUBSCRIPTION:
- config.setSubscriptionType(getPpsNodeValue(child));
- break;
- case NODE_USAGE_LIMITS:
- parseUsageLimits(child, config);
- break;
- default:
- throw new ParsingException("Unknown node under SubscriptionParameter"
- + child.getName());
- }
- }
- }
-
- /**
- * Parse configurations under PerProviderSubscription/SubscriptionParameter/UsageLimits
- * subtree.
- *
- * @param node PPSNode representing the root of
- * PerProviderSubscription/SubscriptionParameter/UsageLimits subtree
- * @param config Instance of {@link PasspointConfiguration}
- * @throws ParsingException
- */
- private static void parseUsageLimits(PPSNode node, PasspointConfiguration config)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for UsageLimits");
- }
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_DATA_LIMIT:
- config.setUsageLimitDataLimit(parseLong(getPpsNodeValue(child), 10));
- break;
- case NODE_START_DATE:
- config.setUsageLimitStartTimeInMillis(parseDate(getPpsNodeValue(child)));
- break;
- case NODE_TIME_LIMIT:
- config.setUsageLimitTimeLimitInMinutes(parseLong(getPpsNodeValue(child), 10));
- break;
- case NODE_USAGE_TIME_PERIOD:
- config.setUsageLimitUsageTimePeriodInMinutes(
- parseLong(getPpsNodeValue(child), 10));
- break;
- default:
- throw new ParsingException("Unknown node under UsageLimits"
- + child.getName());
- }
- }
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Extension/Android/AAAServerTrustedNames
- * subtree.
- *
- * @param node PPSNode representing the root of the
- * PerProviderSubscription/Extension/Android/AAAServerTrustedNames subtree
- * @return String[] list of trusted name
- * @throws ParsingException
- */
- private static String[] parseAaaServerTrustedNames(PPSNode node) throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for AAAServerTrustedNames instance");
- }
- String fqdnListStr = null;
- String[] fqdnListArray = null;
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_FQDN:
- fqdnListStr = getPpsNodeValue(child);
- fqdnListArray = fqdnListStr.split(";");
- break;
- default:
- throw new ParsingException(
- "Unknown node under AAAServerTrustedNames instance: "
- + child.getName());
- }
- }
- if (fqdnListArray == null) {
- throw new ParsingException("AAAServerTrustedNames instance missing FQDN field");
- }
-
- return fqdnListArray;
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Extension/Android subtree.
- *
- * @param node PPSNode representing the root of PerProviderSubscription/Extension
- * subtree
- * @param config Instance of {@link PasspointConfiguration}
- * @throws ParsingException
- */
- private static void parseVendorAndroidExtension(PPSNode node, PasspointConfiguration config)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for AndroidExtension");
- }
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_AAA_SERVER_TRUSTED_NAMES:
- config.setAaaServerTrustedNames(parseAaaServerTrustedNames(child));
- break;
- default:
- // Don't raise an exception for unknown nodes to avoid breaking old release
- Log.w(TAG, "Unknown node under Android Extension: " + child.getName());
- }
- }
- }
-
- /**
- * Parse configurations under PerProviderSubscription/Extension subtree.
- *
- * @param node PPSNode representing the root of PerProviderSubscription/Extension
- * subtree
- * @param config Instance of {@link PasspointConfiguration}
- * @throws ParsingException
- */
- private static void parseExtension(PPSNode node, PasspointConfiguration config)
- throws ParsingException {
- if (node.isLeaf()) {
- throw new ParsingException("Leaf node not expected for Extension");
- }
- for (PPSNode child : node.getChildren()) {
- switch (child.getName()) {
- case NODE_VENDOR_ANDROID:
- parseVendorAndroidExtension(child, config);
- break;
- default:
- // Unknown nodes under Extension won't raise exception.
- // This allows adding new nodes in the future and
- // won't break older release.
- Log.w(TAG, "Unknown node under Extension: " + child.getName());
- }
- }
- }
-
- /**
- * Convert a hex string to a byte array.
- *
- * @param str String containing hex values
- * @return byte[]
- * @throws ParsingException
- */
- private static byte[] parseHexString(String str) throws ParsingException {
- if ((str.length() & 1) == 1) {
- throw new ParsingException("Odd length hex string: " + str + ", length: "
- + str.length());
- }
-
- byte[] result = new byte[str.length() / 2];
- for (int i = 0; i < result.length; i++) {
- int index = i * 2;
- try {
- result[i] = (byte) Integer.parseInt(str.substring(index, index + 2), 16);
- } catch (NumberFormatException e) {
- throw new ParsingException("Invalid hex string: " + str);
- }
- }
- return result;
- }
-
- /**
- * Convert a date string to the number of milliseconds since January 1, 1970, 00:00:00 GMT.
- *
- * @param dateStr String in the format of yyyy-MM-dd'T'HH:mm:ss'Z'
- * @return number of milliseconds
- * @throws ParsingException
- */
- private static long parseDate(String dateStr) throws ParsingException {
- try {
- DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
- return format.parse(dateStr).getTime();
- } catch (ParseException pe) {
- throw new ParsingException("Badly formatted time: " + dateStr);
- }
- }
-
- /**
- * Parse an integer string.
- *
- * @param value String of integer value
- * @return int
- * @throws ParsingException
- */
- private static int parseInteger(String value) throws ParsingException {
- try {
- return Integer.parseInt(value);
- } catch (NumberFormatException e) {
- throw new ParsingException("Invalid integer value: " + value);
- }
- }
-
- /**
- * Parse a string representing a long integer.
- *
- * @param value String of long integer value
- * @return long
- * @throws ParsingException
- */
- private static long parseLong(String value, int radix) throws ParsingException {
- try {
- return Long.parseLong(value, radix);
- } catch (NumberFormatException e) {
- throw new ParsingException("Invalid long integer value: " + value);
- }
- }
-
- /**
- * Convert a List<Long> to a primitive long array long[].
- *
- * @param list List to be converted
- * @return long[]
- */
- private static long[] convertFromLongList(List<Long> list) {
- Long[] objectArray = list.toArray(new Long[list.size()]);
- long[] primitiveArray = new long[objectArray.length];
- for (int i = 0; i < objectArray.length; i++) {
- primitiveArray[i] = objectArray[i].longValue();
- }
- return primitiveArray;
- }
-}
diff --git a/wifi/java/android/net/wifi/hotspot2/omadm/XMLNode.java b/wifi/java/android/net/wifi/hotspot2/omadm/XMLNode.java
deleted file mode 100644
index 959d505..0000000
--- a/wifi/java/android/net/wifi/hotspot2/omadm/XMLNode.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Copyright (c) 2016, 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.hotspot2.omadm;
-
-import android.text.TextUtils;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * A class represent a node in an XML tree. Each node is an XML element.
- * Used by {@link XMLParser} for parsing/converting each XML element to XMLNode.
- *
- * @hide
- */
-public class XMLNode {
- private final String mTag;
- private final List<XMLNode> mChildren;
- private final XMLNode mParent;
- private StringBuilder mTextBuilder;
- private String mText;
-
- public XMLNode(XMLNode parent, String tag) {
- mTag = tag;
- mParent = parent;
- mChildren = new ArrayList<>();
- mTextBuilder = new StringBuilder();
- mText = null;
- }
-
- /**
- * Adding a text to this node. Invoked by {@link XMLParser#characters}.
- *
- * @param text String to be added
- */
- public void addText(String text) {
- mTextBuilder.append(text);
- }
-
- /**
- * Adding a child node to this node. Invoked by {@link XMLParser#startElement}.
- *
- * @param child XMLNode to be added
- */
- public void addChild(XMLNode child) {
- mChildren.add(child);
- }
-
- /**
- * Invoked when the end of the XML element is detected. Used for further processing
- * of the text enclosed within this XML element. Invoked by {@link XMLParser#endElement}.
- */
- public void close() {
- // Remove the leading and the trailing whitespaces.
- mText = mTextBuilder.toString().trim();
- mTextBuilder = null;
- }
-
- public String getTag() {
- return mTag;
- }
-
- public XMLNode getParent() {
- return mParent;
- }
-
- public String getText() {
- return mText;
- }
-
- public List<XMLNode> getChildren() {
- return mChildren;
- }
-
- @Override
- public boolean equals(Object thatObject) {
- if (this == thatObject) {
- return true;
- }
- if (!(thatObject instanceof XMLNode)) {
- return false;
- }
- XMLNode that = (XMLNode) thatObject;
-
- return TextUtils.equals(mTag, that.mTag) &&
- TextUtils.equals(mText, that.mText) &&
- mChildren.equals(that.mChildren);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mTag, mText, mChildren);
- }
-}
diff --git a/wifi/java/android/net/wifi/hotspot2/omadm/XMLParser.java b/wifi/java/android/net/wifi/hotspot2/omadm/XMLParser.java
deleted file mode 100644
index 948052c..0000000
--- a/wifi/java/android/net/wifi/hotspot2/omadm/XMLParser.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2016 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.hotspot2.omadm;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import android.text.TextUtils;
-
-import java.io.IOException;
-import java.io.StringReader;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-/**
- * Class for parsing an XML string to an XML tree represented by {@link XMLNode}.
- *
- * The original XML string:
- * <root>
- * <tag1>text1</tag1>
- * <tag2>
- * <tag3>text3</tag3>
- * </tag2>
- * </root>
- *
- * The XML tree representation:
- * [root]
- * |
- * |
- * [tag1, text1]-----|-----[tag2]
- * |
- * |
- * [tag3, text3]
- *
- * @hide
- */
-public class XMLParser extends DefaultHandler {
- private XMLNode mRoot = null;
- private XMLNode mCurrent = null;
-
- public XMLNode parse(String text) throws IOException, SAXException {
- if (TextUtils.isEmpty(text)) {
- throw new IOException("XML string not provided");
- }
-
- // Reset pointers.
- mRoot = null;
- mCurrent = null;
-
- try {
- SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
- parser.parse(new InputSource(new StringReader(text)), this);
- return mRoot;
- } catch (ParserConfigurationException pce) {
- throw new SAXException(pce);
- }
- }
-
- @Override
- public void startElement(String uri, String localName, String qName, Attributes attributes)
- throws SAXException {
- XMLNode parent = mCurrent;
-
- mCurrent = new XMLNode(parent, qName);
-
- if (mRoot == null) {
- mRoot = mCurrent;
- } else if (parent == null) {
- throw new SAXException("More than one root nodes");
- } else {
- parent.addChild(mCurrent);
- }
- }
-
- @Override
- public void endElement(String uri, String localName, String qName) throws SAXException {
- if (!qName.equals(mCurrent.getTag())) {
- throw new SAXException("End tag '" + qName + "' doesn't match current node: " +
- mCurrent);
- }
-
- mCurrent.close();
- mCurrent = mCurrent.getParent();
- }
-
- @Override
- public void characters(char[] ch, int start, int length) throws SAXException {
- mCurrent.addText(new String(ch, start, length));
- }
-}
diff --git a/wifi/java/android/net/wifi/hotspot2/pps/Credential.java b/wifi/java/android/net/wifi/hotspot2/pps/Credential.java
deleted file mode 100644
index 282757a..0000000
--- a/wifi/java/android/net/wifi/hotspot2/pps/Credential.java
+++ /dev/null
@@ -1,1313 +0,0 @@
-/**
- * Copyright (c) 2016, 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.hotspot2.pps;
-
-import android.net.wifi.EAPConstants;
-import android.net.wifi.ParcelUtil;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.text.TextUtils;
-import android.util.Log;
-
-import java.nio.charset.StandardCharsets;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.cert.CertificateEncodingException;
-import java.security.cert.X509Certificate;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Objects;
-import java.util.Set;
-
-/**
- * Class representing Credential subtree in the PerProviderSubscription (PPS)
- * Management Object (MO) tree.
- * For more info, refer to Hotspot 2.0 PPS MO defined in section 9.1 of the Hotspot 2.0
- * Release 2 Technical Specification.
- *
- * In addition to the fields in the Credential subtree, this will also maintain necessary
- * information for the private key and certificates associated with this credential.
- */
-public final class Credential implements Parcelable {
- private static final String TAG = "Credential";
-
- /**
- * Max string length for realm. Refer to Credential/Realm node in Hotspot 2.0 Release 2
- * Technical Specification Section 9.1 for more info.
- */
- private static final int MAX_REALM_BYTES = 253;
-
- /**
- * The time this credential is created. It is in the format of number
- * of milliseconds since January 1, 1970, 00:00:00 GMT.
- * Using Long.MIN_VALUE to indicate unset value.
- */
- private long mCreationTimeInMillis = Long.MIN_VALUE;
- /**
- * @hide
- */
- public void setCreationTimeInMillis(long creationTimeInMillis) {
- mCreationTimeInMillis = creationTimeInMillis;
- }
- /**
- * @hide
- */
- public long getCreationTimeInMillis() {
- return mCreationTimeInMillis;
- }
-
- /**
- * The time this credential will expire. It is in the format of number
- * of milliseconds since January 1, 1970, 00:00:00 GMT.
- * Using Long.MIN_VALUE to indicate unset value.
- */
- private long mExpirationTimeInMillis = Long.MIN_VALUE;
- /**
- * @hide
- */
- public void setExpirationTimeInMillis(long expirationTimeInMillis) {
- mExpirationTimeInMillis = expirationTimeInMillis;
- }
- /**
- * @hide
- */
- public long getExpirationTimeInMillis() {
- return mExpirationTimeInMillis;
- }
-
- /**
- * The realm associated with this credential. It will be used to determine
- * if this credential can be used to authenticate with a given hotspot by
- * comparing the realm specified in that hotspot's ANQP element.
- */
- private String mRealm = null;
- /**
- * Set the realm associated with this credential.
- *
- * @param realm The realm to set to
- */
- public void setRealm(String realm) {
- mRealm = realm;
- }
- /**
- * Get the realm associated with this credential.
- *
- * @return the realm associated with this credential
- */
- public String getRealm() {
- return mRealm;
- }
-
- /**
- * When set to true, the device should check AAA (Authentication, Authorization,
- * and Accounting) server's certificate during EAP (Extensible Authentication
- * Protocol) authentication.
- */
- private boolean mCheckAaaServerCertStatus = false;
- /**
- * @hide
- */
- public void setCheckAaaServerCertStatus(boolean checkAaaServerCertStatus) {
- mCheckAaaServerCertStatus = checkAaaServerCertStatus;
- }
- /**
- * @hide
- */
- public boolean getCheckAaaServerCertStatus() {
- return mCheckAaaServerCertStatus;
- }
-
- /**
- * Username-password based credential.
- * Contains the fields under PerProviderSubscription/Credential/UsernamePassword subtree.
- */
- public static final class UserCredential implements Parcelable {
- /**
- * Maximum string length for username. Refer to Credential/UsernamePassword/Username
- * node in Hotspot 2.0 Release 2 Technical Specification Section 9.1 for more info.
- */
- private static final int MAX_USERNAME_BYTES = 63;
-
- /**
- * Maximum string length for password. Refer to Credential/UsernamePassword/Password
- * in Hotspot 2.0 Release 2 Technical Specification Section 9.1 for more info.
- */
- private static final int MAX_PASSWORD_BYTES = 255;
-
- /**
- * Supported authentication methods.
- * @hide
- */
- public static final String AUTH_METHOD_PAP = "PAP";
- /** @hide */
- public static final String AUTH_METHOD_MSCHAP = "MS-CHAP";
- /** @hide */
- public static final String AUTH_METHOD_MSCHAPV2 = "MS-CHAP-V2";
-
- /**
- * Supported Non-EAP inner methods. Refer to
- * Credential/UsernamePassword/EAPMethod/InnerEAPType in Hotspot 2.0 Release 2 Technical
- * Specification Section 9.1 for more info.
- */
- private static final Set<String> SUPPORTED_AUTH = new HashSet<String>(
- Arrays.asList(AUTH_METHOD_PAP, AUTH_METHOD_MSCHAP, AUTH_METHOD_MSCHAPV2));
-
- /**
- * Username of the credential.
- */
- private String mUsername = null;
- /**
- * Set the username associated with this user credential.
- *
- * @param username The username to set to
- */
- public void setUsername(String username) {
- mUsername = username;
- }
- /**
- * Get the username associated with this user credential.
- *
- * @return the username associated with this user credential
- */
- public String getUsername() {
- return mUsername;
- }
-
- /**
- * Base64-encoded password.
- */
- private String mPassword = null;
- /**
- * Set the Base64-encoded password associated with this user credential.
- *
- * @param password The password to set to
- */
- public void setPassword(String password) {
- mPassword = password;
- }
- /**
- * Get the Base64-encoded password associated with this user credential.
- *
- * @return the Base64-encoded password associated with this user credential
- */
- public String getPassword() {
- return mPassword;
- }
-
- /**
- * Flag indicating if the password is machine managed.
- */
- private boolean mMachineManaged = false;
- /**
- * @hide
- */
- public void setMachineManaged(boolean machineManaged) {
- mMachineManaged = machineManaged;
- }
- /**
- * @hide
- */
- public boolean getMachineManaged() {
- return mMachineManaged;
- }
-
- /**
- * The name of the application used to generate the password.
- */
- private String mSoftTokenApp = null;
- /**
- * @hide
- */
- public void setSoftTokenApp(String softTokenApp) {
- mSoftTokenApp = softTokenApp;
- }
- /**
- * @hide
- */
- public String getSoftTokenApp() {
- return mSoftTokenApp;
- }
-
- /**
- * Flag indicating if this credential is usable on other mobile devices as well.
- */
- private boolean mAbleToShare = false;
- /**
- * @hide
- */
- public void setAbleToShare(boolean ableToShare) {
- mAbleToShare = ableToShare;
- }
- /**
- * @hide
- */
- public boolean getAbleToShare() {
- return mAbleToShare;
- }
-
- /**
- * EAP (Extensible Authentication Protocol) method type.
- * Refer to
- * <a href="http://www.iana.org/assignments/eap-numbers/eap-numbers.xml#eap-numbers-4">
- * EAP Numbers</a> for valid values.
- * Using Integer.MIN_VALUE to indicate unset value.
- */
- private int mEapType = Integer.MIN_VALUE;
- /**
- * Set the EAP (Extensible Authentication Protocol) method type associated with this
- * user credential.
- * Refer to
- * <a href="http://www.iana.org/assignments/eap-numbers/eap-numbers.xml#eap-numbers-4">
- * EAP Numbers</a> for valid values.
- *
- * @param eapType The EAP method type associated with this user credential
- */
- public void setEapType(int eapType) {
- mEapType = eapType;
- }
- /**
- * Get the EAP (Extensible Authentication Protocol) method type associated with this
- * user credential.
- *
- * @return EAP method type
- */
- public int getEapType() {
- return mEapType;
- }
-
- /**
- * Non-EAP inner authentication method.
- */
- private String mNonEapInnerMethod = null;
- /**
- * Set the inner non-EAP method associated with this user credential.
- *
- * @param nonEapInnerMethod The non-EAP inner method to set to
- */
- public void setNonEapInnerMethod(String nonEapInnerMethod) {
- mNonEapInnerMethod = nonEapInnerMethod;
- }
- /**
- * Get the inner non-EAP method associated with this user credential.
- *
- * @return Non-EAP inner method associated with this user credential
- */
- public String getNonEapInnerMethod() {
- return mNonEapInnerMethod;
- }
-
- /**
- * Constructor for creating UserCredential with default values.
- */
- public UserCredential() {}
-
- /**
- * Copy constructor.
- *
- * @param source The source to copy from
- */
- public UserCredential(UserCredential source) {
- if (source != null) {
- mUsername = source.mUsername;
- mPassword = source.mPassword;
- mMachineManaged = source.mMachineManaged;
- mSoftTokenApp = source.mSoftTokenApp;
- mAbleToShare = source.mAbleToShare;
- mEapType = source.mEapType;
- mNonEapInnerMethod = source.mNonEapInnerMethod;
- }
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(mUsername);
- dest.writeString(mPassword);
- dest.writeInt(mMachineManaged ? 1 : 0);
- dest.writeString(mSoftTokenApp);
- dest.writeInt(mAbleToShare ? 1 : 0);
- dest.writeInt(mEapType);
- dest.writeString(mNonEapInnerMethod);
- }
-
- @Override
- public boolean equals(Object thatObject) {
- if (this == thatObject) {
- return true;
- }
- if (!(thatObject instanceof UserCredential)) {
- return false;
- }
-
- UserCredential that = (UserCredential) thatObject;
- return TextUtils.equals(mUsername, that.mUsername)
- && TextUtils.equals(mPassword, that.mPassword)
- && mMachineManaged == that.mMachineManaged
- && TextUtils.equals(mSoftTokenApp, that.mSoftTokenApp)
- && mAbleToShare == that.mAbleToShare
- && mEapType == that.mEapType
- && TextUtils.equals(mNonEapInnerMethod, that.mNonEapInnerMethod);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mUsername, mPassword, mMachineManaged, mSoftTokenApp,
- mAbleToShare, mEapType, mNonEapInnerMethod);
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("Username: ").append(mUsername).append("\n");
- builder.append("MachineManaged: ").append(mMachineManaged).append("\n");
- builder.append("SoftTokenApp: ").append(mSoftTokenApp).append("\n");
- builder.append("AbleToShare: ").append(mAbleToShare).append("\n");
- builder.append("EAPType: ").append(mEapType).append("\n");
- builder.append("AuthMethod: ").append(mNonEapInnerMethod).append("\n");
- return builder.toString();
- }
-
- /**
- * Validate the configuration data.
- *
- * @return true on success or false on failure
- * @hide
- */
- public boolean validate() {
- if (TextUtils.isEmpty(mUsername)) {
- Log.d(TAG, "Missing username");
- return false;
- }
- if (mUsername.getBytes(StandardCharsets.UTF_8).length > MAX_USERNAME_BYTES) {
- Log.d(TAG, "username exceeding maximum length: "
- + mUsername.getBytes(StandardCharsets.UTF_8).length);
- return false;
- }
-
- if (TextUtils.isEmpty(mPassword)) {
- Log.d(TAG, "Missing password");
- return false;
- }
- if (mPassword.getBytes(StandardCharsets.UTF_8).length > MAX_PASSWORD_BYTES) {
- Log.d(TAG, "password exceeding maximum length: "
- + mPassword.getBytes(StandardCharsets.UTF_8).length);
- return false;
- }
-
- // Only supports EAP-TTLS for user credential.
- if (mEapType != EAPConstants.EAP_TTLS) {
- Log.d(TAG, "Invalid EAP Type for user credential: " + mEapType);
- return false;
- }
-
- // Verify Non-EAP inner method for EAP-TTLS.
- if (!SUPPORTED_AUTH.contains(mNonEapInnerMethod)) {
- Log.d(TAG, "Invalid non-EAP inner method for EAP-TTLS: " + mNonEapInnerMethod);
- return false;
- }
- return true;
- }
-
- public static final @android.annotation.NonNull Creator<UserCredential> CREATOR =
- new Creator<UserCredential>() {
- @Override
- public UserCredential createFromParcel(Parcel in) {
- UserCredential userCredential = new UserCredential();
- userCredential.setUsername(in.readString());
- userCredential.setPassword(in.readString());
- userCredential.setMachineManaged(in.readInt() != 0);
- userCredential.setSoftTokenApp(in.readString());
- userCredential.setAbleToShare(in.readInt() != 0);
- userCredential.setEapType(in.readInt());
- userCredential.setNonEapInnerMethod(in.readString());
- return userCredential;
- }
-
- @Override
- public UserCredential[] newArray(int size) {
- return new UserCredential[size];
- }
- };
-
- /**
- * Get a unique identifier for UserCredential.
- *
- * @hide
- * @return a Unique identifier for a UserCredential object
- */
- public int getUniqueId() {
- return Objects.hash(mUsername);
- }
- }
- private UserCredential mUserCredential = null;
- /**
- * Set the user credential information.
- *
- * @param userCredential The user credential to set to
- */
- public void setUserCredential(UserCredential userCredential) {
- mUserCredential = userCredential;
- }
- /**
- * Get the user credential information.
- *
- * @return user credential information
- */
- public UserCredential getUserCredential() {
- return mUserCredential;
- }
-
- /**
- * Certificate based credential. This is used for EAP-TLS.
- * Contains fields under PerProviderSubscription/Credential/DigitalCertificate subtree.
- */
- public static final class CertificateCredential implements Parcelable {
- /**
- * Supported certificate types.
- * @hide
- */
- public static final String CERT_TYPE_X509V3 = "x509v3";
-
- /**
- * Certificate SHA-256 fingerprint length.
- */
- private static final int CERT_SHA256_FINGER_PRINT_LENGTH = 32;
-
- /**
- * Certificate type.
- */
- private String mCertType = null;
- /**
- * Set the certificate type associated with this certificate credential.
- *
- * @param certType The certificate type to set to
- */
- public void setCertType(String certType) {
- mCertType = certType;
- }
- /**
- * Get the certificate type associated with this certificate credential.
- *
- * @return certificate type
- */
- public String getCertType() {
- return mCertType;
- }
-
- /**
- * The SHA-256 fingerprint of the certificate.
- */
- private byte[] mCertSha256Fingerprint = null;
- /**
- * Set the certificate SHA-256 fingerprint associated with this certificate credential.
- *
- * @param certSha256Fingerprint The certificate fingerprint to set to
- */
- public void setCertSha256Fingerprint(byte[] certSha256Fingerprint) {
- mCertSha256Fingerprint = certSha256Fingerprint;
- }
- /**
- * Get the certificate SHA-256 fingerprint associated with this certificate credential.
- *
- * @return certificate SHA-256 fingerprint
- */
- public byte[] getCertSha256Fingerprint() {
- return mCertSha256Fingerprint;
- }
-
- /**
- * Constructor for creating CertificateCredential with default values.
- */
- public CertificateCredential() {}
-
- /**
- * Copy constructor.
- *
- * @param source The source to copy from
- */
- public CertificateCredential(CertificateCredential source) {
- if (source != null) {
- mCertType = source.mCertType;
- if (source.mCertSha256Fingerprint != null) {
- mCertSha256Fingerprint = Arrays.copyOf(source.mCertSha256Fingerprint,
- source.mCertSha256Fingerprint.length);
- }
- }
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(mCertType);
- dest.writeByteArray(mCertSha256Fingerprint);
- }
-
- @Override
- public boolean equals(Object thatObject) {
- if (this == thatObject) {
- return true;
- }
- if (!(thatObject instanceof CertificateCredential)) {
- return false;
- }
-
- CertificateCredential that = (CertificateCredential) thatObject;
- return TextUtils.equals(mCertType, that.mCertType)
- && Arrays.equals(mCertSha256Fingerprint, that.mCertSha256Fingerprint);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mCertType, Arrays.hashCode(mCertSha256Fingerprint));
- }
-
- @Override
- public String toString() {
- return "CertificateType: " + mCertType + "\n";
- }
-
- /**
- * Validate the configuration data.
- *
- * @return true on success or false on failure
- * @hide
- */
- public boolean validate() {
- if (!TextUtils.equals(CERT_TYPE_X509V3, mCertType)) {
- Log.d(TAG, "Unsupported certificate type: " + mCertType);
- return false;
- }
- if (mCertSha256Fingerprint == null
- || mCertSha256Fingerprint.length != CERT_SHA256_FINGER_PRINT_LENGTH) {
- Log.d(TAG, "Invalid SHA-256 fingerprint");
- return false;
- }
- return true;
- }
-
- public static final @android.annotation.NonNull Creator<CertificateCredential> CREATOR =
- new Creator<CertificateCredential>() {
- @Override
- public CertificateCredential createFromParcel(Parcel in) {
- CertificateCredential certCredential = new CertificateCredential();
- certCredential.setCertType(in.readString());
- certCredential.setCertSha256Fingerprint(in.createByteArray());
- return certCredential;
- }
-
- @Override
- public CertificateCredential[] newArray(int size) {
- return new CertificateCredential[size];
- }
- };
- }
- private CertificateCredential mCertCredential = null;
- /**
- * Set the certificate credential information.
- *
- * @param certCredential The certificate credential to set to
- */
- public void setCertCredential(CertificateCredential certCredential) {
- mCertCredential = certCredential;
- }
- /**
- * Get the certificate credential information.
- *
- * @return certificate credential information
- */
- public CertificateCredential getCertCredential() {
- return mCertCredential;
- }
-
- /**
- * SIM (Subscriber Identify Module) based credential.
- * Contains fields under PerProviderSubscription/Credential/SIM subtree.
- */
- public static final class SimCredential implements Parcelable {
- /**
- * Maximum string length for IMSI.
- */
- private static final int MAX_IMSI_LENGTH = 15;
-
- /**
- * International Mobile Subscriber Identity, is used to identify the user
- * of a cellular network and is a unique identification associated with all
- * cellular networks
- */
- private String mImsi = null;
- /**
- * Set the IMSI (International Mobile Subscriber Identity) associated with this SIM
- * credential.
- *
- * @param imsi The IMSI to set to
- */
- public void setImsi(String imsi) {
- mImsi = imsi;
- }
- /**
- * Get the IMSI (International Mobile Subscriber Identity) associated with this SIM
- * credential.
- *
- * @return IMSI associated with this SIM credential
- */
- public String getImsi() {
- return mImsi;
- }
-
- /**
- * EAP (Extensible Authentication Protocol) method type for using SIM credential.
- * Refer to http://www.iana.org/assignments/eap-numbers/eap-numbers.xml#eap-numbers-4
- * for valid values.
- * Using Integer.MIN_VALUE to indicate unset value.
- */
- private int mEapType = Integer.MIN_VALUE;
- /**
- * Set the EAP (Extensible Authentication Protocol) method type associated with this
- * SIM credential.
- *
- * @param eapType The EAP method type to set to
- */
- public void setEapType(int eapType) {
- mEapType = eapType;
- }
- /**
- * Get the EAP (Extensible Authentication Protocol) method type associated with this
- * SIM credential.
- *
- * @return EAP method type associated with this SIM credential
- */
- public int getEapType() {
- return mEapType;
- }
-
- /**
- * Constructor for creating SimCredential with default values.
- */
- public SimCredential() {}
-
- /**
- * Copy constructor
- *
- * @param source The source to copy from
- */
- public SimCredential(SimCredential source) {
- if (source != null) {
- mImsi = source.mImsi;
- mEapType = source.mEapType;
- }
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public boolean equals(Object thatObject) {
- if (this == thatObject) {
- return true;
- }
- if (!(thatObject instanceof SimCredential)) {
- return false;
- }
-
- SimCredential that = (SimCredential) thatObject;
- return TextUtils.equals(mImsi, that.mImsi)
- && mEapType == that.mEapType;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mImsi, mEapType);
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- String imsi;
- if (mImsi != null) {
- if (mImsi.length() > 6 && mImsi.charAt(6) != '*') {
- // Truncate the full IMSI from the log
- imsi = mImsi.substring(0, 6) + "****";
- } else {
- imsi = mImsi;
- }
- builder.append("IMSI: ").append(imsi).append("\n");
- }
- builder.append("EAPType: ").append(mEapType).append("\n");
- return builder.toString();
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(mImsi);
- dest.writeInt(mEapType);
- }
-
- /**
- * Validate the configuration data.
- *
- * @return true on success or false on failure
- * @hide
- */
- public boolean validate() {
- // Note: this only validate the format of IMSI string itself. Additional verification
- // will be done by WifiService at the time of provisioning to verify against the IMSI
- // of the SIM card installed in the device.
- if (!verifyImsi()) {
- return false;
- }
- if (mEapType != EAPConstants.EAP_SIM && mEapType != EAPConstants.EAP_AKA
- && mEapType != EAPConstants.EAP_AKA_PRIME) {
- Log.d(TAG, "Invalid EAP Type for SIM credential: " + mEapType);
- return false;
- }
- return true;
- }
-
- public static final @android.annotation.NonNull Creator<SimCredential> CREATOR =
- new Creator<SimCredential>() {
- @Override
- public SimCredential createFromParcel(Parcel in) {
- SimCredential simCredential = new SimCredential();
- simCredential.setImsi(in.readString());
- simCredential.setEapType(in.readInt());
- return simCredential;
- }
-
- @Override
- public SimCredential[] newArray(int size) {
- return new SimCredential[size];
- }
- };
-
- /**
- * Verify the IMSI (International Mobile Subscriber Identity) string. The string
- * should contain zero or more numeric digits, and might ends with a "*" for prefix
- * matching.
- *
- * @return true if IMSI is valid, false otherwise.
- */
- private boolean verifyImsi() {
- if (TextUtils.isEmpty(mImsi)) {
- Log.d(TAG, "Missing IMSI");
- return false;
- }
- if (mImsi.length() > MAX_IMSI_LENGTH) {
- Log.d(TAG, "IMSI exceeding maximum length: " + mImsi.length());
- return false;
- }
-
- // Locate the first non-digit character.
- int nonDigit;
- char stopChar = '\0';
- for (nonDigit = 0; nonDigit < mImsi.length(); nonDigit++) {
- stopChar = mImsi.charAt(nonDigit);
- if (stopChar < '0' || stopChar > '9') {
- break;
- }
- }
-
- if (nonDigit == mImsi.length()) {
- return true;
- }
- else if (nonDigit == mImsi.length()-1 && stopChar == '*') {
- // Prefix matching.
- return true;
- }
- return false;
- }
- }
- private SimCredential mSimCredential = null;
- /**
- * Set the SIM credential information.
- *
- * @param simCredential The SIM credential to set to
- */
- public void setSimCredential(SimCredential simCredential) {
- mSimCredential = simCredential;
- }
- /**
- * Get the SIM credential information.
- *
- * @return SIM credential information
- */
- public SimCredential getSimCredential() {
- return mSimCredential;
- }
-
- /**
- * CA (Certificate Authority) X509 certificates.
- */
- private X509Certificate[] mCaCertificates = null;
-
- /**
- * Set the CA (Certification Authority) certificate associated with this credential.
- *
- * @param caCertificate The CA certificate to set to
- */
- public void setCaCertificate(X509Certificate caCertificate) {
- mCaCertificates = null;
- if (caCertificate != null) {
- mCaCertificates = new X509Certificate[] {caCertificate};
- }
- }
-
- /**
- * Set the CA (Certification Authority) certificates associated with this credential.
- *
- * @param caCertificates The list of CA certificates to set to
- * @hide
- */
- public void setCaCertificates(X509Certificate[] caCertificates) {
- mCaCertificates = caCertificates;
- }
-
- /**
- * Get the CA (Certification Authority) certificate associated with this credential.
- *
- * @return CA certificate associated with this credential, {@code null} if certificate is not
- * set or certificate is more than one.
- */
- public X509Certificate getCaCertificate() {
- return mCaCertificates == null || mCaCertificates.length > 1 ? null : mCaCertificates[0];
- }
-
- /**
- * Get the CA (Certification Authority) certificates associated with this credential.
- *
- * @return The list of CA certificates associated with this credential
- * @hide
- */
- public X509Certificate[] getCaCertificates() {
- return mCaCertificates;
- }
-
- /**
- * Client side X509 certificate chain.
- */
- private X509Certificate[] mClientCertificateChain = null;
- /**
- * Set the client certificate chain associated with this credential.
- *
- * @param certificateChain The client certificate chain to set to
- */
- public void setClientCertificateChain(X509Certificate[] certificateChain) {
- mClientCertificateChain = certificateChain;
- }
- /**
- * Get the client certificate chain associated with this credential.
- *
- * @return client certificate chain associated with this credential
- */
- public X509Certificate[] getClientCertificateChain() {
- return mClientCertificateChain;
- }
-
- /**
- * Client side private key.
- */
- private PrivateKey mClientPrivateKey = null;
- /**
- * Set the client private key associated with this credential.
- *
- * @param clientPrivateKey the client private key to set to
- */
- public void setClientPrivateKey(PrivateKey clientPrivateKey) {
- mClientPrivateKey = clientPrivateKey;
- }
- /**
- * Get the client private key associated with this credential.
- *
- * @return client private key associated with this credential.
- */
- public PrivateKey getClientPrivateKey() {
- return mClientPrivateKey;
- }
-
- /**
- * Constructor for creating Credential with default values.
- */
- public Credential() {}
-
- /**
- * Copy constructor.
- *
- * @param source The source to copy from
- */
- public Credential(Credential source) {
- if (source != null) {
- mCreationTimeInMillis = source.mCreationTimeInMillis;
- mExpirationTimeInMillis = source.mExpirationTimeInMillis;
- mRealm = source.mRealm;
- mCheckAaaServerCertStatus = source.mCheckAaaServerCertStatus;
- if (source.mUserCredential != null) {
- mUserCredential = new UserCredential(source.mUserCredential);
- }
- if (source.mCertCredential != null) {
- mCertCredential = new CertificateCredential(source.mCertCredential);
- }
- if (source.mSimCredential != null) {
- mSimCredential = new SimCredential(source.mSimCredential);
- }
- if (source.mClientCertificateChain != null) {
- mClientCertificateChain = Arrays.copyOf(source.mClientCertificateChain,
- source.mClientCertificateChain.length);
- }
- if (source.mCaCertificates != null) {
- mCaCertificates = Arrays.copyOf(source.mCaCertificates,
- source.mCaCertificates.length);
- }
-
- mClientPrivateKey = source.mClientPrivateKey;
- }
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeLong(mCreationTimeInMillis);
- dest.writeLong(mExpirationTimeInMillis);
- dest.writeString(mRealm);
- dest.writeInt(mCheckAaaServerCertStatus ? 1 : 0);
- dest.writeParcelable(mUserCredential, flags);
- dest.writeParcelable(mCertCredential, flags);
- dest.writeParcelable(mSimCredential, flags);
- ParcelUtil.writeCertificates(dest, mCaCertificates);
- ParcelUtil.writeCertificates(dest, mClientCertificateChain);
- ParcelUtil.writePrivateKey(dest, mClientPrivateKey);
- }
-
- @Override
- public boolean equals(Object thatObject) {
- if (this == thatObject) {
- return true;
- }
- if (!(thatObject instanceof Credential)) {
- return false;
- }
-
- Credential that = (Credential) thatObject;
- return TextUtils.equals(mRealm, that.mRealm)
- && mCreationTimeInMillis == that.mCreationTimeInMillis
- && mExpirationTimeInMillis == that.mExpirationTimeInMillis
- && mCheckAaaServerCertStatus == that.mCheckAaaServerCertStatus
- && (mUserCredential == null ? that.mUserCredential == null
- : mUserCredential.equals(that.mUserCredential))
- && (mCertCredential == null ? that.mCertCredential == null
- : mCertCredential.equals(that.mCertCredential))
- && (mSimCredential == null ? that.mSimCredential == null
- : mSimCredential.equals(that.mSimCredential))
- && isX509CertificatesEquals(mCaCertificates, that.mCaCertificates)
- && isX509CertificatesEquals(mClientCertificateChain, that.mClientCertificateChain)
- && isPrivateKeyEquals(mClientPrivateKey, that.mClientPrivateKey);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mCreationTimeInMillis, mExpirationTimeInMillis, mRealm,
- mCheckAaaServerCertStatus, mUserCredential, mCertCredential, mSimCredential,
- mClientPrivateKey, Arrays.hashCode(mCaCertificates),
- Arrays.hashCode(mClientCertificateChain));
- }
-
- /**
- * Get a unique identifier for Credential. This identifier depends only on items that remain
- * constant throughout the lifetime of a subscription's credentials.
- *
- * @hide
- * @return a Unique identifier for a Credential object
- */
- public int getUniqueId() {
- return Objects.hash(mUserCredential != null ? mUserCredential.getUniqueId() : 0,
- mCertCredential, mSimCredential, mRealm);
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("Realm: ").append(mRealm).append("\n");
- builder.append("CreationTime: ").append(mCreationTimeInMillis != Long.MIN_VALUE
- ? new Date(mCreationTimeInMillis) : "Not specified").append("\n");
- builder.append("ExpirationTime: ").append(mExpirationTimeInMillis != Long.MIN_VALUE
- ? new Date(mExpirationTimeInMillis) : "Not specified").append("\n");
- builder.append("CheckAAAServerStatus: ").append(mCheckAaaServerCertStatus).append("\n");
- if (mUserCredential != null) {
- builder.append("UserCredential Begin ---\n");
- builder.append(mUserCredential);
- builder.append("UserCredential End ---\n");
- }
- if (mCertCredential != null) {
- builder.append("CertificateCredential Begin ---\n");
- builder.append(mCertCredential);
- builder.append("CertificateCredential End ---\n");
- }
- if (mSimCredential != null) {
- builder.append("SIMCredential Begin ---\n");
- builder.append(mSimCredential);
- builder.append("SIMCredential End ---\n");
- }
- return builder.toString();
- }
-
- /**
- * Validate the configuration data.
- *
- * @return true on success or false on failure
- * @hide
- */
- public boolean validate() {
- if (TextUtils.isEmpty(mRealm)) {
- Log.d(TAG, "Missing realm");
- return false;
- }
- if (mRealm.getBytes(StandardCharsets.UTF_8).length > MAX_REALM_BYTES) {
- Log.d(TAG, "realm exceeding maximum length: "
- + mRealm.getBytes(StandardCharsets.UTF_8).length);
- return false;
- }
-
- // Verify the credential.
- if (mUserCredential != null) {
- if (!verifyUserCredential()) {
- return false;
- }
- } else if (mCertCredential != null) {
- if (!verifyCertCredential()) {
- return false;
- }
- } else if (mSimCredential != null) {
- if (!verifySimCredential()) {
- return false;
- }
- } else {
- Log.d(TAG, "Missing required credential");
- return false;
- }
-
- return true;
- }
-
- public static final @android.annotation.NonNull Creator<Credential> CREATOR =
- new Creator<Credential>() {
- @Override
- public Credential createFromParcel(Parcel in) {
- Credential credential = new Credential();
- credential.setCreationTimeInMillis(in.readLong());
- credential.setExpirationTimeInMillis(in.readLong());
- credential.setRealm(in.readString());
- credential.setCheckAaaServerCertStatus(in.readInt() != 0);
- credential.setUserCredential(in.readParcelable(null));
- credential.setCertCredential(in.readParcelable(null));
- credential.setSimCredential(in.readParcelable(null));
- credential.setCaCertificates(ParcelUtil.readCertificates(in));
- credential.setClientCertificateChain(ParcelUtil.readCertificates(in));
- credential.setClientPrivateKey(ParcelUtil.readPrivateKey(in));
- return credential;
- }
-
- @Override
- public Credential[] newArray(int size) {
- return new Credential[size];
- }
- };
-
- /**
- * Verify user credential.
- * If no CA certificate is provided, then the system uses the CAs in the trust store.
- *
- * @return true if user credential is valid, false otherwise.
- */
- private boolean verifyUserCredential() {
- if (mUserCredential == null) {
- Log.d(TAG, "Missing user credential");
- return false;
- }
- if (mCertCredential != null || mSimCredential != null) {
- Log.d(TAG, "Contained more than one type of credential");
- return false;
- }
- if (!mUserCredential.validate()) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Verify certificate credential, which is used for EAP-TLS. This will verify
- * that the necessary client key and certificates are provided.
- * If no CA certificate is provided, then the system uses the CAs in the trust store.
- *
- * @return true if certificate credential is valid, false otherwise.
- */
- private boolean verifyCertCredential() {
- if (mCertCredential == null) {
- Log.d(TAG, "Missing certificate credential");
- return false;
- }
- if (mUserCredential != null || mSimCredential != null) {
- Log.d(TAG, "Contained more than one type of credential");
- return false;
- }
-
- if (!mCertCredential.validate()) {
- return false;
- }
-
- if (mClientPrivateKey == null) {
- Log.d(TAG, "Missing client private key for certificate credential");
- return false;
- }
- try {
- // Verify SHA-256 fingerprint for client certificate.
- if (!verifySha256Fingerprint(mClientCertificateChain,
- mCertCredential.getCertSha256Fingerprint())) {
- Log.d(TAG, "SHA-256 fingerprint mismatch");
- return false;
- }
- } catch (NoSuchAlgorithmException | CertificateEncodingException e) {
- Log.d(TAG, "Failed to verify SHA-256 fingerprint: " + e.getMessage());
- return false;
- }
-
- return true;
- }
-
- /**
- * Verify SIM credential.
- *
- * @return true if SIM credential is valid, false otherwise.
- */
- private boolean verifySimCredential() {
- if (mSimCredential == null) {
- Log.d(TAG, "Missing SIM credential");
- return false;
- }
- if (mUserCredential != null || mCertCredential != null) {
- Log.d(TAG, "Contained more than one type of credential");
- return false;
- }
- return mSimCredential.validate();
- }
-
- private static boolean isPrivateKeyEquals(PrivateKey key1, PrivateKey key2) {
- if (key1 == null && key2 == null) {
- return true;
- }
-
- /* Return false if only one of them is null */
- if (key1 == null || key2 == null) {
- return false;
- }
-
- return TextUtils.equals(key1.getAlgorithm(), key2.getAlgorithm()) &&
- Arrays.equals(key1.getEncoded(), key2.getEncoded());
- }
-
- /**
- * Verify two X.509 certificates are identical.
- *
- * @param cert1 a certificate to compare
- * @param cert2 a certificate to compare
- * @return {@code true} if given certificates are the same each other, {@code false} otherwise.
- * @hide
- */
- public static boolean isX509CertificateEquals(X509Certificate cert1, X509Certificate cert2) {
- if (cert1 == null && cert2 == null) {
- return true;
- }
-
- /* Return false if only one of them is null */
- if (cert1 == null || cert2 == null) {
- return false;
- }
-
- boolean result = false;
- try {
- result = Arrays.equals(cert1.getEncoded(), cert2.getEncoded());
- } catch (CertificateEncodingException e) {
- /* empty, return false. */
- }
- return result;
- }
-
- private static boolean isX509CertificatesEquals(X509Certificate[] certs1,
- X509Certificate[] certs2) {
- if (certs1 == null && certs2 == null) {
- return true;
- }
-
- /* Return false if only one of them is null */
- if (certs1 == null || certs2 == null) {
- return false;
- }
-
- if (certs1.length != certs2.length) {
- return false;
- }
-
- for (int i = 0; i < certs1.length; i++) {
- if (!isX509CertificateEquals(certs1[i], certs2[i])) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Verify that the digest for a certificate in the certificate chain matches expected
- * fingerprint. The certificate that matches the fingerprint is the client certificate.
- *
- * @param certChain Chain of certificates
- * @param expectedFingerprint The expected SHA-256 digest of the client certificate
- * @return true if the certificate chain contains a matching certificate, false otherwise
- * @throws NoSuchAlgorithmException
- * @throws CertificateEncodingException
- */
- private static boolean verifySha256Fingerprint(X509Certificate[] certChain,
- byte[] expectedFingerprint)
- throws NoSuchAlgorithmException, CertificateEncodingException {
- if (certChain == null) {
- return false;
- }
- MessageDigest digester = MessageDigest.getInstance("SHA-256");
- for (X509Certificate certificate : certChain) {
- digester.reset();
- byte[] fingerprint = digester.digest(certificate.getEncoded());
- if (Arrays.equals(expectedFingerprint, fingerprint)) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/wifi/java/android/net/wifi/hotspot2/pps/HomeSp.java b/wifi/java/android/net/wifi/hotspot2/pps/HomeSp.java
deleted file mode 100644
index 64aad61..0000000
--- a/wifi/java/android/net/wifi/hotspot2/pps/HomeSp.java
+++ /dev/null
@@ -1,491 +0,0 @@
-/**
- * Copyright (c) 2016, 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.hotspot2.pps;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.text.TextUtils;
-import android.util.Log;
-
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * Class representing HomeSP subtree in PerProviderSubscription (PPS)
- * Management Object (MO) tree.
- *
- * For more info, refer to Hotspot 2.0 PPS MO defined in section 9.1 of the Hotspot 2.0
- * Release 2 Technical Specification.
- */
-public final class HomeSp implements Parcelable {
- private static final String TAG = "HomeSp";
-
- /**
- * Maximum number of bytes allowed for a SSID.
- */
- private static final int MAX_SSID_BYTES = 32;
-
- /**
- * Integer value used for indicating null value in the Parcel.
- */
- private static final int NULL_VALUE = -1;
-
- /**
- * FQDN (Fully Qualified Domain Name) of this home service provider.
- */
- private String mFqdn = null;
- /**
- * Set the FQDN (Fully Qualified Domain Name) associated with this home service provider.
- *
- * @param fqdn The FQDN to set to
- */
- public void setFqdn(String fqdn) {
- mFqdn = fqdn;
- }
- /**
- * Get the FQDN (Fully Qualified Domain Name) associated with this home service provider.
- *
- * @return the FQDN associated with this home service provider
- */
- public String getFqdn() {
- return mFqdn;
- }
-
- /**
- * Friendly name of this home service provider.
- */
- private String mFriendlyName = null;
- /**
- * Set the friendly name associated with this home service provider.
- *
- * @param friendlyName The friendly name to set to
- */
- public void setFriendlyName(String friendlyName) {
- mFriendlyName = friendlyName;
- }
- /**
- * Get the friendly name associated with this home service provider.
- *
- * @return the friendly name associated with this home service provider
- */
- public String getFriendlyName() {
- return mFriendlyName;
- }
-
- /**
- * Icon URL of this home service provider.
- */
- private String mIconUrl = null;
- /**
- * @hide
- */
- public void setIconUrl(String iconUrl) {
- mIconUrl = iconUrl;
- }
- /**
- * @hide
- */
- public String getIconUrl() {
- return mIconUrl;
- }
-
- /**
- * <SSID, HESSID> duple of the networks that are consider home networks.
- *
- * According to the Section 9.1.2 of the Hotspot 2.0 Release 2 Technical Specification,
- * all nodes in the PSS MO are encoded using UTF-8 unless stated otherwise. Thus, the SSID
- * string is assumed to be encoded using UTF-8.
- */
- private Map<String, Long> mHomeNetworkIds = null;
- /**
- * @hide
- */
- public void setHomeNetworkIds(Map<String, Long> homeNetworkIds) {
- mHomeNetworkIds = homeNetworkIds;
- }
- /**
- * @hide
- */
- public Map<String, Long> getHomeNetworkIds() {
- return mHomeNetworkIds;
- }
-
- /**
- * Used for determining if this provider is a member of a given Hotspot provider.
- * Every Organization Identifiers (OIs) in this list are required to match an OI in the
- * the Roaming Consortium advertised by a Hotspot, in order to consider this provider
- * as a member of that Hotspot provider (e.g. successful authentication with such Hotspot
- * is possible).
- *
- * Refer to HomeSP/HomeOIList subtree in PerProviderSubscription (PPS) Management Object
- * (MO) tree for more detail.
- */
- private long[] mMatchAllOis = null;
-
- /**
- * Set a list of HomeOIs such that all OIs in the list must match an OI in the Roaming
- * Consortium advertised by a hotspot operator. The list set by this API will have precedence
- * over {@link #setMatchAnyOis(long[])}, meaning the list set in {@link #setMatchAnyOis(long[])}
- * will only be used for matching if the list set by this API is null or empty.
- *
- * @param matchAllOis An array of longs containing the HomeOIs
- */
- public void setMatchAllOis(@Nullable long[] matchAllOis) {
- mMatchAllOis = matchAllOis;
- }
-
- /**
- * Get the list of HomeOIs such that all OIs in the list must match an OI in the Roaming
- * Consortium advertised by a hotspot operator.
- *
- * @return An array of longs containing the HomeOIs
- */
- public @Nullable long[] getMatchAllOis() {
- return mMatchAllOis;
- }
-
- /**
- * Used for determining if this provider is a member of a given Hotspot provider.
- * Matching of any Organization Identifiers (OIs) in this list with an OI in the
- * Roaming Consortium advertised by a Hotspot, will consider this provider as a member
- * of that Hotspot provider (e.g. successful authentication with such Hotspot
- * is possible).
- *
- * The list set by {@link #setMatchAllOis(long[])} will have precedence over this one, meaning
- * this list will only be used for matching if the list set by {@link #setMatchAllOis(long[])}
- * is null or empty.
- *
- * Refer to HomeSP/HomeOIList subtree in PerProviderSubscription (PPS) Management Object
- * (MO) tree for more detail.
- */
- private long[] mMatchAnyOis = null;
-
- /**
- * Set a list of HomeOIs such that any OI in the list matches an OI in the Roaming Consortium
- * advertised by a hotspot operator. The list set by {@link #setMatchAllOis(long[])}
- * will have precedence over this API, meaning this list will only be used for matching if the
- * list set by {@link #setMatchAllOis(long[])} is null or empty.
- *
- * @param matchAnyOis An array of longs containing the HomeOIs
- */
- public void setMatchAnyOis(@Nullable long[] matchAnyOis) {
- mMatchAnyOis = matchAnyOis;
- }
-
- /**
- * Get a list of HomeOIs such that any OI in the list matches an OI in the Roaming Consortium
- * advertised by a hotspot operator.
- *
- * @return An array of longs containing the HomeOIs
- */
- public @Nullable long[] getMatchAnyOis() {
- return mMatchAnyOis;
- }
-
- /**
- * List of FQDN (Fully Qualified Domain Name) of partner providers.
- * These providers should also be regarded as home Hotspot operators.
- * This relationship is most likely achieved via a commercial agreement or
- * operator merges between the providers.
- */
- private String[] mOtherHomePartners = null;
-
- /**
- * Set the list of FQDN (Fully Qualified Domain Name) of other Home partner providers.
- *
- * @param otherHomePartners Array of Strings containing the FQDNs of other Home partner
- * providers
- * @hide
- */
- public void setOtherHomePartners(@Nullable String[] otherHomePartners) {
- mOtherHomePartners = otherHomePartners;
- }
-
- /**
- * Set the list of FQDN (Fully Qualified Domain Name) of other Home partner providers.
- *
- * @param otherHomePartners Collection of Strings containing the FQDNs of other Home partner
- * providers
- */
- public void setOtherHomePartnersList(@NonNull Collection<String> otherHomePartners) {
- if (otherHomePartners == null) {
- return;
- }
- mOtherHomePartners = otherHomePartners.toArray(new String[otherHomePartners.size()]);
- }
-
- /**
- * Get the list of FQDN (Fully Qualified Domain Name) of other Home partner providers set in
- * the profile.
- *
- * @return Array of Strings containing the FQDNs of other Home partner providers set in the
- * profile
- * @hide
- */
- public @Nullable String[] getOtherHomePartners() {
- return mOtherHomePartners;
- }
-
- /**
- * Get the list of FQDN (Fully Qualified Domain Name) of other Home partner providers set in
- * the profile.
- *
- * @return Collection of Strings containing the FQDNs of other Home partner providers set in the
- * profile
- */
- public @NonNull Collection<String> getOtherHomePartnersList() {
- if (mOtherHomePartners == null) {
- return Collections.emptyList();
- }
- return Arrays.asList(mOtherHomePartners);
- }
-
- /**
- * List of Organization Identifiers (OIs) identifying a roaming consortium of
- * which this provider is a member.
- */
- private long[] mRoamingConsortiumOis = null;
- /**
- * Set the Organization Identifiers (OIs) identifying a roaming consortium of which this
- * provider is a member.
- *
- * @param roamingConsortiumOis Array of roaming consortium OIs
- */
- public void setRoamingConsortiumOis(long[] roamingConsortiumOis) {
- mRoamingConsortiumOis = roamingConsortiumOis;
- }
- /**
- * Get the Organization Identifiers (OIs) identifying a roaming consortium of which this
- * provider is a member.
- *
- * @return array of roaming consortium OIs
- */
- public long[] getRoamingConsortiumOis() {
- return mRoamingConsortiumOis;
- }
-
- /**
- * Constructor for creating HomeSp with default values.
- */
- public HomeSp() {}
-
- /**
- * Copy constructor.
- *
- * @param source The source to copy from
- */
- public HomeSp(HomeSp source) {
- if (source == null) {
- return;
- }
- mFqdn = source.mFqdn;
- mFriendlyName = source.mFriendlyName;
- mIconUrl = source.mIconUrl;
- if (source.mHomeNetworkIds != null) {
- mHomeNetworkIds = Collections.unmodifiableMap(source.mHomeNetworkIds);
- }
- if (source.mMatchAllOis != null) {
- mMatchAllOis = Arrays.copyOf(source.mMatchAllOis, source.mMatchAllOis.length);
- }
- if (source.mMatchAnyOis != null) {
- mMatchAnyOis = Arrays.copyOf(source.mMatchAnyOis, source.mMatchAnyOis.length);
- }
- if (source.mOtherHomePartners != null) {
- mOtherHomePartners = Arrays.copyOf(source.mOtherHomePartners,
- source.mOtherHomePartners.length);
- }
- if (source.mRoamingConsortiumOis != null) {
- mRoamingConsortiumOis = Arrays.copyOf(source.mRoamingConsortiumOis,
- source.mRoamingConsortiumOis.length);
- }
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(mFqdn);
- dest.writeString(mFriendlyName);
- dest.writeString(mIconUrl);
- writeHomeNetworkIds(dest, mHomeNetworkIds);
- dest.writeLongArray(mMatchAllOis);
- dest.writeLongArray(mMatchAnyOis);
- dest.writeStringArray(mOtherHomePartners);
- dest.writeLongArray(mRoamingConsortiumOis);
- }
-
- @Override
- public boolean equals(Object thatObject) {
- if (this == thatObject) {
- return true;
- }
- if (!(thatObject instanceof HomeSp)) {
- return false;
- }
- HomeSp that = (HomeSp) thatObject;
-
- return TextUtils.equals(mFqdn, that.mFqdn)
- && TextUtils.equals(mFriendlyName, that.mFriendlyName)
- && TextUtils.equals(mIconUrl, that.mIconUrl)
- && (mHomeNetworkIds == null ? that.mHomeNetworkIds == null
- : mHomeNetworkIds.equals(that.mHomeNetworkIds))
- && Arrays.equals(mMatchAllOis, that.mMatchAllOis)
- && Arrays.equals(mMatchAnyOis, that.mMatchAnyOis)
- && Arrays.equals(mOtherHomePartners, that.mOtherHomePartners)
- && Arrays.equals(mRoamingConsortiumOis, that.mRoamingConsortiumOis);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mFqdn, mFriendlyName, mIconUrl,
- mHomeNetworkIds, Arrays.hashCode(mMatchAllOis),
- Arrays.hashCode(mMatchAnyOis), Arrays.hashCode(mOtherHomePartners),
- Arrays.hashCode(mRoamingConsortiumOis));
- }
-
- /**
- * Get a unique identifier for HomeSp. This identifier depends only on items that remain
- * constant throughout the lifetime of a subscription.
- *
- * @hide
- * @return a Unique identifier for a HomeSp object
- */
- public int getUniqueId() {
- return Objects.hash(mFqdn);
- }
-
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("FQDN: ").append(mFqdn).append("\n");
- builder.append("FriendlyName: ").append(mFriendlyName).append("\n");
- builder.append("IconURL: ").append(mIconUrl).append("\n");
- builder.append("HomeNetworkIDs: ").append(mHomeNetworkIds).append("\n");
- builder.append("MatchAllOIs: ").append(mMatchAllOis).append("\n");
- builder.append("MatchAnyOIs: ").append(mMatchAnyOis).append("\n");
- builder.append("OtherHomePartners: ").append(mOtherHomePartners).append("\n");
- builder.append("RoamingConsortiumOIs: ").append(mRoamingConsortiumOis).append("\n");
- return builder.toString();
- }
-
- /**
- * Validate HomeSp data.
- *
- * @return true on success or false on failure
- * @hide
- */
- public boolean validate() {
- if (TextUtils.isEmpty(mFqdn)) {
- Log.d(TAG, "Missing FQDN");
- return false;
- }
- if (TextUtils.isEmpty(mFriendlyName)) {
- Log.d(TAG, "Missing friendly name");
- return false;
- }
- // Verify SSIDs specified in the NetworkID
- if (mHomeNetworkIds != null) {
- for (Map.Entry<String, Long> entry : mHomeNetworkIds.entrySet()) {
- if (entry.getKey() == null ||
- entry.getKey().getBytes(StandardCharsets.UTF_8).length > MAX_SSID_BYTES) {
- Log.d(TAG, "Invalid SSID in HomeNetworkIDs");
- return false;
- }
- }
- }
- return true;
- }
-
- public static final @android.annotation.NonNull Creator<HomeSp> CREATOR =
- new Creator<HomeSp>() {
- @Override
- public HomeSp createFromParcel(Parcel in) {
- HomeSp homeSp = new HomeSp();
- homeSp.setFqdn(in.readString());
- homeSp.setFriendlyName(in.readString());
- homeSp.setIconUrl(in.readString());
- homeSp.setHomeNetworkIds(readHomeNetworkIds(in));
- homeSp.setMatchAllOis(in.createLongArray());
- homeSp.setMatchAnyOis(in.createLongArray());
- homeSp.setOtherHomePartners(in.createStringArray());
- homeSp.setRoamingConsortiumOis(in.createLongArray());
- return homeSp;
- }
-
- @Override
- public HomeSp[] newArray(int size) {
- return new HomeSp[size];
- }
-
- /**
- * Helper function for reading a Home Network IDs map from a Parcel.
- *
- * @param in The Parcel to read from
- * @return Map of home network IDs
- */
- private Map<String, Long> readHomeNetworkIds(Parcel in) {
- int size = in.readInt();
- if (size == NULL_VALUE) {
- return null;
- }
- Map<String, Long> networkIds = new HashMap<>(size);
- for (int i = 0; i < size; i++) {
- String key = in.readString();
- Long value = null;
- long readValue = in.readLong();
- if (readValue != NULL_VALUE) {
- value = Long.valueOf(readValue);
- }
- networkIds.put(key, value);
- }
- return networkIds;
- }
- };
-
- /**
- * Helper function for writing Home Network IDs map to a Parcel.
- *
- * @param dest The Parcel to write to
- * @param networkIds The map of home network IDs
- */
- private static void writeHomeNetworkIds(Parcel dest, Map<String, Long> networkIds) {
- if (networkIds == null) {
- dest.writeInt(NULL_VALUE);
- return;
- }
- dest.writeInt(networkIds.size());
- for (Map.Entry<String, Long> entry : networkIds.entrySet()) {
- dest.writeString(entry.getKey());
- if (entry.getValue() == null) {
- dest.writeLong(NULL_VALUE);
- } else {
- dest.writeLong(entry.getValue());
- }
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/hotspot2/pps/Policy.java b/wifi/java/android/net/wifi/hotspot2/pps/Policy.java
deleted file mode 100644
index b0a2cc3..0000000
--- a/wifi/java/android/net/wifi/hotspot2/pps/Policy.java
+++ /dev/null
@@ -1,576 +0,0 @@
-/**
- * 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.
- */
-
-package android.net.wifi.hotspot2.pps;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.text.TextUtils;
-import android.util.Log;
-
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * Class representing Policy subtree in PerProviderSubscription (PPS)
- * Management Object (MO) tree.
- *
- * The Policy specifies additional criteria for Passpoint network selections, such as preferred
- * roaming partner, minimum backhaul bandwidth, and etc. It also provides the meta data for
- * updating the policy.
- *
- * For more info, refer to Hotspot 2.0 PPS MO defined in section 9.1 of the Hotspot 2.0
- * Release 2 Technical Specification.
- *
- * @hide
- */
-public final class Policy implements Parcelable {
- private static final String TAG = "Policy";
-
- /**
- * Maximum number of SSIDs in the exclusion list.
- */
- private static final int MAX_EXCLUSION_SSIDS = 128;
-
- /**
- * Maximum byte for SSID.
- */
- private static final int MAX_SSID_BYTES = 32;
-
- /**
- * Maximum bytes for port string in {@link #requiredProtoPortMap}.
- */
- private static final int MAX_PORT_STRING_BYTES = 64;
-
- /**
- * Integer value used for indicating null value in the Parcel.
- */
- private static final int NULL_VALUE = -1;
-
- /**
- * Minimum available downlink/uplink bandwidth (in kilobits per second) required when
- * selecting a network from home providers.
- *
- * The bandwidth is calculated as the LinkSpeed * (1 – LinkLoad/255), where LinkSpeed
- * and LinkLoad parameters are drawn from the WAN Metrics ANQP element at that hotspot.
- *
- * Using Long.MIN_VALUE to indicate unset value.
- */
- private long mMinHomeDownlinkBandwidth = Long.MIN_VALUE;
- public void setMinHomeDownlinkBandwidth(long minHomeDownlinkBandwidth) {
- mMinHomeDownlinkBandwidth = minHomeDownlinkBandwidth;
- }
- public long getMinHomeDownlinkBandwidth() {
- return mMinHomeDownlinkBandwidth;
- }
- private long mMinHomeUplinkBandwidth = Long.MIN_VALUE;
- public void setMinHomeUplinkBandwidth(long minHomeUplinkBandwidth) {
- mMinHomeUplinkBandwidth = minHomeUplinkBandwidth;
- }
- public long getMinHomeUplinkBandwidth() {
- return mMinHomeUplinkBandwidth;
- }
-
- /**
- * Minimum available downlink/uplink bandwidth (in kilobits per second) required when
- * selecting a network from roaming providers.
- *
- * The bandwidth is calculated as the LinkSpeed * (1 – LinkLoad/255), where LinkSpeed
- * and LinkLoad parameters are drawn from the WAN Metrics ANQP element at that hotspot.
- *
- * Using Long.MIN_VALUE to indicate unset value.
- */
- private long mMinRoamingDownlinkBandwidth = Long.MIN_VALUE;
- public void setMinRoamingDownlinkBandwidth(long minRoamingDownlinkBandwidth) {
- mMinRoamingDownlinkBandwidth = minRoamingDownlinkBandwidth;
- }
- public long getMinRoamingDownlinkBandwidth() {
- return mMinRoamingDownlinkBandwidth;
- }
- private long mMinRoamingUplinkBandwidth = Long.MIN_VALUE;
- public void setMinRoamingUplinkBandwidth(long minRoamingUplinkBandwidth) {
- mMinRoamingUplinkBandwidth = minRoamingUplinkBandwidth;
- }
- public long getMinRoamingUplinkBandwidth() {
- return mMinRoamingUplinkBandwidth;
- }
-
- /**
- * List of SSIDs that are not preferred by the Home SP.
- */
- private String[] mExcludedSsidList = null;
- public void setExcludedSsidList(String[] excludedSsidList) {
- mExcludedSsidList = excludedSsidList;
- }
- public String[] getExcludedSsidList() {
- return mExcludedSsidList;
- }
-
- /**
- * List of IP protocol and port number required by one or more operator supported application.
- * The port string contained one or more port numbers delimited by ",".
- */
- private Map<Integer, String> mRequiredProtoPortMap = null;
- public void setRequiredProtoPortMap(Map<Integer, String> requiredProtoPortMap) {
- mRequiredProtoPortMap = requiredProtoPortMap;
- }
- public Map<Integer, String> getRequiredProtoPortMap() {
- return mRequiredProtoPortMap;
- }
-
- /**
- * This specifies the maximum acceptable BSS load policy. This is used to prevent device
- * from joining an AP whose channel is overly congested with traffic.
- * Using Integer.MIN_VALUE to indicate unset value.
- */
- private int mMaximumBssLoadValue = Integer.MIN_VALUE;
- public void setMaximumBssLoadValue(int maximumBssLoadValue) {
- mMaximumBssLoadValue = maximumBssLoadValue;
- }
- public int getMaximumBssLoadValue() {
- return mMaximumBssLoadValue;
- }
-
- /**
- * Policy associated with a roaming provider. This specifies a priority associated
- * with a roaming provider for given list of countries.
- *
- * Contains field under PerProviderSubscription/Policy/PreferredRoamingPartnerList.
- */
- public static final class RoamingPartner implements Parcelable {
- /**
- * FQDN of the roaming partner.
- */
- private String mFqdn = null;
- public void setFqdn(String fqdn) {
- mFqdn = fqdn;
- }
- public String getFqdn() {
- return mFqdn;
- }
-
- /**
- * Flag indicating the exact match of FQDN is required for FQDN matching.
- *
- * When this flag is set to false, sub-domain matching is used. For example, when
- * {@link #fqdn} s set to "example.com", "host.example.com" would be a match.
- */
- private boolean mFqdnExactMatch = false;
- public void setFqdnExactMatch(boolean fqdnExactMatch) {
- mFqdnExactMatch = fqdnExactMatch;
- }
- public boolean getFqdnExactMatch() {
- return mFqdnExactMatch;
- }
-
- /**
- * Priority associated with this roaming partner policy.
- * Using Integer.MIN_VALUE to indicate unset value.
- */
- private int mPriority = Integer.MIN_VALUE;
- public void setPriority(int priority) {
- mPriority = priority;
- }
- public int getPriority() {
- return mPriority;
- }
-
- /**
- * A string contained One or more, comma delimited (i.e., ",") ISO/IEC 3166-1 two
- * character country strings or the country-independent value, "*".
- */
- private String mCountries = null;
- public void setCountries(String countries) {
- mCountries = countries;
- }
- public String getCountries() {
- return mCountries;
- }
-
- public RoamingPartner() {}
-
- public RoamingPartner(RoamingPartner source) {
- if (source != null) {
- mFqdn = source.mFqdn;
- mFqdnExactMatch = source.mFqdnExactMatch;
- mPriority = source.mPriority;
- mCountries = source.mCountries;
- }
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(mFqdn);
- dest.writeInt(mFqdnExactMatch ? 1 : 0);
- dest.writeInt(mPriority);
- dest.writeString(mCountries);
- }
-
- @Override
- public boolean equals(Object thatObject) {
- if (this == thatObject) {
- return true;
- }
- if (!(thatObject instanceof RoamingPartner)) {
- return false;
- }
-
- RoamingPartner that = (RoamingPartner) thatObject;
- return TextUtils.equals(mFqdn, that.mFqdn)
- && mFqdnExactMatch == that.mFqdnExactMatch
- && mPriority == that.mPriority
- && TextUtils.equals(mCountries, that.mCountries);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mFqdn, mFqdnExactMatch, mPriority, mCountries);
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("FQDN: ").append(mFqdn).append("\n");
- builder.append("ExactMatch: ").append("mFqdnExactMatch").append("\n");
- builder.append("Priority: ").append(mPriority).append("\n");
- builder.append("Countries: ").append(mCountries).append("\n");
- return builder.toString();
- }
-
- /**
- * Validate RoamingParnter data.
- *
- * @return true on success
- * @hide
- */
- public boolean validate() {
- if (TextUtils.isEmpty(mFqdn)) {
- Log.d(TAG, "Missing FQDN");
- return false;
- }
- if (TextUtils.isEmpty(mCountries)) {
- Log.d(TAG, "Missing countries");
- return false;
- }
- return true;
- }
-
- public static final @android.annotation.NonNull Creator<RoamingPartner> CREATOR =
- new Creator<RoamingPartner>() {
- @Override
- public RoamingPartner createFromParcel(Parcel in) {
- RoamingPartner roamingPartner = new RoamingPartner();
- roamingPartner.setFqdn(in.readString());
- roamingPartner.setFqdnExactMatch(in.readInt() != 0);
- roamingPartner.setPriority(in.readInt());
- roamingPartner.setCountries(in.readString());
- return roamingPartner;
- }
-
- @Override
- public RoamingPartner[] newArray(int size) {
- return new RoamingPartner[size];
- }
- };
- }
- private List<RoamingPartner> mPreferredRoamingPartnerList = null;
- public void setPreferredRoamingPartnerList(List<RoamingPartner> partnerList) {
- mPreferredRoamingPartnerList = partnerList;
- }
- public List<RoamingPartner> getPreferredRoamingPartnerList() {
- return mPreferredRoamingPartnerList;
- }
-
- /**
- * Meta data used for policy update.
- */
- private UpdateParameter mPolicyUpdate = null;
- public void setPolicyUpdate(UpdateParameter policyUpdate) {
- mPolicyUpdate = policyUpdate;
- }
- public UpdateParameter getPolicyUpdate() {
- return mPolicyUpdate;
- }
-
- /**
- * Constructor for creating Policy with default values.
- */
- public Policy() {}
-
- /**
- * Copy constructor.
- *
- * @param source The source to copy from
- */
- public Policy(Policy source) {
- if (source == null) {
- return;
- }
- mMinHomeDownlinkBandwidth = source.mMinHomeDownlinkBandwidth;
- mMinHomeUplinkBandwidth = source.mMinHomeUplinkBandwidth;
- mMinRoamingDownlinkBandwidth = source.mMinRoamingDownlinkBandwidth;
- mMinRoamingUplinkBandwidth = source.mMinRoamingUplinkBandwidth;
- mMaximumBssLoadValue = source.mMaximumBssLoadValue;
- if (source.mExcludedSsidList != null) {
- mExcludedSsidList = Arrays.copyOf(source.mExcludedSsidList,
- source.mExcludedSsidList.length);
- }
- if (source.mRequiredProtoPortMap != null) {
- mRequiredProtoPortMap = Collections.unmodifiableMap(source.mRequiredProtoPortMap);
- }
- if (source.mPreferredRoamingPartnerList != null) {
- mPreferredRoamingPartnerList = Collections.unmodifiableList(
- source.mPreferredRoamingPartnerList);
- }
- if (source.mPolicyUpdate != null) {
- mPolicyUpdate = new UpdateParameter(source.mPolicyUpdate);
- }
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeLong(mMinHomeDownlinkBandwidth);
- dest.writeLong(mMinHomeUplinkBandwidth);
- dest.writeLong(mMinRoamingDownlinkBandwidth);
- dest.writeLong(mMinRoamingUplinkBandwidth);
- dest.writeStringArray(mExcludedSsidList);
- writeProtoPortMap(dest, mRequiredProtoPortMap);
- dest.writeInt(mMaximumBssLoadValue);
- writeRoamingPartnerList(dest, flags, mPreferredRoamingPartnerList);
- dest.writeParcelable(mPolicyUpdate, flags);
- }
-
- @Override
- public boolean equals(Object thatObject) {
- if (this == thatObject) {
- return true;
- }
- if (!(thatObject instanceof Policy)) {
- return false;
- }
- Policy that = (Policy) thatObject;
-
- return mMinHomeDownlinkBandwidth == that.mMinHomeDownlinkBandwidth
- && mMinHomeUplinkBandwidth == that.mMinHomeUplinkBandwidth
- && mMinRoamingDownlinkBandwidth == that.mMinRoamingDownlinkBandwidth
- && mMinRoamingUplinkBandwidth == that.mMinRoamingUplinkBandwidth
- && Arrays.equals(mExcludedSsidList, that.mExcludedSsidList)
- && (mRequiredProtoPortMap == null ? that.mRequiredProtoPortMap == null
- : mRequiredProtoPortMap.equals(that.mRequiredProtoPortMap))
- && mMaximumBssLoadValue == that.mMaximumBssLoadValue
- && (mPreferredRoamingPartnerList == null
- ? that.mPreferredRoamingPartnerList == null
- : mPreferredRoamingPartnerList.equals(that.mPreferredRoamingPartnerList))
- && (mPolicyUpdate == null ? that.mPolicyUpdate == null
- : mPolicyUpdate.equals(that.mPolicyUpdate));
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mMinHomeDownlinkBandwidth, mMinHomeUplinkBandwidth,
- mMinRoamingDownlinkBandwidth, mMinRoamingUplinkBandwidth, mExcludedSsidList,
- mRequiredProtoPortMap, mMaximumBssLoadValue, mPreferredRoamingPartnerList,
- mPolicyUpdate);
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("MinHomeDownlinkBandwidth: ").append(mMinHomeDownlinkBandwidth)
- .append("\n");
- builder.append("MinHomeUplinkBandwidth: ").append(mMinHomeUplinkBandwidth).append("\n");
- builder.append("MinRoamingDownlinkBandwidth: ").append(mMinRoamingDownlinkBandwidth)
- .append("\n");
- builder.append("MinRoamingUplinkBandwidth: ").append(mMinRoamingUplinkBandwidth)
- .append("\n");
- builder.append("ExcludedSSIDList: ").append(mExcludedSsidList).append("\n");
- builder.append("RequiredProtoPortMap: ").append(mRequiredProtoPortMap).append("\n");
- builder.append("MaximumBSSLoadValue: ").append(mMaximumBssLoadValue).append("\n");
- builder.append("PreferredRoamingPartnerList: ").append(mPreferredRoamingPartnerList)
- .append("\n");
- if (mPolicyUpdate != null) {
- builder.append("PolicyUpdate Begin ---\n");
- builder.append(mPolicyUpdate);
- builder.append("PolicyUpdate End ---\n");
- }
- return builder.toString();
- }
-
- /**
- * Validate Policy data.
- *
- * @return true on success
- * @hide
- */
- public boolean validate() {
- if (mPolicyUpdate == null) {
- Log.d(TAG, "PolicyUpdate not specified");
- return false;
- }
- if (!mPolicyUpdate.validate()) {
- return false;
- }
-
- // Validate SSID exclusion list.
- if (mExcludedSsidList != null) {
- if (mExcludedSsidList.length > MAX_EXCLUSION_SSIDS) {
- Log.d(TAG, "SSID exclusion list size exceeded the max: "
- + mExcludedSsidList.length);
- return false;
- }
- for (String ssid : mExcludedSsidList) {
- if (ssid.getBytes(StandardCharsets.UTF_8).length > MAX_SSID_BYTES) {
- Log.d(TAG, "Invalid SSID: " + ssid);
- return false;
- }
- }
- }
- // Validate required protocol to port map.
- if (mRequiredProtoPortMap != null) {
- for (Map.Entry<Integer, String> entry : mRequiredProtoPortMap.entrySet()) {
- String portNumber = entry.getValue();
- if (portNumber.getBytes(StandardCharsets.UTF_8).length > MAX_PORT_STRING_BYTES) {
- Log.d(TAG, "PortNumber string bytes exceeded the max: " + portNumber);
- return false;
- }
- }
- }
- // Validate preferred roaming partner list.
- if (mPreferredRoamingPartnerList != null) {
- for (RoamingPartner partner : mPreferredRoamingPartnerList) {
- if (!partner.validate()) {
- return false;
- }
- }
- }
- return true;
- }
-
- public static final @android.annotation.NonNull Creator<Policy> CREATOR =
- new Creator<Policy>() {
- @Override
- public Policy createFromParcel(Parcel in) {
- Policy policy = new Policy();
- policy.setMinHomeDownlinkBandwidth(in.readLong());
- policy.setMinHomeUplinkBandwidth(in.readLong());
- policy.setMinRoamingDownlinkBandwidth(in.readLong());
- policy.setMinRoamingUplinkBandwidth(in.readLong());
- policy.setExcludedSsidList(in.createStringArray());
- policy.setRequiredProtoPortMap(readProtoPortMap(in));
- policy.setMaximumBssLoadValue(in.readInt());
- policy.setPreferredRoamingPartnerList(readRoamingPartnerList(in));
- policy.setPolicyUpdate(in.readParcelable(null));
- return policy;
- }
-
- @Override
- public Policy[] newArray(int size) {
- return new Policy[size];
- }
-
- /**
- * Helper function for reading IP Protocol to Port Number map from a Parcel.
- *
- * @param in The Parcel to read from
- * @return Map of IP protocol to port number
- */
- private Map<Integer, String> readProtoPortMap(Parcel in) {
- int size = in.readInt();
- if (size == NULL_VALUE) {
- return null;
- }
- Map<Integer, String> protoPortMap = new HashMap<>(size);
- for (int i = 0; i < size; i++) {
- int key = in.readInt();
- String value = in.readString();
- protoPortMap.put(key, value);
- }
- return protoPortMap;
- }
-
- /**
- * Helper function for reading roaming partner list from a Parcel.
- *
- * @param in The Parcel to read from
- * @return List of roaming partners
- */
- private List<RoamingPartner> readRoamingPartnerList(Parcel in) {
- int size = in.readInt();
- if (size == NULL_VALUE) {
- return null;
- }
- List<RoamingPartner> partnerList = new ArrayList<>();
- for (int i = 0; i < size; i++) {
- partnerList.add(in.readParcelable(null));
- }
- return partnerList;
- }
-
- };
-
- /**
- * Helper function for writing IP Protocol to Port Number map to a Parcel.
- *
- * @param dest The Parcel to write to
- * @param protoPortMap The map to write
- */
- private static void writeProtoPortMap(Parcel dest, Map<Integer, String> protoPortMap) {
- if (protoPortMap == null) {
- dest.writeInt(NULL_VALUE);
- return;
- }
- dest.writeInt(protoPortMap.size());
- for (Map.Entry<Integer, String> entry : protoPortMap.entrySet()) {
- dest.writeInt(entry.getKey());
- dest.writeString(entry.getValue());
- }
- }
-
- /**
- * Helper function for writing roaming partner list to a Parcel.
- *
- * @param dest The Parcel to write to
- * @param flags The flag about how the object should be written
- * @param partnerList The partner list to write
- */
- private static void writeRoamingPartnerList(Parcel dest, int flags,
- List<RoamingPartner> partnerList) {
- if (partnerList == null) {
- dest.writeInt(NULL_VALUE);
- return;
- }
- dest.writeInt(partnerList.size());
- for (RoamingPartner partner : partnerList) {
- dest.writeParcelable(partner, flags);
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/hotspot2/pps/UpdateParameter.java b/wifi/java/android/net/wifi/hotspot2/pps/UpdateParameter.java
deleted file mode 100644
index 4a8aa36..0000000
--- a/wifi/java/android/net/wifi/hotspot2/pps/UpdateParameter.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/**
- * 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.
- */
-
-package android.net.wifi.hotspot2.pps;
-
-import android.net.wifi.ParcelUtil;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.text.TextUtils;
-import android.util.Base64;
-import android.util.Log;
-
-import java.nio.charset.StandardCharsets;
-import java.security.cert.X509Certificate;
-import java.util.Arrays;
-import java.util.Objects;
-
-/**
- * Class representing configuration parameters for subscription or policy update in
- * PerProviderSubscription (PPS) Management Object (MO) tree. This is used by both
- * PerProviderSubscription/Policy/PolicyUpdate and PerProviderSubscription/SubscriptionUpdate
- * subtree.
- *
- * For more info, refer to Hotspot 2.0 PPS MO defined in section 9.1 of the Hotspot 2.0
- * Release 2 Technical Specification.
- *
- * @hide
- */
-public final class UpdateParameter implements Parcelable {
- private static final String TAG = "UpdateParameter";
-
- /**
- * Value indicating policy update is not applicable. Thus, never check with policy server
- * for updates.
- */
- public static final long UPDATE_CHECK_INTERVAL_NEVER = 0xFFFFFFFFL;
-
- /**
- * Valid string for UpdateMethod.
- */
- public static final String UPDATE_METHOD_OMADM = "OMA-DM-ClientInitiated";
- public static final String UPDATE_METHOD_SSP = "SSP-ClientInitiated";
-
- /**
- * Valid string for Restriction.
- */
- public static final String UPDATE_RESTRICTION_HOMESP = "HomeSP";
- public static final String UPDATE_RESTRICTION_ROAMING_PARTNER = "RoamingPartner";
- public static final String UPDATE_RESTRICTION_UNRESTRICTED = "Unrestricted";
-
- /**
- * Maximum bytes for URI string.
- */
- private static final int MAX_URI_BYTES = 1023;
-
- /**
- * Maximum bytes for URI string.
- */
- private static final int MAX_URL_BYTES = 1023;
-
- /**
- * Maximum bytes for username.
- */
- private static final int MAX_USERNAME_BYTES = 63;
-
- /**
- * Maximum bytes for password.
- */
- private static final int MAX_PASSWORD_BYTES = 255;
-
- /**
- * Number of bytes for certificate SHA-256 fingerprint byte array.
- */
- private static final int CERTIFICATE_SHA256_BYTES = 32;
-
- /**
- * This specifies how often the mobile device shall check with policy server for updates.
- *
- * Using Long.MIN_VALUE to indicate unset value.
- */
- private long mUpdateIntervalInMinutes = Long.MIN_VALUE;
- public void setUpdateIntervalInMinutes(long updateIntervalInMinutes) {
- mUpdateIntervalInMinutes = updateIntervalInMinutes;
- }
- public long getUpdateIntervalInMinutes() {
- return mUpdateIntervalInMinutes;
- }
-
- /**
- * The method used to update the policy. Permitted values are "OMA-DM-ClientInitiated"
- * and "SPP-ClientInitiated".
- */
- private String mUpdateMethod = null;
- public void setUpdateMethod(String updateMethod) {
- mUpdateMethod = updateMethod;
- }
- public String getUpdateMethod() {
- return mUpdateMethod;
- }
-
- /**
- * This specifies the hotspots at which the subscription update is permitted. Permitted
- * values are "HomeSP", "RoamingPartner", or "Unrestricted";
- */
- private String mRestriction = null;
- public void setRestriction(String restriction) {
- mRestriction = restriction;
- }
- public String getRestriction() {
- return mRestriction;
- }
-
- /**
- * The URI of the update server.
- */
- private String mServerUri = null;
- public void setServerUri(String serverUri) {
- mServerUri = serverUri;
- }
- public String getServerUri() {
- return mServerUri;
- }
-
- /**
- * Username used to authenticate with the policy server.
- */
- private String mUsername = null;
- public void setUsername(String username) {
- mUsername = username;
- }
- public String getUsername() {
- return mUsername;
- }
-
- /**
- * Base64 encoded password used to authenticate with the policy server.
- */
- private String mBase64EncodedPassword = null;
- public void setBase64EncodedPassword(String password) {
- mBase64EncodedPassword = password;
- }
- public String getBase64EncodedPassword() {
- return mBase64EncodedPassword;
- }
-
- /**
- * HTTPS URL for retrieving certificate for trust root. The trust root is used to validate
- * policy server's identity.
- */
- private String mTrustRootCertUrl = null;
- public void setTrustRootCertUrl(String trustRootCertUrl) {
- mTrustRootCertUrl = trustRootCertUrl;
- }
- public String getTrustRootCertUrl() {
- return mTrustRootCertUrl;
- }
-
- /**
- * SHA-256 fingerprint of the certificate located at {@code mTrustRootCertUrl}
- */
- private byte[] mTrustRootCertSha256Fingerprint = null;
- public void setTrustRootCertSha256Fingerprint(byte[] fingerprint) {
- mTrustRootCertSha256Fingerprint = fingerprint;
- }
- public byte[] getTrustRootCertSha256Fingerprint() {
- return mTrustRootCertSha256Fingerprint;
- }
-
- /**
- * CA (Certificate Authority) X509 certificates.
- */
- private X509Certificate mCaCertificate;
-
- /**
- * Set the CA (Certification Authority) certificate associated with Policy/Subscription update.
- *
- * @param caCertificate The CA certificate to set
- * @hide
- */
- public void setCaCertificate(X509Certificate caCertificate) {
- mCaCertificate = caCertificate;
- }
-
- /**
- * Get the CA (Certification Authority) certificate associated with Policy/Subscription update.
- *
- * @return CA certificate associated and {@code null} if certificate is not set.
- * @hide
- */
- public X509Certificate getCaCertificate() {
- return mCaCertificate;
- }
-
- /**
- * Constructor for creating Policy with default values.
- */
- public UpdateParameter() {}
-
- /**
- * Copy constructor.
- *
- * @param source The source to copy from
- */
- public UpdateParameter(UpdateParameter source) {
- if (source == null) {
- return;
- }
- mUpdateIntervalInMinutes = source.mUpdateIntervalInMinutes;
- mUpdateMethod = source.mUpdateMethod;
- mRestriction = source.mRestriction;
- mServerUri = source.mServerUri;
- mUsername = source.mUsername;
- mBase64EncodedPassword = source.mBase64EncodedPassword;
- mTrustRootCertUrl = source.mTrustRootCertUrl;
- if (source.mTrustRootCertSha256Fingerprint != null) {
- mTrustRootCertSha256Fingerprint = Arrays.copyOf(source.mTrustRootCertSha256Fingerprint,
- source.mTrustRootCertSha256Fingerprint.length);
- }
- mCaCertificate = source.mCaCertificate;
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeLong(mUpdateIntervalInMinutes);
- dest.writeString(mUpdateMethod);
- dest.writeString(mRestriction);
- dest.writeString(mServerUri);
- dest.writeString(mUsername);
- dest.writeString(mBase64EncodedPassword);
- dest.writeString(mTrustRootCertUrl);
- dest.writeByteArray(mTrustRootCertSha256Fingerprint);
- ParcelUtil.writeCertificate(dest, mCaCertificate);
- }
-
- @Override
- public boolean equals(Object thatObject) {
- if (this == thatObject) {
- return true;
- }
- if (!(thatObject instanceof UpdateParameter)) {
- return false;
- }
- UpdateParameter that = (UpdateParameter) thatObject;
-
- return mUpdateIntervalInMinutes == that.mUpdateIntervalInMinutes
- && TextUtils.equals(mUpdateMethod, that.mUpdateMethod)
- && TextUtils.equals(mRestriction, that.mRestriction)
- && TextUtils.equals(mServerUri, that.mServerUri)
- && TextUtils.equals(mUsername, that.mUsername)
- && TextUtils.equals(mBase64EncodedPassword, that.mBase64EncodedPassword)
- && TextUtils.equals(mTrustRootCertUrl, that.mTrustRootCertUrl)
- && Arrays.equals(mTrustRootCertSha256Fingerprint,
- that.mTrustRootCertSha256Fingerprint)
- && Credential.isX509CertificateEquals(mCaCertificate, that.mCaCertificate);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mUpdateIntervalInMinutes, mUpdateMethod, mRestriction, mServerUri,
- mUsername, mBase64EncodedPassword, mTrustRootCertUrl,
- Arrays.hashCode(mTrustRootCertSha256Fingerprint), mCaCertificate);
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("UpdateInterval: ").append(mUpdateIntervalInMinutes).append("\n");
- builder.append("UpdateMethod: ").append(mUpdateMethod).append("\n");
- builder.append("Restriction: ").append(mRestriction).append("\n");
- builder.append("ServerURI: ").append(mServerUri).append("\n");
- builder.append("Username: ").append(mUsername).append("\n");
- builder.append("TrustRootCertURL: ").append(mTrustRootCertUrl).append("\n");
- return builder.toString();
- }
-
- /**
- * Validate UpdateParameter data.
- *
- * @return true on success
- * @hide
- */
- public boolean validate() {
- if (mUpdateIntervalInMinutes == Long.MIN_VALUE) {
- Log.d(TAG, "Update interval not specified");
- return false;
- }
- // Update not applicable.
- if (mUpdateIntervalInMinutes == UPDATE_CHECK_INTERVAL_NEVER) {
- return true;
- }
-
- if (!TextUtils.equals(mUpdateMethod, UPDATE_METHOD_OMADM)
- && !TextUtils.equals(mUpdateMethod, UPDATE_METHOD_SSP)) {
- Log.d(TAG, "Unknown update method: " + mUpdateMethod);
- return false;
- }
-
- if (!TextUtils.equals(mRestriction, UPDATE_RESTRICTION_HOMESP)
- && !TextUtils.equals(mRestriction, UPDATE_RESTRICTION_ROAMING_PARTNER)
- && !TextUtils.equals(mRestriction, UPDATE_RESTRICTION_UNRESTRICTED)) {
- Log.d(TAG, "Unknown restriction: " + mRestriction);
- return false;
- }
-
- if (TextUtils.isEmpty(mServerUri)) {
- Log.d(TAG, "Missing update server URI");
- return false;
- }
- if (mServerUri.getBytes(StandardCharsets.UTF_8).length > MAX_URI_BYTES) {
- Log.d(TAG, "URI bytes exceeded the max: "
- + mServerUri.getBytes(StandardCharsets.UTF_8).length);
- return false;
- }
-
- if (TextUtils.isEmpty(mUsername)) {
- Log.d(TAG, "Missing username");
- return false;
- }
- if (mUsername.getBytes(StandardCharsets.UTF_8).length > MAX_USERNAME_BYTES) {
- Log.d(TAG, "Username bytes exceeded the max: "
- + mUsername.getBytes(StandardCharsets.UTF_8).length);
- return false;
- }
-
- if (TextUtils.isEmpty(mBase64EncodedPassword)) {
- Log.d(TAG, "Missing username");
- return false;
- }
- if (mBase64EncodedPassword.getBytes(StandardCharsets.UTF_8).length > MAX_PASSWORD_BYTES) {
- Log.d(TAG, "Password bytes exceeded the max: "
- + mBase64EncodedPassword.getBytes(StandardCharsets.UTF_8).length);
- return false;
- }
- try {
- Base64.decode(mBase64EncodedPassword, Base64.DEFAULT);
- } catch (IllegalArgumentException e) {
- Log.d(TAG, "Invalid encoding for password: " + mBase64EncodedPassword);
- return false;
- }
-
- if (TextUtils.isEmpty(mTrustRootCertUrl)) {
- Log.d(TAG, "Missing trust root certificate URL");
- return false;
- }
- if (mTrustRootCertUrl.getBytes(StandardCharsets.UTF_8).length > MAX_URL_BYTES) {
- Log.d(TAG, "Trust root cert URL bytes exceeded the max: "
- + mTrustRootCertUrl.getBytes(StandardCharsets.UTF_8).length);
- return false;
- }
-
- if (mTrustRootCertSha256Fingerprint == null) {
- Log.d(TAG, "Missing trust root certificate SHA-256 fingerprint");
- return false;
- }
- if (mTrustRootCertSha256Fingerprint.length != CERTIFICATE_SHA256_BYTES) {
- Log.d(TAG, "Incorrect size of trust root certificate SHA-256 fingerprint: "
- + mTrustRootCertSha256Fingerprint.length);
- return false;
- }
- return true;
- }
-
- public static final @android.annotation.NonNull Creator<UpdateParameter> CREATOR =
- new Creator<UpdateParameter>() {
- @Override
- public UpdateParameter createFromParcel(Parcel in) {
- UpdateParameter updateParam = new UpdateParameter();
- updateParam.setUpdateIntervalInMinutes(in.readLong());
- updateParam.setUpdateMethod(in.readString());
- updateParam.setRestriction(in.readString());
- updateParam.setServerUri(in.readString());
- updateParam.setUsername(in.readString());
- updateParam.setBase64EncodedPassword(in.readString());
- updateParam.setTrustRootCertUrl(in.readString());
- updateParam.setTrustRootCertSha256Fingerprint(in.createByteArray());
- updateParam.setCaCertificate(ParcelUtil.readCertificate(in));
- return updateParam;
- }
-
- @Override
- public UpdateParameter[] newArray(int size) {
- return new UpdateParameter[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl b/wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl
deleted file mode 100644
index fd89d3b..0000000
--- a/wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl
+++ /dev/null
@@ -1,34 +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 android.net.wifi.p2p;
-
-import android.os.Messenger;
-
-/**
- * Interface that WifiP2pService implements
- *
- * {@hide}
- */
-interface IWifiP2pManager
-{
- Messenger getMessenger(in IBinder binder, in String packageName);
- Messenger getP2pStateMachineMessenger();
- oneway void close(in IBinder binder);
- void setMiracastMode(int mode);
- void checkConfigureWifiDisplayPermission();
-}
-
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pConfig.java b/wifi/java/android/net/wifi/p2p/WifiP2pConfig.java
deleted file mode 100644
index d3a6bac..0000000
--- a/wifi/java/android/net/wifi/p2p/WifiP2pConfig.java
+++ /dev/null
@@ -1,506 +0,0 @@
-/*
- * Copyright (C) 2011 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.p2p;
-
-import android.annotation.IntDef;
-import android.annotation.IntRange;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.compat.annotation.UnsupportedAppUsage;
-import android.net.MacAddress;
-import android.net.wifi.WpsInfo;
-import android.os.Build;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.text.TextUtils;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.nio.charset.StandardCharsets;
-import java.util.regex.PatternSyntaxException;
-
-/**
- * A class representing a Wi-Fi P2p configuration for setting up a connection
- *
- * {@see WifiP2pManager}
- */
-public class WifiP2pConfig implements Parcelable {
-
- /**
- * The device MAC address uniquely identifies a Wi-Fi p2p device
- */
- public String deviceAddress = "";
-
- /**
- * Wi-Fi Protected Setup information
- */
- public WpsInfo wps;
-
- /** Get the network name of this P2P configuration, or null if unset. */
- @Nullable
- public String getNetworkName() {
- return networkName;
- }
-
- /** @hide */
- public String networkName = "";
-
- /** Get the passphrase of this P2P configuration, or null if unset. */
- @Nullable
- public String getPassphrase() {
- return passphrase;
- }
-
- /** @hide */
- public String passphrase = "";
-
- /**
- * Get the required band for the group owner.
- * The result will be one of the following:
- * {@link #GROUP_OWNER_BAND_AUTO},
- * {@link #GROUP_OWNER_BAND_2GHZ},
- * {@link #GROUP_OWNER_BAND_5GHZ}
- */
- @GroupOperatingBandType
- public int getGroupOwnerBand() {
- return groupOwnerBand;
- }
-
- /** @hide */
- @GroupOperatingBandType
- public int groupOwnerBand = GROUP_OWNER_BAND_AUTO;
-
- /** @hide */
- @IntDef(flag = false, prefix = { "GROUP_OWNER_BAND_" }, value = {
- GROUP_OWNER_BAND_AUTO,
- GROUP_OWNER_BAND_2GHZ,
- GROUP_OWNER_BAND_5GHZ
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface GroupOperatingBandType {}
-
- /**
- * Allow the system to pick the operating frequency from all supported bands.
- */
- public static final int GROUP_OWNER_BAND_AUTO = 0;
- /**
- * Allow the system to pick the operating frequency from the 2.4 GHz band.
- */
- public static final int GROUP_OWNER_BAND_2GHZ = 1;
- /**
- * Allow the system to pick the operating frequency from the 5 GHz band.
- */
- public static final int GROUP_OWNER_BAND_5GHZ = 2;
-
- /**
- * The least inclination to be a group owner, to be filled in the field
- * {@link #groupOwnerIntent}.
- */
- public static final int GROUP_OWNER_INTENT_MIN = 0;
-
- /**
- * The most inclination to be a group owner, to be filled in the field
- * {@link #groupOwnerIntent}.
- */
- public static final int GROUP_OWNER_INTENT_MAX = 15;
-
- /**
- * The system can choose an appropriate owner intent value, to be filled in the field
- * {@link #groupOwnerIntent}.
- */
- public static final int GROUP_OWNER_INTENT_AUTO = -1;
-
- /**
- * This is an integer value between {@link #GROUP_OWNER_INTENT_MIN} and
- * {@link #GROUP_OWNER_INTENT_MAX} where
- * {@link #GROUP_OWNER_INTENT_MIN} indicates the least inclination to be a group owner and
- * {@link #GROUP_OWNER_INTENT_MAX} indicates the highest inclination to be a group owner.
- *
- * A value of {@link #GROUP_OWNER_INTENT_AUTO} indicates the system can choose an appropriate
- * value.
- *
- * By default this field is set to {@link #GROUP_OWNER_INTENT_AUTO}.
- */
- @IntRange(from = 0, to = 15)
- public int groupOwnerIntent = GROUP_OWNER_INTENT_AUTO;
-
- /** @hide */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public int netId = WifiP2pGroup.NETWORK_ID_PERSISTENT;
-
- /**
- * Get the network ID of this P2P configuration.
- * @return either a non-negative network ID, or one of
- * {@link WifiP2pGroup#NETWORK_ID_PERSISTENT} or {@link WifiP2pGroup#NETWORK_ID_TEMPORARY}.
- */
- public int getNetworkId() {
- return netId;
- }
-
- public WifiP2pConfig() {
- //set defaults
- wps = new WpsInfo();
- wps.setup = WpsInfo.PBC;
- }
-
- /** @hide */
- public void invalidate() {
- deviceAddress = "";
- }
-
- /** P2P-GO-NEG-REQUEST 42:fc:89:a8:96:09 dev_passwd_id=4 {@hide}*/
- @UnsupportedAppUsage
- public WifiP2pConfig(String supplicantEvent) throws IllegalArgumentException {
- String[] tokens = supplicantEvent.split(" ");
-
- if (tokens.length < 2 || !tokens[0].equals("P2P-GO-NEG-REQUEST")) {
- throw new IllegalArgumentException("Malformed supplicant event");
- }
-
- deviceAddress = tokens[1];
- wps = new WpsInfo();
-
- if (tokens.length > 2) {
- String[] nameVal = tokens[2].split("=");
- int devPasswdId;
- try {
- devPasswdId = Integer.parseInt(nameVal[1]);
- } catch (NumberFormatException e) {
- devPasswdId = 0;
- }
- //Based on definitions in wps/wps_defs.h
- switch (devPasswdId) {
- //DEV_PW_USER_SPECIFIED = 0x0001,
- case 0x01:
- wps.setup = WpsInfo.DISPLAY;
- break;
- //DEV_PW_PUSHBUTTON = 0x0004,
- case 0x04:
- wps.setup = WpsInfo.PBC;
- break;
- //DEV_PW_REGISTRAR_SPECIFIED = 0x0005
- case 0x05:
- wps.setup = WpsInfo.KEYPAD;
- break;
- default:
- wps.setup = WpsInfo.PBC;
- break;
- }
- }
- }
-
- public String toString() {
- StringBuffer sbuf = new StringBuffer();
- sbuf.append("\n address: ").append(deviceAddress);
- sbuf.append("\n wps: ").append(wps);
- sbuf.append("\n groupOwnerIntent: ").append(groupOwnerIntent);
- sbuf.append("\n persist: ").append(netId);
- sbuf.append("\n networkName: ").append(networkName);
- sbuf.append("\n passphrase: ").append(
- TextUtils.isEmpty(passphrase) ? "<empty>" : "<non-empty>");
- sbuf.append("\n groupOwnerBand: ").append(groupOwnerBand);
- return sbuf.toString();
- }
-
- /** Implement the Parcelable interface */
- public int describeContents() {
- return 0;
- }
-
- /** copy constructor */
- public WifiP2pConfig(WifiP2pConfig source) {
- if (source != null) {
- deviceAddress = source.deviceAddress;
- wps = new WpsInfo(source.wps);
- groupOwnerIntent = source.groupOwnerIntent;
- netId = source.netId;
- networkName = source.networkName;
- passphrase = source.passphrase;
- groupOwnerBand = source.groupOwnerBand;
- }
- }
-
- /** Implement the Parcelable interface */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(deviceAddress);
- dest.writeParcelable(wps, flags);
- dest.writeInt(groupOwnerIntent);
- dest.writeInt(netId);
- dest.writeString(networkName);
- dest.writeString(passphrase);
- dest.writeInt(groupOwnerBand);
- }
-
- /** Implement the Parcelable interface */
- public static final @android.annotation.NonNull Creator<WifiP2pConfig> CREATOR =
- new Creator<WifiP2pConfig>() {
- public WifiP2pConfig createFromParcel(Parcel in) {
- WifiP2pConfig config = new WifiP2pConfig();
- config.deviceAddress = in.readString();
- config.wps = (WpsInfo) in.readParcelable(null);
- config.groupOwnerIntent = in.readInt();
- config.netId = in.readInt();
- config.networkName = in.readString();
- config.passphrase = in.readString();
- config.groupOwnerBand = in.readInt();
- return config;
- }
-
- public WifiP2pConfig[] newArray(int size) {
- return new WifiP2pConfig[size];
- }
- };
-
- /**
- * Builder used to build {@link WifiP2pConfig} objects for
- * creating or joining a group.
- */
- public static final class Builder {
-
- private static final MacAddress MAC_ANY_ADDRESS =
- MacAddress.fromString("02:00:00:00:00:00");
- /**
- * Maximum number of bytes allowed for a SSID.
- */
- private static final int MAX_SSID_BYTES = 32;
-
- private MacAddress mDeviceAddress = MAC_ANY_ADDRESS;
- private String mNetworkName = "";
- private String mPassphrase = "";
- private int mGroupOperatingBand = GROUP_OWNER_BAND_AUTO;
- private int mGroupOperatingFrequency = GROUP_OWNER_BAND_AUTO;
- private int mNetId = WifiP2pGroup.NETWORK_ID_TEMPORARY;
-
- /**
- * Specify the peer's MAC address. If not set, the device will
- * try to find a peer whose SSID matches the network name as
- * specified by {@link #setNetworkName(String)}. Specifying null will
- * reset the peer's MAC address to "02:00:00:00:00:00".
- * <p>
- * Optional. "02:00:00:00:00:00" by default.
- *
- * @param deviceAddress the peer's MAC address.
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public @NonNull Builder setDeviceAddress(@Nullable MacAddress deviceAddress) {
- if (deviceAddress == null) {
- mDeviceAddress = MAC_ANY_ADDRESS;
- } else {
- mDeviceAddress = deviceAddress;
- }
- return this;
- }
-
- /**
- * Specify the network name, a.k.a. group name,
- * for creating or joining a group.
- * <p>
- * A network name shall begin with "DIRECT-xy". x and y are selected
- * from the following character set: upper case letters, lower case
- * letters and numbers. Any byte values allowed for an SSID according to
- * IEEE802.11-2012 [1] may be included after the string "DIRECT-xy"
- * (including none).
- * <p>
- * Must be called - an empty network name or an network name
- * not conforming to the P2P Group ID naming rule is not valid.
- *
- * @param networkName network name of a group.
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public @NonNull Builder setNetworkName(@NonNull String networkName) {
- if (TextUtils.isEmpty(networkName)) {
- throw new IllegalArgumentException(
- "network name must be non-empty.");
- }
- if (networkName.getBytes(StandardCharsets.UTF_8).length > MAX_SSID_BYTES) {
- throw new IllegalArgumentException(
- "network name exceeds " + MAX_SSID_BYTES + " bytes.");
- }
- try {
- if (!networkName.matches("^DIRECT-[a-zA-Z0-9]{2}.*")) {
- throw new IllegalArgumentException(
- "network name must starts with the prefix DIRECT-xy.");
- }
- } catch (PatternSyntaxException e) {
- // can never happen (fixed pattern)
- }
- mNetworkName = networkName;
- return this;
- }
-
- /**
- * Specify the passphrase for creating or joining a group.
- * <p>
- * The passphrase must be an ASCII string whose length is between 8
- * and 63.
- * <p>
- * Must be called - an empty passphrase is not valid.
- *
- * @param passphrase the passphrase of a group.
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public @NonNull Builder setPassphrase(@NonNull String passphrase) {
- if (TextUtils.isEmpty(passphrase)) {
- throw new IllegalArgumentException(
- "passphrase must be non-empty.");
- }
- if (passphrase.length() < 8 || passphrase.length() > 63) {
- throw new IllegalArgumentException(
- "The length of a passphrase must be between 8 and 63.");
- }
- mPassphrase = passphrase;
- return this;
- }
-
- /**
- * Specify the band to use for creating the group or joining the group. The band should
- * be {@link #GROUP_OWNER_BAND_2GHZ}, {@link #GROUP_OWNER_BAND_5GHZ} or
- * {@link #GROUP_OWNER_BAND_AUTO}.
- * <p>
- * When creating a group as Group Owner using {@link
- * WifiP2pManager#createGroup(WifiP2pManager.Channel,
- * WifiP2pConfig, WifiP2pManager.ActionListener)},
- * specifying {@link #GROUP_OWNER_BAND_AUTO} allows the system to pick the operating
- * frequency from all supported bands.
- * Specifying {@link #GROUP_OWNER_BAND_2GHZ} or {@link #GROUP_OWNER_BAND_5GHZ}
- * only allows the system to pick the operating frequency in the specified band.
- * If the Group Owner cannot create a group in the specified band, the operation will fail.
- * <p>
- * When joining a group as Group Client using {@link
- * WifiP2pManager#connect(WifiP2pManager.Channel, WifiP2pConfig,
- * WifiP2pManager.ActionListener)},
- * specifying {@link #GROUP_OWNER_BAND_AUTO} allows the system to scan all supported
- * frequencies to find the desired group. Specifying {@link #GROUP_OWNER_BAND_2GHZ} or
- * {@link #GROUP_OWNER_BAND_5GHZ} only allows the system to scan the specified band.
- * <p>
- * {@link #setGroupOperatingBand(int)} and {@link #setGroupOperatingFrequency(int)} are
- * mutually exclusive. Setting operating band and frequency both is invalid.
- * <p>
- * Optional. {@link #GROUP_OWNER_BAND_AUTO} by default.
- *
- * @param band the operating band of the group.
- * This should be one of {@link #GROUP_OWNER_BAND_AUTO},
- * {@link #GROUP_OWNER_BAND_2GHZ}, {@link #GROUP_OWNER_BAND_5GHZ}.
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public @NonNull Builder setGroupOperatingBand(@GroupOperatingBandType int band) {
- switch (band) {
- case GROUP_OWNER_BAND_AUTO:
- case GROUP_OWNER_BAND_2GHZ:
- case GROUP_OWNER_BAND_5GHZ:
- mGroupOperatingBand = band;
- break;
- default:
- throw new IllegalArgumentException(
- "Invalid constant for the group operating band!");
- }
- return this;
- }
-
- /**
- * Specify the frequency, in MHz, to use for creating the group or joining the group.
- * <p>
- * When creating a group as Group Owner using {@link WifiP2pManager#createGroup(
- * WifiP2pManager.Channel, WifiP2pConfig, WifiP2pManager.ActionListener)},
- * specifying a frequency only allows the system to pick the specified frequency.
- * If the Group Owner cannot create a group at the specified frequency,
- * the operation will fail.
- * When not specifying a frequency, it allows the system to pick operating frequency
- * from all supported bands.
- * <p>
- * When joining a group as Group Client using {@link WifiP2pManager#connect(
- * WifiP2pManager.Channel, WifiP2pConfig, WifiP2pManager.ActionListener)},
- * specifying a frequency only allows the system to scan the specified frequency.
- * If the frequency is not supported or invalid, the operation will fail.
- * When not specifying a frequency, it allows the system to scan all supported
- * frequencies to find the desired group.
- * <p>
- * {@link #setGroupOperatingBand(int)} and {@link #setGroupOperatingFrequency(int)} are
- * mutually exclusive. Setting operating band and frequency both is invalid.
- * <p>
- * Optional. 0 by default.
- *
- * @param frequency the operating frequency of the group.
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public @NonNull Builder setGroupOperatingFrequency(int frequency) {
- if (frequency < 0) {
- throw new IllegalArgumentException(
- "Invalid group operating frequency!");
- }
- mGroupOperatingFrequency = frequency;
- return this;
- }
-
- /**
- * Specify that the group configuration be persisted (i.e. saved).
- * By default the group configuration will not be saved.
- * <p>
- * Optional. false by default.
- *
- * @param persistent is this group persistent group.
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public @NonNull Builder enablePersistentMode(boolean persistent) {
- if (persistent) {
- mNetId = WifiP2pGroup.NETWORK_ID_PERSISTENT;
- } else {
- mNetId = WifiP2pGroup.NETWORK_ID_TEMPORARY;
- }
- return this;
- }
-
- /**
- * Build {@link WifiP2pConfig} given the current requests made on the builder.
- * @return {@link WifiP2pConfig} constructed based on builder method calls.
- */
- public @NonNull WifiP2pConfig build() {
- if (TextUtils.isEmpty(mNetworkName)) {
- throw new IllegalStateException(
- "network name must be non-empty.");
- }
- if (TextUtils.isEmpty(mPassphrase)) {
- throw new IllegalStateException(
- "passphrase must be non-empty.");
- }
-
- if (mGroupOperatingFrequency > 0 && mGroupOperatingBand > 0) {
- throw new IllegalStateException(
- "Preferred frequency and band are mutually exclusive.");
- }
-
- WifiP2pConfig config = new WifiP2pConfig();
- config.deviceAddress = mDeviceAddress.toString();
- config.networkName = mNetworkName;
- config.passphrase = mPassphrase;
- config.groupOwnerBand = GROUP_OWNER_BAND_AUTO;
- if (mGroupOperatingFrequency > 0) {
- config.groupOwnerBand = mGroupOperatingFrequency;
- } else if (mGroupOperatingBand > 0) {
- config.groupOwnerBand = mGroupOperatingBand;
- }
- config.netId = mNetId;
- return config;
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pDevice.java b/wifi/java/android/net/wifi/p2p/WifiP2pDevice.java
deleted file mode 100644
index 567637a..0000000
--- a/wifi/java/android/net/wifi/p2p/WifiP2pDevice.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*
- * Copyright (C) 2011 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.p2p;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.compat.annotation.UnsupportedAppUsage;
-import android.os.Build;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.util.Log;
-
-import java.util.Objects;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * A class representing a Wi-Fi p2p device
- *
- * Note that the operations are not thread safe
- * {@see WifiP2pManager}
- */
-public class WifiP2pDevice implements Parcelable {
-
- private static final String TAG = "WifiP2pDevice";
-
- /**
- * The device name is a user friendly string to identify a Wi-Fi p2p device
- */
- public String deviceName = "";
-
- /**
- * The device MAC address uniquely identifies a Wi-Fi p2p device
- */
- public String deviceAddress = "";
-
- /**
- * Primary device type identifies the type of device. For example, an application
- * could filter the devices discovered to only display printers if the purpose is to
- * enable a printing action from the user. See the Wi-Fi Direct technical specification
- * for the full list of standard device types supported.
- */
- public String primaryDeviceType;
-
- /**
- * Secondary device type is an optional attribute that can be provided by a device in
- * addition to the primary device type.
- */
- public String secondaryDeviceType;
-
-
- // These definitions match the ones in wpa_supplicant
- /* WPS config methods supported */
- private static final int WPS_CONFIG_DISPLAY = 0x0008;
- private static final int WPS_CONFIG_PUSHBUTTON = 0x0080;
- private static final int WPS_CONFIG_KEYPAD = 0x0100;
-
- /* Device Capability bitmap */
- private static final int DEVICE_CAPAB_SERVICE_DISCOVERY = 1;
- @SuppressWarnings("unused")
- private static final int DEVICE_CAPAB_CLIENT_DISCOVERABILITY = 1<<1;
- @SuppressWarnings("unused")
- private static final int DEVICE_CAPAB_CONCURRENT_OPER = 1<<2;
- @SuppressWarnings("unused")
- private static final int DEVICE_CAPAB_INFRA_MANAGED = 1<<3;
- @SuppressWarnings("unused")
- private static final int DEVICE_CAPAB_DEVICE_LIMIT = 1<<4;
- private static final int DEVICE_CAPAB_INVITATION_PROCEDURE = 1<<5;
-
- /* Group Capability bitmap */
- private static final int GROUP_CAPAB_GROUP_OWNER = 1;
- @SuppressWarnings("unused")
- private static final int GROUP_CAPAB_PERSISTENT_GROUP = 1<<1;
- private static final int GROUP_CAPAB_GROUP_LIMIT = 1<<2;
- @SuppressWarnings("unused")
- private static final int GROUP_CAPAB_INTRA_BSS_DIST = 1<<3;
- @SuppressWarnings("unused")
- private static final int GROUP_CAPAB_CROSS_CONN = 1<<4;
- @SuppressWarnings("unused")
- private static final int GROUP_CAPAB_PERSISTENT_RECONN = 1<<5;
- @SuppressWarnings("unused")
- private static final int GROUP_CAPAB_GROUP_FORMATION = 1<<6;
-
- /**
- * WPS config methods supported
- * @hide
- */
- @UnsupportedAppUsage
- public int wpsConfigMethodsSupported;
-
- /**
- * Device capability
- * @hide
- */
- @UnsupportedAppUsage
- public int deviceCapability;
-
- /**
- * Group capability
- * @hide
- */
- @UnsupportedAppUsage
- public int groupCapability;
-
- public static final int CONNECTED = 0;
- public static final int INVITED = 1;
- public static final int FAILED = 2;
- public static final int AVAILABLE = 3;
- public static final int UNAVAILABLE = 4;
-
- /** Device connection status */
- public int status = UNAVAILABLE;
-
- /** @hide */
- @UnsupportedAppUsage
- public WifiP2pWfdInfo wfdInfo;
-
- /** Detailed device string pattern with WFD info
- * Example:
- * P2P-DEVICE-FOUND 00:18:6b:de:a3:6e p2p_dev_addr=00:18:6b:de:a3:6e
- * pri_dev_type=1-0050F204-1 name='DWD-300-DEA36E' config_methods=0x188
- * dev_capab=0x21 group_capab=0x9
- */
- private static final Pattern detailedDevicePattern = Pattern.compile(
- "((?:[0-9a-f]{2}:){5}[0-9a-f]{2}) " +
- "(\\d+ )?" +
- "p2p_dev_addr=((?:[0-9a-f]{2}:){5}[0-9a-f]{2}) " +
- "pri_dev_type=(\\d+-[0-9a-fA-F]+-\\d+) " +
- "name='(.*)' " +
- "config_methods=(0x[0-9a-fA-F]+) " +
- "dev_capab=(0x[0-9a-fA-F]+) " +
- "group_capab=(0x[0-9a-fA-F]+)" +
- "( wfd_dev_info=0x([0-9a-fA-F]{12}))?"
- );
-
- /** 2 token device address pattern
- * Example:
- * P2P-DEVICE-LOST p2p_dev_addr=fa:7b:7a:42:02:13
- * AP-STA-DISCONNECTED 42:fc:89:a8:96:09
- */
- private static final Pattern twoTokenPattern = Pattern.compile(
- "(p2p_dev_addr=)?((?:[0-9a-f]{2}:){5}[0-9a-f]{2})"
- );
-
- /** 3 token device address pattern
- * Example:
- * AP-STA-CONNECTED 42:fc:89:a8:96:09 p2p_dev_addr=fa:7b:7a:42:02:13
- * AP-STA-DISCONNECTED 42:fc:89:a8:96:09 p2p_dev_addr=fa:7b:7a:42:02:13
- */
- private static final Pattern threeTokenPattern = Pattern.compile(
- "(?:[0-9a-f]{2}:){5}[0-9a-f]{2} p2p_dev_addr=((?:[0-9a-f]{2}:){5}[0-9a-f]{2})"
- );
-
-
- public WifiP2pDevice() {
- }
-
- /**
- * @param string formats supported include
- * P2P-DEVICE-FOUND fa:7b:7a:42:02:13 p2p_dev_addr=fa:7b:7a:42:02:13
- * pri_dev_type=1-0050F204-1 name='p2p-TEST1' config_methods=0x188 dev_capab=0x27
- * group_capab=0x0 wfd_dev_info=000006015d022a0032
- *
- * P2P-DEVICE-LOST p2p_dev_addr=fa:7b:7a:42:02:13
- *
- * AP-STA-CONNECTED 42:fc:89:a8:96:09 [p2p_dev_addr=02:90:4c:a0:92:54]
- *
- * AP-STA-DISCONNECTED 42:fc:89:a8:96:09 [p2p_dev_addr=02:90:4c:a0:92:54]
- *
- * fa:7b:7a:42:02:13
- *
- * Note: The events formats can be looked up in the wpa_supplicant code
- * @hide
- */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public WifiP2pDevice(String string) throws IllegalArgumentException {
- String[] tokens = string.split("[ \n]");
- Matcher match;
-
- if (tokens.length < 1) {
- throw new IllegalArgumentException("Malformed supplicant event");
- }
-
- switch (tokens.length) {
- case 1:
- /* Just a device address */
- deviceAddress = string;
- return;
- case 2:
- match = twoTokenPattern.matcher(string);
- if (!match.find()) {
- throw new IllegalArgumentException("Malformed supplicant event");
- }
- deviceAddress = match.group(2);
- return;
- case 3:
- match = threeTokenPattern.matcher(string);
- if (!match.find()) {
- throw new IllegalArgumentException("Malformed supplicant event");
- }
- deviceAddress = match.group(1);
- return;
- default:
- match = detailedDevicePattern.matcher(string);
- if (!match.find()) {
- throw new IllegalArgumentException("Malformed supplicant event");
- }
-
- deviceAddress = match.group(3);
- primaryDeviceType = match.group(4);
- deviceName = match.group(5);
- wpsConfigMethodsSupported = parseHex(match.group(6));
- deviceCapability = parseHex(match.group(7));
- groupCapability = parseHex(match.group(8));
- if (match.group(9) != null) {
- String str = match.group(10);
- wfdInfo = new WifiP2pWfdInfo(parseHex(str.substring(0,4)),
- parseHex(str.substring(4,8)),
- parseHex(str.substring(8,12)));
- }
- break;
- }
-
- if (tokens[0].startsWith("P2P-DEVICE-FOUND")) {
- status = AVAILABLE;
- }
- }
-
- /** The Wifi Display information for this device, or null if unavailable. */
- @Nullable
- public WifiP2pWfdInfo getWfdInfo() {
- return wfdInfo;
- }
-
- /** Returns true if WPS push button configuration is supported */
- public boolean wpsPbcSupported() {
- return (wpsConfigMethodsSupported & WPS_CONFIG_PUSHBUTTON) != 0;
- }
-
- /** Returns true if WPS keypad configuration is supported */
- public boolean wpsKeypadSupported() {
- return (wpsConfigMethodsSupported & WPS_CONFIG_KEYPAD) != 0;
- }
-
- /** Returns true if WPS display configuration is supported */
- public boolean wpsDisplaySupported() {
- return (wpsConfigMethodsSupported & WPS_CONFIG_DISPLAY) != 0;
- }
-
- /** Returns true if the device is capable of service discovery */
- public boolean isServiceDiscoveryCapable() {
- return (deviceCapability & DEVICE_CAPAB_SERVICE_DISCOVERY) != 0;
- }
-
- /** Returns true if the device is capable of invitation {@hide}*/
- public boolean isInvitationCapable() {
- return (deviceCapability & DEVICE_CAPAB_INVITATION_PROCEDURE) != 0;
- }
-
- /** Returns true if the device reaches the limit. {@hide}*/
- public boolean isDeviceLimit() {
- return (deviceCapability & DEVICE_CAPAB_DEVICE_LIMIT) != 0;
- }
-
- /** Returns true if the device is a group owner */
- public boolean isGroupOwner() {
- return (groupCapability & GROUP_CAPAB_GROUP_OWNER) != 0;
- }
-
- /** Returns true if the group reaches the limit. {@hide}*/
- public boolean isGroupLimit() {
- return (groupCapability & GROUP_CAPAB_GROUP_LIMIT) != 0;
- }
-
- /**
- * Update this device's details using another {@link WifiP2pDevice} instance.
- * This will throw an exception if the device address does not match.
- *
- * @param device another instance of {@link WifiP2pDevice} used to update this instance.
- * @throws IllegalArgumentException if the device is null or the device address does not match
- */
- public void update(@NonNull WifiP2pDevice device) {
- updateSupplicantDetails(device);
- status = device.status;
- }
-
- /** Updates details obtained from supplicant @hide */
- public void updateSupplicantDetails(WifiP2pDevice device) {
- if (device == null) {
- throw new IllegalArgumentException("device is null");
- }
- if (device.deviceAddress == null) {
- throw new IllegalArgumentException("deviceAddress is null");
- }
- if (!deviceAddress.equals(device.deviceAddress)) {
- throw new IllegalArgumentException("deviceAddress does not match");
- }
- deviceName = device.deviceName;
- primaryDeviceType = device.primaryDeviceType;
- secondaryDeviceType = device.secondaryDeviceType;
- wpsConfigMethodsSupported = device.wpsConfigMethodsSupported;
- deviceCapability = device.deviceCapability;
- groupCapability = device.groupCapability;
- wfdInfo = device.wfdInfo;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (!(obj instanceof WifiP2pDevice)) return false;
-
- WifiP2pDevice other = (WifiP2pDevice) obj;
- if (other == null || other.deviceAddress == null) {
- return (deviceAddress == null);
- }
- return other.deviceAddress.equals(deviceAddress);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(deviceAddress);
- }
-
- @Override
- public String toString() {
- StringBuffer sbuf = new StringBuffer();
- sbuf.append("Device: ").append(deviceName);
- sbuf.append("\n deviceAddress: ").append(deviceAddress);
- sbuf.append("\n primary type: ").append(primaryDeviceType);
- sbuf.append("\n secondary type: ").append(secondaryDeviceType);
- sbuf.append("\n wps: ").append(wpsConfigMethodsSupported);
- sbuf.append("\n grpcapab: ").append(groupCapability);
- sbuf.append("\n devcapab: ").append(deviceCapability);
- sbuf.append("\n status: ").append(status);
- sbuf.append("\n wfdInfo: ").append(wfdInfo);
- return sbuf.toString();
- }
-
- /** Implement the Parcelable interface */
- @Override
- public int describeContents() {
- return 0;
- }
-
- /** copy constructor */
- public WifiP2pDevice(WifiP2pDevice source) {
- if (source != null) {
- deviceName = source.deviceName;
- deviceAddress = source.deviceAddress;
- primaryDeviceType = source.primaryDeviceType;
- secondaryDeviceType = source.secondaryDeviceType;
- wpsConfigMethodsSupported = source.wpsConfigMethodsSupported;
- deviceCapability = source.deviceCapability;
- groupCapability = source.groupCapability;
- status = source.status;
- if (source.wfdInfo != null) {
- wfdInfo = new WifiP2pWfdInfo(source.wfdInfo);
- }
- }
- }
-
- /** Implement the Parcelable interface */
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(deviceName);
- dest.writeString(deviceAddress);
- dest.writeString(primaryDeviceType);
- dest.writeString(secondaryDeviceType);
- dest.writeInt(wpsConfigMethodsSupported);
- dest.writeInt(deviceCapability);
- dest.writeInt(groupCapability);
- dest.writeInt(status);
- if (wfdInfo != null) {
- dest.writeInt(1);
- wfdInfo.writeToParcel(dest, flags);
- } else {
- dest.writeInt(0);
- }
- }
-
- /** Implement the Parcelable interface */
- public static final @android.annotation.NonNull Creator<WifiP2pDevice> CREATOR =
- new Creator<WifiP2pDevice>() {
- @Override
- public WifiP2pDevice createFromParcel(Parcel in) {
- WifiP2pDevice device = new WifiP2pDevice();
- device.deviceName = in.readString();
- device.deviceAddress = in.readString();
- device.primaryDeviceType = in.readString();
- device.secondaryDeviceType = in.readString();
- device.wpsConfigMethodsSupported = in.readInt();
- device.deviceCapability = in.readInt();
- device.groupCapability = in.readInt();
- device.status = in.readInt();
- if (in.readInt() == 1) {
- device.wfdInfo = WifiP2pWfdInfo.CREATOR.createFromParcel(in);
- }
- return device;
- }
-
- @Override
- public WifiP2pDevice[] newArray(int size) {
- return new WifiP2pDevice[size];
- }
- };
-
- //supported formats: 0x1abc, 0X1abc, 1abc
- private int parseHex(String hexString) {
- int num = 0;
- if (hexString.startsWith("0x") || hexString.startsWith("0X")) {
- hexString = hexString.substring(2);
- }
-
- try {
- num = Integer.parseInt(hexString, 16);
- } catch(NumberFormatException e) {
- Log.e(TAG, "Failed to parse hex string " + hexString);
- }
- return num;
- }
-}
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pDeviceList.java b/wifi/java/android/net/wifi/p2p/WifiP2pDeviceList.java
deleted file mode 100644
index e7866e6..0000000
--- a/wifi/java/android/net/wifi/p2p/WifiP2pDeviceList.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright (C) 2011 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.p2p;
-
-import android.compat.annotation.UnsupportedAppUsage;
-import android.os.Build;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.text.TextUtils;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-
-/**
- * A class representing a Wi-Fi P2p device list.
- *
- * Note that the operations are not thread safe.
- * {@see WifiP2pManager}
- */
-public class WifiP2pDeviceList implements Parcelable {
-
- private final HashMap<String, WifiP2pDevice> mDevices = new HashMap<String, WifiP2pDevice>();
-
- public WifiP2pDeviceList() {
- }
-
- /** copy constructor */
- public WifiP2pDeviceList(WifiP2pDeviceList source) {
- if (source != null) {
- for (WifiP2pDevice d : source.getDeviceList()) {
- mDevices.put(d.deviceAddress, new WifiP2pDevice(d));
- }
- }
- }
-
- /** @hide */
- public WifiP2pDeviceList(ArrayList<WifiP2pDevice> devices) {
- for (WifiP2pDevice device : devices) {
- if (device.deviceAddress != null) {
- mDevices.put(device.deviceAddress, new WifiP2pDevice(device));
- }
- }
- }
-
- private void validateDevice(WifiP2pDevice device) {
- if (device == null) throw new IllegalArgumentException("Null device");
- if (TextUtils.isEmpty(device.deviceAddress)) {
- throw new IllegalArgumentException("Empty deviceAddress");
- }
- }
-
- private void validateDeviceAddress(String deviceAddress) {
- if (TextUtils.isEmpty(deviceAddress)) {
- throw new IllegalArgumentException("Empty deviceAddress");
- }
- }
-
- /** Clear the list @hide */
- public boolean clear() {
- if (mDevices.isEmpty()) return false;
- mDevices.clear();
- return true;
- }
-
- /**
- * Add/update a device to the list. If the device is not found, a new device entry
- * is created. If the device is already found, the device details are updated
- * @param device to be updated
- * @hide
- */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public void update(WifiP2pDevice device) {
- updateSupplicantDetails(device);
- mDevices.get(device.deviceAddress).status = device.status;
- }
-
- /** Only updates details fetched from the supplicant @hide */
- public void updateSupplicantDetails(WifiP2pDevice device) {
- validateDevice(device);
- WifiP2pDevice d = mDevices.get(device.deviceAddress);
- if (d != null) {
- d.deviceName = device.deviceName;
- d.primaryDeviceType = device.primaryDeviceType;
- d.secondaryDeviceType = device.secondaryDeviceType;
- d.wpsConfigMethodsSupported = device.wpsConfigMethodsSupported;
- d.deviceCapability = device.deviceCapability;
- d.groupCapability = device.groupCapability;
- d.wfdInfo = device.wfdInfo;
- return;
- }
- //Not found, add a new one
- mDevices.put(device.deviceAddress, device);
- }
-
- /** @hide */
- public void updateGroupCapability(String deviceAddress, int groupCapab) {
- validateDeviceAddress(deviceAddress);
- WifiP2pDevice d = mDevices.get(deviceAddress);
- if (d != null) {
- d.groupCapability = groupCapab;
- }
- }
-
- /** @hide */
- public void updateStatus(String deviceAddress, int status) {
- validateDeviceAddress(deviceAddress);
- WifiP2pDevice d = mDevices.get(deviceAddress);
- if (d != null) {
- d.status = status;
- }
- }
-
- /**
- * Fetch a device from the list
- * @param deviceAddress is the address of the device
- * @return WifiP2pDevice device found, or null if none found
- */
- public WifiP2pDevice get(String deviceAddress) {
- validateDeviceAddress(deviceAddress);
- return mDevices.get(deviceAddress);
- }
-
- /** @hide */
- public boolean remove(WifiP2pDevice device) {
- validateDevice(device);
- return mDevices.remove(device.deviceAddress) != null;
- }
-
- /**
- * Remove a device from the list
- * @param deviceAddress is the address of the device
- * @return WifiP2pDevice device removed, or null if none removed
- * @hide
- */
- @UnsupportedAppUsage
- public WifiP2pDevice remove(String deviceAddress) {
- validateDeviceAddress(deviceAddress);
- return mDevices.remove(deviceAddress);
- }
-
- /** Returns true if any device the list was removed @hide */
- public boolean remove(WifiP2pDeviceList list) {
- boolean ret = false;
- for (WifiP2pDevice d : list.mDevices.values()) {
- if (remove(d)) ret = true;
- }
- return ret;
- }
-
- /** Get the list of devices */
- public Collection<WifiP2pDevice> getDeviceList() {
- return Collections.unmodifiableCollection(mDevices.values());
- }
-
- /** @hide */
- public boolean isGroupOwner(String deviceAddress) {
- validateDeviceAddress(deviceAddress);
- WifiP2pDevice device = mDevices.get(deviceAddress);
- if (device == null) {
- throw new IllegalArgumentException("Device not found " + deviceAddress);
- }
- return device.isGroupOwner();
- }
-
- public String toString() {
- StringBuffer sbuf = new StringBuffer();
- for (WifiP2pDevice device : mDevices.values()) {
- sbuf.append("\n").append(device);
- }
- return sbuf.toString();
- }
-
- /** Implement the Parcelable interface */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(mDevices.size());
- for(WifiP2pDevice device : mDevices.values()) {
- dest.writeParcelable(device, flags);
- }
- }
-
- /** Implement the Parcelable interface */
- public static final @android.annotation.NonNull Creator<WifiP2pDeviceList> CREATOR =
- new Creator<WifiP2pDeviceList>() {
- public WifiP2pDeviceList createFromParcel(Parcel in) {
- WifiP2pDeviceList deviceList = new WifiP2pDeviceList();
-
- int deviceCount = in.readInt();
- for (int i = 0; i < deviceCount; i++) {
- deviceList.update((WifiP2pDevice)in.readParcelable(null));
- }
- return deviceList;
- }
-
- public WifiP2pDeviceList[] newArray(int size) {
- return new WifiP2pDeviceList[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pGroup.java b/wifi/java/android/net/wifi/p2p/WifiP2pGroup.java
deleted file mode 100644
index e497b22..0000000
--- a/wifi/java/android/net/wifi/p2p/WifiP2pGroup.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- * Copyright (C) 2011 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.p2p;
-
-import android.annotation.Nullable;
-import android.compat.annotation.UnsupportedAppUsage;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * A class representing a Wi-Fi P2p group. A p2p group consists of a single group
- * owner and one or more clients. In the case of a group with only two devices, one
- * will be the group owner and the other will be a group client.
- *
- * {@see WifiP2pManager}
- */
-public class WifiP2pGroup implements Parcelable {
-
- /**
- * The temporary network id.
- * @see #getNetworkId()
- */
- public static final int NETWORK_ID_TEMPORARY = -1;
-
- /**
- * The temporary network id.
- *
- * @hide
- */
- @UnsupportedAppUsage
- public static final int TEMPORARY_NET_ID = NETWORK_ID_TEMPORARY;
-
- /**
- * The persistent network id.
- * If a matching persistent profile is found, use it.
- * Otherwise, create a new persistent profile.
- * @see #getNetworkId()
- */
- public static final int NETWORK_ID_PERSISTENT = -2;
-
- /** The network name */
- private String mNetworkName;
-
- /** Group owner */
- private WifiP2pDevice mOwner;
-
- /** Device is group owner */
- private boolean mIsGroupOwner;
-
- /** Group clients */
- private List<WifiP2pDevice> mClients = new ArrayList<WifiP2pDevice>();
-
- /** The passphrase used for WPA2-PSK */
- private String mPassphrase;
-
- private String mInterface;
-
- /** The network ID in wpa_supplicant */
- private int mNetId;
-
- /** The frequency (in MHz) used by this group */
- private int mFrequency;
-
- /** P2P group started string pattern */
- private static final Pattern groupStartedPattern = Pattern.compile(
- "ssid=\"(.+)\" " +
- "freq=(\\d+) " +
- "(?:psk=)?([0-9a-fA-F]{64})?" +
- "(?:passphrase=)?(?:\"(.{0,63})\")? " +
- "go_dev_addr=((?:[0-9a-f]{2}:){5}[0-9a-f]{2})" +
- " ?(\\[PERSISTENT\\])?"
- );
-
- public WifiP2pGroup() {
- }
-
- /**
- * @param supplicantEvent formats supported include
- *
- * P2P-GROUP-STARTED p2p-wlan0-0 [client|GO] ssid="DIRECT-W8" freq=2437
- * [psk=2182b2e50e53f260d04f3c7b25ef33c965a3291b9b36b455a82d77fd82ca15bc|
- * passphrase="fKG4jMe3"] go_dev_addr=fa:7b:7a:42:02:13 [PERSISTENT]
- *
- * P2P-GROUP-REMOVED p2p-wlan0-0 [client|GO] reason=REQUESTED
- *
- * P2P-INVITATION-RECEIVED sa=fa:7b:7a:42:02:13 go_dev_addr=f8:7b:7a:42:02:13
- * bssid=fa:7b:7a:42:82:13 unknown-network
- *
- * P2P-INVITATION-RECEIVED sa=b8:f9:34:2a:c7:9d persistent=0
- *
- * Note: The events formats can be looked up in the wpa_supplicant code
- * @hide
- */
- @UnsupportedAppUsage
- public WifiP2pGroup(String supplicantEvent) throws IllegalArgumentException {
-
- String[] tokens = supplicantEvent.split(" ");
-
- if (tokens.length < 3) {
- throw new IllegalArgumentException("Malformed supplicant event");
- }
-
- if (tokens[0].startsWith("P2P-GROUP")) {
- mInterface = tokens[1];
- mIsGroupOwner = tokens[2].equals("GO");
-
- Matcher match = groupStartedPattern.matcher(supplicantEvent);
- if (!match.find()) {
- return;
- }
-
- mNetworkName = match.group(1);
- // It throws NumberFormatException if the string cannot be parsed as an integer.
- mFrequency = Integer.parseInt(match.group(2));
- // psk is unused right now
- //String psk = match.group(3);
- mPassphrase = match.group(4);
- mOwner = new WifiP2pDevice(match.group(5));
- if (match.group(6) != null) {
- mNetId = NETWORK_ID_PERSISTENT;
- } else {
- mNetId = NETWORK_ID_TEMPORARY;
- }
- } else if (tokens[0].equals("P2P-INVITATION-RECEIVED")) {
- String sa = null;
- mNetId = NETWORK_ID_PERSISTENT;
- for (String token : tokens) {
- String[] nameValue = token.split("=");
- if (nameValue.length != 2) continue;
-
- if (nameValue[0].equals("sa")) {
- sa = nameValue[1];
-
- // set source address into the client list.
- WifiP2pDevice dev = new WifiP2pDevice();
- dev.deviceAddress = nameValue[1];
- mClients.add(dev);
- continue;
- }
-
- if (nameValue[0].equals("go_dev_addr")) {
- mOwner = new WifiP2pDevice(nameValue[1]);
- continue;
- }
-
- if (nameValue[0].equals("persistent")) {
- mNetId = Integer.parseInt(nameValue[1]);
- continue;
- }
- }
- } else {
- throw new IllegalArgumentException("Malformed supplicant event");
- }
- }
-
- /** @hide */
- public void setNetworkName(String networkName) {
- mNetworkName = networkName;
- }
-
- /**
- * Get the network name (SSID) of the group. Legacy Wi-Fi clients will discover
- * the p2p group using the network name.
- */
- public String getNetworkName() {
- return mNetworkName;
- }
-
- /** @hide */
- @UnsupportedAppUsage
- public void setIsGroupOwner(boolean isGo) {
- mIsGroupOwner = isGo;
- }
-
- /** Check whether this device is the group owner of the created p2p group */
- public boolean isGroupOwner() {
- return mIsGroupOwner;
- }
-
- /** @hide */
- public void setOwner(WifiP2pDevice device) {
- mOwner = device;
- }
-
- /** Get the details of the group owner as a {@link WifiP2pDevice} object */
- public WifiP2pDevice getOwner() {
- return mOwner;
- }
-
- /** @hide */
- public void addClient(String address) {
- addClient(new WifiP2pDevice(address));
- }
-
- /** @hide */
- public void addClient(WifiP2pDevice device) {
- for (WifiP2pDevice client : mClients) {
- if (client.equals(device)) return;
- }
- mClients.add(device);
- }
-
- /** @hide */
- public boolean removeClient(String address) {
- return mClients.remove(new WifiP2pDevice(address));
- }
-
- /** @hide */
- public boolean removeClient(WifiP2pDevice device) {
- return mClients.remove(device);
- }
-
- /** @hide */
- @UnsupportedAppUsage
- public boolean isClientListEmpty() {
- return mClients.size() == 0;
- }
-
- /**
- * Returns {@code true} if the device is part of the group, {@code false} otherwise.
- *
- * @hide
- */
- public boolean contains(@Nullable WifiP2pDevice device) {
- return mOwner.equals(device) || mClients.contains(device);
- }
-
- /** Get the list of clients currently part of the p2p group */
- public Collection<WifiP2pDevice> getClientList() {
- return Collections.unmodifiableCollection(mClients);
- }
-
- /** @hide */
- public void setPassphrase(String passphrase) {
- mPassphrase = passphrase;
- }
-
- /**
- * Get the passphrase of the group. This function will return a valid passphrase only
- * at the group owner. Legacy Wi-Fi clients will need this passphrase alongside
- * network name obtained from {@link #getNetworkName()} to join the group
- */
- public String getPassphrase() {
- return mPassphrase;
- }
-
- /** @hide */
- @UnsupportedAppUsage
- public void setInterface(String intf) {
- mInterface = intf;
- }
-
- /** Get the interface name on which the group is created */
- public String getInterface() {
- return mInterface;
- }
-
- /** The network ID of the P2P group in wpa_supplicant. */
- public int getNetworkId() {
- return mNetId;
- }
-
- /** @hide */
- @UnsupportedAppUsage
- public void setNetworkId(int netId) {
- this.mNetId = netId;
- }
-
- /** Get the operating frequency (in MHz) of the p2p group */
- public int getFrequency() {
- return mFrequency;
- }
-
- /** @hide */
- public void setFrequency(int freq) {
- this.mFrequency = freq;
- }
-
- public String toString() {
- StringBuffer sbuf = new StringBuffer();
- sbuf.append("network: ").append(mNetworkName);
- sbuf.append("\n isGO: ").append(mIsGroupOwner);
- sbuf.append("\n GO: ").append(mOwner);
- for (WifiP2pDevice client : mClients) {
- sbuf.append("\n Client: ").append(client);
- }
- sbuf.append("\n interface: ").append(mInterface);
- sbuf.append("\n networkId: ").append(mNetId);
- sbuf.append("\n frequency: ").append(mFrequency);
- return sbuf.toString();
- }
-
- /** Implement the Parcelable interface */
- public int describeContents() {
- return 0;
- }
-
- /** copy constructor */
- public WifiP2pGroup(WifiP2pGroup source) {
- if (source != null) {
- mNetworkName = source.getNetworkName();
- mOwner = new WifiP2pDevice(source.getOwner());
- mIsGroupOwner = source.mIsGroupOwner;
- for (WifiP2pDevice d : source.getClientList()) mClients.add(d);
- mPassphrase = source.getPassphrase();
- mInterface = source.getInterface();
- mNetId = source.getNetworkId();
- mFrequency = source.getFrequency();
- }
- }
-
- /** Implement the Parcelable interface */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(mNetworkName);
- dest.writeParcelable(mOwner, flags);
- dest.writeByte(mIsGroupOwner ? (byte) 1: (byte) 0);
- dest.writeInt(mClients.size());
- for (WifiP2pDevice client : mClients) {
- dest.writeParcelable(client, flags);
- }
- dest.writeString(mPassphrase);
- dest.writeString(mInterface);
- dest.writeInt(mNetId);
- dest.writeInt(mFrequency);
- }
-
- /** Implement the Parcelable interface */
- public static final @android.annotation.NonNull Creator<WifiP2pGroup> CREATOR =
- new Creator<WifiP2pGroup>() {
- public WifiP2pGroup createFromParcel(Parcel in) {
- WifiP2pGroup group = new WifiP2pGroup();
- group.setNetworkName(in.readString());
- group.setOwner((WifiP2pDevice)in.readParcelable(null));
- group.setIsGroupOwner(in.readByte() == (byte)1);
- int clientCount = in.readInt();
- for (int i=0; i<clientCount; i++) {
- group.addClient((WifiP2pDevice) in.readParcelable(null));
- }
- group.setPassphrase(in.readString());
- group.setInterface(in.readString());
- group.setNetworkId(in.readInt());
- group.setFrequency(in.readInt());
- return group;
- }
-
- public WifiP2pGroup[] newArray(int size) {
- return new WifiP2pGroup[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pGroupList.java b/wifi/java/android/net/wifi/p2p/WifiP2pGroupList.java
deleted file mode 100644
index 8a86311..0000000
--- a/wifi/java/android/net/wifi/p2p/WifiP2pGroupList.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright (C) 2012 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.p2p;
-
-import android.annotation.NonNull;
-import android.annotation.SystemApi;
-import android.compat.annotation.UnsupportedAppUsage;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.util.LruCache;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-
-/**
- * A class representing a Wi-Fi P2p group list
- *
- * {@see WifiP2pManager}
- * @hide
- */
-@SystemApi
-public final class WifiP2pGroupList implements Parcelable {
-
- private static final int CREDENTIAL_MAX_NUM = 32;
-
- @UnsupportedAppUsage
- private final LruCache<Integer, WifiP2pGroup> mGroups;
- private final GroupDeleteListener mListener;
-
- private boolean isClearCalled = false;
-
- /** @hide */
- public interface GroupDeleteListener {
- public void onDeleteGroup(int netId);
- }
-
- /** @hide */
- public WifiP2pGroupList() {
- this(null, null);
- }
-
- /** @hide */
- @UnsupportedAppUsage
- public WifiP2pGroupList(WifiP2pGroupList source, GroupDeleteListener listener) {
- mListener = listener;
- mGroups = new LruCache<Integer, WifiP2pGroup>(CREDENTIAL_MAX_NUM) {
- @Override
- protected void entryRemoved(boolean evicted, Integer netId,
- WifiP2pGroup oldValue, WifiP2pGroup newValue) {
- if (mListener != null && !isClearCalled) {
- mListener.onDeleteGroup(oldValue.getNetworkId());
- }
- }
- };
-
- if (source != null) {
- for (Map.Entry<Integer, WifiP2pGroup> item : source.mGroups.snapshot().entrySet()) {
- mGroups.put(item.getKey(), item.getValue());
- }
- }
- }
-
- /**
- * Get the list of P2P groups.
- */
- @NonNull
- public List<WifiP2pGroup> getGroupList() {
- return new ArrayList<>(mGroups.snapshot().values());
- }
-
- /**
- * Add the specified group to this group list.
- *
- * @param group
- * @hide
- */
- public void add(WifiP2pGroup group) {
- mGroups.put(group.getNetworkId(), group);
- }
-
- /**
- * Remove the group with the specified network id from this group list.
- *
- * @param netId
- * @hide
- */
- public void remove(int netId) {
- mGroups.remove(netId);
- }
-
- /**
- * Remove the group with the specified device address from this group list.
- *
- * @param deviceAddress
- */
- void remove(String deviceAddress) {
- remove(getNetworkId(deviceAddress));
- }
-
- /**
- * Clear the group.
- * @hide
- */
- public boolean clear() {
- if (mGroups.size() == 0) return false;
- isClearCalled = true;
- mGroups.evictAll();
- isClearCalled = false;
- return true;
- }
-
- /**
- * Return the network id of the group owner profile with the specified p2p device
- * address.
- * If more than one persistent group of the same address is present in the list,
- * return the first one.
- *
- * @param deviceAddress p2p device address.
- * @return the network id. if not found, return -1.
- * @hide
- */
- public int getNetworkId(String deviceAddress) {
- if (deviceAddress == null) return -1;
-
- final Collection<WifiP2pGroup> groups = mGroups.snapshot().values();
- for (WifiP2pGroup grp: groups) {
- if (deviceAddress.equalsIgnoreCase(grp.getOwner().deviceAddress)) {
- // update cache ordered.
- mGroups.get(grp.getNetworkId());
- return grp.getNetworkId();
- }
- }
- return -1;
- }
-
- /**
- * Return the network id of the group with the specified p2p device address
- * and the ssid.
- *
- * @param deviceAddress p2p device address.
- * @param ssid ssid.
- * @return the network id. if not found, return -1.
- * @hide
- */
- public int getNetworkId(String deviceAddress, String ssid) {
- if (deviceAddress == null || ssid == null) {
- return -1;
- }
-
- final Collection<WifiP2pGroup> groups = mGroups.snapshot().values();
- for (WifiP2pGroup grp: groups) {
- if (deviceAddress.equalsIgnoreCase(grp.getOwner().deviceAddress) &&
- ssid.equals(grp.getNetworkName())) {
- // update cache ordered.
- mGroups.get(grp.getNetworkId());
- return grp.getNetworkId();
- }
- }
-
- return -1;
- }
-
- /**
- * Return the group owner address of the group with the specified network id
- *
- * @param netId network id.
- * @return the address. if not found, return null.
- * @hide
- */
- public String getOwnerAddr(int netId) {
- WifiP2pGroup grp = mGroups.get(netId);
- if (grp != null) {
- return grp.getOwner().deviceAddress;
- }
- return null;
- }
-
- /**
- * Return true if this group list contains the specified network id.
- * This function does NOT update LRU information.
- * It means the internal queue is NOT reordered.
- *
- * @param netId network id.
- * @return true if the specified network id is present in this group list.
- * @hide
- */
- public boolean contains(int netId) {
- final Collection<WifiP2pGroup> groups = mGroups.snapshot().values();
- for (WifiP2pGroup grp: groups) {
- if (netId == grp.getNetworkId()) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public String toString() {
- StringBuffer sbuf = new StringBuffer();
-
- final Collection<WifiP2pGroup> groups = mGroups.snapshot().values();
- for (WifiP2pGroup grp: groups) {
- sbuf.append(grp).append("\n");
- }
- return sbuf.toString();
- }
-
- /** Implement the Parcelable interface */
- @Override
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface */
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- final Collection<WifiP2pGroup> groups = mGroups.snapshot().values();
- dest.writeInt(groups.size());
- for(WifiP2pGroup group : groups) {
- dest.writeParcelable(group, flags);
- }
- }
-
- /** Implement the Parcelable interface */
- public static final @NonNull Creator<WifiP2pGroupList> CREATOR =
- new Creator<WifiP2pGroupList>() {
- public WifiP2pGroupList createFromParcel(Parcel in) {
- WifiP2pGroupList grpList = new WifiP2pGroupList();
-
- int deviceCount = in.readInt();
- for (int i = 0; i < deviceCount; i++) {
- grpList.add((WifiP2pGroup)in.readParcelable(null));
- }
- return grpList;
- }
-
- public WifiP2pGroupList[] newArray(int size) {
- return new WifiP2pGroupList[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pInfo.java b/wifi/java/android/net/wifi/p2p/WifiP2pInfo.java
deleted file mode 100644
index 33bc37e..0000000
--- a/wifi/java/android/net/wifi/p2p/WifiP2pInfo.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2011 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.p2p;
-
-import android.os.Parcelable;
-import android.os.Parcel;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-/**
- * A class representing connection information about a Wi-Fi p2p group
- *
- * {@see WifiP2pManager}
- */
-public class WifiP2pInfo implements Parcelable {
-
- /** Indicates if a p2p group has been successfully formed */
- public boolean groupFormed;
-
- /** Indicates if the current device is the group owner */
- public boolean isGroupOwner;
-
- /** Group owner address */
- public InetAddress groupOwnerAddress;
-
- public WifiP2pInfo() {
- }
-
- public String toString() {
- StringBuffer sbuf = new StringBuffer();
- sbuf.append("groupFormed: ").append(groupFormed)
- .append(" isGroupOwner: ").append(isGroupOwner)
- .append(" groupOwnerAddress: ").append(groupOwnerAddress);
- return sbuf.toString();
- }
-
- /** Implement the Parcelable interface */
- public int describeContents() {
- return 0;
- }
-
- /** copy constructor */
- public WifiP2pInfo(WifiP2pInfo source) {
- if (source != null) {
- groupFormed = source.groupFormed;
- isGroupOwner = source.isGroupOwner;
- groupOwnerAddress = source.groupOwnerAddress;
- }
- }
-
- /** Implement the Parcelable interface */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeByte(groupFormed ? (byte)1 : (byte)0);
- dest.writeByte(isGroupOwner ? (byte)1 : (byte)0);
-
- if (groupOwnerAddress != null) {
- dest.writeByte((byte)1);
- dest.writeByteArray(groupOwnerAddress.getAddress());
- } else {
- dest.writeByte((byte)0);
- }
- }
-
- /** Implement the Parcelable interface */
- public static final @android.annotation.NonNull Creator<WifiP2pInfo> CREATOR =
- new Creator<WifiP2pInfo>() {
- public WifiP2pInfo createFromParcel(Parcel in) {
- WifiP2pInfo info = new WifiP2pInfo();
- info.groupFormed = (in.readByte() == 1);
- info.isGroupOwner = (in.readByte() == 1);
- if (in.readByte() == 1) {
- try {
- info.groupOwnerAddress = InetAddress.getByAddress(in.createByteArray());
- } catch (UnknownHostException e) {}
- }
- return info;
- }
-
- public WifiP2pInfo[] newArray(int size) {
- return new WifiP2pInfo[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pManager.java b/wifi/java/android/net/wifi/p2p/WifiP2pManager.java
deleted file mode 100644
index 13ac7a0..0000000
--- a/wifi/java/android/net/wifi/p2p/WifiP2pManager.java
+++ /dev/null
@@ -1,2039 +0,0 @@
-/*
- * Copyright (C) 2011 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.p2p;
-
-import android.annotation.IntDef;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.RequiresPermission;
-import android.annotation.SdkConstant;
-import android.annotation.SdkConstant.SdkConstantType;
-import android.annotation.SystemApi;
-import android.annotation.SystemService;
-import android.compat.annotation.UnsupportedAppUsage;
-import android.content.Context;
-import android.net.NetworkInfo;
-import android.net.wifi.WpsInfo;
-import android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceInfo;
-import android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceResponse;
-import android.net.wifi.p2p.nsd.WifiP2pServiceInfo;
-import android.net.wifi.p2p.nsd.WifiP2pServiceRequest;
-import android.net.wifi.p2p.nsd.WifiP2pServiceResponse;
-import android.net.wifi.p2p.nsd.WifiP2pUpnpServiceInfo;
-import android.net.wifi.p2p.nsd.WifiP2pUpnpServiceResponse;
-import android.os.Binder;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.Message;
-import android.os.Messenger;
-import android.os.RemoteException;
-import android.text.TextUtils;
-import android.util.CloseGuard;
-import android.util.Log;
-
-import com.android.internal.util.AsyncChannel;
-import com.android.internal.util.Protocol;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.ref.Reference;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * This class provides the API for managing Wi-Fi peer-to-peer connectivity. This lets an
- * application discover available peers, setup connection to peers and query for the list of peers.
- * When a p2p connection is formed over wifi, the device continues to maintain the uplink
- * connection over mobile or any other available network for internet connectivity on the device.
- *
- * <p> The API is asynchronous and responses to requests from an application are on listener
- * callbacks provided by the application. The application needs to do an initialization with
- * {@link #initialize} before doing any p2p operation.
- *
- * <p> Most application calls need a {@link ActionListener} instance for receiving callbacks
- * {@link ActionListener#onSuccess} or {@link ActionListener#onFailure}. Action callbacks
- * indicate whether the initiation of the action was a success or a failure.
- * Upon failure, the reason of failure can be one of {@link #ERROR}, {@link #P2P_UNSUPPORTED}
- * or {@link #BUSY}.
- *
- * <p> An application can initiate discovery of peers with {@link #discoverPeers}. An initiated
- * discovery request from an application stays active until the device starts connecting to a peer
- * ,forms a p2p group or there is an explicit {@link #stopPeerDiscovery}.
- * Applications can listen to {@link #WIFI_P2P_DISCOVERY_CHANGED_ACTION} to know if a peer-to-peer
- * discovery is running or stopped. Additionally, {@link #WIFI_P2P_PEERS_CHANGED_ACTION} indicates
- * if the peer list has changed.
- *
- * <p> When an application needs to fetch the current list of peers, it can request the list
- * of peers with {@link #requestPeers}. When the peer list is available
- * {@link PeerListListener#onPeersAvailable} is called with the device list.
- *
- * <p> An application can initiate a connection request to a peer through {@link #connect}. See
- * {@link WifiP2pConfig} for details on setting up the configuration. For communication with legacy
- * Wi-Fi devices that do not support p2p, an app can create a group using {@link #createGroup}
- * which creates an access point whose details can be fetched with {@link #requestGroupInfo}.
- *
- * <p> After a successful group formation through {@link #createGroup} or through {@link #connect},
- * use {@link #requestConnectionInfo} to fetch the connection details. The connection info
- * {@link WifiP2pInfo} contains the address of the group owner
- * {@link WifiP2pInfo#groupOwnerAddress} and a flag {@link WifiP2pInfo#isGroupOwner} to indicate
- * if the current device is a p2p group owner. A p2p client can thus communicate with
- * the p2p group owner through a socket connection. If the current device is the p2p group owner,
- * {@link WifiP2pInfo#groupOwnerAddress} is anonymized unless the caller holds the
- * {@code android.Manifest.permission#LOCAL_MAC_ADDRESS} permission.
- *
- * <p> With peer discovery using {@link #discoverPeers}, an application discovers the neighboring
- * peers, but has no good way to figure out which peer to establish a connection with. For example,
- * if a game application is interested in finding all the neighboring peers that are also running
- * the same game, it has no way to find out until after the connection is setup. Pre-association
- * service discovery is meant to address this issue of filtering the peers based on the running
- * services.
- *
- * <p>With pre-association service discovery, an application can advertise a service for a
- * application on a peer device prior to a connection setup between the devices.
- * Currently, DNS based service discovery (Bonjour) and Upnp are the higher layer protocols
- * supported. Get Bonjour resources at dns-sd.org and Upnp resources at upnp.org
- * As an example, a video application can discover a Upnp capable media renderer
- * prior to setting up a Wi-fi p2p connection with the device.
- *
- * <p> An application can advertise a Upnp or a Bonjour service with a call to
- * {@link #addLocalService}. After a local service is added,
- * the framework automatically responds to a peer application discovering the service prior
- * to establishing a p2p connection. A call to {@link #removeLocalService} removes a local
- * service and {@link #clearLocalServices} can be used to clear all local services.
- *
- * <p> An application that is looking for peer devices that support certain services
- * can do so with a call to {@link #discoverServices}. Prior to initiating the discovery,
- * application can add service discovery request with a call to {@link #addServiceRequest},
- * remove a service discovery request with a call to {@link #removeServiceRequest} or clear
- * all requests with a call to {@link #clearServiceRequests}. When no service requests remain,
- * a previously running service discovery will stop.
- *
- * The application is notified of a result of service discovery request through listener callbacks
- * set through {@link #setDnsSdResponseListeners} for Bonjour or
- * {@link #setUpnpServiceResponseListener} for Upnp.
- *
- * <p class="note"><strong>Note:</strong>
- * Registering an application handler with {@link #initialize} requires the permissions
- * {@link android.Manifest.permission#ACCESS_WIFI_STATE} and
- * {@link android.Manifest.permission#CHANGE_WIFI_STATE} to perform any further peer-to-peer
- * operations.
- *
- * {@see WifiP2pConfig}
- * {@see WifiP2pInfo}
- * {@see WifiP2pGroup}
- * {@see WifiP2pDevice}
- * {@see WifiP2pDeviceList}
- * {@see android.net.wifi.WpsInfo}
- */
-@SystemService(Context.WIFI_P2P_SERVICE)
-public class WifiP2pManager {
- private static final String TAG = "WifiP2pManager";
- /**
- * Broadcast intent action to indicate whether Wi-Fi p2p is enabled or disabled. An
- * extra {@link #EXTRA_WIFI_STATE} provides the state information as int.
- *
- * @see #EXTRA_WIFI_STATE
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String WIFI_P2P_STATE_CHANGED_ACTION =
- "android.net.wifi.p2p.STATE_CHANGED";
-
- /**
- * The lookup key for an int that indicates whether Wi-Fi p2p is enabled or disabled.
- * Retrieve it with {@link android.content.Intent#getIntExtra(String,int)}.
- *
- * @see #WIFI_P2P_STATE_DISABLED
- * @see #WIFI_P2P_STATE_ENABLED
- */
- public static final String EXTRA_WIFI_STATE = "wifi_p2p_state";
-
- /** @hide */
- @IntDef({
- WIFI_P2P_STATE_DISABLED,
- WIFI_P2P_STATE_ENABLED})
- @Retention(RetentionPolicy.SOURCE)
- public @interface WifiP2pState {
- }
-
- /**
- * Wi-Fi p2p is disabled.
- *
- * @see #WIFI_P2P_STATE_CHANGED_ACTION
- */
- public static final int WIFI_P2P_STATE_DISABLED = 1;
-
- /**
- * Wi-Fi p2p is enabled.
- *
- * @see #WIFI_P2P_STATE_CHANGED_ACTION
- */
- public static final int WIFI_P2P_STATE_ENABLED = 2;
-
- /**
- * Broadcast intent action indicating that the state of Wi-Fi p2p connectivity
- * has changed. One extra {@link #EXTRA_WIFI_P2P_INFO} provides the p2p connection info in
- * the form of a {@link WifiP2pInfo} object. Another extra {@link #EXTRA_NETWORK_INFO} provides
- * the network info in the form of a {@link android.net.NetworkInfo}. A third extra provides
- * the details of the group and may contain a {@code null}.
- *
- * All of these permissions are required to receive this broadcast:
- * {@link android.Manifest.permission#ACCESS_FINE_LOCATION} and
- * {@link android.Manifest.permission#ACCESS_WIFI_STATE}
- *
- * @see #EXTRA_WIFI_P2P_INFO
- * @see #EXTRA_NETWORK_INFO
- * @see #EXTRA_WIFI_P2P_GROUP
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String WIFI_P2P_CONNECTION_CHANGED_ACTION =
- "android.net.wifi.p2p.CONNECTION_STATE_CHANGE";
-
- /**
- * The lookup key for a {@link android.net.wifi.p2p.WifiP2pInfo} object
- * Retrieve with {@link android.content.Intent#getParcelableExtra(String)}.
- */
- public static final String EXTRA_WIFI_P2P_INFO = "wifiP2pInfo";
-
- /**
- * The lookup key for a {@link android.net.NetworkInfo} object associated with the
- * p2p network. Retrieve with
- * {@link android.content.Intent#getParcelableExtra(String)}.
- */
- public static final String EXTRA_NETWORK_INFO = "networkInfo";
-
- /**
- * The lookup key for a {@link android.net.wifi.p2p.WifiP2pGroup} object
- * associated with the p2p network. Retrieve with
- * {@link android.content.Intent#getParcelableExtra(String)}.
- */
- public static final String EXTRA_WIFI_P2P_GROUP = "p2pGroupInfo";
-
- /**
- * Broadcast intent action indicating that the available peer list has changed. This
- * can be sent as a result of peers being found, lost or updated.
- *
- * All of these permissions are required to receive this broadcast:
- * {@link android.Manifest.permission#ACCESS_FINE_LOCATION} and
- * {@link android.Manifest.permission#ACCESS_WIFI_STATE}
- *
- * <p> An extra {@link #EXTRA_P2P_DEVICE_LIST} provides the full list of
- * current peers. The full list of peers can also be obtained any time with
- * {@link #requestPeers}.
- *
- * @see #EXTRA_P2P_DEVICE_LIST
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String WIFI_P2P_PEERS_CHANGED_ACTION =
- "android.net.wifi.p2p.PEERS_CHANGED";
-
- /**
- * The lookup key for a {@link android.net.wifi.p2p.WifiP2pDeviceList} object representing
- * the new peer list when {@link #WIFI_P2P_PEERS_CHANGED_ACTION} broadcast is sent.
- *
- * <p>Retrieve with {@link android.content.Intent#getParcelableExtra(String)}.
- */
- public static final String EXTRA_P2P_DEVICE_LIST = "wifiP2pDeviceList";
-
- /**
- * Broadcast intent action indicating that peer discovery has either started or stopped.
- * One extra {@link #EXTRA_DISCOVERY_STATE} indicates whether discovery has started
- * or stopped.
- *
- * <p>Note that discovery will be stopped during a connection setup. If the application tries
- * to re-initiate discovery during this time, it can fail.
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String WIFI_P2P_DISCOVERY_CHANGED_ACTION =
- "android.net.wifi.p2p.DISCOVERY_STATE_CHANGE";
-
- /**
- * The lookup key for an int that indicates whether p2p discovery has started or stopped.
- * Retrieve it with {@link android.content.Intent#getIntExtra(String,int)}.
- *
- * @see #WIFI_P2P_DISCOVERY_STARTED
- * @see #WIFI_P2P_DISCOVERY_STOPPED
- */
- public static final String EXTRA_DISCOVERY_STATE = "discoveryState";
-
- /** @hide */
- @IntDef({
- WIFI_P2P_DISCOVERY_STOPPED,
- WIFI_P2P_DISCOVERY_STARTED})
- @Retention(RetentionPolicy.SOURCE)
- public @interface WifiP2pDiscoveryState {
- }
-
- /**
- * p2p discovery has stopped
- *
- * @see #WIFI_P2P_DISCOVERY_CHANGED_ACTION
- */
- public static final int WIFI_P2P_DISCOVERY_STOPPED = 1;
-
- /**
- * p2p discovery has started
- *
- * @see #WIFI_P2P_DISCOVERY_CHANGED_ACTION
- */
- public static final int WIFI_P2P_DISCOVERY_STARTED = 2;
-
- /**
- * Broadcast intent action indicating that this device details have changed.
- *
- * <p> An extra {@link #EXTRA_WIFI_P2P_DEVICE} provides this device details.
- * The valid device details can also be obtained with
- * {@link #requestDeviceInfo(Channel, DeviceInfoListener)} when p2p is enabled.
- * To get information notifications on P2P getting enabled refers
- * {@link #WIFI_P2P_STATE_ENABLED}.
- *
- * <p> The {@link #EXTRA_WIFI_P2P_DEVICE} extra contains an anonymized version of the device's
- * MAC address. Callers holding the {@code android.Manifest.permission#LOCAL_MAC_ADDRESS}
- * permission can use {@link #requestDeviceInfo} to obtain the actual MAC address of this
- * device.
- *
- * All of these permissions are required to receive this broadcast:
- * {@link android.Manifest.permission#ACCESS_FINE_LOCATION} and
- * {@link android.Manifest.permission#ACCESS_WIFI_STATE}
- *
- * @see #EXTRA_WIFI_P2P_DEVICE
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String WIFI_P2P_THIS_DEVICE_CHANGED_ACTION =
- "android.net.wifi.p2p.THIS_DEVICE_CHANGED";
-
- /**
- * The lookup key for a {@link android.net.wifi.p2p.WifiP2pDevice} object
- * Retrieve with {@link android.content.Intent#getParcelableExtra(String)}.
- */
- public static final String EXTRA_WIFI_P2P_DEVICE = "wifiP2pDevice";
-
- /**
- * Broadcast intent action indicating that remembered persistent groups have changed.
- *
- * You can <em>not</em> receive this through components declared
- * in manifests, only by explicitly registering for it with
- * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
- * android.content.IntentFilter) Context.registerReceiver()}.
- *
- * @hide
- */
- @SystemApi
- public static final String ACTION_WIFI_P2P_PERSISTENT_GROUPS_CHANGED =
- "android.net.wifi.p2p.action.WIFI_P2P_PERSISTENT_GROUPS_CHANGED";
-
- /**
- * The lookup key for a handover message returned by the WifiP2pService.
- * @hide
- */
- public static final String EXTRA_HANDOVER_MESSAGE =
- "android.net.wifi.p2p.EXTRA_HANDOVER_MESSAGE";
-
- /**
- * The lookup key for a calling package name from WifiP2pManager
- * @hide
- */
- public static final String CALLING_PACKAGE =
- "android.net.wifi.p2p.CALLING_PACKAGE";
-
- /**
- * The lookup key for a calling feature id from WifiP2pManager
- * @hide
- */
- public static final String CALLING_FEATURE_ID =
- "android.net.wifi.p2p.CALLING_FEATURE_ID";
-
- /**
- * The lookup key for a calling package binder from WifiP2pManager
- * @hide
- */
- public static final String CALLING_BINDER =
- "android.net.wifi.p2p.CALLING_BINDER";
-
- IWifiP2pManager mService;
-
- private static final int BASE = Protocol.BASE_WIFI_P2P_MANAGER;
-
- /** @hide */
- public static final int DISCOVER_PEERS = BASE + 1;
- /** @hide */
- public static final int DISCOVER_PEERS_FAILED = BASE + 2;
- /** @hide */
- public static final int DISCOVER_PEERS_SUCCEEDED = BASE + 3;
-
- /** @hide */
- public static final int STOP_DISCOVERY = BASE + 4;
- /** @hide */
- public static final int STOP_DISCOVERY_FAILED = BASE + 5;
- /** @hide */
- public static final int STOP_DISCOVERY_SUCCEEDED = BASE + 6;
-
- /** @hide */
- public static final int CONNECT = BASE + 7;
- /** @hide */
- public static final int CONNECT_FAILED = BASE + 8;
- /** @hide */
- public static final int CONNECT_SUCCEEDED = BASE + 9;
-
- /** @hide */
- public static final int CANCEL_CONNECT = BASE + 10;
- /** @hide */
- public static final int CANCEL_CONNECT_FAILED = BASE + 11;
- /** @hide */
- public static final int CANCEL_CONNECT_SUCCEEDED = BASE + 12;
-
- /** @hide */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int CREATE_GROUP = BASE + 13;
- /** @hide */
- public static final int CREATE_GROUP_FAILED = BASE + 14;
- /** @hide */
- public static final int CREATE_GROUP_SUCCEEDED = BASE + 15;
-
- /** @hide */
- public static final int REMOVE_GROUP = BASE + 16;
- /** @hide */
- public static final int REMOVE_GROUP_FAILED = BASE + 17;
- /** @hide */
- public static final int REMOVE_GROUP_SUCCEEDED = BASE + 18;
-
- /** @hide */
- public static final int REQUEST_PEERS = BASE + 19;
- /** @hide */
- public static final int RESPONSE_PEERS = BASE + 20;
-
- /** @hide */
- public static final int REQUEST_CONNECTION_INFO = BASE + 21;
- /** @hide */
- public static final int RESPONSE_CONNECTION_INFO = BASE + 22;
-
- /** @hide */
- public static final int REQUEST_GROUP_INFO = BASE + 23;
- /** @hide */
- public static final int RESPONSE_GROUP_INFO = BASE + 24;
-
- /** @hide */
- public static final int ADD_LOCAL_SERVICE = BASE + 28;
- /** @hide */
- public static final int ADD_LOCAL_SERVICE_FAILED = BASE + 29;
- /** @hide */
- public static final int ADD_LOCAL_SERVICE_SUCCEEDED = BASE + 30;
-
- /** @hide */
- public static final int REMOVE_LOCAL_SERVICE = BASE + 31;
- /** @hide */
- public static final int REMOVE_LOCAL_SERVICE_FAILED = BASE + 32;
- /** @hide */
- public static final int REMOVE_LOCAL_SERVICE_SUCCEEDED = BASE + 33;
-
- /** @hide */
- public static final int CLEAR_LOCAL_SERVICES = BASE + 34;
- /** @hide */
- public static final int CLEAR_LOCAL_SERVICES_FAILED = BASE + 35;
- /** @hide */
- public static final int CLEAR_LOCAL_SERVICES_SUCCEEDED = BASE + 36;
-
- /** @hide */
- public static final int ADD_SERVICE_REQUEST = BASE + 37;
- /** @hide */
- public static final int ADD_SERVICE_REQUEST_FAILED = BASE + 38;
- /** @hide */
- public static final int ADD_SERVICE_REQUEST_SUCCEEDED = BASE + 39;
-
- /** @hide */
- public static final int REMOVE_SERVICE_REQUEST = BASE + 40;
- /** @hide */
- public static final int REMOVE_SERVICE_REQUEST_FAILED = BASE + 41;
- /** @hide */
- public static final int REMOVE_SERVICE_REQUEST_SUCCEEDED = BASE + 42;
-
- /** @hide */
- public static final int CLEAR_SERVICE_REQUESTS = BASE + 43;
- /** @hide */
- public static final int CLEAR_SERVICE_REQUESTS_FAILED = BASE + 44;
- /** @hide */
- public static final int CLEAR_SERVICE_REQUESTS_SUCCEEDED = BASE + 45;
-
- /** @hide */
- public static final int DISCOVER_SERVICES = BASE + 46;
- /** @hide */
- public static final int DISCOVER_SERVICES_FAILED = BASE + 47;
- /** @hide */
- public static final int DISCOVER_SERVICES_SUCCEEDED = BASE + 48;
-
- /** @hide */
- public static final int PING = BASE + 49;
-
- /** @hide */
- public static final int RESPONSE_SERVICE = BASE + 50;
-
- /** @hide */
- public static final int SET_DEVICE_NAME = BASE + 51;
- /** @hide */
- public static final int SET_DEVICE_NAME_FAILED = BASE + 52;
- /** @hide */
- public static final int SET_DEVICE_NAME_SUCCEEDED = BASE + 53;
-
- /** @hide */
- public static final int DELETE_PERSISTENT_GROUP = BASE + 54;
- /** @hide */
- public static final int DELETE_PERSISTENT_GROUP_FAILED = BASE + 55;
- /** @hide */
- public static final int DELETE_PERSISTENT_GROUP_SUCCEEDED = BASE + 56;
-
- /** @hide */
- public static final int REQUEST_PERSISTENT_GROUP_INFO = BASE + 57;
- /** @hide */
- public static final int RESPONSE_PERSISTENT_GROUP_INFO = BASE + 58;
-
- /** @hide */
- public static final int SET_WFD_INFO = BASE + 59;
- /** @hide */
- public static final int SET_WFD_INFO_FAILED = BASE + 60;
- /** @hide */
- public static final int SET_WFD_INFO_SUCCEEDED = BASE + 61;
-
- /** @hide */
- public static final int START_WPS = BASE + 62;
- /** @hide */
- public static final int START_WPS_FAILED = BASE + 63;
- /** @hide */
- public static final int START_WPS_SUCCEEDED = BASE + 64;
-
- /** @hide */
- public static final int START_LISTEN = BASE + 65;
- /** @hide */
- public static final int START_LISTEN_FAILED = BASE + 66;
- /** @hide */
- public static final int START_LISTEN_SUCCEEDED = BASE + 67;
-
- /** @hide */
- public static final int STOP_LISTEN = BASE + 68;
- /** @hide */
- public static final int STOP_LISTEN_FAILED = BASE + 69;
- /** @hide */
- public static final int STOP_LISTEN_SUCCEEDED = BASE + 70;
-
- /** @hide */
- public static final int SET_CHANNEL = BASE + 71;
- /** @hide */
- public static final int SET_CHANNEL_FAILED = BASE + 72;
- /** @hide */
- public static final int SET_CHANNEL_SUCCEEDED = BASE + 73;
-
- /** @hide */
- public static final int GET_HANDOVER_REQUEST = BASE + 75;
- /** @hide */
- public static final int GET_HANDOVER_SELECT = BASE + 76;
- /** @hide */
- public static final int RESPONSE_GET_HANDOVER_MESSAGE = BASE + 77;
- /** @hide */
- public static final int INITIATOR_REPORT_NFC_HANDOVER = BASE + 78;
- /** @hide */
- public static final int RESPONDER_REPORT_NFC_HANDOVER = BASE + 79;
- /** @hide */
- public static final int REPORT_NFC_HANDOVER_SUCCEEDED = BASE + 80;
- /** @hide */
- public static final int REPORT_NFC_HANDOVER_FAILED = BASE + 81;
-
- /** @hide */
- public static final int FACTORY_RESET = BASE + 82;
- /** @hide */
- public static final int FACTORY_RESET_FAILED = BASE + 83;
- /** @hide */
- public static final int FACTORY_RESET_SUCCEEDED = BASE + 84;
-
- /** @hide */
- public static final int REQUEST_ONGOING_PEER_CONFIG = BASE + 85;
- /** @hide */
- public static final int RESPONSE_ONGOING_PEER_CONFIG = BASE + 86;
- /** @hide */
- public static final int SET_ONGOING_PEER_CONFIG = BASE + 87;
- /** @hide */
- public static final int SET_ONGOING_PEER_CONFIG_FAILED = BASE + 88;
- /** @hide */
- public static final int SET_ONGOING_PEER_CONFIG_SUCCEEDED = BASE + 89;
-
- /** @hide */
- public static final int REQUEST_P2P_STATE = BASE + 90;
- /** @hide */
- public static final int RESPONSE_P2P_STATE = BASE + 91;
-
- /** @hide */
- public static final int REQUEST_DISCOVERY_STATE = BASE + 92;
- /** @hide */
- public static final int RESPONSE_DISCOVERY_STATE = BASE + 93;
-
- /** @hide */
- public static final int REQUEST_NETWORK_INFO = BASE + 94;
- /** @hide */
- public static final int RESPONSE_NETWORK_INFO = BASE + 95;
-
- /** @hide */
- public static final int UPDATE_CHANNEL_INFO = BASE + 96;
-
- /** @hide */
- public static final int REQUEST_DEVICE_INFO = BASE + 97;
- /** @hide */
- public static final int RESPONSE_DEVICE_INFO = BASE + 98;
-
- /**
- * Create a new WifiP2pManager instance. Applications use
- * {@link android.content.Context#getSystemService Context.getSystemService()} to retrieve
- * the standard {@link android.content.Context#WIFI_P2P_SERVICE Context.WIFI_P2P_SERVICE}.
- * @param service the Binder interface
- * @hide - hide this because it takes in a parameter of type IWifiP2pManager, which
- * is a system private class.
- */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
- public WifiP2pManager(IWifiP2pManager service) {
- mService = service;
- }
-
- /**
- * Passed with {@link ActionListener#onFailure}.
- * Indicates that the operation failed due to an internal error.
- */
- public static final int ERROR = 0;
-
- /**
- * Passed with {@link ActionListener#onFailure}.
- * Indicates that the operation failed because p2p is unsupported on the device.
- */
- public static final int P2P_UNSUPPORTED = 1;
-
- /**
- * Passed with {@link ActionListener#onFailure}.
- * Indicates that the operation failed because the framework is busy and
- * unable to service the request
- */
- public static final int BUSY = 2;
-
- /**
- * Passed with {@link ActionListener#onFailure}.
- * Indicates that the {@link #discoverServices} failed because no service
- * requests are added. Use {@link #addServiceRequest} to add a service
- * request.
- */
- public static final int NO_SERVICE_REQUESTS = 3;
-
- /** Interface for callback invocation when framework channel is lost */
- public interface ChannelListener {
- /**
- * The channel to the framework has been disconnected.
- * Application could try re-initializing using {@link #initialize}
- */
- public void onChannelDisconnected();
- }
-
- /** Interface for callback invocation on an application action */
- public interface ActionListener {
- /** The operation succeeded */
- public void onSuccess();
- /**
- * The operation failed
- * @param reason The reason for failure could be one of {@link #P2P_UNSUPPORTED},
- * {@link #ERROR} or {@link #BUSY}
- */
- public void onFailure(int reason);
- }
-
- /** Interface for callback invocation when peer list is available */
- public interface PeerListListener {
- /**
- * The requested peer list is available
- * @param peers List of available peers
- */
- public void onPeersAvailable(WifiP2pDeviceList peers);
- }
-
- /** Interface for callback invocation when connection info is available */
- public interface ConnectionInfoListener {
- /**
- * The requested connection info is available
- * @param info Wi-Fi p2p connection info
- */
- public void onConnectionInfoAvailable(WifiP2pInfo info);
- }
-
- /** Interface for callback invocation when group info is available */
- public interface GroupInfoListener {
- /**
- * The requested p2p group info is available
- * @param group Wi-Fi p2p group info
- */
- public void onGroupInfoAvailable(WifiP2pGroup group);
- }
-
- /**
- * Interface for callback invocation when service discovery response other than
- * Upnp or Bonjour is received
- */
- public interface ServiceResponseListener {
-
- /**
- * The requested service response is available.
- *
- * @param protocolType protocol type. currently only
- * {@link WifiP2pServiceInfo#SERVICE_TYPE_VENDOR_SPECIFIC}.
- * @param responseData service discovery response data based on the requested
- * service protocol type. The format depends on the service type.
- * @param srcDevice source device.
- */
- public void onServiceAvailable(int protocolType,
- byte[] responseData, WifiP2pDevice srcDevice);
- }
-
- /**
- * Interface for callback invocation when Bonjour service discovery response
- * is received
- */
- public interface DnsSdServiceResponseListener {
-
- /**
- * The requested Bonjour service response is available.
- *
- * <p>This function is invoked when the device with the specified Bonjour
- * registration type returned the instance name.
- * @param instanceName instance name.<br>
- * e.g) "MyPrinter".
- * @param registrationType <br>
- * e.g) "_ipp._tcp.local."
- * @param srcDevice source device.
- */
- public void onDnsSdServiceAvailable(String instanceName,
- String registrationType, WifiP2pDevice srcDevice);
-
- }
-
- /**
- * Interface for callback invocation when Bonjour TXT record is available
- * for a service
- */
- public interface DnsSdTxtRecordListener {
- /**
- * The requested Bonjour service response is available.
- *
- * <p>This function is invoked when the device with the specified full
- * service domain service returned TXT record.
- *
- * @param fullDomainName full domain name. <br>
- * e.g) "MyPrinter._ipp._tcp.local.".
- * @param txtRecordMap TXT record data as a map of key/value pairs
- * @param srcDevice source device.
- */
- public void onDnsSdTxtRecordAvailable(String fullDomainName,
- Map<String, String> txtRecordMap,
- WifiP2pDevice srcDevice);
- }
-
- /**
- * Interface for callback invocation when upnp service discovery response
- * is received
- * */
- public interface UpnpServiceResponseListener {
-
- /**
- * The requested upnp service response is available.
- *
- * <p>This function is invoked when the specified device or service is found.
- *
- * @param uniqueServiceNames The list of unique service names.<br>
- * e.g) uuid:6859dede-8574-59ab-9332-123456789012::urn:schemas-upnp-org:device:
- * MediaServer:1
- * @param srcDevice source device.
- */
- public void onUpnpServiceAvailable(List<String> uniqueServiceNames,
- WifiP2pDevice srcDevice);
- }
-
-
- /**
- * Interface for callback invocation when stored group info list is available
- *
- * @hide
- */
- @SystemApi
- public interface PersistentGroupInfoListener {
- /**
- * The requested stored p2p group info list is available
- * @param groups Wi-Fi p2p group info list
- */
- void onPersistentGroupInfoAvailable(@NonNull WifiP2pGroupList groups);
- }
-
- /**
- * Interface for callback invocation when Handover Request or Select Message is available
- * @hide
- */
- public interface HandoverMessageListener {
- public void onHandoverMessageAvailable(String handoverMessage);
- }
-
- /** Interface for callback invocation when p2p state is available
- * in response to {@link #requestP2pState}.
- */
- public interface P2pStateListener {
- /**
- * The requested p2p state is available.
- * @param state Wi-Fi p2p state
- * @see #WIFI_P2P_STATE_DISABLED
- * @see #WIFI_P2P_STATE_ENABLED
- */
- void onP2pStateAvailable(@WifiP2pState int state);
- }
-
- /** Interface for callback invocation when p2p state is available
- * in response to {@link #requestDiscoveryState}.
- */
- public interface DiscoveryStateListener {
- /**
- * The requested p2p discovery state is available.
- * @param state Wi-Fi p2p discovery state
- * @see #WIFI_P2P_DISCOVERY_STARTED
- * @see #WIFI_P2P_DISCOVERY_STOPPED
- */
- void onDiscoveryStateAvailable(@WifiP2pDiscoveryState int state);
- }
-
- /** Interface for callback invocation when {@link android.net.NetworkInfo} is available
- * in response to {@link #requestNetworkInfo}.
- */
- public interface NetworkInfoListener {
- /**
- * The requested {@link android.net.NetworkInfo} is available
- * @param networkInfo Wi-Fi p2p {@link android.net.NetworkInfo}
- */
- void onNetworkInfoAvailable(@NonNull NetworkInfo networkInfo);
- }
-
- /**
- * Interface for callback invocation when ongoing peer info is available
- * @hide
- */
- public interface OngoingPeerInfoListener {
- /**
- * The requested ongoing WifiP2pConfig is available
- * @param peerConfig WifiP2pConfig for current connecting session
- */
- void onOngoingPeerAvailable(WifiP2pConfig peerConfig);
- }
-
- /** Interface for callback invocation when {@link android.net.wifi.p2p.WifiP2pDevice}
- * is available in response to {@link #requestDeviceInfo(Channel, DeviceInfoListener)}.
- */
- public interface DeviceInfoListener {
- /**
- * The requested {@link android.net.wifi.p2p.WifiP2pDevice} is available.
- * @param wifiP2pDevice Wi-Fi p2p {@link android.net.wifi.p2p.WifiP2pDevice}
- */
- void onDeviceInfoAvailable(@Nullable WifiP2pDevice wifiP2pDevice);
- }
-
- /**
- * A channel that connects the application to the Wifi p2p framework.
- * Most p2p operations require a Channel as an argument. An instance of Channel is obtained
- * by doing a call on {@link #initialize}
- */
- public static class Channel implements AutoCloseable {
- /** @hide */
- public Channel(Context context, Looper looper, ChannelListener l, Binder binder,
- WifiP2pManager p2pManager) {
- mAsyncChannel = new AsyncChannel();
- mHandler = new P2pHandler(looper);
- mChannelListener = l;
- mContext = context;
- mBinder = binder;
- mP2pManager = p2pManager;
-
- mCloseGuard.open("close");
- }
- private final static int INVALID_LISTENER_KEY = 0;
- private final WifiP2pManager mP2pManager;
- private ChannelListener mChannelListener;
- private ServiceResponseListener mServRspListener;
- private DnsSdServiceResponseListener mDnsSdServRspListener;
- private DnsSdTxtRecordListener mDnsSdTxtListener;
- private UpnpServiceResponseListener mUpnpServRspListener;
- private HashMap<Integer, Object> mListenerMap = new HashMap<Integer, Object>();
- private final Object mListenerMapLock = new Object();
- private int mListenerKey = 0;
-
- private final CloseGuard mCloseGuard = new CloseGuard();
-
- /**
- * Close the current P2P connection and indicate to the P2P service that connections
- * created by the app can be removed.
- */
- public void close() {
- if (mP2pManager == null) {
- Log.w(TAG, "Channel.close(): Null mP2pManager!?");
- } else {
- try {
- mP2pManager.mService.close(mBinder);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- mAsyncChannel.disconnect();
- mCloseGuard.close();
- Reference.reachabilityFence(this);
- }
-
- /** @hide */
- @Override
- protected void finalize() throws Throwable {
- try {
- if (mCloseGuard != null) {
- mCloseGuard.warnIfOpen();
- }
-
- close();
- } finally {
- super.finalize();
- }
- }
-
- /* package */ final Binder mBinder;
-
- @UnsupportedAppUsage
- private AsyncChannel mAsyncChannel;
- private P2pHandler mHandler;
- Context mContext;
- class P2pHandler extends Handler {
- P2pHandler(Looper looper) {
- super(looper);
- }
-
- @Override
- public void handleMessage(Message message) {
- Object listener = getListener(message.arg2);
- switch (message.what) {
- case AsyncChannel.CMD_CHANNEL_DISCONNECTED:
- if (mChannelListener != null) {
- mChannelListener.onChannelDisconnected();
- mChannelListener = null;
- }
- break;
- /* ActionListeners grouped together */
- case DISCOVER_PEERS_FAILED:
- case STOP_DISCOVERY_FAILED:
- case DISCOVER_SERVICES_FAILED:
- case CONNECT_FAILED:
- case CANCEL_CONNECT_FAILED:
- case CREATE_GROUP_FAILED:
- case REMOVE_GROUP_FAILED:
- case ADD_LOCAL_SERVICE_FAILED:
- case REMOVE_LOCAL_SERVICE_FAILED:
- case CLEAR_LOCAL_SERVICES_FAILED:
- case ADD_SERVICE_REQUEST_FAILED:
- case REMOVE_SERVICE_REQUEST_FAILED:
- case CLEAR_SERVICE_REQUESTS_FAILED:
- case SET_DEVICE_NAME_FAILED:
- case DELETE_PERSISTENT_GROUP_FAILED:
- case SET_WFD_INFO_FAILED:
- case START_WPS_FAILED:
- case START_LISTEN_FAILED:
- case STOP_LISTEN_FAILED:
- case SET_CHANNEL_FAILED:
- case REPORT_NFC_HANDOVER_FAILED:
- case FACTORY_RESET_FAILED:
- case SET_ONGOING_PEER_CONFIG_FAILED:
- if (listener != null) {
- ((ActionListener) listener).onFailure(message.arg1);
- }
- break;
- /* ActionListeners grouped together */
- case DISCOVER_PEERS_SUCCEEDED:
- case STOP_DISCOVERY_SUCCEEDED:
- case DISCOVER_SERVICES_SUCCEEDED:
- case CONNECT_SUCCEEDED:
- case CANCEL_CONNECT_SUCCEEDED:
- case CREATE_GROUP_SUCCEEDED:
- case REMOVE_GROUP_SUCCEEDED:
- case ADD_LOCAL_SERVICE_SUCCEEDED:
- case REMOVE_LOCAL_SERVICE_SUCCEEDED:
- case CLEAR_LOCAL_SERVICES_SUCCEEDED:
- case ADD_SERVICE_REQUEST_SUCCEEDED:
- case REMOVE_SERVICE_REQUEST_SUCCEEDED:
- case CLEAR_SERVICE_REQUESTS_SUCCEEDED:
- case SET_DEVICE_NAME_SUCCEEDED:
- case DELETE_PERSISTENT_GROUP_SUCCEEDED:
- case SET_WFD_INFO_SUCCEEDED:
- case START_WPS_SUCCEEDED:
- case START_LISTEN_SUCCEEDED:
- case STOP_LISTEN_SUCCEEDED:
- case SET_CHANNEL_SUCCEEDED:
- case REPORT_NFC_HANDOVER_SUCCEEDED:
- case FACTORY_RESET_SUCCEEDED:
- case SET_ONGOING_PEER_CONFIG_SUCCEEDED:
- if (listener != null) {
- ((ActionListener) listener).onSuccess();
- }
- break;
- case RESPONSE_PEERS:
- WifiP2pDeviceList peers = (WifiP2pDeviceList) message.obj;
- if (listener != null) {
- ((PeerListListener) listener).onPeersAvailable(peers);
- }
- break;
- case RESPONSE_CONNECTION_INFO:
- WifiP2pInfo wifiP2pInfo = (WifiP2pInfo) message.obj;
- if (listener != null) {
- ((ConnectionInfoListener) listener).onConnectionInfoAvailable(wifiP2pInfo);
- }
- break;
- case RESPONSE_GROUP_INFO:
- WifiP2pGroup group = (WifiP2pGroup) message.obj;
- if (listener != null) {
- ((GroupInfoListener) listener).onGroupInfoAvailable(group);
- }
- break;
- case RESPONSE_SERVICE:
- WifiP2pServiceResponse resp = (WifiP2pServiceResponse) message.obj;
- handleServiceResponse(resp);
- break;
- case RESPONSE_PERSISTENT_GROUP_INFO:
- WifiP2pGroupList groups = (WifiP2pGroupList) message.obj;
- if (listener != null) {
- ((PersistentGroupInfoListener) listener).
- onPersistentGroupInfoAvailable(groups);
- }
- break;
- case RESPONSE_GET_HANDOVER_MESSAGE:
- Bundle handoverBundle = (Bundle) message.obj;
- if (listener != null) {
- String handoverMessage = handoverBundle != null
- ? handoverBundle.getString(EXTRA_HANDOVER_MESSAGE)
- : null;
- ((HandoverMessageListener) listener)
- .onHandoverMessageAvailable(handoverMessage);
- }
- break;
- case RESPONSE_ONGOING_PEER_CONFIG:
- WifiP2pConfig peerConfig = (WifiP2pConfig) message.obj;
- if (listener != null) {
- ((OngoingPeerInfoListener) listener)
- .onOngoingPeerAvailable(peerConfig);
- }
- break;
- case RESPONSE_P2P_STATE:
- if (listener != null) {
- ((P2pStateListener) listener)
- .onP2pStateAvailable(message.arg1);
- }
- break;
- case RESPONSE_DISCOVERY_STATE:
- if (listener != null) {
- ((DiscoveryStateListener) listener)
- .onDiscoveryStateAvailable(message.arg1);
- }
- break;
- case RESPONSE_NETWORK_INFO:
- if (listener != null) {
- ((NetworkInfoListener) listener)
- .onNetworkInfoAvailable((NetworkInfo) message.obj);
- }
- break;
- case RESPONSE_DEVICE_INFO:
- if (listener != null) {
- ((DeviceInfoListener) listener)
- .onDeviceInfoAvailable((WifiP2pDevice) message.obj);
- }
- break;
- default:
- Log.d(TAG, "Ignored " + message);
- break;
- }
- }
- }
-
- private void handleServiceResponse(WifiP2pServiceResponse resp) {
- if (resp instanceof WifiP2pDnsSdServiceResponse) {
- handleDnsSdServiceResponse((WifiP2pDnsSdServiceResponse)resp);
- } else if (resp instanceof WifiP2pUpnpServiceResponse) {
- if (mUpnpServRspListener != null) {
- handleUpnpServiceResponse((WifiP2pUpnpServiceResponse)resp);
- }
- } else {
- if (mServRspListener != null) {
- mServRspListener.onServiceAvailable(resp.getServiceType(),
- resp.getRawData(), resp.getSrcDevice());
- }
- }
- }
-
- private void handleUpnpServiceResponse(WifiP2pUpnpServiceResponse resp) {
- mUpnpServRspListener.onUpnpServiceAvailable(resp.getUniqueServiceNames(),
- resp.getSrcDevice());
- }
-
- private void handleDnsSdServiceResponse(WifiP2pDnsSdServiceResponse resp) {
- if (resp.getDnsType() == WifiP2pDnsSdServiceInfo.DNS_TYPE_PTR) {
- if (mDnsSdServRspListener != null) {
- mDnsSdServRspListener.onDnsSdServiceAvailable(
- resp.getInstanceName(),
- resp.getDnsQueryName(),
- resp.getSrcDevice());
- }
- } else if (resp.getDnsType() == WifiP2pDnsSdServiceInfo.DNS_TYPE_TXT) {
- if (mDnsSdTxtListener != null) {
- mDnsSdTxtListener.onDnsSdTxtRecordAvailable(
- resp.getDnsQueryName(),
- resp.getTxtRecord(),
- resp.getSrcDevice());
- }
- } else {
- Log.e(TAG, "Unhandled resp " + resp);
- }
- }
-
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- private int putListener(Object listener) {
- if (listener == null) return INVALID_LISTENER_KEY;
- int key;
- synchronized (mListenerMapLock) {
- do {
- key = mListenerKey++;
- } while (key == INVALID_LISTENER_KEY);
- mListenerMap.put(key, listener);
- }
- return key;
- }
-
- private Object getListener(int key) {
- if (key == INVALID_LISTENER_KEY) return null;
- synchronized (mListenerMapLock) {
- return mListenerMap.remove(key);
- }
- }
- }
-
- private static void checkChannel(Channel c) {
- if (c == null) throw new IllegalArgumentException("Channel needs to be initialized");
- }
-
- private static void checkServiceInfo(WifiP2pServiceInfo info) {
- if (info == null) throw new IllegalArgumentException("service info is null");
- }
-
- private static void checkServiceRequest(WifiP2pServiceRequest req) {
- if (req == null) throw new IllegalArgumentException("service request is null");
- }
-
- private static void checkP2pConfig(WifiP2pConfig c) {
- if (c == null) throw new IllegalArgumentException("config cannot be null");
- if (TextUtils.isEmpty(c.deviceAddress)) {
- throw new IllegalArgumentException("deviceAddress cannot be empty");
- }
- }
-
- /**
- * Registers the application with the Wi-Fi framework. This function
- * must be the first to be called before any p2p operations are performed.
- *
- * @param srcContext is the context of the source
- * @param srcLooper is the Looper on which the callbacks are receivied
- * @param listener for callback at loss of framework communication. Can be null.
- * @return Channel instance that is necessary for performing any further p2p operations
- */
- public Channel initialize(Context srcContext, Looper srcLooper, ChannelListener listener) {
- Binder binder = new Binder();
- Channel channel = initializeChannel(srcContext, srcLooper, listener,
- getMessenger(binder, srcContext.getOpPackageName()), binder);
- return channel;
- }
-
- /**
- * Registers the application with the Wi-Fi framework. Enables system-only functionality.
- * @hide
- */
- public Channel initializeInternal(Context srcContext, Looper srcLooper,
- ChannelListener listener) {
- return initializeChannel(srcContext, srcLooper, listener, getP2pStateMachineMessenger(),
- null);
- }
-
- private Channel initializeChannel(Context srcContext, Looper srcLooper,
- ChannelListener listener, Messenger messenger, Binder binder) {
- if (messenger == null) return null;
-
- Channel c = new Channel(srcContext, srcLooper, listener, binder, this);
- if (c.mAsyncChannel.connectSync(srcContext, c.mHandler, messenger)
- == AsyncChannel.STATUS_SUCCESSFUL) {
- Bundle bundle = new Bundle();
- bundle.putString(CALLING_PACKAGE, c.mContext.getOpPackageName());
- bundle.putString(CALLING_FEATURE_ID, c.mContext.getAttributionTag());
- bundle.putBinder(CALLING_BINDER, binder);
- c.mAsyncChannel.sendMessage(UPDATE_CHANNEL_INFO, 0,
- c.putListener(null), bundle);
- return c;
- } else {
- c.close();
- return null;
- }
- }
-
- /**
- * Initiate peer discovery. A discovery process involves scanning for available Wi-Fi peers
- * for the purpose of establishing a connection.
- *
- * <p> The function call immediately returns after sending a discovery request
- * to the framework. The application is notified of a success or failure to initiate
- * discovery through listener callbacks {@link ActionListener#onSuccess} or
- * {@link ActionListener#onFailure}.
- *
- * <p> The discovery remains active until a connection is initiated or
- * a p2p group is formed. Register for {@link #WIFI_P2P_PEERS_CHANGED_ACTION} intent to
- * determine when the framework notifies of a change as peers are discovered.
- *
- * <p> Upon receiving a {@link #WIFI_P2P_PEERS_CHANGED_ACTION} intent, an application
- * can request for the list of peers using {@link #requestPeers}.
- *
- * @param c is the channel created at {@link #initialize}
- * @param listener for callbacks on success or failure. Can be null.
- */
- @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION)
- public void discoverPeers(Channel c, ActionListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(DISCOVER_PEERS, 0, c.putListener(listener));
- }
-
- /**
- * Stop an ongoing peer discovery
- *
- * <p> The function call immediately returns after sending a stop request
- * to the framework. The application is notified of a success or failure to initiate
- * stop through listener callbacks {@link ActionListener#onSuccess} or
- * {@link ActionListener#onFailure}.
- *
- * @param c is the channel created at {@link #initialize}
- * @param listener for callbacks on success or failure. Can be null.
- */
- public void stopPeerDiscovery(Channel c, ActionListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(STOP_DISCOVERY, 0, c.putListener(listener));
- }
-
- /**
- * Start a p2p connection to a device with the specified configuration.
- *
- * <p> The function call immediately returns after sending a connection request
- * to the framework. The application is notified of a success or failure to initiate
- * connect through listener callbacks {@link ActionListener#onSuccess} or
- * {@link ActionListener#onFailure}.
- *
- * <p> Register for {@link #WIFI_P2P_CONNECTION_CHANGED_ACTION} intent to
- * determine when the framework notifies of a change in connectivity.
- *
- * <p> If the current device is not part of a p2p group, a connect request initiates
- * a group negotiation with the peer.
- *
- * <p> If the current device is part of an existing p2p group or has created
- * a p2p group with {@link #createGroup}, an invitation to join the group is sent to
- * the peer device.
- *
- * @param c is the channel created at {@link #initialize}
- * @param config options as described in {@link WifiP2pConfig} class
- * @param listener for callbacks on success or failure. Can be null.
- */
- @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION)
- public void connect(Channel c, WifiP2pConfig config, ActionListener listener) {
- checkChannel(c);
- checkP2pConfig(config);
- c.mAsyncChannel.sendMessage(CONNECT, 0, c.putListener(listener), config);
- }
-
- /**
- * Cancel any ongoing p2p group negotiation
- *
- * <p> The function call immediately returns after sending a connection cancellation request
- * to the framework. The application is notified of a success or failure to initiate
- * cancellation through listener callbacks {@link ActionListener#onSuccess} or
- * {@link ActionListener#onFailure}.
- *
- * @param c is the channel created at {@link #initialize}
- * @param listener for callbacks on success or failure. Can be null.
- */
- public void cancelConnect(Channel c, ActionListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(CANCEL_CONNECT, 0, c.putListener(listener));
- }
-
- /**
- * Create a p2p group with the current device as the group owner. This essentially creates
- * an access point that can accept connections from legacy clients as well as other p2p
- * devices.
- *
- * <p class="note"><strong>Note:</strong>
- * This function would normally not be used unless the current device needs
- * to form a p2p connection with a legacy client
- *
- * <p> The function call immediately returns after sending a group creation request
- * to the framework. The application is notified of a success or failure to initiate
- * group creation through listener callbacks {@link ActionListener#onSuccess} or
- * {@link ActionListener#onFailure}.
- *
- * <p> Application can request for the group details with {@link #requestGroupInfo}.
- *
- * @param c is the channel created at {@link #initialize}
- * @param listener for callbacks on success or failure. Can be null.
- */
- @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION)
- public void createGroup(Channel c, ActionListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(CREATE_GROUP, WifiP2pGroup.NETWORK_ID_PERSISTENT,
- c.putListener(listener));
- }
-
- /**
- * Create a p2p group with the current device as the group owner. This essentially creates
- * an access point that can accept connections from legacy clients as well as other p2p
- * devices.
- *
- * <p> An app should use {@link WifiP2pConfig.Builder} to build the configuration
- * for a group.
- *
- * <p class="note"><strong>Note:</strong>
- * This function would normally not be used unless the current device needs
- * to form a p2p group as a Group Owner and allow peers to join it as either
- * Group Clients or legacy Wi-Fi STAs.
- *
- * <p> The function call immediately returns after sending a group creation request
- * to the framework. The application is notified of a success or failure to initiate
- * group creation through listener callbacks {@link ActionListener#onSuccess} or
- * {@link ActionListener#onFailure}.
- *
- * <p> Application can request for the group details with {@link #requestGroupInfo}.
- *
- * @param c is the channel created at {@link #initialize}.
- * @param config the configuration of a p2p group.
- * @param listener for callbacks on success or failure. Can be null.
- */
- @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION)
- public void createGroup(@NonNull Channel c,
- @Nullable WifiP2pConfig config,
- @Nullable ActionListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(CREATE_GROUP, 0,
- c.putListener(listener), config);
- }
-
- /**
- * Remove the current p2p group.
- *
- * <p> The function call immediately returns after sending a group removal request
- * to the framework. The application is notified of a success or failure to initiate
- * group removal through listener callbacks {@link ActionListener#onSuccess} or
- * {@link ActionListener#onFailure}.
- *
- * @param c is the channel created at {@link #initialize}
- * @param listener for callbacks on success or failure. Can be null.
- */
- public void removeGroup(Channel c, ActionListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(REMOVE_GROUP, 0, c.putListener(listener));
- }
-
- /**
- * Force p2p to enter listen state
- *
- * @param c is the channel created at {@link #initialize(Context, Looper, ChannelListener)}
- * @param listener for callbacks on success or failure. Can be null.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void startListening(@NonNull Channel c, @Nullable ActionListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(START_LISTEN, 0, c.putListener(listener));
- }
-
- /**
- * Force p2p to exit listen state
- *
- * @param c is the channel created at {@link #initialize(Context, Looper, ChannelListener)}
- * @param listener for callbacks on success or failure. Can be null.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void stopListening(@NonNull Channel c, @Nullable ActionListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(STOP_LISTEN, 0, c.putListener(listener));
- }
-
- /**
- * Set P2P listening and operating channel.
- *
- * @param c is the channel created at {@link #initialize}
- * @param listeningChannel the listening channel's Wifi channel number. e.g. 1, 6, 11.
- * @param operatingChannel the operating channel's Wifi channel number. e.g. 1, 6, 11.
- * @param listener for callbacks on success or failure. Can be null.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_STACK,
- android.Manifest.permission.OVERRIDE_WIFI_CONFIG
- })
- public void setWifiP2pChannels(@NonNull Channel c, int listeningChannel, int operatingChannel,
- @Nullable ActionListener listener) {
- checkChannel(c);
- Bundle p2pChannels = new Bundle();
- p2pChannels.putInt("lc", listeningChannel);
- p2pChannels.putInt("oc", operatingChannel);
- c.mAsyncChannel.sendMessage(SET_CHANNEL, 0, c.putListener(listener), p2pChannels);
- }
-
- /**
- * Start a Wi-Fi Protected Setup (WPS) session.
- *
- * <p> The function call immediately returns after sending a request to start a
- * WPS session. Currently, this is only valid if the current device is running
- * as a group owner to allow any new clients to join the group. The application
- * is notified of a success or failure to initiate WPS through listener callbacks
- * {@link ActionListener#onSuccess} or {@link ActionListener#onFailure}.
- * @hide
- */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public void startWps(Channel c, WpsInfo wps, ActionListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(START_WPS, 0, c.putListener(listener), wps);
- }
-
- /**
- * Register a local service for service discovery. If a local service is registered,
- * the framework automatically responds to a service discovery request from a peer.
- *
- * <p> The function call immediately returns after sending a request to add a local
- * service to the framework. The application is notified of a success or failure to
- * add service through listener callbacks {@link ActionListener#onSuccess} or
- * {@link ActionListener#onFailure}.
- *
- * <p>The service information is set through {@link WifiP2pServiceInfo}.<br>
- * or its subclass calls {@link WifiP2pUpnpServiceInfo#newInstance} or
- * {@link WifiP2pDnsSdServiceInfo#newInstance} for a Upnp or Bonjour service
- * respectively
- *
- * <p>The service information can be cleared with calls to
- * {@link #removeLocalService} or {@link #clearLocalServices}.
- *
- * @param c is the channel created at {@link #initialize}
- * @param servInfo is a local service information.
- * @param listener for callbacks on success or failure. Can be null.
- */
- @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION)
- public void addLocalService(Channel c, WifiP2pServiceInfo servInfo, ActionListener listener) {
- checkChannel(c);
- checkServiceInfo(servInfo);
- c.mAsyncChannel.sendMessage(ADD_LOCAL_SERVICE, 0, c.putListener(listener), servInfo);
- }
-
- /**
- * Remove a registered local service added with {@link #addLocalService}
- *
- * <p> The function call immediately returns after sending a request to remove a
- * local service to the framework. The application is notified of a success or failure to
- * add service through listener callbacks {@link ActionListener#onSuccess} or
- * {@link ActionListener#onFailure}.
- *
- * @param c is the channel created at {@link #initialize}
- * @param servInfo is the local service information.
- * @param listener for callbacks on success or failure. Can be null.
- */
- public void removeLocalService(Channel c, WifiP2pServiceInfo servInfo,
- ActionListener listener) {
- checkChannel(c);
- checkServiceInfo(servInfo);
- c.mAsyncChannel.sendMessage(REMOVE_LOCAL_SERVICE, 0, c.putListener(listener), servInfo);
- }
-
- /**
- * Clear all registered local services of service discovery.
- *
- * <p> The function call immediately returns after sending a request to clear all
- * local services to the framework. The application is notified of a success or failure to
- * add service through listener callbacks {@link ActionListener#onSuccess} or
- * {@link ActionListener#onFailure}.
- *
- * @param c is the channel created at {@link #initialize}
- * @param listener for callbacks on success or failure. Can be null.
- */
- public void clearLocalServices(Channel c, ActionListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(CLEAR_LOCAL_SERVICES, 0, c.putListener(listener));
- }
-
- /**
- * Register a callback to be invoked on receiving service discovery response.
- * Used only for vendor specific protocol right now. For Bonjour or Upnp, use
- * {@link #setDnsSdResponseListeners} or {@link #setUpnpServiceResponseListener}
- * respectively.
- *
- * <p> see {@link #discoverServices} for the detail.
- *
- * @param c is the channel created at {@link #initialize}
- * @param listener for callbacks on receiving service discovery response.
- */
- public void setServiceResponseListener(Channel c,
- ServiceResponseListener listener) {
- checkChannel(c);
- c.mServRspListener = listener;
- }
-
- /**
- * Register a callback to be invoked on receiving Bonjour service discovery
- * response.
- *
- * <p> see {@link #discoverServices} for the detail.
- *
- * @param c
- * @param servListener is for listening to a Bonjour service response
- * @param txtListener is for listening to a Bonjour TXT record response
- */
- public void setDnsSdResponseListeners(Channel c,
- DnsSdServiceResponseListener servListener, DnsSdTxtRecordListener txtListener) {
- checkChannel(c);
- c.mDnsSdServRspListener = servListener;
- c.mDnsSdTxtListener = txtListener;
- }
-
- /**
- * Register a callback to be invoked on receiving upnp service discovery
- * response.
- *
- * <p> see {@link #discoverServices} for the detail.
- *
- * @param c is the channel created at {@link #initialize}
- * @param listener for callbacks on receiving service discovery response.
- */
- public void setUpnpServiceResponseListener(Channel c,
- UpnpServiceResponseListener listener) {
- checkChannel(c);
- c.mUpnpServRspListener = listener;
- }
-
- /**
- * Initiate service discovery. A discovery process involves scanning for
- * requested services for the purpose of establishing a connection to a peer
- * that supports an available service.
- *
- * <p> The function call immediately returns after sending a request to start service
- * discovery to the framework. The application is notified of a success or failure to initiate
- * discovery through listener callbacks {@link ActionListener#onSuccess} or
- * {@link ActionListener#onFailure}.
- *
- * <p> The services to be discovered are specified with calls to {@link #addServiceRequest}.
- *
- * <p>The application is notified of the response against the service discovery request
- * through listener callbacks registered by {@link #setServiceResponseListener} or
- * {@link #setDnsSdResponseListeners}, or {@link #setUpnpServiceResponseListener}.
- *
- * @param c is the channel created at {@link #initialize}
- * @param listener for callbacks on success or failure. Can be null.
- */
- @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION)
- public void discoverServices(Channel c, ActionListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(DISCOVER_SERVICES, 0, c.putListener(listener));
- }
-
- /**
- * Add a service discovery request.
- *
- * <p> The function call immediately returns after sending a request to add service
- * discovery request to the framework. The application is notified of a success or failure to
- * add service through listener callbacks {@link ActionListener#onSuccess} or
- * {@link ActionListener#onFailure}.
- *
- * <p>After service discovery request is added, you can initiate service discovery by
- * {@link #discoverServices}.
- *
- * <p>The added service requests can be cleared with calls to
- * {@link #removeServiceRequest(Channel, WifiP2pServiceRequest, ActionListener)} or
- * {@link #clearServiceRequests(Channel, ActionListener)}.
- *
- * @param c is the channel created at {@link #initialize}
- * @param req is the service discovery request.
- * @param listener for callbacks on success or failure. Can be null.
- */
- public void addServiceRequest(Channel c,
- WifiP2pServiceRequest req, ActionListener listener) {
- checkChannel(c);
- checkServiceRequest(req);
- c.mAsyncChannel.sendMessage(ADD_SERVICE_REQUEST, 0,
- c.putListener(listener), req);
- }
-
- /**
- * Remove a specified service discovery request added with {@link #addServiceRequest}
- *
- * <p> The function call immediately returns after sending a request to remove service
- * discovery request to the framework. The application is notified of a success or failure to
- * add service through listener callbacks {@link ActionListener#onSuccess} or
- * {@link ActionListener#onFailure}.
- *
- * @param c is the channel created at {@link #initialize}
- * @param req is the service discovery request.
- * @param listener for callbacks on success or failure. Can be null.
- */
- public void removeServiceRequest(Channel c, WifiP2pServiceRequest req,
- ActionListener listener) {
- checkChannel(c);
- checkServiceRequest(req);
- c.mAsyncChannel.sendMessage(REMOVE_SERVICE_REQUEST, 0,
- c.putListener(listener), req);
- }
-
- /**
- * Clear all registered service discovery requests.
- *
- * <p> The function call immediately returns after sending a request to clear all
- * service discovery requests to the framework. The application is notified of a success
- * or failure to add service through listener callbacks {@link ActionListener#onSuccess} or
- * {@link ActionListener#onFailure}.
- *
- * @param c is the channel created at {@link #initialize}
- * @param listener for callbacks on success or failure. Can be null.
- */
- public void clearServiceRequests(Channel c, ActionListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(CLEAR_SERVICE_REQUESTS,
- 0, c.putListener(listener));
- }
-
- /**
- * Request the current list of peers.
- *
- * @param c is the channel created at {@link #initialize}
- * @param listener for callback when peer list is available. Can be null.
- */
- @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION)
- public void requestPeers(Channel c, PeerListListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(REQUEST_PEERS, 0, c.putListener(listener));
- }
-
- /**
- * Request device connection info.
- *
- * @param c is the channel created at {@link #initialize}
- * @param listener for callback when connection info is available. Can be null.
- */
- public void requestConnectionInfo(Channel c, ConnectionInfoListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(REQUEST_CONNECTION_INFO, 0, c.putListener(listener));
- }
-
- /**
- * Request p2p group info.
- *
- * @param c is the channel created at {@link #initialize}
- * @param listener for callback when group info is available. Can be null.
- */
- @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION)
- public void requestGroupInfo(Channel c, GroupInfoListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(REQUEST_GROUP_INFO, 0, c.putListener(listener));
- }
-
- /**
- * Set p2p device name.
- *
- * @param c is the channel created at {@link #initialize}
- * @param listener for callback when group info is available. Can be null.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_STACK,
- android.Manifest.permission.OVERRIDE_WIFI_CONFIG
- })
- public void setDeviceName(@NonNull Channel c, @NonNull String devName,
- @Nullable ActionListener listener) {
- checkChannel(c);
- WifiP2pDevice d = new WifiP2pDevice();
- d.deviceName = devName;
- c.mAsyncChannel.sendMessage(SET_DEVICE_NAME, 0, c.putListener(listener), d);
- }
-
- /**
- * Set Wifi Display information.
- *
- * @param c is the channel created at {@link #initialize}
- * @param wfdInfo the Wifi Display information to set
- * @param listener for callbacks on success or failure. Can be null.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.CONFIGURE_WIFI_DISPLAY)
- public void setWfdInfo(@NonNull Channel c, @NonNull WifiP2pWfdInfo wfdInfo,
- @Nullable ActionListener listener) {
- setWFDInfo(c, wfdInfo, listener);
- }
-
- /** @hide */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- @RequiresPermission(android.Manifest.permission.CONFIGURE_WIFI_DISPLAY)
- public void setWFDInfo(@NonNull Channel c, @NonNull WifiP2pWfdInfo wfdInfo,
- @Nullable ActionListener listener) {
- checkChannel(c);
- try {
- mService.checkConfigureWifiDisplayPermission();
- } catch (RemoteException e) {
- e.rethrowFromSystemServer();
- }
- c.mAsyncChannel.sendMessage(SET_WFD_INFO, 0, c.putListener(listener), wfdInfo);
- }
-
-
- /**
- * Delete a stored persistent group from the system settings.
- *
- * <p> The function call immediately returns after sending a persistent group removal request
- * to the framework. The application is notified of a success or failure to initiate
- * group removal through listener callbacks {@link ActionListener#onSuccess} or
- * {@link ActionListener#onFailure}.
- *
- * <p>The persistent p2p group list stored in the system can be obtained by
- * {@link #requestPersistentGroupInfo(Channel, PersistentGroupInfoListener)} and
- * a network id can be obtained by {@link WifiP2pGroup#getNetworkId()}.
- *
- * @param c is the channel created at {@link #initialize}
- * @param netId the network id of the p2p group.
- * @param listener for callbacks on success or failure. Can be null.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_STACK,
- android.Manifest.permission.OVERRIDE_WIFI_CONFIG
- })
- public void deletePersistentGroup(@NonNull Channel c, int netId,
- @Nullable ActionListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(DELETE_PERSISTENT_GROUP, netId, c.putListener(listener));
- }
-
- /**
- * Request a list of all the persistent p2p groups stored in system.
- *
- * @param c is the channel created at {@link #initialize}
- * @param listener for callback when persistent group info list is available. Can be null.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(anyOf = {
- android.Manifest.permission.NETWORK_SETTINGS,
- android.Manifest.permission.NETWORK_STACK,
- android.Manifest.permission.READ_WIFI_CREDENTIAL
- })
- public void requestPersistentGroupInfo(@NonNull Channel c,
- @Nullable PersistentGroupInfoListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(REQUEST_PERSISTENT_GROUP_INFO, 0, c.putListener(listener));
- }
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = {"MIRACAST_"}, value = {
- MIRACAST_DISABLED,
- MIRACAST_SOURCE,
- MIRACAST_SINK})
- public @interface MiracastMode {}
-
- /**
- * Miracast is disabled.
- * @hide
- */
- @SystemApi
- public static final int MIRACAST_DISABLED = 0;
- /**
- * Device acts as a Miracast source.
- * @hide
- */
- @SystemApi
- public static final int MIRACAST_SOURCE = 1;
- /**
- * Device acts as a Miracast sink.
- * @hide
- */
- @SystemApi
- public static final int MIRACAST_SINK = 2;
-
- /**
- * This is used to provide information to drivers to optimize performance depending
- * on the current mode of operation.
- * {@link #MIRACAST_DISABLED} - disabled
- * {@link #MIRACAST_SOURCE} - source operation
- * {@link #MIRACAST_SINK} - sink operation
- *
- * As an example, the driver could reduce the channel dwell time during scanning
- * when acting as a source or sink to minimize impact on Miracast.
- *
- * @param mode mode of operation. One of {@link #MIRACAST_DISABLED}, {@link #MIRACAST_SOURCE},
- * or {@link #MIRACAST_SINK}
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.CONFIGURE_WIFI_DISPLAY)
- public void setMiracastMode(@MiracastMode int mode) {
- try {
- mService.setMiracastMode(mode);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- private Messenger getMessenger(@NonNull Binder binder, @Nullable String packageName) {
- try {
- return mService.getMessenger(binder, packageName);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Get a reference to WifiP2pService handler. This is used to establish
- * an AsyncChannel communication with WifiService
- *
- * @param binder A binder for the service to associate with this client.
- *
- * @return Messenger pointing to the WifiP2pService handler
- * @hide
- */
- public Messenger getMessenger(Binder binder) {
- // No way to determine package name in this case.
- return getMessenger(binder, null);
- }
-
- /**
- * Get a reference to P2pStateMachine handler. This is used to establish
- * a priveleged AsyncChannel communication with WifiP2pService.
- *
- * @return Messenger pointing to the WifiP2pService handler
- * @hide
- */
- public Messenger getP2pStateMachineMessenger() {
- try {
- return mService.getP2pStateMachineMessenger();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Get a handover request message for use in WFA NFC Handover transfer.
- * @hide
- */
- public void getNfcHandoverRequest(Channel c, HandoverMessageListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(GET_HANDOVER_REQUEST, 0, c.putListener(listener));
- }
-
-
- /**
- * Get a handover select message for use in WFA NFC Handover transfer.
- * @hide
- */
- public void getNfcHandoverSelect(Channel c, HandoverMessageListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(GET_HANDOVER_SELECT, 0, c.putListener(listener));
- }
-
- /**
- * @hide
- */
- public void initiatorReportNfcHandover(Channel c, String handoverSelect,
- ActionListener listener) {
- checkChannel(c);
- Bundle bundle = new Bundle();
- bundle.putString(EXTRA_HANDOVER_MESSAGE, handoverSelect);
- c.mAsyncChannel.sendMessage(INITIATOR_REPORT_NFC_HANDOVER, 0,
- c.putListener(listener), bundle);
- }
-
-
- /**
- * @hide
- */
- public void responderReportNfcHandover(Channel c, String handoverRequest,
- ActionListener listener) {
- checkChannel(c);
- Bundle bundle = new Bundle();
- bundle.putString(EXTRA_HANDOVER_MESSAGE, handoverRequest);
- c.mAsyncChannel.sendMessage(RESPONDER_REPORT_NFC_HANDOVER, 0,
- c.putListener(listener), bundle);
- }
-
- /**
- * Removes all saved p2p groups.
- *
- * @param c is the channel created at {@link #initialize}.
- * @param listener for callback on success or failure. Can be null.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
- public void factoryReset(@NonNull Channel c, @Nullable ActionListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(FACTORY_RESET, 0, c.putListener(listener));
- }
-
- /**
- * Request saved WifiP2pConfig which used for an ongoing peer connection
- *
- * @param c is the channel created at {@link #initialize}
- * @param listener for callback when ongoing peer config updated. Can't be null.
- *
- * @hide
- */
- @RequiresPermission(android.Manifest.permission.NETWORK_STACK)
- public void requestOngoingPeerConfig(@NonNull Channel c,
- @NonNull OngoingPeerInfoListener listener) {
- checkChannel(c);
- c.mAsyncChannel.sendMessage(REQUEST_ONGOING_PEER_CONFIG,
- Binder.getCallingUid(), c.putListener(listener));
- }
-
- /**
- * Set saved WifiP2pConfig which used for an ongoing peer connection
- *
- * @param c is the channel created at {@link #initialize}
- * @param config used for change an ongoing peer connection
- * @param listener for callback when ongoing peer config updated. Can be null.
- *
- * @hide
- */
- @RequiresPermission(android.Manifest.permission.NETWORK_STACK)
- public void setOngoingPeerConfig(@NonNull Channel c, @NonNull WifiP2pConfig config,
- @Nullable ActionListener listener) {
- checkChannel(c);
- checkP2pConfig(config);
- c.mAsyncChannel.sendMessage(SET_ONGOING_PEER_CONFIG, 0,
- c.putListener(listener), config);
- }
-
- /**
- * Request p2p enabled state.
- *
- * <p> This state indicates whether Wi-Fi p2p is enabled or disabled.
- * The valid value is one of {@link #WIFI_P2P_STATE_DISABLED} or
- * {@link #WIFI_P2P_STATE_ENABLED}. The state is returned using the
- * {@link P2pStateListener} listener.
- *
- * <p> This state is also included in the {@link #WIFI_P2P_STATE_CHANGED_ACTION}
- * broadcast event with extra {@link #EXTRA_WIFI_STATE}.
- *
- * @param c is the channel created at {@link #initialize}.
- * @param listener for callback when p2p state is available..
- */
- public void requestP2pState(@NonNull Channel c,
- @NonNull P2pStateListener listener) {
- checkChannel(c);
- if (listener == null) throw new IllegalArgumentException("This listener cannot be null.");
- c.mAsyncChannel.sendMessage(REQUEST_P2P_STATE, 0, c.putListener(listener));
- }
-
- /**
- * Request p2p discovery state.
- *
- * <p> This state indicates whether p2p discovery has started or stopped.
- * The valid value is one of {@link #WIFI_P2P_DISCOVERY_STARTED} or
- * {@link #WIFI_P2P_DISCOVERY_STOPPED}. The state is returned using the
- * {@link DiscoveryStateListener} listener.
- *
- * <p> This state is also included in the {@link #WIFI_P2P_DISCOVERY_CHANGED_ACTION}
- * broadcast event with extra {@link #EXTRA_DISCOVERY_STATE}.
- *
- * @param c is the channel created at {@link #initialize}.
- * @param listener for callback when discovery state is available..
- */
- public void requestDiscoveryState(@NonNull Channel c,
- @NonNull DiscoveryStateListener listener) {
- checkChannel(c);
- if (listener == null) throw new IllegalArgumentException("This listener cannot be null.");
- c.mAsyncChannel.sendMessage(REQUEST_DISCOVERY_STATE, 0, c.putListener(listener));
- }
-
- /**
- * Request network info.
- *
- * <p> This method provides the network info in the form of a {@link android.net.NetworkInfo}.
- * {@link android.net.NetworkInfo#isAvailable()} indicates the p2p availability and
- * {@link android.net.NetworkInfo#getDetailedState()} reports the current fine-grained state
- * of the network. This {@link android.net.NetworkInfo} is returned using the
- * {@link NetworkInfoListener} listener.
- *
- * <p> This information is also included in the {@link #WIFI_P2P_CONNECTION_CHANGED_ACTION}
- * broadcast event with extra {@link #EXTRA_NETWORK_INFO}.
- *
- * @param c is the channel created at {@link #initialize}.
- * @param listener for callback when network info is available..
- */
- public void requestNetworkInfo(@NonNull Channel c,
- @NonNull NetworkInfoListener listener) {
- checkChannel(c);
- if (listener == null) throw new IllegalArgumentException("This listener cannot be null.");
- c.mAsyncChannel.sendMessage(REQUEST_NETWORK_INFO, 0, c.putListener(listener));
- }
-
- /**
- * Request Device Info
- *
- * <p> This method provides the device info
- * in the form of a {@link android.net.wifi.p2p.WifiP2pDevice}.
- * Valid {@link android.net.wifi.p2p.WifiP2pDevice} is returned when p2p is enabled.
- * To get information notifications on P2P getting enabled refers
- * {@link #WIFI_P2P_STATE_ENABLED}.
- *
- * <p> This {@link android.net.wifi.p2p.WifiP2pDevice} is returned using the
- * {@link DeviceInfoListener} listener.
- *
- * <p> {@link android.net.wifi.p2p.WifiP2pDevice#deviceAddress} is only available if the caller
- * holds the {@code android.Manifest.permission#LOCAL_MAC_ADDRESS} permission, and holds the
- * anonymized MAC address (02:00:00:00:00:00) otherwise.
- *
- * <p> This information is also included in the {@link #WIFI_P2P_THIS_DEVICE_CHANGED_ACTION}
- * broadcast event with extra {@link #EXTRA_WIFI_P2P_DEVICE}.
- *
- * @param c is the channel created at {@link #initialize(Context, Looper, ChannelListener)}.
- * @param listener for callback when network info is available.
- */
- @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION)
- public void requestDeviceInfo(@NonNull Channel c, @NonNull DeviceInfoListener listener) {
- checkChannel(c);
- if (listener == null) throw new IllegalArgumentException("This listener cannot be null.");
- c.mAsyncChannel.sendMessage(REQUEST_DEVICE_INFO, 0, c.putListener(listener));
- }
-}
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pProvDiscEvent.java b/wifi/java/android/net/wifi/p2p/WifiP2pProvDiscEvent.java
deleted file mode 100644
index d0fe92d..0000000
--- a/wifi/java/android/net/wifi/p2p/WifiP2pProvDiscEvent.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2011 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.p2p;
-
-import android.compat.annotation.UnsupportedAppUsage;
-
-/**
- * A class representing a Wi-Fi p2p provisional discovery request/response
- * See {@link #WifiP2pProvDiscEvent} for supported types
- *
- * @hide
- */
-public class WifiP2pProvDiscEvent {
-
- private static final String TAG = "WifiP2pProvDiscEvent";
-
- public static final int PBC_REQ = 1;
- public static final int PBC_RSP = 2;
- public static final int ENTER_PIN = 3;
- public static final int SHOW_PIN = 4;
-
- /* One of PBC_REQ, PBC_RSP, ENTER_PIN or SHOW_PIN */
- @UnsupportedAppUsage
- public int event;
-
- @UnsupportedAppUsage
- public WifiP2pDevice device;
-
- /* Valid when event = SHOW_PIN */
- @UnsupportedAppUsage
- public String pin;
-
- @UnsupportedAppUsage
- public WifiP2pProvDiscEvent() {
- device = new WifiP2pDevice();
- }
-
- /**
- * @param string formats supported include
- *
- * P2P-PROV-DISC-PBC-REQ 42:fc:89:e1:e2:27
- * P2P-PROV-DISC-PBC-RESP 02:12:47:f2:5a:36
- * P2P-PROV-DISC-ENTER-PIN 42:fc:89:e1:e2:27
- * P2P-PROV-DISC-SHOW-PIN 42:fc:89:e1:e2:27 44490607
- *
- * Note: The events formats can be looked up in the wpa_supplicant code
- * @hide
- */
- public WifiP2pProvDiscEvent(String string) throws IllegalArgumentException {
- String[] tokens = string.split(" ");
-
- if (tokens.length < 2) {
- throw new IllegalArgumentException("Malformed event " + string);
- }
-
- if (tokens[0].endsWith("PBC-REQ")) event = PBC_REQ;
- else if (tokens[0].endsWith("PBC-RESP")) event = PBC_RSP;
- else if (tokens[0].endsWith("ENTER-PIN")) event = ENTER_PIN;
- else if (tokens[0].endsWith("SHOW-PIN")) event = SHOW_PIN;
- else throw new IllegalArgumentException("Malformed event " + string);
-
-
- device = new WifiP2pDevice();
- device.deviceAddress = tokens[1];
-
- if (event == SHOW_PIN) {
- pin = tokens[2];
- }
- }
-
- public String toString() {
- StringBuffer sbuf = new StringBuffer();
- sbuf.append(device);
- sbuf.append("\n event: ").append(event);
- sbuf.append("\n pin: ").append(pin);
- return sbuf.toString();
- }
-}
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pWfdInfo.java b/wifi/java/android/net/wifi/p2p/WifiP2pWfdInfo.java
deleted file mode 100644
index e399b5b..0000000
--- a/wifi/java/android/net/wifi/p2p/WifiP2pWfdInfo.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Copyright (C) 2012 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.p2p;
-
-import android.annotation.IntDef;
-import android.annotation.IntRange;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.compat.annotation.UnsupportedAppUsage;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.util.Locale;
-
-/**
- * A class representing Wifi Display information for a device.
- *
- * See Wifi Display technical specification v1.0.0, section 5.1.2.
- */
-public final class WifiP2pWfdInfo implements Parcelable {
-
- private boolean mEnabled;
-
- /** Device information bitmap */
- private int mDeviceInfo;
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = { "DEVICE_TYPE_" }, value = {
- DEVICE_TYPE_WFD_SOURCE,
- DEVICE_TYPE_PRIMARY_SINK,
- DEVICE_TYPE_SECONDARY_SINK,
- DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK})
- public @interface DeviceType {}
-
- /** The device is a Wifi Display Source. */
- public static final int DEVICE_TYPE_WFD_SOURCE = 0;
- /** The device is a primary sink. */
- public static final int DEVICE_TYPE_PRIMARY_SINK = 1;
- /** The device is a secondary sink. */
- public static final int DEVICE_TYPE_SECONDARY_SINK = 2;
- /** The device is dual-role capable i.e. either a WFD source or a primary sink. */
- public static final int DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK = 3;
-
- /**
- * {@link #mDeviceInfo} & {@link #DEVICE_TYPE} is one of {@link #DEVICE_TYPE_WFD_SOURCE},
- * {@link #DEVICE_TYPE_PRIMARY_SINK}, {@link #DEVICE_TYPE_SECONDARY_SINK} or
- * {@link #DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK}.
- *
- * The bit definition is listed in 5.1.2 WFD Device Information Subelement in
- * Wi-Fi Display Technical Specification.
- */
- private static final int DEVICE_TYPE = 1 << 1 | 1 << 0;
- private static final int COUPLED_SINK_SUPPORT_AT_SOURCE = 1 << 2;
- private static final int COUPLED_SINK_SUPPORT_AT_SINK = 1 << 3;
- private static final int SESSION_AVAILABLE_BIT1 = 1 << 4;
- private static final int SESSION_AVAILABLE_BIT2 = 1 << 5;
- private static final int SESSION_AVAILABLE =
- SESSION_AVAILABLE_BIT2 | SESSION_AVAILABLE_BIT1;
- /* The support of Content Protection using the HDCP system 2.0/2.1. */
- private static final int CONTENT_PROTECTION_SUPPORT = 1 << 8;
-
- private int mCtrlPort;
-
- private int mMaxThroughput;
-
- /** Default constructor. */
- public WifiP2pWfdInfo() {}
-
- /** @hide */
- @UnsupportedAppUsage
- public WifiP2pWfdInfo(int devInfo, int ctrlPort, int maxTput) {
- mEnabled = true;
- mDeviceInfo = devInfo;
- mCtrlPort = ctrlPort;
- mMaxThroughput = maxTput;
- }
-
- /** Returns true is Wifi Display is enabled, false otherwise. */
- public boolean isEnabled() {
- return mEnabled;
- }
-
- /**
- * Sets whether Wifi Display should be enabled.
- *
- * @param enabled true to enable Wifi Display, false to disable
- */
- public void setEnabled(boolean enabled) {
- mEnabled = enabled;
- }
-
- /**
- * Get the type of the device.
- * One of {@link #DEVICE_TYPE_WFD_SOURCE}, {@link #DEVICE_TYPE_PRIMARY_SINK},
- * {@link #DEVICE_TYPE_SECONDARY_SINK}, {@link #DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK}
- */
- @DeviceType
- public int getDeviceType() {
- return mDeviceInfo & DEVICE_TYPE;
- }
-
- /**
- * Sets the type of the device.
- *
- * @param deviceType One of {@link #DEVICE_TYPE_WFD_SOURCE}, {@link #DEVICE_TYPE_PRIMARY_SINK},
- * {@link #DEVICE_TYPE_SECONDARY_SINK}, {@link #DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK}
- * @return true if the device type was successfully set, false otherwise
- */
- public boolean setDeviceType(@DeviceType int deviceType) {
- if (DEVICE_TYPE_WFD_SOURCE <= deviceType
- && deviceType <= DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK) {
- mDeviceInfo &= ~DEVICE_TYPE;
- mDeviceInfo |= deviceType;
- return true;
- }
- return false;
- }
-
- /** Returns true if a session is available, false otherwise. */
- public boolean isSessionAvailable() {
- return (mDeviceInfo & SESSION_AVAILABLE) != 0;
- }
-
- /**
- * Sets whether a session is available.
- *
- * @param enabled true to indicate that a session is available, false otherwise.
- */
- public void setSessionAvailable(boolean enabled) {
- if (enabled) {
- mDeviceInfo |= SESSION_AVAILABLE_BIT1;
- mDeviceInfo &= ~SESSION_AVAILABLE_BIT2;
- } else {
- mDeviceInfo &= ~SESSION_AVAILABLE;
- }
- }
-
- /**
- * @return true if Content Protection using the HDCP system 2.0/2.1 is supported.
- */
- public boolean isContentProtectionSupported() {
- return (mDeviceInfo & CONTENT_PROTECTION_SUPPORT) != 0;
- }
-
- /**
- * Sets whether Content Protection using the HDCP system 2.0/2.1 is supported.
- *
- * @param enabled true to indicate that Content Protection is supported, false otherwise.
- */
- public void setContentProtectionSupported(boolean enabled) {
- if (enabled) {
- mDeviceInfo |= CONTENT_PROTECTION_SUPPORT;
- } else {
- mDeviceInfo &= ~CONTENT_PROTECTION_SUPPORT;
- }
- }
-
- /** Returns the TCP port at which the WFD Device listens for RTSP messages. */
- public int getControlPort() {
- return mCtrlPort;
- }
-
- /** Sets the TCP port at which the WFD Device listens for RTSP messages. */
- public void setControlPort(@IntRange(from = 0) int port) {
- mCtrlPort = port;
- }
-
- /** Sets the maximum average throughput capability of the WFD Device, in megabits/second. */
- public void setMaxThroughput(@IntRange(from = 0) int maxThroughput) {
- mMaxThroughput = maxThroughput;
- }
-
- /** Returns the maximum average throughput capability of the WFD Device, in megabits/second. */
- public int getMaxThroughput() {
- return mMaxThroughput;
- }
-
- /** @hide */
- public String getDeviceInfoHex() {
- return String.format(
- Locale.US, "%04x%04x%04x", mDeviceInfo, mCtrlPort, mMaxThroughput);
- }
-
- @Override
- public String toString() {
- StringBuffer sbuf = new StringBuffer();
- sbuf.append("WFD enabled: ").append(mEnabled);
- sbuf.append("WFD DeviceInfo: ").append(mDeviceInfo);
- sbuf.append("\n WFD CtrlPort: ").append(mCtrlPort);
- sbuf.append("\n WFD MaxThroughput: ").append(mMaxThroughput);
- return sbuf.toString();
- }
-
- /** Implement the Parcelable interface */
- public int describeContents() {
- return 0;
- }
-
- /** Copy constructor. */
- public WifiP2pWfdInfo(@Nullable WifiP2pWfdInfo source) {
- if (source != null) {
- mEnabled = source.mEnabled;
- mDeviceInfo = source.mDeviceInfo;
- mCtrlPort = source.mCtrlPort;
- mMaxThroughput = source.mMaxThroughput;
- }
- }
-
- /** Implement the Parcelable interface */
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- dest.writeInt(mEnabled ? 1 : 0);
- dest.writeInt(mDeviceInfo);
- dest.writeInt(mCtrlPort);
- dest.writeInt(mMaxThroughput);
- }
-
- private void readFromParcel(Parcel in) {
- mEnabled = (in.readInt() == 1);
- mDeviceInfo = in.readInt();
- mCtrlPort = in.readInt();
- mMaxThroughput = in.readInt();
- }
-
- /** Implement the Parcelable interface */
- public static final @NonNull Creator<WifiP2pWfdInfo> CREATOR =
- new Creator<WifiP2pWfdInfo>() {
- public WifiP2pWfdInfo createFromParcel(Parcel in) {
- WifiP2pWfdInfo device = new WifiP2pWfdInfo();
- device.readFromParcel(in);
- return device;
- }
-
- public WifiP2pWfdInfo[] newArray(int size) {
- return new WifiP2pWfdInfo[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceInfo.java b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceInfo.java
deleted file mode 100644
index e2f40cf..0000000
--- a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceInfo.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Copyright (C) 2012 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.p2p.nsd;
-
-import android.compat.annotation.UnsupportedAppUsage;
-import android.os.Build;
-import android.text.TextUtils;
-
-import com.android.net.module.util.DnsSdTxtRecord;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * A class for storing Bonjour service information that is advertised
- * over a Wi-Fi peer-to-peer setup.
- *
- * {@see android.net.wifi.p2p.WifiP2pManager#addLocalService}
- * {@see android.net.wifi.p2p.WifiP2pManager#removeLocalService}
- * {@see WifiP2pServiceInfo}
- * {@see WifiP2pUpnpServiceInfo}
- */
-public class WifiP2pDnsSdServiceInfo extends WifiP2pServiceInfo {
-
- /**
- * Bonjour version 1.
- * @hide
- */
- public static final int VERSION_1 = 0x01;
-
- /**
- * Pointer record.
- * @hide
- */
- public static final int DNS_TYPE_PTR = 12;
-
- /**
- * Text record.
- * @hide
- */
- public static final int DNS_TYPE_TXT = 16;
-
- /**
- * virtual memory packet.
- * see E.3 of the Wi-Fi Direct technical specification for the detail.<br>
- * Key: domain name Value: pointer address.<br>
- */
- private final static Map<String, String> sVmPacket;
-
- static {
- sVmPacket = new HashMap<String, String>();
- sVmPacket.put("_tcp.local.", "c00c");
- sVmPacket.put("local.", "c011");
- sVmPacket.put("_udp.local.", "c01c");
- }
-
- /**
- * This constructor is only used in newInstance().
- *
- * @param queryList
- */
- private WifiP2pDnsSdServiceInfo(List<String> queryList) {
- super(queryList);
- }
-
- /**
- * Create a Bonjour service information object.
- *
- * @param instanceName instance name.<br>
- * e.g) "MyPrinter"
- * @param serviceType service type.<br>
- * e.g) "_ipp._tcp"
- * @param txtMap TXT record with key/value pair in a map confirming to format defined at
- * http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt
- * @return Bonjour service information object
- */
- public static WifiP2pDnsSdServiceInfo newInstance(String instanceName,
- String serviceType, Map<String, String> txtMap) {
- if (TextUtils.isEmpty(instanceName) || TextUtils.isEmpty(serviceType)) {
- throw new IllegalArgumentException(
- "instance name or service type cannot be empty");
- }
-
- DnsSdTxtRecord txtRecord = new DnsSdTxtRecord();
- if (txtMap != null) {
- for (String key : txtMap.keySet()) {
- txtRecord.set(key, txtMap.get(key));
- }
- }
-
- ArrayList<String> queries = new ArrayList<String>();
- queries.add(createPtrServiceQuery(instanceName, serviceType));
- queries.add(createTxtServiceQuery(instanceName, serviceType, txtRecord));
-
- return new WifiP2pDnsSdServiceInfo(queries);
- }
-
- /**
- * Create wpa_supplicant service query for PTR record.
- *
- * @param instanceName instance name.<br>
- * e.g) "MyPrinter"
- * @param serviceType service type.<br>
- * e.g) "_ipp._tcp"
- * @return wpa_supplicant service query.
- */
- private static String createPtrServiceQuery(String instanceName,
- String serviceType) {
-
- StringBuffer sb = new StringBuffer();
- sb.append("bonjour ");
- sb.append(createRequest(serviceType + ".local.", DNS_TYPE_PTR, VERSION_1));
- sb.append(" ");
-
- byte[] data = instanceName.getBytes();
- sb.append(String.format(Locale.US, "%02x", data.length));
- sb.append(WifiP2pServiceInfo.bin2HexStr(data));
- // This is the start point of this response.
- // Therefore, it indicates the request domain name.
- sb.append("c027");
- return sb.toString();
- }
-
- /**
- * Create wpa_supplicant service query for TXT record.
- *
- * @param instanceName instance name.<br>
- * e.g) "MyPrinter"
- * @param serviceType service type.<br>
- * e.g) "_ipp._tcp"
- * @param txtRecord TXT record.<br>
- * @return wpa_supplicant service query.
- */
- private static String createTxtServiceQuery(String instanceName,
- String serviceType,
- DnsSdTxtRecord txtRecord) {
-
-
- StringBuffer sb = new StringBuffer();
- sb.append("bonjour ");
-
- sb.append(createRequest((instanceName + "." + serviceType + ".local."),
- DNS_TYPE_TXT, VERSION_1));
- sb.append(" ");
- byte[] rawData = txtRecord.getRawData();
- if (rawData.length == 0) {
- sb.append("00");
- } else {
- sb.append(bin2HexStr(rawData));
- }
- return sb.toString();
- }
-
- /**
- * Create bonjour service discovery request.
- *
- * @param dnsName dns name
- * @param dnsType dns type
- * @param version version number
- * @hide
- */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
- static String createRequest(String dnsName, int dnsType, int version) {
- StringBuffer sb = new StringBuffer();
-
- /*
- * The request format is as follows.
- * ________________________________________________
- * | Encoded and Compressed dns name (variable) |
- * ________________________________________________
- * | Type (2) | Version (1) |
- */
- if (dnsType == WifiP2pDnsSdServiceInfo.DNS_TYPE_TXT) {
- dnsName = dnsName.toLowerCase(Locale.ROOT); // TODO: is this right?
- }
- sb.append(compressDnsName(dnsName));
- sb.append(String.format(Locale.US, "%04x", dnsType));
- sb.append(String.format(Locale.US, "%02x", version));
-
- return sb.toString();
- }
-
- /**
- * Compress DNS data.
- *
- * see E.3 of the Wi-Fi Direct technical specification for the detail.
- *
- * @param dnsName dns name
- * @return compressed dns name
- */
- private static String compressDnsName(String dnsName) {
- StringBuffer sb = new StringBuffer();
-
- // The domain name is replaced with a pointer to a prior
- // occurrence of the same name in virtual memory packet.
- while (true) {
- String data = sVmPacket.get(dnsName);
- if (data != null) {
- sb.append(data);
- break;
- }
- int i = dnsName.indexOf('.');
- if (i == -1) {
- if (dnsName.length() > 0) {
- sb.append(String.format(Locale.US, "%02x", dnsName.length()));
- sb.append(WifiP2pServiceInfo.bin2HexStr(dnsName.getBytes()));
- }
- // for a sequence of labels ending in a zero octet
- sb.append("00");
- break;
- }
-
- String name = dnsName.substring(0, i);
- dnsName = dnsName.substring(i + 1);
- sb.append(String.format(Locale.US, "%02x", name.length()));
- sb.append(WifiP2pServiceInfo.bin2HexStr(name.getBytes()));
- }
- return sb.toString();
- }
-}
diff --git a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceRequest.java b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceRequest.java
deleted file mode 100644
index d5415e0..0000000
--- a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceRequest.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2012 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.p2p.nsd;
-
-import android.net.wifi.p2p.WifiP2pManager;
-
-/**
- * A class for creating a Bonjour service discovery request for use with
- * {@link WifiP2pManager#addServiceRequest} and {@link WifiP2pManager#removeServiceRequest}
- *
- * {@see WifiP2pManager}
- * {@see WifiP2pServiceRequest}
- * {@see WifiP2pUpnpServiceRequest}
- */
-public class WifiP2pDnsSdServiceRequest extends WifiP2pServiceRequest {
-
- /**
- * This constructor is only used in newInstance().
- *
- * @param query The part of service specific query.
- * @hide
- */
- private WifiP2pDnsSdServiceRequest(String query) {
- super(WifiP2pServiceInfo.SERVICE_TYPE_BONJOUR, query);
- }
-
- /**
- * This constructor is only used in newInstance().
- * @hide
- */
- private WifiP2pDnsSdServiceRequest() {
- super(WifiP2pServiceInfo.SERVICE_TYPE_BONJOUR, null);
- }
-
- private WifiP2pDnsSdServiceRequest(String dnsQuery, int dnsType, int version) {
- super(WifiP2pServiceInfo.SERVICE_TYPE_BONJOUR, WifiP2pDnsSdServiceInfo.createRequest(
- dnsQuery,
- dnsType,
- version));
- }
-
- /**
- * Create a service discovery request to search all Bonjour services.
- *
- * @return service request for Bonjour.
- */
- public static WifiP2pDnsSdServiceRequest newInstance() {
- return new WifiP2pDnsSdServiceRequest();
- }
-
- /**
- * Create a service discovery to search for Bonjour services with the specified
- * service type.
- *
- * @param serviceType service type. Cannot be null <br>
- * "_afpovertcp._tcp."(Apple File Sharing over TCP)<br>
- * "_ipp._tcp" (IP Printing over TCP)<br>
- * "_http._tcp" (http service)
- * @return service request for DnsSd.
- */
- public static WifiP2pDnsSdServiceRequest newInstance(String serviceType) {
- if (serviceType == null) {
- throw new IllegalArgumentException("service type cannot be null");
- }
- return new WifiP2pDnsSdServiceRequest(serviceType + ".local.",
- WifiP2pDnsSdServiceInfo.DNS_TYPE_PTR,
- WifiP2pDnsSdServiceInfo.VERSION_1);
- }
-
- /**
- * Create a service discovery request to get the TXT data from the specified
- * Bonjour service.
- *
- * @param instanceName instance name. Cannot be null. <br>
- * "MyPrinter"
- * @param serviceType service type. Cannot be null. <br>
- * e.g) <br>
- * "_afpovertcp._tcp"(Apple File Sharing over TCP)<br>
- * "_ipp._tcp" (IP Printing over TCP)<br>
- * @return service request for Bonjour.
- */
- public static WifiP2pDnsSdServiceRequest newInstance(String instanceName,
- String serviceType) {
- if (instanceName == null || serviceType == null) {
- throw new IllegalArgumentException(
- "instance name or service type cannot be null");
- }
- String fullDomainName = instanceName + "." + serviceType + ".local.";
- return new WifiP2pDnsSdServiceRequest(fullDomainName,
- WifiP2pDnsSdServiceInfo.DNS_TYPE_TXT,
- WifiP2pDnsSdServiceInfo.VERSION_1);
- }
-}
diff --git a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceResponse.java b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceResponse.java
deleted file mode 100644
index ed84a1a..0000000
--- a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceResponse.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * Copyright (C) 2012 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.p2p.nsd;
-
-import android.net.wifi.p2p.WifiP2pDevice;
-
-import java.io.ByteArrayInputStream;
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A class for a response of bonjour service discovery.
- *
- * @hide
- */
-public class WifiP2pDnsSdServiceResponse extends WifiP2pServiceResponse {
-
- /**
- * DNS query name.
- * e.g)
- * for PTR
- * "_ipp._tcp.local."
- * for TXT
- * "MyPrinter._ipp._tcp.local."
- */
- private String mDnsQueryName;
-
- /**
- * Service instance name.
- * e.g) "MyPrinter"
- * This field is only used when the dns type equals to
- * {@link WifiP2pDnsSdServiceInfo#DNS_TYPE_PTR}.
- */
- private String mInstanceName;
-
- /**
- * DNS Type.
- * Should be {@link WifiP2pDnsSdServiceInfo#DNS_TYPE_PTR} or
- * {@link WifiP2pDnsSdServiceInfo#DNS_TYPE_TXT}.
- */
- private int mDnsType;
-
- /**
- * DnsSd version number.
- * Should be {@link WifiP2pDnsSdServiceInfo#VERSION_1}.
- */
- private int mVersion;
-
- /**
- * Txt record.
- * This field is only used when the dns type equals to
- * {@link WifiP2pDnsSdServiceInfo#DNS_TYPE_TXT}.
- */
- private final HashMap<String, String> mTxtRecord = new HashMap<String, String>();
-
- /**
- * Virtual memory packet.
- * see E.3 of the Wi-Fi Direct technical specification for the detail.<br>
- * The spec can be obtained from wi-fi.org
- * Key: pointer Value: domain name.<br>
- */
- private final static Map<Integer, String> sVmpack;
-
- static {
- sVmpack = new HashMap<Integer, String>();
- sVmpack.put(0x0c, "_tcp.local.");
- sVmpack.put(0x11, "local.");
- sVmpack.put(0x1c, "_udp.local.");
- }
-
- /**
- * Returns query DNS name.
- * @return DNS name.
- */
- public String getDnsQueryName() {
- return mDnsQueryName;
- }
-
- /**
- * Return query DNS type.
- * @return DNS type.
- */
- public int getDnsType() {
- return mDnsType;
- }
-
- /**
- * Return bonjour version number.
- * @return version number.
- */
- public int getVersion() {
- return mVersion;
- }
-
- /**
- * Return instance name.
- * @return
- */
- public String getInstanceName() {
- return mInstanceName;
- }
-
- /**
- * Return TXT record data.
- * @return TXT record data.
- */
- public Map<String, String> getTxtRecord() {
- return mTxtRecord;
- }
-
- @Override
- public String toString() {
- StringBuffer sbuf = new StringBuffer();
- sbuf.append("serviceType:DnsSd(").append(mServiceType).append(")");
- sbuf.append(" status:").append(Status.toString(mStatus));
- sbuf.append(" srcAddr:").append(mDevice.deviceAddress);
- sbuf.append(" version:").append(String.format("%02x", mVersion));
- sbuf.append(" dnsName:").append(mDnsQueryName);
- sbuf.append(" TxtRecord:");
- for (String key : mTxtRecord.keySet()) {
- sbuf.append(" key:").append(key).append(" value:").append(mTxtRecord.get(key));
- }
- if (mInstanceName != null) {
- sbuf.append(" InsName:").append(mInstanceName);
- }
- return sbuf.toString();
- }
-
- /**
- * This is only used in framework.
- * @param status status code.
- * @param dev source device.
- * @param data RDATA.
- * @hide
- */
- protected WifiP2pDnsSdServiceResponse(int status,
- int tranId, WifiP2pDevice dev, byte[] data) {
- super(WifiP2pServiceInfo.SERVICE_TYPE_BONJOUR,
- status, tranId, dev, data);
- if (!parse()) {
- throw new IllegalArgumentException("Malformed bonjour service response");
- }
- }
-
- /**
- * Parse DnsSd service discovery response.
- *
- * @return {@code true} if the operation succeeded
- */
- private boolean parse() {
- /*
- * The data format from Wi-Fi Direct spec is as follows.
- * ________________________________________________
- * | encoded and compressed dns name (variable) |
- * ________________________________________________
- * | dnstype(2byte) | version(1byte) |
- * ________________________________________________
- * | RDATA (variable) |
- */
- if (mData == null) {
- // the empty is OK.
- return true;
- }
-
- DataInputStream dis = new DataInputStream(new ByteArrayInputStream(mData));
-
- mDnsQueryName = readDnsName(dis);
- if (mDnsQueryName == null) {
- return false;
- }
-
- try {
- mDnsType = dis.readUnsignedShort();
- mVersion = dis.readUnsignedByte();
- } catch (IOException e) {
- e.printStackTrace();
- return false;
- }
-
- if (mDnsType == WifiP2pDnsSdServiceInfo.DNS_TYPE_PTR) {
- String rData = readDnsName(dis);
- if (rData == null) {
- return false;
- }
- if (rData.length() <= mDnsQueryName.length()) {
- return false;
- }
-
- mInstanceName = rData.substring(0,
- rData.length() - mDnsQueryName.length() -1);
- } else if (mDnsType == WifiP2pDnsSdServiceInfo.DNS_TYPE_TXT) {
- return readTxtData(dis);
- } else {
- return false;
- }
-
- return true;
- }
-
- /**
- * Read dns name.
- *
- * @param dis data input stream.
- * @return dns name
- */
- private String readDnsName(DataInputStream dis) {
- StringBuffer sb = new StringBuffer();
-
- // copy virtual memory packet.
- HashMap<Integer, String> vmpack = new HashMap<Integer, String>(sVmpack);
- if (mDnsQueryName != null) {
- vmpack.put(0x27, mDnsQueryName);
- }
- try {
- while (true) {
- int i = dis.readUnsignedByte();
- if (i == 0x00) {
- return sb.toString();
- } else if (i == 0xc0) {
- // refer to pointer.
- String ref = vmpack.get(dis.readUnsignedByte());
- if (ref == null) {
- //invalid.
- return null;
- }
- sb.append(ref);
- return sb.toString();
- } else {
- byte[] data = new byte[i];
- dis.readFully(data);
- sb.append(new String(data));
- sb.append(".");
- }
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- /**
- * Read TXT record data.
- *
- * @param dis
- * @return true if TXT data is valid
- */
- private boolean readTxtData(DataInputStream dis) {
- try {
- while (dis.available() > 0) {
- int len = dis.readUnsignedByte();
- if (len == 0) {
- break;
- }
- byte[] data = new byte[len];
- dis.readFully(data);
- String[] keyVal = new String(data).split("=");
- if (keyVal.length != 2) {
- return false;
- }
- mTxtRecord.put(keyVal[0], keyVal[1]);
- }
- return true;
- } catch (IOException e) {
- e.printStackTrace();
- }
- return false;
- }
-
- /**
- * Creates DnsSd service response.
- * This is only called from WifiP2pServiceResponse
- *
- * @param status status code.
- * @param dev source device.
- * @param data DnsSd response data.
- * @return DnsSd service response data.
- * @hide
- */
- static WifiP2pDnsSdServiceResponse newInstance(int status,
- int transId, WifiP2pDevice dev, byte[] data) {
- if (status != WifiP2pServiceResponse.Status.SUCCESS) {
- return new WifiP2pDnsSdServiceResponse(status,
- transId, dev, null);
- }
- try {
- return new WifiP2pDnsSdServiceResponse(status,
- transId, dev, data);
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- }
- return null;
- }
-}
diff --git a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pServiceInfo.java b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pServiceInfo.java
deleted file mode 100644
index 5d018e7..0000000
--- a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pServiceInfo.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright (C) 2012 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.p2p.nsd;
-
-import android.compat.annotation.UnsupportedAppUsage;
-import android.os.Build;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A class for storing service information that is advertised
- * over a Wi-Fi peer-to-peer setup
- *
- * @see WifiP2pUpnpServiceInfo
- * @see WifiP2pDnsSdServiceInfo
- */
-public class WifiP2pServiceInfo implements Parcelable {
-
- /**
- * All service protocol types.
- */
- public static final int SERVICE_TYPE_ALL = 0;
-
- /**
- * DNS based service discovery protocol.
- */
- public static final int SERVICE_TYPE_BONJOUR = 1;
-
- /**
- * UPnP protocol.
- */
- public static final int SERVICE_TYPE_UPNP = 2;
-
- /**
- * WS-Discovery protocol
- * @hide
- */
- public static final int SERVICE_TYPE_WS_DISCOVERY = 3;
-
- /**
- * Vendor Specific protocol
- */
- public static final int SERVICE_TYPE_VENDOR_SPECIFIC = 255;
-
- /**
- * the list of query string for wpa_supplicant
- *
- * e.g)
- * # IP Printing over TCP (PTR) (RDATA=MyPrinter._ipp._tcp.local.)
- * {"bonjour", "045f697070c00c000c01", "094d795072696e746572c027"
- *
- * # IP Printing over TCP (TXT) (RDATA=txtvers=1,pdl=application/postscript)
- * {"bonjour", "096d797072696e746572045f697070c00c001001",
- * "09747874766572733d311a70646c3d6170706c69636174696f6e2f706f7374736372797074"}
- *
- * [UPnP]
- * # UPnP uuid
- * {"upnp", "10", "uuid:6859dede-8574-59ab-9332-123456789012"}
- *
- * # UPnP rootdevice
- * {"upnp", "10", "uuid:6859dede-8574-59ab-9332-123456789012::upnp:rootdevice"}
- *
- * # UPnP device
- * {"upnp", "10", "uuid:6859dede-8574-59ab-9332-123456789012::urn:schemas-upnp
- * -org:device:InternetGatewayDevice:1"}
- *
- * # UPnP service
- * {"upnp", "10", "uuid:6859dede-8574-59ab-9322-123456789012::urn:schemas-upnp
- * -org:service:ContentDirectory:2"}
- */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
- private List<String> mQueryList;
-
- /**
- * This is only used in subclass.
- *
- * @param queryList query string for wpa_supplicant
- * @hide
- */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
- protected WifiP2pServiceInfo(List<String> queryList) {
- if (queryList == null) {
- throw new IllegalArgumentException("query list cannot be null");
- }
- mQueryList = queryList;
- }
-
- /**
- * Return the list of the query string for wpa_supplicant.
- *
- * @return the list of the query string for wpa_supplicant.
- * @hide
- */
- public List<String> getSupplicantQueryList() {
- return mQueryList;
- }
-
- /**
- * Converts byte array to hex string.
- *
- * @param data
- * @return hex string.
- * @hide
- */
- static String bin2HexStr(byte[] data) {
- StringBuffer sb = new StringBuffer();
-
- for (byte b: data) {
- String s = null;
- try {
- s = Integer.toHexString(b & 0xff);
- } catch (Exception e) {
- e.printStackTrace();
- return null;
- }
- //add 0 padding
- if (s.length() == 1) {
- sb.append('0');
- }
- sb.append(s);
- }
- return sb.toString();
- }
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if (!(o instanceof WifiP2pServiceInfo)) {
- return false;
- }
-
- WifiP2pServiceInfo servInfo = (WifiP2pServiceInfo)o;
- return mQueryList.equals(servInfo.mQueryList);
- }
-
- @Override
- public int hashCode() {
- int result = 17;
- result = 31 * result + (mQueryList == null ? 0 : mQueryList.hashCode());
- return result;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeStringList(mQueryList);
- }
-
- /** Implement the Parcelable interface {@hide} */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final @android.annotation.NonNull Creator<WifiP2pServiceInfo> CREATOR =
- new Creator<WifiP2pServiceInfo>() {
- public WifiP2pServiceInfo createFromParcel(Parcel in) {
-
- List<String> data = new ArrayList<String>();
- in.readStringList(data);
- return new WifiP2pServiceInfo(data);
- }
-
- public WifiP2pServiceInfo[] newArray(int size) {
- return new WifiP2pServiceInfo[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pServiceRequest.java b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pServiceRequest.java
deleted file mode 100644
index dea0477..0000000
--- a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pServiceRequest.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * Copyright (C) 2012 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.p2p.nsd;
-
-import android.compat.annotation.UnsupportedAppUsage;
-import android.net.wifi.p2p.WifiP2pManager;
-import android.os.Build;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.util.Locale;
-
-/**
- * A class for creating a service discovery request for use with
- * {@link WifiP2pManager#addServiceRequest} and {@link WifiP2pManager#removeServiceRequest}
- *
- * <p>This class is used to create service discovery request for custom
- * vendor specific service discovery protocol {@link WifiP2pServiceInfo#SERVICE_TYPE_VENDOR_SPECIFIC}
- * or to search all service protocols {@link WifiP2pServiceInfo#SERVICE_TYPE_ALL}.
- *
- * <p>For the purpose of creating a UPnP or Bonjour service request, use
- * {@link WifiP2pUpnpServiceRequest} or {@link WifiP2pDnsSdServiceRequest} respectively.
- *
- * {@see WifiP2pManager}
- * {@see WifiP2pUpnpServiceRequest}
- * {@see WifiP2pDnsSdServiceRequest}
- */
-public class WifiP2pServiceRequest implements Parcelable {
-
- /**
- * Service discovery protocol. It's defined in table63 in Wi-Fi Direct specification.
- */
- private int mProtocolType;
-
- /**
- * The length of the service request TLV.
- * The value is equal to 2 plus the number of octets in the
- * query data field.
- */
- private int mLength;
-
- /**
- * Service transaction ID.
- * This is a nonzero value used to match the service request/response TLVs.
- */
- private int mTransId;
-
- /**
- * The hex dump string of query data for the requested service information.
- *
- * e.g) DnsSd apple file sharing over tcp (dns name=_afpovertcp._tcp.local.)
- * 0b5f6166706f766572746370c00c000c01
- */
- private String mQuery;
-
- /**
- * This constructor is only used in newInstance().
- *
- * @param protocolType service discovery protocol.
- * @param query The part of service specific query.
- * @hide
- */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
- protected WifiP2pServiceRequest(int protocolType, String query) {
- validateQuery(query);
-
- mProtocolType = protocolType;
- mQuery = query;
- if (query != null) {
- mLength = query.length()/2 + 2;
- } else {
- mLength = 2;
- }
- }
-
- /**
- * This constructor is only used in Parcelable.
- *
- * @param serviceType service discovery type.
- * @param length the length of service discovery packet.
- * @param transId the transaction id
- * @param query The part of service specific query.
- */
- private WifiP2pServiceRequest(int serviceType, int length,
- int transId, String query) {
- mProtocolType = serviceType;
- mLength = length;
- mTransId = transId;
- mQuery = query;
- }
-
- /**
- * Return transaction id.
- *
- * @return transaction id
- * @hide
- */
- public int getTransactionId() {
- return mTransId;
- }
-
- /**
- * Set transaction id.
- *
- * @param id
- * @hide
- */
- public void setTransactionId(int id) {
- mTransId = id;
- }
-
- /**
- * Return wpa_supplicant request string.
- *
- * The format is the hex dump of the following frame.
- * <pre>
- * _______________________________________________________________
- * | Length (2) | Type (1) | Transaction ID (1) |
- * | Query Data (variable) |
- * </pre>
- *
- * @return wpa_supplicant request string.
- * @hide
- */
- public String getSupplicantQuery() {
- StringBuffer sb = new StringBuffer();
- // length is retained as little endian format.
- sb.append(String.format(Locale.US, "%02x", (mLength) & 0xff));
- sb.append(String.format(Locale.US, "%02x", (mLength >> 8) & 0xff));
- sb.append(String.format(Locale.US, "%02x", mProtocolType));
- sb.append(String.format(Locale.US, "%02x", mTransId));
- if (mQuery != null) {
- sb.append(mQuery);
- }
-
- return sb.toString();
- }
-
- /**
- * Validate query.
- *
- * <p>If invalid, throw IllegalArgumentException.
- * @param query The part of service specific query.
- */
- private void validateQuery(String query) {
- if (query == null) {
- return;
- }
-
- int UNSIGNED_SHORT_MAX = 0xffff;
- if (query.length()%2 == 1) {
- throw new IllegalArgumentException(
- "query size is invalid. query=" + query);
- }
- if (query.length()/2 > UNSIGNED_SHORT_MAX) {
- throw new IllegalArgumentException(
- "query size is too large. len=" + query.length());
- }
-
- // check whether query is hex string.
- query = query.toLowerCase(Locale.ROOT);
- char[] chars = query.toCharArray();
- for (char c: chars) {
- if (!((c >= '0' && c <= '9') ||
- (c >= 'a' && c <= 'f'))){
- throw new IllegalArgumentException(
- "query should be hex string. query=" + query);
- }
- }
- }
-
- /**
- * Create a service discovery request.
- *
- * @param protocolType can be {@link WifiP2pServiceInfo#SERVICE_TYPE_ALL}
- * or {@link WifiP2pServiceInfo#SERVICE_TYPE_VENDOR_SPECIFIC}.
- * In order to create a UPnP or Bonjour service request, use
- * {@link WifiP2pUpnpServiceRequest} or {@link WifiP2pDnsSdServiceRequest}
- * respectively
- *
- * @param queryData hex string that is vendor specific. Can be null.
- * @return service discovery request.
- */
- public static WifiP2pServiceRequest newInstance(int protocolType, String queryData) {
- return new WifiP2pServiceRequest(protocolType, queryData);
- }
-
- /**
- * Create a service discovery request.
- *
- * @param protocolType can be {@link WifiP2pServiceInfo#SERVICE_TYPE_ALL}
- * or {@link WifiP2pServiceInfo#SERVICE_TYPE_VENDOR_SPECIFIC}.
- * In order to create a UPnP or Bonjour service request, use
- * {@link WifiP2pUpnpServiceRequest} or {@link WifiP2pDnsSdServiceRequest}
- * respectively
- *
- * @return service discovery request.
- */
- public static WifiP2pServiceRequest newInstance(int protocolType ) {
- return new WifiP2pServiceRequest(protocolType, null);
- }
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if (!(o instanceof WifiP2pServiceRequest)) {
- return false;
- }
-
- WifiP2pServiceRequest req = (WifiP2pServiceRequest)o;
-
- /*
- * Not compare transaction id.
- * Transaction id may be changed on each service discovery operation.
- */
- if ((req.mProtocolType != mProtocolType) ||
- (req.mLength != mLength)) {
- return false;
- }
-
- if (req.mQuery == null && mQuery == null) {
- return true;
- } else if (req.mQuery != null) {
- return req.mQuery.equals(mQuery);
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- int result = 17;
- result = 31 * result + mProtocolType;
- result = 31 * result + mLength;
- result = 31 * result + (mQuery == null ? 0 : mQuery.hashCode());
- return result;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(mProtocolType);
- dest.writeInt(mLength);
- dest.writeInt(mTransId);
- dest.writeString(mQuery);
- }
-
- /** Implement the Parcelable interface {@hide} */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final @android.annotation.NonNull Creator<WifiP2pServiceRequest> CREATOR =
- new Creator<WifiP2pServiceRequest>() {
- public WifiP2pServiceRequest createFromParcel(Parcel in) {
- int servType = in.readInt();
- int length = in.readInt();
- int transId = in.readInt();
- String query = in.readString();
- return new WifiP2pServiceRequest(servType, length, transId, query);
- }
-
- public WifiP2pServiceRequest[] newArray(int size) {
- return new WifiP2pServiceRequest[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pServiceResponse.java b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pServiceResponse.java
deleted file mode 100644
index 1b9c080..0000000
--- a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pServiceResponse.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * Copyright (C) 2012 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.p2p.nsd;
-
-import android.net.wifi.p2p.WifiP2pDevice;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.io.ByteArrayInputStream;
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * The class for a response of service discovery.
- *
- * @hide
- */
-public class WifiP2pServiceResponse implements Parcelable {
-
- private static int MAX_BUF_SIZE = 1024;
-
- /**
- * Service type. It's defined in table63 in Wi-Fi Direct specification.
- */
- protected int mServiceType;
-
- /**
- * Status code of service discovery response.
- * It's defined in table65 in Wi-Fi Direct specification.
- * @see Status
- */
- protected int mStatus;
-
- /**
- * Service transaction ID.
- * This is a nonzero value used to match the service request/response TLVs.
- */
- protected int mTransId;
-
- /**
- * Source device.
- */
- protected WifiP2pDevice mDevice;
-
- /**
- * Service discovery response data based on the requested on
- * the service protocol type. The protocol format depends on the service type.
- */
- protected byte[] mData;
-
-
- /**
- * The status code of service discovery response.
- * Currently 4 status codes are defined and the status codes from 4 to 255
- * are reserved.
- *
- * See Wi-Fi Direct specification for the detail.
- */
- public static class Status {
- /** success */
- public static final int SUCCESS = 0;
-
- /** the service protocol type is not available */
- public static final int SERVICE_PROTOCOL_NOT_AVAILABLE = 1;
-
- /** the requested information is not available */
- public static final int REQUESTED_INFORMATION_NOT_AVAILABLE = 2;
-
- /** bad request */
- public static final int BAD_REQUEST = 3;
-
- /** @hide */
- public static String toString(int status) {
- switch(status) {
- case SUCCESS:
- return "SUCCESS";
- case SERVICE_PROTOCOL_NOT_AVAILABLE:
- return "SERVICE_PROTOCOL_NOT_AVAILABLE";
- case REQUESTED_INFORMATION_NOT_AVAILABLE:
- return "REQUESTED_INFORMATION_NOT_AVAILABLE";
- case BAD_REQUEST:
- return "BAD_REQUEST";
- default:
- return "UNKNOWN";
- }
- }
-
- /** not used */
- private Status() {}
- }
-
- /**
- * Hidden constructor. This is only used in framework.
- *
- * @param serviceType service discovery type.
- * @param status status code.
- * @param transId transaction id.
- * @param device source device.
- * @param data query data.
- */
- protected WifiP2pServiceResponse(int serviceType, int status, int transId,
- WifiP2pDevice device, byte[] data) {
- mServiceType = serviceType;
- mStatus = status;
- mTransId = transId;
- mDevice = device;
- mData = data;
- }
-
- /**
- * Return the service type of service discovery response.
- *
- * @return service discovery type.<br>
- * e.g) {@link WifiP2pServiceInfo#SERVICE_TYPE_BONJOUR}
- */
- public int getServiceType() {
- return mServiceType;
- }
-
- /**
- * Return the status code of service discovery response.
- *
- * @return status code.
- * @see Status
- */
- public int getStatus() {
- return mStatus;
- }
-
- /**
- * Return the transaction id of service discovery response.
- *
- * @return transaction id.
- * @hide
- */
- public int getTransactionId() {
- return mTransId;
- }
-
- /**
- * Return response data.
- *
- * <pre>Data format depends on service type
- *
- * @return a query or response data.
- */
- public byte[] getRawData() {
- return mData;
- }
-
- /**
- * Returns the source device of service discovery response.
- *
- * <pre>This is valid only when service discovery response.
- *
- * @return the source device of service discovery response.
- */
- public WifiP2pDevice getSrcDevice() {
- return mDevice;
- }
-
- /** @hide */
- public void setSrcDevice(WifiP2pDevice dev) {
- if (dev == null) return;
- this.mDevice = dev;
- }
-
-
- /**
- * Create the list of WifiP2pServiceResponse instance from supplicant event.
- *
- * @param srcAddr source address of the service response
- * @param tlvsBin byte array containing the binary tlvs data
- * @return if parse failed, return null
- * @hide
- */
- public static List<WifiP2pServiceResponse> newInstance(String srcAddr, byte[] tlvsBin) {
- //updateIndicator not used, and not passed up from supplicant
-
- List<WifiP2pServiceResponse> respList = new ArrayList<WifiP2pServiceResponse>();
- WifiP2pDevice dev = new WifiP2pDevice();
- dev.deviceAddress = srcAddr;
- if (tlvsBin == null) {
- return null;
- }
-
-
- DataInputStream dis = new DataInputStream(new ByteArrayInputStream(tlvsBin));
- try {
- while (dis.available() > 0) {
- /*
- * Service discovery header is as follows.
- * ______________________________________________________________
- * | Length(2byte) | Type(1byte) | TransId(1byte)}|
- * ______________________________________________________________
- * | status(1byte) | vendor specific(variable) |
- */
- // The length equals to 3 plus the number of octets in the vendor
- // specific content field. And this is little endian.
- int length = (dis.readUnsignedByte() +
- (dis.readUnsignedByte() << 8)) - 3;
- int type = dis.readUnsignedByte();
- int transId = dis.readUnsignedByte();
- int status = dis.readUnsignedByte();
- if (length < 0) {
- return null;
- }
- if (length == 0) {
- if (status == Status.SUCCESS) {
- respList.add(new WifiP2pServiceResponse(type, status,
- transId, dev, null));
- }
- continue;
- }
- if (length > MAX_BUF_SIZE) {
- dis.skip(length);
- continue;
- }
- byte[] data = new byte[length];
- dis.readFully(data);
-
- WifiP2pServiceResponse resp;
- if (type == WifiP2pServiceInfo.SERVICE_TYPE_BONJOUR) {
- resp = WifiP2pDnsSdServiceResponse.newInstance(status,
- transId, dev, data);
- } else if (type == WifiP2pServiceInfo.SERVICE_TYPE_UPNP) {
- resp = WifiP2pUpnpServiceResponse.newInstance(status,
- transId, dev, data);
- } else {
- resp = new WifiP2pServiceResponse(type, status, transId, dev, data);
- }
- if (resp != null && resp.getStatus() == Status.SUCCESS) {
- respList.add(resp);
- }
- }
- return respList;
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- if (respList.size() > 0) {
- return respList;
- }
- return null;
- }
-
- /**
- * Converts hex string to byte array.
- *
- * @param hex hex string. if invalid, return null.
- * @return binary data.
- */
- private static byte[] hexStr2Bin(String hex) {
- int sz = hex.length()/2;
- byte[] b = new byte[hex.length()/2];
-
- for (int i=0;i<sz;i++) {
- try {
- b[i] = (byte)Integer.parseInt(hex.substring(i*2, i*2+2), 16);
- } catch (Exception e) {
- e.printStackTrace();
- return null;
- }
- }
- return b;
- }
-
- @Override
- public String toString() {
- StringBuffer sbuf = new StringBuffer();
- sbuf.append("serviceType:").append(mServiceType);
- sbuf.append(" status:").append(Status.toString(mStatus));
- sbuf.append(" srcAddr:").append(mDevice.deviceAddress);
- sbuf.append(" data:").append(Arrays.toString(mData));
- return sbuf.toString();
- }
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if (!(o instanceof WifiP2pServiceResponse)) {
- return false;
- }
-
- WifiP2pServiceResponse req = (WifiP2pServiceResponse)o;
-
- return (req.mServiceType == mServiceType) &&
- (req.mStatus == mStatus) &&
- equals(req.mDevice.deviceAddress, mDevice.deviceAddress) &&
- Arrays.equals(req.mData, mData);
- }
-
- private boolean equals(Object a, Object b) {
- if (a == null && b == null) {
- return true;
- } else if (a != null) {
- return a.equals(b);
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- int result = 17;
- result = 31 * result + mServiceType;
- result = 31 * result + mStatus;
- result = 31 * result + mTransId;
- result = 31 * result + (mDevice.deviceAddress == null ?
- 0 : mDevice.deviceAddress.hashCode());
- result = 31 * result + (mData == null ? 0 : Arrays.hashCode(mData));
- return result;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public int describeContents() {
- return 0;
- }
-
- /** Implement the Parcelable interface {@hide} */
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(mServiceType);
- dest.writeInt(mStatus);
- dest.writeInt(mTransId);
- dest.writeParcelable(mDevice, flags);
- if (mData == null || mData.length == 0) {
- dest.writeInt(0);
- } else {
- dest.writeInt(mData.length);
- dest.writeByteArray(mData);
- }
- }
-
- /** Implement the Parcelable interface {@hide} */
- public static final @android.annotation.NonNull Creator<WifiP2pServiceResponse> CREATOR =
- new Creator<WifiP2pServiceResponse>() {
- public WifiP2pServiceResponse createFromParcel(Parcel in) {
-
- int type = in.readInt();
- int status = in.readInt();
- int transId = in.readInt();
- WifiP2pDevice dev = (WifiP2pDevice)in.readParcelable(null);
- int len = in.readInt();
- byte[] data = null;
- if (len > 0) {
- data = new byte[len];
- in.readByteArray(data);
- }
- if (type == WifiP2pServiceInfo.SERVICE_TYPE_BONJOUR) {
- return WifiP2pDnsSdServiceResponse.newInstance(status,
- transId, dev, data);
- } else if (type == WifiP2pServiceInfo.SERVICE_TYPE_UPNP) {
- return WifiP2pUpnpServiceResponse.newInstance(status,
- transId, dev, data);
- }
- return new WifiP2pServiceResponse(type, status, transId, dev, data);
- }
-
- public WifiP2pServiceResponse[] newArray(int size) {
- return new WifiP2pServiceResponse[size];
- }
- };
-}
diff --git a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pUpnpServiceInfo.java b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pUpnpServiceInfo.java
deleted file mode 100644
index a4cdfd9..0000000
--- a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pUpnpServiceInfo.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2012 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.p2p.nsd;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-import java.util.UUID;
-
-/**
- * A class for storing Upnp service information that is advertised
- * over a Wi-Fi peer-to-peer setup.
- *
- * {@see android.net.wifi.p2p.WifiP2pManager#addLocalService}
- * {@see android.net.wifi.p2p.WifiP2pManager#removeLocalService}
- * {@see WifiP2pServiceInfo}
- * {@see WifiP2pDnsSdServiceInfo}
- */
-public class WifiP2pUpnpServiceInfo extends WifiP2pServiceInfo {
-
- /**
- * UPnP version 1.0.
- *
- * <pre>Query Version should always be set to 0x10 if the query values are
- * compatible with UPnP Device Architecture 1.0.
- * @hide
- */
- public static final int VERSION_1_0 = 0x10;
-
- /**
- * This constructor is only used in newInstance().
- *
- * @param queryList
- */
- private WifiP2pUpnpServiceInfo(List<String> queryList) {
- super(queryList);
- }
-
- /**
- * Create UPnP service information object.
- *
- * @param uuid a string representation of this UUID in the following format,
- * as per <a href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>.<br>
- * e.g) 6859dede-8574-59ab-9332-123456789012
- * @param device a string representation of this device in the following format,
- * as per
- * <a href="http://www.upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf">
- * UPnP Device Architecture1.1</a><br>
- * e.g) urn:schemas-upnp-org:device:MediaServer:1
- * @param services a string representation of this service in the following format,
- * as per
- * <a href="http://www.upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf">
- * UPnP Device Architecture1.1</a><br>
- * e.g) urn:schemas-upnp-org:service:ContentDirectory:1
- * @return UPnP service information object.
- */
- public static WifiP2pUpnpServiceInfo newInstance(String uuid,
- String device, List<String> services) {
- if (uuid == null || device == null) {
- throw new IllegalArgumentException("uuid or device cannnot be null");
- }
- UUID.fromString(uuid);
-
- ArrayList<String> info = new ArrayList<String>();
-
- info.add(createSupplicantQuery(uuid, null));
- info.add(createSupplicantQuery(uuid, "upnp:rootdevice"));
- info.add(createSupplicantQuery(uuid, device));
- if (services != null) {
- for (String service:services) {
- info.add(createSupplicantQuery(uuid, service));
- }
- }
-
- return new WifiP2pUpnpServiceInfo(info);
- }
-
- /**
- * Create wpa_supplicant service query for upnp.
- *
- * @param uuid
- * @param data
- * @return wpa_supplicant service query for upnp
- */
- private static String createSupplicantQuery(String uuid, String data) {
- StringBuffer sb = new StringBuffer();
- sb.append("upnp ");
- sb.append(String.format(Locale.US, "%02x ", VERSION_1_0));
- sb.append("uuid:");
- sb.append(uuid);
- if (data != null) {
- sb.append("::");
- sb.append(data);
- }
- return sb.toString();
- }
-}
diff --git a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pUpnpServiceRequest.java b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pUpnpServiceRequest.java
deleted file mode 100644
index 98e447e..0000000
--- a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pUpnpServiceRequest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2012 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.p2p.nsd;
-
-import android.net.wifi.p2p.WifiP2pManager;
-
-import java.util.Locale;
-
-/**
- * A class for creating a Upnp service discovery request for use with
- * {@link WifiP2pManager#addServiceRequest} and {@link WifiP2pManager#removeServiceRequest}
- *
- * {@see WifiP2pManager}
- * {@see WifiP2pServiceRequest}
- * {@see WifiP2pDnsSdServiceRequest}
- */
-public class WifiP2pUpnpServiceRequest extends WifiP2pServiceRequest {
-
- /**
- * This constructor is only used in newInstance().
- *
- * @param query The part of service specific query.
- * @hide
- */
- protected WifiP2pUpnpServiceRequest(String query) {
- super(WifiP2pServiceInfo.SERVICE_TYPE_UPNP, query);
- }
-
- /**
- * This constructor is only used in newInstance().
- * @hide
- */
- protected WifiP2pUpnpServiceRequest() {
- super(WifiP2pServiceInfo.SERVICE_TYPE_UPNP, null);
- }
-
- /**
- * Create a service discovery request to search all UPnP services.
- *
- * @return service request for UPnP.
- */
- public static WifiP2pUpnpServiceRequest newInstance() {
- return new WifiP2pUpnpServiceRequest();
- }
- /**
- * Create a service discovery request to search specified UPnP services.
- *
- * @param st ssdp search target. Cannot be null.<br>
- * e.g ) <br>
- * <ul>
- * <li>"ssdp:all"
- * <li>"upnp:rootdevice"
- * <li>"urn:schemas-upnp-org:device:MediaServer:2"
- * <li>"urn:schemas-upnp-org:service:ContentDirectory:2"
- * <li>"uuid:6859dede-8574-59ab-9332-123456789012"
- * </ul>
- * @return service request for UPnP.
- */
- public static WifiP2pUpnpServiceRequest newInstance(String st) {
- if (st == null) {
- throw new IllegalArgumentException("search target cannot be null");
- }
- StringBuffer sb = new StringBuffer();
- sb.append(String.format(Locale.US, "%02x", WifiP2pUpnpServiceInfo.VERSION_1_0));
- sb.append(WifiP2pServiceInfo.bin2HexStr(st.getBytes()));
- return new WifiP2pUpnpServiceRequest(sb.toString());
- }
-}
diff --git a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pUpnpServiceResponse.java b/wifi/java/android/net/wifi/p2p/nsd/WifiP2pUpnpServiceResponse.java
deleted file mode 100644
index ab95af6f6..0000000
--- a/wifi/java/android/net/wifi/p2p/nsd/WifiP2pUpnpServiceResponse.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2012 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.p2p.nsd;
-
-import android.net.wifi.p2p.WifiP2pDevice;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A class for a response of upnp service discovery.
- *
- * @hide
- */
-public class WifiP2pUpnpServiceResponse extends WifiP2pServiceResponse {
-
- /**
- * UPnP version. should be {@link WifiP2pUpnpServiceInfo#VERSION_1_0}
- */
- private int mVersion;
-
- /**
- * The list of Unique Service Name.
- * e.g)
- *{"uuid:6859dede-8574-59ab-9332-123456789012",
- *"uuid:6859dede-8574-59ab-9332-123456789012::upnp:rootdevice"}
- */
- private List<String> mUniqueServiceNames;
-
- /**
- * Return UPnP version number.
- *
- * @return version number.
- * @see WifiP2pUpnpServiceInfo#VERSION_1_0
- */
- public int getVersion() {
- return mVersion;
- }
-
- /**
- * Return Unique Service Name strings.
- *
- * @return Unique Service Name.<br>
- * e.g ) <br>
- * <ul>
- * <li>"uuid:6859dede-8574-59ab-9332-123456789012"
- * <li>"uuid:6859dede-8574-59ab-9332-123456789012::upnp:rootdevice"
- * <li>"uuid:6859dede-8574-59ab-9332-123456789012::urn:schemas-upnp-org:device:
- * MediaServer:2"
- * <li>"uuid:6859dede-8574-59ab-9332-123456789012::urn:schemas-upnp-org:service:
- * ContentDirectory:2"
- * </ul>
- */
- public List<String> getUniqueServiceNames() {
- return mUniqueServiceNames;
- }
-
- /**
- * hidden constructor.
- *
- * @param status status code
- * @param transId transaction id
- * @param dev source device
- * @param data UPnP response data.
- */
- protected WifiP2pUpnpServiceResponse(int status,
- int transId, WifiP2pDevice dev, byte[] data) {
- super(WifiP2pServiceInfo.SERVICE_TYPE_UPNP,
- status, transId, dev, data);
- if (!parse()) {
- throw new IllegalArgumentException("Malformed upnp service response");
- }
- }
-
- /**
- * Parse UPnP service discovery response
- *
- * @return {@code true} if the operation succeeded
- */
- private boolean parse() {
- /*
- * The data format is as follows.
- *
- * ______________________________________________________
- * | Version (1) | USN (Variable) |
- */
- if (mData == null) {
- // the empty is OK.
- return true;
- }
-
- if (mData.length < 1) {
- return false;
- }
-
- mVersion = mData[0] & 0xff;
- String[] names = new String(mData, 1, mData.length-1).split(",");
- mUniqueServiceNames = new ArrayList<String>();
- for (String name : names) {
- mUniqueServiceNames.add(name);
- }
- return true;
- }
-
- @Override
- public String toString() {
- StringBuffer sbuf = new StringBuffer();
- sbuf.append("serviceType:UPnP(").append(mServiceType).append(")");
- sbuf.append(" status:").append(Status.toString(mStatus));
- sbuf.append(" srcAddr:").append(mDevice.deviceAddress);
- sbuf.append(" version:").append(String.format("%02x", mVersion));
- if (mUniqueServiceNames != null) {
- for (String name : mUniqueServiceNames) {
- sbuf.append(" usn:").append(name);
- }
- }
- return sbuf.toString();
- }
-
- /**
- * Create upnp service response.
- *
- * <pre>This is only used in{@link WifiP2pServiceResponse}
- *
- * @param status status code.
- * @param transId transaction id.
- * @param device source device.
- * @param data UPnP response data.
- * @return UPnP service response data.
- * @hide
- */
- static WifiP2pUpnpServiceResponse newInstance(int status,
- int transId, WifiP2pDevice device, byte[] data) {
- if (status != WifiP2pServiceResponse.Status.SUCCESS) {
- return new WifiP2pUpnpServiceResponse(status, transId, device, null);
- }
-
- try {
- return new WifiP2pUpnpServiceResponse(status, transId, device, data);
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- }
- return null;
- }
-}
diff --git a/wifi/java/android/net/wifi/p2p/package.html b/wifi/java/android/net/wifi/p2p/package.html
deleted file mode 100644
index 6a5e8e6..0000000
--- a/wifi/java/android/net/wifi/p2p/package.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<HTML>
-<BODY>
-<p>Provides classes to create peer-to-peer (P2P) connections with Wi-Fi Direct.</p>
-
-<p>Using these APIs, you can discover and connect to other devices when each
-device supports Wi-Fi Direct, then communicate over a speedy connection across distances much longer
-than a Bluetooth connection. The primary class you need to work with is {@link
-android.net.wifi.p2p.WifiP2pManager}, which you can acquire by calling {@link
-android.app.Activity#getSystemService getSystemService(WIFI_P2P_SERVICE)}. The {@link
-android.net.wifi.p2p.WifiP2pManager} includes APIs that allow you to:</p>
-<ul>
-<li>Initialize your application for P2P connections by calling {@link
-android.net.wifi.p2p.WifiP2pManager#initialize initialize()}</li>
-
-<li>Discover nearby devices by calling {@link android.net.wifi.p2p.WifiP2pManager#discoverPeers
-discoverPeers()}</li>
-
-<li>Start a P2P connection by calling {@link android.net.wifi.p2p.WifiP2pManager#connect
-connect()}</li>
-<li>And more</li>
-</ul>
-
-<p>Several other interfaces and classes are necessary as well, such as:</p>
-<ul>
-<li>The {@link android.net.wifi.p2p.WifiP2pManager.ActionListener} interface allows you to receive
-callbacks when an operation such as discovering peers or connecting to them succeeds or fails.</li>
-
-<li>{@link android.net.wifi.p2p.WifiP2pManager.PeerListListener} interface allows you to receive
-information about discovered peers. The callback provides a {@link
-android.net.wifi.p2p.WifiP2pDeviceList}, from which you can retrieve a {@link
-android.net.wifi.p2p.WifiP2pDevice} object for each device within range and get information such as
-the device name, address, device type, the WPS configurations the device supports, and more.</li>
-
-<li>The {@link android.net.wifi.p2p.WifiP2pManager.GroupInfoListener} interface allows you to
-receive information about a P2P group. The callback provides a {@link
-android.net.wifi.p2p.WifiP2pGroup} object, which provides group information such as the owner, the
-network name, and passphrase.</li>
-
-<li>{@link android.net.wifi.p2p.WifiP2pManager.ConnectionInfoListener} interface allows you to
-receive information about the current connection. The callback provides a {@link
-android.net.wifi.p2p.WifiP2pInfo} object, which has information such as whether a group has been
-formed and who is the group owner.</li>
-</ul>
-
-<p>In order to use the Wi-Fi P2P APIs, your app must request the following user permissions:</p>
-<ul>
-<li>{@link android.Manifest.permission#ACCESS_WIFI_STATE}</li>
-<li>{@link android.Manifest.permission#CHANGE_WIFI_STATE}</li>
-<li>{@link android.Manifest.permission#INTERNET} (although your app doesn’t technically connect
-to the Internet, communicating to Wi-Fi Direct peers with standard java sockets requires Internet
-permission).</li>
-</ul>
-
-<p>For example code, see the <a href="{@docRoot}resources/samples/WiFiDirectDemo/index.html">Wi-Fi
-Direct Demo</a> sample application.</p>
-
-<p class="note"><strong>Note:</strong> Not all Android-powered devices support Wi-Fi
-Direct. If your application uses Wi-Fi Direct, declare so with a <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
-element in the manifest file:</p>
-<pre>
-<manifest ...>
- <uses-feature android:name="android.hardware.wifi.direct" />
- ...
-</manifest>
-</pre>
-</BODY>
-</HTML>
diff --git a/wifi/java/android/net/wifi/package.html b/wifi/java/android/net/wifi/package.html
deleted file mode 100644
index b21d39d..0000000
--- a/wifi/java/android/net/wifi/package.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<HTML>
-<BODY>
-<p>Provides classes to manage Wi-Fi functionality on the device.</p>
-<p>The Wi-Fi APIs provide a means by which applications can communicate
-with the lower-level wireless stack that provides Wi-Fi network access. Almost all
-information from the device supplicant is available, including the connected network's
-link speed, IP address, negotiation state, and more, plus information about other
-networks that are available. Some other API features include the ability to
-scan, add, save, terminate and initiate Wi-Fi connections.</p>
-
-<p>Some APIs may require the following user permissions:</p>
-<ul>
- <li>{@link android.Manifest.permission#ACCESS_WIFI_STATE}</li>
- <li>{@link android.Manifest.permission#CHANGE_WIFI_STATE}</li>
- <li>{@link android.Manifest.permission#CHANGE_WIFI_MULTICAST_STATE}</li>
-</ul>
-
-<p class="note"><strong>Note:</strong> Not all Android-powered devices provide Wi-Fi functionality.
-If your application uses Wi-Fi, declare so with a <a
-href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
-element in the manifest file:</p>
-<pre>
-<manifest ...>
- <uses-feature android:name="android.hardware.wifi" />
- ...
-</manifest>
-</pre>
-</BODY>
-</HTML>
diff --git a/wifi/java/android/net/wifi/rtt/CivicLocation.java b/wifi/java/android/net/wifi/rtt/CivicLocation.java
deleted file mode 100644
index 1d41177..0000000
--- a/wifi/java/android/net/wifi/rtt/CivicLocation.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- * 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.net.wifi.rtt;
-
-import android.annotation.Nullable;
-import android.location.Address;
-import android.net.wifi.rtt.CivicLocationKeys.CivicLocationKeysType;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.os.Parcelable.Creator;
-import android.util.SparseArray;
-
-import java.nio.charset.StandardCharsets;
-import java.util.Locale;
-import java.util.Objects;
-
-/**
- * Decodes the Type Length Value (TLV) elements found in a Location Civic Record as defined by IEEE
- * P802.11-REVmc/D8.0 section 9.4.2.22.13 using the format described in IETF RFC 4776.
- *
- * <p>The TLVs each define a key, value pair for a civic address type such as apt, street, city,
- * county, and country. The class provides a general getter method to extract a value for an element
- * key, returning null if not set.
- *
- * @hide
- */
-public final class CivicLocation implements Parcelable {
- // Address (class) line indexes
- private static final int ADDRESS_LINE_0_ROOM_DESK_FLOOR = 0;
- private static final int ADDRESS_LINE_1_NUMBER_ROAD_SUFFIX_APT = 1;
- private static final int ADDRESS_LINE_2_CITY = 2;
- private static final int ADDRESS_LINE_3_STATE_POSTAL_CODE = 3;
- private static final int ADDRESS_LINE_4_COUNTRY = 4;
-
- // Buffer management
- private static final int MIN_CIVIC_BUFFER_SIZE = 3;
- private static final int MAX_CIVIC_BUFFER_SIZE = 256;
- private static final int COUNTRY_CODE_LENGTH = 2;
- private static final int BYTE_MASK = 0xFF;
- private static final int TLV_TYPE_INDEX = 0;
- private static final int TLV_LENGTH_INDEX = 1;
- private static final int TLV_VALUE_INDEX = 2;
-
- private final boolean mIsValid;
- private final String mCountryCode; // Two character country code (ISO 3166 standard).
- private SparseArray<String> mCivicAddressElements =
- new SparseArray<>(MIN_CIVIC_BUFFER_SIZE);
-
-
- /**
- * Constructor
- *
- * @param civicTLVs a byte buffer containing parameters in the form type, length, value
- * @param countryCode the two letter code defined by the ISO 3166 standard
- *
- * @hide
- */
- public CivicLocation(@Nullable byte[] civicTLVs, @Nullable String countryCode) {
- this.mCountryCode = countryCode;
- if (countryCode == null || countryCode.length() != COUNTRY_CODE_LENGTH) {
- this.mIsValid = false;
- return;
- }
- boolean isValid = false;
- if (civicTLVs != null
- && civicTLVs.length >= MIN_CIVIC_BUFFER_SIZE
- && civicTLVs.length < MAX_CIVIC_BUFFER_SIZE) {
- isValid = parseCivicTLVs(civicTLVs);
- }
-
- mIsValid = isValid;
- }
-
- private CivicLocation(Parcel in) {
- mIsValid = in.readByte() != 0;
- mCountryCode = in.readString();
- mCivicAddressElements = in.readSparseArray(this.getClass().getClassLoader());
- }
-
- public static final @android.annotation.NonNull Creator<CivicLocation> CREATOR = new Creator<CivicLocation>() {
- @Override
- public CivicLocation createFromParcel(Parcel in) {
- return new CivicLocation(in);
- }
-
- @Override
- public CivicLocation[] newArray(int size) {
- return new CivicLocation[size];
- }
- };
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel parcel, int flags) {
- parcel.writeByte((byte) (mIsValid ? 1 : 0));
- parcel.writeString(mCountryCode);
- parcel.writeSparseArray((android.util.SparseArray) mCivicAddressElements);
- }
-
- /**
- * Check TLV format and store TLV key/value pairs in this object so they can be queried by key.
- *
- * @param civicTLVs the buffer of TLV elements
- * @return a boolean indicating success of the parsing process
- */
- private boolean parseCivicTLVs(byte[] civicTLVs) {
- int bufferPtr = 0;
- int bufferLength = civicTLVs.length;
-
- // Iterate through the sub-elements contained in the LCI IE checking the accumulated
- // element lengths do not overflow the total buffer length
- while (bufferPtr < bufferLength) {
- int civicAddressType = civicTLVs[bufferPtr + TLV_TYPE_INDEX] & BYTE_MASK;
- int civicAddressTypeLength = civicTLVs[bufferPtr + TLV_LENGTH_INDEX];
- if (civicAddressTypeLength != 0) {
- if (bufferPtr + TLV_VALUE_INDEX + civicAddressTypeLength > bufferLength) {
- return false;
- }
- mCivicAddressElements.put(civicAddressType,
- new String(civicTLVs, bufferPtr + TLV_VALUE_INDEX,
- civicAddressTypeLength, StandardCharsets.UTF_8));
- }
- bufferPtr += civicAddressTypeLength + TLV_VALUE_INDEX;
- }
- return true;
- }
-
- /**
- * Getter for the value of a civic Address element type.
- *
- * @param key an integer code for the element type key
- * @return the string value associated with that element type
- */
- @Nullable
- public String getCivicElementValue(@CivicLocationKeysType int key) {
- return mCivicAddressElements.get(key);
- }
-
- /**
- * Converts a CivicLocation object to a SparseArray.
- *
- * @return the SparseArray<string> representation of the CivicLocation
- */
- @Nullable
- public SparseArray<String> toSparseArray() {
- return mCivicAddressElements;
- }
-
- /**
- * Generates a comma separated string of all the defined elements.
- *
- * @return a compiled string representing all elements
- */
- @Override
- public String toString() {
- return mCivicAddressElements.toString();
- }
-
- /**
- * Converts Civic Location to the best effort Address Object.
- *
- * @return the {@link Address} object based on the Civic Location data
- */
- @Nullable
- public Address toAddress() {
- if (!mIsValid) {
- return null;
- }
- Address address = new Address(Locale.US);
- String room = formatAddressElement("Room: ", getCivicElementValue(CivicLocationKeys.ROOM));
- String desk =
- formatAddressElement(" Desk: ", getCivicElementValue(CivicLocationKeys.DESK));
- String floor =
- formatAddressElement(", Flr: ", getCivicElementValue(CivicLocationKeys.FLOOR));
- String houseNumber = formatAddressElement("", getCivicElementValue(CivicLocationKeys.HNO));
- String houseNumberSuffix =
- formatAddressElement("", getCivicElementValue(CivicLocationKeys.HNS));
- String road =
- formatAddressElement(" ", getCivicElementValue(
- CivicLocationKeys.PRIMARY_ROAD_NAME));
- String roadSuffix = formatAddressElement(" ", getCivicElementValue(CivicLocationKeys.STS));
- String apt = formatAddressElement(", Apt: ", getCivicElementValue(CivicLocationKeys.APT));
- String city = formatAddressElement("", getCivicElementValue(CivicLocationKeys.CITY));
- String state = formatAddressElement("", getCivicElementValue(CivicLocationKeys.STATE));
- String postalCode =
- formatAddressElement(" ", getCivicElementValue(CivicLocationKeys.POSTAL_CODE));
-
- // Aggregation into common address format
- String addressLine0 =
- new StringBuilder().append(room).append(desk).append(floor).toString();
- String addressLine1 =
- new StringBuilder().append(houseNumber).append(houseNumberSuffix).append(road)
- .append(roadSuffix).append(apt).toString();
- String addressLine2 = city;
- String addressLine3 = new StringBuilder().append(state).append(postalCode).toString();
- String addressLine4 = mCountryCode;
-
- // Setting Address object line fields by common convention.
- address.setAddressLine(ADDRESS_LINE_0_ROOM_DESK_FLOOR, addressLine0);
- address.setAddressLine(ADDRESS_LINE_1_NUMBER_ROAD_SUFFIX_APT, addressLine1);
- address.setAddressLine(ADDRESS_LINE_2_CITY, addressLine2);
- address.setAddressLine(ADDRESS_LINE_3_STATE_POSTAL_CODE, addressLine3);
- address.setAddressLine(ADDRESS_LINE_4_COUNTRY, addressLine4);
-
- // Other compatible fields between the CIVIC_ADDRESS and the Address Class.
- address.setFeatureName(getCivicElementValue(CivicLocationKeys.NAM)); // Structure name
- address.setSubThoroughfare(getCivicElementValue(CivicLocationKeys.HNO));
- address.setThoroughfare(getCivicElementValue(CivicLocationKeys.PRIMARY_ROAD_NAME));
- address.setSubLocality(getCivicElementValue(CivicLocationKeys.NEIGHBORHOOD));
- address.setSubAdminArea(getCivicElementValue(CivicLocationKeys.COUNTY));
- address.setAdminArea(getCivicElementValue(CivicLocationKeys.STATE));
- address.setPostalCode(getCivicElementValue(CivicLocationKeys.POSTAL_CODE));
- address.setCountryCode(mCountryCode); // Country
- return address;
- }
-
- /**
- * Prepares an address element so that it can be integrated into an address line convention.
- *
- * <p>If an address element is null, the return string will be empty e.g. "".
- *
- * @param label a string defining the type of address element
- * @param value a string defining the elements value
- * @return the formatted version of the value, with null values converted to empty strings
- */
- private String formatAddressElement(String label, String value) {
- if (value != null) {
- return label + value;
- } else {
- return "";
- }
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!(obj instanceof CivicLocation)) {
- return false;
- }
- CivicLocation other = (CivicLocation) obj;
- return mIsValid == other.mIsValid
- && Objects.equals(mCountryCode, other.mCountryCode)
- && isSparseArrayStringEqual(mCivicAddressElements, other.mCivicAddressElements);
- }
-
- @Override
- public int hashCode() {
- int[] civicAddressKeys = getSparseArrayKeys(mCivicAddressElements);
- String[] civicAddressValues = getSparseArrayValues(mCivicAddressElements);
- return Objects.hash(mIsValid, mCountryCode, civicAddressKeys, civicAddressValues);
- }
-
- /**
- * Tests if the Civic Location object is valid
- *
- * @return a boolean defining mIsValid
- */
- public boolean isValid() {
- return mIsValid;
- }
-
- /**
- * Tests if two sparse arrays are equal on a key for key basis
- *
- * @param sa1 the first sparse array
- * @param sa2 the second sparse array
- * @return the boolean result after comparing values key by key
- */
- private boolean isSparseArrayStringEqual(SparseArray<String> sa1, SparseArray<String> sa2) {
- int size = sa1.size();
- if (size != sa2.size()) {
- return false;
- }
- for (int i = 0; i < size; i++) {
- String sa1Value = sa1.valueAt(i);
- String sa2Value = sa2.valueAt(i);
- if (!sa1Value.equals(sa2Value)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Extract an array of all the keys in a SparseArray<String>
- *
- * @param sa the sparse array of Strings
- * @return an integer array of all keys in the SparseArray<String>
- */
- private int[] getSparseArrayKeys(SparseArray<String> sa) {
- int size = sa.size();
- int[] keys = new int[size];
- for (int i = 0; i < size; i++) {
- keys[i] = sa.keyAt(i);
- }
- return keys;
- }
-
- /**
- * Extract an array of all the String values in a SparseArray<String>
- *
- * @param sa the sparse array of Strings
- * @return a String array of all values in the SparseArray<String>
- */
- private String[] getSparseArrayValues(SparseArray<String> sa) {
- int size = sa.size();
- String[] values = new String[size];
- for (int i = 0; i < size; i++) {
- values[i] = sa.valueAt(i);
- }
- return values;
- }
-}
diff --git a/wifi/java/android/net/wifi/rtt/CivicLocationKeys.java b/wifi/java/android/net/wifi/rtt/CivicLocationKeys.java
deleted file mode 100644
index b03f4a9..0000000
--- a/wifi/java/android/net/wifi/rtt/CivicLocationKeys.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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.net.wifi.rtt;
-
-import static java.lang.annotation.RetentionPolicy.SOURCE;
-
-import android.annotation.IntDef;
-
-import java.lang.annotation.Retention;
-
-/**
- * Civic Address key types used to define address elements.
- *
- * <p>These keys can be used with {@code ResponderLocation.toCivicLocationSparseArray()}
- * to look-up the corresponding string values.</p>
- */
-public class CivicLocationKeys {
-
- /**
- * An enumeration of all civic location keys.
- *
- * @hide
- */
- @Retention(SOURCE)
- @IntDef({LANGUAGE, STATE, COUNTY, CITY, BOROUGH, NEIGHBORHOOD, GROUP_OF_STREETS, PRD, POD, STS,
- HNO, HNS, LMK, LOC, NAM, POSTAL_CODE, BUILDING, APT, FLOOR, ROOM, TYPE_OF_PLACE, PCN,
- PO_BOX, ADDITIONAL_CODE, DESK, PRIMARY_ROAD_NAME, ROAD_SECTION, BRANCH_ROAD_NAME,
- SUBBRANCH_ROAD_NAME, STREET_NAME_PRE_MODIFIER, STREET_NAME_POST_MODIFIER, SCRIPT})
- public @interface CivicLocationKeysType {
- }
-
- /** Language key e.g. i-default. */
- public static final int LANGUAGE = 0;
- /** Category label A1 key e.g. California. */
- public static final int STATE = 1;
- /** Category label A2 key e.g. Marin. */
- public static final int COUNTY = 2;
- /** Category label A3 key e.g. San Francisco. */
- public static final int CITY = 3;
- /** Category label A4 key e.g. Westminster. */
- public static final int BOROUGH = 4;
- /** Category label A5 key e.g. Pacific Heights. */
- public static final int NEIGHBORHOOD = 5;
- /** Category label A6 key e.g. University District. */
- public static final int GROUP_OF_STREETS = 6;
- // 7 - 15 not defined
- /** Leading Street direction key e.g. N. */
- public static final int PRD = 16;
- /** Trailing street suffix key e.g. SW. */
- public static final int POD = 17;
- /** Street suffix or Type key e.g Ave, Platz. */
- public static final int STS = 18;
- /** House Number key e.g. 123. */
- public static final int HNO = 19;
- /** House number suffix key e.g. A, 1/2. */
- public static final int HNS = 20;
- /** Landmark or vanity address key e.g. Golden Gate Bridge. */
- public static final int LMK = 21;
- /** Additional Location info key e.g. South Wing. */
- public static final int LOC = 22;
- /** Name of residence key e.g. Joe's Barbershop. */
- public static final int NAM = 23;
- /** Postal or ZIP code key e.g. 10027-1234. */
- public static final int POSTAL_CODE = 24;
- /** Building key e.g. Lincoln Library. */
- public static final int BUILDING = 25;
- /** Apartment or suite key e.g. Apt 42. */
- public static final int APT = 26;
- /** Floor key e.g. 4. */
- public static final int FLOOR = 27;
- /** Room key e.g. 450F. */
- public static final int ROOM = 28;
- /** Type of place key e.g. office. */
- public static final int TYPE_OF_PLACE = 29;
- /** Postal community name key e.g. Leonia. */
- public static final int PCN = 30;
- /** Post Office Box key e.g. 12345. */
- public static final int PO_BOX = 31;
- /** Additional Code key e.g. 13203000003. */
- public static final int ADDITIONAL_CODE = 32;
- /** Seat, desk, pole, or cubical key e.g. WS 181. */
- public static final int DESK = 33;
- /** Primary road name key e.g. Shoreline. */
- public static final int PRIMARY_ROAD_NAME = 34;
- /** Road Section key e.g. 14. */
- public static final int ROAD_SECTION = 35;
- /** Branch Rd Name key e.g. Lane 7. */
- public static final int BRANCH_ROAD_NAME = 36;
- /** Subbranch Rd Name key e.g. Alley 8. */
- public static final int SUBBRANCH_ROAD_NAME = 37;
- /** Premodifier key e.g. Old. */
- public static final int STREET_NAME_PRE_MODIFIER = 38;
- /** Postmodifier key e.g. Service. */
- public static final int STREET_NAME_POST_MODIFIER = 39;
- /** Script key e.g. Latn. */
- public static final int SCRIPT = 128;
-
- /** private constructor */
- private CivicLocationKeys() {}
-}
-
diff --git a/wifi/java/android/net/wifi/rtt/IRttCallback.aidl b/wifi/java/android/net/wifi/rtt/IRttCallback.aidl
deleted file mode 100644
index 578dd1e..0000000
--- a/wifi/java/android/net/wifi/rtt/IRttCallback.aidl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.rtt;
-
-import android.net.wifi.rtt.RangingResult;
-
-/**
- * Interface for RTT result callback.
- *
- * @hide
- */
-oneway interface IRttCallback
-{
- /**
- * Service to manager callback indicating failure.
- */
- void onRangingFailure(int status);
-
- /**
- * Service to manager callback indicating success and providing results.
- */
- void onRangingResults(in List<RangingResult> results);
-}
diff --git a/wifi/java/android/net/wifi/rtt/IWifiRttManager.aidl b/wifi/java/android/net/wifi/rtt/IWifiRttManager.aidl
deleted file mode 100644
index 7c92a6b..0000000
--- a/wifi/java/android/net/wifi/rtt/IWifiRttManager.aidl
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.rtt;
-
-import android.os.WorkSource;
-
-import android.net.wifi.rtt.IRttCallback;
-import android.net.wifi.rtt.RangingRequest;
-
-/**
- * @hide
- */
-interface IWifiRttManager
-{
- boolean isAvailable();
- void startRanging(in IBinder binder, in String callingPackage, in String callingFeatureId,
- in WorkSource workSource, in RangingRequest request, in IRttCallback callback);
- void cancelRanging(in WorkSource workSource);
-}
diff --git a/wifi/java/android/net/wifi/rtt/RangingRequest.java b/wifi/java/android/net/wifi/rtt/RangingRequest.java
deleted file mode 100644
index 04dfcf2..0000000
--- a/wifi/java/android/net/wifi/rtt/RangingRequest.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.rtt;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SystemApi;
-import android.net.MacAddress;
-import android.net.wifi.ScanResult;
-import android.net.wifi.aware.AttachCallback;
-import android.net.wifi.aware.DiscoverySessionCallback;
-import android.net.wifi.aware.IdentityChangedListener;
-import android.net.wifi.aware.PeerHandle;
-import android.net.wifi.aware.WifiAwareManager;
-import android.os.Handler;
-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;
-
-/**
- * Defines the ranging request to other devices. The ranging request is built using
- * {@link RangingRequest.Builder}.
- * A ranging request is executed using
- * {@link WifiRttManager#startRanging(RangingRequest, java.util.concurrent.Executor, RangingResultCallback)}.
- * <p>
- * The ranging request is a batch request - specifying a set of devices (specified using
- * {@link RangingRequest.Builder#addAccessPoint(ScanResult)} and
- * {@link RangingRequest.Builder#addAccessPoints(List)}).
- */
-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
- * RangingRequest}. The limit applies no matter how the peers are added to the request, e.g.
- * through {@link RangingRequest.Builder#addAccessPoint(ScanResult)} or
- * {@link RangingRequest.Builder#addAccessPoints(List)}.
- *
- * @return Maximum number of peers.
- */
- public static int getMaxPeers() {
- 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 */
- 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
- public int describeContents() {
- return 0;
- }
-
- @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>() {
- @Override
- public RangingRequest[] newArray(int size) {
- return new RangingRequest[size];
- }
-
- @Override
- public RangingRequest createFromParcel(Parcel in) {
- return new RangingRequest(in.readArrayList(null), in.readInt());
- }
- };
-
- /** @hide */
- @Override
- public String toString() {
- StringJoiner sj = new StringJoiner(", ", "RangingRequest: mRttPeers=[", "]");
- for (ResponderConfig rc : mRttPeers) {
- sj.add(rc.toString());
- }
- return sj.toString();
- }
-
- /** @hide */
- public void enforceValidity(boolean awareSupported) {
- if (mRttPeers.size() > MAX_PEERS) {
- 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");
- }
- }
- }
-
- /**
- * Builder class used to construct {@link RangingRequest} objects.
- */
- 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
- * which to measure range. The total number of peers added to a request cannot exceed the
- * limit specified by {@link #getMaxPeers()}.
- * <p>
- * Ranging may not be supported if the Access Point does not support IEEE 802.11mc. Use
- * {@link ScanResult#is80211mcResponder()} to verify the Access Point's capabilities. If
- * not supported the result status will be
- * {@link RangingResult#STATUS_RESPONDER_DOES_NOT_SUPPORT_IEEE80211MC}.
- *
- * @param apInfo Information of an Access Point (AP) obtained in a Scan Result.
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder addAccessPoint(@NonNull ScanResult apInfo) {
- if (apInfo == null) {
- throw new IllegalArgumentException("Null ScanResult!");
- }
- return addResponder(ResponderConfig.fromScanResult(apInfo));
- }
-
- /**
- * Add the devices specified by the {@link ScanResult}s to the list of devices with
- * which to measure range. The total number of peers added to a request cannot exceed the
- * limit specified by {@link #getMaxPeers()}.
- * <p>
- * Ranging may not be supported if the Access Point does not support IEEE 802.11mc. Use
- * {@link ScanResult#is80211mcResponder()} to verify the Access Point's capabilities. If
- * not supported the result status will be
- * {@link RangingResult#STATUS_RESPONDER_DOES_NOT_SUPPORT_IEEE80211MC}.
- *
- * @param apInfos Information of an Access Points (APs) obtained in a Scan Result.
- * @return The builder to facilitate chaining
- * {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder addAccessPoints(@NonNull List<ScanResult> apInfos) {
- if (apInfos == null) {
- throw new IllegalArgumentException("Null list of ScanResults!");
- }
- for (ScanResult scanResult : apInfos) {
- addAccessPoint(scanResult);
- }
- return this;
- }
-
- /**
- * Add the device specified by the {@code peerMacAddress} to the list of devices with
- * which to measure range.
- * <p>
- * The MAC address may be obtained out-of-band from a peer Wi-Fi Aware device. A Wi-Fi
- * Aware device may obtain its MAC address using the {@link IdentityChangedListener}
- * provided to
- * {@link WifiAwareManager#attach(AttachCallback, IdentityChangedListener, Handler)}.
- * <p>
- * Note: in order to use this API the device must support Wi-Fi Aware
- * {@link android.net.wifi.aware}. The peer device which is being ranged to must be
- * configured to publish a service (with any name) with:
- * <li>Type {@link android.net.wifi.aware.PublishConfig#PUBLISH_TYPE_UNSOLICITED}.
- * <li>Ranging enabled
- * {@link android.net.wifi.aware.PublishConfig.Builder#setRangingEnabled(boolean)}.
- *
- * @param peerMacAddress The MAC address of the Wi-Fi Aware peer.
- * @return The builder, to facilitate chaining {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder addWifiAwarePeer(@NonNull MacAddress peerMacAddress) {
- if (peerMacAddress == null) {
- throw new IllegalArgumentException("Null peer MAC address");
- }
- return addResponder(
- ResponderConfig.fromWifiAwarePeerMacAddressWithDefaults(peerMacAddress));
- }
-
- /**
- * Add a device specified by a {@link PeerHandle} to the list of devices with which to
- * measure range.
- * <p>
- * The {@link PeerHandle} may be obtained as part of the Wi-Fi Aware discovery process. E.g.
- * using {@link DiscoverySessionCallback#onServiceDiscovered(PeerHandle, byte[], List)}.
- * <p>
- * Note: in order to use this API the device must support Wi-Fi Aware
- * {@link android.net.wifi.aware}. The peer device which is being ranged to must be
- * configured to publish a service (with any name) with:
- * <li>Type {@link android.net.wifi.aware.PublishConfig#PUBLISH_TYPE_UNSOLICITED}.
- * <li>Ranging enabled
- * {@link android.net.wifi.aware.PublishConfig.Builder#setRangingEnabled(boolean)}.
- *
- * @param peerHandle The peer handler of the peer Wi-Fi Aware device.
- * @return The builder, to facilitate chaining {@code builder.setXXX(..).setXXX(..)}.
- */
- public Builder addWifiAwarePeer(@NonNull PeerHandle peerHandle) {
- if (peerHandle == null) {
- throw new IllegalArgumentException("Null peer handler (identifier)");
- }
-
- return addResponder(ResponderConfig.fromWifiAwarePeerHandleWithDefaults(peerHandle));
- }
-
- /**
- * Add the Responder device specified by the {@link ResponderConfig} to the list of devices
- * with which to measure range. The total number of peers added to the request cannot exceed
- * the limit specified by {@link #getMaxPeers()}.
- *
- * @param responder Information on the RTT Responder.
- * @return The builder, to facilitate chaining {@code builder.setXXX(..).setXXX(..)}.
- *
- * @hide
- */
- @SystemApi
- public Builder addResponder(@NonNull ResponderConfig responder) {
- if (responder == null) {
- throw new IllegalArgumentException("Null Responder!");
- }
-
- mRttPeers.add(responder);
- return this;
- }
-
- /**
- * Build {@link RangingRequest} given the current configurations made on the
- * builder.
- */
- public RangingRequest build() {
- return new RangingRequest(mRttPeers, mRttBurstSize);
- }
- }
-
- @Override
- public boolean equals(@Nullable Object o) {
- if (this == o) {
- return true;
- }
-
- if (!(o instanceof RangingRequest)) {
- return false;
- }
-
- RangingRequest lhs = (RangingRequest) o;
-
- return mRttPeers.size() == lhs.mRttPeers.size()
- && mRttPeers.containsAll(lhs.mRttPeers)
- && mRttBurstSize == lhs.mRttBurstSize;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mRttPeers, mRttBurstSize);
- }
-}
diff --git a/wifi/java/android/net/wifi/rtt/RangingResult.java b/wifi/java/android/net/wifi/rtt/RangingResult.java
deleted file mode 100644
index a065bbc..0000000
--- a/wifi/java/android/net/wifi/rtt/RangingResult.java
+++ /dev/null
@@ -1,438 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.rtt;
-
-import android.annotation.IntDef;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SystemApi;
-import android.net.MacAddress;
-import android.net.wifi.aware.PeerHandle;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * Ranging result for a request started by
- * {@link WifiRttManager#startRanging(RangingRequest, java.util.concurrent.Executor, RangingResultCallback)}.
- * Results are returned in {@link RangingResultCallback#onRangingResults(List)}.
- * <p>
- * A ranging result is the distance measurement result for a single device specified in the
- * {@link RangingRequest}.
- */
-public final class RangingResult implements Parcelable {
- private static final String TAG = "RangingResult";
- private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
-
- /** @hide */
- @IntDef({STATUS_SUCCESS, STATUS_FAIL, STATUS_RESPONDER_DOES_NOT_SUPPORT_IEEE80211MC})
- @Retention(RetentionPolicy.SOURCE)
- public @interface RangeResultStatus {
- }
-
- /**
- * Individual range request status, {@link #getStatus()}. Indicates ranging operation was
- * successful and distance value is valid.
- */
- public static final int STATUS_SUCCESS = 0;
-
- /**
- * Individual range request status, {@link #getStatus()}. Indicates ranging operation failed
- * and the distance value is invalid.
- */
- public static final int STATUS_FAIL = 1;
-
- /**
- * Individual range request status, {@link #getStatus()}. Indicates that the ranging operation
- * failed because the specified peer does not support IEEE 802.11mc RTT operations. Support by
- * an Access Point can be confirmed using
- * {@link android.net.wifi.ScanResult#is80211mcResponder()}.
- * <p>
- * On such a failure, the individual result fields of {@link RangingResult} such as
- * {@link RangingResult#getDistanceMm()} are invalid.
- */
- public static final int STATUS_RESPONDER_DOES_NOT_SUPPORT_IEEE80211MC = 2;
-
- private final int mStatus;
- private final MacAddress mMac;
- private final PeerHandle mPeerHandle;
- private final int mDistanceMm;
- private final int mDistanceStdDevMm;
- private final int mRssi;
- private final int mNumAttemptedMeasurements;
- private final int mNumSuccessfulMeasurements;
- private final byte[] mLci;
- private final byte[] mLcr;
- private final ResponderLocation mResponderLocation;
- private final long mTimestamp;
-
- /** @hide */
- public RangingResult(@RangeResultStatus int status, @NonNull MacAddress mac, int distanceMm,
- int distanceStdDevMm, int rssi, int numAttemptedMeasurements,
- int numSuccessfulMeasurements, byte[] lci, byte[] lcr,
- ResponderLocation responderLocation, long timestamp) {
- mStatus = status;
- mMac = mac;
- mPeerHandle = null;
- mDistanceMm = distanceMm;
- mDistanceStdDevMm = distanceStdDevMm;
- mRssi = rssi;
- mNumAttemptedMeasurements = numAttemptedMeasurements;
- mNumSuccessfulMeasurements = numSuccessfulMeasurements;
- mLci = lci == null ? EMPTY_BYTE_ARRAY : lci;
- mLcr = lcr == null ? EMPTY_BYTE_ARRAY : lcr;
- mResponderLocation = responderLocation;
- mTimestamp = timestamp;
- }
-
- /** @hide */
- public RangingResult(@RangeResultStatus int status, PeerHandle peerHandle, int distanceMm,
- int distanceStdDevMm, int rssi, int numAttemptedMeasurements,
- int numSuccessfulMeasurements, byte[] lci, byte[] lcr,
- ResponderLocation responderLocation, long timestamp) {
- mStatus = status;
- mMac = null;
- mPeerHandle = peerHandle;
- mDistanceMm = distanceMm;
- mDistanceStdDevMm = distanceStdDevMm;
- mRssi = rssi;
- mNumAttemptedMeasurements = numAttemptedMeasurements;
- mNumSuccessfulMeasurements = numSuccessfulMeasurements;
- mLci = lci == null ? EMPTY_BYTE_ARRAY : lci;
- mLcr = lcr == null ? EMPTY_BYTE_ARRAY : lcr;
- mResponderLocation = responderLocation;
- mTimestamp = timestamp;
- }
-
- /**
- * @return The status of ranging measurement: {@link #STATUS_SUCCESS} in case of success, and
- * {@link #STATUS_FAIL} in case of failure.
- */
- @RangeResultStatus
- public int getStatus() {
- return mStatus;
- }
-
- /**
- * @return The MAC address of the device whose range measurement was requested. Will correspond
- * to the MAC address of the device in the {@link RangingRequest}.
- * <p>
- * Will return a {@code null} for results corresponding to requests issued using a {@code
- * PeerHandle}, i.e. using the {@link RangingRequest.Builder#addWifiAwarePeer(PeerHandle)} API.
- */
- @Nullable
- public MacAddress getMacAddress() {
- return mMac;
- }
-
- /**
- * @return The PeerHandle of the device whose reange measurement was requested. Will correspond
- * to the PeerHandle of the devices requested using
- * {@link RangingRequest.Builder#addWifiAwarePeer(PeerHandle)}.
- * <p>
- * Will return a {@code null} for results corresponding to requests issued using a MAC address.
- */
- @Nullable public PeerHandle getPeerHandle() {
- return mPeerHandle;
- }
-
- /**
- * @return The distance (in mm) to the device specified by {@link #getMacAddress()} or
- * {@link #getPeerHandle()}.
- * <p>
- * Note: the measured distance may be negative for very close devices.
- * <p>
- * Only valid if {@link #getStatus()} returns {@link #STATUS_SUCCESS}, otherwise will throw an
- * exception.
- */
- public int getDistanceMm() {
- if (mStatus != STATUS_SUCCESS) {
- throw new IllegalStateException(
- "getDistanceMm(): invoked on an invalid result: getStatus()=" + mStatus);
- }
- return mDistanceMm;
- }
-
- /**
- * @return The standard deviation of the measured distance (in mm) to the device specified by
- * {@link #getMacAddress()} or {@link #getPeerHandle()}. The standard deviation is calculated
- * over the measurements executed in a single RTT burst. The number of measurements is returned
- * by {@link #getNumSuccessfulMeasurements()} - 0 successful measurements indicate that the
- * standard deviation is not valid (a valid standard deviation requires at least 2 data points).
- * <p>
- * Only valid if {@link #getStatus()} returns {@link #STATUS_SUCCESS}, otherwise will throw an
- * exception.
- */
- public int getDistanceStdDevMm() {
- if (mStatus != STATUS_SUCCESS) {
- throw new IllegalStateException(
- "getDistanceStdDevMm(): invoked on an invalid result: getStatus()=" + mStatus);
- }
- return mDistanceStdDevMm;
- }
-
- /**
- * @return The average RSSI, in units of dBm, observed during the RTT measurement.
- * <p>
- * Only valid if {@link #getStatus()} returns {@link #STATUS_SUCCESS}, otherwise will throw an
- * exception.
- */
- public int getRssi() {
- if (mStatus != STATUS_SUCCESS) {
- throw new IllegalStateException(
- "getRssi(): invoked on an invalid result: getStatus()=" + mStatus);
- }
- return mRssi;
- }
-
- /**
- * @return The number of attempted measurements used in the RTT exchange resulting in this set
- * of results. The number of successful measurements is returned by
- * {@link #getNumSuccessfulMeasurements()} which at most, if there are no errors, will be 1 less
- * that the number of attempted measurements.
- * <p>
- * Only valid if {@link #getStatus()} returns {@link #STATUS_SUCCESS}, otherwise will throw an
- * exception.
- */
- public int getNumAttemptedMeasurements() {
- if (mStatus != STATUS_SUCCESS) {
- throw new IllegalStateException(
- "getNumAttemptedMeasurements(): invoked on an invalid result: getStatus()="
- + mStatus);
- }
- return mNumAttemptedMeasurements;
- }
-
- /**
- * @return The number of successful measurements used to calculate the distance and standard
- * deviation. If the number of successful measurements if 1 then then standard deviation,
- * returned by {@link #getDistanceStdDevMm()}, is not valid (a 0 is returned for the standard
- * deviation).
- * <p>
- * The total number of measurement attempts is returned by
- * {@link #getNumAttemptedMeasurements()}. The number of successful measurements will be at
- * most 1 less then the number of attempted measurements.
- * <p>
- * Only valid if {@link #getStatus()} returns {@link #STATUS_SUCCESS}, otherwise will throw an
- * exception.
- */
- public int getNumSuccessfulMeasurements() {
- if (mStatus != STATUS_SUCCESS) {
- throw new IllegalStateException(
- "getNumSuccessfulMeasurements(): invoked on an invalid result: getStatus()="
- + mStatus);
- }
- return mNumSuccessfulMeasurements;
- }
-
- /**
- * @return The unverified responder location represented as {@link ResponderLocation} which
- * captures location information the responder is programmed to broadcast. The responder
- * location is referred to as unverified, because we are relying on the device/site
- * administrator to correctly configure its location data.
- * <p>
- * Will return a {@code null} when the location information cannot be parsed.
- * <p>
- * Only valid if {@link #getStatus()} returns {@link #STATUS_SUCCESS}, otherwise will throw an
- * exception.
- */
- @Nullable
- public ResponderLocation getUnverifiedResponderLocation() {
- if (mStatus != STATUS_SUCCESS) {
- throw new IllegalStateException(
- "getUnverifiedResponderLocation(): invoked on an invalid result: getStatus()="
- + mStatus);
- }
- return mResponderLocation;
- }
-
- /**
- * @return The Location Configuration Information (LCI) as self-reported by the peer. The format
- * is specified in the IEEE 802.11-2016 specifications, section 9.4.2.22.10.
- * <p>
- * Note: the information is NOT validated - use with caution. Consider validating it with
- * other sources of information before using it.
- *
- * @hide
- */
- @SystemApi
- @NonNull
- public byte[] getLci() {
- if (mStatus != STATUS_SUCCESS) {
- throw new IllegalStateException(
- "getLci(): invoked on an invalid result: getStatus()=" + mStatus);
- }
- return mLci;
- }
-
- /**
- * @return The Location Civic report (LCR) as self-reported by the peer. The format
- * is specified in the IEEE 802.11-2016 specifications, section 9.4.2.22.13.
- * <p>
- * Note: the information is NOT validated - use with caution. Consider validating it with
- * other sources of information before using it.
- *
- * @hide
- */
- @SystemApi
- @NonNull
- public byte[] getLcr() {
- if (mStatus != STATUS_SUCCESS) {
- throw new IllegalStateException(
- "getReportedLocationCivic(): invoked on an invalid result: getStatus()="
- + mStatus);
- }
- return mLcr;
- }
-
- /**
- * @return The timestamp at which the ranging operation was performed. The timestamp is in
- * milliseconds since boot, including time spent in sleep, corresponding to values provided by
- * {@link android.os.SystemClock#elapsedRealtime()}.
- * <p>
- * Only valid if {@link #getStatus()} returns {@link #STATUS_SUCCESS}, otherwise will throw an
- * exception.
- */
- public long getRangingTimestampMillis() {
- if (mStatus != STATUS_SUCCESS) {
- throw new IllegalStateException(
- "getRangingTimestampMillis(): invoked on an invalid result: getStatus()="
- + mStatus);
- }
- return mTimestamp;
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(mStatus);
- if (mMac == null) {
- dest.writeBoolean(false);
- } else {
- dest.writeBoolean(true);
- mMac.writeToParcel(dest, flags);
- }
- if (mPeerHandle == null) {
- dest.writeBoolean(false);
- } else {
- dest.writeBoolean(true);
- dest.writeInt(mPeerHandle.peerId);
- }
- dest.writeInt(mDistanceMm);
- dest.writeInt(mDistanceStdDevMm);
- dest.writeInt(mRssi);
- dest.writeInt(mNumAttemptedMeasurements);
- dest.writeInt(mNumSuccessfulMeasurements);
- dest.writeByteArray(mLci);
- dest.writeByteArray(mLcr);
- dest.writeParcelable(mResponderLocation, flags);
- dest.writeLong(mTimestamp);
- }
-
- public static final @android.annotation.NonNull Creator<RangingResult> CREATOR = new Creator<RangingResult>() {
- @Override
- public RangingResult[] newArray(int size) {
- return new RangingResult[size];
- }
-
- @Override
- public RangingResult createFromParcel(Parcel in) {
- int status = in.readInt();
- boolean macAddressPresent = in.readBoolean();
- MacAddress mac = null;
- if (macAddressPresent) {
- mac = MacAddress.CREATOR.createFromParcel(in);
- }
- boolean peerHandlePresent = in.readBoolean();
- PeerHandle peerHandle = null;
- if (peerHandlePresent) {
- peerHandle = new PeerHandle(in.readInt());
- }
- int distanceMm = in.readInt();
- int distanceStdDevMm = in.readInt();
- int rssi = in.readInt();
- int numAttemptedMeasurements = in.readInt();
- int numSuccessfulMeasurements = in.readInt();
- byte[] lci = in.createByteArray();
- byte[] lcr = in.createByteArray();
- ResponderLocation responderLocation =
- in.readParcelable(this.getClass().getClassLoader());
- long timestamp = in.readLong();
- if (peerHandlePresent) {
- return new RangingResult(status, peerHandle, distanceMm, distanceStdDevMm, rssi,
- numAttemptedMeasurements, numSuccessfulMeasurements, lci, lcr,
- responderLocation, timestamp);
- } else {
- return new RangingResult(status, mac, distanceMm, distanceStdDevMm, rssi,
- numAttemptedMeasurements, numSuccessfulMeasurements, lci, lcr,
- responderLocation, timestamp);
- }
- }
- };
-
- /** @hide */
- @Override
- public String toString() {
- return new StringBuilder("RangingResult: [status=").append(mStatus).append(", mac=").append(
- mMac).append(", peerHandle=").append(
- mPeerHandle == null ? "<null>" : mPeerHandle.peerId).append(", distanceMm=").append(
- mDistanceMm).append(", distanceStdDevMm=").append(mDistanceStdDevMm).append(
- ", rssi=").append(mRssi).append(", numAttemptedMeasurements=").append(
- mNumAttemptedMeasurements).append(", numSuccessfulMeasurements=").append(
- mNumSuccessfulMeasurements).append(", lci=").append(mLci).append(", lcr=").append(
- mLcr).append(", responderLocation=").append(mResponderLocation)
- .append(", timestamp=").append(mTimestamp).append("]").toString();
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
-
- if (!(o instanceof RangingResult)) {
- return false;
- }
-
- RangingResult lhs = (RangingResult) o;
-
- return mStatus == lhs.mStatus && Objects.equals(mMac, lhs.mMac) && Objects.equals(
- mPeerHandle, lhs.mPeerHandle) && mDistanceMm == lhs.mDistanceMm
- && mDistanceStdDevMm == lhs.mDistanceStdDevMm && mRssi == lhs.mRssi
- && mNumAttemptedMeasurements == lhs.mNumAttemptedMeasurements
- && mNumSuccessfulMeasurements == lhs.mNumSuccessfulMeasurements
- && Arrays.equals(mLci, lhs.mLci) && Arrays.equals(mLcr, lhs.mLcr)
- && mTimestamp == lhs.mTimestamp
- && Objects.equals(mResponderLocation, lhs.mResponderLocation);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mStatus, mMac, mPeerHandle, mDistanceMm, mDistanceStdDevMm, mRssi,
- mNumAttemptedMeasurements, mNumSuccessfulMeasurements, mLci, mLcr,
- mResponderLocation, mTimestamp);
- }
-}
diff --git a/wifi/java/android/net/wifi/rtt/RangingResultCallback.java b/wifi/java/android/net/wifi/rtt/RangingResultCallback.java
deleted file mode 100644
index fa7d79e..0000000
--- a/wifi/java/android/net/wifi/rtt/RangingResultCallback.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.rtt;
-
-import android.annotation.IntDef;
-import android.annotation.NonNull;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.util.List;
-
-/**
- * Base class for ranging result callbacks. Should be extended by applications and set when calling
- * {@link WifiRttManager#startRanging(RangingRequest, java.util.concurrent.Executor, RangingResultCallback)}.
- * If the ranging operation fails in whole (not attempted) then {@link #onRangingFailure(int)}
- * will be called with a failure code. If the ranging operation is performed for each of the
- * requested peers then the {@link #onRangingResults(List)} will be called with the set of
- * results (@link {@link RangingResult}, each of which has its own success/failure code
- * {@link RangingResult#getStatus()}.
- */
-public abstract class RangingResultCallback {
- /** @hide */
- @IntDef({STATUS_CODE_FAIL, STATUS_CODE_FAIL_RTT_NOT_AVAILABLE})
- @Retention(RetentionPolicy.SOURCE)
- public @interface RangingOperationStatus {
- }
-
- /**
- * A failure code for the whole ranging request operation. Indicates a failure.
- */
- public static final int STATUS_CODE_FAIL = 1;
-
- /**
- * A failure code for the whole ranging request operation. Indicates that the request failed due
- * to RTT not being available - e.g. Wi-Fi was disabled. Use the
- * {@link WifiRttManager#isAvailable()} and {@link WifiRttManager#ACTION_WIFI_RTT_STATE_CHANGED}
- * to track RTT availability.
- */
- public static final int STATUS_CODE_FAIL_RTT_NOT_AVAILABLE = 2;
-
- /**
- * Called when a ranging operation failed in whole - i.e. no ranging operation to any of the
- * devices specified in the request was attempted.
- *
- * @param code A status code indicating the type of failure.
- */
- public abstract void onRangingFailure(@RangingOperationStatus int code);
-
- /**
- * Called when a ranging operation was executed. The list of results corresponds to devices
- * specified in the ranging request.
- *
- * @param results List of range measurements, one per requested device.
- */
- public abstract void onRangingResults(@NonNull List<RangingResult> results);
-}
diff --git a/wifi/java/android/net/wifi/rtt/ResponderConfig.java b/wifi/java/android/net/wifi/rtt/ResponderConfig.java
deleted file mode 100644
index be4eecc..0000000
--- a/wifi/java/android/net/wifi/rtt/ResponderConfig.java
+++ /dev/null
@@ -1,514 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.rtt;
-
-import static android.net.wifi.ScanResult.InformationElement.EID_EXTENSION_PRESENT;
-import static android.net.wifi.ScanResult.InformationElement.EID_EXT_HE_CAPABILITIES;
-import static android.net.wifi.ScanResult.InformationElement.EID_HT_CAPABILITIES;
-import static android.net.wifi.ScanResult.InformationElement.EID_VHT_CAPABILITIES;
-
-import android.annotation.IntDef;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SystemApi;
-import android.net.MacAddress;
-import android.net.wifi.ScanResult;
-import android.net.wifi.aware.PeerHandle;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.util.Log;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.util.Objects;
-
-/**
- * Defines the configuration of an IEEE 802.11mc Responder. The Responder may be an Access Point
- * (AP), a Wi-Fi Aware device, or a manually configured Responder.
- * <p>
- * A Responder configuration may be constructed from a {@link ScanResult} or manually (with the
- * data obtained out-of-band from a peer).
- *
- * @hide
- */
-@SystemApi
-public final class ResponderConfig implements Parcelable {
- private static final String TAG = "ResponderConfig";
- private static final int AWARE_BAND_2_DISCOVERY_CHANNEL = 2437;
-
- /** @hide */
- @IntDef({RESPONDER_AP, RESPONDER_STA, RESPONDER_P2P_GO, RESPONDER_P2P_CLIENT, RESPONDER_AWARE})
- @Retention(RetentionPolicy.SOURCE)
- public @interface ResponderType {
- }
-
- /**
- * Responder is an AP.
- */
- public static final int RESPONDER_AP = 0;
- /**
- * Responder is a STA.
- */
- public static final int RESPONDER_STA = 1;
- /**
- * Responder is a Wi-Fi Direct Group Owner (GO).
- */
- public static final int RESPONDER_P2P_GO = 2;
- /**
- * Responder is a Wi-Fi Direct Group Client.
- */
- public static final int RESPONDER_P2P_CLIENT = 3;
- /**
- * Responder is a Wi-Fi Aware device.
- */
- public static final int RESPONDER_AWARE = 4;
-
-
- /** @hide */
- @IntDef({
- CHANNEL_WIDTH_20MHZ, CHANNEL_WIDTH_40MHZ, CHANNEL_WIDTH_80MHZ, CHANNEL_WIDTH_160MHZ,
- CHANNEL_WIDTH_80MHZ_PLUS_MHZ})
- @Retention(RetentionPolicy.SOURCE)
- public @interface ChannelWidth {
- }
-
- /**
- * Channel bandwidth is 20 MHZ
- */
- public static final int CHANNEL_WIDTH_20MHZ = 0;
- /**
- * Channel bandwidth is 40 MHZ
- */
- public static final int CHANNEL_WIDTH_40MHZ = 1;
- /**
- * Channel bandwidth is 80 MHZ
- */
- public static final int CHANNEL_WIDTH_80MHZ = 2;
- /**
- * Channel bandwidth is 160 MHZ
- */
- public static final int CHANNEL_WIDTH_160MHZ = 3;
- /**
- * Channel bandwidth is 160 MHZ, but 80MHZ + 80MHZ
- */
- public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 4;
-
- /** @hide */
- @IntDef({PREAMBLE_LEGACY, PREAMBLE_HT, PREAMBLE_VHT, PREAMBLE_HE})
- @Retention(RetentionPolicy.SOURCE)
- public @interface PreambleType {
- }
-
- /**
- * Preamble type: Legacy.
- */
- public static final int PREAMBLE_LEGACY = 0;
-
- /**
- * Preamble type: HT.
- */
- public static final int PREAMBLE_HT = 1;
-
- /**
- * Preamble type: VHT.
- */
- public static final int PREAMBLE_VHT = 2;
-
- /**
- * Preamble type: HE.
- */
- public static final int PREAMBLE_HE = 3;
-
- /**
- * The MAC address of the Responder. Will be null if a Wi-Fi Aware peer identifier (the
- * peerHandle field) ise used to identify the Responder.
- */
- public final MacAddress macAddress;
-
- /**
- * The peer identifier of a Wi-Fi Aware Responder. Will be null if a MAC Address (the macAddress
- * field) is used to identify the Responder.
- */
- public final PeerHandle peerHandle;
-
- /**
- * The device type of the Responder.
- */
- public final int responderType;
-
- /**
- * Indicates whether the Responder device supports IEEE 802.11mc.
- */
- public final boolean supports80211mc;
-
- /**
- * Responder channel bandwidth, specified using {@link ChannelWidth}.
- */
- public final int channelWidth;
-
- /**
- * The primary 20 MHz frequency (in MHz) of the channel of the Responder.
- */
- public final int frequency;
-
- /**
- * Not used if the {@link #channelWidth} is 20 MHz. If the Responder uses 40, 80 or 160 MHz,
- * this is the center frequency (in MHz), if the Responder uses 80 + 80 MHz, this is the
- * center frequency of the first segment (in MHz).
- */
- public final int centerFreq0;
-
- /**
- * Only used if the {@link #channelWidth} is 80 + 80 MHz. If the Responder uses 80 + 80 MHz,
- * this is the center frequency of the second segment (in MHz).
- */
- public final int centerFreq1;
-
- /**
- * The preamble used by the Responder, specified using {@link PreambleType}.
- */
- public final int preamble;
-
- /**
- * Constructs Responder configuration, using a MAC address to identify the Responder.
- *
- * @param macAddress The MAC address of the Responder.
- * @param responderType The type of the responder device, specified using
- * {@link ResponderType}.
- * @param supports80211mc Indicates whether the responder supports IEEE 802.11mc.
- * @param channelWidth Responder channel bandwidth, specified using {@link ChannelWidth}.
- * @param frequency The primary 20 MHz frequency (in MHz) of the channel of the Responder.
- * @param centerFreq0 Not used if the {@code channelWidth} is 20 MHz. If the Responder uses
- * 40, 80 or 160 MHz, this is the center frequency (in MHz), if the
- * Responder uses 80 + 80 MHz, this is the center frequency of the first
- * segment (in MHz).
- * @param centerFreq1 Only used if the {@code channelWidth} is 80 + 80 MHz. If the
- * Responder
- * uses 80 + 80 MHz, this is the center frequency of the second segment
- * (in
- * MHz).
- * @param preamble The preamble used by the Responder, specified using
- * {@link PreambleType}.
- */
- public ResponderConfig(@NonNull MacAddress macAddress, @ResponderType int responderType,
- boolean supports80211mc, @ChannelWidth int channelWidth, int frequency, int centerFreq0,
- int centerFreq1, @PreambleType int preamble) {
- if (macAddress == null) {
- throw new IllegalArgumentException(
- "Invalid ResponderConfig - must specify a MAC address");
- }
- this.macAddress = macAddress;
- this.peerHandle = null;
- this.responderType = responderType;
- this.supports80211mc = supports80211mc;
- this.channelWidth = channelWidth;
- this.frequency = frequency;
- this.centerFreq0 = centerFreq0;
- this.centerFreq1 = centerFreq1;
- this.preamble = preamble;
- }
-
- /**
- * Constructs Responder configuration, using a Wi-Fi Aware PeerHandle to identify the Responder.
- *
- * @param peerHandle The Wi-Fi Aware peer identifier of the Responder.
- * @param responderType The type of the responder device, specified using
- * {@link ResponderType}.
- * @param supports80211mc Indicates whether the responder supports IEEE 802.11mc.
- * @param channelWidth Responder channel bandwidth, specified using {@link ChannelWidth}.
- * @param frequency The primary 20 MHz frequency (in MHz) of the channel of the Responder.
- * @param centerFreq0 Not used if the {@code channelWidth} is 20 MHz. If the Responder uses
- * 40, 80 or 160 MHz, this is the center frequency (in MHz), if the
- * Responder uses 80 + 80 MHz, this is the center frequency of the first
- * segment (in MHz).
- * @param centerFreq1 Only used if the {@code channelWidth} is 80 + 80 MHz. If the
- * Responder
- * uses 80 + 80 MHz, this is the center frequency of the second segment
- * (in
- * MHz).
- * @param preamble The preamble used by the Responder, specified using
- * {@link PreambleType}.
- */
- public ResponderConfig(@NonNull PeerHandle peerHandle, @ResponderType int responderType,
- boolean supports80211mc, @ChannelWidth int channelWidth, int frequency, int centerFreq0,
- int centerFreq1, @PreambleType int preamble) {
- this.macAddress = null;
- this.peerHandle = peerHandle;
- this.responderType = responderType;
- this.supports80211mc = supports80211mc;
- this.channelWidth = channelWidth;
- this.frequency = frequency;
- this.centerFreq0 = centerFreq0;
- this.centerFreq1 = centerFreq1;
- this.preamble = preamble;
- }
-
- /**
- * Constructs Responder configuration. This is an internal-only constructor which specifies both
- * a MAC address and a Wi-Fi PeerHandle to identify the Responder.
- *
- * @param macAddress The MAC address of the Responder.
- * @param peerHandle The Wi-Fi Aware peer identifier of the Responder.
- * @param responderType The type of the responder device, specified using
- * {@link ResponderType}.
- * @param supports80211mc Indicates whether the responder supports IEEE 802.11mc.
- * @param channelWidth Responder channel bandwidth, specified using {@link ChannelWidth}.
- * @param frequency The primary 20 MHz frequency (in MHz) of the channel of the Responder.
- * @param centerFreq0 Not used if the {@code channelWidth} is 20 MHz. If the Responder uses
- * 40, 80 or 160 MHz, this is the center frequency (in MHz), if the
- * Responder uses 80 + 80 MHz, this is the center frequency of the first
- * segment (in MHz).
- * @param centerFreq1 Only used if the {@code channelWidth} is 80 + 80 MHz. If the
- * Responder
- * uses 80 + 80 MHz, this is the center frequency of the second segment
- * (in
- * MHz).
- * @param preamble The preamble used by the Responder, specified using
- * {@link PreambleType}.
- * @hide
- */
- public ResponderConfig(@NonNull MacAddress macAddress, @NonNull PeerHandle peerHandle,
- @ResponderType int responderType, boolean supports80211mc,
- @ChannelWidth int channelWidth, int frequency, int centerFreq0, int centerFreq1,
- @PreambleType int preamble) {
- this.macAddress = macAddress;
- this.peerHandle = peerHandle;
- this.responderType = responderType;
- this.supports80211mc = supports80211mc;
- this.channelWidth = channelWidth;
- this.frequency = frequency;
- this.centerFreq0 = centerFreq0;
- this.centerFreq1 = centerFreq1;
- this.preamble = preamble;
- }
-
- /**
- * Creates a Responder configuration from a {@link ScanResult} corresponding to an Access
- * Point (AP), which can be obtained from {@link android.net.wifi.WifiManager#getScanResults()}.
- */
- public static ResponderConfig fromScanResult(ScanResult scanResult) {
- MacAddress macAddress = MacAddress.fromString(scanResult.BSSID);
- int responderType = RESPONDER_AP;
- boolean supports80211mc = scanResult.is80211mcResponder();
- int channelWidth = translateScanResultChannelWidth(scanResult.channelWidth);
- int frequency = scanResult.frequency;
- int centerFreq0 = scanResult.centerFreq0;
- int centerFreq1 = scanResult.centerFreq1;
-
- int preamble;
- if (scanResult.informationElements != null && scanResult.informationElements.length != 0) {
- boolean htCapabilitiesPresent = false;
- boolean vhtCapabilitiesPresent = false;
- boolean heCapabilitiesPresent = false;
-
- for (ScanResult.InformationElement ie : scanResult.informationElements) {
- if (ie.id == EID_HT_CAPABILITIES) {
- htCapabilitiesPresent = true;
- } else if (ie.id == EID_VHT_CAPABILITIES) {
- vhtCapabilitiesPresent = true;
- } else if (ie.id == EID_EXTENSION_PRESENT && ie.idExt == EID_EXT_HE_CAPABILITIES) {
- heCapabilitiesPresent = true;
- }
- }
-
- if (heCapabilitiesPresent) {
- preamble = PREAMBLE_HE;
- } else if (vhtCapabilitiesPresent) {
- preamble = PREAMBLE_VHT;
- } else if (htCapabilitiesPresent) {
- preamble = PREAMBLE_HT;
- } else {
- preamble = PREAMBLE_LEGACY;
- }
- } else {
- Log.e(TAG, "Scan Results do not contain IEs - using backup method to select preamble");
- if (channelWidth == CHANNEL_WIDTH_80MHZ || channelWidth == CHANNEL_WIDTH_160MHZ) {
- preamble = PREAMBLE_VHT;
- } else {
- preamble = PREAMBLE_HT;
- }
- }
-
- return new ResponderConfig(macAddress, responderType, supports80211mc, channelWidth,
- frequency, centerFreq0, centerFreq1, preamble);
- }
-
- /**
- * Creates a Responder configuration from a MAC address corresponding to a Wi-Fi Aware
- * Responder. The Responder parameters are set to defaults.
- */
- public static ResponderConfig fromWifiAwarePeerMacAddressWithDefaults(MacAddress macAddress) {
- /* Note: the parameters are those of the Aware discovery channel (channel 6). A Responder
- * is expected to be brought up and available to negotiate a maximum accuracy channel
- * (i.e. Band 5 @ 80MHz). A Responder is brought up on the peer by starting an Aware
- * Unsolicited Publisher with Ranging enabled.
- */
- return new ResponderConfig(macAddress, RESPONDER_AWARE, true, CHANNEL_WIDTH_20MHZ,
- AWARE_BAND_2_DISCOVERY_CHANNEL, 0, 0, PREAMBLE_HT);
- }
-
- /**
- * Creates a Responder configuration from a {@link PeerHandle} corresponding to a Wi-Fi Aware
- * Responder. The Responder parameters are set to defaults.
- */
- public static ResponderConfig fromWifiAwarePeerHandleWithDefaults(PeerHandle peerHandle) {
- /* Note: the parameters are those of the Aware discovery channel (channel 6). A Responder
- * is expected to be brought up and available to negotiate a maximum accuracy channel
- * (i.e. Band 5 @ 80MHz). A Responder is brought up on the peer by starting an Aware
- * Unsolicited Publisher with Ranging enabled.
- */
- return new ResponderConfig(peerHandle, RESPONDER_AWARE, true, CHANNEL_WIDTH_20MHZ,
- AWARE_BAND_2_DISCOVERY_CHANNEL, 0, 0, PREAMBLE_HT);
- }
-
- /**
- * Check whether the Responder configuration is valid.
- *
- * @return true if valid, false otherwise.
- * @hide
- */
- public boolean isValid(boolean awareSupported) {
- if (macAddress == null && peerHandle == null || macAddress != null && peerHandle != null) {
- return false;
- }
- if (!awareSupported && responderType == RESPONDER_AWARE) {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- if (macAddress == null) {
- dest.writeBoolean(false);
- } else {
- dest.writeBoolean(true);
- macAddress.writeToParcel(dest, flags);
- }
- if (peerHandle == null) {
- dest.writeBoolean(false);
- } else {
- dest.writeBoolean(true);
- dest.writeInt(peerHandle.peerId);
- }
- dest.writeInt(responderType);
- dest.writeInt(supports80211mc ? 1 : 0);
- dest.writeInt(channelWidth);
- dest.writeInt(frequency);
- dest.writeInt(centerFreq0);
- dest.writeInt(centerFreq1);
- dest.writeInt(preamble);
- }
-
- public static final @android.annotation.NonNull Creator<ResponderConfig> CREATOR = new Creator<ResponderConfig>() {
- @Override
- public ResponderConfig[] newArray(int size) {
- return new ResponderConfig[size];
- }
-
- @Override
- public ResponderConfig createFromParcel(Parcel in) {
- boolean macAddressPresent = in.readBoolean();
- MacAddress macAddress = null;
- if (macAddressPresent) {
- macAddress = MacAddress.CREATOR.createFromParcel(in);
- }
- boolean peerHandlePresent = in.readBoolean();
- PeerHandle peerHandle = null;
- if (peerHandlePresent) {
- peerHandle = new PeerHandle(in.readInt());
- }
- int responderType = in.readInt();
- boolean supports80211mc = in.readInt() == 1;
- int channelWidth = in.readInt();
- int frequency = in.readInt();
- int centerFreq0 = in.readInt();
- int centerFreq1 = in.readInt();
- int preamble = in.readInt();
-
- if (peerHandle == null) {
- return new ResponderConfig(macAddress, responderType, supports80211mc, channelWidth,
- frequency, centerFreq0, centerFreq1, preamble);
- } else {
- return new ResponderConfig(peerHandle, responderType, supports80211mc, channelWidth,
- frequency, centerFreq0, centerFreq1, preamble);
- }
- }
- };
-
- @Override
- public boolean equals(@Nullable Object o) {
- if (this == o) {
- return true;
- }
-
- if (!(o instanceof ResponderConfig)) {
- return false;
- }
-
- ResponderConfig lhs = (ResponderConfig) o;
-
- return Objects.equals(macAddress, lhs.macAddress) && Objects.equals(peerHandle,
- lhs.peerHandle) && responderType == lhs.responderType
- && supports80211mc == lhs.supports80211mc && channelWidth == lhs.channelWidth
- && frequency == lhs.frequency && centerFreq0 == lhs.centerFreq0
- && centerFreq1 == lhs.centerFreq1 && preamble == lhs.preamble;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(macAddress, peerHandle, responderType, supports80211mc, channelWidth,
- frequency, centerFreq0, centerFreq1, preamble);
- }
-
- /** @hide */
- @Override
- public String toString() {
- return new StringBuffer("ResponderConfig: macAddress=").append(macAddress).append(
- ", peerHandle=").append(peerHandle == null ? "<null>" : peerHandle.peerId).append(
- ", responderType=").append(responderType).append(", supports80211mc=").append(
- supports80211mc).append(", channelWidth=").append(channelWidth).append(
- ", frequency=").append(frequency).append(", centerFreq0=").append(
- centerFreq0).append(", centerFreq1=").append(centerFreq1).append(
- ", preamble=").append(preamble).toString();
- }
-
- /** @hide */
- static int translateScanResultChannelWidth(int scanResultChannelWidth) {
- switch (scanResultChannelWidth) {
- case ScanResult.CHANNEL_WIDTH_20MHZ:
- return CHANNEL_WIDTH_20MHZ;
- case ScanResult.CHANNEL_WIDTH_40MHZ:
- return CHANNEL_WIDTH_40MHZ;
- case ScanResult.CHANNEL_WIDTH_80MHZ:
- return CHANNEL_WIDTH_80MHZ;
- case ScanResult.CHANNEL_WIDTH_160MHZ:
- return CHANNEL_WIDTH_160MHZ;
- case ScanResult.CHANNEL_WIDTH_80MHZ_PLUS_MHZ:
- return CHANNEL_WIDTH_80MHZ_PLUS_MHZ;
- default:
- throw new IllegalArgumentException(
- "translateScanResultChannelWidth: bad " + scanResultChannelWidth);
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/rtt/ResponderLocation.java b/wifi/java/android/net/wifi/rtt/ResponderLocation.java
deleted file mode 100644
index 218b2dca..0000000
--- a/wifi/java/android/net/wifi/rtt/ResponderLocation.java
+++ /dev/null
@@ -1,1427 +0,0 @@
-/*
- * 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.net.wifi.rtt;
-
-import static java.lang.annotation.RetentionPolicy.SOURCE;
-
-import android.annotation.IntDef;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SuppressLint;
-import android.annotation.SystemApi;
-import android.location.Address;
-import android.location.Location;
-import android.net.MacAddress;
-import android.net.Uri;
-import android.net.wifi.rtt.CivicLocationKeys.CivicLocationKeysType;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.text.TextUtils;
-import android.util.SparseArray;
-import android.webkit.MimeTypeMap;
-
-import java.lang.annotation.Retention;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * ResponderLocation is both a Location Configuration Information (LCI) decoder and a Location Civic
- * Report (LCR) decoder for information received from a Wi-Fi Access Point (AP) during Wi-Fi RTT
- * ranging process.
- *
- * <p>This is based on the IEEE P802.11-REVmc/D8.0 spec section 9.4.2.22, under Measurement Report
- * Element. Subelement location data-fields parsed from separate input LCI and LCR Information
- * Elements are unified in this class.</p>
- *
- * <p>Note: The information provided by this class is broadcast by a responder (usually an Access
- * Point), and passed on as-is. There is no guarantee this information is accurate or correct, and
- * as a result developers should carefully consider how this information should be used and provide
- * corresponding advice to users.</p>
- */
-public final class ResponderLocation implements Parcelable {
- private static final int BYTE_MASK = 0xFF;
- private static final int LSB_IN_BYTE = 0x01;
- private static final int MSB_IN_BYTE = 0x80;
- private static final int MIN_BUFFER_SIZE = 3; // length of LEAD_LCI_ELEMENT_BYTES
- private static final int MAX_BUFFER_SIZE = 256;
-
- // Information Element (IE) fields
- private static final byte MEASUREMENT_TOKEN_AUTONOMOUS = 0x01;
- private static final byte MEASUREMENT_REPORT_MODE = 0x00;
- private static final byte MEASUREMENT_TYPE_LCI = 0x08;
- private static final byte MEASUREMENT_TYPE_LCR = 0x0b;
-
- // LCI Subelement IDs
- private static final byte SUBELEMENT_LCI = 0x00;
- private static final byte SUBELEMENT_Z = 0x04;
- private static final byte SUBELEMENT_USAGE = 0x06;
- private static final byte SUBELEMENT_BSSID_LIST = 0x07;
-
- // LCI Subelement Lengths
- private static final int SUBELEMENT_LCI_LENGTH = 16;
- private static final int SUBELEMENT_Z_LENGTH = 6;
- private static final int SUBELEMENT_USAGE_LENGTH1 = 1;
- private static final int SUBELEMENT_USAGE_LENGTH3 = 3;
- private static final int SUBELEMENT_BSSID_LIST_MIN_BUFFER_LENGTH = 1;
-
- private static final byte[] LEAD_LCI_ELEMENT_BYTES = {
- MEASUREMENT_TOKEN_AUTONOMOUS, MEASUREMENT_REPORT_MODE, MEASUREMENT_TYPE_LCI
- };
-
- // Subelement LCI constants
-
- /* The LCI subelement bit-field lengths are described in Figure 9-214 of the REVmc spec and
- represented here as a an array of integers */
- private static final int[] SUBELEMENT_LCI_BIT_FIELD_LENGTHS = {
- 6, 34, 6, 34, 4, 6, 30, 3, 1, 1, 1, 2
- };
- private static final int LATLNG_FRACTION_BITS = 25;
- private static final int LATLNG_UNCERTAINTY_BASE = 8;
- private static final int ALTITUDE_FRACTION_BITS = 8;
- private static final int ALTITUDE_UNCERTAINTY_BASE = 21;
- private static final double LAT_ABS_LIMIT = 90.0;
- private static final double LNG_ABS_LIMIT = 180.0;
- private static final int UNCERTAINTY_UNDEFINED = 0;
-
- // Subelement LCI fields indices
- private static final int SUBELEMENT_LCI_LAT_UNCERTAINTY_INDEX = 0;
- private static final int SUBELEMENT_LCI_LAT_INDEX = 1;
- private static final int SUBELEMENT_LCI_LNG_UNCERTAINTY_INDEX = 2;
- private static final int SUBELEMENT_LCI_LNG_INDEX = 3;
- private static final int SUBELEMENT_LCI_ALT_TYPE_INDEX = 4;
- private static final int SUBELEMENT_LCI_ALT_UNCERTAINTY_INDEX = 5;
- private static final int SUBELEMENT_LCI_ALT_INDEX = 6;
- private static final int SUBELEMENT_LCI_DATUM_INDEX = 7;
- private static final int SUBELEMENT_LCI_REGLOC_AGREEMENT_INDEX = 8;
- private static final int SUBELEMENT_LCI_REGLOC_DSE_INDEX = 9;
- private static final int SUBELEMENT_LCI_DEPENDENT_STA_INDEX = 10;
- private static final int SUBELEMENT_LCI_VERSION_INDEX = 11;
-
- /**
- * The Altitude value is interpreted based on the Altitude Type, and the selected mDatum.
- *
- * @hide
- */
- @Retention(SOURCE)
- @IntDef({ALTITUDE_UNDEFINED, ALTITUDE_METERS, ALTITUDE_FLOORS})
- public @interface AltitudeType {
- }
-
- /**
- * Altitude is not defined for the Responder.
- * The altitude and altitude uncertainty should not be used: see section 2.4 of IETF RFC 6225.
- */
- public static final int ALTITUDE_UNDEFINED = 0;
- /** Responder Altitude is measured in meters. */
- public static final int ALTITUDE_METERS = 1;
- /** Responder Altitude is measured in floors. */
- public static final int ALTITUDE_FLOORS = 2;
-
- /**
- * The Datum value determines how coordinates are organized in relation to the real world.
- *
- * @hide
- */
- @Retention(SOURCE)
- @IntDef({DATUM_UNDEFINED, DATUM_WGS84, DATUM_NAD83_NAV88, DATUM_NAD83_MLLW})
- public @interface DatumType {
- }
-
- /** Datum is not defined. */
- public static final int DATUM_UNDEFINED = 0;
- /** Datum used is WGS84. */
- public static final int DATUM_WGS84 = 1;
- /** Datum used is NAD83 NAV88. */
- public static final int DATUM_NAD83_NAV88 = 2;
- /** Datum used is NAD83 MLLW. */
- public static final int DATUM_NAD83_MLLW = 3;
-
-
- /** Version of the LCI protocol is 1.0, the only defined protocol at this time. */
- public static final int LCI_VERSION_1 = 1;
-
- /** Provider/Source of the location */
- private static final String LOCATION_PROVIDER = "WiFi Access Point";
-
- // LCI Subelement Z constants
- private static final int[] SUBELEMENT_Z_BIT_FIELD_LENGTHS = {2, 14, 24, 8};
- private static final int Z_FLOOR_NUMBER_FRACTION_BITS = 4;
- private static final int Z_FLOOR_HEIGHT_FRACTION_BITS = 12;
- private static final int Z_MAX_HEIGHT_UNCERTAINTY_FACTOR = 25;
-
- // LCI Subelement Z fields indices
- private static final int SUBELEMENT_Z_LAT_EXPECTED_TO_MOVE_INDEX = 0;
- private static final int SUBELEMENT_Z_FLOOR_NUMBER_INDEX = 1;
- private static final int SUBELEMENT_Z_HEIGHT_ABOVE_FLOOR_INDEX = 2;
- private static final int SUBELEMENT_Z_HEIGHT_ABOVE_FLOOR_UNCERTAINTY_INDEX = 3;
-
- // LCI Subelement Usage Rules constants
- private static final int SUBELEMENT_USAGE_MASK_RETRANSMIT = 0x01;
- private static final int SUBELEMENT_USAGE_MASK_RETENTION_EXPIRES = 0x02;
- private static final int SUBELEMENT_USAGE_MASK_STA_LOCATION_POLICY = 0x04;
-
- // LCI Subelement Usage Rules field indices
- private static final int SUBELEMENT_USAGE_PARAMS_INDEX = 0; // 8 bits
-
- // LCI Subelement BSSID List
- private static final int SUBELEMENT_BSSID_MAX_INDICATOR_INDEX = 0;
- private static final int SUBELEMENT_BSSID_LIST_INDEX = 1;
- private static final int BYTES_IN_A_BSSID = 6;
-
- /**
- * The Expected-To-Move value determines how mobile we expect the STA to be.
- *
- * @hide
- */
- @Retention(SOURCE)
- @IntDef({LOCATION_FIXED, LOCATION_VARIABLE, LOCATION_MOVEMENT_UNKNOWN, LOCATION_RESERVED})
- public @interface ExpectedToMoveType {
- }
-
- /** Location of responder is fixed (does not move) */
- public static final int LOCATION_FIXED = 0;
- /** Location of the responder is variable, and may move */
- public static final int LOCATION_VARIABLE = 1;
- /** Location of the responder is not known to be either fixed or variable. */
- public static final int LOCATION_MOVEMENT_UNKNOWN = 2;
- /** Location of the responder status is a reserved value */
- public static final int LOCATION_RESERVED = 3;
-
- // LCR Subelement IDs
- private static final byte SUBELEMENT_LOCATION_CIVIC = 0x00;
- private static final byte SUBELEMENT_MAP_IMAGE = 0x05;
-
- // LCR Subelement Lengths
- private static final int SUBELEMENT_LOCATION_CIVIC_MIN_LENGTH = 2;
- private static final int SUBELEMENT_LOCATION_CIVIC_MAX_LENGTH = 256;
- private static final int SUBELEMENT_MAP_IMAGE_URL_MAX_LENGTH = 256;
-
- private static final byte[] LEAD_LCR_ELEMENT_BYTES = {
- MEASUREMENT_TOKEN_AUTONOMOUS, MEASUREMENT_REPORT_MODE, MEASUREMENT_TYPE_LCR
- };
-
- // LCR Location Civic Subelement
- private static final int CIVIC_COUNTRY_CODE_INDEX = 0;
- private static final int CIVIC_TLV_LIST_INDEX = 2;
-
- // LCR Map Image Subelement field indexes.
- private static final int SUBELEMENT_IMAGE_MAP_TYPE_INDEX = 0;
- private static final int MAP_TYPE_URL_DEFINED = 0;
- private static final String[] SUPPORTED_IMAGE_FILE_EXTENSIONS = {
- "",
- "png",
- "gif",
- "jpg",
- "svg",
- "dxf",
- "dwg",
- "dwf",
- "cad",
- "tif",
- "gml",
- "kml",
- "bmp",
- "pgm",
- "ppm",
- "xbm",
- "xpm",
- "ico"
- };
-
- // General LCI and LCR state
- private final boolean mIsValid;
-
- /*
- These members are not final because we are not sure if the corresponding subelement will be
- present until after the parsing process. However, the default value should be set as listed.
- */
- private boolean mIsLciValid = false;
- private boolean mIsZValid = false;
- private boolean mIsUsageValid = true; // By default this is assumed true
- private boolean mIsBssidListValid = false;
- private boolean mIsLocationCivicValid = false;
- private boolean mIsMapImageValid = false;
-
- // LCI Subelement LCI state
- private double mLatitudeUncertainty;
- private double mLatitude;
- private double mLongitudeUncertainty;
- private double mLongitude;
- private int mAltitudeType;
- private double mAltitudeUncertainty;
- private double mAltitude;
- private int mDatum;
- private boolean mLciRegisteredLocationAgreement;
- private boolean mLciRegisteredLocationDse;
- private boolean mLciDependentStation;
- private int mLciVersion;
-
- // LCI Subelement Z state
- private int mExpectedToMove;
- private double mFloorNumber;
- private double mHeightAboveFloorMeters;
- private double mHeightAboveFloorUncertaintyMeters;
-
- // LCI Subelement Usage Rights state
- private boolean mUsageRetransmit;
- private boolean mUsageRetentionExpires;
- private boolean mUsageExtraInfoOnAssociation;
-
- // LCI Subelement BSSID List state
- private ArrayList<MacAddress> mBssidList;
-
- // LCR Subelement Location Civic state
- private String mCivicLocationCountryCode;
- private String mCivicLocationString;
- private CivicLocation mCivicLocation;
-
- // LCR Subelement Map Image state
- private int mMapImageType;
- private Uri mMapImageUri;
-
- /**
- * Constructor
- *
- * @param lciBuffer the bytes received in the LCI Measurement Report Information Element
- * @param lcrBuffer the bytes received in the LCR Measurement Report Information Element
- *
- * @hide
- */
- public ResponderLocation(byte[] lciBuffer, byte[] lcrBuffer) {
- boolean isLciIeValid = false;
- boolean isLcrIeValid = false;
- setLciSubelementDefaults();
- setZaxisSubelementDefaults();
- setUsageSubelementDefaults();
- setBssidListSubelementDefaults();
- setCivicLocationSubelementDefaults();
- setMapImageSubelementDefaults();
- if (lciBuffer != null && lciBuffer.length > LEAD_LCI_ELEMENT_BYTES.length) {
- isLciIeValid = parseInformationElementBuffer(
- MEASUREMENT_TYPE_LCI, lciBuffer, LEAD_LCI_ELEMENT_BYTES);
- }
- if (lcrBuffer != null && lcrBuffer.length > LEAD_LCR_ELEMENT_BYTES.length) {
- isLcrIeValid = parseInformationElementBuffer(
- MEASUREMENT_TYPE_LCR, lcrBuffer, LEAD_LCR_ELEMENT_BYTES);
- }
-
- boolean isLciValid = isLciIeValid && mIsUsageValid
- && (mIsLciValid || mIsZValid || mIsBssidListValid);
-
- boolean isLcrValid = isLcrIeValid && mIsUsageValid
- && (mIsLocationCivicValid || mIsMapImageValid);
-
- mIsValid = isLciValid || isLcrValid;
-
- if (!mIsValid) {
- setLciSubelementDefaults();
- setZaxisSubelementDefaults();
- setCivicLocationSubelementDefaults();
- setMapImageSubelementDefaults();
- }
- }
-
- private ResponderLocation(Parcel in) {
- // Object Validation
- mIsValid = in.readByte() != 0;
- mIsLciValid = in.readByte() != 0;
- mIsZValid = in.readByte() != 0;
- mIsUsageValid = in.readByte() != 0;
- mIsBssidListValid = in.readByte() != 0;
- mIsLocationCivicValid = in.readByte() != 0;
- mIsMapImageValid = in.readByte() != 0;
-
- // LCI Subelement LCI state
- mLatitudeUncertainty = in.readDouble();
- mLatitude = in.readDouble();
- mLongitudeUncertainty = in.readDouble();
- mLongitude = in.readDouble();
- mAltitudeType = in.readInt();
- mAltitudeUncertainty = in.readDouble();
- mAltitude = in.readDouble();
- mDatum = in.readInt();
- mLciRegisteredLocationAgreement = in.readByte() != 0;
- mLciRegisteredLocationDse = in.readByte() != 0;
- mLciDependentStation = in.readByte() != 0;
- mLciVersion = in.readInt();
-
- // LCI Subelement Z state
- mExpectedToMove = in.readInt();
- mFloorNumber = in.readDouble();
- mHeightAboveFloorMeters = in.readDouble();
- mHeightAboveFloorUncertaintyMeters = in.readDouble();
-
- // LCI Usage Rights
- mUsageRetransmit = in.readByte() != 0;
- mUsageRetentionExpires = in.readByte() != 0;
- mUsageExtraInfoOnAssociation = in.readByte() != 0;
-
- // LCI Subelement BSSID List
- mBssidList = in.readArrayList(MacAddress.class.getClassLoader());
-
- // LCR Subelement Location Civic
- mCivicLocationCountryCode = in.readString();
- mCivicLocationString = in.readString();
- mCivicLocation = in.readParcelable(this.getClass().getClassLoader());
-
- // LCR Subelement Map Image
- mMapImageType = in.readInt();
- String urlString = in.readString();
- if (TextUtils.isEmpty(urlString)) {
- mMapImageUri = null;
- } else {
- mMapImageUri = Uri.parse(urlString);
- }
- }
-
- public static final @android.annotation.NonNull Creator<ResponderLocation> CREATOR = new Creator<ResponderLocation>() {
- @Override
- public ResponderLocation createFromParcel(Parcel in) {
- return new ResponderLocation(in);
- }
-
- @Override
- public ResponderLocation[] newArray(int size) {
- return new ResponderLocation[size];
- }
- };
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel parcel, int flags) {
- // Object
- parcel.writeByte((byte) (mIsValid ? 1 : 0));
- parcel.writeByte((byte) (mIsLciValid ? 1 : 0));
- parcel.writeByte((byte) (mIsZValid ? 1 : 0));
- parcel.writeByte((byte) (mIsUsageValid ? 1 : 0));
- parcel.writeByte((byte) (mIsBssidListValid ? 1 : 0));
- parcel.writeByte((byte) (mIsLocationCivicValid ? 1 : 0));
- parcel.writeByte((byte) (mIsMapImageValid ? 1 : 0));
-
- // LCI Subelement LCI state
- parcel.writeDouble(mLatitudeUncertainty);
- parcel.writeDouble(mLatitude);
- parcel.writeDouble(mLongitudeUncertainty);
- parcel.writeDouble(mLongitude);
- parcel.writeInt(mAltitudeType);
- parcel.writeDouble(mAltitudeUncertainty);
- parcel.writeDouble(mAltitude);
- parcel.writeInt(mDatum);
- parcel.writeByte((byte) (mLciRegisteredLocationAgreement ? 1 : 0));
- parcel.writeByte((byte) (mLciRegisteredLocationDse ? 1 : 0));
- parcel.writeByte((byte) (mLciDependentStation ? 1 : 0));
- parcel.writeInt(mLciVersion);
-
- // LCI Subelement Z state
- parcel.writeInt(mExpectedToMove);
- parcel.writeDouble(mFloorNumber);
- parcel.writeDouble(mHeightAboveFloorMeters);
- parcel.writeDouble(mHeightAboveFloorUncertaintyMeters);
-
- // LCI Usage Rights
- parcel.writeByte((byte) (mUsageRetransmit ? 1 : 0));
- parcel.writeByte((byte) (mUsageRetentionExpires ? 1 : 0));
- parcel.writeByte((byte) (mUsageExtraInfoOnAssociation ? 1 : 0));
-
- // LCI Subelement BSSID List
- parcel.writeList(mBssidList);
-
- // LCR Subelement Location Civic
- parcel.writeString(mCivicLocationCountryCode);
- parcel.writeString(mCivicLocationString);
- parcel.writeParcelable(mCivicLocation, flags);
-
- // LCR Subelement Map Image
- parcel.writeInt(mMapImageType);
- if (mMapImageUri != null) {
- parcel.writeString(mMapImageUri.toString());
- } else {
- parcel.writeString("");
- }
- }
-
- /**
- * Test if the Information Element (IE) is in the correct format, and then parse its Subelements
- * based on their type, and setting state in this object when present.
- *
- * @return a boolean indicating the success of the parsing function
- */
- private boolean parseInformationElementBuffer(
- int ieType, byte[] buffer, byte[] expectedLeadBytes) {
- int bufferPtr = 0;
- int bufferLength = buffer.length;
-
- // Ensure the buffer size is within expected limits
- if (bufferLength < MIN_BUFFER_SIZE || bufferLength > MAX_BUFFER_SIZE) {
- return false;
- }
-
- // Ensure the IE contains the correct leading bytes
- byte[] leadBufferBytes = Arrays.copyOfRange(buffer, bufferPtr, expectedLeadBytes.length);
- if (!Arrays.equals(leadBufferBytes, expectedLeadBytes)) {
- return false;
- }
-
- // Iterate through the sub-elements contained in the Information Element (IE)
- bufferPtr += expectedLeadBytes.length;
- // Loop over the buffer ensuring there are 2-bytes available for each new subelement tested.
- while (bufferPtr + 1 < bufferLength) {
- byte subelement = buffer[bufferPtr++];
- int subelementLength = buffer[bufferPtr++];
- // Check there is enough data for the next subelement
- if ((bufferPtr + subelementLength) > bufferLength || subelementLength <= 0) {
- return false;
- }
-
- byte[] subelementData =
- Arrays.copyOfRange(buffer, bufferPtr, bufferPtr + subelementLength);
-
- if (ieType == MEASUREMENT_TYPE_LCI) {
- switch (subelement) {
- case SUBELEMENT_LCI:
- mIsLciValid = parseSubelementLci(subelementData);
- if (!mIsLciValid || mLciVersion != LCI_VERSION_1) {
- setLciSubelementDefaults();
- }
- break;
- case SUBELEMENT_Z:
- mIsZValid = parseSubelementZ(subelementData);
- if (!mIsZValid) {
- setZaxisSubelementDefaults();
- }
- break;
- case SUBELEMENT_USAGE:
- mIsUsageValid = parseSubelementUsage(subelementData);
- // Note: if the Usage Subelement is not valid, don't reset the state, as
- // it is now indicating the whole ResponderLocation is invalid.
- break;
- case SUBELEMENT_BSSID_LIST:
- mIsBssidListValid = parseSubelementBssidList(subelementData);
- if (!mIsBssidListValid) {
- setBssidListSubelementDefaults();
- }
- break;
- default:
- break; // skip over unused or vendor specific subelements
- }
- } else if (ieType == MEASUREMENT_TYPE_LCR) {
- switch (subelement) {
- case SUBELEMENT_LOCATION_CIVIC:
- mIsLocationCivicValid = parseSubelementLocationCivic(subelementData);
- if (!mIsLocationCivicValid) {
- setCivicLocationSubelementDefaults();
- }
- break;
- case SUBELEMENT_MAP_IMAGE:
- mIsMapImageValid = parseSubelementMapImage(subelementData);
- if (!mIsMapImageValid) {
- setMapImageSubelementDefaults();
- }
- break;
- default:
- break; // skip over unused or other vendor specific subelements
- }
- }
-
- bufferPtr += subelementLength;
- }
- return true;
- }
-
- /**
- * Parse the LCI Sub-Element in the LCI Information Element (IE).
- *
- * @param buffer a buffer containing the subelement
- * @return boolean true indicates success
- */
- private boolean parseSubelementLci(byte[] buffer) {
- if (buffer.length > SUBELEMENT_LCI_LENGTH) {
- return false;
- }
- swapEndianByteByByte(buffer);
- long[] subelementLciFields = getFieldData(buffer, SUBELEMENT_LCI_BIT_FIELD_LENGTHS);
- if (subelementLciFields == null) {
- return false;
- }
- // Set member state based on parsed buffer data
- mLatitudeUncertainty = decodeLciLatLngUncertainty(
- subelementLciFields[SUBELEMENT_LCI_LAT_UNCERTAINTY_INDEX]);
- mLatitude = decodeLciLatLng(subelementLciFields, SUBELEMENT_LCI_BIT_FIELD_LENGTHS,
- SUBELEMENT_LCI_LAT_INDEX, LAT_ABS_LIMIT);
- mLongitudeUncertainty = decodeLciLatLngUncertainty(
- subelementLciFields[SUBELEMENT_LCI_LNG_UNCERTAINTY_INDEX]);
- mLongitude =
- decodeLciLatLng(subelementLciFields, SUBELEMENT_LCI_BIT_FIELD_LENGTHS,
- SUBELEMENT_LCI_LNG_INDEX, LNG_ABS_LIMIT);
- mAltitudeType = (int) subelementLciFields[SUBELEMENT_LCI_ALT_TYPE_INDEX] & BYTE_MASK;
- mAltitudeUncertainty =
- decodeLciAltUncertainty(subelementLciFields[SUBELEMENT_LCI_ALT_UNCERTAINTY_INDEX]);
- mAltitude =
- Math.scalb(subelementLciFields[SUBELEMENT_LCI_ALT_INDEX], -ALTITUDE_FRACTION_BITS);
- mDatum = (int) subelementLciFields[SUBELEMENT_LCI_DATUM_INDEX] & BYTE_MASK;
- mLciRegisteredLocationAgreement =
- (subelementLciFields[SUBELEMENT_LCI_REGLOC_AGREEMENT_INDEX] == 1);
- mLciRegisteredLocationDse =
- (subelementLciFields[SUBELEMENT_LCI_REGLOC_DSE_INDEX] == 1);
- mLciDependentStation =
- (subelementLciFields[SUBELEMENT_LCI_DEPENDENT_STA_INDEX] == 1);
- mLciVersion = (int) subelementLciFields[SUBELEMENT_LCI_VERSION_INDEX];
- return true;
- }
-
- /**
- * Decode the floating point value of an encoded lat or lng in the LCI subelement field.
- *
- * @param fields the array of field data represented as longs
- * @param bitFieldSizes the lengths of each field
- * @param offset the offset of the field being decoded
- * @param limit the maximum absolute value (note: different for lat vs lng)
- * @return the floating point value of the lat or lng
- */
- private double decodeLciLatLng(long[] fields, int[] bitFieldSizes, int offset, double limit) {
- double angle;
- if ((fields[offset] & (long) Math.pow(2, bitFieldSizes[offset] - 1)) != 0) {
- // Negative 2's complement value
- // Note: The Math.pow(...) method cannot return a NaN value because the bitFieldSize
- // for Lat or Lng is limited to exactly 34 bits.
- angle = Math.scalb((double) fields[offset] - Math.pow(2, bitFieldSizes[offset]),
- -LATLNG_FRACTION_BITS);
- } else {
- // Positive 2's complement value
- angle = Math.scalb((double) fields[offset], -LATLNG_FRACTION_BITS);
- }
- if (angle > limit) {
- angle = limit;
- } else if (angle < -limit) {
- angle = -limit;
- }
- return angle;
- }
-
- /**
- * Coverts an encoded Lat/Lng uncertainty into a number of degrees.
- *
- * @param encodedValue the encoded uncertainty
- * @return the value in degrees
- */
- private double decodeLciLatLngUncertainty(long encodedValue) {
- return Math.pow(2, LATLNG_UNCERTAINTY_BASE - encodedValue);
- }
-
- /**
- * Converts an encoded Alt uncertainty into a number of degrees.
- *
- * @param encodedValue the encoded uncertainty
- * @return the value in degrees
- */
- private double decodeLciAltUncertainty(long encodedValue) {
- return Math.pow(2, ALTITUDE_UNCERTAINTY_BASE - encodedValue);
- }
-
- /**
- * Parse the Z subelement of the LCI IE.
- *
- * @param buffer a buffer containing the subelement
- * @return boolean true indicates success
- */
- private boolean parseSubelementZ(byte[] buffer) {
- if (buffer.length != SUBELEMENT_Z_LENGTH) {
- return false;
- }
- swapEndianByteByByte(buffer);
- long[] subelementZFields = getFieldData(buffer, SUBELEMENT_Z_BIT_FIELD_LENGTHS);
- if (subelementZFields == null) {
- return false;
- }
-
- mExpectedToMove =
- (int) subelementZFields[SUBELEMENT_Z_LAT_EXPECTED_TO_MOVE_INDEX] & BYTE_MASK;
- mFloorNumber = decodeZUnsignedToSignedValue(subelementZFields,
- SUBELEMENT_Z_BIT_FIELD_LENGTHS, SUBELEMENT_Z_FLOOR_NUMBER_INDEX,
- Z_FLOOR_NUMBER_FRACTION_BITS);
-
- mHeightAboveFloorMeters = decodeZUnsignedToSignedValue(subelementZFields,
- SUBELEMENT_Z_BIT_FIELD_LENGTHS, SUBELEMENT_Z_HEIGHT_ABOVE_FLOOR_INDEX,
- Z_FLOOR_HEIGHT_FRACTION_BITS);
-
- long zHeightUncertainty =
- subelementZFields[SUBELEMENT_Z_HEIGHT_ABOVE_FLOOR_UNCERTAINTY_INDEX];
- if (zHeightUncertainty > 0 && zHeightUncertainty < Z_MAX_HEIGHT_UNCERTAINTY_FACTOR) {
- mHeightAboveFloorUncertaintyMeters =
- Math.pow(2, Z_FLOOR_HEIGHT_FRACTION_BITS - zHeightUncertainty - 1);
- } else {
- return false;
- }
- return true;
- }
-
- /**
- * Decode a two's complement encoded value, to a signed double based on the field length.
- *
- * @param fieldValues the array of field values reprented as longs
- * @param fieldLengths the array of field lengths
- * @param index the index of the field being decoded
- * @param fraction the number of fractional bits in the value
- * @return the signed value represented as a double
- */
- private double decodeZUnsignedToSignedValue(long[] fieldValues, int[] fieldLengths, int index,
- int fraction) {
- int value = (int) fieldValues[index];
- int maxPositiveValue = (int) Math.pow(2, fieldLengths[index] - 1) - 1;
- if (value > maxPositiveValue) {
- value -= Math.pow(2, fieldLengths[index]);
- }
- return Math.scalb(value, -fraction);
- }
-
- /**
- * Parse Subelement Usage Rights
- */
- private boolean parseSubelementUsage(byte[] buffer) {
- if (buffer.length != SUBELEMENT_USAGE_LENGTH1
- && buffer.length != SUBELEMENT_USAGE_LENGTH3) {
- return false;
- }
- mUsageRetransmit =
- (buffer[SUBELEMENT_USAGE_PARAMS_INDEX] & SUBELEMENT_USAGE_MASK_RETRANSMIT) != 0;
- mUsageRetentionExpires =
- (buffer[SUBELEMENT_USAGE_PARAMS_INDEX] & SUBELEMENT_USAGE_MASK_RETENTION_EXPIRES)
- != 0;
- mUsageExtraInfoOnAssociation =
- (buffer[SUBELEMENT_USAGE_PARAMS_INDEX] & SUBELEMENT_USAGE_MASK_STA_LOCATION_POLICY)
- != 0;
- // Note: the Retransmit flag must be true, and RetentionExpires, false for the
- // ResponderLocation object to be usable by public applications.
- return (mUsageRetransmit && !mUsageRetentionExpires);
- }
-
- /**
- * Parse the BSSID List Subelement of the LCI IE.
- *
- * @param buffer a buffer containing the subelement
- * @return boolean true indicates success
- */
- private boolean parseSubelementBssidList(byte[] buffer) {
- if (buffer.length < SUBELEMENT_BSSID_LIST_MIN_BUFFER_LENGTH) {
- return false;
- }
- if ((buffer.length - 1) % BYTES_IN_A_BSSID != 0) {
- return false;
- }
-
- int maxBssidIndicator = (int) buffer[SUBELEMENT_BSSID_MAX_INDICATOR_INDEX] & BYTE_MASK;
- int bssidListLength = (buffer.length - 1) / BYTES_IN_A_BSSID;
- // The maxBSSIDIndicator is ignored. Its use is still being clarified in 802.11REVmd,
- // which is not published at this time. This field will be used in a future
- // release of Android after 802.11REVmd is public. Here, we interpret the following
- // params as an explicit list of BSSIDs.
-
-
- int bssidOffset = SUBELEMENT_BSSID_LIST_INDEX;
- for (int i = 0; i < bssidListLength; i++) {
- byte[] bssid = Arrays.copyOfRange(buffer, bssidOffset, bssidOffset + BYTES_IN_A_BSSID);
- MacAddress macAddress = MacAddress.fromBytes(bssid);
- mBssidList.add(macAddress);
- bssidOffset += BYTES_IN_A_BSSID;
- }
- return true;
- }
-
- /**
- * Parse the Location Civic subelement in the LCR IE.
- *
- * @param buffer a buffer containing the subelement
- * @return boolean true indicates success
- */
- private boolean parseSubelementLocationCivic(byte[] buffer) {
- if (buffer.length < SUBELEMENT_LOCATION_CIVIC_MIN_LENGTH
- || buffer.length > SUBELEMENT_LOCATION_CIVIC_MAX_LENGTH) {
- return false;
- }
- mCivicLocationCountryCode =
- new String(Arrays.copyOfRange(buffer, CIVIC_COUNTRY_CODE_INDEX,
- CIVIC_TLV_LIST_INDEX)).toUpperCase();
- CivicLocation civicLocation =
- new CivicLocation(
- Arrays.copyOfRange(buffer, CIVIC_TLV_LIST_INDEX, buffer.length),
- mCivicLocationCountryCode);
- if (!civicLocation.isValid()) {
- return false;
- }
- this.mCivicLocation = civicLocation;
- mCivicLocationString = civicLocation.toString();
- return true;
- }
-
- /**
- * Parse the Map Image subelement in the LCR IE.
- *
- * @param buffer a buffer containing the subelement
- * @return boolean true indicates success
- */
- private boolean parseSubelementMapImage(byte[] buffer) {
- if (buffer.length > SUBELEMENT_MAP_IMAGE_URL_MAX_LENGTH) {
- return false;
- }
- int mapImageType = buffer[SUBELEMENT_IMAGE_MAP_TYPE_INDEX];
- int supportedTypesMax = SUPPORTED_IMAGE_FILE_EXTENSIONS.length - 1;
- if (mapImageType < MAP_TYPE_URL_DEFINED || mapImageType > supportedTypesMax) {
- return false;
- }
- this.mMapImageType = mapImageType;
- byte[] urlBytes = Arrays.copyOfRange(buffer, 1, buffer.length);
- mMapImageUri = Uri.parse(new String(urlBytes, StandardCharsets.UTF_8));
- return true;
- }
-
- /**
- * Convert an image type code to a Mime type
- *
- * @param imageTypeCode encoded as an integer
- * @return the mime type of the image file
- */
- private String imageTypeToMime(int imageTypeCode, String imageUrl) {
- int supportedExtensionsMax = SUPPORTED_IMAGE_FILE_EXTENSIONS.length - 1;
- if ((imageTypeCode == 0 && imageUrl == null) || imageTypeCode > supportedExtensionsMax) {
- return null;
- }
- MimeTypeMap mimeTypeMap = MimeTypeMap.getSingleton();
- if (imageTypeCode == 0) {
- return mimeTypeMap.getMimeTypeFromExtension(
- MimeTypeMap.getFileExtensionFromUrl(imageUrl));
- } else {
- return mimeTypeMap.getMimeTypeFromExtension(
- SUPPORTED_IMAGE_FILE_EXTENSIONS[imageTypeCode]);
- }
- }
-
- /**
- * Converts a byte array containing fields of variable size, into an array of longs where the
- * field boundaries are defined in a constant int array passed as an argument.
- *
- * @param buffer the byte array containing all the fields
- * @param bitFieldSizes the int array defining the size of each field
- */
- private long[] getFieldData(byte[] buffer, int[] bitFieldSizes) {
- int bufferLengthBits = buffer.length * Byte.SIZE;
- int sumBitFieldSizes = 0;
- for (int i : bitFieldSizes) {
- if (i > Long.SIZE) {
- return null;
- }
- sumBitFieldSizes += i;
- }
- if (bufferLengthBits != sumBitFieldSizes) {
- return null;
- }
- long[] fieldData = new long[bitFieldSizes.length];
- int bufferBitPos = 0;
- for (int fieldIndex = 0; fieldIndex < bitFieldSizes.length; fieldIndex++) {
- int bitFieldSize = bitFieldSizes[fieldIndex];
- long field = 0;
- for (int n = 0; n < bitFieldSize; n++) {
- field |= ((long) getBitAtBitOffsetInByteArray(buffer, bufferBitPos + n) << n);
- }
- fieldData[fieldIndex] = field;
- bufferBitPos += bitFieldSize;
- }
- return fieldData;
- }
-
- /**
- * Retrieves state of a bit at the bit-offset in a byte array, where the offset represents the
- * bytes in contiguous data with each value in big endian order.
- *
- * @param buffer the data buffer of bytes containing all the fields
- * @param bufferBitOffset the bit offset into the entire buffer
- * @return a zero or one value, representing the state of that bit.
- */
- private int getBitAtBitOffsetInByteArray(byte[] buffer, int bufferBitOffset) {
- int bufferIndex = bufferBitOffset / Byte.SIZE; // The byte index that contains the bit
- int bitOffsetInByte = bufferBitOffset % Byte.SIZE; // The bit offset within that byte
- int result = (buffer[bufferIndex] & (MSB_IN_BYTE >> bitOffsetInByte)) == 0 ? 0 : 1;
- return result;
- }
-
- /**
- * Reverses the order of the bits in each byte of a byte array.
- *
- * @param buffer the array containing each byte that will be reversed
- */
- private void swapEndianByteByByte(byte[] buffer) {
- for (int n = 0; n < buffer.length; n++) {
- byte currentByte = buffer[n];
- byte reversedByte = 0; // Cleared value
- byte bitSelectorMask = LSB_IN_BYTE;
- for (int i = 0; i < Byte.SIZE; i++) {
- reversedByte = (byte) (reversedByte << 1);
- if ((currentByte & bitSelectorMask) != 0) {
- reversedByte = (byte) (reversedByte | LSB_IN_BYTE);
- }
- bitSelectorMask = (byte) (bitSelectorMask << 1);
- }
- buffer[n] = reversedByte;
- }
- }
-
- /**
- * Sets the LCI subelement fields to the default undefined values.
- */
- private void setLciSubelementDefaults() {
- mIsLciValid = false;
- mLatitudeUncertainty = UNCERTAINTY_UNDEFINED;
- mLatitude = 0;
- mLongitudeUncertainty = UNCERTAINTY_UNDEFINED;
- mLongitude = 0;
- mAltitudeType = ALTITUDE_UNDEFINED;
- mAltitudeUncertainty = UNCERTAINTY_UNDEFINED;
- mAltitude = 0;
- mDatum = DATUM_UNDEFINED;
- mLciRegisteredLocationAgreement = false;
- mLciRegisteredLocationDse = false;
- mLciDependentStation = false;
- mLciVersion = 0;
- }
-
- /**
- * Sets the Z subelement fields to the default values when undefined.
- */
- private void setZaxisSubelementDefaults() {
- mIsZValid = false;
- mExpectedToMove = 0;
- mFloorNumber = 0;
- mHeightAboveFloorMeters = 0;
- mHeightAboveFloorUncertaintyMeters = 0;
- }
-
- /**
- * Sets the Usage Policy subelement fields to the default undefined values.
- */
- private void setUsageSubelementDefaults() {
- mUsageRetransmit = true;
- mUsageRetentionExpires = false;
- mUsageExtraInfoOnAssociation = false;
- }
-
- /**
- * Sets the BSSID List subelement fields to the default values when undefined.
- */
- private void setBssidListSubelementDefaults() {
- mIsBssidListValid = false;
- mBssidList = new ArrayList<>();
- }
-
- /**
- * Sets the LCR Civic Location subelement field to the default undefined value.
- *
- * @hide
- */
- public void setCivicLocationSubelementDefaults() {
- mIsLocationCivicValid = false;
- mCivicLocationCountryCode = "";
- mCivicLocationString = "";
- mCivicLocation = null;
- }
-
- /**
- * Sets the LCR Map Image subelement field to the default values when undefined.
- */
- private void setMapImageSubelementDefaults() {
- mIsMapImageValid = false;
- mMapImageType = MAP_TYPE_URL_DEFINED;
- mMapImageUri = null;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null || getClass() != obj.getClass()) {
- return false;
- }
- ResponderLocation other = (ResponderLocation) obj;
- return mIsValid == other.mIsValid
- && mIsLciValid == other.mIsLciValid
- && mIsZValid == other.mIsZValid
- && mIsUsageValid == other.mIsUsageValid
- && mIsBssidListValid == other.mIsBssidListValid
- && mIsLocationCivicValid == other.mIsLocationCivicValid
- && mIsMapImageValid == other.mIsMapImageValid
- && mLatitudeUncertainty == other.mLatitudeUncertainty
- && mLatitude == other.mLatitude
- && mLongitudeUncertainty == other.mLongitudeUncertainty
- && mLongitude == other.mLongitude
- && mAltitudeType == other.mAltitudeType
- && mAltitudeUncertainty == other.mAltitudeUncertainty
- && mAltitude == other.mAltitude
- && mDatum == other.mDatum
- && mLciRegisteredLocationAgreement == other.mLciRegisteredLocationAgreement
- && mLciRegisteredLocationDse == other.mLciRegisteredLocationDse
- && mLciDependentStation == other.mLciDependentStation
- && mLciVersion == other.mLciVersion
- && mExpectedToMove == other.mExpectedToMove
- && mFloorNumber == other.mFloorNumber
- && mHeightAboveFloorMeters == other.mHeightAboveFloorMeters
- && mHeightAboveFloorUncertaintyMeters
- == other.mHeightAboveFloorUncertaintyMeters
- && mUsageRetransmit == other.mUsageRetransmit
- && mUsageRetentionExpires == other.mUsageRetentionExpires
- && mUsageExtraInfoOnAssociation == other.mUsageExtraInfoOnAssociation
- && mBssidList.equals(other.mBssidList)
- && mCivicLocationCountryCode.equals(other.mCivicLocationCountryCode)
- && mCivicLocationString.equals(other.mCivicLocationString)
- && Objects.equals(mCivicLocation, other.mCivicLocation)
- && mMapImageType == other.mMapImageType
- && Objects.equals(mMapImageUri, other.mMapImageUri);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mIsValid, mIsLciValid, mIsZValid, mIsUsageValid, mIsBssidListValid,
- mIsLocationCivicValid, mIsMapImageValid, mLatitudeUncertainty, mLatitude,
- mLongitudeUncertainty, mLongitude, mAltitudeType, mAltitudeUncertainty, mAltitude,
- mDatum, mLciRegisteredLocationAgreement,
- mLciRegisteredLocationDse, mLciDependentStation, mLciVersion,
- mExpectedToMove, mFloorNumber, mHeightAboveFloorMeters,
- mHeightAboveFloorUncertaintyMeters, mUsageRetransmit, mUsageRetentionExpires,
- mUsageExtraInfoOnAssociation, mBssidList, mCivicLocationCountryCode,
- mCivicLocationString, mCivicLocation, mMapImageType, mMapImageUri);
- }
-
- /**
- * @return true if the ResponderLocation object is valid and contains useful information
- * relevant to the location of the Responder. If this is ever false, this object will not be
- * available to developers, and have a null value.
- *
- * @hide
- */
- public boolean isValid() {
- return mIsValid;
- }
-
- /**
- * @return true if the LCI subelement (containing Latitude, Longitude and Altitude) is valid.
- *
- * <p> This method tells us if the responder has provided its Location Configuration
- * Information (LCI) directly, and is useful when an external database of responder locations
- * is not available</p>
- *
- * <p>If isLciSubelementValid() returns true, all the LCI values provided by the corresponding
- * getter methods will have been set as described by the responder, or else if false, they
- * should not be used and will throw an IllegalStateException.</p>
- */
- public boolean isLciSubelementValid() {
- return mIsLciValid;
- }
-
- /**
- * @return the latitude uncertainty in degrees.
- * <p>
- * Only valid if {@link #isLciSubelementValid()} returns true, or will throw an exception.
- * </p>
- * <p> An unknown uncertainty is indicated by 0.</p>
- */
- public double getLatitudeUncertainty() {
- if (!mIsLciValid) {
- throw new IllegalStateException(
- "getLatitudeUncertainty(): invoked on an invalid result: mIsLciValid = false.");
- }
- return mLatitudeUncertainty;
- }
-
- /**
- * @return the latitude in degrees
- * <p>
- * Only valid if {@link #isLciSubelementValid()} returns true, or will throw an exception.
- */
- public double getLatitude() {
- if (!mIsLciValid) {
- throw new IllegalStateException(
- "getLatitude(): invoked on an invalid result: mIsLciValid = false.");
- }
- return mLatitude;
- }
-
- /**
- * @return the Longitude uncertainty in degrees.
- * <p>
- * Only valid if {@link #isLciSubelementValid()} returns true, or will throw an exception.
- * </p>
- * <p> An unknown uncertainty is indicated by 0.</p>
- */
- public double getLongitudeUncertainty() {
- if (!mIsLciValid) {
- throw new IllegalStateException(
- "getLongitudeUncertainty(): invoked on an invalid result: mIsLciValid = false.");
- }
- return mLongitudeUncertainty;
- }
-
- /**
- * @return the Longitude in degrees..
- * <p>
- * Only valid if {@link #isLciSubelementValid()} returns true, or will throw an exception.
- */
- public double getLongitude() {
- if (!mIsLciValid) {
- throw new IllegalStateException(
- "getLatitudeUncertainty(): invoked on an invalid result: mIsLciValid = false.");
- }
- return mLongitude;
- }
-
- /**
- * @return the Altitude type.
- * <p>
- * Only valid if {@link #isLciSubelementValid()} returns true, or will throw an exception.
- */
- @AltitudeType
- public int getAltitudeType() {
- if (!mIsLciValid) {
- throw new IllegalStateException(
- "getLatitudeUncertainty(): invoked on an invalid result: mIsLciValid = false.");
- }
- return mAltitudeType;
- }
-
- /**
- * @return the Altitude uncertainty in meters.
- * <p>
- * Only valid if {@link #isLciSubelementValid()} returns true, or will throw an exception.
- * </p>
- * <p>An unknown uncertainty is indicated by 0.</p>
- */
- public double getAltitudeUncertainty() {
- if (!mIsLciValid) {
- throw new IllegalStateException(
- "getLatitudeUncertainty(): invoked on an invalid result: mIsLciValid = false.");
- }
- return mAltitudeUncertainty;
- }
-
- /**
- * @return the Altitude in units defined by the altitude type.
- * <p>
- * Only valid if {@link #isLciSubelementValid()} returns true, or will throw an exception.
- */
- public double getAltitude() {
- if (!mIsLciValid) {
- throw new IllegalStateException(
- "getAltitude(): invoked on an invalid result: mIsLciValid = false.");
- }
- return mAltitude;
- }
-
- /**
- * @return the Datum used for the LCI positioning information.
- * <p>
- * Only valid if {@link #isLciSubelementValid()} returns true, or will throw an exception.
- */
- @DatumType
- public int getDatum() {
- if (!mIsLciValid) {
- throw new IllegalStateException(
- "getDatum(): invoked on an invalid result: mIsLciValid = false.");
- }
- return mDatum;
- }
-
- /**
- * @return true if the station is operating within a national policy area or an international
- * agreement area near a national border, otherwise false
- * (see 802.11REVmc Section 11.12.3 - Registered STA Operation).
- * <p>
- * Only valid if {@link #isLciSubelementValid()} returns true, or will throw an exception.
- */
- public boolean getRegisteredLocationAgreementIndication() {
- if (!mIsLciValid) {
- throw new IllegalStateException(
- "getRegisteredLocationAgreementIndication(): "
- + "invoked on an invalid result: mIsLciValid = false.");
- }
- return mLciRegisteredLocationAgreement;
- }
-
- /**
- * @return true indicating this is an enabling station, enabling the operation of nearby STAs
- * with Dynamic Station Enablement (DSE), otherwise false.
- * (see 802.11REVmc Section 11.12.3 - Registered STA Operation).
- * <p>
- * Only valid if {@link #isLciSubelementValid()} returns true, or will throw an exception.
- *
- * @hide
- */
- public boolean getRegisteredLocationDseIndication() {
- if (!mIsLciValid) {
- throw new IllegalStateException(
- "getRegisteredLocationDseIndication(): "
- + "invoked on an invalid result: mIsLciValid = false.");
- }
- return mLciRegisteredLocationDse;
- }
-
- /**
- * @return true indicating this is a dependent station that is operating with the enablement of
- * an enabling station whose LCI is being reported, otherwise false.
- * (see 802.11REVmc Section 11.12.3 - Registered STA Operation).
- * <p>
- * Only valid if {@link #isLciSubelementValid()} returns true, or will throw an exception.
- *
- * @hide
- */
- public boolean getDependentStationIndication() {
- if (!mIsLciValid) {
- throw new IllegalStateException(
- "getDependentStationIndication(): "
- + "invoked on an invalid result: mIsLciValid = false.");
- }
- return mLciDependentStation;
- }
-
- /**
- * @return a value greater or equal to 1, indicating the current version number
- * of the LCI protocol.
- * <p>
- * Only valid if {@link #isLciSubelementValid()} returns true, or will throw an exception.
- */
- public int getLciVersion() {
- if (!mIsLciValid) {
- throw new IllegalStateException(
- "getLciVersion(): "
- + "invoked on an invalid result: mIsLciValid = false.");
- }
- return mLciVersion;
- }
-
- /**
- * @return the LCI location represented as a {@link Location} object (best effort).
- * <p>
- * Only valid if {@link #isLciSubelementValid()} returns true, or will throw an exception.
- */
- @NonNull
- public Location toLocation() {
- if (!mIsLciValid) {
- throw new IllegalStateException(
- "toLocation(): "
- + "invoked on an invalid result: mIsLciValid = false.");
- }
- Location location = new Location(LOCATION_PROVIDER);
- location.setLatitude(mLatitude);
- location.setLongitude(mLongitude);
- location.setAccuracy((float) (mLatitudeUncertainty + mLongitudeUncertainty) / 2);
- location.setAltitude(mAltitude);
- location.setVerticalAccuracyMeters((float) mAltitudeUncertainty);
- location.setTime(System.currentTimeMillis());
- return location;
- }
-
- /**
- * @return if the Z subelement (containing mobility, Floor, Height above floor) is valid.
- */
- public boolean isZaxisSubelementValid() {
- return mIsZValid;
- }
-
- /**
- * @return an integer representing the mobility of the responder.
- * <p>
- * Only valid if {@link #isZaxisSubelementValid()} returns true, or will throw an exception.
- */
- @ExpectedToMoveType
- public int getExpectedToMove() {
- if (!mIsZValid) {
- throw new IllegalStateException(
- "getExpectedToMove(): invoked on an invalid result: mIsZValid = false.");
- }
- return mExpectedToMove;
- }
-
- /**
- * @return the Z sub element Floor Number.
- * <p>
- * Only valid if {@link #isZaxisSubelementValid()} returns true, or will throw an exception.
- * </p>
- * <p>Note: this number can be positive or negative, with value increments of +/- 1/16 of a
- * floor.</p>.
- */
- public double getFloorNumber() {
- if (!mIsZValid) {
- throw new IllegalStateException(
- "getFloorNumber(): invoked on an invalid result: mIsZValid = false)");
- }
- return mFloorNumber;
- }
-
- /**
- * @return the Z subelement Height above the floor in meters.
- * <p>
- * Only valid if {@link #isZaxisSubelementValid()} returns true, or will throw an exception.
- * </p>
- * <p>This value can be positive or negative. </p>
- */
- public double getHeightAboveFloorMeters() {
- if (!mIsZValid) {
- throw new IllegalStateException(
- "getHeightAboveFloorMeters(): invoked on an invalid result: mIsZValid = false)");
- }
- return mHeightAboveFloorMeters;
- }
-
- /**
- * @return the Z subelement Height above the floor uncertainty in meters.
- * <p>
- * Only valid if {@link #isZaxisSubelementValid()} returns true, or will throw an exception.
- * </p>
- * <p>An unknown uncertainty is indicated by 0.</p>
- */
- public double getHeightAboveFloorUncertaintyMeters() {
- if (!mIsZValid) {
- throw new IllegalStateException(
- "getHeightAboveFloorUncertaintyMeters():"
- + "invoked on an invalid result: mIsZValid = false)");
- }
- return mHeightAboveFloorUncertaintyMeters;
- }
-
- /**
- * @return true if the location information received from the responder can be
- * retransmitted to another device, physically separate from the one that received it.
- *
- * @hide
- */
- public boolean getRetransmitPolicyIndication() {
- return mUsageRetransmit;
- }
-
- /**
- * @return true if location-data received should expire (and be deleted)
- * by the time provided in the getRelativeExpirationTimeHours() method.
- *
- * @hide
- */
- public boolean getRetentionExpiresIndication() {
- return mUsageRetentionExpires;
- }
-
- /**
- * @return true if there is extra location info available on association.
- *
- * @hide
- */
- @SystemApi
- public boolean getExtraInfoOnAssociationIndication() {
- return mUsageExtraInfoOnAssociation;
- }
-
- /**
- * @return the Immutable list of colocated BSSIDs at the responder.
- *
- * <p> Will return an empty list when there are no bssids listed.
- */
- public List<MacAddress> getColocatedBssids() {
- return Collections.unmodifiableList(mBssidList);
- }
-
- /**
- * @return the civic location represented as an {@link Address} object (best effort).
- *
- * <p> Will return a {@code null} when there is no Civic Location defined.
- */
- @Nullable
- public Address toCivicLocationAddress() {
- if (mCivicLocation != null && mCivicLocation.isValid()) {
- return mCivicLocation.toAddress();
- } else {
- return null;
- }
- }
-
- /**
- * @return the civic location represented as a {@link SparseArray}
- * <p>
- * Valid keys to access the SparseArray can be found in {@code CivicLocationKeys}.
- * </p>
- * <p> Will return a {@code null} when there is no Civic Location defined.
- *
- */
- @Nullable
- @SuppressLint("ChangedType")
- public SparseArray<String> toCivicLocationSparseArray() {
- if (mCivicLocation != null && mCivicLocation.isValid()) {
- return mCivicLocation.toSparseArray();
- } else {
- return null;
- }
- }
-
- /**
- * @return the civic location two upper-case ASCII character country code defined in ISO 3166.
- *
- * <p> Will return a {@code null} when there is no country code defined.
- *
- * @hide
- */
- @Nullable
- public String getCivicLocationCountryCode() {
- return mCivicLocationCountryCode;
- }
-
- /**
- * @return the value of the Civic Location String associated with a key.
- *
- * <p> Will return a {@code null} when there is no value associated with the key provided.
- *
- * @param key used to find a corresponding value in the Civic Location Tuple list
- *
- * @hide
- */
- @Nullable
- public String getCivicLocationElementValue(@CivicLocationKeysType int key) {
- return mCivicLocation.getCivicElementValue(key);
- }
-
- /**
- * @return the Map Image file Mime type, referred to by getMapImageUrl().
- */
- @Nullable
- public String getMapImageMimeType() {
- if (mMapImageUri == null) {
- return null;
- } else {
- return imageTypeToMime(mMapImageType, mMapImageUri.toString());
- }
- }
-
- /**
- * @return a URI referencing a map-file showing the local floor plan.
- *
- * <p> Will return a {@code null} when there is no URI defined.
- */
- @Nullable
- public Uri getMapImageUri() {
- return mMapImageUri;
- }
-}
diff --git a/wifi/java/android/net/wifi/rtt/WifiRttManager.java b/wifi/java/android/net/wifi/rtt/WifiRttManager.java
deleted file mode 100644
index 865702a..0000000
--- a/wifi/java/android/net/wifi/rtt/WifiRttManager.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * 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.net.wifi.rtt;
-
-import static android.Manifest.permission.ACCESS_FINE_LOCATION;
-import static android.Manifest.permission.ACCESS_WIFI_STATE;
-import static android.Manifest.permission.CHANGE_WIFI_STATE;
-import static android.Manifest.permission.LOCATION_HARDWARE;
-
-import android.annotation.CallbackExecutor;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.RequiresPermission;
-import android.annotation.SdkConstant;
-import android.annotation.SystemApi;
-import android.annotation.SystemService;
-import android.content.Context;
-import android.os.Binder;
-import android.os.RemoteException;
-import android.os.WorkSource;
-import android.util.Log;
-
-import java.util.List;
-import java.util.concurrent.Executor;
-
-/**
- * This class provides the primary API for measuring distance (range) to other devices using the
- * IEEE 802.11mc Wi-Fi Round Trip Time (RTT) technology.
- * <p>
- * The devices which can be ranged include:
- * <li>Access Points (APs)
- * <li>Wi-Fi Aware peers
- * <p>
- * Ranging requests are triggered using
- * {@link #startRanging(RangingRequest, Executor, RangingResultCallback)}. Results (in case of
- * successful operation) are returned in the {@link RangingResultCallback#onRangingResults(List)}
- * callback.
- * <p>
- * Wi-Fi RTT may not be usable at some points, e.g. when Wi-Fi is disabled. To validate that
- * the functionality is available use the {@link #isAvailable()} function. To track
- * changes in RTT usability register for the {@link #ACTION_WIFI_RTT_STATE_CHANGED}
- * broadcast. Note that this broadcast is not sticky - you should register for it and then
- * check the above API to avoid a race condition.
- */
-@SystemService(Context.WIFI_RTT_RANGING_SERVICE)
-public class WifiRttManager {
- private static final String TAG = "WifiRttManager";
- private static final boolean VDBG = false;
-
- private final Context mContext;
- private final IWifiRttManager mService;
-
- /**
- * Broadcast intent action to indicate that the state of Wi-Fi RTT availability has changed.
- * Use the {@link #isAvailable()} to query the current status.
- * This broadcast is <b>not</b> sticky, use the {@link #isAvailable()} API after registering
- * the broadcast to check the current state of Wi-Fi RTT.
- * <p>Note: The broadcast is only delivered to registered receivers - no manifest registered
- * components will be launched.
- */
- @SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String ACTION_WIFI_RTT_STATE_CHANGED =
- "android.net.wifi.rtt.action.WIFI_RTT_STATE_CHANGED";
-
- /** @hide */
- public WifiRttManager(@NonNull Context context, @NonNull IWifiRttManager service) {
- mContext = context;
- mService = service;
- }
-
- /**
- * Returns the current status of RTT API: whether or not RTT is available. To track
- * changes in the state of RTT API register for the
- * {@link #ACTION_WIFI_RTT_STATE_CHANGED} broadcast.
- * <p>Note: availability of RTT does not mean that the app can use the API. The app's
- * permissions and platform Location Mode are validated at run-time.
- *
- * @return A boolean indicating whether the app can use the RTT API at this time (true) or
- * not (false).
- */
- public boolean isAvailable() {
- try {
- return mService.isAvailable();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Initiate a request to range to a set of devices specified in the {@link RangingRequest}.
- * Results will be returned in the {@link RangingResultCallback} set of callbacks.
- *
- * @param request A request specifying a set of devices whose distance measurements are
- * requested.
- * @param executor The Executor on which to run the callback.
- * @param callback A callback for the result of the ranging request.
- */
- @RequiresPermission(allOf = {ACCESS_FINE_LOCATION, CHANGE_WIFI_STATE, ACCESS_WIFI_STATE})
- public void startRanging(@NonNull RangingRequest request,
- @NonNull @CallbackExecutor Executor executor, @NonNull RangingResultCallback callback) {
- startRanging(null, request, executor, callback);
- }
-
- /**
- * Initiate a request to range to a set of devices specified in the {@link RangingRequest}.
- * Results will be returned in the {@link RangingResultCallback} set of callbacks.
- *
- * @param workSource A mechanism to specify an alternative work-source for the request.
- * @param request A request specifying a set of devices whose distance measurements are
- * requested.
- * @param executor The Executor on which to run the callback.
- * @param callback A callback for the result of the ranging request.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(allOf = {LOCATION_HARDWARE, ACCESS_FINE_LOCATION, CHANGE_WIFI_STATE,
- ACCESS_WIFI_STATE})
- public void startRanging(@Nullable WorkSource workSource, @NonNull RangingRequest request,
- @NonNull @CallbackExecutor Executor executor, @NonNull RangingResultCallback callback) {
- if (VDBG) {
- Log.v(TAG, "startRanging: workSource=" + workSource + ", request=" + request
- + ", callback=" + callback + ", executor=" + executor);
- }
-
- if (executor == null) {
- throw new IllegalArgumentException("Null executor provided");
- }
- if (callback == null) {
- throw new IllegalArgumentException("Null callback provided");
- }
-
- Binder binder = new Binder();
- try {
- mService.startRanging(binder, mContext.getOpPackageName(),
- mContext.getAttributionTag(), workSource, request, new IRttCallback.Stub() {
- @Override
- public void onRangingFailure(int status) throws RemoteException {
- clearCallingIdentity();
- executor.execute(() -> callback.onRangingFailure(status));
- }
-
- @Override
- public void onRangingResults(List<RangingResult> results)
- throws RemoteException {
- clearCallingIdentity();
- executor.execute(() -> callback.onRangingResults(results));
- }
- });
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Cancel all ranging requests for the specified work sources. The requests have been requested
- * using {@link #startRanging(WorkSource, RangingRequest, Executor, RangingResultCallback)}.
- *
- * @param workSource The work-sources of the requesters.
- *
- * @hide
- */
- @SystemApi
- @RequiresPermission(allOf = {LOCATION_HARDWARE})
- public void cancelRanging(@Nullable WorkSource workSource) {
- if (VDBG) {
- Log.v(TAG, "cancelRanging: workSource=" + workSource);
- }
-
- try {
- mService.cancelRanging(workSource);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-}
diff --git a/wifi/java/android/net/wifi/rtt/package.html b/wifi/java/android/net/wifi/rtt/package.html
deleted file mode 100644
index 4a32f52..0000000
--- a/wifi/java/android/net/wifi/rtt/package.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<HTML>
-<BODY>
-<p>Provides classes which allow applications to use Wi-Fi RTT (IEEE 802.11mc) to measure distance
- to supporting Access Points and peer devices.</p>
-<p>The primary entry point to Wi-Fi RTT capabilities is the
- {@link android.net.wifi.rtt.WifiRttManager} class, which is acquired by calling
- {@link android.content.Context#getSystemService(String)
- Context.getSystemService(Context.WIFI_RTT_RANGING_SERVICE)}</p>
-
-<p>Some APIs may require the following user permissions:</p>
-<ul>
- <li>{@link android.Manifest.permission#ACCESS_WIFI_STATE}</li>
- <li>{@link android.Manifest.permission#CHANGE_WIFI_STATE}</li>
- <li>{@link android.Manifest.permission#ACCESS_FINE_LOCATION}</li>
-</ul>
-<p>Usage of the API is also gated by the device's Location Mode: whether it permits Wi-Fi based
-location to be queried.</p>
-
-<p class="note"><strong>Note:</strong> Not all Android-powered devices support Wi-Fi RTT
- functionality.
- If your application only works with Wi-Fi RTT (i.e. it should only be installed on devices which
- support Wi-Fi RTT), declare so with a <a
- href="{@docRoot}guide/topics/manifest/uses-feature-element.html">
- {@code <uses-feature>}</a>
- element in the manifest file:</p>
-<pre>
-<manifest ...>
- <uses-feature android:name="android.hardware.wifi.rtt" />
- ...
-</manifest>
-</pre>
-<p>Alternatively, if your application does not require Wi-Fi RTT but can take advantage of it if
- available, you can perform
- the check at run-time in your code using {@link
- android.content.pm.PackageManager#hasSystemFeature(String)} with {@link
- android.content.pm.PackageManager#FEATURE_WIFI_RTT}:</p>
-<pre>
- getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI_RTT)
-</pre>
-
-<p>For an example of this functionality, see
-<a href="{@docRoot}guide/topics/connectivity/wifi-rtt" class="external">Wi-Fi location: ranging
-with RTT</a>.</p>
-</BODY>
-</HTML>
diff --git a/wifi/java/android/net/wifi/util/HexEncoding.java b/wifi/java/android/net/wifi/util/HexEncoding.java
deleted file mode 100644
index 9ebf947..0000000
--- a/wifi/java/android/net/wifi/util/HexEncoding.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.util;
-
-/**
- * Hexadecimal encoding where each byte is represented by two hexadecimal digits.
- *
- * Note: this is copied from {@link libcore.util.HexEncoding}.
- *
- * @hide
- */
-public class HexEncoding {
-
- private static final char[] LOWER_CASE_DIGITS = {
- '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
- };
-
- private static final char[] UPPER_CASE_DIGITS = {
- '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
- };
-
- /** Hidden constructor to prevent instantiation. */
- private HexEncoding() {}
-
- /**
- * Encodes the provided byte as a two-digit hexadecimal String value.
- */
- public static String encodeToString(byte b, boolean upperCase) {
- char[] digits = upperCase ? UPPER_CASE_DIGITS : LOWER_CASE_DIGITS;
- char[] buf = new char[2]; // We always want two digits.
- buf[0] = digits[(b >> 4) & 0xf];
- buf[1] = digits[b & 0xf];
- return new String(buf, 0, 2);
- }
-
- /**
- * Encodes the provided data as a sequence of hexadecimal characters.
- */
- public static char[] encode(byte[] data) {
- return encode(data, 0, data.length, true /* upperCase */);
- }
-
- /**
- * Encodes the provided data as a sequence of hexadecimal characters.
- */
- public static char[] encode(byte[] data, boolean upperCase) {
- return encode(data, 0, data.length, upperCase);
- }
-
- /**
- * Encodes the provided data as a sequence of hexadecimal characters.
- */
- public static char[] encode(byte[] data, int offset, int len) {
- return encode(data, offset, len, true /* upperCase */);
- }
-
- /**
- * Encodes the provided data as a sequence of hexadecimal characters.
- */
- private static char[] encode(byte[] data, int offset, int len, boolean upperCase) {
- char[] digits = upperCase ? UPPER_CASE_DIGITS : LOWER_CASE_DIGITS;
- char[] result = new char[len * 2];
- for (int i = 0; i < len; i++) {
- byte b = data[offset + i];
- int resultIndex = 2 * i;
- result[resultIndex] = (digits[(b >> 4) & 0x0f]);
- result[resultIndex + 1] = (digits[b & 0x0f]);
- }
-
- return result;
- }
-
- /**
- * Encodes the provided data as a sequence of hexadecimal characters.
- */
- public static String encodeToString(byte[] data) {
- return encodeToString(data, true /* upperCase */);
- }
-
- /**
- * Encodes the provided data as a sequence of hexadecimal characters.
- */
- public static String encodeToString(byte[] data, boolean upperCase) {
- return new String(encode(data, upperCase));
- }
-
- /**
- * Decodes the provided hexadecimal string into a byte array. Odd-length inputs
- * are not allowed.
- *
- * Throws an {@code IllegalArgumentException} if the input is malformed.
- */
- public static byte[] decode(String encoded) throws IllegalArgumentException {
- return decode(encoded.toCharArray());
- }
-
- /**
- * Decodes the provided hexadecimal string into a byte array. If {@code allowSingleChar}
- * is {@code true} odd-length inputs are allowed and the first character is interpreted
- * as the lower bits of the first result byte.
- *
- * Throws an {@code IllegalArgumentException} if the input is malformed.
- */
- public static byte[] decode(String encoded, boolean allowSingleChar)
- throws IllegalArgumentException {
- return decode(encoded.toCharArray(), allowSingleChar);
- }
-
- /**
- * Decodes the provided hexadecimal string into a byte array. Odd-length inputs
- * are not allowed.
- *
- * Throws an {@code IllegalArgumentException} if the input is malformed.
- */
- public static byte[] decode(char[] encoded) throws IllegalArgumentException {
- return decode(encoded, false);
- }
-
- /**
- * Decodes the provided hexadecimal string into a byte array. If {@code allowSingleChar}
- * is {@code true} odd-length inputs are allowed and the first character is interpreted
- * as the lower bits of the first result byte.
- *
- * Throws an {@code IllegalArgumentException} if the input is malformed.
- */
- public static byte[] decode(char[] encoded, boolean allowSingleChar)
- throws IllegalArgumentException {
- int encodedLength = encoded.length;
- int resultLengthBytes = (encodedLength + 1) / 2;
- byte[] result = new byte[resultLengthBytes];
-
- int resultOffset = 0;
- int i = 0;
- if (allowSingleChar) {
- if ((encodedLength % 2) != 0) {
- // Odd number of digits -- the first digit is the lower 4 bits of the first result
- // byte.
- result[resultOffset++] = (byte) toDigit(encoded, i);
- i++;
- }
- } else {
- if ((encodedLength % 2) != 0) {
- throw new IllegalArgumentException("Invalid input length: " + encodedLength);
- }
- }
-
- for (; i < encodedLength; i += 2) {
- result[resultOffset++] = (byte) ((toDigit(encoded, i) << 4) | toDigit(encoded, i + 1));
- }
-
- return result;
- }
-
- private static int toDigit(char[] str, int offset) throws IllegalArgumentException {
- // NOTE: that this isn't really a code point in the traditional sense, since we're
- // just rejecting surrogate pairs outright.
- int pseudoCodePoint = str[offset];
-
- if ('0' <= pseudoCodePoint && pseudoCodePoint <= '9') {
- return pseudoCodePoint - '0';
- } else if ('a' <= pseudoCodePoint && pseudoCodePoint <= 'f') {
- return 10 + (pseudoCodePoint - 'a');
- } else if ('A' <= pseudoCodePoint && pseudoCodePoint <= 'F') {
- return 10 + (pseudoCodePoint - 'A');
- }
-
- throw new IllegalArgumentException("Illegal char: " + str[offset] + " at offset " + offset);
- }
-}
diff --git a/wifi/java/android/net/wifi/SoftApConfToXmlMigrationUtil.java b/wifi/java/src/android/net/wifi/SoftApConfToXmlMigrationUtil.java
similarity index 100%
rename from wifi/java/android/net/wifi/SoftApConfToXmlMigrationUtil.java
rename to wifi/java/src/android/net/wifi/SoftApConfToXmlMigrationUtil.java
diff --git a/wifi/java/android/net/wifi/WifiMigration.java b/wifi/java/src/android/net/wifi/WifiMigration.java
similarity index 99%
rename from wifi/java/android/net/wifi/WifiMigration.java
rename to wifi/java/src/android/net/wifi/WifiMigration.java
index 5792d27..4fabc0b 100755
--- a/wifi/java/android/net/wifi/WifiMigration.java
+++ b/wifi/java/src/android/net/wifi/WifiMigration.java
@@ -139,8 +139,8 @@
/**
* Load data from legacy shared wifi config store file.
* <p>
- * Expected AOSP format is available in the sample files under {@code /frameworks/base/wifi/
- * java/android/net/wifi/migration_samples}.
+ * Expected AOSP format is available in the sample files under {@code
+ * frameworks/base/wifi/non-updatable/migration_samples/}.
* </p>
* <p>
* Note:
@@ -218,8 +218,8 @@
/**
* Load data from legacy user wifi config store file.
* <p>
- * Expected AOSP format is available in the sample files under {@code /frameworks/base/wifi/
- * java/android/net/wifi/migration_samples}.
+ * Expected AOSP format is available in the sample files under {@code
+ * frameworks/base/wifi/non-updatable/migration_samples/}.
* </p>
* <p>
* Note:
diff --git a/wifi/java/android/net/wifi/WifiNetworkScoreCache.java b/wifi/java/src/android/net/wifi/WifiNetworkScoreCache.java
similarity index 98%
rename from wifi/java/android/net/wifi/WifiNetworkScoreCache.java
rename to wifi/java/src/android/net/wifi/WifiNetworkScoreCache.java
index 378549d..3903658 100755
--- a/wifi/java/android/net/wifi/WifiNetworkScoreCache.java
+++ b/wifi/java/src/android/net/wifi/WifiNetworkScoreCache.java
@@ -89,7 +89,7 @@
@Override public final void updateScores(List<ScoredNetwork> networks) {
if (networks == null || networks.isEmpty()) {
- return;
+ return;
}
if (DBG) {
Log.d(TAG, "updateScores list size=" + networks.size());
@@ -97,7 +97,7 @@
boolean changed = false;
- synchronized(mLock) {
+ synchronized (mLock) {
for (ScoredNetwork network : networks) {
String networkKey = buildNetworkKey(network);
if (networkKey == null) {
@@ -189,7 +189,7 @@
String key = buildNetworkKey(result);
if (key == null) return null;
- synchronized(mLock) {
+ synchronized (mLock) {
ScoredNetwork network = mCache.get(key);
return network;
}
diff --git a/wifi/java/android/net/wifi/nl80211/ChannelSettings.java b/wifi/java/src/android/net/wifi/nl80211/ChannelSettings.java
similarity index 100%
rename from wifi/java/android/net/wifi/nl80211/ChannelSettings.java
rename to wifi/java/src/android/net/wifi/nl80211/ChannelSettings.java
diff --git a/wifi/java/android/net/wifi/nl80211/DeviceWiphyCapabilities.java b/wifi/java/src/android/net/wifi/nl80211/DeviceWiphyCapabilities.java
similarity index 100%
rename from wifi/java/android/net/wifi/nl80211/DeviceWiphyCapabilities.java
rename to wifi/java/src/android/net/wifi/nl80211/DeviceWiphyCapabilities.java
diff --git a/wifi/java/android/net/wifi/nl80211/HiddenNetwork.java b/wifi/java/src/android/net/wifi/nl80211/HiddenNetwork.java
similarity index 100%
rename from wifi/java/android/net/wifi/nl80211/HiddenNetwork.java
rename to wifi/java/src/android/net/wifi/nl80211/HiddenNetwork.java
diff --git a/wifi/java/android/net/wifi/nl80211/NativeScanResult.java b/wifi/java/src/android/net/wifi/nl80211/NativeScanResult.java
similarity index 100%
rename from wifi/java/android/net/wifi/nl80211/NativeScanResult.java
rename to wifi/java/src/android/net/wifi/nl80211/NativeScanResult.java
diff --git a/wifi/java/android/net/wifi/nl80211/NativeWifiClient.java b/wifi/java/src/android/net/wifi/nl80211/NativeWifiClient.java
similarity index 100%
rename from wifi/java/android/net/wifi/nl80211/NativeWifiClient.java
rename to wifi/java/src/android/net/wifi/nl80211/NativeWifiClient.java
diff --git a/wifi/java/android/net/wifi/nl80211/PnoNetwork.java b/wifi/java/src/android/net/wifi/nl80211/PnoNetwork.java
similarity index 100%
rename from wifi/java/android/net/wifi/nl80211/PnoNetwork.java
rename to wifi/java/src/android/net/wifi/nl80211/PnoNetwork.java
diff --git a/wifi/java/android/net/wifi/nl80211/PnoSettings.java b/wifi/java/src/android/net/wifi/nl80211/PnoSettings.java
similarity index 100%
rename from wifi/java/android/net/wifi/nl80211/PnoSettings.java
rename to wifi/java/src/android/net/wifi/nl80211/PnoSettings.java
diff --git a/wifi/java/android/net/wifi/nl80211/RadioChainInfo.java b/wifi/java/src/android/net/wifi/nl80211/RadioChainInfo.java
similarity index 100%
rename from wifi/java/android/net/wifi/nl80211/RadioChainInfo.java
rename to wifi/java/src/android/net/wifi/nl80211/RadioChainInfo.java
diff --git a/wifi/java/android/net/wifi/nl80211/SingleScanSettings.java b/wifi/java/src/android/net/wifi/nl80211/SingleScanSettings.java
similarity index 100%
rename from wifi/java/android/net/wifi/nl80211/SingleScanSettings.java
rename to wifi/java/src/android/net/wifi/nl80211/SingleScanSettings.java
diff --git a/wifi/java/android/net/wifi/nl80211/WifiNl80211Manager.java b/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java
similarity index 100%
rename from wifi/java/android/net/wifi/nl80211/WifiNl80211Manager.java
rename to wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java
diff --git a/wifi/java/android/net/wifi/migration_samples/README.txt b/wifi/migration_samples/README.txt
similarity index 100%
rename from wifi/java/android/net/wifi/migration_samples/README.txt
rename to wifi/migration_samples/README.txt
diff --git a/wifi/java/android/net/wifi/migration_samples/Shared_WifiConfigStore.xml b/wifi/migration_samples/Shared_WifiConfigStore.xml
similarity index 100%
rename from wifi/java/android/net/wifi/migration_samples/Shared_WifiConfigStore.xml
rename to wifi/migration_samples/Shared_WifiConfigStore.xml
diff --git a/wifi/java/android/net/wifi/migration_samples/Shared_WifiConfigStoreSoftAp.xml b/wifi/migration_samples/Shared_WifiConfigStoreSoftAp.xml
similarity index 100%
rename from wifi/java/android/net/wifi/migration_samples/Shared_WifiConfigStoreSoftAp.xml
rename to wifi/migration_samples/Shared_WifiConfigStoreSoftAp.xml
diff --git a/wifi/java/android/net/wifi/migration_samples/User_WifiConfigStore.xml b/wifi/migration_samples/User_WifiConfigStore.xml
similarity index 100%
rename from wifi/java/android/net/wifi/migration_samples/User_WifiConfigStore.xml
rename to wifi/migration_samples/User_WifiConfigStore.xml
diff --git a/wifi/java/android/net/wifi/migration_samples/User_WifiConfigStoreNetworkSuggestions.xml b/wifi/migration_samples/User_WifiConfigStoreNetworkSuggestions.xml
similarity index 100%
rename from wifi/java/android/net/wifi/migration_samples/User_WifiConfigStoreNetworkSuggestions.xml
rename to wifi/migration_samples/User_WifiConfigStoreNetworkSuggestions.xml
diff --git a/wifi/tests/Android.bp b/wifi/tests/Android.bp
index 7eba0a7..3f5cacf 100644
--- a/wifi/tests/Android.bp
+++ b/wifi/tests/Android.bp
@@ -12,18 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Make test APK
-// ============================================================
-
android_test {
- name: "FrameworksWifiApiTests",
+ name: "FrameworksWifiNonUpdatableApiTests",
defaults: ["framework-wifi-test-defaults"],
- min_sdk_version: "30",
- target_sdk_version: "30",
-
- srcs: ["**/*.java"],
+ srcs: ["src/**/*.java"],
jacoco: {
include_filter: ["android.net.wifi.*"],
@@ -33,12 +27,9 @@
static_libs: [
"androidx.test.rules",
- "core-test-rules",
"frameworks-base-testutils",
"guava",
"mockito-target-minus-junit4",
- "modules-utils-build",
- "net-tests-utils",
"truth-prebuilt",
],
@@ -49,10 +40,5 @@
test_suites: [
"general-tests",
- "mts",
],
-
- // static libs used by both framework-wifi & FrameworksWifiApiTests. Need to rename test usage
- // to a different package name to prevent conflict with the copy in production code.
- jarjar_rules: "test-jarjar-rules.txt",
}
diff --git a/wifi/tests/AndroidManifest.xml b/wifi/tests/AndroidManifest.xml
index 8fcf78f..18986fc 100644
--- a/wifi/tests/AndroidManifest.xml
+++ b/wifi/tests/AndroidManifest.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- ~ Copyright (C) 2016 The Android Open Source Project
+ ~ 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.
@@ -16,7 +16,7 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="android.net.wifi.test">
+ package="android.net.wifi.nonupdatable.test">
<application>
<uses-library android:name="android.test.runner"/>
@@ -31,8 +31,8 @@
</application>
<instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
- android:targetPackage="android.net.wifi.test"
- android:label="Frameworks Wifi API Tests">
+ android:targetPackage="android.net.wifi.nonupdatable.test"
+ android:label="Frameworks Wifi Non-updatable API Tests">
</instrumentation>
</manifest>
diff --git a/wifi/tests/AndroidTest.xml b/wifi/tests/AndroidTest.xml
index 2cdaddb..4e8bb55 100644
--- a/wifi/tests/AndroidTest.xml
+++ b/wifi/tests/AndroidTest.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2017 The Android Open Source Project
+<!-- 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.
@@ -13,24 +13,16 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<configuration description="Runs Frameworks Wifi API Tests.">
+<configuration description="Runs Frameworks Wifi Non-updatable API Tests.">
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
- <option name="test-file-name" value="FrameworksWifiApiTests.apk" />
+ <option name="test-file-name" value="FrameworksWifiNonUpdatableApiTests.apk" />
</target_preparer>
<option name="test-suite-tag" value="apct" />
- <option name="test-tag" value="FrameworksWifiApiTests" />
- <option name="config-descriptor:metadata" key="mainline-param"
- value="com.google.android.wifi.apex" />
+ <option name="test-tag" value="FrameworksWifiNonUpdatableApiTests" />
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
- <option name="package" value="android.net.wifi.test" />
+ <option name="package" value="android.net.wifi.nonupdatable.test" />
<option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
<option name="hidden-api-checks" value="false"/>
</test>
-
- <!-- Only run FrameworksWifiApiTests in MTS if the Wifi Mainline module is installed. -->
- <object type="module_controller"
- class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController">
- <option name="mainline-module-package-name" value="com.google.android.wifi" />
- </object>
</configuration>
diff --git a/wifi/tests/README.md b/wifi/tests/README.md
index f909404..ad535f4 100644
--- a/wifi/tests/README.md
+++ b/wifi/tests/README.md
@@ -1,5 +1,6 @@
-# Wifi Unit Tests
-This package contains unit tests for the android wifi framework APIs based on the
+# Wifi Non-Updatable Framework Unit Tests
+This package contains unit tests for the non-updatable part (i.e. outside the Wifi module) of the
+Android Wifi framework APIs based on the
[Android Testing Support Library](http://developer.android.com/tools/testing-support-library/index.html).
The test cases are built using the [JUnit](http://junit.org/) and [Mockito](http://mockito.org/)
libraries.
diff --git a/wifi/tests/assets/hsr1/HSR1ProfileWithCACert.base64 b/wifi/tests/assets/hsr1/HSR1ProfileWithCACert.base64
deleted file mode 100644
index 760c839..0000000
--- a/wifi/tests/assets/hsr1/HSR1ProfileWithCACert.base64
+++ /dev/null
@@ -1,86 +0,0 @@
-TUlNRS1WZXJzaW9uOiAxLjAKQ29udGVudC1UeXBlOiBtdWx0aXBhcnQvbWl4ZWQ7IGJvdW5kYXJ5
-PXtib3VuZGFyeX07IGNoYXJzZXQ9VVRGLTgKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogYmFz
-ZTY0CgotLXtib3VuZGFyeX0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi94LXBhc3Nwb2ludC1w
-cm9maWxlOyBjaGFyc2V0PVVURi04CkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IGJhc2U2NAoK
-UEUxbmJYUlVjbVZsSUhodGJHNXpQU0p6ZVc1amJXdzZaRzFrWkdZeExqSWlQZ29nSUR4V1pYSkVW
-RVErTVM0eVBDOVdaWEpFVkVRKwpDaUFnUEU1dlpHVStDaUFnSUNBOFRtOWtaVTVoYldVK1VHVnlV
-SEp2ZG1sa1pYSlRkV0p6WTNKcGNIUnBiMjQ4TDA1dlpHVk9ZVzFsClBnb2dJQ0FnUEZKVVVISnZj
-R1Z5ZEdsbGN6NEtJQ0FnSUNBZ1BGUjVjR1UrQ2lBZ0lDQWdJQ0FnUEVSRVJrNWhiV1UrZFhKdU9u
-ZG0KWVRwdGJ6cG9iM1J6Y0c5ME1tUnZkREF0Y0dWeWNISnZkbWxrWlhKemRXSnpZM0pwY0hScGIy
-NDZNUzR3UEM5RVJFWk9ZVzFsUGdvZwpJQ0FnSUNBOEwxUjVjR1UrQ2lBZ0lDQThMMUpVVUhKdmNH
-VnlkR2xsY3o0S0lDQWdJRHhPYjJSbFBnb2dJQ0FnSUNBOFRtOWtaVTVoCmJXVSthVEF3TVR3dlRt
-OWtaVTVoYldVK0NpQWdJQ0FnSUR4T2IyUmxQZ29nSUNBZ0lDQWdJRHhPYjJSbFRtRnRaVDVJYjIx
-bFUxQTgKTDA1dlpHVk9ZVzFsUGdvZ0lDQWdJQ0FnSUR4T2IyUmxQZ29nSUNBZ0lDQWdJQ0FnUEU1
-dlpHVk9ZVzFsUGtaeWFXVnVaR3g1VG1GdApaVHd2VG05a1pVNWhiV1UrQ2lBZ0lDQWdJQ0FnSUNB
-OFZtRnNkV1UrUlhoaGJYQnNaU0JPWlhSM2IzSnJQQzlXWVd4MVpUNEtJQ0FnCklDQWdJQ0E4TDA1
-dlpHVStDaUFnSUNBZ0lDQWdQRTV2WkdVK0NpQWdJQ0FnSUNBZ0lDQThUbTlrWlU1aGJXVStSbEZF
-VGp3dlRtOWsKWlU1aGJXVStDaUFnSUNBZ0lDQWdJQ0E4Vm1Gc2RXVSthRzkwYzNCdmRDNWxlR0Z0
-Y0d4bExtNWxkRHd2Vm1Gc2RXVStDaUFnSUNBZwpJQ0FnUEM5T2IyUmxQZ29nSUNBZ0lDQWdJRHhP
-YjJSbFBnb2dJQ0FnSUNBZ0lDQWdQRTV2WkdWT1lXMWxQbEp2WVcxcGJtZERiMjV6CmIzSjBhWFZ0
-VDBrOEwwNXZaR1ZPWVcxbFBnb2dJQ0FnSUNBZ0lDQWdQRlpoYkhWbFBqRXhNakl6TXl3ME5EVTFO
-alk4TDFaaGJIVmwKUGdvZ0lDQWdJQ0FnSUR3dlRtOWtaVDRLSUNBZ0lDQWdQQzlPYjJSbFBnb2dJ
-Q0FnSUNBOFRtOWtaVDRLSUNBZ0lDQWdJQ0E4VG05awpaVTVoYldVK1EzSmxaR1Z1ZEdsaGJEd3ZU
-bTlrWlU1aGJXVStDaUFnSUNBZ0lDQWdQRTV2WkdVK0NpQWdJQ0FnSUNBZ0lDQThUbTlrClpVNWhi
-V1UrVW1WaGJHMDhMMDV2WkdWT1lXMWxQZ29nSUNBZ0lDQWdJQ0FnUEZaaGJIVmxQbVY0WVcxd2JH
-VXVZMjl0UEM5V1lXeDEKWlQ0S0lDQWdJQ0FnSUNBOEwwNXZaR1UrQ2lBZ0lDQWdJQ0FnUEU1dlpH
-VStDaUFnSUNBZ0lDQWdJQ0E4VG05a1pVNWhiV1UrVlhObApjbTVoYldWUVlYTnpkMjl5WkR3dlRt
-OWtaVTVoYldVK0NpQWdJQ0FnSUNBZ0lDQThUbTlrWlQ0S0lDQWdJQ0FnSUNBZ0lDQWdQRTV2ClpH
-Vk9ZVzFsUGxWelpYSnVZVzFsUEM5T2IyUmxUbUZ0WlQ0S0lDQWdJQ0FnSUNBZ0lDQWdQRlpoYkhW
-bFBuVnpaWEk4TDFaaGJIVmwKUGdvZ0lDQWdJQ0FnSUNBZ1BDOU9iMlJsUGdvZ0lDQWdJQ0FnSUNB
-Z1BFNXZaR1UrQ2lBZ0lDQWdJQ0FnSUNBZ0lEeE9iMlJsVG1GdApaVDVRWVhOemQyOXlaRHd2VG05
-a1pVNWhiV1UrQ2lBZ0lDQWdJQ0FnSUNBZ0lEeFdZV3gxWlQ1alIwWjZZek5rZG1OdFVUMDhMMVpo
-CmJIVmxQZ29nSUNBZ0lDQWdJQ0FnUEM5T2IyUmxQZ29nSUNBZ0lDQWdJQ0FnUEU1dlpHVStDaUFn
-SUNBZ0lDQWdJQ0FnSUR4T2IyUmwKVG1GdFpUNUZRVkJOWlhSb2IyUThMMDV2WkdWT1lXMWxQZ29n
-SUNBZ0lDQWdJQ0FnSUNBOFRtOWtaVDRLSUNBZ0lDQWdJQ0FnSUNBZwpJQ0E4VG05a1pVNWhiV1Ur
-UlVGUVZIbHdaVHd2VG05a1pVNWhiV1UrQ2lBZ0lDQWdJQ0FnSUNBZ0lDQWdQRlpoYkhWbFBqSXhQ
-QzlXCllXeDFaVDRLSUNBZ0lDQWdJQ0FnSUNBZ1BDOU9iMlJsUGdvZ0lDQWdJQ0FnSUNBZ0lDQThU
-bTlrWlQ0S0lDQWdJQ0FnSUNBZ0lDQWcKSUNBOFRtOWtaVTVoYldVK1NXNXVaWEpOWlhSb2IyUThM
-MDV2WkdWT1lXMWxQZ29nSUNBZ0lDQWdJQ0FnSUNBZ0lEeFdZV3gxWlQ1TgpVeTFEU0VGUUxWWXlQ
-QzlXWVd4MVpUNEtJQ0FnSUNBZ0lDQWdJQ0FnUEM5T2IyUmxQZ29nSUNBZ0lDQWdJQ0FnUEM5T2Iy
-UmxQZ29nCklDQWdJQ0FnSUR3dlRtOWtaVDRLSUNBZ0lDQWdJQ0E4VG05a1pUNEtJQ0FnSUNBZ0lD
-QWdJRHhPYjJSbFRtRnRaVDVFYVdkcGRHRnMKUTJWeWRHbG1hV05oZEdVOEwwNXZaR1ZPWVcxbFBn
-b2dJQ0FnSUNBZ0lDQWdQRTV2WkdVK0NpQWdJQ0FnSUNBZ0lDQWdJRHhPYjJSbApUbUZ0WlQ1RFpY
-SjBhV1pwWTJGMFpWUjVjR1U4TDA1dlpHVk9ZVzFsUGdvZ0lDQWdJQ0FnSUNBZ0lDQThWbUZzZFdV
-K2VEVXdPWFl6ClBDOVdZV3gxWlQ0S0lDQWdJQ0FnSUNBZ0lEd3ZUbTlrWlQ0S0lDQWdJQ0FnSUNB
-Z0lEeE9iMlJsUGdvZ0lDQWdJQ0FnSUNBZ0lDQTgKVG05a1pVNWhiV1UrUTJWeWRGTklRVEkxTmta
-cGJtZGxjbkJ5YVc1MFBDOU9iMlJsVG1GdFpUNEtJQ0FnSUNBZ0lDQWdJQ0FnUEZaaApiSFZsUGpG
-bU1XWXhaakZtTVdZeFpqRm1NV1l4WmpGbU1XWXhaakZtTVdZeFpqRm1NV1l4WmpGbU1XWXhaakZt
-TVdZeFpqRm1NV1l4ClpqRm1NV1l4WmpGbU1XWThMMVpoYkhWbFBnb2dJQ0FnSUNBZ0lDQWdQQzlP
-YjJSbFBnb2dJQ0FnSUNBZ0lEd3ZUbTlrWlQ0S0lDQWcKSUNBZ0lDQThUbTlrWlQ0S0lDQWdJQ0Fn
-SUNBZ0lEeE9iMlJsVG1GdFpUNVRTVTA4TDA1dlpHVk9ZVzFsUGdvZ0lDQWdJQ0FnSUNBZwpQRTV2
-WkdVK0NpQWdJQ0FnSUNBZ0lDQWdJRHhPYjJSbFRtRnRaVDVKVFZOSlBDOU9iMlJsVG1GdFpUNEtJ
-Q0FnSUNBZ0lDQWdJQ0FnClBGWmhiSFZsUGpFeU16UTFOaW84TDFaaGJIVmxQZ29nSUNBZ0lDQWdJ
-Q0FnUEM5T2IyUmxQZ29nSUNBZ0lDQWdJQ0FnUEU1dlpHVSsKQ2lBZ0lDQWdJQ0FnSUNBZ0lEeE9i
-MlJsVG1GdFpUNUZRVkJVZVhCbFBDOU9iMlJsVG1GdFpUNEtJQ0FnSUNBZ0lDQWdJQ0FnUEZaaApi
-SFZsUGpJelBDOVdZV3gxWlQ0S0lDQWdJQ0FnSUNBZ0lEd3ZUbTlrWlQ0S0lDQWdJQ0FnSUNBOEww
-NXZaR1UrQ2lBZ0lDQWdJRHd2ClRtOWtaVDRLSUNBZ0lEd3ZUbTlrWlQ0S0lDQThMMDV2WkdVK0Nq
-d3ZUV2R0ZEZSeVpXVSsKCi0te2JvdW5kYXJ5fQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL3gt
-eDUwOS1jYS1jZXJ0CkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IGJhc2U2NAoKTFMwdExTMUNS
-VWRKVGlCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2sxSlNVUkxSRU5EUVdoRFowRjNTVUpCWjBsS1FV
-bE1iRVprZDNwTQpWblZ5VFVFd1IwTlRjVWRUU1dJelJGRkZRa04zVlVGTlFrbDRSVVJCVDBKblRs
-WUtRa0ZOVkVJd1ZrSlZRMEpFVVZSRmQwaG9ZMDVOClZGbDNUVlJGZVUxVVJURk5SRVV4VjJoalRr
-MXFXWGROVkVFMVRWUkZNVTFFUlRGWGFrRlRUVkpCZHdwRVoxbEVWbEZSUkVWM1pFWlIKVmtGblVU
-QkZlRTFKU1VKSmFrRk9RbWRyY1docmFVYzVkekJDUVZGRlJrRkJUME5CVVRoQlRVbEpRa05uUzBO
-QlVVVkJDbnB1UVZCVgplakkyVFhOaFpUUjNjelF6WTNwU05ERXZTakpSZEhKVFNWcFZTMjFXVlhO
-V2RXMUVZbGxJY2xCT2RsUllTMU5OV0VGalpYZFBVa1JSCldWZ0tVbkYyU0had2JqaERjMk5DTVN0
-dlIxaGFka2gzZUdvMGVsWXdWMHR2U3pKNlpWaHJZWFV6ZG1ONWJETklTVXQxY0VwbWNUSlUKUlVG
-RFpXWldhbW93ZEFwS1Z5dFlNelZRUjFkd09TOUlOWHBKVlU1V1RsWnFVemRWYlhNNE5FbDJTMmhT
-UWpnMU1USlFRamxWZVVoaApaMWhaVmxnMVIxZHdRV05XY0hsbWNteFNDa1pKT1ZGa2FHZ3JVR0py
-TUhWNWEzUmtZbVl2UTJSbVowaFBiMlZpY2xSMGQxSnNhazB3CmIwUjBXQ3N5UTNZMmFqQjNRa3Mz
-YUVRNGNGQjJaakVyZFhrS1IzcGplbWxuUVZVdk5FdDNOMlZhY1hsa1pqbENLelZTZFhCU0swbGEK
-YVhCWU5ERjRSV2xKY2t0U2QzRnBOVEUzVjFkNldHTnFZVWN5WTA1aVpqUTFNUXA0Y0VnMVVHNVdN
-Mmt4ZEhFd05HcE5SMUZWZWtaMwpTVVJCVVVGQ2J6UkhRVTFJTkhkSVVWbEVWbEl3VDBKQ1dVVkdT
-WGRZTkhaek9FSnBRbU5UWTI5a0NqVnViMXBJVWswNFJUUXJhVTFGClNVZEJNVlZrU1hkUk4wMUVi
-VUZHU1hkWU5IWnpPRUpwUW1OVFkyOWtOVzV2V2toU1RUaEZOQ3RwYjFKaGEwWkVRVk1LVFZKQmQw
-Um4KV1VSV1VWRkVSWGRrUmxGV1FXZFJNRVY0WjJkclFXZDFWVll6UkUxMFZ6WnpkMFJCV1VSV1Vq
-QlVRa0ZWZDBGM1JVSXZla0ZNUW1kTwpWZ3BJVVRoRlFrRk5RMEZSV1hkRVVWbEtTMjlhU1doMlkw
-NUJVVVZNUWxGQlJHZG5SVUpCUm1aUmNVOVVRVGRTZGpkTEsyeDFVVGR3CmJtRnpORUpaZDBoRkNq
-bEhSVkF2ZFc5b2RqWkxUM2t3VkVkUlJtSnlVbFJxUm05TVZrNUNPVUphTVhsdFRVUmFNQzlVU1hk
-SlZXTTMKZDJrM1lUaDBOVzFGY1ZsSU1UVXpkMWNLWVZkdmIybFRhbmxNVEdoMVNUUnpUbkpPUTA5
-MGFYTmtRbkV5Y2pKTlJsaDBObWd3YlVGUgpXVTlRZGpoU09FczNMMlpuVTNoSFJuRjZhSGxPYlcx
-V1RBb3hjVUpLYkdSNE16UlRjSGR6VkVGTVVWWlFZalJvUjNkS2VscG1jakZRClkzQkZVWGcyZUUx
-dVZHdzRlRVZYV2tVelRYTTVPWFZoVlhoaVVYRkpkMUoxQ2t4blFVOXJUa050V1RKdE9EbFdhSHBo
-U0VveGRWWTQKTlVGa1RTOTBSQ3RaYzIxc2JtNXFkRGxNVWtObGFtSkNhWEJxU1VkcVQxaHlaekZL
-VUN0c2VGWUtiWFZOTkhaSUsxQXZiV3h0ZUhOUQpVSG93WkRZMVlpdEZSMjFLV25CdlRHdFBMM1Jr
-VGs1MlExbDZha3B3VkVWWGNFVnpUelpPVFdoTFdXODlDaTB0TFMwdFJVNUVJRU5GClVsUkpSa2xE
-UVZSRkxTMHRMUzBLCi0te2JvdW5kYXJ5fS0tCg==
\ No newline at end of file
diff --git a/wifi/tests/assets/hsr1/HSR1ProfileWithCACert.conf b/wifi/tests/assets/hsr1/HSR1ProfileWithCACert.conf
deleted file mode 100644
index 5b4e4cb..0000000
--- a/wifi/tests/assets/hsr1/HSR1ProfileWithCACert.conf
+++ /dev/null
@@ -1,74 +0,0 @@
-MIME-Version: 1.0
-Content-Type: multipart/mixed; boundary={boundary}; charset=UTF-8
-Content-Transfer-Encoding: base64
-
---{boundary}
-Content-Type: application/x-passpoint-profile; charset=UTF-8
-Content-Transfer-Encoding: base64
-
-PE1nbXRUcmVlIHhtbG5zPSJzeW5jbWw6ZG1kZGYxLjIiPgogIDxWZXJEVEQ+MS4yPC9WZXJEVEQ+
-CiAgPE5vZGU+CiAgICA8Tm9kZU5hbWU+UGVyUHJvdmlkZXJTdWJzY3JpcHRpb248L05vZGVOYW1l
-PgogICAgPFJUUHJvcGVydGllcz4KICAgICAgPFR5cGU+CiAgICAgICAgPERERk5hbWU+dXJuOndm
-YTptbzpob3RzcG90MmRvdDAtcGVycHJvdmlkZXJzdWJzY3JpcHRpb246MS4wPC9EREZOYW1lPgog
-ICAgICA8L1R5cGU+CiAgICA8L1JUUHJvcGVydGllcz4KICAgIDxOb2RlPgogICAgICA8Tm9kZU5h
-bWU+aTAwMTwvTm9kZU5hbWU+CiAgICAgIDxOb2RlPgogICAgICAgIDxOb2RlTmFtZT5Ib21lU1A8
-L05vZGVOYW1lPgogICAgICAgIDxOb2RlPgogICAgICAgICAgPE5vZGVOYW1lPkZyaWVuZGx5TmFt
-ZTwvTm9kZU5hbWU+CiAgICAgICAgICA8VmFsdWU+RXhhbXBsZSBOZXR3b3JrPC9WYWx1ZT4KICAg
-ICAgICA8L05vZGU+CiAgICAgICAgPE5vZGU+CiAgICAgICAgICA8Tm9kZU5hbWU+RlFETjwvTm9k
-ZU5hbWU+CiAgICAgICAgICA8VmFsdWU+aG90c3BvdC5leGFtcGxlLm5ldDwvVmFsdWU+CiAgICAg
-ICAgPC9Ob2RlPgogICAgICAgIDxOb2RlPgogICAgICAgICAgPE5vZGVOYW1lPlJvYW1pbmdDb25z
-b3J0aXVtT0k8L05vZGVOYW1lPgogICAgICAgICAgPFZhbHVlPjExMjIzMyw0NDU1NjY8L1ZhbHVl
-PgogICAgICAgIDwvTm9kZT4KICAgICAgPC9Ob2RlPgogICAgICA8Tm9kZT4KICAgICAgICA8Tm9k
-ZU5hbWU+Q3JlZGVudGlhbDwvTm9kZU5hbWU+CiAgICAgICAgPE5vZGU+CiAgICAgICAgICA8Tm9k
-ZU5hbWU+UmVhbG08L05vZGVOYW1lPgogICAgICAgICAgPFZhbHVlPmV4YW1wbGUuY29tPC9WYWx1
-ZT4KICAgICAgICA8L05vZGU+CiAgICAgICAgPE5vZGU+CiAgICAgICAgICA8Tm9kZU5hbWU+VXNl
-cm5hbWVQYXNzd29yZDwvTm9kZU5hbWU+CiAgICAgICAgICA8Tm9kZT4KICAgICAgICAgICAgPE5v
-ZGVOYW1lPlVzZXJuYW1lPC9Ob2RlTmFtZT4KICAgICAgICAgICAgPFZhbHVlPnVzZXI8L1ZhbHVl
-PgogICAgICAgICAgPC9Ob2RlPgogICAgICAgICAgPE5vZGU+CiAgICAgICAgICAgIDxOb2RlTmFt
-ZT5QYXNzd29yZDwvTm9kZU5hbWU+CiAgICAgICAgICAgIDxWYWx1ZT5jR0Z6YzNkdmNtUT08L1Zh
-bHVlPgogICAgICAgICAgPC9Ob2RlPgogICAgICAgICAgPE5vZGU+CiAgICAgICAgICAgIDxOb2Rl
-TmFtZT5FQVBNZXRob2Q8L05vZGVOYW1lPgogICAgICAgICAgICA8Tm9kZT4KICAgICAgICAgICAg
-ICA8Tm9kZU5hbWU+RUFQVHlwZTwvTm9kZU5hbWU+CiAgICAgICAgICAgICAgPFZhbHVlPjIxPC9W
-YWx1ZT4KICAgICAgICAgICAgPC9Ob2RlPgogICAgICAgICAgICA8Tm9kZT4KICAgICAgICAgICAg
-ICA8Tm9kZU5hbWU+SW5uZXJNZXRob2Q8L05vZGVOYW1lPgogICAgICAgICAgICAgIDxWYWx1ZT5N
-Uy1DSEFQLVYyPC9WYWx1ZT4KICAgICAgICAgICAgPC9Ob2RlPgogICAgICAgICAgPC9Ob2RlPgog
-ICAgICAgIDwvTm9kZT4KICAgICAgICA8Tm9kZT4KICAgICAgICAgIDxOb2RlTmFtZT5EaWdpdGFs
-Q2VydGlmaWNhdGU8L05vZGVOYW1lPgogICAgICAgICAgPE5vZGU+CiAgICAgICAgICAgIDxOb2Rl
-TmFtZT5DZXJ0aWZpY2F0ZVR5cGU8L05vZGVOYW1lPgogICAgICAgICAgICA8VmFsdWU+eDUwOXYz
-PC9WYWx1ZT4KICAgICAgICAgIDwvTm9kZT4KICAgICAgICAgIDxOb2RlPgogICAgICAgICAgICA8
-Tm9kZU5hbWU+Q2VydFNIQTI1NkZpbmdlcnByaW50PC9Ob2RlTmFtZT4KICAgICAgICAgICAgPFZh
-bHVlPjFmMWYxZjFmMWYxZjFmMWYxZjFmMWYxZjFmMWYxZjFmMWYxZjFmMWYxZjFmMWYxZjFmMWYx
-ZjFmMWYxZjFmMWY8L1ZhbHVlPgogICAgICAgICAgPC9Ob2RlPgogICAgICAgIDwvTm9kZT4KICAg
-ICAgICA8Tm9kZT4KICAgICAgICAgIDxOb2RlTmFtZT5TSU08L05vZGVOYW1lPgogICAgICAgICAg
-PE5vZGU+CiAgICAgICAgICAgIDxOb2RlTmFtZT5JTVNJPC9Ob2RlTmFtZT4KICAgICAgICAgICAg
-PFZhbHVlPjEyMzQ1Nio8L1ZhbHVlPgogICAgICAgICAgPC9Ob2RlPgogICAgICAgICAgPE5vZGU+
-CiAgICAgICAgICAgIDxOb2RlTmFtZT5FQVBUeXBlPC9Ob2RlTmFtZT4KICAgICAgICAgICAgPFZh
-bHVlPjIzPC9WYWx1ZT4KICAgICAgICAgIDwvTm9kZT4KICAgICAgICA8L05vZGU+CiAgICAgIDwv
-Tm9kZT4KICAgIDwvTm9kZT4KICA8L05vZGU+CjwvTWdtdFRyZWU+
-
---{boundary}
-Content-Type: application/x-x509-ca-cert
-Content-Transfer-Encoding: base64
-
-LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURLRENDQWhDZ0F3SUJBZ0lKQUlMbEZkd3pM
-VnVyTUEwR0NTcUdTSWIzRFFFQkN3VUFNQkl4RURBT0JnTlYKQkFNVEIwVkJVQ0JEUVRFd0hoY05N
-VFl3TVRFeU1URTFNREUxV2hjTk1qWXdNVEE1TVRFMU1ERTFXakFTTVJBdwpEZ1lEVlFRREV3ZEZR
-VkFnUTBFeE1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBCnpuQVBV
-ejI2TXNhZTR3czQzY3pSNDEvSjJRdHJTSVpVS21WVXNWdW1EYllIclBOdlRYS1NNWEFjZXdPUkRR
-WVgKUnF2SHZwbjhDc2NCMStvR1hadkh3eGo0elYwV0tvSzJ6ZVhrYXUzdmN5bDNISUt1cEpmcTJU
-RUFDZWZWamowdApKVytYMzVQR1dwOS9INXpJVU5WTlZqUzdVbXM4NEl2S2hSQjg1MTJQQjlVeUhh
-Z1hZVlg1R1dwQWNWcHlmcmxSCkZJOVFkaGgrUGJrMHV5a3RkYmYvQ2RmZ0hPb2ViclR0d1Jsak0w
-b0R0WCsyQ3Y2ajB3Qks3aEQ4cFB2ZjErdXkKR3pjemlnQVUvNEt3N2VacXlkZjlCKzVSdXBSK0la
-aXBYNDF4RWlJcktSd3FpNTE3V1d6WGNqYUcyY05iZjQ1MQp4cEg1UG5WM2kxdHEwNGpNR1FVekZ3
-SURBUUFCbzRHQU1INHdIUVlEVlIwT0JCWUVGSXdYNHZzOEJpQmNTY29kCjVub1pIUk04RTQraU1F
-SUdBMVVkSXdRN01EbUFGSXdYNHZzOEJpQmNTY29kNW5vWkhSTThFNCtpb1Jha0ZEQVMKTVJBd0Rn
-WURWUVFERXdkRlFWQWdRMEV4Z2drQWd1VVYzRE10VzZzd0RBWURWUjBUQkFVd0F3RUIvekFMQmdO
-VgpIUThFQkFNQ0FRWXdEUVlKS29aSWh2Y05BUUVMQlFBRGdnRUJBRmZRcU9UQTdSdjdLK2x1UTdw
-bmFzNEJZd0hFCjlHRVAvdW9odjZLT3kwVEdRRmJyUlRqRm9MVk5COUJaMXltTURaMC9USXdJVWM3
-d2k3YTh0NW1FcVlIMTUzd1cKYVdvb2lTanlMTGh1STRzTnJOQ090aXNkQnEycjJNRlh0NmgwbUFR
-WU9QdjhSOEs3L2ZnU3hHRnF6aHlObW1WTAoxcUJKbGR4MzRTcHdzVEFMUVZQYjRoR3dKelpmcjFQ
-Y3BFUXg2eE1uVGw4eEVXWkUzTXM5OXVhVXhiUXFJd1J1CkxnQU9rTkNtWTJtODlWaHphSEoxdVY4
-NUFkTS90RCtZc21sbm5qdDlMUkNlamJCaXBqSUdqT1hyZzFKUCtseFYKbXVNNHZIK1AvbWxteHNQ
-UHowZDY1YitFR21KWnBvTGtPL3RkTk52Q1l6akpwVEVXcEVzTzZOTWhLWW89Ci0tLS0tRU5EIENF
-UlRJRklDQVRFLS0tLS0K
---{boundary}--
diff --git a/wifi/tests/assets/hsr1/HSR1ProfileWithInvalidContentType.base64 b/wifi/tests/assets/hsr1/HSR1ProfileWithInvalidContentType.base64
deleted file mode 100644
index 2775a9f..0000000
--- a/wifi/tests/assets/hsr1/HSR1ProfileWithInvalidContentType.base64
+++ /dev/null
@@ -1,86 +0,0 @@
-TUlNRS1WZXJzaW9uOiAxLjAKQ29udGVudC1UeXBlOiBtdWx0aXBhcnQvbWl4ZWQ7IGJvdW5kYXJ5
-PXtib3VuZGFyeX07IGNoYXJzZXQ9VVRGLTgKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogYmFz
-ZTY0CgotLXtib3VuZGFyeX0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9wYXNzcG9pbnQtcHJv
-ZmlsZTsgY2hhcnNldD1VVEYtOApDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiBiYXNlNjQKClBF
-MW5iWFJVY21WbElIaHRiRzV6UFNKemVXNWpiV3c2Wkcxa1pHWXhMaklpUGdvZ0lEeFdaWEpFVkVR
-K01TNHlQQzlXWlhKRVZFUSsKQ2lBZ1BFNXZaR1UrQ2lBZ0lDQThUbTlrWlU1aGJXVStVR1Z5VUhK
-dmRtbGtaWEpUZFdKelkzSnBjSFJwYjI0OEwwNXZaR1ZPWVcxbApQZ29nSUNBZ1BGSlVVSEp2Y0dW
-eWRHbGxjejRLSUNBZ0lDQWdQRlI1Y0dVK0NpQWdJQ0FnSUNBZ1BFUkVSazVoYldVK2RYSnVPbmRt
-CllUcHRienBvYjNSemNHOTBNbVJ2ZERBdGNHVnljSEp2ZG1sa1pYSnpkV0p6WTNKcGNIUnBiMjQ2
-TVM0d1BDOUVSRVpPWVcxbFBnb2cKSUNBZ0lDQThMMVI1Y0dVK0NpQWdJQ0E4TDFKVVVISnZjR1Z5
-ZEdsbGN6NEtJQ0FnSUR4T2IyUmxQZ29nSUNBZ0lDQThUbTlrWlU1aApiV1UrYVRBd01Ud3ZUbTlr
-WlU1aGJXVStDaUFnSUNBZ0lEeE9iMlJsUGdvZ0lDQWdJQ0FnSUR4T2IyUmxUbUZ0WlQ1SWIyMWxV
-MUE4CkwwNXZaR1ZPWVcxbFBnb2dJQ0FnSUNBZ0lEeE9iMlJsUGdvZ0lDQWdJQ0FnSUNBZ1BFNXZa
-R1ZPWVcxbFBrWnlhV1Z1Wkd4NVRtRnQKWlR3dlRtOWtaVTVoYldVK0NpQWdJQ0FnSUNBZ0lDQThW
-bUZzZFdVK1JYaGhiWEJzWlNCT1pYUjNiM0pyUEM5V1lXeDFaVDRLSUNBZwpJQ0FnSUNBOEwwNXZa
-R1UrQ2lBZ0lDQWdJQ0FnUEU1dlpHVStDaUFnSUNBZ0lDQWdJQ0E4VG05a1pVNWhiV1UrUmxGRVRq
-d3ZUbTlrClpVNWhiV1UrQ2lBZ0lDQWdJQ0FnSUNBOFZtRnNkV1UrYUc5MGMzQnZkQzVsZUdGdGNH
-eGxMbTVsZER3dlZtRnNkV1UrQ2lBZ0lDQWcKSUNBZ1BDOU9iMlJsUGdvZ0lDQWdJQ0FnSUR4T2Iy
-UmxQZ29nSUNBZ0lDQWdJQ0FnUEU1dlpHVk9ZVzFsUGxKdllXMXBibWREYjI1egpiM0owYVhWdFQw
-azhMMDV2WkdWT1lXMWxQZ29nSUNBZ0lDQWdJQ0FnUEZaaGJIVmxQakV4TWpJek15dzBORFUxTmpZ
-OEwxWmhiSFZsClBnb2dJQ0FnSUNBZ0lEd3ZUbTlrWlQ0S0lDQWdJQ0FnUEM5T2IyUmxQZ29nSUNB
-Z0lDQThUbTlrWlQ0S0lDQWdJQ0FnSUNBOFRtOWsKWlU1aGJXVStRM0psWkdWdWRHbGhiRHd2VG05
-a1pVNWhiV1UrQ2lBZ0lDQWdJQ0FnUEU1dlpHVStDaUFnSUNBZ0lDQWdJQ0E4VG05awpaVTVoYldV
-K1VtVmhiRzA4TDA1dlpHVk9ZVzFsUGdvZ0lDQWdJQ0FnSUNBZ1BGWmhiSFZsUG1WNFlXMXdiR1V1
-WTI5dFBDOVdZV3gxClpUNEtJQ0FnSUNBZ0lDQThMMDV2WkdVK0NpQWdJQ0FnSUNBZ1BFNXZaR1Ur
-Q2lBZ0lDQWdJQ0FnSUNBOFRtOWtaVTVoYldVK1ZYTmwKY201aGJXVlFZWE56ZDI5eVpEd3ZUbTlr
-WlU1aGJXVStDaUFnSUNBZ0lDQWdJQ0E4VG05a1pUNEtJQ0FnSUNBZ0lDQWdJQ0FnUEU1dgpaR1ZP
-WVcxbFBsVnpaWEp1WVcxbFBDOU9iMlJsVG1GdFpUNEtJQ0FnSUNBZ0lDQWdJQ0FnUEZaaGJIVmxQ
-blZ6WlhJOEwxWmhiSFZsClBnb2dJQ0FnSUNBZ0lDQWdQQzlPYjJSbFBnb2dJQ0FnSUNBZ0lDQWdQ
-RTV2WkdVK0NpQWdJQ0FnSUNBZ0lDQWdJRHhPYjJSbFRtRnQKWlQ1UVlYTnpkMjl5WkR3dlRtOWta
-VTVoYldVK0NpQWdJQ0FnSUNBZ0lDQWdJRHhXWVd4MVpUNWpSMFo2WXpOa2RtTnRVVDA4TDFaaApi
-SFZsUGdvZ0lDQWdJQ0FnSUNBZ1BDOU9iMlJsUGdvZ0lDQWdJQ0FnSUNBZ1BFNXZaR1UrQ2lBZ0lD
-QWdJQ0FnSUNBZ0lEeE9iMlJsClRtRnRaVDVGUVZCTlpYUm9iMlE4TDA1dlpHVk9ZVzFsUGdvZ0lD
-QWdJQ0FnSUNBZ0lDQThUbTlrWlQ0S0lDQWdJQ0FnSUNBZ0lDQWcKSUNBOFRtOWtaVTVoYldVK1JV
-RlFWSGx3WlR3dlRtOWtaVTVoYldVK0NpQWdJQ0FnSUNBZ0lDQWdJQ0FnUEZaaGJIVmxQakl4UEM5
-VwpZV3gxWlQ0S0lDQWdJQ0FnSUNBZ0lDQWdQQzlPYjJSbFBnb2dJQ0FnSUNBZ0lDQWdJQ0E4VG05
-a1pUNEtJQ0FnSUNBZ0lDQWdJQ0FnCklDQThUbTlrWlU1aGJXVStTVzV1WlhKTlpYUm9iMlE4TDA1
-dlpHVk9ZVzFsUGdvZ0lDQWdJQ0FnSUNBZ0lDQWdJRHhXWVd4MVpUNU4KVXkxRFNFRlFMVll5UEM5
-V1lXeDFaVDRLSUNBZ0lDQWdJQ0FnSUNBZ1BDOU9iMlJsUGdvZ0lDQWdJQ0FnSUNBZ1BDOU9iMlJs
-UGdvZwpJQ0FnSUNBZ0lEd3ZUbTlrWlQ0S0lDQWdJQ0FnSUNBOFRtOWtaVDRLSUNBZ0lDQWdJQ0Fn
-SUR4T2IyUmxUbUZ0WlQ1RWFXZHBkR0ZzClEyVnlkR2xtYVdOaGRHVThMMDV2WkdWT1lXMWxQZ29n
-SUNBZ0lDQWdJQ0FnUEU1dlpHVStDaUFnSUNBZ0lDQWdJQ0FnSUR4T2IyUmwKVG1GdFpUNURaWEow
-YVdacFkyRjBaVlI1Y0dVOEwwNXZaR1ZPWVcxbFBnb2dJQ0FnSUNBZ0lDQWdJQ0E4Vm1Gc2RXVStl
-RFV3T1hZegpQQzlXWVd4MVpUNEtJQ0FnSUNBZ0lDQWdJRHd2VG05a1pUNEtJQ0FnSUNBZ0lDQWdJ
-RHhPYjJSbFBnb2dJQ0FnSUNBZ0lDQWdJQ0E4ClRtOWtaVTVoYldVK1EyVnlkRk5JUVRJMU5rWnBi
-bWRsY25CeWFXNTBQQzlPYjJSbFRtRnRaVDRLSUNBZ0lDQWdJQ0FnSUNBZ1BGWmgKYkhWbFBqRm1N
-V1l4WmpGbU1XWXhaakZtTVdZeFpqRm1NV1l4WmpGbU1XWXhaakZtTVdZeFpqRm1NV1l4WmpGbU1X
-WXhaakZtTVdZeApaakZtTVdZeFpqRm1NV1k4TDFaaGJIVmxQZ29nSUNBZ0lDQWdJQ0FnUEM5T2Iy
-UmxQZ29nSUNBZ0lDQWdJRHd2VG05a1pUNEtJQ0FnCklDQWdJQ0E4VG05a1pUNEtJQ0FnSUNBZ0lD
-QWdJRHhPYjJSbFRtRnRaVDVUU1UwOEwwNXZaR1ZPWVcxbFBnb2dJQ0FnSUNBZ0lDQWcKUEU1dlpH
-VStDaUFnSUNBZ0lDQWdJQ0FnSUR4T2IyUmxUbUZ0WlQ1SlRWTkpQQzlPYjJSbFRtRnRaVDRLSUNB
-Z0lDQWdJQ0FnSUNBZwpQRlpoYkhWbFBqRXlNelExTmlvOEwxWmhiSFZsUGdvZ0lDQWdJQ0FnSUNB
-Z1BDOU9iMlJsUGdvZ0lDQWdJQ0FnSUNBZ1BFNXZaR1UrCkNpQWdJQ0FnSUNBZ0lDQWdJRHhPYjJS
-bFRtRnRaVDVGUVZCVWVYQmxQQzlPYjJSbFRtRnRaVDRLSUNBZ0lDQWdJQ0FnSUNBZ1BGWmgKYkhW
-bFBqSXpQQzlXWVd4MVpUNEtJQ0FnSUNBZ0lDQWdJRHd2VG05a1pUNEtJQ0FnSUNBZ0lDQThMMDV2
-WkdVK0NpQWdJQ0FnSUR3dgpUbTlrWlQ0S0lDQWdJRHd2VG05a1pUNEtJQ0E4TDA1dlpHVStDand2
-VFdkdGRGUnlaV1UrCgotLXtib3VuZGFyeX0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi94LXg1
-MDktY2EtY2VydApDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiBiYXNlNjQKCkxTMHRMUzFDUlVk
-SlRpQkRSVkpVU1VaSlEwRlVSUzB0TFMwdENrMUpTVVJMUkVORFFXaERaMEYzU1VKQlowbEtRVWxN
-YkVaa2QzcE0KVm5WeVRVRXdSME5UY1VkVFNXSXpSRkZGUWtOM1ZVRk5Ra2w0UlVSQlQwSm5UbFlL
-UWtGTlZFSXdWa0pWUTBKRVVWUkZkMGhvWTA1TgpWRmwzVFZSRmVVMVVSVEZOUkVVeFYyaGpUazFx
-V1hkTlZFRTFUVlJGTVUxRVJURlhha0ZUVFZKQmR3cEVaMWxFVmxGUlJFVjNaRVpSClZrRm5VVEJG
-ZUUxSlNVSkpha0ZPUW1kcmNXaHJhVWM1ZHpCQ1FWRkZSa0ZCVDBOQlVUaEJUVWxKUWtOblMwTkJV
-VVZCQ25wdVFWQlYKZWpJMlRYTmhaVFIzY3pRelkzcFNOREV2U2pKUmRISlRTVnBWUzIxV1ZYTldk
-VzFFWWxsSWNsQk9kbFJZUzFOTldFRmpaWGRQVWtSUgpXVmdLVW5GMlNIWndiamhEYzJOQ01TdHZS
-MWhhZGtoM2VHbzBlbFl3VjB0dlN6SjZaVmhyWVhVemRtTjViRE5JU1V0MWNFcG1jVEpVClJVRkRa
-V1pXYW1vd2RBcEtWeXRZTXpWUVIxZHdPUzlJTlhwSlZVNVdUbFpxVXpkVmJYTTRORWwyUzJoU1Fq
-ZzFNVEpRUWpsVmVVaGgKWjFoWlZsZzFSMWR3UVdOV2NIbG1jbXhTQ2taSk9WRmthR2dyVUdKck1I
-VjVhM1JrWW1ZdlEyUm1aMGhQYjJWaWNsUjBkMUpzYWswdwpiMFIwV0NzeVEzWTJhakIzUWtzM2FF
-UTRjRkIyWmpFcmRYa0tSM3BqZW1sblFWVXZORXQzTjJWYWNYbGtaamxDS3pWU2RYQlNLMGxhCmFY
-QllOREY0UldsSmNrdFNkM0ZwTlRFM1YxZDZXR05xWVVjeVkwNWlaalExTVFwNGNFZzFVRzVXTTJr
-eGRIRXdOR3BOUjFGVmVrWjMKU1VSQlVVRkNielJIUVUxSU5IZElVVmxFVmxJd1QwSkNXVVZHU1hk
-WU5IWnpPRUpwUW1OVFkyOWtDalZ1YjFwSVVrMDRSVFFyYVUxRgpTVWRCTVZWa1NYZFJOMDFFYlVG
-R1NYZFlOSFp6T0VKcFFtTlRZMjlrTlc1dldraFNUVGhGTkN0cGIxSmhhMFpFUVZNS1RWSkJkMFJu
-CldVUldVVkZFUlhka1JsRldRV2RSTUVWNFoyZHJRV2QxVlZZelJFMTBWelp6ZDBSQldVUldVakJV
-UWtGVmQwRjNSVUl2ZWtGTVFtZE8KVmdwSVVUaEZRa0ZOUTBGUldYZEVVVmxLUzI5YVNXaDJZMDVC
-VVVWTVFsRkJSR2RuUlVKQlJtWlJjVTlVUVRkU2RqZExLMngxVVRkdwpibUZ6TkVKWmQwaEZDamxI
-UlZBdmRXOW9kalpMVDNrd1ZFZFJSbUp5VWxScVJtOU1WazVDT1VKYU1YbHRUVVJhTUM5VVNYZEpW
-V00zCmQyazNZVGgwTlcxRmNWbElNVFV6ZDFjS1lWZHZiMmxUYW5sTVRHaDFTVFJ6VG5KT1EwOTBh
-WE5rUW5FeWNqSk5SbGgwTm1nd2JVRlIKV1U5UWRqaFNPRXMzTDJablUzaEhSbkY2YUhsT2JXMVdU
-QW94Y1VKS2JHUjRNelJUY0hkelZFRk1VVlpRWWpSb1IzZEtlbHBtY2pGUQpZM0JGVVhnMmVFMXVW
-R3c0ZUVWWFdrVXpUWE01T1hWaFZYaGlVWEZKZDFKMUNreG5RVTlyVGtOdFdUSnRPRGxXYUhwaFNF
-b3hkVlk0Ck5VRmtUUzkwUkN0WmMyMXNibTVxZERsTVVrTmxhbUpDYVhCcVNVZHFUMWh5WnpGS1VD
-dHNlRllLYlhWTk5IWklLMUF2Yld4dGVITlEKVUhvd1pEWTFZaXRGUjIxS1duQnZUR3RQTDNSa1Rr
-NTJRMWw2YWtwd1ZFVlhjRVZ6VHpaT1RXaExXVzg5Q2kwdExTMHRSVTVFSUVORgpVbFJKUmtsRFFW
-UkZMUzB0TFMwSwotLXtib3VuZGFyeX0tLQo=
\ No newline at end of file
diff --git a/wifi/tests/assets/hsr1/HSR1ProfileWithMissingBoundary.base64 b/wifi/tests/assets/hsr1/HSR1ProfileWithMissingBoundary.base64
deleted file mode 100644
index 7023453..0000000
--- a/wifi/tests/assets/hsr1/HSR1ProfileWithMissingBoundary.base64
+++ /dev/null
@@ -1,86 +0,0 @@
-TUlNRS1WZXJzaW9uOiAxLjAKQ29udGVudC1UeXBlOiBtdWx0aXBhcnQvbWl4ZWQ7IGJvdW5kYXJ5
-PXtib3VuZGFyeX07IGNoYXJzZXQ9VVRGLTgKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogYmFz
-ZTY0CgotLXtib3VuZGFyeX0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi94LXBhc3Nwb2ludC1w
-cm9maWxlOyBjaGFyc2V0PVVURi04CkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IGJhc2U2NAoK
-UEUxbmJYUlVjbVZsSUhodGJHNXpQU0p6ZVc1amJXdzZaRzFrWkdZeExqSWlQZ29nSUR4V1pYSkVW
-RVErTVM0eVBDOVdaWEpFVkVRKwpDaUFnUEU1dlpHVStDaUFnSUNBOFRtOWtaVTVoYldVK1VHVnlV
-SEp2ZG1sa1pYSlRkV0p6WTNKcGNIUnBiMjQ4TDA1dlpHVk9ZVzFsClBnb2dJQ0FnUEZKVVVISnZj
-R1Z5ZEdsbGN6NEtJQ0FnSUNBZ1BGUjVjR1UrQ2lBZ0lDQWdJQ0FnUEVSRVJrNWhiV1UrZFhKdU9u
-ZG0KWVRwdGJ6cG9iM1J6Y0c5ME1tUnZkREF0Y0dWeWNISnZkbWxrWlhKemRXSnpZM0pwY0hScGIy
-NDZNUzR3UEM5RVJFWk9ZVzFsUGdvZwpJQ0FnSUNBOEwxUjVjR1UrQ2lBZ0lDQThMMUpVVUhKdmNH
-VnlkR2xsY3o0S0lDQWdJRHhPYjJSbFBnb2dJQ0FnSUNBOFRtOWtaVTVoCmJXVSthVEF3TVR3dlRt
-OWtaVTVoYldVK0NpQWdJQ0FnSUR4T2IyUmxQZ29nSUNBZ0lDQWdJRHhPYjJSbFRtRnRaVDVJYjIx
-bFUxQTgKTDA1dlpHVk9ZVzFsUGdvZ0lDQWdJQ0FnSUR4T2IyUmxQZ29nSUNBZ0lDQWdJQ0FnUEU1
-dlpHVk9ZVzFsUGtaeWFXVnVaR3g1VG1GdApaVHd2VG05a1pVNWhiV1UrQ2lBZ0lDQWdJQ0FnSUNB
-OFZtRnNkV1UrUlhoaGJYQnNaU0JPWlhSM2IzSnJQQzlXWVd4MVpUNEtJQ0FnCklDQWdJQ0E4TDA1
-dlpHVStDaUFnSUNBZ0lDQWdQRTV2WkdVK0NpQWdJQ0FnSUNBZ0lDQThUbTlrWlU1aGJXVStSbEZF
-VGp3dlRtOWsKWlU1aGJXVStDaUFnSUNBZ0lDQWdJQ0E4Vm1Gc2RXVSthRzkwYzNCdmRDNWxlR0Z0
-Y0d4bExtNWxkRHd2Vm1Gc2RXVStDaUFnSUNBZwpJQ0FnUEM5T2IyUmxQZ29nSUNBZ0lDQWdJRHhP
-YjJSbFBnb2dJQ0FnSUNBZ0lDQWdQRTV2WkdWT1lXMWxQbEp2WVcxcGJtZERiMjV6CmIzSjBhWFZ0
-VDBrOEwwNXZaR1ZPWVcxbFBnb2dJQ0FnSUNBZ0lDQWdQRlpoYkhWbFBqRXhNakl6TXl3ME5EVTFO
-alk4TDFaaGJIVmwKUGdvZ0lDQWdJQ0FnSUR3dlRtOWtaVDRLSUNBZ0lDQWdQQzlPYjJSbFBnb2dJ
-Q0FnSUNBOFRtOWtaVDRLSUNBZ0lDQWdJQ0E4VG05awpaVTVoYldVK1EzSmxaR1Z1ZEdsaGJEd3ZU
-bTlrWlU1aGJXVStDaUFnSUNBZ0lDQWdQRTV2WkdVK0NpQWdJQ0FnSUNBZ0lDQThUbTlrClpVNWhi
-V1UrVW1WaGJHMDhMMDV2WkdWT1lXMWxQZ29nSUNBZ0lDQWdJQ0FnUEZaaGJIVmxQbVY0WVcxd2JH
-VXVZMjl0UEM5V1lXeDEKWlQ0S0lDQWdJQ0FnSUNBOEwwNXZaR1UrQ2lBZ0lDQWdJQ0FnUEU1dlpH
-VStDaUFnSUNBZ0lDQWdJQ0E4VG05a1pVNWhiV1UrVlhObApjbTVoYldWUVlYTnpkMjl5WkR3dlRt
-OWtaVTVoYldVK0NpQWdJQ0FnSUNBZ0lDQThUbTlrWlQ0S0lDQWdJQ0FnSUNBZ0lDQWdQRTV2ClpH
-Vk9ZVzFsUGxWelpYSnVZVzFsUEM5T2IyUmxUbUZ0WlQ0S0lDQWdJQ0FnSUNBZ0lDQWdQRlpoYkhW
-bFBuVnpaWEk4TDFaaGJIVmwKUGdvZ0lDQWdJQ0FnSUNBZ1BDOU9iMlJsUGdvZ0lDQWdJQ0FnSUNB
-Z1BFNXZaR1UrQ2lBZ0lDQWdJQ0FnSUNBZ0lEeE9iMlJsVG1GdApaVDVRWVhOemQyOXlaRHd2VG05
-a1pVNWhiV1UrQ2lBZ0lDQWdJQ0FnSUNBZ0lEeFdZV3gxWlQ1alIwWjZZek5rZG1OdFVUMDhMMVpo
-CmJIVmxQZ29nSUNBZ0lDQWdJQ0FnUEM5T2IyUmxQZ29nSUNBZ0lDQWdJQ0FnUEU1dlpHVStDaUFn
-SUNBZ0lDQWdJQ0FnSUR4T2IyUmwKVG1GdFpUNUZRVkJOWlhSb2IyUThMMDV2WkdWT1lXMWxQZ29n
-SUNBZ0lDQWdJQ0FnSUNBOFRtOWtaVDRLSUNBZ0lDQWdJQ0FnSUNBZwpJQ0E4VG05a1pVNWhiV1Ur
-UlVGUVZIbHdaVHd2VG05a1pVNWhiV1UrQ2lBZ0lDQWdJQ0FnSUNBZ0lDQWdQRlpoYkhWbFBqSXhQ
-QzlXCllXeDFaVDRLSUNBZ0lDQWdJQ0FnSUNBZ1BDOU9iMlJsUGdvZ0lDQWdJQ0FnSUNBZ0lDQThU
-bTlrWlQ0S0lDQWdJQ0FnSUNBZ0lDQWcKSUNBOFRtOWtaVTVoYldVK1NXNXVaWEpOWlhSb2IyUThM
-MDV2WkdWT1lXMWxQZ29nSUNBZ0lDQWdJQ0FnSUNBZ0lEeFdZV3gxWlQ1TgpVeTFEU0VGUUxWWXlQ
-QzlXWVd4MVpUNEtJQ0FnSUNBZ0lDQWdJQ0FnUEM5T2IyUmxQZ29nSUNBZ0lDQWdJQ0FnUEM5T2Iy
-UmxQZ29nCklDQWdJQ0FnSUR3dlRtOWtaVDRLSUNBZ0lDQWdJQ0E4VG05a1pUNEtJQ0FnSUNBZ0lD
-QWdJRHhPYjJSbFRtRnRaVDVFYVdkcGRHRnMKUTJWeWRHbG1hV05oZEdVOEwwNXZaR1ZPWVcxbFBn
-b2dJQ0FnSUNBZ0lDQWdQRTV2WkdVK0NpQWdJQ0FnSUNBZ0lDQWdJRHhPYjJSbApUbUZ0WlQ1RFpY
-SjBhV1pwWTJGMFpWUjVjR1U4TDA1dlpHVk9ZVzFsUGdvZ0lDQWdJQ0FnSUNBZ0lDQThWbUZzZFdV
-K2VEVXdPWFl6ClBDOVdZV3gxWlQ0S0lDQWdJQ0FnSUNBZ0lEd3ZUbTlrWlQ0S0lDQWdJQ0FnSUNB
-Z0lEeE9iMlJsUGdvZ0lDQWdJQ0FnSUNBZ0lDQTgKVG05a1pVNWhiV1UrUTJWeWRGTklRVEkxTmta
-cGJtZGxjbkJ5YVc1MFBDOU9iMlJsVG1GdFpUNEtJQ0FnSUNBZ0lDQWdJQ0FnUEZaaApiSFZsUGpG
-bU1XWXhaakZtTVdZeFpqRm1NV1l4WmpGbU1XWXhaakZtTVdZeFpqRm1NV1l4WmpGbU1XWXhaakZt
-TVdZeFpqRm1NV1l4ClpqRm1NV1l4WmpGbU1XWThMMVpoYkhWbFBnb2dJQ0FnSUNBZ0lDQWdQQzlP
-YjJSbFBnb2dJQ0FnSUNBZ0lEd3ZUbTlrWlQ0S0lDQWcKSUNBZ0lDQThUbTlrWlQ0S0lDQWdJQ0Fn
-SUNBZ0lEeE9iMlJsVG1GdFpUNVRTVTA4TDA1dlpHVk9ZVzFsUGdvZ0lDQWdJQ0FnSUNBZwpQRTV2
-WkdVK0NpQWdJQ0FnSUNBZ0lDQWdJRHhPYjJSbFRtRnRaVDVKVFZOSlBDOU9iMlJsVG1GdFpUNEtJ
-Q0FnSUNBZ0lDQWdJQ0FnClBGWmhiSFZsUGpFeU16UTFOaW84TDFaaGJIVmxQZ29nSUNBZ0lDQWdJ
-Q0FnUEM5T2IyUmxQZ29nSUNBZ0lDQWdJQ0FnUEU1dlpHVSsKQ2lBZ0lDQWdJQ0FnSUNBZ0lEeE9i
-MlJsVG1GdFpUNUZRVkJVZVhCbFBDOU9iMlJsVG1GdFpUNEtJQ0FnSUNBZ0lDQWdJQ0FnUEZaaApi
-SFZsUGpJelBDOVdZV3gxWlQ0S0lDQWdJQ0FnSUNBZ0lEd3ZUbTlrWlQ0S0lDQWdJQ0FnSUNBOEww
-NXZaR1UrQ2lBZ0lDQWdJRHd2ClRtOWtaVDRLSUNBZ0lEd3ZUbTlrWlQ0S0lDQThMMDV2WkdVK0Nq
-d3ZUV2R0ZEZSeVpXVSsKCi0te2JvdW5kYXJ5fQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL3gt
-eDUwOS1jYS1jZXJ0CkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IGJhc2U2NAoKTFMwdExTMUNS
-VWRKVGlCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2sxSlNVUkxSRU5EUVdoRFowRjNTVUpCWjBsS1FV
-bE1iRVprZDNwTQpWblZ5VFVFd1IwTlRjVWRUU1dJelJGRkZRa04zVlVGTlFrbDRSVVJCVDBKblRs
-WUtRa0ZOVkVJd1ZrSlZRMEpFVVZSRmQwaG9ZMDVOClZGbDNUVlJGZVUxVVJURk5SRVV4VjJoalRr
-MXFXWGROVkVFMVRWUkZNVTFFUlRGWGFrRlRUVkpCZHdwRVoxbEVWbEZSUkVWM1pFWlIKVmtGblVU
-QkZlRTFKU1VKSmFrRk9RbWRyY1docmFVYzVkekJDUVZGRlJrRkJUME5CVVRoQlRVbEpRa05uUzBO
-QlVVVkJDbnB1UVZCVgplakkyVFhOaFpUUjNjelF6WTNwU05ERXZTakpSZEhKVFNWcFZTMjFXVlhO
-V2RXMUVZbGxJY2xCT2RsUllTMU5OV0VGalpYZFBVa1JSCldWZ0tVbkYyU0had2JqaERjMk5DTVN0
-dlIxaGFka2gzZUdvMGVsWXdWMHR2U3pKNlpWaHJZWFV6ZG1ONWJETklTVXQxY0VwbWNUSlUKUlVG
-RFpXWldhbW93ZEFwS1Z5dFlNelZRUjFkd09TOUlOWHBKVlU1V1RsWnFVemRWYlhNNE5FbDJTMmhT
-UWpnMU1USlFRamxWZVVoaApaMWhaVmxnMVIxZHdRV05XY0hsbWNteFNDa1pKT1ZGa2FHZ3JVR0py
-TUhWNWEzUmtZbVl2UTJSbVowaFBiMlZpY2xSMGQxSnNhazB3CmIwUjBXQ3N5UTNZMmFqQjNRa3Mz
-YUVRNGNGQjJaakVyZFhrS1IzcGplbWxuUVZVdk5FdDNOMlZhY1hsa1pqbENLelZTZFhCU0swbGEK
-YVhCWU5ERjRSV2xKY2t0U2QzRnBOVEUzVjFkNldHTnFZVWN5WTA1aVpqUTFNUXA0Y0VnMVVHNVdN
-Mmt4ZEhFd05HcE5SMUZWZWtaMwpTVVJCVVVGQ2J6UkhRVTFJTkhkSVVWbEVWbEl3VDBKQ1dVVkdT
-WGRZTkhaek9FSnBRbU5UWTI5a0NqVnViMXBJVWswNFJUUXJhVTFGClNVZEJNVlZrU1hkUk4wMUVi
-VUZHU1hkWU5IWnpPRUpwUW1OVFkyOWtOVzV2V2toU1RUaEZOQ3RwYjFKaGEwWkVRVk1LVFZKQmQw
-Um4KV1VSV1VWRkVSWGRrUmxGV1FXZFJNRVY0WjJkclFXZDFWVll6UkUxMFZ6WnpkMFJCV1VSV1Vq
-QlVRa0ZWZDBGM1JVSXZla0ZNUW1kTwpWZ3BJVVRoRlFrRk5RMEZSV1hkRVVWbEtTMjlhU1doMlkw
-NUJVVVZNUWxGQlJHZG5SVUpCUm1aUmNVOVVRVGRTZGpkTEsyeDFVVGR3CmJtRnpORUpaZDBoRkNq
-bEhSVkF2ZFc5b2RqWkxUM2t3VkVkUlJtSnlVbFJxUm05TVZrNUNPVUphTVhsdFRVUmFNQzlVU1hk
-SlZXTTMKZDJrM1lUaDBOVzFGY1ZsSU1UVXpkMWNLWVZkdmIybFRhbmxNVEdoMVNUUnpUbkpPUTA5
-MGFYTmtRbkV5Y2pKTlJsaDBObWd3YlVGUgpXVTlRZGpoU09FczNMMlpuVTNoSFJuRjZhSGxPYlcx
-V1RBb3hjVUpLYkdSNE16UlRjSGR6VkVGTVVWWlFZalJvUjNkS2VscG1jakZRClkzQkZVWGcyZUUx
-dVZHdzRlRVZYV2tVelRYTTVPWFZoVlhoaVVYRkpkMUoxQ2t4blFVOXJUa050V1RKdE9EbFdhSHBo
-U0VveGRWWTQKTlVGa1RTOTBSQ3RaYzIxc2JtNXFkRGxNVWtObGFtSkNhWEJxU1VkcVQxaHlaekZL
-VUN0c2VGWUtiWFZOTkhaSUsxQXZiV3h0ZUhOUQpVSG93WkRZMVlpdEZSMjFLV25CdlRHdFBMM1Jr
-VGs1MlExbDZha3B3VkVWWGNFVnpUelpPVFdoTFdXODlDaTB0TFMwdFJVNUVJRU5GClVsUkpSa2xE
-UVZSRkxTMHRMUzBLCg==
\ No newline at end of file
diff --git a/wifi/tests/assets/hsr1/HSR1ProfileWithNonBase64Part.base64 b/wifi/tests/assets/hsr1/HSR1ProfileWithNonBase64Part.base64
deleted file mode 100644
index 5c23f61..0000000
--- a/wifi/tests/assets/hsr1/HSR1ProfileWithNonBase64Part.base64
+++ /dev/null
@@ -1,86 +0,0 @@
-TUlNRS1WZXJzaW9uOiAxLjAKQ29udGVudC1UeXBlOiBtdWx0aXBhcnQvbWl4ZWQ7IGJvdW5kYXJ5
-PXtib3VuZGFyeX07IGNoYXJzZXQ9VVRGLTgKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogOGJp
-dAoKLS17Ym91bmRhcnl9CkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24veC1wYXNzcG9pbnQtcHJv
-ZmlsZTsgY2hhcnNldD1VVEYtOApDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiBiYXNlNjQKClBF
-MW5iWFJVY21WbElIaHRiRzV6UFNKemVXNWpiV3c2Wkcxa1pHWXhMaklpUGdvZ0lEeFdaWEpFVkVR
-K01TNHlQQzlXWlhKRVZFUSsKQ2lBZ1BFNXZaR1UrQ2lBZ0lDQThUbTlrWlU1aGJXVStVR1Z5VUhK
-dmRtbGtaWEpUZFdKelkzSnBjSFJwYjI0OEwwNXZaR1ZPWVcxbApQZ29nSUNBZ1BGSlVVSEp2Y0dW
-eWRHbGxjejRLSUNBZ0lDQWdQRlI1Y0dVK0NpQWdJQ0FnSUNBZ1BFUkVSazVoYldVK2RYSnVPbmRt
-CllUcHRienBvYjNSemNHOTBNbVJ2ZERBdGNHVnljSEp2ZG1sa1pYSnpkV0p6WTNKcGNIUnBiMjQ2
-TVM0d1BDOUVSRVpPWVcxbFBnb2cKSUNBZ0lDQThMMVI1Y0dVK0NpQWdJQ0E4TDFKVVVISnZjR1Z5
-ZEdsbGN6NEtJQ0FnSUR4T2IyUmxQZ29nSUNBZ0lDQThUbTlrWlU1aApiV1UrYVRBd01Ud3ZUbTlr
-WlU1aGJXVStDaUFnSUNBZ0lEeE9iMlJsUGdvZ0lDQWdJQ0FnSUR4T2IyUmxUbUZ0WlQ1SWIyMWxV
-MUE4CkwwNXZaR1ZPWVcxbFBnb2dJQ0FnSUNBZ0lEeE9iMlJsUGdvZ0lDQWdJQ0FnSUNBZ1BFNXZa
-R1ZPWVcxbFBrWnlhV1Z1Wkd4NVRtRnQKWlR3dlRtOWtaVTVoYldVK0NpQWdJQ0FnSUNBZ0lDQThW
-bUZzZFdVK1JYaGhiWEJzWlNCT1pYUjNiM0pyUEM5V1lXeDFaVDRLSUNBZwpJQ0FnSUNBOEwwNXZa
-R1UrQ2lBZ0lDQWdJQ0FnUEU1dlpHVStDaUFnSUNBZ0lDQWdJQ0E4VG05a1pVNWhiV1UrUmxGRVRq
-d3ZUbTlrClpVNWhiV1UrQ2lBZ0lDQWdJQ0FnSUNBOFZtRnNkV1UrYUc5MGMzQnZkQzVsZUdGdGNH
-eGxMbTVsZER3dlZtRnNkV1UrQ2lBZ0lDQWcKSUNBZ1BDOU9iMlJsUGdvZ0lDQWdJQ0FnSUR4T2Iy
-UmxQZ29nSUNBZ0lDQWdJQ0FnUEU1dlpHVk9ZVzFsUGxKdllXMXBibWREYjI1egpiM0owYVhWdFQw
-azhMMDV2WkdWT1lXMWxQZ29nSUNBZ0lDQWdJQ0FnUEZaaGJIVmxQakV4TWpJek15dzBORFUxTmpZ
-OEwxWmhiSFZsClBnb2dJQ0FnSUNBZ0lEd3ZUbTlrWlQ0S0lDQWdJQ0FnUEM5T2IyUmxQZ29nSUNB
-Z0lDQThUbTlrWlQ0S0lDQWdJQ0FnSUNBOFRtOWsKWlU1aGJXVStRM0psWkdWdWRHbGhiRHd2VG05
-a1pVNWhiV1UrQ2lBZ0lDQWdJQ0FnUEU1dlpHVStDaUFnSUNBZ0lDQWdJQ0E4VG05awpaVTVoYldV
-K1VtVmhiRzA4TDA1dlpHVk9ZVzFsUGdvZ0lDQWdJQ0FnSUNBZ1BGWmhiSFZsUG1WNFlXMXdiR1V1
-WTI5dFBDOVdZV3gxClpUNEtJQ0FnSUNBZ0lDQThMMDV2WkdVK0NpQWdJQ0FnSUNBZ1BFNXZaR1Ur
-Q2lBZ0lDQWdJQ0FnSUNBOFRtOWtaVTVoYldVK1ZYTmwKY201aGJXVlFZWE56ZDI5eVpEd3ZUbTlr
-WlU1aGJXVStDaUFnSUNBZ0lDQWdJQ0E4VG05a1pUNEtJQ0FnSUNBZ0lDQWdJQ0FnUEU1dgpaR1ZP
-WVcxbFBsVnpaWEp1WVcxbFBDOU9iMlJsVG1GdFpUNEtJQ0FnSUNBZ0lDQWdJQ0FnUEZaaGJIVmxQ
-blZ6WlhJOEwxWmhiSFZsClBnb2dJQ0FnSUNBZ0lDQWdQQzlPYjJSbFBnb2dJQ0FnSUNBZ0lDQWdQ
-RTV2WkdVK0NpQWdJQ0FnSUNBZ0lDQWdJRHhPYjJSbFRtRnQKWlQ1UVlYTnpkMjl5WkR3dlRtOWta
-VTVoYldVK0NpQWdJQ0FnSUNBZ0lDQWdJRHhXWVd4MVpUNWpSMFo2WXpOa2RtTnRVVDA4TDFaaApi
-SFZsUGdvZ0lDQWdJQ0FnSUNBZ1BDOU9iMlJsUGdvZ0lDQWdJQ0FnSUNBZ1BFNXZaR1UrQ2lBZ0lD
-QWdJQ0FnSUNBZ0lEeE9iMlJsClRtRnRaVDVGUVZCTlpYUm9iMlE4TDA1dlpHVk9ZVzFsUGdvZ0lD
-QWdJQ0FnSUNBZ0lDQThUbTlrWlQ0S0lDQWdJQ0FnSUNBZ0lDQWcKSUNBOFRtOWtaVTVoYldVK1JV
-RlFWSGx3WlR3dlRtOWtaVTVoYldVK0NpQWdJQ0FnSUNBZ0lDQWdJQ0FnUEZaaGJIVmxQakl4UEM5
-VwpZV3gxWlQ0S0lDQWdJQ0FnSUNBZ0lDQWdQQzlPYjJSbFBnb2dJQ0FnSUNBZ0lDQWdJQ0E4VG05
-a1pUNEtJQ0FnSUNBZ0lDQWdJQ0FnCklDQThUbTlrWlU1aGJXVStTVzV1WlhKTlpYUm9iMlE4TDA1
-dlpHVk9ZVzFsUGdvZ0lDQWdJQ0FnSUNBZ0lDQWdJRHhXWVd4MVpUNU4KVXkxRFNFRlFMVll5UEM5
-V1lXeDFaVDRLSUNBZ0lDQWdJQ0FnSUNBZ1BDOU9iMlJsUGdvZ0lDQWdJQ0FnSUNBZ1BDOU9iMlJs
-UGdvZwpJQ0FnSUNBZ0lEd3ZUbTlrWlQ0S0lDQWdJQ0FnSUNBOFRtOWtaVDRLSUNBZ0lDQWdJQ0Fn
-SUR4T2IyUmxUbUZ0WlQ1RWFXZHBkR0ZzClEyVnlkR2xtYVdOaGRHVThMMDV2WkdWT1lXMWxQZ29n
-SUNBZ0lDQWdJQ0FnUEU1dlpHVStDaUFnSUNBZ0lDQWdJQ0FnSUR4T2IyUmwKVG1GdFpUNURaWEow
-YVdacFkyRjBaVlI1Y0dVOEwwNXZaR1ZPWVcxbFBnb2dJQ0FnSUNBZ0lDQWdJQ0E4Vm1Gc2RXVStl
-RFV3T1hZegpQQzlXWVd4MVpUNEtJQ0FnSUNBZ0lDQWdJRHd2VG05a1pUNEtJQ0FnSUNBZ0lDQWdJ
-RHhPYjJSbFBnb2dJQ0FnSUNBZ0lDQWdJQ0E4ClRtOWtaVTVoYldVK1EyVnlkRk5JUVRJMU5rWnBi
-bWRsY25CeWFXNTBQQzlPYjJSbFRtRnRaVDRLSUNBZ0lDQWdJQ0FnSUNBZ1BGWmgKYkhWbFBqRm1N
-V1l4WmpGbU1XWXhaakZtTVdZeFpqRm1NV1l4WmpGbU1XWXhaakZtTVdZeFpqRm1NV1l4WmpGbU1X
-WXhaakZtTVdZeApaakZtTVdZeFpqRm1NV1k4TDFaaGJIVmxQZ29nSUNBZ0lDQWdJQ0FnUEM5T2Iy
-UmxQZ29nSUNBZ0lDQWdJRHd2VG05a1pUNEtJQ0FnCklDQWdJQ0E4VG05a1pUNEtJQ0FnSUNBZ0lD
-QWdJRHhPYjJSbFRtRnRaVDVUU1UwOEwwNXZaR1ZPWVcxbFBnb2dJQ0FnSUNBZ0lDQWcKUEU1dlpH
-VStDaUFnSUNBZ0lDQWdJQ0FnSUR4T2IyUmxUbUZ0WlQ1SlRWTkpQQzlPYjJSbFRtRnRaVDRLSUNB
-Z0lDQWdJQ0FnSUNBZwpQRlpoYkhWbFBqRXlNelExTmlvOEwxWmhiSFZsUGdvZ0lDQWdJQ0FnSUNB
-Z1BDOU9iMlJsUGdvZ0lDQWdJQ0FnSUNBZ1BFNXZaR1UrCkNpQWdJQ0FnSUNBZ0lDQWdJRHhPYjJS
-bFRtRnRaVDVGUVZCVWVYQmxQQzlPYjJSbFRtRnRaVDRLSUNBZ0lDQWdJQ0FnSUNBZ1BGWmgKYkhW
-bFBqSXpQQzlXWVd4MVpUNEtJQ0FnSUNBZ0lDQWdJRHd2VG05a1pUNEtJQ0FnSUNBZ0lDQThMMDV2
-WkdVK0NpQWdJQ0FnSUR3dgpUbTlrWlQ0S0lDQWdJRHd2VG05a1pUNEtJQ0E4TDA1dlpHVStDand2
-VFdkdGRGUnlaV1UrCgotLXtib3VuZGFyeX0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi94LXg1
-MDktY2EtY2VydApDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiBiYXNlNjQKCkxTMHRMUzFDUlVk
-SlRpQkRSVkpVU1VaSlEwRlVSUzB0TFMwdENrMUpTVVJMUkVORFFXaERaMEYzU1VKQlowbEtRVWxN
-YkVaa2QzcE0KVm5WeVRVRXdSME5UY1VkVFNXSXpSRkZGUWtOM1ZVRk5Ra2w0UlVSQlQwSm5UbFlL
-UWtGTlZFSXdWa0pWUTBKRVVWUkZkMGhvWTA1TgpWRmwzVFZSRmVVMVVSVEZOUkVVeFYyaGpUazFx
-V1hkTlZFRTFUVlJGTVUxRVJURlhha0ZUVFZKQmR3cEVaMWxFVmxGUlJFVjNaRVpSClZrRm5VVEJG
-ZUUxSlNVSkpha0ZPUW1kcmNXaHJhVWM1ZHpCQ1FWRkZSa0ZCVDBOQlVUaEJUVWxKUWtOblMwTkJV
-VVZCQ25wdVFWQlYKZWpJMlRYTmhaVFIzY3pRelkzcFNOREV2U2pKUmRISlRTVnBWUzIxV1ZYTldk
-VzFFWWxsSWNsQk9kbFJZUzFOTldFRmpaWGRQVWtSUgpXVmdLVW5GMlNIWndiamhEYzJOQ01TdHZS
-MWhhZGtoM2VHbzBlbFl3VjB0dlN6SjZaVmhyWVhVemRtTjViRE5JU1V0MWNFcG1jVEpVClJVRkRa
-V1pXYW1vd2RBcEtWeXRZTXpWUVIxZHdPUzlJTlhwSlZVNVdUbFpxVXpkVmJYTTRORWwyUzJoU1Fq
-ZzFNVEpRUWpsVmVVaGgKWjFoWlZsZzFSMWR3UVdOV2NIbG1jbXhTQ2taSk9WRmthR2dyVUdKck1I
-VjVhM1JrWW1ZdlEyUm1aMGhQYjJWaWNsUjBkMUpzYWswdwpiMFIwV0NzeVEzWTJhakIzUWtzM2FF
-UTRjRkIyWmpFcmRYa0tSM3BqZW1sblFWVXZORXQzTjJWYWNYbGtaamxDS3pWU2RYQlNLMGxhCmFY
-QllOREY0UldsSmNrdFNkM0ZwTlRFM1YxZDZXR05xWVVjeVkwNWlaalExTVFwNGNFZzFVRzVXTTJr
-eGRIRXdOR3BOUjFGVmVrWjMKU1VSQlVVRkNielJIUVUxSU5IZElVVmxFVmxJd1QwSkNXVVZHU1hk
-WU5IWnpPRUpwUW1OVFkyOWtDalZ1YjFwSVVrMDRSVFFyYVUxRgpTVWRCTVZWa1NYZFJOMDFFYlVG
-R1NYZFlOSFp6T0VKcFFtTlRZMjlrTlc1dldraFNUVGhGTkN0cGIxSmhhMFpFUVZNS1RWSkJkMFJu
-CldVUldVVkZFUlhka1JsRldRV2RSTUVWNFoyZHJRV2QxVlZZelJFMTBWelp6ZDBSQldVUldVakJV
-UWtGVmQwRjNSVUl2ZWtGTVFtZE8KVmdwSVVUaEZRa0ZOUTBGUldYZEVVVmxLUzI5YVNXaDJZMDVC
-VVVWTVFsRkJSR2RuUlVKQlJtWlJjVTlVUVRkU2RqZExLMngxVVRkdwpibUZ6TkVKWmQwaEZDamxI
-UlZBdmRXOW9kalpMVDNrd1ZFZFJSbUp5VWxScVJtOU1WazVDT1VKYU1YbHRUVVJhTUM5VVNYZEpW
-V00zCmQyazNZVGgwTlcxRmNWbElNVFV6ZDFjS1lWZHZiMmxUYW5sTVRHaDFTVFJ6VG5KT1EwOTBh
-WE5rUW5FeWNqSk5SbGgwTm1nd2JVRlIKV1U5UWRqaFNPRXMzTDJablUzaEhSbkY2YUhsT2JXMVdU
-QW94Y1VKS2JHUjRNelJUY0hkelZFRk1VVlpRWWpSb1IzZEtlbHBtY2pGUQpZM0JGVVhnMmVFMXVW
-R3c0ZUVWWFdrVXpUWE01T1hWaFZYaGlVWEZKZDFKMUNreG5RVTlyVGtOdFdUSnRPRGxXYUhwaFNF
-b3hkVlk0Ck5VRmtUUzkwUkN0WmMyMXNibTVxZERsTVVrTmxhbUpDYVhCcVNVZHFUMWh5WnpGS1VD
-dHNlRllLYlhWTk5IWklLMUF2Yld4dGVITlEKVUhvd1pEWTFZaXRGUjIxS1duQnZUR3RQTDNSa1Rr
-NTJRMWw2YWtwd1ZFVlhjRVZ6VHpaT1RXaExXVzg5Q2kwdExTMHRSVTVFSUVORgpVbFJKUmtsRFFW
-UkZMUzB0TFMwSwotLXtib3VuZGFyeX0tLQo=
\ No newline at end of file
diff --git a/wifi/tests/assets/hsr1/HSR1ProfileWithUpdateIdentifier.base64 b/wifi/tests/assets/hsr1/HSR1ProfileWithUpdateIdentifier.base64
deleted file mode 100644
index bab7607..0000000
--- a/wifi/tests/assets/hsr1/HSR1ProfileWithUpdateIdentifier.base64
+++ /dev/null
@@ -1,88 +0,0 @@
-TUlNRS1WZXJzaW9uOiAxLjAKQ29udGVudC1UeXBlOiBtdWx0aXBhcnQvbWl4ZWQ7IGJvdW5kYXJ5
-PXtib3VuZGFyeX07IGNoYXJzZXQ9VVRGLTgKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogYmFz
-ZTY0CgotLXtib3VuZGFyeX0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi94LXBhc3Nwb2ludC1w
-cm9maWxlOyBjaGFyc2V0PVVURi04CkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IGJhc2U2NAoK
-UEUxbmJYUlVjbVZsSUhodGJHNXpQU0p6ZVc1amJXdzZaRzFrWkdZeExqSWlQZ29nSUR4V1pYSkVW
-RVErTVM0eVBDOVdaWEpFVkVRKwpDaUFnUEU1dlpHVStDaUFnSUNBOFRtOWtaVTVoYldVK1VHVnlV
-SEp2ZG1sa1pYSlRkV0p6WTNKcGNIUnBiMjQ4TDA1dlpHVk9ZVzFsClBnb2dJQ0FnUEZKVVVISnZj
-R1Z5ZEdsbGN6NEtJQ0FnSUNBZ1BGUjVjR1UrQ2lBZ0lDQWdJQ0FnUEVSRVJrNWhiV1UrZFhKdU9u
-ZG0KWVRwdGJ6cG9iM1J6Y0c5ME1tUnZkREF0Y0dWeWNISnZkbWxrWlhKemRXSnpZM0pwY0hScGIy
-NDZNUzR3UEM5RVJFWk9ZVzFsUGdvZwpJQ0FnSUNBOEwxUjVjR1UrQ2lBZ0lDQThMMUpVVUhKdmNH
-VnlkR2xsY3o0S0lDQWdJRHhPYjJSbFBnb2dJQ0FnSUNBOFRtOWtaVTVoCmJXVStWWEJrWVhSbFNX
-UmxiblJwWm1sbGNqd3ZUbTlrWlU1aGJXVStDaUFnSUNBZ0lEeFdZV3gxWlQ0eE1qTTBQQzlXWVd4
-MVpUNEsKSUNBZ0lEd3ZUbTlrWlQ0S0lDQWdJRHhPYjJSbFBnb2dJQ0FnSUNBOFRtOWtaVTVoYldV
-K2FUQXdNVHd2VG05a1pVNWhiV1UrQ2lBZwpJQ0FnSUR4T2IyUmxQZ29nSUNBZ0lDQWdJRHhPYjJS
-bFRtRnRaVDVJYjIxbFUxQThMMDV2WkdWT1lXMWxQZ29nSUNBZ0lDQWdJRHhPCmIyUmxQZ29nSUNB
-Z0lDQWdJQ0FnUEU1dlpHVk9ZVzFsUGtaeWFXVnVaR3g1VG1GdFpUd3ZUbTlrWlU1aGJXVStDaUFn
-SUNBZ0lDQWcKSUNBOFZtRnNkV1UrUlhoaGJYQnNaU0JPWlhSM2IzSnJQQzlXWVd4MVpUNEtJQ0Fn
-SUNBZ0lDQThMMDV2WkdVK0NpQWdJQ0FnSUNBZwpQRTV2WkdVK0NpQWdJQ0FnSUNBZ0lDQThUbTlr
-WlU1aGJXVStSbEZFVGp3dlRtOWtaVTVoYldVK0NpQWdJQ0FnSUNBZ0lDQThWbUZzCmRXVSthRzkw
-YzNCdmRDNWxlR0Z0Y0d4bExtNWxkRHd2Vm1Gc2RXVStDaUFnSUNBZ0lDQWdQQzlPYjJSbFBnb2dJ
-Q0FnSUNBZ0lEeE8KYjJSbFBnb2dJQ0FnSUNBZ0lDQWdQRTV2WkdWT1lXMWxQbEp2WVcxcGJtZERi
-MjV6YjNKMGFYVnRUMGs4TDA1dlpHVk9ZVzFsUGdvZwpJQ0FnSUNBZ0lDQWdQRlpoYkhWbFBqRXhN
-akl6TXl3ME5EVTFOalk4TDFaaGJIVmxQZ29nSUNBZ0lDQWdJRHd2VG05a1pUNEtJQ0FnCklDQWdQ
-QzlPYjJSbFBnb2dJQ0FnSUNBOFRtOWtaVDRLSUNBZ0lDQWdJQ0E4VG05a1pVNWhiV1UrUTNKbFpH
-VnVkR2xoYkR3dlRtOWsKWlU1aGJXVStDaUFnSUNBZ0lDQWdQRTV2WkdVK0NpQWdJQ0FnSUNBZ0lD
-QThUbTlrWlU1aGJXVStVbVZoYkcwOEwwNXZaR1ZPWVcxbApQZ29nSUNBZ0lDQWdJQ0FnUEZaaGJI
-VmxQbVY0WVcxd2JHVXVZMjl0UEM5V1lXeDFaVDRLSUNBZ0lDQWdJQ0E4TDA1dlpHVStDaUFnCklD
-QWdJQ0FnUEU1dlpHVStDaUFnSUNBZ0lDQWdJQ0E4VG05a1pVNWhiV1UrVlhObGNtNWhiV1ZRWVhO
-emQyOXlaRHd2VG05a1pVNWgKYldVK0NpQWdJQ0FnSUNBZ0lDQThUbTlrWlQ0S0lDQWdJQ0FnSUNB
-Z0lDQWdQRTV2WkdWT1lXMWxQbFZ6WlhKdVlXMWxQQzlPYjJSbApUbUZ0WlQ0S0lDQWdJQ0FnSUNB
-Z0lDQWdQRlpoYkhWbFBuVnpaWEk4TDFaaGJIVmxQZ29nSUNBZ0lDQWdJQ0FnUEM5T2IyUmxQZ29n
-CklDQWdJQ0FnSUNBZ1BFNXZaR1UrQ2lBZ0lDQWdJQ0FnSUNBZ0lEeE9iMlJsVG1GdFpUNVFZWE56
-ZDI5eVpEd3ZUbTlrWlU1aGJXVSsKQ2lBZ0lDQWdJQ0FnSUNBZ0lEeFdZV3gxWlQ1alIwWjZZek5r
-ZG1OdFVUMDhMMVpoYkhWbFBnb2dJQ0FnSUNBZ0lDQWdQQzlPYjJSbApQZ29nSUNBZ0lDQWdJQ0Fn
-UEU1dlpHVStDaUFnSUNBZ0lDQWdJQ0FnSUR4T2IyUmxUbUZ0WlQ1RlFWQk5aWFJvYjJROEwwNXZa
-R1ZPCllXMWxQZ29nSUNBZ0lDQWdJQ0FnSUNBOFRtOWtaVDRLSUNBZ0lDQWdJQ0FnSUNBZ0lDQThU
-bTlrWlU1aGJXVStSVUZRVkhsd1pUd3YKVG05a1pVNWhiV1UrQ2lBZ0lDQWdJQ0FnSUNBZ0lDQWdQ
-RlpoYkhWbFBqSXhQQzlXWVd4MVpUNEtJQ0FnSUNBZ0lDQWdJQ0FnUEM5TwpiMlJsUGdvZ0lDQWdJ
-Q0FnSUNBZ0lDQThUbTlrWlQ0S0lDQWdJQ0FnSUNBZ0lDQWdJQ0E4VG05a1pVNWhiV1UrU1c1dVpY
-Sk5aWFJvCmIyUThMMDV2WkdWT1lXMWxQZ29nSUNBZ0lDQWdJQ0FnSUNBZ0lEeFdZV3gxWlQ1TlV5
-MURTRUZRTFZZeVBDOVdZV3gxWlQ0S0lDQWcKSUNBZ0lDQWdJQ0FnUEM5T2IyUmxQZ29nSUNBZ0lD
-QWdJQ0FnUEM5T2IyUmxQZ29nSUNBZ0lDQWdJRHd2VG05a1pUNEtJQ0FnSUNBZwpJQ0E4VG05a1pU
-NEtJQ0FnSUNBZ0lDQWdJRHhPYjJSbFRtRnRaVDVFYVdkcGRHRnNRMlZ5ZEdsbWFXTmhkR1U4TDA1
-dlpHVk9ZVzFsClBnb2dJQ0FnSUNBZ0lDQWdQRTV2WkdVK0NpQWdJQ0FnSUNBZ0lDQWdJRHhPYjJS
-bFRtRnRaVDVEWlhKMGFXWnBZMkYwWlZSNWNHVTgKTDA1dlpHVk9ZVzFsUGdvZ0lDQWdJQ0FnSUNB
-Z0lDQThWbUZzZFdVK2VEVXdPWFl6UEM5V1lXeDFaVDRLSUNBZ0lDQWdJQ0FnSUR3dgpUbTlrWlQ0
-S0lDQWdJQ0FnSUNBZ0lEeE9iMlJsUGdvZ0lDQWdJQ0FnSUNBZ0lDQThUbTlrWlU1aGJXVStRMlZ5
-ZEZOSVFUSTFOa1pwCmJtZGxjbkJ5YVc1MFBDOU9iMlJsVG1GdFpUNEtJQ0FnSUNBZ0lDQWdJQ0Fn
-UEZaaGJIVmxQakZtTVdZeFpqRm1NV1l4WmpGbU1XWXgKWmpGbU1XWXhaakZtTVdZeFpqRm1NV1l4
-WmpGbU1XWXhaakZtTVdZeFpqRm1NV1l4WmpGbU1XWXhaakZtTVdZOEwxWmhiSFZsUGdvZwpJQ0Fn
-SUNBZ0lDQWdQQzlPYjJSbFBnb2dJQ0FnSUNBZ0lEd3ZUbTlrWlQ0S0lDQWdJQ0FnSUNBOFRtOWta
-VDRLSUNBZ0lDQWdJQ0FnCklEeE9iMlJsVG1GdFpUNVRTVTA4TDA1dlpHVk9ZVzFsUGdvZ0lDQWdJ
-Q0FnSUNBZ1BFNXZaR1UrQ2lBZ0lDQWdJQ0FnSUNBZ0lEeE8KYjJSbFRtRnRaVDVKVFZOSlBDOU9i
-MlJsVG1GdFpUNEtJQ0FnSUNBZ0lDQWdJQ0FnUEZaaGJIVmxQakV5TXpRMU5pbzhMMVpoYkhWbApQ
-Z29nSUNBZ0lDQWdJQ0FnUEM5T2IyUmxQZ29nSUNBZ0lDQWdJQ0FnUEU1dlpHVStDaUFnSUNBZ0lD
-QWdJQ0FnSUR4T2IyUmxUbUZ0ClpUNUZRVkJVZVhCbFBDOU9iMlJsVG1GdFpUNEtJQ0FnSUNBZ0lD
-QWdJQ0FnUEZaaGJIVmxQakl6UEM5V1lXeDFaVDRLSUNBZ0lDQWcKSUNBZ0lEd3ZUbTlrWlQ0S0lD
-QWdJQ0FnSUNBOEwwNXZaR1UrQ2lBZ0lDQWdJRHd2VG05a1pUNEtJQ0FnSUR3dlRtOWtaVDRLSUNB
-OApMMDV2WkdVK0Nqd3ZUV2R0ZEZSeVpXVSsKCi0te2JvdW5kYXJ5fQpDb250ZW50LVR5cGU6IGFw
-cGxpY2F0aW9uL3gteDUwOS1jYS1jZXJ0CkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IGJhc2U2
-NAoKTFMwdExTMUNSVWRKVGlCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2sxSlNVUkxSRU5EUVdoRFow
-RjNTVUpCWjBsS1FVbE1iRVprZDNwTQpWblZ5VFVFd1IwTlRjVWRUU1dJelJGRkZRa04zVlVGTlFr
-bDRSVVJCVDBKblRsWUtRa0ZOVkVJd1ZrSlZRMEpFVVZSRmQwaG9ZMDVOClZGbDNUVlJGZVUxVVJU
-Rk5SRVV4VjJoalRrMXFXWGROVkVFMVRWUkZNVTFFUlRGWGFrRlRUVkpCZHdwRVoxbEVWbEZSUkVW
-M1pFWlIKVmtGblVUQkZlRTFKU1VKSmFrRk9RbWRyY1docmFVYzVkekJDUVZGRlJrRkJUME5CVVRo
-QlRVbEpRa05uUzBOQlVVVkJDbnB1UVZCVgplakkyVFhOaFpUUjNjelF6WTNwU05ERXZTakpSZEhK
-VFNWcFZTMjFXVlhOV2RXMUVZbGxJY2xCT2RsUllTMU5OV0VGalpYZFBVa1JSCldWZ0tVbkYyU0ha
-d2JqaERjMk5DTVN0dlIxaGFka2gzZUdvMGVsWXdWMHR2U3pKNlpWaHJZWFV6ZG1ONWJETklTVXQx
-Y0VwbWNUSlUKUlVGRFpXWldhbW93ZEFwS1Z5dFlNelZRUjFkd09TOUlOWHBKVlU1V1RsWnFVemRW
-YlhNNE5FbDJTMmhTUWpnMU1USlFRamxWZVVoaApaMWhaVmxnMVIxZHdRV05XY0hsbWNteFNDa1pK
-T1ZGa2FHZ3JVR0pyTUhWNWEzUmtZbVl2UTJSbVowaFBiMlZpY2xSMGQxSnNhazB3CmIwUjBXQ3N5
-UTNZMmFqQjNRa3MzYUVRNGNGQjJaakVyZFhrS1IzcGplbWxuUVZVdk5FdDNOMlZhY1hsa1pqbENL
-elZTZFhCU0swbGEKYVhCWU5ERjRSV2xKY2t0U2QzRnBOVEUzVjFkNldHTnFZVWN5WTA1aVpqUTFN
-UXA0Y0VnMVVHNVdNMmt4ZEhFd05HcE5SMUZWZWtaMwpTVVJCVVVGQ2J6UkhRVTFJTkhkSVVWbEVW
-bEl3VDBKQ1dVVkdTWGRZTkhaek9FSnBRbU5UWTI5a0NqVnViMXBJVWswNFJUUXJhVTFGClNVZEJN
-VlZrU1hkUk4wMUViVUZHU1hkWU5IWnpPRUpwUW1OVFkyOWtOVzV2V2toU1RUaEZOQ3RwYjFKaGEw
-WkVRVk1LVFZKQmQwUm4KV1VSV1VWRkVSWGRrUmxGV1FXZFJNRVY0WjJkclFXZDFWVll6UkUxMFZ6
-WnpkMFJCV1VSV1VqQlVRa0ZWZDBGM1JVSXZla0ZNUW1kTwpWZ3BJVVRoRlFrRk5RMEZSV1hkRVVW
-bEtTMjlhU1doMlkwNUJVVVZNUWxGQlJHZG5SVUpCUm1aUmNVOVVRVGRTZGpkTEsyeDFVVGR3CmJt
-RnpORUpaZDBoRkNqbEhSVkF2ZFc5b2RqWkxUM2t3VkVkUlJtSnlVbFJxUm05TVZrNUNPVUphTVhs
-dFRVUmFNQzlVU1hkSlZXTTMKZDJrM1lUaDBOVzFGY1ZsSU1UVXpkMWNLWVZkdmIybFRhbmxNVEdo
-MVNUUnpUbkpPUTA5MGFYTmtRbkV5Y2pKTlJsaDBObWd3YlVGUgpXVTlRZGpoU09FczNMMlpuVTNo
-SFJuRjZhSGxPYlcxV1RBb3hjVUpLYkdSNE16UlRjSGR6VkVGTVVWWlFZalJvUjNkS2VscG1jakZR
-ClkzQkZVWGcyZUUxdVZHdzRlRVZYV2tVelRYTTVPWFZoVlhoaVVYRkpkMUoxQ2t4blFVOXJUa050
-V1RKdE9EbFdhSHBoU0VveGRWWTQKTlVGa1RTOTBSQ3RaYzIxc2JtNXFkRGxNVWtObGFtSkNhWEJx
-U1VkcVQxaHlaekZLVUN0c2VGWUtiWFZOTkhaSUsxQXZiV3h0ZUhOUQpVSG93WkRZMVlpdEZSMjFL
-V25CdlRHdFBMM1JrVGs1MlExbDZha3B3VkVWWGNFVnpUelpPVFdoTFdXODlDaTB0TFMwdFJVNUVJ
-RU5GClVsUkpSa2xEUVZSRkxTMHRMUzBLCi0te2JvdW5kYXJ5fS0tCg==
\ No newline at end of file
diff --git a/wifi/tests/assets/hsr1/HSR1ProfileWithoutProfile.base64 b/wifi/tests/assets/hsr1/HSR1ProfileWithoutProfile.base64
deleted file mode 100644
index 833c527..0000000
--- a/wifi/tests/assets/hsr1/HSR1ProfileWithoutProfile.base64
+++ /dev/null
@@ -1,31 +0,0 @@
-Q29udGVudC1UeXBlOiBtdWx0aXBhcnQvbWl4ZWQ7IGJvdW5kYXJ5PXtib3VuZGFyeX0KQ29udGVu
-dC1UcmFuc2Zlci1FbmNvZGluZzogYmFzZTY0CgotLXtib3VuZGFyeX0KQ29udGVudC1UeXBlOiBh
-cHBsaWNhdGlvbi94LXg1MDktY2EtY2VydApDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiBiYXNl
-NjQKCkxTMHRMUzFDUlVkSlRpQkRSVkpVU1VaSlEwRlVSUzB0TFMwdENrMUpTVVJMUkVORFFXaERa
-MEYzU1VKQlowbEtRVWxNYkVaa2QzcE0KVm5WeVRVRXdSME5UY1VkVFNXSXpSRkZGUWtOM1ZVRk5R
-a2w0UlVSQlQwSm5UbFlLUWtGTlZFSXdWa0pWUTBKRVVWUkZkMGhvWTA1TgpWRmwzVFZSRmVVMVVS
-VEZOUkVVeFYyaGpUazFxV1hkTlZFRTFUVlJGTVUxRVJURlhha0ZUVFZKQmR3cEVaMWxFVmxGUlJF
-VjNaRVpSClZrRm5VVEJGZUUxSlNVSkpha0ZPUW1kcmNXaHJhVWM1ZHpCQ1FWRkZSa0ZCVDBOQlVU
-aEJUVWxKUWtOblMwTkJVVVZCQ25wdVFWQlYKZWpJMlRYTmhaVFIzY3pRelkzcFNOREV2U2pKUmRI
-SlRTVnBWUzIxV1ZYTldkVzFFWWxsSWNsQk9kbFJZUzFOTldFRmpaWGRQVWtSUgpXVmdLVW5GMlNI
-WndiamhEYzJOQ01TdHZSMWhhZGtoM2VHbzBlbFl3VjB0dlN6SjZaVmhyWVhVemRtTjViRE5JU1V0
-MWNFcG1jVEpVClJVRkRaV1pXYW1vd2RBcEtWeXRZTXpWUVIxZHdPUzlJTlhwSlZVNVdUbFpxVXpk
-VmJYTTRORWwyUzJoU1FqZzFNVEpRUWpsVmVVaGgKWjFoWlZsZzFSMWR3UVdOV2NIbG1jbXhTQ2ta
-Sk9WRmthR2dyVUdKck1IVjVhM1JrWW1ZdlEyUm1aMGhQYjJWaWNsUjBkMUpzYWswdwpiMFIwV0Nz
-eVEzWTJhakIzUWtzM2FFUTRjRkIyWmpFcmRYa0tSM3BqZW1sblFWVXZORXQzTjJWYWNYbGtaamxD
-S3pWU2RYQlNLMGxhCmFYQllOREY0UldsSmNrdFNkM0ZwTlRFM1YxZDZXR05xWVVjeVkwNWlaalEx
-TVFwNGNFZzFVRzVXTTJreGRIRXdOR3BOUjFGVmVrWjMKU1VSQlVVRkNielJIUVUxSU5IZElVVmxF
-VmxJd1QwSkNXVVZHU1hkWU5IWnpPRUpwUW1OVFkyOWtDalZ1YjFwSVVrMDRSVFFyYVUxRgpTVWRC
-TVZWa1NYZFJOMDFFYlVGR1NYZFlOSFp6T0VKcFFtTlRZMjlrTlc1dldraFNUVGhGTkN0cGIxSmhh
-MFpFUVZNS1RWSkJkMFJuCldVUldVVkZFUlhka1JsRldRV2RSTUVWNFoyZHJRV2QxVlZZelJFMTBW
-elp6ZDBSQldVUldVakJVUWtGVmQwRjNSVUl2ZWtGTVFtZE8KVmdwSVVUaEZRa0ZOUTBGUldYZEVV
-VmxLUzI5YVNXaDJZMDVCVVVWTVFsRkJSR2RuUlVKQlJtWlJjVTlVUVRkU2RqZExLMngxVVRkdwpi
-bUZ6TkVKWmQwaEZDamxIUlZBdmRXOW9kalpMVDNrd1ZFZFJSbUp5VWxScVJtOU1WazVDT1VKYU1Y
-bHRUVVJhTUM5VVNYZEpWV00zCmQyazNZVGgwTlcxRmNWbElNVFV6ZDFjS1lWZHZiMmxUYW5sTVRH
-aDFTVFJ6VG5KT1EwOTBhWE5rUW5FeWNqSk5SbGgwTm1nd2JVRlIKV1U5UWRqaFNPRXMzTDJablUz
-aEhSbkY2YUhsT2JXMVdUQW94Y1VKS2JHUjRNelJUY0hkelZFRk1VVlpRWWpSb1IzZEtlbHBtY2pG
-UQpZM0JGVVhnMmVFMXVWR3c0ZUVWWFdrVXpUWE01T1hWaFZYaGlVWEZKZDFKMUNreG5RVTlyVGtO
-dFdUSnRPRGxXYUhwaFNFb3hkVlk0Ck5VRmtUUzkwUkN0WmMyMXNibTVxZERsTVVrTmxhbUpDYVhC
-cVNVZHFUMWh5WnpGS1VDdHNlRllLYlhWTk5IWklLMUF2Yld4dGVITlEKVUhvd1pEWTFZaXRGUjIx
-S1duQnZUR3RQTDNSa1RrNTJRMWw2YWtwd1ZFVlhjRVZ6VHpaT1RXaExXVzg5Q2kwdExTMHRSVTVF
-SUVORgpVbFJKUmtsRFFWUkZMUzB0TFMwSwotLXtib3VuZGFyeX0tLQo=
diff --git a/wifi/tests/assets/hsr1/README.txt b/wifi/tests/assets/hsr1/README.txt
deleted file mode 100644
index 9f3cdc2..0000000
--- a/wifi/tests/assets/hsr1/README.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-HSR1ProfileWithCACert.conf - unencoded installation file that contains a Passpoint profile and a CA Certificate
-HSR1ProfileWithCACert.base64 - base64 encoded of the data contained in HSR1ProfileWithCAWith.conf
-HSR1ProfileWithNonBase64Part.base64 - base64 encoded installation file that contains a part of non-base64 encoding type
-HSR1ProfileWithMissingBoundary.base64 - base64 encoded installation file with missing end-boundary in the MIME data
-HSR1ProfileWithInvalidContentType.base64 - base64 encoded installation file with that contains a MIME part with an invalid content type
-HSR1ProfileWithUpdateIdentifier.base64 - base64 encoded installation file with that contains an R2 update identifier
diff --git a/wifi/tests/assets/pps/PerProviderSubscription.xml b/wifi/tests/assets/pps/PerProviderSubscription.xml
deleted file mode 100644
index e9afb35..0000000
--- a/wifi/tests/assets/pps/PerProviderSubscription.xml
+++ /dev/null
@@ -1,430 +0,0 @@
-<MgmtTree xmlns="syncml:dmddf1.2">
- <VerDTD>1.2</VerDTD>
- <Node>
- <NodeName>PerProviderSubscription</NodeName>
- <RTProperties>
- <Type>
- <DDFName>urn:wfa:mo:hotspot2dot0-perprovidersubscription:1.0</DDFName>
- </Type>
- </RTProperties>
- <Node>
- <NodeName>UpdateIdentifier</NodeName>
- <Value>12</Value>
- </Node>
- <Node>
- <NodeName>i001</NodeName>
- <Node>
- <NodeName>Extension</NodeName>
- <Node>
- <NodeName>VendorSpecific</NodeName>
- <Value>Test</Value>
- </Node>
- <Node>
- <NodeName>VendorExtension</NodeName>
- <Node>
- <NodeName>VendorAttribute</NodeName>
- <Value>VendorValue</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>Android</NodeName>
- <Node>
- <NodeName>AAAServerTrustedNames</NodeName>
- <Node>
- <NodeName>FQDN</NodeName>
- <Value>trusted.fqdn.com;another-trusted.fqdn.com</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>NewSubTree</NodeName>
- <Node>
- <NodeName>NewAttribute</NodeName>
- <Value>NewValue</Value>
- </Node>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>HomeSP</NodeName>
- <Node>
- <NodeName>FriendlyName</NodeName>
- <Value>Century House</Value>
- </Node>
- <Node>
- <NodeName>FQDN</NodeName>
- <Value>mi6.co.uk</Value>
- </Node>
- <Node>
- <NodeName>RoamingConsortiumOI</NodeName>
- <Value>112233,445566</Value>
- </Node>
- <Node>
- <NodeName>IconURL</NodeName>
- <Value>icon.test.com</Value>
- </Node>
- <Node>
- <NodeName>NetworkID</NodeName>
- <Node>
- <NodeName>n001</NodeName>
- <Node>
- <NodeName>SSID</NodeName>
- <Value>TestSSID</Value>
- </Node>
- <Node>
- <NodeName>HESSID</NodeName>
- <Value>12345678</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>n002</NodeName>
- <Node>
- <NodeName>SSID</NodeName>
- <Value>NullHESSID</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>HomeOIList</NodeName>
- <Node>
- <NodeName>h001</NodeName>
- <Node>
- <NodeName>HomeOI</NodeName>
- <Value>11223344</Value>
- </Node>
- <Node>
- <NodeName>HomeOIRequired</NodeName>
- <Value>true</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>h002</NodeName>
- <Node>
- <NodeName>HomeOI</NodeName>
- <Value>55667788</Value>
- </Node>
- <Node>
- <NodeName>HomeOIRequired</NodeName>
- <Value>false</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>OtherHomePartners</NodeName>
- <Node>
- <NodeName>o001</NodeName>
- <Node>
- <NodeName>FQDN</NodeName>
- <Value>other.fqdn.com</Value>
- </Node>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>Credential</NodeName>
- <Node>
- <NodeName>CreationDate</NodeName>
- <Value>2016-01-01T10:00:00Z</Value>
- </Node>
- <Node>
- <NodeName>ExpirationDate</NodeName>
- <Value>2016-02-01T10:00:00Z</Value>
- </Node>
- <Node>
- <NodeName>Realm</NodeName>
- <Value>shaken.stirred.com</Value>
- </Node>
- <Node>
- <NodeName>CheckAAAServerCertStatus</NodeName>
- <Value>true</Value>
- </Node>
- <Node>
- <NodeName>UsernamePassword</NodeName>
- <Node>
- <NodeName>Username</NodeName>
- <Value>james</Value>
- </Node>
- <Node>
- <NodeName>Password</NodeName>
- <Value>Ym9uZDAwNw==</Value>
- </Node>
- <Node>
- <NodeName>MachineManaged</NodeName>
- <Value>true</Value>
- </Node>
- <Node>
- <NodeName>SoftTokenApp</NodeName>
- <Value>TestApp</Value>
- </Node>
- <Node>
- <NodeName>AbleToShare</NodeName>
- <Value>true</Value>
- </Node>
- <Node>
- <NodeName>EAPMethod</NodeName>
- <Node>
- <NodeName>EAPType</NodeName>
- <Value>21</Value>
- </Node>
- <Node>
- <NodeName>InnerMethod</NodeName>
- <Value>MS-CHAP-V2</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>DigitalCertificate</NodeName>
- <Node>
- <NodeName>CertificateType</NodeName>
- <Value>x509v3</Value>
- </Node>
- <Node>
- <NodeName>CertSHA256Fingerprint</NodeName>
- <Value>1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>SIM</NodeName>
- <Node>
- <NodeName>IMSI</NodeName>
- <Value>imsi</Value>
- </Node>
- <Node>
- <NodeName>EAPType</NodeName>
- <Value>24</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>Policy</NodeName>
- <Node>
- <NodeName>PreferredRoamingPartnerList</NodeName>
- <Node>
- <NodeName>p001</NodeName>
- <Node>
- <NodeName>FQDN_Match</NodeName>
- <Value>test1.fqdn.com,exactMatch</Value>
- </Node>
- <Node>
- <NodeName>Priority</NodeName>
- <Value>127</Value>
- </Node>
- <Node>
- <NodeName>Country</NodeName>
- <Value>us,fr</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>p002</NodeName>
- <Node>
- <NodeName>FQDN_Match</NodeName>
- <Value>test2.fqdn.com,includeSubdomains</Value>
- </Node>
- <Node>
- <NodeName>Priority</NodeName>
- <Value>200</Value>
- </Node>
- <Node>
- <NodeName>Country</NodeName>
- <Value>*</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>MinBackhaulThreshold</NodeName>
- <Node>
- <NodeName>m001</NodeName>
- <Node>
- <NodeName>NetworkType</NodeName>
- <Value>home</Value>
- </Node>
- <Node>
- <NodeName>DLBandwidth</NodeName>
- <Value>23412</Value>
- </Node>
- <Node>
- <NodeName>ULBandwidth</NodeName>
- <Value>9823</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>m002</NodeName>
- <Node>
- <NodeName>NetworkType</NodeName>
- <Value>roaming</Value>
- </Node>
- <Node>
- <NodeName>DLBandwidth</NodeName>
- <Value>9271</Value>
- </Node>
- <Node>
- <NodeName>ULBandwidth</NodeName>
- <Value>2315</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>PolicyUpdate</NodeName>
- <Node>
- <NodeName>UpdateInterval</NodeName>
- <Value>120</Value>
- </Node>
- <Node>
- <NodeName>UpdateMethod</NodeName>
- <Value>OMA-DM-ClientInitiated</Value>
- </Node>
- <Node>
- <NodeName>Restriction</NodeName>
- <Value>HomeSP</Value>
- </Node>
- <Node>
- <NodeName>URI</NodeName>
- <Value>policy.update.com</Value>
- </Node>
- <Node>
- <NodeName>UsernamePassword</NodeName>
- <Node>
- <NodeName>Username</NodeName>
- <Value>updateUser</Value>
- </Node>
- <Node>
- <NodeName>Password</NodeName>
- <Value>updatePass</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>TrustRoot</NodeName>
- <Node>
- <NodeName>CertURL</NodeName>
- <Value>update.cert.com</Value>
- </Node>
- <Node>
- <NodeName>CertSHA256Fingerprint</NodeName>
- <Value>1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>SPExclusionList</NodeName>
- <Node>
- <NodeName>s001</NodeName>
- <Node>
- <NodeName>SSID</NodeName>
- <Value>excludeSSID</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>RequiredProtoPortTuple</NodeName>
- <Node>
- <NodeName>r001</NodeName>
- <Node>
- <NodeName>IPProtocol</NodeName>
- <Value>12</Value>
- </Node>
- <Node>
- <NodeName>PortNumber</NodeName>
- <Value>34,92,234</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>MaximumBSSLoadValue</NodeName>
- <Value>23</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>CredentialPriority</NodeName>
- <Value>99</Value>
- </Node>
- <Node>
- <NodeName>AAAServerTrustRoot</NodeName>
- <Node>
- <NodeName>a001</NodeName>
- <Node>
- <NodeName>CertURL</NodeName>
- <Value>server1.trust.root.com</Value>
- </Node>
- <Node>
- <NodeName>CertSHA256Fingerprint</NodeName>
- <Value>1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>SubscriptionUpdate</NodeName>
- <Node>
- <NodeName>UpdateInterval</NodeName>
- <Value>120</Value>
- </Node>
- <Node>
- <NodeName>UpdateMethod</NodeName>
- <Value>SSP-ClientInitiated</Value>
- </Node>
- <Node>
- <NodeName>Restriction</NodeName>
- <Value>RoamingPartner</Value>
- </Node>
- <Node>
- <NodeName>URI</NodeName>
- <Value>subscription.update.com</Value>
- </Node>
- <Node>
- <NodeName>UsernamePassword</NodeName>
- <Node>
- <NodeName>Username</NodeName>
- <Value>subscriptionUser</Value>
- </Node>
- <Node>
- <NodeName>Password</NodeName>
- <Value>subscriptionPass</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>TrustRoot</NodeName>
- <Node>
- <NodeName>CertURL</NodeName>
- <Value>subscription.update.cert.com</Value>
- </Node>
- <Node>
- <NodeName>CertSHA256Fingerprint</NodeName>
- <Value>1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>SubscriptionParameters</NodeName>
- <Node>
- <NodeName>CreationDate</NodeName>
- <Value>2016-02-01T10:00:00Z</Value>
- </Node>
- <Node>
- <NodeName>ExpirationDate</NodeName>
- <Value>2016-03-01T10:00:00Z</Value>
- </Node>
- <Node>
- <NodeName>TypeOfSubscription</NodeName>
- <Value>Gold</Value>
- </Node>
- <Node>
- <NodeName>UsageLimits</NodeName>
- <Node>
- <NodeName>DataLimit</NodeName>
- <Value>921890</Value>
- </Node>
- <Node>
- <NodeName>StartDate</NodeName>
- <Value>2016-12-01T10:00:00Z</Value>
- </Node>
- <Node>
- <NodeName>TimeLimit</NodeName>
- <Value>120</Value>
- </Node>
- <Node>
- <NodeName>UsageTimePeriod</NodeName>
- <Value>99910</Value>
- </Node>
- </Node>
- </Node>
- </Node>
- </Node>
-</MgmtTree>
diff --git a/wifi/tests/assets/pps/PerProviderSubscription_DuplicateHomeSP.xml b/wifi/tests/assets/pps/PerProviderSubscription_DuplicateHomeSP.xml
deleted file mode 100644
index e13eb2a..0000000
--- a/wifi/tests/assets/pps/PerProviderSubscription_DuplicateHomeSP.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<MgmtTree xmlns="syncml:dmddf1.2">
- <VerDTD>1.2</VerDTD>
- <Node>
- <NodeName>PerProviderSubscription</NodeName>
- <RTProperties>
- <Type>
- <DDFName>urn:wfa:mo:hotspot2dot0-perprovidersubscription:1.0</DDFName>
- </Type>
- </RTProperties>
- <Node>
- <NodeName>i001</NodeName>
- <Node>
- <NodeName>HomeSP</NodeName>
- <Node>
- <NodeName>FriendlyName</NodeName>
- <Value>Century House</Value>
- </Node>
- <Node>
- <NodeName>FQDN</NodeName>
- <Value>mi6.co.uk</Value>
- </Node>
- <Node>
- <NodeName>RoamingConsortiumOI</NodeName>
- <Value>112233,445566</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>HomeSP</NodeName>
- <Node>
- <NodeName>FriendlyName</NodeName>
- <Value>Century House</Value>
- </Node>
- <Node>
- <NodeName>FQDN</NodeName>
- <Value>mi6.co.uk</Value>
- </Node>
- <Node>
- <NodeName>RoamingConsortiumOI</NodeName>
- <Value>112233,445566</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>Credential</NodeName>
- <Node>
- <NodeName>Realm</NodeName>
- <Value>shaken.stirred.com</Value>
- </Node>
- <Node>
- <NodeName>UsernamePassword</NodeName>
- <Node>
- <NodeName>Username</NodeName>
- <Value>james</Value>
- </Node>
- <Node>
- <NodeName>Password</NodeName>
- <Value>Ym9uZDAwNw==</Value>
- </Node>
- <Node>
- <NodeName>EAPMethod</NodeName>
- <Node>
- <NodeName>EAPType</NodeName>
- <Value>21</Value>
- </Node>
- <Node>
- <NodeName>InnerMethod</NodeName>
- <Value>MS-CHAP-V2</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>DigitalCertificate</NodeName>
- <Node>
- <NodeName>CertificateType</NodeName>
- <Value>x509v3</Value>
- </Node>
- <Node>
- <NodeName>CertSHA256FingerPrint</NodeName>
- <Value>1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>SIM</NodeName>
- <Node>
- <NodeName>IMSI</NodeName>
- <Value>imsi</Value>
- </Node>
- <Node>
- <NodeName>EAPType</NodeName>
- <Value>24</Value>
- </Node>
- </Node>
- </Node>
- </Node>
- </Node>
-</MgmtTree>
diff --git a/wifi/tests/assets/pps/PerProviderSubscription_DuplicateValue.xml b/wifi/tests/assets/pps/PerProviderSubscription_DuplicateValue.xml
deleted file mode 100644
index 8719ffa..0000000
--- a/wifi/tests/assets/pps/PerProviderSubscription_DuplicateValue.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<MgmtTree xmlns="syncml:dmddf1.2">
- <VerDTD>1.2</VerDTD>
- <Node>
- <NodeName>PerProviderSubscription</NodeName>
- <RTProperties>
- <Type>
- <DDFName>urn:wfa:mo:hotspot2dot0-perprovidersubscription:1.0</DDFName>
- </Type>
- </RTProperties>
- <Node>
- <NodeName>i001</NodeName>
- <Node>
- <NodeName>HomeSP</NodeName>
- <Node>
- <NodeName>FriendlyName</NodeName>
- <Value>Century House</Value>
- <Value>Century House</Value>
- </Node>
- <Node>
- <NodeName>FQDN</NodeName>
- <Value>mi6.co.uk</Value>
- </Node>
- <Node>
- <NodeName>RoamingConsortiumOI</NodeName>
- <Value>112233,445566</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>Credential</NodeName>
- <Node>
- <NodeName>Realm</NodeName>
- <Value>shaken.stirred.com</Value>
- </Node>
- <Node>
- <NodeName>UsernamePassword</NodeName>
- <Node>
- <NodeName>Username</NodeName>
- <Value>james</Value>
- </Node>
- <Node>
- <NodeName>Password</NodeName>
- <Value>Ym9uZDAwNw==</Value>
- </Node>
- <Node>
- <NodeName>EAPMethod</NodeName>
- <Node>
- <NodeName>EAPType</NodeName>
- <Value>21</Value>
- </Node>
- <Node>
- <NodeName>InnerMethod</NodeName>
- <Value>MS-CHAP-V2</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>DigitalCertificate</NodeName>
- <Node>
- <NodeName>CertificateType</NodeName>
- <Value>x509v3</Value>
- </Node>
- <Node>
- <NodeName>CertSHA256FingerPrint</NodeName>
- <Value>1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>SIM</NodeName>
- <Node>
- <NodeName>IMSI</NodeName>
- <Value>imsi</Value>
- </Node>
- <Node>
- <NodeName>EAPType</NodeName>
- <Value>24</Value>
- </Node>
- </Node>
- </Node>
- </Node>
- </Node>
-</MgmtTree>
diff --git a/wifi/tests/assets/pps/PerProviderSubscription_InvalidName.xml b/wifi/tests/assets/pps/PerProviderSubscription_InvalidName.xml
deleted file mode 100644
index c761237..0000000
--- a/wifi/tests/assets/pps/PerProviderSubscription_InvalidName.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<MgmtTree xmlns="syncml:dmddf1.2">
- <VerDTD>1.2</VerDTD>
- <Node>
- <NodeName>PerProviderSubscription</NodeName>
- <RTProperties>
- <Type>
- <DDFName>urn:wfa:mo:hotspot2dot0-perprovidersubscription:1.0</DDFName>
- </Type>
- </RTProperties>
- <Node>
- <NodeName>i001</NodeName>
- <Node>
- <NodeName>HomeSP</NodeName>
- <Node>
- <NodeName>FriendName</NodeName>
- <Value>Century House</Value>
- </Node>
- <Node>
- <NodeName>FQDN</NodeName>
- <Value>mi6.co.uk</Value>
- </Node>
- <Node>
- <NodeName>RoamingConsortiumOI</NodeName>
- <Value>112233,445566</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>Credential</NodeName>
- <Node>
- <NodeName>Realm</NodeName>
- <Value>shaken.stirred.com</Value>
- </Node>
- <Node>
- <NodeName>UsernamePassword</NodeName>
- <Node>
- <NodeName>Username</NodeName>
- <Value>james</Value>
- </Node>
- <Node>
- <NodeName>Password</NodeName>
- <Value>Ym9uZDAwNw==</Value>
- </Node>
- <Node>
- <NodeName>EAPMethod</NodeName>
- <Node>
- <NodeName>EAPType</NodeName>
- <Value>21</Value>
- </Node>
- <Node>
- <NodeName>InnerMethod</NodeName>
- <Value>MS-CHAP-V2</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>DigitalCertificate</NodeName>
- <Node>
- <NodeName>CertificateType</NodeName>
- <Value>x509v3</Value>
- </Node>
- <Node>
- <NodeName>CertSHA256FingerPrint</NodeName>
- <Value>1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>SIM</NodeName>
- <Node>
- <NodeName>IMSI</NodeName>
- <Value>imsi</Value>
- </Node>
- <Node>
- <NodeName>EAPType</NodeName>
- <Value>24</Value>
- </Node>
- </Node>
- </Node>
- </Node>
- </Node>
-</MgmtTree>
diff --git a/wifi/tests/assets/pps/PerProviderSubscription_InvalidNode.xml b/wifi/tests/assets/pps/PerProviderSubscription_InvalidNode.xml
deleted file mode 100644
index 6b807af..0000000
--- a/wifi/tests/assets/pps/PerProviderSubscription_InvalidNode.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<MgmtTree xmlns="syncml:dmddf1.2">
- <VerDTD>1.2</VerDTD>
- <Node>
- <NodeName>PerProviderSubscription</NodeName>
- <RTProperties>
- <Type>
- <DDFName>urn:wfa:mo:hotspot2dot0-perprovidersubscription:1.0</DDFName>
- </Type>
- </RTProperties>
- <Node>
- <NodeName>i001</NodeName>
- <Node>
- <NodeName>HomeSP</NodeName>
- <Node>
- <NodeName>FriendlyName</NodeName>
- <Value>Century House</Value>
- </Node>
- <Node>
- <NodeName>FQDN</NodeName>
- <Value>mi6.co.uk</Value>
- <Node>
- <NodeName>InvalidNode</NodeName>
- <Value>Test</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>RoamingConsortiumOI</NodeName>
- <Value>112233,445566</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>Credential</NodeName>
- <Node>
- <NodeName>Realm</NodeName>
- <Value>shaken.stirred.com</Value>
- </Node>
- <Node>
- <NodeName>UsernamePassword</NodeName>
- <Node>
- <NodeName>Username</NodeName>
- <Value>james</Value>
- </Node>
- <Node>
- <NodeName>Password</NodeName>
- <Value>Ym9uZDAwNw==</Value>
- </Node>
- <Node>
- <NodeName>EAPMethod</NodeName>
- <Node>
- <NodeName>EAPType</NodeName>
- <Value>21</Value>
- </Node>
- <Node>
- <NodeName>InnerMethod</NodeName>
- <Value>MS-CHAP-V2</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>DigitalCertificate</NodeName>
- <Node>
- <NodeName>CertificateType</NodeName>
- <Value>x509v3</Value>
- </Node>
- <Node>
- <NodeName>CertSHA256FingerPrint</NodeName>
- <Value>1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>SIM</NodeName>
- <Node>
- <NodeName>IMSI</NodeName>
- <Value>imsi</Value>
- </Node>
- <Node>
- <NodeName>EAPType</NodeName>
- <Value>24</Value>
- </Node>
- </Node>
- </Node>
- </Node>
- </Node>
-</MgmtTree>
diff --git a/wifi/tests/assets/pps/PerProviderSubscription_MissingName.xml b/wifi/tests/assets/pps/PerProviderSubscription_MissingName.xml
deleted file mode 100644
index ed06b47..0000000
--- a/wifi/tests/assets/pps/PerProviderSubscription_MissingName.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<MgmtTree xmlns="syncml:dmddf1.2">
- <VerDTD>1.2</VerDTD>
- <Node>
- <NodeName>PerProviderSubscription</NodeName>
- <RTProperties>
- <Type>
- <DDFName>urn:wfa:mo:hotspot2dot0-perprovidersubscription:1.0</DDFName>
- </Type>
- </RTProperties>
- <Node>
- <NodeName>i001</NodeName>
- <Node>
- <Node>
- <NodeName>FriendlyName</NodeName>
- <Value>Century House</Value>
- </Node>
- <Node>
- <NodeName>FQDN</NodeName>
- <Value>mi6.co.uk</Value>
- </Node>
- <Node>
- <NodeName>RoamingConsortiumOI</NodeName>
- <Value>112233,445566</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>Credential</NodeName>
- <Node>
- <NodeName>Realm</NodeName>
- <Value>shaken.stirred.com</Value>
- </Node>
- <Node>
- <NodeName>UsernamePassword</NodeName>
- <Node>
- <NodeName>Username</NodeName>
- <Value>james</Value>
- </Node>
- <Node>
- <NodeName>Password</NodeName>
- <Value>Ym9uZDAwNw==</Value>
- </Node>
- <Node>
- <NodeName>EAPMethod</NodeName>
- <Node>
- <NodeName>EAPType</NodeName>
- <Value>21</Value>
- </Node>
- <Node>
- <NodeName>InnerMethod</NodeName>
- <Value>MS-CHAP-V2</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>DigitalCertificate</NodeName>
- <Node>
- <NodeName>CertificateType</NodeName>
- <Value>x509v3</Value>
- </Node>
- <Node>
- <NodeName>CertSHA256FingerPrint</NodeName>
- <Value>1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>SIM</NodeName>
- <Node>
- <NodeName>IMSI</NodeName>
- <Value>imsi</Value>
- </Node>
- <Node>
- <NodeName>EAPType</NodeName>
- <Value>24</Value>
- </Node>
- </Node>
- </Node>
- </Node>
- </Node>
-</MgmtTree>
diff --git a/wifi/tests/assets/pps/PerProviderSubscription_MissingValue.xml b/wifi/tests/assets/pps/PerProviderSubscription_MissingValue.xml
deleted file mode 100644
index f7e35dd..0000000
--- a/wifi/tests/assets/pps/PerProviderSubscription_MissingValue.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<MgmtTree xmlns="syncml:dmddf1.2">
- <VerDTD>1.2</VerDTD>
- <Node>
- <NodeName>PerProviderSubscription</NodeName>
- <RTProperties>
- <Type>
- <DDFName>urn:wfa:mo:hotspot2dot0-perprovidersubscription:1.0</DDFName>
- </Type>
- </RTProperties>
- <Node>
- <NodeName>i001</NodeName>
- <Node>
- <NodeName>HomeSP</NodeName>
- <Node>
- <NodeName>FriendlyName</NodeName>
- </Node>
- <Node>
- <NodeName>FQDN</NodeName>
- <Value>mi6.co.uk</Value>
- </Node>
- <Node>
- <NodeName>RoamingConsortiumOI</NodeName>
- <Value>112233,445566</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>Credential</NodeName>
- <Node>
- <NodeName>Realm</NodeName>
- <Value>shaken.stirred.com</Value>
- </Node>
- <Node>
- <NodeName>UsernamePassword</NodeName>
- <Node>
- <NodeName>Username</NodeName>
- <Value>james</Value>
- </Node>
- <Node>
- <NodeName>Password</NodeName>
- <Value>Ym9uZDAwNw==</Value>
- </Node>
- <Node>
- <NodeName>EAPMethod</NodeName>
- <Node>
- <NodeName>EAPType</NodeName>
- <Value>21</Value>
- </Node>
- <Node>
- <NodeName>InnerMethod</NodeName>
- <Value>MS-CHAP-V2</Value>
- </Node>
- </Node>
- </Node>
- <Node>
- <NodeName>DigitalCertificate</NodeName>
- <Node>
- <NodeName>CertificateType</NodeName>
- <Value>x509v3</Value>
- </Node>
- <Node>
- <NodeName>CertSHA256FingerPrint</NodeName>
- <Value>1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f</Value>
- </Node>
- </Node>
- <Node>
- <NodeName>SIM</NodeName>
- <Node>
- <NodeName>IMSI</NodeName>
- <Value>imsi</Value>
- </Node>
- <Node>
- <NodeName>EAPType</NodeName>
- <Value>24</Value>
- </Node>
- </Node>
- </Node>
- </Node>
- </Node>
-</MgmtTree>
diff --git a/wifi/tests/assets/pps/README.txt b/wifi/tests/assets/pps/README.txt
deleted file mode 100644
index 369c0a9..0000000
--- a/wifi/tests/assets/pps/README.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-PerProviderSubscription.xml - valid PPS XML file
-PerProviderSubscription_DuplicateHomeSP.xml - containing multiple HomeSP node
-PerProviderSubscription_DuplicateValue.xml - FriendlyName node contains multiple Value
-PerProviderSubscription_MissingValue.xml - FriendlyName node is missing Value
-PerProviderSubscription_MissingName.xml - HomeSP node is missing NodeName
-PerProviderSubscription_InvalidNode.xml - FQDN node contains both Value and a child node
-PerProviderSubscription_InvalidName.xml - FriendlyName node have a typo in its name
diff --git a/wifi/tests/src/android/net/wifi/CoexUnsafeChannelTest.java b/wifi/tests/src/android/net/wifi/CoexUnsafeChannelTest.java
deleted file mode 100644
index 320f25e..0000000
--- a/wifi/tests/src/android/net/wifi/CoexUnsafeChannelTest.java
+++ /dev/null
@@ -1,97 +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 android.net.wifi;
-
-import static android.net.wifi.WifiScanner.WIFI_BAND_24_GHZ;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-/**
- * Unit tests for {@link android.net.wifi.CoexUnsafeChannel}.
- */
-@SmallTest
-public class CoexUnsafeChannelTest {
- /**
- * Verifies {@link CoexUnsafeChannel#isPowerCapAvailable()} returns false if no cap is set.
- */
- @Test
- public void testIsPowerCapAvailable_noPowerCap_returnsFalse() {
- CoexUnsafeChannel unsafeChannel = new CoexUnsafeChannel(WIFI_BAND_24_GHZ, 6);
-
- assertThat(unsafeChannel.isPowerCapAvailable()).isFalse();
- }
-
- /**
- * Verifies {@link CoexUnsafeChannel#isPowerCapAvailable()} returns true if a cap is set, and
- * {@link CoexUnsafeChannel#getPowerCapDbm()} returns the set value.
- */
- @Test
- public void testIsPowerCapAvailable_powerCapSet_returnsTrue() {
- final int powerCapDbm = -50;
- CoexUnsafeChannel unsafeChannel = new CoexUnsafeChannel(WIFI_BAND_24_GHZ, 6);
-
- unsafeChannel.setPowerCapDbm(powerCapDbm);
-
- assertThat(unsafeChannel.isPowerCapAvailable()).isTrue();
- assertThat(unsafeChannel.getPowerCapDbm()).isEqualTo(powerCapDbm);
- }
-
- /**
- * Verifies {@link CoexUnsafeChannel#getPowerCapDbm()} throws an IllegalStateException if
- * {@link CoexUnsafeChannel#isPowerCapAvailable()} is {@code false}.
- */
- @Test(expected = IllegalStateException.class)
- public void testGetPowerCap_powerCapUnavailable_throwsException() {
- CoexUnsafeChannel unsafeChannel = new CoexUnsafeChannel(WIFI_BAND_24_GHZ, 6);
-
- unsafeChannel.getPowerCapDbm();
- }
-
- /**
- * Verify parcel read/write for CoexUnsafeChannel with or without power cap.
- */
- @Test
- public void testParcelReadWrite_withOrWithoutCap_readEqualsWritten() throws Exception {
- CoexUnsafeChannel writeUnsafeChannelNoCap =
- new CoexUnsafeChannel(WIFI_BAND_24_GHZ, 6);
- CoexUnsafeChannel writeUnsafeChannelCapped =
- new CoexUnsafeChannel(WIFI_BAND_24_GHZ, 6, -50);
-
- CoexUnsafeChannel readUnsafeChannelNoCap = parcelReadWrite(writeUnsafeChannelNoCap);
- CoexUnsafeChannel readUnsafeChannelCapped = parcelReadWrite(writeUnsafeChannelCapped);
-
- assertThat(writeUnsafeChannelNoCap).isEqualTo(readUnsafeChannelNoCap);
- assertThat(writeUnsafeChannelCapped).isEqualTo(readUnsafeChannelCapped);
- }
-
- /**
- * Write the provided {@link CoexUnsafeChannel} to a parcel and deserialize it.
- */
- private static CoexUnsafeChannel parcelReadWrite(CoexUnsafeChannel writeResult)
- throws Exception {
- Parcel parcel = Parcel.obtain();
- writeResult.writeToParcel(parcel, 0);
- parcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- return CoexUnsafeChannel.CREATOR.createFromParcel(parcel);
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/EasyConnectStatusCallbackTest.java b/wifi/tests/src/android/net/wifi/EasyConnectStatusCallbackTest.java
deleted file mode 100644
index cf37b78..0000000
--- a/wifi/tests/src/android/net/wifi/EasyConnectStatusCallbackTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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.net.wifi;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import android.annotation.NonNull;
-import android.util.SparseArray;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Unit tests for {@link android.net.wifi.EasyConnectStatusCallbackTest}.
- */
-@SmallTest
-public class EasyConnectStatusCallbackTest {
- private EasyConnectStatusCallback mEasyConnectStatusCallback = new EasyConnectStatusCallback() {
- @Override
- public void onEnrolleeSuccess(int newNetworkId) {
-
- }
-
- @Override
- public void onConfiguratorSuccess(int code) {
-
- }
-
- @Override
- public void onProgress(int code) {
-
- }
-
- @Override
- public void onFailure(int code) {
- mOnFailureR1EventReceived = true;
- mLastCode = code;
- }
-
- @Override
- public void onBootstrapUriGenerated(@NonNull String uri) {
-
- }
- };
- private boolean mOnFailureR1EventReceived;
- private int mLastCode;
-
- @Before
- public void setUp() {
- mOnFailureR1EventReceived = false;
- mLastCode = 0;
- }
-
- /**
- * Test that the legacy R1 onFailure is called by default if the R2 onFailure is not overridden
- * by the app.
- */
- @Test
- public void testR1OnFailureCalled() {
-
- SparseArray<int[]> channelList = new SparseArray<>();
- int[] channelArray = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
-
- channelList.append(81, channelArray);
- mEasyConnectStatusCallback.onFailure(
- EasyConnectStatusCallback.EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK,
- "SomeSSID", channelList, new int[] {81});
-
- assertTrue(mOnFailureR1EventReceived);
- assertEquals(mLastCode,
- EasyConnectStatusCallback.EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK);
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/FakeKeys.java b/wifi/tests/src/android/net/wifi/FakeKeys.java
deleted file mode 100644
index 8aa6add..0000000
--- a/wifi/tests/src/android/net/wifi/FakeKeys.java
+++ /dev/null
@@ -1,673 +0,0 @@
-/*
- * Copyright (C) 2016 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 java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
-import java.security.KeyFactory;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.PKCS8EncodedKeySpec;
-
-/**
- * A class containing test certificates and private keys.
- */
-public class FakeKeys {
- private static final String CA_CERT0_STRING = "-----BEGIN CERTIFICATE-----\n" +
- "MIIDKDCCAhCgAwIBAgIJAILlFdwzLVurMA0GCSqGSIb3DQEBCwUAMBIxEDAOBgNV\n" +
- "BAMTB0VBUCBDQTEwHhcNMTYwMTEyMTE1MDE1WhcNMjYwMTA5MTE1MDE1WjASMRAw\n" +
- "DgYDVQQDEwdFQVAgQ0ExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\n" +
- "znAPUz26Msae4ws43czR41/J2QtrSIZUKmVUsVumDbYHrPNvTXKSMXAcewORDQYX\n" +
- "RqvHvpn8CscB1+oGXZvHwxj4zV0WKoK2zeXkau3vcyl3HIKupJfq2TEACefVjj0t\n" +
- "JW+X35PGWp9/H5zIUNVNVjS7Ums84IvKhRB8512PB9UyHagXYVX5GWpAcVpyfrlR\n" +
- "FI9Qdhh+Pbk0uyktdbf/CdfgHOoebrTtwRljM0oDtX+2Cv6j0wBK7hD8pPvf1+uy\n" +
- "GzczigAU/4Kw7eZqydf9B+5RupR+IZipX41xEiIrKRwqi517WWzXcjaG2cNbf451\n" +
- "xpH5PnV3i1tq04jMGQUzFwIDAQABo4GAMH4wHQYDVR0OBBYEFIwX4vs8BiBcScod\n" +
- "5noZHRM8E4+iMEIGA1UdIwQ7MDmAFIwX4vs8BiBcScod5noZHRM8E4+ioRakFDAS\n" +
- "MRAwDgYDVQQDEwdFQVAgQ0ExggkAguUV3DMtW6swDAYDVR0TBAUwAwEB/zALBgNV\n" +
- "HQ8EBAMCAQYwDQYJKoZIhvcNAQELBQADggEBAFfQqOTA7Rv7K+luQ7pnas4BYwHE\n" +
- "9GEP/uohv6KOy0TGQFbrRTjFoLVNB9BZ1ymMDZ0/TIwIUc7wi7a8t5mEqYH153wW\n" +
- "aWooiSjyLLhuI4sNrNCOtisdBq2r2MFXt6h0mAQYOPv8R8K7/fgSxGFqzhyNmmVL\n" +
- "1qBJldx34SpwsTALQVPb4hGwJzZfr1PcpEQx6xMnTl8xEWZE3Ms99uaUxbQqIwRu\n" +
- "LgAOkNCmY2m89VhzaHJ1uV85AdM/tD+Ysmlnnjt9LRCejbBipjIGjOXrg1JP+lxV\n" +
- "muM4vH+P/mlmxsPPz0d65b+EGmJZpoLkO/tdNNvCYzjJpTEWpEsO6NMhKYo=\n" +
- "-----END CERTIFICATE-----\n";
- public static final X509Certificate CA_CERT0 = loadCertificate(CA_CERT0_STRING);
-
- private static final String CA_CERT1_STRING = "-----BEGIN CERTIFICATE-----\n" +
- "MIIDKDCCAhCgAwIBAgIJAOM5SzKO2pzCMA0GCSqGSIb3DQEBCwUAMBIxEDAOBgNV\n" +
- "BAMTB0VBUCBDQTAwHhcNMTYwMTEyMDAxMDQ3WhcNMjYwMTA5MDAxMDQ3WjASMRAw\n" +
- "DgYDVQQDEwdFQVAgQ0EwMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\n" +
- "89ug+IEKVQXnJGKg5g4uVHg6J/8iRUxR5k2eH5o03hrJNMfN2D+cBe/wCiZcnWbI\n" +
- "GbGZACWm2nQth2wy9Zgm2LOd3b4ocrHYls3XLq6Qb5Dd7a0JKU7pdGufiNVEkrmF\n" +
- "EB+N64wgwH4COTvCiN4erp5kyJwkfqAl2xLkZo0C464c9XoyQOXbmYD9A8v10wZu\n" +
- "jyNsEo7Nr2USyw+qhjWSbFbEirP77Tvx+7pJQJwdtk1V9Tn73T2dGF2WHYejei9S\n" +
- "mcWpdIUqsu9etYH+zDmtu7I1xlkwiaVsNr2+D+qaCJyOYqrDTKVNK5nmbBPXDWZc\n" +
- "NoDbTOoqquX7xONpq9M6jQIDAQABo4GAMH4wHQYDVR0OBBYEFAZ3A2S4qJZZwuNY\n" +
- "wkJ6mAdc0gVdMEIGA1UdIwQ7MDmAFAZ3A2S4qJZZwuNYwkJ6mAdc0gVdoRakFDAS\n" +
- "MRAwDgYDVQQDEwdFQVAgQ0EwggkA4zlLMo7anMIwDAYDVR0TBAUwAwEB/zALBgNV\n" +
- "HQ8EBAMCAQYwDQYJKoZIhvcNAQELBQADggEBAHmdMwEhtys4d0E+t7owBmoVR+lU\n" +
- "hMCcRtWs8YKX5WIM2kTweT0h/O1xwE1mWmRv/IbDAEb8od4BjAQLhIcolStr2JaO\n" +
- "9ZzyxjOnNzqeErh/1DHDbb/moPpqfeJ8YiEz7nH/YU56Q8iCPO7TsgS0sNNE7PfN\n" +
- "IUsBW0yHRgpQ4OxWmiZG2YZWiECRzAC0ecPzo59N5iH4vLQIMTMYquiDeMPQnn1e\n" +
- "NDGxG8gCtDKIaS6tMg3a28MvWB094pr2ETou8O1C8Ji0Y4hE8QJmSdT7I4+GZjgW\n" +
- "g94DZ5RiL7sdp3vC48CXOmeT61YBIvhGUsE1rPhXqkpqQ3Z3C4TFF0jXZZc=\n" +
- "-----END CERTIFICATE-----\n";
- public static final X509Certificate CA_CERT1 = loadCertificate(CA_CERT1_STRING);
-
- private static final String CLIENT_CERT_STR = "-----BEGIN CERTIFICATE-----\n" +
- "MIIE/DCCAuQCAQEwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxCzAJBgNV\n" +
- "BAgMAkNBMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MRAwDgYDVQQKDAdUZXN0aW5n\n" +
- "MB4XDTE2MDkzMDIwNTQyOFoXDTE3MDkzMDIwNTQyOFowRDELMAkGA1UEBhMCVVMx\n" +
- "CzAJBgNVBAgMAkNBMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MRAwDgYDVQQKDAdU\n" +
- "ZXN0aW5nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAnpmcbuaeHfnJ\n" +
- "k+2QNvxmdVFTawyFMNk0USCq5sexscwmxbewG/Rb8YnixwJWS44v2XkSujB67z5C\n" +
- "s2qudFEhRXKdEuC6idbAuA97KjipHh0AAniWMsyv61fvbgsUC0b0canx3LiDq81p\n" +
- "y28NNGmAvoazLZUZ4AhBRiwYZY6FKk723gmZoGbEIeG7J1dlXPusc1662rIjz4eU\n" +
- "zlmmlvqyHfNqnNk8L14Vug6Xh+lOEGN85xhu1YHAEKGrS89kZxs5rum/cZU8KH2V\n" +
- "v6eKnY03kxjiVLQtnLpm/7VUEoCMGHyruRj+p3my4+DgqMsmsH52RZCBsjyGlpbU\n" +
- "NOwOTIX6xh+Rqloduz4AnrMYYIiIw2s8g+2zJM7VbcVKx0fGS26BKdrxgrXWfmNE\n" +
- "nR0/REQ5AxDGw0jfTUvtdTkXAf+K4MDjcNLEZ+MA4rHfAfQWZtUR5BkHCQYxNpJk\n" +
- "pA0gyk+BpKdC4WdzI14NSWsu5sRCmBCFqH6BTOSEq/V1cNorBxNwLSSTwFFqUDqx\n" +
- "Y5nQLXygkJf9WHZWtSKeSjtOYgilz7UKzC2s3CsjmIyGFe+SwpuHJnuE4Uc8Z5Cb\n" +
- "bjNGHPzqL6XnmzZHJp7RF8kBdKdjGC7dCUltzOfICZeKlzOOq+Kw42T/nXjuXvpb\n" +
- "nkXNxg741Nwd6RecykXJbseFwm3EYxkCAwEAATANBgkqhkiG9w0BAQsFAAOCAgEA\n" +
- "Ga1mGwI9aXkL2fTPXO9YkAPzoGeX8aeuVYSQaSkNq+5vnogYCyAt3YDHjRG+ewTT\n" +
- "WbnPA991xRAPac+biJeXWmwvgGj0YuT7e79phAiGkTTnbAjFHGfYnBy/tI/v7btO\n" +
- "hRNElA5yTJ1m2fVbBEKXzMR83jrT9iyI+YLRN86zUZIaC86xxSbqnrdWN2jOK6MX\n" +
- "dS8Arp9tPQjC/4gW+2Ilxv68jiYh+5auWHQZVjppWVY//iu4mAbkq1pTwQEhZ8F8\n" +
- "Zrmh9DHh60hLFcfSuhIAwf/NMzppwdkjy1ruKVrpijhGKGp4OWu8nvOUgHSzxc7F\n" +
- "PwpVZ5N2Ku4L8MLO6BG2VasRJK7l17TzDXlfLZHJjkuryOFxVaQKt8ZNFgTOaCXS\n" +
- "E+gpTLksKU7riYckoiP4+H1sn9qcis0e8s4o/uf1UVc8GSdDw61ReGM5oZEDm1u8\n" +
- "H9x20QU6igLqzyBpqvCKv7JNgU1uB2PAODHH78zJiUfnKd1y+o+J1iWzaGj3EFji\n" +
- "T8AXksbTP733FeFXfggXju2dyBH+Z1S5BBTEOd1brWgXlHSAZGm97MKZ94r6/tkX\n" +
- "qfv3fCos0DKz0oV7qBxYS8wiYhzrRVxG6ITAoH8uuUVVQaZF+G4nJ2jEqNbfuKyX\n" +
- "ATQsVNjNNlDA0J33GobPMjT326wa4YAWMx8PI5PJZ3g=\n" +
- "-----END CERTIFICATE-----\n";
- public static final X509Certificate CLIENT_CERT = loadCertificate(CLIENT_CERT_STR);
-
- private static final byte[] FAKE_RSA_KEY_1 = new byte[] {
- (byte) 0x30, (byte) 0x82, (byte) 0x02, (byte) 0x78, (byte) 0x02, (byte) 0x01,
- (byte) 0x00, (byte) 0x30, (byte) 0x0d, (byte) 0x06, (byte) 0x09, (byte) 0x2a,
- (byte) 0x86, (byte) 0x48, (byte) 0x86, (byte) 0xf7, (byte) 0x0d, (byte) 0x01,
- (byte) 0x01, (byte) 0x01, (byte) 0x05, (byte) 0x00, (byte) 0x04, (byte) 0x82,
- (byte) 0x02, (byte) 0x62, (byte) 0x30, (byte) 0x82, (byte) 0x02, (byte) 0x5e,
- (byte) 0x02, (byte) 0x01, (byte) 0x00, (byte) 0x02, (byte) 0x81, (byte) 0x81,
- (byte) 0x00, (byte) 0xce, (byte) 0x29, (byte) 0xeb, (byte) 0xf6, (byte) 0x5b,
- (byte) 0x25, (byte) 0xdc, (byte) 0xa1, (byte) 0xa6, (byte) 0x2c, (byte) 0x66,
- (byte) 0xcb, (byte) 0x20, (byte) 0x90, (byte) 0x27, (byte) 0x86, (byte) 0x8a,
- (byte) 0x44, (byte) 0x71, (byte) 0x50, (byte) 0xda, (byte) 0xd3, (byte) 0x02,
- (byte) 0x77, (byte) 0x55, (byte) 0xe9, (byte) 0xe8, (byte) 0x08, (byte) 0xf3,
- (byte) 0x36, (byte) 0x9a, (byte) 0xae, (byte) 0xab, (byte) 0x04, (byte) 0x6d,
- (byte) 0x00, (byte) 0x99, (byte) 0xbf, (byte) 0x7d, (byte) 0x0f, (byte) 0x67,
- (byte) 0x8b, (byte) 0x1d, (byte) 0xd4, (byte) 0x2b, (byte) 0x7c, (byte) 0xcb,
- (byte) 0xcd, (byte) 0x33, (byte) 0xc7, (byte) 0x84, (byte) 0x30, (byte) 0xe2,
- (byte) 0x45, (byte) 0x21, (byte) 0xb3, (byte) 0x75, (byte) 0xf5, (byte) 0x79,
- (byte) 0x02, (byte) 0xda, (byte) 0x50, (byte) 0xa3, (byte) 0x8b, (byte) 0xce,
- (byte) 0xc3, (byte) 0x8e, (byte) 0x0f, (byte) 0x25, (byte) 0xeb, (byte) 0x08,
- (byte) 0x2c, (byte) 0xdd, (byte) 0x1c, (byte) 0xcf, (byte) 0xff, (byte) 0x3b,
- (byte) 0xde, (byte) 0xb6, (byte) 0xaa, (byte) 0x2a, (byte) 0xa9, (byte) 0xc4,
- (byte) 0x8a, (byte) 0x24, (byte) 0x24, (byte) 0xe6, (byte) 0x29, (byte) 0x0d,
- (byte) 0x98, (byte) 0x4c, (byte) 0x32, (byte) 0xa1, (byte) 0x7b, (byte) 0x23,
- (byte) 0x2b, (byte) 0x42, (byte) 0x30, (byte) 0xee, (byte) 0x78, (byte) 0x08,
- (byte) 0x47, (byte) 0xad, (byte) 0xf2, (byte) 0x96, (byte) 0xd5, (byte) 0xf1,
- (byte) 0x62, (byte) 0x42, (byte) 0x2d, (byte) 0x35, (byte) 0x19, (byte) 0xb4,
- (byte) 0x3c, (byte) 0xc9, (byte) 0xc3, (byte) 0x5f, (byte) 0x03, (byte) 0x16,
- (byte) 0x3a, (byte) 0x23, (byte) 0xac, (byte) 0xcb, (byte) 0xce, (byte) 0x9e,
- (byte) 0x51, (byte) 0x2e, (byte) 0x6d, (byte) 0x02, (byte) 0x03, (byte) 0x01,
- (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x81, (byte) 0x80, (byte) 0x16,
- (byte) 0x59, (byte) 0xc3, (byte) 0x24, (byte) 0x1d, (byte) 0x33, (byte) 0x98,
- (byte) 0x9c, (byte) 0xc9, (byte) 0xc8, (byte) 0x2c, (byte) 0x88, (byte) 0xbf,
- (byte) 0x0a, (byte) 0x01, (byte) 0xce, (byte) 0xfb, (byte) 0x34, (byte) 0x7a,
- (byte) 0x58, (byte) 0x7a, (byte) 0xb0, (byte) 0xbf, (byte) 0xa6, (byte) 0xb2,
- (byte) 0x60, (byte) 0xbe, (byte) 0x70, (byte) 0x21, (byte) 0xf5, (byte) 0xfc,
- (byte) 0x85, (byte) 0x0d, (byte) 0x33, (byte) 0x58, (byte) 0xa1, (byte) 0xe5,
- (byte) 0x09, (byte) 0x36, (byte) 0x84, (byte) 0xb2, (byte) 0x04, (byte) 0x0a,
- (byte) 0x02, (byte) 0xd3, (byte) 0x88, (byte) 0x1f, (byte) 0x0c, (byte) 0x2b,
- (byte) 0x1d, (byte) 0xe9, (byte) 0x3d, (byte) 0xe7, (byte) 0x79, (byte) 0xf9,
- (byte) 0x32, (byte) 0x5c, (byte) 0x8a, (byte) 0x75, (byte) 0x49, (byte) 0x12,
- (byte) 0xe4, (byte) 0x05, (byte) 0x26, (byte) 0xd4, (byte) 0x2e, (byte) 0x9e,
- (byte) 0x1f, (byte) 0xcc, (byte) 0x54, (byte) 0xad, (byte) 0x33, (byte) 0x8d,
- (byte) 0x99, (byte) 0x00, (byte) 0xdc, (byte) 0xf5, (byte) 0xb4, (byte) 0xa2,
- (byte) 0x2f, (byte) 0xba, (byte) 0xe5, (byte) 0x62, (byte) 0x30, (byte) 0x6d,
- (byte) 0xe6, (byte) 0x3d, (byte) 0xeb, (byte) 0x24, (byte) 0xc2, (byte) 0xdc,
- (byte) 0x5f, (byte) 0xb7, (byte) 0x16, (byte) 0x35, (byte) 0xa3, (byte) 0x98,
- (byte) 0x98, (byte) 0xa8, (byte) 0xef, (byte) 0xe8, (byte) 0xc4, (byte) 0x96,
- (byte) 0x6d, (byte) 0x38, (byte) 0xab, (byte) 0x26, (byte) 0x6d, (byte) 0x30,
- (byte) 0xc2, (byte) 0xa0, (byte) 0x44, (byte) 0xe4, (byte) 0xff, (byte) 0x7e,
- (byte) 0xbe, (byte) 0x7c, (byte) 0x33, (byte) 0xa5, (byte) 0x10, (byte) 0xad,
- (byte) 0xd7, (byte) 0x1e, (byte) 0x13, (byte) 0x20, (byte) 0xb3, (byte) 0x1f,
- (byte) 0x41, (byte) 0x02, (byte) 0x41, (byte) 0x00, (byte) 0xf1, (byte) 0x89,
- (byte) 0x07, (byte) 0x0f, (byte) 0xe8, (byte) 0xcf, (byte) 0xab, (byte) 0x13,
- (byte) 0x2a, (byte) 0x8f, (byte) 0x88, (byte) 0x80, (byte) 0x11, (byte) 0x9a,
- (byte) 0x79, (byte) 0xb6, (byte) 0x59, (byte) 0x3a, (byte) 0x50, (byte) 0x6e,
- (byte) 0x57, (byte) 0x37, (byte) 0xab, (byte) 0x2a, (byte) 0xd2, (byte) 0xaa,
- (byte) 0xd9, (byte) 0x72, (byte) 0x73, (byte) 0xff, (byte) 0x8b, (byte) 0x47,
- (byte) 0x76, (byte) 0xdd, (byte) 0xdc, (byte) 0xf5, (byte) 0x97, (byte) 0x44,
- (byte) 0x3a, (byte) 0x78, (byte) 0xbe, (byte) 0x17, (byte) 0xb4, (byte) 0x22,
- (byte) 0x6f, (byte) 0xe5, (byte) 0x23, (byte) 0x70, (byte) 0x1d, (byte) 0x10,
- (byte) 0x5d, (byte) 0xba, (byte) 0x16, (byte) 0x81, (byte) 0xf1, (byte) 0x45,
- (byte) 0xce, (byte) 0x30, (byte) 0xb4, (byte) 0xab, (byte) 0x80, (byte) 0xe4,
- (byte) 0x98, (byte) 0x31, (byte) 0x02, (byte) 0x41, (byte) 0x00, (byte) 0xda,
- (byte) 0x82, (byte) 0x9d, (byte) 0x3f, (byte) 0xca, (byte) 0x2f, (byte) 0xe1,
- (byte) 0xd4, (byte) 0x86, (byte) 0x77, (byte) 0x48, (byte) 0xa6, (byte) 0xab,
- (byte) 0xab, (byte) 0x1c, (byte) 0x42, (byte) 0x5c, (byte) 0xd5, (byte) 0xc7,
- (byte) 0x46, (byte) 0x59, (byte) 0x91, (byte) 0x3f, (byte) 0xfc, (byte) 0xcc,
- (byte) 0xec, (byte) 0xc2, (byte) 0x40, (byte) 0x12, (byte) 0x2c, (byte) 0x8d,
- (byte) 0x1f, (byte) 0xa2, (byte) 0x18, (byte) 0x88, (byte) 0xee, (byte) 0x82,
- (byte) 0x4a, (byte) 0x5a, (byte) 0x5e, (byte) 0x88, (byte) 0x20, (byte) 0xe3,
- (byte) 0x7b, (byte) 0xe0, (byte) 0xd8, (byte) 0x3a, (byte) 0x52, (byte) 0x9a,
- (byte) 0x26, (byte) 0x6a, (byte) 0x04, (byte) 0xec, (byte) 0xe8, (byte) 0xb9,
- (byte) 0x48, (byte) 0x40, (byte) 0xe1, (byte) 0xe1, (byte) 0x83, (byte) 0xa6,
- (byte) 0x67, (byte) 0xa6, (byte) 0xfd, (byte) 0x02, (byte) 0x41, (byte) 0x00,
- (byte) 0x89, (byte) 0x72, (byte) 0x3e, (byte) 0xb0, (byte) 0x90, (byte) 0xfd,
- (byte) 0x4c, (byte) 0x0e, (byte) 0xd6, (byte) 0x13, (byte) 0x63, (byte) 0xcb,
- (byte) 0xed, (byte) 0x38, (byte) 0x88, (byte) 0xb6, (byte) 0x79, (byte) 0xc4,
- (byte) 0x33, (byte) 0x6c, (byte) 0xf6, (byte) 0xf8, (byte) 0xd8, (byte) 0xd0,
- (byte) 0xbf, (byte) 0x9d, (byte) 0x35, (byte) 0xac, (byte) 0x69, (byte) 0xd2,
- (byte) 0x2b, (byte) 0xc1, (byte) 0xf9, (byte) 0x24, (byte) 0x7b, (byte) 0xce,
- (byte) 0xcd, (byte) 0xcb, (byte) 0xa7, (byte) 0xb2, (byte) 0x7a, (byte) 0x0a,
- (byte) 0x27, (byte) 0x19, (byte) 0xc9, (byte) 0xaf, (byte) 0x0d, (byte) 0x21,
- (byte) 0x89, (byte) 0x88, (byte) 0x7c, (byte) 0xad, (byte) 0x9e, (byte) 0x8d,
- (byte) 0x47, (byte) 0x6d, (byte) 0x3f, (byte) 0xce, (byte) 0x7b, (byte) 0xa1,
- (byte) 0x74, (byte) 0xf1, (byte) 0xa0, (byte) 0xa1, (byte) 0x02, (byte) 0x41,
- (byte) 0x00, (byte) 0xd9, (byte) 0xa8, (byte) 0xf5, (byte) 0xfe, (byte) 0xce,
- (byte) 0xe6, (byte) 0x77, (byte) 0x6b, (byte) 0xfe, (byte) 0x2d, (byte) 0xe0,
- (byte) 0x1e, (byte) 0xb6, (byte) 0x2e, (byte) 0x12, (byte) 0x4e, (byte) 0x40,
- (byte) 0xaf, (byte) 0x6a, (byte) 0x7b, (byte) 0x37, (byte) 0x49, (byte) 0x2a,
- (byte) 0x96, (byte) 0x25, (byte) 0x83, (byte) 0x49, (byte) 0xd4, (byte) 0x0c,
- (byte) 0xc6, (byte) 0x78, (byte) 0x25, (byte) 0x24, (byte) 0x90, (byte) 0x90,
- (byte) 0x06, (byte) 0x15, (byte) 0x9e, (byte) 0xfe, (byte) 0xf9, (byte) 0xdf,
- (byte) 0x5b, (byte) 0xf3, (byte) 0x7e, (byte) 0x38, (byte) 0x70, (byte) 0xeb,
- (byte) 0x57, (byte) 0xd0, (byte) 0xd9, (byte) 0xa7, (byte) 0x0e, (byte) 0x14,
- (byte) 0xf7, (byte) 0x95, (byte) 0x68, (byte) 0xd5, (byte) 0xc8, (byte) 0xab,
- (byte) 0x9d, (byte) 0x3a, (byte) 0x2b, (byte) 0x51, (byte) 0xf9, (byte) 0x02,
- (byte) 0x41, (byte) 0x00, (byte) 0x96, (byte) 0xdf, (byte) 0xe9, (byte) 0x67,
- (byte) 0x6c, (byte) 0xdc, (byte) 0x90, (byte) 0x14, (byte) 0xb4, (byte) 0x1d,
- (byte) 0x22, (byte) 0x33, (byte) 0x4a, (byte) 0x31, (byte) 0xc1, (byte) 0x9d,
- (byte) 0x2e, (byte) 0xff, (byte) 0x9a, (byte) 0x2a, (byte) 0x95, (byte) 0x4b,
- (byte) 0x27, (byte) 0x74, (byte) 0xcb, (byte) 0x21, (byte) 0xc3, (byte) 0xd2,
- (byte) 0x0b, (byte) 0xb2, (byte) 0x46, (byte) 0x87, (byte) 0xf8, (byte) 0x28,
- (byte) 0x01, (byte) 0x8b, (byte) 0xd8, (byte) 0xb9, (byte) 0x4b, (byte) 0xcd,
- (byte) 0x9a, (byte) 0x96, (byte) 0x41, (byte) 0x0e, (byte) 0x36, (byte) 0x6d,
- (byte) 0x40, (byte) 0x42, (byte) 0xbc, (byte) 0xd9, (byte) 0xd3, (byte) 0x7b,
- (byte) 0xbc, (byte) 0xa7, (byte) 0x92, (byte) 0x90, (byte) 0xdd, (byte) 0xa1,
- (byte) 0x9c, (byte) 0xce, (byte) 0xa1, (byte) 0x87, (byte) 0x11, (byte) 0x51
- };
- public static final PrivateKey RSA_KEY1 = loadPrivateKey("RSA", FAKE_RSA_KEY_1);
-
- private static final String CA_SUITE_B_RSA3072_CERT_STRING =
- "-----BEGIN CERTIFICATE-----\n"
- + "MIIEnTCCAwWgAwIBAgIUD87Y8fFLzLr1HQ/64aEnjNq2R/4wDQYJKoZIhvcNAQEM\n"
- + "BQAwXjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQwwCgYDVQQHDANNVFYxEDAO\n"
- + "BgNVBAoMB0FuZHJvaWQxDjAMBgNVBAsMBVdpLUZpMRIwEAYDVQQDDAl1bml0ZXN0\n"
- + "Q0EwHhcNMjAwNzIxMDIxNzU0WhcNMzAwNTMwMDIxNzU0WjBeMQswCQYDVQQGEwJV\n"
- + "UzELMAkGA1UECAwCQ0ExDDAKBgNVBAcMA01UVjEQMA4GA1UECgwHQW5kcm9pZDEO\n"
- + "MAwGA1UECwwFV2ktRmkxEjAQBgNVBAMMCXVuaXRlc3RDQTCCAaIwDQYJKoZIhvcN\n"
- + "AQEBBQADggGPADCCAYoCggGBAMtrsT0otlxh0QS079KpRRbU1PQjCihSoltXnrxF\n"
- + "sTWZs2weVEeYVyYU5LaauCDDgISCMtjtfbfylMBeYjpWB5hYzYQOiTzo0anWhMyb\n"
- + "Ngb7gpMVZuIl6lwMYRyVRKwHWnTo2EUg1ZzW5rGe5fs/KHj6//hoNFm+3Oju0TQd\n"
- + "nraQULpoERPF5B7p85Cssk8uNbviBfZXvtCuJ4N6w7PNceOY/9bbwc1mC+pPZmzV\n"
- + "SOAg0vvbIQRzChm63C3jBC3xmxSOOZVrKN4zKDG2s8P0oCNGt0NlgRMrgbPRekzg\n"
- + "4avkbA0vTuc2AyriTEYkdea/Mt4EpRg9XuOb43U/GJ/d/vQv2/9fsxhXmsZrn8kr\n"
- + "Qo5MMHJFUd96GgHmvYSU3Mf/5r8gF626lvqHioGuTAuHUSnr02ri1WUxZ15LDRgY\n"
- + "quMjDCFZfucjJPDAdtiHcFSej/4SLJlN39z8oKKNPn3aL9Gv49oAKs9S8tfDVzMk\n"
- + "fDLROQFHFuW715GnnMgEAoOpRwIDAQABo1MwUTAdBgNVHQ4EFgQUeVuGmSVN4ARs\n"
- + "mesUMWSJ2qWLbxUwHwYDVR0jBBgwFoAUeVuGmSVN4ARsmesUMWSJ2qWLbxUwDwYD\n"
- + "VR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQwFAAOCAYEAit1Lo/hegZpPuT9dlWZJ\n"
- + "bC8JvAf95O8lnn6LFb69pgYOHCLgCIlvYXu9rdBUJgZo+V1MzJJljiO6RxWRfKbQ\n"
- + "8WBYkoqR1EqriR3Kn8q/SjIZCdFSaznTyU1wQMveBQ6RJWXSUhYVfE9RjyFTp7B4\n"
- + "UyH2uCluR/0T06HQNGfH5XpIYQqCk1Zgng5lmEmheLDPoJpa92lKeQFJMC6eYz9g\n"
- + "lF1GHxPxkPfbMJ6ZDp5X6Yopu6Q6uEXhVKM/iQVcgzRkx9rid+xTYl+nOKyK/XfC\n"
- + "z8P0/TFIoPTW02DLge5wKagdoCpy1B7HdrAXyUjoH4B8MsUkq3kYPFSjPzScuTtV\n"
- + "kUuDw5ipCNeXCRnhbYqRDk6PX5GUu2cmN9jtaH3tbgm3fKNOsd/BO1fLIl7qjXlR\n"
- + "27HHbC0JXjNvlm2DLp23v4NTxS7WZGYsxyUj5DZrxBxqCsTXu/01w1BrQKWKh9FM\n"
- + "aVrlA8omfVODK2CSuw+KhEMHepRv/AUgsLl4L4+RMoa+\n"
- + "-----END CERTIFICATE-----\n";
- public static final X509Certificate CA_SUITE_B_RSA3072_CERT =
- loadCertificate(CA_SUITE_B_RSA3072_CERT_STRING);
-
- private static final String CA_SUITE_B_ECDSA_CERT_STRING =
- "-----BEGIN CERTIFICATE-----\n"
- + "MIICTzCCAdSgAwIBAgIUdnLttwNPnQzFufplGOr9bTrGCqMwCgYIKoZIzj0EAwMw\n"
- + "XjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQwwCgYDVQQHDANNVFYxEDAOBgNV\n"
- + "BAoMB0FuZHJvaWQxDjAMBgNVBAsMBVdpLUZpMRIwEAYDVQQDDAl1bml0ZXN0Q0Ew\n"
- + "HhcNMjAwNzIxMDIyNDA1WhcNMzAwNTMwMDIyNDA1WjBeMQswCQYDVQQGEwJVUzEL\n"
- + "MAkGA1UECAwCQ0ExDDAKBgNVBAcMA01UVjEQMA4GA1UECgwHQW5kcm9pZDEOMAwG\n"
- + "A1UECwwFV2ktRmkxEjAQBgNVBAMMCXVuaXRlc3RDQTB2MBAGByqGSM49AgEGBSuB\n"
- + "BAAiA2IABFmntXwk9icqhDQFUP1xy04WyEpaGW4q6Q+8pujlSl/X3iotPZ++GZfp\n"
- + "Mfv3YDHDBl6sELPQ2BEjyPXmpsKjOUdiUe69e88oGEdeqT2xXiQ6uzpTfJD4170i\n"
- + "O/TwLrQGKKNTMFEwHQYDVR0OBBYEFCjptsX3g4g5W0L4oEP6N3gfyiZXMB8GA1Ud\n"
- + "IwQYMBaAFCjptsX3g4g5W0L4oEP6N3gfyiZXMA8GA1UdEwEB/wQFMAMBAf8wCgYI\n"
- + "KoZIzj0EAwMDaQAwZgIxAK61brUYRbLmQKiaEboZgrHtnPAcGo7Yzx3MwHecx3Dm\n"
- + "5soIeLVYc8bPYN1pbhXW1gIxALdEe2sh03nBHyQH4adYoZungoCwt8mp/7sJFxou\n"
- + "9UnRegyBgGzf74ROWdpZHzh+Pg==\n"
- + "-----END CERTIFICATE-----\n";
- public static final X509Certificate CA_SUITE_B_ECDSA_CERT =
- loadCertificate(CA_SUITE_B_ECDSA_CERT_STRING);
-
- private static final String CLIENT_SUITE_B_RSA3072_CERT_STRING =
- "-----BEGIN CERTIFICATE-----\n"
- + "MIIERzCCAq8CFDopjyNgaj+c2TN2k06h7okEWpHJMA0GCSqGSIb3DQEBDAUAMF4x\n"
- + "CzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTEMMAoGA1UEBwwDTVRWMRAwDgYDVQQK\n"
- + "DAdBbmRyb2lkMQ4wDAYDVQQLDAVXaS1GaTESMBAGA1UEAwwJdW5pdGVzdENBMB4X\n"
- + "DTIwMDcyMTAyMjkxMVoXDTMwMDUzMDAyMjkxMVowYjELMAkGA1UEBhMCVVMxCzAJ\n"
- + "BgNVBAgMAkNBMQwwCgYDVQQHDANNVFYxEDAOBgNVBAoMB0FuZHJvaWQxDjAMBgNV\n"
- + "BAsMBVdpLUZpMRYwFAYDVQQDDA11bml0ZXN0Q2xpZW50MIIBojANBgkqhkiG9w0B\n"
- + "AQEFAAOCAY8AMIIBigKCAYEAwSK3C5K5udtCKTnE14e8z2cZvwmB4Xe+a8+7QLud\n"
- + "Hooc/lQzClgK4MbVUC0D3FE+U32C78SxKoTaRWtvPmNm+UaFT8KkwyUno/dv+2XD\n"
- + "pd/zARQ+3FwAfWopAhEyCVSxwsCa+slQ4juRIMIuUC1Mm0NaptZyM3Tj/ICQEfpk\n"
- + "o9qVIbiK6eoJMTkY8EWfAn7RTFdfR1OLuO0mVOjgLW9/+upYv6hZ19nAMAxw4QTJ\n"
- + "x7lLwALX7B+tDYNEZHDqYL2zyvQWAj2HClere8QYILxkvktgBg2crEJJe4XbDH7L\n"
- + "A3rrXmsiqf1ZbfFFEzK9NFqovL+qGh+zIP+588ShJFO9H/RDnDpiTnAFTWXQdTwg\n"
- + "szSS0Vw2PB+JqEABAa9DeMvXT1Oy+NY3ItPHyy63nQZVI2rXANw4NhwS0Z6DF+Qs\n"
- + "TNrj+GU7e4SG/EGR8SvldjYfQTWFLg1l/UT1hOOkQZwdsaW1zgKyeuiFB2KdMmbA\n"
- + "Sq+Ux1L1KICo0IglwWcB/8nnAgMBAAEwDQYJKoZIhvcNAQEMBQADggGBAMYwJkNw\n"
- + "BaCviKFmReDTMwWPRy4AMNViEeqAXgERwDEKwM7efjsaj5gctWfKsxX6UdLzkhgg\n"
- + "6S/T6PxVWKzJ6l7SoOuTa6tMQOZp+h3R1mdfEQbw8B5cXBxZ+batzAai6Fiy1FKS\n"
- + "/ka3INbcGfYuIYghfTrb4/NJKN06ZaQ1bpPwq0e4gN7800T2nbawvSf7r+8ZLcG3\n"
- + "6bGCjRMwDSIipNvOwoj3TG315XC7TccX5difQ4sKOY+d2MkVJ3RiO0Ciw2ZbEW8d\n"
- + "1FH5vUQJWnBUfSFznosGzLwH3iWfqlP+27jNE+qB2igEwCRFgVAouURx5ou43xuX\n"
- + "qf6JkdI3HTJGLIWxkp7gOeln4dEaYzKjYw+P0VqJvKVqQ0IXiLjHgE0J9p0vgyD6\n"
- + "HVVcP7U8RgqrbIjL1QgHU4KBhGi+WSUh/mRplUCNvHgcYdcHi/gHpj/j6ubwqIGV\n"
- + "z4iSolAHYTmBWcLyE0NgpzE6ntp+53r2KaUJA99l2iGVzbWTwqPSm0XAVw==\n"
- + "-----END CERTIFICATE-----\n";
- public static final X509Certificate CLIENT_SUITE_B_RSA3072_CERT =
- loadCertificate(CLIENT_SUITE_B_RSA3072_CERT_STRING);
-
- private static final byte[] CLIENT_SUITE_B_RSA3072_KEY_DATA = new byte[]{
- (byte) 0x30, (byte) 0x82, (byte) 0x06, (byte) 0xfe, (byte) 0x02, (byte) 0x01,
- (byte) 0x00, (byte) 0x30, (byte) 0x0d, (byte) 0x06, (byte) 0x09, (byte) 0x2a,
- (byte) 0x86, (byte) 0x48, (byte) 0x86, (byte) 0xf7, (byte) 0x0d, (byte) 0x01,
- (byte) 0x01, (byte) 0x01, (byte) 0x05, (byte) 0x00, (byte) 0x04, (byte) 0x82,
- (byte) 0x06, (byte) 0xe8, (byte) 0x30, (byte) 0x82, (byte) 0x06, (byte) 0xe4,
- (byte) 0x02, (byte) 0x01, (byte) 0x00, (byte) 0x02, (byte) 0x82, (byte) 0x01,
- (byte) 0x81, (byte) 0x00, (byte) 0xc1, (byte) 0x22, (byte) 0xb7, (byte) 0x0b,
- (byte) 0x92, (byte) 0xb9, (byte) 0xb9, (byte) 0xdb, (byte) 0x42, (byte) 0x29,
- (byte) 0x39, (byte) 0xc4, (byte) 0xd7, (byte) 0x87, (byte) 0xbc, (byte) 0xcf,
- (byte) 0x67, (byte) 0x19, (byte) 0xbf, (byte) 0x09, (byte) 0x81, (byte) 0xe1,
- (byte) 0x77, (byte) 0xbe, (byte) 0x6b, (byte) 0xcf, (byte) 0xbb, (byte) 0x40,
- (byte) 0xbb, (byte) 0x9d, (byte) 0x1e, (byte) 0x8a, (byte) 0x1c, (byte) 0xfe,
- (byte) 0x54, (byte) 0x33, (byte) 0x0a, (byte) 0x58, (byte) 0x0a, (byte) 0xe0,
- (byte) 0xc6, (byte) 0xd5, (byte) 0x50, (byte) 0x2d, (byte) 0x03, (byte) 0xdc,
- (byte) 0x51, (byte) 0x3e, (byte) 0x53, (byte) 0x7d, (byte) 0x82, (byte) 0xef,
- (byte) 0xc4, (byte) 0xb1, (byte) 0x2a, (byte) 0x84, (byte) 0xda, (byte) 0x45,
- (byte) 0x6b, (byte) 0x6f, (byte) 0x3e, (byte) 0x63, (byte) 0x66, (byte) 0xf9,
- (byte) 0x46, (byte) 0x85, (byte) 0x4f, (byte) 0xc2, (byte) 0xa4, (byte) 0xc3,
- (byte) 0x25, (byte) 0x27, (byte) 0xa3, (byte) 0xf7, (byte) 0x6f, (byte) 0xfb,
- (byte) 0x65, (byte) 0xc3, (byte) 0xa5, (byte) 0xdf, (byte) 0xf3, (byte) 0x01,
- (byte) 0x14, (byte) 0x3e, (byte) 0xdc, (byte) 0x5c, (byte) 0x00, (byte) 0x7d,
- (byte) 0x6a, (byte) 0x29, (byte) 0x02, (byte) 0x11, (byte) 0x32, (byte) 0x09,
- (byte) 0x54, (byte) 0xb1, (byte) 0xc2, (byte) 0xc0, (byte) 0x9a, (byte) 0xfa,
- (byte) 0xc9, (byte) 0x50, (byte) 0xe2, (byte) 0x3b, (byte) 0x91, (byte) 0x20,
- (byte) 0xc2, (byte) 0x2e, (byte) 0x50, (byte) 0x2d, (byte) 0x4c, (byte) 0x9b,
- (byte) 0x43, (byte) 0x5a, (byte) 0xa6, (byte) 0xd6, (byte) 0x72, (byte) 0x33,
- (byte) 0x74, (byte) 0xe3, (byte) 0xfc, (byte) 0x80, (byte) 0x90, (byte) 0x11,
- (byte) 0xfa, (byte) 0x64, (byte) 0xa3, (byte) 0xda, (byte) 0x95, (byte) 0x21,
- (byte) 0xb8, (byte) 0x8a, (byte) 0xe9, (byte) 0xea, (byte) 0x09, (byte) 0x31,
- (byte) 0x39, (byte) 0x18, (byte) 0xf0, (byte) 0x45, (byte) 0x9f, (byte) 0x02,
- (byte) 0x7e, (byte) 0xd1, (byte) 0x4c, (byte) 0x57, (byte) 0x5f, (byte) 0x47,
- (byte) 0x53, (byte) 0x8b, (byte) 0xb8, (byte) 0xed, (byte) 0x26, (byte) 0x54,
- (byte) 0xe8, (byte) 0xe0, (byte) 0x2d, (byte) 0x6f, (byte) 0x7f, (byte) 0xfa,
- (byte) 0xea, (byte) 0x58, (byte) 0xbf, (byte) 0xa8, (byte) 0x59, (byte) 0xd7,
- (byte) 0xd9, (byte) 0xc0, (byte) 0x30, (byte) 0x0c, (byte) 0x70, (byte) 0xe1,
- (byte) 0x04, (byte) 0xc9, (byte) 0xc7, (byte) 0xb9, (byte) 0x4b, (byte) 0xc0,
- (byte) 0x02, (byte) 0xd7, (byte) 0xec, (byte) 0x1f, (byte) 0xad, (byte) 0x0d,
- (byte) 0x83, (byte) 0x44, (byte) 0x64, (byte) 0x70, (byte) 0xea, (byte) 0x60,
- (byte) 0xbd, (byte) 0xb3, (byte) 0xca, (byte) 0xf4, (byte) 0x16, (byte) 0x02,
- (byte) 0x3d, (byte) 0x87, (byte) 0x0a, (byte) 0x57, (byte) 0xab, (byte) 0x7b,
- (byte) 0xc4, (byte) 0x18, (byte) 0x20, (byte) 0xbc, (byte) 0x64, (byte) 0xbe,
- (byte) 0x4b, (byte) 0x60, (byte) 0x06, (byte) 0x0d, (byte) 0x9c, (byte) 0xac,
- (byte) 0x42, (byte) 0x49, (byte) 0x7b, (byte) 0x85, (byte) 0xdb, (byte) 0x0c,
- (byte) 0x7e, (byte) 0xcb, (byte) 0x03, (byte) 0x7a, (byte) 0xeb, (byte) 0x5e,
- (byte) 0x6b, (byte) 0x22, (byte) 0xa9, (byte) 0xfd, (byte) 0x59, (byte) 0x6d,
- (byte) 0xf1, (byte) 0x45, (byte) 0x13, (byte) 0x32, (byte) 0xbd, (byte) 0x34,
- (byte) 0x5a, (byte) 0xa8, (byte) 0xbc, (byte) 0xbf, (byte) 0xaa, (byte) 0x1a,
- (byte) 0x1f, (byte) 0xb3, (byte) 0x20, (byte) 0xff, (byte) 0xb9, (byte) 0xf3,
- (byte) 0xc4, (byte) 0xa1, (byte) 0x24, (byte) 0x53, (byte) 0xbd, (byte) 0x1f,
- (byte) 0xf4, (byte) 0x43, (byte) 0x9c, (byte) 0x3a, (byte) 0x62, (byte) 0x4e,
- (byte) 0x70, (byte) 0x05, (byte) 0x4d, (byte) 0x65, (byte) 0xd0, (byte) 0x75,
- (byte) 0x3c, (byte) 0x20, (byte) 0xb3, (byte) 0x34, (byte) 0x92, (byte) 0xd1,
- (byte) 0x5c, (byte) 0x36, (byte) 0x3c, (byte) 0x1f, (byte) 0x89, (byte) 0xa8,
- (byte) 0x40, (byte) 0x01, (byte) 0x01, (byte) 0xaf, (byte) 0x43, (byte) 0x78,
- (byte) 0xcb, (byte) 0xd7, (byte) 0x4f, (byte) 0x53, (byte) 0xb2, (byte) 0xf8,
- (byte) 0xd6, (byte) 0x37, (byte) 0x22, (byte) 0xd3, (byte) 0xc7, (byte) 0xcb,
- (byte) 0x2e, (byte) 0xb7, (byte) 0x9d, (byte) 0x06, (byte) 0x55, (byte) 0x23,
- (byte) 0x6a, (byte) 0xd7, (byte) 0x00, (byte) 0xdc, (byte) 0x38, (byte) 0x36,
- (byte) 0x1c, (byte) 0x12, (byte) 0xd1, (byte) 0x9e, (byte) 0x83, (byte) 0x17,
- (byte) 0xe4, (byte) 0x2c, (byte) 0x4c, (byte) 0xda, (byte) 0xe3, (byte) 0xf8,
- (byte) 0x65, (byte) 0x3b, (byte) 0x7b, (byte) 0x84, (byte) 0x86, (byte) 0xfc,
- (byte) 0x41, (byte) 0x91, (byte) 0xf1, (byte) 0x2b, (byte) 0xe5, (byte) 0x76,
- (byte) 0x36, (byte) 0x1f, (byte) 0x41, (byte) 0x35, (byte) 0x85, (byte) 0x2e,
- (byte) 0x0d, (byte) 0x65, (byte) 0xfd, (byte) 0x44, (byte) 0xf5, (byte) 0x84,
- (byte) 0xe3, (byte) 0xa4, (byte) 0x41, (byte) 0x9c, (byte) 0x1d, (byte) 0xb1,
- (byte) 0xa5, (byte) 0xb5, (byte) 0xce, (byte) 0x02, (byte) 0xb2, (byte) 0x7a,
- (byte) 0xe8, (byte) 0x85, (byte) 0x07, (byte) 0x62, (byte) 0x9d, (byte) 0x32,
- (byte) 0x66, (byte) 0xc0, (byte) 0x4a, (byte) 0xaf, (byte) 0x94, (byte) 0xc7,
- (byte) 0x52, (byte) 0xf5, (byte) 0x28, (byte) 0x80, (byte) 0xa8, (byte) 0xd0,
- (byte) 0x88, (byte) 0x25, (byte) 0xc1, (byte) 0x67, (byte) 0x01, (byte) 0xff,
- (byte) 0xc9, (byte) 0xe7, (byte) 0x02, (byte) 0x03, (byte) 0x01, (byte) 0x00,
- (byte) 0x01, (byte) 0x02, (byte) 0x82, (byte) 0x01, (byte) 0x80, (byte) 0x04,
- (byte) 0xb1, (byte) 0xcc, (byte) 0x53, (byte) 0x3a, (byte) 0xb0, (byte) 0xcb,
- (byte) 0x04, (byte) 0xba, (byte) 0x59, (byte) 0xf8, (byte) 0x2e, (byte) 0x81,
- (byte) 0xb2, (byte) 0xa9, (byte) 0xf3, (byte) 0x3c, (byte) 0xa5, (byte) 0x52,
- (byte) 0x90, (byte) 0x6f, (byte) 0x98, (byte) 0xc4, (byte) 0x69, (byte) 0x5b,
- (byte) 0x83, (byte) 0x84, (byte) 0x20, (byte) 0xb1, (byte) 0xae, (byte) 0xc3,
- (byte) 0x04, (byte) 0x46, (byte) 0x6a, (byte) 0x24, (byte) 0x2f, (byte) 0xcd,
- (byte) 0x6b, (byte) 0x90, (byte) 0x70, (byte) 0x20, (byte) 0x45, (byte) 0x25,
- (byte) 0x1a, (byte) 0xc3, (byte) 0x02, (byte) 0x42, (byte) 0xf3, (byte) 0x49,
- (byte) 0xe2, (byte) 0x3e, (byte) 0x21, (byte) 0x87, (byte) 0xdd, (byte) 0x6a,
- (byte) 0x94, (byte) 0x2a, (byte) 0x1e, (byte) 0x0f, (byte) 0xdb, (byte) 0x77,
- (byte) 0x5f, (byte) 0xc1, (byte) 0x2c, (byte) 0x03, (byte) 0xfb, (byte) 0xcf,
- (byte) 0x91, (byte) 0x82, (byte) 0xa1, (byte) 0xbf, (byte) 0xb0, (byte) 0x73,
- (byte) 0xfa, (byte) 0xda, (byte) 0xbc, (byte) 0xf8, (byte) 0x9f, (byte) 0x45,
- (byte) 0xd3, (byte) 0xe8, (byte) 0xbb, (byte) 0x38, (byte) 0xfb, (byte) 0xc2,
- (byte) 0x2d, (byte) 0x76, (byte) 0x51, (byte) 0x96, (byte) 0x18, (byte) 0x03,
- (byte) 0x15, (byte) 0xd9, (byte) 0xea, (byte) 0x82, (byte) 0x25, (byte) 0x83,
- (byte) 0xff, (byte) 0x5c, (byte) 0x85, (byte) 0x06, (byte) 0x09, (byte) 0xb2,
- (byte) 0x46, (byte) 0x12, (byte) 0x64, (byte) 0x02, (byte) 0x74, (byte) 0x4f,
- (byte) 0xbc, (byte) 0x9a, (byte) 0x25, (byte) 0x18, (byte) 0x01, (byte) 0x07,
- (byte) 0x17, (byte) 0x25, (byte) 0x55, (byte) 0x7c, (byte) 0xdc, (byte) 0xe1,
- (byte) 0xd1, (byte) 0x5a, (byte) 0x2f, (byte) 0x25, (byte) 0xaf, (byte) 0xf6,
- (byte) 0x8f, (byte) 0xa4, (byte) 0x9a, (byte) 0x5a, (byte) 0x3a, (byte) 0xfe,
- (byte) 0x2e, (byte) 0x93, (byte) 0x24, (byte) 0xa0, (byte) 0x27, (byte) 0xac,
- (byte) 0x07, (byte) 0x75, (byte) 0x33, (byte) 0x01, (byte) 0x54, (byte) 0x23,
- (byte) 0x0f, (byte) 0xe8, (byte) 0x9f, (byte) 0xfa, (byte) 0x36, (byte) 0xe6,
- (byte) 0x3a, (byte) 0xd5, (byte) 0x78, (byte) 0xb0, (byte) 0xe4, (byte) 0x6a,
- (byte) 0x16, (byte) 0x50, (byte) 0xbd, (byte) 0x0f, (byte) 0x9f, (byte) 0x32,
- (byte) 0xa1, (byte) 0x6b, (byte) 0xf5, (byte) 0xa4, (byte) 0x34, (byte) 0x58,
- (byte) 0xb6, (byte) 0xa4, (byte) 0xb3, (byte) 0xc3, (byte) 0x83, (byte) 0x08,
- (byte) 0x18, (byte) 0xc7, (byte) 0xef, (byte) 0x95, (byte) 0xe2, (byte) 0x1b,
- (byte) 0xba, (byte) 0x35, (byte) 0x61, (byte) 0xa3, (byte) 0xb4, (byte) 0x30,
- (byte) 0xe0, (byte) 0xd1, (byte) 0xc1, (byte) 0xa2, (byte) 0x3a, (byte) 0xc6,
- (byte) 0xb4, (byte) 0xd2, (byte) 0x80, (byte) 0x5a, (byte) 0xaf, (byte) 0xa4,
- (byte) 0x54, (byte) 0x3c, (byte) 0x66, (byte) 0x5a, (byte) 0x1c, (byte) 0x4d,
- (byte) 0xe1, (byte) 0xd9, (byte) 0x98, (byte) 0x44, (byte) 0x01, (byte) 0x1b,
- (byte) 0x8c, (byte) 0xe9, (byte) 0x80, (byte) 0x54, (byte) 0x83, (byte) 0x3d,
- (byte) 0x96, (byte) 0x25, (byte) 0x41, (byte) 0x1c, (byte) 0xad, (byte) 0xae,
- (byte) 0x3b, (byte) 0x7a, (byte) 0xd7, (byte) 0x9d, (byte) 0x10, (byte) 0x7c,
- (byte) 0xd1, (byte) 0xa7, (byte) 0x96, (byte) 0x39, (byte) 0xa5, (byte) 0x2f,
- (byte) 0xbe, (byte) 0xc3, (byte) 0x2c, (byte) 0x64, (byte) 0x01, (byte) 0xfe,
- (byte) 0xa2, (byte) 0xd1, (byte) 0x6a, (byte) 0xcf, (byte) 0x4c, (byte) 0x76,
- (byte) 0x3b, (byte) 0xc8, (byte) 0x35, (byte) 0x21, (byte) 0xda, (byte) 0x98,
- (byte) 0xcf, (byte) 0xf9, (byte) 0x29, (byte) 0xff, (byte) 0x30, (byte) 0x59,
- (byte) 0x36, (byte) 0x53, (byte) 0x0b, (byte) 0xbb, (byte) 0xfa, (byte) 0xba,
- (byte) 0xc4, (byte) 0x03, (byte) 0x23, (byte) 0xe0, (byte) 0xd3, (byte) 0x33,
- (byte) 0xff, (byte) 0x32, (byte) 0xdb, (byte) 0x30, (byte) 0x64, (byte) 0xc7,
- (byte) 0x56, (byte) 0xca, (byte) 0x55, (byte) 0x14, (byte) 0xee, (byte) 0x58,
- (byte) 0xfe, (byte) 0x96, (byte) 0x7e, (byte) 0x1c, (byte) 0x34, (byte) 0x16,
- (byte) 0xeb, (byte) 0x76, (byte) 0x26, (byte) 0x48, (byte) 0xe2, (byte) 0xe5,
- (byte) 0x5c, (byte) 0xd5, (byte) 0x83, (byte) 0x37, (byte) 0xd9, (byte) 0x09,
- (byte) 0x71, (byte) 0xbc, (byte) 0x54, (byte) 0x25, (byte) 0xca, (byte) 0x2e,
- (byte) 0xdb, (byte) 0x36, (byte) 0x39, (byte) 0xcc, (byte) 0x3a, (byte) 0x81,
- (byte) 0x95, (byte) 0x9e, (byte) 0xf4, (byte) 0x01, (byte) 0xa7, (byte) 0xc0,
- (byte) 0x20, (byte) 0xce, (byte) 0x70, (byte) 0x55, (byte) 0x2c, (byte) 0xe0,
- (byte) 0x93, (byte) 0x72, (byte) 0xa6, (byte) 0x25, (byte) 0xda, (byte) 0x64,
- (byte) 0x19, (byte) 0x18, (byte) 0xd2, (byte) 0x31, (byte) 0xe2, (byte) 0x7c,
- (byte) 0xf2, (byte) 0x30, (byte) 0x9e, (byte) 0x8d, (byte) 0xc6, (byte) 0x14,
- (byte) 0x8a, (byte) 0x38, (byte) 0xf0, (byte) 0x94, (byte) 0xeb, (byte) 0xf4,
- (byte) 0x64, (byte) 0x92, (byte) 0x3d, (byte) 0x67, (byte) 0xa6, (byte) 0x2c,
- (byte) 0x52, (byte) 0xfc, (byte) 0x60, (byte) 0xca, (byte) 0x2a, (byte) 0xcf,
- (byte) 0x24, (byte) 0xd5, (byte) 0x42, (byte) 0x5f, (byte) 0xc7, (byte) 0x9f,
- (byte) 0xf3, (byte) 0xb4, (byte) 0xdf, (byte) 0x76, (byte) 0x6e, (byte) 0x53,
- (byte) 0xa1, (byte) 0x7b, (byte) 0xae, (byte) 0xa5, (byte) 0x84, (byte) 0x1f,
- (byte) 0xfa, (byte) 0xc0, (byte) 0xb4, (byte) 0x6c, (byte) 0xc9, (byte) 0x02,
- (byte) 0x81, (byte) 0xc1, (byte) 0x00, (byte) 0xf3, (byte) 0x17, (byte) 0xd9,
- (byte) 0x48, (byte) 0x17, (byte) 0x87, (byte) 0x84, (byte) 0x16, (byte) 0xea,
- (byte) 0x2d, (byte) 0x31, (byte) 0x1b, (byte) 0xce, (byte) 0xec, (byte) 0xaf,
- (byte) 0xdc, (byte) 0x6b, (byte) 0xaf, (byte) 0xc8, (byte) 0xf1, (byte) 0x40,
- (byte) 0xa7, (byte) 0x4f, (byte) 0xef, (byte) 0x48, (byte) 0x08, (byte) 0x5e,
- (byte) 0x9a, (byte) 0xd1, (byte) 0xc0, (byte) 0xb1, (byte) 0xfe, (byte) 0xe7,
- (byte) 0x03, (byte) 0xd5, (byte) 0x96, (byte) 0x01, (byte) 0xe8, (byte) 0x40,
- (byte) 0xca, (byte) 0x78, (byte) 0xcb, (byte) 0xb3, (byte) 0x28, (byte) 0x1a,
- (byte) 0xf0, (byte) 0xe5, (byte) 0xf6, (byte) 0x46, (byte) 0xef, (byte) 0xcd,
- (byte) 0x1a, (byte) 0x0f, (byte) 0x13, (byte) 0x2d, (byte) 0x38, (byte) 0xf8,
- (byte) 0xf7, (byte) 0x88, (byte) 0x21, (byte) 0x15, (byte) 0xce, (byte) 0x48,
- (byte) 0xf4, (byte) 0x92, (byte) 0x7e, (byte) 0x9b, (byte) 0x2e, (byte) 0x2f,
- (byte) 0x22, (byte) 0x3e, (byte) 0x5c, (byte) 0x67, (byte) 0xd7, (byte) 0x58,
- (byte) 0xf6, (byte) 0xef, (byte) 0x1f, (byte) 0xb4, (byte) 0x04, (byte) 0xc7,
- (byte) 0xfd, (byte) 0x8c, (byte) 0x4e, (byte) 0x27, (byte) 0x9e, (byte) 0xb9,
- (byte) 0xef, (byte) 0x0f, (byte) 0xf7, (byte) 0x4a, (byte) 0xc2, (byte) 0xf4,
- (byte) 0x64, (byte) 0x6b, (byte) 0xe0, (byte) 0xfb, (byte) 0xe3, (byte) 0x45,
- (byte) 0xd5, (byte) 0x37, (byte) 0xa0, (byte) 0x2a, (byte) 0xc6, (byte) 0xf3,
- (byte) 0xf6, (byte) 0xcc, (byte) 0xb5, (byte) 0x94, (byte) 0xbf, (byte) 0x56,
- (byte) 0xa0, (byte) 0x61, (byte) 0x36, (byte) 0x88, (byte) 0x35, (byte) 0xd5,
- (byte) 0xa5, (byte) 0xad, (byte) 0x20, (byte) 0x48, (byte) 0xda, (byte) 0x70,
- (byte) 0x35, (byte) 0xd9, (byte) 0x75, (byte) 0x66, (byte) 0xa5, (byte) 0xac,
- (byte) 0x86, (byte) 0x7a, (byte) 0x75, (byte) 0x49, (byte) 0x88, (byte) 0x40,
- (byte) 0xce, (byte) 0xb0, (byte) 0x6f, (byte) 0x57, (byte) 0x15, (byte) 0x54,
- (byte) 0xd3, (byte) 0x2f, (byte) 0x11, (byte) 0x9b, (byte) 0xe3, (byte) 0x87,
- (byte) 0xc8, (byte) 0x8d, (byte) 0x98, (byte) 0xc6, (byte) 0xe0, (byte) 0xbc,
- (byte) 0x85, (byte) 0xb9, (byte) 0x04, (byte) 0x43, (byte) 0xa9, (byte) 0x41,
- (byte) 0xce, (byte) 0x42, (byte) 0x1a, (byte) 0x57, (byte) 0x10, (byte) 0xd8,
- (byte) 0xe4, (byte) 0x6a, (byte) 0x51, (byte) 0x10, (byte) 0x0a, (byte) 0xec,
- (byte) 0xe4, (byte) 0x57, (byte) 0xc7, (byte) 0xee, (byte) 0xe9, (byte) 0xd6,
- (byte) 0xcb, (byte) 0x3e, (byte) 0xba, (byte) 0xfa, (byte) 0xe9, (byte) 0x0e,
- (byte) 0xed, (byte) 0x87, (byte) 0x04, (byte) 0x9a, (byte) 0x48, (byte) 0xba,
- (byte) 0xaf, (byte) 0x08, (byte) 0xf5, (byte) 0x02, (byte) 0x81, (byte) 0xc1,
- (byte) 0x00, (byte) 0xcb, (byte) 0x63, (byte) 0xd6, (byte) 0x54, (byte) 0xb6,
- (byte) 0xf3, (byte) 0xf3, (byte) 0x8c, (byte) 0xf8, (byte) 0xd0, (byte) 0xd2,
- (byte) 0x84, (byte) 0xc1, (byte) 0xf5, (byte) 0x12, (byte) 0xe0, (byte) 0x02,
- (byte) 0x80, (byte) 0x42, (byte) 0x92, (byte) 0x4e, (byte) 0xa4, (byte) 0x5c,
- (byte) 0xa5, (byte) 0x64, (byte) 0xec, (byte) 0xb7, (byte) 0xdc, (byte) 0xe0,
- (byte) 0x2d, (byte) 0x5d, (byte) 0xac, (byte) 0x0e, (byte) 0x24, (byte) 0x48,
- (byte) 0x13, (byte) 0x05, (byte) 0xe8, (byte) 0xff, (byte) 0x96, (byte) 0x93,
- (byte) 0xba, (byte) 0x3c, (byte) 0x88, (byte) 0xcc, (byte) 0x80, (byte) 0xf9,
- (byte) 0xdb, (byte) 0xa8, (byte) 0x4d, (byte) 0x86, (byte) 0x47, (byte) 0xc8,
- (byte) 0xbf, (byte) 0x34, (byte) 0x2d, (byte) 0xda, (byte) 0xb6, (byte) 0x28,
- (byte) 0xf0, (byte) 0x1e, (byte) 0xd2, (byte) 0x46, (byte) 0x0d, (byte) 0x6f,
- (byte) 0x36, (byte) 0x8e, (byte) 0x84, (byte) 0xd8, (byte) 0xaf, (byte) 0xf7,
- (byte) 0x69, (byte) 0x23, (byte) 0x77, (byte) 0xfb, (byte) 0xc5, (byte) 0x04,
- (byte) 0x08, (byte) 0x18, (byte) 0xac, (byte) 0x85, (byte) 0x80, (byte) 0x87,
- (byte) 0x1c, (byte) 0xfe, (byte) 0x8e, (byte) 0x5d, (byte) 0x00, (byte) 0x7f,
- (byte) 0x5b, (byte) 0x33, (byte) 0xf5, (byte) 0xdf, (byte) 0x70, (byte) 0x81,
- (byte) 0xad, (byte) 0x81, (byte) 0xf4, (byte) 0x5a, (byte) 0x37, (byte) 0x8a,
- (byte) 0x79, (byte) 0x09, (byte) 0xc5, (byte) 0x55, (byte) 0xab, (byte) 0x58,
- (byte) 0x7c, (byte) 0x47, (byte) 0xca, (byte) 0xa5, (byte) 0x80, (byte) 0x49,
- (byte) 0x5f, (byte) 0x71, (byte) 0x83, (byte) 0xfb, (byte) 0x3b, (byte) 0x06,
- (byte) 0xec, (byte) 0x75, (byte) 0x23, (byte) 0xc4, (byte) 0x32, (byte) 0xc7,
- (byte) 0x18, (byte) 0xf6, (byte) 0x82, (byte) 0x95, (byte) 0x98, (byte) 0x39,
- (byte) 0xf7, (byte) 0x92, (byte) 0x31, (byte) 0xc0, (byte) 0x89, (byte) 0xba,
- (byte) 0xd4, (byte) 0xd4, (byte) 0x58, (byte) 0x4e, (byte) 0x38, (byte) 0x35,
- (byte) 0x10, (byte) 0xb9, (byte) 0xf1, (byte) 0x27, (byte) 0xdc, (byte) 0xff,
- (byte) 0xc7, (byte) 0xb2, (byte) 0xba, (byte) 0x1f, (byte) 0x27, (byte) 0xaf,
- (byte) 0x99, (byte) 0xd5, (byte) 0xb0, (byte) 0x39, (byte) 0xe7, (byte) 0x43,
- (byte) 0x88, (byte) 0xd3, (byte) 0xce, (byte) 0x38, (byte) 0xc2, (byte) 0x99,
- (byte) 0x43, (byte) 0xfc, (byte) 0x8a, (byte) 0xe3, (byte) 0x60, (byte) 0x0d,
- (byte) 0x0a, (byte) 0xb8, (byte) 0xc4, (byte) 0x29, (byte) 0xca, (byte) 0x0d,
- (byte) 0x30, (byte) 0xaf, (byte) 0xca, (byte) 0xd0, (byte) 0xaa, (byte) 0x67,
- (byte) 0xb1, (byte) 0xdd, (byte) 0xdb, (byte) 0x7a, (byte) 0x11, (byte) 0xad,
- (byte) 0xeb, (byte) 0x02, (byte) 0x81, (byte) 0xc0, (byte) 0x71, (byte) 0xb8,
- (byte) 0xcf, (byte) 0x72, (byte) 0x35, (byte) 0x67, (byte) 0xb5, (byte) 0x38,
- (byte) 0x8f, (byte) 0x16, (byte) 0xd3, (byte) 0x29, (byte) 0x82, (byte) 0x35,
- (byte) 0x21, (byte) 0xd4, (byte) 0x49, (byte) 0x20, (byte) 0x74, (byte) 0x2d,
- (byte) 0xc0, (byte) 0xa4, (byte) 0x44, (byte) 0xf5, (byte) 0xd8, (byte) 0xc9,
- (byte) 0xe9, (byte) 0x90, (byte) 0x1d, (byte) 0xde, (byte) 0x3a, (byte) 0xa6,
- (byte) 0xd7, (byte) 0xe5, (byte) 0xe8, (byte) 0x4e, (byte) 0x83, (byte) 0xd7,
- (byte) 0xe6, (byte) 0x2f, (byte) 0x92, (byte) 0x31, (byte) 0x21, (byte) 0x3f,
- (byte) 0xfa, (byte) 0xd2, (byte) 0x85, (byte) 0x92, (byte) 0x1f, (byte) 0xff,
- (byte) 0x61, (byte) 0x00, (byte) 0xf6, (byte) 0xda, (byte) 0x6e, (byte) 0xc6,
- (byte) 0x7f, (byte) 0x5a, (byte) 0x35, (byte) 0x79, (byte) 0xdc, (byte) 0xdc,
- (byte) 0xa3, (byte) 0x2e, (byte) 0x9f, (byte) 0x35, (byte) 0xd1, (byte) 0x5c,
- (byte) 0xda, (byte) 0xb9, (byte) 0xf7, (byte) 0x58, (byte) 0x7d, (byte) 0x4f,
- (byte) 0xb6, (byte) 0x13, (byte) 0xd7, (byte) 0x2c, (byte) 0x0a, (byte) 0xa8,
- (byte) 0x4d, (byte) 0xf2, (byte) 0xe4, (byte) 0x67, (byte) 0x4f, (byte) 0x8b,
- (byte) 0xa6, (byte) 0xca, (byte) 0x1a, (byte) 0xbb, (byte) 0x02, (byte) 0x63,
- (byte) 0x8f, (byte) 0xb7, (byte) 0x46, (byte) 0xec, (byte) 0x7a, (byte) 0x8a,
- (byte) 0x09, (byte) 0x0a, (byte) 0x45, (byte) 0x3a, (byte) 0x8d, (byte) 0xa8,
- (byte) 0x83, (byte) 0x4b, (byte) 0x0a, (byte) 0xdb, (byte) 0x4b, (byte) 0x99,
- (byte) 0xf3, (byte) 0x69, (byte) 0x95, (byte) 0xf0, (byte) 0xcf, (byte) 0xe9,
- (byte) 0xf7, (byte) 0x67, (byte) 0xc9, (byte) 0x45, (byte) 0x18, (byte) 0x2f,
- (byte) 0xf0, (byte) 0x5c, (byte) 0x90, (byte) 0xbd, (byte) 0xa6, (byte) 0x66,
- (byte) 0x8c, (byte) 0xfe, (byte) 0x60, (byte) 0x5d, (byte) 0x6c, (byte) 0x27,
- (byte) 0xec, (byte) 0xc1, (byte) 0x84, (byte) 0xb2, (byte) 0xa1, (byte) 0x97,
- (byte) 0x9e, (byte) 0x16, (byte) 0x29, (byte) 0xa7, (byte) 0xe0, (byte) 0x38,
- (byte) 0xa2, (byte) 0x36, (byte) 0x05, (byte) 0x5f, (byte) 0xda, (byte) 0x72,
- (byte) 0x1a, (byte) 0x5f, (byte) 0xa8, (byte) 0x7d, (byte) 0x41, (byte) 0x35,
- (byte) 0xf6, (byte) 0x4e, (byte) 0x0a, (byte) 0x88, (byte) 0x8e, (byte) 0x00,
- (byte) 0x98, (byte) 0xa6, (byte) 0xca, (byte) 0xc1, (byte) 0xdf, (byte) 0x72,
- (byte) 0x6c, (byte) 0xfe, (byte) 0x29, (byte) 0xbe, (byte) 0xa3, (byte) 0x9b,
- (byte) 0x0b, (byte) 0x5c, (byte) 0x0b, (byte) 0x9d, (byte) 0xa7, (byte) 0x71,
- (byte) 0xce, (byte) 0x04, (byte) 0xfa, (byte) 0xac, (byte) 0x01, (byte) 0x8d,
- (byte) 0x52, (byte) 0xa0, (byte) 0x3d, (byte) 0xdd, (byte) 0x02, (byte) 0x81,
- (byte) 0xc1, (byte) 0x00, (byte) 0xc1, (byte) 0xc0, (byte) 0x2e, (byte) 0xa9,
- (byte) 0xee, (byte) 0xca, (byte) 0xff, (byte) 0xe4, (byte) 0xf8, (byte) 0x15,
- (byte) 0xfd, (byte) 0xa5, (byte) 0x68, (byte) 0x1b, (byte) 0x2d, (byte) 0x4a,
- (byte) 0xe6, (byte) 0x37, (byte) 0x06, (byte) 0xb3, (byte) 0xd7, (byte) 0x64,
- (byte) 0xad, (byte) 0xb9, (byte) 0x05, (byte) 0x26, (byte) 0x97, (byte) 0x94,
- (byte) 0x3a, (byte) 0x9e, (byte) 0x1c, (byte) 0xd0, (byte) 0xcd, (byte) 0x7b,
- (byte) 0xf4, (byte) 0x88, (byte) 0xe2, (byte) 0xa5, (byte) 0x6d, (byte) 0xed,
- (byte) 0x24, (byte) 0x77, (byte) 0x52, (byte) 0x39, (byte) 0x43, (byte) 0x0f,
- (byte) 0x4e, (byte) 0x75, (byte) 0xd8, (byte) 0xa3, (byte) 0x59, (byte) 0x5a,
- (byte) 0xc2, (byte) 0xba, (byte) 0x9a, (byte) 0x5b, (byte) 0x60, (byte) 0x31,
- (byte) 0x0d, (byte) 0x58, (byte) 0x89, (byte) 0x13, (byte) 0xe8, (byte) 0x95,
- (byte) 0xdd, (byte) 0xae, (byte) 0xcc, (byte) 0x1f, (byte) 0x73, (byte) 0x48,
- (byte) 0x55, (byte) 0xd8, (byte) 0xfb, (byte) 0x67, (byte) 0xce, (byte) 0x18,
- (byte) 0x85, (byte) 0x59, (byte) 0xad, (byte) 0x1f, (byte) 0x93, (byte) 0xe1,
- (byte) 0xb7, (byte) 0x54, (byte) 0x80, (byte) 0x8e, (byte) 0x5f, (byte) 0xbc,
- (byte) 0x1c, (byte) 0x96, (byte) 0x66, (byte) 0x2e, (byte) 0x40, (byte) 0x17,
- (byte) 0x2e, (byte) 0x01, (byte) 0x7a, (byte) 0x7d, (byte) 0xaa, (byte) 0xff,
- (byte) 0xa3, (byte) 0xd2, (byte) 0xdf, (byte) 0xe2, (byte) 0xf3, (byte) 0x54,
- (byte) 0x51, (byte) 0xeb, (byte) 0xba, (byte) 0x7c, (byte) 0x2a, (byte) 0x22,
- (byte) 0xc6, (byte) 0x42, (byte) 0xbc, (byte) 0xa1, (byte) 0x6c, (byte) 0xcf,
- (byte) 0x73, (byte) 0x2e, (byte) 0x07, (byte) 0xfc, (byte) 0xf5, (byte) 0x67,
- (byte) 0x25, (byte) 0xd0, (byte) 0xfa, (byte) 0xeb, (byte) 0xb4, (byte) 0xd4,
- (byte) 0x19, (byte) 0xcc, (byte) 0x64, (byte) 0xa1, (byte) 0x2e, (byte) 0x78,
- (byte) 0x45, (byte) 0xd9, (byte) 0x7f, (byte) 0x1b, (byte) 0x4c, (byte) 0x10,
- (byte) 0x31, (byte) 0x44, (byte) 0xe8, (byte) 0xcc, (byte) 0xf9, (byte) 0x1b,
- (byte) 0x87, (byte) 0x31, (byte) 0xd6, (byte) 0x69, (byte) 0x85, (byte) 0x4a,
- (byte) 0x49, (byte) 0xf6, (byte) 0xb2, (byte) 0xe0, (byte) 0xb8, (byte) 0x98,
- (byte) 0x3c, (byte) 0xf6, (byte) 0x78, (byte) 0x46, (byte) 0xc8, (byte) 0x3d,
- (byte) 0x60, (byte) 0xc1, (byte) 0xaa, (byte) 0x2f, (byte) 0x28, (byte) 0xa1,
- (byte) 0x14, (byte) 0x6b, (byte) 0x75, (byte) 0x4d, (byte) 0xb1, (byte) 0x3d,
- (byte) 0x80, (byte) 0x49, (byte) 0x33, (byte) 0xfd, (byte) 0x71, (byte) 0xc0,
- (byte) 0x13, (byte) 0x1e, (byte) 0x16, (byte) 0x69, (byte) 0x80, (byte) 0xa4,
- (byte) 0x9c, (byte) 0xd7, (byte) 0x02, (byte) 0x81, (byte) 0xc1, (byte) 0x00,
- (byte) 0x8c, (byte) 0x33, (byte) 0x2d, (byte) 0xd9, (byte) 0xf3, (byte) 0x42,
- (byte) 0x4d, (byte) 0xca, (byte) 0x5e, (byte) 0x60, (byte) 0x14, (byte) 0x10,
- (byte) 0xf6, (byte) 0xf3, (byte) 0x71, (byte) 0x15, (byte) 0x88, (byte) 0x54,
- (byte) 0x84, (byte) 0x21, (byte) 0x04, (byte) 0xb1, (byte) 0xaf, (byte) 0x02,
- (byte) 0x11, (byte) 0x7f, (byte) 0x42, (byte) 0x3e, (byte) 0x86, (byte) 0xcb,
- (byte) 0x6c, (byte) 0xf5, (byte) 0x57, (byte) 0x78, (byte) 0x4a, (byte) 0x03,
- (byte) 0x9b, (byte) 0x80, (byte) 0xc2, (byte) 0x04, (byte) 0x3a, (byte) 0x6b,
- (byte) 0xb3, (byte) 0x30, (byte) 0x31, (byte) 0x7e, (byte) 0xc3, (byte) 0x89,
- (byte) 0x09, (byte) 0x4e, (byte) 0x86, (byte) 0x59, (byte) 0x41, (byte) 0xb5,
- (byte) 0xae, (byte) 0xd5, (byte) 0xc6, (byte) 0x38, (byte) 0xbc, (byte) 0xd7,
- (byte) 0xd7, (byte) 0x8e, (byte) 0xa3, (byte) 0x1a, (byte) 0xde, (byte) 0x32,
- (byte) 0xad, (byte) 0x8d, (byte) 0x15, (byte) 0x81, (byte) 0xfe, (byte) 0xac,
- (byte) 0xbd, (byte) 0xd0, (byte) 0xca, (byte) 0xbc, (byte) 0xd8, (byte) 0x6a,
- (byte) 0xe1, (byte) 0xfe, (byte) 0xda, (byte) 0xc4, (byte) 0xd8, (byte) 0x62,
- (byte) 0x71, (byte) 0x20, (byte) 0xa3, (byte) 0xd3, (byte) 0x06, (byte) 0x11,
- (byte) 0xa9, (byte) 0x53, (byte) 0x7a, (byte) 0x44, (byte) 0x89, (byte) 0x3d,
- (byte) 0x28, (byte) 0x5e, (byte) 0x7d, (byte) 0xf0, (byte) 0x60, (byte) 0xeb,
- (byte) 0xb5, (byte) 0xdf, (byte) 0xed, (byte) 0x4f, (byte) 0x6d, (byte) 0x05,
- (byte) 0x59, (byte) 0x06, (byte) 0xb0, (byte) 0x62, (byte) 0x50, (byte) 0x1c,
- (byte) 0xb7, (byte) 0x2c, (byte) 0x44, (byte) 0xa4, (byte) 0x49, (byte) 0xf8,
- (byte) 0x4f, (byte) 0x4b, (byte) 0xab, (byte) 0x71, (byte) 0x5b, (byte) 0xcb,
- (byte) 0x31, (byte) 0x10, (byte) 0x41, (byte) 0xe0, (byte) 0x1a, (byte) 0x15,
- (byte) 0xdc, (byte) 0x4c, (byte) 0x5d, (byte) 0x4f, (byte) 0x62, (byte) 0x83,
- (byte) 0xa4, (byte) 0x80, (byte) 0x06, (byte) 0x36, (byte) 0xba, (byte) 0xc9,
- (byte) 0xe2, (byte) 0xa4, (byte) 0x11, (byte) 0x98, (byte) 0x6b, (byte) 0x4c,
- (byte) 0xe9, (byte) 0x90, (byte) 0x55, (byte) 0x18, (byte) 0xde, (byte) 0xe1,
- (byte) 0x42, (byte) 0x38, (byte) 0x28, (byte) 0xa3, (byte) 0x54, (byte) 0x56,
- (byte) 0x31, (byte) 0xaf, (byte) 0x5a, (byte) 0xd6, (byte) 0xf0, (byte) 0x26,
- (byte) 0xe0, (byte) 0x7a, (byte) 0xd9, (byte) 0x6c, (byte) 0x64, (byte) 0xca,
- (byte) 0x5d, (byte) 0x6d, (byte) 0x3d, (byte) 0x9a, (byte) 0xfe, (byte) 0x36,
- (byte) 0x93, (byte) 0x9e, (byte) 0x62, (byte) 0x94, (byte) 0xc6, (byte) 0x07,
- (byte) 0x83, (byte) 0x96, (byte) 0xd6, (byte) 0x27, (byte) 0xa6, (byte) 0xd8
- };
- public static final PrivateKey CLIENT_SUITE_B_RSA3072_KEY =
- loadPrivateKey("RSA", CLIENT_SUITE_B_RSA3072_KEY_DATA);
-
- private static final String CLIENT_SUITE_B_ECDSA_CERT_STRING =
- "-----BEGIN CERTIFICATE-----\n"
- + "MIIB9zCCAX4CFDpfSZh3AH07BEfGWuMDa7Ynz6y+MAoGCCqGSM49BAMDMF4xCzAJ\n"
- + "BgNVBAYTAlVTMQswCQYDVQQIDAJDQTEMMAoGA1UEBwwDTVRWMRAwDgYDVQQKDAdB\n"
- + "bmRyb2lkMQ4wDAYDVQQLDAVXaS1GaTESMBAGA1UEAwwJdW5pdGVzdENBMB4XDTIw\n"
- + "MDcyMTAyMjk1MFoXDTMwMDUzMDAyMjk1MFowYjELMAkGA1UEBhMCVVMxCzAJBgNV\n"
- + "BAgMAkNBMQwwCgYDVQQHDANNVFYxEDAOBgNVBAoMB0FuZHJvaWQxDjAMBgNVBAsM\n"
- + "BVdpLUZpMRYwFAYDVQQDDA11bml0ZXN0Q2xpZW50MHYwEAYHKoZIzj0CAQYFK4EE\n"
- + "ACIDYgAEhxhVJ7dcSqrto0X+dgRxtd8BWG8cWmPjBji3MIxDLfpcMDoIB84ae1Ew\n"
- + "gJn4YUYHrWsUDiVNihv8j7a/Ol1qcIY2ybH7tbezefLmagqA4vXEUXZXoUyL4ZNC\n"
- + "DWcdw6LrMAoGCCqGSM49BAMDA2cAMGQCMH4aP73HrriRUJRguiuRic+X4Cqj/7YQ\n"
- + "ueJmP87KF92/thhoQ9OrRo8uJITPmNDswwIwP2Q1AZCSL4BI9dYrqu07Ar+pSkXE\n"
- + "R7oOqGdZR+d/MvXcFSrbIaLKEoHXmQamIHLe\n"
- + "-----END CERTIFICATE-----\n";
- public static final X509Certificate CLIENT_SUITE_B_ECDSA_CERT =
- loadCertificate(CLIENT_SUITE_B_ECDSA_CERT_STRING);
-
- private static final byte[] CLIENT_SUITE_B_ECC_KEY_DATA = new byte[]{
- (byte) 0x30, (byte) 0x81, (byte) 0xb6, (byte) 0x02, (byte) 0x01, (byte) 0x00,
- (byte) 0x30, (byte) 0x10, (byte) 0x06, (byte) 0x07, (byte) 0x2a, (byte) 0x86,
- (byte) 0x48, (byte) 0xce, (byte) 0x3d, (byte) 0x02, (byte) 0x01, (byte) 0x06,
- (byte) 0x05, (byte) 0x2b, (byte) 0x81, (byte) 0x04, (byte) 0x00, (byte) 0x22,
- (byte) 0x04, (byte) 0x81, (byte) 0x9e, (byte) 0x30, (byte) 0x81, (byte) 0x9b,
- (byte) 0x02, (byte) 0x01, (byte) 0x01, (byte) 0x04, (byte) 0x30, (byte) 0xea,
- (byte) 0x6c, (byte) 0x4b, (byte) 0x6d, (byte) 0x43, (byte) 0xf9, (byte) 0x6c,
- (byte) 0x91, (byte) 0xdc, (byte) 0x2d, (byte) 0x6e, (byte) 0x87, (byte) 0x4f,
- (byte) 0x0a, (byte) 0x0b, (byte) 0x97, (byte) 0x25, (byte) 0x1c, (byte) 0x79,
- (byte) 0xa2, (byte) 0x07, (byte) 0xdc, (byte) 0x94, (byte) 0xc2, (byte) 0xee,
- (byte) 0x64, (byte) 0x51, (byte) 0x6d, (byte) 0x4e, (byte) 0x35, (byte) 0x1c,
- (byte) 0x22, (byte) 0x2f, (byte) 0xc0, (byte) 0xea, (byte) 0x09, (byte) 0x47,
- (byte) 0x3e, (byte) 0xb9, (byte) 0xb6, (byte) 0xb8, (byte) 0x83, (byte) 0x9e,
- (byte) 0xed, (byte) 0x59, (byte) 0xe5, (byte) 0xe7, (byte) 0x0f, (byte) 0xa1,
- (byte) 0x64, (byte) 0x03, (byte) 0x62, (byte) 0x00, (byte) 0x04, (byte) 0x87,
- (byte) 0x18, (byte) 0x55, (byte) 0x27, (byte) 0xb7, (byte) 0x5c, (byte) 0x4a,
- (byte) 0xaa, (byte) 0xed, (byte) 0xa3, (byte) 0x45, (byte) 0xfe, (byte) 0x76,
- (byte) 0x04, (byte) 0x71, (byte) 0xb5, (byte) 0xdf, (byte) 0x01, (byte) 0x58,
- (byte) 0x6f, (byte) 0x1c, (byte) 0x5a, (byte) 0x63, (byte) 0xe3, (byte) 0x06,
- (byte) 0x38, (byte) 0xb7, (byte) 0x30, (byte) 0x8c, (byte) 0x43, (byte) 0x2d,
- (byte) 0xfa, (byte) 0x5c, (byte) 0x30, (byte) 0x3a, (byte) 0x08, (byte) 0x07,
- (byte) 0xce, (byte) 0x1a, (byte) 0x7b, (byte) 0x51, (byte) 0x30, (byte) 0x80,
- (byte) 0x99, (byte) 0xf8, (byte) 0x61, (byte) 0x46, (byte) 0x07, (byte) 0xad,
- (byte) 0x6b, (byte) 0x14, (byte) 0x0e, (byte) 0x25, (byte) 0x4d, (byte) 0x8a,
- (byte) 0x1b, (byte) 0xfc, (byte) 0x8f, (byte) 0xb6, (byte) 0xbf, (byte) 0x3a,
- (byte) 0x5d, (byte) 0x6a, (byte) 0x70, (byte) 0x86, (byte) 0x36, (byte) 0xc9,
- (byte) 0xb1, (byte) 0xfb, (byte) 0xb5, (byte) 0xb7, (byte) 0xb3, (byte) 0x79,
- (byte) 0xf2, (byte) 0xe6, (byte) 0x6a, (byte) 0x0a, (byte) 0x80, (byte) 0xe2,
- (byte) 0xf5, (byte) 0xc4, (byte) 0x51, (byte) 0x76, (byte) 0x57, (byte) 0xa1,
- (byte) 0x4c, (byte) 0x8b, (byte) 0xe1, (byte) 0x93, (byte) 0x42, (byte) 0x0d,
- (byte) 0x67, (byte) 0x1d, (byte) 0xc3, (byte) 0xa2, (byte) 0xeb
- };
- public static final PrivateKey CLIENT_SUITE_B_ECC_KEY =
- loadPrivateKey("EC", CLIENT_SUITE_B_ECC_KEY_DATA);
-
- private static X509Certificate loadCertificate(String blob) {
- try {
- final CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
- InputStream stream = new ByteArrayInputStream(blob.getBytes(StandardCharsets.UTF_8));
-
- return (X509Certificate) certFactory.generateCertificate(stream);
- } catch (Exception e) {
- e.printStackTrace();
- return null;
- }
- }
-
- private static PrivateKey loadPrivateKey(String algorithm, byte[] fakeKey) {
- try {
- KeyFactory kf = KeyFactory.getInstance(algorithm);
- return kf.generatePrivate(new PKCS8EncodedKeySpec(fakeKey));
- } catch (InvalidKeySpecException | NoSuchAlgorithmException e) {
- return null;
- }
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/ParcelUtilTest.java b/wifi/tests/src/android/net/wifi/ParcelUtilTest.java
deleted file mode 100644
index 917b1df..0000000
--- a/wifi/tests/src/android/net/wifi/ParcelUtilTest.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2016 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.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import java.security.PrivateKey;
-import java.security.cert.X509Certificate;
-
-/**
- * Unit tests for {@link android.net.wifi.ParcelUtil}.
- */
-@SmallTest
-public class ParcelUtilTest {
- private Parcel mParcel;
-
- @Before
- public void setUp() throws Exception {
- mParcel = Parcel.obtain();
- }
-
- @Test
- public void readWriteNullPrivateKey() throws Exception {
- ParcelUtil.writePrivateKey(mParcel, null);
-
- mParcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- PrivateKey readKey = ParcelUtil.readPrivateKey(mParcel);
- assertNull(readKey);
- }
-
- @Test
- public void readWriteValidPrivateKey() throws Exception {
- PrivateKey writeKey = FakeKeys.RSA_KEY1;
- ParcelUtil.writePrivateKey(mParcel, writeKey);
-
- mParcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- PrivateKey readKey = ParcelUtil.readPrivateKey(mParcel);
- assertNotNull(readKey);
- assertEquals(writeKey.getAlgorithm(), readKey.getAlgorithm());
- assertArrayEquals(writeKey.getEncoded(), readKey.getEncoded());
- }
-
- @Test
- public void readWriteNullCertificate() throws Exception {
- ParcelUtil.writeCertificate(mParcel, null);
-
- mParcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- X509Certificate readCert = ParcelUtil.readCertificate(mParcel);
- assertNull(readCert);
- }
-
- @Test
- public void readWriteValidCertificate() throws Exception {
- X509Certificate writeCert = FakeKeys.CA_CERT1;
- ParcelUtil.writeCertificate(mParcel, writeCert);
-
- mParcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- X509Certificate readCert = ParcelUtil.readCertificate(mParcel);
- assertNotNull(readCert);
- assertArrayEquals(writeCert.getEncoded(), readCert.getEncoded());
- }
-
- @Test
- public void readWriteNullCertificates() throws Exception {
- ParcelUtil.writeCertificates(mParcel, null);
-
- mParcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- X509Certificate[] readCerts = ParcelUtil.readCertificates(mParcel);
- assertNull(readCerts);
- }
-
- @Test
- public void readWriteValidCertificates() throws Exception {
- X509Certificate[] writeCerts = new X509Certificate[2];
- writeCerts[0] = FakeKeys.CA_CERT0;
- writeCerts[1] = FakeKeys.CA_CERT1;
- ParcelUtil.writeCertificates(mParcel, writeCerts);
-
- mParcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- X509Certificate[] readCerts = ParcelUtil.readCertificates(mParcel);
- assertNotNull(readCerts);
- assertEquals(writeCerts.length, readCerts.length);
- for (int i = 0; i < writeCerts.length; i++) {
- assertNotNull(readCerts[i]);
- assertArrayEquals(writeCerts[i].getEncoded(), readCerts[i].getEncoded());
- }
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/ScanResultTest.java b/wifi/tests/src/android/net/wifi/ScanResultTest.java
deleted file mode 100644
index 59b88a7..0000000
--- a/wifi/tests/src/android/net/wifi/ScanResultTest.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * 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.net.wifi;
-
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.mockito.Mockito.validateMockitoUsage;
-
-import android.net.wifi.ScanResult.InformationElement;
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.MockitoAnnotations;
-
-/**
- * Unit tests for {@link android.net.wifi.WifiScanner}.
- */
-@SmallTest
-public class ScanResultTest {
- public static final String TEST_SSID = "\"test_ssid\"";
- public static final String TEST_BSSID = "04:ac:fe:45:34:10";
- public static final String TEST_CAPS = "CCMP";
- public static final int TEST_LEVEL = -56;
- public static final int TEST_FREQUENCY = 2412;
- public static final long TEST_TSF = 04660l;
- public static final @WifiAnnotations.WifiStandard int TEST_WIFI_STANDARD =
- ScanResult.WIFI_STANDARD_11AC;
- public static final String TEST_IFACE_NAME = "test_ifname";
-
- /**
- * Frequency to channel map. This include some frequencies used outside the US.
- * Representing it using a vector (instead of map) for simplification.
- */
- private static final int[] FREQUENCY_TO_CHANNEL_MAP = {
- 2412, WifiScanner.WIFI_BAND_24_GHZ, 1,
- 2417, WifiScanner.WIFI_BAND_24_GHZ, 2,
- 2422, WifiScanner.WIFI_BAND_24_GHZ, 3,
- 2427, WifiScanner.WIFI_BAND_24_GHZ, 4,
- 2432, WifiScanner.WIFI_BAND_24_GHZ, 5,
- 2437, WifiScanner.WIFI_BAND_24_GHZ, 6,
- 2442, WifiScanner.WIFI_BAND_24_GHZ, 7,
- 2447, WifiScanner.WIFI_BAND_24_GHZ, 8,
- 2452, WifiScanner.WIFI_BAND_24_GHZ, 9,
- 2457, WifiScanner.WIFI_BAND_24_GHZ, 10,
- 2462, WifiScanner.WIFI_BAND_24_GHZ, 11,
- /* 12, 13 are only legitimate outside the US. */
- 2467, WifiScanner.WIFI_BAND_24_GHZ, 12,
- 2472, WifiScanner.WIFI_BAND_24_GHZ, 13,
- /* 14 is for Japan, DSSS and CCK only. */
- 2484, WifiScanner.WIFI_BAND_24_GHZ, 14,
- /* 34 valid in Japan. */
- 5170, WifiScanner.WIFI_BAND_5_GHZ, 34,
- 5180, WifiScanner.WIFI_BAND_5_GHZ, 36,
- 5190, WifiScanner.WIFI_BAND_5_GHZ, 38,
- 5200, WifiScanner.WIFI_BAND_5_GHZ, 40,
- 5210, WifiScanner.WIFI_BAND_5_GHZ, 42,
- 5220, WifiScanner.WIFI_BAND_5_GHZ, 44,
- 5230, WifiScanner.WIFI_BAND_5_GHZ, 46,
- 5240, WifiScanner.WIFI_BAND_5_GHZ, 48,
- 5260, WifiScanner.WIFI_BAND_5_GHZ, 52,
- 5280, WifiScanner.WIFI_BAND_5_GHZ, 56,
- 5300, WifiScanner.WIFI_BAND_5_GHZ, 60,
- 5320, WifiScanner.WIFI_BAND_5_GHZ, 64,
- 5500, WifiScanner.WIFI_BAND_5_GHZ, 100,
- 5520, WifiScanner.WIFI_BAND_5_GHZ, 104,
- 5540, WifiScanner.WIFI_BAND_5_GHZ, 108,
- 5560, WifiScanner.WIFI_BAND_5_GHZ, 112,
- 5580, WifiScanner.WIFI_BAND_5_GHZ, 116,
- /* 120, 124, 128 valid in Europe/Japan. */
- 5600, WifiScanner.WIFI_BAND_5_GHZ, 120,
- 5620, WifiScanner.WIFI_BAND_5_GHZ, 124,
- 5640, WifiScanner.WIFI_BAND_5_GHZ, 128,
- /* 132+ valid in US. */
- 5660, WifiScanner.WIFI_BAND_5_GHZ, 132,
- 5680, WifiScanner.WIFI_BAND_5_GHZ, 136,
- 5700, WifiScanner.WIFI_BAND_5_GHZ, 140,
- /* 144 is supported by a subset of WiFi chips. */
- 5720, WifiScanner.WIFI_BAND_5_GHZ, 144,
- 5745, WifiScanner.WIFI_BAND_5_GHZ, 149,
- 5765, WifiScanner.WIFI_BAND_5_GHZ, 153,
- 5785, WifiScanner.WIFI_BAND_5_GHZ, 157,
- 5805, WifiScanner.WIFI_BAND_5_GHZ, 161,
- 5825, WifiScanner.WIFI_BAND_5_GHZ, 165,
- 5845, WifiScanner.WIFI_BAND_5_GHZ, 169,
- 5865, WifiScanner.WIFI_BAND_5_GHZ, 173,
- /* Now some 6GHz channels */
- 5955, WifiScanner.WIFI_BAND_6_GHZ, 1,
- 5935, WifiScanner.WIFI_BAND_6_GHZ, 2,
- 5970, WifiScanner.WIFI_BAND_6_GHZ, 4,
- 6110, WifiScanner.WIFI_BAND_6_GHZ, 32
- };
-
- /**
- * Setup before tests.
- */
- @Before
- public void setUp() throws Exception {
- MockitoAnnotations.initMocks(this);
- }
-
- /**
- * Clean up after tests.
- */
- @After
- public void cleanup() {
- validateMockitoUsage();
- }
-
- /**
- * Verify parcel read/write for ScanResult.
- */
- @Test
- public void verifyScanResultParcelWithoutRadioChainInfo() throws Exception {
- ScanResult writeScanResult = createScanResult();
- ScanResult readScanResult = parcelReadWrite(writeScanResult);
- assertScanResultEquals(writeScanResult, readScanResult);
- }
-
- /**
- * Verify parcel read/write for ScanResult.
- */
- @Test
- public void verifyScanResultParcelWithZeroRadioChainInfo() throws Exception {
- ScanResult writeScanResult = createScanResult();
- writeScanResult.radioChainInfos = new ScanResult.RadioChainInfo[0];
- ScanResult readScanResult = parcelReadWrite(writeScanResult);
- assertNull(readScanResult.radioChainInfos);
- }
-
- /**
- * Verify parcel read/write for ScanResult.
- */
- @Test
- public void verifyScanResultParcelWithRadioChainInfo() throws Exception {
- ScanResult writeScanResult = createScanResult();
- writeScanResult.radioChainInfos = new ScanResult.RadioChainInfo[2];
- writeScanResult.radioChainInfos[0] = new ScanResult.RadioChainInfo();
- writeScanResult.radioChainInfos[0].id = 0;
- writeScanResult.radioChainInfos[0].level = -45;
- writeScanResult.radioChainInfos[1] = new ScanResult.RadioChainInfo();
- writeScanResult.radioChainInfos[1].id = 1;
- writeScanResult.radioChainInfos[1].level = -54;
- ScanResult readScanResult = parcelReadWrite(writeScanResult);
- assertScanResultEquals(writeScanResult, readScanResult);
- }
-
- /**
- * Verify copy constructor for ScanResult.
- */
- @Test
- public void verifyScanResultCopyWithoutRadioChainInfo() throws Exception {
- ScanResult scanResult = createScanResult();
- ScanResult copyScanResult = new ScanResult(scanResult);
- assertScanResultEquals(scanResult, copyScanResult);
- }
-
- /**
- * Verify copy constructor for ScanResult.
- */
- @Test
- public void verifyScanResultCopyWithRadioChainInfo() throws Exception {
- ScanResult scanResult = createScanResult();
- scanResult.radioChainInfos = new ScanResult.RadioChainInfo[2];
- scanResult.radioChainInfos[0] = new ScanResult.RadioChainInfo();
- scanResult.radioChainInfos[0].id = 0;
- scanResult.radioChainInfos[0].level = -45;
- scanResult.radioChainInfos[1] = new ScanResult.RadioChainInfo();
- scanResult.radioChainInfos[1].id = 1;
- scanResult.radioChainInfos[1].level = -54;
- ScanResult copyScanResult = new ScanResult(scanResult);
- assertScanResultEquals(scanResult, copyScanResult);
- }
-
- /**
- * Verify parcel read/write for ScanResult with Information Element
- */
- @Test
- public void verifyScanResultParcelWithInformationElement() throws Exception {
- ScanResult writeScanResult = createScanResult();
- writeScanResult.informationElements = new ScanResult.InformationElement[2];
- writeScanResult.informationElements[0] = new ScanResult.InformationElement();
- writeScanResult.informationElements[0].id = InformationElement.EID_HT_OPERATION;
- writeScanResult.informationElements[0].idExt = 0;
- writeScanResult.informationElements[0].bytes = new byte[]{0x11, 0x22, 0x33};
- writeScanResult.informationElements[1] = new ScanResult.InformationElement();
- writeScanResult.informationElements[1].id = InformationElement.EID_EXTENSION_PRESENT;
- writeScanResult.informationElements[1].idExt = InformationElement.EID_EXT_HE_OPERATION;
- writeScanResult.informationElements[1].bytes = new byte[]{0x44, 0x55, 0x66};
- ScanResult readScanResult = new ScanResult(writeScanResult);
- assertScanResultEquals(writeScanResult, readScanResult);
- }
-
- /**
- * Verify toString for ScanResult.
- */
- @Test
- public void verifyScanResultToStringWithoutRadioChainInfo() throws Exception {
- ScanResult scanResult = createScanResult();
- assertEquals("SSID: \"test_ssid\", BSSID: 04:ac:fe:45:34:10, capabilities: CCMP, "
- + "level: -56, frequency: 2412, timestamp: 2480, "
- + "distance: 0(cm), distanceSd: 0(cm), "
- + "passpoint: no, ChannelBandwidth: 0, centerFreq0: 0, centerFreq1: 0, "
- + "standard: 11ac, "
- + "80211mcResponder: is not supported, "
- + "Radio Chain Infos: null, interface name: test_ifname", scanResult.toString());
- }
-
- /**
- * Verify toString for ScanResult.
- */
- @Test
- public void verifyScanResultToStringWithRadioChainInfo() throws Exception {
- ScanResult scanResult = createScanResult();
- scanResult.radioChainInfos = new ScanResult.RadioChainInfo[2];
- scanResult.radioChainInfos[0] = new ScanResult.RadioChainInfo();
- scanResult.radioChainInfos[0].id = 0;
- scanResult.radioChainInfos[0].level = -45;
- scanResult.radioChainInfos[1] = new ScanResult.RadioChainInfo();
- scanResult.radioChainInfos[1].id = 1;
- scanResult.radioChainInfos[1].level = -54;
- assertEquals("SSID: \"test_ssid\", BSSID: 04:ac:fe:45:34:10, capabilities: CCMP, "
- + "level: -56, frequency: 2412, timestamp: 2480, distance: 0(cm), "
- + "distanceSd: 0(cm), "
- + "passpoint: no, ChannelBandwidth: 0, centerFreq0: 0, centerFreq1: 0, "
- + "standard: 11ac, "
- + "80211mcResponder: is not supported, "
- + "Radio Chain Infos: [RadioChainInfo: id=0, level=-45, "
- + "RadioChainInfo: id=1, level=-54], interface name: test_ifname",
- scanResult.toString());
- }
-
- /**
- * verify frequency to channel conversion for all possible frequencies.
- */
- @Test
- public void convertFrequencyToChannel() throws Exception {
- for (int i = 0; i < FREQUENCY_TO_CHANNEL_MAP.length; i += 3) {
- assertEquals(FREQUENCY_TO_CHANNEL_MAP[i + 2],
- ScanResult.convertFrequencyMhzToChannel(FREQUENCY_TO_CHANNEL_MAP[i]));
- }
- }
-
- /**
- * Verify frequency to channel conversion failed for an invalid frequency.
- */
- @Test
- public void convertFrequencyToChannelWithInvalidFreq() throws Exception {
- assertEquals(-1, ScanResult.convertFrequencyMhzToChannel(8000));
- }
-
- /**
- * Write the provided {@link ScanResult} to a parcel and deserialize it.
- */
- private static ScanResult parcelReadWrite(ScanResult writeResult) throws Exception {
- Parcel parcel = Parcel.obtain();
- writeResult.writeToParcel(parcel, 0);
- parcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- return ScanResult.CREATOR.createFromParcel(parcel);
- }
-
- private static ScanResult createScanResult() {
- ScanResult result = new ScanResult();
- result.wifiSsid = WifiSsid.createFromAsciiEncoded(TEST_SSID);
- result.BSSID = TEST_BSSID;
- result.capabilities = TEST_CAPS;
- result.level = TEST_LEVEL;
- result.frequency = TEST_FREQUENCY;
- result.timestamp = TEST_TSF;
- result.setWifiStandard(TEST_WIFI_STANDARD);
- result.ifaceName = TEST_IFACE_NAME;
-
- return result;
- }
-
- private static void assertScanResultEquals(ScanResult expected, ScanResult actual) {
- assertEquals(expected.SSID, actual.SSID);
- assertEquals(expected.BSSID, actual.BSSID);
- assertEquals(expected.capabilities, actual.capabilities);
- assertEquals(expected.level, actual.level);
- assertEquals(expected.frequency, actual.frequency);
- assertEquals(expected.timestamp, actual.timestamp);
- assertEquals(expected.getWifiStandard(), actual.getWifiStandard());
- assertArrayEquals(expected.radioChainInfos, actual.radioChainInfos);
- assertArrayEquals(expected.informationElements, actual.informationElements);
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/SecurityParamsTest.java b/wifi/tests/src/android/net/wifi/SecurityParamsTest.java
deleted file mode 100644
index 2f6b724..0000000
--- a/wifi/tests/src/android/net/wifi/SecurityParamsTest.java
+++ /dev/null
@@ -1,502 +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 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
deleted file mode 100644
index 9e3b022..0000000
--- a/wifi/tests/src/android/net/wifi/SoftApCapabilityTest.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * 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.net.wifi;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assume.assumeTrue;
-
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import com.android.modules.utils.build.SdkLevel;
-
-import org.junit.Test;
-
-/**
- * Unit tests for {@link android.net.wifi.SoftApCapability}.
- */
-@SmallTest
-public class SoftApCapabilityTest {
-
- /**
- * Verifies copy constructor.
- */
- @Test
- public void testCopyOperator() throws Exception {
- long testSoftApFeature = SoftApCapability.SOFTAP_FEATURE_CLIENT_FORCE_DISCONNECT
- | 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);
-
- assertEquals(capability, copiedCapability);
- assertEquals(capability.hashCode(), copiedCapability.hashCode());
- }
-
- /**
- * Verifies parcel serialization/deserialization.
- */
- @Test
- public void testParcelOperation() throws Exception {
- long testSoftApFeature = SoftApCapability.SOFTAP_FEATURE_CLIENT_FORCE_DISCONNECT
- | SoftApCapability.SOFTAP_FEATURE_ACS_OFFLOAD;
- SoftApCapability capability = new SoftApCapability(testSoftApFeature);
- 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);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- SoftApCapability fromParcel = SoftApCapability.CREATOR.createFromParcel(parcelR);
-
- assertEquals(capability, fromParcel);
- assertEquals(capability.hashCode(), fromParcel.hashCode());
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testSetSupportedChannelListWithInvalidBand() {
- long testSoftApFeature = SoftApCapability.SOFTAP_FEATURE_CLIENT_FORCE_DISCONNECT
- | SoftApCapability.SOFTAP_FEATURE_ACS_OFFLOAD;
- SoftApCapability capability = new SoftApCapability(testSoftApFeature);
- capability.setSupportedChannelList(
- SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ, new int[0]);
-
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testGetSupportedChannelListWithInvalidBand() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- long testSoftApFeature = SoftApCapability.SOFTAP_FEATURE_CLIENT_FORCE_DISCONNECT
- | SoftApCapability.SOFTAP_FEATURE_ACS_OFFLOAD;
- SoftApCapability capability = new SoftApCapability(testSoftApFeature);
- capability.getSupportedChannelList(
- SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ);
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/SoftApConfigurationTest.java b/wifi/tests/src/android/net/wifi/SoftApConfigurationTest.java
deleted file mode 100644
index a609a12..0000000
--- a/wifi/tests/src/android/net/wifi/SoftApConfigurationTest.java
+++ /dev/null
@@ -1,532 +0,0 @@
-/*
- * 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.net.wifi;
-
-import static com.google.common.truth.Truth.assertThat;
-
-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;
-import android.util.SparseIntArray;
-
-import androidx.test.filters.SmallTest;
-
-import com.android.modules.utils.build.SdkLevel;
-
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Random;
-
-@SmallTest
-public class SoftApConfigurationTest {
- private static final String TEST_CHAR_SET_AS_STRING = "abcdefghijklmnopqrstuvwxyz0123456789";
- private static final String TEST_BSSID = "aa:22:33:aa:bb:cc";
-
- private SoftApConfiguration parcelUnparcel(SoftApConfiguration configIn) {
- Parcel parcel = Parcel.obtain();
- parcel.writeParcelable(configIn, 0);
- parcel.setDataPosition(0);
- SoftApConfiguration configOut =
- parcel.readParcelable(SoftApConfiguration.class.getClassLoader());
- parcel.recycle();
- return configOut;
- }
-
- /**
- * Helper method to generate random string.
- *
- * Note: this method has limited use as a random string generator.
- * The characters used in this method do no not cover all valid inputs.
- * @param length number of characters to generate for the string
- * @return String generated string of random characters
- */
- private String generateRandomString(int length) {
- Random random = new Random();
- StringBuilder stringBuilder = new StringBuilder(length);
- int index = -1;
- while (stringBuilder.length() < length) {
- index = random.nextInt(TEST_CHAR_SET_AS_STRING.length());
- stringBuilder.append(TEST_CHAR_SET_AS_STRING.charAt(index));
- }
- return stringBuilder.toString();
- }
-
- @Test
- public void testBasicSettings() {
- MacAddress testBssid = MacAddress.fromString(TEST_BSSID);
- SoftApConfiguration original = new SoftApConfiguration.Builder()
- .setSsid("ssid")
- .setBssid(testBssid)
- .build();
- assertThat(original.getSsid()).isEqualTo("ssid");
- assertThat(original.getBssid()).isEqualTo(testBssid);
- assertThat(original.getPassphrase()).isNull();
- assertThat(original.getSecurityType()).isEqualTo(SoftApConfiguration.SECURITY_TYPE_OPEN);
- assertThat(original.getBand()).isEqualTo(SoftApConfiguration.BAND_2GHZ);
- assertThat(original.getChannel()).isEqualTo(0);
- assertThat(original.isHiddenSsid()).isEqualTo(false);
- assertThat(original.getMaxNumberOfClients()).isEqualTo(0);
- if (SdkLevel.isAtLeastS()) {
- assertThat(original.getMacRandomizationSetting())
- .isEqualTo(SoftApConfiguration.RANDOMIZATION_PERSISTENT);
- }
-
- SoftApConfiguration unparceled = parcelUnparcel(original);
- assertThat(unparceled).isNotSameInstanceAs(original);
- assertThat(unparceled).isEqualTo(original);
- assertThat(unparceled.hashCode()).isEqualTo(original.hashCode());
-
- SoftApConfiguration copy = new SoftApConfiguration.Builder(original).build();
- assertThat(copy).isNotSameInstanceAs(original);
- assertThat(copy).isEqualTo(original);
- assertThat(copy.hashCode()).isEqualTo(original.hashCode());
- }
-
- @Test
- public void testWpa2() {
- SoftApConfiguration original = new SoftApConfiguration.Builder()
- .setPassphrase("secretsecret", SoftApConfiguration.SECURITY_TYPE_WPA2_PSK)
- .build();
- assertThat(original.getPassphrase()).isEqualTo("secretsecret");
- assertThat(original.getSecurityType()).isEqualTo(
- SoftApConfiguration.SECURITY_TYPE_WPA2_PSK);
- assertThat(original.getBand()).isEqualTo(SoftApConfiguration.BAND_2GHZ);
- assertThat(original.getChannel()).isEqualTo(0);
- assertThat(original.isHiddenSsid()).isEqualTo(false);
- assertThat(original.getMaxNumberOfClients()).isEqualTo(0);
-
- SoftApConfiguration unparceled = parcelUnparcel(original);
- assertThat(unparceled).isNotSameInstanceAs(original);
- assertThat(unparceled).isEqualTo(original);
- assertThat(unparceled.hashCode()).isEqualTo(original.hashCode());
-
- SoftApConfiguration copy = new SoftApConfiguration.Builder(original).build();
- assertThat(copy).isNotSameInstanceAs(original);
- assertThat(copy).isEqualTo(original);
- assertThat(copy.hashCode()).isEqualTo(original.hashCode());
- }
-
- @Test
- public void testWpa2WithAllFieldCustomized() {
- List<MacAddress> testBlockedClientList = new ArrayList<>();
- List<MacAddress> testAllowedClientList = new ArrayList<>();
- testBlockedClientList.add(MacAddress.fromString("11:22:33:44:55:66"));
- testAllowedClientList.add(MacAddress.fromString("aa:bb:cc:dd:ee:ff"));
- SoftApConfiguration.Builder originalBuilder = new SoftApConfiguration.Builder()
- .setPassphrase("secretsecret", SoftApConfiguration.SECURITY_TYPE_WPA2_PSK)
- .setChannel(149, SoftApConfiguration.BAND_5GHZ)
- .setHiddenSsid(true)
- .setMaxNumberOfClients(10)
- .setAutoShutdownEnabled(true)
- .setShutdownTimeoutMillis(500000)
- .setClientControlByUserEnabled(true)
- .setBlockedClientList(testBlockedClientList)
- .setAllowedClientList(testAllowedClientList);
- if (SdkLevel.isAtLeastS()) {
- originalBuilder.setMacRandomizationSetting(SoftApConfiguration.RANDOMIZATION_NONE);
- }
- SoftApConfiguration original = originalBuilder.build();
- assertThat(original.getPassphrase()).isEqualTo("secretsecret");
- assertThat(original.getSecurityType()).isEqualTo(
- SoftApConfiguration.SECURITY_TYPE_WPA2_PSK);
- assertThat(original.getBand()).isEqualTo(SoftApConfiguration.BAND_5GHZ);
- assertThat(original.getChannel()).isEqualTo(149);
- assertThat(original.isHiddenSsid()).isEqualTo(true);
- assertThat(original.getMaxNumberOfClients()).isEqualTo(10);
- assertThat(original.isAutoShutdownEnabled()).isEqualTo(true);
- assertThat(original.getShutdownTimeoutMillis()).isEqualTo(500000);
- assertThat(original.isClientControlByUserEnabled()).isEqualTo(true);
- assertThat(original.getBlockedClientList()).isEqualTo(testBlockedClientList);
- assertThat(original.getAllowedClientList()).isEqualTo(testAllowedClientList);
- if (SdkLevel.isAtLeastS()) {
- assertThat(original.getMacRandomizationSetting())
- .isEqualTo(SoftApConfiguration.RANDOMIZATION_NONE);
- }
-
- SoftApConfiguration unparceled = parcelUnparcel(original);
- assertThat(unparceled).isNotSameInstanceAs(original);
- assertThat(unparceled).isEqualTo(original);
- assertThat(unparceled.hashCode()).isEqualTo(original.hashCode());
-
- SoftApConfiguration copy = new SoftApConfiguration.Builder(original).build();
- assertThat(copy).isNotSameInstanceAs(original);
- assertThat(copy).isEqualTo(original);
- assertThat(copy.hashCode()).isEqualTo(original.hashCode());
- }
-
- @Test
- public void testWpa3Sae() {
- SoftApConfiguration original = new SoftApConfiguration.Builder()
- .setPassphrase("secretsecret", SoftApConfiguration.SECURITY_TYPE_WPA3_SAE)
- .setChannel(149, SoftApConfiguration.BAND_5GHZ)
- .setHiddenSsid(true)
- .build();
- assertThat(original.getPassphrase()).isEqualTo("secretsecret");
- assertThat(original.getSecurityType()).isEqualTo(
- SoftApConfiguration.SECURITY_TYPE_WPA3_SAE);
- assertThat(original.getBand()).isEqualTo(SoftApConfiguration.BAND_5GHZ);
- assertThat(original.getChannel()).isEqualTo(149);
- assertThat(original.isHiddenSsid()).isEqualTo(true);
-
-
- SoftApConfiguration unparceled = parcelUnparcel(original);
- assertThat(unparceled).isNotSameInstanceAs(original);
- assertThat(unparceled).isEqualTo(original);
- assertThat(unparceled.hashCode()).isEqualTo(original.hashCode());
-
- SoftApConfiguration copy = new SoftApConfiguration.Builder(original).build();
- assertThat(copy).isNotSameInstanceAs(original);
- assertThat(copy).isEqualTo(original);
- assertThat(copy.hashCode()).isEqualTo(original.hashCode());
- }
-
- @Test
- public void testWpa3SaeTransition() {
- SoftApConfiguration original = new SoftApConfiguration.Builder()
- .setPassphrase("secretsecret",
- SoftApConfiguration.SECURITY_TYPE_WPA3_SAE_TRANSITION)
- .setChannel(149, SoftApConfiguration.BAND_5GHZ)
- .setHiddenSsid(true)
- .build();
- assertThat(original.getSecurityType()).isEqualTo(
- SoftApConfiguration.SECURITY_TYPE_WPA3_SAE_TRANSITION);
- assertThat(original.getPassphrase()).isEqualTo("secretsecret");
- assertThat(original.getBand()).isEqualTo(SoftApConfiguration.BAND_5GHZ);
- assertThat(original.getChannel()).isEqualTo(149);
- assertThat(original.isHiddenSsid()).isEqualTo(true);
-
-
- SoftApConfiguration unparceled = parcelUnparcel(original);
- assertThat(unparceled).isNotSameInstanceAs(original);
- assertThat(unparceled).isEqualTo(original);
- assertThat(unparceled.hashCode()).isEqualTo(original.hashCode());
-
- SoftApConfiguration copy = new SoftApConfiguration.Builder(original).build();
- assertThat(copy).isNotSameInstanceAs(original);
- assertThat(copy).isEqualTo(original);
- assertThat(copy.hashCode()).isEqualTo(original.hashCode());
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testInvalidBroadcastBssid() {
- SoftApConfiguration original = new SoftApConfiguration.Builder()
- .setBssid(MacAddress.BROADCAST_ADDRESS)
- .build();
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testInvalidMulticastBssid() {
- SoftApConfiguration original = new SoftApConfiguration.Builder()
- .setBssid(MacAddress.fromString("01:aa:bb:cc:dd:ee"))
- .build();
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testInvalidShortPasswordLengthForWpa2() {
- SoftApConfiguration original = new SoftApConfiguration.Builder()
- .setPassphrase(generateRandomString(SoftApConfiguration.PSK_MIN_LEN - 1),
- SoftApConfiguration.SECURITY_TYPE_WPA2_PSK)
- .setChannel(149, SoftApConfiguration.BAND_5GHZ)
- .setHiddenSsid(true)
- .build();
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testInvalidLongPasswordLengthForWpa2() {
- SoftApConfiguration original = new SoftApConfiguration.Builder()
- .setPassphrase(generateRandomString(SoftApConfiguration.PSK_MAX_LEN + 1),
- SoftApConfiguration.SECURITY_TYPE_WPA2_PSK)
- .setChannel(149, SoftApConfiguration.BAND_5GHZ)
- .setHiddenSsid(true)
- .build();
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testInvalidShortPasswordLengthForWpa3SaeTransition() {
- SoftApConfiguration original = new SoftApConfiguration.Builder()
- .setPassphrase(generateRandomString(SoftApConfiguration.PSK_MIN_LEN - 1),
- SoftApConfiguration.SECURITY_TYPE_WPA3_SAE_TRANSITION)
- .setChannel(149, SoftApConfiguration.BAND_5GHZ)
- .setHiddenSsid(true)
- .build();
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testInvalidLongPasswordLengthForWpa3SaeTransition() {
- SoftApConfiguration original = new SoftApConfiguration.Builder()
- .setPassphrase(generateRandomString(SoftApConfiguration.PSK_MAX_LEN + 1),
- SoftApConfiguration.SECURITY_TYPE_WPA3_SAE_TRANSITION)
- .setChannel(149, SoftApConfiguration.BAND_5GHZ)
- .setHiddenSsid(true)
- .build();
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testInvalieShutdownTimeoutMillis() {
- SoftApConfiguration original = new SoftApConfiguration.Builder()
- .setShutdownTimeoutMillis(-1)
- .build();
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testSetClientListExceptionWhenExistMacAddressInBothList() {
- final MacAddress testMacAddress_1 = MacAddress.fromString("22:33:44:55:66:77");
- final MacAddress testMacAddress_2 = MacAddress.fromString("aa:bb:cc:dd:ee:ff");
- ArrayList<MacAddress> testAllowedClientList = new ArrayList<>();
- testAllowedClientList.add(testMacAddress_1);
- testAllowedClientList.add(testMacAddress_2);
- ArrayList<MacAddress> testBlockedClientList = new ArrayList<>();
- testBlockedClientList.add(testMacAddress_1);
- SoftApConfiguration.Builder configBuilder = new SoftApConfiguration.Builder();
- configBuilder.setBlockedClientList(testBlockedClientList)
- .setAllowedClientList(testAllowedClientList)
- .build();
- }
-
- @Test
- public void testToWifiConfigurationWithUnsupportedParameter() {
- SoftApConfiguration sae_config = new SoftApConfiguration.Builder()
- .setPassphrase("secretsecret", SoftApConfiguration.SECURITY_TYPE_WPA3_SAE)
- .build();
-
- assertNull(sae_config.toWifiConfiguration());
- SoftApConfiguration band_6g_config = new SoftApConfiguration.Builder()
- .setBand(SoftApConfiguration.BAND_6GHZ)
- .build();
-
- assertNull(band_6g_config.toWifiConfiguration());
- }
-
- @Test
- public void testToWifiConfigurationWithSupportedParameter() {
- SoftApConfiguration softApConfig_2g = new SoftApConfiguration.Builder()
- .setPassphrase("secretsecret",
- SoftApConfiguration.SECURITY_TYPE_WPA2_PSK)
- .setChannel(11, SoftApConfiguration.BAND_2GHZ)
- .setHiddenSsid(true)
- .build();
- WifiConfiguration wifiConfig_2g = softApConfig_2g.toWifiConfiguration();
- assertThat(wifiConfig_2g.getAuthType()).isEqualTo(WifiConfiguration.KeyMgmt.WPA2_PSK);
- assertThat(wifiConfig_2g.preSharedKey).isEqualTo("secretsecret");
- assertThat(wifiConfig_2g.apBand).isEqualTo(WifiConfiguration.AP_BAND_2GHZ);
- assertThat(wifiConfig_2g.apChannel).isEqualTo(11);
- assertThat(wifiConfig_2g.hiddenSSID).isEqualTo(true);
-
- SoftApConfiguration softApConfig_5g = new SoftApConfiguration.Builder()
- .setPassphrase("secretsecret",
- SoftApConfiguration.SECURITY_TYPE_WPA2_PSK)
- .setChannel(149, SoftApConfiguration.BAND_5GHZ)
- .setHiddenSsid(true)
- .build();
- WifiConfiguration wifiConfig_5g = softApConfig_5g.toWifiConfiguration();
- assertThat(wifiConfig_5g.getAuthType()).isEqualTo(WifiConfiguration.KeyMgmt.WPA2_PSK);
- assertThat(wifiConfig_5g.preSharedKey).isEqualTo("secretsecret");
- assertThat(wifiConfig_5g.apBand).isEqualTo(WifiConfiguration.AP_BAND_5GHZ);
- assertThat(wifiConfig_5g.apChannel).isEqualTo(149);
- assertThat(wifiConfig_5g.hiddenSSID).isEqualTo(true);
-
- SoftApConfiguration softApConfig_2g5g = new SoftApConfiguration.Builder()
- .setPassphrase("secretsecret",
- SoftApConfiguration.SECURITY_TYPE_WPA2_PSK)
- .setBand(SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ)
- .setHiddenSsid(true)
- .build();
- WifiConfiguration wifiConfig_2g5g = softApConfig_2g5g.toWifiConfiguration();
- assertThat(wifiConfig_2g5g.getAuthType()).isEqualTo(WifiConfiguration.KeyMgmt.WPA2_PSK);
- assertThat(wifiConfig_2g5g.preSharedKey).isEqualTo("secretsecret");
- assertThat(wifiConfig_2g5g.apBand).isEqualTo(WifiConfiguration.AP_BAND_ANY);
- assertThat(wifiConfig_2g5g.apChannel).isEqualTo(0);
- assertThat(wifiConfig_2g5g.hiddenSSID).isEqualTo(true);
-
- SoftApConfiguration softApConfig_sae_transition = new SoftApConfiguration.Builder()
- .setPassphrase("secretsecret",
- SoftApConfiguration.SECURITY_TYPE_WPA3_SAE_TRANSITION)
- .build();
-
- WifiConfiguration wifiConfig_sae_transition =
- softApConfig_sae_transition.toWifiConfiguration();
- assertThat(wifiConfig_sae_transition.getAuthType())
- .isEqualTo(WifiConfiguration.KeyMgmt.WPA2_PSK);
- assertThat(wifiConfig_sae_transition.preSharedKey).isEqualTo("secretsecret");
- }
-
- @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;
- SoftApConfiguration dual_bands_config = new SoftApConfiguration.Builder()
- .setSsid("ssid")
- .setBands(dual_bands)
- .build();
- assertTrue(Arrays.equals(dual_bands, dual_bands_config.getBands()));
- assertThat(dual_bands_config.getBand()).isEqualTo(SoftApConfiguration.BAND_2GHZ);
- }
-
- @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;
- SparseIntArray dual_channels = new SparseIntArray(2);
- dual_channels.put(SoftApConfiguration.BAND_5GHZ, 149);
- dual_channels.put(SoftApConfiguration.BAND_2GHZ, 2);
- SoftApConfiguration dual_channels_config = new SoftApConfiguration.Builder()
- .setSsid("ssid")
- .setChannels(dual_channels)
- .build();
- assertTrue(Arrays.equals(expected_dual_bands, dual_channels_config.getBands()));
- assertThat(dual_channels_config.getBand()).isEqualTo(SoftApConfiguration.BAND_2GHZ);
- assertTrue(dual_channels.toString().equals(dual_channels_config.getChannels().toString()));
- assertThat(dual_channels_config.getChannel()).isEqualTo(2);
-
- // Test different parameters.
- dual_channels.clear();
- dual_channels.put(SoftApConfiguration.BAND_5GHZ, 149);
- dual_channels.put(SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ, 0);
- expected_dual_bands[0] = SoftApConfiguration.BAND_5GHZ;
- expected_dual_bands[1] = SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ;
- dual_channels_config = new SoftApConfiguration.Builder()
- .setSsid("ssid")
- .setChannels(dual_channels)
- .build();
- assertTrue(Arrays.equals(expected_dual_bands, dual_channels_config.getBands()));
- assertThat(dual_channels_config.getBand()).isEqualTo(SoftApConfiguration.BAND_5GHZ);
- assertTrue(dual_channels.toString().equals(dual_channels_config.getChannels().toString()));
- assertThat(dual_channels_config.getChannel()).isEqualTo(149);
- }
-
- @Test
- public void testInvalidBandWhenSetBands() {
- assumeTrue(SdkLevel.isAtLeastS());
- boolean isIllegalArgumentExceptionHappened = false;
- int[] dual_bands = new int[2];
- dual_bands[0] = SoftApConfiguration.BAND_2GHZ;
- dual_bands[1] = -1;
- try {
- SoftApConfiguration dual_channels_config = new SoftApConfiguration.Builder()
- .setSsid("ssid")
- .setBands(dual_bands)
- .build();
- isIllegalArgumentExceptionHappened = false;
- } catch (IllegalArgumentException iae) {
- isIllegalArgumentExceptionHappened = true;
- }
- assertTrue(isIllegalArgumentExceptionHappened);
-
- try {
- SoftApConfiguration dual_channels_config = new SoftApConfiguration.Builder()
- .setSsid("ssid")
- .setBands(new int[0])
- .build();
- isIllegalArgumentExceptionHappened = false;
- } catch (IllegalArgumentException iae) {
- isIllegalArgumentExceptionHappened = true;
- }
- assertTrue(isIllegalArgumentExceptionHappened);
-
- try {
- SoftApConfiguration dual_channels_config = new SoftApConfiguration.Builder()
- .setSsid("ssid")
- .setBands(new int[3])
- .build();
- isIllegalArgumentExceptionHappened = false;
- } catch (IllegalArgumentException iae) {
- isIllegalArgumentExceptionHappened = true;
- }
- assertTrue(isIllegalArgumentExceptionHappened);
- }
-
- @Test
- public void testInvalidConfigWhenSetChannels() {
- assumeTrue(SdkLevel.isAtLeastS());
- boolean isIllegalArgumentExceptionHappened = false;
- SparseIntArray invalid_channels = new SparseIntArray();
- try {
- SoftApConfiguration zero_channels_config = new SoftApConfiguration.Builder()
- .setSsid("ssid")
- .setChannels(invalid_channels)
- .build();
- isIllegalArgumentExceptionHappened = false;
- } catch (IllegalArgumentException iae) {
- isIllegalArgumentExceptionHappened = true;
- }
- assertTrue(isIllegalArgumentExceptionHappened);
-
- try {
- invalid_channels.clear();
- invalid_channels.put(SoftApConfiguration.BAND_2GHZ, 2);
- invalid_channels.put(SoftApConfiguration.BAND_5GHZ, 11);
- SoftApConfiguration invalid_band_channels_config = new SoftApConfiguration.Builder()
- .setSsid("ssid")
- .setChannels(invalid_channels)
- .build();
- isIllegalArgumentExceptionHappened = false;
- } catch (IllegalArgumentException iae) {
- isIllegalArgumentExceptionHappened = true;
- }
- assertTrue(isIllegalArgumentExceptionHappened);
-
- try {
- invalid_channels.clear();
- invalid_channels.put(SoftApConfiguration.BAND_2GHZ, 2);
- invalid_channels.put(SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ,
- 149);
- SoftApConfiguration invalid_dual_channels_config = new SoftApConfiguration.Builder()
- .setSsid("ssid")
- .setChannels(invalid_channels)
- .build();
- isIllegalArgumentExceptionHappened = false;
- } catch (IllegalArgumentException iae) {
- isIllegalArgumentExceptionHappened = true;
- }
- assertTrue(isIllegalArgumentExceptionHappened);
-
- try {
- invalid_channels.clear();
- invalid_channels.put(SoftApConfiguration.BAND_2GHZ, 2);
- invalid_channels.put(SoftApConfiguration.BAND_5GHZ, 149);
- invalid_channels.put(SoftApConfiguration.BAND_6GHZ, 2);
- SoftApConfiguration three_channels_config = new SoftApConfiguration.Builder()
- .setSsid("ssid")
- .setChannels(invalid_channels)
- .build();
- isIllegalArgumentExceptionHappened = false;
- } catch (IllegalArgumentException iae) {
- isIllegalArgumentExceptionHappened = true;
- }
- 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
deleted file mode 100644
index 2121d10..0000000
--- a/wifi/tests/src/android/net/wifi/SoftApInfoTest.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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.net.wifi;
-
-import static org.junit.Assert.assertEquals;
-
-import android.net.MacAddress;
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import com.android.modules.utils.build.SdkLevel;
-
-import org.junit.Test;
-
-/**
- * Unit tests for {@link android.net.wifi.SoftApInfo}.
- */
-@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(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);
-
- assertEquals(info, copiedInfo);
- assertEquals(info.hashCode(), copiedInfo.hashCode());
- }
-
- /**
- * Verifies parcel serialization/deserialization.
- */
- @Test
- public void testParcelOperation() 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);
-
- Parcel parcelW = Parcel.obtain();
- info.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- SoftApInfo fromParcel = SoftApInfo.CREATOR.createFromParcel(parcelR);
-
- assertEquals(info, fromParcel);
- assertEquals(info.hashCode(), fromParcel.hashCode());
- }
-
-
- /**
- * Verifies the initial value same as expected.
- */
- @Test
- public void testInitialValue() throws Exception {
- SoftApInfo info = new SoftApInfo();
- assertEquals(info.getFrequency(), 0);
- assertEquals(info.getBandwidth(), SoftApInfo.CHANNEL_WIDTH_INVALID);
- 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
deleted file mode 100644
index 7046563..0000000
--- a/wifi/tests/src/android/net/wifi/WifiClientTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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.net.wifi;
-
-import static com.android.testutils.MiscAsserts.assertFieldCountEquals;
-import static com.android.testutils.ParcelUtils.assertParcelSane;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-
-import android.net.MacAddress;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-/**
- * Unit tests for {@link android.net.wifi.WifiClient}.
- */
-@SmallTest
-public class WifiClientTest {
- private static final String INTERFACE_NAME = "wlan0";
- private static final String MAC_ADDRESS_STRING = "00:0a:95:9d:68:16";
- private static final MacAddress MAC_ADDRESS = MacAddress.fromString(MAC_ADDRESS_STRING);
-
- /**
- * Verify parcel write/read with WifiClient.
- */
- @Test
- public void testWifiClientParcelWriteRead() throws Exception {
- WifiClient writeWifiClient = new WifiClient(MAC_ADDRESS, INTERFACE_NAME);
-
- assertParcelSane(writeWifiClient, 2);
- }
-
- /**
- * Verify equals with WifiClient.
- */
- @Test
- public void testWifiClientEquals() throws Exception {
- 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(2, WifiClient.class);
- }
-
- /**
- * Verify not-equals with WifiClient.
- */
- @Test
- public void testWifiClientNotEquals() throws Exception {
- final MacAddress macAddressNotEquals = MacAddress.fromString("00:00:00:00:00:00");
- 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
deleted file mode 100644
index f351e61..0000000
--- a/wifi/tests/src/android/net/wifi/WifiConfigurationTest.java
+++ /dev/null
@@ -1,1122 +0,0 @@
-/*
- * Copyright (C) 2016 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 android.net.wifi.WifiConfiguration.SECURITY_TYPE_EAP;
-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;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-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;
-
-import com.android.net.module.util.MacAddressUtils;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import java.util.List;
-
-/**
- * Unit tests for {@link android.net.wifi.WifiConfiguration}.
- */
-@SmallTest
-public class WifiConfigurationTest {
- private static final String TEST_PASSPOINT_UNIQUE_ID = "uniqueId";
- private static final int TEST_CARRIER_ID = 1234;
- private static final int TEST_SUB_ID = 3;
- private static final String TEST_PACKAGE_NAME = "google.com";
-
- @Before
- public void setUp() {
- }
-
- /**
- * Check that parcel marshalling/unmarshalling works
- *
- * Create and populate a WifiConfiguration.
- * Marshall and unmashall it, and expect to recover a copy of the original.
- * Marshall the resulting object, and expect the bytes to match the
- * first marshall result.
- */
- @Test
- public void testWifiConfigurationParcel() {
- String cookie = "C O.o |<IE";
- WifiConfiguration config = new WifiConfiguration();
- config.setPasspointManagementObjectTree(cookie);
- config.trusted = false;
- config.oemPaid = true;
- config.oemPrivate = true;
- config.carrierMerged = true;
- config.updateIdentifier = "1234";
- config.fromWifiNetworkSpecifier = true;
- config.fromWifiNetworkSuggestion = true;
- config.setRandomizedMacAddress(MacAddressUtils.createRandomUnicastAddress());
- MacAddress macBeforeParcel = config.getRandomizedMacAddress();
- config.subscriptionId = 1;
- config.carrierId = 1189;
- Parcel parcelW = Parcel.obtain();
- config.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- WifiConfiguration reconfig = WifiConfiguration.CREATOR.createFromParcel(parcelR);
-
- // lacking a useful config.equals, check two fields near the end.
- assertEquals(cookie, reconfig.getMoTree());
- assertEquals(macBeforeParcel, reconfig.getRandomizedMacAddress());
- assertEquals(config.updateIdentifier, reconfig.updateIdentifier);
- assertFalse(reconfig.trusted);
- assertTrue(reconfig.fromWifiNetworkSpecifier);
- assertTrue(reconfig.fromWifiNetworkSuggestion);
- assertTrue(reconfig.oemPaid);
- assertTrue(reconfig.oemPrivate);
- assertTrue(reconfig.carrierMerged);
-
- Parcel parcelWW = Parcel.obtain();
- reconfig.writeToParcel(parcelWW, 0);
- byte[] rebytes = parcelWW.marshall();
- parcelWW.recycle();
-
- assertArrayEquals(bytes, rebytes);
- }
-
- @Test
- public void testWifiConfigurationCopyConstructor() {
- WifiConfiguration config = new WifiConfiguration();
- config.trusted = false;
- config.oemPaid = true;
- config.oemPrivate = true;
- config.carrierMerged = true;
- config.updateIdentifier = "1234";
- config.fromWifiNetworkSpecifier = true;
- config.fromWifiNetworkSuggestion = true;
- config.setRandomizedMacAddress(MacAddressUtils.createRandomUnicastAddress());
- MacAddress macBeforeParcel = config.getRandomizedMacAddress();
- config.subscriptionId = 1;
- config.carrierId = 1189;
-
- WifiConfiguration reconfig = new WifiConfiguration(config);
-
- // lacking a useful config.equals, check two fields near the end.
- assertEquals(macBeforeParcel, reconfig.getRandomizedMacAddress());
- assertEquals(config.updateIdentifier, reconfig.updateIdentifier);
- assertFalse(reconfig.trusted);
- assertTrue(reconfig.fromWifiNetworkSpecifier);
- assertTrue(reconfig.fromWifiNetworkSuggestion);
- assertTrue(reconfig.oemPaid);
- assertTrue(reconfig.oemPrivate);
- assertTrue(reconfig.carrierMerged);
- }
-
- @Test
- public void testIsOpenNetwork_IsOpen_NullWepKeys() {
- WifiConfiguration config = new WifiConfiguration();
- config.allowedKeyManagement.clear();
- config.wepKeys = null;
-
- assertTrue(config.isOpenNetwork());
- }
-
- @Test
- public void testIsOpenNetwork_IsOpen_ZeroLengthWepKeysArray() {
- WifiConfiguration config = new WifiConfiguration();
- config.allowedKeyManagement.clear();
- config.wepKeys = new String[0];
-
- assertTrue(config.isOpenNetwork());
- }
-
- @Test
- public void testIsOpenNetwork_IsOpen_NullWepKeysArray() {
- WifiConfiguration config = new WifiConfiguration();
- config.allowedKeyManagement.clear();
- config.wepKeys = new String[1];
-
- assertTrue(config.isOpenNetwork());
- }
-
- @Test
- public void testIsOpenNetwork_NotOpen_HasWepKeys() {
- WifiConfiguration config = new WifiConfiguration();
- config.allowedKeyManagement.clear();
- config.wepKeys = new String[] {"test"};
-
- assertFalse(config.isOpenNetwork());
- }
-
- @Test
- public void testIsOpenNetwork_NotOpen_HasNullWepKeyFollowedByNonNullKey() {
- WifiConfiguration config = new WifiConfiguration();
- config.allowedKeyManagement.clear();
- config.wepKeys = new String[] {null, null, "test"};
-
- assertFalse(config.isOpenNetwork());
- }
-
- @Test
- public void testIsOpenNetwork_NotOpen_HasAuthType() {
- 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.setSecurityParams(type);
- config.wepKeys = null;
-
- assertFalse("Open network reported when security type was set to "
- + type, config.isOpenNetwork());
- }
- }
-
- @Test
- public void testIsOpenNetwork_NotOpen_HasAuthTypeNoneAndMore() {
- WifiConfiguration config = new WifiConfiguration();
- config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
- config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_EAP);
- config.wepKeys = null;
- config.convertLegacyFieldsToSecurityParamsIfNeeded();
-
- assertFalse(config.isOpenNetwork());
- }
-
- @Test
- public void testSetRandomizedMacAddress_ChangesSavedAddress() {
- WifiConfiguration config = new WifiConfiguration();
- MacAddress defaultMac = MacAddress.fromString(WifiInfo.DEFAULT_MAC_ADDRESS);
- assertEquals(defaultMac, config.getRandomizedMacAddress());
-
- MacAddress macToChangeInto = MacAddressUtils.createRandomUnicastAddress();
- config.setRandomizedMacAddress(macToChangeInto);
- MacAddress macAfterChange = config.getRandomizedMacAddress();
-
- assertEquals(macToChangeInto, macAfterChange);
- }
-
- @Test
- public void testSetRandomizedMacAddress_DoesNothingWhenNull() {
- WifiConfiguration config = new WifiConfiguration();
- MacAddress defaultMac = MacAddress.fromString(WifiInfo.DEFAULT_MAC_ADDRESS);
- config.setRandomizedMacAddress(null);
- assertEquals(defaultMac, config.getRandomizedMacAddress());
- }
-
- /**
- * Verifies that updateIdentifier should be copied for copy constructor.
- */
- @Test
- public void testUpdateIdentifierForCopyConstructor() {
- WifiConfiguration config = new WifiConfiguration();
- config.updateIdentifier = "1234";
- WifiConfiguration copyConfig = new WifiConfiguration(config);
-
- assertEquals(config.updateIdentifier, copyConfig.updateIdentifier);
- }
-
- /**
- * Verifies that getKeyIdForCredentials returns the expected string for Enterprise networks
- * @throws Exception
- */
- @Test
- public void testGetKeyIdForCredentials() throws Exception {
- WifiConfiguration config = new WifiConfiguration();
- final String mSsid = "TestAP";
- config.SSID = mSsid;
-
- // Test various combinations
- // EAP with TLS
- config.allowedKeyManagement.set(KeyMgmt.WPA_EAP);
- config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.NONE);
- String keyId = config.getKeyIdForCredentials(config);
- assertEquals(keyId, mSsid + "_WPA_EAP_TLS_NULL");
-
- // EAP with TTLS & MSCHAPv2
- config.allowedKeyManagement.set(KeyMgmt.WPA_EAP);
- config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TTLS);
- config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.MSCHAPV2);
- keyId = config.getKeyIdForCredentials(config);
- assertEquals(keyId, mSsid + "_WPA_EAP_TTLS_MSCHAPV2");
-
- // Suite-B 192 with PWD & GTC
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.SUITE_B_192);
- config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.PWD);
- config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.GTC);
- keyId = config.getKeyIdForCredentials(config);
- assertEquals(keyId, mSsid + "_SUITE_B_192_PWD_GTC");
-
- // IEEE8021X with SIM
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.IEEE8021X);
- config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.SIM);
- config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.NONE);
- keyId = config.getKeyIdForCredentials(config);
- assertEquals(keyId, mSsid + "_IEEE8021X_SIM_NULL");
-
- // Try calling this method with non-Enterprise network, expect an exception
- boolean exceptionThrown = false;
- try {
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.WPA2_PSK);
- config.preSharedKey = "TestPsk";
- keyId = config.getKeyIdForCredentials(config);
- } catch (IllegalStateException e) {
- exceptionThrown = true;
- }
- assertTrue(exceptionThrown);
- }
-
- /**
- * Verifies that getKeyIdForCredentials returns the expected string for Suggestion Enterprise
- * networks
- * @throws Exception
- */
- @Test
- public void testGetKeyIdForCredentialsForSuggestion() throws Exception {
- WifiConfiguration config = new WifiConfiguration();
- final String mSsid = "TestAP";
- final String packageName = "TestApp";
- final String bSsid = MacAddressUtils.createRandomUnicastAddress().toString();
- String suggestionSuffix = "_" + bSsid + "_" + packageName;
- config.SSID = mSsid;
- config.fromWifiNetworkSuggestion = true;
- config.creatorName = packageName;
- config.BSSID = bSsid;
-
- // Test various combinations
- // EAP with TLS
- config.allowedKeyManagement.set(KeyMgmt.WPA_EAP);
- config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.NONE);
- String keyId = config.getKeyIdForCredentials(config);
- assertEquals(keyId, mSsid + "_WPA_EAP_TLS_NULL" + suggestionSuffix);
-
- // EAP with TTLS & MSCHAPv2
- config.allowedKeyManagement.set(KeyMgmt.WPA_EAP);
- config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TTLS);
- config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.MSCHAPV2);
- keyId = config.getKeyIdForCredentials(config);
- assertEquals(keyId, mSsid + "_WPA_EAP_TTLS_MSCHAPV2" + suggestionSuffix);
-
- // Suite-B 192 with PWD & GTC
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.SUITE_B_192);
- config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.PWD);
- config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.GTC);
- keyId = config.getKeyIdForCredentials(config);
- assertEquals(keyId, mSsid + "_SUITE_B_192_PWD_GTC" + suggestionSuffix);
-
- // IEEE8021X with SIM
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.IEEE8021X);
- config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.SIM);
- config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.NONE);
- keyId = config.getKeyIdForCredentials(config);
- assertEquals(keyId, mSsid + "_IEEE8021X_SIM_NULL" + suggestionSuffix);
-
- // Try calling this method with non-Enterprise network, expect an exception
- boolean exceptionThrown = false;
- try {
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.WPA2_PSK);
- config.preSharedKey = "TestPsk";
- keyId = config.getKeyIdForCredentials(config);
- } catch (IllegalStateException e) {
- exceptionThrown = true;
- }
- assertTrue(exceptionThrown);
- }
-
- /**
- * Verifies that getSsidAndSecurityTypeString returns the correct String for networks of
- * various different security types
- */
- @Test
- public void testGetSsidAndSecurityTypeString() {
- WifiConfiguration config = new WifiConfiguration();
- final String mSsid = "TestAP";
- config.SSID = mSsid;
-
- // Test various combinations
- config.allowedKeyManagement.set(KeyMgmt.WPA_PSK);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.WPA_PSK],
- config.getSsidAndSecurityTypeString());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.WPA_EAP);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.WPA_EAP],
- config.getSsidAndSecurityTypeString());
-
- config.wepKeys[0] = "TestWep";
- config.allowedKeyManagement.clear();
- assertEquals(mSsid + "WEP", config.getSsidAndSecurityTypeString());
-
- // set WEP key and give a valid index.
- config.wepKeys[0] = null;
- config.wepKeys[2] = "TestWep";
- config.wepTxKeyIndex = 2;
- config.allowedKeyManagement.clear();
- assertEquals(mSsid + "WEP", config.getSsidAndSecurityTypeString());
-
- // set WEP key but does not give a valid index.
- config.wepKeys[0] = null;
- config.wepKeys[2] = "TestWep";
- config.wepTxKeyIndex = 0;
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.OWE);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.OWE], config.getSsidAndSecurityTypeString());
-
- config.wepKeys[0] = null;
- config.wepTxKeyIndex = 0;
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.OWE);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.OWE], config.getSsidAndSecurityTypeString());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.SAE);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.SAE], config.getSsidAndSecurityTypeString());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.SUITE_B_192);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.SUITE_B_192],
- config.getSsidAndSecurityTypeString());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.NONE);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.NONE], config.getSsidAndSecurityTypeString());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.WAPI_PSK);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.WAPI_PSK],
- config.getSsidAndSecurityTypeString());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.WAPI_CERT);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.WAPI_CERT],
- config.getSsidAndSecurityTypeString());
- }
-
- /**
- * Verifies that getNetworkKey returns the correct String for networks of
- * various different security types, the result should be stable.
- */
- @Test
- public void testGetNetworkKeyString() {
- WifiConfiguration config = new WifiConfiguration();
- final String mSsid = "TestAP";
- config.SSID = mSsid;
-
- // Test various combinations
- config.allowedKeyManagement.set(KeyMgmt.WPA_PSK);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.WPA_PSK],
- config.getNetworkKey());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.WPA_EAP);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.WPA_EAP],
- config.getNetworkKey());
-
- config.wepKeys[0] = "TestWep";
- config.allowedKeyManagement.clear();
- assertEquals(mSsid + "WEP", config.getNetworkKey());
-
- // set WEP key and give a valid index.
- config.wepKeys[0] = null;
- config.wepKeys[2] = "TestWep";
- config.wepTxKeyIndex = 2;
- config.allowedKeyManagement.clear();
- assertEquals(mSsid + "WEP", config.getNetworkKey());
-
- // set WEP key but does not give a valid index.
- config.wepKeys[0] = null;
- config.wepKeys[2] = "TestWep";
- config.wepTxKeyIndex = 0;
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.OWE);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.OWE], config.getNetworkKey());
-
- config.wepKeys[0] = null;
- config.wepTxKeyIndex = 0;
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.OWE);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.OWE], config.getNetworkKey());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.SAE);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.SAE], config.getNetworkKey());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.SUITE_B_192);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.SUITE_B_192],
- config.getNetworkKey());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.NONE);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.NONE], config.getNetworkKey());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.WAPI_PSK);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.WAPI_PSK],
- config.getNetworkKey());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.WAPI_CERT);
- assertEquals(mSsid + KeyMgmt.strings[KeyMgmt.WAPI_CERT],
- config.getNetworkKey());
-
- config.allowedKeyManagement.clear();
- config.setPasspointUniqueId(TEST_PASSPOINT_UNIQUE_ID);
- assertEquals(TEST_PASSPOINT_UNIQUE_ID, config.getNetworkKey());
- }
-
- /**
- * Ensure that the {@link NetworkSelectionStatus.DisableReasonInfo}s are populated in
- * {@link NetworkSelectionStatus#DISABLE_REASON_INFOS} for reason codes from 0 to
- * {@link NetworkSelectionStatus#NETWORK_SELECTION_DISABLED_MAX} - 1.
- */
- @Test
- public void testNetworkSelectionDisableReasonInfosPopulated() {
- assertEquals(NetworkSelectionStatus.NETWORK_SELECTION_DISABLED_MAX,
- NetworkSelectionStatus.DISABLE_REASON_INFOS.size());
- for (int i = 0; i < NetworkSelectionStatus.NETWORK_SELECTION_DISABLED_MAX; i++) {
- assertNotNull(NetworkSelectionStatus.DISABLE_REASON_INFOS.get(i));
- }
- }
-
- /**
- * Ensure that {@link NetworkSelectionStatus#getMaxNetworkSelectionDisableReason()} returns
- * the maximum disable reason.
- */
- @Test
- public void testNetworkSelectionGetMaxNetworkSelectionDisableReason() {
- int maxReason = Integer.MIN_VALUE;
- for (int i = 0; i < NetworkSelectionStatus.DISABLE_REASON_INFOS.size(); i++) {
- int reason = NetworkSelectionStatus.DISABLE_REASON_INFOS.keyAt(i);
- maxReason = Math.max(maxReason, reason);
- }
- assertEquals(maxReason, NetworkSelectionStatus.getMaxNetworkSelectionDisableReason());
- }
-
- /**
- * Ensure that {@link WifiConfiguration#setSecurityParams(int)} sets up the
- * {@link WifiConfiguration} object correctly for SAE security type.
- * @throws Exception
- */
- @Test
- public void testSetSecurityParamsForSae() throws Exception {
- WifiConfiguration config = new WifiConfiguration();
-
- config.setSecurityParams(SECURITY_TYPE_SAE);
-
- assertTrue(config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.SAE));
- assertTrue(config.allowedPairwiseCiphers.get(WifiConfiguration.PairwiseCipher.CCMP));
- assertTrue(config.allowedPairwiseCiphers.get(WifiConfiguration.PairwiseCipher.GCMP_256));
- assertTrue(config.allowedGroupCiphers.get(WifiConfiguration.GroupCipher.CCMP));
- assertTrue(config.allowedGroupCiphers.get(WifiConfiguration.GroupCipher.GCMP_256));
- assertTrue(config.requirePmf);
- }
-
- /**
- * Ensure that {@link WifiConfiguration#setSecurityParams(int)} sets up the
- * {@link WifiConfiguration} object correctly for OWE security type.
- * @throws Exception
- */
- @Test
- public void testSetSecurityParamsForOwe() throws Exception {
- WifiConfiguration config = new WifiConfiguration();
-
- config.setSecurityParams(SECURITY_TYPE_OWE);
-
- assertTrue(config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.OWE));
- assertTrue(config.allowedPairwiseCiphers.get(WifiConfiguration.PairwiseCipher.CCMP));
- assertTrue(config.allowedPairwiseCiphers.get(WifiConfiguration.PairwiseCipher.GCMP_256));
- assertTrue(config.allowedGroupCiphers.get(WifiConfiguration.GroupCipher.CCMP));
- assertTrue(config.allowedGroupCiphers.get(WifiConfiguration.GroupCipher.GCMP_256));
- assertTrue(config.requirePmf);
- }
-
- /**
- * Ensure that {@link WifiConfiguration#setSecurityParams(int)} sets up the
- * {@link WifiConfiguration} object correctly for Suite-B security type.
- * @throws Exception
- */
- @Test
- public void testSetSecurityParamsForSuiteB() throws Exception {
- WifiConfiguration config = new WifiConfiguration();
-
- config.setSecurityParams(SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT);
-
- assertTrue(config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.WPA_EAP));
- assertTrue(config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.IEEE8021X));
- assertTrue(config.allowedPairwiseCiphers.get(WifiConfiguration.PairwiseCipher.GCMP_256));
- assertTrue(config.allowedGroupCiphers.get(WifiConfiguration.GroupCipher.GCMP_256));
- assertTrue(config.allowedGroupManagementCiphers
- .get(WifiConfiguration.GroupMgmtCipher.BIP_GMAC_256));
- assertTrue(config.requirePmf);
- }
-
- /**
- * Ensure that {@link WifiConfiguration#setSecurityParams(int)} sets up the
- * {@link WifiConfiguration} object correctly for WPA3 Enterprise security type.
- * @throws Exception
- */
- @Test
- public void testSetSecurityParamsForWpa3Enterprise() throws Exception {
- WifiConfiguration config = new WifiConfiguration();
-
- config.setSecurityParams(SECURITY_TYPE_EAP_WPA3_ENTERPRISE);
-
- assertTrue(config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.WPA_EAP));
- assertTrue(config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.IEEE8021X));
- assertTrue(config.allowedPairwiseCiphers.get(WifiConfiguration.PairwiseCipher.CCMP));
- assertTrue(config.allowedPairwiseCiphers.get(WifiConfiguration.PairwiseCipher.GCMP_256));
- assertTrue(config.allowedGroupCiphers.get(WifiConfiguration.GroupCipher.CCMP));
- assertTrue(config.allowedGroupCiphers.get(WifiConfiguration.GroupCipher.GCMP_256));
- assertTrue(config.requirePmf);
- }
-
- /**
- * Test that the NetworkSelectionStatus Builder returns the same values that was set, and that
- * calling build multiple times returns different instances.
- */
- @Test
- public void testNetworkSelectionStatusBuilder() throws Exception {
- NetworkSelectionStatus.Builder builder = new NetworkSelectionStatus.Builder()
- .setNetworkSelectionDisableReason(
- NetworkSelectionStatus.DISABLED_ASSOCIATION_REJECTION)
- .setNetworkSelectionStatus(
- NetworkSelectionStatus.NETWORK_SELECTION_PERMANENTLY_DISABLED);
-
- NetworkSelectionStatus status1 = builder.build();
-
- assertEquals(NetworkSelectionStatus.DISABLED_ASSOCIATION_REJECTION,
- status1.getNetworkSelectionDisableReason());
- assertEquals(NetworkSelectionStatus.NETWORK_SELECTION_PERMANENTLY_DISABLED,
- status1.getNetworkSelectionStatus());
-
- NetworkSelectionStatus status2 = builder
- .setNetworkSelectionDisableReason(NetworkSelectionStatus.DISABLED_BY_WRONG_PASSWORD)
- .build();
-
- // different instances
- assertNotSame(status1, status2);
-
- // assert that status1 didn't change
- assertEquals(NetworkSelectionStatus.DISABLED_ASSOCIATION_REJECTION,
- status1.getNetworkSelectionDisableReason());
- assertEquals(NetworkSelectionStatus.NETWORK_SELECTION_PERMANENTLY_DISABLED,
- status1.getNetworkSelectionStatus());
-
- // assert that status2 changed
- assertEquals(NetworkSelectionStatus.DISABLED_BY_WRONG_PASSWORD,
- status2.getNetworkSelectionDisableReason());
- assertEquals(NetworkSelectionStatus.NETWORK_SELECTION_PERMANENTLY_DISABLED,
- status2.getNetworkSelectionStatus());
- }
-
- @Test
- public void testNeedsPreSharedKey() throws Exception {
- WifiConfiguration configuration = new WifiConfiguration();
-
- configuration.setSecurityParams(SECURITY_TYPE_PSK);
- assertTrue(configuration.needsPreSharedKey());
-
- configuration.setSecurityParams(SECURITY_TYPE_SAE);
- assertTrue(configuration.needsPreSharedKey());
-
- configuration.setSecurityParams(SECURITY_TYPE_WAPI_PSK);
- assertTrue(configuration.needsPreSharedKey());
-
- configuration.setSecurityParams(SECURITY_TYPE_OPEN);
- assertFalse(configuration.needsPreSharedKey());
-
- configuration.setSecurityParams(SECURITY_TYPE_OWE);
- assertFalse(configuration.needsPreSharedKey());
-
- configuration.setSecurityParams(SECURITY_TYPE_EAP);
- assertFalse(configuration.needsPreSharedKey());
-
- configuration.setSecurityParams(SECURITY_TYPE_EAP_WPA3_ENTERPRISE);
- assertFalse(configuration.needsPreSharedKey());
-
- configuration.setSecurityParams(SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT);
- assertFalse(configuration.needsPreSharedKey());
- }
-
- @Test
- public void testGetAuthType() throws Exception {
- WifiConfiguration configuration = new WifiConfiguration();
-
- configuration.setSecurityParams(SECURITY_TYPE_PSK);
- assertEquals(KeyMgmt.WPA_PSK, configuration.getAuthType());
-
- configuration.setSecurityParams(SECURITY_TYPE_SAE);
- assertEquals(KeyMgmt.SAE, configuration.getAuthType());
-
- configuration.setSecurityParams(SECURITY_TYPE_WAPI_PSK);
- assertEquals(KeyMgmt.WAPI_PSK, configuration.getAuthType());
-
- configuration.setSecurityParams(SECURITY_TYPE_OPEN);
- assertEquals(KeyMgmt.NONE, configuration.getAuthType());
-
- configuration.setSecurityParams(SECURITY_TYPE_OWE);
- assertEquals(KeyMgmt.OWE, configuration.getAuthType());
-
- configuration.setSecurityParams(SECURITY_TYPE_EAP);
- assertEquals(KeyMgmt.WPA_EAP, configuration.getAuthType());
-
- configuration.setSecurityParams(SECURITY_TYPE_EAP_WPA3_ENTERPRISE);
- assertEquals(KeyMgmt.WPA_EAP, configuration.getAuthType());
-
- configuration.setSecurityParams(SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT);
- assertEquals(KeyMgmt.SUITE_B_192, configuration.getAuthType());
-
- configuration.setSecurityParams(SECURITY_TYPE_WAPI_CERT);
- assertEquals(KeyMgmt.WAPI_CERT, configuration.getAuthType());
- }
-
- @Test (expected = IllegalStateException.class)
- public void testGetAuthTypeFailure1() throws Exception {
- WifiConfiguration configuration = new WifiConfiguration();
-
- configuration.setSecurityParams(SECURITY_TYPE_PSK);
- configuration.allowedKeyManagement.set(KeyMgmt.IEEE8021X);
- configuration.getAuthType();
- }
-
- @Test (expected = IllegalStateException.class)
- public void testGetAuthTypeFailure2() throws Exception {
- WifiConfiguration configuration = new WifiConfiguration();
-
- configuration.allowedKeyManagement.set(KeyMgmt.IEEE8021X);
- configuration.allowedKeyManagement.set(KeyMgmt.WPA_EAP);
- configuration.allowedKeyManagement.set(KeyMgmt.SAE);
- configuration.getAuthType();
- }
-
- /**
- * Verifies that getProfileKey returns the correct String for networks of
- * various different security types, the result should be stable.
- */
- @Test
- public void testGetProfileKeyString() {
- WifiConfiguration config = new WifiConfiguration();
- final String mSsid = "TestAP";
- config.SSID = mSsid;
- config.carrierId = TEST_CARRIER_ID;
- config.subscriptionId = TEST_SUB_ID;
- config.creatorName = TEST_PACKAGE_NAME;
-
-
- // Test various combinations
- config.allowedKeyManagement.set(KeyMgmt.WPA_PSK);
- config.fromWifiNetworkSuggestion = false;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.WPA_PSK], TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, false), config.getProfileKey());
- config.fromWifiNetworkSuggestion = true;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.WPA_PSK], TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, true), config.getProfileKey());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.WPA_EAP);
- config.fromWifiNetworkSuggestion = false;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.WPA_EAP], TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, false), config.getProfileKey());
- config.fromWifiNetworkSuggestion = true;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.WPA_EAP], TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, true), config.getProfileKey());
-
- config.wepKeys[0] = "TestWep";
- config.allowedKeyManagement.clear();
- config.fromWifiNetworkSuggestion = false;
- assertEquals(createProfileKey(mSsid, "WEP", TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, false), config.getProfileKey());
- config.fromWifiNetworkSuggestion = true;
- assertEquals(createProfileKey(mSsid, "WEP", TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, true), config.getProfileKey());
-
- // set WEP key and give a valid index.
- config.wepKeys[0] = null;
- config.wepKeys[2] = "TestWep";
- config.wepTxKeyIndex = 2;
- config.allowedKeyManagement.clear();
- config.fromWifiNetworkSuggestion = false;
- assertEquals(createProfileKey(mSsid, "WEP", TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, false), config.getProfileKey());
- config.fromWifiNetworkSuggestion = true;
- assertEquals(createProfileKey(mSsid, "WEP", TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, true), config.getProfileKey());
-
- // set WEP key but does not give a valid index.
- config.wepKeys[0] = null;
- config.wepKeys[2] = "TestWep";
- config.wepTxKeyIndex = 0;
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.OWE);
- config.fromWifiNetworkSuggestion = false;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.OWE], TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, false), config.getProfileKey());
- config.fromWifiNetworkSuggestion = true;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.OWE], TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, true), config.getProfileKey());
-
- config.wepKeys[0] = null;
- config.wepTxKeyIndex = 0;
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.OWE);
- config.fromWifiNetworkSuggestion = false;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.OWE], TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, false), config.getProfileKey());
- config.fromWifiNetworkSuggestion = true;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.OWE], TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, true), config.getProfileKey());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.SAE);
- config.fromWifiNetworkSuggestion = false;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.SAE], TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, false), config.getProfileKey());
- config.fromWifiNetworkSuggestion = true;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.SAE], TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, true), config.getProfileKey());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.SUITE_B_192);
- config.fromWifiNetworkSuggestion = false;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.SUITE_B_192],
- TEST_PACKAGE_NAME, TEST_CARRIER_ID, TEST_SUB_ID, false), config.getProfileKey());
- config.fromWifiNetworkSuggestion = true;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.SUITE_B_192],
- TEST_PACKAGE_NAME, TEST_CARRIER_ID, TEST_SUB_ID, true), config.getProfileKey());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.NONE);
- config.fromWifiNetworkSuggestion = false;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.NONE], TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, false), config.getProfileKey());
- config.fromWifiNetworkSuggestion = true;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.NONE], TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, true), config.getProfileKey());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.WAPI_PSK);
- config.fromWifiNetworkSuggestion = false;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.WAPI_PSK], TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, false), config.getProfileKey());
- config.fromWifiNetworkSuggestion = true;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.WAPI_PSK], TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, true), config.getProfileKey());
-
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(KeyMgmt.WAPI_CERT);
- config.fromWifiNetworkSuggestion = false;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.WAPI_CERT], TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, false), config.getProfileKey());
- config.fromWifiNetworkSuggestion = true;
- assertEquals(createProfileKey(mSsid, KeyMgmt.strings[KeyMgmt.WAPI_CERT], TEST_PACKAGE_NAME,
- TEST_CARRIER_ID, TEST_SUB_ID, true), config.getProfileKey());
-
- config.allowedKeyManagement.clear();
- config.setPasspointUniqueId(TEST_PASSPOINT_UNIQUE_ID);
- assertEquals(TEST_PASSPOINT_UNIQUE_ID, config.getProfileKey());
- }
-
- private String createProfileKey(String ssid, String keyMgmt, String providerName,
- int carrierId, int subId, boolean isFromSuggestion) {
- StringBuilder sb = new StringBuilder();
- sb.append(ssid).append(keyMgmt);
- if (isFromSuggestion) {
- sb.append("_").append(providerName).append('-')
- .append(carrierId).append('-').append(subId);
- }
- 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/WifiEnterpriseConfigTest.java b/wifi/tests/src/android/net/wifi/WifiEnterpriseConfigTest.java
deleted file mode 100644
index 62485ec..0000000
--- a/wifi/tests/src/android/net/wifi/WifiEnterpriseConfigTest.java
+++ /dev/null
@@ -1,577 +0,0 @@
-/*
- * Copyright (C) 2016 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.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import android.net.wifi.WifiEnterpriseConfig.Eap;
-import android.net.wifi.WifiEnterpriseConfig.Phase2;
-import android.os.Parcel;
-import android.security.Credentials;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import java.security.PrivateKey;
-import java.security.cert.X509Certificate;
-
-/**
- * Unit tests for {@link android.net.wifi.WifiEnterpriseConfig}.
- */
-@SmallTest
-public class WifiEnterpriseConfigTest {
- // Maintain a ground truth of the keystore uri prefix which is expected by wpa_supplicant.
- public static final String KEYSTORE_URI = "keystore://";
- public static final String CA_CERT_PREFIX = KEYSTORE_URI + Credentials.CA_CERTIFICATE;
- public static final String KEYSTORES_URI = "keystores://";
- private static final String TEST_DOMAIN_SUFFIX_MATCH = "domainSuffixMatch";
-
- private WifiEnterpriseConfig mEnterpriseConfig;
-
- @Before
- public void setUp() throws Exception {
- mEnterpriseConfig = new WifiEnterpriseConfig();
- }
-
- @Test
- public void testGetEmptyCaCertificate() {
- // A newly-constructed WifiEnterpriseConfig object should have no CA certificate.
- assertNull(mEnterpriseConfig.getCaCertificate());
- assertNull(mEnterpriseConfig.getCaCertificates());
- // Setting CA certificate to null explicitly.
- mEnterpriseConfig.setCaCertificate(null);
- assertNull(mEnterpriseConfig.getCaCertificate());
- // Setting CA certificate to null using setCaCertificates().
- mEnterpriseConfig.setCaCertificates(null);
- assertNull(mEnterpriseConfig.getCaCertificates());
- // Setting CA certificate to zero-length array.
- mEnterpriseConfig.setCaCertificates(new X509Certificate[0]);
- assertNull(mEnterpriseConfig.getCaCertificates());
- }
-
- @Test
- public void testSetGetSingleCaCertificate() {
- X509Certificate cert0 = FakeKeys.CA_CERT0;
- mEnterpriseConfig.setCaCertificate(cert0);
- assertEquals(mEnterpriseConfig.getCaCertificate(), cert0);
- }
-
- @Test
- public void testSetGetMultipleCaCertificates() {
- X509Certificate cert0 = FakeKeys.CA_CERT0;
- X509Certificate cert1 = FakeKeys.CA_CERT1;
- mEnterpriseConfig.setCaCertificates(new X509Certificate[] {cert0, cert1});
- X509Certificate[] result = mEnterpriseConfig.getCaCertificates();
- assertEquals(result.length, 2);
- assertTrue(result[0] == cert0 && result[1] == cert1);
- }
-
- @Test
- public void testSetClientKeyEntryWithNull() {
- mEnterpriseConfig.setClientKeyEntry(null, null);
- assertNull(mEnterpriseConfig.getClientCertificateChain());
- assertNull(mEnterpriseConfig.getClientCertificate());
- mEnterpriseConfig.setClientKeyEntryWithCertificateChain(null, null);
- assertNull(mEnterpriseConfig.getClientCertificateChain());
- assertNull(mEnterpriseConfig.getClientCertificate());
-
- // Setting the client certificate to null should clear the existing chain.
- PrivateKey clientKey = FakeKeys.RSA_KEY1;
- X509Certificate clientCert0 = FakeKeys.CLIENT_CERT;
- X509Certificate clientCert1 = FakeKeys.CA_CERT1;
- mEnterpriseConfig.setClientKeyEntry(clientKey, clientCert0);
- assertNotNull(mEnterpriseConfig.getClientCertificate());
- mEnterpriseConfig.setClientKeyEntry(null, null);
- assertNull(mEnterpriseConfig.getClientCertificate());
- assertNull(mEnterpriseConfig.getClientCertificateChain());
-
- // Setting the chain to null should clear the existing chain.
- X509Certificate[] clientChain = new X509Certificate[] {clientCert0, clientCert1};
- mEnterpriseConfig.setClientKeyEntryWithCertificateChain(clientKey, clientChain);
- assertNotNull(mEnterpriseConfig.getClientCertificateChain());
- mEnterpriseConfig.setClientKeyEntryWithCertificateChain(null, null);
- assertNull(mEnterpriseConfig.getClientCertificate());
- assertNull(mEnterpriseConfig.getClientCertificateChain());
- }
-
- @Test
- public void testSetClientCertificateChain() {
- PrivateKey clientKey = FakeKeys.RSA_KEY1;
- X509Certificate cert0 = FakeKeys.CLIENT_CERT;
- X509Certificate cert1 = FakeKeys.CA_CERT1;
- X509Certificate[] clientChain = new X509Certificate[] {cert0, cert1};
- mEnterpriseConfig.setClientKeyEntryWithCertificateChain(clientKey, clientChain);
- X509Certificate[] result = mEnterpriseConfig.getClientCertificateChain();
- assertEquals(result.length, 2);
- assertTrue(result[0] == cert0 && result[1] == cert1);
- assertTrue(mEnterpriseConfig.getClientCertificate() == cert0);
- }
-
- private boolean isClientCertificateChainInvalid(X509Certificate[] clientChain) {
- boolean exceptionThrown = false;
- try {
- PrivateKey clientKey = FakeKeys.RSA_KEY1;
- mEnterpriseConfig.setClientKeyEntryWithCertificateChain(clientKey, clientChain);
- } catch (IllegalArgumentException e) {
- exceptionThrown = true;
- }
- return exceptionThrown;
- }
-
- @Test
- public void testSetInvalidClientCertificateChain() {
- X509Certificate clientCert = FakeKeys.CLIENT_CERT;
- X509Certificate caCert = FakeKeys.CA_CERT1;
- assertTrue("Invalid client certificate",
- isClientCertificateChainInvalid(new X509Certificate[] {caCert, caCert}));
- assertTrue("Invalid CA certificate",
- isClientCertificateChainInvalid(new X509Certificate[] {clientCert, clientCert}));
- assertTrue("Both certificates invalid",
- isClientCertificateChainInvalid(new X509Certificate[] {caCert, clientCert}));
- }
-
- @Test
- public void testSaveSingleCaCertificateAlias() {
- final String alias = "single_alias 0";
- mEnterpriseConfig.setCaCertificateAliases(new String[] {alias});
- assertEquals(getCaCertField(), CA_CERT_PREFIX + alias);
- }
-
- @Test
- public void testLoadSingleCaCertificateAlias() {
- final String alias = "single_alias 1";
- setCaCertField(CA_CERT_PREFIX + alias);
- String[] aliases = mEnterpriseConfig.getCaCertificateAliases();
- assertEquals(aliases.length, 1);
- assertEquals(aliases[0], alias);
- }
-
- @Test
- public void testSaveMultipleCaCertificates() {
- final String alias0 = "single_alias 0";
- final String alias1 = "single_alias 1";
- mEnterpriseConfig.setCaCertificateAliases(new String[] {alias0, alias1});
- assertEquals(getCaCertField(), String.format("%s%s %s",
- KEYSTORES_URI,
- WifiEnterpriseConfig.encodeCaCertificateAlias(Credentials.CA_CERTIFICATE + alias0),
- WifiEnterpriseConfig.encodeCaCertificateAlias(Credentials.CA_CERTIFICATE + alias1)));
- }
-
- @Test
- public void testLoadMultipleCaCertificates() {
- final String alias0 = "single_alias 0";
- final String alias1 = "single_alias 1";
- setCaCertField(String.format("%s%s %s",
- KEYSTORES_URI,
- WifiEnterpriseConfig.encodeCaCertificateAlias(Credentials.CA_CERTIFICATE + alias0),
- WifiEnterpriseConfig.encodeCaCertificateAlias(Credentials.CA_CERTIFICATE + alias1)));
- String[] aliases = mEnterpriseConfig.getCaCertificateAliases();
- assertEquals(aliases.length, 2);
- assertEquals(aliases[0], alias0);
- assertEquals(aliases[1], alias1);
- }
-
- private String getCaCertField() {
- return mEnterpriseConfig.getFieldValue(WifiEnterpriseConfig.CA_CERT_KEY);
- }
-
- private void setCaCertField(String value) {
- mEnterpriseConfig.setFieldValue(WifiEnterpriseConfig.CA_CERT_KEY, value);
- }
-
- // Retrieves the value for a specific key supplied to wpa_supplicant.
- private class SupplicantConfigExtractor implements WifiEnterpriseConfig.SupplicantSaver {
- private String mValue = null;
- private String mKey;
-
- SupplicantConfigExtractor(String key) {
- mKey = key;
- }
-
- @Override
- public boolean saveValue(String key, String value) {
- if (key.equals(mKey)) {
- mValue = value;
- }
- return true;
- }
-
- public String getValue() {
- return mValue;
- }
- }
-
- private String getSupplicantEapMethod() {
- SupplicantConfigExtractor entryExtractor = new SupplicantConfigExtractor(
- WifiEnterpriseConfig.EAP_KEY);
- mEnterpriseConfig.saveToSupplicant(entryExtractor);
- return entryExtractor.getValue();
- }
-
- private String getSupplicantPhase2Method() {
- SupplicantConfigExtractor entryExtractor = new SupplicantConfigExtractor(
- WifiEnterpriseConfig.PHASE2_KEY);
- mEnterpriseConfig.saveToSupplicant(entryExtractor);
- return entryExtractor.getValue();
- }
-
- /** Verifies the default value for EAP outer and inner methods */
- @Test
- public void eapInnerDefault() {
- assertEquals(null, getSupplicantEapMethod());
- assertEquals(null, getSupplicantPhase2Method());
- }
-
- /** Verifies that the EAP inner method is reset when we switch to TLS */
- @Test
- public void eapPhase2MethodForTls() {
- // Initially select an EAP method that supports an phase2.
- mEnterpriseConfig.setEapMethod(Eap.PEAP);
- mEnterpriseConfig.setPhase2Method(Phase2.MSCHAPV2);
- assertEquals("PEAP", getSupplicantEapMethod());
- assertEquals("\"auth=MSCHAPV2\"", getSupplicantPhase2Method());
-
- // Change the EAP method to another type which supports a phase2.
- mEnterpriseConfig.setEapMethod(Eap.TTLS);
- assertEquals("TTLS", getSupplicantEapMethod());
- assertEquals("\"auth=MSCHAPV2\"", getSupplicantPhase2Method());
-
- // Change the EAP method to TLS which does not support a phase2.
- mEnterpriseConfig.setEapMethod(Eap.TLS);
- assertEquals(null, getSupplicantPhase2Method());
- }
-
- /** Verfies that the EAP inner method is reset when we switch phase2 to NONE */
- @Test
- public void eapPhase2None() {
- // Initially select an EAP method that supports an phase2.
- mEnterpriseConfig.setEapMethod(Eap.PEAP);
- mEnterpriseConfig.setPhase2Method(Phase2.MSCHAPV2);
- assertEquals("PEAP", getSupplicantEapMethod());
- assertEquals("\"auth=MSCHAPV2\"", getSupplicantPhase2Method());
-
- // Change the phase2 method to NONE and ensure the value is cleared.
- mEnterpriseConfig.setPhase2Method(Phase2.NONE);
- assertEquals(null, getSupplicantPhase2Method());
- }
-
- /** Verfies that the correct "autheap" parameter is supplied for TTLS/GTC. */
- @Test
- public void peapGtcToTtls() {
- mEnterpriseConfig.setEapMethod(Eap.PEAP);
- mEnterpriseConfig.setPhase2Method(Phase2.GTC);
- assertEquals("PEAP", getSupplicantEapMethod());
- assertEquals("\"auth=GTC\"", getSupplicantPhase2Method());
-
- mEnterpriseConfig.setEapMethod(Eap.TTLS);
- assertEquals("TTLS", getSupplicantEapMethod());
- assertEquals("\"autheap=GTC\"", getSupplicantPhase2Method());
- }
-
- /** Verfies that the correct "auth" parameter is supplied for PEAP/GTC. */
- @Test
- public void ttlsGtcToPeap() {
- mEnterpriseConfig.setEapMethod(Eap.TTLS);
- mEnterpriseConfig.setPhase2Method(Phase2.GTC);
- assertEquals("TTLS", getSupplicantEapMethod());
- assertEquals("\"autheap=GTC\"", getSupplicantPhase2Method());
-
- mEnterpriseConfig.setEapMethod(Eap.PEAP);
- assertEquals("PEAP", getSupplicantEapMethod());
- assertEquals("\"auth=GTC\"", getSupplicantPhase2Method());
- }
-
- /** Verfies PEAP/SIM, PEAP/AKA, PEAP/AKA'. */
- @Test
- public void peapSimAkaAkaPrime() {
- mEnterpriseConfig.setEapMethod(Eap.PEAP);
- mEnterpriseConfig.setPhase2Method(Phase2.SIM);
- assertEquals("PEAP", getSupplicantEapMethod());
- assertEquals("\"auth=SIM\"", getSupplicantPhase2Method());
-
- mEnterpriseConfig.setPhase2Method(Phase2.AKA);
- assertEquals("\"auth=AKA\"", getSupplicantPhase2Method());
-
- mEnterpriseConfig.setPhase2Method(Phase2.AKA_PRIME);
- assertEquals("\"auth=AKA'\"", getSupplicantPhase2Method());
- }
-
- /**
- * Verifies that the copy constructor preseves both the masked password and inner method
- * information.
- */
- @Test
- public void copyConstructor() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setPassword("*");
- enterpriseConfig.setEapMethod(Eap.TTLS);
- enterpriseConfig.setPhase2Method(Phase2.GTC);
- mEnterpriseConfig = new WifiEnterpriseConfig(enterpriseConfig);
- assertEquals("TTLS", getSupplicantEapMethod());
- assertEquals("\"autheap=GTC\"", getSupplicantPhase2Method());
- assertEquals("*", mEnterpriseConfig.getPassword());
- }
-
- /**
- * Verifies that the copy from external ignores masked passwords and preserves the
- * inner method information.
- */
- @Test
- public void copyFromExternal() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setPassword("*");
- enterpriseConfig.setEapMethod(Eap.TTLS);
- enterpriseConfig.setPhase2Method(Phase2.GTC);
- enterpriseConfig.setOcsp(WifiEnterpriseConfig.OCSP_REQUIRE_CERT_STATUS);
- mEnterpriseConfig = new WifiEnterpriseConfig();
- mEnterpriseConfig.copyFromExternal(enterpriseConfig, "*");
- assertEquals("TTLS", getSupplicantEapMethod());
- assertEquals("\"autheap=GTC\"", getSupplicantPhase2Method());
- assertNotEquals("*", mEnterpriseConfig.getPassword());
- assertEquals(enterpriseConfig.getOcsp(), mEnterpriseConfig.getOcsp());
- }
-
- /** Verfies that parceling a WifiEnterpriseConfig preseves method information. */
- @Test
- public void parcelConstructor() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(Eap.TTLS);
- enterpriseConfig.setPhase2Method(Phase2.GTC);
- Parcel parcel = Parcel.obtain();
- enterpriseConfig.writeToParcel(parcel, 0);
- parcel.setDataPosition(0); // Allow parcel to be read from the beginning.
- mEnterpriseConfig = WifiEnterpriseConfig.CREATOR.createFromParcel(parcel);
- assertEquals("TTLS", getSupplicantEapMethod());
- assertEquals("\"autheap=GTC\"", getSupplicantPhase2Method());
- }
-
- /**
- * Verifies that parceling a WifiEnterpriseConfig preserves the key
- * and certificates information.
- */
- @Test
- public void parcelConfigWithKeyAndCerts() throws Exception {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- PrivateKey clientKey = FakeKeys.RSA_KEY1;
- X509Certificate clientCert = FakeKeys.CLIENT_CERT;
- X509Certificate[] caCerts = new X509Certificate[] {FakeKeys.CA_CERT0, FakeKeys.CA_CERT1};
- enterpriseConfig.setClientKeyEntry(clientKey, clientCert);
- enterpriseConfig.setCaCertificates(caCerts);
- Parcel parcel = Parcel.obtain();
- enterpriseConfig.writeToParcel(parcel, 0);
-
- parcel.setDataPosition(0); // Allow parcel to be read from the beginning.
- mEnterpriseConfig = WifiEnterpriseConfig.CREATOR.createFromParcel(parcel);
- PrivateKey actualClientKey = mEnterpriseConfig.getClientPrivateKey();
- X509Certificate actualClientCert = mEnterpriseConfig.getClientCertificate();
- X509Certificate[] actualCaCerts = mEnterpriseConfig.getCaCertificates();
-
- /* Verify client private key. */
- assertNotNull(actualClientKey);
- assertEquals(clientKey.getAlgorithm(), actualClientKey.getAlgorithm());
- assertArrayEquals(clientKey.getEncoded(), actualClientKey.getEncoded());
-
- /* Verify client certificate. */
- assertNotNull(actualClientCert);
- assertArrayEquals(clientCert.getEncoded(), actualClientCert.getEncoded());
-
- /* Verify CA certificates. */
- assertNotNull(actualCaCerts);
- assertEquals(caCerts.length, actualCaCerts.length);
- for (int i = 0; i < caCerts.length; i++) {
- assertNotNull(actualCaCerts[i]);
- assertArrayEquals(caCerts[i].getEncoded(), actualCaCerts[i].getEncoded());
- }
- }
-
- /** Verifies proper operation of the getKeyId() method. */
- @Test
- public void getKeyId() {
- assertEquals("NULL", mEnterpriseConfig.getKeyId(null));
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(Eap.TTLS);
- enterpriseConfig.setPhase2Method(Phase2.GTC);
- assertEquals("TTLS_GTC", mEnterpriseConfig.getKeyId(enterpriseConfig));
- mEnterpriseConfig.setEapMethod(Eap.PEAP);
- mEnterpriseConfig.setPhase2Method(Phase2.MSCHAPV2);
- assertEquals("PEAP_MSCHAPV2", mEnterpriseConfig.getKeyId(enterpriseConfig));
- }
-
- /** Verifies that passwords are not displayed in toString. */
- @Test
- public void passwordNotInToString() {
- String password = "supersecret";
- mEnterpriseConfig.setPassword(password);
- assertFalse(mEnterpriseConfig.toString().contains(password));
- }
-
- /** Verifies that certificate ownership flag is set correctly */
- @Test
- public void testIsAppInstalledDeviceKeyAndCert() {
- // First make sure that app didn't install anything
- assertFalse(mEnterpriseConfig.isAppInstalledDeviceKeyAndCert());
- assertFalse(mEnterpriseConfig.isAppInstalledCaCert());
-
- // Then app loads keys via the enterprise config API
- PrivateKey clientKey = FakeKeys.RSA_KEY1;
- X509Certificate cert0 = FakeKeys.CLIENT_CERT;
- X509Certificate cert1 = FakeKeys.CA_CERT1;
- X509Certificate[] clientChain = new X509Certificate[] {cert0, cert1};
- mEnterpriseConfig.setClientKeyEntryWithCertificateChain(clientKey, clientChain);
- X509Certificate[] result = mEnterpriseConfig.getClientCertificateChain();
- assertEquals(result.length, 2);
- assertTrue(result[0] == cert0 && result[1] == cert1);
- assertTrue(mEnterpriseConfig.getClientCertificate() == cert0);
-
- // Make sure it is the owner now
- assertTrue(mEnterpriseConfig.isAppInstalledDeviceKeyAndCert());
- assertFalse(mEnterpriseConfig.isAppInstalledCaCert());
- }
-
- /** Verifies that certificate ownership flag is set correctly */
- @Test
- public void testIsAppInstalledCaCert() {
- // First make sure that app didn't install anything
- assertFalse(mEnterpriseConfig.isAppInstalledDeviceKeyAndCert());
- assertFalse(mEnterpriseConfig.isAppInstalledCaCert());
-
- // Then app loads CA cert via the enterprise config API
- X509Certificate cert = FakeKeys.CA_CERT1;
- mEnterpriseConfig.setCaCertificate(cert);
- X509Certificate result = mEnterpriseConfig.getCaCertificate();
- assertTrue(result == cert);
-
- // Make sure it is the owner now
- assertFalse(mEnterpriseConfig.isAppInstalledDeviceKeyAndCert());
- assertTrue(mEnterpriseConfig.isAppInstalledCaCert());
- }
-
- /** Verifies that certificate ownership flag is set correctly */
- @Test
- public void testIsAppInstalledCaCerts() {
- // First make sure that app didn't install anything
- assertFalse(mEnterpriseConfig.isAppInstalledDeviceKeyAndCert());
- assertFalse(mEnterpriseConfig.isAppInstalledCaCert());
-
- // Then app loads CA cert via the enterprise config API
- X509Certificate cert0 = FakeKeys.CA_CERT0;
- X509Certificate cert1 = FakeKeys.CA_CERT1;
- X509Certificate[] cert = new X509Certificate[] {cert0, cert1};
-
- mEnterpriseConfig.setCaCertificates(cert);
- X509Certificate[] result = mEnterpriseConfig.getCaCertificates();
- assertEquals(result.length, 2);
- assertTrue(result[0] == cert0 && result[1] == cert1);
-// assertTrue(mEnterpriseConfig.getClientCertificate() == cert0);
-
- // Make sure it is the owner now
- assertFalse(mEnterpriseConfig.isAppInstalledDeviceKeyAndCert());
- assertTrue(mEnterpriseConfig.isAppInstalledCaCert());
- }
-
- /** Verifies that OCSP value is set correctly. */
- @Test
- public void testOcspSetGet() throws Exception {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
-
- enterpriseConfig.setOcsp(WifiEnterpriseConfig.OCSP_NONE);
- assertEquals(WifiEnterpriseConfig.OCSP_NONE, enterpriseConfig.getOcsp());
-
- enterpriseConfig.setOcsp(WifiEnterpriseConfig.OCSP_REQUIRE_CERT_STATUS);
- assertEquals(WifiEnterpriseConfig.OCSP_REQUIRE_CERT_STATUS, enterpriseConfig.getOcsp());
-
- enterpriseConfig.setOcsp(WifiEnterpriseConfig.OCSP_REQUEST_CERT_STATUS);
- assertEquals(WifiEnterpriseConfig.OCSP_REQUEST_CERT_STATUS, enterpriseConfig.getOcsp());
-
- enterpriseConfig.setOcsp(WifiEnterpriseConfig.OCSP_REQUIRE_ALL_NON_TRUSTED_CERTS_STATUS);
- assertEquals(WifiEnterpriseConfig.OCSP_REQUIRE_ALL_NON_TRUSTED_CERTS_STATUS,
- enterpriseConfig.getOcsp());
- }
-
- /** Verifies that an exception is thrown when invalid OCSP is set. */
- @Test
- public void testInvalidOcspValue() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- try {
- enterpriseConfig.setOcsp(-1);
- fail("Should raise an IllegalArgumentException here.");
- } catch (IllegalArgumentException e) {
- // expected exception.
- }
- }
-
- /** Verifies that the EAP inner method is reset when we switch to Unauth-TLS */
- @Test
- public void eapPhase2MethodForUnauthTls() {
- // Initially select an EAP method that supports an phase2.
- mEnterpriseConfig.setEapMethod(Eap.PEAP);
- mEnterpriseConfig.setPhase2Method(Phase2.MSCHAPV2);
- assertEquals("PEAP", getSupplicantEapMethod());
- assertEquals("\"auth=MSCHAPV2\"", getSupplicantPhase2Method());
-
- // Change the EAP method to another type which supports a phase2.
- mEnterpriseConfig.setEapMethod(Eap.TTLS);
- assertEquals("TTLS", getSupplicantEapMethod());
- assertEquals("\"auth=MSCHAPV2\"", getSupplicantPhase2Method());
-
- // Change the EAP method to Unauth-TLS which does not support a phase2.
- mEnterpriseConfig.setEapMethod(Eap.UNAUTH_TLS);
- assertEquals(null, getSupplicantPhase2Method());
- }
-
- @Test
- public void testIsEnterpriseConfigSecure() {
- WifiEnterpriseConfig baseConfig = new WifiEnterpriseConfig();
- baseConfig.setEapMethod(Eap.PEAP);
- baseConfig.setPhase2Method(Phase2.MSCHAPV2);
- assertTrue(baseConfig.isInsecure());
-
- WifiEnterpriseConfig noMatchConfig = new WifiEnterpriseConfig(baseConfig);
- noMatchConfig.setCaCertificate(FakeKeys.CA_CERT0);
- // Missing match is insecure.
- assertTrue(noMatchConfig.isInsecure());
-
- WifiEnterpriseConfig noCaConfig = new WifiEnterpriseConfig(baseConfig);
- noCaConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
- // Missing CA certificate is insecure.
- assertTrue(noCaConfig.isInsecure());
-
- WifiEnterpriseConfig secureConfig = new WifiEnterpriseConfig();
- secureConfig.setEapMethod(Eap.PEAP);
- secureConfig.setPhase2Method(Phase2.MSCHAPV2);
- secureConfig.setCaCertificate(FakeKeys.CA_CERT0);
- secureConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
- assertFalse(secureConfig.isInsecure());
-
- WifiEnterpriseConfig secureConfigWithCaAlias = new WifiEnterpriseConfig();
- secureConfigWithCaAlias.setEapMethod(Eap.PEAP);
- secureConfigWithCaAlias.setPhase2Method(Phase2.MSCHAPV2);
- secureConfigWithCaAlias.setCaCertificateAliases(new String[]{"alias1", "alisa2"});
- secureConfigWithCaAlias.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
- assertFalse(secureConfigWithCaAlias.isInsecure());
- }
-
-}
diff --git a/wifi/tests/src/android/net/wifi/WifiInfoTest.java b/wifi/tests/src/android/net/wifi/WifiInfoTest.java
deleted file mode 100644
index 33438ed..0000000
--- a/wifi/tests/src/android/net/wifi/WifiInfoTest.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * 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.net.wifi;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
-
-import android.os.Parcel;
-import android.telephony.SubscriptionManager;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-import java.nio.charset.StandardCharsets;
-
-/**
- * Unit tests for {@link android.net.wifi.WifiInfo}.
- */
-@SmallTest
-public class WifiInfoTest {
- private static final long TEST_TX_SUCCESS = 1;
- private static final long TEST_TX_RETRIES = 2;
- private static final long TEST_TX_BAD = 3;
- private static final long TEST_RX_SUCCESS = 4;
- private static final String TEST_PACKAGE_NAME = "com.test.example";
- private static final String TEST_FQDN = "test.com";
- private static final String TEST_PROVIDER_NAME = "test";
- private static final int TEST_WIFI_STANDARD = ScanResult.WIFI_STANDARD_11AC;
- private static final int TEST_MAX_SUPPORTED_TX_LINK_SPEED_MBPS = 866;
- private static final int TEST_MAX_SUPPORTED_RX_LINK_SPEED_MBPS = 1200;
- private static final String TEST_SSID = "Test123";
- private static final String TEST_BSSID = "12:12:12:12:12:12";
- private static final int TEST_RSSI = -60;
- private static final int TEST_NETWORK_ID = 5;
- private static final int TEST_NETWORK_ID2 = 6;
- private static final int TEST_SUB_ID = 1;
-
- /**
- * Verify parcel write/read with WifiInfo.
- */
- @Test
- public void testWifiInfoParcelWriteRead() throws Exception {
- WifiInfo writeWifiInfo = new WifiInfo();
- writeWifiInfo.txSuccess = TEST_TX_SUCCESS;
- writeWifiInfo.txRetries = TEST_TX_RETRIES;
- writeWifiInfo.txBad = TEST_TX_BAD;
- writeWifiInfo.rxSuccess = TEST_RX_SUCCESS;
- writeWifiInfo.setTrusted(true);
- writeWifiInfo.setOemPaid(true);
- writeWifiInfo.setOemPrivate(true);
- writeWifiInfo.setCarrierMerged(true);
- writeWifiInfo.setOsuAp(true);
- writeWifiInfo.setFQDN(TEST_FQDN);
- writeWifiInfo.setProviderFriendlyName(TEST_PROVIDER_NAME);
- writeWifiInfo.setRequestingPackageName(TEST_PACKAGE_NAME);
- writeWifiInfo.setWifiStandard(TEST_WIFI_STANDARD);
- writeWifiInfo.setMaxSupportedTxLinkSpeedMbps(TEST_MAX_SUPPORTED_TX_LINK_SPEED_MBPS);
- writeWifiInfo.setMaxSupportedRxLinkSpeedMbps(TEST_MAX_SUPPORTED_RX_LINK_SPEED_MBPS);
- writeWifiInfo.setSubscriptionId(TEST_SUB_ID);
-
- Parcel parcel = Parcel.obtain();
- writeWifiInfo.writeToParcel(parcel, 0);
- // Rewind the pointer to the head of the parcel.
- parcel.setDataPosition(0);
- WifiInfo readWifiInfo = WifiInfo.CREATOR.createFromParcel(parcel);
-
- assertNotNull(readWifiInfo);
- assertEquals(TEST_TX_SUCCESS, readWifiInfo.txSuccess);
- assertEquals(TEST_TX_RETRIES, readWifiInfo.txRetries);
- assertEquals(TEST_TX_BAD, readWifiInfo.txBad);
- assertEquals(TEST_RX_SUCCESS, readWifiInfo.rxSuccess);
- assertTrue(readWifiInfo.isTrusted());
- assertTrue(readWifiInfo.isOemPaid());
- assertTrue(readWifiInfo.isOemPrivate());
- assertTrue(readWifiInfo.isCarrierMerged());
- assertTrue(readWifiInfo.isOsuAp());
- assertTrue(readWifiInfo.isPasspointAp());
- assertEquals(TEST_PACKAGE_NAME, readWifiInfo.getRequestingPackageName());
- assertEquals(TEST_FQDN, readWifiInfo.getPasspointFqdn());
- assertEquals(TEST_PROVIDER_NAME, readWifiInfo.getPasspointProviderFriendlyName());
- assertEquals(TEST_WIFI_STANDARD, readWifiInfo.getWifiStandard());
- assertEquals(TEST_MAX_SUPPORTED_TX_LINK_SPEED_MBPS,
- readWifiInfo.getMaxSupportedTxLinkSpeedMbps());
- assertEquals(TEST_MAX_SUPPORTED_RX_LINK_SPEED_MBPS,
- readWifiInfo.getMaxSupportedRxLinkSpeedMbps());
- assertEquals(TEST_SUB_ID, readWifiInfo.getSubscriptionId());
- }
-
- @Test
- public void testWifiInfoCopyConstructor() throws Exception {
- WifiInfo writeWifiInfo = new WifiInfo();
- writeWifiInfo.txSuccess = TEST_TX_SUCCESS;
- writeWifiInfo.txRetries = TEST_TX_RETRIES;
- writeWifiInfo.txBad = TEST_TX_BAD;
- writeWifiInfo.rxSuccess = TEST_RX_SUCCESS;
- writeWifiInfo.setTrusted(true);
- writeWifiInfo.setOemPaid(true);
- writeWifiInfo.setOemPrivate(true);
- writeWifiInfo.setCarrierMerged(true);
- writeWifiInfo.setOsuAp(true);
- writeWifiInfo.setFQDN(TEST_FQDN);
- writeWifiInfo.setProviderFriendlyName(TEST_PROVIDER_NAME);
- writeWifiInfo.setRequestingPackageName(TEST_PACKAGE_NAME);
- writeWifiInfo.setWifiStandard(TEST_WIFI_STANDARD);
- writeWifiInfo.setMaxSupportedTxLinkSpeedMbps(TEST_MAX_SUPPORTED_TX_LINK_SPEED_MBPS);
- writeWifiInfo.setMaxSupportedRxLinkSpeedMbps(TEST_MAX_SUPPORTED_RX_LINK_SPEED_MBPS);
- writeWifiInfo.setSubscriptionId(TEST_SUB_ID);
-
- WifiInfo readWifiInfo = new WifiInfo(writeWifiInfo);
-
- assertEquals(TEST_TX_SUCCESS, readWifiInfo.txSuccess);
- assertEquals(TEST_TX_RETRIES, readWifiInfo.txRetries);
- assertEquals(TEST_TX_BAD, readWifiInfo.txBad);
- assertEquals(TEST_RX_SUCCESS, readWifiInfo.rxSuccess);
- assertTrue(readWifiInfo.isTrusted());
- assertTrue(readWifiInfo.isOemPaid());
- assertTrue(readWifiInfo.isOemPrivate());
- assertTrue(readWifiInfo.isCarrierMerged());
- assertTrue(readWifiInfo.isOsuAp());
- assertTrue(readWifiInfo.isPasspointAp());
- assertEquals(TEST_PACKAGE_NAME, readWifiInfo.getRequestingPackageName());
- assertEquals(TEST_FQDN, readWifiInfo.getPasspointFqdn());
- assertEquals(TEST_PROVIDER_NAME, readWifiInfo.getPasspointProviderFriendlyName());
- assertEquals(TEST_WIFI_STANDARD, readWifiInfo.getWifiStandard());
- assertEquals(TEST_MAX_SUPPORTED_TX_LINK_SPEED_MBPS,
- readWifiInfo.getMaxSupportedTxLinkSpeedMbps());
- assertEquals(TEST_MAX_SUPPORTED_RX_LINK_SPEED_MBPS,
- readWifiInfo.getMaxSupportedRxLinkSpeedMbps());
- assertEquals(TEST_SUB_ID, readWifiInfo.getSubscriptionId());
- }
-
- /**
- * Verify values after reset()
- */
- @Test
- public void testWifiInfoResetValue() throws Exception {
- WifiInfo wifiInfo = new WifiInfo();
- wifiInfo.reset();
- assertEquals(WifiInfo.LINK_SPEED_UNKNOWN, wifiInfo.getMaxSupportedTxLinkSpeedMbps());
- assertEquals(WifiInfo.LINK_SPEED_UNKNOWN, wifiInfo.getMaxSupportedRxLinkSpeedMbps());
- assertEquals(WifiInfo.LINK_SPEED_UNKNOWN, wifiInfo.getTxLinkSpeedMbps());
- assertEquals(WifiInfo.LINK_SPEED_UNKNOWN, wifiInfo.getRxLinkSpeedMbps());
- assertEquals(WifiInfo.INVALID_RSSI, wifiInfo.getRssi());
- assertEquals(WifiManager.UNKNOWN_SSID, wifiInfo.getSSID());
- assertEquals(null, wifiInfo.getBSSID());
- assertEquals(-1, wifiInfo.getNetworkId());
- assertFalse(wifiInfo.isOemPaid());
- assertFalse(wifiInfo.isOemPrivate());
- assertFalse(wifiInfo.isCarrierMerged());
- assertEquals(SubscriptionManager.INVALID_SUBSCRIPTION_ID, wifiInfo.getSubscriptionId());
- }
-
- /**
- * Test that the WifiInfo Builder returns the same values that was set, and that
- * calling build multiple times returns different instances.
- */
- @Test
- public void testWifiInfoBuilder() throws Exception {
- WifiInfo.Builder builder = new WifiInfo.Builder()
- .setSsid(TEST_SSID.getBytes(StandardCharsets.UTF_8))
- .setBssid(TEST_BSSID)
- .setRssi(TEST_RSSI)
- .setNetworkId(TEST_NETWORK_ID);
-
- WifiInfo info1 = builder.build();
-
- assertEquals("\"" + TEST_SSID + "\"", info1.getSSID());
- assertEquals(TEST_BSSID, info1.getBSSID());
- assertEquals(TEST_RSSI, info1.getRssi());
- assertEquals(TEST_NETWORK_ID, info1.getNetworkId());
-
- WifiInfo info2 = builder
- .setNetworkId(TEST_NETWORK_ID2)
- .build();
-
- // different instances
- assertNotSame(info1, info2);
-
- // assert that info1 didn't change
- assertEquals("\"" + TEST_SSID + "\"", info1.getSSID());
- assertEquals(TEST_BSSID, info1.getBSSID());
- assertEquals(TEST_RSSI, info1.getRssi());
- assertEquals(TEST_NETWORK_ID, info1.getNetworkId());
-
- // assert that info2 changed
- assertEquals("\"" + TEST_SSID + "\"", info2.getSSID());
- assertEquals(TEST_BSSID, info2.getBSSID());
- assertEquals(TEST_RSSI, info2.getRssi());
- assertEquals(TEST_NETWORK_ID2, info2.getNetworkId());
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/WifiManagerTest.java b/wifi/tests/src/android/net/wifi/WifiManagerTest.java
deleted file mode 100644
index b15fa2c..0000000
--- a/wifi/tests/src/android/net/wifi/WifiManagerTest.java
+++ /dev/null
@@ -1,2723 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi;
-
-import static android.net.wifi.WifiConfiguration.METERED_OVERRIDE_METERED;
-import static android.net.wifi.WifiManager.ActionListener;
-import static android.net.wifi.WifiManager.BUSY;
-import static android.net.wifi.WifiManager.COEX_RESTRICTION_SOFTAP;
-import static android.net.wifi.WifiManager.COEX_RESTRICTION_WIFI_AWARE;
-import static android.net.wifi.WifiManager.COEX_RESTRICTION_WIFI_DIRECT;
-import static android.net.wifi.WifiManager.ERROR;
-import static android.net.wifi.WifiManager.LocalOnlyHotspotCallback.ERROR_GENERIC;
-import static android.net.wifi.WifiManager.LocalOnlyHotspotCallback.ERROR_INCOMPATIBLE_MODE;
-import static android.net.wifi.WifiManager.LocalOnlyHotspotCallback.ERROR_NO_CHANNEL;
-import static android.net.wifi.WifiManager.LocalOnlyHotspotCallback.ERROR_TETHERING_DISALLOWED;
-import static android.net.wifi.WifiManager.LocalOnlyHotspotCallback.REQUEST_REGISTERED;
-import static android.net.wifi.WifiManager.NOT_AUTHORIZED;
-import static android.net.wifi.WifiManager.OnWifiActivityEnergyInfoListener;
-import static android.net.wifi.WifiManager.SAP_START_FAILURE_GENERAL;
-import static android.net.wifi.WifiManager.STATUS_NETWORK_SUGGESTIONS_SUCCESS;
-import static android.net.wifi.WifiManager.STATUS_SUGGESTION_CONNECTION_FAILURE_AUTHENTICATION;
-import static android.net.wifi.WifiManager.WIFI_AP_STATE_ENABLED;
-import static android.net.wifi.WifiManager.WIFI_AP_STATE_ENABLING;
-import static android.net.wifi.WifiManager.WIFI_AP_STATE_FAILED;
-import static android.net.wifi.WifiManager.WIFI_FEATURE_ADDITIONAL_STA;
-import static android.net.wifi.WifiManager.WIFI_FEATURE_AP_STA;
-import static android.net.wifi.WifiManager.WIFI_FEATURE_DPP;
-import static android.net.wifi.WifiManager.WIFI_FEATURE_OWE;
-import static android.net.wifi.WifiManager.WIFI_FEATURE_P2P;
-import static android.net.wifi.WifiManager.WIFI_FEATURE_PASSPOINT;
-import static android.net.wifi.WifiManager.WIFI_FEATURE_SCANNER;
-import static android.net.wifi.WifiManager.WIFI_FEATURE_WPA3_SAE;
-import static android.net.wifi.WifiManager.WIFI_FEATURE_WPA3_SUITE_B;
-import static android.net.wifi.WifiManager.WpsCallback;
-import static android.net.wifi.WifiScanner.WIFI_BAND_24_GHZ;
-
-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.junit.Assert.fail;
-import static org.junit.Assume.assumeTrue;
-import static org.mockito.ArgumentMatchers.anyBoolean;
-import static org.mockito.ArgumentMatchers.nullable;
-import static org.mockito.Mockito.any;
-import static org.mockito.Mockito.anyInt;
-import static org.mockito.Mockito.anyList;
-import static org.mockito.Mockito.anyString;
-import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.eq;
-import static org.mockito.Mockito.inOrder;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
-
-import android.app.ActivityManager;
-import android.content.Context;
-import android.content.pm.ApplicationInfo;
-import android.net.DhcpInfo;
-import android.net.MacAddress;
-import android.net.wifi.WifiManager.CoexCallback;
-import android.net.wifi.WifiManager.LocalOnlyHotspotCallback;
-import android.net.wifi.WifiManager.LocalOnlyHotspotObserver;
-import android.net.wifi.WifiManager.LocalOnlyHotspotReservation;
-import android.net.wifi.WifiManager.LocalOnlyHotspotSubscription;
-import android.net.wifi.WifiManager.NetworkRequestMatchCallback;
-import android.net.wifi.WifiManager.NetworkRequestUserSelectionCallback;
-import android.net.wifi.WifiManager.OnWifiUsabilityStatsListener;
-import android.net.wifi.WifiManager.ScanResultsCallback;
-import android.net.wifi.WifiManager.SoftApCallback;
-import android.net.wifi.WifiManager.SuggestionConnectionStatusListener;
-import android.net.wifi.WifiManager.SuggestionUserApprovalStatusListener;
-import android.net.wifi.WifiManager.TrafficStateCallback;
-import android.net.wifi.WifiManager.WifiConnectedNetworkScorer;
-import android.os.Build;
-import android.os.Handler;
-import android.os.HandlerExecutor;
-import android.os.IBinder;
-import android.os.RemoteException;
-import android.os.connectivity.WifiActivityEnergyInfo;
-import android.os.test.TestLooper;
-import android.util.SparseArray;
-
-import androidx.test.filters.SmallTest;
-
-import com.android.modules.utils.build.SdkLevel;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.ArgumentCaptor;
-import org.mockito.InOrder;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.concurrent.Executor;
-
-/**
- * Unit tests for {@link android.net.wifi.WifiManager}.
- */
-@SmallTest
-public class WifiManagerTest {
-
- private static final int ERROR_NOT_SET = -1;
- private static final int ERROR_TEST_REASON = 5;
- private static final int TEST_UID = 14553;
- private static final int TEST_NETWORK_ID = 143;
- private static final String TEST_PACKAGE_NAME = "TestPackage";
- private static final String TEST_FEATURE_ID = "TestFeature";
- private static final String TEST_COUNTRY_CODE = "US";
- private static final String[] TEST_MAC_ADDRESSES = {"da:a1:19:0:0:0"};
- 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;
- @Mock ApplicationInfo mApplicationInfo;
- @Mock WifiConfiguration mApConfig;
- @Mock SoftApCallback mSoftApCallback;
- @Mock TrafficStateCallback mTrafficStateCallback;
- @Mock NetworkRequestMatchCallback mNetworkRequestMatchCallback;
- @Mock OnWifiUsabilityStatsListener mOnWifiUsabilityStatsListener;
- @Mock OnWifiActivityEnergyInfoListener mOnWifiActivityEnergyInfoListener;
- @Mock SuggestionConnectionStatusListener mSuggestionConnectionListener;
- @Mock Runnable mRunnable;
- @Mock Executor mExecutor;
- @Mock Executor mAnotherExecutor;
- @Mock ActivityManager mActivityManager;
- @Mock WifiConnectedNetworkScorer mWifiConnectedNetworkScorer;
- @Mock SuggestionUserApprovalStatusListener mSuggestionUserApprovalStatusListener;
-
- private Handler mHandler;
- private TestLooper mLooper;
- private WifiManager mWifiManager;
- private WifiNetworkSuggestion mWifiNetworkSuggestion;
- private ScanResultsCallback mScanResultsCallback;
- private CoexCallback mCoexCallback;
- private WifiActivityEnergyInfo mWifiActivityEnergyInfo;
-
- /**
- * Util function to check public field which used for softap in WifiConfiguration
- * same as the value in SoftApConfiguration.
- *
- */
- private boolean compareWifiAndSoftApConfiguration(
- SoftApConfiguration softApConfig, WifiConfiguration wifiConfig) {
- if (!Objects.equals(wifiConfig.SSID, softApConfig.getSsid())) {
- return false;
- }
- if (!Objects.equals(wifiConfig.BSSID, softApConfig.getBssid())) {
- return false;
- }
- if (!Objects.equals(wifiConfig.preSharedKey, softApConfig.getPassphrase())) {
- return false;
- }
-
- if (wifiConfig.hiddenSSID != softApConfig.isHiddenSsid()) {
- return false;
- }
- switch (softApConfig.getSecurityType()) {
- case SoftApConfiguration.SECURITY_TYPE_OPEN:
- if (wifiConfig.getAuthType() != WifiConfiguration.KeyMgmt.NONE) {
- return false;
- }
- break;
- case SoftApConfiguration.SECURITY_TYPE_WPA2_PSK:
- if (wifiConfig.getAuthType() != WifiConfiguration.KeyMgmt.WPA2_PSK) {
- return false;
- }
- break;
- default:
- return false;
- }
- return true;
- }
-
- private SoftApConfiguration generatorTestSoftApConfig() {
- return new SoftApConfiguration.Builder()
- .setSsid("TestSSID")
- .setPassphrase("TestPassphrase", SoftApConfiguration.SECURITY_TYPE_WPA2_PSK)
- .build();
- }
-
- @Before
- public void setUp() throws Exception {
- MockitoAnnotations.initMocks(this);
- mLooper = new TestLooper();
- mHandler = spy(new Handler(mLooper.getLooper()));
- mApplicationInfo.targetSdkVersion = Build.VERSION_CODES.Q;
- when(mContext.getApplicationInfo()).thenReturn(mApplicationInfo);
- when(mContext.getOpPackageName()).thenReturn(TEST_PACKAGE_NAME);
- mWifiManager = new WifiManager(mContext, mWifiService, mLooper.getLooper());
- verify(mWifiService).getVerboseLoggingLevel();
- mWifiNetworkSuggestion = new WifiNetworkSuggestion();
- mScanResultsCallback = new ScanResultsCallback() {
- @Override
- public void onScanResultsAvailable() {
- mRunnable.run();
- }
- };
- mCoexCallback = new CoexCallback() {
- @Override
- public void onCoexUnsafeChannelsChanged() {
- mRunnable.run();
- }
- };
- mWifiActivityEnergyInfo = new WifiActivityEnergyInfo(0, 0, 0, 0, 0, 0);
- }
-
- /**
- * Check the call to setCoexUnsafeChannels calls WifiServiceImpl to setCoexUnsafeChannels with
- * the provided CoexUnsafeChannels and restrictions bitmask.
- */
- @Test
- public void testSetCoexUnsafeChannelsGoesToWifiServiceImpl() throws Exception {
- Set<CoexUnsafeChannel> unsafeChannels = new HashSet<>();
- int restrictions = COEX_RESTRICTION_WIFI_DIRECT | COEX_RESTRICTION_SOFTAP
- | COEX_RESTRICTION_WIFI_AWARE;
-
- mWifiManager.setCoexUnsafeChannels(unsafeChannels, restrictions);
-
- verify(mWifiService).setCoexUnsafeChannels(new ArrayList<>(unsafeChannels), restrictions);
- }
-
- /**
- * Verify an IllegalArgumentException if passed a null value for unsafeChannels.
- */
- @Test
- public void testSetCoexUnsafeChannelsThrowsIllegalArgumentExceptionOnNullUnsafeChannels() {
- try {
- mWifiManager.setCoexUnsafeChannels(null, 0);
- fail("expected IllegalArgumentException");
- } catch (IllegalArgumentException expected) {
- }
- }
-
- /**
- * Check the call to getCoexUnsafeChannels calls WifiServiceImpl to return the values from
- * getCoexUnsafeChannels.
- */
- @Test
- public void testGetCoexUnsafeChannelsGoesToWifiServiceImpl() throws Exception {
- Set<CoexUnsafeChannel> unsafeChannels = new HashSet<>();
- unsafeChannels.add(new CoexUnsafeChannel(WIFI_BAND_24_GHZ, 6));
- when(mWifiService.getCoexUnsafeChannels()).thenReturn(new ArrayList<>(unsafeChannels));
-
- assertEquals(mWifiManager.getCoexUnsafeChannels(), unsafeChannels);
- }
-
- /**
- * Verify call to getCoexRestrictions calls WifiServiceImpl to return the value from
- * getCoexRestrictions.
- */
- @Test
- public void testGetCoexRestrictionsGoesToWifiServiceImpl() throws Exception {
- int restrictions = COEX_RESTRICTION_WIFI_DIRECT | COEX_RESTRICTION_SOFTAP
- | COEX_RESTRICTION_WIFI_AWARE;
- when(mWifiService.getCoexRestrictions()).thenReturn(restrictions);
-
- assertEquals(mWifiService.getCoexRestrictions(), restrictions);
- }
-
-
- /**
- * Verify an IllegalArgumentException is thrown if callback is not provided.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testRegisterCoexCallbackWithNullCallback() throws Exception {
- mWifiManager.registerCoexCallback(mExecutor, null);
- }
-
- /**
- * Verify an IllegalArgumentException is thrown if executor is not provided.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testRegisterCoexCallbackWithNullExecutor() throws Exception {
- mWifiManager.registerCoexCallback(null, mCoexCallback);
- }
-
- /**
- * Verify client provided callback is being called to the right callback.
- */
- @Test
- public void testAddCoexCallbackAndReceiveEvent() throws Exception {
- ArgumentCaptor<ICoexCallback.Stub> callbackCaptor =
- ArgumentCaptor.forClass(ICoexCallback.Stub.class);
- mWifiManager.registerCoexCallback(new SynchronousExecutor(), mCoexCallback);
- verify(mWifiService).registerCoexCallback(callbackCaptor.capture());
- callbackCaptor.getValue().onCoexUnsafeChannelsChanged();
- verify(mRunnable).run();
- }
-
- /**
- * Verify client provided callback is being called to the right executor.
- */
- @Test
- public void testRegisterCoexCallbackWithTheTargetExecutor() throws Exception {
- ArgumentCaptor<ICoexCallback.Stub> callbackCaptor =
- ArgumentCaptor.forClass(ICoexCallback.Stub.class);
- mWifiManager.registerCoexCallback(mExecutor, mCoexCallback);
- verify(mWifiService).registerCoexCallback(callbackCaptor.capture());
- mWifiManager.registerCoexCallback(mAnotherExecutor, mCoexCallback);
- callbackCaptor.getValue().onCoexUnsafeChannelsChanged();
- verify(mExecutor, never()).execute(any(Runnable.class));
- verify(mAnotherExecutor).execute(any(Runnable.class));
- }
-
- /**
- * Verify client register unregister then register again, to ensure callback still works.
- */
- @Test
- public void testRegisterUnregisterThenRegisterAgainWithCoexCallback() throws Exception {
- ArgumentCaptor<ICoexCallback.Stub> callbackCaptor =
- ArgumentCaptor.forClass(ICoexCallback.Stub.class);
- mWifiManager.registerCoexCallback(new SynchronousExecutor(), mCoexCallback);
- verify(mWifiService).registerCoexCallback(callbackCaptor.capture());
- mWifiManager.unregisterCoexCallback(mCoexCallback);
- callbackCaptor.getValue().onCoexUnsafeChannelsChanged();
- verify(mRunnable, never()).run();
- mWifiManager.registerCoexCallback(new SynchronousExecutor(), mCoexCallback);
- callbackCaptor.getValue().onCoexUnsafeChannelsChanged();
- verify(mRunnable).run();
- }
-
- /**
- * Verify client unregisterCoexCallback.
- */
- @Test
- public void testUnregisterCoexCallback() throws Exception {
- mWifiManager.unregisterCoexCallback(mCoexCallback);
- verify(mWifiService).unregisterCoexCallback(any());
- }
-
- /**
- * Verify client unregisterCoexCallback with null callback will cause an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testUnregisterCoexCallbackWithNullCallback() throws Exception {
- mWifiManager.unregisterCoexCallback(null);
- }
-
-
- /**
- * Check the call to startSoftAp calls WifiService to startSoftAp with the provided
- * WifiConfiguration. Verify that the return value is propagated to the caller.
- */
- @Test
- public void testStartSoftApCallsServiceWithWifiConfig() throws Exception {
- when(mWifiService.startSoftAp(mApConfig, TEST_PACKAGE_NAME)).thenReturn(true);
- assertTrue(mWifiManager.startSoftAp(mApConfig));
-
- when(mWifiService.startSoftAp(mApConfig, TEST_PACKAGE_NAME)).thenReturn(false);
- assertFalse(mWifiManager.startSoftAp(mApConfig));
- }
-
- /**
- * Check the call to startSoftAp calls WifiService to startSoftAp with a null config. Verify
- * that the return value is propagated to the caller.
- */
- @Test
- public void testStartSoftApCallsServiceWithNullConfig() throws Exception {
- when(mWifiService.startSoftAp(null, TEST_PACKAGE_NAME)).thenReturn(true);
- assertTrue(mWifiManager.startSoftAp(null));
-
- when(mWifiService.startSoftAp(null, TEST_PACKAGE_NAME)).thenReturn(false);
- assertFalse(mWifiManager.startSoftAp(null));
- }
-
- /**
- * Check the call to stopSoftAp calls WifiService to stopSoftAp.
- */
- @Test
- public void testStopSoftApCallsService() throws Exception {
- when(mWifiService.stopSoftAp()).thenReturn(true);
- assertTrue(mWifiManager.stopSoftAp());
-
- when(mWifiService.stopSoftAp()).thenReturn(false);
- assertFalse(mWifiManager.stopSoftAp());
- }
-
- /**
- * Check the call to startSoftAp calls WifiService to startSoftAp with the provided
- * WifiConfiguration. Verify that the return value is propagated to the caller.
- */
- @Test
- public void testStartTetheredHotspotCallsServiceWithSoftApConfig() throws Exception {
- SoftApConfiguration softApConfig = generatorTestSoftApConfig();
- when(mWifiService.startTetheredHotspot(softApConfig, TEST_PACKAGE_NAME))
- .thenReturn(true);
- assertTrue(mWifiManager.startTetheredHotspot(softApConfig));
-
- when(mWifiService.startTetheredHotspot(softApConfig, TEST_PACKAGE_NAME))
- .thenReturn(false);
- assertFalse(mWifiManager.startTetheredHotspot(softApConfig));
- }
-
- /**
- * Check the call to startSoftAp calls WifiService to startSoftAp with a null config. Verify
- * that the return value is propagated to the caller.
- */
- @Test
- public void testStartTetheredHotspotCallsServiceWithNullConfig() throws Exception {
- when(mWifiService.startTetheredHotspot(null, TEST_PACKAGE_NAME)).thenReturn(true);
- assertTrue(mWifiManager.startTetheredHotspot(null));
-
- when(mWifiService.startTetheredHotspot(null, TEST_PACKAGE_NAME)).thenReturn(false);
- assertFalse(mWifiManager.startTetheredHotspot(null));
- }
-
- /**
- * Test creation of a LocalOnlyHotspotReservation and verify that close properly calls
- * WifiService.stopLocalOnlyHotspot.
- */
- @Test
- public void testCreationAndCloseOfLocalOnlyHotspotReservation() throws Exception {
- SoftApConfiguration softApConfig = generatorTestSoftApConfig();
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- when(mWifiService.startLocalOnlyHotspot(any(ILocalOnlyHotspotCallback.class), anyString(),
- nullable(String.class), eq(null))).thenReturn(REQUEST_REGISTERED);
- mWifiManager.startLocalOnlyHotspot(callback, mHandler);
-
- callback.onStarted(mWifiManager.new LocalOnlyHotspotReservation(softApConfig));
-
- assertEquals(softApConfig, callback.mRes.getSoftApConfiguration());
- WifiConfiguration wifiConfig = callback.mRes.getWifiConfiguration();
- assertTrue(compareWifiAndSoftApConfiguration(softApConfig, wifiConfig));
-
- callback.mRes.close();
- verify(mWifiService).stopLocalOnlyHotspot();
- }
-
- /**
- * Verify stopLOHS is called when try-with-resources is used properly.
- */
- @Test
- public void testLocalOnlyHotspotReservationCallsStopProperlyInTryWithResources()
- throws Exception {
- SoftApConfiguration softApConfig = generatorTestSoftApConfig();
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- when(mWifiService.startLocalOnlyHotspot(any(ILocalOnlyHotspotCallback.class), anyString(),
- nullable(String.class), eq(null))).thenReturn(REQUEST_REGISTERED);
- mWifiManager.startLocalOnlyHotspot(callback, mHandler);
-
- callback.onStarted(mWifiManager.new LocalOnlyHotspotReservation(softApConfig));
-
- try (WifiManager.LocalOnlyHotspotReservation res = callback.mRes) {
- assertEquals(softApConfig, res.getSoftApConfiguration());
- WifiConfiguration wifiConfig = callback.mRes.getWifiConfiguration();
- assertTrue(compareWifiAndSoftApConfiguration(softApConfig, wifiConfig));
- }
-
- verify(mWifiService).stopLocalOnlyHotspot();
- }
-
- /**
- * Test creation of a LocalOnlyHotspotSubscription.
- * TODO: when registrations are tracked, verify removal on close.
- */
- @Test
- public void testCreationOfLocalOnlyHotspotSubscription() throws Exception {
- try (WifiManager.LocalOnlyHotspotSubscription sub =
- mWifiManager.new LocalOnlyHotspotSubscription()) {
- sub.close();
- }
- }
-
- public class TestLocalOnlyHotspotCallback extends LocalOnlyHotspotCallback {
- public boolean mOnStartedCalled = false;
- public boolean mOnStoppedCalled = false;
- public int mFailureReason = -1;
- public LocalOnlyHotspotReservation mRes = null;
- public long mCallingThreadId = -1;
-
- @Override
- public void onStarted(LocalOnlyHotspotReservation r) {
- mRes = r;
- mOnStartedCalled = true;
- mCallingThreadId = Thread.currentThread().getId();
- }
-
- @Override
- public void onStopped() {
- mOnStoppedCalled = true;
- mCallingThreadId = Thread.currentThread().getId();
- }
-
- @Override
- public void onFailed(int reason) {
- mFailureReason = reason;
- mCallingThreadId = Thread.currentThread().getId();
- }
- }
-
- /**
- * Verify callback is properly plumbed when called.
- */
- @Test
- public void testLocalOnlyHotspotCallback() {
- SoftApConfiguration softApConfig = generatorTestSoftApConfig();
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- assertFalse(callback.mOnStartedCalled);
- assertFalse(callback.mOnStoppedCalled);
- assertEquals(ERROR_NOT_SET, callback.mFailureReason);
- assertEquals(null, callback.mRes);
-
- // test onStarted
- WifiManager.LocalOnlyHotspotReservation res =
- mWifiManager.new LocalOnlyHotspotReservation(softApConfig);
- callback.onStarted(res);
- assertEquals(res, callback.mRes);
- assertTrue(callback.mOnStartedCalled);
- assertFalse(callback.mOnStoppedCalled);
- assertEquals(ERROR_NOT_SET, callback.mFailureReason);
-
- // test onStopped
- callback.onStopped();
- assertEquals(res, callback.mRes);
- assertTrue(callback.mOnStartedCalled);
- assertTrue(callback.mOnStoppedCalled);
- assertEquals(ERROR_NOT_SET, callback.mFailureReason);
-
- // test onFailed
- callback.onFailed(ERROR_TEST_REASON);
- assertEquals(res, callback.mRes);
- assertTrue(callback.mOnStartedCalled);
- assertTrue(callback.mOnStoppedCalled);
- assertEquals(ERROR_TEST_REASON, callback.mFailureReason);
- }
-
- public class TestLocalOnlyHotspotObserver extends LocalOnlyHotspotObserver {
- public boolean mOnRegistered = false;
- public boolean mOnStartedCalled = false;
- public boolean mOnStoppedCalled = false;
- public SoftApConfiguration mConfig = null;
- public LocalOnlyHotspotSubscription mSub = null;
- public long mCallingThreadId = -1;
-
- @Override
- public void onRegistered(LocalOnlyHotspotSubscription sub) {
- mOnRegistered = true;
- mSub = sub;
- mCallingThreadId = Thread.currentThread().getId();
- }
-
- @Override
- public void onStarted(SoftApConfiguration config) {
- mOnStartedCalled = true;
- mConfig = config;
- mCallingThreadId = Thread.currentThread().getId();
- }
-
- @Override
- public void onStopped() {
- mOnStoppedCalled = true;
- mCallingThreadId = Thread.currentThread().getId();
- }
- }
-
- /**
- * Verify observer is properly plumbed when called.
- */
- @Test
- public void testLocalOnlyHotspotObserver() {
- TestLocalOnlyHotspotObserver observer = new TestLocalOnlyHotspotObserver();
- SoftApConfiguration softApConfig = generatorTestSoftApConfig();
- assertFalse(observer.mOnRegistered);
- assertFalse(observer.mOnStartedCalled);
- assertFalse(observer.mOnStoppedCalled);
- assertEquals(null, observer.mConfig);
- assertEquals(null, observer.mSub);
-
- WifiManager.LocalOnlyHotspotSubscription sub =
- mWifiManager.new LocalOnlyHotspotSubscription();
- observer.onRegistered(sub);
- assertTrue(observer.mOnRegistered);
- assertFalse(observer.mOnStartedCalled);
- assertFalse(observer.mOnStoppedCalled);
- assertEquals(null, observer.mConfig);
- assertEquals(sub, observer.mSub);
-
- observer.onStarted(softApConfig);
- assertTrue(observer.mOnRegistered);
- assertTrue(observer.mOnStartedCalled);
- assertFalse(observer.mOnStoppedCalled);
- assertEquals(softApConfig, observer.mConfig);
- assertEquals(sub, observer.mSub);
-
- observer.onStopped();
- assertTrue(observer.mOnRegistered);
- assertTrue(observer.mOnStartedCalled);
- assertTrue(observer.mOnStoppedCalled);
- assertEquals(softApConfig, observer.mConfig);
- assertEquals(sub, observer.mSub);
- }
-
- /**
- * Verify call to startLocalOnlyHotspot goes to WifiServiceImpl.
- */
- @Test
- public void testStartLocalOnlyHotspot() throws Exception {
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- mWifiManager.startLocalOnlyHotspot(callback, mHandler);
-
- verify(mWifiService).startLocalOnlyHotspot(any(ILocalOnlyHotspotCallback.class),
- anyString(), nullable(String.class), eq(null));
- }
-
- /**
- * Verify a SecurityException is thrown for callers without proper permissions for
- * startLocalOnlyHotspot.
- */
- @Test(expected = SecurityException.class)
- public void testStartLocalOnlyHotspotThrowsSecurityException() throws Exception {
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- doThrow(new SecurityException()).when(mWifiService).startLocalOnlyHotspot(
- any(ILocalOnlyHotspotCallback.class), anyString(), nullable(String.class),
- eq(null));
- mWifiManager.startLocalOnlyHotspot(callback, mHandler);
- }
-
- /**
- * Verify an IllegalStateException is thrown for callers that already have a pending request for
- * startLocalOnlyHotspot.
- */
- @Test(expected = IllegalStateException.class)
- public void testStartLocalOnlyHotspotThrowsIllegalStateException() throws Exception {
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- doThrow(new IllegalStateException()).when(mWifiService).startLocalOnlyHotspot(
- any(ILocalOnlyHotspotCallback.class), anyString(), nullable(String.class),
- eq(null));
- mWifiManager.startLocalOnlyHotspot(callback, mHandler);
- }
-
- /**
- * Verify that the handler provided by the caller is used for the callbacks.
- */
- @Test
- public void testCorrectLooperIsUsedForHandler() throws Exception {
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- when(mWifiService.startLocalOnlyHotspot(any(ILocalOnlyHotspotCallback.class), anyString(),
- nullable(String.class), eq(null))).thenReturn(ERROR_INCOMPATIBLE_MODE);
- mWifiManager.startLocalOnlyHotspot(callback, mHandler);
- mLooper.dispatchAll();
- assertEquals(ERROR_INCOMPATIBLE_MODE, callback.mFailureReason);
- verify(mContext, never()).getMainLooper();
- verify(mContext, never()).getMainExecutor();
- }
-
- /**
- * Verify that the main looper's thread is used if a handler is not provided by the reqiestomg
- * application.
- */
- @Test
- public void testMainLooperIsUsedWhenHandlerNotProvided() throws Exception {
- // record thread from looper.getThread and check ids.
- TestLooper altLooper = new TestLooper();
- when(mContext.getMainExecutor()).thenReturn(altLooper.getNewExecutor());
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- when(mWifiService.startLocalOnlyHotspot(any(ILocalOnlyHotspotCallback.class), anyString(),
- nullable(String.class), eq(null))).thenReturn(ERROR_INCOMPATIBLE_MODE);
- mWifiManager.startLocalOnlyHotspot(callback, null);
- altLooper.dispatchAll();
- assertEquals(ERROR_INCOMPATIBLE_MODE, callback.mFailureReason);
- assertEquals(altLooper.getLooper().getThread().getId(), callback.mCallingThreadId);
- verify(mContext).getMainExecutor();
- }
-
- /**
- * Verify the LOHS onStarted callback is triggered when WifiManager receives a HOTSPOT_STARTED
- * message from WifiServiceImpl.
- */
- @Test
- public void testOnStartedIsCalledWithReservation() throws Exception {
- SoftApConfiguration softApConfig = generatorTestSoftApConfig();
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- TestLooper callbackLooper = new TestLooper();
- Handler callbackHandler = new Handler(callbackLooper.getLooper());
- ArgumentCaptor<ILocalOnlyHotspotCallback> internalCallback =
- ArgumentCaptor.forClass(ILocalOnlyHotspotCallback.class);
- when(mWifiService.startLocalOnlyHotspot(internalCallback.capture(), anyString(),
- nullable(String.class), eq(null))).thenReturn(REQUEST_REGISTERED);
- mWifiManager.startLocalOnlyHotspot(callback, callbackHandler);
- callbackLooper.dispatchAll();
- mLooper.dispatchAll();
- assertFalse(callback.mOnStartedCalled);
- assertEquals(null, callback.mRes);
- // now trigger the callback
- internalCallback.getValue().onHotspotStarted(softApConfig);
- mLooper.dispatchAll();
- callbackLooper.dispatchAll();
- assertTrue(callback.mOnStartedCalled);
- assertEquals(softApConfig, callback.mRes.getSoftApConfiguration());
- WifiConfiguration wifiConfig = callback.mRes.getWifiConfiguration();
- assertTrue(compareWifiAndSoftApConfiguration(softApConfig, wifiConfig));
- }
-
- /**
- * Verify the LOHS onStarted callback is triggered when WifiManager receives a HOTSPOT_STARTED
- * message from WifiServiceImpl when softap enabled with SAE security type.
- */
- @Test
- public void testOnStartedIsCalledWithReservationAndSaeSoftApConfig() throws Exception {
- SoftApConfiguration softApConfig = new SoftApConfiguration.Builder()
- .setSsid("TestSSID")
- .setPassphrase("TestPassphrase", SoftApConfiguration.SECURITY_TYPE_WPA3_SAE)
- .build();
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- TestLooper callbackLooper = new TestLooper();
- Handler callbackHandler = new Handler(callbackLooper.getLooper());
- ArgumentCaptor<ILocalOnlyHotspotCallback> internalCallback =
- ArgumentCaptor.forClass(ILocalOnlyHotspotCallback.class);
- when(mWifiService.startLocalOnlyHotspot(internalCallback.capture(), anyString(),
- nullable(String.class), eq(null))).thenReturn(REQUEST_REGISTERED);
- mWifiManager.startLocalOnlyHotspot(callback, callbackHandler);
- callbackLooper.dispatchAll();
- mLooper.dispatchAll();
- assertFalse(callback.mOnStartedCalled);
- assertEquals(null, callback.mRes);
- // now trigger the callback
- internalCallback.getValue().onHotspotStarted(softApConfig);
- mLooper.dispatchAll();
- callbackLooper.dispatchAll();
- assertTrue(callback.mOnStartedCalled);
- assertEquals(softApConfig, callback.mRes.getSoftApConfiguration());
- assertEquals(null, callback.mRes.getWifiConfiguration());
- }
-
- /**
- * Verify onFailed is called if WifiServiceImpl sends a HOTSPOT_STARTED message with a null
- * config.
- */
- @Test
- public void testOnStartedIsCalledWithNullConfig() throws Exception {
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- TestLooper callbackLooper = new TestLooper();
- Handler callbackHandler = new Handler(callbackLooper.getLooper());
- ArgumentCaptor<ILocalOnlyHotspotCallback> internalCallback =
- ArgumentCaptor.forClass(ILocalOnlyHotspotCallback.class);
- when(mWifiService.startLocalOnlyHotspot(internalCallback.capture(), anyString(),
- nullable(String.class), eq(null))).thenReturn(REQUEST_REGISTERED);
- mWifiManager.startLocalOnlyHotspot(callback, callbackHandler);
- callbackLooper.dispatchAll();
- mLooper.dispatchAll();
- assertFalse(callback.mOnStartedCalled);
- assertEquals(null, callback.mRes);
- // now trigger the callback
- internalCallback.getValue().onHotspotStarted(null);
- mLooper.dispatchAll();
- callbackLooper.dispatchAll();
- assertFalse(callback.mOnStartedCalled);
- assertEquals(ERROR_GENERIC, callback.mFailureReason);
- }
-
- /**
- * Verify onStopped is called if WifiServiceImpl sends a HOTSPOT_STOPPED message.
- */
- @Test
- public void testOnStoppedIsCalled() throws Exception {
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- TestLooper callbackLooper = new TestLooper();
- Handler callbackHandler = new Handler(callbackLooper.getLooper());
- ArgumentCaptor<ILocalOnlyHotspotCallback> internalCallback =
- ArgumentCaptor.forClass(ILocalOnlyHotspotCallback.class);
- when(mWifiService.startLocalOnlyHotspot(internalCallback.capture(), anyString(),
- nullable(String.class), eq(null))).thenReturn(REQUEST_REGISTERED);
- mWifiManager.startLocalOnlyHotspot(callback, callbackHandler);
- callbackLooper.dispatchAll();
- mLooper.dispatchAll();
- assertFalse(callback.mOnStoppedCalled);
- // now trigger the callback
- internalCallback.getValue().onHotspotStopped();
- mLooper.dispatchAll();
- callbackLooper.dispatchAll();
- assertTrue(callback.mOnStoppedCalled);
- }
-
- /**
- * Verify onFailed is called if WifiServiceImpl sends a HOTSPOT_FAILED message.
- */
- @Test
- public void testOnFailedIsCalled() throws Exception {
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- TestLooper callbackLooper = new TestLooper();
- Handler callbackHandler = new Handler(callbackLooper.getLooper());
- ArgumentCaptor<ILocalOnlyHotspotCallback> internalCallback =
- ArgumentCaptor.forClass(ILocalOnlyHotspotCallback.class);
- when(mWifiService.startLocalOnlyHotspot(internalCallback.capture(), anyString(),
- nullable(String.class), eq(null))).thenReturn(REQUEST_REGISTERED);
- mWifiManager.startLocalOnlyHotspot(callback, callbackHandler);
- callbackLooper.dispatchAll();
- mLooper.dispatchAll();
- assertEquals(ERROR_NOT_SET, callback.mFailureReason);
- // now trigger the callback
- internalCallback.getValue().onHotspotFailed(ERROR_NO_CHANNEL);
- mLooper.dispatchAll();
- callbackLooper.dispatchAll();
- assertEquals(ERROR_NO_CHANNEL, callback.mFailureReason);
- }
-
- /**
- * Verify callback triggered from startLocalOnlyHotspot with an incompatible mode failure.
- */
- @Test
- public void testLocalOnlyHotspotCallbackFullOnIncompatibleMode() throws Exception {
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- when(mWifiService.startLocalOnlyHotspot(any(ILocalOnlyHotspotCallback.class), anyString(),
- nullable(String.class), eq(null))).thenReturn(ERROR_INCOMPATIBLE_MODE);
- mWifiManager.startLocalOnlyHotspot(callback, mHandler);
- mLooper.dispatchAll();
- assertEquals(ERROR_INCOMPATIBLE_MODE, callback.mFailureReason);
- assertFalse(callback.mOnStartedCalled);
- assertFalse(callback.mOnStoppedCalled);
- assertEquals(null, callback.mRes);
- }
-
- /**
- * Verify callback triggered from startLocalOnlyHotspot with a tethering disallowed failure.
- */
- @Test
- public void testLocalOnlyHotspotCallbackFullOnTetheringDisallowed() throws Exception {
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- when(mWifiService.startLocalOnlyHotspot(any(ILocalOnlyHotspotCallback.class), anyString(),
- nullable(String.class), eq(null))).thenReturn(ERROR_TETHERING_DISALLOWED);
- mWifiManager.startLocalOnlyHotspot(callback, mHandler);
- mLooper.dispatchAll();
- assertEquals(ERROR_TETHERING_DISALLOWED, callback.mFailureReason);
- assertFalse(callback.mOnStartedCalled);
- assertFalse(callback.mOnStoppedCalled);
- assertEquals(null, callback.mRes);
- }
-
- /**
- * Verify a SecurityException resulting from an application without necessary permissions will
- * bubble up through the call to start LocalOnlyHotspot and will not trigger other callbacks.
- */
- @Test(expected = SecurityException.class)
- public void testLocalOnlyHotspotCallbackFullOnSecurityException() throws Exception {
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- doThrow(new SecurityException()).when(mWifiService).startLocalOnlyHotspot(
- any(ILocalOnlyHotspotCallback.class), anyString(), nullable(String.class),
- eq(null));
- try {
- mWifiManager.startLocalOnlyHotspot(callback, mHandler);
- } catch (SecurityException e) {
- assertEquals(ERROR_NOT_SET, callback.mFailureReason);
- assertFalse(callback.mOnStartedCalled);
- assertFalse(callback.mOnStoppedCalled);
- assertEquals(null, callback.mRes);
- throw e;
- }
-
- }
-
- /**
- * Verify the handler passed to startLocalOnlyHotspot is correctly used for callbacks when
- * SoftApMode fails due to a underlying error.
- */
- @Test
- public void testLocalOnlyHotspotCallbackFullOnNoChannelError() throws Exception {
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- when(mWifiService.startLocalOnlyHotspot(any(ILocalOnlyHotspotCallback.class), anyString(),
- nullable(String.class), eq(null))).thenReturn(REQUEST_REGISTERED);
- mWifiManager.startLocalOnlyHotspot(callback, mHandler);
- mLooper.dispatchAll();
- //assertEquals(ERROR_NO_CHANNEL, callback.mFailureReason);
- assertFalse(callback.mOnStartedCalled);
- assertFalse(callback.mOnStoppedCalled);
- assertEquals(null, callback.mRes);
- }
-
- /**
- * Verify that the call to cancel a LOHS request does call stopLOHS.
- */
- @Test
- public void testCancelLocalOnlyHotspotRequestCallsStopOnWifiService() throws Exception {
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- when(mWifiService.startLocalOnlyHotspot(any(ILocalOnlyHotspotCallback.class), anyString(),
- nullable(String.class), eq(null))).thenReturn(REQUEST_REGISTERED);
- mWifiManager.startLocalOnlyHotspot(callback, mHandler);
- mWifiManager.cancelLocalOnlyHotspotRequest();
- verify(mWifiService).stopLocalOnlyHotspot();
- }
-
- /**
- * Verify that we do not crash if cancelLocalOnlyHotspotRequest is called without an existing
- * callback stored.
- */
- @Test
- public void testCancelLocalOnlyHotspotReturnsWithoutExistingRequest() {
- mWifiManager.cancelLocalOnlyHotspotRequest();
- }
-
- /**
- * Verify that the callback is not triggered if the LOHS request was already cancelled.
- */
- @Test
- public void testCallbackAfterLocalOnlyHotspotWasCancelled() throws Exception {
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- when(mWifiService.startLocalOnlyHotspot(any(ILocalOnlyHotspotCallback.class), anyString(),
- nullable(String.class), eq(null))).thenReturn(REQUEST_REGISTERED);
- mWifiManager.startLocalOnlyHotspot(callback, mHandler);
- mWifiManager.cancelLocalOnlyHotspotRequest();
- verify(mWifiService).stopLocalOnlyHotspot();
- mLooper.dispatchAll();
- assertEquals(ERROR_NOT_SET, callback.mFailureReason);
- assertFalse(callback.mOnStartedCalled);
- assertFalse(callback.mOnStoppedCalled);
- assertEquals(null, callback.mRes);
- }
-
- /**
- * Verify that calling cancel LOHS request does not crash if an error callback was already
- * handled.
- */
- @Test
- public void testCancelAfterLocalOnlyHotspotCallbackTriggered() throws Exception {
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- when(mWifiService.startLocalOnlyHotspot(any(ILocalOnlyHotspotCallback.class), anyString(),
- nullable(String.class), eq(null))).thenReturn(ERROR_INCOMPATIBLE_MODE);
- mWifiManager.startLocalOnlyHotspot(callback, mHandler);
- mLooper.dispatchAll();
- assertEquals(ERROR_INCOMPATIBLE_MODE, callback.mFailureReason);
- assertFalse(callback.mOnStartedCalled);
- assertFalse(callback.mOnStoppedCalled);
- assertEquals(null, callback.mRes);
- mWifiManager.cancelLocalOnlyHotspotRequest();
- verify(mWifiService, never()).stopLocalOnlyHotspot();
- }
-
- @Test
- public void testStartLocalOnlyHotspotForwardsCustomConfig() throws Exception {
- SoftApConfiguration customConfig = new SoftApConfiguration.Builder()
- .setSsid("customSsid")
- .build();
- TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
- mWifiManager.startLocalOnlyHotspot(customConfig, mExecutor, callback);
- verify(mWifiService).startLocalOnlyHotspot(any(ILocalOnlyHotspotCallback.class),
- anyString(), nullable(String.class), eq(customConfig));
- }
-
- /**
- * Verify the watchLocalOnlyHotspot call goes to WifiServiceImpl.
- */
- @Test
- public void testWatchLocalOnlyHotspot() throws Exception {
- TestLocalOnlyHotspotObserver observer = new TestLocalOnlyHotspotObserver();
-
- mWifiManager.watchLocalOnlyHotspot(observer, mHandler);
- verify(mWifiService).startWatchLocalOnlyHotspot(any(ILocalOnlyHotspotCallback.class));
- }
-
- /**
- * Verify a SecurityException is thrown for callers without proper permissions for
- * startWatchLocalOnlyHotspot.
- */
- @Test(expected = SecurityException.class)
- public void testStartWatchLocalOnlyHotspotThrowsSecurityException() throws Exception {
- TestLocalOnlyHotspotObserver observer = new TestLocalOnlyHotspotObserver();
- doThrow(new SecurityException()).when(mWifiService)
- .startWatchLocalOnlyHotspot(any(ILocalOnlyHotspotCallback.class));
- mWifiManager.watchLocalOnlyHotspot(observer, mHandler);
- }
-
- /**
- * Verify an IllegalStateException is thrown for callers that already have a pending request for
- * watchLocalOnlyHotspot.
- */
- @Test(expected = IllegalStateException.class)
- public void testStartWatchLocalOnlyHotspotThrowsIllegalStateException() throws Exception {
- TestLocalOnlyHotspotObserver observer = new TestLocalOnlyHotspotObserver();
- doThrow(new IllegalStateException()).when(mWifiService)
- .startWatchLocalOnlyHotspot(any(ILocalOnlyHotspotCallback.class));
- mWifiManager.watchLocalOnlyHotspot(observer, mHandler);
- }
-
- /**
- * Verify an IllegalArgumentException is thrown if callback is not provided.
- */
- @Test
- public void registerSoftApCallbackThrowsIllegalArgumentExceptionOnNullArgumentForCallback() {
- try {
- mWifiManager.registerSoftApCallback(new HandlerExecutor(mHandler), null);
- fail("expected IllegalArgumentException");
- } catch (IllegalArgumentException expected) {
- }
- }
-
- /**
- * Verify an IllegalArgumentException is thrown if executor is null.
- */
- @Test
- public void registerSoftApCallbackThrowsIllegalArgumentExceptionOnNullArgumentForExecutor() {
- try {
- mWifiManager.registerSoftApCallback(null, mSoftApCallback);
- fail("expected IllegalArgumentException");
- } catch (IllegalArgumentException expected) {
- }
- }
-
- /**
- * Verify an IllegalArgumentException is thrown if callback is not provided.
- */
- @Test
- public void unregisterSoftApCallbackThrowsIllegalArgumentExceptionOnNullArgumentForCallback() {
- try {
- mWifiManager.unregisterSoftApCallback(null);
- fail("expected IllegalArgumentException");
- } catch (IllegalArgumentException expected) {
- }
- }
-
- /**
- * Verify the call to registerSoftApCallback goes to WifiServiceImpl.
- */
- @Test
- public void registerSoftApCallbackCallGoesToWifiServiceImpl() throws Exception {
- mWifiManager.registerSoftApCallback(new HandlerExecutor(mHandler), mSoftApCallback);
- verify(mWifiService).registerSoftApCallback(any(IBinder.class),
- any(ISoftApCallback.Stub.class), anyInt());
- }
-
- /**
- * Verify the call to unregisterSoftApCallback goes to WifiServiceImpl.
- */
- @Test
- public void unregisterSoftApCallbackCallGoesToWifiServiceImpl() throws Exception {
- ArgumentCaptor<Integer> callbackIdentifier = ArgumentCaptor.forClass(Integer.class);
- mWifiManager.registerSoftApCallback(new HandlerExecutor(mHandler), mSoftApCallback);
- verify(mWifiService).registerSoftApCallback(any(IBinder.class),
- any(ISoftApCallback.Stub.class), callbackIdentifier.capture());
-
- mWifiManager.unregisterSoftApCallback(mSoftApCallback);
- verify(mWifiService).unregisterSoftApCallback(eq((int) callbackIdentifier.getValue()));
- }
-
- /*
- * Verify client-provided callback is being called through callback proxy
- */
- @Test
- public void softApCallbackProxyCallsOnStateChanged() throws Exception {
- 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().onStateChanged(WIFI_AP_STATE_ENABLED, 0);
- mLooper.dispatchAll();
- verify(mSoftApCallback).onStateChanged(WIFI_AP_STATE_ENABLED, 0);
- }
-
- /*
- * Verify client-provided callback is being called through callback proxy
- */
- @Test
- public void softApCallbackProxyCallsOnConnectedClientsChanged() throws Exception {
- ArgumentCaptor<ISoftApCallback.Stub> callbackCaptor =
- ArgumentCaptor.forClass(ISoftApCallback.Stub.class);
- mWifiManager.registerSoftApCallback(new HandlerExecutor(mHandler), mSoftApCallback);
- verify(mWifiService).registerSoftApCallback(any(IBinder.class), callbackCaptor.capture(),
- anyInt());
-
- final List<WifiClient> testClients = new ArrayList();
- callbackCaptor.getValue().onConnectedClientsChanged(testClients);
- mLooper.dispatchAll();
- verify(mSoftApCallback).onConnectedClientsChanged(testClients);
- }
-
-
- /*
- * Verify client-provided callback is being called through callback proxy
- */
- @Test
- public void softApCallbackProxyCallsOnSoftApInfoChanged() throws Exception {
- SoftApInfo testSoftApInfo = new SoftApInfo();
- testSoftApInfo.setFrequency(TEST_AP_FREQUENCY);
- testSoftApInfo.setBandwidth(TEST_AP_BANDWIDTH);
- 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().onInfoChanged(testSoftApInfo);
- mLooper.dispatchAll();
- 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
- */
- @Test
- public void softApCallbackProxyCallsOnCapabilityChanged() throws Exception {
- SoftApCapability testSoftApCapability = new SoftApCapability(0);
- testSoftApCapability.setMaxSupportedClients(10);
- 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().onCapabilityChanged(testSoftApCapability);
- mLooper.dispatchAll();
- verify(mSoftApCallback).onCapabilityChanged(testSoftApCapability);
- }
-
- /*
- * Verify client-provided callback is being called through callback proxy
- */
- @Test
- public void softApCallbackProxyCallsOnBlockedClientConnecting() throws Exception {
- 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);
- verify(mWifiService).registerSoftApCallback(any(IBinder.class), callbackCaptor.capture(),
- anyInt());
-
- callbackCaptor.getValue().onBlockedClientConnecting(testWifiClient,
- WifiManager.SAP_CLIENT_BLOCK_REASON_CODE_NO_MORE_STAS);
- mLooper.dispatchAll();
- verify(mSoftApCallback).onBlockedClientConnecting(testWifiClient,
- WifiManager.SAP_CLIENT_BLOCK_REASON_CODE_NO_MORE_STAS);
- }
-
- /*
- * Verify client-provided callback is being called through callback proxy on multiple events
- */
- @Test
- public void softApCallbackProxyCallsOnMultipleUpdates() throws Exception {
- 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 =
- ArgumentCaptor.forClass(ISoftApCallback.Stub.class);
- mWifiManager.registerSoftApCallback(new HandlerExecutor(mHandler), mSoftApCallback);
- verify(mWifiService).registerSoftApCallback(any(IBinder.class), callbackCaptor.capture(),
- anyInt());
-
- final List<WifiClient> testClients = new ArrayList();
- 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);
-
-
- mLooper.dispatchAll();
- 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);
- }
-
- /*
- * Verify client-provided callback is being called on the correct thread
- */
- @Test
- public void softApCallbackIsCalledOnCorrectThread() throws Exception {
- ArgumentCaptor<ISoftApCallback.Stub> callbackCaptor =
- ArgumentCaptor.forClass(ISoftApCallback.Stub.class);
- TestLooper altLooper = new TestLooper();
- Handler altHandler = new Handler(altLooper.getLooper());
- mWifiManager.registerSoftApCallback(new HandlerExecutor(altHandler), mSoftApCallback);
- verify(mWifiService).registerSoftApCallback(any(IBinder.class), callbackCaptor.capture(),
- anyInt());
-
- callbackCaptor.getValue().onStateChanged(WIFI_AP_STATE_ENABLED, 0);
- altLooper.dispatchAll();
- verify(mSoftApCallback).onStateChanged(WIFI_AP_STATE_ENABLED, 0);
- }
-
- /**
- * Verify that the handler provided by the caller is used for registering soft AP callback.
- */
- @Test
- public void testCorrectLooperIsUsedForSoftApCallbackHandler() throws Exception {
- mWifiManager.registerSoftApCallback(new HandlerExecutor(mHandler), mSoftApCallback);
- mLooper.dispatchAll();
- verify(mWifiService).registerSoftApCallback(any(IBinder.class),
- any(ISoftApCallback.Stub.class), anyInt());
- verify(mContext, never()).getMainLooper();
- verify(mContext, never()).getMainExecutor();
- }
-
- /**
- * Verify that the handler provided by the caller is used for the observer.
- */
- @Test
- public void testCorrectLooperIsUsedForObserverHandler() throws Exception {
- TestLocalOnlyHotspotObserver observer = new TestLocalOnlyHotspotObserver();
- mWifiManager.watchLocalOnlyHotspot(observer, mHandler);
- mLooper.dispatchAll();
- assertTrue(observer.mOnRegistered);
- verify(mContext, never()).getMainLooper();
- verify(mContext, never()).getMainExecutor();
- }
-
- /**
- * Verify that the main looper's thread is used if a handler is not provided by the requesting
- * application.
- */
- @Test
- public void testMainLooperIsUsedWhenHandlerNotProvidedForObserver() throws Exception {
- // record thread from looper.getThread and check ids.
- TestLooper altLooper = new TestLooper();
- when(mContext.getMainExecutor()).thenReturn(altLooper.getNewExecutor());
- TestLocalOnlyHotspotObserver observer = new TestLocalOnlyHotspotObserver();
- mWifiManager.watchLocalOnlyHotspot(observer, null);
- altLooper.dispatchAll();
- assertTrue(observer.mOnRegistered);
- assertEquals(altLooper.getLooper().getThread().getId(), observer.mCallingThreadId);
- verify(mContext).getMainExecutor();
- }
-
- /**
- * Verify the LOHS onRegistered observer callback is triggered when WifiManager receives a
- * HOTSPOT_OBSERVER_REGISTERED message from WifiServiceImpl.
- */
- @Test
- public void testOnRegisteredIsCalledWithSubscription() throws Exception {
- TestLocalOnlyHotspotObserver observer = new TestLocalOnlyHotspotObserver();
- TestLooper observerLooper = new TestLooper();
- Handler observerHandler = new Handler(observerLooper.getLooper());
- assertFalse(observer.mOnRegistered);
- assertEquals(null, observer.mSub);
- mWifiManager.watchLocalOnlyHotspot(observer, observerHandler);
- verify(mWifiService).startWatchLocalOnlyHotspot(any(ILocalOnlyHotspotCallback.class));
- // now trigger the callback
- observerLooper.dispatchAll();
- mLooper.dispatchAll();
- assertTrue(observer.mOnRegistered);
- assertNotNull(observer.mSub);
- }
-
- /**
- * Verify the LOHS onStarted observer callback is triggered when WifiManager receives a
- * HOTSPOT_STARTED message from WifiServiceImpl.
- */
- @Test
- public void testObserverOnStartedIsCalledWithWifiConfig() throws Exception {
- SoftApConfiguration softApConfig = generatorTestSoftApConfig();
- TestLocalOnlyHotspotObserver observer = new TestLocalOnlyHotspotObserver();
- TestLooper observerLooper = new TestLooper();
- Handler observerHandler = new Handler(observerLooper.getLooper());
- mWifiManager.watchLocalOnlyHotspot(observer, observerHandler);
- ArgumentCaptor<ILocalOnlyHotspotCallback> internalCallback =
- ArgumentCaptor.forClass(ILocalOnlyHotspotCallback.class);
- verify(mWifiService).startWatchLocalOnlyHotspot(internalCallback.capture());
- observerLooper.dispatchAll();
- mLooper.dispatchAll();
- assertFalse(observer.mOnStartedCalled);
- // now trigger the callback
- internalCallback.getValue().onHotspotStarted(softApConfig);
- mLooper.dispatchAll();
- observerLooper.dispatchAll();
- assertTrue(observer.mOnStartedCalled);
- assertEquals(softApConfig, observer.mConfig);
- }
-
- /**
- * Verify the LOHS onStarted observer callback is triggered not when WifiManager receives a
- * HOTSPOT_STARTED message from WifiServiceImpl with a null config.
- */
- @Test
- public void testObserverOnStartedNotCalledWithNullConfig() throws Exception {
- TestLocalOnlyHotspotObserver observer = new TestLocalOnlyHotspotObserver();
- TestLooper observerLooper = new TestLooper();
- Handler observerHandler = new Handler(observerLooper.getLooper());
- mWifiManager.watchLocalOnlyHotspot(observer, observerHandler);
- ArgumentCaptor<ILocalOnlyHotspotCallback> internalCallback =
- ArgumentCaptor.forClass(ILocalOnlyHotspotCallback.class);
- verify(mWifiService).startWatchLocalOnlyHotspot(internalCallback.capture());
- observerLooper.dispatchAll();
- mLooper.dispatchAll();
- assertFalse(observer.mOnStartedCalled);
- // now trigger the callback
- internalCallback.getValue().onHotspotStarted(null);
- mLooper.dispatchAll();
- observerLooper.dispatchAll();
- assertFalse(observer.mOnStartedCalled);
- assertEquals(null, observer.mConfig);
- }
-
-
- /**
- * Verify the LOHS onStopped observer callback is triggered when WifiManager receives a
- * HOTSPOT_STOPPED message from WifiServiceImpl.
- */
- @Test
- public void testObserverOnStoppedIsCalled() throws Exception {
- TestLocalOnlyHotspotObserver observer = new TestLocalOnlyHotspotObserver();
- TestLooper observerLooper = new TestLooper();
- Handler observerHandler = new Handler(observerLooper.getLooper());
- mWifiManager.watchLocalOnlyHotspot(observer, observerHandler);
- ArgumentCaptor<ILocalOnlyHotspotCallback> internalCallback =
- ArgumentCaptor.forClass(ILocalOnlyHotspotCallback.class);
- verify(mWifiService).startWatchLocalOnlyHotspot(internalCallback.capture());
- observerLooper.dispatchAll();
- mLooper.dispatchAll();
- assertFalse(observer.mOnStoppedCalled);
- // now trigger the callback
- internalCallback.getValue().onHotspotStopped();
- mLooper.dispatchAll();
- observerLooper.dispatchAll();
- assertTrue(observer.mOnStoppedCalled);
- }
-
- /**
- * Verify WifiServiceImpl is not called if there is not a registered LOHS observer callback.
- */
- @Test
- public void testUnregisterWifiServiceImplNotCalledWithoutRegisteredObserver() throws Exception {
- mWifiManager.unregisterLocalOnlyHotspotObserver();
- verifyZeroInteractions(mWifiService);
- }
-
- /**
- * Verify WifiServiceImpl is called when there is a registered LOHS observer callback.
- */
- @Test
- public void testUnregisterWifiServiceImplCalledWithRegisteredObserver() throws Exception {
- TestLocalOnlyHotspotObserver observer = new TestLocalOnlyHotspotObserver();
- TestLooper observerLooper = new TestLooper();
- Handler observerHandler = new Handler(observerLooper.getLooper());
- mWifiManager.watchLocalOnlyHotspot(observer, observerHandler);
- mWifiManager.unregisterLocalOnlyHotspotObserver();
- verify(mWifiService).stopWatchLocalOnlyHotspot();
- }
-
- /**
- * Test that calls to get the current WPS config token return null and do not have any
- * interactions with WifiServiceImpl.
- */
- @Test
- public void testGetCurrentNetworkWpsNfcConfigurationTokenReturnsNull() {
- assertNull(mWifiManager.getCurrentNetworkWpsNfcConfigurationToken());
- verifyNoMoreInteractions(mWifiService);
- }
-
-
- class WpsCallbackTester extends WpsCallback {
- public boolean mStarted = false;
- public boolean mSucceeded = false;
- public boolean mFailed = false;
- public int mFailureCode = -1;
-
- @Override
- public void onStarted(String pin) {
- mStarted = true;
- }
-
- @Override
- public void onSucceeded() {
- mSucceeded = true;
- }
-
- @Override
- public void onFailed(int reason) {
- mFailed = true;
- mFailureCode = reason;
- }
-
- }
-
- /**
- * Verify that a call to start WPS immediately returns a failure.
- */
- @Test
- public void testStartWpsImmediatelyFailsWithCallback() {
- WpsCallbackTester wpsCallback = new WpsCallbackTester();
- mWifiManager.startWps(null, wpsCallback);
- assertTrue(wpsCallback.mFailed);
- assertEquals(ERROR, wpsCallback.mFailureCode);
- assertFalse(wpsCallback.mStarted);
- assertFalse(wpsCallback.mSucceeded);
- verifyNoMoreInteractions(mWifiService);
- }
-
- /**
- * Verify that a call to start WPS does not go to WifiServiceImpl if we do not have a callback.
- */
- @Test
- public void testStartWpsDoesNotCallWifiServiceImpl() {
- mWifiManager.startWps(null, null);
- verifyNoMoreInteractions(mWifiService);
- }
-
- /**
- * Verify that a call to cancel WPS immediately returns a failure.
- */
- @Test
- public void testCancelWpsImmediatelyFailsWithCallback() {
- WpsCallbackTester wpsCallback = new WpsCallbackTester();
- mWifiManager.cancelWps(wpsCallback);
- assertTrue(wpsCallback.mFailed);
- assertEquals(ERROR, wpsCallback.mFailureCode);
- assertFalse(wpsCallback.mStarted);
- assertFalse(wpsCallback.mSucceeded);
- verifyNoMoreInteractions(mWifiService);
- }
-
- /**
- * Verify that a call to cancel WPS does not go to WifiServiceImpl if we do not have a callback.
- */
- @Test
- public void testCancelWpsDoesNotCallWifiServiceImpl() {
- mWifiManager.cancelWps(null);
- verifyNoMoreInteractions(mWifiService);
- }
-
- /**
- * Verify that a successful call properly returns true.
- */
- @Test
- public void testSetWifiApConfigurationSuccessReturnsTrue() throws Exception {
- WifiConfiguration apConfig = new WifiConfiguration();
-
- when(mWifiService.setWifiApConfiguration(eq(apConfig), eq(TEST_PACKAGE_NAME)))
- .thenReturn(true);
- assertTrue(mWifiManager.setWifiApConfiguration(apConfig));
- }
-
- /**
- * Verify that a failed call properly returns false.
- */
- @Test
- public void testSetWifiApConfigurationFailureReturnsFalse() throws Exception {
- WifiConfiguration apConfig = new WifiConfiguration();
-
- when(mWifiService.setWifiApConfiguration(eq(apConfig), eq(TEST_PACKAGE_NAME)))
- .thenReturn(false);
- assertFalse(mWifiManager.setWifiApConfiguration(apConfig));
- }
-
- /**
- * Verify Exceptions are rethrown when underlying calls to WifiService throw exceptions.
- */
- @Test
- public void testSetWifiApConfigurationRethrowsException() throws Exception {
- doThrow(new SecurityException()).when(mWifiService).setWifiApConfiguration(any(), any());
-
- try {
- mWifiManager.setWifiApConfiguration(new WifiConfiguration());
- fail("setWifiApConfiguration should rethrow Exceptions from WifiService");
- } catch (SecurityException e) { }
- }
-
- /**
- * Verify that a successful call properly returns true.
- */
- @Test
- public void testSetSoftApConfigurationSuccessReturnsTrue() throws Exception {
- SoftApConfiguration apConfig = generatorTestSoftApConfig();
-
- when(mWifiService.setSoftApConfiguration(eq(apConfig), eq(TEST_PACKAGE_NAME)))
- .thenReturn(true);
- assertTrue(mWifiManager.setSoftApConfiguration(apConfig));
- }
-
- /**
- * Verify that a failed call properly returns false.
- */
- @Test
- public void testSetSoftApConfigurationFailureReturnsFalse() throws Exception {
- SoftApConfiguration apConfig = generatorTestSoftApConfig();
-
- when(mWifiService.setSoftApConfiguration(eq(apConfig), eq(TEST_PACKAGE_NAME)))
- .thenReturn(false);
- assertFalse(mWifiManager.setSoftApConfiguration(apConfig));
- }
-
- /**
- * Verify Exceptions are rethrown when underlying calls to WifiService throw exceptions.
- */
- @Test
- public void testSetSoftApConfigurationRethrowsException() throws Exception {
- doThrow(new SecurityException()).when(mWifiService).setSoftApConfiguration(any(), any());
-
- try {
- mWifiManager.setSoftApConfiguration(generatorTestSoftApConfig());
- fail("setWifiApConfiguration should rethrow Exceptions from WifiService");
- } catch (SecurityException e) { }
- }
-
- /**
- * Check the call to startScan calls WifiService.
- */
- @Test
- public void testStartScan() throws Exception {
- when(mWifiService.startScan(eq(TEST_PACKAGE_NAME), nullable(String.class))).thenReturn(
- true);
- assertTrue(mWifiManager.startScan());
-
- when(mWifiService.startScan(eq(TEST_PACKAGE_NAME), nullable(String.class))).thenReturn(
- false);
- assertFalse(mWifiManager.startScan());
- }
-
- /**
- * Verify main looper is used when handler is not provided.
- */
- @Test
- public void registerTrafficStateCallbackUsesMainLooperOnNullArgumentForHandler()
- throws Exception {
- ArgumentCaptor<ITrafficStateCallback.Stub> callbackCaptor =
- ArgumentCaptor.forClass(ITrafficStateCallback.Stub.class);
- mWifiManager.registerTrafficStateCallback(
- new HandlerExecutor(new Handler(mLooper.getLooper())), mTrafficStateCallback);
- verify(mWifiService).registerTrafficStateCallback(
- any(IBinder.class), callbackCaptor.capture(), anyInt());
-
- assertEquals(0, mLooper.dispatchAll());
- callbackCaptor.getValue().onStateChanged(TrafficStateCallback.DATA_ACTIVITY_INOUT);
- assertEquals(1, mLooper.dispatchAll());
- verify(mTrafficStateCallback).onStateChanged(TrafficStateCallback.DATA_ACTIVITY_INOUT);
- }
-
- /**
- * Verify the call to unregisterTrafficStateCallback goes to WifiServiceImpl.
- */
- @Test
- public void unregisterTrafficStateCallbackCallGoesToWifiServiceImpl() throws Exception {
- ArgumentCaptor<Integer> callbackIdentifier = ArgumentCaptor.forClass(Integer.class);
- mWifiManager.registerTrafficStateCallback(new HandlerExecutor(mHandler),
- mTrafficStateCallback);
- verify(mWifiService).registerTrafficStateCallback(any(IBinder.class),
- any(ITrafficStateCallback.Stub.class), callbackIdentifier.capture());
-
- mWifiManager.unregisterTrafficStateCallback(mTrafficStateCallback);
- verify(mWifiService).unregisterTrafficStateCallback(
- eq((int) callbackIdentifier.getValue()));
- }
-
- /*
- * Verify client-provided callback is being called through callback proxy on multiple events
- */
- @Test
- public void trafficStateCallbackProxyCallsOnMultipleUpdates() throws Exception {
- ArgumentCaptor<ITrafficStateCallback.Stub> callbackCaptor =
- ArgumentCaptor.forClass(ITrafficStateCallback.Stub.class);
- mWifiManager.registerTrafficStateCallback(new HandlerExecutor(mHandler),
- mTrafficStateCallback);
- verify(mWifiService).registerTrafficStateCallback(
- any(IBinder.class), callbackCaptor.capture(), anyInt());
-
- InOrder inOrder = inOrder(mTrafficStateCallback);
-
- callbackCaptor.getValue().onStateChanged(TrafficStateCallback.DATA_ACTIVITY_IN);
- callbackCaptor.getValue().onStateChanged(TrafficStateCallback.DATA_ACTIVITY_INOUT);
- callbackCaptor.getValue().onStateChanged(TrafficStateCallback.DATA_ACTIVITY_OUT);
-
- mLooper.dispatchAll();
- inOrder.verify(mTrafficStateCallback).onStateChanged(
- TrafficStateCallback.DATA_ACTIVITY_IN);
- inOrder.verify(mTrafficStateCallback).onStateChanged(
- TrafficStateCallback.DATA_ACTIVITY_INOUT);
- inOrder.verify(mTrafficStateCallback).onStateChanged(
- TrafficStateCallback.DATA_ACTIVITY_OUT);
- }
-
- /**
- * Verify client-provided callback is being called on the correct thread
- */
- @Test
- public void trafficStateCallbackIsCalledOnCorrectThread() throws Exception {
- ArgumentCaptor<ITrafficStateCallback.Stub> callbackCaptor =
- ArgumentCaptor.forClass(ITrafficStateCallback.Stub.class);
- TestLooper altLooper = new TestLooper();
- Handler altHandler = new Handler(altLooper.getLooper());
- mWifiManager.registerTrafficStateCallback(new HandlerExecutor(altHandler),
- mTrafficStateCallback);
- verify(mContext, never()).getMainLooper();
- verify(mContext, never()).getMainExecutor();
- verify(mWifiService).registerTrafficStateCallback(
- any(IBinder.class), callbackCaptor.capture(), anyInt());
-
- assertEquals(0, altLooper.dispatchAll());
- callbackCaptor.getValue().onStateChanged(TrafficStateCallback.DATA_ACTIVITY_INOUT);
- assertEquals(1, altLooper.dispatchAll());
- verify(mTrafficStateCallback).onStateChanged(TrafficStateCallback.DATA_ACTIVITY_INOUT);
- }
-
- /**
- * Verify the call to registerNetworkRequestMatchCallback goes to WifiServiceImpl.
- */
- @Test
- public void registerNetworkRequestMatchCallbackCallGoesToWifiServiceImpl()
- throws Exception {
- ArgumentCaptor<INetworkRequestMatchCallback.Stub> callbackCaptor =
- ArgumentCaptor.forClass(INetworkRequestMatchCallback.Stub.class);
- mWifiManager.registerNetworkRequestMatchCallback(
- new HandlerExecutor(new Handler(mLooper.getLooper())),
- mNetworkRequestMatchCallback);
- verify(mWifiService).registerNetworkRequestMatchCallback(
- any(IBinder.class), callbackCaptor.capture(), anyInt());
-
- INetworkRequestUserSelectionCallback iUserSelectionCallback =
- mock(INetworkRequestUserSelectionCallback.class);
-
- assertEquals(0, mLooper.dispatchAll());
-
- callbackCaptor.getValue().onAbort();
- assertEquals(1, mLooper.dispatchAll());
- verify(mNetworkRequestMatchCallback).onAbort();
-
- callbackCaptor.getValue().onMatch(new ArrayList<ScanResult>());
- assertEquals(1, mLooper.dispatchAll());
- verify(mNetworkRequestMatchCallback).onMatch(anyList());
-
- callbackCaptor.getValue().onUserSelectionConnectSuccess(new WifiConfiguration());
- assertEquals(1, mLooper.dispatchAll());
- verify(mNetworkRequestMatchCallback).onUserSelectionConnectSuccess(
- any(WifiConfiguration.class));
-
- callbackCaptor.getValue().onUserSelectionConnectFailure(new WifiConfiguration());
- assertEquals(1, mLooper.dispatchAll());
- verify(mNetworkRequestMatchCallback).onUserSelectionConnectFailure(
- any(WifiConfiguration.class));
- }
-
- /**
- * Verify the call to unregisterNetworkRequestMatchCallback goes to WifiServiceImpl.
- */
- @Test
- public void unregisterNetworkRequestMatchCallbackCallGoesToWifiServiceImpl() throws Exception {
- ArgumentCaptor<Integer> callbackIdentifier = ArgumentCaptor.forClass(Integer.class);
- mWifiManager.registerNetworkRequestMatchCallback(new HandlerExecutor(mHandler),
- mNetworkRequestMatchCallback);
- verify(mWifiService).registerNetworkRequestMatchCallback(
- any(IBinder.class), any(INetworkRequestMatchCallback.class),
- callbackIdentifier.capture());
-
- mWifiManager.unregisterNetworkRequestMatchCallback(mNetworkRequestMatchCallback);
- verify(mWifiService).unregisterNetworkRequestMatchCallback(
- eq((int) callbackIdentifier.getValue()));
- }
-
- /**
- * Verify the call to NetworkRequestUserSelectionCallback goes to
- * WifiServiceImpl.
- */
- @Test
- public void networkRequestUserSelectionCallbackCallGoesToWifiServiceImpl()
- throws Exception {
- ArgumentCaptor<INetworkRequestMatchCallback.Stub> callbackCaptor =
- ArgumentCaptor.forClass(INetworkRequestMatchCallback.Stub.class);
- mWifiManager.registerNetworkRequestMatchCallback(
- new HandlerExecutor(new Handler(mLooper.getLooper())),
- mNetworkRequestMatchCallback);
- verify(mWifiService).registerNetworkRequestMatchCallback(
- any(IBinder.class), callbackCaptor.capture(), anyInt());
-
- INetworkRequestUserSelectionCallback iUserSelectionCallback =
- mock(INetworkRequestUserSelectionCallback.class);
- ArgumentCaptor<NetworkRequestUserSelectionCallback> userSelectionCallbackCaptor =
- ArgumentCaptor.forClass(NetworkRequestUserSelectionCallback.class);
- callbackCaptor.getValue().onUserSelectionCallbackRegistration(
- iUserSelectionCallback);
- assertEquals(1, mLooper.dispatchAll());
- verify(mNetworkRequestMatchCallback).onUserSelectionCallbackRegistration(
- userSelectionCallbackCaptor.capture());
-
- WifiConfiguration selected = new WifiConfiguration();
- userSelectionCallbackCaptor.getValue().select(selected);
- verify(iUserSelectionCallback).select(selected);
-
- userSelectionCallbackCaptor.getValue().reject();
- verify(iUserSelectionCallback).reject();
- }
-
- /**
- * Check the call to getAllMatchingWifiConfigs calls getAllMatchingFqdnsForScanResults and
- * getWifiConfigsForPasspointProfiles of WifiService in order.
- */
- @Test
- public void testGetAllMatchingWifiConfigs() throws Exception {
- Map<String, List<ScanResult>> passpointProfiles = new HashMap<>();
- passpointProfiles.put("www.test.com_987a69bca26", new ArrayList<>());
- when(mWifiService.getAllMatchingPasspointProfilesForScanResults(
- any(List.class))).thenReturn(passpointProfiles);
- InOrder inOrder = inOrder(mWifiService);
-
- mWifiManager.getAllMatchingWifiConfigs(new ArrayList<>());
-
- inOrder.verify(mWifiService).getAllMatchingPasspointProfilesForScanResults(any(List.class));
- inOrder.verify(mWifiService).getWifiConfigsForPasspointProfiles(any(List.class));
- }
-
- /**
- * Check the call to getMatchingOsuProviders calls getMatchingOsuProviders of WifiService
- * with the provided a list of ScanResult.
- */
- @Test
- public void testGetMatchingOsuProviders() throws Exception {
- mWifiManager.getMatchingOsuProviders(new ArrayList<>());
-
- verify(mWifiService).getMatchingOsuProviders(any(List.class));
- }
-
- /**
- * Verify calls to {@link WifiManager#addNetworkSuggestions(List)},
- * {@link WifiManager#getNetworkSuggestions()} and
- * {@link WifiManager#removeNetworkSuggestions(List)}.
- */
- @Test
- public void addGetRemoveNetworkSuggestions() throws Exception {
- List<WifiNetworkSuggestion> testList = new ArrayList<>();
- when(mWifiService.addNetworkSuggestions(any(List.class), anyString(),
- nullable(String.class))).thenReturn(STATUS_NETWORK_SUGGESTIONS_SUCCESS);
- when(mWifiService.removeNetworkSuggestions(any(List.class), anyString())).thenReturn(
- STATUS_NETWORK_SUGGESTIONS_SUCCESS);
- when(mWifiService.getNetworkSuggestions(anyString()))
- .thenReturn(testList);
-
- assertEquals(STATUS_NETWORK_SUGGESTIONS_SUCCESS,
- mWifiManager.addNetworkSuggestions(testList));
- verify(mWifiService).addNetworkSuggestions(anyList(), eq(TEST_PACKAGE_NAME),
- nullable(String.class));
-
- assertEquals(testList, mWifiManager.getNetworkSuggestions());
- verify(mWifiService).getNetworkSuggestions(eq(TEST_PACKAGE_NAME));
-
- assertEquals(STATUS_NETWORK_SUGGESTIONS_SUCCESS,
- mWifiManager.removeNetworkSuggestions(new ArrayList<>()));
- verify(mWifiService).removeNetworkSuggestions(anyList(), eq(TEST_PACKAGE_NAME));
- }
-
- /**
- * Verify call to {@link WifiManager#getMaxNumberOfNetworkSuggestionsPerApp()}.
- */
- @Test
- public void getMaxNumberOfNetworkSuggestionsPerApp() {
- when(mContext.getSystemServiceName(ActivityManager.class))
- .thenReturn(Context.ACTIVITY_SERVICE);
- when(mContext.getSystemService(Context.ACTIVITY_SERVICE))
- .thenReturn(mActivityManager);
- when(mActivityManager.isLowRamDevice()).thenReturn(true);
- assertEquals(256, mWifiManager.getMaxNumberOfNetworkSuggestionsPerApp());
-
- when(mActivityManager.isLowRamDevice()).thenReturn(false);
- assertEquals(1024, mWifiManager.getMaxNumberOfNetworkSuggestionsPerApp());
- }
-
- /**
- * Verify getting the factory MAC address.
- */
- @Test
- public void testGetFactoryMacAddress() throws Exception {
- when(mWifiService.getFactoryMacAddresses()).thenReturn(TEST_MAC_ADDRESSES);
- assertArrayEquals(TEST_MAC_ADDRESSES, mWifiManager.getFactoryMacAddresses());
- verify(mWifiService).getFactoryMacAddresses();
- }
-
- /**
- * Verify the call to startTemporarilyDisablingAllNonCarrierMergedWifi goes to WifiServiceImpl.
- */
- @Test
- public void testStartTemporarilyDisablingAllNonCarrierMergedWifi() throws Exception {
- mWifiManager.startTemporarilyDisablingAllNonCarrierMergedWifi(1);
- verify(mWifiService).startTemporarilyDisablingAllNonCarrierMergedWifi(1);
- }
-
- /**
- * Verify the call to stopTemporarilyDisablingAllNonCarrierMergedWifi goes to WifiServiceImpl.
- */
- @Test
- public void testStopTemporarilyDisablingAllNonCarrierMergedWifi() throws Exception {
- mWifiManager.stopTemporarilyDisablingAllNonCarrierMergedWifi();
- verify(mWifiService).stopTemporarilyDisablingAllNonCarrierMergedWifi();
- }
-
- /**
- * Verify the call to addOnWifiUsabilityStatsListener goes to WifiServiceImpl.
- */
- @Test
- public void addOnWifiUsabilityStatsListeneroesToWifiServiceImpl() throws Exception {
- mExecutor = new SynchronousExecutor();
- mWifiManager.addOnWifiUsabilityStatsListener(mExecutor, mOnWifiUsabilityStatsListener);
- verify(mWifiService).addOnWifiUsabilityStatsListener(any(IBinder.class),
- any(IOnWifiUsabilityStatsListener.Stub.class), anyInt());
- }
-
- /**
- * Verify the call to removeOnWifiUsabilityStatsListener goes to WifiServiceImpl.
- */
- @Test
- public void removeOnWifiUsabilityListenerGoesToWifiServiceImpl() throws Exception {
- ArgumentCaptor<Integer> listenerIdentifier = ArgumentCaptor.forClass(Integer.class);
- mExecutor = new SynchronousExecutor();
- mWifiManager.addOnWifiUsabilityStatsListener(mExecutor, mOnWifiUsabilityStatsListener);
- verify(mWifiService).addOnWifiUsabilityStatsListener(any(IBinder.class),
- any(IOnWifiUsabilityStatsListener.Stub.class), listenerIdentifier.capture());
-
- mWifiManager.removeOnWifiUsabilityStatsListener(mOnWifiUsabilityStatsListener);
- verify(mWifiService).removeOnWifiUsabilityStatsListener(
- eq((int) listenerIdentifier.getValue()));
- }
-
- /**
- * Test behavior of isEnhancedOpenSupported
- */
- @Test
- public void testIsEnhancedOpenSupported() throws Exception {
- when(mWifiService.getSupportedFeatures())
- .thenReturn(new Long(WIFI_FEATURE_OWE));
- assertTrue(mWifiManager.isEnhancedOpenSupported());
- when(mWifiService.getSupportedFeatures())
- .thenReturn(new Long(~WIFI_FEATURE_OWE));
- assertFalse(mWifiManager.isEnhancedOpenSupported());
- }
-
- /**
- * Test behavior of isWpa3SaeSupported
- */
- @Test
- public void testIsWpa3SaeSupported() throws Exception {
- when(mWifiService.getSupportedFeatures())
- .thenReturn(new Long(WIFI_FEATURE_WPA3_SAE));
- assertTrue(mWifiManager.isWpa3SaeSupported());
- when(mWifiService.getSupportedFeatures())
- .thenReturn(new Long(~WIFI_FEATURE_WPA3_SAE));
- assertFalse(mWifiManager.isWpa3SaeSupported());
- }
-
- /**
- * Test behavior of isWpa3SuiteBSupported
- */
- @Test
- public void testIsWpa3SuiteBSupported() throws Exception {
- when(mWifiService.getSupportedFeatures())
- .thenReturn(new Long(WIFI_FEATURE_WPA3_SUITE_B));
- assertTrue(mWifiManager.isWpa3SuiteBSupported());
- when(mWifiService.getSupportedFeatures())
- .thenReturn(new Long(~WIFI_FEATURE_WPA3_SUITE_B));
- assertFalse(mWifiManager.isWpa3SuiteBSupported());
- }
-
- /**
- * Test behavior of isEasyConnectSupported
- */
- @Test
- public void testIsEasyConnectSupported() throws Exception {
- when(mWifiService.getSupportedFeatures())
- .thenReturn(new Long(WIFI_FEATURE_DPP));
- assertTrue(mWifiManager.isEasyConnectSupported());
- when(mWifiService.getSupportedFeatures())
- .thenReturn(new Long(~WIFI_FEATURE_DPP));
- assertFalse(mWifiManager.isEasyConnectSupported());
- }
-
- /**
- * Test behavior of isStaApConcurrencySupported
- */
- @Test
- public void testIsStaApConcurrencyOpenSupported() throws Exception {
- when(mWifiService.getSupportedFeatures())
- .thenReturn(new Long(WIFI_FEATURE_AP_STA));
- assertTrue(mWifiManager.isStaApConcurrencySupported());
- when(mWifiService.getSupportedFeatures())
- .thenReturn(new Long(~WIFI_FEATURE_AP_STA));
- assertFalse(mWifiManager.isStaApConcurrencySupported());
- }
-
- /**
- * Test behavior of isMultiStaConcurrencySupported
- */
- @Test
- public void testIsMultiStaConcurrencyOpenSupported() throws Exception {
- assumeTrue(SdkLevel.isAtLeastS());
-
- when(mWifiService.getSupportedFeatures())
- .thenReturn(new Long(WIFI_FEATURE_ADDITIONAL_STA));
- assertTrue(mWifiManager.isMultiStaConcurrencySupported());
- when(mWifiService.getSupportedFeatures())
- .thenReturn(new Long(~WIFI_FEATURE_ADDITIONAL_STA));
- assertFalse(mWifiManager.isMultiStaConcurrencySupported());
- }
-
- /**
- * Test behavior of {@link WifiManager#addNetwork(WifiConfiguration)}
- */
- @Test
- public void testAddNetwork() throws Exception {
- WifiConfiguration configuration = new WifiConfiguration();
- when(mWifiService.addOrUpdateNetwork(any(), anyString()))
- .thenReturn(TEST_NETWORK_ID);
-
- assertEquals(mWifiManager.addNetwork(configuration), TEST_NETWORK_ID);
- verify(mWifiService).addOrUpdateNetwork(configuration, mContext.getOpPackageName());
-
- // send a null config
- assertEquals(mWifiManager.addNetwork(null), -1);
- }
-
- /**
- * Test behavior of {@link WifiManager#addNetwork(WifiConfiguration)}
- */
- @Test
- public void testUpdateNetwork() throws Exception {
- WifiConfiguration configuration = new WifiConfiguration();
- when(mWifiService.addOrUpdateNetwork(any(), anyString()))
- .thenReturn(TEST_NETWORK_ID);
-
- configuration.networkId = TEST_NETWORK_ID;
- assertEquals(mWifiManager.updateNetwork(configuration), TEST_NETWORK_ID);
- verify(mWifiService).addOrUpdateNetwork(configuration, mContext.getOpPackageName());
-
- // config with invalid network ID
- configuration.networkId = -1;
- assertEquals(mWifiManager.updateNetwork(configuration), -1);
-
- // send a null config
- assertEquals(mWifiManager.updateNetwork(null), -1);
- }
-
- /**
- * Test behavior of {@link WifiManager#enableNetwork(int, boolean)}
- */
- @Test
- public void testEnableNetwork() throws Exception {
- when(mWifiService.enableNetwork(anyInt(), anyBoolean(), anyString()))
- .thenReturn(true);
- assertTrue(mWifiManager.enableNetwork(TEST_NETWORK_ID, true));
- verify(mWifiService).enableNetwork(TEST_NETWORK_ID, true, mContext.getOpPackageName());
- }
-
- /**
- * Test behavior of {@link WifiManager#disableNetwork(int)}
- */
- @Test
- public void testDisableNetwork() throws Exception {
- when(mWifiService.disableNetwork(anyInt(), anyString()))
- .thenReturn(true);
- assertTrue(mWifiManager.disableNetwork(TEST_NETWORK_ID));
- verify(mWifiService).disableNetwork(TEST_NETWORK_ID, mContext.getOpPackageName());
- }
-
- /**
- * Test behavior of {@link WifiManager#allowAutojoin(int, boolean)}
- * @throws Exception
- */
- @Test
- public void testAllowAutojoin() throws Exception {
- mWifiManager.allowAutojoin(1, true);
- verify(mWifiService).allowAutojoin(1, true);
- }
-
- /**
- * Test behavior of {@link WifiManager#allowAutojoinPasspoint(String, boolean)}
- * @throws Exception
- */
- @Test
- public void testAllowAutojoinPasspoint() throws Exception {
- final String fqdn = "FullyQualifiedDomainName";
- mWifiManager.allowAutojoinPasspoint(fqdn, true);
- verify(mWifiService).allowAutojoinPasspoint(fqdn, true);
- }
-
- /**
- * Test behavior of
- * {@link WifiManager#setMacRandomizationSettingPasspointEnabled(String, boolean)}
- */
- @Test
- public void testSetMacRandomizationSettingPasspointEnabled() throws Exception {
- final String fqdn = "FullyQualifiedDomainName";
- mWifiManager.setMacRandomizationSettingPasspointEnabled(fqdn, true);
- verify(mWifiService).setMacRandomizationSettingPasspointEnabled(fqdn, true);
- }
-
- /**
- * Test behavior of
- * {@link WifiManager#setMacRandomizationSettingPasspointEnabled(String, boolean)}
- */
- @Test
- public void testSetPasspointMeteredOverride() throws Exception {
- final String fqdn = "FullyQualifiedDomainName";
- mWifiManager.setPasspointMeteredOverride(fqdn, METERED_OVERRIDE_METERED);
- verify(mWifiService).setPasspointMeteredOverride(fqdn, METERED_OVERRIDE_METERED);
- }
-
- /**
- * Test behavior of {@link WifiManager#disconnect()}
- */
- @Test
- public void testDisconnect() throws Exception {
- when(mWifiService.disconnect(anyString())).thenReturn(true);
- assertTrue(mWifiManager.disconnect());
- verify(mWifiService).disconnect(mContext.getOpPackageName());
- }
-
- /**
- * Test behavior of {@link WifiManager#reconnect()}
- */
- @Test
- public void testReconnect() throws Exception {
- when(mWifiService.reconnect(anyString())).thenReturn(true);
- assertTrue(mWifiManager.reconnect());
- verify(mWifiService).reconnect(mContext.getOpPackageName());
- }
-
- /**
- * Test behavior of {@link WifiManager#reassociate()}
- */
- @Test
- public void testReassociate() throws Exception {
- when(mWifiService.reassociate(anyString())).thenReturn(true);
- assertTrue(mWifiManager.reassociate());
- verify(mWifiService).reassociate(mContext.getOpPackageName());
- }
-
- /**
- * Test behavior of {@link WifiManager#getSupportedFeatures()}
- */
- @Test
- public void testGetSupportedFeatures() throws Exception {
- long supportedFeatures =
- WIFI_FEATURE_SCANNER
- | WIFI_FEATURE_PASSPOINT
- | WIFI_FEATURE_P2P;
- when(mWifiService.getSupportedFeatures())
- .thenReturn(Long.valueOf(supportedFeatures));
-
- assertTrue(mWifiManager.isWifiScannerSupported());
- assertTrue(mWifiManager.isPasspointSupported());
- assertTrue(mWifiManager.isP2pSupported());
- assertFalse(mWifiManager.isPortableHotspotSupported());
- assertFalse(mWifiManager.isDeviceToDeviceRttSupported());
- assertFalse(mWifiManager.isDeviceToApRttSupported());
- assertFalse(mWifiManager.isPreferredNetworkOffloadSupported());
- assertFalse(mWifiManager.isTdlsSupported());
- assertFalse(mWifiManager.isOffChannelTdlsSupported());
- assertFalse(mWifiManager.isEnhancedPowerReportingSupported());
- }
-
- /**
- * Tests that passing a null Executor to {@link WifiManager#getWifiActivityEnergyInfoAsync}
- * throws an exception.
- */
- @Test(expected = NullPointerException.class)
- public void testGetWifiActivityInfoNullExecutor() throws Exception {
- mWifiManager.getWifiActivityEnergyInfoAsync(null, mOnWifiActivityEnergyInfoListener);
- }
-
- /**
- * Tests that passing a null listener to {@link WifiManager#getWifiActivityEnergyInfoAsync}
- * throws an exception.
- */
- @Test(expected = NullPointerException.class)
- public void testGetWifiActivityInfoNullListener() throws Exception {
- mWifiManager.getWifiActivityEnergyInfoAsync(mExecutor, null);
- }
-
- /** Tests that the listener runs on the correct Executor. */
- @Test
- public void testGetWifiActivityInfoRunsOnCorrectExecutor() throws Exception {
- mWifiManager.getWifiActivityEnergyInfoAsync(mExecutor, mOnWifiActivityEnergyInfoListener);
- ArgumentCaptor<IOnWifiActivityEnergyInfoListener> listenerCaptor =
- ArgumentCaptor.forClass(IOnWifiActivityEnergyInfoListener.class);
- verify(mWifiService).getWifiActivityEnergyInfoAsync(listenerCaptor.capture());
- IOnWifiActivityEnergyInfoListener listener = listenerCaptor.getValue();
- listener.onWifiActivityEnergyInfo(mWifiActivityEnergyInfo);
- verify(mExecutor).execute(any());
-
- // ensure that the executor is only triggered once
- listener.onWifiActivityEnergyInfo(mWifiActivityEnergyInfo);
- verify(mExecutor).execute(any());
- }
-
- /** Tests that the correct listener runs. */
- @Test
- public void testGetWifiActivityInfoRunsCorrectListener() throws Exception {
- int[] flag = {0};
- mWifiManager.getWifiActivityEnergyInfoAsync(
- new SynchronousExecutor(), info -> flag[0]++);
- ArgumentCaptor<IOnWifiActivityEnergyInfoListener> listenerCaptor =
- ArgumentCaptor.forClass(IOnWifiActivityEnergyInfoListener.class);
- verify(mWifiService).getWifiActivityEnergyInfoAsync(listenerCaptor.capture());
- IOnWifiActivityEnergyInfoListener listener = listenerCaptor.getValue();
- listener.onWifiActivityEnergyInfo(mWifiActivityEnergyInfo);
- assertEquals(1, flag[0]);
-
- // ensure that the listener is only triggered once
- listener.onWifiActivityEnergyInfo(mWifiActivityEnergyInfo);
- assertEquals(1, flag[0]);
- }
-
- /**
- * Test behavior of {@link WifiManager#getConnectionInfo()}
- */
- @Test
- public void testGetConnectionInfo() throws Exception {
- WifiInfo wifiInfo = new WifiInfo();
- when(mWifiService.getConnectionInfo(anyString(), nullable(String.class))).thenReturn(
- wifiInfo);
-
- assertEquals(wifiInfo, mWifiManager.getConnectionInfo());
- }
-
- /**
- * Test behavior of {@link WifiManager#is5GHzBandSupported()}
- */
- @Test
- public void testIs5GHzBandSupported() throws Exception {
- when(mWifiService.is5GHzBandSupported()).thenReturn(true);
- assertTrue(mWifiManager.is5GHzBandSupported());
- verify(mWifiService).is5GHzBandSupported();
- }
-
- /**
- * Test behavior of {@link WifiManager#is6GHzBandSupported()}
- */
- @Test
- public void testIs6GHzBandSupported() throws Exception {
- when(mWifiService.is6GHzBandSupported()).thenReturn(true);
- assertTrue(mWifiManager.is6GHzBandSupported());
- verify(mWifiService).is6GHzBandSupported();
- }
-
- /**
- * Test behavior of {@link WifiManager#isWifiStandardSupported()}
- */
- @Test
- public void testIsWifiStandardSupported() throws Exception {
- int standard = ScanResult.WIFI_STANDARD_11AX;
- when(mWifiService.isWifiStandardSupported(standard)).thenReturn(true);
- assertTrue(mWifiManager.isWifiStandardSupported(standard));
- verify(mWifiService).isWifiStandardSupported(standard);
- }
-
- /**
- * Test behavior of {@link WifiManager#getDhcpInfo()}
- */
- @Test
- public void testGetDhcpInfo() throws Exception {
- DhcpInfo dhcpInfo = new DhcpInfo();
-
- when(mWifiService.getDhcpInfo()).thenReturn(dhcpInfo);
- assertEquals(dhcpInfo, mWifiManager.getDhcpInfo());
- verify(mWifiService).getDhcpInfo();
- }
-
- /**
- * Test behavior of {@link WifiManager#setWifiEnabled(boolean)}
- */
- @Test
- public void testSetWifiEnabled() throws Exception {
- when(mWifiService.setWifiEnabled(anyString(), anyBoolean())).thenReturn(true);
- assertTrue(mWifiManager.setWifiEnabled(true));
- verify(mWifiService).setWifiEnabled(mContext.getOpPackageName(), true);
- assertTrue(mWifiManager.setWifiEnabled(false));
- verify(mWifiService).setWifiEnabled(mContext.getOpPackageName(), false);
- }
-
- /**
- * Test behavior of {@link WifiManager#connect(int, ActionListener)}
- */
- @Test
- public void testConnectWithListener() throws Exception {
- ActionListener externalListener = mock(ActionListener.class);
- mWifiManager.connect(TEST_NETWORK_ID, externalListener);
-
- ArgumentCaptor<IActionListener> binderListenerCaptor =
- ArgumentCaptor.forClass(IActionListener.class);
- verify(mWifiService).connect(eq(null), eq(TEST_NETWORK_ID), binderListenerCaptor.capture());
- assertNotNull(binderListenerCaptor.getValue());
-
- // Trigger on success.
- binderListenerCaptor.getValue().onSuccess();
- mLooper.dispatchAll();
- verify(externalListener).onSuccess();
-
- // Trigger on failure.
- binderListenerCaptor.getValue().onFailure(BUSY);
- mLooper.dispatchAll();
- verify(externalListener).onFailure(BUSY);
- }
-
- /**
- * Test behavior of {@link WifiManager#connect(int, ActionListener)}
- */
- @Test
- public void testConnectWithListenerHandleSecurityException() throws Exception {
- doThrow(new SecurityException()).when(mWifiService)
- .connect(eq(null), anyInt(), any(IActionListener.class));
- ActionListener externalListener = mock(ActionListener.class);
- mWifiManager.connect(TEST_NETWORK_ID, externalListener);
-
- mLooper.dispatchAll();
- verify(externalListener).onFailure(NOT_AUTHORIZED);
- }
-
- /**
- * Test behavior of {@link WifiManager#connect(int, ActionListener)}
- */
- @Test
- public void testConnectWithListenerHandleRemoteException() throws Exception {
- doThrow(new RemoteException()).when(mWifiService)
- .connect(eq(null), anyInt(), any(IActionListener.class));
- ActionListener externalListener = mock(ActionListener.class);
- mWifiManager.connect(TEST_NETWORK_ID, externalListener);
-
- mLooper.dispatchAll();
- verify(externalListener).onFailure(ERROR);
- }
-
- /**
- * Test behavior of {@link WifiManager#connect(int, ActionListener)}
- */
- @Test
- public void testConnectWithoutListener() throws Exception {
- WifiConfiguration configuration = new WifiConfiguration();
- mWifiManager.connect(configuration, null);
-
- verify(mWifiService).connect(configuration, WifiConfiguration.INVALID_NETWORK_ID, null);
- }
-
- /**
- * Verify an IllegalArgumentException is thrown if callback is not provided.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testRegisterScanResultsCallbackWithNullCallback() throws Exception {
- mWifiManager.registerScanResultsCallback(mExecutor, null);
- }
-
- /**
- * Verify an IllegalArgumentException is thrown if executor is not provided.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testRegisterCallbackWithNullExecutor() throws Exception {
- mWifiManager.registerScanResultsCallback(null, mScanResultsCallback);
- }
-
- /**
- * Verify client provided callback is being called to the right callback.
- */
- @Test
- public void testAddScanResultsCallbackAndReceiveEvent() throws Exception {
- ArgumentCaptor<IScanResultsCallback.Stub> callbackCaptor =
- ArgumentCaptor.forClass(IScanResultsCallback.Stub.class);
- mWifiManager.registerScanResultsCallback(new SynchronousExecutor(), mScanResultsCallback);
- verify(mWifiService).registerScanResultsCallback(callbackCaptor.capture());
- callbackCaptor.getValue().onScanResultsAvailable();
- verify(mRunnable).run();
- }
-
- /**
- * Verify client provided callback is being called to the right executor.
- */
- @Test
- public void testRegisterScanResultsCallbackWithTheTargetExecutor() throws Exception {
- ArgumentCaptor<IScanResultsCallback.Stub> callbackCaptor =
- ArgumentCaptor.forClass(IScanResultsCallback.Stub.class);
- mWifiManager.registerScanResultsCallback(mExecutor, mScanResultsCallback);
- verify(mWifiService).registerScanResultsCallback(callbackCaptor.capture());
- mWifiManager.registerScanResultsCallback(mAnotherExecutor, mScanResultsCallback);
- callbackCaptor.getValue().onScanResultsAvailable();
- verify(mExecutor, never()).execute(any(Runnable.class));
- verify(mAnotherExecutor).execute(any(Runnable.class));
- }
-
- /**
- * Verify client register unregister then register again, to ensure callback still works.
- */
- @Test
- public void testRegisterUnregisterThenRegisterAgainWithScanResultCallback() throws Exception {
- ArgumentCaptor<IScanResultsCallback.Stub> callbackCaptor =
- ArgumentCaptor.forClass(IScanResultsCallback.Stub.class);
- mWifiManager.registerScanResultsCallback(new SynchronousExecutor(), mScanResultsCallback);
- verify(mWifiService).registerScanResultsCallback(callbackCaptor.capture());
- mWifiManager.unregisterScanResultsCallback(mScanResultsCallback);
- callbackCaptor.getValue().onScanResultsAvailable();
- verify(mRunnable, never()).run();
- mWifiManager.registerScanResultsCallback(new SynchronousExecutor(), mScanResultsCallback);
- callbackCaptor.getValue().onScanResultsAvailable();
- verify(mRunnable).run();
- }
-
- /**
- * Verify client unregisterScanResultsCallback.
- */
- @Test
- public void testUnregisterScanResultsCallback() throws Exception {
- mWifiManager.unregisterScanResultsCallback(mScanResultsCallback);
- verify(mWifiService).unregisterScanResultsCallback(any());
- }
-
- /**
- * Verify client unregisterScanResultsCallback with null callback will cause an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testUnregisterScanResultsCallbackWithNullCallback() throws Exception {
- mWifiManager.unregisterScanResultsCallback(null);
- }
-
- /**
- * Verify an IllegalArgumentException is thrown if executor not provided.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testAddSuggestionConnectionStatusListenerWithNullExecutor() {
- mWifiManager.addSuggestionConnectionStatusListener(null, mSuggestionConnectionListener);
- }
-
- /**
- * Verify an IllegalArgumentException is thrown if listener is not provided.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testAddSuggestionConnectionStatusListenerWithNullListener() {
- mWifiManager.addSuggestionConnectionStatusListener(mExecutor, null);
- }
-
- /**
- * Verify client provided listener is being called to the right listener.
- */
- @Test
- public void testAddSuggestionConnectionStatusListenerAndReceiveEvent() throws Exception {
- int errorCode = STATUS_SUGGESTION_CONNECTION_FAILURE_AUTHENTICATION;
- ArgumentCaptor<ISuggestionConnectionStatusListener.Stub> callbackCaptor =
- ArgumentCaptor.forClass(ISuggestionConnectionStatusListener.Stub.class);
- Executor executor = new SynchronousExecutor();
- mWifiManager.addSuggestionConnectionStatusListener(executor, mSuggestionConnectionListener);
- verify(mWifiService).registerSuggestionConnectionStatusListener(any(IBinder.class),
- callbackCaptor.capture(), anyInt(), anyString(), nullable(String.class));
- callbackCaptor.getValue().onConnectionStatus(mWifiNetworkSuggestion, errorCode);
- verify(mSuggestionConnectionListener).onConnectionStatus(any(WifiNetworkSuggestion.class),
- eq(errorCode));
- }
-
- /**
- * Verify client provided listener is being called to the right executor.
- */
- @Test
- public void testAddSuggestionConnectionStatusListenerWithTheTargetExecutor() throws Exception {
- int errorCode = STATUS_SUGGESTION_CONNECTION_FAILURE_AUTHENTICATION;
- ArgumentCaptor<ISuggestionConnectionStatusListener.Stub> callbackCaptor =
- ArgumentCaptor.forClass(ISuggestionConnectionStatusListener.Stub.class);
- mWifiManager.addSuggestionConnectionStatusListener(mExecutor,
- mSuggestionConnectionListener);
- verify(mWifiService).registerSuggestionConnectionStatusListener(any(IBinder.class),
- callbackCaptor.capture(), anyInt(), anyString(), nullable(String.class));
- callbackCaptor.getValue().onConnectionStatus(any(WifiNetworkSuggestion.class), errorCode);
- verify(mExecutor).execute(any(Runnable.class));
- }
-
- /**
- * Verify an IllegalArgumentException is thrown if listener is not provided.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testRemoveSuggestionConnectionListenerWithNullListener() {
- mWifiManager.removeSuggestionConnectionStatusListener(null);
- }
-
- /**
- * Verify removeSuggestionConnectionListener.
- */
- @Test
- public void testRemoveSuggestionConnectionListener() throws Exception {
- mWifiManager.removeSuggestionConnectionStatusListener(mSuggestionConnectionListener);
- verify(mWifiService).unregisterSuggestionConnectionStatusListener(anyInt(), anyString());
- }
-
- /** Test {@link WifiManager#calculateSignalLevel(int)} */
- @Test
- public void testCalculateSignalLevel() throws Exception {
- when(mWifiService.calculateSignalLevel(anyInt())).thenReturn(3);
- int actual = mWifiManager.calculateSignalLevel(-60);
- verify(mWifiService).calculateSignalLevel(-60);
- assertEquals(3, actual);
- }
-
- /** Test {@link WifiManager#getMaxSignalLevel()} */
- @Test
- public void testGetMaxSignalLevel() throws Exception {
- when(mWifiService.calculateSignalLevel(anyInt())).thenReturn(4);
- int actual = mWifiManager.getMaxSignalLevel();
- verify(mWifiService).calculateSignalLevel(Integer.MAX_VALUE);
- assertEquals(4, actual);
- }
-
- /*
- * Test behavior of isWapiSupported
- * @throws Exception
- */
- @Test
- public void testIsWapiSupported() throws Exception {
- when(mWifiService.getSupportedFeatures())
- .thenReturn(new Long(WifiManager.WIFI_FEATURE_WAPI));
- assertTrue(mWifiManager.isWapiSupported());
- when(mWifiService.getSupportedFeatures())
- .thenReturn(new Long(~WifiManager.WIFI_FEATURE_WAPI));
- assertFalse(mWifiManager.isWapiSupported());
- }
-
- /*
- * Test that DPP channel list is parsed correctly
- */
- @Test
- public void testparseDppChannelList() throws Exception {
- String channelList = "81/1,2,3,4,5,6,7,8,9,10,11,115/36,40,44,48";
- SparseArray<int[]> expectedResult = new SparseArray<>();
- expectedResult.append(81, new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11});
- expectedResult.append(115, new int[]{36, 40, 44, 48});
-
- SparseArray<int[]> result = WifiManager.parseDppChannelList(channelList);
- assertEquals(expectedResult.size(), result.size());
-
- int index = 0;
- int key;
-
- // Compare the two primitive int arrays
- do {
- try {
- key = result.keyAt(index);
- } catch (java.lang.ArrayIndexOutOfBoundsException e) {
- break;
- }
- int[] expected = expectedResult.get(key);
- int[] output = result.get(key);
- assertEquals(expected.length, output.length);
- for (int i = 0; i < output.length; i++) {
- assertEquals(expected[i], output[i]);
- }
- index++;
- } while (true);
- }
-
- /*
- * Test that DPP channel list parser gracefully fails for invalid input
- */
- @Test
- public void testparseDppChannelListWithInvalidFormats() throws Exception {
- String channelList = "1,2,3,4,5,6,7,8,9,10,11,36,40,44,48";
- SparseArray<int[]> result = WifiManager.parseDppChannelList(channelList);
- assertEquals(result.size(), 0);
-
- channelList = "ajgalskgjalskjg3-09683dh";
- result = WifiManager.parseDppChannelList(channelList);
- assertEquals(result.size(), 0);
-
- channelList = "13/abc,46////";
- result = WifiManager.parseDppChannelList(channelList);
- assertEquals(result.size(), 0);
-
- channelList = "11/4,5,13/";
- result = WifiManager.parseDppChannelList(channelList);
- assertEquals(result.size(), 0);
-
- channelList = "/24,6";
- result = WifiManager.parseDppChannelList(channelList);
- assertEquals(result.size(), 0);
- }
-
- /**
- * Test getWifiConfigsForMatchedNetworkSuggestions for given scanResults.
- */
- @Test
- public void testGetWifiConfigsForMatchedNetworkSuggestions() throws Exception {
- List<WifiConfiguration> testResults = new ArrayList<>();
- testResults.add(new WifiConfiguration());
-
- when(mWifiService.getWifiConfigForMatchedNetworkSuggestionsSharedWithUser(any(List.class)))
- .thenReturn(testResults);
- assertEquals(testResults, mWifiManager
- .getWifiConfigForMatchedNetworkSuggestionsSharedWithUser(new ArrayList<>()));
- }
-
- /**
- * Verify the call to setWifiConnectedNetworkScorer goes to WifiServiceImpl.
- */
- @Test
- public void setWifiConnectedNetworkScorerGoesToWifiServiceImpl() throws Exception {
- mExecutor = new SynchronousExecutor();
- mWifiManager.setWifiConnectedNetworkScorer(mExecutor, mWifiConnectedNetworkScorer);
- verify(mWifiService).setWifiConnectedNetworkScorer(any(IBinder.class),
- any(IWifiConnectedNetworkScorer.Stub.class));
- }
-
- /**
- * Verify the call to clearWifiConnectedNetworkScorer goes to WifiServiceImpl.
- */
- @Test
- public void clearWifiConnectedNetworkScorerGoesToWifiServiceImpl() throws Exception {
- mExecutor = new SynchronousExecutor();
- mWifiManager.setWifiConnectedNetworkScorer(mExecutor, mWifiConnectedNetworkScorer);
- verify(mWifiService).setWifiConnectedNetworkScorer(any(IBinder.class),
- any(IWifiConnectedNetworkScorer.Stub.class));
-
- mWifiManager.clearWifiConnectedNetworkScorer();
- verify(mWifiService).clearWifiConnectedNetworkScorer();
- }
-
- /**
- * Verify that Wi-Fi connected scorer receives score update observer after registeration.
- */
- @Test
- public void verifyScorerReceiveScoreUpdateObserverAfterRegistration() throws Exception {
- mExecutor = new SynchronousExecutor();
- mWifiManager.setWifiConnectedNetworkScorer(mExecutor, mWifiConnectedNetworkScorer);
- ArgumentCaptor<IWifiConnectedNetworkScorer.Stub> scorerCaptor =
- ArgumentCaptor.forClass(IWifiConnectedNetworkScorer.Stub.class);
- verify(mWifiService).setWifiConnectedNetworkScorer(any(IBinder.class),
- scorerCaptor.capture());
- scorerCaptor.getValue().onSetScoreUpdateObserver(any());
- mLooper.dispatchAll();
- verify(mWifiConnectedNetworkScorer).onSetScoreUpdateObserver(any());
- }
-
- /**
- * Verify that Wi-Fi connected scorer receives session ID when onStart/onStop methods
- * are called.
- */
- @Test
- public void verifyScorerReceiveSessionIdWhenStartStopIsCalled() throws Exception {
- mExecutor = new SynchronousExecutor();
- mWifiManager.setWifiConnectedNetworkScorer(mExecutor, mWifiConnectedNetworkScorer);
- ArgumentCaptor<IWifiConnectedNetworkScorer.Stub> callbackCaptor =
- ArgumentCaptor.forClass(IWifiConnectedNetworkScorer.Stub.class);
- verify(mWifiService).setWifiConnectedNetworkScorer(any(IBinder.class),
- callbackCaptor.capture());
- callbackCaptor.getValue().onStart(0);
- callbackCaptor.getValue().onStop(10);
- mLooper.dispatchAll();
- verify(mWifiConnectedNetworkScorer).onStart(0);
- verify(mWifiConnectedNetworkScorer).onStop(10);
- }
-
- @Test
- public void testScanThrottle() throws Exception {
- mWifiManager.setScanThrottleEnabled(true);
- verify(mWifiService).setScanThrottleEnabled(true);
-
- when(mWifiService.isScanThrottleEnabled()).thenReturn(false);
- assertFalse(mWifiManager.isScanThrottleEnabled());
- verify(mWifiService).isScanThrottleEnabled();
- }
-
- @Test
- public void testAutoWakeup() throws Exception {
- mWifiManager.setAutoWakeupEnabled(true);
- verify(mWifiService).setAutoWakeupEnabled(true);
-
- when(mWifiService.isAutoWakeupEnabled()).thenReturn(false);
- assertFalse(mWifiManager.isAutoWakeupEnabled());
- verify(mWifiService).isAutoWakeupEnabled();
- }
-
-
- @Test
- public void testScanAvailable() throws Exception {
- mWifiManager.setScanAlwaysAvailable(true);
- verify(mWifiService).setScanAlwaysAvailable(true, TEST_PACKAGE_NAME);
-
- when(mWifiService.isScanAlwaysAvailable()).thenReturn(false);
- assertFalse(mWifiManager.isScanAlwaysAvailable());
- verify(mWifiService).isScanAlwaysAvailable();
- }
-
- @Test
- public void testGetNetworkSuggestionUserApprovalStatus() throws Exception {
- assumeTrue(SdkLevel.isAtLeastS());
-
- when(mWifiService.getNetworkSuggestionUserApprovalStatus(TEST_PACKAGE_NAME))
- .thenReturn(WifiManager.STATUS_SUGGESTION_APPROVAL_APPROVED_BY_USER);
- assertEquals(WifiManager.STATUS_SUGGESTION_APPROVAL_APPROVED_BY_USER,
- mWifiManager.getNetworkSuggestionUserApprovalStatus());
- verify(mWifiService).getNetworkSuggestionUserApprovalStatus(TEST_PACKAGE_NAME);
- }
-
- @Test
- public void testSetCarrierNetworkOffload() throws Exception {
- assumeTrue(SdkLevel.isAtLeastS());
- mWifiManager.setCarrierNetworkOffloadEnabled(TEST_SUB_ID, true, false);
- verify(mWifiService).setCarrierNetworkOffloadEnabled(TEST_SUB_ID,
- true, false);
- }
-
- @Test
- public void testGetCarrierNetworkOffload() throws Exception {
- assumeTrue(SdkLevel.isAtLeastS());
- when(mWifiService.isCarrierNetworkOffloadEnabled(TEST_SUB_ID, false)).thenReturn(true);
- assertTrue(mWifiManager.isCarrierNetworkOffloadEnabled(TEST_SUB_ID, false));
- verify(mWifiService).isCarrierNetworkOffloadEnabled(TEST_SUB_ID, false);
- }
-
-
- /**
- * Verify an IllegalArgumentException is thrown if listener is not provided.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testRemoveSuggestionUserApprovalStatusListenerWithNullListener() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- mWifiManager.removeSuggestionUserApprovalStatusListener(null);
- }
-
-
- /**
- * Verify removeSuggestionUserApprovalStatusListener.
- */
- @Test
- public void testRemoveSuggestionUserApprovalStatusListener() throws Exception {
- assumeTrue(SdkLevel.isAtLeastS());
-
- mWifiManager.removeSuggestionUserApprovalStatusListener(
- mSuggestionUserApprovalStatusListener);
- verify(mWifiService).removeSuggestionUserApprovalStatusListener(anyInt(), anyString());
- }
-
- /**
- * Verify an IllegalArgumentException is thrown if executor not provided.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testAddSuggestionUserApprovalStatusListenerWithNullExecutor() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- mWifiManager.addSuggestionUserApprovalStatusListener(null,
- mSuggestionUserApprovalStatusListener);
- }
-
- /**
- * Verify an IllegalArgumentException is thrown if listener is not provided.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testAddSuggestionUserApprovalStatusListenerWithNullListener() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- mWifiManager.addSuggestionUserApprovalStatusListener(mExecutor, null);
- }
-
- /**
- * Verify client provided listener is being called to the right listener.
- */
- @Test
- public void testAddSuggestionUserApprovalStatusListenerAndReceiveEvent() throws Exception {
- assumeTrue(SdkLevel.isAtLeastS());
-
- ArgumentCaptor<ISuggestionUserApprovalStatusListener.Stub> callbackCaptor =
- ArgumentCaptor.forClass(ISuggestionUserApprovalStatusListener.Stub.class);
- Executor executor = new SynchronousExecutor();
- mWifiManager.addSuggestionUserApprovalStatusListener(executor,
- mSuggestionUserApprovalStatusListener);
- verify(mWifiService).addSuggestionUserApprovalStatusListener(any(IBinder.class),
- callbackCaptor.capture(), anyInt(), anyString(), nullable(String.class));
- callbackCaptor.getValue().onUserApprovalStatusChange();
- verify(mSuggestionUserApprovalStatusListener).onUserApprovalStatusChange();
- }
-
- /**
- * Verify client provided listener is being called to the right executor.
- */
- @Test
- public void testAddSuggestionUserApprovalStatusListenerWithTheTargetExecutor()
- throws Exception {
- assumeTrue(SdkLevel.isAtLeastS());
- ArgumentCaptor<ISuggestionUserApprovalStatusListener.Stub> callbackCaptor =
- ArgumentCaptor.forClass(ISuggestionUserApprovalStatusListener.Stub.class);
- mWifiManager.addSuggestionUserApprovalStatusListener(mExecutor,
- mSuggestionUserApprovalStatusListener);
- verify(mWifiService).addSuggestionUserApprovalStatusListener(any(IBinder.class),
- callbackCaptor.capture(), anyInt(), anyString(), nullable(String.class));
- callbackCaptor.getValue().onUserApprovalStatusChange();
- verify(mExecutor).execute(any(Runnable.class));
- }
-
-}
diff --git a/wifi/tests/src/android/net/wifi/WifiNetworkAgentSpecifierTest.java b/wifi/tests/src/android/net/wifi/WifiNetworkAgentSpecifierTest.java
deleted file mode 100644
index d479aac..0000000
--- a/wifi/tests/src/android/net/wifi/WifiNetworkAgentSpecifierTest.java
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * 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.net.wifi;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import android.net.MacAddress;
-import android.net.MatchAllNetworkSpecifier;
-import android.os.Parcel;
-import android.os.PatternMatcher;
-import android.util.Pair;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-/**
- * Unit tests for {@link android.net.wifi.WifiNetworkAgentSpecifier}.
- */
-@SmallTest
-public class WifiNetworkAgentSpecifierTest {
- private static final String TEST_SSID = "Test123";
- private static final String TEST_SSID_PATTERN = "Test";
- private static final String TEST_SSID_1 = "456test";
- private static final String TEST_BSSID = "12:12:12:aa:0b:c0";
- private static final String TEST_BSSID_OUI_BASE_ADDRESS = "12:12:12:00:00:00";
- private static final String TEST_BSSID_OUI_MASK = "ff:ff:ff:00:00:00";
- private static final String TEST_BSSID_1 = "aa:cc:12:aa:0b:c0";
- private static final String TEST_PRESHARED_KEY = "\"Test123\"";
-
- /**
- * Validate that parcel marshalling/unmarshalling works
- */
- @Test
- public void testWifiNetworkAgentSpecifierParcel() {
- WifiNetworkAgentSpecifier specifier = createDefaultNetworkAgentSpecifier();
-
- Parcel parcelW = Parcel.obtain();
- specifier.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- WifiNetworkAgentSpecifier parcelSpecifier =
- WifiNetworkAgentSpecifier.CREATOR.createFromParcel(parcelR);
-
- assertEquals(specifier, parcelSpecifier);
- }
-
- /**
- * Validate NetworkAgentSpecifier equals with itself.
- * a) Create network agent specifier 1 for WPA_PSK network
- * b) Create network agent specifier 2 with the same params as specifier 1.
- * c) Ensure that the specifier 2 equals specifier 1.
- */
- @Test
- public void testWifiNetworkAgentSpecifierEqualsSame() {
- WifiNetworkAgentSpecifier specifier1 = createDefaultNetworkAgentSpecifier();
- WifiNetworkAgentSpecifier specifier2 = createDefaultNetworkAgentSpecifier();
-
- assertTrue(specifier2.equals(specifier1));
- }
-
- /**
- * Validate NetworkAgentSpecifier equals between instances of {@link WifiNetworkAgentSpecifier}.
- * a) Create network agent specifier 1 for WPA_PSK network
- * b) Create network agent specifier 2 with different key mgmt params.
- * c) Ensure that the specifier 2 does not equal specifier 1.
- */
- @Test
- public void testWifiNetworkAgentSpecifierDoesNotEqualsWhenKeyMgmtDifferent() {
- WifiConfiguration wifiConfiguration1 = createDefaultWifiConfiguration();
- WifiNetworkAgentSpecifier specifier1 =
- new WifiNetworkAgentSpecifier(
- wifiConfiguration1);
-
- WifiConfiguration wifiConfiguration2 = new WifiConfiguration(wifiConfiguration1);
- wifiConfiguration2.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
- WifiNetworkAgentSpecifier specifier2 =
- new WifiNetworkAgentSpecifier(
- wifiConfiguration2);
-
- assertFalse(specifier2.equals(specifier1));
- }
-
- /**
- * Validate NetworkAgentSpecifier equals between instances of {@link WifiNetworkAgentSpecifier}.
- * a) Create network agent specifier 1 for WPA_PSK network
- * b) Create network agent specifier 2 with different SSID.
- * c) Ensure that the specifier 2 does not equal specifier 1.
- */
- @Test
- public void testWifiNetworkAgentSpecifierDoesNotSatisifyWhenSsidDifferent() {
- WifiConfiguration wifiConfiguration1 = createDefaultWifiConfiguration();
- WifiNetworkAgentSpecifier specifier1 =
- new WifiNetworkAgentSpecifier(
- wifiConfiguration1);
-
- WifiConfiguration wifiConfiguration2 = new WifiConfiguration(wifiConfiguration1);
- wifiConfiguration2.SSID = TEST_SSID_1;
- WifiNetworkAgentSpecifier specifier2 =
- new WifiNetworkAgentSpecifier(
- wifiConfiguration2);
-
- assertFalse(specifier2.equals(specifier1));
- }
-
- /**
- * Validate NetworkAgentSpecifier equals between instances of {@link WifiNetworkAgentSpecifier}.
- * a) Create network agent specifier 1 for WPA_PSK network
- * b) Create network agent specifier 2 with different BSSID.
- * c) Ensure that the specifier 2 does not equal specifier 1.
- */
- @Test
- public void testWifiNetworkAgentSpecifierDoesNotSatisifyWhenBssidDifferent() {
- WifiConfiguration wifiConfiguration1 = createDefaultWifiConfiguration();
- WifiNetworkAgentSpecifier specifier1 =
- new WifiNetworkAgentSpecifier(
- wifiConfiguration1);
-
- WifiConfiguration wifiConfiguration2 = new WifiConfiguration(wifiConfiguration1);
- wifiConfiguration2.BSSID = TEST_BSSID_1;
- WifiNetworkAgentSpecifier specifier2 =
- new WifiNetworkAgentSpecifier(
- wifiConfiguration2);
-
- assertFalse(specifier2.equals(specifier1));
- }
-
- /**
- * Validate NetworkAgentSpecifier matching.
- * a) Create a network agent specifier for WPA_PSK network
- * b) Ensure that the specifier matches {@code null} and {@link MatchAllNetworkSpecifier}
- * specifiers.
- */
- @Test
- public void testWifiNetworkAgentSpecifierSatisifiesNullAndAllMatch() {
- WifiNetworkAgentSpecifier specifier = createDefaultNetworkAgentSpecifier();
-
- assertTrue(specifier.canBeSatisfiedBy(null));
- assertTrue(specifier.canBeSatisfiedBy(new MatchAllNetworkSpecifier()));
- }
-
- /**
- * Validate NetworkAgentSpecifier matching with itself.
- * a) Create network agent specifier 1 for WPA_PSK network
- * b) Create network agent specifier 2 with the same params as specifier 1.
- * c) Ensure that the agent specifier is satisfied by itself.
- */
- @Test
- public void testWifiNetworkAgentSpecifierDoesSatisifySame() {
- WifiNetworkAgentSpecifier specifier1 = createDefaultNetworkAgentSpecifier();
- WifiNetworkAgentSpecifier specifier2 = createDefaultNetworkAgentSpecifier();
-
- assertTrue(specifier2.canBeSatisfiedBy(specifier1));
- }
-
- /**
- * Validate {@link WifiNetworkAgentSpecifier} with {@link WifiNetworkSpecifier} matching.
- * a) Create network agent specifier for WPA_PSK network
- * b) Create network specifier with matching SSID pattern.
- * c) Ensure that the agent specifier is satisfied by specifier.
- */
- @Test
- public void
- testWifiNetworkAgentSpecifierSatisfiesNetworkSpecifierWithSsidPattern() {
- WifiNetworkAgentSpecifier wifiNetworkAgentSpecifier = createDefaultNetworkAgentSpecifier();
-
- PatternMatcher ssidPattern =
- new PatternMatcher(TEST_SSID_PATTERN, PatternMatcher.PATTERN_PREFIX);
- Pair<MacAddress, MacAddress> bssidPattern =
- Pair.create(WifiManager.ALL_ZEROS_MAC_ADDRESS, WifiManager.ALL_ZEROS_MAC_ADDRESS);
- WifiConfiguration wificonfigurationNetworkSpecifier = new WifiConfiguration();
- wificonfigurationNetworkSpecifier.allowedKeyManagement
- .set(WifiConfiguration.KeyMgmt.WPA_PSK);
- WifiNetworkSpecifier wifiNetworkSpecifier = new WifiNetworkSpecifier(
- ssidPattern,
- bssidPattern,
- wificonfigurationNetworkSpecifier);
-
- assertTrue(wifiNetworkSpecifier.canBeSatisfiedBy(wifiNetworkAgentSpecifier));
- assertTrue(wifiNetworkAgentSpecifier.canBeSatisfiedBy(wifiNetworkSpecifier));
- }
-
- /**
- * Validate {@link WifiNetworkAgentSpecifier} with {@link WifiNetworkSpecifier} matching.
- * a) Create network agent specifier for WPA_PSK network
- * b) Create network specifier with matching BSSID pattern.
- * c) Ensure that the agent specifier is satisfied by specifier.
- */
- @Test
- public void
- testWifiNetworkAgentSpecifierSatisfiesNetworkSpecifierWithBssidPattern() {
- WifiNetworkAgentSpecifier wifiNetworkAgentSpecifier = createDefaultNetworkAgentSpecifier();
-
- PatternMatcher ssidPattern =
- new PatternMatcher(".*", PatternMatcher.PATTERN_SIMPLE_GLOB);
- Pair<MacAddress, MacAddress> bssidPattern =
- Pair.create(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- MacAddress.fromString(TEST_BSSID_OUI_MASK));
- WifiConfiguration wificonfigurationNetworkSpecifier = new WifiConfiguration();
- wificonfigurationNetworkSpecifier.allowedKeyManagement
- .set(WifiConfiguration.KeyMgmt.WPA_PSK);
- WifiNetworkSpecifier wifiNetworkSpecifier = new WifiNetworkSpecifier(
- ssidPattern,
- bssidPattern,
- wificonfigurationNetworkSpecifier);
-
- assertTrue(wifiNetworkSpecifier.canBeSatisfiedBy(wifiNetworkAgentSpecifier));
- assertTrue(wifiNetworkAgentSpecifier.canBeSatisfiedBy(wifiNetworkSpecifier));
- }
-
- /**
- * Validate {@link WifiNetworkAgentSpecifier} with {@link WifiNetworkSpecifier} matching.
- * a) Create network agent specifier for WPA_PSK network
- * b) Create network specifier with matching SSID & BSSID pattern.
- * c) Ensure that the agent specifier is satisfied by specifier.
- */
- @Test
- public void
- testWifiNetworkAgentSpecifierSatisfiesNetworkSpecifierWithSsidAndBssidPattern() {
- WifiNetworkAgentSpecifier wifiNetworkAgentSpecifier = createDefaultNetworkAgentSpecifier();
-
- PatternMatcher ssidPattern =
- new PatternMatcher(TEST_SSID_PATTERN, PatternMatcher.PATTERN_PREFIX);
- Pair<MacAddress, MacAddress> bssidPattern =
- Pair.create(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- MacAddress.fromString(TEST_BSSID_OUI_MASK));
- WifiConfiguration wificonfigurationNetworkSpecifier = new WifiConfiguration();
- wificonfigurationNetworkSpecifier.allowedKeyManagement
- .set(WifiConfiguration.KeyMgmt.WPA_PSK);
- WifiNetworkSpecifier wifiNetworkSpecifier = new WifiNetworkSpecifier(
- ssidPattern,
- bssidPattern,
- wificonfigurationNetworkSpecifier);
-
- assertTrue(wifiNetworkSpecifier.canBeSatisfiedBy(wifiNetworkAgentSpecifier));
- assertTrue(wifiNetworkAgentSpecifier.canBeSatisfiedBy(wifiNetworkSpecifier));
- }
-
- /**
- * Validate {@link WifiNetworkAgentSpecifier} with {@link WifiNetworkSpecifier} matching.
- * a) Create network agent specifier for WPA_PSK network
- * b) Create network specifier with non-matching SSID pattern.
- * c) Ensure that the agent specifier is not satisfied by specifier.
- */
- @Test
- public void
- testWifiNetworkAgentSpecifierDoesNotSatisfyNetworkSpecifierWithSsidPattern() {
- WifiConfiguration wifiConfigurationNetworkAgent = createDefaultWifiConfiguration();
- wifiConfigurationNetworkAgent.SSID = "\"" + TEST_SSID_1 + "\"";
- WifiNetworkAgentSpecifier wifiNetworkAgentSpecifier =
- new WifiNetworkAgentSpecifier(
- wifiConfigurationNetworkAgent);
-
- PatternMatcher ssidPattern =
- new PatternMatcher(TEST_SSID_PATTERN, PatternMatcher.PATTERN_PREFIX);
- Pair<MacAddress, MacAddress> bssidPattern =
- Pair.create(WifiManager.ALL_ZEROS_MAC_ADDRESS, WifiManager.ALL_ZEROS_MAC_ADDRESS);
- WifiConfiguration wificonfigurationNetworkSpecifier = new WifiConfiguration();
- wificonfigurationNetworkSpecifier.allowedKeyManagement
- .set(WifiConfiguration.KeyMgmt.WPA_PSK);
- WifiNetworkSpecifier wifiNetworkSpecifier = new WifiNetworkSpecifier(
- ssidPattern,
- bssidPattern,
- wificonfigurationNetworkSpecifier);
-
- assertFalse(wifiNetworkSpecifier.canBeSatisfiedBy(wifiNetworkAgentSpecifier));
- assertFalse(wifiNetworkAgentSpecifier.canBeSatisfiedBy(wifiNetworkSpecifier));
- }
-
- /**
- * Validate {@link WifiNetworkAgentSpecifier} with {@link WifiNetworkSpecifier} matching.
- * a) Create network agent specifier for WPA_PSK network
- * b) Create network specifier with non-matching BSSID pattern.
- * c) Ensure that the agent specifier is not satisfied by specifier.
- */
- @Test
- public void
- testWifiNetworkAgentSpecifierDoesNotSatisfyNetworkSpecifierWithBssidPattern() {
- WifiConfiguration wifiConfigurationNetworkAgent = createDefaultWifiConfiguration();
- wifiConfigurationNetworkAgent.BSSID = TEST_BSSID_1;
- WifiNetworkAgentSpecifier wifiNetworkAgentSpecifier =
- new WifiNetworkAgentSpecifier(
- wifiConfigurationNetworkAgent);
-
- PatternMatcher ssidPattern =
- new PatternMatcher(".*", PatternMatcher.PATTERN_SIMPLE_GLOB);
- Pair<MacAddress, MacAddress> bssidPattern =
- Pair.create(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- MacAddress.fromString(TEST_BSSID_OUI_MASK));
- WifiConfiguration wificonfigurationNetworkSpecifier = new WifiConfiguration();
- wificonfigurationNetworkSpecifier.allowedKeyManagement
- .set(WifiConfiguration.KeyMgmt.WPA_PSK);
- WifiNetworkSpecifier wifiNetworkSpecifier = new WifiNetworkSpecifier(
- ssidPattern,
- bssidPattern,
- wificonfigurationNetworkSpecifier);
-
- assertFalse(wifiNetworkSpecifier.canBeSatisfiedBy(wifiNetworkAgentSpecifier));
- assertFalse(wifiNetworkAgentSpecifier.canBeSatisfiedBy(wifiNetworkSpecifier));
- }
-
- /**
- * Validate {@link WifiNetworkAgentSpecifier} with {@link WifiNetworkSpecifier} matching.
- * a) Create network agent specifier for WPA_PSK network
- * b) Create network specifier with non-matching SSID and BSSID pattern.
- * c) Ensure that the agent specifier is not satisfied by specifier.
- */
- @Test
- public void
- testWifiNetworkAgentSpecifierDoesNotSatisfyNetworkSpecifierWithSsidAndBssidPattern() {
- WifiConfiguration wifiConfigurationNetworkAgent = createDefaultWifiConfiguration();
- wifiConfigurationNetworkAgent.BSSID = TEST_BSSID_1;
- WifiNetworkAgentSpecifier wifiNetworkAgentSpecifier =
- new WifiNetworkAgentSpecifier(
- wifiConfigurationNetworkAgent);
-
- PatternMatcher ssidPattern =
- new PatternMatcher(TEST_SSID_PATTERN, PatternMatcher.PATTERN_PREFIX);
- Pair<MacAddress, MacAddress> bssidPattern =
- Pair.create(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- MacAddress.fromString(TEST_BSSID_OUI_MASK));
- WifiConfiguration wificonfigurationNetworkSpecifier = new WifiConfiguration();
- wificonfigurationNetworkSpecifier.allowedKeyManagement
- .set(WifiConfiguration.KeyMgmt.WPA_PSK);
- WifiNetworkSpecifier wifiNetworkSpecifier = new WifiNetworkSpecifier(
- ssidPattern,
- bssidPattern,
- wificonfigurationNetworkSpecifier);
-
- assertFalse(wifiNetworkSpecifier.canBeSatisfiedBy(wifiNetworkAgentSpecifier));
- assertFalse(wifiNetworkAgentSpecifier.canBeSatisfiedBy(wifiNetworkSpecifier));
- }
-
- /**
- * Validate {@link WifiNetworkAgentSpecifier} with {@link WifiNetworkSpecifier} matching.
- * a) Create network agent specifier for WPA_PSK network
- * b) Create network specifier with matching SSID and BSSID pattern, but different key mgmt.
- * c) Ensure that the agent specifier is not satisfied by specifier.
- */
- @Test
- public void
- testWifiNetworkAgentSpecifierDoesNotSatisfyNetworkSpecifierWithDifferentKeyMgmt() {
- WifiNetworkAgentSpecifier wifiNetworkAgentSpecifier = createDefaultNetworkAgentSpecifier();
-
- PatternMatcher ssidPattern =
- new PatternMatcher(TEST_SSID_PATTERN, PatternMatcher.PATTERN_PREFIX);
- Pair<MacAddress, MacAddress> bssidPattern =
- Pair.create(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- MacAddress.fromString(TEST_BSSID_OUI_MASK));
- WifiConfiguration wificonfigurationNetworkSpecifier = new WifiConfiguration();
- wificonfigurationNetworkSpecifier.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
- WifiNetworkSpecifier wifiNetworkSpecifier = new WifiNetworkSpecifier(
- ssidPattern,
- bssidPattern,
- wificonfigurationNetworkSpecifier);
-
- assertFalse(wifiNetworkSpecifier.canBeSatisfiedBy(wifiNetworkAgentSpecifier));
- assertFalse(wifiNetworkAgentSpecifier.canBeSatisfiedBy(wifiNetworkSpecifier));
- }
-
-
- private WifiConfiguration createDefaultWifiConfiguration() {
- WifiConfiguration wifiConfiguration = new WifiConfiguration();
- wifiConfiguration.SSID = "\"" + TEST_SSID + "\"";
- wifiConfiguration.BSSID = TEST_BSSID;
- wifiConfiguration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
- wifiConfiguration.preSharedKey = TEST_PRESHARED_KEY;
- return wifiConfiguration;
- }
-
- private WifiNetworkAgentSpecifier createDefaultNetworkAgentSpecifier() {
- return new WifiNetworkAgentSpecifier(createDefaultWifiConfiguration());
- }
-
-}
diff --git a/wifi/tests/src/android/net/wifi/WifiNetworkScoreCacheTest.java b/wifi/tests/src/android/net/wifi/WifiNetworkScoreCacheTest.java
index fdd11a3..c4967eb 100644
--- a/wifi/tests/src/android/net/wifi/WifiNetworkScoreCacheTest.java
+++ b/wifi/tests/src/android/net/wifi/WifiNetworkScoreCacheTest.java
@@ -11,7 +11,7 @@
* 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
+ * limitations under the License.
*/
package android.net.wifi;
diff --git a/wifi/tests/src/android/net/wifi/WifiNetworkSpecifierTest.java b/wifi/tests/src/android/net/wifi/WifiNetworkSpecifierTest.java
deleted file mode 100644
index 464f462..0000000
--- a/wifi/tests/src/android/net/wifi/WifiNetworkSpecifierTest.java
+++ /dev/null
@@ -1,793 +0,0 @@
-/*
- * 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.net.wifi;
-
-import static android.os.PatternMatcher.PATTERN_LITERAL;
-import static android.os.PatternMatcher.PATTERN_PREFIX;
-import static android.os.PatternMatcher.PATTERN_SIMPLE_GLOB;
-
-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 android.net.MacAddress;
-import android.net.MatchAllNetworkSpecifier;
-import android.net.NetworkSpecifier;
-import android.os.Parcel;
-import android.os.PatternMatcher;
-import android.util.Pair;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-import java.security.cert.X509Certificate;
-
-/**
- * Unit tests for {@link android.net.wifi.WifiNetworkSpecifier}.
- */
-@SmallTest
-public class WifiNetworkSpecifierTest {
- private static final String TEST_SSID = "Test123";
- private static final String TEST_BSSID_OUI_BASE_ADDRESS = "12:12:12:00:00:00";
- private static final String TEST_BSSID_OUI_MASK = "ff:ff:ff:00:00:00";
- private static final String TEST_BSSID = "12:12:12:12:12:12";
- private static final String TEST_PRESHARED_KEY = "\"Test123\"";
- private static final String TEST_DOMAIN_SUFFIX_MATCH = "domainSuffixMatch";
-
- /**
- * Validate correctness of WifiNetworkSpecifier object created by
- * {@link WifiNetworkSpecifier.Builder#build()} for open network with SSID pattern.
- */
- @Test
- public void testWifiNetworkSpecifierBuilderForOpenNetworkWithSsidPattern() {
- NetworkSpecifier specifier = new WifiNetworkSpecifier.Builder()
- .setSsidPattern(new PatternMatcher(TEST_SSID, PATTERN_PREFIX))
- .build();
-
- assertTrue(specifier instanceof WifiNetworkSpecifier);
- WifiNetworkSpecifier wifiNetworkSpecifier = (WifiNetworkSpecifier) specifier;
-
- assertEquals(TEST_SSID, wifiNetworkSpecifier.ssidPatternMatcher.getPath());
- assertEquals(PATTERN_PREFIX, wifiNetworkSpecifier.ssidPatternMatcher.getType());
- assertEquals(WifiManager.ALL_ZEROS_MAC_ADDRESS,
- wifiNetworkSpecifier.bssidPatternMatcher.first);
- assertEquals(WifiManager.ALL_ZEROS_MAC_ADDRESS,
- wifiNetworkSpecifier.bssidPatternMatcher.second);
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.NONE));
- }
-
- /**
- * Validate correctness of WifiNetworkSpecifier object created by
- * {@link WifiNetworkSpecifier.Builder#build()} for WPA_PSK network with BSSID
- * pattern.
- */
- @Test
- public void testWifiNetworkSpecifierBuilderForWpa2PskNetworkWithBssidPattern() {
- NetworkSpecifier specifier = new WifiNetworkSpecifier.Builder()
- .setBssidPattern(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- MacAddress.fromString(TEST_BSSID_OUI_MASK))
- .setWpa2Passphrase(TEST_PRESHARED_KEY)
- .build();
-
- assertTrue(specifier instanceof WifiNetworkSpecifier);
- WifiNetworkSpecifier wifiNetworkSpecifier = (WifiNetworkSpecifier) specifier;
-
- assertEquals(".*", wifiNetworkSpecifier.ssidPatternMatcher.getPath());
- assertEquals(PATTERN_SIMPLE_GLOB, wifiNetworkSpecifier.ssidPatternMatcher.getType());
- assertEquals(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- wifiNetworkSpecifier.bssidPatternMatcher.first);
- assertEquals(MacAddress.fromString(TEST_BSSID_OUI_MASK),
- wifiNetworkSpecifier.bssidPatternMatcher.second);
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.WPA_PSK));
- assertEquals("\"" + TEST_PRESHARED_KEY + "\"",
- wifiNetworkSpecifier.wifiConfiguration.preSharedKey);
- }
-
- /**
- * Validate correctness of WifiNetworkSpecifier object created by
- * {@link WifiNetworkSpecifier.Builder#build()} for WPA_EAP network with
- * SSID and BSSID pattern.
- */
- @Test
- public void testWifiNetworkSpecifierBuilderForWpa2EapHiddenNetworkWithSsidAndBssid() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.GTC);
-
- NetworkSpecifier specifier = new WifiNetworkSpecifier.Builder()
- .setSsid(TEST_SSID)
- .setBssid(MacAddress.fromString(TEST_BSSID))
- .setWpa2EnterpriseConfig(enterpriseConfig)
- .setIsHiddenSsid(true)
- .build();
-
- assertTrue(specifier instanceof WifiNetworkSpecifier);
- WifiNetworkSpecifier wifiNetworkSpecifier = (WifiNetworkSpecifier) specifier;
-
- assertEquals(TEST_SSID, wifiNetworkSpecifier.ssidPatternMatcher.getPath());
- assertEquals(PATTERN_LITERAL, wifiNetworkSpecifier.ssidPatternMatcher.getType());
- assertEquals(MacAddress.fromString(TEST_BSSID),
- wifiNetworkSpecifier.bssidPatternMatcher.first);
- assertEquals(MacAddress.BROADCAST_ADDRESS,
- wifiNetworkSpecifier.bssidPatternMatcher.second);
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.WPA_EAP));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.IEEE8021X));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.hiddenSSID);
- assertEquals(enterpriseConfig.getEapMethod(),
- wifiNetworkSpecifier.wifiConfiguration.enterpriseConfig.getEapMethod());
- assertEquals(enterpriseConfig.getPhase2Method(),
- wifiNetworkSpecifier.wifiConfiguration.enterpriseConfig.getPhase2Method());
- }
-
- /**
- * Validate correctness of WifiNetworkSpecifier object created by
- * {@link WifiNetworkSpecifier.Builder#build()} for WPA3-Enterprise network.
- */
- @Test
- public void testWifiNetworkSpecifierBuilderForWpa3EapNetwork() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_CERT0);
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- NetworkSpecifier specifier = new WifiNetworkSpecifier.Builder()
- .setSsid(TEST_SSID)
- .setWpa3EnterpriseConfig(enterpriseConfig)
- .build();
-
- assertTrue(specifier instanceof WifiNetworkSpecifier);
- WifiNetworkSpecifier wifiNetworkSpecifier = (WifiNetworkSpecifier) specifier;
-
- assertEquals("\"" + TEST_SSID + "\"", wifiNetworkSpecifier.wifiConfiguration.SSID);
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.IEEE8021X));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.WPA_EAP));
- assertFalse(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.CCMP));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.requirePmf);
- assertNull(wifiNetworkSpecifier.wifiConfiguration.preSharedKey);
- assertNotNull(wifiNetworkSpecifier.wifiConfiguration.enterpriseConfig);
- }
-
- /**
- * Validate correctness of WifiNetworkSpecifier object created by
- * {@link WifiNetworkSpecifier.Builder#build()} for WPA3-Enterprise network.
- */
- @Test
- public void testWifiNetworkSpecifierBuilderForWpa3EapNetworkWithStandardApi() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_CERT0);
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- NetworkSpecifier specifier = new WifiNetworkSpecifier.Builder()
- .setSsid(TEST_SSID)
- .setWpa3EnterpriseStandardModeConfig(enterpriseConfig)
- .build();
-
- assertTrue(specifier instanceof WifiNetworkSpecifier);
- WifiNetworkSpecifier wifiNetworkSpecifier = (WifiNetworkSpecifier) specifier;
-
- assertEquals("\"" + TEST_SSID + "\"", wifiNetworkSpecifier.wifiConfiguration.SSID);
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.IEEE8021X));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.WPA_EAP));
- assertFalse(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.CCMP));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.requirePmf);
- assertNull(wifiNetworkSpecifier.wifiConfiguration.preSharedKey);
- assertNotNull(wifiNetworkSpecifier.wifiConfiguration.enterpriseConfig);
- }
-
- /**
- * Validate correctness of WifiNetworkSpecifier object created by
- * {@link WifiNetworkSpecifier.Builder#build()} for WPA3-Enterprise network
- * with 192-bit RSA certificates.
- */
- @Test
- public void testWifiNetworkSpecifierBuilderForWpa3EapNetworkWithSuiteBRsaCerts() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_SUITE_B_RSA3072_CERT);
- enterpriseConfig.setClientKeyEntryWithCertificateChain(FakeKeys.CLIENT_SUITE_B_RSA3072_KEY,
- new X509Certificate[] {FakeKeys.CLIENT_SUITE_B_RSA3072_CERT});
-
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- NetworkSpecifier specifier = new WifiNetworkSpecifier.Builder()
- .setSsid(TEST_SSID)
- .setWpa3EnterpriseStandardModeConfig(enterpriseConfig)
- .build();
-
- assertTrue(specifier instanceof WifiNetworkSpecifier);
- WifiNetworkSpecifier wifiNetworkSpecifier = (WifiNetworkSpecifier) specifier;
-
- assertEquals("\"" + TEST_SSID + "\"", wifiNetworkSpecifier.wifiConfiguration.SSID);
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.IEEE8021X));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.WPA_EAP));
- assertFalse(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.CCMP));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.requirePmf);
- assertNull(wifiNetworkSpecifier.wifiConfiguration.preSharedKey);
- assertNotNull(wifiNetworkSpecifier.wifiConfiguration.enterpriseConfig);
- }
-
- /**
- * Validate correctness of WifiNetworkSpecifier object created by
- * {@link WifiNetworkSpecifier.Builder#build()} for WPA3-Enterprise network
- * with 192-bit ECC certificates.
- */
- @Test
- public void testWifiNetworkSpecifierBuilderForWpa3EapNetworkWithSuiteBEccCerts() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_SUITE_B_ECDSA_CERT);
- enterpriseConfig.setClientKeyEntryWithCertificateChain(FakeKeys.CLIENT_SUITE_B_ECC_KEY,
- new X509Certificate[] {FakeKeys.CLIENT_SUITE_B_ECDSA_CERT});
-
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- NetworkSpecifier specifier = new WifiNetworkSpecifier.Builder()
- .setSsid(TEST_SSID)
- .setWpa3EnterpriseStandardModeConfig(enterpriseConfig)
- .build();
-
- assertTrue(specifier instanceof WifiNetworkSpecifier);
- WifiNetworkSpecifier wifiNetworkSpecifier = (WifiNetworkSpecifier) specifier;
-
- assertEquals("\"" + TEST_SSID + "\"", wifiNetworkSpecifier.wifiConfiguration.SSID);
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.IEEE8021X));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.WPA_EAP));
- assertFalse(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.CCMP));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.requirePmf);
- assertNull(wifiNetworkSpecifier.wifiConfiguration.preSharedKey);
- assertNotNull(wifiNetworkSpecifier.wifiConfiguration.enterpriseConfig);
- }
-
- /**
- * Validate correctness of WifiNetworkSpecifier object created by
- * {@link WifiNetworkSpecifier.Builder#build()} for WPA3-Enterprise 192-bit RSA SuiteB network.
- */
- @Test
- public void testWifiNetworkSpecifierBuilderForWpa3SuiteBRsaEapNetwork() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_SUITE_B_RSA3072_CERT);
- enterpriseConfig.setClientKeyEntryWithCertificateChain(FakeKeys.CLIENT_SUITE_B_RSA3072_KEY,
- new X509Certificate[] {FakeKeys.CLIENT_SUITE_B_RSA3072_CERT});
-
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- NetworkSpecifier specifier = new WifiNetworkSpecifier.Builder()
- .setSsid(TEST_SSID)
- .setWpa3EnterpriseConfig(enterpriseConfig)
- .build();
-
- assertTrue(specifier instanceof WifiNetworkSpecifier);
- WifiNetworkSpecifier wifiNetworkSpecifier = (WifiNetworkSpecifier) specifier;
-
- assertEquals("\"" + TEST_SSID + "\"", wifiNetworkSpecifier.wifiConfiguration.SSID);
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.GCMP_256));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedGroupManagementCiphers
- .get(WifiConfiguration.GroupMgmtCipher.BIP_GMAC_256));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.requirePmf);
- assertNull(wifiNetworkSpecifier.wifiConfiguration.preSharedKey);
- assertNotNull(wifiNetworkSpecifier.wifiConfiguration.enterpriseConfig);
- }
-
- /**
- * Validate correctness of WifiNetworkSpecifier object created by
- * {@link WifiNetworkSpecifier.Builder#build()} for WPA3-Enterprise 192-bit ECC SuiteB network.
- */
- @Test
- public void testWifiNetworkSpecifierBuilderForWpa3SuiteBEccEapNetwork() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_SUITE_B_ECDSA_CERT);
- enterpriseConfig.setClientKeyEntryWithCertificateChain(FakeKeys.CLIENT_SUITE_B_ECC_KEY,
- new X509Certificate[] {FakeKeys.CLIENT_SUITE_B_ECDSA_CERT});
-
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- NetworkSpecifier specifier = new WifiNetworkSpecifier.Builder()
- .setSsid(TEST_SSID)
- .setWpa3EnterpriseConfig(enterpriseConfig)
- .build();
-
- assertTrue(specifier instanceof WifiNetworkSpecifier);
- WifiNetworkSpecifier wifiNetworkSpecifier = (WifiNetworkSpecifier) specifier;
-
- assertEquals("\"" + TEST_SSID + "\"", wifiNetworkSpecifier.wifiConfiguration.SSID);
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.GCMP_256));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedGroupManagementCiphers
- .get(WifiConfiguration.GroupMgmtCipher.BIP_GMAC_256));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.requirePmf);
- assertNull(wifiNetworkSpecifier.wifiConfiguration.preSharedKey);
- assertNotNull(wifiNetworkSpecifier.wifiConfiguration.enterpriseConfig);
- }
-
- /**
- * Validate correctness of WifiNetworkSpecifier object created by
- * {@link WifiNetworkSpecifier.Builder#build()} for WPA3-Enterprise 192-bit RSA SuiteB network.
- */
- @Test
- public void testWifiNetworkSpecifierBuilderForWpa3SuiteBRsaEapNetworkWith192BitApi() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_SUITE_B_RSA3072_CERT);
- enterpriseConfig.setClientKeyEntryWithCertificateChain(FakeKeys.CLIENT_SUITE_B_RSA3072_KEY,
- new X509Certificate[] {FakeKeys.CLIENT_SUITE_B_RSA3072_CERT});
-
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- NetworkSpecifier specifier = new WifiNetworkSpecifier.Builder()
- .setSsid(TEST_SSID)
- .setWpa3Enterprise192BitModeConfig(enterpriseConfig)
- .build();
-
- assertTrue(specifier instanceof WifiNetworkSpecifier);
- WifiNetworkSpecifier wifiNetworkSpecifier = (WifiNetworkSpecifier) specifier;
-
- assertEquals("\"" + TEST_SSID + "\"", wifiNetworkSpecifier.wifiConfiguration.SSID);
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.GCMP_256));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedGroupManagementCiphers
- .get(WifiConfiguration.GroupMgmtCipher.BIP_GMAC_256));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.requirePmf);
- assertNull(wifiNetworkSpecifier.wifiConfiguration.preSharedKey);
- assertNotNull(wifiNetworkSpecifier.wifiConfiguration.enterpriseConfig);
- }
-
- /**
- * Validate correctness of WifiNetworkSpecifier object created by
- * {@link WifiNetworkSpecifier.Builder#build()} for WPA3-Enterprise 192-bit ECC SuiteB network.
- */
- @Test
- public void testWifiNetworkSpecifierBuilderForWpa3SuiteBEccEapNetworkWith192BitApi() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_SUITE_B_ECDSA_CERT);
- enterpriseConfig.setClientKeyEntryWithCertificateChain(FakeKeys.CLIENT_SUITE_B_ECC_KEY,
- new X509Certificate[] {FakeKeys.CLIENT_SUITE_B_ECDSA_CERT});
-
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- NetworkSpecifier specifier = new WifiNetworkSpecifier.Builder()
- .setSsid(TEST_SSID)
- .setWpa3Enterprise192BitModeConfig(enterpriseConfig)
- .build();
-
- assertTrue(specifier instanceof WifiNetworkSpecifier);
- WifiNetworkSpecifier wifiNetworkSpecifier = (WifiNetworkSpecifier) specifier;
-
- assertEquals("\"" + TEST_SSID + "\"", wifiNetworkSpecifier.wifiConfiguration.SSID);
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.GCMP_256));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.allowedGroupManagementCiphers
- .get(WifiConfiguration.GroupMgmtCipher.BIP_GMAC_256));
- assertTrue(wifiNetworkSpecifier.wifiConfiguration.requirePmf);
- assertNull(wifiNetworkSpecifier.wifiConfiguration.preSharedKey);
- assertNotNull(wifiNetworkSpecifier.wifiConfiguration.enterpriseConfig);
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#setSsid(String)} throws an exception
- * when the string is not Unicode.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testWifiNetworkSpecifierBuilderSetSsidWithNonUnicodeString() {
- new WifiNetworkSpecifier.Builder()
- .setSsid("\ud800")
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#setWpa2Passphrase(String)} throws an exception
- * when the string is not ASCII encodable.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testWifiNetworkSpecifierSetWpa2PasphraseWithNonAsciiString() {
- new WifiNetworkSpecifier.Builder()
- .setSsid(TEST_SSID)
- .setWpa2Passphrase("salvē")
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#build()} throws an exception
- * when neither SSID nor BSSID patterns were set.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSpecifierBuilderWithNoSsidAndBssidPattern() {
- new WifiNetworkSpecifier.Builder().build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#build()} throws an exception
- * when match-all SSID pattern is set.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSpecifierBuilderWithMatchAllSsidPattern1() {
- new WifiNetworkSpecifier.Builder()
- .setSsidPattern(new PatternMatcher(".*", PATTERN_SIMPLE_GLOB))
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#build()} throws an exception
- * when match-all SSID pattern is set.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSpecifierBuilderWithMatchAllSsidPattern2() {
- new WifiNetworkSpecifier.Builder()
- .setSsidPattern(new PatternMatcher(".*", PatternMatcher.PATTERN_ADVANCED_GLOB))
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#build()} throws an exception
- * when match-all SSID pattern is set.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSpecifierBuilderWithMatchAllSsidPattern3() {
- new WifiNetworkSpecifier.Builder()
- .setSsidPattern(new PatternMatcher("", PATTERN_PREFIX))
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#build()} throws an exception
- * when match-all BSSID pattern is set.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSpecifierBuilderWithMatchAllBssidPattern() {
- new WifiNetworkSpecifier.Builder()
- .setBssidPattern(WifiManager.ALL_ZEROS_MAC_ADDRESS,
- WifiManager.ALL_ZEROS_MAC_ADDRESS)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#build()} throws an exception
- * when match-none SSID pattern is set.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSpecifierBuilderWithMatchNoneSsidPattern1() {
- new WifiNetworkSpecifier.Builder()
- .setSsidPattern(new PatternMatcher("", PatternMatcher.PATTERN_LITERAL))
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#build()} throws an exception
- * when match-none SSID pattern is set.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSpecifierBuilderWithMatchNoneSsidPattern2() {
- new WifiNetworkSpecifier.Builder()
- .setSsid("")
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#build()} throws an exception
- * when match-none BSSID pattern is set.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSpecifierBuilderWithMatchNoneBssidPattern1() {
- new WifiNetworkSpecifier.Builder()
- .setBssidPattern(MacAddress.BROADCAST_ADDRESS, MacAddress.BROADCAST_ADDRESS)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#build()} throws an exception
- * when match-none BSSID pattern is set.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSpecifierBuilderWithMatchNoneBssidPattern2() {
- new WifiNetworkSpecifier.Builder()
- .setBssid(MacAddress.BROADCAST_ADDRESS)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#build()} throws an exception
- * when match-none BSSID pattern is set.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSpecifierBuilderWithMatchNoneBssidPattern3() {
- new WifiNetworkSpecifier.Builder()
- .setBssid(WifiManager.ALL_ZEROS_MAC_ADDRESS)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#build()} throws an exception
- * when SSID pattern is set for hidden network.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSpecifierBuilderWithBssidMatchPatternForHiddenNetwork() {
- new WifiNetworkSpecifier.Builder()
- .setBssidPattern(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- MacAddress.fromString(TEST_BSSID_OUI_MASK))
- .setIsHiddenSsid(true)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#build()} throws an exception
- * when both {@link WifiNetworkSpecifier.Builder#setWpa2Passphrase(String)} and
- * {@link WifiNetworkSpecifier.Builder#setWpa2EnterpriseConfig(WifiEnterpriseConfig)} are
- * invoked.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSpecifierBuilderWithBothWpa2PasphraseAndEnterpriseConfig() {
- new WifiNetworkSpecifier.Builder()
- .setSsidPattern(new PatternMatcher(TEST_SSID, PATTERN_LITERAL))
- .setWpa2Passphrase(TEST_PRESHARED_KEY)
- .setWpa2EnterpriseConfig(new WifiEnterpriseConfig())
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#build()} throws an exception
- * when SSID pattern is set for hidden network.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSpecifierBuilderWithSsidMatchPatternForHiddenNetwork() {
- new WifiNetworkSpecifier.Builder()
- .setSsidPattern(new PatternMatcher(TEST_SSID, PATTERN_PREFIX))
- .setIsHiddenSsid(true)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#build()} throws an exception
- * when both {@link WifiNetworkSpecifier.Builder#setWpa2Passphrase(String)} and
- * {@link WifiNetworkSpecifier.Builder#setWpa3Passphrase(String)} are invoked.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSpecifierBuilderWithBothWpa2PasphraseAndWpa3Passphrase() {
- new WifiNetworkSpecifier.Builder()
- .setSsidPattern(new PatternMatcher(TEST_SSID, PATTERN_LITERAL))
- .setWpa2Passphrase(TEST_PRESHARED_KEY)
- .setWpa3Passphrase(TEST_PRESHARED_KEY)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#build()} throws an exception
- * when both {@link WifiNetworkSpecifier.Builder#setWpa3Passphrase(String)} and
- * {@link WifiNetworkSpecifier.Builder
- * #setWpa3EnterpriseStandardModeConfig(WifiEnterpriseConfig)}
- * are invoked.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSpecifierBuilderWithBothWpa3PasphraseAndEnterprise() {
- new WifiNetworkSpecifier.Builder()
- .setSsidPattern(new PatternMatcher(TEST_SSID, PATTERN_LITERAL))
- .setWpa3Passphrase(TEST_PRESHARED_KEY)
- .setWpa3EnterpriseStandardModeConfig(new WifiEnterpriseConfig())
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSpecifier.Builder#build()} throws an exception
- * when both {@link WifiNetworkSpecifier.Builder#setWpa3Passphrase(String)} and
- * {@link WifiNetworkSpecifier.Builder#setIsEnhancedOpen(boolean)} are invoked.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSpecifierBuilderWithBothWpa3PasphraseAndEnhancedOpen() {
- new WifiNetworkSpecifier.Builder()
- .setSsidPattern(new PatternMatcher(TEST_SSID, PATTERN_LITERAL))
- .setWpa3Passphrase(TEST_PRESHARED_KEY)
- .setIsEnhancedOpen(true)
- .build();
- }
-
- /**
- * Validate that parcel marshalling/unmarshalling works
- */
- @Test
- public void testWifiNetworkSpecifierParcel() {
- WifiConfiguration wifiConfiguration = new WifiConfiguration();
- wifiConfiguration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
- wifiConfiguration.preSharedKey = TEST_PRESHARED_KEY;
- WifiNetworkSpecifier specifier =
- new WifiNetworkSpecifier(new PatternMatcher(TEST_SSID, PATTERN_LITERAL),
- Pair.create(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- MacAddress.fromString(TEST_BSSID_OUI_MASK)),
- wifiConfiguration);
-
- Parcel parcelW = Parcel.obtain();
- specifier.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- WifiNetworkSpecifier parcelSpecifier =
- WifiNetworkSpecifier.CREATOR.createFromParcel(parcelR);
-
- assertEquals(specifier, parcelSpecifier);
- }
-
- /**
- * Validate NetworkSpecifier matching.
- * a) Create a network specifier for WPA_PSK network
- * b) Ensure that the specifier does not match {@code null} and {@link MatchAllNetworkSpecifier}
- * specifiers.
- */
- @Test
- public void testWifiNetworkSpecifierDoesNotSatisfyNullAndAllMatch() {
- WifiConfiguration wifiConfiguration = new WifiConfiguration();
- wifiConfiguration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
- wifiConfiguration.preSharedKey = TEST_PRESHARED_KEY;
- WifiNetworkSpecifier specifier =
- new WifiNetworkSpecifier(new PatternMatcher(TEST_SSID, PATTERN_LITERAL),
- Pair.create(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- MacAddress.fromString(TEST_BSSID_OUI_MASK)),
- wifiConfiguration);
-
- assertFalse(specifier.canBeSatisfiedBy(null));
- assertFalse(specifier.canBeSatisfiedBy(new MatchAllNetworkSpecifier()));
- }
-
- /**
- * Validate NetworkSpecifier matching.
- * a) Create network specifier 1 for WPA_PSK network
- * b) Create network specifier 2 with the same params as specifier 1.
- * c) Ensure that the specifier 2 is satisfied by specifier 1.
- */
- @Test
- public void testWifiNetworkSpecifierSatisfiesSame() {
- WifiConfiguration wifiConfiguration = new WifiConfiguration();
- wifiConfiguration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
- wifiConfiguration.preSharedKey = TEST_PRESHARED_KEY;
-
- WifiNetworkSpecifier specifier1 =
- new WifiNetworkSpecifier(new PatternMatcher(TEST_SSID, PATTERN_LITERAL),
- Pair.create(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- MacAddress.fromString(TEST_BSSID_OUI_MASK)),
- wifiConfiguration);
-
- WifiNetworkSpecifier specifier2 =
- new WifiNetworkSpecifier(new PatternMatcher(TEST_SSID, PATTERN_LITERAL),
- Pair.create(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- MacAddress.fromString(TEST_BSSID_OUI_MASK)),
- wifiConfiguration);
-
- assertTrue(specifier2.canBeSatisfiedBy(specifier1));
- }
-
- /**
- * Validate NetworkSpecifier matching.
- * a) Create network specifier 1 for WPA_PSK network
- * b) Create network specifier 2 with different key mgmt params.
- * c) Ensure that the specifier 2 is not satisfied by specifier 1.
- */
- @Test
- public void testWifiNetworkSpecifierDoesNotSatisfyWhenKeyMgmtDifferent() {
- WifiConfiguration wifiConfiguration1 = new WifiConfiguration();
- wifiConfiguration1.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
- wifiConfiguration1.preSharedKey = TEST_PRESHARED_KEY;
-
- WifiNetworkSpecifier specifier1 =
- new WifiNetworkSpecifier(new PatternMatcher(TEST_SSID, PATTERN_LITERAL),
- Pair.create(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- MacAddress.fromString(TEST_BSSID_OUI_MASK)),
- wifiConfiguration1);
-
- WifiConfiguration wifiConfiguration2 = new WifiConfiguration();
- wifiConfiguration2.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
- WifiNetworkSpecifier specifier2 =
- new WifiNetworkSpecifier(new PatternMatcher(TEST_SSID, PATTERN_LITERAL),
- Pair.create(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- MacAddress.fromString(TEST_BSSID_OUI_MASK)),
- wifiConfiguration2);
-
- assertFalse(specifier2.canBeSatisfiedBy(specifier1));
- }
-
- /**
- * Validate NetworkSpecifier matching.
- * a) Create network specifier 1 for WPA_PSK network
- * b) Create network specifier 2 with different SSID pattern.
- * c) Ensure that the specifier 2 is not satisfied by specifier 1.
- */
- @Test
- public void testWifiNetworkSpecifierDoesNotSatisfyWhenSsidDifferent() {
- WifiConfiguration wifiConfiguration = new WifiConfiguration();
- wifiConfiguration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
- wifiConfiguration.preSharedKey = TEST_PRESHARED_KEY;
-
- WifiNetworkSpecifier specifier1 =
- new WifiNetworkSpecifier(new PatternMatcher("", PATTERN_LITERAL),
- Pair.create(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- MacAddress.fromString(TEST_BSSID_OUI_MASK)),
- wifiConfiguration);
-
- WifiNetworkSpecifier specifier2 =
- new WifiNetworkSpecifier(new PatternMatcher(TEST_SSID, PATTERN_LITERAL),
- Pair.create(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- MacAddress.fromString(TEST_BSSID_OUI_MASK)),
- wifiConfiguration);
-
- assertFalse(specifier2.canBeSatisfiedBy(specifier1));
- }
-
- /**
- * Validate NetworkSpecifier matching.
- * a) Create network specifier 1 for WPA_PSK network
- * b) Create network specifier 2 with different BSSID pattern.
- * c) Ensure that the specifier 2 is not satisfied by specifier 1.
- */
- @Test
- public void testWifiNetworkSpecifierDoesNotSatisfyWhenBssidDifferent() {
- WifiConfiguration wifiConfiguration = new WifiConfiguration();
- wifiConfiguration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
- wifiConfiguration.preSharedKey = TEST_PRESHARED_KEY;
-
- WifiNetworkSpecifier specifier1 =
- new WifiNetworkSpecifier(new PatternMatcher(TEST_SSID, PATTERN_LITERAL),
- Pair.create(MacAddress.fromString(TEST_BSSID_OUI_BASE_ADDRESS),
- MacAddress.fromString(TEST_BSSID_OUI_MASK)),
- wifiConfiguration);
-
- WifiNetworkSpecifier specifier2 =
- new WifiNetworkSpecifier(new PatternMatcher(TEST_SSID, PATTERN_LITERAL),
- Pair.create(WifiManager.ALL_ZEROS_MAC_ADDRESS,
- WifiManager.ALL_ZEROS_MAC_ADDRESS),
- wifiConfiguration);
-
- assertFalse(specifier2.canBeSatisfiedBy(specifier1));
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/WifiNetworkSuggestionTest.java b/wifi/tests/src/android/net/wifi/WifiNetworkSuggestionTest.java
deleted file mode 100644
index 5e82918..0000000
--- a/wifi/tests/src/android/net/wifi/WifiNetworkSuggestionTest.java
+++ /dev/null
@@ -1,1524 +0,0 @@
-/*
- * 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.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.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeTrue;
-
-import android.net.MacAddress;
-import android.net.wifi.hotspot2.PasspointConfiguration;
-import android.net.wifi.hotspot2.PasspointTestUtils;
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import com.android.modules.utils.build.SdkLevel;
-
-import org.junit.Test;
-
-import java.security.cert.X509Certificate;
-
-/**
- * Unit tests for {@link android.net.wifi.WifiNetworkSuggestion}.
- */
-@SmallTest
-public class WifiNetworkSuggestionTest {
- private static final String TEST_SSID = "\"Test123\"";
- private static final String TEST_BSSID = "12:12:12:12:12:12";
- private static final String TEST_SSID_1 = "\"Test1234\"";
- private static final String TEST_PRESHARED_KEY = "Test123";
- private static final String TEST_FQDN = "fqdn";
- private static final String TEST_WAPI_CERT_SUITE = "suite";
- private static final String TEST_DOMAIN_SUFFIX_MATCH = "domainSuffixMatch";
- private static final int DEFAULT_PRIORITY_GROUP = 0;
- private static final int TEST_PRIORITY_GROUP = 1;
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for Open network which requires
- * app interaction.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForOpenNetworkWithReqAppInteraction() {
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setIsAppInteractionRequired(true)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.NONE));
- assertTrue(suggestion.isAppInteractionRequired);
- assertFalse(suggestion.isUserInteractionRequired);
- assertEquals(WifiConfiguration.METERED_OVERRIDE_NONE,
- suggestion.wifiConfiguration.meteredOverride);
- assertEquals(-1, suggestion.wifiConfiguration.priority);
- assertFalse(suggestion.isUserAllowedToManuallyConnect);
- assertTrue(suggestion.isInitialAutoJoinEnabled);
- assertNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for WPA_EAP network which requires
- * app interaction, not share credential and has a priority of zero set.
- */
- @Test
- public void
- testWifiNetworkSuggestionBuilderForWpa2EapNetworkWithPriorityAndReqAppInteraction() {
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa2Passphrase(TEST_PRESHARED_KEY)
- .setIsAppInteractionRequired(true)
- .setCredentialSharedWithUser(false)
- .setPriority(0)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.WPA_PSK));
- assertEquals("\"" + TEST_PRESHARED_KEY + "\"",
- suggestion.wifiConfiguration.preSharedKey);
- assertTrue(suggestion.isAppInteractionRequired);
- assertFalse(suggestion.isUserInteractionRequired);
- assertEquals(WifiConfiguration.METERED_OVERRIDE_NONE,
- suggestion.wifiConfiguration.meteredOverride);
- assertEquals(0, suggestion.wifiConfiguration.priority);
- assertFalse(suggestion.isUserAllowedToManuallyConnect);
- assertTrue(suggestion.isInitialAutoJoinEnabled);
- assertNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for WPA_PSK network which requires
- * user interaction and is metered.
- */
- @Test
- public void
- testWifiNetworkSuggestionBuilderForWpa2PskNetworkWithMeteredAndReqUserInteraction() {
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa2Passphrase(TEST_PRESHARED_KEY)
- .setIsUserInteractionRequired(true)
- .setIsInitialAutojoinEnabled(false)
- .setIsMetered(true)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.WPA_PSK));
- assertEquals("\"" + TEST_PRESHARED_KEY + "\"",
- suggestion.wifiConfiguration.preSharedKey);
- assertFalse(suggestion.isAppInteractionRequired);
- assertTrue(suggestion.isUserInteractionRequired);
- assertEquals(WifiConfiguration.METERED_OVERRIDE_METERED,
- suggestion.wifiConfiguration.meteredOverride);
- assertEquals(-1, suggestion.wifiConfiguration.priority);
- assertTrue(suggestion.isUserAllowedToManuallyConnect);
- assertFalse(suggestion.isInitialAutoJoinEnabled);
- assertNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for WPA_PSK network which requires
- * user interaction and is not metered.
- */
- @Test
- public void
- testWifiNetworkSuggestionBuilderForWpa2PskNetworkWithNotMeteredAndReqUserInteraction() {
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa2Passphrase(TEST_PRESHARED_KEY)
- .setIsUserInteractionRequired(true)
- .setIsInitialAutojoinEnabled(false)
- .setIsMetered(false)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.WPA_PSK));
- assertEquals("\"" + TEST_PRESHARED_KEY + "\"",
- suggestion.wifiConfiguration.preSharedKey);
- assertFalse(suggestion.isAppInteractionRequired);
- assertTrue(suggestion.isUserInteractionRequired);
- assertEquals(WifiConfiguration.METERED_OVERRIDE_NOT_METERED,
- suggestion.wifiConfiguration.meteredOverride);
- assertEquals(-1, suggestion.wifiConfiguration.priority);
- assertTrue(suggestion.isUserAllowedToManuallyConnect);
- assertFalse(suggestion.isInitialAutoJoinEnabled);
- assertNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for OWE network.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForEnhancedOpenNetworkWithBssid() {
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setBssid(MacAddress.fromString(TEST_BSSID))
- .setIsEnhancedOpen(true)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertEquals(TEST_BSSID, suggestion.wifiConfiguration.BSSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.OWE));
- assertNull(suggestion.wifiConfiguration.preSharedKey);
- assertTrue(suggestion.wifiConfiguration.requirePmf);
- assertFalse(suggestion.isUserAllowedToManuallyConnect);
- assertTrue(suggestion.isInitialAutoJoinEnabled);
- assertNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for OWE network.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForOemPaidEnhancedOpenNetworkWithBssid() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setBssid(MacAddress.fromString(TEST_BSSID))
- .setOemPaid(true)
- .setIsEnhancedOpen(true)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertEquals(TEST_BSSID, suggestion.wifiConfiguration.BSSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.OWE));
- assertNull(suggestion.wifiConfiguration.preSharedKey);
- assertTrue(suggestion.wifiConfiguration.requirePmf);
- assertTrue(suggestion.wifiConfiguration.oemPaid);
- assertTrue(suggestion.isOemPaid());
- assertFalse(suggestion.isUserAllowedToManuallyConnect);
- assertTrue(suggestion.isInitialAutoJoinEnabled);
- assertNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for OWE network.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForOemPrivateEnhancedOpenNetworkWithBssid() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setBssid(MacAddress.fromString(TEST_BSSID))
- .setOemPrivate(true)
- .setIsEnhancedOpen(true)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertEquals(TEST_BSSID, suggestion.wifiConfiguration.BSSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.OWE));
- assertNull(suggestion.wifiConfiguration.preSharedKey);
- assertTrue(suggestion.wifiConfiguration.requirePmf);
- assertTrue(suggestion.wifiConfiguration.oemPrivate);
- assertTrue(suggestion.isOemPrivate());
- assertFalse(suggestion.isUserAllowedToManuallyConnect);
- assertTrue(suggestion.isInitialAutoJoinEnabled);
- assertNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for SAE network.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForWpa3PskNetwork() {
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa3Passphrase(TEST_PRESHARED_KEY)
- .setCredentialSharedWithUser(true)
- .setIsInitialAutojoinEnabled(false)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SAE));
- assertEquals("\"" + TEST_PRESHARED_KEY + "\"",
- suggestion.wifiConfiguration.preSharedKey);
- assertTrue(suggestion.wifiConfiguration.requirePmf);
- assertTrue(suggestion.isUserAllowedToManuallyConnect);
- assertFalse(suggestion.isInitialAutoJoinEnabled);
- assertNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for WPA3-Enterprise network.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForWpa3EapNetwork() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_CERT0);
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa3EnterpriseConfig(enterpriseConfig)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.IEEE8021X));
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.WPA_EAP));
- assertFalse(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(suggestion.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.CCMP));
- assertTrue(suggestion.wifiConfiguration.requirePmf);
- assertNull(suggestion.wifiConfiguration.preSharedKey);
- // allowedSuiteBCiphers are set according to the loaded certificate and cannot be tested
- // here.
- assertTrue(suggestion.isUserAllowedToManuallyConnect);
- assertTrue(suggestion.isInitialAutoJoinEnabled);
- assertNotNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for WPA3-Enterprise standard network.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForWpa3EapNetworkWithStandardApi() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_CERT0);
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa3EnterpriseStandardModeConfig(enterpriseConfig)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.IEEE8021X));
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.WPA_EAP));
- assertFalse(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(suggestion.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.CCMP));
- assertTrue(suggestion.wifiConfiguration.requirePmf);
- assertNull(suggestion.wifiConfiguration.preSharedKey);
- // allowedSuiteBCiphers are set according to the loaded certificate and cannot be tested
- // here.
- assertTrue(suggestion.isUserAllowedToManuallyConnect);
- assertTrue(suggestion.isInitialAutoJoinEnabled);
- assertNotNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for WPA3-Enterprise network
- * with 192-bit RSA SuiteB certificates.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForWpa3EapNetworkWithSuiteBRsaCerts() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_SUITE_B_RSA3072_CERT);
- enterpriseConfig.setClientKeyEntryWithCertificateChain(FakeKeys.CLIENT_SUITE_B_RSA3072_KEY,
- new X509Certificate[] {FakeKeys.CLIENT_SUITE_B_RSA3072_CERT});
-
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa3EnterpriseStandardModeConfig(enterpriseConfig)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.IEEE8021X));
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.WPA_EAP));
- assertFalse(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(suggestion.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.CCMP));
- assertTrue(suggestion.wifiConfiguration.requirePmf);
- assertNull(suggestion.wifiConfiguration.preSharedKey);
- // allowedSuiteBCiphers are set according to the loaded certificate and cannot be tested
- // here.
- assertTrue(suggestion.isUserAllowedToManuallyConnect);
- assertTrue(suggestion.isInitialAutoJoinEnabled);
- assertNotNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for WPA3-Enterprise network
- * with 192-bit ECC certificates.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForWpa3EapNetworkWithSuiteBEccCerts() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_SUITE_B_ECDSA_CERT);
- enterpriseConfig.setClientKeyEntryWithCertificateChain(FakeKeys.CLIENT_SUITE_B_ECC_KEY,
- new X509Certificate[] {FakeKeys.CLIENT_SUITE_B_ECDSA_CERT});
-
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa3EnterpriseStandardModeConfig(enterpriseConfig)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.IEEE8021X));
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.WPA_EAP));
- assertFalse(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(suggestion.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.CCMP));
- assertTrue(suggestion.wifiConfiguration.requirePmf);
- assertNull(suggestion.wifiConfiguration.preSharedKey);
- // allowedSuiteBCiphers are set according to the loaded certificate and cannot be tested
- // here.
- assertTrue(suggestion.isUserAllowedToManuallyConnect);
- assertTrue(suggestion.isInitialAutoJoinEnabled);
- assertNotNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for WPA3-Enterprise 192-bit RSA SuiteB network.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForWpa3SuiteBRsaEapNetwork() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_SUITE_B_RSA3072_CERT);
- enterpriseConfig.setClientKeyEntryWithCertificateChain(FakeKeys.CLIENT_SUITE_B_RSA3072_KEY,
- new X509Certificate[] {FakeKeys.CLIENT_SUITE_B_RSA3072_CERT});
-
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa3EnterpriseConfig(enterpriseConfig)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(suggestion.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.GCMP_256));
- assertTrue(suggestion.wifiConfiguration.allowedGroupManagementCiphers
- .get(WifiConfiguration.GroupMgmtCipher.BIP_GMAC_256));
- assertTrue(suggestion.wifiConfiguration.requirePmf);
- assertNull(suggestion.wifiConfiguration.preSharedKey);
- // allowedSuiteBCiphers are set according to the loaded certificate and cannot be tested
- // here.
- assertTrue(suggestion.isUserAllowedToManuallyConnect);
- assertTrue(suggestion.isInitialAutoJoinEnabled);
- assertNotNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for WPA3-Enterprise 192-bit RSA SuiteB network.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForWpa3SuiteBRsaEapNetworWith192BitApi() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_SUITE_B_RSA3072_CERT);
- enterpriseConfig.setClientKeyEntryWithCertificateChain(FakeKeys.CLIENT_SUITE_B_RSA3072_KEY,
- new X509Certificate[] {FakeKeys.CLIENT_SUITE_B_RSA3072_CERT});
-
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa3Enterprise192BitModeConfig(enterpriseConfig)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(suggestion.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.GCMP_256));
- assertTrue(suggestion.wifiConfiguration.allowedGroupManagementCiphers
- .get(WifiConfiguration.GroupMgmtCipher.BIP_GMAC_256));
- assertTrue(suggestion.wifiConfiguration.requirePmf);
- assertNull(suggestion.wifiConfiguration.preSharedKey);
- // allowedSuiteBCiphers are set according to the loaded certificate and cannot be tested
- // here.
- assertTrue(suggestion.isUserAllowedToManuallyConnect);
- assertTrue(suggestion.isInitialAutoJoinEnabled);
- assertNotNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for WPA3-Enterprise 192-bit ECC SuiteB network.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForWpa3SuiteBEccEapNetwork() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_SUITE_B_ECDSA_CERT);
- enterpriseConfig.setClientKeyEntryWithCertificateChain(FakeKeys.CLIENT_SUITE_B_ECC_KEY,
- new X509Certificate[] {FakeKeys.CLIENT_SUITE_B_ECDSA_CERT});
-
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa3EnterpriseConfig(enterpriseConfig)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(suggestion.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.GCMP_256));
- assertTrue(suggestion.wifiConfiguration.allowedGroupManagementCiphers
- .get(WifiConfiguration.GroupMgmtCipher.BIP_GMAC_256));
- assertTrue(suggestion.wifiConfiguration.requirePmf);
- assertNull(suggestion.wifiConfiguration.preSharedKey);
- // allowedSuiteBCiphers are set according to the loaded certificate and cannot be tested
- // here.
- assertTrue(suggestion.isUserAllowedToManuallyConnect);
- assertTrue(suggestion.isInitialAutoJoinEnabled);
- assertNotNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for WPA3-Enterprise 192-bit ECC SuiteB network.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForWpa3SuiteBEccEapNetworkWith192BitApi() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_SUITE_B_ECDSA_CERT);
- enterpriseConfig.setClientKeyEntryWithCertificateChain(FakeKeys.CLIENT_SUITE_B_ECC_KEY,
- new X509Certificate[] {FakeKeys.CLIENT_SUITE_B_ECDSA_CERT});
-
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa3Enterprise192BitModeConfig(enterpriseConfig)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SUITE_B_192));
- assertTrue(suggestion.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.GCMP_256));
- assertTrue(suggestion.wifiConfiguration.allowedGroupManagementCiphers
- .get(WifiConfiguration.GroupMgmtCipher.BIP_GMAC_256));
- assertTrue(suggestion.wifiConfiguration.requirePmf);
- assertNull(suggestion.wifiConfiguration.preSharedKey);
- // allowedSuiteBCiphers are set according to the loaded certificate and cannot be tested
- // here.
- assertTrue(suggestion.isUserAllowedToManuallyConnect);
- assertTrue(suggestion.isInitialAutoJoinEnabled);
- assertNotNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Ensure create enterprise suggestion requires CA, when CA certificate is missing, will throw
- * an exception.
- */
- @Test (expected = IllegalArgumentException.class)
- public void testWifiNetworkSuggestionBuilderForEapNetworkWithoutCa() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.GTC);
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
-
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa2EnterpriseConfig(enterpriseConfig)
- .build();
- }
-
- /**
- * Ensure create enterprise suggestion requires CA, when both domain suffix and alt subject
- * match are missing, will throw an exception.
- */
- @Test (expected = IllegalArgumentException.class)
- public void testWifiNetworkSuggestionBuilderForEapNetworkWithoutMatch() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.GTC);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_CERT0);
-
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa3EnterpriseStandardModeConfig(enterpriseConfig)
- .build();
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for WAPI-PSK network.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForWapiPskNetwork() {
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWapiPassphrase(TEST_PRESHARED_KEY)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.WAPI_PSK));
- assertTrue(suggestion.wifiConfiguration.allowedPairwiseCiphers
- .get(WifiConfiguration.PairwiseCipher.SMS4));
- assertTrue(suggestion.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.SMS4));
- assertEquals("\"" + TEST_PRESHARED_KEY + "\"",
- suggestion.wifiConfiguration.preSharedKey);
- assertNull(suggestion.getEnterpriseConfig());
- }
-
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for WAPI-CERT network.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForWapiCertNetwork() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.WAPI_CERT);
- enterpriseConfig.setWapiCertSuite(TEST_WAPI_CERT_SUITE);
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWapiEnterpriseConfig(enterpriseConfig)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.WAPI_CERT));
- assertTrue(suggestion.wifiConfiguration.allowedPairwiseCiphers
- .get(WifiConfiguration.PairwiseCipher.SMS4));
- assertTrue(suggestion.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.SMS4));
- assertNull(suggestion.wifiConfiguration.preSharedKey);
- assertNotNull(suggestion.wifiConfiguration.enterpriseConfig);
- assertEquals(WifiEnterpriseConfig.Eap.WAPI_CERT,
- suggestion.wifiConfiguration.enterpriseConfig.getEapMethod());
- assertEquals(TEST_WAPI_CERT_SUITE,
- suggestion.wifiConfiguration.enterpriseConfig.getWapiCertSuite());
- assertNotNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for WAPI-CERT network
- * which selects the certificate suite automatically.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForWapiCertAutoNetwork() {
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.WAPI_CERT);
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWapiEnterpriseConfig(enterpriseConfig)
- .build();
-
- assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID);
- assertTrue(suggestion.wifiConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.WAPI_CERT));
- assertTrue(suggestion.wifiConfiguration.allowedPairwiseCiphers
- .get(WifiConfiguration.PairwiseCipher.SMS4));
- assertTrue(suggestion.wifiConfiguration.allowedGroupCiphers
- .get(WifiConfiguration.GroupCipher.SMS4));
- assertNull(suggestion.wifiConfiguration.preSharedKey);
- assertNotNull(suggestion.wifiConfiguration.enterpriseConfig);
- assertEquals(WifiEnterpriseConfig.Eap.WAPI_CERT,
- suggestion.wifiConfiguration.enterpriseConfig.getEapMethod());
- assertEquals("",
- suggestion.wifiConfiguration.enterpriseConfig.getWapiCertSuite());
- assertNotNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Validate correctness of WifiNetworkSuggestion object created by
- * {@link WifiNetworkSuggestion.Builder#build()} for Passpoint network which requires
- * app interaction and metered.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderForPasspointNetworkWithReqAppInteractionMetered() {
- PasspointConfiguration passpointConfiguration = PasspointTestUtils.createConfig();
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setPasspointConfig(passpointConfiguration)
- .setIsAppInteractionRequired(true)
- .setIsMetered(true)
- .build();
- assertEquals(TEST_FQDN, suggestion.wifiConfiguration.FQDN);
- assertTrue(suggestion.isAppInteractionRequired);
- assertEquals(suggestion.wifiConfiguration.meteredOverride,
- WifiConfiguration.METERED_OVERRIDE_METERED);
- assertEquals(suggestion.getPasspointConfig().getMeteredOverride(),
- WifiConfiguration.METERED_OVERRIDE_METERED);
- assertTrue(suggestion.isUserAllowedToManuallyConnect);
- assertNull(suggestion.getEnterpriseConfig());
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#setSsid(String)} throws an exception
- * when the string is not Unicode.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testWifiNetworkSuggestionBuilderSetSsidWithNonUnicodeString() {
- new WifiNetworkSuggestion.Builder()
- .setSsid("\ud800")
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#setWpa2Passphrase(String)} throws an exception
- * when the string is not ASCII encodable.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testWifiNetworkSuggestionBuilderSetWpa2PasphraseWithNonAsciiString() {
- new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa2Passphrase("salvē")
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#setPasspointConfig(PasspointConfiguration)}}
- * throws an exception when the PasspointConfiguration is not valid.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testWifiNetworkSuggestionBuilderSetPasspointConfigWithNonValid() {
- PasspointConfiguration passpointConfiguration = new PasspointConfiguration();
- new WifiNetworkSuggestion.Builder()
- .setPasspointConfig(passpointConfiguration)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when {@link WifiNetworkSuggestion.Builder#setSsid(String)} is not set.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSuggestionBuilderWithNoSsid() {
- new WifiNetworkSuggestion.Builder()
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when {@link WifiNetworkSuggestion.Builder#setSsid(String)} is invoked with an invalid value.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSuggestionBuilderWithInvalidSsid() {
- new WifiNetworkSuggestion.Builder()
- .setSsid("")
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when {@link WifiNetworkSuggestion.Builder#setBssid(MacAddress)} is invoked with an invalid
- * value.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSuggestionBuilderWithInvalidBroadcastBssid() {
- new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setBssid(MacAddress.BROADCAST_ADDRESS)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when {@link WifiNetworkSuggestion.Builder#setBssid(MacAddress)} is invoked with an invalid
- * value.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSuggestionBuilderWithInvalidAllZeroBssid() {
- new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setBssid(WifiManager.ALL_ZEROS_MAC_ADDRESS)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#setPriority(int)} throws an exception
- * when the value is negative.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testWifiNetworkSuggestionBuilderWithInvalidPriority() {
- new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setPriority(-2)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when both {@link WifiNetworkSuggestion.Builder#setWpa2Passphrase(String)} and
- * {@link WifiNetworkSuggestion.Builder#setWpa3Passphrase(String)} are invoked.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSuggestionBuilderWithBothWpa2PasphraseAndWpa3Passphrase() {
- new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa2Passphrase(TEST_PRESHARED_KEY)
- .setWpa3Passphrase(TEST_PRESHARED_KEY)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when both {@link WifiNetworkSuggestion.Builder#setWpa3Passphrase(String)} and
- * {@link WifiNetworkSuggestion.Builder
- * #setWpa3EnterpriseStandardModeConfig(WifiEnterpriseConfig)}
- * are invoked.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSuggestionBuilderWithBothWpa3PasphraseAndEnterprise() {
- new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa3Passphrase(TEST_PRESHARED_KEY)
- .setWpa3EnterpriseStandardModeConfig(new WifiEnterpriseConfig())
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when both {@link WifiNetworkSuggestion.Builder#setWpa3Passphrase(String)} and
- * {@link WifiNetworkSuggestion.Builder#setIsEnhancedOpen(boolean)} are invoked.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSuggestionBuilderWithBothWpa3PasphraseAndEnhancedOpen() {
- new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa3Passphrase(TEST_PRESHARED_KEY)
- .setIsEnhancedOpen(true)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when both {@link WifiNetworkSuggestion.Builder#setSsid(String)} and
- * {@link WifiNetworkSuggestion.Builder#setPasspointConfig(PasspointConfiguration)} are invoked.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSuggestionBuilderWithBothSsidAndPasspointConfig() {
- PasspointConfiguration passpointConfiguration = PasspointTestUtils.createConfig();
- new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setPasspointConfig(passpointConfiguration)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when both {@link WifiNetworkSuggestion.Builder#setWpa2Passphrase(String)} and
- * {@link WifiNetworkSuggestion.Builder#setPasspointConfig(PasspointConfiguration)} are invoked.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSuggestionBuilderWithBothWpa2PassphraseAndPasspointConfig() {
- PasspointConfiguration passpointConfiguration = PasspointTestUtils.createConfig();
- new WifiNetworkSuggestion.Builder()
- .setWpa2Passphrase(TEST_PRESHARED_KEY)
- .setPasspointConfig(passpointConfiguration)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when both {@link WifiNetworkSuggestion.Builder#setWpa3Passphrase(String)} and
- * {@link WifiNetworkSuggestion.Builder#setPasspointConfig(PasspointConfiguration)} are invoked.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSuggestionBuilderWithBothWpa3PassphraseAndPasspointConfig() {
- PasspointConfiguration passpointConfiguration = PasspointTestUtils.createConfig();
- new WifiNetworkSuggestion.Builder()
- .setWpa3Passphrase(TEST_PRESHARED_KEY)
- .setPasspointConfig(passpointConfiguration)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when both
- * {@link WifiNetworkSuggestion.Builder
- * #setWpa3EnterpriseStandardModeConfig(WifiEnterpriseConfig)}
- * and {@link WifiNetworkSuggestion.Builder#setPasspointConfig(PasspointConfiguration)} are
- * invoked.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSuggestionBuilderWithBothEnterpriseAndPasspointConfig() {
- PasspointConfiguration passpointConfiguration = PasspointTestUtils.createConfig();
- new WifiNetworkSuggestion.Builder()
- .setWpa3EnterpriseStandardModeConfig(new WifiEnterpriseConfig())
- .setPasspointConfig(passpointConfiguration)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when both {@link WifiNetworkSuggestion.Builder#setIsEnhancedOpen(boolean)} and
- * {@link WifiNetworkSuggestion.Builder#setPasspointConfig(PasspointConfiguration)} are invoked.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSuggestionBuilderWithBothEnhancedOpenAndPasspointConfig() {
- PasspointConfiguration passpointConfiguration = PasspointTestUtils.createConfig();
- new WifiNetworkSuggestion.Builder()
- .setIsEnhancedOpen(true)
- .setPasspointConfig(passpointConfiguration)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when both {@link WifiNetworkSuggestion.Builder#setIsHiddenSsid(boolean)} and
- * {@link WifiNetworkSuggestion.Builder#setPasspointConfig(PasspointConfiguration)} are invoked.
- */
- @Test(expected = IllegalStateException.class)
- public void testWifiNetworkSuggestionBuilderWithBothHiddenSsidAndPasspointConfig() {
- PasspointConfiguration passpointConfiguration = PasspointTestUtils.createConfig();
- new WifiNetworkSuggestion.Builder()
- .setIsHiddenSsid(true)
- .setPasspointConfig(passpointConfiguration)
- .build();
- }
-
- /**
- * Verify that the macRandomizationSetting defaults to RANDOMIZATION_PERSISTENT and could be set
- * to RANDOMIZATION_ENHANCED.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderSetMacRandomization() {
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .build();
- assertEquals(WifiConfiguration.RANDOMIZATION_PERSISTENT,
- suggestion.wifiConfiguration.macRandomizationSetting);
-
- suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setIsEnhancedMacRandomizationEnabled(false)
- .build();
- assertEquals(WifiConfiguration.RANDOMIZATION_PERSISTENT,
- suggestion.wifiConfiguration.macRandomizationSetting);
-
- suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setIsEnhancedMacRandomizationEnabled(true)
- .build();
- assertEquals(WifiConfiguration.RANDOMIZATION_ENHANCED,
- suggestion.wifiConfiguration.macRandomizationSetting);
- }
-
- /**
- * Verify that the builder creates the appropriate PasspointConfiguration according to the
- * enhanced MAC randomization setting.
- */
- @Test
- public void testWifiNetworkSuggestionBuilderSetMacRandomizationPasspoint() {
- PasspointConfiguration passpointConfiguration = PasspointTestUtils.createConfig();
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setPasspointConfig(passpointConfiguration)
- .build();
- assertEquals(false, suggestion.passpointConfiguration.isEnhancedMacRandomizationEnabled());
-
- suggestion = new WifiNetworkSuggestion.Builder()
- .setPasspointConfig(passpointConfiguration)
- .setIsEnhancedMacRandomizationEnabled(false)
- .build();
- assertEquals(false, suggestion.passpointConfiguration.isEnhancedMacRandomizationEnabled());
-
- suggestion = new WifiNetworkSuggestion.Builder()
- .setPasspointConfig(passpointConfiguration)
- .setIsEnhancedMacRandomizationEnabled(true)
- .build();
- assertEquals(true, suggestion.passpointConfiguration.isEnhancedMacRandomizationEnabled());
- }
-
- /**
- * Verify that the builder creates the appropriate SIM credential suggestion with SubId, also
- * verify {@link WifiNetworkSuggestion#equals(Object)} consider suggestion with different SubId
- * as different suggestions.
- */
- @Test
- public void testSimCredentialNetworkWithSubId() {
- assumeTrue(SdkLevel.isAtLeastS());
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.SIM);
- enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.NONE);
- WifiNetworkSuggestion suggestion1 = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa2EnterpriseConfig(enterpriseConfig)
- .setSubscriptionId(1)
- .build();
- assertEquals(1, suggestion1.getSubscriptionId());
- WifiNetworkSuggestion suggestion2 = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa2EnterpriseConfig(enterpriseConfig)
- .setSubscriptionId(2)
- .build();
- assertEquals(2, suggestion2.getSubscriptionId());
- assertNotEquals(suggestion1, suggestion2);
- }
-
- /**
- * Check that parcel marshalling/unmarshalling works
- */
- @Test
- public void testWifiNetworkSuggestionParcel() {
- WifiConfiguration configuration = new WifiConfiguration();
- configuration.SSID = TEST_SSID;
- configuration.BSSID = TEST_BSSID;
- configuration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion(
- configuration, null, false, true, true, true, TEST_PRIORITY_GROUP);
-
- Parcel parcelW = Parcel.obtain();
- suggestion.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- WifiNetworkSuggestion parcelSuggestion =
- WifiNetworkSuggestion.CREATOR.createFromParcel(parcelR);
-
- // Two suggestion objects are considered equal if they point to the same network (i.e same
- // SSID + keyMgmt + same UID). |isAppInteractionRequired| & |isUserInteractionRequired| are
- // not considered for equality and hence needs to be checked for explicitly below.
- assertEquals(suggestion, parcelSuggestion);
- assertEquals(suggestion.hashCode(), parcelSuggestion.hashCode());
- assertEquals(suggestion.isAppInteractionRequired,
- parcelSuggestion.isAppInteractionRequired);
- assertEquals(suggestion.isUserInteractionRequired,
- parcelSuggestion.isUserInteractionRequired);
- assertEquals(suggestion.isInitialAutoJoinEnabled,
- parcelSuggestion.isInitialAutoJoinEnabled);
- }
-
- /**
- * Check that parcel marshalling/unmarshalling works
- */
- @Test
- public void testPasspointNetworkSuggestionParcel() {
- PasspointConfiguration passpointConfiguration = PasspointTestUtils.createConfig();
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setPasspointConfig(passpointConfiguration)
- .build();
-
- Parcel parcelW = Parcel.obtain();
- suggestion.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- WifiNetworkSuggestion parcelSuggestion =
- WifiNetworkSuggestion.CREATOR.createFromParcel(parcelR);
-
- // Two suggestion objects are considered equal if they point to the same network (i.e same
- // SSID + keyMgmt + same UID). |isAppInteractionRequired| & |isUserInteractionRequired| are
- // not considered for equality and hence needs to be checked for explicitly below.
- assertEquals(suggestion, parcelSuggestion);
- assertEquals(suggestion.hashCode(), parcelSuggestion.hashCode());
- assertEquals(suggestion.isAppInteractionRequired,
- parcelSuggestion.isAppInteractionRequired);
- assertEquals(suggestion.isUserInteractionRequired,
- parcelSuggestion.isUserInteractionRequired);
- assertEquals(suggestion.isInitialAutoJoinEnabled,
- parcelSuggestion.isInitialAutoJoinEnabled);
- }
-
- /**
- * Check NetworkSuggestion equals returns {@code true} for 2 network suggestions with the same
- * SSID, BSSID, key mgmt and UID.
- */
- @Test
- public void testWifiNetworkSuggestionEqualsSame() {
- WifiConfiguration configuration = new WifiConfiguration();
- configuration.SSID = TEST_SSID;
- configuration.BSSID = TEST_BSSID;
- configuration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
- WifiNetworkSuggestion suggestion =
- new WifiNetworkSuggestion(configuration, null, true, false, true, true,
- TEST_PRIORITY_GROUP);
-
- WifiConfiguration configuration1 = new WifiConfiguration();
- configuration1.SSID = TEST_SSID;
- configuration1.BSSID = TEST_BSSID;
- configuration1.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
- WifiNetworkSuggestion suggestion1 =
- new WifiNetworkSuggestion(configuration1, null, false, true, true, true,
- DEFAULT_PRIORITY_GROUP);
-
- assertEquals(suggestion, suggestion1);
- assertEquals(suggestion.hashCode(), suggestion1.hashCode());
- }
-
- /**
- * Check NetworkSuggestion equals returns {@code false} for 2 network suggestions with the same
- * BSSID, key mgmt and UID, but different SSID.
- */
- @Test
- public void testWifiNetworkSuggestionEqualsFailsWhenSsidIsDifferent() {
- WifiConfiguration configuration = new WifiConfiguration();
- configuration.SSID = TEST_SSID;
- configuration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
- WifiNetworkSuggestion suggestion =
- new WifiNetworkSuggestion(configuration, null, false, false, true, true,
- DEFAULT_PRIORITY_GROUP);
-
- WifiConfiguration configuration1 = new WifiConfiguration();
- configuration1.SSID = TEST_SSID_1;
- configuration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
- WifiNetworkSuggestion suggestion1 =
- new WifiNetworkSuggestion(configuration1, null, false, false, true, true,
- DEFAULT_PRIORITY_GROUP);
-
- assertNotEquals(suggestion, suggestion1);
- }
-
- /**
- * Check NetworkSuggestion equals returns {@code false} for 2 network suggestions with the same
- * SSID, key mgmt and UID, but different BSSID.
- */
- @Test
- public void testWifiNetworkSuggestionEqualsFailsWhenBssidIsDifferent() {
- WifiConfiguration configuration = new WifiConfiguration();
- configuration.SSID = TEST_SSID;
- configuration.BSSID = TEST_BSSID;
- configuration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
- WifiNetworkSuggestion suggestion =
- new WifiNetworkSuggestion(configuration, null, false, false, true, true,
- DEFAULT_PRIORITY_GROUP);
-
- WifiConfiguration configuration1 = new WifiConfiguration();
- configuration1.SSID = TEST_SSID;
- configuration1.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
- WifiNetworkSuggestion suggestion1 =
- new WifiNetworkSuggestion(configuration1, null, false, false, true, true,
- DEFAULT_PRIORITY_GROUP);
-
- assertNotEquals(suggestion, suggestion1);
- }
-
- /**
- * Check NetworkSuggestion equals returns {@code false} for 2 network suggestions with the same
- * SSID, BSSID and UID, but different key mgmt.
- */
- @Test
- public void testWifiNetworkSuggestionEqualsFailsWhenKeyMgmtIsDifferent() {
- WifiConfiguration configuration = new WifiConfiguration();
- configuration.SSID = TEST_SSID;
- configuration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
- WifiNetworkSuggestion suggestion =
- new WifiNetworkSuggestion(configuration, null, false, false, true, true,
- DEFAULT_PRIORITY_GROUP);
-
- WifiConfiguration configuration1 = new WifiConfiguration();
- configuration1.SSID = TEST_SSID;
- configuration1.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
- WifiNetworkSuggestion suggestion1 =
- new WifiNetworkSuggestion(configuration1, null, false, false, true, true,
- DEFAULT_PRIORITY_GROUP);
-
- assertNotEquals(suggestion, suggestion1);
- }
-
- /**
- * Check NetworkSuggestion equals returns {@code true} for 2 Passpoint network suggestions with
- * same FQDN.
- */
- @Test
- public void testPasspointNetworkSuggestionEqualsSameWithSameFQDN() {
- PasspointConfiguration passpointConfiguration = PasspointTestUtils.createConfig();
- PasspointConfiguration passpointConfiguration1 = PasspointTestUtils.createConfig();
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setPasspointConfig(passpointConfiguration)
- .build();
- WifiNetworkSuggestion suggestion1 = new WifiNetworkSuggestion.Builder()
- .setPasspointConfig(passpointConfiguration1)
- .build();
- assertEquals(suggestion, suggestion1);
- assertEquals(suggestion.hashCode(), suggestion1.hashCode());
- }
-
- /**
- * Check NetworkSuggestion equals returns {@code false} for 2 Passpoint network suggestions with
- * different FQDN.
- */
- @Test
- public void testPasspointNetworkSuggestionNotEqualsSameWithDifferentFQDN() {
- PasspointConfiguration passpointConfiguration = PasspointTestUtils.createConfig();
- PasspointConfiguration passpointConfiguration1 = PasspointTestUtils.createConfig();
- passpointConfiguration1.getHomeSp().setFqdn(TEST_FQDN + 1);
-
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setPasspointConfig(passpointConfiguration)
- .build();
- WifiNetworkSuggestion suggestion1 = new WifiNetworkSuggestion.Builder()
- .setPasspointConfig(passpointConfiguration1)
- .build();
- assertNotEquals(suggestion, suggestion1);
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when {@link WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)} to
- * true on a open network suggestion.
- */
- @Test(expected = IllegalStateException.class)
- public void testSetCredentialSharedWithUserWithOpenNetwork() {
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setCredentialSharedWithUser(true)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when {@link WifiNetworkSuggestion.Builder#setIsInitialAutojoinEnabled(boolean)} to
- * false on a open network suggestion.
- */
- @Test(expected = IllegalStateException.class)
- public void testSetIsAutoJoinDisabledWithOpenNetwork() {
- new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setIsInitialAutojoinEnabled(false)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when set both {@link WifiNetworkSuggestion.Builder#setIsInitialAutojoinEnabled(boolean)}
- * and {@link WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)} (boolean)}
- * to false on a network suggestion.
- */
- @Test(expected = IllegalStateException.class)
- public void testSetIsAutoJoinDisabledWithSecureNetworkNotSharedWithUser() {
- new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa2Passphrase(TEST_PRESHARED_KEY)
- .setCredentialSharedWithUser(false)
- .setIsInitialAutojoinEnabled(false)
- .build();
- }
-
- /**
- * Validate {@link WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)} set the
- * correct value to the WifiConfiguration.
- */
- @Test
- public void testSetIsNetworkAsUntrusted() {
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa2Passphrase(TEST_PRESHARED_KEY)
- .setUntrusted(true)
- .build();
- assertTrue(suggestion.isUntrusted());
- assertFalse(suggestion.isUserAllowedToManuallyConnect);
- }
-
- /**
- * Validate {@link WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)} set the
- * correct value to the WifiConfiguration.
- * Also the {@link WifiNetworkSuggestion#isUserAllowedToManuallyConnect} should be false;
- */
- @Test
- public void testSetIsNetworkAsUntrustedOnPasspointNetwork() {
- PasspointConfiguration passpointConfiguration = PasspointTestUtils.createConfig();
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setPasspointConfig(passpointConfiguration)
- .setUntrusted(true)
- .build();
- assertTrue(suggestion.isUntrusted());
- assertFalse(suggestion.isUserAllowedToManuallyConnect);
- }
-
- /**
- * Validate {@link WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)} set the
- * correct value to the WifiConfiguration.
- */
- @Test
- public void testSetIsNetworkAsOemPaid() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa2Passphrase(TEST_PRESHARED_KEY)
- .setOemPaid(true)
- .build();
- assertTrue(suggestion.isOemPaid());
- assertFalse(suggestion.isUserAllowedToManuallyConnect);
- }
-
- /**
- * Validate {@link WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)} set the
- * correct value to the WifiConfiguration.
- * Also the {@link WifiNetworkSuggestion#isUserAllowedToManuallyConnect} should be false;
- */
- @Test
- public void testSetIsNetworkAsOemPaidOnPasspointNetwork() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- PasspointConfiguration passpointConfiguration = PasspointTestUtils.createConfig();
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setPasspointConfig(passpointConfiguration)
- .setOemPaid(true)
- .build();
- assertTrue(suggestion.isOemPaid());
- assertFalse(suggestion.isUserAllowedToManuallyConnect);
- assertTrue(suggestion.getPasspointConfig().isOemPaid());
- }
-
- /**
- * Validate {@link WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)} set the
- * correct value to the WifiConfiguration.
- */
- @Test
- public void testSetIsNetworkAsOemPrivate() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa2Passphrase(TEST_PRESHARED_KEY)
- .setOemPrivate(true)
- .build();
- assertTrue(suggestion.isOemPrivate());
- assertFalse(suggestion.isUserAllowedToManuallyConnect);
- }
-
- /**
- * Validate {@link WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)} set the
- * correct value to the WifiConfiguration.
- * Also the {@link WifiNetworkSuggestion#isUserAllowedToManuallyConnect} should be false;
- */
- @Test
- public void testSetIsNetworkAsOemPrivateOnPasspointNetwork() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- PasspointConfiguration passpointConfiguration = PasspointTestUtils.createConfig();
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setPasspointConfig(passpointConfiguration)
- .setOemPrivate(true)
- .build();
- assertTrue(suggestion.isOemPrivate());
- assertFalse(suggestion.isUserAllowedToManuallyConnect);
- assertTrue(suggestion.getPasspointConfig().isOemPrivate());
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when set {@link WifiNetworkSuggestion.Builder#setUntrusted(boolean)} to true and
- * set {@link WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)} to true
- * together.
- */
- @Test(expected = IllegalStateException.class)
- public void testSetCredentialSharedWithUserWithSetIsNetworkAsUntrusted() {
- new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa2Passphrase(TEST_PRESHARED_KEY)
- .setCredentialSharedWithUser(true)
- .setUntrusted(true)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when set {@link WifiNetworkSuggestion.Builder#setOemPaid(boolean)} to true and
- * set {@link WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)} to true
- * together.
- */
- @Test(expected = IllegalStateException.class)
- public void testSetCredentialSharedWithUserWithSetIsNetworkAsOemPaid() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa2Passphrase(TEST_PRESHARED_KEY)
- .setCredentialSharedWithUser(true)
- .setOemPaid(true)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when set {@link WifiNetworkSuggestion.Builder#setOemPrivate(boolean)} to true and
- * set {@link WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)} to true
- * together.
- */
- @Test(expected = IllegalStateException.class)
- public void testSetCredentialSharedWithUserWithSetIsNetworkAsOemPrivate() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa2Passphrase(TEST_PRESHARED_KEY)
- .setCredentialSharedWithUser(true)
- .setOemPrivate(true)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when set both {@link WifiNetworkSuggestion.Builder#setIsInitialAutojoinEnabled(boolean)}
- * and {@link WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)} (boolean)}
- * to false on a passpoint suggestion.
- */
- @Test(expected = IllegalStateException.class)
- public void testSetIsAutoJoinDisabledWithSecureNetworkNotSharedWithUserForPasspoint() {
- PasspointConfiguration passpointConfiguration = PasspointTestUtils.createConfig();
- new WifiNetworkSuggestion.Builder()
- .setPasspointConfig(passpointConfiguration)
- .setCredentialSharedWithUser(false)
- .setIsInitialAutojoinEnabled(false)
- .build();
- }
-
- /**
- * Validate {@link WifiNetworkSuggestion.Builder#setCarrierMerged(boolean)} (boolean)} set the
- * correct value to the WifiConfiguration.
- */
- @Test
- public void testSetCarrierMergedNetwork() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_CERT0);
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setSubscriptionId(1)
- .setWpa2EnterpriseConfig(enterpriseConfig)
- .setCarrierMerged(true)
- .setIsMetered(true)
- .build();
- assertTrue(suggestion.isCarrierMerged());
- assertTrue(suggestion.wifiConfiguration.carrierMerged);
- }
-
- /**
- * Validate {@link WifiNetworkSuggestion.Builder#setCarrierMerged(boolean)} (boolean)} set the
- * correct value to the passpoint network.
- */
- @Test
- public void testSetCarrierMergedNetworkOnPasspointNetwork() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- PasspointConfiguration passpointConfiguration = PasspointTestUtils.createConfig();
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setPasspointConfig(passpointConfiguration)
- .setSubscriptionId(1)
- .setCarrierMerged(true)
- .setIsMetered(true)
- .build();
- assertTrue(suggestion.isCarrierMerged());
- assertTrue(suggestion.getPasspointConfig().isCarrierMerged());
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when set both {@link WifiNetworkSuggestion.Builder#setCarrierMerged(boolean)} (boolean)}
- * to true on a network is not metered.
- */
- @Test(expected = IllegalStateException.class)
- public void testSetCarrierMergedNetworkOnUnmeteredNetworkFail() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_CERT0);
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
- new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setSubscriptionId(1)
- .setWpa2EnterpriseConfig(enterpriseConfig)
- .setCarrierMerged(true)
- .build();
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when set both {@link WifiNetworkSuggestion.Builder#setCarrierMerged(boolean)} (boolean)}
- * to true on a network which {@link WifiNetworkSuggestion.Builder#setSubscriptionId(int)}
- * is not set with a valid sub id.
- */
- @Test(expected = IllegalStateException.class)
- public void testSetCarrierMergedNetworkWithoutValidSubscriptionIdFail() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS);
- enterpriseConfig.setCaCertificate(FakeKeys.CA_CERT0);
- enterpriseConfig.setDomainSuffixMatch(TEST_DOMAIN_SUFFIX_MATCH);
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setWpa2EnterpriseConfig(enterpriseConfig)
- .setCarrierMerged(true)
- .setIsMetered(true)
- .build();
- assertTrue(suggestion.isCarrierMerged());
- }
-
- /**
- * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception
- * when set both {@link WifiNetworkSuggestion.Builder#setCarrierMerged(boolean)} (boolean)}
- * to true on a non enterprise network.
- */
- @Test(expected = IllegalStateException.class)
- public void testSetCarrierMergedNetworkWithNonEnterpriseNetworkFail() {
- assumeTrue(SdkLevel.isAtLeastS());
-
- WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder()
- .setSsid(TEST_SSID)
- .setSubscriptionId(1)
- .setWpa2Passphrase(TEST_PRESHARED_KEY)
- .setCarrierMerged(true)
- .setIsMetered(true)
- .build();
- assertTrue(suggestion.isCarrierMerged());
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/WifiScannerTest.java b/wifi/tests/src/android/net/wifi/WifiScannerTest.java
deleted file mode 100644
index b68616f..0000000
--- a/wifi/tests/src/android/net/wifi/WifiScannerTest.java
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
- * Copyright (C) 2016 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.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.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.validateMockitoUsage;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.content.Context;
-import android.net.wifi.WifiScanner.PnoSettings;
-import android.net.wifi.WifiScanner.PnoSettings.PnoNetwork;
-import android.net.wifi.WifiScanner.ScanData;
-import android.net.wifi.WifiScanner.ScanListener;
-import android.net.wifi.WifiScanner.ScanSettings;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
-import android.os.Messenger;
-import android.os.Parcel;
-import android.os.test.TestLooper;
-
-import androidx.test.filters.SmallTest;
-
-import com.android.internal.util.test.BidirectionalAsyncChannelServer;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.mockito.Spy;
-
-import java.util.Arrays;
-import java.util.concurrent.Executor;
-
-/**
- * Unit tests for {@link android.net.wifi.WifiScanner}.
- */
-@SmallTest
-public class WifiScannerTest {
- @Mock
- private Context mContext;
- @Mock
- private IWifiScanner mService;
- @Spy
- private Executor mExecutor = new SynchronousExecutor();
- @Mock
- private ScanListener mScanListener;
- @Mock
- private WifiScanner.ParcelableScanData mParcelableScanData;
- private ScanData[] mScanData = {};
-
- private static final boolean TEST_PNOSETTINGS_IS_CONNECTED = false;
- private static final int TEST_PNOSETTINGS_MIN_5GHZ_RSSI = -60;
- private static final int TEST_PNOSETTINGS_MIN_2GHZ_RSSI = -70;
- private static final int TEST_PNOSETTINGS_MIN_6GHZ_RSSI = -55;
- private static final String TEST_SSID_1 = "TEST1";
- private static final String TEST_SSID_2 = "TEST2";
- private static final int[] TEST_FREQUENCIES_1 = {};
- private static final int[] TEST_FREQUENCIES_2 = {2500, 5124, 6245};
- private static final String DESCRIPTION_NOT_AUTHORIZED = "Not authorized";
-
- private WifiScanner mWifiScanner;
- private TestLooper mLooper;
- private Handler mHandler;
- private BidirectionalAsyncChannelServer mBidirectionalAsyncChannelServer;
-
- /**
- * Setup before tests.
- */
- @Before
- public void setUp() throws Exception {
- MockitoAnnotations.initMocks(this);
- mLooper = new TestLooper();
- mHandler = spy(new Handler(mLooper.getLooper()));
- mBidirectionalAsyncChannelServer = new BidirectionalAsyncChannelServer(
- mContext, mLooper.getLooper(), mHandler);
- when(mService.getMessenger()).thenReturn(mBidirectionalAsyncChannelServer.getMessenger());
- mWifiScanner = new WifiScanner(mContext, mService, mLooper.getLooper());
- mLooper.dispatchAll();
- when(mParcelableScanData.getResults()).thenReturn(mScanData);
- }
-
- /**
- * Clean up after tests.
- */
- @After
- public void cleanup() {
- validateMockitoUsage();
- }
-
- /**
- * Verify parcel read/write for ScanSettings.
- */
- @Test
- public void verifyScanSettingsParcelWithBand() throws Exception {
- ScanSettings writeSettings = new ScanSettings();
- writeSettings.type = WifiScanner.SCAN_TYPE_LOW_POWER;
- writeSettings.band = WifiScanner.WIFI_BAND_BOTH_WITH_DFS;
-
- ScanSettings readSettings = parcelWriteRead(writeSettings);
- assertEquals(readSettings.type, writeSettings.type);
- assertEquals(readSettings.band, writeSettings.band);
- assertEquals(0, readSettings.channels.length);
- }
-
- /**
- * Verify parcel read/write for ScanSettings.
- */
- @Test
- public void verifyScanSettingsParcelWithChannels() throws Exception {
- ScanSettings writeSettings = new ScanSettings();
- writeSettings.type = WifiScanner.SCAN_TYPE_HIGH_ACCURACY;
- writeSettings.band = WifiScanner.WIFI_BAND_UNSPECIFIED;
- writeSettings.channels = new WifiScanner.ChannelSpec[] {
- new WifiScanner.ChannelSpec(5),
- new WifiScanner.ChannelSpec(7)
- };
-
- ScanSettings readSettings = parcelWriteRead(writeSettings);
- assertEquals(writeSettings.type, readSettings.type);
- assertEquals(writeSettings.band, readSettings.band);
- assertEquals(2, readSettings.channels.length);
- assertEquals(5, readSettings.channels[0].frequency);
- assertEquals(7, readSettings.channels[1].frequency);
- }
-
- /**
- * Write the provided {@link ScanSettings} to a parcel and deserialize it.
- */
- private static ScanSettings parcelWriteRead(ScanSettings writeSettings) throws Exception {
- Parcel parcel = Parcel.obtain();
- writeSettings.writeToParcel(parcel, 0);
- parcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- return ScanSettings.CREATOR.createFromParcel(parcel);
- }
-
- /**
- * PnoSettings object can be serialized and deserialized, while keeping the
- * values unchanged.
- */
- @Test
- public void canSerializeAndDeserializePnoSettings() throws Exception {
-
- PnoSettings pnoSettings = new PnoSettings();
-
- PnoNetwork pnoNetwork1 = new PnoNetwork(TEST_SSID_1);
- PnoNetwork pnoNetwork2 = new PnoNetwork(TEST_SSID_2);
- pnoNetwork1.frequencies = TEST_FREQUENCIES_1;
- pnoNetwork2.frequencies = TEST_FREQUENCIES_2;
-
- pnoSettings.networkList = new PnoNetwork[]{pnoNetwork1, pnoNetwork2};
- pnoSettings.isConnected = TEST_PNOSETTINGS_IS_CONNECTED;
- pnoSettings.min5GHzRssi = TEST_PNOSETTINGS_MIN_5GHZ_RSSI;
- pnoSettings.min24GHzRssi = TEST_PNOSETTINGS_MIN_2GHZ_RSSI;
- pnoSettings.min6GHzRssi = TEST_PNOSETTINGS_MIN_6GHZ_RSSI;
-
- Parcel parcel = Parcel.obtain();
- pnoSettings.writeToParcel(parcel, 0);
- // Rewind the pointer to the head of the parcel.
- parcel.setDataPosition(0);
- PnoSettings pnoSettingsDeserialized =
- pnoSettings.CREATOR.createFromParcel(parcel);
-
- assertNotNull(pnoSettingsDeserialized);
- assertEquals(TEST_PNOSETTINGS_IS_CONNECTED, pnoSettingsDeserialized.isConnected);
- assertEquals(TEST_PNOSETTINGS_MIN_5GHZ_RSSI, pnoSettingsDeserialized.min5GHzRssi);
- assertEquals(TEST_PNOSETTINGS_MIN_2GHZ_RSSI, pnoSettingsDeserialized.min24GHzRssi);
- assertEquals(TEST_PNOSETTINGS_MIN_6GHZ_RSSI, pnoSettingsDeserialized.min6GHzRssi);
-
- // Test parsing of PnoNetwork
- assertEquals(pnoSettings.networkList.length, pnoSettingsDeserialized.networkList.length);
- for (int i = 0; i < pnoSettings.networkList.length; i++) {
- PnoNetwork expected = pnoSettings.networkList[i];
- PnoNetwork actual = pnoSettingsDeserialized.networkList[i];
- assertEquals(expected.ssid, actual.ssid);
- assertEquals(expected.flags, actual.flags);
- assertEquals(expected.authBitField, actual.authBitField);
- assertTrue(Arrays.equals(expected.frequencies, actual.frequencies));
- }
- }
-
- /**
- * Make sure that frequencies is not null by default.
- */
- @Test
- public void pnoNetworkFrequencyIsNotNull() throws Exception {
- PnoNetwork pnoNetwork = new PnoNetwork(TEST_SSID_1);
- assertNotNull(pnoNetwork.frequencies);
- }
-
- /**
- * Verify parcel read/write for ScanData.
- */
- @Test
- public void verifyScanDataParcel() throws Exception {
- ScanData writeScanData = new ScanData(2, 0, 3,
- WifiScanner.WIFI_BAND_BOTH_WITH_DFS, new ScanResult[0]);
-
- ScanData readScanData = parcelWriteRead(writeScanData);
- assertEquals(writeScanData.getId(), readScanData.getId());
- assertEquals(writeScanData.getFlags(), readScanData.getFlags());
- assertEquals(writeScanData.getBucketsScanned(), readScanData.getBucketsScanned());
- assertEquals(writeScanData.getBandScanned(), readScanData.getBandScanned());
- assertArrayEquals(writeScanData.getResults(), readScanData.getResults());
- }
-
- /**
- * Write the provided {@link ScanData} to a parcel and deserialize it.
- */
- private static ScanData parcelWriteRead(ScanData writeScanData) throws Exception {
- Parcel parcel = Parcel.obtain();
- writeScanData.writeToParcel(parcel, 0);
- parcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- return ScanData.CREATOR.createFromParcel(parcel);
- }
-
-
- /**
- * Test behavior of {@link WifiScanner#startScan(ScanSettings, ScanListener)}
- * @throws Exception
- */
- @Test
- public void testStartScan() throws Exception {
- ScanSettings scanSettings = new ScanSettings();
- ScanListener scanListener = mock(ScanListener.class);
-
- mWifiScanner.startScan(scanSettings, scanListener);
- mLooper.dispatchAll();
-
- ArgumentCaptor<Message> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class);
- verify(mHandler).handleMessage(messageArgumentCaptor.capture());
- Message message = messageArgumentCaptor.getValue();
- assertNotNull(message);
-
- assertEquals(WifiScanner.CMD_START_SINGLE_SCAN, message.what);
- assertTrue(message.obj instanceof Bundle);
- Bundle messageBundle = (Bundle) message.obj;
- assertEquals(scanSettings,
- messageBundle.getParcelable(WifiScanner.SCAN_PARAMS_SCAN_SETTINGS_KEY));
- assertNull(messageBundle.getParcelable(WifiScanner.SCAN_PARAMS_WORK_SOURCE_KEY));
- assertEquals(mContext.getOpPackageName(),
- messageBundle.getParcelable(WifiScanner.REQUEST_PACKAGE_NAME_KEY));
- assertEquals(mContext.getAttributionTag(),
- messageBundle.getParcelable(WifiScanner.REQUEST_FEATURE_ID_KEY));
-
- }
-
- /**
- * Test behavior of {@link WifiScanner#stopScan(ScanListener)}
- * @throws Exception
- */
- @Test
- public void testStopScan() throws Exception {
- ScanSettings scanSettings = new ScanSettings();
- ScanListener scanListener = mock(ScanListener.class);
-
- mWifiScanner.startScan(scanSettings, scanListener);
- mLooper.dispatchAll();
-
- mWifiScanner.stopScan(scanListener);
- mLooper.dispatchAll();
-
- ArgumentCaptor<Message> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class);
- verify(mHandler, times(2)).handleMessage(messageArgumentCaptor.capture());
- Message message = messageArgumentCaptor.getValue();
- assertNotNull(message);
-
- assertEquals(WifiScanner.CMD_STOP_SINGLE_SCAN, message.what);
- assertTrue(message.obj instanceof Bundle);
- Bundle messageBundle = (Bundle) message.obj;
- assertEquals(mContext.getOpPackageName(),
- messageBundle.getParcelable(WifiScanner.REQUEST_PACKAGE_NAME_KEY));
- assertEquals(mContext.getAttributionTag(),
- messageBundle.getParcelable(WifiScanner.REQUEST_FEATURE_ID_KEY));
- }
-
- /**
- * Test behavior of {@link WifiScanner#startScan(ScanSettings, ScanListener)}
- * @throws Exception
- */
- @Test
- public void testStartScanListenerOnSuccess() throws Exception {
- ScanSettings scanSettings = new ScanSettings();
- ScanListener scanListener = mock(ScanListener.class);
-
- mWifiScanner.startScan(scanSettings, scanListener);
- mLooper.dispatchAll();
-
- ArgumentCaptor<Message> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class);
- verify(mHandler).handleMessage(messageArgumentCaptor.capture());
- Message sentMessage = messageArgumentCaptor.getValue();
- assertNotNull(sentMessage);
-
- assertEquals(1, mBidirectionalAsyncChannelServer.getClientMessengers().size());
- Messenger scannerMessenger =
- mBidirectionalAsyncChannelServer.getClientMessengers().iterator().next();
-
- Message responseMessage = Message.obtain();
- responseMessage.what = WifiScanner.CMD_OP_SUCCEEDED;
- responseMessage.arg2 = sentMessage.arg2;
- scannerMessenger.send(responseMessage);
- mLooper.dispatchAll();
-
- verify(scanListener).onSuccess();
- }
-
- /**
- * Test behavior of {@link WifiScanner#startScan(ScanSettings, ScanListener)}
- * @throws Exception
- */
- @Test
- public void testStartScanListenerOnResults() throws Exception {
- ScanSettings scanSettings = new ScanSettings();
- ScanListener scanListener = mock(ScanListener.class);
-
- mWifiScanner.startScan(scanSettings, scanListener);
- mLooper.dispatchAll();
-
- ArgumentCaptor<Message> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class);
- verify(mHandler).handleMessage(messageArgumentCaptor.capture());
- Message sentMessage = messageArgumentCaptor.getValue();
- assertNotNull(sentMessage);
-
- assertEquals(1, mBidirectionalAsyncChannelServer.getClientMessengers().size());
- Messenger scannerMessenger =
- mBidirectionalAsyncChannelServer.getClientMessengers().iterator().next();
-
- ScanResult scanResult = new ScanResult();
- ScanData scanDatas[] = new ScanData[]{new ScanData(0, 0 , new ScanResult[] {scanResult})};
- Message responseMessage = Message.obtain();
- responseMessage.what = WifiScanner.CMD_SCAN_RESULT;
- responseMessage.arg2 = sentMessage.arg2;
- responseMessage.obj = new WifiScanner.ParcelableScanData(scanDatas);
- scannerMessenger.send(responseMessage);
- mLooper.dispatchAll();
-
- verify(scanListener).onResults(scanDatas);
- }
-
- /**
- * Test behavior of {@link WifiScanner#startDisconnectedPnoScan(ScanSettings, PnoSettings,
- * Executor, WifiScanner.PnoScanListener)}
- * @throws Exception
- */
- @Test
- public void testStartDisconnectedPnoScan() throws Exception {
- ScanSettings scanSettings = new ScanSettings();
- PnoSettings pnoSettings = new PnoSettings();
- WifiScanner.PnoScanListener pnoScanListener = mock(WifiScanner.PnoScanListener.class);
-
- mWifiScanner.startDisconnectedPnoScan(
- scanSettings, pnoSettings, mock(Executor.class), pnoScanListener);
- mLooper.dispatchAll();
-
- ArgumentCaptor<Message> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class);
- verify(mHandler).handleMessage(messageArgumentCaptor.capture());
- Message message = messageArgumentCaptor.getValue();
- assertNotNull(message);
-
- assertEquals(WifiScanner.CMD_START_PNO_SCAN, message.what);
- assertTrue(message.obj instanceof Bundle);
- Bundle messageBundle = (Bundle) message.obj;
- assertEquals(scanSettings,
- messageBundle.getParcelable(WifiScanner.PNO_PARAMS_SCAN_SETTINGS_KEY));
- assertTrue(scanSettings.isPnoScan);
- assertFalse(pnoSettings.isConnected);
- assertEquals(pnoSettings,
- messageBundle.getParcelable(WifiScanner.PNO_PARAMS_PNO_SETTINGS_KEY));
- }
-
- /**
- * Test behavior of {@link WifiScanner#startConnectedPnoScan(ScanSettings, PnoSettings,
- * Executor, WifiScanner.PnoScanListener)}
- * @throws Exception
- */
- @Test
- public void testStartConnectedPnoScan() throws Exception {
- ScanSettings scanSettings = new ScanSettings();
- PnoSettings pnoSettings = new PnoSettings();
- WifiScanner.PnoScanListener pnoScanListener = mock(WifiScanner.PnoScanListener.class);
-
- mWifiScanner.startConnectedPnoScan(
- scanSettings, pnoSettings, mock(Executor.class), pnoScanListener);
- mLooper.dispatchAll();
-
- ArgumentCaptor<Message> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class);
- verify(mHandler).handleMessage(messageArgumentCaptor.capture());
- Message message = messageArgumentCaptor.getValue();
- assertNotNull(message);
-
- assertEquals(WifiScanner.CMD_START_PNO_SCAN, message.what);
- assertTrue(message.obj instanceof Bundle);
- Bundle messageBundle = (Bundle) message.obj;
- assertEquals(scanSettings,
- messageBundle.getParcelable(WifiScanner.PNO_PARAMS_SCAN_SETTINGS_KEY));
- assertTrue(scanSettings.isPnoScan);
- assertTrue(pnoSettings.isConnected);
- assertEquals(pnoSettings,
- messageBundle.getParcelable(WifiScanner.PNO_PARAMS_PNO_SETTINGS_KEY));
- }
-
- /**
- * Test behavior of {@link WifiScanner#stopPnoScan(ScanListener)}
- * Executor, WifiScanner.PnoScanListener)}
- * @throws Exception
- */
- @Test
- public void testStopPnoScan() throws Exception {
- ScanSettings scanSettings = new ScanSettings();
- PnoSettings pnoSettings = new PnoSettings();
- WifiScanner.PnoScanListener pnoScanListener = mock(WifiScanner.PnoScanListener.class);
-
- mWifiScanner.startDisconnectedPnoScan(
- scanSettings, pnoSettings, mock(Executor.class), pnoScanListener);
- mLooper.dispatchAll();
- mWifiScanner.stopPnoScan(pnoScanListener);
- mLooper.dispatchAll();
-
- ArgumentCaptor<Message> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class);
- verify(mHandler, times(2)).handleMessage(messageArgumentCaptor.capture());
- Message message = messageArgumentCaptor.getValue();
- assertNotNull(message);
-
- assertEquals(WifiScanner.CMD_STOP_PNO_SCAN, message.what);
- }
-
- @Test
- public void testScanDataAddResults() throws Exception {
- ScanResult scanResult1 = new ScanResult();
- scanResult1.SSID = TEST_SSID_1;
- ScanData scanData = new ScanData(0, 0, new ScanResult[]{scanResult1});
-
- ScanResult scanResult2 = new ScanResult();
- scanResult2.SSID = TEST_SSID_2;
- scanData.addResults(new ScanResult[]{scanResult2});
-
- ScanResult[] consolidatedScanResults = scanData.getResults();
- assertEquals(2, consolidatedScanResults.length);
- assertEquals(TEST_SSID_1, consolidatedScanResults[0].SSID);
- assertEquals(TEST_SSID_2, consolidatedScanResults[1].SSID);
- }
-
- @Test
- public void testScanDataParcel() throws Exception {
- ScanResult scanResult1 = new ScanResult();
- scanResult1.SSID = TEST_SSID_1;
- ScanData scanData = new ScanData(5, 4, new ScanResult[]{scanResult1});
-
- Parcel parcel = Parcel.obtain();
- scanData.writeToParcel(parcel, 0);
- parcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- ScanData readScanData = ScanData.CREATOR.createFromParcel(parcel);
-
- assertEquals(scanData.getId(), readScanData.getId());
- assertEquals(scanData.getFlags(), readScanData.getFlags());
- assertEquals(scanData.getResults().length, readScanData.getResults().length);
- assertEquals(scanData.getResults()[0].SSID, readScanData.getResults()[0].SSID);
- }
-
- /** Tests that upon registration success, {@link ScanListener#onSuccess()} is called. */
- @Test
- public void testRegisterScanListenerSuccess() throws Exception {
- mWifiScanner.registerScanListener(mExecutor, mScanListener);
- mLooper.dispatchAll();
-
- ArgumentCaptor<Message> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class);
- verify(mHandler).handleMessage(messageArgumentCaptor.capture());
- Message sentMessage = messageArgumentCaptor.getValue();
- assertNotNull(sentMessage);
-
- assertEquals(1, mBidirectionalAsyncChannelServer.getClientMessengers().size());
- Messenger scannerMessenger =
- mBidirectionalAsyncChannelServer.getClientMessengers().iterator().next();
-
- Message responseMessage = Message.obtain();
- responseMessage.what = WifiScanner.CMD_OP_SUCCEEDED;
- responseMessage.arg2 = sentMessage.arg2;
- scannerMessenger.send(responseMessage);
- mLooper.dispatchAll();
-
- verify(mExecutor).execute(any());
- verify(mScanListener).onSuccess();
- }
-
- /**
- * Tests that upon registration failed, {@link ScanListener#onFailure(int, String)} is called.
- */
- @Test
- public void testRegisterScanListenerFailed() throws Exception {
- mWifiScanner.registerScanListener(mExecutor, mScanListener);
- mLooper.dispatchAll();
-
- ArgumentCaptor<Message> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class);
- verify(mHandler).handleMessage(messageArgumentCaptor.capture());
- Message sentMessage = messageArgumentCaptor.getValue();
- assertNotNull(sentMessage);
-
- assertEquals(1, mBidirectionalAsyncChannelServer.getClientMessengers().size());
- Messenger scannerMessenger =
- mBidirectionalAsyncChannelServer.getClientMessengers().iterator().next();
-
- {
- Message responseMessage = Message.obtain();
- responseMessage.what = WifiScanner.CMD_OP_FAILED;
- responseMessage.arg2 = sentMessage.arg2;
- responseMessage.obj = new WifiScanner.OperationResult(
- WifiScanner.REASON_NOT_AUTHORIZED, DESCRIPTION_NOT_AUTHORIZED);
- scannerMessenger.send(responseMessage);
- mLooper.dispatchAll();
- }
-
- verify(mExecutor).execute(any());
- verify(mScanListener).onFailure(
- WifiScanner.REASON_NOT_AUTHORIZED, DESCRIPTION_NOT_AUTHORIZED);
-
- // CMD_OP_FAILED should have caused the removal of the listener, verify this
- {
- Message responseMessage = Message.obtain();
- responseMessage.what = WifiScanner.CMD_SCAN_RESULT;
- responseMessage.arg2 = sentMessage.arg2;
- responseMessage.obj = mParcelableScanData;
- scannerMessenger.send(responseMessage);
- mLooper.dispatchAll();
- }
- // execute() called once before, not called again
- verify(mExecutor, times(1)).execute(any());
- // onResults() never triggered
- verify(mScanListener, never()).onResults(any());
- }
-
- /**
- * Tests that when the ScanListener is triggered, {@link ScanListener#onResults(ScanData[])}
- * is called.
- */
- @Test
- public void testRegisterScanListenerReceiveScanResults() throws Exception {
- mWifiScanner.registerScanListener(mExecutor, mScanListener);
- mLooper.dispatchAll();
-
- ArgumentCaptor<Message> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class);
- verify(mHandler).handleMessage(messageArgumentCaptor.capture());
- Message sentMessage = messageArgumentCaptor.getValue();
- assertNotNull(sentMessage);
-
- assertEquals(1, mBidirectionalAsyncChannelServer.getClientMessengers().size());
- Messenger scannerMessenger =
- mBidirectionalAsyncChannelServer.getClientMessengers().iterator().next();
-
- Message responseMessage = Message.obtain();
- responseMessage.what = WifiScanner.CMD_SCAN_RESULT;
- responseMessage.arg2 = sentMessage.arg2;
- responseMessage.obj = mParcelableScanData;
- scannerMessenger.send(responseMessage);
- mLooper.dispatchAll();
-
- verify(mExecutor).execute(any());
- verify(mScanListener).onResults(mScanData);
- }
-
- /**
- * Tests that after unregistering a scan listener, {@link ScanListener#onResults(ScanData[])}
- * is not called.
- */
- @Test
- public void testUnregisterScanListener() throws Exception {
- mWifiScanner.registerScanListener(mExecutor, mScanListener);
- mWifiScanner.unregisterScanListener(mScanListener);
- mLooper.dispatchAll();
-
- assertEquals(1, mBidirectionalAsyncChannelServer.getClientMessengers().size());
- Messenger scannerMessenger =
- mBidirectionalAsyncChannelServer.getClientMessengers().iterator().next();
-
- ArgumentCaptor<Message> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class);
- verify(mHandler, times(2)).handleMessage(messageArgumentCaptor.capture());
- Message sentMessage = messageArgumentCaptor.getValue();
- assertNotNull(sentMessage);
-
- Message responseMessage = Message.obtain();
- responseMessage.what = WifiScanner.CMD_SCAN_RESULT;
- responseMessage.obj = mParcelableScanData;
- responseMessage.arg2 = sentMessage.arg2;
- scannerMessenger.send(responseMessage);
- mLooper.dispatchAll();
-
- verify(mExecutor, never()).execute(any());
- verify(mScanListener, never()).onResults(mScanData);
- }
-
- /**
- * Tests isFullBandScan() method with and without DFS check
- */
- @Test
- public void testIsFullBandScan() throws Exception {
- assertFalse(WifiScanner.isFullBandScan(WifiScanner.WIFI_BAND_24_GHZ, true));
- assertFalse(WifiScanner.isFullBandScan(WifiScanner.WIFI_BAND_5_GHZ, true));
- assertFalse(WifiScanner.isFullBandScan(WifiScanner.WIFI_BAND_6_GHZ, true));
- assertFalse(WifiScanner.isFullBandScan(
- WifiScanner.WIFI_BAND_6_GHZ | WifiScanner.WIFI_BAND_5_GHZ, true));
- assertTrue(WifiScanner.isFullBandScan(
- WifiScanner.WIFI_BAND_24_GHZ | WifiScanner.WIFI_BAND_5_GHZ, true));
- assertFalse(WifiScanner.isFullBandScan(
- WifiScanner.WIFI_BAND_24_GHZ | WifiScanner.WIFI_BAND_5_GHZ, false));
- assertTrue(WifiScanner.isFullBandScan(WifiScanner.WIFI_BAND_BOTH_WITH_DFS, true));
- assertTrue(WifiScanner.isFullBandScan(WifiScanner.WIFI_BAND_BOTH_WITH_DFS, false));
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/WifiSsidTest.java b/wifi/tests/src/android/net/wifi/WifiSsidTest.java
deleted file mode 100644
index 10a37c0..0000000
--- a/wifi/tests/src/android/net/wifi/WifiSsidTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-import java.nio.charset.StandardCharsets;
-
-/**
- * Unit tests for {@link android.net.wifi.WifiSsid}.
- */
-@SmallTest
-public class WifiSsidTest {
-
- private static final String TEST_SSID = "Test SSID";
- private static final byte[] TEST_SSID_BYTES = TEST_SSID.getBytes(StandardCharsets.US_ASCII);
-
- /**
- * Check that createFromByteArray() works.
- */
- @Test
- public void testCreateFromByteArray() {
- WifiSsid wifiSsid = WifiSsid.createFromByteArray(TEST_SSID_BYTES);
- assertTrue(wifiSsid != null);
- assertEquals(TEST_SSID, wifiSsid.toString());
- }
-
- /**
- * Verify that SSID created from byte array and string with the same content are equal.
- *
- * @throws Exception
- */
- @Test
- public void testEquals() throws Exception {
- WifiSsid fromBytes = WifiSsid.createFromByteArray(TEST_SSID_BYTES);
- WifiSsid fromString = WifiSsid.createFromAsciiEncoded(TEST_SSID);
- assertTrue(fromBytes != null);
- assertTrue(fromString != null);
- assertEquals(fromBytes, fromString);
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/WifiUsabilityStatsEntryTest.java b/wifi/tests/src/android/net/wifi/WifiUsabilityStatsEntryTest.java
deleted file mode 100644
index 5184152..0000000
--- a/wifi/tests/src/android/net/wifi/WifiUsabilityStatsEntryTest.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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.net.wifi;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.validateMockitoUsage;
-
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.MockitoAnnotations;
-
-
-/**
- * Unit tests for {@link android.net.wifi.WifiUsabilityStatsEntry}.
- */
-@SmallTest
-public class WifiUsabilityStatsEntryTest {
-
- /**
- * Setup before tests.
- */
- @Before
- public void setUp() throws Exception {
- MockitoAnnotations.initMocks(this);
- }
-
- /**
- * Clean up after tests.
- */
- @After
- public void cleanup() {
- validateMockitoUsage();
- }
-
- /**
- * Verify parcel read/write for Wifi usability stats result.
- */
- @Test
- public void verifyStatsResultWriteAndThenRead() throws Exception {
- WifiUsabilityStatsEntry writeResult = createResult();
- WifiUsabilityStatsEntry readResult = parcelWriteRead(writeResult);
- assertWifiUsabilityStatsEntryEquals(writeResult, readResult);
- }
-
- /**
- * Write the provided {@link WifiUsabilityStatsEntry} to a parcel and deserialize it.
- */
- private static WifiUsabilityStatsEntry parcelWriteRead(
- WifiUsabilityStatsEntry writeResult) throws Exception {
- Parcel parcel = Parcel.obtain();
- writeResult.writeToParcel(parcel, 0);
- parcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- return WifiUsabilityStatsEntry.CREATOR.createFromParcel(parcel);
- }
-
- private static WifiUsabilityStatsEntry createResult() {
- return new WifiUsabilityStatsEntry(
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, true
- );
- }
-
- private static void assertWifiUsabilityStatsEntryEquals(
- WifiUsabilityStatsEntry expected,
- WifiUsabilityStatsEntry actual) {
- assertEquals(expected.getTimeStampMillis(), actual.getTimeStampMillis());
- assertEquals(expected.getRssi(), actual.getRssi());
- assertEquals(expected.getLinkSpeedMbps(), actual.getLinkSpeedMbps());
- assertEquals(expected.getTotalTxSuccess(), actual.getTotalTxSuccess());
- assertEquals(expected.getTotalTxRetries(), actual.getTotalTxRetries());
- assertEquals(expected.getTotalTxBad(), actual.getTotalTxBad());
- assertEquals(expected.getTotalRxSuccess(), actual.getTotalRxSuccess());
- assertEquals(expected.getTotalRadioOnTimeMillis(), actual.getTotalRadioOnTimeMillis());
- assertEquals(expected.getTotalRadioTxTimeMillis(), actual.getTotalRadioTxTimeMillis());
- assertEquals(expected.getTotalRadioRxTimeMillis(), actual.getTotalRadioRxTimeMillis());
- assertEquals(expected.getTotalScanTimeMillis(), actual.getTotalScanTimeMillis());
- assertEquals(expected.getTotalNanScanTimeMillis(), actual.getTotalNanScanTimeMillis());
- assertEquals(expected.getTotalBackgroundScanTimeMillis(),
- actual.getTotalBackgroundScanTimeMillis());
- assertEquals(expected.getTotalRoamScanTimeMillis(), actual.getTotalRoamScanTimeMillis());
- assertEquals(expected.getTotalPnoScanTimeMillis(), actual.getTotalPnoScanTimeMillis());
- assertEquals(expected.getTotalHotspot2ScanTimeMillis(),
- actual.getTotalHotspot2ScanTimeMillis());
- assertEquals(expected.getTotalCcaBusyFreqTimeMillis(),
- actual.getTotalCcaBusyFreqTimeMillis());
- assertEquals(expected.getTotalRadioOnFreqTimeMillis(),
- actual.getTotalRadioOnFreqTimeMillis());
- assertEquals(expected.getTotalBeaconRx(), actual.getTotalBeaconRx());
- assertEquals(expected.getProbeStatusSinceLastUpdate(),
- actual.getProbeStatusSinceLastUpdate());
- assertEquals(expected.getProbeElapsedTimeSinceLastUpdateMillis(),
- actual.getProbeElapsedTimeSinceLastUpdateMillis());
- assertEquals(expected.getProbeMcsRateSinceLastUpdate(),
- actual.getProbeMcsRateSinceLastUpdate());
- assertEquals(expected.getRxLinkSpeedMbps(), actual.getRxLinkSpeedMbps());
- assertEquals(expected.getCellularDataNetworkType(), actual.getCellularDataNetworkType());
- assertEquals(expected.getCellularSignalStrengthDbm(),
- actual.getCellularSignalStrengthDbm());
- assertEquals(expected.getCellularSignalStrengthDb(), actual.getCellularSignalStrengthDb());
- assertEquals(expected.isSameRegisteredCell(), actual.isSameRegisteredCell());
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/aware/TlvBufferUtilsTest.java b/wifi/tests/src/android/net/wifi/aware/TlvBufferUtilsTest.java
deleted file mode 100644
index 79e95e8..0000000
--- a/wifi/tests/src/android/net/wifi/aware/TlvBufferUtilsTest.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ErrorCollector;
-
-import java.nio.BufferOverflowException;
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * Unit test harness for TlvBufferUtils class.
- */
-@SmallTest
-public class TlvBufferUtilsTest {
- @Rule
- public ErrorCollector collector = new ErrorCollector();
-
- /*
- * TlvBufferUtils Tests
- */
-
- @Test
- public void testTlvBuild() {
- TlvBufferUtils.TlvConstructor tlv11 = new TlvBufferUtils.TlvConstructor(1, 1);
- tlv11.allocate(15);
- tlv11.putByte(0, (byte) 2);
- tlv11.putByteArray(2, new byte[] {
- 0, 1, 2 });
-
- collector.checkThat("tlv11-correct-construction",
- tlv11.getArray(), equalTo(new byte[]{0, 1, 2, 2, 3, 0, 1, 2}));
-
- TlvBufferUtils.TlvConstructor tlv01 = new TlvBufferUtils.TlvConstructor(0, 1);
- tlv01.allocate(15);
- tlv01.putByte(0, (byte) 2);
- tlv01.putByteArray(2, new byte[] {
- 0, 1, 2 });
-
- collector.checkThat("tlv01-correct-construction",
- tlv01.getArray(), equalTo(new byte[] {1, 2, 3, 0, 1, 2 }));
-
- collector.checkThat("tlv11-valid",
- TlvBufferUtils.isValid(tlv11.getArray(), 1, 1),
- equalTo(true));
- collector.checkThat("tlv01-valid",
- TlvBufferUtils.isValid(tlv01.getArray(), 0, 1),
- equalTo(true));
- }
-
- /**
- * Validate that re-using a TLV by any of the reallocation method resets it completely.
- */
- @Test
- public void testTlvReuse() {
- TlvBufferUtils.TlvConstructor tlv = new TlvBufferUtils.TlvConstructor(1, 1);
-
- tlv.allocate(10);
- tlv.putByte(0, (byte) 2);
- tlv.putByte(1, (byte) 104);
-
- collector.checkThat("initial", tlv.getArray(), equalTo(new byte[]{0, 1, 2, 1, 1, 104}));
-
- tlv.allocate(8);
- tlv.putByte(5, (byte) 7);
- collector.checkThat("re-alloc", tlv.getArray(), equalTo(new byte[]{5, 1, 7}));
- }
-
- /**
- * Verify that can build a valid TLV from a List of byte[].
- */
- @Test
- public void testTlvListOperations() {
- byte[] entry1 = { 1, 2, 3 };
- byte[] entry2 = { 4, 5 };
- byte[] entry3 = new byte[0];
- List<byte[]> data = new ArrayList<>();
- data.add(entry1);
- data.add(entry2);
- data.add(entry3);
- data.add(null); // zero-length should work
-
- TlvBufferUtils.TlvConstructor tlv01 = new TlvBufferUtils.TlvConstructor(0, 1);
- tlv01.allocateAndPut(data);
- byte[] tlvData = tlv01.getArray();
- List<byte[]> parsedList = new TlvBufferUtils.TlvIterable(0, 1, tlvData).toList();
-
- collector.checkThat("tlvData-correct-length", tlvData.length,
- equalTo(entry1.length + 1 + entry2.length + 1 + entry3.length + 1 + 1));
- collector.checkThat("parsedList-correct-length", parsedList.size(), equalTo(4));
- collector.checkThat("parsedList-entry1", parsedList.get(0), equalTo(entry1));
- collector.checkThat("parsedList-entry2", parsedList.get(1), equalTo(entry2));
- collector.checkThat("parsedList-entry3", parsedList.get(2), equalTo(entry3));
- collector.checkThat("parsedList-entry4", parsedList.get(3), equalTo(new byte[0]));
- }
-
- /**
- * Verify that can parse a (correctly formatted) byte array to a list.
- */
- @Test
- public void testTlvParseToList() {
- byte[] validTlv01 = { 0, 1, 55, 2, 33, 66, 0 };
-
- List<byte[]> parsedList = new TlvBufferUtils.TlvIterable(0, 1, validTlv01).toList();
-
- collector.checkThat("parsedList-entry1", parsedList.get(0), equalTo(new byte[0]));
- collector.checkThat("parsedList-entry2", parsedList.get(1), equalTo(new byte[] { 55 }));
- collector.checkThat("parsedList-entry3", parsedList.get(2), equalTo(new byte[] { 33, 66 }));
- collector.checkThat("parsedList-entry4", parsedList.get(3), equalTo(new byte[0]));
- }
-
- /**
- * Verify that an exception is thrown when trying to parse an invalid array.
- */
- @Test(expected = BufferOverflowException.class)
- public void testTlvParseToListError() {
- byte[] invalidTlv01 = { 0, 1, 55, 2, 55, 66, 3 }; // bad data
-
- List<byte[]> data = new TlvBufferUtils.TlvIterable(0, 1, invalidTlv01).toList();
- }
-
- /**
- * Validate the API which places raw bytes into the TLV (without a TL structure).
- */
- @Test
- public void testRawPuts() {
- TlvBufferUtils.TlvConstructor tlv = new TlvBufferUtils.TlvConstructor(1, 1);
-
- tlv.allocate(10);
- tlv.putByte(0, (byte) 2);
- tlv.putRawByte((byte) 55);
- tlv.putByte(1, (byte) 104);
- tlv.putRawByteArray(new byte[]{66, 77});
-
- collector.checkThat("data", tlv.getArray(),
- equalTo(new byte[]{0, 1, 2, 55, 1, 1, 104, 66, 77}));
- }
-
- @Test
- public void testTlvIterate() {
- final String ascii = "ABC";
- final String nonAscii = "何かもっと複雑な";
-
- TlvBufferUtils.TlvConstructor tlv22 = new TlvBufferUtils.TlvConstructor(2, 2);
- tlv22.allocate(18);
- tlv22.putInt(0, 2);
- tlv22.putShort(2, (short) 3);
- tlv22.putZeroLengthElement(55);
-
- TlvBufferUtils.TlvIterable tlv22It = new TlvBufferUtils.TlvIterable(2, 2, tlv22.getArray());
- int count = 0;
- for (TlvBufferUtils.TlvElement tlv : tlv22It) {
- if (count == 0) {
- collector.checkThat("tlv22-correct-iteration-mType", tlv.type, equalTo(0));
- collector.checkThat("tlv22-correct-iteration-mLength", tlv.length, equalTo(4));
- collector.checkThat("tlv22-correct-iteration-DATA", tlv.getInt(), equalTo(2));
- } else if (count == 1) {
- collector.checkThat("tlv22-correct-iteration-mType", tlv.type, equalTo(2));
- collector.checkThat("tlv22-correct-iteration-mLength", tlv.length, equalTo(2));
- collector.checkThat("tlv22-correct-iteration-DATA", (int) tlv.getShort(),
- equalTo(3));
- } else if (count == 2) {
- collector.checkThat("tlv22-correct-iteration-mType", tlv.type, equalTo(55));
- collector.checkThat("tlv22-correct-iteration-mLength", tlv.length, equalTo(0));
- } else {
- collector.checkThat("Invalid number of iterations in loop - tlv22", true,
- equalTo(false));
- }
- ++count;
- }
- if (count != 3) {
- collector.checkThat("Invalid number of iterations outside loop - tlv22", true,
- equalTo(false));
- }
-
- TlvBufferUtils.TlvConstructor tlv02 = new TlvBufferUtils.TlvConstructor(0, 2);
- tlv02.allocate(100);
- tlv02.putByte(0, (byte) 2);
- tlv02.putString(0, ascii);
- tlv02.putString(0, nonAscii);
- tlv02.putByteArray(0, new byte[]{5, 4, 3, 2, 1});
-
- TlvBufferUtils.TlvIterable tlv02It = new TlvBufferUtils.TlvIterable(0, 2, tlv02.getArray());
- count = 0;
- for (TlvBufferUtils.TlvElement tlv : tlv02It) {
- if (count == 0) {
- collector.checkThat("tlv02-correct-iteration-mLength", tlv.length, equalTo(1));
- collector.checkThat("tlv02-correct-iteration-DATA", (int) tlv.getByte(),
- equalTo(2));
- } else if (count == 1) {
- collector.checkThat("tlv02-correct-iteration-mLength", tlv.length,
- equalTo(ascii.length()));
- collector.checkThat("tlv02-correct-iteration-DATA", tlv.getString().equals(ascii),
- equalTo(true));
- } else if (count == 2) {
- collector.checkThat("tlv02-correct-iteration-mLength", tlv.length,
- equalTo(nonAscii.getBytes().length));
- collector.checkThat("tlv02-correct-iteration-DATA",
- tlv.getString().equals(nonAscii), equalTo(true));
- } else if (count == 3) {
- collector.checkThat("tlv02-correct-iteration-mLength", tlv.length,
- equalTo(5));
- collector.checkThat("tlv02-correct-iteration-DATA", tlv.getRawData(),
- equalTo(new byte[]{5, 4, 3, 2, 1}));
- } else {
- collector.checkThat("Invalid number of iterations in loop - tlv02", true,
- equalTo(false));
- }
- ++count;
- }
- collector.checkThat("Invalid number of iterations outside loop - tlv02", count,
- equalTo(4));
-
- collector.checkThat("tlv22-valid",
- TlvBufferUtils.isValid(tlv22.getArray(), 2, 2),
- equalTo(true));
- collector.checkThat("tlv02-valid",
- TlvBufferUtils.isValid(tlv02.getArray(), 0, 2),
- equalTo(true));
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testTlvInvalidSizeT1L0() {
- TlvBufferUtils.TlvConstructor tlv10 = new TlvBufferUtils.TlvConstructor(1, 0);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testTlvInvalidSizeTm3L2() {
- TlvBufferUtils.TlvConstructor tlv10 = new TlvBufferUtils.TlvConstructor(-3, 2);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testTlvInvalidSizeT1Lm2() {
- TlvBufferUtils.TlvConstructor tlv10 = new TlvBufferUtils.TlvConstructor(1, -2);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testTlvInvalidSizeT1L3() {
- TlvBufferUtils.TlvConstructor tlv10 = new TlvBufferUtils.TlvConstructor(1, 3);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testTlvInvalidSizeT3L1() {
- TlvBufferUtils.TlvConstructor tlv10 = new TlvBufferUtils.TlvConstructor(3, 1);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testTlvItInvalidSizeT1L0() {
- final byte[] testTlv = {
- 0, 1, 2 };
- final int testLength = 3;
- TlvBufferUtils.TlvIterable tlvIt10 = new TlvBufferUtils.TlvIterable(1, 0, testTlv);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testTlvItInvalidSizeTm3L2() {
- final byte[] testTlv = {
- 0, 1, 2 };
- final int testLength = 3;
- TlvBufferUtils.TlvIterable tlvIt10 = new TlvBufferUtils.TlvIterable(-3, 2, testTlv);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testTlvItInvalidSizeT1Lm2() {
- final byte[] testTlv = {
- 0, 1, 2 };
- final int testLength = 3;
- TlvBufferUtils.TlvIterable tlvIt10 = new TlvBufferUtils.TlvIterable(1, -2, testTlv);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testTlvItInvalidSizeT1L3() {
- final byte[] testTlv = {
- 0, 1, 2 };
- final int testLength = 3;
- TlvBufferUtils.TlvIterable tlvIt10 = new TlvBufferUtils.TlvIterable(1, 3, testTlv);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testTlvItInvalidSizeT3L1() {
- final byte[] testTlv = {
- 0, 1, 2 };
- final int testLength = 3;
- TlvBufferUtils.TlvIterable tlvIt10 = new TlvBufferUtils.TlvIterable(3, 1, testTlv);
- }
-
- /**
- * Validate that a malformed byte array fails the TLV validity test.
- */
- @Test
- public void testTlvInvalidByteArray() {
- TlvBufferUtils.TlvConstructor tlv01 = new TlvBufferUtils.TlvConstructor(0, 1);
- tlv01.allocate(15);
- tlv01.putByte(0, (byte) 2);
- tlv01.putByteArray(2, new byte[]{0, 1, 2});
-
- byte[] array = tlv01.getArray();
- array[0] = 10;
-
- collector.checkThat("tlv01-invalid",
- TlvBufferUtils.isValid(array, 0, 1), equalTo(false));
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/aware/WifiAwareAgentNetworkSpecifierTest.java b/wifi/tests/src/android/net/wifi/aware/WifiAwareAgentNetworkSpecifierTest.java
deleted file mode 100644
index b65de6b..0000000
--- a/wifi/tests/src/android/net/wifi/aware/WifiAwareAgentNetworkSpecifierTest.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ErrorCollector;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Unit test harness for WifiAwareAgentNetworkSpecifier class.
- */
-@SmallTest
-public class WifiAwareAgentNetworkSpecifierTest {
- @Rule
- public ErrorCollector collector = new ErrorCollector();
-
- @Test
- public void testParcel() {
- final int numNs = 10;
-
- Set<WifiAwareNetworkSpecifier> nsSet = new HashSet<>();
- for (int i = 0; i < numNs; ++i) {
- nsSet.add(getMockNetworkSpecifier(10 + i));
- }
- WifiAwareAgentNetworkSpecifier dut = new WifiAwareAgentNetworkSpecifier(
- nsSet.toArray(new WifiAwareNetworkSpecifier[numNs]));
-
- Parcel parcelW = Parcel.obtain();
- dut.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- WifiAwareAgentNetworkSpecifier rereadDut =
- WifiAwareAgentNetworkSpecifier.CREATOR.createFromParcel(parcelR);
-
- assertEquals(dut, rereadDut);
- assertEquals(dut.hashCode(), rereadDut.hashCode());
-
- // Ensure that individual network specifiers are satisfied by both the original & marshaled
- // |WifiAwareNetworkAgentSpecifier instances.
- for (WifiAwareNetworkSpecifier ns : nsSet) {
- assertTrue(dut.satisfiesAwareNetworkSpecifier(ns));
- assertTrue(rereadDut.satisfiesAwareNetworkSpecifier(ns));
- }
- }
-
- /**
- * Validate that an empty agent network specifier doesn't match any base network specifier.
- */
- @Test
- public void testEmptyDoesntMatchAnything() {
- WifiAwareAgentNetworkSpecifier dut = new WifiAwareAgentNetworkSpecifier();
- WifiAwareNetworkSpecifier ns = getMockNetworkSpecifier(6);
- collector.checkThat("No match expected", ns.canBeSatisfiedBy(dut), equalTo(false));
- }
-
- /**
- * Validate that an agent network specifier constructed with a single entry matches that entry,
- * and only that entry.
- */
- @Test
- public void testSingleMatch() {
- WifiAwareNetworkSpecifier nsThis = getMockNetworkSpecifier(6);
- WifiAwareAgentNetworkSpecifier dut = new WifiAwareAgentNetworkSpecifier(nsThis);
- WifiAwareNetworkSpecifier nsOther = getMockNetworkSpecifier(8);
- collector.checkThat("Match expected", nsThis.canBeSatisfiedBy(dut), equalTo(true));
- collector.checkThat("No match expected", nsOther.canBeSatisfiedBy(dut), equalTo(false));
- }
-
- /**
- * Validate that an agent network specifier constructed with multiple entries matches all those
- * entries - but none other.
- */
- @Test
- public void testMultipleMatchesAllMembers() {
- final int numNs = 10;
-
- Set<WifiAwareNetworkSpecifier> nsSet = new HashSet<>();
- for (int i = 0; i < numNs; ++i) {
- nsSet.add(getMockNetworkSpecifier(10 + i));
- }
-
- WifiAwareAgentNetworkSpecifier dut = new WifiAwareAgentNetworkSpecifier(
- nsSet.toArray(new WifiAwareNetworkSpecifier[numNs]));
- WifiAwareNetworkSpecifier nsOther = getMockNetworkSpecifier(10000);
-
- for (WifiAwareNetworkSpecifier nsThis: nsSet) {
- collector.checkThat("Match expected", nsThis.canBeSatisfiedBy(dut), equalTo(true));
- }
- collector.checkThat("No match expected", nsOther.canBeSatisfiedBy(dut), equalTo(false));
- }
-
- /**
- * Validate that agent network specifier matches against a super-set.
- */
- @Test
- public void testMatchSuperset() {
- final int numNs = 10;
-
- Set<WifiAwareNetworkSpecifier> nsSet = new HashSet<>();
- for (int i = 0; i < numNs; ++i) {
- nsSet.add(getMockNetworkSpecifier(10 + i));
- }
-
- WifiAwareAgentNetworkSpecifier oldNs = new WifiAwareAgentNetworkSpecifier(
- nsSet.toArray(new WifiAwareNetworkSpecifier[nsSet.size()]));
-
- nsSet.add(getMockNetworkSpecifier(100 + numNs));
- WifiAwareAgentNetworkSpecifier newNs = new WifiAwareAgentNetworkSpecifier(
- nsSet.toArray(new WifiAwareNetworkSpecifier[nsSet.size()]));
-
- collector.checkThat("Match expected", oldNs.canBeSatisfiedBy(newNs), equalTo(true));
- }
-
- /**
- * Validate that agent network specifier does not match against a sub-set.
- */
- @Test
- public void testNoMatchSubset() {
- final int numNs = 10;
-
- Set<WifiAwareNetworkSpecifier> nsSet = new HashSet<>();
- for (int i = 0; i < numNs; ++i) {
- nsSet.add(getMockNetworkSpecifier(10 + i));
- }
-
- WifiAwareAgentNetworkSpecifier newNs = new WifiAwareAgentNetworkSpecifier(
- nsSet.toArray(new WifiAwareNetworkSpecifier[nsSet.size()]));
-
- nsSet.add(getMockNetworkSpecifier(100 + numNs));
- WifiAwareAgentNetworkSpecifier oldNs = new WifiAwareAgentNetworkSpecifier(
- nsSet.toArray(new WifiAwareNetworkSpecifier[nsSet.size()]));
-
- collector.checkThat("Match unexpected", oldNs.canBeSatisfiedBy(newNs), equalTo(false));
- }
-
- // utilities
-
- /**
- * Returns a WifiAwareNetworkSpecifier with mock (but valid) entries. Each can be
- * differentiated (made unique) by specifying a different client ID.
- */
- WifiAwareNetworkSpecifier getMockNetworkSpecifier(int clientId) {
- return new WifiAwareNetworkSpecifier(WifiAwareNetworkSpecifier.NETWORK_SPECIFIER_TYPE_OOB,
- WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_INITIATOR, clientId, 0, 0, new byte[6],
- null, null, 10, 5);
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/aware/WifiAwareManagerTest.java b/wifi/tests/src/android/net/wifi/aware/WifiAwareManagerTest.java
deleted file mode 100644
index 1ecd325..0000000
--- a/wifi/tests/src/android/net/wifi/aware/WifiAwareManagerTest.java
+++ /dev/null
@@ -1,1690 +0,0 @@
-/*
- * Copyright (C) 2016 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.aware;
-
-import static android.net.wifi.aware.WifiAwareManager.WIFI_AWARE_DISCOVERY_LOST_REASON_PEER_NOT_VISIBLE;
-import static android.net.wifi.aware.WifiAwareNetworkSpecifier.NETWORK_SPECIFIER_TYPE_IB;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.ArgumentMatchers.isNull;
-import static org.mockito.Mockito.inOrder;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
-
-import android.content.Context;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.net.MacAddress;
-import android.net.wifi.RttManager;
-import android.net.wifi.util.HexEncoding;
-import android.os.Build;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Parcel;
-import android.os.test.TestLooper;
-
-import androidx.test.filters.SmallTest;
-
-import com.android.modules.utils.build.SdkLevel;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ErrorCollector;
-import org.mockito.ArgumentCaptor;
-import org.mockito.InOrder;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-import java.net.Inet6Address;
-import java.net.UnknownHostException;
-import java.util.List;
-
-/**
- * Unit test harness for WifiAwareManager class.
- */
-@SmallTest
-public class WifiAwareManagerTest {
- private WifiAwareManager mDut;
- private TestLooper mMockLooper;
- private Handler mMockLooperHandler;
-
- @Rule
- public ErrorCollector collector = new ErrorCollector();
-
- @Mock
- public Context mockContext;
-
- @Mock
- public AttachCallback mockCallback;
-
- @Mock
- public DiscoverySessionCallback mockSessionCallback;
-
- @Mock
- public IWifiAwareManager mockAwareService;
-
- @Mock
- public PublishDiscoverySession mockPublishSession;
-
- @Mock
- public SubscribeDiscoverySession mockSubscribeSession;
-
- @Mock
- public RttManager.RttListener mockRttListener;
-
- @Mock
- public PackageManager mockPackageManager;
-
- @Mock
- public ApplicationInfo mockApplicationInfo;
-
- private static final int AWARE_STATUS_ERROR = -1;
-
- private static final byte[] PMK_VALID = "01234567890123456789012345678901".getBytes();
- private static final byte[] PMK_INVALID = "012".getBytes();
-
- private static final String PASSPHRASE_VALID = "SomeLongEnoughPassphrase";
- private static final String PASSPHRASE_TOO_SHORT = "012";
- private static final String PASSPHRASE_TOO_LONG =
- "0123456789012345678901234567890123456789012345678901234567890123456789";
-
- @Before
- public void setUp() throws Exception {
- MockitoAnnotations.initMocks(this);
-
- mockApplicationInfo.targetSdkVersion = Build.VERSION_CODES.Q;
- when(mockPackageManager.getApplicationInfo(anyString(), anyInt())).thenReturn(
- mockApplicationInfo);
- when(mockContext.getOpPackageName()).thenReturn("XXX");
- when(mockContext.getPackageManager()).thenReturn(mockPackageManager);
-
- mDut = new WifiAwareManager(mockContext, mockAwareService);
- mMockLooper = new TestLooper();
- mMockLooperHandler = new Handler(mMockLooper.getLooper());
- }
-
- /*
- * Straight pass-through tests
- */
-
- /**
- * Validate pass-through of isUsageEnabled() API.
- */
- @Test
- public void testIsUsageEnable() throws Exception {
- mDut.isAvailable();
-
- verify(mockAwareService).isUsageEnabled();
- }
-
- /**
- * Validate pass-through of getCharacteristics() API.
- */
- @Test
- public void testGetCharacteristics() throws Exception {
- mDut.getCharacteristics();
-
- verify(mockAwareService).getCharacteristics();
- }
-
- /**
- * Validate pass-through of isDeviceAttached() API.
- */
- @Test
- public void testIsAttached() throws Exception {
- assumeTrue(SdkLevel.isAtLeastS());
- mDut.isDeviceAttached();
- verify(mockAwareService).isDeviceAttached();
- }
-
- /**
- * Validate pass-through of isInstantCommunicationModeEnabled() and
- * enableInstantCommunicationMode() API
- */
- @Test
- public void testEnableInstantCommunicationMode() throws Exception {
- assumeTrue(SdkLevel.isAtLeastS());
- mDut.isInstantCommunicationModeEnabled();
- verify(mockAwareService).isInstantCommunicationModeEnabled();
- mDut.enableInstantCommunicationMode(true);
- verify(mockAwareService).enableInstantCommunicationMode(anyString(), eq(true));
- }
-
- /**
- * Validate pass-through of getAvailableAwareResources() API.
- */
- @Test
- public void testGetAvailableAwareResource() throws Exception {
- assumeTrue(SdkLevel.isAtLeastS());
- mDut.getAvailableAwareResources();
- verify(mockAwareService).getAvailableAwareResources();
- }
-
- /*
- * WifiAwareEventCallbackProxy Tests
- */
-
- /**
- * Validate the successful connect flow: (1) connect + success (2) publish, (3) disconnect
- * (4) try publishing on old session (5) connect again
- */
- @Test
- public void testConnectFlow() throws Exception {
- final int clientId = 4565;
-
- InOrder inOrder = inOrder(mockCallback, mockSessionCallback, mockAwareService);
- ArgumentCaptor<IWifiAwareEventCallback> clientProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareEventCallback.class);
- ArgumentCaptor<WifiAwareSession> sessionCaptor = ArgumentCaptor.forClass(
- WifiAwareSession.class);
- ArgumentCaptor<IBinder> binder = ArgumentCaptor.forClass(IBinder.class);
-
- // (1) connect + success
- mDut.attach(mockCallback, mMockLooperHandler);
- inOrder.verify(mockAwareService).connect(binder.capture(), any(), any(),
- clientProxyCallback.capture(), isNull(), eq(false));
- clientProxyCallback.getValue().onConnectSuccess(clientId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockCallback).onAttached(sessionCaptor.capture());
- WifiAwareSession session = sessionCaptor.getValue();
-
- // (2) publish - should succeed
- PublishConfig publishConfig = new PublishConfig.Builder().build();
- session.publish(publishConfig, mockSessionCallback, mMockLooperHandler);
- inOrder.verify(mockAwareService).publish(any(), any(), eq(clientId), eq(publishConfig),
- any());
-
- // (3) disconnect
- session.close();
- inOrder.verify(mockAwareService).disconnect(eq(clientId), eq(binder.getValue()));
-
- // (4) try publishing again - fails silently
- session.publish(new PublishConfig.Builder().build(), mockSessionCallback,
- mMockLooperHandler);
-
- // (5) connect
- mDut.attach(mockCallback, mMockLooperHandler);
- inOrder.verify(mockAwareService).connect(binder.capture(), any(), any(), any(), isNull(),
- eq(false));
-
- verifyNoMoreInteractions(mockCallback, mockSessionCallback, mockAwareService);
- }
-
- /**
- * Validate the failed connect flow: (1) connect + failure, (2) connect + success (3) subscribe
- */
- @Test
- public void testConnectFailure() throws Exception {
- final int clientId = 4565;
- final int reason = AWARE_STATUS_ERROR;
-
- InOrder inOrder = inOrder(mockCallback, mockSessionCallback, mockAwareService);
- ArgumentCaptor<WifiAwareSession> sessionCaptor = ArgumentCaptor.forClass(
- WifiAwareSession.class);
- ArgumentCaptor<IWifiAwareEventCallback> clientProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareEventCallback.class);
-
- // (1) connect + failure
- mDut.attach(mockCallback, mMockLooperHandler);
- inOrder.verify(mockAwareService).connect(any(), any(), any(), clientProxyCallback.capture(),
- isNull(), eq(false));
- clientProxyCallback.getValue().onConnectFail(reason);
- mMockLooper.dispatchAll();
- inOrder.verify(mockCallback).onAttachFailed();
-
- // (2) connect + success
- mDut.attach(mockCallback, mMockLooperHandler);
- inOrder.verify(mockAwareService).connect(any(), any(), any(), clientProxyCallback.capture(),
- isNull(), eq(false));
- clientProxyCallback.getValue().onConnectSuccess(clientId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockCallback).onAttached(sessionCaptor.capture());
- WifiAwareSession session = sessionCaptor.getValue();
-
- // (4) subscribe: should succeed
- SubscribeConfig subscribeConfig = new SubscribeConfig.Builder().build();
- session.subscribe(subscribeConfig, mockSessionCallback, mMockLooperHandler);
- inOrder.verify(mockAwareService).subscribe(any(), any(), eq(clientId), eq(subscribeConfig),
- any());
-
- verifyNoMoreInteractions(mockCallback, mockSessionCallback, mockAwareService);
- }
-
- /**
- * Validate that can call connect to create multiple sessions: (1) connect
- * + success, (2) try connect again
- */
- @Test
- public void testInvalidConnectSequence() throws Exception {
- final int clientId = 4565;
-
- InOrder inOrder = inOrder(mockCallback, mockSessionCallback, mockAwareService);
- ArgumentCaptor<IWifiAwareEventCallback> clientProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareEventCallback.class);
-
- // (1) connect + success
- mDut.attach(mockCallback, mMockLooperHandler);
- inOrder.verify(mockAwareService).connect(any(), any(), any(), clientProxyCallback.capture(),
- isNull(), eq(false));
- clientProxyCallback.getValue().onConnectSuccess(clientId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockCallback).onAttached(any());
-
- // (2) connect + success
- mDut.attach(mockCallback, mMockLooperHandler);
- inOrder.verify(mockAwareService).connect(any(), any(), any(), clientProxyCallback.capture(),
- isNull(), eq(false));
- clientProxyCallback.getValue().onConnectSuccess(clientId + 1);
- mMockLooper.dispatchAll();
- inOrder.verify(mockCallback).onAttached(any());
-
- verifyNoMoreInteractions(mockCallback, mockSessionCallback, mockAwareService);
- }
-
- /*
- * WifiAwareDiscoverySessionCallbackProxy Tests
- */
-
- /**
- * Validate the publish flow: (0) connect + success, (1) publish, (2)
- * success creates session, (3) pass through everything, (4) update publish
- * through session, (5) terminate locally, (6) try another command -
- * ignored.
- */
- @Test
- public void testPublishFlow() throws Exception {
- final int clientId = 4565;
- final int sessionId = 123;
- final ConfigRequest configRequest = new ConfigRequest.Builder().build();
- final PublishConfig publishConfig = new PublishConfig.Builder().build();
- final PeerHandle peerHandle = new PeerHandle(873);
- final String string1 = "hey from here...";
- final byte[] matchFilter = { 1, 12, 2, 31, 32 };
- final int messageId = 2123;
- final int reason = AWARE_STATUS_ERROR;
-
- InOrder inOrder = inOrder(mockCallback, mockSessionCallback, mockAwareService,
- mockPublishSession);
- ArgumentCaptor<WifiAwareSession> sessionCaptor = ArgumentCaptor.forClass(
- WifiAwareSession.class);
- ArgumentCaptor<IWifiAwareEventCallback> clientProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareEventCallback.class);
- ArgumentCaptor<IWifiAwareDiscoverySessionCallback> sessionProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareDiscoverySessionCallback.class);
- ArgumentCaptor<PublishDiscoverySession> publishSession = ArgumentCaptor
- .forClass(PublishDiscoverySession.class);
- ArgumentCaptor<PeerHandle> peerIdCaptor = ArgumentCaptor.forClass(PeerHandle.class);
- ArgumentCaptor<List<byte[]>> matchFilterCaptor = ArgumentCaptor.forClass(
- (Class) List.class);
-
- // (0) connect + success
- mDut.attach(mMockLooperHandler, configRequest, mockCallback, null);
- inOrder.verify(mockAwareService).connect(any(), any(), any(), clientProxyCallback.capture(),
- eq(configRequest), eq(false));
- clientProxyCallback.getValue().onConnectSuccess(clientId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockCallback).onAttached(sessionCaptor.capture());
- WifiAwareSession session = sessionCaptor.getValue();
-
- // (1) publish
- session.publish(publishConfig, mockSessionCallback, mMockLooperHandler);
- inOrder.verify(mockAwareService).publish(any(), any(), eq(clientId), eq(publishConfig),
- sessionProxyCallback.capture());
-
- // (2) publish session created
- sessionProxyCallback.getValue().onSessionStarted(sessionId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockSessionCallback).onPublishStarted(publishSession.capture());
-
- // (3) ...
- publishSession.getValue().sendMessage(peerHandle, messageId, string1.getBytes());
- sessionProxyCallback.getValue().onMatch(peerHandle.peerId, string1.getBytes(), matchFilter);
- sessionProxyCallback.getValue().onMessageReceived(peerHandle.peerId, string1.getBytes());
- sessionProxyCallback.getValue().onMessageSendFail(messageId, reason);
- sessionProxyCallback.getValue().onMessageSendSuccess(messageId);
- mMockLooper.dispatchAll();
-
- inOrder.verify(mockAwareService).sendMessage(eq(clientId), eq(sessionId),
- eq(peerHandle.peerId), eq(string1.getBytes()), eq(messageId), eq(0));
- inOrder.verify(mockSessionCallback).onServiceDiscovered(peerIdCaptor.capture(),
- eq(string1.getBytes()),
- matchFilterCaptor.capture());
-
- // note: need to capture/compare elements since the Mockito eq() is a shallow comparator
- List<byte[]> parsedMatchFilter = new TlvBufferUtils.TlvIterable(0, 1, matchFilter).toList();
- collector.checkThat("match-filter-size", parsedMatchFilter.size(),
- equalTo(matchFilterCaptor.getValue().size()));
- collector.checkThat("match-filter-entry0", parsedMatchFilter.get(0),
- equalTo(matchFilterCaptor.getValue().get(0)));
- collector.checkThat("match-filter-entry1", parsedMatchFilter.get(1),
- equalTo(matchFilterCaptor.getValue().get(1)));
-
- assertEquals(peerIdCaptor.getValue().peerId, peerHandle.peerId);
- inOrder.verify(mockSessionCallback).onMessageReceived(peerIdCaptor.capture(),
- eq(string1.getBytes()));
- assertEquals(peerIdCaptor.getValue().peerId, peerHandle.peerId);
- inOrder.verify(mockSessionCallback).onMessageSendFailed(eq(messageId));
- inOrder.verify(mockSessionCallback).onMessageSendSucceeded(eq(messageId));
-
- // (4) update publish
- publishSession.getValue().updatePublish(publishConfig);
- sessionProxyCallback.getValue().onSessionConfigFail(reason);
- mMockLooper.dispatchAll();
- inOrder.verify(mockAwareService).updatePublish(eq(clientId), eq(sessionId),
- eq(publishConfig));
- inOrder.verify(mockSessionCallback).onSessionConfigFailed();
-
- // (5) discovery session is no longer visible
- sessionProxyCallback.getValue().onMatchExpired(peerHandle.peerId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockSessionCallback).onServiceLost(peerIdCaptor.capture(),
- eq(WIFI_AWARE_DISCOVERY_LOST_REASON_PEER_NOT_VISIBLE));
- assertEquals(peerHandle.peerId, peerIdCaptor.getValue().peerId);
-
- // (6) terminate
- publishSession.getValue().close();
- mMockLooper.dispatchAll();
- inOrder.verify(mockAwareService).terminateSession(clientId, sessionId);
-
- // (7) try an update (nothing)
- publishSession.getValue().updatePublish(publishConfig);
- mMockLooper.dispatchAll();
-
- verifyNoMoreInteractions(mockCallback, mockSessionCallback, mockAwareService,
- mockPublishSession);
- }
-
- /**
- * Validate race condition of session terminate and session action: (1)
- * connect, (2) publish success + terminate, (3) update.
- */
- @Test
- public void testPublishRemoteTerminate() throws Exception {
- final int clientId = 4565;
- final int sessionId = 123;
- final ConfigRequest configRequest = new ConfigRequest.Builder().build();
- final PublishConfig publishConfig = new PublishConfig.Builder().build();
-
- InOrder inOrder = inOrder(mockCallback, mockSessionCallback, mockAwareService,
- mockPublishSession);
- ArgumentCaptor<WifiAwareSession> sessionCaptor = ArgumentCaptor.forClass(
- WifiAwareSession.class);
- ArgumentCaptor<IWifiAwareEventCallback> clientProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareEventCallback.class);
- ArgumentCaptor<IWifiAwareDiscoverySessionCallback> sessionProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareDiscoverySessionCallback.class);
- ArgumentCaptor<PublishDiscoverySession> publishSession = ArgumentCaptor
- .forClass(PublishDiscoverySession.class);
-
- // (1) connect successfully
- mDut.attach(mMockLooperHandler, configRequest, mockCallback, null);
- inOrder.verify(mockAwareService).connect(any(), any(), any(), clientProxyCallback.capture(),
- eq(configRequest), eq(false));
- clientProxyCallback.getValue().onConnectSuccess(clientId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockCallback).onAttached(sessionCaptor.capture());
- WifiAwareSession session = sessionCaptor.getValue();
-
- // (2) publish: successfully - then terminated
- session.publish(publishConfig, mockSessionCallback, mMockLooperHandler);
- inOrder.verify(mockAwareService).publish(any(), any(), eq(clientId), eq(publishConfig),
- sessionProxyCallback.capture());
- sessionProxyCallback.getValue().onSessionStarted(sessionId);
- sessionProxyCallback.getValue().onSessionTerminated(0);
- mMockLooper.dispatchAll();
- inOrder.verify(mockSessionCallback).onPublishStarted(publishSession.capture());
- inOrder.verify(mockSessionCallback).onSessionTerminated();
-
- // (3) failure when trying to update: NOP
- publishSession.getValue().updatePublish(publishConfig);
-
- verifyNoMoreInteractions(mockCallback, mockSessionCallback, mockAwareService,
- mockPublishSession);
- }
-
- /**
- * Validate the subscribe flow: (0) connect + success, (1) subscribe, (2)
- * success creates session, (3) pass through everything, (4) update
- * subscribe through session, (5) terminate locally, (6) try another command
- * - ignored.
- */
- @Test
- public void testSubscribeFlow() throws Exception {
- final int clientId = 4565;
- final int sessionId = 123;
- final ConfigRequest configRequest = new ConfigRequest.Builder().build();
- final SubscribeConfig subscribeConfig = new SubscribeConfig.Builder().build();
- final PeerHandle peerHandle = new PeerHandle(873);
- final String string1 = "hey from here...";
- final byte[] matchFilter = { 1, 12, 3, 31, 32 }; // bad data!
- final int messageId = 2123;
- final int reason = AWARE_STATUS_ERROR;
- final int distanceMm = 100;
-
- InOrder inOrder = inOrder(mockCallback, mockSessionCallback, mockAwareService,
- mockSubscribeSession);
- ArgumentCaptor<WifiAwareSession> sessionCaptor = ArgumentCaptor.forClass(
- WifiAwareSession.class);
- ArgumentCaptor<IWifiAwareEventCallback> clientProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareEventCallback.class);
- ArgumentCaptor<IWifiAwareDiscoverySessionCallback> sessionProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareDiscoverySessionCallback.class);
- ArgumentCaptor<SubscribeDiscoverySession> subscribeSession = ArgumentCaptor
- .forClass(SubscribeDiscoverySession.class);
- ArgumentCaptor<PeerHandle> peerIdCaptor = ArgumentCaptor.forClass(PeerHandle.class);
-
- // (0) connect + success
- mDut.attach(mMockLooperHandler, configRequest, mockCallback, null);
- inOrder.verify(mockAwareService).connect(any(), any(), any(), clientProxyCallback.capture(),
- eq(configRequest), eq(false));
- clientProxyCallback.getValue().onConnectSuccess(clientId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockCallback).onAttached(sessionCaptor.capture());
- WifiAwareSession session = sessionCaptor.getValue();
-
- // (1) subscribe
- session.subscribe(subscribeConfig, mockSessionCallback, mMockLooperHandler);
- inOrder.verify(mockAwareService).subscribe(any(), any(), eq(clientId), eq(subscribeConfig),
- sessionProxyCallback.capture());
-
- // (2) subscribe session created
- sessionProxyCallback.getValue().onSessionStarted(sessionId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockSessionCallback).onSubscribeStarted(subscribeSession.capture());
-
- // (3) ...
- subscribeSession.getValue().sendMessage(peerHandle, messageId, string1.getBytes());
- sessionProxyCallback.getValue().onMatch(peerHandle.peerId, string1.getBytes(), matchFilter);
- sessionProxyCallback.getValue().onMatchWithDistance(peerHandle.peerId, string1.getBytes(),
- matchFilter, distanceMm);
- sessionProxyCallback.getValue().onMessageReceived(peerHandle.peerId, string1.getBytes());
- sessionProxyCallback.getValue().onMessageSendFail(messageId, reason);
- sessionProxyCallback.getValue().onMessageSendSuccess(messageId);
- mMockLooper.dispatchAll();
-
- inOrder.verify(mockAwareService).sendMessage(eq(clientId), eq(sessionId),
- eq(peerHandle.peerId), eq(string1.getBytes()), eq(messageId), eq(0));
- inOrder.verify(mockSessionCallback).onServiceDiscovered(peerIdCaptor.capture(),
- eq(string1.getBytes()), isNull());
- inOrder.verify(mockSessionCallback).onServiceDiscoveredWithinRange(peerIdCaptor.capture(),
- eq(string1.getBytes()), isNull(), eq(distanceMm));
- assertEquals((peerIdCaptor.getValue()).peerId, peerHandle.peerId);
- inOrder.verify(mockSessionCallback).onMessageReceived(peerIdCaptor.capture(),
- eq(string1.getBytes()));
- assertEquals((peerIdCaptor.getValue()).peerId, peerHandle.peerId);
- inOrder.verify(mockSessionCallback).onMessageSendFailed(eq(messageId));
- inOrder.verify(mockSessionCallback).onMessageSendSucceeded(eq(messageId));
-
- // (4) update subscribe
- subscribeSession.getValue().updateSubscribe(subscribeConfig);
- sessionProxyCallback.getValue().onSessionConfigFail(reason);
- mMockLooper.dispatchAll();
- inOrder.verify(mockAwareService).updateSubscribe(eq(clientId), eq(sessionId),
- eq(subscribeConfig));
- inOrder.verify(mockSessionCallback).onSessionConfigFailed();
-
- // (5) discovery session is no longer visible
- sessionProxyCallback.getValue().onMatchExpired(peerHandle.peerId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockSessionCallback).onServiceLost(peerIdCaptor.capture(),
- eq(WIFI_AWARE_DISCOVERY_LOST_REASON_PEER_NOT_VISIBLE));
- assertEquals(peerHandle.peerId, peerIdCaptor.getValue().peerId);
-
- // (6) terminate
- subscribeSession.getValue().close();
- mMockLooper.dispatchAll();
- inOrder.verify(mockAwareService).terminateSession(clientId, sessionId);
-
- // (7) try an update (nothing)
- subscribeSession.getValue().updateSubscribe(subscribeConfig);
- mMockLooper.dispatchAll();
-
- verifyNoMoreInteractions(mockCallback, mockSessionCallback, mockAwareService,
- mockSubscribeSession);
- }
-
- /**
- * Validate race condition of session terminate and session action: (1)
- * connect, (2) subscribe success + terminate, (3) update.
- */
- @Test
- public void testSubscribeRemoteTerminate() throws Exception {
- final int clientId = 4565;
- final int sessionId = 123;
- final ConfigRequest configRequest = new ConfigRequest.Builder().build();
- final SubscribeConfig subscribeConfig = new SubscribeConfig.Builder().build();
-
- InOrder inOrder = inOrder(mockCallback, mockSessionCallback, mockAwareService,
- mockSubscribeSession);
- ArgumentCaptor<WifiAwareSession> sessionCaptor = ArgumentCaptor.forClass(
- WifiAwareSession.class);
- ArgumentCaptor<IWifiAwareEventCallback> clientProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareEventCallback.class);
- ArgumentCaptor<IWifiAwareDiscoverySessionCallback> sessionProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareDiscoverySessionCallback.class);
- ArgumentCaptor<SubscribeDiscoverySession> subscribeSession = ArgumentCaptor
- .forClass(SubscribeDiscoverySession.class);
-
- // (1) connect successfully
- mDut.attach(mMockLooperHandler, configRequest, mockCallback, null);
- inOrder.verify(mockAwareService).connect(any(), any(), any(), clientProxyCallback.capture(),
- eq(configRequest), eq(false));
- clientProxyCallback.getValue().onConnectSuccess(clientId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockCallback).onAttached(sessionCaptor.capture());
- WifiAwareSession session = sessionCaptor.getValue();
-
- // (2) subscribe: successfully - then terminated
- session.subscribe(subscribeConfig, mockSessionCallback, mMockLooperHandler);
- inOrder.verify(mockAwareService).subscribe(any(), any(), eq(clientId), eq(subscribeConfig),
- sessionProxyCallback.capture());
- sessionProxyCallback.getValue().onSessionStarted(sessionId);
- sessionProxyCallback.getValue().onSessionTerminated(0);
- mMockLooper.dispatchAll();
- inOrder.verify(mockSessionCallback).onSubscribeStarted(subscribeSession.capture());
- inOrder.verify(mockSessionCallback).onSessionTerminated();
-
- // (3) failure when trying to update: NOP
- subscribeSession.getValue().updateSubscribe(subscribeConfig);
-
- verifyNoMoreInteractions(mockCallback, mockSessionCallback, mockAwareService,
- mockSubscribeSession);
- }
-
- /*
- * ConfigRequest Tests
- */
-
- @Test
- public void testConfigRequestBuilderDefaults() {
- ConfigRequest configRequest = new ConfigRequest.Builder().build();
-
- collector.checkThat("mClusterHigh", ConfigRequest.CLUSTER_ID_MAX,
- equalTo(configRequest.mClusterHigh));
- collector.checkThat("mClusterLow", ConfigRequest.CLUSTER_ID_MIN,
- equalTo(configRequest.mClusterLow));
- collector.checkThat("mMasterPreference", 0,
- equalTo(configRequest.mMasterPreference));
- collector.checkThat("mSupport5gBand", true, equalTo(configRequest.mSupport5gBand));
- collector.checkThat("mSupport6gBand", false, equalTo(configRequest.mSupport6gBand));
- collector.checkThat("mDiscoveryWindowInterval.length", 3,
- equalTo(configRequest.mDiscoveryWindowInterval.length));
- collector.checkThat("mDiscoveryWindowInterval[2.4GHz]", ConfigRequest.DW_INTERVAL_NOT_INIT,
- equalTo(configRequest.mDiscoveryWindowInterval[ConfigRequest.NAN_BAND_24GHZ]));
- collector.checkThat("mDiscoveryWindowInterval[5Hz]", ConfigRequest.DW_INTERVAL_NOT_INIT,
- equalTo(configRequest.mDiscoveryWindowInterval[ConfigRequest.NAN_BAND_5GHZ]));
- collector.checkThat("mDiscoveryWindowInterval[6Hz]", ConfigRequest.DW_INTERVAL_NOT_INIT,
- equalTo(configRequest.mDiscoveryWindowInterval[ConfigRequest.NAN_BAND_6GHZ]));
- }
-
- @Test
- public void testConfigRequestBuilder() {
- final int clusterHigh = 100;
- final int clusterLow = 5;
- final int masterPreference = 55;
- final boolean supportBand5g = true;
- final boolean supportBand6g = true;
- final int dwWindow5GHz = 3;
- final int dwWindow6GHz = 4;
-
- ConfigRequest configRequest = new ConfigRequest.Builder().setClusterHigh(clusterHigh)
- .setClusterLow(clusterLow).setMasterPreference(masterPreference)
- .setSupport5gBand(supportBand5g)
- .setSupport6gBand(supportBand6g)
- .setDiscoveryWindowInterval(ConfigRequest.NAN_BAND_5GHZ, dwWindow5GHz)
- .setDiscoveryWindowInterval(ConfigRequest.NAN_BAND_6GHZ, dwWindow6GHz)
- .build();
-
- collector.checkThat("mClusterHigh", clusterHigh, equalTo(configRequest.mClusterHigh));
- collector.checkThat("mClusterLow", clusterLow, equalTo(configRequest.mClusterLow));
- collector.checkThat("mMasterPreference", masterPreference,
- equalTo(configRequest.mMasterPreference));
- collector.checkThat("mSupport5gBand", supportBand5g, equalTo(configRequest.mSupport5gBand));
- collector.checkThat("mSupport6gBand", supportBand6g, equalTo(configRequest.mSupport6gBand));
- collector.checkThat("mDiscoveryWindowInterval.length", 3,
- equalTo(configRequest.mDiscoveryWindowInterval.length));
- collector.checkThat("mDiscoveryWindowInterval[2.4GHz]", ConfigRequest.DW_INTERVAL_NOT_INIT,
- equalTo(configRequest.mDiscoveryWindowInterval[ConfigRequest.NAN_BAND_24GHZ]));
- collector.checkThat("mDiscoveryWindowInterval[5GHz]", dwWindow5GHz,
- equalTo(configRequest.mDiscoveryWindowInterval[ConfigRequest.NAN_BAND_5GHZ]));
- collector.checkThat("mDiscoveryWindowInterval[6GHz]", dwWindow6GHz,
- equalTo(configRequest.mDiscoveryWindowInterval[ConfigRequest.NAN_BAND_6GHZ]));
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testConfigRequestBuilderMasterPrefNegative() {
- ConfigRequest.Builder builder = new ConfigRequest.Builder();
- builder.setMasterPreference(-1);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testConfigRequestBuilderMasterPrefReserved1() {
- new ConfigRequest.Builder().setMasterPreference(1);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testConfigRequestBuilderMasterPrefReserved255() {
- new ConfigRequest.Builder().setMasterPreference(255);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testConfigRequestBuilderMasterPrefTooLarge() {
- new ConfigRequest.Builder().setMasterPreference(256);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testConfigRequestBuilderClusterLowNegative() {
- new ConfigRequest.Builder().setClusterLow(-1);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testConfigRequestBuilderClusterHighNegative() {
- new ConfigRequest.Builder().setClusterHigh(-1);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testConfigRequestBuilderClusterLowAboveMax() {
- new ConfigRequest.Builder().setClusterLow(ConfigRequest.CLUSTER_ID_MAX + 1);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testConfigRequestBuilderClusterHighAboveMax() {
- new ConfigRequest.Builder().setClusterHigh(ConfigRequest.CLUSTER_ID_MAX + 1);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testConfigRequestBuilderClusterLowLargerThanHigh() {
- new ConfigRequest.Builder().setClusterLow(100).setClusterHigh(5).build();
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testConfigRequestBuilderDwIntervalInvalidBand() {
- new ConfigRequest.Builder().setDiscoveryWindowInterval(5, 1).build();
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testConfigRequestBuilderDwIntervalInvalidValueZero() {
- new ConfigRequest.Builder().setDiscoveryWindowInterval(ConfigRequest.NAN_BAND_24GHZ,
- 0).build();
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testConfigRequestBuilderDwIntervalInvalidValueLarge() {
- new ConfigRequest.Builder().setDiscoveryWindowInterval(ConfigRequest.NAN_BAND_5GHZ,
- 6).build();
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testConfigRequestBuilderDwIntervalInvalidValueLargeValidate() {
- ConfigRequest cr = new ConfigRequest.Builder().build();
- cr.mDiscoveryWindowInterval[ConfigRequest.NAN_BAND_5GHZ] = 6;
- cr.validate();
- }
-
- @Test
- public void testConfigRequestParcel() {
- final int clusterHigh = 189;
- final int clusterLow = 25;
- final int masterPreference = 177;
- final boolean supportBand5g = true;
- final boolean supportBand6g = false;
- final int dwWindow24GHz = 1;
- final int dwWindow5GHz = 5;
- final int dwWindow6GHz = 4;
-
- ConfigRequest configRequest = new ConfigRequest.Builder().setClusterHigh(clusterHigh)
- .setClusterLow(clusterLow).setMasterPreference(masterPreference)
- .setSupport5gBand(supportBand5g)
- .setSupport6gBand(supportBand6g)
- .setDiscoveryWindowInterval(ConfigRequest.NAN_BAND_24GHZ, dwWindow24GHz)
- .setDiscoveryWindowInterval(ConfigRequest.NAN_BAND_5GHZ, dwWindow5GHz)
- .setDiscoveryWindowInterval(ConfigRequest.NAN_BAND_6GHZ, dwWindow6GHz)
- .build();
-
- Parcel parcelW = Parcel.obtain();
- configRequest.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- ConfigRequest rereadConfigRequest = ConfigRequest.CREATOR.createFromParcel(parcelR);
-
- assertEquals(configRequest, rereadConfigRequest);
- assertEquals(configRequest.hashCode(), rereadConfigRequest.hashCode());
- }
-
- /*
- * SubscribeConfig Tests
- */
-
- @Test
- public void testSubscribeConfigBuilderDefaults() {
- SubscribeConfig subscribeConfig = new SubscribeConfig.Builder().build();
-
- collector.checkThat("mServiceName", subscribeConfig.mServiceName, equalTo(null));
- collector.checkThat("mServiceSpecificInfo", subscribeConfig.mServiceSpecificInfo,
- equalTo(null));
- collector.checkThat("mMatchFilter", subscribeConfig.mMatchFilter, equalTo(null));
- collector.checkThat("mSubscribeType", subscribeConfig.mSubscribeType,
- equalTo(SubscribeConfig.SUBSCRIBE_TYPE_PASSIVE));
- collector.checkThat("mTtlSec", subscribeConfig.mTtlSec, equalTo(0));
- collector.checkThat("mEnableTerminateNotification",
- subscribeConfig.mEnableTerminateNotification, equalTo(true));
- collector.checkThat("mMinDistanceCmSet", subscribeConfig.mMinDistanceMmSet, equalTo(false));
- collector.checkThat("mMinDistanceMm", subscribeConfig.mMinDistanceMm, equalTo(0));
- collector.checkThat("mMaxDistanceMmSet", subscribeConfig.mMaxDistanceMmSet, equalTo(false));
- collector.checkThat("mMaxDistanceMm", subscribeConfig.mMaxDistanceMm, equalTo(0));
- }
-
- @Test
- public void testSubscribeConfigBuilder() {
- final String serviceName = "some_service_or_other";
- final String serviceSpecificInfo = "long arbitrary string with some info";
- final byte[] matchFilter = { 1, 16, 1, 22 };
- final int subscribeType = SubscribeConfig.SUBSCRIBE_TYPE_PASSIVE;
- final int subscribeTtl = 15;
- final boolean enableTerminateNotification = false;
- final int minDistance = 10;
- final int maxDistance = 50;
-
- SubscribeConfig subscribeConfig = new SubscribeConfig.Builder().setServiceName(serviceName)
- .setServiceSpecificInfo(serviceSpecificInfo.getBytes()).setMatchFilter(
- new TlvBufferUtils.TlvIterable(0, 1, matchFilter).toList())
- .setSubscribeType(subscribeType)
- .setTtlSec(subscribeTtl)
- .setTerminateNotificationEnabled(enableTerminateNotification)
- .setMinDistanceMm(minDistance)
- .setMaxDistanceMm(maxDistance).build();
-
- collector.checkThat("mServiceName", serviceName.getBytes(),
- equalTo(subscribeConfig.mServiceName));
- collector.checkThat("mServiceSpecificInfo",
- serviceSpecificInfo.getBytes(), equalTo(subscribeConfig.mServiceSpecificInfo));
- collector.checkThat("mMatchFilter", matchFilter, equalTo(subscribeConfig.mMatchFilter));
- collector.checkThat("mSubscribeType", subscribeType,
- equalTo(subscribeConfig.mSubscribeType));
- collector.checkThat("mTtlSec", subscribeTtl, equalTo(subscribeConfig.mTtlSec));
- collector.checkThat("mEnableTerminateNotification", enableTerminateNotification,
- equalTo(subscribeConfig.mEnableTerminateNotification));
- collector.checkThat("mMinDistanceMmSet", true, equalTo(subscribeConfig.mMinDistanceMmSet));
- collector.checkThat("mMinDistanceMm", minDistance, equalTo(subscribeConfig.mMinDistanceMm));
- collector.checkThat("mMaxDistanceMmSet", true, equalTo(subscribeConfig.mMaxDistanceMmSet));
- collector.checkThat("mMaxDistanceMm", maxDistance, equalTo(subscribeConfig.mMaxDistanceMm));
- }
-
- @Test
- public void testSubscribeConfigParcel() {
- final String serviceName = "some_service_or_other";
- final String serviceSpecificInfo = "long arbitrary string with some info";
- final byte[] matchFilter = { 1, 16, 1, 22 };
- final int subscribeType = SubscribeConfig.SUBSCRIBE_TYPE_PASSIVE;
- final int subscribeTtl = 15;
- final boolean enableTerminateNotification = true;
- final int minDistance = 10;
- final int maxDistance = 50;
-
- SubscribeConfig subscribeConfig = new SubscribeConfig.Builder().setServiceName(serviceName)
- .setServiceSpecificInfo(serviceSpecificInfo.getBytes()).setMatchFilter(
- new TlvBufferUtils.TlvIterable(0, 1, matchFilter).toList())
- .setSubscribeType(subscribeType)
- .setTtlSec(subscribeTtl)
- .setTerminateNotificationEnabled(enableTerminateNotification)
- .setMinDistanceMm(minDistance)
- .setMaxDistanceMm(maxDistance).build();
-
- Parcel parcelW = Parcel.obtain();
- subscribeConfig.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- SubscribeConfig rereadSubscribeConfig = SubscribeConfig.CREATOR.createFromParcel(parcelR);
-
- assertEquals(subscribeConfig, rereadSubscribeConfig);
- assertEquals(subscribeConfig.hashCode(), rereadSubscribeConfig.hashCode());
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testSubscribeConfigBuilderBadSubscribeType() {
- new SubscribeConfig.Builder().setSubscribeType(10);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testSubscribeConfigBuilderNegativeTtl() {
- new SubscribeConfig.Builder().setTtlSec(-100);
- }
-
- /*
- * PublishConfig Tests
- */
-
- @Test
- public void testPublishConfigBuilderDefaults() {
- PublishConfig publishConfig = new PublishConfig.Builder().build();
-
- collector.checkThat("mServiceName", publishConfig.mServiceName, equalTo(null));
- collector.checkThat("mServiceSpecificInfo", publishConfig.mServiceSpecificInfo,
- equalTo(null));
- collector.checkThat("mMatchFilter", publishConfig.mMatchFilter, equalTo(null));
- collector.checkThat("mPublishType", publishConfig.mPublishType,
- equalTo(PublishConfig.PUBLISH_TYPE_UNSOLICITED));
- collector.checkThat("mTtlSec", publishConfig.mTtlSec, equalTo(0));
- collector.checkThat("mEnableTerminateNotification",
- publishConfig.mEnableTerminateNotification, equalTo(true));
- collector.checkThat("mEnableRanging", publishConfig.mEnableRanging, equalTo(false));
- }
-
- @Test
- public void testPublishConfigBuilder() {
- final String serviceName = "some_service_or_other";
- final String serviceSpecificInfo = "long arbitrary string with some info";
- final byte[] matchFilter = { 1, 16, 1, 22 };
- final int publishType = PublishConfig.PUBLISH_TYPE_SOLICITED;
- final int publishTtl = 15;
- final boolean enableTerminateNotification = false;
- final boolean enableRanging = true;
-
- PublishConfig publishConfig = new PublishConfig.Builder().setServiceName(serviceName)
- .setServiceSpecificInfo(serviceSpecificInfo.getBytes()).setMatchFilter(
- new TlvBufferUtils.TlvIterable(0, 1, matchFilter).toList())
- .setPublishType(publishType)
- .setTtlSec(publishTtl)
- .setTerminateNotificationEnabled(enableTerminateNotification)
- .setRangingEnabled(enableRanging).build();
-
- collector.checkThat("mServiceName", serviceName.getBytes(),
- equalTo(publishConfig.mServiceName));
- collector.checkThat("mServiceSpecificInfo",
- serviceSpecificInfo.getBytes(), equalTo(publishConfig.mServiceSpecificInfo));
- collector.checkThat("mMatchFilter", matchFilter, equalTo(publishConfig.mMatchFilter));
- collector.checkThat("mPublishType", publishType, equalTo(publishConfig.mPublishType));
- collector.checkThat("mTtlSec", publishTtl, equalTo(publishConfig.mTtlSec));
- collector.checkThat("mEnableTerminateNotification", enableTerminateNotification,
- equalTo(publishConfig.mEnableTerminateNotification));
- collector.checkThat("mEnableRanging", enableRanging, equalTo(publishConfig.mEnableRanging));
- }
-
- @Test
- public void testPublishConfigParcel() {
- final String serviceName = "some_service_or_other";
- final String serviceSpecificInfo = "long arbitrary string with some info";
- final byte[] matchFilter = { 1, 16, 1, 22 };
- final int publishType = PublishConfig.PUBLISH_TYPE_SOLICITED;
- final int publishTtl = 15;
- final boolean enableTerminateNotification = false;
- final boolean enableRanging = true;
-
- PublishConfig publishConfig = new PublishConfig.Builder().setServiceName(serviceName)
- .setServiceSpecificInfo(serviceSpecificInfo.getBytes()).setMatchFilter(
- new TlvBufferUtils.TlvIterable(0, 1, matchFilter).toList())
- .setPublishType(publishType)
- .setTtlSec(publishTtl)
- .setTerminateNotificationEnabled(enableTerminateNotification)
- .setRangingEnabled(enableRanging).build();
-
- Parcel parcelW = Parcel.obtain();
- publishConfig.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- PublishConfig rereadPublishConfig = PublishConfig.CREATOR.createFromParcel(parcelR);
-
- assertEquals(publishConfig, rereadPublishConfig);
- assertEquals(publishConfig.hashCode(), rereadPublishConfig.hashCode());
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testPublishConfigBuilderBadPublishType() {
- new PublishConfig.Builder().setPublishType(5);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testPublishConfigBuilderNegativeTtl() {
- new PublishConfig.Builder().setTtlSec(-10);
- }
-
- /*
- * Data-path tests
- */
-
- /**
- * Validate that correct network specifier is generated for client-based data-path.
- */
- @Test
- public void testNetworkSpecifierWithClient() throws Exception {
- final int clientId = 4565;
- final int sessionId = 123;
- final PeerHandle peerHandle = new PeerHandle(123412);
- final byte[] pmk = PMK_VALID;
- final String passphrase = PASSPHRASE_VALID;
- final int port = 5;
- final int transportProtocol = 10;
- final ConfigRequest configRequest = new ConfigRequest.Builder().build();
- final PublishConfig publishConfig = new PublishConfig.Builder().build();
-
- mockApplicationInfo.targetSdkVersion = Build.VERSION_CODES.P;
-
- ArgumentCaptor<WifiAwareSession> sessionCaptor = ArgumentCaptor.forClass(
- WifiAwareSession.class);
- ArgumentCaptor<IWifiAwareEventCallback> clientProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareEventCallback.class);
- ArgumentCaptor<IWifiAwareDiscoverySessionCallback> sessionProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareDiscoverySessionCallback.class);
- ArgumentCaptor<PublishDiscoverySession> publishSession = ArgumentCaptor
- .forClass(PublishDiscoverySession.class);
-
- InOrder inOrder = inOrder(mockCallback, mockSessionCallback, mockAwareService,
- mockPublishSession, mockRttListener);
-
- // (1) connect successfully
- mDut.attach(mMockLooperHandler, configRequest, mockCallback, null);
- inOrder.verify(mockAwareService).connect(any(), any(), any(), clientProxyCallback.capture(),
- eq(configRequest), eq(false));
- clientProxyCallback.getValue().onConnectSuccess(clientId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockCallback).onAttached(sessionCaptor.capture());
- WifiAwareSession session = sessionCaptor.getValue();
-
- // (2) publish successfully
- session.publish(publishConfig, mockSessionCallback, mMockLooperHandler);
- inOrder.verify(mockAwareService).publish(any(), any(), eq(clientId), eq(publishConfig),
- sessionProxyCallback.capture());
- sessionProxyCallback.getValue().onSessionStarted(sessionId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockSessionCallback).onPublishStarted(publishSession.capture());
-
- // (3) request an open (unencrypted) network specifier from the session
- WifiAwareNetworkSpecifier ns =
- (WifiAwareNetworkSpecifier) publishSession.getValue().createNetworkSpecifierOpen(
- peerHandle);
- WifiAwareNetworkSpecifier nsb = new WifiAwareNetworkSpecifier.Builder(
- publishSession.getValue(), peerHandle).build();
-
- // validate format
- collector.checkThat("role", WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_RESPONDER,
- equalTo(ns.role));
- collector.checkThat("client_id", clientId, equalTo(ns.clientId));
- collector.checkThat("session_id", sessionId, equalTo(ns.sessionId));
- collector.checkThat("peer_id", peerHandle.peerId, equalTo(ns.peerId));
-
- collector.checkThat("role", WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_RESPONDER,
- equalTo(nsb.role));
- collector.checkThat("client_id", clientId, equalTo(nsb.clientId));
- collector.checkThat("session_id", sessionId, equalTo(nsb.sessionId));
- collector.checkThat("peer_id", peerHandle.peerId, equalTo(nsb.peerId));
- collector.checkThat("port", 0, equalTo(nsb.port));
- collector.checkThat("transportProtocol", -1, equalTo(nsb.transportProtocol));
-
- // (4) request an encrypted (PMK) network specifier from the session
- ns = (WifiAwareNetworkSpecifier) publishSession.getValue().createNetworkSpecifierPmk(
- peerHandle, pmk);
- nsb = new WifiAwareNetworkSpecifier.Builder(publishSession.getValue(), peerHandle).setPmk(
- pmk).setPort(port).setTransportProtocol(transportProtocol).build();
-
- // validate format
- collector.checkThat("role", WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_RESPONDER,
- equalTo(ns.role));
- collector.checkThat("client_id", clientId, equalTo(ns.clientId));
- collector.checkThat("session_id", sessionId, equalTo(ns.sessionId));
- collector.checkThat("peer_id", peerHandle.peerId, equalTo(ns.peerId));
- collector.checkThat("pmk", pmk , equalTo(ns.pmk));
-
- collector.checkThat("role", WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_RESPONDER,
- equalTo(nsb.role));
- collector.checkThat("client_id", clientId, equalTo(nsb.clientId));
- collector.checkThat("session_id", sessionId, equalTo(nsb.sessionId));
- collector.checkThat("peer_id", peerHandle.peerId, equalTo(nsb.peerId));
- collector.checkThat("pmk", pmk , equalTo(nsb.pmk));
- collector.checkThat("port", port, equalTo(nsb.port));
- collector.checkThat("transportProtocol", transportProtocol, equalTo(nsb.transportProtocol));
-
- // (5) request an encrypted (Passphrase) network specifier from the session
- ns =
- (WifiAwareNetworkSpecifier) publishSession.getValue()
- .createNetworkSpecifierPassphrase(
- peerHandle, passphrase);
- nsb = new WifiAwareNetworkSpecifier.Builder(publishSession.getValue(),
- peerHandle).setPskPassphrase(passphrase).setPort(port).setTransportProtocol(
- transportProtocol).build();
-
- // validate format
- collector.checkThat("role", WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_RESPONDER,
- equalTo(ns.role));
- collector.checkThat("client_id", clientId, equalTo(ns.clientId));
- collector.checkThat("session_id", sessionId, equalTo(ns.sessionId));
- collector.checkThat("peer_id", peerHandle.peerId, equalTo(ns.peerId));
- collector.checkThat("passphrase", passphrase, equalTo(ns.passphrase));
-
- collector.checkThat("role", WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_RESPONDER,
- equalTo(nsb.role));
- collector.checkThat("client_id", clientId, equalTo(nsb.clientId));
- collector.checkThat("session_id", sessionId, equalTo(nsb.sessionId));
- collector.checkThat("peer_id", peerHandle.peerId, equalTo(nsb.peerId));
- collector.checkThat("passphrase", passphrase, equalTo(nsb.passphrase));
- collector.checkThat("port", port, equalTo(nsb.port));
- collector.checkThat("transportProtocol", transportProtocol, equalTo(nsb.transportProtocol));
-
- verifyNoMoreInteractions(mockCallback, mockSessionCallback, mockAwareService,
- mockPublishSession, mockRttListener);
- }
-
- /**
- * Validate that correct network specifier is generated for a direct data-path (i.e.
- * specifying MAC address as opposed to a client-based oqaque specification).
- */
- @Test
- public void testNetworkSpecifierDirect() throws Exception {
- final int clientId = 134;
- final ConfigRequest configRequest = new ConfigRequest.Builder().build();
- final byte[] someMac = HexEncoding.decode("000102030405".toCharArray(), false);
- final int role = WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_INITIATOR;
- final byte[] pmk = PMK_VALID;
- final String passphrase = PASSPHRASE_VALID;
-
- ArgumentCaptor<WifiAwareSession> sessionCaptor = ArgumentCaptor.forClass(
- WifiAwareSession.class);
- ArgumentCaptor<IWifiAwareEventCallback> clientProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareEventCallback.class);
-
- InOrder inOrder = inOrder(mockCallback, mockSessionCallback, mockAwareService,
- mockPublishSession, mockRttListener);
-
- // (1) connect successfully
- mDut.attach(mMockLooperHandler, configRequest, mockCallback, null);
- inOrder.verify(mockAwareService).connect(any(), any(), any(), clientProxyCallback.capture(),
- eq(configRequest), eq(false));
- clientProxyCallback.getValue().onConnectSuccess(clientId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockCallback).onAttached(sessionCaptor.capture());
- WifiAwareSession session = sessionCaptor.getValue();
-
- // (2) request an open (unencrypted) direct network specifier
- WifiAwareNetworkSpecifier ns =
- (WifiAwareNetworkSpecifier) session.createNetworkSpecifierOpen(role, someMac);
-
- // validate format
- collector.checkThat("role", role, equalTo(ns.role));
- collector.checkThat("client_id", clientId, equalTo(ns.clientId));
- collector.checkThat("peer_mac", someMac, equalTo(ns.peerMac));
-
- // (3) request an encrypted (PMK) direct network specifier
- ns = (WifiAwareNetworkSpecifier) session.createNetworkSpecifierPmk(role, someMac, pmk);
-
- // validate format
- collector.checkThat("role", role, equalTo(ns.role));
- collector.checkThat("client_id", clientId, equalTo(ns.clientId));
- collector.checkThat("peer_mac", someMac, equalTo(ns.peerMac));
- collector.checkThat("pmk", pmk, equalTo(ns.pmk));
-
- // (4) request an encrypted (Passphrase) direct network specifier
- ns = (WifiAwareNetworkSpecifier) session.createNetworkSpecifierPassphrase(role, someMac,
- passphrase);
-
- // validate format
- collector.checkThat("role", role, equalTo(ns.role));
- collector.checkThat("client_id", clientId, equalTo(ns.clientId));
- collector.checkThat("peer_mac", someMac, equalTo(ns.peerMac));
- collector.checkThat("passphrase", passphrase, equalTo(ns.passphrase));
-
- verifyNoMoreInteractions(mockCallback, mockSessionCallback, mockAwareService,
- mockPublishSession, mockRttListener);
- }
-
- /**
- * Validate that a null PMK triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierWithClientNullPmk() throws Exception {
- executeNetworkSpecifierWithClient(new PeerHandle(123412), true, null, null, false);
- }
-
- /**
- * Validate that a non-32-bytes PMK triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierWithClientIncorrectLengthPmk() throws Exception {
- executeNetworkSpecifierWithClient(new PeerHandle(123412), true, PMK_INVALID, null, false);
- }
-
- /**
- * Validate that a null Passphrase triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierWithClientNullPassphrase() throws Exception {
- executeNetworkSpecifierWithClient(new PeerHandle(123412), false, null, null, false);
- }
-
- /**
- * Validate that a too short Passphrase triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierWithClientTooShortPassphrase() throws Exception {
- executeNetworkSpecifierWithClient(new PeerHandle(123412), false, null,
- PASSPHRASE_TOO_SHORT, false);
- }
-
- /**
- * Validate that a too long Passphrase triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierWithClientTooLongPassphrase() throws Exception {
- executeNetworkSpecifierWithClient(new PeerHandle(123412), false, null, PASSPHRASE_TOO_LONG,
- false);
- }
-
- /**
- * Validate that a null PeerHandle triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierWithClientNullPeer() throws Exception {
- mockApplicationInfo.targetSdkVersion = Build.VERSION_CODES.P;
- executeNetworkSpecifierWithClient(null, false, null, PASSPHRASE_VALID, false);
- }
-
- /**
- * Validate that a null PeerHandle does not trigger an exception for legacy API.
- */
- @Test
- public void testNetworkSpecifierWithClientNullPeerLegacyApi() throws Exception {
- mockApplicationInfo.targetSdkVersion = Build.VERSION_CODES.O;
- executeNetworkSpecifierWithClient(null, false, null, PASSPHRASE_VALID, false);
- }
-
- /**
- * Validate that a null PMK triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierWithClientNullPmkBuilder() throws Exception {
- executeNetworkSpecifierWithClient(new PeerHandle(123412), true, null, null, true);
- }
-
- /**
- * Validate that a non-32-bytes PMK triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierWithClientIncorrectLengthPmkBuilder() throws Exception {
- executeNetworkSpecifierWithClient(new PeerHandle(123412), true, PMK_INVALID, null, true);
- }
-
- /**
- * Validate that a null Passphrase triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierWithClientNullPassphraseBuilder() throws Exception {
- executeNetworkSpecifierWithClient(new PeerHandle(123412), false, null, null, true);
- }
-
- /**
- * Validate that a too short Passphrase triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierWithClientTooShortPassphraseBuilder() throws Exception {
- executeNetworkSpecifierWithClient(new PeerHandle(123412), false, null,
- PASSPHRASE_TOO_SHORT, true);
- }
-
- /**
- * Validate that a too long Passphrase triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierWithClientTooLongPassphraseBuilder() throws Exception {
- executeNetworkSpecifierWithClient(new PeerHandle(123412), false, null, PASSPHRASE_TOO_LONG,
- true);
- }
-
- /**
- * Validate that a null PeerHandle triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierWithClientNullPeerBuilder() throws Exception {
- executeNetworkSpecifierWithClient(null, false, null, PASSPHRASE_VALID, true);
- }
-
- /**
- * Validate that a null PeerHandle does not trigger an exception for legacy API.
- */
- @Test
- public void testNetworkSpecifierWithClientNullPeerLegacyApiBuilder() throws Exception {
- mockApplicationInfo.targetSdkVersion = Build.VERSION_CODES.O;
- executeNetworkSpecifierWithClient(null, false, null, PASSPHRASE_VALID, false);
- }
-
- @Test(expected = UnsupportedOperationException.class)
- public void testNetworkSpecifierDeprecatedOnNewApi() throws Exception {
- executeNetworkSpecifierWithClient(null, false, null, PASSPHRASE_VALID, false);
- }
-
- private void executeNetworkSpecifierWithClient(PeerHandle peerHandle, boolean doPmk, byte[] pmk,
- String passphrase, boolean useBuilder) throws Exception {
- final int clientId = 4565;
- final int sessionId = 123;
- final ConfigRequest configRequest = new ConfigRequest.Builder().build();
- final PublishConfig publishConfig = new PublishConfig.Builder().build();
-
- ArgumentCaptor<WifiAwareSession> sessionCaptor = ArgumentCaptor.forClass(
- WifiAwareSession.class);
- ArgumentCaptor<IWifiAwareEventCallback> clientProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareEventCallback.class);
- ArgumentCaptor<IWifiAwareDiscoverySessionCallback> sessionProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareDiscoverySessionCallback.class);
- ArgumentCaptor<PublishDiscoverySession> publishSession = ArgumentCaptor
- .forClass(PublishDiscoverySession.class);
-
- InOrder inOrder = inOrder(mockCallback, mockSessionCallback, mockAwareService,
- mockPublishSession, mockRttListener);
-
- // (1) connect successfully
- mDut.attach(mMockLooperHandler, configRequest, mockCallback, null);
- inOrder.verify(mockAwareService).connect(any(), any(), any(), clientProxyCallback.capture(),
- eq(configRequest), eq(false));
- clientProxyCallback.getValue().onConnectSuccess(clientId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockCallback).onAttached(sessionCaptor.capture());
- WifiAwareSession session = sessionCaptor.getValue();
-
- // (2) publish successfully
- session.publish(publishConfig, mockSessionCallback, mMockLooperHandler);
- inOrder.verify(mockAwareService).publish(any(), any(), eq(clientId), eq(publishConfig),
- sessionProxyCallback.capture());
- sessionProxyCallback.getValue().onSessionStarted(sessionId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockSessionCallback).onPublishStarted(publishSession.capture());
-
- // (3) create network specifier
- if (doPmk) {
- if (useBuilder) {
- new WifiAwareNetworkSpecifier.Builder(publishSession.getValue(), peerHandle).setPmk(
- pmk).build();
- } else {
- publishSession.getValue().createNetworkSpecifierPmk(peerHandle, pmk);
- }
- } else {
- if (useBuilder) {
- new WifiAwareNetworkSpecifier.Builder(publishSession.getValue(),
- peerHandle).setPskPassphrase(passphrase).build();
- } else {
- publishSession.getValue().createNetworkSpecifierPassphrase(peerHandle, passphrase);
- }
- }
- }
-
- /**
- * Validate that a null PMK triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierDirectNullPmk() throws Exception {
- executeNetworkSpecifierDirect(HexEncoding.decode("000102030405".toCharArray(), false), true,
- null, null, true);
- }
-
- /**
- * Validate that a non-32-bytes PMK triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierDirectIncorrectLengthPmk() throws Exception {
- executeNetworkSpecifierDirect(HexEncoding.decode("000102030405".toCharArray(), false), true,
- PMK_INVALID, null, true);
- }
-
- /**
- * Validate that a null Passphrase triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierDirectNullPassphrase() throws Exception {
- executeNetworkSpecifierDirect(HexEncoding.decode("000102030405".toCharArray(), false),
- false, null, null, true);
- }
-
- /**
- * Validate that a too short Passphrase triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierDirectTooShortPassphrase() throws Exception {
- executeNetworkSpecifierDirect(HexEncoding.decode("000102030405".toCharArray(), false),
- false, null, PASSPHRASE_TOO_SHORT, true);
- }
-
- /**
- * Validate that a too long Passphrase triggers an exception.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierDirectTooLongPassphrase() throws Exception {
- executeNetworkSpecifierDirect(HexEncoding.decode("000102030405".toCharArray(), false),
- false, null, PASSPHRASE_TOO_LONG, true);
- }
-
- /**
- * Validate that a null peer MAC triggers an exception for an Initiator.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierDirectNullPeerInitiator() throws Exception {
- executeNetworkSpecifierDirect(null, false, null, PASSPHRASE_VALID, true);
- }
-
- /**
- * Validate that a null peer MAC triggers an exception for a Resonder.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierDirectNullPeerResponder() throws Exception {
- executeNetworkSpecifierDirect(null, false, null, PASSPHRASE_VALID, false);
- }
-
- /**
- * Validate that a null peer MAC does not trigger an exception for a Resonder on legacy API.
- */
- @Test
- public void testNetworkSpecifierDirectNullPeerResponderLegacyApi() throws Exception {
- mockApplicationInfo.targetSdkVersion = Build.VERSION_CODES.O;
- executeNetworkSpecifierDirect(null, false, null, PASSPHRASE_VALID, false);
- }
-
- /**
- * Validate that get an exception when creating a network specifier with an invalid port number
- * (<=0).
- */
- @Test(expected = IllegalArgumentException.class)
- public void testNetworkSpecifierBuilderInvalidPortNumber() throws Exception {
- final PeerHandle peerHandle = new PeerHandle(123412);
- final byte[] pmk = PMK_VALID;
- final int port = 0;
-
- DiscoverySession publishSession = executeSessionStartup(true);
-
- WifiAwareNetworkSpecifier nsb = new WifiAwareNetworkSpecifier.Builder(publishSession,
- peerHandle).setPmk(pmk).setPort(port).build();
- }
-
- /**
- * Validate that get an exception when creating a network specifier with port information
- * without also requesting a secure link.
- */
- @Test(expected = IllegalStateException.class)
- public void testNetworkSpecifierBuilderInvalidPortOnInsecure() throws Exception {
- final PeerHandle peerHandle = new PeerHandle(123412);
- final int port = 5;
-
- DiscoverySession publishSession = executeSessionStartup(true);
-
- WifiAwareNetworkSpecifier nsb = new WifiAwareNetworkSpecifier.Builder(publishSession,
- peerHandle).setPort(port).build();
- }
-
- /**
- * Validate that get an exception when creating a network specifier with port information on
- * a responder.
- */
- @Test(expected = IllegalStateException.class)
- public void testNetworkSpecifierBuilderInvalidPortOnResponder() throws Exception {
- final PeerHandle peerHandle = new PeerHandle(123412);
- final int port = 5;
-
- DiscoverySession subscribeSession = executeSessionStartup(false);
-
- WifiAwareNetworkSpecifier nsb = new WifiAwareNetworkSpecifier.Builder(subscribeSession,
- peerHandle).setPort(port).build();
- }
-
- /**
- * Validate that get an exception when creating a network specifier with an invalid transport
- * protocol number (not in [0, 255]).
- */
- @Test
- public void testNetworkSpecifierBuilderInvalidTransportProtocolNumber() throws Exception {
- final PeerHandle peerHandle = new PeerHandle(123412);
- final byte[] pmk = PMK_VALID;
- final int tpNegative = -1;
- final int tpTooLarge = 256;
- final int tpSmallest = 0;
- final int tpLargest = 255;
-
- DiscoverySession publishSession = executeSessionStartup(true);
-
- try {
- WifiAwareNetworkSpecifier nsb = new WifiAwareNetworkSpecifier.Builder(publishSession,
- peerHandle).setPmk(pmk).setTransportProtocol(tpNegative).build();
- assertTrue("No exception on negative transport protocol!", false);
- } catch (IllegalArgumentException e) {
- // nop - exception is correct!
- }
- try {
- WifiAwareNetworkSpecifier nsb = new WifiAwareNetworkSpecifier.Builder(publishSession,
- peerHandle).setPmk(pmk).setTransportProtocol(tpTooLarge).build();
- assertTrue("No exception on >255 transport protocol!", false);
- } catch (IllegalArgumentException e) {
- // nop - exception is correct!
- }
- WifiAwareNetworkSpecifier nsb = new WifiAwareNetworkSpecifier.Builder(publishSession,
- peerHandle).setPmk(pmk).setTransportProtocol(tpSmallest).build();
- nsb = new WifiAwareNetworkSpecifier.Builder(publishSession, peerHandle).setPmk(
- pmk).setTransportProtocol(tpLargest).build();
- }
-
- /**
- * Validate that get an exception when creating a network specifier with transport protocol
- * information without also requesting a secure link.
- */
- @Test(expected = IllegalStateException.class)
- public void testNetworkSpecifierBuilderInvalidTransportProtocolOnInsecure() throws Exception {
- final PeerHandle peerHandle = new PeerHandle(123412);
- final int transportProtocol = 5;
-
- DiscoverySession publishSession = executeSessionStartup(true);
-
- WifiAwareNetworkSpecifier nsb = new WifiAwareNetworkSpecifier.Builder(publishSession,
- peerHandle).setTransportProtocol(transportProtocol).build();
- }
-
- /**
- * Validate that get an exception when creating a network specifier with transport protocol
- * information on a responder.
- */
- @Test(expected = IllegalStateException.class)
- public void testNetworkSpecifierBuilderInvalidTransportProtocolOnResponder() throws Exception {
- final PeerHandle peerHandle = new PeerHandle(123412);
- final int transportProtocol = 5;
-
- DiscoverySession subscribeSession = executeSessionStartup(false);
-
- WifiAwareNetworkSpecifier nsb = new WifiAwareNetworkSpecifier.Builder(subscribeSession,
- peerHandle).setTransportProtocol(transportProtocol).build();
- }
-
- /*
- * Utilities
- */
-
- private void executeNetworkSpecifierDirect(byte[] someMac, boolean doPmk, byte[] pmk,
- String passphrase, boolean doInitiator) throws Exception {
- final int clientId = 134;
- final int role = doInitiator ? WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_INITIATOR
- : WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_RESPONDER;
- final ConfigRequest configRequest = new ConfigRequest.Builder().build();
-
- ArgumentCaptor<WifiAwareSession> sessionCaptor = ArgumentCaptor.forClass(
- WifiAwareSession.class);
- ArgumentCaptor<IWifiAwareEventCallback> clientProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareEventCallback.class);
-
- InOrder inOrder = inOrder(mockCallback, mockSessionCallback, mockAwareService,
- mockPublishSession, mockRttListener);
-
- // (1) connect successfully
- mDut.attach(mMockLooperHandler, configRequest, mockCallback, null);
- inOrder.verify(mockAwareService).connect(any(), any(), any(), clientProxyCallback.capture(),
- eq(configRequest), eq(false));
- clientProxyCallback.getValue().onConnectSuccess(clientId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockCallback).onAttached(sessionCaptor.capture());
-
- // (2) create network specifier
- if (doPmk) {
- sessionCaptor.getValue().createNetworkSpecifierPmk(role, someMac, pmk);
- } else {
- sessionCaptor.getValue().createNetworkSpecifierPassphrase(role, someMac, passphrase);
- }
- }
-
- private DiscoverySession executeSessionStartup(boolean isPublish) throws Exception {
- final int clientId = 4565;
- final int sessionId = 123;
- final PeerHandle peerHandle = new PeerHandle(123412);
- final int port = 5;
- final ConfigRequest configRequest = new ConfigRequest.Builder().build();
- final SubscribeConfig subscribeConfig = new SubscribeConfig.Builder().build();
- final PublishConfig publishConfig = new PublishConfig.Builder().build();
-
- ArgumentCaptor<WifiAwareSession> sessionCaptor = ArgumentCaptor.forClass(
- WifiAwareSession.class);
- ArgumentCaptor<IWifiAwareEventCallback> clientProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareEventCallback.class);
- ArgumentCaptor<IWifiAwareDiscoverySessionCallback> sessionProxyCallback = ArgumentCaptor
- .forClass(IWifiAwareDiscoverySessionCallback.class);
- ArgumentCaptor<PublishDiscoverySession> publishSession = ArgumentCaptor
- .forClass(PublishDiscoverySession.class);
- ArgumentCaptor<SubscribeDiscoverySession> subscribeSession = ArgumentCaptor
- .forClass(SubscribeDiscoverySession.class);
-
-
- InOrder inOrder = inOrder(mockCallback, mockSessionCallback, mockAwareService,
- mockPublishSession, mockRttListener);
-
- // (1) connect successfully
- mDut.attach(mMockLooperHandler, configRequest, mockCallback, null);
- inOrder.verify(mockAwareService).connect(any(), any(), any(), clientProxyCallback.capture(),
- eq(configRequest), eq(false));
- clientProxyCallback.getValue().onConnectSuccess(clientId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockCallback).onAttached(sessionCaptor.capture());
- WifiAwareSession session = sessionCaptor.getValue();
-
- if (isPublish) {
- // (2) publish successfully
- session.publish(publishConfig, mockSessionCallback, mMockLooperHandler);
- inOrder.verify(mockAwareService).publish(any(), any(), eq(clientId), eq(publishConfig),
- sessionProxyCallback.capture());
- sessionProxyCallback.getValue().onSessionStarted(sessionId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockSessionCallback).onPublishStarted(publishSession.capture());
- return publishSession.getValue();
- } else {
- // (2) subscribe successfully
- session.subscribe(subscribeConfig, mockSessionCallback, mMockLooperHandler);
- inOrder.verify(mockAwareService).subscribe(any(), any(), eq(clientId),
- eq(subscribeConfig), sessionProxyCallback.capture());
- sessionProxyCallback.getValue().onSessionStarted(sessionId);
- mMockLooper.dispatchAll();
- inOrder.verify(mockSessionCallback).onSubscribeStarted(subscribeSession.capture());
- return subscribeSession.getValue();
- }
- }
-
- // WifiAwareNetworkSpecifier && WifiAwareNetworkInfo tests
-
- @Test
- public void testWifiAwareNetworkSpecifierParcel() {
- WifiAwareNetworkSpecifier ns = new WifiAwareNetworkSpecifier(NETWORK_SPECIFIER_TYPE_IB,
- WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_RESPONDER, 5, 568, 334,
- HexEncoding.decode("000102030405".toCharArray(), false),
- "01234567890123456789012345678901".getBytes(), "blah blah", 666, 4);
-
- Parcel parcelW = Parcel.obtain();
- ns.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- WifiAwareNetworkSpecifier rereadNs =
- WifiAwareNetworkSpecifier.CREATOR.createFromParcel(parcelR);
-
- assertEquals(ns, rereadNs);
- assertEquals(ns.hashCode(), rereadNs.hashCode());
- }
-
- @Test
- public void testWifiAwareNetworkCapabilitiesParcel() throws UnknownHostException {
- final Inet6Address inet6 = MacAddress.fromString(
- "11:22:33:44:55:66").getLinkLocalIpv6FromEui48Mac();
- // note: placeholder scope = 5
- final Inet6Address inet6Scoped = Inet6Address.getByAddress(null, inet6.getAddress(), 5);
- final int port = 5;
- final int transportProtocol = 6;
-
- assertEquals(inet6Scoped.toString(), "/fe80::1322:33ff:fe44:5566%5");
- WifiAwareNetworkInfo cap = new WifiAwareNetworkInfo(inet6Scoped, port, transportProtocol);
-
- Parcel parcelW = Parcel.obtain();
- cap.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- WifiAwareNetworkInfo rereadCap =
- WifiAwareNetworkInfo.CREATOR.createFromParcel(parcelR);
-
- assertEquals(cap.getPeerIpv6Addr().toString(), "/fe80::1322:33ff:fe44:5566%5");
- assertEquals(cap, rereadCap);
- assertEquals(cap.hashCode(), rereadCap.hashCode());
- }
-
- // ParcelablePeerHandle tests
-
- /**
- * Verify parceling of ParcelablePeerHandle and interoperability with PeerHandle.
- */
- @Test
- public void testParcelablePeerHandleParcel() {
- final PeerHandle peerHandle = new PeerHandle(5);
- final ParcelablePeerHandle parcelablePeerHandle = new ParcelablePeerHandle(peerHandle);
-
- Parcel parcelW = Parcel.obtain();
- parcelablePeerHandle.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- ParcelablePeerHandle rereadParcelablePeerHandle =
- ParcelablePeerHandle.CREATOR.createFromParcel(parcelR);
-
- assertEquals(peerHandle, rereadParcelablePeerHandle);
- assertEquals(peerHandle.hashCode(), rereadParcelablePeerHandle.hashCode());
- assertEquals(parcelablePeerHandle, rereadParcelablePeerHandle);
- assertEquals(parcelablePeerHandle.hashCode(), rereadParcelablePeerHandle.hashCode());
-
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/hotspot2/ConfigParserTest.java b/wifi/tests/src/android/net/wifi/hotspot2/ConfigParserTest.java
deleted file mode 100644
index 439e672..0000000
--- a/wifi/tests/src/android/net/wifi/hotspot2/ConfigParserTest.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright (C) 2016 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.hotspot2;
-
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import android.net.wifi.FakeKeys;
-import android.net.wifi.hotspot2.pps.Credential;
-import android.net.wifi.hotspot2.pps.HomeSp;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-/**
- * Unit tests for {@link android.net.wifi.hotspot2.ConfigParser}.
- */
-@SmallTest
-public class ConfigParserTest {
- /**
- * Hotspot 2.0 Release 1 installation file that contains a Passpoint profile and a
- * CA (Certificate Authority) X.509 certificate {@link FakeKeys#CA_CERT0}.
- */
- private static final String PASSPOINT_INSTALLATION_FILE_WITH_CA_CERT =
- "assets/hsr1/HSR1ProfileWithCACert.base64";
- private static final String PASSPOINT_INSTALLATION_FILE_WITH_UNENCODED_DATA =
- "assets/hsr1/HSR1ProfileWithCACert.conf";
- private static final String PASSPOINT_INSTALLATION_FILE_WITH_INVALID_PART =
- "assets/hsr1/HSR1ProfileWithNonBase64Part.base64";
- private static final String PASSPOINT_INSTALLATION_FILE_WITH_MISSING_BOUNDARY =
- "assets/hsr1/HSR1ProfileWithMissingBoundary.base64";
- private static final String PASSPOINT_INSTALLATION_FILE_WITH_INVALID_CONTENT_TYPE =
- "assets/hsr1/HSR1ProfileWithInvalidContentType.base64";
- private static final String PASSPOINT_INSTALLATION_FILE_WITHOUT_PROFILE =
- "assets/hsr1/HSR1ProfileWithoutProfile.base64";
- private static final String PASSPOINT_INSTALLATION_FILE_WITH_UPDATE_ID =
- "assets/hsr1/HSR1ProfileWithUpdateIdentifier.base64";
-
- /**
- * Read the content of the given resource file into a String.
- *
- * @param filename String name of the file
- * @return String
- * @throws IOException
- */
- private String loadResourceFile(String filename) throws IOException {
- InputStream in = getClass().getClassLoader().getResourceAsStream(filename);
- BufferedReader reader = new BufferedReader(new InputStreamReader(in));
- StringBuilder builder = new StringBuilder();
- String line;
- while ((line = reader.readLine()) != null) {
- builder.append(line).append("\n");
- }
-
- return builder.toString();
- }
-
- /**
- * Generate a {@link PasspointConfiguration} that matches the configuration specified in the
- * XML file {@link #PASSPOINT_INSTALLATION_FILE_WITH_CA_CERT}.
- *
- * @return {@link PasspointConfiguration}
- */
- private PasspointConfiguration generateConfigurationFromProfile() {
- PasspointConfiguration config = new PasspointConfiguration();
-
- // HomeSP configuration.
- HomeSp homeSp = new HomeSp();
- homeSp.setFriendlyName("Example Network");
- homeSp.setFqdn("hotspot.example.net");
- homeSp.setRoamingConsortiumOis(new long[] {0x112233L, 0x445566L});
- config.setHomeSp(homeSp);
-
- // Credential configuration.
- Credential credential = new Credential();
- credential.setRealm("example.com");
- Credential.UserCredential userCredential = new Credential.UserCredential();
- userCredential.setUsername("user");
- userCredential.setPassword("cGFzc3dvcmQ=");
- userCredential.setEapType(21);
- userCredential.setNonEapInnerMethod("MS-CHAP-V2");
- credential.setUserCredential(userCredential);
- Credential.CertificateCredential certCredential = new Credential.CertificateCredential();
- certCredential.setCertType("x509v3");
- byte[] certSha256Fingerprint = new byte[32];
- Arrays.fill(certSha256Fingerprint, (byte)0x1f);
- certCredential.setCertSha256Fingerprint(certSha256Fingerprint);
- credential.setCertCredential(certCredential);
- Credential.SimCredential simCredential = new Credential.SimCredential();
- simCredential.setImsi("123456*");
- simCredential.setEapType(23);
- credential.setSimCredential(simCredential);
- credential.setCaCertificate(FakeKeys.CA_CERT0);
- config.setCredential(credential);
- return config;
- }
-
- /**
- * Verify a valid installation file is parsed successfully with the matching contents.
- *
- * @throws Exception
- */
- @Test
- public void parseConfigFile() throws Exception {
- String configStr = loadResourceFile(PASSPOINT_INSTALLATION_FILE_WITH_CA_CERT);
- PasspointConfiguration expectedConfig = generateConfigurationFromProfile();
- PasspointConfiguration actualConfig =
- ConfigParser.parsePasspointConfig(
- "application/x-wifi-config", configStr.getBytes());
- assertTrue(actualConfig.equals(expectedConfig));
- }
-
- /**
- * Verify that parsing an installation file with invalid MIME type will fail.
- *
- * @throws Exception
- */
- @Test
- public void parseConfigFileWithInvalidMimeType() throws Exception {
- String configStr = loadResourceFile(PASSPOINT_INSTALLATION_FILE_WITH_CA_CERT);
- assertNull(ConfigParser.parsePasspointConfig(
- "application/wifi-config", configStr.getBytes()));
- }
-
- /**
- * Verify that parsing an un-encoded installation file will fail.
- *
- * @throws Exception
- */
- @Test
- public void parseConfigFileWithUnencodedData() throws Exception {
- String configStr = loadResourceFile(PASSPOINT_INSTALLATION_FILE_WITH_UNENCODED_DATA);
- assertNull(ConfigParser.parsePasspointConfig(
- "application/x-wifi-config", configStr.getBytes()));
- }
-
- /**
- * Verify that parsing an installation file that contains a non-base64 part will fail.
- *
- * @throws Exception
- */
- @Test
- public void parseConfigFileWithInvalidPart() throws Exception {
- String configStr = loadResourceFile(PASSPOINT_INSTALLATION_FILE_WITH_INVALID_PART);
- assertNull(ConfigParser.parsePasspointConfig(
- "application/x-wifi-config", configStr.getBytes()));
- }
-
- /**
- * Verify that parsing an installation file that contains a missing boundary string will fail.
- *
- * @throws Exception
- */
- @Test
- public void parseConfigFileWithMissingBoundary() throws Exception {
- String configStr = loadResourceFile(PASSPOINT_INSTALLATION_FILE_WITH_MISSING_BOUNDARY);
- assertNull(ConfigParser.parsePasspointConfig(
- "application/x-wifi-config", configStr.getBytes()));
- }
-
- /**
- * Verify that parsing an installation file that contains a MIME part with an invalid content
- * type will fail.
- *
- * @throws Exception
- */
- @Test
- public void parseConfigFileWithInvalidContentType() throws Exception {
- String configStr = loadResourceFile(PASSPOINT_INSTALLATION_FILE_WITH_INVALID_CONTENT_TYPE);
- assertNull(ConfigParser.parsePasspointConfig(
- "application/x-wifi-config", configStr.getBytes()));
- }
-
- /**
- * Verify that parsing an installation file that doesn't contain a Passpoint profile will fail.
- *
- * @throws Exception
- */
- @Test
- public void parseConfigFileWithoutPasspointProfile() throws Exception {
- String configStr = loadResourceFile(PASSPOINT_INSTALLATION_FILE_WITHOUT_PROFILE);
- assertNull(ConfigParser.parsePasspointConfig(
- "application/x-wifi-config", configStr.getBytes()));
- }
-
- /**
- * Verify a valid installation file is parsed successfully with the matching contents, and that
- * Update identifier is cleared.
- *
- * @throws Exception
- */
- @Test
- public void parseConfigFileWithUpdateIdentifier() throws Exception {
- String configStr = loadResourceFile(PASSPOINT_INSTALLATION_FILE_WITH_UPDATE_ID);
- PasspointConfiguration expectedConfig = generateConfigurationFromProfile();
- PasspointConfiguration actualConfig =
- ConfigParser.parsePasspointConfig(
- "application/x-wifi-config", configStr.getBytes());
- // Expected configuration does not contain an update identifier
- assertTrue(actualConfig.equals(expectedConfig));
- }
-}
\ No newline at end of file
diff --git a/wifi/tests/src/android/net/wifi/hotspot2/OsuProviderTest.java b/wifi/tests/src/android/net/wifi/hotspot2/OsuProviderTest.java
deleted file mode 100644
index 2ded849..0000000
--- a/wifi/tests/src/android/net/wifi/hotspot2/OsuProviderTest.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * 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
- */
-
-package android.net.wifi.hotspot2;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import android.net.Uri;
-import android.net.wifi.WifiSsid;
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Unit tests for {@link android.net.wifi.hotspot2.OsuProvider}.
- */
-@SmallTest
-public class OsuProviderTest {
- private static final WifiSsid TEST_SSID =
- WifiSsid.createFromByteArray("TEST SSID".getBytes(StandardCharsets.UTF_8));
- private static final String TEST_FRIENDLY_NAME = "Friendly Name";
- private static final Map<String, String> TEST_FRIENDLY_NAMES =
- new HashMap<String, String>() {
- {
- put("en", TEST_FRIENDLY_NAME);
- put("kr", TEST_FRIENDLY_NAME + 2);
- put("jp", TEST_FRIENDLY_NAME + 3);
- }
- };
-
- private static final String TEST_SERVICE_DESCRIPTION = "Dummy Service";
- private static final Uri TEST_SERVER_URI = Uri.parse("https://test.com");
- private static final String TEST_NAI = "test.access.com";
- private static final List<Integer> TEST_METHOD_LIST =
- Arrays.asList(OsuProvider.METHOD_SOAP_XML_SPP);
-
- /**
- * Verify parcel write and read consistency for the given {@link OsuProvider}.
- *
- * @param writeInfo The {@link OsuProvider} to verify
- * @throws Exception
- */
- private static void verifyParcel(OsuProvider writeInfo) throws Exception {
- Parcel parcel = Parcel.obtain();
- writeInfo.writeToParcel(parcel, 0);
-
- parcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- OsuProvider readInfo = OsuProvider.CREATOR.createFromParcel(parcel);
-
- assertEquals(writeInfo, readInfo);
- assertEquals(writeInfo.hashCode(), readInfo.hashCode());
- }
-
- /**
- * Verify parcel read/write for an OSU provider containing no information.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithEmptyProviderInfo() throws Exception {
- verifyParcel(new OsuProvider((WifiSsid) null, null, null, null, null, null));
- }
-
- /**
- * Verify parcel read/write for an OSU provider containing full information.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithFullProviderInfo() throws Exception {
- verifyParcel(new OsuProvider(TEST_SSID, TEST_FRIENDLY_NAMES,
- TEST_SERVICE_DESCRIPTION, TEST_SERVER_URI, TEST_NAI, TEST_METHOD_LIST));
- }
-
- /**
- * Verify copy constructor with a null source.
- * @throws Exception
- */
- @Test
- public void verifyCopyConstructorWithNullSource() throws Exception {
- OsuProvider expected = new OsuProvider((WifiSsid) null, null, null, null, null, null);
- assertEquals(expected, new OsuProvider(null));
- }
-
- /**
- * Verify copy constructor with a valid source.
- *
- * @throws Exception
- */
- @Test
- public void verifyCopyConstructorWithValidSource() throws Exception {
- OsuProvider source = new OsuProvider(TEST_SSID, TEST_FRIENDLY_NAMES,
- TEST_SERVICE_DESCRIPTION, TEST_SERVER_URI, TEST_NAI, TEST_METHOD_LIST);
- assertEquals(source, new OsuProvider(source));
- }
-
- /**
- * Verify getter methods.
- *
- * @throws Exception
- */
- @Test
- public void verifyGetters() throws Exception {
- OsuProvider provider = new OsuProvider(TEST_SSID, TEST_FRIENDLY_NAMES,
- TEST_SERVICE_DESCRIPTION, TEST_SERVER_URI, TEST_NAI, TEST_METHOD_LIST);
-
- assertTrue(TEST_SSID.equals(provider.getOsuSsid()));
- assertTrue(TEST_FRIENDLY_NAME.equals(provider.getFriendlyName()));
- assertTrue(TEST_FRIENDLY_NAMES.equals(provider.getFriendlyNameList()));
- assertTrue(TEST_SERVICE_DESCRIPTION.equals(provider.getServiceDescription()));
- assertTrue(TEST_SERVER_URI.equals(provider.getServerUri()));
- assertTrue(TEST_NAI.equals(provider.getNetworkAccessIdentifier()));
- assertTrue(TEST_METHOD_LIST.equals(provider.getMethodList()));
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java b/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java
deleted file mode 100644
index badcf52..0000000
--- a/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java
+++ /dev/null
@@ -1,627 +0,0 @@
-/*
- * Copyright (C) 2016 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.hotspot2;
-
-import static android.net.wifi.WifiConfiguration.METERED_OVERRIDE_NONE;
-
-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.EAPConstants;
-import android.net.wifi.FakeKeys;
-import android.net.wifi.hotspot2.pps.Credential;
-import android.net.wifi.hotspot2.pps.HomeSp;
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-import java.nio.charset.StandardCharsets;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.cert.CertificateEncodingException;
-import java.security.cert.X509Certificate;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Unit tests for {@link android.net.wifi.hotspot2.PasspointConfiguration}.
- */
-@SmallTest
-public class PasspointConfigurationTest {
- private static final int MAX_URL_BYTES = 1023;
- private static final int CERTIFICATE_FINGERPRINT_BYTES = 32;
-
- /**
- * Verify parcel write and read consistency for the given configuration.
- *
- * @param writeConfig The configuration to verify
- * @throws Exception
- */
- private static void verifyParcel(PasspointConfiguration writeConfig) throws Exception {
- Parcel parcel = Parcel.obtain();
- writeConfig.writeToParcel(parcel, 0);
-
- parcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- PasspointConfiguration readConfig =
- PasspointConfiguration.CREATOR.createFromParcel(parcel);
- assertTrue(readConfig.equals(writeConfig));
- }
-
- /**
- * Verify parcel read/write for a default configuration.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithDefault() throws Exception {
- verifyParcel(new PasspointConfiguration());
- }
-
- /**
- * Verify parcel read/write for a configuration that contained the full configuration.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithFullConfiguration() throws Exception {
- verifyParcel(PasspointTestUtils.createConfig());
- }
-
- /**
- * Verify parcel read/write for a configuration that doesn't contain a list of service names.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithoutServiceNames() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- config.setServiceFriendlyNames(null);
- verifyParcel(config);
- }
-
- /**
- * Verify parcel read/write for a configuration that doesn't contain HomeSP.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithoutHomeSP() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- config.setHomeSp(null);
- verifyParcel(config);
- }
-
- /**
- * Verify parcel read/write for a configuration that doesn't contain Credential.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithoutCredential() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- config.setCredential(null);
- verifyParcel(config);
- }
-
- /**
- * Verify parcel read/write for a configuration that doesn't contain Policy.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithoutPolicy() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- config.setPolicy(null);
- verifyParcel(config);
- }
-
- /**
- * Verify parcel read/write for a configuration that doesn't contain subscription update.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithoutSubscriptionUpdate() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- config.setSubscriptionUpdate(null);
- verifyParcel(config);
- }
-
- /**
- * Verify parcel read/write for a configuration that doesn't contain trust root certificate
- * list.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithoutTrustRootCertList() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- config.setTrustRootCertList(null);
- verifyParcel(config);
- }
-
- /**
- * Verify parcel read/write for a configuration that doesn't contain AAA server trusted names
- * list.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithoutAaaServerTrustedNames() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- config.setAaaServerTrustedNames(null);
- verifyParcel(config);
- }
-
- /**
- * Verify that a default/empty configuration is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateDefaultConfig() throws Exception {
- PasspointConfiguration config = new PasspointConfiguration();
-
- assertFalse(config.validate());
- assertFalse(config.validateForR2());
- assertTrue(config.isAutojoinEnabled());
- assertTrue(config.isMacRandomizationEnabled());
- assertFalse(config.isEnhancedMacRandomizationEnabled());
- assertTrue(config.getMeteredOverride() == METERED_OVERRIDE_NONE);
- }
-
- /**
- * Verify that a configuration containing all fields is valid for R1/R2.
- *
- * @throws Exception
- */
- @Test
- public void validateFullConfig() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
-
- assertTrue(config.validate());
- assertFalse(config.isOsuProvisioned());
- }
-
- /**
- * Verify that a configuration containing all fields except for UpdateIdentifier is valid for
- * R1, but invalid for R2.
- *
- * @throws Exception
- */
- @Test
- public void validateFullConfigWithoutUpdateIdentifier() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- config.setUpdateIdentifier(Integer.MIN_VALUE);
-
- assertTrue(config.validate());
- assertFalse(config.validateForR2());
- }
-
- /**
- * Verify that a configuration without Credential is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateConfigWithoutCredential() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- config.setCredential(null);
-
- assertFalse(config.validate());
- assertFalse(config.validateForR2());
- }
-
- /**
- * Verify that a configuration without HomeSP is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateConfigWithoutHomeSp() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- config.setHomeSp(null);
-
- assertFalse(config.validate());
- assertFalse(config.validateForR2());
- }
-
- /**
- * Verify that a configuration without Policy is valid, since Policy configurations
- * are optional for R1 and R2.
- *
- * @throws Exception
- */
- @Test
- public void validateConfigWithoutPolicy() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- config.setPolicy(null);
-
- assertTrue(config.validate());
- }
-
- /**
- * Verify that a configuration without subscription update is valid for R1 and invalid for R2,
- * since subscription update configuration is only applicable for R2.
- *
- * @throws Exception
- */
- @Test
- public void validateConfigWithoutSubscriptionUpdate() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- config.setSubscriptionUpdate(null);
-
- assertTrue(config.validate());
- assertFalse(config.validateForR2());
- }
-
- /**
- * Verify that a configuration without AAA server trusted names is valid for R1 and R2,
- * since AAA server trusted names are optional for R1 and R2.
- *
- * @throws Exception
- */
- @Test
- public void validateConfigWithoutAaaServerTrustedNames() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- config.setAaaServerTrustedNames(null);
-
- assertTrue(config.validate());
- }
-
- /**
- * Verify that a configuration with a trust root certificate URL exceeding the max size
- * is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateConfigWithInvalidTrustRootCertUrl() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- byte[] rawUrlBytes = new byte[MAX_URL_BYTES + 1];
- Map<String, byte[]> trustRootCertList = new HashMap<>();
- Arrays.fill(rawUrlBytes, (byte) 'a');
- trustRootCertList.put(new String(rawUrlBytes, StandardCharsets.UTF_8),
- new byte[CERTIFICATE_FINGERPRINT_BYTES]);
- config.setTrustRootCertList(trustRootCertList);
-
- assertFalse(config.validate());
-
- trustRootCertList = new HashMap<>();
- trustRootCertList.put(null, new byte[CERTIFICATE_FINGERPRINT_BYTES]);
- config.setTrustRootCertList(trustRootCertList);
-
- assertFalse(config.validate());
- assertFalse(config.validateForR2());
- }
-
- /**
- * Verify that a configuration with an invalid trust root certificate fingerprint is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateConfigWithInvalidTrustRootCertFingerprint() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- Map<String, byte[]> trustRootCertList = new HashMap<>();
- trustRootCertList.put("test.cert.com", new byte[CERTIFICATE_FINGERPRINT_BYTES + 1]);
- config.setTrustRootCertList(trustRootCertList);
- assertFalse(config.validate());
-
- trustRootCertList = new HashMap<>();
- trustRootCertList.put("test.cert.com", new byte[CERTIFICATE_FINGERPRINT_BYTES - 1]);
- config.setTrustRootCertList(trustRootCertList);
- assertFalse(config.validate());
-
- trustRootCertList = new HashMap<>();
- trustRootCertList.put("test.cert.com", null);
- config.setTrustRootCertList(trustRootCertList);
- assertFalse(config.validate());
- assertFalse(config.validateForR2());
- }
-
- /**
- * Verify that copy constructor works when pass in a null source.
- *
- * @throws Exception
- */
- @Test
- public void validateCopyConstructorWithNullSource() throws Exception {
- PasspointConfiguration copyConfig = new PasspointConfiguration(null);
- PasspointConfiguration defaultConfig = new PasspointConfiguration();
- assertTrue(copyConfig.equals(defaultConfig));
- }
-
- /**
- * Verify that copy constructor works when pass in a valid source.
- *
- * @throws Exception
- */
- @Test
- public void validateCopyConstructorWithValidSource() throws Exception {
- PasspointConfiguration sourceConfig = PasspointTestUtils.createConfig();
- PasspointConfiguration copyConfig = new PasspointConfiguration(sourceConfig);
- assertTrue(copyConfig.equals(sourceConfig));
- }
-
- /**
- * Verify that a configuration containing all fields is valid for R2.
- *
- * @throws Exception
- */
- @Test
- public void validateFullR2Config() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createR2Config();
- assertTrue(config.validate());
- assertTrue(config.validateForR2());
- assertTrue(config.isOsuProvisioned());
- }
-
- /**
- * Verify that the unique identifier generated is identical for two instances
- *
- * @throws Exception
- */
- @Test
- public void validateUniqueId() throws Exception {
- PasspointConfiguration config1 = PasspointTestUtils.createConfig();
- PasspointConfiguration config2 = PasspointTestUtils.createConfig();
-
- assertEquals(config1.getUniqueId(), config2.getUniqueId());
- }
-
- /**
- * Verify that the unique identifier generated is the same for two instances with different
- * HomeSp node but same FQDN
- *
- * @throws Exception
- */
- @Test
- public void validateUniqueIdDifferentHomeSpSameFqdn() throws Exception {
- PasspointConfiguration config1 = PasspointTestUtils.createConfig();
-
- // Modify config2's RCOIs and friendly name to a different set of values
- PasspointConfiguration config2 = PasspointTestUtils.createConfig();
- HomeSp homeSp = config2.getHomeSp();
- homeSp.setRoamingConsortiumOis(new long[] {0xaa, 0xbb});
- homeSp.setFriendlyName("Some other name");
- config2.setHomeSp(homeSp);
-
- assertEquals(config1.getUniqueId(), config2.getUniqueId());
- }
-
- /**
- * Verify that the unique identifier generated is different for two instances with the same
- * HomeSp node but different FQDN
- *
- * @throws Exception
- */
- @Test
- public void validateUniqueIdSameHomeSpDifferentFqdn() throws Exception {
- PasspointConfiguration config1 = PasspointTestUtils.createConfig();
-
- // Modify config2's FQDN to a different value
- PasspointConfiguration config2 = PasspointTestUtils.createConfig();
- HomeSp homeSp = config2.getHomeSp();
- homeSp.setFqdn("fqdn2.com");
- config2.setHomeSp(homeSp);
-
- assertNotEquals(config1.getUniqueId(), config2.getUniqueId());
- }
-
- /**
- * Verify that the unique identifier generated is different for two instances with different
- * SIM Credential node
- *
- * @throws Exception
- */
- @Test
- public void validateUniqueIdDifferentSimCredential() throws Exception {
- PasspointConfiguration config1 = PasspointTestUtils.createConfig();
-
- // Modify config2's realm and SIM credential to a different set of values
- PasspointConfiguration config2 = PasspointTestUtils.createConfig();
- Credential credential = config2.getCredential();
- credential.setRealm("realm2.example.com");
- credential.getSimCredential().setImsi("350460*");
- config2.setCredential(credential);
-
- assertNotEquals(config1.getUniqueId(), config2.getUniqueId());
- }
-
- /**
- * Verify that the unique identifier generated is different for two instances with different
- * Realm in the Credential node
- *
- * @throws Exception
- */
- @Test
- public void validateUniqueIdDifferentRealm() throws Exception {
- PasspointConfiguration config1 = PasspointTestUtils.createConfig();
-
- // Modify config2's realm to a different set of values
- PasspointConfiguration config2 = PasspointTestUtils.createConfig();
- Credential credential = config2.getCredential();
- credential.setRealm("realm2.example.com");
- config2.setCredential(credential);
-
- assertNotEquals(config1.getUniqueId(), config2.getUniqueId());
- }
-
- /**
- * Verify that the unique identifier generated is the same for two instances with different
- * password and same username in the User Credential node
- *
- * @throws Exception
- */
- @Test
- public void validateUniqueIdSameUserInUserCredential() throws Exception {
- PasspointConfiguration config1 = PasspointTestUtils.createConfig();
- Credential credential = createCredentialWithUserCredential("user", "passwd");
- config1.setCredential(credential);
-
- // Modify config2's Passpowrd to a different set of values
- PasspointConfiguration config2 = PasspointTestUtils.createConfig();
- credential = createCredentialWithUserCredential("user", "newpasswd");
- config2.setCredential(credential);
-
- assertEquals(config1.getUniqueId(), config2.getUniqueId());
- }
-
- /**
- * Verify that the unique identifier generated is different for two instances with different
- * username in the User Credential node
- *
- * @throws Exception
- */
- @Test
- public void validateUniqueIdDifferentUserCredential() throws Exception {
- PasspointConfiguration config1 = PasspointTestUtils.createConfig();
- Credential credential = createCredentialWithUserCredential("user", "passwd");
- config1.setCredential(credential);
-
- // Modify config2's username to a different value
- PasspointConfiguration config2 = PasspointTestUtils.createConfig();
- credential = createCredentialWithUserCredential("user2", "passwd");
- config2.setCredential(credential);
-
- assertNotEquals(config1.getUniqueId(), config2.getUniqueId());
- }
-
- /**
- * Verify that the unique identifier generated is different for two instances with different
- * Cert Credential node
- *
- * @throws Exception
- */
- @Test
- public void validateUniqueIdDifferentCertCredential() throws Exception {
- PasspointConfiguration config1 = PasspointTestUtils.createConfig();
- Credential credential = createCredentialWithCertificateCredential(true, true);
- config1.setCredential(credential);
-
- // Modify config2's cert credential to a different set of values
- PasspointConfiguration config2 = PasspointTestUtils.createConfig();
- credential = createCredentialWithCertificateCredential(false, false);
- config2.setCredential(credential);
-
- assertNotEquals(config1.getUniqueId(), config2.getUniqueId());
- }
-
- /**
- * Helper function for generating certificate credential for testing.
- *
- * @return {@link Credential}
- */
- private static Credential createCredentialWithCertificateCredential(Boolean useCaCert0,
- Boolean useCert0)
- throws NoSuchAlgorithmException, CertificateEncodingException {
- Credential.CertificateCredential certCred = new Credential.CertificateCredential();
- certCred.setCertType("x509v3");
- if (useCert0) {
- certCred.setCertSha256Fingerprint(
- MessageDigest.getInstance("SHA-256").digest(FakeKeys.CLIENT_CERT.getEncoded()));
- } else {
- certCred.setCertSha256Fingerprint(MessageDigest.getInstance("SHA-256")
- .digest(FakeKeys.CLIENT_SUITE_B_RSA3072_CERT.getEncoded()));
- }
- return createCredential(null, certCred, null, new X509Certificate[] {FakeKeys.CLIENT_CERT},
- FakeKeys.RSA_KEY1, useCaCert0 ? FakeKeys.CA_CERT0 : FakeKeys.CA_CERT1);
- }
-
- /**
- * Helper function for generating user credential for testing.
- *
- * @return {@link Credential}
- */
- private static Credential createCredentialWithUserCredential(String username, String password) {
- Credential.UserCredential userCred = new Credential.UserCredential();
- userCred.setUsername(username);
- userCred.setPassword(password);
- userCred.setMachineManaged(true);
- userCred.setAbleToShare(true);
- userCred.setSoftTokenApp("TestApp");
- userCred.setEapType(EAPConstants.EAP_TTLS);
- userCred.setNonEapInnerMethod("MS-CHAP");
- return createCredential(userCred, null, null, null, null, FakeKeys.CA_CERT0);
- }
-
- /**
- * Helper function for generating Credential for testing.
- *
- * @param userCred Instance of UserCredential
- * @param certCred Instance of CertificateCredential
- * @param simCred Instance of SimCredential
- * @param clientCertificateChain Chain of client certificates
- * @param clientPrivateKey Client private key
- * @param caCerts CA certificates
- * @return {@link Credential}
- */
- private static Credential createCredential(Credential.UserCredential userCred,
- Credential.CertificateCredential certCred,
- Credential.SimCredential simCred,
- X509Certificate[] clientCertificateChain, PrivateKey clientPrivateKey,
- X509Certificate... caCerts) {
- Credential cred = new Credential();
- cred.setCreationTimeInMillis(123455L);
- cred.setExpirationTimeInMillis(2310093L);
- cred.setRealm("realm");
- cred.setCheckAaaServerCertStatus(true);
- cred.setUserCredential(userCred);
- cred.setCertCredential(certCred);
- cred.setSimCredential(simCred);
- if (caCerts != null && caCerts.length == 1) {
- cred.setCaCertificate(caCerts[0]);
- } else {
- cred.setCaCertificates(caCerts);
- }
- cred.setClientCertificateChain(clientCertificateChain);
- cred.setClientPrivateKey(clientPrivateKey);
- return cred;
- }
-
- /**
- * Verify that the unique identifier API generates an exception if HomeSP is not initialized.
- *
- * @throws Exception
- */
- @Test (expected = IllegalStateException.class)
- public void validateUniqueIdExceptionWithEmptyHomeSp() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- config.setHomeSp(null);
- String uniqueId = config.getUniqueId();
- }
-
- /**
- * Verify that the unique identifier API generates an exception if Credential is not
- * initialized.
- *
- * @throws Exception
- */
- @Test (expected = IllegalStateException.class)
- public void validateUniqueIdExceptionWithEmptyCredential() throws Exception {
- PasspointConfiguration config = PasspointTestUtils.createConfig();
- config.setCredential(null);
- String uniqueId = config.getUniqueId();
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/hotspot2/PasspointTestUtils.java b/wifi/tests/src/android/net/wifi/hotspot2/PasspointTestUtils.java
deleted file mode 100644
index 5830a1e..0000000
--- a/wifi/tests/src/android/net/wifi/hotspot2/PasspointTestUtils.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * 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.net.wifi.hotspot2;
-
-import android.net.wifi.EAPConstants;
-import android.net.wifi.hotspot2.pps.Credential;
-import android.net.wifi.hotspot2.pps.HomeSp;
-import android.net.wifi.hotspot2.pps.Policy;
-import android.net.wifi.hotspot2.pps.UpdateParameter;
-import android.util.Base64;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class PasspointTestUtils {
- private static final int CERTIFICATE_FINGERPRINT_BYTES = 32;
- private static final int TEST_SUB_ID = 1;
-
- /**
- * Utility function for creating a {@link android.net.wifi.hotspot2.pps.HomeSP}.
- *
- * @return {@link android.net.wifi.hotspot2.pps.HomeSP}
- */
- private static HomeSp createHomeSp() {
- HomeSp homeSp = new HomeSp();
- homeSp.setFqdn("fqdn");
- homeSp.setFriendlyName("friendly name");
- homeSp.setRoamingConsortiumOis(new long[] {0x55, 0x66});
- return homeSp;
- }
-
- /**
- * Utility function for creating a {@link android.net.wifi.hotspot2.pps.Credential}.
- *
- * @return {@link android.net.wifi.hotspot2.pps.Credential}
- */
- private static Credential createCredential() {
- Credential cred = new Credential();
- cred.setRealm("realm");
- cred.setUserCredential(null);
- cred.setCertCredential(null);
- cred.setSimCredential(new Credential.SimCredential());
- cred.getSimCredential().setImsi("1234*");
- cred.getSimCredential().setEapType(EAPConstants.EAP_SIM);
- cred.setCaCertificate(null);
- cred.setClientCertificateChain(null);
- cred.setClientPrivateKey(null);
- return cred;
- }
-
- /**
- * Helper function for creating a {@link Policy} for testing.
- *
- * @return {@link Policy}
- */
- private static Policy createPolicy() {
- Policy policy = new Policy();
- policy.setMinHomeDownlinkBandwidth(123);
- policy.setMinHomeUplinkBandwidth(345);
- policy.setMinRoamingDownlinkBandwidth(567);
- policy.setMinRoamingUplinkBandwidth(789);
- policy.setMaximumBssLoadValue(12);
- policy.setExcludedSsidList(new String[] {"ssid1", "ssid2"});
- HashMap<Integer, String> requiredProtoPortMap = new HashMap<>();
- requiredProtoPortMap.put(12, "23,342,123");
- requiredProtoPortMap.put(23, "789,372,1235");
- policy.setRequiredProtoPortMap(requiredProtoPortMap);
-
- List<Policy.RoamingPartner> preferredRoamingPartnerList = new ArrayList<>();
- Policy.RoamingPartner partner1 = new Policy.RoamingPartner();
- partner1.setFqdn("partner1.com");
- partner1.setFqdnExactMatch(true);
- partner1.setPriority(12);
- partner1.setCountries("us,jp");
- Policy.RoamingPartner partner2 = new Policy.RoamingPartner();
- partner2.setFqdn("partner2.com");
- partner2.setFqdnExactMatch(false);
- partner2.setPriority(42);
- partner2.setCountries("ca,fr");
- preferredRoamingPartnerList.add(partner1);
- preferredRoamingPartnerList.add(partner2);
- policy.setPreferredRoamingPartnerList(preferredRoamingPartnerList);
-
- UpdateParameter policyUpdate = new UpdateParameter();
- policyUpdate.setUpdateIntervalInMinutes(1712);
- policyUpdate.setUpdateMethod(UpdateParameter.UPDATE_METHOD_OMADM);
- policyUpdate.setRestriction(UpdateParameter.UPDATE_RESTRICTION_HOMESP);
- policyUpdate.setServerUri("policy.update.com");
- policyUpdate.setUsername("username");
- policyUpdate.setBase64EncodedPassword(
- Base64.encodeToString("password".getBytes(), Base64.DEFAULT));
- policyUpdate.setTrustRootCertUrl("trust.cert.com");
- policyUpdate.setTrustRootCertSha256Fingerprint(
- new byte[CERTIFICATE_FINGERPRINT_BYTES]);
- policy.setPolicyUpdate(policyUpdate);
-
- return policy;
- }
-
- private static UpdateParameter createSubscriptionUpdate() {
- UpdateParameter subUpdate = new UpdateParameter();
- subUpdate.setUpdateIntervalInMinutes(9021);
- subUpdate.setUpdateMethod(UpdateParameter.UPDATE_METHOD_SSP);
- subUpdate.setRestriction(UpdateParameter.UPDATE_RESTRICTION_ROAMING_PARTNER);
- subUpdate.setServerUri("subscription.update.com");
- subUpdate.setUsername("subUsername");
- subUpdate.setBase64EncodedPassword(
- Base64.encodeToString("subPassword".getBytes(), Base64.DEFAULT));
- subUpdate.setTrustRootCertUrl("subscription.trust.cert.com");
- subUpdate.setTrustRootCertSha256Fingerprint(new byte[CERTIFICATE_FINGERPRINT_BYTES]);
- return subUpdate;
- }
- /**
- * Helper function for creating a {@link PasspointConfiguration} for testing.
- *
- * @return {@link PasspointConfiguration}
- */
- public static PasspointConfiguration createConfig() {
- PasspointConfiguration config = new PasspointConfiguration();
- config.setHomeSp(createHomeSp());
- config.setAaaServerTrustedNames(
- new String[] {"trusted.fqdn.com", "another-trusted.fqdn.com"});
- config.setCredential(createCredential());
- config.setPolicy(createPolicy());
- config.setSubscriptionUpdate(createSubscriptionUpdate());
- Map<String, byte[]> trustRootCertList = new HashMap<>();
- trustRootCertList.put("trustRoot.cert1.com",
- new byte[CERTIFICATE_FINGERPRINT_BYTES]);
- trustRootCertList.put("trustRoot.cert2.com",
- new byte[CERTIFICATE_FINGERPRINT_BYTES]);
- config.setTrustRootCertList(trustRootCertList);
- config.setCredentialPriority(120);
- config.setSubscriptionCreationTimeInMillis(231200);
- config.setSubscriptionExpirationTimeInMillis(2134232);
- config.setSubscriptionType("Gold");
- config.setUsageLimitUsageTimePeriodInMinutes(3600);
- config.setUsageLimitStartTimeInMillis(124214213);
- config.setUsageLimitDataLimit(14121);
- config.setUsageLimitTimeLimitInMinutes(78912);
- Map<String, String> friendlyNames = new HashMap<>();
- friendlyNames.put("en", "ServiceName1");
- friendlyNames.put("kr", "ServiceName2");
- config.setServiceFriendlyNames(friendlyNames);
- config.setSubscriptionId(TEST_SUB_ID);
- return config;
- }
-
- /**
- * Helper function for creating an R2 {@link PasspointConfiguration} for testing.
- *
- * @return {@link PasspointConfiguration}
- */
- public static PasspointConfiguration createR2Config() {
- PasspointConfiguration config = createConfig();
- config.setUpdateIdentifier(1234);
- return config;
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/hotspot2/omadm/PpsMoParserTest.java b/wifi/tests/src/android/net/wifi/hotspot2/omadm/PpsMoParserTest.java
deleted file mode 100644
index 1ac9cb8..0000000
--- a/wifi/tests/src/android/net/wifi/hotspot2/omadm/PpsMoParserTest.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright (C) 2016 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.hotspot2.omadm;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import android.net.wifi.hotspot2.PasspointConfiguration;
-import android.net.wifi.hotspot2.pps.Credential;
-import android.net.wifi.hotspot2.pps.HomeSp;
-import android.net.wifi.hotspot2.pps.Policy;
-import android.net.wifi.hotspot2.pps.UpdateParameter;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Unit tests for {@link android.net.wifi.hotspot2.omadm.PpsMoParser}.
- */
-@SmallTest
-public class PpsMoParserTest {
- private static final String VALID_PPS_MO_XML_FILE = "assets/pps/PerProviderSubscription.xml";
- private static final String PPS_MO_XML_FILE_DUPLICATE_HOMESP =
- "assets/pps/PerProviderSubscription_DuplicateHomeSP.xml";
- private static final String PPS_MO_XML_FILE_DUPLICATE_VALUE =
- "assets/pps/PerProviderSubscription_DuplicateValue.xml";
- private static final String PPS_MO_XML_FILE_MISSING_VALUE =
- "assets/pps/PerProviderSubscription_MissingValue.xml";
- private static final String PPS_MO_XML_FILE_MISSING_NAME =
- "assets/pps/PerProviderSubscription_MissingName.xml";
- private static final String PPS_MO_XML_FILE_INVALID_NODE =
- "assets/pps/PerProviderSubscription_InvalidNode.xml";
- private static final String PPS_MO_XML_FILE_INVALID_NAME =
- "assets/pps/PerProviderSubscription_InvalidName.xml";
-
- /**
- * Read the content of the given resource file into a String.
- *
- * @param filename String name of the file
- * @return String
- * @throws IOException
- */
- private String loadResourceFile(String filename) throws IOException {
- InputStream in = getClass().getClassLoader().getResourceAsStream(filename);
- BufferedReader reader = new BufferedReader(new InputStreamReader(in));
- StringBuilder builder = new StringBuilder();
- String line;
- while ((line = reader.readLine()) != null) {
- builder.append(line).append("\n");
- }
-
- return builder.toString();
- }
-
- /**
- * Generate a {@link PasspointConfiguration} that matches the configuration specified in the
- * XML file {@link #VALID_PPS_MO_XML_FILE}.
- *
- * @return {@link PasspointConfiguration}
- */
- private PasspointConfiguration generateConfigurationFromPPSMOTree() throws Exception {
- DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
- byte[] certFingerprint = new byte[32];
- Arrays.fill(certFingerprint, (byte) 0x1f);
-
- PasspointConfiguration config = new PasspointConfiguration();
- config.setUpdateIdentifier(12);
- config.setCredentialPriority(99);
-
- // AAA Server trust root.
- Map<String, byte[]> trustRootCertList = new HashMap<>();
- trustRootCertList.put("server1.trust.root.com", certFingerprint);
- config.setTrustRootCertList(trustRootCertList);
-
- // Subscription update.
- UpdateParameter subscriptionUpdate = new UpdateParameter();
- subscriptionUpdate.setUpdateIntervalInMinutes(120);
- subscriptionUpdate.setUpdateMethod(UpdateParameter.UPDATE_METHOD_SSP);
- subscriptionUpdate.setRestriction(UpdateParameter.UPDATE_RESTRICTION_ROAMING_PARTNER);
- subscriptionUpdate.setServerUri("subscription.update.com");
- subscriptionUpdate.setUsername("subscriptionUser");
- subscriptionUpdate.setBase64EncodedPassword("subscriptionPass");
- subscriptionUpdate.setTrustRootCertUrl("subscription.update.cert.com");
- subscriptionUpdate.setTrustRootCertSha256Fingerprint(certFingerprint);
- config.setSubscriptionUpdate(subscriptionUpdate);
-
- // Subscription parameters.
- config.setSubscriptionCreationTimeInMillis(format.parse("2016-02-01T10:00:00Z").getTime());
- config.setSubscriptionExpirationTimeInMillis(format.parse("2016-03-01T10:00:00Z").getTime());
- config.setSubscriptionType("Gold");
- config.setUsageLimitDataLimit(921890);
- config.setUsageLimitStartTimeInMillis(format.parse("2016-12-01T10:00:00Z").getTime());
- config.setUsageLimitTimeLimitInMinutes(120);
- config.setUsageLimitUsageTimePeriodInMinutes(99910);
-
- // HomeSP configuration.
- HomeSp homeSp = new HomeSp();
- homeSp.setFriendlyName("Century House");
- homeSp.setFqdn("mi6.co.uk");
- homeSp.setRoamingConsortiumOis(new long[] {0x112233L, 0x445566L});
- homeSp.setIconUrl("icon.test.com");
- Map<String, Long> homeNetworkIds = new HashMap<>();
- homeNetworkIds.put("TestSSID", 0x12345678L);
- homeNetworkIds.put("NullHESSID", null);
- homeSp.setHomeNetworkIds(homeNetworkIds);
- homeSp.setMatchAllOis(new long[] {0x11223344});
- homeSp.setMatchAnyOis(new long[] {0x55667788});
- homeSp.setOtherHomePartners(new String[] {"other.fqdn.com"});
- config.setHomeSp(homeSp);
-
- config.setAaaServerTrustedNames(
- new String[] {"trusted.fqdn.com", "another-trusted.fqdn.com"});
-
- // Credential configuration.
- Credential credential = new Credential();
- credential.setCreationTimeInMillis(format.parse("2016-01-01T10:00:00Z").getTime());
- credential.setExpirationTimeInMillis(format.parse("2016-02-01T10:00:00Z").getTime());
- credential.setRealm("shaken.stirred.com");
- credential.setCheckAaaServerCertStatus(true);
- Credential.UserCredential userCredential = new Credential.UserCredential();
- userCredential.setUsername("james");
- userCredential.setPassword("Ym9uZDAwNw==");
- userCredential.setMachineManaged(true);
- userCredential.setSoftTokenApp("TestApp");
- userCredential.setAbleToShare(true);
- userCredential.setEapType(21);
- userCredential.setNonEapInnerMethod("MS-CHAP-V2");
- credential.setUserCredential(userCredential);
- Credential.CertificateCredential certCredential = new Credential.CertificateCredential();
- certCredential.setCertType("x509v3");
- certCredential.setCertSha256Fingerprint(certFingerprint);
- credential.setCertCredential(certCredential);
- Credential.SimCredential simCredential = new Credential.SimCredential();
- simCredential.setImsi("imsi");
- simCredential.setEapType(24);
- credential.setSimCredential(simCredential);
- config.setCredential(credential);
-
- // Policy configuration.
- Policy policy = new Policy();
- List<Policy.RoamingPartner> preferredRoamingPartnerList = new ArrayList<>();
- Policy.RoamingPartner partner1 = new Policy.RoamingPartner();
- partner1.setFqdn("test1.fqdn.com");
- partner1.setFqdnExactMatch(true);
- partner1.setPriority(127);
- partner1.setCountries("us,fr");
- Policy.RoamingPartner partner2 = new Policy.RoamingPartner();
- partner2.setFqdn("test2.fqdn.com");
- partner2.setFqdnExactMatch(false);
- partner2.setPriority(200);
- partner2.setCountries("*");
- preferredRoamingPartnerList.add(partner1);
- preferredRoamingPartnerList.add(partner2);
- policy.setPreferredRoamingPartnerList(preferredRoamingPartnerList);
- policy.setMinHomeDownlinkBandwidth(23412);
- policy.setMinHomeUplinkBandwidth(9823);
- policy.setMinRoamingDownlinkBandwidth(9271);
- policy.setMinRoamingUplinkBandwidth(2315);
- policy.setExcludedSsidList(new String[] {"excludeSSID"});
- Map<Integer, String> requiredProtoPortMap = new HashMap<>();
- requiredProtoPortMap.put(12, "34,92,234");
- policy.setRequiredProtoPortMap(requiredProtoPortMap);
- policy.setMaximumBssLoadValue(23);
- UpdateParameter policyUpdate = new UpdateParameter();
- policyUpdate.setUpdateIntervalInMinutes(120);
- policyUpdate.setUpdateMethod(UpdateParameter.UPDATE_METHOD_OMADM);
- policyUpdate.setRestriction(UpdateParameter.UPDATE_RESTRICTION_HOMESP);
- policyUpdate.setServerUri("policy.update.com");
- policyUpdate.setUsername("updateUser");
- policyUpdate.setBase64EncodedPassword("updatePass");
- policyUpdate.setTrustRootCertUrl("update.cert.com");
- policyUpdate.setTrustRootCertSha256Fingerprint(certFingerprint);
- policy.setPolicyUpdate(policyUpdate);
- config.setPolicy(policy);
- return config;
- }
-
- /**
- * Parse and verify all supported fields under PPS MO tree.
- *
- * @throws Exception
- */
- @Test
- public void parseValidPPSMOTree() throws Exception {
- String ppsMoTree = loadResourceFile(VALID_PPS_MO_XML_FILE);
- PasspointConfiguration expectedConfig = generateConfigurationFromPPSMOTree();
- PasspointConfiguration actualConfig = PpsMoParser.parseMoText(ppsMoTree);
- assertTrue(actualConfig.equals(expectedConfig));
- }
-
- @Test
- public void parseNullPPSMOTree() throws Exception {
- assertEquals(null, PpsMoParser.parseMoText(null));
- }
-
- @Test
- public void parseEmptyPPSMOTree() throws Exception {
- assertEquals(null, PpsMoParser.parseMoText(new String()));
- }
-
- @Test
- public void parsePPSMOTreeWithDuplicateHomeSP() throws Exception {
- assertEquals(null, PpsMoParser.parseMoText(
- loadResourceFile(PPS_MO_XML_FILE_DUPLICATE_HOMESP)));
- }
-
- @Test
- public void parsePPSMOTreeWithDuplicateValue() throws Exception {
- assertEquals(null, PpsMoParser.parseMoText(
- loadResourceFile(PPS_MO_XML_FILE_DUPLICATE_VALUE)));
- }
-
- @Test
- public void parsePPSMOTreeWithMissingValue() throws Exception {
- assertEquals(null, PpsMoParser.parseMoText(
- loadResourceFile(PPS_MO_XML_FILE_MISSING_VALUE)));
- }
-
- @Test
- public void parsePPSMOTreeWithMissingName() throws Exception {
- assertEquals(null, PpsMoParser.parseMoText(
- loadResourceFile(PPS_MO_XML_FILE_MISSING_NAME)));
- }
-
- @Test
- public void parsePPSMOTreeWithInvalidNode() throws Exception {
- assertEquals(null, PpsMoParser.parseMoText(
- loadResourceFile(PPS_MO_XML_FILE_INVALID_NODE)));
- }
-
- @Test
- public void parsePPSMOTreeWithInvalidName() throws Exception {
- assertEquals(null, PpsMoParser.parseMoText(
- loadResourceFile(PPS_MO_XML_FILE_INVALID_NAME)));
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/hotspot2/omadm/XMLParserTest.java b/wifi/tests/src/android/net/wifi/hotspot2/omadm/XMLParserTest.java
deleted file mode 100644
index 85d0a90..0000000
--- a/wifi/tests/src/android/net/wifi/hotspot2/omadm/XMLParserTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2016 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.hotspot2.omadm;
-
-import static org.junit.Assert.assertTrue;
-
-import android.net.wifi.hotspot2.omadm.XMLNode;
-import android.net.wifi.hotspot2.omadm.XMLParser;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.xml.sax.SAXException;
-
-import java.io.IOException;
-
-/**
- * Unit tests for {@link android.net.wifi.hotspot2.omadm.XMLParser}.
- */
-@SmallTest
-public class XMLParserTest {
- XMLParser mParser;
-
- private static XMLNode createNode(XMLNode parent, String tag, String text) {
- XMLNode node = new XMLNode(parent, tag);
- node.addText(text);
- if (parent != null)
- parent.addChild(node);
- node.close();
- return node;
- }
-
- /**
- * Setup before tests.
- */
- @Before
- public void setUp() throws Exception {
- mParser = new XMLParser();
- }
-
- @Test(expected = IOException.class)
- public void parseNullXML() throws Exception {
- mParser.parse(null);
- }
-
- @Test(expected = IOException.class)
- public void parseEmptyXML() throws Exception {
- mParser.parse(new String());
- }
-
- @Test(expected = SAXException.class)
- public void parseMalformedXML() throws Exception {
- String malformedXmlTree = "<root><child1>test1</child2></root>";
- mParser.parse(malformedXmlTree);
- }
-
- @Test
- public void parseValidXMLTree() throws Exception {
- String xmlTree = "<root><child1>test1</child1><child2>test2</child2></root>";
-
- // Construct the expected XML tree.
- XMLNode expectedRoot = createNode(null, "root", "");
- createNode(expectedRoot, "child1", "test1");
- createNode(expectedRoot, "child2", "test2");
-
- XMLNode actualRoot = mParser.parse(xmlTree);
- assertTrue(actualRoot.equals(expectedRoot));
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/hotspot2/pps/CredentialTest.java b/wifi/tests/src/android/net/wifi/hotspot2/pps/CredentialTest.java
deleted file mode 100644
index a44df40..0000000
--- a/wifi/tests/src/android/net/wifi/hotspot2/pps/CredentialTest.java
+++ /dev/null
@@ -1,636 +0,0 @@
-/*
- * Copyright (C) 2016 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.hotspot2.pps;
-
-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.EAPConstants;
-import android.net.wifi.FakeKeys;
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.cert.CertificateEncodingException;
-import java.security.cert.X509Certificate;
-
-/**
- * Unit tests for {@link android.net.wifi.hotspot2.pps.CredentialTest}.
- */
-@SmallTest
-public class CredentialTest {
- /**
- * Helper function for generating Credential for testing.
- *
- * @param userCred Instance of UserCredential
- * @param certCred Instance of CertificateCredential
- * @param simCred Instance of SimCredential
- * @param clientCertificateChain Chain of client certificates
- * @param clientPrivateKey Client private key
- * @param caCerts CA certificates
- * @return {@link Credential}
- */
- private static Credential createCredential(Credential.UserCredential userCred,
- Credential.CertificateCredential certCred,
- Credential.SimCredential simCred,
- X509Certificate[] clientCertificateChain, PrivateKey clientPrivateKey,
- X509Certificate... caCerts) {
- Credential cred = new Credential();
- cred.setCreationTimeInMillis(123455L);
- cred.setExpirationTimeInMillis(2310093L);
- cred.setRealm("realm");
- cred.setCheckAaaServerCertStatus(true);
- cred.setUserCredential(userCred);
- cred.setCertCredential(certCred);
- cred.setSimCredential(simCred);
- if (caCerts != null && caCerts.length == 1) {
- cred.setCaCertificate(caCerts[0]);
- } else {
- cred.setCaCertificates(caCerts);
- }
- cred.setClientCertificateChain(clientCertificateChain);
- cred.setClientPrivateKey(clientPrivateKey);
- return cred;
- }
-
- /**
- * Helper function for generating certificate credential for testing.
- *
- * @return {@link Credential}
- */
- private static Credential createCredentialWithCertificateCredential()
- throws NoSuchAlgorithmException, CertificateEncodingException {
- Credential.CertificateCredential certCred = new Credential.CertificateCredential();
- certCred.setCertType("x509v3");
- certCred.setCertSha256Fingerprint(
- MessageDigest.getInstance("SHA-256").digest(FakeKeys.CLIENT_CERT.getEncoded()));
- return createCredential(null, certCred, null, new X509Certificate[] {FakeKeys.CLIENT_CERT},
- FakeKeys.RSA_KEY1, FakeKeys.CA_CERT0, FakeKeys.CA_CERT1);
- }
-
- /**
- * Helper function for generating SIM credential for testing.
- *
- * @return {@link Credential}
- */
- private static Credential createCredentialWithSimCredential() {
- Credential.SimCredential simCred = new Credential.SimCredential();
- simCred.setImsi("1234*");
- simCred.setEapType(EAPConstants.EAP_SIM);
- return createCredential(null, null, simCred, null, null, (X509Certificate[]) null);
- }
-
- /**
- * Helper function for generating user credential for testing.
- *
- * @return {@link Credential}
- */
- private static Credential createCredentialWithUserCredential() {
- Credential.UserCredential userCred = new Credential.UserCredential();
- userCred.setUsername("username");
- userCred.setPassword("password");
- userCred.setMachineManaged(true);
- userCred.setAbleToShare(true);
- userCred.setSoftTokenApp("TestApp");
- userCred.setEapType(EAPConstants.EAP_TTLS);
- userCred.setNonEapInnerMethod("MS-CHAP");
- return createCredential(userCred, null, null, null, null, FakeKeys.CA_CERT0);
- }
-
- private static void verifyParcel(Credential writeCred) {
- Parcel parcel = Parcel.obtain();
- writeCred.writeToParcel(parcel, 0);
-
- parcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- Credential readCred = Credential.CREATOR.createFromParcel(parcel);
- assertTrue(readCred.equals(writeCred));
- assertEquals(writeCred.hashCode(), readCred.hashCode());
- }
-
- /**
- * Verify parcel read/write for a default/empty credential.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithDefault() throws Exception {
- verifyParcel(new Credential());
- }
-
- /**
- * Verify parcel read/write for a certificate credential.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithCertificateCredential() throws Exception {
- verifyParcel(createCredentialWithCertificateCredential());
- }
-
- /**
- * Verify parcel read/write for a SIM credential.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithSimCredential() throws Exception {
- verifyParcel(createCredentialWithSimCredential());
- }
-
- /**
- * Verify parcel read/write for a user credential.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithUserCredential() throws Exception {
- verifyParcel(createCredentialWithUserCredential());
- }
-
- /**
- * Verify a valid user credential.
- * @throws Exception
- */
- @Test
- public void validateUserCredential() throws Exception {
- Credential cred = createCredentialWithUserCredential();
-
- // For R1 validation
- assertTrue(cred.validate());
-
- // For R2 validation
- assertTrue(cred.validate());
- }
-
- /**
- * Verify that a user credential without CA Certificate is valid.
- *
- * @throws Exception
- */
- @Test
- public void validateUserCredentialWithoutCaCert() throws Exception {
- Credential cred = createCredentialWithUserCredential();
- cred.setCaCertificate(null);
-
- // Accept a configuration with no CA certificate, the system will use the default cert store
- assertTrue(cred.validate());
- }
-
- /**
- * Verify that a user credential with EAP type other than EAP-TTLS is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUserCredentialWithEapTls() throws Exception {
- Credential cred = createCredentialWithUserCredential();
- cred.getUserCredential().setEapType(EAPConstants.EAP_TLS);
-
- // For R1 validation
- assertFalse(cred.validate());
-
- // For R2 validation
- assertFalse(cred.validate());
- }
-
-
- /**
- * Verify that a user credential without realm is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUserCredentialWithoutRealm() throws Exception {
- Credential cred = createCredentialWithUserCredential();
- cred.setRealm(null);
-
- // For R1 validation
- assertFalse(cred.validate());
-
- // For R2 validation
- assertFalse(cred.validate());
- }
-
- /**
- * Verify that a user credential without username is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUserCredentialWithoutUsername() throws Exception {
- Credential cred = createCredentialWithUserCredential();
- cred.getUserCredential().setUsername(null);
-
- // For R1 validation
- assertFalse(cred.validate());
-
- // For R2 validation
- assertFalse(cred.validate());
- }
-
- /**
- * Verify that a user credential without password is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUserCredentialWithoutPassword() throws Exception {
- Credential cred = createCredentialWithUserCredential();
- cred.getUserCredential().setPassword(null);
-
- // For R1 validation
- assertFalse(cred.validate());
-
- // For R2 validation
- assertFalse(cred.validate());
- }
-
- /**
- * Verify that a user credential without auth methoh (non-EAP inner method) is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUserCredentialWithoutAuthMethod() throws Exception {
- Credential cred = createCredentialWithUserCredential();
- cred.getUserCredential().setNonEapInnerMethod(null);
-
- // For R1 validation
- assertFalse(cred.validate());
-
- // For R2 validation
- assertFalse(cred.validate());
- }
-
- /**
- * Verify a certificate credential. CA Certificate, client certificate chain,
- * and client private key are all required. Also the digest for client
- * certificate must match the fingerprint specified in the certificate credential.
- *
- * @throws Exception
- */
- @Test
- public void validateCertCredential() throws Exception {
- Credential cred = createCredentialWithCertificateCredential();
-
- // For R1 validation
- assertTrue(cred.validate());
-
- // For R2 validation
- assertTrue(cred.validate());
- }
-
- /**
- * Verify that an certificate credential without CA Certificate is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateCertCredentialWithoutCaCert() throws Exception {
- Credential cred = createCredentialWithCertificateCredential();
- cred.setCaCertificate(null);
-
- // Accept a configuration with no CA certificate, the system will use the default cert store
- assertTrue(cred.validate());
- }
-
- /**
- * Verify that a certificate credential without client certificate chain is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateCertCredentialWithoutClientCertChain() throws Exception {
- Credential cred = createCredentialWithCertificateCredential();
- cred.setClientCertificateChain(null);
-
- // For R1 validation
- assertFalse(cred.validate());
-
- // For R2 validation
- assertFalse(cred.validate());
- }
-
- /**
- * Verify that a certificate credential without client private key is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateCertCredentialWithoutClientPrivateKey() throws Exception {
- Credential cred = createCredentialWithCertificateCredential();
- cred.setClientPrivateKey(null);
-
- // For R1 validation
- assertFalse(cred.validate());
-
- // For R2 validation
- assertFalse(cred.validate());
- }
-
- /**
- * Verify that a certificate credential with mismatch client certificate fingerprint
- * is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateCertCredentialWithMismatchFingerprint() throws Exception {
- Credential cred = createCredentialWithCertificateCredential();
- cred.getCertCredential().setCertSha256Fingerprint(new byte[32]);
-
- // For R1 validation
- assertFalse(cred.validate());
-
- // For R2 validation
- assertFalse(cred.validate());
- }
-
- /**
- * Verify a SIM credential using EAP-SIM.
- *
- * @throws Exception
- */
- @Test
- public void validateSimCredentialWithEapSim() throws Exception {
- Credential cred = createCredentialWithSimCredential();
-
- // For R1 validation
- assertTrue(cred.validate());
-
- // For R2 validation
- assertTrue(cred.validate());
- }
-
- /**
- * Verify a SIM credential using EAP-AKA.
- *
- * @throws Exception
- */
- @Test
- public void validateSimCredentialWithEapAka() throws Exception {
- Credential cred = createCredentialWithSimCredential();
- cred.getSimCredential().setEapType(EAPConstants.EAP_AKA);
-
- // For R1 validation
- assertTrue(cred.validate());
-
- // For R2 validation
- assertTrue(cred.validate());
- }
-
- /**
- * Verify a SIM credential using EAP-AKA-PRIME.
- *
- * @throws Exception
- */
- @Test
- public void validateSimCredentialWithEapAkaPrime() throws Exception {
- Credential cred = createCredentialWithSimCredential();
- cred.getSimCredential().setEapType(EAPConstants.EAP_AKA_PRIME);
-
- // For R1 validation
- assertTrue(cred.validate());
-
- // For R2 validation
- assertTrue(cred.validate());
- }
-
- /**
- * Verify that a SIM credential without IMSI is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateSimCredentialWithoutIMSI() throws Exception {
- Credential cred = createCredentialWithSimCredential();
- cred.getSimCredential().setImsi(null);
-
- // For R1 validation
- assertFalse(cred.validate());
-
- // For R2 validation
- assertFalse(cred.validate());
- }
-
- /**
- * Verify that a SIM credential with an invalid IMSI is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateSimCredentialWithInvalidIMSI() throws Exception {
- Credential cred = createCredentialWithSimCredential();
- cred.getSimCredential().setImsi("dummy");
-
- // For R1 validation
- assertFalse(cred.validate());
-
- // For R2 validation
- assertFalse(cred.validate());
- }
-
- /**
- * Verify that a SIM credential with invalid EAP type is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateSimCredentialWithEapTls() throws Exception {
- Credential cred = createCredentialWithSimCredential();
- cred.getSimCredential().setEapType(EAPConstants.EAP_TLS);
-
- // For R1 validation
- assertFalse(cred.validate());
-
- // For R2 validation
- assertFalse(cred.validate());
- }
-
- /**
- * Verify that a credential contained both a user and a SIM credential is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateCredentialWithUserAndSimCredential() throws Exception {
- Credential cred = createCredentialWithUserCredential();
- // Setup SIM credential.
- Credential.SimCredential simCredential = new Credential.SimCredential();
- simCredential.setImsi("1234*");
- simCredential.setEapType(EAPConstants.EAP_SIM);
- cred.setSimCredential(simCredential);
-
- // For R1 validation
- assertFalse(cred.validate());
-
- // For R2 validation
- assertFalse(cred.validate());
- }
-
- /**
- * Verify that copy constructor works when pass in a null source.
- *
- * @throws Exception
- */
- @Test
- public void validateCopyConstructorWithNullSource() throws Exception {
- Credential copyCred = new Credential(null);
- Credential defaultCred = new Credential();
- assertTrue(copyCred.equals(defaultCred));
- }
-
- /**
- * Verify that copy constructor works when pass in a source with user credential.
- *
- * @throws Exception
- */
- @Test
- public void validateCopyConstructorWithSourceWithUserCred() throws Exception {
- Credential sourceCred = createCredentialWithUserCredential();
- Credential copyCred = new Credential(sourceCred);
- assertTrue(copyCred.equals(sourceCred));
- }
-
- /**
- * Verify that copy constructor works when pass in a source with certificate credential.
- *
- * @throws Exception
- */
- @Test
- public void validateCopyConstructorWithSourceWithCertCred() throws Exception {
- Credential sourceCred = createCredentialWithCertificateCredential();
- Credential copyCred = new Credential(sourceCred);
- assertTrue(copyCred.equals(sourceCred));
- }
-
- /**
- * Verify that copy constructor works when pass in a source with SIM credential.
- *
- * @throws Exception
- */
- @Test
- public void validateCopyConstructorWithSourceWithSimCred() throws Exception {
- Credential sourceCred = createCredentialWithSimCredential();
- Credential copyCred = new Credential(sourceCred);
- assertTrue(copyCred.equals(sourceCred));
- }
-
- /**
- * Verify that two certificates are identical.
- */
- @Test
- public void validateTwoCertificateIdentical() {
- assertTrue(Credential.isX509CertificateEquals(FakeKeys.CA_CERT1, FakeKeys.CA_CERT1));
- }
-
- /**
- * Verify that two certificates are different.
- */
- @Test
- public void validateTwoCertificateDifferent() {
- assertFalse(Credential.isX509CertificateEquals(FakeKeys.CA_CERT0, FakeKeys.CA_CERT1));
- }
-
- /**
- * Verify that unique identifiers are the same for objects with the same credentials
- */
- @Test
- public void testUniqueIdSameCredentialTypes() throws Exception {
- assertEquals(createCredentialWithSimCredential().getUniqueId(),
- createCredentialWithSimCredential().getUniqueId());
- assertEquals(createCredentialWithCertificateCredential().getUniqueId(),
- createCredentialWithCertificateCredential().getUniqueId());
- assertEquals(createCredentialWithUserCredential().getUniqueId(),
- createCredentialWithUserCredential().getUniqueId());
- }
-
- /**
- * Verify that unique identifiers are different for each credential
- */
- @Test
- public void testUniqueIdDifferentForDifferentCredentialTypes() throws Exception {
- Credential simCred = createCredentialWithSimCredential();
- Credential certCred = createCredentialWithCertificateCredential();
- Credential userCred = createCredentialWithUserCredential();
-
- assertNotEquals(simCred.getUniqueId(), userCred.getUniqueId());
- assertNotEquals(simCred.getUniqueId(), certCred.getUniqueId());
- assertNotEquals(certCred.getUniqueId(), userCred.getUniqueId());
- }
-
- /**
- * Verify that unique identifiers are different for a credential with different values
- */
- @Test
- public void testUniqueIdDifferentForSimCredentialsWithDifferentValues() throws Exception {
- Credential simCred1 = createCredentialWithSimCredential();
- Credential simCred2 = createCredentialWithSimCredential();
- simCred2.getSimCredential().setImsi("567890*");
-
- assertNotEquals(simCred1.getUniqueId(), simCred2.getUniqueId());
- }
-
- /**
- * Verify that unique identifiers are different for a credential with different username
- */
- @Test
- public void testUniqueIdDifferentForUserCredentialsWithDifferentUsername() throws Exception {
- Credential userCred1 = createCredentialWithUserCredential();
- Credential userCred2 = createCredentialWithUserCredential();
- userCred2.getUserCredential().setUsername("anotheruser");
-
- assertNotEquals(userCred1.getUniqueId(), userCred2.getUniqueId());
- }
-
- /**
- * Verify that unique identifiers are different for a credential with different password and
- * other values other than username
- */
- @Test
- public void testUniqueIdSameForUserCredentialsWithDifferentPassword() throws Exception {
- Credential userCred1 = createCredentialWithUserCredential();
- Credential userCred2 = createCredentialWithUserCredential();
- userCred2.getUserCredential().setPassword("someotherpassword!");
- userCred2.getUserCredential().setMachineManaged(false);
- userCred2.getUserCredential().setAbleToShare(false);
- userCred2.getUserCredential().setSoftTokenApp("TestApp2");
- userCred2.getUserCredential().setNonEapInnerMethod("PAP");
-
- assertEquals(userCred1.getUniqueId(), userCred2.getUniqueId());
- }
-
- /**
- * Verify that unique identifiers are different for a cert credential with different values
- */
- @Test
- public void testUniqueIdDifferentForCertCredentialsWithDifferentValues() throws Exception {
- Credential certCred1 = createCredentialWithCertificateCredential();
- Credential certCred2 = createCredentialWithCertificateCredential();
- certCred2.getCertCredential().setCertSha256Fingerprint(
- MessageDigest.getInstance("SHA-256").digest(FakeKeys.CA_CERT0.getEncoded()));
-
- assertNotEquals(certCred1.getUniqueId(), certCred2.getUniqueId());
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/hotspot2/pps/HomeSpTest.java b/wifi/tests/src/android/net/wifi/hotspot2/pps/HomeSpTest.java
deleted file mode 100644
index fe889fc..0000000
--- a/wifi/tests/src/android/net/wifi/hotspot2/pps/HomeSpTest.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Copyright (C) 2016 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.hotspot2.pps;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Unit tests for {@link android.net.wifi.hotspot2.pps.HomeSp}.
- */
-@SmallTest
-public class HomeSpTest {
- private static final String[] OTHER_HOME_PARTNER_LIST = new String[]{"partner1", "partner2"};
-
- /**
- * Helper function for creating a map of home network IDs for testing.
- *
- * @return Map of home network IDs
- */
- private static Map<String, Long> createHomeNetworkIds() {
- Map<String, Long> homeNetworkIds = new HashMap<>();
- homeNetworkIds.put("ssid", 0x1234L);
- homeNetworkIds.put("nullhessid", null);
- return homeNetworkIds;
- }
-
- /**
- * Helper function for creating a HomeSp for testing.
- *
- * @param homeNetworkIds The map of home network IDs associated with HomeSp
- * @return {@link HomeSp}
- */
- private static HomeSp createHomeSp(Map<String, Long> homeNetworkIds) {
- HomeSp homeSp = new HomeSp();
- homeSp.setFqdn("fqdn");
- homeSp.setFriendlyName("friendly name");
- homeSp.setIconUrl("icon.url");
- homeSp.setHomeNetworkIds(homeNetworkIds);
- homeSp.setMatchAllOis(new long[] {0x11L, 0x22L});
- homeSp.setMatchAnyOis(new long[] {0x33L, 0x44L});
- homeSp.setOtherHomePartners(OTHER_HOME_PARTNER_LIST);
- homeSp.setRoamingConsortiumOis(new long[] {0x55, 0x66});
- return homeSp;
- }
-
- /**
- * Helper function for creating a HomeSp with home network IDs for testing.
- *
- * @return {@link HomeSp}
- */
- private static HomeSp createHomeSpWithHomeNetworkIds() {
- return createHomeSp(createHomeNetworkIds());
- }
-
- /**
- * Helper function for creating a HomeSp without home network IDs for testing.
- *
- * @return {@link HomeSp}
- */
- private static HomeSp createHomeSpWithoutHomeNetworkIds() {
- return createHomeSp(null);
- }
-
- /**
- * Helper function for verifying HomeSp after parcel write then read.
- * @param writeHomeSp
- * @throws Exception
- */
- private static void verifyParcel(HomeSp writeHomeSp) throws Exception {
- Parcel parcel = Parcel.obtain();
- writeHomeSp.writeToParcel(parcel, 0);
-
- parcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- HomeSp readHomeSp = HomeSp.CREATOR.createFromParcel(parcel);
- assertTrue(readHomeSp.equals(writeHomeSp));
- }
-
- /**
- * Verify parcel read/write for an empty HomeSp.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithEmptyHomeSp() throws Exception {
- verifyParcel(new HomeSp());
- }
-
- /**
- * Verify parcel read/write for a HomeSp containing Home Network IDs.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithHomeNetworkIds() throws Exception {
- verifyParcel(createHomeSpWithHomeNetworkIds());
- }
-
- /**
- * Verify parcel read/write for a HomeSp without Home Network IDs.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithoutHomeNetworkIds() throws Exception {
- verifyParcel(createHomeSpWithoutHomeNetworkIds());
- }
-
- /**
- * Verify that a HomeSp is valid when both FQDN and Friendly Name
- * are provided.
- *
- * @throws Exception
- */
- @Test
- public void validateValidHomeSp() throws Exception {
- HomeSp homeSp = createHomeSpWithHomeNetworkIds();
- assertTrue(homeSp.validate());
- }
-
- /**
- * Verify that a HomeSp is not valid when FQDN is not provided
- *
- * @throws Exception
- */
- @Test
- public void validateHomeSpWithoutFqdn() throws Exception {
- HomeSp homeSp = createHomeSpWithHomeNetworkIds();
- homeSp.setFqdn(null);
- assertFalse(homeSp.validate());
- }
-
- /**
- * Verify that a HomeSp is not valid when Friendly Name is not provided
- *
- * @throws Exception
- */
- @Test
- public void validateHomeSpWithoutFriendlyName() throws Exception {
- HomeSp homeSp = createHomeSpWithHomeNetworkIds();
- homeSp.setFriendlyName(null);
- assertFalse(homeSp.validate());
- }
-
- /**
- * Verify that a HomeSp is valid when the optional Home Network IDs are
- * not provided.
- *
- * @throws Exception
- */
- @Test
- public void validateHomeSpWithoutHomeNetworkIds() throws Exception {
- HomeSp homeSp = createHomeSpWithoutHomeNetworkIds();
- assertTrue(homeSp.validate());
- }
-
- /**
- * Verify that a HomeSp is invalid when the optional Home Network IDs
- * contained an invalid SSID (exceeding maximum number of bytes).
- *
- * @throws Exception
- */
- @Test
- public void validateHomeSpWithInvalidHomeNetworkIds() throws Exception {
- HomeSp homeSp = createHomeSpWithoutHomeNetworkIds();
- // HomeNetworkID with SSID exceeding the maximum length.
- Map<String, Long> homeNetworkIds = new HashMap<>();
- byte[] rawSsidBytes = new byte[33];
- Arrays.fill(rawSsidBytes, (byte) 'a');
- homeNetworkIds.put(new String(rawSsidBytes, StandardCharsets.UTF_8), 0x1234L);
- homeSp.setHomeNetworkIds(homeNetworkIds);
- assertFalse(homeSp.validate());
- }
-
- /**
- * Verify that copy constructor works when pass in a null source.
- *
- * @throws Exception
- */
- @Test
- public void validateCopyConstructorFromNullSource() throws Exception {
- HomeSp copySp = new HomeSp(null);
- HomeSp defaultSp = new HomeSp();
- assertTrue(copySp.equals(defaultSp));
- }
-
- /**
- * Verify that copy constructor works when pass in a valid source.
- *
- * @throws Exception
- */
- @Test
- public void validateCopyConstructorFromValidSource() throws Exception {
- HomeSp sourceSp = createHomeSpWithHomeNetworkIds();
- HomeSp copySp = new HomeSp(sourceSp);
- assertTrue(copySp.equals(sourceSp));
- }
-
- /**
- * Verify that the getOtherHomePartnersList gets the list of partners as expected.
- *
- * @throws Exception
- */
- @Test
- public void validateGetOtherHomePartnersList() throws Exception {
- HomeSp homeSp = createHomeSpWithoutHomeNetworkIds();
-
- Collection<String> otherHomePartnersList = homeSp.getOtherHomePartnersList();
- assertEquals(2, otherHomePartnersList.size());
- assertTrue(Arrays.equals(OTHER_HOME_PARTNER_LIST, otherHomePartnersList.toArray()));
- }
-
- /**
- * Verify that the setOtherHomePartnersList sets the list of partners as expected.
- *
- * @throws Exception
- */
- @Test
- public void validateSetOtherHomePartnersList() throws Exception {
- HomeSp homeSp = createHomeSpWithoutHomeNetworkIds();
-
- final Collection<String> homePartners =
- new ArrayList<>(Arrays.asList(OTHER_HOME_PARTNER_LIST));
-
- homeSp.setOtherHomePartnersList(homePartners);
- assertTrue(Arrays.equals(homeSp.getOtherHomePartners(), OTHER_HOME_PARTNER_LIST));
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/hotspot2/pps/PolicyTest.java b/wifi/tests/src/android/net/wifi/hotspot2/pps/PolicyTest.java
deleted file mode 100644
index 980b199..0000000
--- a/wifi/tests/src/android/net/wifi/hotspot2/pps/PolicyTest.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * 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
- */
-
-package android.net.wifi.hotspot2.pps;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import android.os.Parcel;
-import android.util.Base64;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Unit tests for {@link android.net.wifi.hotspot2.pps.Policy}.
- */
-@SmallTest
-public class PolicyTest {
- private static final int MAX_NUMBER_OF_EXCLUDED_SSIDS = 128;
- private static final int MAX_SSID_BYTES = 32;
- private static final int MAX_PORT_STRING_BYTES = 64;
-
- /**
- * Helper function for creating a {@link Policy} for testing.
- *
- * @return {@link Policy}
- */
- private static Policy createPolicy() {
- Policy policy = new Policy();
- policy.setMinHomeDownlinkBandwidth(123);
- policy.setMinHomeUplinkBandwidth(345);
- policy.setMinRoamingDownlinkBandwidth(567);
- policy.setMinRoamingUplinkBandwidth(789);
- policy.setExcludedSsidList(new String[] {"ssid1", "ssid2"});
- Map<Integer, String> requiredProtoPortMap = new HashMap<>();
- requiredProtoPortMap.put(12, "23,342,123");
- requiredProtoPortMap.put(23, "789,372,1235");
- policy.setRequiredProtoPortMap(requiredProtoPortMap);
- policy.setMaximumBssLoadValue(12);
-
- List<Policy.RoamingPartner> preferredRoamingPartnerList = new ArrayList<>();
- Policy.RoamingPartner partner1 = new Policy.RoamingPartner();
- partner1.setFqdn("partner1.com");
- partner1.setFqdnExactMatch(true);
- partner1.setPriority(12);
- partner1.setCountries("us,jp");
- Policy.RoamingPartner partner2 = new Policy.RoamingPartner();
- partner2.setFqdn("partner2.com");
- partner2.setFqdnExactMatch(false);
- partner2.setPriority(42);
- partner2.setCountries("ca,fr");
- preferredRoamingPartnerList.add(partner1);
- preferredRoamingPartnerList.add(partner2);
- policy.setPreferredRoamingPartnerList(preferredRoamingPartnerList);
-
- UpdateParameter policyUpdate = new UpdateParameter();
- policyUpdate.setUpdateIntervalInMinutes(1712);
- policyUpdate.setUpdateMethod(UpdateParameter.UPDATE_METHOD_OMADM);
- policyUpdate.setRestriction(UpdateParameter.UPDATE_RESTRICTION_HOMESP);
- policyUpdate.setServerUri("policy.update.com");
- policyUpdate.setUsername("username");
- policyUpdate.setBase64EncodedPassword(
- Base64.encodeToString("password".getBytes(), Base64.DEFAULT));
- policyUpdate.setTrustRootCertUrl("trust.cert.com");
- policyUpdate.setTrustRootCertSha256Fingerprint(new byte[32]);
- policy.setPolicyUpdate(policyUpdate);
-
- return policy;
- }
-
- /**
- * Helper function for verifying Policy after parcel write then read.
- * @param policyToWrite
- * @throws Exception
- */
- private static void verifyParcel(Policy policyToWrite) throws Exception {
- Parcel parcel = Parcel.obtain();
- policyToWrite.writeToParcel(parcel, 0);
-
- parcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- Policy policyFromRead = Policy.CREATOR.createFromParcel(parcel);
- assertTrue(policyFromRead.equals(policyToWrite));
- }
-
- /**
- * Verify parcel read/write for an empty Policy.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithEmptyPolicy() throws Exception {
- verifyParcel(new Policy());
- }
-
- /**
- * Verify parcel read/write for a Policy with all fields set.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithFullPolicy() throws Exception {
- verifyParcel(createPolicy());
- }
-
- /**
- * Verify parcel read/write for a Policy without protocol port map.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithoutProtoPortMap() throws Exception {
- Policy policy = createPolicy();
- policy.setRequiredProtoPortMap(null);
- verifyParcel(policy);
- }
-
- /**
- * Verify parcel read/write for a Policy without preferred roaming partner list.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithoutPreferredRoamingPartnerList() throws Exception {
- Policy policy = createPolicy();
- policy.setPreferredRoamingPartnerList(null);
- verifyParcel(policy);
- }
-
- /**
- * Verify parcel read/write for a Policy without policy update parameters.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithoutPolicyUpdate() throws Exception {
- Policy policy = createPolicy();
- policy.setPolicyUpdate(null);
- verifyParcel(policy);
- }
-
- /**
- * Verify that policy created using copy constructor with null source should be the same
- * as the policy created using default constructor.
- *
- * @throws Exception
- */
- @Test
- public void verifyCopyConstructionWithNullSource() throws Exception {
- Policy copyPolicy = new Policy(null);
- Policy defaultPolicy = new Policy();
- assertTrue(defaultPolicy.equals(copyPolicy));
- }
-
- /**
- * Verify that policy created using copy constructor with a valid source should be the
- * same as the source.
- *
- * @throws Exception
- */
- @Test
- public void verifyCopyConstructionWithFullPolicy() throws Exception {
- Policy policy = createPolicy();
- Policy copyPolicy = new Policy(policy);
- assertTrue(policy.equals(copyPolicy));
- }
-
- /**
- * Verify that a default policy (with no informatio) is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validatePolicyWithDefault() throws Exception {
- Policy policy = new Policy();
- assertFalse(policy.validate());
- }
-
- /**
- * Verify that a policy created using {@link #createPolicy} is valid, since all fields are
- * filled in with valid values.
- *
- * @throws Exception
- */
- @Test
- public void validatePolicyWithFullPolicy() throws Exception {
- assertTrue(createPolicy().validate());
- }
-
- /**
- * Verify that a policy without policy update parameters is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validatePolicyWithoutPolicyUpdate() throws Exception {
- Policy policy = createPolicy();
- policy.setPolicyUpdate(null);
- assertFalse(policy.validate());
- }
-
- /**
- * Verify that a policy with invalid policy update parameters is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validatePolicyWithInvalidPolicyUpdate() throws Exception {
- Policy policy = createPolicy();
- policy.setPolicyUpdate(new UpdateParameter());
- assertFalse(policy.validate());
- }
-
- /**
- * Verify that a policy with a preferred roaming partner with FQDN not specified is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validatePolicyWithRoamingPartnerWithoutFQDN() throws Exception {
- Policy policy = createPolicy();
- Policy.RoamingPartner partner = new Policy.RoamingPartner();
- partner.setFqdnExactMatch(true);
- partner.setPriority(12);
- partner.setCountries("us,jp");
- policy.getPreferredRoamingPartnerList().add(partner);
- assertFalse(policy.validate());
- }
-
- /**
- * Verify that a policy with a preferred roaming partner with countries not specified is
- * invalid.
- *
- * @throws Exception
- */
- @Test
- public void validatePolicyWithRoamingPartnerWithoutCountries() throws Exception {
- Policy policy = createPolicy();
- Policy.RoamingPartner partner = new Policy.RoamingPartner();
- partner.setFqdn("test.com");
- partner.setFqdnExactMatch(true);
- partner.setPriority(12);
- policy.getPreferredRoamingPartnerList().add(partner);
- assertFalse(policy.validate());
- }
-
- /**
- * Verify that a policy with a proto-port tuple that contains an invalid port string is
- * invalid.
- *
- * @throws Exception
- */
- @Test
- public void validatePolicyWithInvalidPortStringInProtoPortMap() throws Exception {
- Policy policy = createPolicy();
- byte[] rawPortBytes = new byte[MAX_PORT_STRING_BYTES + 1];
- policy.getRequiredProtoPortMap().put(
- 324, new String(rawPortBytes, StandardCharsets.UTF_8));
- assertFalse(policy.validate());
- }
-
- /**
- * Verify that a policy with number of excluded SSIDs exceeded the max is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validatePolicyWithSsidExclusionListSizeExceededMax() throws Exception {
- Policy policy = createPolicy();
- String[] excludedSsidList = new String[MAX_NUMBER_OF_EXCLUDED_SSIDS + 1];
- Arrays.fill(excludedSsidList, "ssid");
- policy.setExcludedSsidList(excludedSsidList);
- assertFalse(policy.validate());
- }
-
- /**
- * Verify that a policy with an invalid SSID in the excluded SSID list is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validatePolicyWithInvalidSsid() throws Exception {
- Policy policy = createPolicy();
- byte[] rawSsidBytes = new byte[MAX_SSID_BYTES + 1];
- Arrays.fill(rawSsidBytes, (byte) 'a');
- String[] excludedSsidList = new String[] {
- new String(rawSsidBytes, StandardCharsets.UTF_8)};
- policy.setExcludedSsidList(excludedSsidList);
- assertFalse(policy.validate());
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/hotspot2/pps/UpdateParameterTest.java b/wifi/tests/src/android/net/wifi/hotspot2/pps/UpdateParameterTest.java
deleted file mode 100644
index 07cb151..0000000
--- a/wifi/tests/src/android/net/wifi/hotspot2/pps/UpdateParameterTest.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * 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
- */
-
-package android.net.wifi.hotspot2.pps;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import android.net.wifi.FakeKeys;
-import android.os.Parcel;
-import android.util.Base64;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-
-/**
- * Unit tests for {@link android.net.wifi.hotspot2.pps.UpdateParameter}.
- */
-@SmallTest
-public class UpdateParameterTest {
- private static final int MAX_URI_BYTES = 1023;
- private static final int MAX_URL_BYTES = 1023;
- private static final int MAX_USERNAME_BYTES = 63;
- private static final int MAX_PASSWORD_BYTES = 255;
- private static final int CERTIFICATE_SHA256_BYTES = 32;
-
- /**
- * Helper function for creating a {@link UpdateParameter} for testing.
- *
- * @return {@link UpdateParameter}
- */
- private static UpdateParameter createUpdateParameter() {
- UpdateParameter updateParam = new UpdateParameter();
- updateParam.setUpdateIntervalInMinutes(1712);
- updateParam.setUpdateMethod(UpdateParameter.UPDATE_METHOD_OMADM);
- updateParam.setRestriction(UpdateParameter.UPDATE_RESTRICTION_HOMESP);
- updateParam.setServerUri("server.pdate.com");
- updateParam.setUsername("username");
- updateParam.setBase64EncodedPassword(
- Base64.encodeToString("password".getBytes(), Base64.DEFAULT));
- updateParam.setTrustRootCertUrl("trust.cert.com");
- updateParam.setTrustRootCertSha256Fingerprint(new byte[32]);
- updateParam.setCaCertificate(FakeKeys.CA_CERT0);
- return updateParam;
- }
-
- /**
- * Helper function for verifying UpdateParameter after parcel write then read.
- * @param paramToWrite The UpdateParamter to verify
- * @throws Exception
- */
- private static void verifyParcel(UpdateParameter paramToWrite) throws Exception {
- Parcel parcel = Parcel.obtain();
- paramToWrite.writeToParcel(parcel, 0);
-
- parcel.setDataPosition(0); // Rewind data position back to the beginning for read.
- UpdateParameter paramFromRead = UpdateParameter.CREATOR.createFromParcel(parcel);
- assertTrue(paramFromRead.equals(paramToWrite));
- assertEquals(paramToWrite.hashCode(), paramFromRead.hashCode());
- }
-
- /**
- * Verify parcel read/write for an empty UpdateParameter.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithEmptyUpdateParameter() throws Exception {
- verifyParcel(new UpdateParameter());
- }
-
- /**
- * Verify parcel read/write for a UpdateParameter with all fields set.
- *
- * @throws Exception
- */
- @Test
- public void verifyParcelWithFullUpdateParameter() throws Exception {
- verifyParcel(createUpdateParameter());
- }
-
- /**
- * Verify that UpdateParameter created using copy constructor with null source should be the
- * same as the UpdateParameter created using default constructor.
- *
- * @throws Exception
- */
- @Test
- public void verifyCopyConstructionWithNullSource() throws Exception {
- UpdateParameter copyParam = new UpdateParameter(null);
- UpdateParameter defaultParam = new UpdateParameter();
- assertTrue(defaultParam.equals(copyParam));
- }
-
- /**
- * Verify that UpdateParameter created using copy constructor with a valid source should be the
- * same as the source.
- *
- * @throws Exception
- */
- @Test
- public void verifyCopyConstructionWithFullUpdateParameter() throws Exception {
- UpdateParameter origParam = createUpdateParameter();
- UpdateParameter copyParam = new UpdateParameter(origParam);
- assertTrue(origParam.equals(copyParam));
- }
-
- /**
- * Verify that a default UpdateParameter is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUpdateParameterWithDefault() throws Exception {
- UpdateParameter updateParam = new UpdateParameter();
- assertFalse(updateParam.validate());
- }
-
- /**
- * Verify that an UpdateParameter created using {@link #createUpdateParameter} is valid,
- * since all fields are filled in with valid values.
- *
- * @throws Exception
- */
- @Test
- public void validateUpdateParameterWithFullPolicy() throws Exception {
- assertTrue(createUpdateParameter().validate());
- }
-
- /**
- * Verify that an UpdateParameter with an unknown update method is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUpdateParameterWithUnknowMethod() throws Exception {
- UpdateParameter updateParam = createUpdateParameter();
- updateParam.setUpdateMethod("adsfasd");
- assertFalse(updateParam.validate());
- }
-
- /**
- * Verify that an UpdateParameter with an unknown restriction is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUpdateParameterWithUnknowRestriction() throws Exception {
- UpdateParameter updateParam = createUpdateParameter();
- updateParam.setRestriction("adsfasd");
- assertFalse(updateParam.validate());
- }
-
- /**
- * Verify that an UpdateParameter with an username exceeding maximum size is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUpdateParameterWithUsernameExceedingMaxSize() throws Exception {
- UpdateParameter updateParam = createUpdateParameter();
- byte[] rawUsernameBytes = new byte[MAX_USERNAME_BYTES + 1];
- Arrays.fill(rawUsernameBytes, (byte) 'a');
- updateParam.setUsername(new String(rawUsernameBytes, StandardCharsets.UTF_8));
- assertFalse(updateParam.validate());
- }
-
- /**
- * Verify that an UpdateParameter with an empty username is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUpdateParameterWithEmptyUsername() throws Exception {
- UpdateParameter updateParam = createUpdateParameter();
- updateParam.setUsername(null);
- assertFalse(updateParam.validate());
- }
-
- /**
- * Verify that an UpdateParameter with a password exceeding maximum size is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUpdateParameterWithPasswordExceedingMaxSize() throws Exception {
- UpdateParameter updateParam = createUpdateParameter();
- byte[] rawPasswordBytes = new byte[MAX_PASSWORD_BYTES + 1];
- Arrays.fill(rawPasswordBytes, (byte) 'a');
- updateParam.setBase64EncodedPassword(new String(rawPasswordBytes, StandardCharsets.UTF_8));
- assertFalse(updateParam.validate());
- }
-
- /**
- * Verify that an UpdateParameter with an empty password is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUpdateParameterWithEmptyPassword() throws Exception {
- UpdateParameter updateParam = createUpdateParameter();
- updateParam.setBase64EncodedPassword(null);
- assertFalse(updateParam.validate());
- }
-
- /**
- * Verify that an UpdateParameter with a Base64 encoded password that contained invalid padding
- * is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUpdateParameterWithPasswordContainedInvalidPadding() throws Exception {
- UpdateParameter updateParam = createUpdateParameter();
- updateParam.setBase64EncodedPassword(updateParam.getBase64EncodedPassword() + "=");
- assertFalse(updateParam.validate());
- }
-
- /**
- * Verify that an UpdateParameter without trust root certificate URL is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUpdateParameterWithoutTrustRootCertUrl() throws Exception {
- UpdateParameter updateParam = createUpdateParameter();
- updateParam.setTrustRootCertUrl(null);
- assertFalse(updateParam.validate());
- }
-
- /**
- * Verify that an UpdateParameter with invalid trust root certificate URL is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUpdateParameterWithInvalidTrustRootCertUrl() throws Exception {
- UpdateParameter updateParam = createUpdateParameter();
- byte[] rawUrlBytes = new byte[MAX_URL_BYTES + 1];
- Arrays.fill(rawUrlBytes, (byte) 'a');
- updateParam.setTrustRootCertUrl(new String(rawUrlBytes, StandardCharsets.UTF_8));
- assertFalse(updateParam.validate());
- }
-
- /**
- * Verify that an UpdateParameter without trust root certificate SHA-256 fingerprint is
- * invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUpdateParameterWithouttrustRootCertSha256Fingerprint() throws Exception {
- UpdateParameter updateParam = createUpdateParameter();
- updateParam.setTrustRootCertSha256Fingerprint(null);
- assertFalse(updateParam.validate());
- }
-
- /**
- * Verify that an UpdateParameter with an incorrect size trust root certificate SHA-256
- * fingerprint is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUpdateParameterWithInvalidtrustRootCertSha256Fingerprint() throws Exception {
- UpdateParameter updateParam = createUpdateParameter();
- updateParam.setTrustRootCertSha256Fingerprint(new byte[CERTIFICATE_SHA256_BYTES + 1]);
- assertFalse(updateParam.validate());
-
- updateParam.setTrustRootCertSha256Fingerprint(new byte[CERTIFICATE_SHA256_BYTES - 1]);
- assertFalse(updateParam.validate());
- }
-
- /**
- * Verify that an UpdateParameter without server URI is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUpdateParameterWithoutServerUri() throws Exception {
- UpdateParameter updateParam = createUpdateParameter();
- updateParam.setServerUri(null);
- assertFalse(updateParam.validate());
- }
-
- /**
- * Verify that an UpdateParameter with an invalid server URI is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validatePolicyWithInvalidServerUri() throws Exception {
- UpdateParameter updateParam = createUpdateParameter();
- byte[] rawUriBytes = new byte[MAX_URI_BYTES + 1];
- Arrays.fill(rawUriBytes, (byte) 'a');
- updateParam.setServerUri(new String(rawUriBytes, StandardCharsets.UTF_8));
- assertFalse(updateParam.validate());
- }
-
- /**
- * Verify that an UpdateParameter with update interval set to "never" will not perform
- * validation on other parameters, since update is not applicable in this case.
- *
- * @throws Exception
- */
- @Test
- public void validateUpdateParameterWithNoServerCheck() throws Exception {
- UpdateParameter updateParam = new UpdateParameter();
- updateParam.setUpdateIntervalInMinutes(UpdateParameter.UPDATE_CHECK_INTERVAL_NEVER);
- updateParam.setUsername(null);
- updateParam.setBase64EncodedPassword(null);
- updateParam.setUpdateMethod(null);
- updateParam.setRestriction(null);
- updateParam.setServerUri(null);
- updateParam.setTrustRootCertUrl(null);
- updateParam.setTrustRootCertSha256Fingerprint(null);
- assertTrue(updateParam.validate());
- }
-
- /**
- * Verify that an UpdateParameter with unset update interval is invalid.
- *
- * @throws Exception
- */
- @Test
- public void validateUpdateParameterWithoutUpdateInterval() throws Exception {
- UpdateParameter updateParam = createUpdateParameter();
- updateParam.setUpdateIntervalInMinutes(Long.MIN_VALUE);
- assertFalse(updateParam.validate());
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/p2p/WifiP2pConfigTest.java b/wifi/tests/src/android/net/wifi/p2p/WifiP2pConfigTest.java
deleted file mode 100644
index 6199325..0000000
--- a/wifi/tests/src/android/net/wifi/p2p/WifiP2pConfigTest.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * 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.net.wifi.p2p;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-/**
- * Unit test harness for {@link android.net.wifi.p2p.WifiP2pConfig}
- */
-@SmallTest
-public class WifiP2pConfigTest {
-
- private static final String DEVICE_ADDRESS = "aa:bb:cc:dd:ee:ff";
- /**
- * Check network name setter
- */
- @Test
- public void testBuilderInvalidNetworkName() throws Exception {
- WifiP2pConfig.Builder b = new WifiP2pConfig.Builder();
-
- // sunny case
- try {
- b.setNetworkName("DIRECT-ab-Hello");
- } catch (IllegalArgumentException e) {
- fail("Unexpected IllegalArgumentException");
- }
-
- // sunny case, no trailing string
- try {
- b.setNetworkName("DIRECT-WR");
- } catch (IllegalArgumentException e) {
- fail("Unexpected IllegalArgumentException");
- }
-
- // sunny case with maximum bytes for the network name
- try {
- b.setNetworkName("DIRECT-abcdefghijklmnopqrstuvwxy");
- } catch (IllegalArgumentException e) {
- fail("Unexpected IllegalArgumentException");
- }
-
- // less than 9 characters.
- try {
- b.setNetworkName("DIRECT-z");
- fail("expected IllegalArgumentException");
- } catch (IllegalArgumentException e) { }
-
- // not starts with DIRECT-xy.
- try {
- b.setNetworkName("ABCDEFGHIJK");
- fail("expected IllegalArgumentException");
- } catch (IllegalArgumentException e) { }
-
- // not starts with uppercase DIRECT-xy
- try {
- b.setNetworkName("direct-ab");
- fail("expected IllegalArgumentException");
- } catch (IllegalArgumentException e) { }
-
- // x and y are not selected from upper case letters, lower case letters or
- // numbers.
- try {
- b.setNetworkName("direct-a?");
- fail("expected IllegalArgumentException");
- } catch (IllegalArgumentException e) { }
-
- // over maximum bytes
- try {
- b.setNetworkName("DIRECT-abcdefghijklmnopqrstuvwxyz");
- fail("expected IllegalArgumentException");
- } catch (IllegalArgumentException e) { }
- }
-
- /**
- * Check passphrase setter
- */
- @Test
- public void testBuilderInvalidPassphrase() throws Exception {
- WifiP2pConfig.Builder b = new WifiP2pConfig.Builder();
-
- // sunny case
- try {
- b.setPassphrase("abcd1234");
- } catch (IllegalArgumentException e) {
- fail("Unexpected IllegalArgumentException");
- }
-
- // null string.
- try {
- b.setPassphrase(null);
- fail("should throw IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- // expected exception.
- }
-
- // less than 8 characters.
- try {
- b.setPassphrase("12abcde");
- fail("should throw IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- // expected exception.
- }
-
- // more than 63 characters.
- try {
- b.setPassphrase(
- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+/");
- fail("should throw IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- // expected exception.
- }
- }
-
- @Test
- /*
- * Verify WifiP2pConfig basic operations
- */
- public void testWifiP2pConfig() throws Exception {
- WifiP2pConfig config = new WifiP2pConfig();
- config.deviceAddress = DEVICE_ADDRESS;
-
- WifiP2pConfig copiedConfig = new WifiP2pConfig(config);
- // no equals operator, use toString for comparison.
- assertEquals(config.toString(), copiedConfig.toString());
-
- Parcel parcelW = Parcel.obtain();
- config.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- WifiP2pConfig configFromParcel = WifiP2pConfig.CREATOR.createFromParcel(parcelR);
-
- // no equals operator, use toString for comparison.
- assertEquals(config.toString(), configFromParcel.toString());
-
- }
-
- @Test
- /*
- * Verify WifiP2pConfig invalidate API
- */
- public void testInvalidate() throws Exception {
- WifiP2pConfig config = new WifiP2pConfig();
- config.deviceAddress = DEVICE_ADDRESS;
- config.invalidate();
- assertEquals("", config.deviceAddress);
- }
-
-}
diff --git a/wifi/tests/src/android/net/wifi/p2p/WifiP2pDeviceListTest.java b/wifi/tests/src/android/net/wifi/p2p/WifiP2pDeviceListTest.java
deleted file mode 100644
index 22936bd..0000000
--- a/wifi/tests/src/android/net/wifi/p2p/WifiP2pDeviceListTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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.net.wifi.p2p;
-
-import static org.junit.Assert.assertEquals;
-
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-/**
- * Unit test harness for {@link android.net.wifi.p2p.WifiP2pDeviceList}
- */
-@SmallTest
-public class WifiP2pDeviceListTest {
-
- private static final WifiP2pDevice TEST_DEVICE_1 = new WifiP2pDevice("aa:bb:cc:dd:ee:ff");
- private static final WifiP2pDevice TEST_DEVICE_2 = new WifiP2pDevice("aa:bb:cc:dd:ee:f1");
- private static final WifiP2pDevice TEST_DEVICE_3 = new WifiP2pDevice("11:22:33:44:55:66");
- private static final WifiP2pDevice TEST_DEVICE_4 = new WifiP2pDevice("a0:b0:c0:d0:e0:f0");
-
- /**
- * Verify basic operations.
- */
- @Test
- public void testListOperations() throws Exception {
- WifiP2pDeviceList list = new WifiP2pDeviceList();
- list.update(TEST_DEVICE_1);
- list.update(TEST_DEVICE_2);
- list.update(TEST_DEVICE_3);
- assertEquals(3, list.getDeviceList().size());
-
- assertEquals(TEST_DEVICE_1, list.get(TEST_DEVICE_1.deviceAddress));
- assertEquals(null, list.get(TEST_DEVICE_4.deviceAddress));
-
- list.remove(TEST_DEVICE_2.deviceAddress);
- assertEquals(null, list.get(TEST_DEVICE_2.deviceAddress));
-
- list.remove(TEST_DEVICE_3);
- assertEquals(null, list.get(TEST_DEVICE_3.deviceAddress));
-
- assertEquals(1, list.getDeviceList().size());
-
- list.clear();
- assertEquals(0, list.getDeviceList().size());
-
- Parcel parcelW = Parcel.obtain();
- list.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- WifiP2pDeviceList fromParcel = WifiP2pDeviceList.CREATOR.createFromParcel(parcelR);
-
- assertEquals(list.toString(), fromParcel.toString());
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/p2p/WifiP2pDeviceTest.java b/wifi/tests/src/android/net/wifi/p2p/WifiP2pDeviceTest.java
deleted file mode 100644
index 6edc287..0000000
--- a/wifi/tests/src/android/net/wifi/p2p/WifiP2pDeviceTest.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.p2p;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-/**
- * Unit test harness for {@link android.net.wifi.p2p.WifiP2pDevice}
- */
-@SmallTest
-public class WifiP2pDeviceTest {
-
- /**
- * Compare two p2p devices.
- *
- * @param devA is the first device to be compared
- * @param devB is the second device to be compared
- */
- private void compareWifiP2pDevices(WifiP2pDevice devA, WifiP2pDevice devB) {
- assertEquals(devA.deviceName, devB.deviceName);
- assertEquals(devA.deviceAddress, devB.deviceAddress);
- assertEquals(devA.primaryDeviceType, devB.primaryDeviceType);
- assertEquals(devA.secondaryDeviceType, devB.secondaryDeviceType);
- assertEquals(devA.wpsConfigMethodsSupported, devB.wpsConfigMethodsSupported);
- assertEquals(devA.deviceCapability, devB.deviceCapability);
- assertEquals(devA.groupCapability, devB.groupCapability);
- assertEquals(devA.status, devB.status);
- if (devA.wfdInfo != null) {
- assertEquals(devA.wfdInfo.isEnabled(), devB.wfdInfo.isEnabled());
- assertEquals(devA.wfdInfo.getDeviceInfoHex(), devB.wfdInfo.getDeviceInfoHex());
- assertEquals(devA.wfdInfo.getControlPort(), devB.wfdInfo.getControlPort());
- assertEquals(devA.wfdInfo.getMaxThroughput(), devB.wfdInfo.getMaxThroughput());
- } else {
- assertEquals(devA.wfdInfo, devB.wfdInfo);
- }
- }
-
- /**
- * Check equals and hashCode consistency
- */
- @Test
- public void testEqualsWithHashCode() throws Exception {
- WifiP2pDevice dev_a = new WifiP2pDevice();
- dev_a.deviceAddress = new String("02:90:4c:a0:92:54");
- WifiP2pDevice dev_b = new WifiP2pDevice();
- dev_b.deviceAddress = new String("02:90:4c:a0:92:54");
-
- assertTrue(dev_a.equals(dev_b));
- assertEquals(dev_a.hashCode(), dev_b.hashCode());
- }
-
- /**
- * Check the copy constructor with default values.
- */
- @Test
- public void testCopyConstructorWithDefaultValues() throws Exception {
- WifiP2pDevice device = new WifiP2pDevice();
- WifiP2pDevice copy = new WifiP2pDevice(device);
- compareWifiP2pDevices(device, copy);
- }
-
- /**
- * Check the copy constructor with updated values.
- */
- @Test
- public void testCopyConstructorWithUpdatedValues() throws Exception {
- WifiP2pDevice device = new WifiP2pDevice();
- device.deviceName = "deviceName";
- device.deviceAddress = "11:22:33:44:55:66";
- device.primaryDeviceType = "primaryDeviceType";
- device.secondaryDeviceType = "secondaryDeviceType";
- device.wpsConfigMethodsSupported = 0x0008;
- device.deviceCapability = 1;
- device.groupCapability = 1;
- device.status = WifiP2pDevice.CONNECTED;
- device.wfdInfo = new WifiP2pWfdInfo();
- WifiP2pDevice copy = new WifiP2pDevice(device);
- compareWifiP2pDevices(device, copy);
- }
-
- /**
- * Check the copy constructor when the wfdInfo of the source object is null.
- */
- @Test
- public void testCopyConstructorWithNullWfdInfo() throws Exception {
- WifiP2pDevice device = new WifiP2pDevice();
- device.deviceName = "deviceName";
- device.deviceAddress = "11:22:33:44:55:66";
- device.primaryDeviceType = "primaryDeviceType";
- device.secondaryDeviceType = "secondaryDeviceType";
- device.wpsConfigMethodsSupported = 0x0008;
- device.deviceCapability = 1;
- device.groupCapability = 1;
- device.status = WifiP2pDevice.CONNECTED;
- device.wfdInfo = null;
- WifiP2pDevice copy = new WifiP2pDevice(device);
- compareWifiP2pDevices(device, copy);
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/p2p/WifiP2pGroupListTest.java b/wifi/tests/src/android/net/wifi/p2p/WifiP2pGroupListTest.java
deleted file mode 100644
index 2402f5b..0000000
--- a/wifi/tests/src/android/net/wifi/p2p/WifiP2pGroupListTest.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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.net.wifi.p2p;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Unit test harness for {@link android.net.wifi.p2p.WifiP2pGroupList}
- */
-@SmallTest
-public class WifiP2pGroupListTest {
-
- private static final WifiP2pDevice TEST_GROUP_OWNER_1 = new WifiP2pDevice("aa:bb:cc:dd:ee:f0");
- private static final WifiP2pDevice TEST_GROUP_OWNER_2 = new WifiP2pDevice("aa:bb:cc:dd:ee:f1");
- private static final WifiP2pDevice TEST_GROUP_OWNER_3 = new WifiP2pDevice("aa:bb:cc:dd:ee:f2");
- private static final WifiP2pDevice TEST_GROUP_OWNER_OTHER =
- new WifiP2pDevice("aa:bb:cc:dd:ee:f3");
-
- private WifiP2pGroup mTestGroup1;
- private WifiP2pGroup mTestGroup2;
- private WifiP2pGroup mTestGroup3;
- private WifiP2pGroup mTestGroup4;
-
- private WifiP2pGroup createGroup(
- int networkId, String networkName,
- String passphrase, boolean isGo,
- WifiP2pDevice goDev) {
- WifiP2pGroup group = new WifiP2pGroup();
- group.setNetworkId(networkId);
- group.setNetworkName(networkName);
- group.setPassphrase(passphrase);
- group.setIsGroupOwner(isGo);
- group.setOwner(goDev);
- return group;
- }
-
- @Before
- public void setUp() throws Exception {
- mTestGroup1 = createGroup(0, "testGroup1", "12345678", false, TEST_GROUP_OWNER_1);
- mTestGroup2 = createGroup(1, "testGroup2", "12345678", true, TEST_GROUP_OWNER_2);
- mTestGroup3 = createGroup(2, "testGroup3", "12345678", false, TEST_GROUP_OWNER_3);
- mTestGroup4 = createGroup(3, "testGroup4", "12345678", false, TEST_GROUP_OWNER_1);
- }
-
- /**
- * Verify basic operations.
- */
- @Test
- public void testListOperations() throws Exception {
- WifiP2pGroupList list = new WifiP2pGroupList();
- list.add(mTestGroup1);
- list.add(mTestGroup2);
- list.add(mTestGroup3);
- list.add(mTestGroup4);
- assertEquals(4, list.getGroupList().size());
-
- // in list
- assertEquals(mTestGroup2.getNetworkId(),
- list.getNetworkId(TEST_GROUP_OWNER_2.deviceAddress));
- assertEquals(TEST_GROUP_OWNER_2.deviceAddress,
- list.getOwnerAddr(mTestGroup2.getNetworkId()));
- // not in list
- assertEquals(-1, list.getNetworkId(TEST_GROUP_OWNER_OTHER.deviceAddress));
- // if there are groups with the same GO, return the first one found.
- assertEquals(mTestGroup1.getNetworkId(),
- list.getNetworkId(TEST_GROUP_OWNER_1.deviceAddress));
- // identify groups with the same GO, but different network names.
- assertEquals(mTestGroup4.getNetworkId(),
- list.getNetworkId(TEST_GROUP_OWNER_1.deviceAddress, "testGroup4"));
-
- list.remove(mTestGroup3.getNetworkId());
- assertEquals(-1, list.getNetworkId(TEST_GROUP_OWNER_3.deviceAddress));
- assertFalse(list.contains(mTestGroup3.getNetworkId()));
-
- assertEquals(3, list.getGroupList().size());
-
- Parcel parcelW = Parcel.obtain();
- list.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- WifiP2pGroupList fromParcel = WifiP2pGroupList.CREATOR.createFromParcel(parcelR);
-
- assertEquals(list.toString(), fromParcel.toString());
-
- list.clear();
- assertEquals(0, list.getGroupList().size());
-
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/p2p/WifiP2pGroupTest.java b/wifi/tests/src/android/net/wifi/p2p/WifiP2pGroupTest.java
deleted file mode 100644
index 9473e42..0000000
--- a/wifi/tests/src/android/net/wifi/p2p/WifiP2pGroupTest.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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.net.wifi.p2p;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-/**
- * Unit test harness for {@link android.net.wifi.p2p.WifiP2pGroup}
- */
-@SmallTest
-public class WifiP2pGroupTest {
-
- private static final String INTERFACE = "p2p-p2p0-3";
- private static final int NETWORK_ID = 9;
- private static final String NETWORK_NAME = "DIRECT-xy-Hello";
- private static final String PASSPHRASE = "HelloWorld";
- private static final WifiP2pDevice GROUP_OWNER = new WifiP2pDevice("de:ad:be:ef:00:01");
- private static final int FREQUENCY = 5300;
- private static final WifiP2pDevice CLIENT_1 = new WifiP2pDevice("aa:bb:cc:dd:ee:01");
- private static final WifiP2pDevice CLIENT_2 = new WifiP2pDevice("aa:bb:cc:dd:ee:02");
-
- /**
- * Verify setter/getter functions.
- */
- @Test
- public void testSetterGetter() throws Exception {
- WifiP2pGroup group = new WifiP2pGroup();
-
- group.setInterface(INTERFACE);
- group.setNetworkId(NETWORK_ID);
- group.setNetworkName(NETWORK_NAME);
- group.setPassphrase(PASSPHRASE);
- group.setIsGroupOwner(false);
- group.setOwner(GROUP_OWNER);
- group.setFrequency(FREQUENCY);
- group.addClient(CLIENT_1.deviceAddress);
- group.addClient(CLIENT_2);
-
- assertEquals(INTERFACE, group.getInterface());
- assertEquals(NETWORK_ID, group.getNetworkId());
- assertEquals(NETWORK_NAME, group.getNetworkName());
- assertEquals(PASSPHRASE, group.getPassphrase());
- assertFalse(group.isGroupOwner());
- assertEquals(GROUP_OWNER, group.getOwner());
- assertEquals(FREQUENCY, group.getFrequency());
-
- assertFalse(group.isClientListEmpty());
- assertTrue(group.contains(CLIENT_1));
-
- assertEquals(2, group.getClientList().size());
-
- group.removeClient(CLIENT_1);
- group.removeClient(CLIENT_2.deviceAddress);
- assertFalse(group.contains(CLIENT_1));
- assertTrue(group.isClientListEmpty());
-
- Parcel parcelW = Parcel.obtain();
- group.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- WifiP2pGroup fromParcel = WifiP2pGroup.CREATOR.createFromParcel(parcelR);
-
- assertEquals(group.toString(), fromParcel.toString());
-
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/p2p/WifiP2pInfoTest.java b/wifi/tests/src/android/net/wifi/p2p/WifiP2pInfoTest.java
deleted file mode 100644
index e207ca1..0000000
--- a/wifi/tests/src/android/net/wifi/p2p/WifiP2pInfoTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.net.wifi.p2p;
-
-import static org.junit.Assert.assertEquals;
-
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import java.net.InetAddress;
-
-/**
- * Unit test harness for {@link android.net.wifi.p2p.WifiP2pInfo}
- */
-@SmallTest
-public class WifiP2pInfoTest {
-
- private InetAddress mGroupOnwerIpv4Address;
-
- @Before
- public void setUp() throws Exception {
- byte[] ipv4 = {(byte) 192, (byte) 168, (byte) 49, (byte) 1};
- mGroupOnwerIpv4Address = InetAddress.getByAddress(ipv4);
- }
-
- /**
- * Verifies copy constructor.
- */
- @Test
- public void testCopyOperator() throws Exception {
- WifiP2pInfo info = new WifiP2pInfo();
- info.groupFormed = true;
- info.isGroupOwner = true;
- info.groupOwnerAddress = mGroupOnwerIpv4Address;
-
- WifiP2pInfo copiedInfo = new WifiP2pInfo(info);
-
- // no equals operator, use toString for data comparison.
- assertEquals(info.toString(), copiedInfo.toString());
- }
-
- /**
- * Verifies parcel serialization/deserialization.
- */
- @Test
- public void testParcelOperation() throws Exception {
- WifiP2pInfo info = new WifiP2pInfo();
- info.groupFormed = true;
- info.isGroupOwner = true;
- info.groupOwnerAddress = mGroupOnwerIpv4Address;
-
- Parcel parcelW = Parcel.obtain();
- info.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- WifiP2pInfo fromParcel = WifiP2pInfo.CREATOR.createFromParcel(parcelR);
-
- // no equals operator, use toString for data comparison.
- assertEquals(info.toString(), fromParcel.toString());
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/p2p/WifiP2pManagerTest.java b/wifi/tests/src/android/net/wifi/p2p/WifiP2pManagerTest.java
deleted file mode 100644
index 9e8dca4..0000000
--- a/wifi/tests/src/android/net/wifi/p2p/WifiP2pManagerTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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.
- */
-
-package android.net.wifi.p2p;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.verify;
-
-import android.content.Context;
-import android.os.test.TestLooper;
-
-import androidx.test.filters.SmallTest;
-
-import libcore.junit.util.ResourceLeakageDetector;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-/**
- * Unit test harness for WifiP2pManager.
- */
-@SmallTest
-public class WifiP2pManagerTest {
- private WifiP2pManager mDut;
- private TestLooper mTestLooper;
-
- @Mock
- public Context mContextMock;
- @Mock
- IWifiP2pManager mP2pServiceMock;
-
- @Rule
- public ResourceLeakageDetector.LeakageDetectorRule leakageDetectorRule =
- ResourceLeakageDetector.getRule();
-
- @Before
- public void setUp() throws Exception {
- MockitoAnnotations.initMocks(this);
-
- mDut = new WifiP2pManager(mP2pServiceMock);
- mTestLooper = new TestLooper();
- }
-
- /**
- * Validate that on finalize we close the channel and flag a resource leakage.
- */
- @Test
- public void testChannelFinalize() throws Exception {
- try (WifiP2pManager.Channel channel = new WifiP2pManager.Channel(mContextMock,
- mTestLooper.getLooper(), null, null, mDut)) {
- leakageDetectorRule.assertUnreleasedResourceCount(channel, 1);
- }
- }
-
- /**
- * Validate that when close is called on a channel it frees up resources (i.e. don't
- * get flagged again on finalize).
- */
- @Test
- public void testChannelClose() throws Exception {
- WifiP2pManager.Channel channel = new WifiP2pManager.Channel(mContextMock,
- mTestLooper.getLooper(), null, null, mDut);
-
- channel.close();
- verify(mP2pServiceMock).close(any());
-
- leakageDetectorRule.assertUnreleasedResourceCount(channel, 0);
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/p2p/WifiP2pProvDiscEventTest.java b/wifi/tests/src/android/net/wifi/p2p/WifiP2pProvDiscEventTest.java
deleted file mode 100644
index e3b10a7..0000000
--- a/wifi/tests/src/android/net/wifi/p2p/WifiP2pProvDiscEventTest.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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.net.wifi.p2p;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-/**
- * Unit test harness for {@link android.net.wifi.p2p.WifiP2pProvDiscEvent}
- */
-@SmallTest
-public class WifiP2pProvDiscEventTest {
-
- private static final String DEVICE_ADDRESS = "aa:bb:cc:dd:ee:ff";
- private static final String EVENT_PBC_REQ_STRING = "P2P-PROV-DISC-PBC-REQ";
- private static final String EVENT_PBC_RSP_STRING = "P2P-PROV-DISC-PBC-RESP";
- private static final String EVENT_ENTER_PIN_STRING = "P2P-PROV-DISC-ENTER-PIN";
- private static final String EVENT_SHOW_PIN_STRING = "P2P-PROV-DISC-SHOW-PIN";
- private static final String TEST_PIN = "44490607";
-
- /**
- * Test parsing PBC request event.
- */
- @Test
- public void testPbcReqEvent() throws Exception {
- WifiP2pProvDiscEvent event =
- new WifiP2pProvDiscEvent(EVENT_PBC_REQ_STRING + " " + DEVICE_ADDRESS);
- assertEquals(WifiP2pProvDiscEvent.PBC_REQ, event.event);
- assertEquals(DEVICE_ADDRESS, event.device.deviceAddress);
- }
-
-
- /**
- * Test parsing PBC response event.
- */
- @Test
- public void testPbcRespEvent() throws Exception {
- WifiP2pProvDiscEvent event =
- new WifiP2pProvDiscEvent(EVENT_PBC_RSP_STRING + " " + DEVICE_ADDRESS);
- assertEquals(WifiP2pProvDiscEvent.PBC_RSP, event.event);
- assertEquals(DEVICE_ADDRESS, event.device.deviceAddress);
- }
-
- /**
- * Test parsing ENTER-PIN event.
- */
- @Test
- public void testEnterPinEvent() throws Exception {
- WifiP2pProvDiscEvent event =
- new WifiP2pProvDiscEvent(EVENT_ENTER_PIN_STRING + " " + DEVICE_ADDRESS);
- assertEquals(WifiP2pProvDiscEvent.ENTER_PIN, event.event);
- assertEquals(DEVICE_ADDRESS, event.device.deviceAddress);
- }
-
- /**
- * Test parsing SHOW-PIN event.
- */
- @Test
- public void testShowPinEvent() throws Exception {
- WifiP2pProvDiscEvent event =
- new WifiP2pProvDiscEvent(
- EVENT_SHOW_PIN_STRING + " " + DEVICE_ADDRESS + " " + TEST_PIN);
- assertEquals(WifiP2pProvDiscEvent.SHOW_PIN, event.event);
- assertEquals(DEVICE_ADDRESS, event.device.deviceAddress);
- assertEquals(TEST_PIN, event.pin);
- }
-
- /**
- * Test parsing malformed input.
- */
- @Test
- public void testMalformedInput() throws Exception {
- try {
- WifiP2pProvDiscEvent event = new WifiP2pProvDiscEvent("OneToken");
- fail("Should throw IllegalArgumentException exception.");
- } catch (IllegalArgumentException ex) {
- // expected exception.
- }
- }
-
- /**
- * Test parsing malformed event.
- */
- @Test
- public void testMalformedEvent() throws Exception {
- try {
- WifiP2pProvDiscEvent event = new WifiP2pProvDiscEvent("XXX " + DEVICE_ADDRESS);
- fail("Should throw IllegalArgumentException exception.");
- } catch (IllegalArgumentException ex) {
- // expected exception.
- }
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/p2p/WifiP2pWfdInfoTest.java b/wifi/tests/src/android/net/wifi/p2p/WifiP2pWfdInfoTest.java
deleted file mode 100644
index 2a9b36b..0000000
--- a/wifi/tests/src/android/net/wifi/p2p/WifiP2pWfdInfoTest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * 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.net.wifi.p2p;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import android.os.Parcel;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Unit test harness for {@link android.net.wifi.p2p.WifiP2pWfdInfo}
- */
-@SmallTest
-public class WifiP2pWfdInfoTest {
-
- private static final int TEST_CTRL_PORT = 9999;
- private static final int TEST_MAX_TPUT = 1024;
-
- private WifiP2pWfdInfo mSourceInfo = new WifiP2pWfdInfo(
- 0,
- TEST_CTRL_PORT,
- TEST_MAX_TPUT);
-
- @Before
- public void setUp() {
- // initialize device info flags.
- mSourceInfo.setDeviceType(WifiP2pWfdInfo.DEVICE_TYPE_WFD_SOURCE);
- mSourceInfo.setSessionAvailable(true);
- mSourceInfo.setContentProtectionSupported(true);
- }
-
- /**
- * Verifies setters/getters.
- */
- @Test
- public void testSettersGetters() throws Exception {
- WifiP2pWfdInfo info = new WifiP2pWfdInfo();
-
- info.setEnabled(true);
- assertTrue(info.isEnabled());
-
- info.setDeviceType(WifiP2pWfdInfo.DEVICE_TYPE_WFD_SOURCE);
- assertEquals(WifiP2pWfdInfo.DEVICE_TYPE_WFD_SOURCE, info.getDeviceType());
-
- info.setSessionAvailable(true);
- assertTrue(info.isSessionAvailable());
-
- info.setContentProtectionSupported(true);
- assertTrue(info.isContentProtectionSupported());
-
- info.setControlPort(TEST_CTRL_PORT);
- assertEquals(TEST_CTRL_PORT, info.getControlPort());
-
- info.setMaxThroughput(TEST_MAX_TPUT);
- assertEquals(TEST_MAX_TPUT, info.getMaxThroughput());
-
- assertEquals("0110270f0400", info.getDeviceInfoHex());
- }
-
- /**
- * Verifies copy constructor.
- */
- @Test
- public void testCopyOperator() throws Exception {
- WifiP2pWfdInfo copiedInfo = new WifiP2pWfdInfo(mSourceInfo);
-
- // no equals operator, use toString for data comparison.
- assertEquals(mSourceInfo.toString(), copiedInfo.toString());
- }
-
- /**
- * Verifies parcel serialization/deserialization.
- */
- @Test
- public void testParcelOperation() throws Exception {
- Parcel parcelW = Parcel.obtain();
- mSourceInfo.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- WifiP2pWfdInfo fromParcel = WifiP2pWfdInfo.CREATOR.createFromParcel(parcelR);
-
- // no equals operator, use toString for data comparison.
- assertEquals(mSourceInfo.toString(), fromParcel.toString());
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceInfoTest.java b/wifi/tests/src/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceInfoTest.java
deleted file mode 100644
index e1cffee..0000000
--- a/wifi/tests/src/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceInfoTest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.net.wifi.p2p.nsd;
-
-import static org.junit.Assert.fail;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Unit test harness for {@link android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceInfo}
- */
-@SmallTest
-public class WifiP2pDnsSdServiceInfoTest {
-
- private static final String INSTANCE_NAME = "MyPrinter";
- private static final String SERVICE_TYPE = "_ipp._tcp";
- private static final String TXTRECORD_PROP_AVAILABLE = "available";
- private static final String TXTRECORD_PROP_AVAILABLE_VISABLE = "visable";
-
- private Map<String, String> mTxtMap = new HashMap<>();
-
- @Before
- public void setUp() throws Exception {
- mTxtMap.put(TXTRECORD_PROP_AVAILABLE, TXTRECORD_PROP_AVAILABLE_VISABLE);
- }
-
- /**
- * Verify newInstance API
- */
- @Test
- public void testNewInstance() throws Exception {
- WifiP2pDnsSdServiceInfo info = null;
-
- // the least arguments
- info = WifiP2pDnsSdServiceInfo.newInstance(
- INSTANCE_NAME,
- SERVICE_TYPE,
- null);
-
- // all arguments are given.
- info = WifiP2pDnsSdServiceInfo.newInstance(
- INSTANCE_NAME,
- SERVICE_TYPE,
- mTxtMap);
-
- // failure case due to no instance name.
- try {
- info = WifiP2pDnsSdServiceInfo.newInstance(
- null,
- SERVICE_TYPE,
- null);
- fail("should throw IllegalArgumentException");
- } catch (IllegalArgumentException ex) {
- // expected exception.
- }
-
- // failure case due to no service type.
- try {
- info = WifiP2pDnsSdServiceInfo.newInstance(
- INSTANCE_NAME,
- null,
- null);
- fail("should throw IllegalArgumentException");
- } catch (IllegalArgumentException ex) {
- // expected exception.
- }
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceRequestTest.java b/wifi/tests/src/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceRequestTest.java
deleted file mode 100644
index 7d46a5f..0000000
--- a/wifi/tests/src/android/net/wifi/p2p/nsd/WifiP2pDnsSdServiceRequestTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.net.wifi.p2p.nsd;
-
-import static org.junit.Assert.fail;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-/**
- * Unit test harness for {@link android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceRequest}
- */
-@SmallTest
-public class WifiP2pDnsSdServiceRequestTest {
-
- private static final String SERVICE_NAME = "MyPrinter";
- private static final String SERVICE_TYPE = "_ipp._tcp";
-
- @Test
- public void testNewInstance() throws Exception {
- WifiP2pDnsSdServiceRequest request = null;
-
- // default new instance
- request = WifiP2pDnsSdServiceRequest.newInstance();
-
- // set service type
- request = WifiP2pDnsSdServiceRequest.newInstance(SERVICE_TYPE);
-
- // set service type
- request = WifiP2pDnsSdServiceRequest.newInstance(SERVICE_NAME, SERVICE_TYPE);
-
- // failure case due to null service type
- try {
- request = WifiP2pDnsSdServiceRequest.newInstance(null);
- fail("should throw IllegalArgumentException");
- } catch (IllegalArgumentException ex) {
- // expected exception.
- }
-
- // failure case due to null service name
- try {
- request = WifiP2pDnsSdServiceRequest.newInstance(SERVICE_NAME, null);
- fail("should throw IllegalArgumentException");
- } catch (IllegalArgumentException ex) {
- // expected exception.
- }
-
- // failure case due to null service type
- try {
- request = WifiP2pDnsSdServiceRequest.newInstance(null, SERVICE_TYPE);
- fail("should throw IllegalArgumentException");
- } catch (IllegalArgumentException ex) {
- // expected exception.
- }
-
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/p2p/nsd/WifiP2pUpnpServiceInfoTest.java b/wifi/tests/src/android/net/wifi/p2p/nsd/WifiP2pUpnpServiceInfoTest.java
deleted file mode 100644
index 49ead11..0000000
--- a/wifi/tests/src/android/net/wifi/p2p/nsd/WifiP2pUpnpServiceInfoTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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.net.wifi.p2p.nsd;
-
-import static org.junit.Assert.fail;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Unit test harness for {@link android.net.wifi.p2p.nsd.WifiP2pUpnpServiceInfo}
- */
-@SmallTest
-public class WifiP2pUpnpServiceInfoTest {
-
- private static final String UUID = "6859dede-8574-59ab-9332-123456789012";
- private static final String DEVICE = "aa:bb:cc:dd:ee:ff";
-
- private List<String> mServiceList = new ArrayList<>();
-
- @Before
- public void setUp() throws Exception {
- mServiceList.add("urn:schemas-upnp-org:service:ContentDirectory:1");
- }
-
- /**
- * Verify newInstance API
- */
- @Test
- public void testNewInstance() throws Exception {
- WifiP2pUpnpServiceInfo info = null;
-
- // the least arguments
- info = WifiP2pUpnpServiceInfo.newInstance(
- UUID, DEVICE, null);
-
- // all arguments are given.
- info = WifiP2pUpnpServiceInfo.newInstance(
- UUID, DEVICE, mServiceList);
-
- // failure case due to no UUID.
- try {
- info = WifiP2pUpnpServiceInfo.newInstance(
- null, DEVICE, null);
- fail("should throw IllegalArgumentException");
- } catch (IllegalArgumentException ex) {
- // expected exception.
- }
-
- // failure case due to no device.
- try {
- info = WifiP2pUpnpServiceInfo.newInstance(
- UUID,
- null,
- null);
- fail("should throw IllegalArgumentException");
- } catch (IllegalArgumentException ex) {
- // expected exception.
- }
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/p2p/nsd/WifiP2pUpnpServiceRequestTest.java b/wifi/tests/src/android/net/wifi/p2p/nsd/WifiP2pUpnpServiceRequestTest.java
deleted file mode 100644
index 79930dc..0000000
--- a/wifi/tests/src/android/net/wifi/p2p/nsd/WifiP2pUpnpServiceRequestTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.net.wifi.p2p.nsd;
-
-import static org.junit.Assert.fail;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-
-/**
- * Unit test harness for {@link android.net.wifi.p2p.nsd.WifiP2pUpnpServiceRequest}
- */
-@SmallTest
-public class WifiP2pUpnpServiceRequestTest {
-
- @Test
- public void testNewInstance() throws Exception {
- WifiP2pUpnpServiceRequest request = null;
-
- // Create a service discovery request to search all UPnP services.
- request = WifiP2pUpnpServiceRequest.newInstance();
-
- // Create a service discovery request to search specified UPnP services.
- request = WifiP2pUpnpServiceRequest.newInstance("ssdp:all");
-
- // failure case due to null target string
- try {
- request = WifiP2pUpnpServiceRequest.newInstance(null);
- fail("should throw IllegalArgumentException");
- } catch (IllegalArgumentException ex) {
- // expected exception.
- }
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/rtt/CivicLocationTest.java b/wifi/tests/src/android/net/wifi/rtt/CivicLocationTest.java
deleted file mode 100644
index f746fb7..0000000
--- a/wifi/tests/src/android/net/wifi/rtt/CivicLocationTest.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * 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.net.wifi.rtt;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
-
-import android.location.Address;
-import android.os.Parcel;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/**
- * Tests for {@link CivicLocation}.
- */
-@RunWith(JUnit4.class)
-public class CivicLocationTest {
- private static final String sUsCountryCode = "US";
-
- private static final byte[] sEmptyBuffer = {};
-
- private static final byte[] sTestCivicLocationBuffer = {
- (byte) 17,
- (byte) 3,
- (byte) 'a',
- (byte) 'b',
- (byte) 'c',
- (byte) 4,
- (byte) 4,
- (byte) 'd',
- (byte) 'e',
- (byte) 'f',
- (byte) 'g',
- (byte) 12,
- (byte) 1,
- (byte) 'h'
- };
-
- private static final byte[] sTestCivicLocationBufferWithAddress = {
- (byte) CivicLocationKeys.HNO,
- (byte) 2,
- (byte) '1',
- (byte) '5',
- (byte) CivicLocationKeys.PRIMARY_ROAD_NAME,
- (byte) 4,
- (byte) 'A',
- (byte) 'l',
- (byte) 't',
- (byte) 'o',
- (byte) CivicLocationKeys.STREET_NAME_POST_MODIFIER,
- (byte) 4,
- (byte) 'R',
- (byte) 'o',
- (byte) 'a',
- (byte) 'd',
- (byte) CivicLocationKeys.CITY,
- (byte) 8,
- (byte) 'M',
- (byte) 't',
- (byte) 'n',
- (byte) ' ',
- (byte) 'V',
- (byte) 'i',
- (byte) 'e',
- (byte) 'w',
- (byte) CivicLocationKeys.STATE,
- (byte) 2,
- (byte) 'C',
- (byte) 'A',
- (byte) CivicLocationKeys.POSTAL_CODE,
- (byte) 5,
- (byte) '9',
- (byte) '4',
- (byte) '0',
- (byte) '4',
- (byte) '3'
- };
-
- /**
- * Test inValid for null CountryCode.
- */
- @Test
- public void testCivicLocationNullCountryCode() {
- CivicLocation civicLocation = new CivicLocation(sTestCivicLocationBuffer, null);
-
- boolean valid = civicLocation.isValid();
-
- assertFalse(valid);
- }
-
- /**
- * Test inValid for CountryCode too short.
- */
- @Test
- public void testCivicLocationCountryCodeTooShort() {
- CivicLocation civicLocation = new CivicLocation(sTestCivicLocationBuffer, "X");
-
- boolean valid = civicLocation.isValid();
-
- assertFalse(valid);
- }
-
- /**
- * Test inValid for CountryCode too long.
- */
- @Test
- public void testCivicLocationCountryCodeTooLong() {
- CivicLocation civicLocation = new CivicLocation(sTestCivicLocationBuffer, "XYZ");
-
- boolean valid = civicLocation.isValid();
-
- assertFalse(valid);
- }
-
- /**
- * Test inValid for null CivicLocation Buffer
- */
- @Test
- public void testCivicLocationNullBuffer() {
- CivicLocation civicLocation = new CivicLocation(null, sUsCountryCode);
-
- boolean valid = civicLocation.isValid();
-
- assertFalse(valid);
- }
-
- /**
- * Test inValid for Empty CivicLocation Buffer.
- */
- @Test
- public void testCivicLocationEmptyBuffer() {
- CivicLocation civicLocation = new CivicLocation(sEmptyBuffer, sUsCountryCode);
-
- boolean valid = civicLocation.isValid();
-
- assertFalse(valid);
- }
-
- /**
- * Test for valid CivicLocationBuffer and Country Code.
- */
- @Test
- public void testCivicLocationValid() {
- CivicLocation civicLocation = new CivicLocation(sTestCivicLocationBuffer, sUsCountryCode);
-
- boolean valid = civicLocation.isValid();
-
- assertTrue(valid);
- }
-
- /**
- * Test toString Representation
- */
- @Test
- public void testCivicLocationToString() {
- CivicLocation civicLocation = new CivicLocation(sTestCivicLocationBuffer, sUsCountryCode);
-
- String str = civicLocation.toString();
-
- assertEquals("{4=defg, 12=h, 17=abc}", str);
- }
-
- /**
- * Test the toString
- */
- @Test
- public void testCivicLocationgetElementValue() {
- CivicLocation civicLocation = new CivicLocation(sTestCivicLocationBuffer, sUsCountryCode);
-
- String value1 = civicLocation.getCivicElementValue(4);
- String value2 = civicLocation.getCivicElementValue(17);
- String value3 = civicLocation.getCivicElementValue(12);
- String value4 = civicLocation.getCivicElementValue(156); // not in test data
- String value5 = civicLocation.getCivicElementValue(276); // greater than key index
-
- assertEquals("defg", value1);
- assertEquals("abc", value2);
- assertEquals("h", value3);
- assertNull(value4);
- assertNull(value5);
- }
-
- /* Test toAddress representation */
- @Test
- public void testCivicLocationToAddress() {
- CivicLocation civicLocation =
- new CivicLocation(sTestCivicLocationBufferWithAddress, sUsCountryCode);
-
- Address address = civicLocation.toAddress();
-
- assertEquals("", address.getAddressLine(0));
- assertEquals("15 Alto", address.getAddressLine(1));
- assertEquals("Mtn View", address.getAddressLine(2));
- assertEquals("CA 94043", address.getAddressLine(3));
- assertEquals("US", address.getAddressLine(4));
- }
-
- /**
- * Test toString Representation
- */
- @Test
- public void testCivicLocationToString2() {
- CivicLocation civicLocation =
- new CivicLocation(sTestCivicLocationBufferWithAddress, sUsCountryCode);
-
- String str = civicLocation.toString();
-
- assertEquals("{1=CA, 3=Mtn View, 19=15, 24=94043, 34=Alto, 39=Road}", str);
- }
-
- /** Test object is Parcellable */
- @Test
- public void testCivicLocationParcelable() {
- CivicLocation civicLocation =
- new CivicLocation(sTestCivicLocationBufferWithAddress, sUsCountryCode);
-
- Parcel parcel = Parcel.obtain();
- civicLocation.writeToParcel(parcel, 0);
- parcel.setDataPosition(0);
- CivicLocation civicLocationFromParcel =
- CivicLocation.CREATOR.createFromParcel(parcel);
-
- assertEquals(civicLocationFromParcel, civicLocation);
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/rtt/ResponderLocationTest.java b/wifi/tests/src/android/net/wifi/rtt/ResponderLocationTest.java
deleted file mode 100644
index 271339c..0000000
--- a/wifi/tests/src/android/net/wifi/rtt/ResponderLocationTest.java
+++ /dev/null
@@ -1,589 +0,0 @@
-/*
- * 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.net.wifi.rtt;
-
-import android.location.Address;
-import android.location.Location;
-import android.net.MacAddress;
-import android.os.Parcel;
-import android.util.SparseArray;
-import android.webkit.MimeTypeMap;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-import java.util.List;
-
-/**
- * Tests for {@link ResponderLocation}.
- */
-@RunWith(JUnit4.class)
-public class ResponderLocationTest {
- private static final double LATLNG_TOLERANCE_DEGREES = 0.000_000_05D; // 5E-8 = 6mm of meridian
- private static final double ALT_TOLERANCE_METERS = 0.01;
- private static final double HEIGHT_TOLERANCE_METERS = 0.01;
- private static final int INDEX_ELEMENT_TYPE = 2;
- private static final int INDEX_SUBELEMENT_TYPE = 0;
- private static final int INDEX_SUBELEMENT_LENGTH = 1;
-
- /* Test Buffers */
-
- private static final byte[] sTestLciIeHeader = {
- (byte) 0x01, (byte) 0x00, (byte) 0x08 // LCI Information Element (IE)
- };
-
- private static final byte[] sTestLciShortBuffer = {
- (byte) 0x00
- };
-
- private static final byte[] sTestLciSE = {
- (byte) 0x00, // Subelement LCI
- (byte) 16, // Subelement LCI length always = 16
- (byte) 0x52,
- (byte) 0x83,
- (byte) 0x4d,
- (byte) 0x12,
- (byte) 0xef,
- (byte) 0xd2,
- (byte) 0xb0,
- (byte) 0x8b,
- (byte) 0x9b,
- (byte) 0x4b,
- (byte) 0xf1,
- (byte) 0xcc,
- (byte) 0x2c,
- (byte) 0x00,
- (byte) 0x00,
- (byte) 0x41
- };
-
- private static final byte[] sTestZHeightSE = {
- (byte) 0x04, // Subelement Z
- (byte) 6, // Length always 6
- (byte) 0x00, // LSB STA Floor Info (2 bytes)
- (byte) 0x01, // MSB
- (byte) 0xcd, // LSB Height(m) (3 bytes)
- (byte) 0x2c,
- (byte) 0x00, // MSB Height(m)
- (byte) 0x0e, // STA Height Uncertainty
- };
-
- private static final byte[] sTestUsageSE1 = {
- (byte) 0x06, // Subelement Usage Rights
- (byte) 1, // Length 1 (with no retention limit)
- (byte) 0x01, // Retransmit ok, No expiration, no extra info available
- };
-
- private static final byte[] sTestUsageSE2 = {
- (byte) 0x06, // Subelement Usage Rights
- (byte) 3, // Length 3 (including retention limit)
- (byte) 0x06, // Retransmit not ok, Expiration, extra info available
- (byte) 0x00, // LSB expiration time (0x8000 = 32768 hrs)
- (byte) 0x80 // MSB expiration time
- };
-
- private static final byte[] sTestBssidListSE = {
- (byte) 0x07, // Subelement BSSID list
- (byte) 13, // length dependent on number of BSSIDs in list
- (byte) 0x00, // List is explicit; no expansion of list required
- (byte) 0x01, // BSSID #1 (MSB)
- (byte) 0x02,
- (byte) 0x03,
- (byte) 0x04,
- (byte) 0x05,
- (byte) 0x06, // (LSB)
- (byte) 0xf1, // BSSID #2 (MSB)
- (byte) 0xf2,
- (byte) 0xf3,
- (byte) 0xf4,
- (byte) 0xf5,
- (byte) 0xf6 // (LSB)
- };
-
- private static final byte[] sTestLcrBufferHeader = {
- (byte) 0x01, (byte) 0x00, (byte) 0x0b,
- };
-
- private static final byte[] sEmptyBuffer = {};
-
- private static final byte[] sTestCivicLocationSEWithAddress = {
- (byte) 0, // Civic Location Subelement
- (byte) 39, // Length of subelement value
- (byte) 'U', // CountryCodeChar1
- (byte) 'S', // CountryCodeChar2
- (byte) CivicLocationKeys.HNO,
- (byte) 2,
- (byte) '1',
- (byte) '5',
- (byte) CivicLocationKeys.PRIMARY_ROAD_NAME,
- (byte) 4,
- (byte) 'A',
- (byte) 'l',
- (byte) 't',
- (byte) 'o',
- (byte) CivicLocationKeys.STREET_NAME_POST_MODIFIER,
- (byte) 4,
- (byte) 'R',
- (byte) 'o',
- (byte) 'a',
- (byte) 'd',
- (byte) CivicLocationKeys.CITY,
- (byte) 8,
- (byte) 'M',
- (byte) 't',
- (byte) 'n',
- (byte) ' ',
- (byte) 'V',
- (byte) 'i',
- (byte) 'e',
- (byte) 'w',
- (byte) CivicLocationKeys.STATE,
- (byte) 2,
- (byte) 'C',
- (byte) 'A',
- (byte) CivicLocationKeys.POSTAL_CODE,
- (byte) 5,
- (byte) '9',
- (byte) '4',
- (byte) '0',
- (byte) '4',
- (byte) '3'
- };
-
- // Buffer representing: "https://map.com/mall.jpg"
- private static final byte[] sTestMapUrlSE = {
- (byte) 5, // Map URL Subelement
- (byte) 25,
- (byte) 0, // MAP_TYPE_URL_DEFINED
- (byte) 'h',
- (byte) 't',
- (byte) 't',
- (byte) 'p',
- (byte) 's',
- (byte) ':',
- (byte) '/',
- (byte) '/',
- (byte) 'm',
- (byte) 'a',
- (byte) 'p',
- (byte) '.',
- (byte) 'c',
- (byte) 'o',
- (byte) 'm',
- (byte) '/',
- (byte) 'm',
- (byte) 'a',
- (byte) 'l',
- (byte) 'l',
- (byte) '.',
- (byte) 'j',
- (byte) 'p',
- (byte) 'g'
- };
-
- /**
- * Test if the lci and lcr buffers are null.
- */
- @Test
- public void testIfLciOrLcrIsNull() {
- ResponderLocation responderLocation = new ResponderLocation(null, null);
-
- boolean valid = responderLocation.isValid();
- boolean lciValid = responderLocation.isLciSubelementValid();
- boolean zValid = responderLocation.isZaxisSubelementValid();
-
- assertFalse(valid);
- assertFalse(lciValid);
- assertFalse(zValid);
- }
-
- /**
- * Test if the lci and lcr buffers are empty.
- */
- @Test
- public void testIfLciOrLcrIsEmpty() {
- ResponderLocation responderLocation = new ResponderLocation(sEmptyBuffer, sEmptyBuffer);
-
- boolean valid = responderLocation.isValid();
- boolean lciValid = responderLocation.isLciSubelementValid();
- boolean zValid = responderLocation.isZaxisSubelementValid();
-
- assertFalse(valid);
- assertFalse(lciValid);
- assertFalse(zValid);
- }
-
- /**
- * Test if the lci subelement only has one byte
- */
- @Test
- public void testIfLciShortBuffer() {
- byte[] testLciBuffer = concatenateArrays(sTestLciIeHeader, sTestLciShortBuffer);
- ResponderLocation responderLocation =
- new ResponderLocation(testLciBuffer, sTestLcrBufferHeader);
-
- boolean valid = responderLocation.isValid();
- boolean lciValid = responderLocation.isLciSubelementValid();
- boolean zValid = responderLocation.isZaxisSubelementValid();
-
- assertFalse(valid);
- assertFalse(lciValid);
- assertFalse(zValid);
- }
-
- /**
- * Test that the example buffer contains a valid LCI Subelement.
- */
- @Test
- public void testLciValidSubelement() {
- byte[] testLciBuffer = concatenateArrays(sTestLciIeHeader, sTestLciSE);
- ResponderLocation responderLocation =
- new ResponderLocation(testLciBuffer, sTestLcrBufferHeader);
-
- boolean valid = responderLocation.isValid();
- boolean lciValid = responderLocation.isLciSubelementValid();
- boolean zValid = responderLocation.isZaxisSubelementValid();
- Location location = responderLocation.toLocation();
-
- assertTrue(valid);
- assertTrue(lciValid);
- assertFalse(zValid);
- assertEquals(0.0009765625D, responderLocation.getLatitudeUncertainty());
- assertEquals(-33.8570095D, responderLocation.getLatitude(),
- LATLNG_TOLERANCE_DEGREES);
- assertEquals(0.0009765625D, responderLocation.getLongitudeUncertainty());
- assertEquals(151.2152005D, responderLocation.getLongitude(),
- LATLNG_TOLERANCE_DEGREES);
- assertEquals(1, responderLocation.getAltitudeType());
- assertEquals(64.0, responderLocation.getAltitudeUncertainty());
- assertEquals(11.2, responderLocation.getAltitude(), ALT_TOLERANCE_METERS);
- assertEquals(1, responderLocation.getDatum()); // WGS84
- assertEquals(false, responderLocation.getRegisteredLocationAgreementIndication());
- assertEquals(false, responderLocation.getRegisteredLocationDseIndication());
- assertEquals(false, responderLocation.getDependentStationIndication());
- assertEquals(1, responderLocation.getLciVersion());
-
- // Testing Location Object
- assertEquals(-33.8570095D, location.getLatitude(),
- LATLNG_TOLERANCE_DEGREES);
- assertEquals(151.2152005D, location.getLongitude(),
- LATLNG_TOLERANCE_DEGREES);
- assertEquals((0.0009765625D + 0.0009765625D) / 2, location.getAccuracy(),
- LATLNG_TOLERANCE_DEGREES);
- assertEquals(11.2, location.getAltitude(), ALT_TOLERANCE_METERS);
- assertEquals(64.0, location.getVerticalAccuracyMeters(), ALT_TOLERANCE_METERS);
- }
-
- /**
- * Test for an invalid LCI element.
- */
- @Test
- public void testLciInvalidElement() {
- byte[] testBuffer = concatenateArrays(sTestLciIeHeader, sTestLciSE);
- testBuffer[INDEX_ELEMENT_TYPE] = (byte) 0xFF;
- ResponderLocation responderLocation =
- new ResponderLocation(testBuffer, sTestLcrBufferHeader);
-
- boolean valid = responderLocation.isValid();
- boolean lciValid = responderLocation.isLciSubelementValid();
- boolean zValid = responderLocation.isZaxisSubelementValid();
-
- assertFalse(valid);
- assertFalse(lciValid);
- assertFalse(zValid);
- }
-
- /**
- * Test for an invalid subelement type.
- */
- @Test
- public void testSkipLciSubElementUnusedOrUnknown() {
- byte[] testLciBuffer = concatenateArrays(sTestLciIeHeader, sTestLciSE);
- // Corrupt the subelement type to an unknown type.
- testLciBuffer[sTestLciIeHeader.length + INDEX_SUBELEMENT_TYPE] = (byte) 0x77;
- ResponderLocation responderLocation =
- new ResponderLocation(testLciBuffer, sTestLcrBufferHeader);
-
- boolean valid = responderLocation.isValid();
- boolean lciValid = responderLocation.isLciSubelementValid();
- boolean zValid = responderLocation.isZaxisSubelementValid();
-
- assertFalse(valid);
- assertFalse(lciValid);
- assertFalse(zValid);
- }
-
- /**
- * Test for a subelement LCI length too small.
- */
- @Test
- public void testInvalidLciSubElementLengthTooSmall() {
- byte[] testLciBuffer = concatenateArrays(sTestLciIeHeader, sTestLciSE);
- // Corrupt the length making it too small.
- testLciBuffer[sTestLciIeHeader.length + INDEX_SUBELEMENT_LENGTH] = (byte) 0x01;
- ResponderLocation responderLocation =
- new ResponderLocation(testLciBuffer, sTestLcrBufferHeader);
-
- boolean valid = responderLocation.isValid();
- boolean lciValid = responderLocation.isLciSubelementValid();
- boolean zValid = responderLocation.isZaxisSubelementValid();
-
- assertFalse(valid);
- assertFalse(lciValid);
- assertFalse(zValid);
- }
-
- /**
- * Test for a subelement LCI length too big.
- */
- @Test
- public void testInvalidLciSubElementLengthTooBig() {
- byte[] testLciBuffer = concatenateArrays(sTestLciIeHeader, sTestLciSE);
- // Corrupt the length making it too big.
- testLciBuffer[sTestLciIeHeader.length + INDEX_SUBELEMENT_TYPE] = (byte) 0x11;
- ResponderLocation responderLocation =
- new ResponderLocation(testLciBuffer, sTestLcrBufferHeader);
-
- boolean valid = responderLocation.isValid();
- boolean lciValid = responderLocation.isLciSubelementValid();
- boolean zValid = responderLocation.isZaxisSubelementValid();
-
- assertFalse(valid);
- assertFalse(lciValid);
- assertFalse(zValid);
- }
-
- /**
- * Test for a valid Z (Height) subelement following an LCI subelement.
- */
- @Test
- public void testLciValidZBufferSEAfterLci() {
- byte[] testBufferTmp = concatenateArrays(sTestLciIeHeader, sTestLciSE);
- byte[] testBuffer = concatenateArrays(testBufferTmp, sTestZHeightSE);
- ResponderLocation responderLocation =
- new ResponderLocation(testBuffer, sTestLcrBufferHeader);
-
- boolean isValid = responderLocation.isValid();
- boolean isZValid = responderLocation.isZaxisSubelementValid();
- boolean isLciValid = responderLocation.isLciSubelementValid();
- double staFloorNumber = responderLocation.getFloorNumber();
- double staHeightAboveFloorMeters = responderLocation.getHeightAboveFloorMeters();
- double staHeightAboveFloorUncertaintyMeters =
- responderLocation.getHeightAboveFloorUncertaintyMeters();
-
- assertTrue(isValid);
- assertTrue(isZValid);
- assertTrue(isLciValid);
- assertEquals(4.0, staFloorNumber);
- assertEquals(2.8, staHeightAboveFloorMeters, HEIGHT_TOLERANCE_METERS);
- assertEquals(0.125, staHeightAboveFloorUncertaintyMeters);
- }
-
- /**
- * Test for a valid Usage Policy that is unrestrictive
- */
- @Test
- public void testLciOpenUsagePolicy() {
- byte[] testBufferTmp = concatenateArrays(sTestLciIeHeader, sTestLciSE);
- byte[] testBuffer = concatenateArrays(testBufferTmp, sTestUsageSE1);
- ResponderLocation responderLocation =
- new ResponderLocation(testBuffer, sTestLcrBufferHeader);
-
- boolean valid = responderLocation.isValid();
- boolean retransmit = responderLocation.getRetransmitPolicyIndication();
- boolean expiration = responderLocation.getRetentionExpiresIndication();
- boolean extraInfo = responderLocation.getExtraInfoOnAssociationIndication();
-
- assertTrue(valid);
- assertTrue(retransmit);
- assertFalse(expiration);
- assertFalse(extraInfo);
- }
-
- /**
- * Test for a valid Usage Policy that is restrictive
- */
- @Test
- public void testLciRestrictiveUsagePolicy() {
- byte[] testBufferTmp = concatenateArrays(sTestLciIeHeader, sTestLciSE);
- byte[] testBuffer = concatenateArrays(testBufferTmp, sTestUsageSE2);
- ResponderLocation responderLocation =
- new ResponderLocation(testBuffer, sTestLcrBufferHeader);
-
- boolean valid = responderLocation.isValid();
- boolean retransmit = responderLocation.getRetransmitPolicyIndication();
- boolean expiration = responderLocation.getRetentionExpiresIndication();
- boolean extraInfo = responderLocation.getExtraInfoOnAssociationIndication();
-
- assertFalse(valid);
- assertFalse(retransmit);
- assertTrue(expiration);
- assertTrue(extraInfo);
- }
-
- /**
- * Test for a valid BSSID element following an LCI subelement.
- */
- @Test
- public void testLciBssidListSEAfterLci() {
- byte[] testBufferTmp = concatenateArrays(sTestLciIeHeader, sTestLciSE);
- byte[] testBuffer = concatenateArrays(testBufferTmp, sTestBssidListSE);
- ResponderLocation responderLocation =
- new ResponderLocation(testBuffer, sTestLcrBufferHeader);
-
- boolean valid = responderLocation.isValid();
- List<MacAddress> bssidList = responderLocation.getColocatedBssids();
-
- assertTrue(valid);
- assertEquals(2, bssidList.size());
- MacAddress macAddress1 = bssidList.get(0);
- assertEquals("01:02:03:04:05:06", macAddress1.toString());
- MacAddress macAddress2 = bssidList.get(1);
- assertEquals("f1:f2:f3:f4:f5:f6", macAddress2.toString());
- }
-
- /**
- * Test for a valid BSSID element before and LCI element
- */
- @Test
- public void testLciBssidListSEBeforeLci() {
- byte[] testBufferTmp = concatenateArrays(sTestLciIeHeader, sTestBssidListSE);
- byte[] testBuffer = concatenateArrays(testBufferTmp, sTestLciSE);
- ResponderLocation responderLocation =
- new ResponderLocation(testBuffer, sTestLcrBufferHeader);
-
- boolean valid = responderLocation.isValid();
- List<MacAddress> bssidList = responderLocation.getColocatedBssids();
-
- assertTrue(valid);
- assertEquals(2, bssidList.size());
- MacAddress macAddress1 = bssidList.get(0);
- assertEquals("01:02:03:04:05:06", macAddress1.toString());
- MacAddress macAddress2 = bssidList.get(1);
- assertEquals("f1:f2:f3:f4:f5:f6", macAddress2.toString());
- }
-
- /**
- * Test that a valid address can be extracted from a valid lcr buffer with Civic Location.
- */
- @Test
- public void testLcrTestCivicLocationAddress() {
- byte[] testLciBuffer = concatenateArrays(sTestLciIeHeader, sTestLciSE);
- byte[] testLcrBuffer =
- concatenateArrays(sTestLcrBufferHeader, sTestCivicLocationSEWithAddress);
- ResponderLocation responderLocation = new ResponderLocation(testLciBuffer, testLcrBuffer);
-
- boolean valid = responderLocation.isValid();
- String countryCode = responderLocation.getCivicLocationCountryCode();
- Address address = responderLocation.toCivicLocationAddress();
-
- assertTrue(valid);
- assertEquals("US", countryCode);
- assertEquals("", address.getAddressLine(0));
- assertEquals("15 Alto", address.getAddressLine(1));
- assertEquals("Mtn View", address.getAddressLine(2));
- assertEquals("CA 94043", address.getAddressLine(3));
- assertEquals("US", address.getAddressLine(4));
- }
-
- /**
- * Test that a Civic Location sparseArray can be extracted from a valid lcr buffer.
- */
- @Test
- public void testLcrTestCivicLocationSparseArray() {
- byte[] testLciBuffer = concatenateArrays(sTestLciIeHeader, sTestLciSE);
- byte[] testLcrBuffer =
- concatenateArrays(sTestLcrBufferHeader, sTestCivicLocationSEWithAddress);
- ResponderLocation responderLocation = new ResponderLocation(testLciBuffer, testLcrBuffer);
-
- boolean valid = responderLocation.isValid();
- SparseArray<String> civicLocationSparseArray = responderLocation
- .toCivicLocationSparseArray();
-
- assertTrue(valid);
- assertEquals("15", civicLocationSparseArray.get(CivicLocationKeys.HNO));
- assertEquals("Alto",
- civicLocationSparseArray.get(CivicLocationKeys.PRIMARY_ROAD_NAME));
- assertEquals("Road",
- civicLocationSparseArray.get(CivicLocationKeys.STREET_NAME_POST_MODIFIER));
- assertEquals("Mtn View", civicLocationSparseArray.get(CivicLocationKeys.CITY));
- assertEquals("94043", civicLocationSparseArray.get(CivicLocationKeys.POSTAL_CODE));
- }
-
- /**
- * Test that a URL can be extracted from a valid lcr buffer with a map image subelement.
- */
- @Test
- public void testLcrCheckMapUriIsValid() {
- byte[] testLciBuffer = concatenateArrays(sTestLciIeHeader, sTestLciSE);
- byte[] testLcrBuffer = concatenateArrays(sTestLcrBufferHeader, sTestMapUrlSE);
- ResponderLocation responderLocation = new ResponderLocation(testLciBuffer, testLcrBuffer);
-
- boolean valid = responderLocation.isValid();
- String mapImageMimeType = responderLocation.getMapImageMimeType();
- String urlString = "";
- if (responderLocation.getMapImageUri() != null) {
- urlString = responderLocation.getMapImageUri().toString();
- }
-
- assertTrue(valid);
- MimeTypeMap mimeTypeMap = MimeTypeMap.getSingleton();
- assertEquals(mimeTypeMap.getMimeTypeFromExtension("jpg"), mapImageMimeType);
- assertEquals("https://map.com/mall.jpg", urlString);
- }
-
- /**
- * Test the object is parcelable
- */
- @Test
- public void testResponderLocationParcelable() {
- byte[] testLciBuffer = concatenateArrays(sTestLciIeHeader, sTestLciSE);
- ResponderLocation responderLocation =
- new ResponderLocation(testLciBuffer, sTestLcrBufferHeader);
-
- Parcel parcel = Parcel.obtain();
- responderLocation.writeToParcel(parcel, 0);
- parcel.setDataPosition(0);
- ResponderLocation responderLocationFromParcel =
- ResponderLocation.CREATOR.createFromParcel(parcel);
-
- assertEquals(responderLocationFromParcel, responderLocation);
- }
-
- /* Helper Method */
-
- /**
- * Concatenate two arrays.
- *
- * @param a first array
- * @param b second array
- * @return a third array which is the concatenation of the two array params
- */
- private byte[] concatenateArrays(byte[] a, byte[] b) {
- int aLen = a.length;
- int bLen = b.length;
- byte[] c = new byte[aLen + bLen];
- System.arraycopy(a, 0, c, 0, aLen);
- System.arraycopy(b, 0, c, aLen, bLen);
- return c;
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/rtt/WifiRttManagerTest.java b/wifi/tests/src/android/net/wifi/rtt/WifiRttManagerTest.java
deleted file mode 100644
index c8006fe..0000000
--- a/wifi/tests/src/android/net/wifi/rtt/WifiRttManagerTest.java
+++ /dev/null
@@ -1,464 +0,0 @@
-/*
- * 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.
- */
-
-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;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
-
-import android.content.Context;
-import android.net.MacAddress;
-import android.net.wifi.ScanResult;
-import android.net.wifi.aware.PeerHandle;
-import android.os.IBinder;
-import android.os.Parcel;
-import android.os.test.TestLooper;
-
-import androidx.test.filters.SmallTest;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Executor;
-
-/**
- * Unit test harness for WifiRttManager class.
- */
-@SmallTest
-public class WifiRttManagerTest {
- private WifiRttManager mDut;
- private TestLooper mMockLooper;
- private Executor mMockLooperExecutor;
-
- private final String packageName = "some.package.name.for.rtt.app";
- private final String featureId = "some.feature.id.in.rtt.app";
-
- @Mock
- public Context mockContext;
-
- @Mock
- public IWifiRttManager mockRttService;
-
- @Before
- public void setUp() throws Exception {
- MockitoAnnotations.initMocks(this);
-
- mDut = new WifiRttManager(mockContext, mockRttService);
- mMockLooper = new TestLooper();
- mMockLooperExecutor = mMockLooper.getNewExecutor();
-
- when(mockContext.getOpPackageName()).thenReturn(packageName);
- when(mockContext.getAttributionTag()).thenReturn(featureId);
- }
-
- /**
- * Validate ranging call flow with successful results.
- */
- @Test
- public void testRangeSuccess() throws Exception {
- RangingRequest request = new RangingRequest.Builder().build();
- List<RangingResult> results = new ArrayList<>();
- results.add(
- new RangingResult(RangingResult.STATUS_SUCCESS, MacAddress.BROADCAST_ADDRESS, 15, 5,
- 10, 8, 5, null, null, null, 666));
- RangingResultCallback callbackMock = mock(RangingResultCallback.class);
- ArgumentCaptor<IRttCallback> callbackCaptor = ArgumentCaptor.forClass(IRttCallback.class);
-
- // verify ranging request passed to service
- mDut.startRanging(request, mMockLooperExecutor, callbackMock);
- verify(mockRttService).startRanging(any(IBinder.class), eq(packageName), eq(featureId),
- eq(null), eq(request), callbackCaptor.capture());
-
- // service calls back with success
- callbackCaptor.getValue().onRangingResults(results);
- mMockLooper.dispatchAll();
- verify(callbackMock).onRangingResults(results);
-
- verifyNoMoreInteractions(mockRttService, callbackMock);
- }
-
- /**
- * Validate ranging call flow which failed.
- */
- @Test
- public void testRangeFail() throws Exception {
- int failureCode = RangingResultCallback.STATUS_CODE_FAIL;
-
- RangingRequest request = new RangingRequest.Builder().build();
- RangingResultCallback callbackMock = mock(RangingResultCallback.class);
- ArgumentCaptor<IRttCallback> callbackCaptor = ArgumentCaptor.forClass(IRttCallback.class);
-
- // verify ranging request passed to service
- mDut.startRanging(request, mMockLooperExecutor, callbackMock);
- verify(mockRttService).startRanging(any(IBinder.class), eq(packageName), eq(featureId),
- eq(null), eq(request), callbackCaptor.capture());
-
- // service calls back with failure code
- callbackCaptor.getValue().onRangingFailure(failureCode);
- mMockLooper.dispatchAll();
- verify(callbackMock).onRangingFailure(failureCode);
-
- verifyNoMoreInteractions(mockRttService, callbackMock);
- }
-
- /**
- * Validate that RangingRequest parcel works (produces same object on write/read).
- */
- @Test
- public void testRangingRequestParcel() {
- // Note: not validating parcel code of ScanResult (assumed to work)
- ScanResult scanResult1 = new ScanResult();
- scanResult1.BSSID = "00:01:02:03:04:05";
- ScanResult scanResult2 = new ScanResult();
- scanResult2.BSSID = "06:07:08:09:0A:0B";
- ScanResult scanResult3 = new ScanResult();
- scanResult3.BSSID = "AA:BB:CC:DD:EE:FF";
- List<ScanResult> scanResults2and3 = new ArrayList<>(2);
- scanResults2and3.add(scanResult2);
- scanResults2and3.add(scanResult3);
- MacAddress mac1 = MacAddress.fromString("00:01:02:03:04:05");
- PeerHandle peerHandle1 = new PeerHandle(12);
-
- RangingRequest.Builder builder = new RangingRequest.Builder();
- builder.setRttBurstSize(4);
- builder.addAccessPoint(scanResult1);
- builder.addAccessPoints(scanResults2and3);
- builder.addWifiAwarePeer(mac1);
- builder.addWifiAwarePeer(peerHandle1);
- RangingRequest request = builder.build();
-
- Parcel parcelW = Parcel.obtain();
- request.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- RangingRequest rereadRequest = RangingRequest.CREATOR.createFromParcel(parcelR);
-
- assertEquals(request, rereadRequest);
- }
-
- /**
- * 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
- public void testRangingRequestAtLimit() {
- ScanResult scanResult = new ScanResult();
- scanResult.BSSID = "AA:BB:CC:DD:EE:FF";
- List<ScanResult> scanResultList = new ArrayList<>();
- for (int i = 0; i < RangingRequest.getMaxPeers() - 3; ++i) {
- scanResultList.add(scanResult);
- }
- MacAddress mac1 = MacAddress.fromString("00:01:02:03:04:05");
-
- // create request using max RTT Peers
- RangingRequest.Builder builder = new RangingRequest.Builder();
- builder.addAccessPoint(scanResult);
- builder.addAccessPoints(scanResultList);
- builder.addAccessPoint(scanResult);
- builder.addWifiAwarePeer(mac1);
- RangingRequest request = builder.build();
-
- // 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());
- }
-
- /**
- * Validate that limit on number of requests is applied.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testRangingRequestPastLimit() {
- ScanResult scanResult = new ScanResult();
- scanResult.BSSID = "00:01:02:03:04:05";
- List<ScanResult> scanResultList = new ArrayList<>();
- for (int i = 0; i < RangingRequest.getMaxPeers() - 2; ++i) {
- scanResultList.add(scanResult);
- }
- MacAddress mac1 = MacAddress.fromString("00:01:02:03:04:05");
-
- // create request
- RangingRequest.Builder builder = new RangingRequest.Builder();
- builder.addAccessPoint(scanResult);
- builder.addAccessPoints(scanResultList);
- builder.addAccessPoint(scanResult);
- builder.addWifiAwarePeer(mac1);
- RangingRequest request = builder.build();
-
- // verify request
- request.enforceValidity(true);
- }
-
- /**
- * Validate that Aware requests are invalid on devices which do not support Aware
- */
- @Test(expected = IllegalArgumentException.class)
- public void testRangingRequestWithAwareWithNoAwareSupport() {
- // create request
- RangingRequest.Builder builder = new RangingRequest.Builder();
- builder.addWifiAwarePeer(new PeerHandle(10));
- RangingRequest request = builder.build();
-
- // verify request
- request.enforceValidity(false);
- }
-
- /**
- * Validate that RangingResults parcel works (produces same object on write/read).
- */
- @Test
- public void testRangingResultsParcel() {
- int status = RangingResult.STATUS_SUCCESS;
- final MacAddress mac = MacAddress.fromString("00:01:02:03:04:05");
- PeerHandle peerHandle = new PeerHandle(10);
- int distanceCm = 105;
- int distanceStdDevCm = 10;
- int rssi = 5;
- int numAttemptedMeasurements = 8;
- int numSuccessfulMeasurements = 3;
- long timestamp = System.currentTimeMillis();
- byte[] lci = { 0x5, 0x6, 0x7 };
- byte[] lcr = { 0x1, 0x2, 0x3, 0xA, 0xB, 0xC };
-
- // RangingResults constructed with a MAC address
- RangingResult result = new RangingResult(status, mac, distanceCm, distanceStdDevCm, rssi,
- numAttemptedMeasurements, numSuccessfulMeasurements, lci, lcr, null, timestamp);
-
- Parcel parcelW = Parcel.obtain();
- result.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- RangingResult rereadResult = RangingResult.CREATOR.createFromParcel(parcelR);
-
- assertEquals(result, rereadResult);
-
- // RangingResults constructed with a PeerHandle
- result = new RangingResult(status, peerHandle, distanceCm, distanceStdDevCm, rssi,
- numAttemptedMeasurements, numSuccessfulMeasurements, null, null, null, timestamp);
-
- parcelW = Parcel.obtain();
- result.writeToParcel(parcelW, 0);
- bytes = parcelW.marshall();
- parcelW.recycle();
-
- parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- rereadResult = RangingResult.CREATOR.createFromParcel(parcelR);
-
- assertEquals(result, rereadResult);
- }
-
- /**
- * Validate that RangingResults tests equal even if LCI/LCR is empty (length == 0) and null.
- */
- @Test
- public void testRangingResultsEqualityLciLcr() {
- int status = RangingResult.STATUS_SUCCESS;
- final MacAddress mac = MacAddress.fromString("00:01:02:03:04:05");
- PeerHandle peerHandle = new PeerHandle(10);
- int distanceCm = 105;
- int distanceStdDevCm = 10;
- int rssi = 5;
- int numAttemptedMeasurements = 10;
- int numSuccessfulMeasurements = 3;
- long timestamp = System.currentTimeMillis();
- byte[] lci = { };
- byte[] lcr = { };
-
- RangingResult rr1 = new RangingResult(status, mac, distanceCm, distanceStdDevCm, rssi,
- numAttemptedMeasurements, numSuccessfulMeasurements, lci, lcr, null, timestamp);
- RangingResult rr2 = new RangingResult(status, mac, distanceCm, distanceStdDevCm, rssi,
- numAttemptedMeasurements, numSuccessfulMeasurements, null, null, null, timestamp);
-
- assertEquals(rr1, rr2);
- }
-
- /**
- * Validate that ResponderConfig parcel works (produces same object on write/read).
- */
- @Test
- public void testResponderConfigParcel() {
- // ResponderConfig constructed with a MAC address
- ResponderConfig config = new ResponderConfig(MacAddress.fromString("00:01:02:03:04:05"),
- ResponderConfig.RESPONDER_AP, true, ResponderConfig.CHANNEL_WIDTH_80MHZ, 2134, 2345,
- 2555, ResponderConfig.PREAMBLE_LEGACY);
-
- Parcel parcelW = Parcel.obtain();
- config.writeToParcel(parcelW, 0);
- byte[] bytes = parcelW.marshall();
- parcelW.recycle();
-
- Parcel parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- ResponderConfig rereadConfig = ResponderConfig.CREATOR.createFromParcel(parcelR);
-
- assertEquals(config, rereadConfig);
-
- // ResponderConfig constructed with a PeerHandle
- config = new ResponderConfig(new PeerHandle(10), ResponderConfig.RESPONDER_AWARE, false,
- ResponderConfig.CHANNEL_WIDTH_80MHZ_PLUS_MHZ, 5555, 6666, 7777,
- ResponderConfig.PREAMBLE_VHT);
-
- parcelW = Parcel.obtain();
- config.writeToParcel(parcelW, 0);
- bytes = parcelW.marshall();
- parcelW.recycle();
-
- parcelR = Parcel.obtain();
- parcelR.unmarshall(bytes, 0, bytes.length);
- parcelR.setDataPosition(0);
- rereadConfig = ResponderConfig.CREATOR.createFromParcel(parcelR);
-
- assertEquals(config, rereadConfig);
- }
-
- /**
- * Validate preamble selection from ScanResults.
- */
- @Test
- public void testResponderPreambleSelection() {
- ScanResult.InformationElement htCap = new ScanResult.InformationElement();
- htCap.id = ScanResult.InformationElement.EID_HT_CAPABILITIES;
-
- ScanResult.InformationElement vhtCap = new ScanResult.InformationElement();
- vhtCap.id = ScanResult.InformationElement.EID_VHT_CAPABILITIES;
-
- ScanResult.InformationElement vsa = new ScanResult.InformationElement();
- vsa.id = ScanResult.InformationElement.EID_VSA;
-
- // no IE
- ScanResult scan = new ScanResult();
- scan.BSSID = "00:01:02:03:04:05";
- scan.informationElements = null;
- scan.channelWidth = ResponderConfig.CHANNEL_WIDTH_80MHZ;
-
- ResponderConfig config = ResponderConfig.fromScanResult(scan);
-
- assertEquals(ResponderConfig.PREAMBLE_VHT, config.preamble);
-
- // IE with HT & VHT
- scan.channelWidth = ResponderConfig.CHANNEL_WIDTH_40MHZ;
-
- scan.informationElements = new ScanResult.InformationElement[2];
- scan.informationElements[0] = htCap;
- scan.informationElements[1] = vhtCap;
-
- config = ResponderConfig.fromScanResult(scan);
-
- assertEquals(ResponderConfig.PREAMBLE_VHT, config.preamble);
-
- // IE with some entries but no HT or VHT
- scan.informationElements[0] = vsa;
- scan.informationElements[1] = vsa;
-
- config = ResponderConfig.fromScanResult(scan);
-
- assertEquals(ResponderConfig.PREAMBLE_LEGACY, config.preamble);
-
- // IE with HT
- scan.informationElements[0] = vsa;
- scan.informationElements[1] = htCap;
-
- config = ResponderConfig.fromScanResult(scan);
-
- assertEquals(ResponderConfig.PREAMBLE_HT, config.preamble);
- }
-}
diff --git a/wifi/tests/src/android/net/wifi/util/HexEncodingTest.java b/wifi/tests/src/android/net/wifi/util/HexEncodingTest.java
deleted file mode 100644
index 0d75138..0000000
--- a/wifi/tests/src/android/net/wifi/util/HexEncodingTest.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * 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.net.wifi.util;
-
-import static android.net.wifi.util.HexEncoding.decode;
-import static android.net.wifi.util.HexEncoding.encode;
-import static android.net.wifi.util.HexEncoding.encodeToString;
-
-import junit.framework.TestCase;
-
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.Locale;
-
-/** Copied from {@link libcore.libcore.util.HexEncodingTest}. */
-public class HexEncodingTest extends TestCase {
-
- public void testEncodeByte() {
- Object[][] testCases = new Object[][]{
- {0x01, "01"},
- {0x09, "09"},
- {0x0A, "0A"},
- {0x0F, "0F"},
- {0x10, "10"},
- {0x1F, "1F"},
- {0x20, "20"},
- {0x7F, "7F"},
- {0x80, "80"},
- {0xFF, "FF"},
- };
- for (Object[] testCase : testCases) {
- Number toEncode = (Number) testCase[0];
- String expected = (String) testCase[1];
-
- String actualUpper = encodeToString(toEncode.byteValue(), true /* upperCase */);
- assertEquals(upper(expected), actualUpper);
-
- String actualLower = encodeToString(toEncode.byteValue(), false /* upperCase */);
- assertEquals(lower(expected), actualLower);
- }
- }
-
- public void testEncodeBytes() {
- Object[][] testCases = new Object[][]{
- {"avocados".getBytes(StandardCharsets.UTF_8), "61766F6361646F73"},
- };
-
- for (Object[] testCase : testCases) {
- byte[] bytes = (byte[]) testCase[0];
- String encodedLower = lower((String) testCase[1]);
- String encodedUpper = upper((String) testCase[1]);
-
- assertArraysEqual(encodedUpper.toCharArray(), encode(bytes));
- assertArraysEqual(encodedUpper.toCharArray(), encode(bytes, true /* upperCase */));
- assertArraysEqual(encodedLower.toCharArray(), encode(bytes, false /* upperCase */));
-
- assertArraysEqual(bytes, decode(encode(bytes), false /* allowSingleChar */));
-
- // Make sure we can handle lower case hex encodings as well.
- assertArraysEqual(bytes,
- decode(encodedLower.toCharArray(), false /* allowSingleChar */));
- }
- }
-
- public void testDecode_allow4Bit() {
- assertArraysEqual(new byte[]{6}, decode("6".toCharArray(), true));
- assertArraysEqual(new byte[]{6, 0x76}, decode("676".toCharArray(), true));
- }
-
- public void testDecode_disallow4Bit() {
- try {
- decode("676".toCharArray(), false /* allowSingleChar */);
- fail();
- } catch (IllegalArgumentException expected) {
- }
- }
-
- public void testDecode_invalid() {
- try {
- decode("DEADBARD".toCharArray(), false /* allowSingleChar */);
- fail();
- } catch (IllegalArgumentException expected) {
- }
-
- // This demonstrates a difference in behaviour from apache commons : apache
- // commons uses Character.isDigit and would successfully decode a string with
- // arabic and devanagari characters.
- try {
- decode("६१٧٥٥F6361646F73".toCharArray(), false /* allowSingleChar */);
- fail();
- } catch (IllegalArgumentException expected) {
- }
-
- try {
- decode("#%6361646F73".toCharArray(), false /* allowSingleChar */);
- fail();
- } catch (IllegalArgumentException expected) {
- }
- }
-
- private static void assertArraysEqual(char[] lhs, char[] rhs) {
- assertEquals(new String(lhs), new String(rhs));
- }
-
- private static void assertArraysEqual(byte[] lhs, byte[] rhs) {
- assertEquals(Arrays.toString(lhs), Arrays.toString(rhs));
- }
-
- private static String lower(String string) {
- return string.toLowerCase(Locale.ROOT);
- }
-
- private static String upper(String string) {
- return string.toUpperCase(Locale.ROOT);
- }
-}
diff --git a/wifi/tests/test-jarjar-rules.txt b/wifi/tests/test-jarjar-rules.txt
deleted file mode 100644
index 41b97ab..0000000
--- a/wifi/tests/test-jarjar-rules.txt
+++ /dev/null
@@ -1 +0,0 @@
-rule com.android.modules.utils.** com.android.wifi.test.x.@0