Launch ephemeral intent

In MR1, the ephemeral application was launched via the supervisor.
In O, the ephemeral application is installed on the system as a
proper application and runs natively.

Bug: 30204367
Test: build & install the framework and run 'adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "https://www.tripadvisor.com/Tourism-g33020-San_Jose_California-Vacations.html"'
Change-Id: Iea496862aeb72c6bfde439620950ba951d859cc7
This commit is contained in:
Todd Kennedy
2016-11-22 10:07:21 -08:00
parent e4e166790b
commit 078f538eb2

View File

@@ -46,10 +46,6 @@ import java.util.UUID;
/** @hide */
public abstract class EphemeralResolver {
/** TODO b/30204367 remove when the platform fully supports ephemeral applications */
public static final boolean USE_DEFAULT_EPHEMERAL_LAUNCHER = false;
public static EphemeralResponse doEphemeralResolutionPhaseOne(Context context,
EphemeralResolverConnection connection, EphemeralRequest requestObj) {
final Intent intent = requestObj.origIntent;
@@ -162,16 +158,10 @@ public abstract class EphemeralResolver {
new IntentSender(failureIntentTarget));
} catch (RemoteException ignore) { /* ignore; same process */ }
final Intent ephemeralIntent;
if (EphemeralResolver.USE_DEFAULT_EPHEMERAL_LAUNCHER) {
// Force the intent to be directed to the ephemeral package
ephemeralIntent = new Intent(origIntent);
ephemeralIntent.setPackage(ephemeralPackageName);
} else {
// Success intent goes back to the installer
ephemeralIntent = new Intent(launchIntent);
}
// Success intent goes back to the installer
final Intent ephemeralIntent = new Intent(launchIntent)
.setComponent(null)
.setPackage(ephemeralPackageName);
// Intent that is eventually launched if the ephemeral package was
// installed successfully. This will actually be launched by a platform
// broadcast receiver.