summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-prod (mdb) <android-build-team-robot@google.com>2017-05-15 18:25:35 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-05-15 18:25:36 +0000
commit1de5671c013b912fe771b1f77756402d6825bdec (patch)
treeb5e662d494fea57e3843927dff1e516b0d8891c8
parent433677bffdb517c03df1f41b174191feb34271af (diff)
parent3dca38adfc857deb369ab8558d6caada0996ed8d (diff)
downloadplatform_cts-1de5671c013b912fe771b1f77756402d6825bdec.tar.gz
platform_cts-1de5671c013b912fe771b1f77756402d6825bdec.tar.bz2
platform_cts-1de5671c013b912fe771b1f77756402d6825bdec.zip
Merge "release-request-df3758e5-899f-46f0-8851-2c684d4eeabc-for-aosp-nougat-mr1-cts-release-4003927 snap-temp-L31600000064050208" into nougat-mr1-cts-releaseandroid-cts-7.1_r6
-rwxr-xr-xapps/CtsVerifier/res/values/strings.xml4
-rw-r--r--apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/AuthenticationBoundKeyTestActivity.java5
-rwxr-xr-xhostsidetests/appsecurity/test-apps/UsePermissionApp23/src/com/android/cts/usepermission/BasePermissionsTest.java14
-rw-r--r--tests/tests/shortcutmanager/src/android/content/pm/cts/shortcutmanager/ShortcutManagerUsageTest.java18
4 files changed, 22 insertions, 19 deletions
diff --git a/apps/CtsVerifier/res/values/strings.xml b/apps/CtsVerifier/res/values/strings.xml
index 3798d8d514b..e49fb8f117f 100755
--- a/apps/CtsVerifier/res/values/strings.xml
+++ b/apps/CtsVerifier/res/values/strings.xml
@@ -1438,7 +1438,7 @@ You should be prompted to select credentials; choose the ones you just installed
<string name="provisioning_byod_capture_media_error">Error while capturing media from managed profile.</string>
<string name="provisioning_byod_capture_image_error">Error while capturing image from managed profile.</string>
- <string name="provisioning_byod_auth_bound_key">Autentication-boud keys</string>
+ <string name="provisioning_byod_auth_bound_key">Authentication-bound keys</string>
<string name="provisioning_byod_auth_bound_key_info">
This test verifies keystore cryptographic keys can be bound to device credentials.
These keys should only be available if there was a recent enough authentication.
@@ -1447,7 +1447,7 @@ You should be prompted to select credentials; choose the ones you just installed
This test verifies keystore cryptographic keys can be bound to device lockscreen challenge or fingerprints (if available).
These keys should only be available if there was a recent enough authentication. \n
- 1. Press "Set up" to open Security settings. Create a lockscreen password and if available, enroll a fingerprint.\n
+ 1. Press "Set up" to open Security settings. Create a lockscreen password and if available, enroll a fingerprint under "Work profile security".\n
2. Go through the list of tests.\n
3. Mark the overall test pass or fail.\n
4. Once the set of tests are completed, remove the lockscreen challenge.
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/AuthenticationBoundKeyTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/AuthenticationBoundKeyTestActivity.java
index 073412d2205..7b6c69626cb 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/AuthenticationBoundKeyTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/AuthenticationBoundKeyTestActivity.java
@@ -208,6 +208,8 @@ public class AuthenticationBoundKeyTestActivity extends DialogTestListActivity {
*/
private void createKey(int testType) {
try {
+ KeyStore keyStore = KeyStore.getInstance(KEYSTORE_NAME);
+ keyStore.load(null);
// Set the alias of the entry in Android KeyStore where the key will appear
// and the constrains (purposes) in the constructor of the Builder
KeyGenParameterSpec.Builder builder;
@@ -226,7 +228,8 @@ public class AuthenticationBoundKeyTestActivity extends DialogTestListActivity {
keyGenerator.init(builder.build());
keyGenerator.generateKey();
} catch (NoSuchAlgorithmException | NoSuchProviderException
- | InvalidAlgorithmParameterException e) {
+ | InvalidAlgorithmParameterException | KeyStoreException
+ | CertificateException | IOException e) {
throw new RuntimeException("Failed to create a symmetric key", e);
}
}
diff --git a/hostsidetests/appsecurity/test-apps/UsePermissionApp23/src/com/android/cts/usepermission/BasePermissionsTest.java b/hostsidetests/appsecurity/test-apps/UsePermissionApp23/src/com/android/cts/usepermission/BasePermissionsTest.java
index 3bc0153b7c2..4367aff5b82 100755
--- a/hostsidetests/appsecurity/test-apps/UsePermissionApp23/src/com/android/cts/usepermission/BasePermissionsTest.java
+++ b/hostsidetests/appsecurity/test-apps/UsePermissionApp23/src/com/android/cts/usepermission/BasePermissionsTest.java
@@ -62,7 +62,7 @@ public abstract class BasePermissionsTest {
private static final long IDLE_TIMEOUT_MILLIS = 500;
private static final long GLOBAL_TIMEOUT_MILLIS = 5000;
- private static final long RETRY_TIMEOUT = 5000;
+ private static final long RETRY_TIMEOUT = 3 * GLOBAL_TIMEOUT_MILLIS;
private static final String LOG_TAG = "BasePermissionsTest";
private static Map<String, String> sPermissionToLabelResNameMap = new ArrayMap<>();
@@ -277,7 +277,7 @@ public abstract class BasePermissionsTest {
// Open the permissions UI
String label = mContext.getResources().getString(R.string.Permissions);
- AccessibilityNodeInfo permLabelView = getNodeTimed(() -> findByText(label));
+ AccessibilityNodeInfo permLabelView = getNodeTimed(() -> findByText(label), true);
Assert.assertNotNull("Permissions label should be present", permLabelView);
AccessibilityNodeInfo permItemView = findCollectionItem(permLabelView);
@@ -291,7 +291,7 @@ public abstract class BasePermissionsTest {
// Find the permission toggle
String permissionLabel = getPermissionLabel(permission);
- AccessibilityNodeInfo labelView = getNodeTimed(() -> findByText(permissionLabel));
+ AccessibilityNodeInfo labelView = getNodeTimed(() -> findByText(permissionLabel), true);
Assert.assertNotNull("Permission label should be present", labelView);
AccessibilityNodeInfo itemView = findCollectionItem(labelView);
@@ -387,14 +387,14 @@ public abstract class BasePermissionsTest {
}
if (child.getCollectionInfo() != null) {
scrollTop(child);
- result = getNodeTimed(() -> findByText(child, text));
+ result = getNodeTimed(() -> findByText(child, text), false);
if (result != null) {
return result;
}
try {
while (child.getActionList().contains(AccessibilityAction.ACTION_SCROLL_FORWARD)) {
scrollForward(child);
- result = getNodeTimed(() -> findByText(child, text));
+ result = getNodeTimed(() -> findByText(child, text), false);
if (result != null) {
return result;
}
@@ -481,7 +481,7 @@ public abstract class BasePermissionsTest {
}
private static AccessibilityNodeInfo getNodeTimed(
- Callable<AccessibilityNodeInfo> callable) throws Exception {
+ Callable<AccessibilityNodeInfo> callable, boolean retry) throws Exception {
final long startTimeMillis = SystemClock.uptimeMillis();
while (true) {
try {
@@ -495,7 +495,7 @@ public abstract class BasePermissionsTest {
}
final long elapsedTimeMillis = SystemClock.uptimeMillis() - startTimeMillis;
- if (elapsedTimeMillis > RETRY_TIMEOUT) {
+ if (!retry || elapsedTimeMillis > RETRY_TIMEOUT) {
return null;
}
SystemClock.sleep(2 * elapsedTimeMillis);
diff --git a/tests/tests/shortcutmanager/src/android/content/pm/cts/shortcutmanager/ShortcutManagerUsageTest.java b/tests/tests/shortcutmanager/src/android/content/pm/cts/shortcutmanager/ShortcutManagerUsageTest.java
index aa0ad821800..7cda2272cbe 100644
--- a/tests/tests/shortcutmanager/src/android/content/pm/cts/shortcutmanager/ShortcutManagerUsageTest.java
+++ b/tests/tests/shortcutmanager/src/android/content/pm/cts/shortcutmanager/ShortcutManagerUsageTest.java
@@ -104,10 +104,6 @@ public class ShortcutManagerUsageTest extends ShortcutManagerCtsTestsBase {
// Report usage.
final long start = System.currentTimeMillis() - USAGE_STATS_RANGE_ALLOWANCE;
- runWithCaller(mPackageContext1, () -> getManager().reportShortcutUsed(id1));
- runWithCaller(mPackageContext1, () -> getManager().reportShortcutUsed(idManifest));
- runWithCaller(mPackageContext1, () -> getManager().reportShortcutUsed(idNonexistance));
-
runWithCaller(mPackageContext2, () -> getManager().reportShortcutUsed(id3));
final long end = System.currentTimeMillis() + USAGE_STATS_RANGE_ALLOWANCE;
@@ -122,14 +118,18 @@ public class ShortcutManagerUsageTest extends ShortcutManagerCtsTestsBase {
mPackageContext2.getPackageName(), id3), "Events weren't populated");
assertTrue(hasEvent(usm.queryEvents(start, end),
- mPackageContext1.getPackageName(), id1));
+ mPackageContext2.getPackageName(), id3));
+ runWithCaller(mPackageContext1, () -> getManager().reportShortcutUsed(id1));
assertTrue(hasEvent(usm.queryEvents(start, end),
- mPackageContext1.getPackageName(), idManifest));
- assertFalse(hasEvent(usm.queryEvents(start, end),
- mPackageContext1.getPackageName(), idNonexistance));
+ mPackageContext1.getPackageName(), id1));
+ runWithCaller(mPackageContext1, () -> getManager().reportShortcutUsed(idManifest));
assertTrue(hasEvent(usm.queryEvents(start, end),
- mPackageContext2.getPackageName(), id3));
+ mPackageContext1.getPackageName(), idManifest));
+
+ runWithCaller(mPackageContext1, () -> getManager().reportShortcutUsed(idNonexistance));
+ assertFalse(hasEvent(usm.queryEvents(start, end),
+ mPackageContext1.getPackageName(), idNonexistance));
}
}