Call getAllowedUid on a separate thread

Test: manual
Bug: 37673384
Change-Id: If7480a8cd3fd1ccb5b7179b613a124db010efa8e
This commit is contained in:
Fyodor Kupolov
2017-04-25 14:19:31 -07:00
parent 9e55fcbdc2
commit ec00b5199c

View File

@@ -95,7 +95,6 @@ public class PersistentDataBlockService extends SystemService {
mContext = context;
mDataBlockFile = SystemProperties.get(PERSISTENT_DATA_BLOCK_PROP);
mBlockDeviceSize = -1; // Load lazily
mAllowedUid = getAllowedUid(UserHandle.USER_SYSTEM);
}
private int getAllowedUid(int userHandle) {
@@ -117,6 +116,7 @@ public class PersistentDataBlockService extends SystemService {
public void onStart() {
// Do init on a separate thread, will join in PHASE_ACTIVITY_MANAGER_READY
SystemServerInitThreadPool.get().submit(() -> {
mAllowedUid = getAllowedUid(UserHandle.USER_SYSTEM);
enforceChecksumValidity();
formatIfOemUnlockEnabled();
publishBinderService(Context.PERSISTENT_DATA_BLOCK_SERVICE, mService);