Fixes warning:
ContextImpl: Calling a method in the system process without a
qualified user
Change-Id: I9352fc85adfacebcf535dfc2b5328dd07476cdb6
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.PowerManager;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.PowerManager;
+import android.os.UserHandle;
import android.os.VibrationEffect;
import android.os.Vibrator;
import android.provider.MediaStore;
import android.os.VibrationEffect;
import android.os.Vibrator;
import android.provider.MediaStore;
Intent intent = createIntent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
if (getBestActivityInfo(intent) != null) {
// Only launch if we can succeed, but let the user pick the action
Intent intent = createIntent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
if (getBestActivityInfo(intent) != null) {
// Only launch if we can succeed, but let the user pick the action
- mContext.startActivity(intent);
+ mContext.startActivityAsUser(intent, UserHandle.CURRENT);
ActivityInfo secureActivity = getBestActivityInfo(secureIntent, normalActivity);
if (secureActivity != null) {
secureIntent.setComponent(componentName(secureActivity));
ActivityInfo secureActivity = getBestActivityInfo(secureIntent, normalActivity);
if (secureActivity != null) {
secureIntent.setComponent(componentName(secureActivity));
- mContext.startActivity(secureIntent);
+ mContext.startActivityAsUser(secureIntent, UserHandle.CURRENT);