import android.os.SystemClock;
import android.os.Trace;
import android.os.UserHandle;
+import android.os.storage.StorageManager;
import android.service.voice.IVoiceInteractionSession;
import android.util.EventLog;
import android.util.Log;
/** Checks whether the activity should be shown for current user. */
public boolean okToShowLocked() {
+ // We cannot show activities when the device is locked and the application is not
+ // encryption aware.
+ if (!StorageManager.isUserKeyUnlocked(userId)
+ && !info.applicationInfo.isEncryptionAware()) {
+ return false;
+ }
+
return (info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0
|| (mStackSupervisor.isCurrentProfileLocked(userId)
&& service.mUserController.isUserRunningLocked(userId, 0 /* flags */));
throw new SecurityException("Package " + packageName + " is currently frozen!");
}
- if (!userKeyUnlocked && !(ps.pkg.applicationInfo.isDirectBootAware()
- || ps.pkg.applicationInfo.isPartiallyDirectBootAware())) {
+ if (!userKeyUnlocked && !ps.pkg.applicationInfo.isEncryptionAware()) {
throw new SecurityException("Package " + packageName + " is not encryption aware!");
}
}