Merge "Use startActivityAsCaller instead of startActivity." into rvc-dev am: 1161f28ddb
Change-Id: Idb65dcfa29e475cacb20d0c77784d74b6936a1d4
This commit is contained in:
@@ -163,7 +163,7 @@ public class IntentForwarderActivity extends Activity {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sanitizeIntent(innerIntent);
|
sanitizeIntent(innerIntent);
|
||||||
startActivity(intentReceived);
|
startActivityAsCaller(intentReceived, null, null, false, getUserId());
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,24 +234,8 @@ public class IntentForwarderActivity extends Activity {
|
|||||||
|
|
||||||
Intent intentToCheck = forwardIntent;
|
Intent intentToCheck = forwardIntent;
|
||||||
if (Intent.ACTION_CHOOSER.equals(forwardIntent.getAction())) {
|
if (Intent.ACTION_CHOOSER.equals(forwardIntent.getAction())) {
|
||||||
// The EXTRA_INITIAL_INTENTS may not be allowed to be forwarded.
|
|
||||||
if (forwardIntent.hasExtra(Intent.EXTRA_INITIAL_INTENTS)) {
|
|
||||||
Slog.wtf(TAG, "An chooser intent with extra initial intents cannot be forwarded to"
|
|
||||||
+ " a different user");
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (forwardIntent.hasExtra(Intent.EXTRA_REPLACEMENT_EXTRAS)) {
|
|
||||||
Slog.wtf(TAG, "A chooser intent with replacement extras cannot be forwarded to a"
|
|
||||||
+ " different user");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
intentToCheck = forwardIntent.getParcelableExtra(Intent.EXTRA_INTENT);
|
|
||||||
if (intentToCheck == null) {
|
|
||||||
Slog.wtf(TAG, "Cannot forward a chooser intent with no extra "
|
|
||||||
+ Intent.EXTRA_INTENT);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (forwardIntent.getSelector() != null) {
|
if (forwardIntent.getSelector() != null) {
|
||||||
intentToCheck = forwardIntent.getSelector();
|
intentToCheck = forwardIntent.getSelector();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -647,12 +647,6 @@ public class IntentForwarderActivityTest {
|
|||||||
mUserIdActivityLaunchedIn = userId;
|
mUserIdActivityLaunchedIn = userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void startActivity(Intent intent) {
|
|
||||||
mStartActivityIntent = intent;
|
|
||||||
mUserIdActivityLaunchedIn = getUserId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected MetricsLogger getMetricsLogger() {
|
protected MetricsLogger getMetricsLogger() {
|
||||||
return mMetricsLogger;
|
return mMetricsLogger;
|
||||||
|
|||||||
Reference in New Issue
Block a user