summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hostsidetests/appsecurity/src/android/appsecurity/cts/AppDataIsolationTests.java4
-rw-r--r--hostsidetests/appsecurity/src/android/appsecurity/cts/AuthBoundKeyTest.java6
-rw-r--r--hostsidetests/appsecurity/test-apps/AppDataIsolationTestApp/AppA/src/com/android/cts/appdataisolation/appa/AppATests.java1
-rw-r--r--hostsidetests/appsecurity/test-apps/EncryptionApp/src/com/android/cts/encryptionapp/EncryptionAppTest.java5
-rw-r--r--tests/framework/base/windowmanager/src/android/server/wm/WindowInputTests.java9
5 files changed, 15 insertions, 10 deletions
diff --git a/hostsidetests/appsecurity/src/android/appsecurity/cts/AppDataIsolationTests.java b/hostsidetests/appsecurity/src/android/appsecurity/cts/AppDataIsolationTests.java
index 30598217a1d..d40a6dfb5bf 100644
--- a/hostsidetests/appsecurity/src/android/appsecurity/cts/AppDataIsolationTests.java
+++ b/hostsidetests/appsecurity/src/android/appsecurity/cts/AppDataIsolationTests.java
@@ -218,7 +218,7 @@ public class AppDataIsolationTests extends BaseAppSecurityTest {
// Setup screenlock
getDevice().executeShellCommand("settings put global require_password_to_decrypt 0");
getDevice().executeShellCommand("locksettings set-disabled false");
- getDevice().executeShellCommand("locksettings set-pin 12345");
+ getDevice().executeShellCommand("locksettings set-pin 1234");
// Give enough time for vold to update keys
Thread.sleep(15000);
@@ -265,7 +265,7 @@ public class AppDataIsolationTests extends BaseAppSecurityTest {
try {
runDeviceTests(APPA_PKG, APPA_CLASS, APPA_METHOD_TEST_UNLOCK_DEVICE);
} catch (Exception e) {}
- getDevice().executeShellCommand("locksettings clear --old 12345");
+ getDevice().executeShellCommand("locksettings clear --old 1234");
getDevice().executeShellCommand("locksettings set-disabled true");
getDevice().executeShellCommand(
"settings delete global require_password_to_decrypt");
diff --git a/hostsidetests/appsecurity/src/android/appsecurity/cts/AuthBoundKeyTest.java b/hostsidetests/appsecurity/src/android/appsecurity/cts/AuthBoundKeyTest.java
index 2952f83ee13..5d871211c57 100644
--- a/hostsidetests/appsecurity/src/android/appsecurity/cts/AuthBoundKeyTest.java
+++ b/hostsidetests/appsecurity/src/android/appsecurity/cts/AuthBoundKeyTest.java
@@ -60,15 +60,15 @@ public class AuthBoundKeyTest extends BaseAppSecurityTest {
runDeviceTests(PKG, CLASS, "testGenerateAuthBoundKey");
getDevice().executeShellCommand("cmd lock_settings clear --old 1234");
runDeviceTests(PKG, CLASS, "testUseKey");
- getDevice().executeShellCommand("cmd lock_settings set-pin 12345");
+ getDevice().executeShellCommand("cmd lock_settings set-pin 2345");
getDevice().executeShellCommand("input keyevent 26"); // Screen on
getDevice().executeShellCommand("input keyevent 82"); // Bring up lock screen
- getDevice().executeShellCommand("input text 12345"); // Input password
+ getDevice().executeShellCommand("input text 2345"); // Input password
getDevice().executeShellCommand("input keyevent 66"); // Submit input
runDeviceTests(PKG, CLASS, "testUseKey");
} finally {
getDevice().executeShellCommand("cmd lock_settings clear --old 1234");
- getDevice().executeShellCommand("cmd lock_settings clear --old 12345");
+ getDevice().executeShellCommand("cmd lock_settings clear --old 2345");
}
}
}
diff --git a/hostsidetests/appsecurity/test-apps/AppDataIsolationTestApp/AppA/src/com/android/cts/appdataisolation/appa/AppATests.java b/hostsidetests/appsecurity/test-apps/AppDataIsolationTestApp/AppA/src/com/android/cts/appdataisolation/appa/AppATests.java
index c25d3d93932..d2555ae9b63 100644
--- a/hostsidetests/appsecurity/test-apps/AppDataIsolationTestApp/AppA/src/com/android/cts/appdataisolation/appa/AppATests.java
+++ b/hostsidetests/appsecurity/test-apps/AppDataIsolationTestApp/AppA/src/com/android/cts/appdataisolation/appa/AppATests.java
@@ -203,7 +203,6 @@ public class AppATests {
mDevice.pressKeyCode(KeyEvent.KEYCODE_2);
mDevice.pressKeyCode(KeyEvent.KEYCODE_3);
mDevice.pressKeyCode(KeyEvent.KEYCODE_4);
- mDevice.pressKeyCode(KeyEvent.KEYCODE_5);
mDevice.waitForIdle();
mDevice.pressEnter();
mDevice.waitForIdle();
diff --git a/hostsidetests/appsecurity/test-apps/EncryptionApp/src/com/android/cts/encryptionapp/EncryptionAppTest.java b/hostsidetests/appsecurity/test-apps/EncryptionApp/src/com/android/cts/encryptionapp/EncryptionAppTest.java
index 8e3a970035c..597045b5686 100644
--- a/hostsidetests/appsecurity/test-apps/EncryptionApp/src/com/android/cts/encryptionapp/EncryptionAppTest.java
+++ b/hostsidetests/appsecurity/test-apps/EncryptionApp/src/com/android/cts/encryptionapp/EncryptionAppTest.java
@@ -114,7 +114,7 @@ public class EncryptionAppTest extends InstrumentationTestCase {
// Set a PIN for this user
mDevice.executeShellCommand("settings put global require_password_to_decrypt 0");
mDevice.executeShellCommand("locksettings set-disabled false");
- mDevice.executeShellCommand("locksettings set-pin 12345");
+ mDevice.executeShellCommand("locksettings set-pin 1234");
}
public void testTearDown() throws Exception {
@@ -126,7 +126,7 @@ public class EncryptionAppTest extends InstrumentationTestCase {
mDevice.waitForIdle();
// Clear PIN for this user
- mDevice.executeShellCommand("locksettings clear --old 12345");
+ mDevice.executeShellCommand("locksettings clear --old 1234");
mDevice.executeShellCommand("locksettings set-disabled true");
mDevice.executeShellCommand("settings delete global require_password_to_decrypt");
}
@@ -188,7 +188,6 @@ public class EncryptionAppTest extends InstrumentationTestCase {
mDevice.pressKeyCode(KeyEvent.KEYCODE_2);
mDevice.pressKeyCode(KeyEvent.KEYCODE_3);
mDevice.pressKeyCode(KeyEvent.KEYCODE_4);
- mDevice.pressKeyCode(KeyEvent.KEYCODE_5);
mDevice.waitForIdle();
mDevice.pressEnter();
mDevice.waitForIdle();
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/WindowInputTests.java b/tests/framework/base/windowmanager/src/android/server/wm/WindowInputTests.java
index ce0a51e2167..e7e990c566d 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/WindowInputTests.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/WindowInputTests.java
@@ -266,6 +266,7 @@ public class WindowInputTests {
mInstrumentation.sendPointerSync(eventDown);
final ExecutorService executor = Executors.newSingleThreadExecutor();
+ boolean[] securityExceptionCaught = new boolean[1];
executor.execute(() -> {
mInstrumentation.sendPointerSync(eventDown);
for (int i = 0; i < 20; i++) {
@@ -275,7 +276,7 @@ public class WindowInputTests {
try {
mInstrumentation.sendPointerSync(eventMove);
} catch (SecurityException e) {
- fail("Should be allowed to inject event.");
+ securityExceptionCaught[0] = true;
}
}
});
@@ -287,6 +288,12 @@ public class WindowInputTests {
executor.shutdown();
executor.awaitTermination(5L, TimeUnit.SECONDS);
+
+ if (securityExceptionCaught[0]) {
+ // Fail the test here instead of in the executor lambda,
+ // so the failure is thrown in the test thread.
+ fail("Should be allowed to inject event.");
+ }
}
public static class TestActivity extends Activity {