diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/FlickerTests/Android.bp | 13 | ||||
| -rw-r--r-- | tests/FlickerTests/libs/window-extensions-release.aar | bin | 21364 -> 0 bytes | |||
| -rw-r--r-- | tests/Input/src/com/android/server/input/KeyboardLayoutManagerTests.kt | 78 | ||||
| -rw-r--r-- | tests/Input/src/com/android/server/input/KeyboardMetricsCollectorTests.kt | 17 | ||||
| -rw-r--r-- | tests/graphics/HwAccelerationTest/jni/native-lib.cpp | 2 |
5 files changed, 66 insertions, 44 deletions
diff --git a/tests/FlickerTests/Android.bp b/tests/FlickerTests/Android.bp index 1d71f95ef64f..d658d5991a57 100644 --- a/tests/FlickerTests/Android.bp +++ b/tests/FlickerTests/Android.bp @@ -63,17 +63,20 @@ java_library { ], } -android_library_import { - name: "wm-flicker-window-extensions_nodeps", - aars: ["libs/window-extensions-release.aar"], +java_library { + name: "wm-flicker-window-extensions", sdk_version: "current", + static_libs: [ + "androidx.window.extensions_extensions-nodeps", + ], + installable: false, } java_library { - name: "wm-flicker-window-extensions", + name: "wm-flicker-window-extensions-core", sdk_version: "current", static_libs: [ - "wm-flicker-window-extensions_nodeps", + "androidx.window.extensions.core_core-nodeps", ], installable: false, } diff --git a/tests/FlickerTests/libs/window-extensions-release.aar b/tests/FlickerTests/libs/window-extensions-release.aar Binary files differdeleted file mode 100644 index 918e514f4c89..000000000000 --- a/tests/FlickerTests/libs/window-extensions-release.aar +++ /dev/null diff --git a/tests/Input/src/com/android/server/input/KeyboardLayoutManagerTests.kt b/tests/Input/src/com/android/server/input/KeyboardLayoutManagerTests.kt index 7343ba1c1ce7..e60764f137af 100644 --- a/tests/Input/src/com/android/server/input/KeyboardLayoutManagerTests.kt +++ b/tests/Input/src/com/android/server/input/KeyboardLayoutManagerTests.kt @@ -24,6 +24,7 @@ import android.content.pm.ApplicationInfo import android.content.pm.PackageManager import android.content.pm.ResolveInfo import android.content.pm.ServiceInfo +import android.hardware.input.KeyboardLayoutSelectionResult import android.hardware.input.IInputManager import android.hardware.input.InputManager import android.hardware.input.InputManagerGlobal @@ -525,13 +526,13 @@ class KeyboardLayoutManagerTests { keyboardDevice.identifier, USER_ID, imeInfo, imeSubtype, ENGLISH_UK_LAYOUT_DESCRIPTOR ) - val keyboardLayout = + assertEquals( + "Default UI: getKeyboardLayoutForInputDevice API should always return " + + "KeyboardLayoutSelectionResult.FAILED", + KeyboardLayoutSelectionResult.FAILED, keyboardLayoutManager.getKeyboardLayoutForInputDevice( keyboardDevice.identifier, USER_ID, imeInfo, imeSubtype ) - assertNull( - "Default UI: getKeyboardLayoutForInputDevice API should always return null", - keyboardLayout ) } } @@ -545,12 +546,14 @@ class KeyboardLayoutManagerTests { keyboardDevice.identifier, USER_ID, imeInfo, imeSubtype, ENGLISH_UK_LAYOUT_DESCRIPTOR ) - assertEquals( - "New UI: getKeyboardLayoutForInputDevice API should return the set layout", - ENGLISH_UK_LAYOUT_DESCRIPTOR, + var result = keyboardLayoutManager.getKeyboardLayoutForInputDevice( keyboardDevice.identifier, USER_ID, imeInfo, imeSubtype ) + assertEquals( + "New UI: getKeyboardLayoutForInputDevice API should return the set layout", + ENGLISH_UK_LAYOUT_DESCRIPTOR, + result.layoutDescriptor ) // This should replace previously set layout @@ -558,12 +561,14 @@ class KeyboardLayoutManagerTests { keyboardDevice.identifier, USER_ID, imeInfo, imeSubtype, ENGLISH_US_LAYOUT_DESCRIPTOR ) - assertEquals( - "New UI: getKeyboardLayoutForInputDevice API should return the last set layout", - ENGLISH_US_LAYOUT_DESCRIPTOR, + result = keyboardLayoutManager.getKeyboardLayoutForInputDevice( keyboardDevice.identifier, USER_ID, imeInfo, imeSubtype ) + assertEquals( + "New UI: getKeyboardLayoutForInputDevice API should return the last set layout", + ENGLISH_US_LAYOUT_DESCRIPTOR, + result.layoutDescriptor ) } } @@ -734,17 +739,20 @@ class KeyboardLayoutManagerTests { createImeSubtypeForLanguageTag("ru"), createLayoutDescriptor("keyboard_layout_russian") ) - assertNull( - "New UI: getDefaultKeyboardLayoutForInputDevice should return null when no " + - "layout available", + assertEquals( + "New UI: getDefaultKeyboardLayoutForInputDevice should return " + + "KeyboardLayoutSelectionResult.FAILED when no layout available", + KeyboardLayoutSelectionResult.FAILED, keyboardLayoutManager.getKeyboardLayoutForInputDevice( keyboardDevice.identifier, USER_ID, imeInfo, createImeSubtypeForLanguageTag("it") ) ) - assertNull( - "New UI: getDefaultKeyboardLayoutForInputDevice should return null when no " + - "layout for script code is available", + assertEquals( + "New UI: getDefaultKeyboardLayoutForInputDevice should return " + + "KeyboardLayoutSelectionResult.FAILED when no layout for script code is" + + "available", + KeyboardLayoutSelectionResult.FAILED, keyboardLayoutManager.getKeyboardLayoutForInputDevice( keyboardDevice.identifier, USER_ID, imeInfo, createImeSubtypeForLanguageTag("en-Deva") @@ -811,8 +819,10 @@ class KeyboardLayoutManagerTests { createImeSubtypeForLanguageTagAndLayoutType("ru", ""), createLayoutDescriptor("keyboard_layout_russian") ) - assertNull("New UI: getDefaultKeyboardLayoutForInputDevice should return null when " + - "no layout for script code is available", + assertEquals("New UI: getDefaultKeyboardLayoutForInputDevice should return " + + "KeyboardLayoutSelectionResult.FAILED when no layout for script code is" + + "available", + KeyboardLayoutSelectionResult.FAILED, keyboardLayoutManager.getKeyboardLayoutForInputDevice( keyboardDevice.identifier, USER_ID, imeInfo, createImeSubtypeForLanguageTagAndLayoutType("en-Deva-US", "") @@ -865,14 +875,16 @@ class KeyboardLayoutManagerTests { ArgumentMatchers.anyBoolean(), ArgumentMatchers.eq(keyboardDevice.vendorId), ArgumentMatchers.eq(keyboardDevice.productId), - ArgumentMatchers.eq(createByteArray( + ArgumentMatchers.eq( + createByteArray( KeyboardMetricsCollector.DEFAULT_LANGUAGE_TAG, LAYOUT_TYPE_DEFAULT, GERMAN_LAYOUT_NAME, - KeyboardMetricsCollector.LAYOUT_SELECTION_CRITERIA_VIRTUAL_KEYBOARD, + KeyboardLayoutSelectionResult.LAYOUT_SELECTION_CRITERIA_VIRTUAL_KEYBOARD, "de-Latn", - LAYOUT_TYPE_QWERTZ), + LAYOUT_TYPE_QWERTZ ), + ), ArgumentMatchers.eq(keyboardDevice.deviceBus), ) } @@ -893,13 +905,16 @@ class KeyboardLayoutManagerTests { ArgumentMatchers.anyBoolean(), ArgumentMatchers.eq(englishQwertyKeyboardDevice.vendorId), ArgumentMatchers.eq(englishQwertyKeyboardDevice.productId), - ArgumentMatchers.eq(createByteArray( + ArgumentMatchers.eq( + createByteArray( "en", LAYOUT_TYPE_QWERTY, ENGLISH_US_LAYOUT_NAME, - KeyboardMetricsCollector.LAYOUT_SELECTION_CRITERIA_DEVICE, + KeyboardLayoutSelectionResult.LAYOUT_SELECTION_CRITERIA_DEVICE, "de-Latn", - LAYOUT_TYPE_QWERTZ)), + LAYOUT_TYPE_QWERTZ + ) + ), ArgumentMatchers.eq(keyboardDevice.deviceBus), ) } @@ -918,14 +933,16 @@ class KeyboardLayoutManagerTests { ArgumentMatchers.anyBoolean(), ArgumentMatchers.eq(keyboardDevice.vendorId), ArgumentMatchers.eq(keyboardDevice.productId), - ArgumentMatchers.eq(createByteArray( + ArgumentMatchers.eq( + createByteArray( KeyboardMetricsCollector.DEFAULT_LANGUAGE_TAG, LAYOUT_TYPE_DEFAULT, "Default", - KeyboardMetricsCollector.LAYOUT_SELECTION_CRITERIA_DEFAULT, + KeyboardLayoutSelectionResult.LAYOUT_SELECTION_CRITERIA_DEFAULT, KeyboardMetricsCollector.DEFAULT_LANGUAGE_TAG, - LAYOUT_TYPE_DEFAULT), + LAYOUT_TYPE_DEFAULT ), + ), ArgumentMatchers.eq(keyboardDevice.deviceBus), ) } @@ -998,12 +1015,13 @@ class KeyboardLayoutManagerTests { imeSubtype: InputMethodSubtype, expectedLayout: String ) { + val result = keyboardLayoutManager.getKeyboardLayoutForInputDevice( + device.identifier, USER_ID, imeInfo, imeSubtype + ) assertEquals( "New UI: getDefaultKeyboardLayoutForInputDevice should return $expectedLayout", expectedLayout, - keyboardLayoutManager.getKeyboardLayoutForInputDevice( - device.identifier, USER_ID, imeInfo, imeSubtype - ) + result.layoutDescriptor ) } diff --git a/tests/Input/src/com/android/server/input/KeyboardMetricsCollectorTests.kt b/tests/Input/src/com/android/server/input/KeyboardMetricsCollectorTests.kt index 89a47b9b736a..0615941eda09 100644 --- a/tests/Input/src/com/android/server/input/KeyboardMetricsCollectorTests.kt +++ b/tests/Input/src/com/android/server/input/KeyboardMetricsCollectorTests.kt @@ -17,6 +17,7 @@ package com.android.server.input import android.hardware.input.KeyboardLayout +import android.hardware.input.KeyboardLayoutSelectionResult import android.icu.util.ULocale import android.platform.test.annotations.Presubmit import android.view.InputDevice @@ -120,15 +121,15 @@ class KeyboardMetricsCollectorTests { val event = builder.addLayoutSelection( createImeSubtype(1, ULocale.forLanguageTag("en-US"), "qwerty"), "English(US)(Qwerty)", - KeyboardMetricsCollector.LAYOUT_SELECTION_CRITERIA_VIRTUAL_KEYBOARD + KeyboardLayoutSelectionResult.LAYOUT_SELECTION_CRITERIA_VIRTUAL_KEYBOARD ).addLayoutSelection( createImeSubtype(2, ULocale.forLanguageTag("en-US"), "azerty"), null, // Default layout type - KeyboardMetricsCollector.LAYOUT_SELECTION_CRITERIA_USER + KeyboardLayoutSelectionResult.LAYOUT_SELECTION_CRITERIA_USER ).addLayoutSelection( createImeSubtype(3, ULocale.forLanguageTag("en-US"), "qwerty"), "German", - KeyboardMetricsCollector.LAYOUT_SELECTION_CRITERIA_DEVICE + KeyboardLayoutSelectionResult.LAYOUT_SELECTION_CRITERIA_DEVICE ).setIsFirstTimeConfiguration(true).build() assertEquals( @@ -158,7 +159,7 @@ class KeyboardMetricsCollectorTests { "de-CH", KeyboardLayout.LayoutType.getLayoutTypeEnumValue("qwertz"), "English(US)(Qwerty)", - KeyboardMetricsCollector.LAYOUT_SELECTION_CRITERIA_VIRTUAL_KEYBOARD, + KeyboardLayoutSelectionResult.LAYOUT_SELECTION_CRITERIA_VIRTUAL_KEYBOARD, "en-US", KeyboardLayout.LayoutType.getLayoutTypeEnumValue("qwerty"), ) @@ -167,7 +168,7 @@ class KeyboardMetricsCollectorTests { "de-CH", KeyboardLayout.LayoutType.getLayoutTypeEnumValue("qwertz"), KeyboardMetricsCollector.DEFAULT_LAYOUT_NAME, - KeyboardMetricsCollector.LAYOUT_SELECTION_CRITERIA_USER, + KeyboardLayoutSelectionResult.LAYOUT_SELECTION_CRITERIA_USER, "en-US", KeyboardLayout.LayoutType.getLayoutTypeEnumValue("azerty"), ) @@ -176,7 +177,7 @@ class KeyboardMetricsCollectorTests { "de-CH", KeyboardLayout.LayoutType.getLayoutTypeEnumValue("qwertz"), "German", - KeyboardMetricsCollector.LAYOUT_SELECTION_CRITERIA_DEVICE, + KeyboardLayoutSelectionResult.LAYOUT_SELECTION_CRITERIA_DEVICE, "en-US", KeyboardLayout.LayoutType.getLayoutTypeEnumValue("qwerty"), ) @@ -197,7 +198,7 @@ class KeyboardMetricsCollectorTests { val event = builder.addLayoutSelection( createImeSubtype(4, null, "qwerty"), // Default language tag "German", - KeyboardMetricsCollector.LAYOUT_SELECTION_CRITERIA_DEVICE + KeyboardLayoutSelectionResult.LAYOUT_SELECTION_CRITERIA_DEVICE ).build() assertExpectedLayoutConfiguration( @@ -205,7 +206,7 @@ class KeyboardMetricsCollectorTests { KeyboardMetricsCollector.DEFAULT_LANGUAGE_TAG, KeyboardLayout.LayoutType.getLayoutTypeEnumValue("azerty"), "German", - KeyboardMetricsCollector.LAYOUT_SELECTION_CRITERIA_DEVICE, + KeyboardLayoutSelectionResult.LAYOUT_SELECTION_CRITERIA_DEVICE, KeyboardMetricsCollector.DEFAULT_LANGUAGE_TAG, KeyboardLayout.LayoutType.getLayoutTypeEnumValue("qwerty"), ) diff --git a/tests/graphics/HwAccelerationTest/jni/native-lib.cpp b/tests/graphics/HwAccelerationTest/jni/native-lib.cpp index 407d4bf76336..2977c2157261 100644 --- a/tests/graphics/HwAccelerationTest/jni/native-lib.cpp +++ b/tests/graphics/HwAccelerationTest/jni/native-lib.cpp @@ -30,7 +30,7 @@ struct MyWrapper { void setBuffer(AHardwareBuffer* buffer) { ASurfaceTransaction* transaction = ASurfaceTransaction_create(); - ASurfaceTransaction_setBuffer(transaction, surfaceControl, buffer); + ASurfaceTransaction_setBuffer(transaction, surfaceControl, buffer, -1); ASurfaceTransaction_setVisibility(transaction, surfaceControl, ASURFACE_TRANSACTION_VISIBILITY_SHOW); ASurfaceTransaction_apply(transaction); |