Use StorageManager#isUserKeyUnlocked to determine CE storage in PMS
Rather than use isUserUnlockingOrUnlocked, which relies on the user state int to be toggled, this moves to isUserKeyUnlocked, which better represents the actual state of being able to create directories on user credential protected storage. The problem with the user state int is that it's only toggled after reconciling app data to fix up missing directories. This means that between reconcilation finishing and the state int being flipped, there is a period of time where an app could be installed, such as a carrier app responding to a SIM event. This causes the install to see that the user is locked and skip creating the /data/user/ directory. But because reconcilation has already finished, this will never get created until the device is rebooted or the package re-installed. This causes the app to crash when initializing. Instead, by checking the storage key directly, which is guaranteed to be flipped when reconcilation occurs, any apps installed that are not reconciled will also create the right directories. Bug: 187103629 Test: manual, try to install carrier apps during reconcilation Change-Id: If086f5126d508739d1079662776f4951ea339f43
Loading
Please register or sign in to comment