Loading core/java/com/android/internal/app/IntentForwarderActivity.java +10 −3 Original line number Diff line number Diff line Loading @@ -85,8 +85,10 @@ public class IntentForwarderActivity extends Activity { int callingUserId = getUserId(); if (canForward(newIntent, targetUserId)) { if (newIntent.getAction().equals(Intent.ACTION_CHOOSER)) { if (Intent.ACTION_CHOOSER.equals(newIntent.getAction())) { Intent innerIntent = (Intent) newIntent.getParcelableExtra(Intent.EXTRA_INTENT); // At this point, innerIntent is not null. Otherwise, canForward would have returned // false. innerIntent.prepareToLeaveUser(callingUserId); } else { newIntent.prepareToLeaveUser(callingUserId); Loading Loading @@ -132,7 +134,7 @@ public class IntentForwarderActivity extends Activity { boolean canForward(Intent intent, int targetUserId) { IPackageManager ipm = AppGlobals.getPackageManager(); if (intent.getAction().equals(Intent.ACTION_CHOOSER)) { if (Intent.ACTION_CHOOSER.equals(intent.getAction())) { // The EXTRA_INITIAL_INTENTS may not be allowed to be forwarded. if (intent.hasExtra(Intent.EXTRA_INITIAL_INTENTS)) { Slog.wtf(TAG, "An chooser intent with extra initial intents cannot be forwarded to" Loading @@ -145,6 +147,11 @@ public class IntentForwarderActivity extends Activity { return false; } intent = (Intent) intent.getParcelableExtra(Intent.EXTRA_INTENT); if (intent == null) { Slog.wtf(TAG, "Cannot forward a chooser intent with no extra " + Intent.EXTRA_INTENT); return false; } } String resolvedType = intent.resolveTypeIfNeeded(getContentResolver()); if (intent.getSelector() != null) { Loading Loading
core/java/com/android/internal/app/IntentForwarderActivity.java +10 −3 Original line number Diff line number Diff line Loading @@ -85,8 +85,10 @@ public class IntentForwarderActivity extends Activity { int callingUserId = getUserId(); if (canForward(newIntent, targetUserId)) { if (newIntent.getAction().equals(Intent.ACTION_CHOOSER)) { if (Intent.ACTION_CHOOSER.equals(newIntent.getAction())) { Intent innerIntent = (Intent) newIntent.getParcelableExtra(Intent.EXTRA_INTENT); // At this point, innerIntent is not null. Otherwise, canForward would have returned // false. innerIntent.prepareToLeaveUser(callingUserId); } else { newIntent.prepareToLeaveUser(callingUserId); Loading Loading @@ -132,7 +134,7 @@ public class IntentForwarderActivity extends Activity { boolean canForward(Intent intent, int targetUserId) { IPackageManager ipm = AppGlobals.getPackageManager(); if (intent.getAction().equals(Intent.ACTION_CHOOSER)) { if (Intent.ACTION_CHOOSER.equals(intent.getAction())) { // The EXTRA_INITIAL_INTENTS may not be allowed to be forwarded. if (intent.hasExtra(Intent.EXTRA_INITIAL_INTENTS)) { Slog.wtf(TAG, "An chooser intent with extra initial intents cannot be forwarded to" Loading @@ -145,6 +147,11 @@ public class IntentForwarderActivity extends Activity { return false; } intent = (Intent) intent.getParcelableExtra(Intent.EXTRA_INTENT); if (intent == null) { Slog.wtf(TAG, "Cannot forward a chooser intent with no extra " + Intent.EXTRA_INTENT); return false; } } String resolvedType = intent.resolveTypeIfNeeded(getContentResolver()); if (intent.getSelector() != null) { Loading