Add implementation alternatives for OemLockManager.
The OEM lock can be implemented with the persistent data block or the
OemLock HAL.
Test: gts-tradefed run gts -m GtsOemLockServiceTestCases -t com.google.android.oemlock.gts.OemLockServiceTest
Bug: 34766843
Change-Id: I16b31785d9af58212a050a299ef024be3139f0c6
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 38f35c0..71781ac 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -83,6 +83,7 @@
import com.android.server.net.NetworkPolicyManagerService;
import com.android.server.net.NetworkStatsService;
import com.android.server.notification.NotificationManagerService;
+import com.android.server.oemlock.OemLockService;
import com.android.server.om.OverlayManagerService;
import com.android.server.os.DeviceIdentifiersPolicyService;
import com.android.server.os.SchedulingPolicyService;
@@ -982,12 +983,15 @@
}
traceEnd();
- if (!SystemProperties.get(PERSISTENT_DATA_BLOCK_PROP).equals("")) {
+ final boolean hasPdb = !SystemProperties.get(PERSISTENT_DATA_BLOCK_PROP).equals("");
+ if (hasPdb) {
traceBeginAndSlog("StartPersistentDataBlock");
mSystemServiceManager.startService(PersistentDataBlockService.class);
traceEnd();
+ }
- // Implementation depends on persistent data block
+ if (hasPdb || OemLockService.isHalPresent()) {
+ // Implementation depends on pdb or the OemLock HAL
traceBeginAndSlog("StartOemLockService");
mSystemServiceManager.startService(OemLockService.class);
traceEnd();