Installd: migrate legacy obb data when user 0 unlocks.

Note that the call to installd is idempotent, and there's a no-op
fast path when no legacy obb data is available to migrate.

Test: manual
Bug: 129167772
Change-Id: I450ace9d3fcf9eb18fd723ed275fce2ec0b4e415
This commit is contained in:
Narayan Kamath
2019-05-15 19:40:19 +01:00
committed by Anton Hansson
parent 261b3b13b0
commit eeb7d8f020

View File

@@ -121,6 +121,24 @@ public class Installer extends SystemService {
}
}
@Override
public void onUnlockUser(int userId) {
if (userId == 0) {
if (!checkBeforeRemote()) return;
if (mInstalld == null) {
Slog.wtf(TAG, "Call to onUnlockUser prior to onStart.");
return;
}
try {
mInstalld.migrateLegacyObbData();
} catch (RemoteException re) {
Slog.wtf(TAG, "Error migrating legacy OBB data.", re);
}
}
}
private void connect() {
IBinder binder = ServiceManager.getService("installd");
if (binder != null) {