Merge "expose the instant app installer component" into oc-dev

This commit is contained in:
TreeHugger Robot
2017-04-17 14:17:20 +00:00
committed by Android (Google) Code Review
7 changed files with 43 additions and 1 deletions

View File

@ -11274,6 +11274,7 @@ package android.content.pm {
method public abstract byte[] getInstantAppCookie();
method public abstract int getInstantAppCookieMaxSize();
method public abstract android.graphics.drawable.Drawable getInstantAppIcon(java.lang.String);
method public abstract android.content.ComponentName getInstantAppInstallerComponent();
method public abstract android.content.ComponentName getInstantAppResolverSettingsComponent();
method public abstract java.util.List<android.content.pm.InstantAppInfo> getInstantApps();
method public abstract android.content.pm.InstrumentationInfo getInstrumentationInfo(android.content.ComponentName, int) throws android.content.pm.PackageManager.NameNotFoundException;
@ -44574,6 +44575,7 @@ package android.test.mock {
method public byte[] getInstantAppCookie();
method public int getInstantAppCookieMaxSize();
method public android.graphics.drawable.Drawable getInstantAppIcon(java.lang.String);
method public android.content.ComponentName getInstantAppInstallerComponent();
method public android.content.ComponentName getInstantAppResolverSettingsComponent();
method public java.util.List<android.content.pm.InstantAppInfo> getInstantApps();
method public android.content.pm.InstrumentationInfo getInstrumentationInfo(android.content.ComponentName, int) throws android.content.pm.PackageManager.NameNotFoundException;

View File

@ -2639,4 +2639,13 @@ public class ApplicationPackageManager extends PackageManager {
throw e.rethrowAsRuntimeException();
}
}
@Override
public ComponentName getInstantAppInstallerComponent() {
try {
return mPM.getInstantAppInstallerComponent();
} catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
}
}
}

View File

@ -632,4 +632,6 @@ interface IPackageManager {
void deletePreloadsFileCache();
ComponentName getInstantAppResolverSettingsComponent();
ComponentName getInstantAppInstallerComponent();
}

View File

@ -6275,9 +6275,19 @@ public abstract class PackageManager {
* Return the {@link ComponentName} of the activity providing Settings for the Instant App
* resolver.
*
* @see {@link android.content.intent#ACTION_INSTANT_APP_RESOLVER_SETTINGS}
* @see {@link android.content.Intent#ACTION_INSTANT_APP_RESOLVER_SETTINGS}
* @hide
*/
@SystemApi
public abstract ComponentName getInstantAppResolverSettingsComponent();
/**
* Return the {@link ComponentName} of the activity responsible for installing instant
* applications.
*
* @see {@link android.content.Intent#ACTION_INSTALL_INSTANT_APP_PACKAGE}
* @hide
*/
@SystemApi
public abstract ComponentName getInstantAppInstallerComponent();
}

View File

@ -23636,4 +23636,10 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName());
public ComponentName getInstantAppResolverSettingsComponent() {
return mInstantAppResolverSettingsComponent;
}
@Override
public ComponentName getInstantAppInstallerComponent() {
return mInstantAppInstallerActivity == null
? null : mInstantAppInstallerActivity.getComponentName();
}
}

View File

@ -1126,4 +1126,12 @@ public class MockPackageManager extends PackageManager {
public ComponentName getInstantAppResolverSettingsComponent() {
throw new UnsupportedOperationException();
}
/**
* @hide
*/
@Override
public ComponentName getInstantAppInstallerComponent() {
throw new UnsupportedOperationException();
}
}

View File

@ -923,4 +923,9 @@ public class BridgePackageManager extends PackageManager {
public ComponentName getInstantAppResolverSettingsComponent() {
return null;
}
@Override
public ComponentName getInstantAppInstallerComponent() {
return null;
}
}