Wire up GateKeeper to LockSettingsService
Adds:
- Communication to GKService
- password upgrade flow
- enroll takes previous credential
Change-Id: I0161b64642be3d0e34ff4a9e6e3ca8569f2d7c0a
diff --git a/services/tests/servicestests/src/com/android/server/LockSettingsStorageTests.java b/services/tests/servicestests/src/com/android/server/LockSettingsStorageTests.java
index bf0e75d..dae8447 100644
--- a/services/tests/servicestests/src/com/android/server/LockSettingsStorageTests.java
+++ b/services/tests/servicestests/src/com/android/server/LockSettingsStorageTests.java
@@ -219,31 +219,31 @@
public void testPassword_Write() {
mStorage.writePasswordHash("thepassword".getBytes(), 0);
- assertArrayEquals("thepassword".getBytes(), mStorage.readPasswordHash(0));
+ assertArrayEquals("thepassword".getBytes(), mStorage.readPasswordHash(0).hash);
mStorage.clearCache();
- assertArrayEquals("thepassword".getBytes(), mStorage.readPasswordHash(0));
+ assertArrayEquals("thepassword".getBytes(), mStorage.readPasswordHash(0).hash);
}
public void testPassword_WriteProfileWritesParent() {
mStorage.writePasswordHash("parentpasswordd".getBytes(), 1);
mStorage.writePasswordHash("profilepassword".getBytes(), 2);
- assertArrayEquals("profilepassword".getBytes(), mStorage.readPasswordHash(1));
- assertArrayEquals("profilepassword".getBytes(), mStorage.readPasswordHash(2));
+ assertArrayEquals("profilepassword".getBytes(), mStorage.readPasswordHash(1).hash);
+ assertArrayEquals("profilepassword".getBytes(), mStorage.readPasswordHash(2).hash);
mStorage.clearCache();
- assertArrayEquals("profilepassword".getBytes(), mStorage.readPasswordHash(1));
- assertArrayEquals("profilepassword".getBytes(), mStorage.readPasswordHash(2));
+ assertArrayEquals("profilepassword".getBytes(), mStorage.readPasswordHash(1).hash);
+ assertArrayEquals("profilepassword".getBytes(), mStorage.readPasswordHash(2).hash);
}
public void testPassword_WriteParentWritesProfile() {
mStorage.writePasswordHash("profilepassword".getBytes(), 2);
mStorage.writePasswordHash("parentpasswordd".getBytes(), 1);
- assertArrayEquals("parentpasswordd".getBytes(), mStorage.readPasswordHash(1));
- assertArrayEquals("parentpasswordd".getBytes(), mStorage.readPasswordHash(2));
+ assertArrayEquals("parentpasswordd".getBytes(), mStorage.readPasswordHash(1).hash);
+ assertArrayEquals("parentpasswordd".getBytes(), mStorage.readPasswordHash(2).hash);
mStorage.clearCache();
- assertArrayEquals("parentpasswordd".getBytes(), mStorage.readPasswordHash(1));
- assertArrayEquals("parentpasswordd".getBytes(), mStorage.readPasswordHash(2));
+ assertArrayEquals("parentpasswordd".getBytes(), mStorage.readPasswordHash(1).hash);
+ assertArrayEquals("parentpasswordd".getBytes(), mStorage.readPasswordHash(2).hash);
}
public void testPattern_Default() {
@@ -253,31 +253,31 @@
public void testPattern_Write() {
mStorage.writePatternHash("thepattern".getBytes(), 0);
- assertArrayEquals("thepattern".getBytes(), mStorage.readPatternHash(0));
+ assertArrayEquals("thepattern".getBytes(), mStorage.readPatternHash(0).hash);
mStorage.clearCache();
- assertArrayEquals("thepattern".getBytes(), mStorage.readPatternHash(0));
+ assertArrayEquals("thepattern".getBytes(), mStorage.readPatternHash(0).hash);
}
public void testPattern_WriteProfileWritesParent() {
mStorage.writePatternHash("parentpatternn".getBytes(), 1);
mStorage.writePatternHash("profilepattern".getBytes(), 2);
- assertArrayEquals("profilepattern".getBytes(), mStorage.readPatternHash(1));
- assertArrayEquals("profilepattern".getBytes(), mStorage.readPatternHash(2));
+ assertArrayEquals("profilepattern".getBytes(), mStorage.readPatternHash(1).hash);
+ assertArrayEquals("profilepattern".getBytes(), mStorage.readPatternHash(2).hash);
mStorage.clearCache();
- assertArrayEquals("profilepattern".getBytes(), mStorage.readPatternHash(1));
- assertArrayEquals("profilepattern".getBytes(), mStorage.readPatternHash(2));
+ assertArrayEquals("profilepattern".getBytes(), mStorage.readPatternHash(1).hash);
+ assertArrayEquals("profilepattern".getBytes(), mStorage.readPatternHash(2).hash);
}
public void testPattern_WriteParentWritesProfile() {
mStorage.writePatternHash("profilepattern".getBytes(), 2);
mStorage.writePatternHash("parentpatternn".getBytes(), 1);
- assertArrayEquals("parentpatternn".getBytes(), mStorage.readPatternHash(1));
- assertArrayEquals("parentpatternn".getBytes(), mStorage.readPatternHash(2));
+ assertArrayEquals("parentpatternn".getBytes(), mStorage.readPatternHash(1).hash);
+ assertArrayEquals("parentpatternn".getBytes(), mStorage.readPatternHash(2).hash);
mStorage.clearCache();
- assertArrayEquals("parentpatternn".getBytes(), mStorage.readPatternHash(1));
- assertArrayEquals("parentpatternn".getBytes(), mStorage.readPatternHash(2));
+ assertArrayEquals("parentpatternn".getBytes(), mStorage.readPatternHash(1).hash);
+ assertArrayEquals("parentpatternn".getBytes(), mStorage.readPatternHash(2).hash);
}
public void testPrefetch() {
@@ -289,8 +289,8 @@
mStorage.prefetchUser(0);
assertEquals("toBeFetched", mStorage.readKeyValue("key", "default", 0));
- assertArrayEquals("pattern".getBytes(), mStorage.readPatternHash(0));
- assertArrayEquals("password".getBytes(), mStorage.readPasswordHash(0));
+ assertArrayEquals("pattern".getBytes(), mStorage.readPatternHash(0).hash);
+ assertArrayEquals("password".getBytes(), mStorage.readPasswordHash(0).hash);
}
public void testFileLocation_Owner() {