diff options
76 files changed, 453 insertions, 330 deletions
diff --git a/ApiDocs.bp b/ApiDocs.bp index 029699efe3b9..ca921ff97c35 100644 --- a/ApiDocs.bp +++ b/ApiDocs.bp @@ -150,12 +150,10 @@ doc_defaults { ":current-support-api", ":current-androidx-api", ], - create_stubs: false, } doc_defaults { name: "framework-dokka-docs-default", - create_stubs: false, } droiddoc { diff --git a/cmds/uiautomator/library/Android.bp b/cmds/uiautomator/library/Android.bp index 04b00cb837b2..14b74da0c616 100644 --- a/cmds/uiautomator/library/Android.bp +++ b/cmds/uiautomator/library/Android.bp @@ -54,7 +54,6 @@ droiddoc { ], installable: false, custom_template: "droiddoc-templates-sdk", - create_stubs: false, } java_library_static { @@ -66,6 +65,7 @@ java_library_static { "android.test.runner", "junit", ], + java_version: "1.8", } java_library_static { diff --git a/cmds/uiautomator/library/testrunner-src/com/android/uiautomator/core/UiAutomationShellWrapper.java b/cmds/uiautomator/library/testrunner-src/com/android/uiautomator/core/UiAutomationShellWrapper.java index 71561c3c7023..39248730802f 100644 --- a/cmds/uiautomator/library/testrunner-src/com/android/uiautomator/core/UiAutomationShellWrapper.java +++ b/cmds/uiautomator/library/testrunner-src/com/android/uiautomator/core/UiAutomationShellWrapper.java @@ -49,7 +49,7 @@ public class UiAutomationShellWrapper { } try { if (isSet) { - am.setActivityController(new DummyActivityController(), true); + am.setActivityController(new NoOpActivityController(), true); } else { am.setActivityController(null, true); } @@ -80,9 +80,9 @@ public class UiAutomationShellWrapper { } /** - * Dummy, no interference, activity controller. + * No-op, no interference, activity controller. */ - private class DummyActivityController extends IActivityController.Stub { + private class NoOpActivityController extends IActivityController.Stub { @Override public boolean activityStarting(Intent intent, String pkg) throws RemoteException { /* do nothing and let activity proceed normally */ diff --git a/cmds/uiautomator/library/testrunner-src/com/android/uiautomator/testrunner/UiAutomatorTestCase.java b/cmds/uiautomator/library/testrunner-src/com/android/uiautomator/testrunner/UiAutomatorTestCase.java index d862e1c2babb..e6fb7aa76e58 100644 --- a/cmds/uiautomator/library/testrunner-src/com/android/uiautomator/testrunner/UiAutomatorTestCase.java +++ b/cmds/uiautomator/library/testrunner-src/com/android/uiautomator/testrunner/UiAutomatorTestCase.java @@ -45,7 +45,7 @@ import java.util.List; public class UiAutomatorTestCase extends TestCase { private static final String DISABLE_IME = "disable_ime"; - private static final String DUMMY_IME_PACKAGE = "com.android.testing.dummyime"; + private static final String STUB_IME_PACKAGE = "com.android.testing.stubime"; private static final int NOT_A_SUBTYPE_ID = -1; private UiDevice mUiDevice; @@ -58,7 +58,7 @@ public class UiAutomatorTestCase extends TestCase { super.setUp(); mShouldDisableIme = "true".equals(mParams.getString(DISABLE_IME)); if (mShouldDisableIme) { - setDummyIme(); + setStubIme(); } } @@ -128,7 +128,7 @@ public class UiAutomatorTestCase extends TestCase { SystemClock.sleep(ms); } - private void setDummyIme() { + private void setStubIme() { Context context = ActivityThread.currentApplication(); if (context == null) { throw new RuntimeException("ActivityThread.currentApplication() is null."); @@ -138,13 +138,13 @@ public class UiAutomatorTestCase extends TestCase { List<InputMethodInfo> infos = im.getInputMethodList(); String id = null; for (InputMethodInfo info : infos) { - if (DUMMY_IME_PACKAGE.equals(info.getComponent().getPackageName())) { + if (STUB_IME_PACKAGE.equals(info.getComponent().getPackageName())) { id = info.getId(); } } if (id == null) { throw new RuntimeException(String.format( - "Required testing fixture missing: IME package (%s)", DUMMY_IME_PACKAGE)); + "Required testing fixture missing: IME package (%s)", STUB_IME_PACKAGE)); } if (context.checkSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) { diff --git a/core/java/android/animation/AnimatorSet.java b/core/java/android/animation/AnimatorSet.java index a9239b48bb3f..bc8db029e06d 100644 --- a/core/java/android/animation/AnimatorSet.java +++ b/core/java/android/animation/AnimatorSet.java @@ -183,7 +183,7 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim // This is to work around a bug in b/34736819. This needs to be removed once app team // fixes their side. - private AnimatorListenerAdapter mAnimationEndingListener = new AnimatorListenerAdapter() { + private AnimatorListenerAdapter mAnimationEndListener = new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { if (mNodeMap.get(animation) == null) { @@ -1186,7 +1186,7 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim } private void startAnimation() { - addAnimationEndingListener(); + addAnimationEndListener(); // Register animation callback addAnimationCallback(0); @@ -1243,15 +1243,15 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim // This is to work around the issue in b/34736819, as the old behavior in AnimatorSet had // masked a real bug in play movies. TODO: remove this and below once the root cause is fixed. - private void addAnimationEndingListener() { + private void addAnimationEndListener() { for (int i = 1; i < mNodes.size(); i++) { - mNodes.get(i).mAnimation.addListener(mAnimationEndingListener); + mNodes.get(i).mAnimation.addListener(mAnimationEndListener); } } - private void removeAnimationEndingListener() { + private void removeAnimationEndListener() { for (int i = 1; i < mNodes.size(); i++) { - mNodes.get(i).mAnimation.removeListener(mAnimationEndingListener); + mNodes.get(i).mAnimation.removeListener(mAnimationEndListener); } } @@ -1301,7 +1301,7 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim tmpListeners.get(i).onAnimationEnd(this, mReversing); } } - removeAnimationEndingListener(); + removeAnimationEndListener(); mSelfPulse = true; mReversing = false; } @@ -1346,7 +1346,7 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim anim.mNodeMap = new ArrayMap<Animator, Node>(); anim.mNodes = new ArrayList<Node>(nodeCount); anim.mEvents = new ArrayList<AnimationEvent>(); - anim.mAnimationEndingListener = new AnimatorListenerAdapter() { + anim.mAnimationEndListener = new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { if (anim.mNodeMap.get(animation) == null) { @@ -1369,7 +1369,7 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim final Node node = mNodes.get(n); Node nodeClone = node.clone(); // Remove the old internal listener from the cloned child - nodeClone.mAnimation.removeListener(mAnimationEndingListener); + nodeClone.mAnimation.removeListener(mAnimationEndListener); clonesMap.put(node, nodeClone); anim.mNodes.add(nodeClone); anim.mNodeMap.put(nodeClone.mAnimation, nodeClone); diff --git a/core/java/android/app/usage/UsageStatsManager.java b/core/java/android/app/usage/UsageStatsManager.java index 8a6cc95319fb..1345e66a355a 100644 --- a/core/java/android/app/usage/UsageStatsManager.java +++ b/core/java/android/app/usage/UsageStatsManager.java @@ -109,7 +109,7 @@ public final class UsageStatsManager { /** - * The app is whitelisted for some reason and the bucket cannot be changed. + * The app is exempted for some reason and the bucket cannot be changed. * {@hide} */ @SystemApi diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java index 1539b6ed4ca7..a6b869d19867 100644 --- a/core/java/android/os/GraphicsEnvironment.java +++ b/core/java/android/os/GraphicsEnvironment.java @@ -570,7 +570,7 @@ public class GraphicsEnvironment { final ContentResolver contentResolver = context.getContentResolver(); final List<String> angleAllowlist = getGlobalSettingsString(contentResolver, bundle, - Settings.Global.GLOBAL_SETTINGS_ANGLE_WHITELIST); + Settings.Global.GLOBAL_SETTINGS_ANGLE_ALLOWLIST); if (DEBUG) Log.v(TAG, "ANGLE allowlist: " + angleAllowlist); diff --git a/core/java/android/os/OWNERS b/core/java/android/os/OWNERS index 0ec4fb832801..40c291f14b67 100644 --- a/core/java/android/os/OWNERS +++ b/core/java/android/os/OWNERS @@ -16,6 +16,6 @@ per-file PowerManager.java = michaelwr@google.com, santoscordon@google.com per-file PowerManagerInternal.java = michaelwr@google.com, santoscordon@google.com # Zygote -per-file ZygoteProcess.java = chriswailes@google.com, ngeoffray@google.com, sehr@google.com, narayan@google.com, maco@google.com +per-file ZygoteProcess.java = calin@google.com, chriswailes@google.com, maco@google.com, narayan@google.com, ngeoffray@google.com per-file GraphicsEnvironment.java = chrisforbes@google.com, cnorthrop@google.com, lpy@google.com, timvp@google.com, zzyiwei@google.com diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index b3bf91ba3c06..dda5c5ede53f 100755 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -12279,8 +12279,8 @@ public final class Settings { * List of package names that should check ANGLE rules * @hide */ - public static final String GLOBAL_SETTINGS_ANGLE_WHITELIST = - "angle_whitelist"; + public static final String GLOBAL_SETTINGS_ANGLE_ALLOWLIST = + "angle_allowlist"; /** * Show the "ANGLE In Use" dialog box to the user when ANGLE is the OpenGL driver. diff --git a/core/java/android/util/proto/ProtoInputStream.java b/core/java/android/util/proto/ProtoInputStream.java index cbe3734ce5fa..aa70d07ff787 100644 --- a/core/java/android/util/proto/ProtoInputStream.java +++ b/core/java/android/util/proto/ProtoInputStream.java @@ -96,7 +96,7 @@ public final class ProtoInputStream extends ProtoStream { private byte mState = 0; /** - * Keeps track of the currently read nested Objects, for end object sanity checking and debug + * Keeps track of the currently read nested Objects, for end object checking and debug */ private ArrayList<Long> mExpectedObjectTokenStack = null; @@ -513,7 +513,7 @@ public final class ProtoInputStream extends ProtoStream { (int) fieldId, getOffset() + messageSize)); } - // Sanity check + // Validation check if (mDepth > 0 && getOffsetFromToken(mExpectedObjectTokenStack.get(mDepth)) > getOffsetFromToken(mExpectedObjectTokenStack.get(mDepth - 1))) { @@ -536,7 +536,7 @@ public final class ProtoInputStream extends ProtoStream { * @param token - token */ public void end(long token) { - // Sanity check to make sure user is keeping track of their embedded messages + // Make sure user is keeping track of their embedded messages if (mExpectedObjectTokenStack.get(mDepth) != token) { throw new ProtoParseException( "end token " + token + " does not match current message token " diff --git a/core/java/android/util/proto/ProtoOutputStream.java b/core/java/android/util/proto/ProtoOutputStream.java index 5fcd38e2fd9c..afca4ab2c741 100644 --- a/core/java/android/util/proto/ProtoOutputStream.java +++ b/core/java/android/util/proto/ProtoOutputStream.java @@ -59,10 +59,10 @@ import java.io.UnsupportedEncodingException; * cache the size, and then write the size-prefixed buffers. * * We are trying to avoid too much generated code here, but this class still - * needs to have a somewhat sane API. We can't have the multiple passes be - * done by the calling code. In addition, we want to avoid the memory high - * water mark of duplicating all of the values into the traditional in-memory - * Message objects. We need to find another way. + * needs to have API. We can't have the multiple passes be done by the + * calling code. In addition, we want to avoid the memory high water mark + * of duplicating all of the values into the traditional in-memory Message + * objects. We need to find another way. * * So what we do here is to let the calling code write the data into a * byte[] (actually a collection of them wrapped in the EncodedBuffer class), diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java index d6fe99a1710b..8bc7f3c91d8c 100644 --- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java +++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java @@ -1768,7 +1768,7 @@ public class AccessibilityNodeInfo implements Parcelable { * <strong>Note:</strong> The primary usage of this API is for UI test automation * and in order to report the fully qualified view id if an {@link AccessibilityNodeInfo} * the client has to set the {@link AccessibilityServiceInfo#FLAG_REPORT_VIEW_IDS} - * flag when configuring their {@link android.accessibilityservice.AccessibilityService}. + * flag when configuring the {@link android.accessibilityservice.AccessibilityService}. * </p> * <p> * <strong>Note:</strong> If this view hierarchy has a {@link SurfaceView} embedding another @@ -3206,7 +3206,7 @@ public class AccessibilityNodeInfo implements Parcelable { * <strong>Note:</strong> The primary usage of this API is for UI test automation * and in order to report the source view id of an {@link AccessibilityNodeInfo} the * client has to set the {@link AccessibilityServiceInfo#FLAG_REPORT_VIEW_IDS} - * flag when configuring their {@link android.accessibilityservice.AccessibilityService}. + * flag when configuring the {@link android.accessibilityservice.AccessibilityService}. * </p> * @return The id resource name. diff --git a/core/java/com/android/internal/os/OWNERS b/core/java/com/android/internal/os/OWNERS index 928310549e6e..afc94329dc4d 100644 --- a/core/java/com/android/internal/os/OWNERS +++ b/core/java/com/android/internal/os/OWNERS @@ -1 +1 @@ -per-file ZygoteArguments.java,ZygoteConnection.java,ZygoteInit.java,Zygote.java,ZygoteServer.java = chriswailes@google.com, ngeoffray@google.com, sehr@google.com, narayan@google.com, maco@google.com +per-file ZygoteArguments.java,ZygoteConnection.java,ZygoteInit.java,Zygote.java,ZygoteServer.java = calin@google.com, chriswailes@google.com, maco@google.com, narayan@google.com, ngeoffray@google.com diff --git a/core/jni/OWNERS b/core/jni/OWNERS index d7d8621a3640..7d80993afc6e 100644 --- a/core/jni/OWNERS +++ b/core/jni/OWNERS @@ -17,4 +17,4 @@ per-file android_view_*MotionEvent.* = michaelwr@google.com, svv@google.com per-file android_view_PointerIcon.* = michaelwr@google.com, svv@google.com # Zygote -per-file com_android_internal_os_Zygote.*,fd_utils.* = chriswailes@google.com, ngeoffray@google.com, sehr@google.com, narayan@google.com, maco@google.com +per-file com_android_internal_os_Zygote.*,fd_utils.* = calin@google.com, chriswailes@google.com, maco@google.com, narayan@google.com, ngeoffray@google.com diff --git a/core/jni/android_media_AudioSystem.cpp b/core/jni/android_media_AudioSystem.cpp index 22bb2102a6e1..1f625443c96e 100644 --- a/core/jni/android_media_AudioSystem.cpp +++ b/core/jni/android_media_AudioSystem.cpp @@ -974,7 +974,7 @@ static jint convertAudioPortConfigFromNative(JNIEnv *env, if (jHandle == NULL) { return (jint)AUDIO_JAVA_ERROR; } - // create dummy port and port config objects with just the correct handle + // create placeholder port and port config objects with just the correct handle // and configuration data. The actual AudioPortConfig objects will be // constructed by java code with correct class type (device, mix etc...) // and reference to AudioPort instance in this client diff --git a/core/jni/android_net_NetUtils.cpp b/core/jni/android_net_NetUtils.cpp index e56809f66dc7..8d4c4e5311f8 100644 --- a/core/jni/android_net_NetUtils.cpp +++ b/core/jni/android_net_NetUtils.cpp @@ -93,13 +93,13 @@ static void android_net_utils_attachDropAllBPFFilter(JNIEnv *env, jobject clazz, static void android_net_utils_detachBPFFilter(JNIEnv *env, jobject clazz, jobject javaFd) { - int dummy = 0; + int optval_ignored = 0; int fd = jniGetFDFromFileDescriptor(env, javaFd); - if (setsockopt(fd, SOL_SOCKET, SO_DETACH_FILTER, &dummy, sizeof(dummy)) != 0) { + if (setsockopt(fd, SOL_SOCKET, SO_DETACH_FILTER, &optval_ignored, sizeof(optval_ignored)) != + 0) { jniThrowExceptionFmt(env, "java/net/SocketException", "setsockopt(SO_DETACH_FILTER): %s", strerror(errno)); } - } static jboolean android_net_utils_bindProcessToNetwork(JNIEnv *env, jobject thiz, jint netId) diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp index d6e8531fa6ca..ef0eeec2c7af 100644 --- a/core/jni/android_os_Debug.cpp +++ b/core/jni/android_os_Debug.cpp @@ -920,7 +920,7 @@ int register_android_os_Debug(JNIEnv *env) { jclass clazz = env->FindClass("android/os/Debug$MemoryInfo"); - // Sanity check the number of other statistics expected in Java matches here. + // Check the number of other statistics expected in Java matches here. jfieldID numOtherStats_field = env->GetStaticFieldID(clazz, "NUM_OTHER_STATS", "I"); jint numOtherStats = env->GetStaticIntField(clazz, numOtherStats_field); jfieldID numDvkStats_field = env->GetStaticFieldID(clazz, "NUM_DVK_STATS", "I"); diff --git a/core/jni/android_os_Parcel.cpp b/core/jni/android_os_Parcel.cpp index 6ec5bce224fc..9ae3d160be98 100644 --- a/core/jni/android_os_Parcel.cpp +++ b/core/jni/android_os_Parcel.cpp @@ -349,7 +349,7 @@ static jbyteArray android_os_Parcel_createByteArray(JNIEnv* env, jclass clazz, j if (parcel != NULL) { int32_t len = parcel->readInt32(); - // sanity check the stored length against the true data size + // Validate the stored length against the true data size if (len >= 0 && len <= (int32_t)parcel->dataAvail()) { ret = env->NewByteArray(len); diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp index 4c9d7abeb5a1..9643b64c68f8 100644 --- a/core/jni/android_util_Binder.cpp +++ b/core/jni/android_util_Binder.cpp @@ -961,7 +961,7 @@ static jlong android_os_Binder_clearCallingIdentity() static void android_os_Binder_restoreCallingIdentity(JNIEnv* env, jobject clazz, jlong token) { - // XXX temporary sanity check to debug crashes. + // XXX temporary validation check to debug crashes. int uid = (int)(token>>32); if (uid > 0 && uid < 999) { // In Android currently there are no uids in this range. diff --git a/core/jni/android_view_InputQueue.cpp b/core/jni/android_view_InputQueue.cpp index 24c3ff80badd..70a9be740810 100644 --- a/core/jni/android_view_InputQueue.cpp +++ b/core/jni/android_view_InputQueue.cpp @@ -176,8 +176,8 @@ void InputQueue::enqueueEvent(InputEvent* event) { Mutex::Autolock _l(mLock); mPendingEvents.push(event); if (mPendingEvents.size() == 1) { - char dummy = 0; - int res = TEMP_FAILURE_RETRY(write(mDispatchWriteFd, &dummy, sizeof(dummy))); + char payload = '\0'; + int res = TEMP_FAILURE_RETRY(write(mDispatchWriteFd, &payload, sizeof(payload))); if (res < 0 && errno != EAGAIN) { ALOGW("Failed writing to dispatch fd: %s", strerror(errno)); } diff --git a/core/proto/android/providers/settings/global.proto b/core/proto/android/providers/settings/global.proto index 21b79604192f..a80bb4013854 100644 --- a/core/proto/android/providers/settings/global.proto +++ b/core/proto/android/providers/settings/global.proto @@ -449,7 +449,7 @@ message GlobalSettingsProto { // Game Driver - List of Apps that are allowed to use Game Driver optional SettingProto game_driver_allowlist = 12; // ANGLE - List of Apps that can check ANGLE rules - optional SettingProto angle_whitelist = 13; + optional SettingProto angle_allowlist = 13; // Game Driver - List of denylists, each denylist is a denylist for // a specific Game Driver version optional SettingProto game_driver_denylists = 14; diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 71d2f199f5b8..a689f5c6a9fa 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -976,7 +976,7 @@ with the modem or some other restricted hardware, add "/dev/bus/usb/001/" to this list. If this is empty, no parts of the host USB bus will be excluded. --> - <string-array name="config_usbHostBlacklist" translatable="false"> + <string-array name="config_usbHostDenylist" translatable="false"> </string-array> <!-- List of paths to serial ports that are available to the serial manager. diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 7c920210dbf2..c49588d0cdc2 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1854,7 +1854,7 @@ <java-symbol type="array" name="config_tether_upstream_types" /> <java-symbol type="array" name="config_tether_usb_regexs" /> <java-symbol type="array" name="config_tether_wifi_regexs" /> - <java-symbol type="array" name="config_usbHostBlacklist" /> + <java-symbol type="array" name="config_usbHostDenylist" /> <java-symbol type="array" name="config_serialPorts" /> <java-symbol type="array" name="radioAttributes" /> <java-symbol type="array" name="config_oemUsbModeOverride" /> diff --git a/core/tests/coretests/apks/install/res/values/strings.xml b/core/tests/coretests/apks/install/res/values/strings.xml index 3b8b3b1af9b5..984152fb5fa7 100644 --- a/core/tests/coretests/apks/install/res/values/strings.xml +++ b/core/tests/coretests/apks/install/res/values/strings.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Just need this dummy file to have something to build. --> +<!-- Just need this placeholder file to have something to build. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="dummy">dummy</string> + <string name="placeholder">placeholder</string> </resources> diff --git a/core/tests/coretests/apks/install_bad_dex/res/values/strings.xml b/core/tests/coretests/apks/install_bad_dex/res/values/strings.xml index 3b8b3b1af9b5..984152fb5fa7 100644 --- a/core/tests/coretests/apks/install_bad_dex/res/values/strings.xml +++ b/core/tests/coretests/apks/install_bad_dex/res/values/strings.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Just need this dummy file to have something to build. --> +<!-- Just need this placeholder file to have something to build. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="dummy">dummy</string> + <string name="placeholder">placeholder</string> </resources> diff --git a/core/tests/coretests/apks/install_decl_perm/res/values/strings.xml b/core/tests/coretests/apks/install_decl_perm/res/values/strings.xml index 3b8b3b1af9b5..984152fb5fa7 100644 --- a/core/tests/coretests/apks/install_decl_perm/res/values/strings.xml +++ b/core/tests/coretests/apks/install_decl_perm/res/values/strings.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Just need this dummy file to have something to build. --> +<!-- Just need this placeholder file to have something to build. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="dummy">dummy</string> + <string name="placeholder">placeholder</string> </resources> diff --git a/core/tests/coretests/apks/install_loc_auto/res/values/strings.xml b/core/tests/coretests/apks/install_loc_auto/res/values/strings.xml index 3b8b3b1af9b5..984152fb5fa7 100644 --- a/core/tests/coretests/apks/install_loc_auto/res/values/strings.xml +++ b/core/tests/coretests/apks/install_loc_auto/res/values/strings.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Just need this dummy file to have something to build. --> +<!-- Just need this placeholder file to have something to build. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="dummy">dummy</string> + <string name="placeholder">placeholder</string> </resources> diff --git a/core/tests/coretests/apks/install_loc_internal/res/values/strings.xml b/core/tests/coretests/apks/install_loc_internal/res/values/strings.xml index 3b8b3b1af9b5..984152fb5fa7 100644 --- a/core/tests/coretests/apks/install_loc_internal/res/values/strings.xml +++ b/core/tests/coretests/apks/install_loc_internal/res/values/strings.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Just need this dummy file to have something to build. --> +<!-- Just need this placeholder file to have something to build. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="dummy">dummy</string> + <string name="placeholder">placeholder</string> </resources> diff --git a/core/tests/coretests/apks/install_loc_sdcard/res/values/strings.xml b/core/tests/coretests/apks/install_loc_sdcard/res/values/strings.xml index 3b8b3b1af9b5..984152fb5fa7 100644 --- a/core/tests/coretests/apks/install_loc_sdcard/res/values/strings.xml +++ b/core/tests/coretests/apks/install_loc_sdcard/res/values/strings.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Just need this dummy file to have something to build. --> +<!-- Just need this placeholder file to have something to build. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="dummy">dummy</string> + <string name="placeholder">placeholder</string> </resources> diff --git a/core/tests/coretests/apks/install_loc_unspecified/res/values/strings.xml b/core/tests/coretests/apks/install_loc_unspecified/res/values/strings.xml index 3b8b3b1af9b5..984152fb5fa7 100644 --- a/core/tests/coretests/apks/install_loc_unspecified/res/values/strings.xml +++ b/core/tests/coretests/apks/install_loc_unspecified/res/values/strings.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Just need this dummy file to have something to build. --> +<!-- Just need this placeholder file to have something to build. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="dummy">dummy</string> + <string name="placeholder">placeholder</string> </resources> diff --git a/core/tests/coretests/apks/install_use_perm_good/res/values/strings.xml b/core/tests/coretests/apks/install_use_perm_good/res/values/strings.xml index 3b8b3b1af9b5..984152fb5fa7 100644 --- a/core/tests/coretests/apks/install_use_perm_good/res/values/strings.xml +++ b/core/tests/coretests/apks/install_use_perm_good/res/values/strings.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Just need this dummy file to have something to build. --> +<!-- Just need this placeholder file to have something to build. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="dummy">dummy</string> + <string name="placeholder">placeholder</string> </resources> diff --git a/core/tests/coretests/apks/install_uses_feature/res/values/strings.xml b/core/tests/coretests/apks/install_uses_feature/res/values/strings.xml index 3b8b3b1af9b5..984152fb5fa7 100644 --- a/core/tests/coretests/apks/install_uses_feature/res/values/strings.xml +++ b/core/tests/coretests/apks/install_uses_feature/res/values/strings.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Just need this dummy file to have something to build. --> +<!-- Just need this placeholder file to have something to build. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="dummy">dummy</string> + <string name="placeholder">placeholder</string> </resources> diff --git a/core/tests/coretests/apks/install_verifier_bad/res/values/strings.xml b/core/tests/coretests/apks/install_verifier_bad/res/values/strings.xml index 3b8b3b1af9b5..984152fb5fa7 100644 --- a/core/tests/coretests/apks/install_verifier_bad/res/values/strings.xml +++ b/core/tests/coretests/apks/install_verifier_bad/res/values/strings.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Just need this dummy file to have something to build. --> +<!-- Just need this placeholder file to have something to build. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="dummy">dummy</string> + <string name="placeholder">placeholder</string> </resources> diff --git a/core/tests/coretests/apks/install_verifier_good/res/values/strings.xml b/core/tests/coretests/apks/install_verifier_good/res/values/strings.xml index 3b8b3b1af9b5..984152fb5fa7 100644 --- a/core/tests/coretests/apks/install_verifier_good/res/values/strings.xml +++ b/core/tests/coretests/apks/install_verifier_good/res/values/strings.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Just need this dummy file to have something to build. --> +<!-- Just need this placeholder file to have something to build. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="dummy">dummy</string> + <string name="placeholder">placeholder</string> </resources> diff --git a/core/tests/coretests/apks/keyset/res/values/strings.xml b/core/tests/coretests/apks/keyset/res/values/strings.xml index ff99ffa77b2a..d811ec29ef19 100644 --- a/core/tests/coretests/apks/keyset/res/values/strings.xml +++ b/core/tests/coretests/apks/keyset/res/values/strings.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Just need this dummy file to have something to build. --> +<!-- Just need this placeholder file to have something to build. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="dummy">dummy</string> + <string name="placeholder">placeholder</string> <string name="keyset_perm_desc">keyset_perm_description</string> <string name="keyset_perm_label">keyset_perm_label</string> </resources> diff --git a/core/tests/coretests/apks/version/res/values/strings.xml b/core/tests/coretests/apks/version/res/values/strings.xml index 3b8b3b1af9b5..984152fb5fa7 100644 --- a/core/tests/coretests/apks/version/res/values/strings.xml +++ b/core/tests/coretests/apks/version/res/values/strings.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Just need this dummy file to have something to build. --> +<!-- Just need this placeholder file to have something to build. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="dummy">dummy</string> + <string name="placeholder">placeholder</string> </resources> diff --git a/core/tests/coretests/apks/version_nosys/res/values/strings.xml b/core/tests/coretests/apks/version_nosys/res/values/strings.xml index 3b8b3b1af9b5..984152fb5fa7 100644 --- a/core/tests/coretests/apks/version_nosys/res/values/strings.xml +++ b/core/tests/coretests/apks/version_nosys/res/values/strings.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Just need this dummy file to have something to build. --> +<!-- Just need this placeholder file to have something to build. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="dummy">dummy</string> + <string name="placeholder">placeholder</string> </resources> diff --git a/data/keyboards/Generic.kl b/data/keyboards/Generic.kl index 4cdfbb8ce27f..5711f98e3b75 100644 --- a/data/keyboards/Generic.kl +++ b/data/keyboards/Generic.kl @@ -415,6 +415,7 @@ key 583 ASSIST key usage 0x0c0067 WINDOW key usage 0x0c006F BRIGHTNESS_UP key usage 0x0c0070 BRIGHTNESS_DOWN +key usage 0x0c0173 MEDIA_AUDIO_TRACK # Joystick and game controller axes. # Axes that are not mapped will be assigned generic axis numbers by the input subsystem. diff --git a/data/keyboards/OWNERS b/data/keyboards/OWNERS index 031a6c1c7a89..c4f6df824a39 100644 --- a/data/keyboards/OWNERS +++ b/data/keyboards/OWNERS @@ -2,3 +2,4 @@ set noparent michaelwr@google.com svv@google.com +lzye@google.com diff --git a/data/keyboards/Vendor_27f8_Product_0bbf.kl b/data/keyboards/Vendor_27f8_Product_0bbf.kl new file mode 100644 index 000000000000..a59f5663842c --- /dev/null +++ b/data/keyboards/Vendor_27f8_Product_0bbf.kl @@ -0,0 +1,54 @@ +# 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. + +# +# Razer Kishi Mobile Controller +# + + +# Mapping according to https://developer.android.com/training/game-controllers/controller-input.html + +key 0x133 BUTTON_X +key 0x130 BUTTON_A +key 0x131 BUTTON_B +key 0x134 BUTTON_Y + +key 0x136 BUTTON_L1 +key 0x137 BUTTON_R1 +key 0x138 BUTTON_L2 +key 0x139 BUTTON_R2 + +axis 0x00 X +axis 0x01 Y + +axis 0x02 Z +axis 0x05 RZ + +axis 0x09 RTRIGGER +axis 0x0a LTRIGGER + +key 0x13d BUTTON_THUMBL +key 0x13e BUTTON_THUMBR + +# Hat +axis 0x10 HAT_X +axis 0x11 HAT_Y + +# Mapping according to https://www.kernel.org/doc/Documentation/input/gamepad.txt +# Left Triangle Button +key 0x13a BUTTON_SELECT +# Right Triangle Button +key 0x13b BUTTON_START +# Home Button +key 0x13c BUTTON_MODE diff --git a/data/keyboards/Vendor_2e95_Product_7725.kl b/data/keyboards/Vendor_2e95_Product_7725.kl new file mode 100644 index 000000000000..7672e22f8adc --- /dev/null +++ b/data/keyboards/Vendor_2e95_Product_7725.kl @@ -0,0 +1,64 @@ +# 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. + +# +# Scuf Vantage Controller +# + +# Mapping according to https://developer.android.com/training/game-controllers/controller-input.html + +# Square +key 0x130 BUTTON_X +# Cross +key 0x131 BUTTON_A +# Circle +key 0x132 BUTTON_B +# Triangle +key 0x133 BUTTON_Y + +key 0x134 BUTTON_L1 +key 0x135 BUTTON_R1 +key 0x136 BUTTON_L2 +key 0x137 BUTTON_R2 + +# L2 Trigger axis +axis 0x03 LTRIGGER +# R2 Trigger axis +axis 0x04 RTRIGGER + +# Left Analog Stick +axis 0x00 X +axis 0x01 Y +# Right Analog Stick +axis 0x02 Z +axis 0x05 RZ + +# Left stick click +key 0x13a BUTTON_THUMBL +# Right stick click +key 0x13b BUTTON_THUMBR + +# Hat +axis 0x10 HAT_X +axis 0x11 HAT_Y + +# Mapping according to https://www.kernel.org/doc/Documentation/input/gamepad.txt +# Share +key 0x138 BUTTON_SELECT +# Options +key 0x139 BUTTON_START +# PS key +key 0x13c BUTTON_MODE +# Touchpad press +key 0x13d BUTTON_1 diff --git a/media/jni/android_media_MediaPlayer.cpp b/media/jni/android_media_MediaPlayer.cpp index e910add86d3c..82b746f6a9e5 100644 --- a/media/jni/android_media_MediaPlayer.cpp +++ b/media/jni/android_media_MediaPlayer.cpp @@ -590,7 +590,7 @@ android_media_MediaPlayer_getSyncParams(JNIEnv *env, jobject thiz) ALOGV("getSyncSettings: %d %d %f %f", scp.sync.mSource, scp.sync.mAudioAdjustMode, scp.sync.mTolerance, scp.frameRate); - // sanity check params + // check params if (scp.sync.mSource >= AVSYNC_SOURCE_MAX || scp.sync.mAudioAdjustMode >= AVSYNC_AUDIO_ADJUST_MODE_MAX || scp.sync.mTolerance < 0.f diff --git a/media/jni/android_media_MediaSync.cpp b/media/jni/android_media_MediaSync.cpp index f75200868a0d..d1ce30a3e827 100644 --- a/media/jni/android_media_MediaSync.cpp +++ b/media/jni/android_media_MediaSync.cpp @@ -451,7 +451,7 @@ static jobject android_media_MediaSync_getSyncParams(JNIEnv *env, jobject thiz) ALOGV("getSyncParams: %d %d %f %f", scs.sync.mSource, scs.sync.mAudioAdjustMode, scs.sync.mTolerance, scs.frameRate); - // sanity check params + // check params if (scs.sync.mSource >= AVSYNC_SOURCE_MAX || scs.sync.mAudioAdjustMode >= AVSYNC_AUDIO_ADJUST_MODE_MAX || scs.sync.mTolerance < 0.f diff --git a/media/jni/audioeffect/Visualizer.cpp b/media/jni/audioeffect/Visualizer.cpp index f4d65d0a397f..a74ae5307a36 100644 --- a/media/jni/audioeffect/Visualizer.cpp +++ b/media/jni/audioeffect/Visualizer.cpp @@ -34,21 +34,9 @@ namespace android { // --------------------------------------------------------------------------- -Visualizer::Visualizer (const String16& opPackageName, - int32_t priority, - effect_callback_t cbf, - void* user, - audio_session_t sessionId) - : AudioEffect(SL_IID_VISUALIZATION, opPackageName, NULL, priority, cbf, user, sessionId), - mCaptureRate(CAPTURE_RATE_DEF), - mCaptureSize(CAPTURE_SIZE_DEF), - mSampleRate(44100000), - mScalingMode(VISUALIZER_SCALING_MODE_NORMALIZED), - mMeasurementMode(MEASUREMENT_MODE_NONE), - mCaptureCallBack(NULL), - mCaptureCbkUser(NULL) +Visualizer::Visualizer (const String16& opPackageName) + : AudioEffect(opPackageName) { - initCaptureSize(); } Visualizer::~Visualizer() @@ -58,6 +46,23 @@ Visualizer::~Visualizer() setCaptureCallBack(NULL, NULL, 0, 0); } +status_t Visualizer::set(int32_t priority, + effect_callback_t cbf, + void* user, + audio_session_t sessionId, + audio_io_handle_t io, + const AudioDeviceTypeAddr& device, + bool probe) +{ + status_t status = AudioEffect::set( + SL_IID_VISUALIZATION, nullptr, priority, cbf, user, sessionId, io, device, probe); + if (status == NO_ERROR || status == ALREADY_EXISTS) { + initCaptureSize(); + } + return status; +} + + void Visualizer::release() { ALOGV("Visualizer::release()"); diff --git a/media/jni/audioeffect/Visualizer.h b/media/jni/audioeffect/Visualizer.h index d4672a95c6d8..8b6a62f25638 100644 --- a/media/jni/audioeffect/Visualizer.h +++ b/media/jni/audioeffect/Visualizer.h @@ -65,14 +65,22 @@ public: /* Constructor. * See AudioEffect constructor for details on parameters. */ - Visualizer(const String16& opPackageName, - int32_t priority = 0, - effect_callback_t cbf = NULL, - void* user = NULL, - audio_session_t sessionId = AUDIO_SESSION_OUTPUT_MIX); + explicit Visualizer(const String16& opPackageName); ~Visualizer(); + /** + * Initialize an uninitialized Visualizer. + * See AudioEffect 'set' function for details on parameters. + */ + status_t set(int32_t priority = 0, + effect_callback_t cbf = NULL, + void* user = NULL, + audio_session_t sessionId = AUDIO_SESSION_OUTPUT_MIX, + audio_io_handle_t io = AUDIO_IO_HANDLE_NONE, + const AudioDeviceTypeAddr& device = {}, + bool probe = false); + // Declared 'final' because we call this in ~Visualizer(). status_t setEnabled(bool enabled) final; @@ -163,15 +171,15 @@ private: uint32_t initCaptureSize(); Mutex mCaptureLock; - uint32_t mCaptureRate; - uint32_t mCaptureSize; - uint32_t mSampleRate; - uint32_t mScalingMode; - uint32_t mMeasurementMode; - capture_cbk_t mCaptureCallBack; - void *mCaptureCbkUser; + uint32_t mCaptureRate = CAPTURE_RATE_DEF; + uint32_t mCaptureSize = CAPTURE_SIZE_DEF; + uint32_t mSampleRate = 44100000; + uint32_t mScalingMode = VISUALIZER_SCALING_MODE_NORMALIZED; + uint32_t mMeasurementMode = MEASUREMENT_MODE_NONE; + capture_cbk_t mCaptureCallBack = nullptr; + void *mCaptureCbkUser = nullptr; sp<CaptureThread> mCaptureThread; - uint32_t mCaptureFlags; + uint32_t mCaptureFlags = 0; }; diff --git a/media/jni/audioeffect/android_media_AudioEffect.cpp b/media/jni/audioeffect/android_media_AudioEffect.cpp index dbe7b4b619c9..96961ac21a2d 100644 --- a/media/jni/audioeffect/android_media_AudioEffect.cpp +++ b/media/jni/audioeffect/android_media_AudioEffect.cpp @@ -337,22 +337,21 @@ android_media_AudioEffect_native_setup(JNIEnv *env, jobject thiz, jobject weak_t } // create the native AudioEffect object - lpAudioEffect = new AudioEffect(typeStr, - String16(opPackageNameStr.c_str()), - uuidStr, - priority, - effectCallback, - &lpJniStorage->mCallbackData, - (audio_session_t) sessionId, - AUDIO_IO_HANDLE_NONE, - device, - probe); + lpAudioEffect = new AudioEffect(String16(opPackageNameStr.c_str())); if (lpAudioEffect == 0) { ALOGE("Error creating AudioEffect"); goto setup_failure; } - + lpAudioEffect->set(typeStr, + uuidStr, + priority, + effectCallback, + &lpJniStorage->mCallbackData, + (audio_session_t) sessionId, + AUDIO_IO_HANDLE_NONE, + device, + probe); lStatus = AudioEffectJni::translateNativeErrorToJava(lpAudioEffect->initCheck()); if (lStatus != AUDIOEFFECT_SUCCESS && lStatus != AUDIOEFFECT_ERROR_ALREADY_EXISTS) { ALOGE("AudioEffect initCheck failed %d", lStatus); diff --git a/media/jni/audioeffect/android_media_Visualizer.cpp b/media/jni/audioeffect/android_media_Visualizer.cpp index f9a77f474c50..4c5970a30a05 100644 --- a/media/jni/audioeffect/android_media_Visualizer.cpp +++ b/media/jni/audioeffect/android_media_Visualizer.cpp @@ -382,15 +382,15 @@ android_media_visualizer_native_setup(JNIEnv *env, jobject thiz, jobject weak_th } // create the native Visualizer object - lpVisualizer = new Visualizer(String16(opPackageNameStr.c_str()), - 0, - android_media_visualizer_effect_callback, - lpJniStorage, - (audio_session_t) sessionId); + lpVisualizer = new Visualizer(String16(opPackageNameStr.c_str())); if (lpVisualizer == 0) { ALOGE("Error creating Visualizer"); goto setup_failure; } + lpVisualizer->set(0, + android_media_visualizer_effect_callback, + lpJniStorage, + (audio_session_t) sessionId); lStatus = translateError(lpVisualizer->initCheck()); if (lStatus != VISUALIZER_SUCCESS && lStatus != VISUALIZER_ERROR_ALREADY_EXISTS) { diff --git a/media/mca/filterfw/java/android/filterfw/core/FilterFunction.java b/media/mca/filterfw/java/android/filterfw/core/FilterFunction.java index ce81a18eeaa8..ab9ae8ab2ac8 100644 --- a/media/mca/filterfw/java/android/filterfw/core/FilterFunction.java +++ b/media/mca/filterfw/java/android/filterfw/core/FilterFunction.java @@ -43,7 +43,7 @@ public class FilterFunction { public Frame execute(KeyValueMap inputMap) { int filterOutCount = mFilter.getNumberOfOutputs(); - // Sanity checks + // Validation checks if (filterOutCount > 1) { throw new RuntimeException("Calling execute on filter " + mFilter + " with multiple " + "outputs! Use executeMulti() instead!"); diff --git a/media/mca/filterfw/jni/jni_native_program.cpp b/media/mca/filterfw/jni/jni_native_program.cpp index 14246078225e..cd4f7187c250 100644 --- a/media/mca/filterfw/jni/jni_native_program.cpp +++ b/media/mca/filterfw/jni/jni_native_program.cpp @@ -134,7 +134,7 @@ jboolean Java_android_filterfw_core_NativeProgram_callNativeProcess(JNIEnv* env, jobject output) { NativeProgram* program = ConvertFromJava<NativeProgram>(env, thiz); - // Sanity checks + // Validation checks if (!program || !inputs) { return JNI_FALSE; } diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/CameraTestUtils.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/CameraTestUtils.java index 0ae640dd7910..e74bda8a6b35 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/CameraTestUtils.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/CameraTestUtils.java @@ -16,16 +16,6 @@ package com.android.mediaframeworktest.helpers; -import com.android.ex.camera2.blocking.BlockingCameraManager; -import com.android.ex.camera2.blocking.BlockingCameraManager.BlockingOpenException; -import com.android.ex.camera2.blocking.BlockingSessionCallback; -import com.android.ex.camera2.blocking.BlockingStateCallback; -import com.android.ex.camera2.exceptions.TimeoutRuntimeException; - -import junit.framework.Assert; - -import org.mockito.Mockito; - import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.ImageFormat; @@ -64,6 +54,16 @@ import android.view.WindowManager; import androidx.test.InstrumentationRegistry; +import com.android.ex.camera2.blocking.BlockingCameraManager; +import com.android.ex.camera2.blocking.BlockingCameraManager.BlockingOpenException; +import com.android.ex.camera2.blocking.BlockingSessionCallback; +import com.android.ex.camera2.blocking.BlockingStateCallback; +import com.android.ex.camera2.exceptions.TimeoutRuntimeException; + +import junit.framework.Assert; + +import org.mockito.Mockito; + import java.io.FileOutputStream; import java.io.IOException; import java.lang.reflect.Array; @@ -77,8 +77,8 @@ import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.List; -import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.Executor; +import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; @@ -225,7 +225,7 @@ public class CameraTestUtils extends Assert { } /** - * Dummy listener that release the image immediately once it is available. + * Mock listener that release the image immediately once it is available. * * <p> * It can be used for the case where we don't care the image data at all. diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/Preconditions.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/Preconditions.java index 96b0424595e3..a77b2898c5e0 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/Preconditions.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/Preconditions.java @@ -22,7 +22,7 @@ import java.util.Objects; /** * Helper set of methods to perform precondition checks before starting method execution. * - * <p>Typically used to sanity check arguments or the current object state.</p> + * <p>Typically used to check arguments or the current object state.</p> */ /** * (non-Javadoc) diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/StaticMetadata.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/StaticMetadata.java index b3f443b30a70..9a64b58a080d 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/StaticMetadata.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/StaticMetadata.java @@ -16,7 +16,7 @@ package com.android.mediaframeworktest.helpers; -import junit.framework.Assert; +import static com.android.mediaframeworktest.helpers.AssertHelpers.assertArrayContainsAnyOf; import android.graphics.ImageFormat; import android.graphics.Rect; @@ -31,6 +31,8 @@ import android.util.Range; import android.util.Rational; import android.util.Size; +import junit.framework.Assert; + import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; @@ -40,8 +42,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import static com.android.mediaframeworktest.helpers.AssertHelpers.assertArrayContainsAnyOf; - /** * Helpers to get common static info out of the camera. * @@ -435,7 +435,7 @@ public class StaticMetadata { } /** - * Get max AE regions and do sanity check. + * Get max AE regions and do validation check. * * @return AE max regions supported by the camera device */ @@ -448,7 +448,7 @@ public class StaticMetadata { } /** - * Get max AWB regions and do sanity check. + * Get max AWB regions and do validation check. * * @return AWB max regions supported by the camera device */ @@ -461,7 +461,7 @@ public class StaticMetadata { } /** - * Get max AF regions and do sanity check. + * Get max AF regions and do validation check. * * @return AF max regions supported by the camera device */ @@ -545,7 +545,7 @@ public class StaticMetadata { } /** - * Get available thumbnail sizes and do the sanity check. + * Get available thumbnail sizes and do the validation check. * * @return The array of available thumbnail sizes */ @@ -573,7 +573,7 @@ public class StaticMetadata { } /** - * Get available focal lengths and do the sanity check. + * Get available focal lengths and do the validation check. * * @return The array of available focal lengths */ @@ -594,7 +594,7 @@ public class StaticMetadata { } /** - * Get available apertures and do the sanity check. + * Get available apertures and do the validation check. * * @return The non-null array of available apertures */ @@ -909,7 +909,7 @@ public class StaticMetadata { } /** - * Get hyperfocalDistance and do the sanity check. + * Get hyperfocalDistance and do the validation check. * <p> * Note that, this tag is optional, will return -1 if this tag is not * available. @@ -1068,7 +1068,7 @@ public class StaticMetadata { } /** - * get android.control.availableModes and do the sanity check. + * get android.control.availableModes and do the validation check. * * @return available control modes. */ @@ -1124,7 +1124,7 @@ public class StaticMetadata { } /** - * Get aeAvailableModes and do the sanity check. + * Get aeAvailableModes and do the validation check. * * <p>Depending on the check level this class has, for WAR or COLLECT levels, * If the aeMode list is invalid, return an empty mode array. The the caller doesn't @@ -1196,7 +1196,7 @@ public class StaticMetadata { } /** - * Get available AWB modes and do the sanity check. + * Get available AWB modes and do the validation check. * * @return array that contains available AWB modes, empty array if awbAvailableModes is * unavailable. @@ -1222,7 +1222,7 @@ public class StaticMetadata { } /** - * Get available AF modes and do the sanity check. + * Get available AF modes and do the validation check. * * @return array that contains available AF modes, empty array if afAvailableModes is * unavailable. @@ -1580,7 +1580,7 @@ public class StaticMetadata { } /** - * Get value of key android.control.aeCompensationStep and do the sanity check. + * Get value of key android.control.aeCompensationStep and do the validation check. * * @return default value if the value is null. */ @@ -1605,7 +1605,7 @@ public class StaticMetadata { } /** - * Get value of key android.control.aeCompensationRange and do the sanity check. + * Get value of key android.control.aeCompensationRange and do the validation check. * * @return default value if the value is null or malformed. */ @@ -1635,7 +1635,7 @@ public class StaticMetadata { } /** - * Get availableVideoStabilizationModes and do the sanity check. + * Get availableVideoStabilizationModes and do the validation check. * * @return available video stabilization modes, empty array if it is unavailable. */ @@ -1666,7 +1666,7 @@ public class StaticMetadata { } /** - * Get availableOpticalStabilization and do the sanity check. + * Get availableOpticalStabilization and do the validation check. * * @return available optical stabilization modes, empty array if it is unavailable. */ @@ -1780,7 +1780,7 @@ public class StaticMetadata { } /** - * Get max pipeline depth and do the sanity check. + * Get max pipeline depth and do the validation check. * * @return max pipeline depth, default value if it is not available. */ @@ -1846,7 +1846,7 @@ public class StaticMetadata { /** - * Get available capabilities and do the sanity check. + * Get available capabilities and do the validation check. * * @return reported available capabilities list, empty list if the value is unavailable. */ @@ -2070,7 +2070,7 @@ public class StaticMetadata { } /** - * Get max number of output raw streams and do the basic sanity check. + * Get max number of output raw streams and do the basic validation check. * * @return reported max number of raw output stream */ @@ -2083,7 +2083,7 @@ public class StaticMetadata { } /** - * Get max number of output processed streams and do the basic sanity check. + * Get max number of output processed streams and do the basic validation check. * * @return reported max number of processed output stream */ @@ -2096,7 +2096,7 @@ public class StaticMetadata { } /** - * Get max number of output stalling processed streams and do the basic sanity check. + * Get max number of output stalling processed streams and do the basic validation check. * * @return reported max number of stalling processed output stream */ @@ -2109,7 +2109,7 @@ public class StaticMetadata { } /** - * Get lens facing and do the sanity check + * Get lens facing and do the validation check * @return lens facing, return default value (BACK) if value is unavailable. */ public int getLensFacingChecked() { diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2CaptureRequestTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2CaptureRequestTest.java index 31b79677f9ff..47caf0a0bc9b 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2CaptureRequestTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2CaptureRequestTest.java @@ -309,7 +309,7 @@ public class Camera2CaptureRequestTest extends Camera2SurfaceViewTestCase { private void changeExposure(CaptureRequest.Builder requestBuilder, long expTime, int sensitivity) { // Check if the max analog sensitivity is available and no larger than max sensitivity. - // The max analog sensitivity is not actually used here. This is only an extra sanity check. + // The max analog sensitivity is not actually used here. This is only an extra check. mStaticInfo.getMaxAnalogSensitivityChecked(); expTime = mStaticInfo.getExposureClampToRange(expTime); diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2RecordingTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2RecordingTest.java index 6a4db5791d5c..dc8da4868df3 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2RecordingTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2RecordingTest.java @@ -985,7 +985,7 @@ public class Camera2RecordingTest extends Camera2SurfaceViewTestCase { } /** - * Validate video snapshot capture image object sanity and test. + * Validate video snapshot capture image object soundness and test. * * <p> Check for size, format and jpeg decoding</p> * diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2StillCaptureTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2StillCaptureTest.java index f7373f7b68db..cbdcc36eea3a 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2StillCaptureTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2StillCaptureTest.java @@ -570,7 +570,7 @@ public class Camera2StillCaptureTest extends Camera2SurfaceViewTestCase { } /** - * Validate JPEG capture image object sanity and test. + * Validate JPEG capture image object soundness and test. * <p> * In addition to image object sanity, this function also does the decoding * test, which is slower. diff --git a/packages/FakeOemFeatures/src/com/android/fakeoemfeatures/FakeView.java b/packages/FakeOemFeatures/src/com/android/fakeoemfeatures/FakeView.java index 276d55ee9a5e..9fe7ab655e46 100644 --- a/packages/FakeOemFeatures/src/com/android/fakeoemfeatures/FakeView.java +++ b/packages/FakeOemFeatures/src/com/android/fakeoemfeatures/FakeView.java @@ -26,7 +26,7 @@ import android.os.Message; import android.view.View; /** - * Dummy view to emulate stuff an OEM may want to do. + * Fake view to emulate stuff an OEM may want to do. */ public class FakeView extends View { static final long TICK_DELAY = 30*1000; // 30 seconds diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java index 3015397ff1a3..bf5ab1c9951a 100644 --- a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java +++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java @@ -256,7 +256,7 @@ public class WifiTracker implements LifecycleObserver, OnStart, OnStop, OnDestro } /** - * Sanity warning: this wipes out mScoreCache, so use with extreme caution + * Validity warning: this wipes out mScoreCache, so use with extreme caution * @param workThread substitute Handler thread, for testing purposes only */ @VisibleForTesting diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java index 6fd6f711927d..7c198c88d5b6 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java @@ -761,8 +761,8 @@ class SettingsProtoDumpUtil { Settings.Global.GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_VALUES, GlobalSettingsProto.Gpu.ANGLE_GL_DRIVER_SELECTION_VALUES); dumpSetting(s, p, - Settings.Global.GLOBAL_SETTINGS_ANGLE_WHITELIST, - GlobalSettingsProto.Gpu.ANGLE_WHITELIST); + Settings.Global.GLOBAL_SETTINGS_ANGLE_ALLOWLIST, + GlobalSettingsProto.Gpu.ANGLE_ALLOWLIST); dumpSetting(s, p, Settings.Global.GLOBAL_SETTINGS_SHOW_ANGLE_IN_USE_DIALOG_BOX, GlobalSettingsProto.Gpu.SHOW_ANGLE_IN_USE_DIALOG); diff --git a/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java b/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java index ed0481bc96d9..d20e14e62f52 100644 --- a/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java +++ b/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java @@ -503,7 +503,7 @@ public class SettingsBackupTest { Settings.Global.GLOBAL_SETTINGS_ANGLE_GL_DRIVER_ALL_ANGLE, Settings.Global.GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_PKGS, Settings.Global.GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_VALUES, - Settings.Global.GLOBAL_SETTINGS_ANGLE_WHITELIST, + Settings.Global.GLOBAL_SETTINGS_ANGLE_ALLOWLIST, Settings.Global.GAME_DRIVER_ALL_APPS, Settings.Global.GAME_DRIVER_OPT_IN_APPS, Settings.Global.GAME_DRIVER_PRERELEASE_OPT_IN_APPS, diff --git a/services/core/java/com/android/server/am/CoreSettingsObserver.java b/services/core/java/com/android/server/am/CoreSettingsObserver.java index d0ca84fd38dc..2661dd62ce21 100644 --- a/services/core/java/com/android/server/am/CoreSettingsObserver.java +++ b/services/core/java/com/android/server/am/CoreSettingsObserver.java @@ -92,7 +92,7 @@ final class CoreSettingsObserver extends ContentObserver { sGlobalSettingToTypeMap.put( Settings.Global.GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_VALUES, String.class); sGlobalSettingToTypeMap.put( - Settings.Global.GLOBAL_SETTINGS_ANGLE_WHITELIST, String.class); + Settings.Global.GLOBAL_SETTINGS_ANGLE_ALLOWLIST, String.class); sGlobalSettingToTypeMap.put( Settings.Global.GLOBAL_SETTINGS_SHOW_ANGLE_IN_USE_DIALOG_BOX, String.class); sGlobalSettingToTypeMap.put(Settings.Global.ENABLE_GPU_DEBUG_LAYERS, int.class); diff --git a/services/core/java/com/android/server/connectivity/PermissionMonitor.java b/services/core/java/com/android/server/connectivity/PermissionMonitor.java index f8774b1b0054..7202f0f401f9 100644 --- a/services/core/java/com/android/server/connectivity/PermissionMonitor.java +++ b/services/core/java/com/android/server/connectivity/PermissionMonitor.java @@ -171,8 +171,8 @@ public class PermissionMonitor implements PackageManagerInternal.PackageListObse mAllApps.add(UserHandle.getAppId(uid)); final boolean isNetwork = hasPermission(CHANGE_NETWORK_STATE, uid); - final boolean hasRestrictedPermission = - hasRestrictedNetworkPermission(app.applicationInfo); + final boolean hasRestrictedPermission = hasRestrictedNetworkPermission(uid) + || isCarryoverPackage(app.applicationInfo); if (isNetwork || hasRestrictedPermission) { Boolean permission = mApps.get(uid); @@ -200,7 +200,7 @@ public class PermissionMonitor implements PackageManagerInternal.PackageListObse for (int i = 0; i < systemPermission.size(); i++) { ArraySet<String> perms = systemPermission.valueAt(i); int uid = systemPermission.keyAt(i); - int netdPermission = 0; + int netdPermission = PERMISSION_NONE; // Get the uids of native services that have UPDATE_DEVICE_STATS or INTERNET permission. if (perms != null) { netdPermission |= perms.contains(UPDATE_DEVICE_STATS) @@ -225,20 +225,21 @@ public class PermissionMonitor implements PackageManagerInternal.PackageListObse } @VisibleForTesting - boolean hasRestrictedNetworkPermission(@Nullable final ApplicationInfo appInfo) { - if (appInfo == null) return false; - // TODO : remove this check in the future(b/162295056). All apps should just - // request the appropriate permission for their use case since android Q. - if ((appInfo.targetSdkVersion < VERSION_Q && isVendorApp(appInfo)) + // TODO : remove this check in the future(b/162295056). All apps should just request the + // appropriate permission for their use case since android Q. + boolean isCarryoverPackage(@Nullable final ApplicationInfo appInfo) { + if (appInfo == null) return false; + return (appInfo.targetSdkVersion < VERSION_Q && isVendorApp(appInfo)) // Backward compatibility for b/114245686, on devices that launched before Q daemons // and apps running as the system UID are exempted from this check. - || (appInfo.uid == SYSTEM_UID && mDeps.getDeviceFirstSdkInt() < VERSION_Q)) { - return true; - } + || (appInfo.uid == SYSTEM_UID && mDeps.getDeviceFirstSdkInt() < VERSION_Q); + } - return hasPermission(PERMISSION_MAINLINE_NETWORK_STACK, appInfo.uid) - || hasPermission(NETWORK_STACK, appInfo.uid) - || hasPermission(CONNECTIVITY_USE_RESTRICTED_NETWORKS, appInfo.uid); + @VisibleForTesting + boolean hasRestrictedNetworkPermission(final int uid) { + return hasPermission(CONNECTIVITY_USE_RESTRICTED_NETWORKS, uid) + || hasPermission(PERMISSION_MAINLINE_NETWORK_STACK, uid) + || hasPermission(NETWORK_STACK, uid); } /** Returns whether the given uid has using background network permission. */ @@ -328,8 +329,8 @@ public class PermissionMonitor implements PackageManagerInternal.PackageListObse try { final PackageInfo app = mPackageManager.getPackageInfo(name, GET_PERMISSIONS); final boolean isNetwork = hasPermission(CHANGE_NETWORK_STATE, uid); - final boolean hasRestrictedPermission = - hasRestrictedNetworkPermission(app.applicationInfo); + final boolean hasRestrictedPermission = hasRestrictedNetworkPermission(uid) + || isCarryoverPackage(app.applicationInfo); if (isNetwork || hasRestrictedPermission) { currentPermission = hasRestrictedPermission; } diff --git a/services/core/java/com/android/server/pm/OWNERS b/services/core/java/com/android/server/pm/OWNERS index fe6aad70c31e..e48862e2e5e0 100644 --- a/services/core/java/com/android/server/pm/OWNERS +++ b/services/core/java/com/android/server/pm/OWNERS @@ -14,16 +14,16 @@ per-file ApexManager.java = dariofreni@google.com, ioffe@google.com, olilan@goog per-file StagingManager.java = dariofreni@google.com, ioffe@google.com, olilan@google.com # dex -per-file AbstractStatsBase.java = agampe@google.com, calin@google.com, ngeoffray@google.com -per-file BackgroundDexOptService.java = agampe@google.com, calin@google.com, ngeoffray@google.com -per-file CompilerStats.java = agampe@google.com, calin@google.com, ngeoffray@google.com -per-file DynamicCodeLoggingService.java = alanstokes@google.com, agampe@google.com, calin@google.com, ngeoffray@google.com -per-file InstructionSets.java = agampe@google.com, calin@google.com, ngeoffray@google.com -per-file OtaDexoptService.java = agampe@google.com, calin@google.com, ngeoffray@google.com -per-file OtaDexoptShellCommand.java = agampe@google.com, calin@google.com, ngeoffray@google.com -per-file PackageDexOptimizer.java = agampe@google.com, calin@google.com, ngeoffray@google.com -per-file PackageManagerServiceCompilerMapping.java = agampe@google.com, calin@google.com, ngeoffray@google.com -per-file PackageUsage.java = agampe@google.com, calin@google.com, ngeoffray@google.com +per-file AbstractStatsBase.java = calin@google.com, ngeoffray@google.com +per-file BackgroundDexOptService.java = calin@google.com, ngeoffray@google.com +per-file CompilerStats.java = calin@google.com, ngeoffray@google.com +per-file DynamicCodeLoggingService.java = alanstokes@google.com, calin@google.com, ngeoffray@google.com +per-file InstructionSets.java = calin@google.com, ngeoffray@google.com +per-file OtaDexoptService.java = calin@google.com, ngeoffray@google.com +per-file OtaDexoptShellCommand.java = calin@google.com, ngeoffray@google.com +per-file PackageDexOptimizer.java = calin@google.com, ngeoffray@google.com +per-file PackageManagerServiceCompilerMapping.java = calin@google.com, ngeoffray@google.com +per-file PackageUsage.java = calin@google.com, ngeoffray@google.com # multi user / cross profile per-file CrossProfileAppsServiceImpl.java = omakoto@google.com, yamasani@google.com diff --git a/services/core/java/com/android/server/pm/dex/OWNERS b/services/core/java/com/android/server/pm/dex/OWNERS index fcc1f6c10eac..5a4431ee8c89 100644 --- a/services/core/java/com/android/server/pm/dex/OWNERS +++ b/services/core/java/com/android/server/pm/dex/OWNERS @@ -1,4 +1,2 @@ -agampe@google.com calin@google.com ngeoffray@google.com -sehr@google.com diff --git a/services/usage/java/com/android/server/usage/AppTimeLimitController.java b/services/usage/java/com/android/server/usage/AppTimeLimitController.java index 6861ad1b2e2d..4986d1883307 100644 --- a/services/usage/java/com/android/server/usage/AppTimeLimitController.java +++ b/services/usage/java/com/android/server/usage/AppTimeLimitController.java @@ -307,7 +307,7 @@ public class AppTimeLimitController { } } else { if (mActives > mObserved.length) { - // Try to get to a sane state and log the issue + // Try to get to a valid state and log the issue mActives = mObserved.length; final UserData user = mUserRef.get(); if (user == null) return; @@ -334,7 +334,7 @@ public class AppTimeLimitController { cancelCheckTimeoutLocked(this); } else { if (mActives < 0) { - // Try to get to a sane state and log the issue + // Try to get to a valid state and log the issue mActives = 0; final UserData user = mUserRef.get(); if (user == null) return; diff --git a/services/usb/java/com/android/server/usb/UsbAlsaManager.java b/services/usb/java/com/android/server/usb/UsbAlsaManager.java index 5239d976e66f..22629dd52608 100644 --- a/services/usb/java/com/android/server/usb/UsbAlsaManager.java +++ b/services/usb/java/com/android/server/usb/UsbAlsaManager.java @@ -64,7 +64,7 @@ public final class UsbAlsaManager { private UsbAlsaDevice mSelectedDevice; // - // Device Blacklist + // Device Denylist // // This exists due to problems with Sony game controllers which present as an audio device // even if no headset is connected and have no way to set the volume on the unit. @@ -73,31 +73,31 @@ public final class UsbAlsaManager { private static final int USB_PRODUCTID_PS4CONTROLLER_ZCT1 = 0x05C4; private static final int USB_PRODUCTID_PS4CONTROLLER_ZCT2 = 0x09CC; - private static final int USB_BLACKLIST_OUTPUT = 0x0001; - private static final int USB_BLACKLIST_INPUT = 0x0002; + private static final int USB_DENYLIST_OUTPUT = 0x0001; + private static final int USB_DENYLIST_INPUT = 0x0002; - private static class BlackListEntry { + private static class DenyListEntry { final int mVendorId; final int mProductId; final int mFlags; - BlackListEntry(int vendorId, int productId, int flags) { + DenyListEntry(int vendorId, int productId, int flags) { mVendorId = vendorId; mProductId = productId; mFlags = flags; } } - static final List<BlackListEntry> sDeviceBlacklist = Arrays.asList( - new BlackListEntry(USB_VENDORID_SONY, + static final List<DenyListEntry> sDeviceDenylist = Arrays.asList( + new DenyListEntry(USB_VENDORID_SONY, USB_PRODUCTID_PS4CONTROLLER_ZCT1, - USB_BLACKLIST_OUTPUT), - new BlackListEntry(USB_VENDORID_SONY, + USB_DENYLIST_OUTPUT), + new DenyListEntry(USB_VENDORID_SONY, USB_PRODUCTID_PS4CONTROLLER_ZCT2, - USB_BLACKLIST_OUTPUT)); + USB_DENYLIST_OUTPUT)); - private static boolean isDeviceBlacklisted(int vendorId, int productId, int flags) { - for (BlackListEntry entry : sDeviceBlacklist) { + private static boolean isDeviceDenylisted(int vendorId, int productId, int flags) { + for (DenyListEntry entry : sDeviceDenylist) { if (entry.mVendorId == vendorId && entry.mProductId == productId) { // see if the type flag is set return (entry.mFlags & flags) != 0; @@ -226,11 +226,11 @@ public final class UsbAlsaManager { // Add it to the devices list boolean hasInput = parser.hasInput() - && !isDeviceBlacklisted(usbDevice.getVendorId(), usbDevice.getProductId(), - USB_BLACKLIST_INPUT); + && !isDeviceDenylisted(usbDevice.getVendorId(), usbDevice.getProductId(), + USB_DENYLIST_INPUT); boolean hasOutput = parser.hasOutput() - && !isDeviceBlacklisted(usbDevice.getVendorId(), usbDevice.getProductId(), - USB_BLACKLIST_OUTPUT); + && !isDeviceDenylisted(usbDevice.getVendorId(), usbDevice.getProductId(), + USB_DENYLIST_OUTPUT); if (DEBUG) { Slog.d(TAG, "hasInput: " + hasInput + " hasOutput:" + hasOutput); } diff --git a/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java index 7595e3f249ce..98b9dcd2cc2f 100644 --- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java +++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java @@ -192,22 +192,22 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser private String[] mAccessoryStrings; private final UEventObserver mUEventObserver; - private static Set<Integer> sBlackListedInterfaces; + private static Set<Integer> sDenyInterfaces; private HashMap<Long, FileDescriptor> mControlFds; static { - sBlackListedInterfaces = new HashSet<>(); - sBlackListedInterfaces.add(UsbConstants.USB_CLASS_AUDIO); - sBlackListedInterfaces.add(UsbConstants.USB_CLASS_COMM); - sBlackListedInterfaces.add(UsbConstants.USB_CLASS_HID); - sBlackListedInterfaces.add(UsbConstants.USB_CLASS_PRINTER); - sBlackListedInterfaces.add(UsbConstants.USB_CLASS_MASS_STORAGE); - sBlackListedInterfaces.add(UsbConstants.USB_CLASS_HUB); - sBlackListedInterfaces.add(UsbConstants.USB_CLASS_CDC_DATA); - sBlackListedInterfaces.add(UsbConstants.USB_CLASS_CSCID); - sBlackListedInterfaces.add(UsbConstants.USB_CLASS_CONTENT_SEC); - sBlackListedInterfaces.add(UsbConstants.USB_CLASS_VIDEO); - sBlackListedInterfaces.add(UsbConstants.USB_CLASS_WIRELESS_CONTROLLER); + sDenyInterfaces = new HashSet<>(); + sDenyInterfaces.add(UsbConstants.USB_CLASS_AUDIO); + sDenyInterfaces.add(UsbConstants.USB_CLASS_COMM); + sDenyInterfaces.add(UsbConstants.USB_CLASS_HID); + sDenyInterfaces.add(UsbConstants.USB_CLASS_PRINTER); + sDenyInterfaces.add(UsbConstants.USB_CLASS_MASS_STORAGE); + sDenyInterfaces.add(UsbConstants.USB_CLASS_HUB); + sDenyInterfaces.add(UsbConstants.USB_CLASS_CDC_DATA); + sDenyInterfaces.add(UsbConstants.USB_CLASS_CSCID); + sDenyInterfaces.add(UsbConstants.USB_CLASS_CONTENT_SEC); + sDenyInterfaces.add(UsbConstants.USB_CLASS_VIDEO); + sDenyInterfaces.add(UsbConstants.USB_CLASS_WIRELESS_CONTROLLER); } /* @@ -886,7 +886,7 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser while (interfaceCount >= 0) { UsbInterface intrface = config.getInterface(interfaceCount); interfaceCount--; - if (sBlackListedInterfaces.contains(intrface.getInterfaceClass())) { + if (sDenyInterfaces.contains(intrface.getInterfaceClass())) { mHideUsbNotification = true; break; } diff --git a/services/usb/java/com/android/server/usb/UsbHostManager.java b/services/usb/java/com/android/server/usb/UsbHostManager.java index 140a95d61100..f33001c9241e 100644 --- a/services/usb/java/com/android/server/usb/UsbHostManager.java +++ b/services/usb/java/com/android/server/usb/UsbHostManager.java @@ -62,7 +62,7 @@ public class UsbHostManager { private final Context mContext; // USB busses to exclude from USB host support - private final String[] mHostBlacklist; + private final String[] mHostDenyList; private final UsbAlsaManager mUsbAlsaManager; private final UsbPermissionManager mPermissionManager; @@ -235,8 +235,8 @@ public class UsbHostManager { UsbPermissionManager permissionManager) { mContext = context; - mHostBlacklist = context.getResources().getStringArray( - com.android.internal.R.array.config_usbHostBlacklist); + mHostDenyList = context.getResources().getStringArray( + com.android.internal.R.array.config_usbHostDenylist); mUsbAlsaManager = alsaManager; mPermissionManager = permissionManager; String deviceConnectionHandler = context.getResources().getString( @@ -271,10 +271,10 @@ public class UsbHostManager { } } - private boolean isBlackListed(String deviceAddress) { - int count = mHostBlacklist.length; + private boolean isDenyListed(String deviceAddress) { + int count = mHostDenyList.length; for (int i = 0; i < count; i++) { - if (deviceAddress.startsWith(mHostBlacklist[i])) { + if (deviceAddress.startsWith(mHostDenyList[i])) { return true; } } @@ -282,11 +282,11 @@ public class UsbHostManager { } /* returns true if the USB device should not be accessible by applications */ - private boolean isBlackListed(int clazz, int subClass) { - // blacklist hubs + private boolean isDenyListed(int clazz, int subClass) { + // deny hubs if (clazz == UsbConstants.USB_CLASS_HUB) return true; - // blacklist HID boot devices (mouse and keyboard) + // deny HID boot devices (mouse and keyboard) return clazz == UsbConstants.USB_CLASS_HID && subClass == UsbConstants.USB_INTERFACE_SUBCLASS_BOOT; @@ -355,23 +355,23 @@ public class UsbHostManager { Slog.d(TAG, "usbDeviceAdded(" + deviceAddress + ") - start"); } - if (isBlackListed(deviceAddress)) { + if (isDenyListed(deviceAddress)) { if (DEBUG) { - Slog.d(TAG, "device address is black listed"); + Slog.d(TAG, "device address is Deny listed"); } return false; } - if (isBlackListed(deviceClass, deviceSubclass)) { + if (isDenyListed(deviceClass, deviceSubclass)) { if (DEBUG) { - Slog.d(TAG, "device class is black listed"); + Slog.d(TAG, "device class is deny listed"); } return false; } UsbDescriptorParser parser = new UsbDescriptorParser(deviceAddress, descriptors); if (deviceClass == UsbConstants.USB_CLASS_PER_INTERFACE - && !checkUsbInterfacesBlackListed(parser)) { + && !checkUsbInterfacesDenyListed(parser)) { return false; } @@ -491,12 +491,12 @@ public class UsbHostManager { public ParcelFileDescriptor openDevice(String deviceAddress, UsbUserPermissionManager permissions, String packageName, int pid, int uid) { synchronized (mLock) { - if (isBlackListed(deviceAddress)) { + if (isDenyListed(deviceAddress)) { throw new SecurityException("USB device is on a restricted bus"); } UsbDevice device = mDevices.get(deviceAddress); if (device == null) { - // if it is not in mDevices, it either does not exist or is blacklisted + // if it is not in mDevices, it either does not exist or is denylisted throw new IllegalArgumentException( "device " + deviceAddress + " does not exist or is restricted"); } @@ -554,23 +554,23 @@ public class UsbHostManager { } } - private boolean checkUsbInterfacesBlackListed(UsbDescriptorParser parser) { + private boolean checkUsbInterfacesDenyListed(UsbDescriptorParser parser) { // Device class needs to be obtained through the device interface. Ignore device only - // if ALL interfaces are black-listed. + // if ALL interfaces are deny-listed. boolean shouldIgnoreDevice = false; for (UsbDescriptor descriptor: parser.getDescriptors()) { if (!(descriptor instanceof UsbInterfaceDescriptor)) { continue; } UsbInterfaceDescriptor iface = (UsbInterfaceDescriptor) descriptor; - shouldIgnoreDevice = isBlackListed(iface.getUsbClass(), iface.getUsbSubclass()); + shouldIgnoreDevice = isDenyListed(iface.getUsbClass(), iface.getUsbSubclass()); if (!shouldIgnoreDevice) { break; } } if (shouldIgnoreDevice) { if (DEBUG) { - Slog.d(TAG, "usb interface class is black listed"); + Slog.d(TAG, "usb interface class is deny listed"); } return false; } diff --git a/startop/OWNERS b/startop/OWNERS index 3394be9779e3..2d1eb38952ed 100644 --- a/startop/OWNERS +++ b/startop/OWNERS @@ -1,7 +1,7 @@ # mailing list: startop-eng@google.com +calin@google.com chriswailes@google.com eholk@google.com iam@google.com mathieuc@google.com -sehr@google.com yawanng@google.com diff --git a/test-runner/src/android/test/AndroidTestRunner.java b/test-runner/src/android/test/AndroidTestRunner.java index f898516a001b..b2fdc5084834 100644 --- a/test-runner/src/android/test/AndroidTestRunner.java +++ b/test-runner/src/android/test/AndroidTestRunner.java @@ -125,7 +125,7 @@ public class AndroidTestRunner extends BaseTestRunner { } catch (IllegalArgumentException e) { runFailed("Illegal argument passed to constructor. Class: " + testClass.getName()); } catch (InvocationTargetException e) { - runFailed("Constructor thew an exception. Class: " + testClass.getName()); + runFailed("Constructor threw an exception. Class: " + testClass.getName()); } return null; } diff --git a/tests/BootImageProfileTest/OWNERS b/tests/BootImageProfileTest/OWNERS index 657b3f2add2e..7ee0d9a5e77e 100644 --- a/tests/BootImageProfileTest/OWNERS +++ b/tests/BootImageProfileTest/OWNERS @@ -1,4 +1,4 @@ -mathieuc@google.com calin@google.com +mathieuc@google.com +ngeoffray@google.com yawanng@google.com -sehr@google.com diff --git a/tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java b/tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java index eb0a867d8ec1..a384687e06f6 100644 --- a/tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java +++ b/tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java @@ -28,6 +28,7 @@ import static android.content.pm.ApplicationInfo.PRIVATE_FLAG_PRODUCT; import static android.content.pm.ApplicationInfo.PRIVATE_FLAG_VENDOR; import static android.content.pm.PackageManager.GET_PERMISSIONS; import static android.content.pm.PackageManager.MATCH_ANY_USER; +import static android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK; import static android.os.Process.SYSTEM_UID; import static com.android.server.connectivity.PermissionMonitor.NETWORK; @@ -138,17 +139,10 @@ public class PermissionMonitorTest { verify(mMockPmi).getPackageList(mPermissionMonitor); } - /** - * Remove all permissions from the uid then build new package info and setup permissions to uid - * for checking restricted network permission. - */ - private boolean hasRestrictedNetworkPermission(String partition, int targetSdkVersion, int uid, - String... permissions) { + private boolean wouldBeCarryoverPackage(String partition, int targetSdkVersion, int uid) { final PackageInfo packageInfo = buildPackageInfo(partition, uid, MOCK_USER1); packageInfo.applicationInfo.targetSdkVersion = targetSdkVersion; - removeAllPermissions(uid); - addPermissions(uid, permissions); - return mPermissionMonitor.hasRestrictedNetworkPermission(packageInfo.applicationInfo); + return mPermissionMonitor.isCarryoverPackage(packageInfo.applicationInfo); } private static PackageInfo packageInfoWithPartition(String partition) { @@ -228,61 +222,57 @@ public class PermissionMonitorTest { assertTrue(mPermissionMonitor.isVendorApp(app.applicationInfo)); } + /** + * Remove all permissions from the uid then setup permissions to uid for checking restricted + * network permission. + */ + private void assertRestrictedNetworkPermission(boolean hasPermission, int uid, + String... permissions) { + removeAllPermissions(uid); + addPermissions(uid, permissions); + assertEquals(hasPermission, mPermissionMonitor.hasRestrictedNetworkPermission(uid)); + } + @Test public void testHasRestrictedNetworkPermission() { - assertFalse(hasRestrictedNetworkPermission(PARTITION_SYSTEM, VERSION_P, MOCK_UID1)); - assertFalse(hasRestrictedNetworkPermission( - PARTITION_SYSTEM, VERSION_P, MOCK_UID1, CHANGE_NETWORK_STATE)); - assertTrue(hasRestrictedNetworkPermission( - PARTITION_SYSTEM, VERSION_P, MOCK_UID1, NETWORK_STACK)); - assertFalse(hasRestrictedNetworkPermission( - PARTITION_SYSTEM, VERSION_P, MOCK_UID1, CONNECTIVITY_INTERNAL)); - assertTrue(hasRestrictedNetworkPermission( - PARTITION_SYSTEM, VERSION_P, MOCK_UID1, CONNECTIVITY_USE_RESTRICTED_NETWORKS)); - assertFalse(hasRestrictedNetworkPermission( - PARTITION_SYSTEM, VERSION_P, MOCK_UID1, CHANGE_WIFI_STATE)); - - assertFalse(hasRestrictedNetworkPermission(PARTITION_SYSTEM, VERSION_Q, MOCK_UID1)); - assertFalse(hasRestrictedNetworkPermission( - PARTITION_SYSTEM, VERSION_Q, MOCK_UID1, CONNECTIVITY_INTERNAL)); + assertRestrictedNetworkPermission(false, MOCK_UID1); + assertRestrictedNetworkPermission(false, MOCK_UID1, CHANGE_NETWORK_STATE); + assertRestrictedNetworkPermission(true, MOCK_UID1, NETWORK_STACK); + assertRestrictedNetworkPermission(false, MOCK_UID1, CONNECTIVITY_INTERNAL); + assertRestrictedNetworkPermission(true, MOCK_UID1, CONNECTIVITY_USE_RESTRICTED_NETWORKS); + assertRestrictedNetworkPermission(false, MOCK_UID1, CHANGE_WIFI_STATE); + assertRestrictedNetworkPermission(true, MOCK_UID1, PERMISSION_MAINLINE_NETWORK_STACK); + + assertFalse(mPermissionMonitor.hasRestrictedNetworkPermission(MOCK_UID2)); + assertFalse(mPermissionMonitor.hasRestrictedNetworkPermission(SYSTEM_UID)); } @Test - public void testHasRestrictedNetworkPermissionSystemUid() { + public void testIsCarryoverPackage() { doReturn(VERSION_P).when(mDeps).getDeviceFirstSdkInt(); - assertTrue(hasRestrictedNetworkPermission(PARTITION_SYSTEM, VERSION_P, SYSTEM_UID)); - assertTrue(hasRestrictedNetworkPermission( - PARTITION_SYSTEM, VERSION_P, SYSTEM_UID, CONNECTIVITY_INTERNAL)); - assertTrue(hasRestrictedNetworkPermission( - PARTITION_SYSTEM, VERSION_P, SYSTEM_UID, CONNECTIVITY_USE_RESTRICTED_NETWORKS)); + assertTrue(wouldBeCarryoverPackage(PARTITION_SYSTEM, VERSION_P, SYSTEM_UID)); + assertTrue(wouldBeCarryoverPackage(PARTITION_VENDOR, VERSION_P, SYSTEM_UID)); + assertFalse(wouldBeCarryoverPackage(PARTITION_SYSTEM, VERSION_P, MOCK_UID1)); + assertTrue(wouldBeCarryoverPackage(PARTITION_VENDOR, VERSION_P, MOCK_UID1)); + assertTrue(wouldBeCarryoverPackage(PARTITION_SYSTEM, VERSION_Q, SYSTEM_UID)); + assertTrue(wouldBeCarryoverPackage(PARTITION_VENDOR, VERSION_Q, SYSTEM_UID)); + assertFalse(wouldBeCarryoverPackage(PARTITION_SYSTEM, VERSION_Q, MOCK_UID1)); + assertFalse(wouldBeCarryoverPackage(PARTITION_VENDOR, VERSION_Q, MOCK_UID1)); doReturn(VERSION_Q).when(mDeps).getDeviceFirstSdkInt(); - assertFalse(hasRestrictedNetworkPermission(PARTITION_SYSTEM, VERSION_Q, SYSTEM_UID)); - assertFalse(hasRestrictedNetworkPermission( - PARTITION_SYSTEM, VERSION_Q, SYSTEM_UID, CONNECTIVITY_INTERNAL)); - assertTrue(hasRestrictedNetworkPermission( - PARTITION_SYSTEM, VERSION_Q, SYSTEM_UID, CONNECTIVITY_USE_RESTRICTED_NETWORKS)); - } - - @Test - public void testHasRestrictedNetworkPermissionVendorApp() { - assertTrue(hasRestrictedNetworkPermission(PARTITION_VENDOR, VERSION_P, MOCK_UID1)); - assertTrue(hasRestrictedNetworkPermission( - PARTITION_VENDOR, VERSION_P, MOCK_UID1, CHANGE_NETWORK_STATE)); - assertTrue(hasRestrictedNetworkPermission( - PARTITION_VENDOR, VERSION_P, MOCK_UID1, NETWORK_STACK)); - assertTrue(hasRestrictedNetworkPermission( - PARTITION_VENDOR, VERSION_P, MOCK_UID1, CONNECTIVITY_INTERNAL)); - assertTrue(hasRestrictedNetworkPermission( - PARTITION_VENDOR, VERSION_P, MOCK_UID1, CONNECTIVITY_USE_RESTRICTED_NETWORKS)); - assertTrue(hasRestrictedNetworkPermission( - PARTITION_VENDOR, VERSION_P, MOCK_UID1, CHANGE_WIFI_STATE)); - - assertFalse(hasRestrictedNetworkPermission(PARTITION_VENDOR, VERSION_Q, MOCK_UID1)); - assertFalse(hasRestrictedNetworkPermission( - PARTITION_VENDOR, VERSION_Q, MOCK_UID1, CONNECTIVITY_INTERNAL)); - assertFalse(hasRestrictedNetworkPermission( - PARTITION_VENDOR, VERSION_Q, MOCK_UID1, CHANGE_NETWORK_STATE)); + assertFalse(wouldBeCarryoverPackage(PARTITION_SYSTEM, VERSION_P, SYSTEM_UID)); + assertTrue(wouldBeCarryoverPackage(PARTITION_VENDOR, VERSION_P, SYSTEM_UID)); + assertFalse(wouldBeCarryoverPackage(PARTITION_SYSTEM, VERSION_P, MOCK_UID1)); + assertTrue(wouldBeCarryoverPackage(PARTITION_VENDOR, VERSION_P, MOCK_UID1)); + assertFalse(wouldBeCarryoverPackage(PARTITION_SYSTEM, VERSION_Q, SYSTEM_UID)); + assertFalse(wouldBeCarryoverPackage(PARTITION_VENDOR, VERSION_Q, SYSTEM_UID)); + assertFalse(wouldBeCarryoverPackage(PARTITION_SYSTEM, VERSION_Q, MOCK_UID1)); + assertFalse(wouldBeCarryoverPackage(PARTITION_VENDOR, VERSION_Q, MOCK_UID1)); + + assertFalse(wouldBeCarryoverPackage(PARTITION_OEM, VERSION_Q, SYSTEM_UID)); + assertFalse(wouldBeCarryoverPackage(PARTITION_PRODUCT, VERSION_Q, SYSTEM_UID)); + assertFalse(wouldBeCarryoverPackage(PARTITION_OEM, VERSION_Q, MOCK_UID1)); + assertFalse(wouldBeCarryoverPackage(PARTITION_PRODUCT, VERSION_Q, MOCK_UID1)); } private void assertBackgroundPermission(boolean hasPermission, String name, int uid, @@ -296,19 +286,23 @@ public class PermissionMonitorTest { @Test public void testHasUseBackgroundNetworksPermission() throws Exception { - doReturn(VERSION_Q).when(mDeps).getDeviceFirstSdkInt(); - assertFalse(mPermissionMonitor.hasUseBackgroundNetworksPermission(SYSTEM_UID)); - assertBackgroundPermission(false, "system1", SYSTEM_UID); - assertBackgroundPermission(false, "system2", SYSTEM_UID, CONNECTIVITY_INTERNAL); - assertBackgroundPermission(true, "system3", SYSTEM_UID, CHANGE_NETWORK_STATE); - assertFalse(mPermissionMonitor.hasUseBackgroundNetworksPermission(MOCK_UID1)); assertBackgroundPermission(false, "mock1", MOCK_UID1); - assertBackgroundPermission(true, "mock2", MOCK_UID1, CONNECTIVITY_USE_RESTRICTED_NETWORKS); + assertBackgroundPermission(false, "mock2", MOCK_UID1, CONNECTIVITY_INTERNAL); + assertBackgroundPermission(true, "mock3", MOCK_UID1, NETWORK_STACK); assertFalse(mPermissionMonitor.hasUseBackgroundNetworksPermission(MOCK_UID2)); - assertBackgroundPermission(false, "mock3", MOCK_UID2, CONNECTIVITY_INTERNAL); - assertBackgroundPermission(true, "mock4", MOCK_UID2, NETWORK_STACK); + assertBackgroundPermission(false, "mock4", MOCK_UID2); + assertBackgroundPermission(true, "mock5", MOCK_UID2, + CONNECTIVITY_USE_RESTRICTED_NETWORKS); + + doReturn(VERSION_Q).when(mDeps).getDeviceFirstSdkInt(); + assertFalse(mPermissionMonitor.hasUseBackgroundNetworksPermission(SYSTEM_UID)); + assertBackgroundPermission(false, "system1", SYSTEM_UID); + assertBackgroundPermission(true, "system2", SYSTEM_UID, CHANGE_NETWORK_STATE); + doReturn(VERSION_P).when(mDeps).getDeviceFirstSdkInt(); + removeAllPermissions(SYSTEM_UID); + assertBackgroundPermission(true, "system3", SYSTEM_UID); } private class NetdMonitor { diff --git a/tests/utils/DummyIME/Android.bp b/tests/utils/StubIME/Android.bp index 4a44b3b27992..668c92c86c51 100644 --- a/tests/utils/DummyIME/Android.bp +++ b/tests/utils/StubIME/Android.bp @@ -15,7 +15,7 @@ // android_test { - name: "DummyIME", + name: "StubIME", srcs: ["src/**/*.java"], sdk_version: "current", } diff --git a/tests/utils/DummyIME/AndroidManifest.xml b/tests/utils/StubIME/AndroidManifest.xml index fd17a52cb7d9..04502d331d6a 100644 --- a/tests/utils/DummyIME/AndroidManifest.xml +++ b/tests/utils/StubIME/AndroidManifest.xml @@ -17,16 +17,16 @@ --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.testing.dummyime"> - <application android:label="Dummy IME"> - <service android:name="DummyIme" + package="com.android.testing.stubime"> + <application android:label="Stub IME"> + <service android:name="StubIme" android:permission="android.permission.BIND_INPUT_METHOD"> <intent-filter> <action android:name="android.view.InputMethod" /> </intent-filter> <meta-data android:name="android.view.im" android:resource="@xml/method" /> </service> - <activity android:name=".ImePreferences" android:label="Dummy IME Settings"> + <activity android:name=".ImePreferences" android:label="Stub IME Settings"> <intent-filter> <action android:name="android.intent.action.MAIN"/> </intent-filter> diff --git a/tests/utils/DummyIME/res/xml/method.xml b/tests/utils/StubIME/res/xml/method.xml index 43a330e2bc93..1bb4bcd3480b 100644 --- a/tests/utils/DummyIME/res/xml/method.xml +++ b/tests/utils/StubIME/res/xml/method.xml @@ -21,9 +21,9 @@ <!-- for the Search Manager. --> <input-method xmlns:android="http://schemas.android.com/apk/res/android" - android:settingsActivity="com.android.testing.dummyime.ImePreferences"> + android:settingsActivity="com.android.testing.stubime.ImePreferences"> <subtype android:label="Generic" android:imeSubtypeLocale="en_US" android:imeSubtypeMode="keyboard" /> -</input-method>
\ No newline at end of file +</input-method> diff --git a/tests/utils/DummyIME/src/com/android/testing/dummyime/ImePreferences.java b/tests/utils/StubIME/src/com/android/testing/stubime/ImePreferences.java index 41036ab86596..b77525ad0a43 100644 --- a/tests/utils/DummyIME/src/com/android/testing/dummyime/ImePreferences.java +++ b/tests/utils/StubIME/src/com/android/testing/stubime/ImePreferences.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package com.android.testing.dummyime; +package com.android.testing.stubime; import android.preference.PreferenceActivity; /** - * Dummy IME preference activity + * Stub IME preference activity */ public class ImePreferences extends PreferenceActivity { diff --git a/tests/utils/DummyIME/src/com/android/testing/dummyime/DummyIme.java b/tests/utils/StubIME/src/com/android/testing/stubime/StubIme.java index 7b7a39a702e5..8795202b3283 100644 --- a/tests/utils/DummyIME/src/com/android/testing/dummyime/DummyIme.java +++ b/tests/utils/StubIME/src/com/android/testing/stubime/StubIme.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package com.android.testing.dummyime; +package com.android.testing.stubime; import android.inputmethodservice.InputMethodService; /** - * Dummy IME implementation that basically does nothing + * Stub IME implementation that basically does nothing */ -public class DummyIme extends InputMethodService { +public class StubIme extends InputMethodService { @Override public boolean onEvaluateFullscreenMode() { |