readSessionsLocked depend on DPMS, so defer it until all system
service is started
Fix:
34663223
Test: Manual
1. Try to install an app and reboot before it is installed
(so the session is persisted in a file)
2. Observe that PackageInstallerService
read the persisted session in onSystemReady and
able to get the DPM instance.
3. Observe play can read the persisted session
Change-Id: Ia14ed09db08fcf59189fa29293f0ac5066650942
new File(Environment.getDataSystemDirectory(), "install_sessions.xml"));
mSessionsDir = new File(Environment.getDataSystemDirectory(), "install_sessions");
mSessionsDir.mkdirs();
+ }
+
+ public void systemReady() {
+ mAppOps = mContext.getSystemService(AppOpsManager.class);
synchronized (mSessions) {
readSessionsLocked();
}
}
- public void systemReady() {
- mAppOps = mContext.getSystemService(AppOpsManager.class);
- }
-
private void reconcileStagesLocked(String volumeUuid, boolean isEphemeral) {
final File stagingDir = buildStagingDir(volumeUuid, isEphemeral);
final ArraySet<File> unclaimedStages = newArraySet(