Move LockSettingsService into locksettings package.
This service now has a large number of support classes so move them into
their own package to keep things tidy and easier to refactor.
Bug: 37090873
Test: runtest frameworks-services -c com.android.server.locksettings.LockSettingsServiceTests
Test: runtest frameworks-services -c com.android.server.locksettings.LockSettingsShellCommandTest
Test: runtest frameworks-services -c com.android.server.locksettings.SyntheticPasswordTests
Change-Id: Ic3cd00e6565749defd74498a3491c3d9b914ad90
diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/locksettings/LockSettingsService.java
similarity index 99%
rename from services/core/java/com/android/server/LockSettingsService.java
rename to services/core/java/com/android/server/locksettings/LockSettingsService.java
index 9629b1b..6b8a74f 100644
--- a/services/core/java/com/android/server/LockSettingsService.java
+++ b/services/core/java/com/android/server/locksettings/LockSettingsService.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server;
+package com.android.server.locksettings;
import static android.Manifest.permission.ACCESS_KEYGUARD_SECURE_STORAGE;
import static android.Manifest.permission.READ_CONTACTS;
@@ -84,9 +84,10 @@
import com.android.internal.widget.ILockSettings;
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.VerifyCredentialResponse;
-import com.android.server.LockSettingsStorage.CredentialHash;
-import com.android.server.SyntheticPasswordManager.AuthenticationResult;
-import com.android.server.SyntheticPasswordManager.AuthenticationToken;
+import com.android.server.SystemService;
+import com.android.server.locksettings.LockSettingsStorage.CredentialHash;
+import com.android.server.locksettings.SyntheticPasswordManager.AuthenticationResult;
+import com.android.server.locksettings.SyntheticPasswordManager.AuthenticationToken;
import libcore.util.HexEncoding;
diff --git a/services/core/java/com/android/server/LockSettingsShellCommand.java b/services/core/java/com/android/server/locksettings/LockSettingsShellCommand.java
similarity index 99%
rename from services/core/java/com/android/server/LockSettingsShellCommand.java
rename to services/core/java/com/android/server/locksettings/LockSettingsShellCommand.java
index 9d671e39..d1fb28a 100644
--- a/services/core/java/com/android/server/LockSettingsShellCommand.java
+++ b/services/core/java/com/android/server/locksettings/LockSettingsShellCommand.java
@@ -14,7 +14,7 @@
* limitations under the License
*/
-package com.android.server;
+package com.android.server.locksettings;
import static android.app.admin.DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC;
import static android.app.admin.DevicePolicyManager.PASSWORD_QUALITY_NUMERIC;
diff --git a/services/core/java/com/android/server/LockSettingsStorage.java b/services/core/java/com/android/server/locksettings/LockSettingsStorage.java
similarity index 99%
rename from services/core/java/com/android/server/LockSettingsStorage.java
rename to services/core/java/com/android/server/locksettings/LockSettingsStorage.java
index 761ae44..861209d 100644
--- a/services/core/java/com/android/server/LockSettingsStorage.java
+++ b/services/core/java/com/android/server/locksettings/LockSettingsStorage.java
@@ -14,7 +14,7 @@
* limitations under the License
*/
-package com.android.server;
+package com.android.server.locksettings;
import static android.content.Context.USER_SERVICE;
diff --git a/services/core/java/com/android/server/LockSettingsStrongAuth.java b/services/core/java/com/android/server/locksettings/LockSettingsStrongAuth.java
similarity index 99%
rename from services/core/java/com/android/server/LockSettingsStrongAuth.java
rename to services/core/java/com/android/server/locksettings/LockSettingsStrongAuth.java
index f5fe3db..0966153 100644
--- a/services/core/java/com/android/server/LockSettingsStrongAuth.java
+++ b/services/core/java/com/android/server/locksettings/LockSettingsStrongAuth.java
@@ -14,7 +14,7 @@
* limitations under the License
*/
-package com.android.server;
+package com.android.server.locksettings;
import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_NOT_REQUIRED;
import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_TIMEOUT;
diff --git a/services/core/java/com/android/server/SyntheticPasswordCrypto.java b/services/core/java/com/android/server/locksettings/SyntheticPasswordCrypto.java
similarity index 99%
rename from services/core/java/com/android/server/SyntheticPasswordCrypto.java
rename to services/core/java/com/android/server/locksettings/SyntheticPasswordCrypto.java
index 71ab2a5..b7bca1fb 100644
--- a/services/core/java/com/android/server/SyntheticPasswordCrypto.java
+++ b/services/core/java/com/android/server/locksettings/SyntheticPasswordCrypto.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server;
+package com.android.server.locksettings;
import android.security.keystore.KeyProperties;
import android.security.keystore.KeyProtection;
diff --git a/services/core/java/com/android/server/SyntheticPasswordManager.java b/services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java
similarity index 99%
rename from services/core/java/com/android/server/SyntheticPasswordManager.java
rename to services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java
index 6722bc5..e2ec92b 100644
--- a/services/core/java/com/android/server/SyntheticPasswordManager.java
+++ b/services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java
@@ -13,7 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.server;
+
+package com.android.server.locksettings;
import android.annotation.NonNull;
import android.annotation.Nullable;
diff --git a/services/core/jni/Android.mk b/services/core/jni/Android.mk
index af70612..355c350 100644
--- a/services/core/jni/Android.mk
+++ b/services/core/jni/Android.mk
@@ -19,13 +19,13 @@
$(LOCAL_REL_DIR)/com_android_server_lights_LightsService.cpp \
$(LOCAL_REL_DIR)/com_android_server_location_ContextHubService.cpp \
$(LOCAL_REL_DIR)/com_android_server_location_GnssLocationProvider.cpp \
+ $(LOCAL_REL_DIR)/com_android_server_locksettings_SyntheticPasswordManager.cpp \
$(LOCAL_REL_DIR)/com_android_server_power_PowerManagerService.cpp \
$(LOCAL_REL_DIR)/com_android_server_radio_RadioService.cpp \
$(LOCAL_REL_DIR)/com_android_server_radio_Tuner.cpp \
$(LOCAL_REL_DIR)/com_android_server_radio_Tuner_TunerCallback.cpp \
$(LOCAL_REL_DIR)/com_android_server_radio_convert.cpp \
$(LOCAL_REL_DIR)/com_android_server_SerialService.cpp \
- $(LOCAL_REL_DIR)/com_android_server_SyntheticPasswordManager.cpp \
$(LOCAL_REL_DIR)/com_android_server_storage_AppFuseBridge.cpp \
$(LOCAL_REL_DIR)/com_android_server_SystemServer.cpp \
$(LOCAL_REL_DIR)/com_android_server_tv_TvUinputBridge.cpp \
diff --git a/services/core/jni/com_android_server_SyntheticPasswordManager.cpp b/services/core/jni/com_android_server_locksettings_SyntheticPasswordManager.cpp
similarity index 96%
rename from services/core/jni/com_android_server_SyntheticPasswordManager.cpp
rename to services/core/jni/com_android_server_locksettings_SyntheticPasswordManager.cpp
index a9f7b9f..248dedb 100644
--- a/services/core/jni/com_android_server_SyntheticPasswordManager.cpp
+++ b/services/core/jni/com_android_server_locksettings_SyntheticPasswordManager.cpp
@@ -83,7 +83,7 @@
};
int register_android_server_SyntheticPasswordManager(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "com/android/server/SyntheticPasswordManager",
+ return jniRegisterNativeMethods(env, "com/android/server/locksettings/SyntheticPasswordManager",
sMethods, NELEM(sMethods));
}
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index c7d6b21..1efe102 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -177,7 +177,7 @@
private static final String JOB_SCHEDULER_SERVICE_CLASS =
"com.android.server.job.JobSchedulerService";
private static final String LOCK_SETTINGS_SERVICE_CLASS =
- "com.android.server.LockSettingsService$Lifecycle";
+ "com.android.server.locksettings.LockSettingsService$Lifecycle";
private static final String STORAGE_MANAGER_SERVICE_CLASS =
"com.android.server.StorageManagerService$Lifecycle";
private static final String STORAGE_STATS_SERVICE_CLASS =
diff --git a/services/tests/servicestests/src/com/android/server/BaseLockSettingsServiceTests.java b/services/tests/servicestests/src/com/android/server/locksettings/BaseLockSettingsServiceTests.java
similarity index 99%
rename from services/tests/servicestests/src/com/android/server/BaseLockSettingsServiceTests.java
rename to services/tests/servicestests/src/com/android/server/locksettings/BaseLockSettingsServiceTests.java
index 7167e8c..a2b4568 100644
--- a/services/tests/servicestests/src/com/android/server/BaseLockSettingsServiceTests.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/BaseLockSettingsServiceTests.java
@@ -14,7 +14,7 @@
* limitations under the License
*/
-package com.android.server;
+package com.android.server.locksettings;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyBoolean;
diff --git a/services/tests/servicestests/src/com/android/server/LockSettingsServiceTestable.java b/services/tests/servicestests/src/com/android/server/locksettings/LockSettingsServiceTestable.java
similarity index 98%
rename from services/tests/servicestests/src/com/android/server/LockSettingsServiceTestable.java
rename to services/tests/servicestests/src/com/android/server/locksettings/LockSettingsServiceTestable.java
index be88927..3a4aa2d 100644
--- a/services/tests/servicestests/src/com/android/server/LockSettingsServiceTestable.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/LockSettingsServiceTestable.java
@@ -14,7 +14,7 @@
* limitations under the License
*/
-package com.android.server;
+package com.android.server.locksettings;
import static org.mockito.Mockito.mock;
diff --git a/services/tests/servicestests/src/com/android/server/LockSettingsServiceTests.java b/services/tests/servicestests/src/com/android/server/locksettings/LockSettingsServiceTests.java
similarity index 97%
rename from services/tests/servicestests/src/com/android/server/LockSettingsServiceTests.java
rename to services/tests/servicestests/src/com/android/server/locksettings/LockSettingsServiceTests.java
index 25cc426..2f0ac38 100644
--- a/services/tests/servicestests/src/com/android/server/LockSettingsServiceTests.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/LockSettingsServiceTests.java
@@ -14,7 +14,7 @@
* limitations under the License
*/
-package com.android.server;
+package com.android.server.locksettings;
import static com.android.internal.widget.LockPatternUtils.CREDENTIAL_TYPE_NONE;
import static com.android.internal.widget.LockPatternUtils.CREDENTIAL_TYPE_PASSWORD;
@@ -25,11 +25,11 @@
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.VerifyCredentialResponse;
-import com.android.server.LockSettingsStorage.CredentialHash;
-import com.android.server.MockGateKeeperService.VerifyHandle;
+import com.android.server.locksettings.LockSettingsStorage.CredentialHash;
+import com.android.server.locksettings.MockGateKeeperService.VerifyHandle;
/**
- * runtest frameworks-services -c com.android.server.LockSettingsServiceTests
+ * runtest frameworks-services -c com.android.server.locksettings.LockSettingsServiceTests
*/
public class LockSettingsServiceTests extends BaseLockSettingsServiceTests {
diff --git a/services/tests/servicestests/src/com/android/server/LockSettingsShellCommandTest.java b/services/tests/servicestests/src/com/android/server/locksettings/LockSettingsShellCommandTest.java
similarity index 97%
rename from services/tests/servicestests/src/com/android/server/LockSettingsShellCommandTest.java
rename to services/tests/servicestests/src/com/android/server/locksettings/LockSettingsShellCommandTest.java
index 84ebb19..424c08c 100644
--- a/services/tests/servicestests/src/com/android/server/LockSettingsShellCommandTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/LockSettingsShellCommandTest.java
@@ -14,7 +14,7 @@
* limitations under the License
*/
-package com.android.server;
+package com.android.server.locksettings;
import static android.app.admin.DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC;
import static android.app.admin.DevicePolicyManager.PASSWORD_QUALITY_NUMERIC;
@@ -59,7 +59,7 @@
/**
* Test class for {@link LockSettingsShellCommand}.
*
- * runtest frameworks-services -c com.android.server.LockSettingsShellCommandTest
+ * runtest frameworks-services -c com.android.server.locksettings.LockSettingsShellCommandTest
*/
@SmallTest
@Presubmit
diff --git a/services/tests/servicestests/src/com/android/server/LockSettingsStorageTestable.java b/services/tests/servicestests/src/com/android/server/locksettings/LockSettingsStorageTestable.java
similarity index 97%
rename from services/tests/servicestests/src/com/android/server/LockSettingsStorageTestable.java
rename to services/tests/servicestests/src/com/android/server/locksettings/LockSettingsStorageTestable.java
index 18da1a5..4bdd1c5 100644
--- a/services/tests/servicestests/src/com/android/server/LockSettingsStorageTestable.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/LockSettingsStorageTestable.java
@@ -14,7 +14,7 @@
* limitations under the License
*/
-package com.android.server;
+package com.android.server.locksettings;
import android.content.Context;
diff --git a/services/tests/servicestests/src/com/android/server/LockSettingsStorageTests.java b/services/tests/servicestests/src/com/android/server/locksettings/LockSettingsStorageTests.java
similarity index 98%
rename from services/tests/servicestests/src/com/android/server/LockSettingsStorageTests.java
rename to services/tests/servicestests/src/com/android/server/locksettings/LockSettingsStorageTests.java
index 4677904..4665441 100644
--- a/services/tests/servicestests/src/com/android/server/LockSettingsStorageTests.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/LockSettingsStorageTests.java
@@ -14,7 +14,7 @@
* limitations under the License
*/
-package com.android.server;
+package com.android.server.locksettings;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
@@ -31,7 +31,7 @@
import android.test.AndroidTestCase;
import com.android.internal.widget.LockPatternUtils;
-import com.android.server.LockSettingsStorage.CredentialHash;
+import com.android.server.locksettings.LockSettingsStorage.CredentialHash;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
@@ -39,7 +39,7 @@
import java.util.concurrent.CountDownLatch;
/**
- * runtest frameworks-services -c com.android.server.LockSettingsStorageTests
+ * runtest frameworks-services -c com.android.server.locksettings.LockSettingsStorageTests
*/
public class LockSettingsStorageTests extends AndroidTestCase {
private final byte[] PASSWORD_0 = "thepassword0".getBytes();
diff --git a/services/tests/servicestests/src/com/android/server/MockGateKeeperService.java b/services/tests/servicestests/src/com/android/server/locksettings/MockGateKeeperService.java
similarity index 99%
rename from services/tests/servicestests/src/com/android/server/MockGateKeeperService.java
rename to services/tests/servicestests/src/com/android/server/locksettings/MockGateKeeperService.java
index bc93341..eefd361 100644
--- a/services/tests/servicestests/src/com/android/server/MockGateKeeperService.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/MockGateKeeperService.java
@@ -14,7 +14,7 @@
* limitations under the License
*/
-package com.android.server;
+package com.android.server.locksettings;
import android.os.IBinder;
import android.os.RemoteException;
diff --git a/services/tests/servicestests/src/com/android/server/MockLockSettingsContext.java b/services/tests/servicestests/src/com/android/server/locksettings/MockLockSettingsContext.java
similarity index 97%
rename from services/tests/servicestests/src/com/android/server/MockLockSettingsContext.java
rename to services/tests/servicestests/src/com/android/server/locksettings/MockLockSettingsContext.java
index 8bceed4..c76a83e 100644
--- a/services/tests/servicestests/src/com/android/server/MockLockSettingsContext.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/MockLockSettingsContext.java
@@ -14,7 +14,7 @@
* limitations under the License
*/
-package com.android.server;
+package com.android.server.locksettings;
import android.app.NotificationManager;
import android.app.admin.DevicePolicyManager;
diff --git a/services/tests/servicestests/src/com/android/server/MockStorageManager.java b/services/tests/servicestests/src/com/android/server/locksettings/MockStorageManager.java
similarity index 99%
rename from services/tests/servicestests/src/com/android/server/MockStorageManager.java
rename to services/tests/servicestests/src/com/android/server/locksettings/MockStorageManager.java
index 17c8ec2..ac46bae 100644
--- a/services/tests/servicestests/src/com/android/server/MockStorageManager.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/MockStorageManager.java
@@ -14,7 +14,7 @@
* limitations under the License
*/
-package com.android.server;
+package com.android.server.locksettings;
import android.content.pm.IPackageMoveObserver;
import android.os.IBinder;
diff --git a/services/tests/servicestests/src/com/android/server/MockSyntheticPasswordManager.java b/services/tests/servicestests/src/com/android/server/locksettings/MockSyntheticPasswordManager.java
similarity index 98%
rename from services/tests/servicestests/src/com/android/server/MockSyntheticPasswordManager.java
rename to services/tests/servicestests/src/com/android/server/locksettings/MockSyntheticPasswordManager.java
index 9389e48..ddef5dc 100644
--- a/services/tests/servicestests/src/com/android/server/MockSyntheticPasswordManager.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/MockSyntheticPasswordManager.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.server;
+package com.android.server.locksettings;
import android.hardware.weaver.V1_0.IWeaver;
import android.os.RemoteException;
diff --git a/services/tests/servicestests/src/com/android/server/MockWeaverService.java b/services/tests/servicestests/src/com/android/server/locksettings/MockWeaverService.java
similarity index 98%
rename from services/tests/servicestests/src/com/android/server/MockWeaverService.java
rename to services/tests/servicestests/src/com/android/server/locksettings/MockWeaverService.java
index 0de50ab..34831cd 100644
--- a/services/tests/servicestests/src/com/android/server/MockWeaverService.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/MockWeaverService.java
@@ -1,4 +1,4 @@
-package com.android.server;
+package com.android.server.locksettings;
import android.hardware.weaver.V1_0.IWeaver;
import android.hardware.weaver.V1_0.WeaverConfig;
diff --git a/services/tests/servicestests/src/com/android/server/SyntheticPasswordTests.java b/services/tests/servicestests/src/com/android/server/locksettings/SyntheticPasswordTests.java
similarity index 98%
rename from services/tests/servicestests/src/com/android/server/SyntheticPasswordTests.java
rename to services/tests/servicestests/src/com/android/server/locksettings/SyntheticPasswordTests.java
index 3ec71e4..0d35385 100644
--- a/services/tests/servicestests/src/com/android/server/SyntheticPasswordTests.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/SyntheticPasswordTests.java
@@ -14,7 +14,7 @@
* limitations under the License
*/
-package com.android.server;
+package com.android.server.locksettings;
import static com.android.internal.widget.LockPatternUtils.SYNTHETIC_PASSWORD_ENABLED_KEY;
import static com.android.internal.widget.LockPatternUtils.SYNTHETIC_PASSWORD_HANDLE_KEY;
@@ -24,12 +24,12 @@
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.VerifyCredentialResponse;
-import com.android.server.SyntheticPasswordManager.AuthenticationResult;
-import com.android.server.SyntheticPasswordManager.AuthenticationToken;
+import com.android.server.locksettings.SyntheticPasswordManager.AuthenticationResult;
+import com.android.server.locksettings.SyntheticPasswordManager.AuthenticationToken;
/**
- * runtest frameworks-services -c com.android.server.SyntheticPasswordTests
+ * runtest frameworks-services -c com.android.server.locksettings.SyntheticPasswordTests
*/
public class SyntheticPasswordTests extends BaseLockSettingsServiceTests {
diff --git a/services/tests/servicestests/src/com/android/server/WeaverBasedSyntheticPasswordTests.java b/services/tests/servicestests/src/com/android/server/locksettings/WeaverBasedSyntheticPasswordTests.java
similarity index 83%
rename from services/tests/servicestests/src/com/android/server/WeaverBasedSyntheticPasswordTests.java
rename to services/tests/servicestests/src/com/android/server/locksettings/WeaverBasedSyntheticPasswordTests.java
index d85a815..5e56704 100644
--- a/services/tests/servicestests/src/com/android/server/WeaverBasedSyntheticPasswordTests.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/WeaverBasedSyntheticPasswordTests.java
@@ -1,4 +1,4 @@
-package com.android.server;
+package com.android.server.locksettings;
public class WeaverBasedSyntheticPasswordTests extends SyntheticPasswordTests {