Merge changes I4a907600,If3205033
* changes: Marking used instant apps fields as System API Revert "Revert "Removes EphemrealResolverService and related""
This commit is contained in:
committed by
Android (Google) Code Review
commit
daaa009003
@@ -1,104 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.app;
|
||||
|
||||
import android.annotation.SystemApi;
|
||||
import android.content.pm.EphemeralResolveInfo;
|
||||
import android.content.pm.InstantAppResolveInfo;
|
||||
import android.os.Build;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Base class for implementing the resolver service.
|
||||
* @hide
|
||||
* @removed
|
||||
* @deprecated use InstantAppResolverService instead
|
||||
*/
|
||||
@Deprecated
|
||||
@SystemApi
|
||||
public abstract class EphemeralResolverService extends InstantAppResolverService {
|
||||
private static final boolean DEBUG_EPHEMERAL = Build.IS_DEBUGGABLE;
|
||||
private static final String TAG = "PackageManager";
|
||||
|
||||
/**
|
||||
* Called to retrieve resolve info for ephemeral applications.
|
||||
*
|
||||
* @param digestPrefix The hash prefix of the ephemeral's domain.
|
||||
* @param prefixMask A mask that was applied to each digest prefix. This should
|
||||
* be used when comparing against the digest prefixes as all bits might
|
||||
* not be set.
|
||||
* @deprecated use {@link #onGetEphemeralResolveInfo(int[])} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract List<EphemeralResolveInfo> onEphemeralResolveInfoList(
|
||||
int digestPrefix[], int prefix);
|
||||
|
||||
/**
|
||||
* Called to retrieve resolve info for ephemeral applications.
|
||||
*
|
||||
* @param digestPrefix The hash prefix of the ephemeral's domain.
|
||||
*/
|
||||
public List<EphemeralResolveInfo> onGetEphemeralResolveInfo(int digestPrefix[]) {
|
||||
return onEphemeralResolveInfoList(digestPrefix, 0xFFFFF000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to retrieve intent filters for ephemeral applications.
|
||||
*
|
||||
* @param hostName The name of the host to get intent filters for.
|
||||
*/
|
||||
public EphemeralResolveInfo onGetEphemeralIntentFilter(String hostName) {
|
||||
throw new IllegalStateException("Must define");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Looper getLooper() {
|
||||
return super.getLooper();
|
||||
}
|
||||
|
||||
void _onGetInstantAppResolveInfo(int[] digestPrefix, String token,
|
||||
InstantAppResolutionCallback callback) {
|
||||
if (DEBUG_EPHEMERAL) {
|
||||
Log.d(TAG, "Legacy resolver; getInstantAppResolveInfo;"
|
||||
+ " prefix: " + Arrays.toString(digestPrefix));
|
||||
}
|
||||
final List<EphemeralResolveInfo> response = onGetEphemeralResolveInfo(digestPrefix);
|
||||
final int responseSize = response == null ? 0 : response.size();
|
||||
final List<InstantAppResolveInfo> resultList = new ArrayList<>(responseSize);
|
||||
for (int i = 0; i < responseSize; i++) {
|
||||
resultList.add(response.get(i).getInstantAppResolveInfo());
|
||||
}
|
||||
callback.onInstantAppResolveInfo(resultList);
|
||||
}
|
||||
|
||||
void _onGetInstantAppIntentFilter(int[] digestPrefix, String token,
|
||||
String hostName, InstantAppResolutionCallback callback) {
|
||||
if (DEBUG_EPHEMERAL) {
|
||||
Log.d(TAG, "Legacy resolver; getInstantAppIntentFilter;"
|
||||
+ " prefix: " + Arrays.toString(digestPrefix));
|
||||
}
|
||||
final EphemeralResolveInfo response = onGetEphemeralIntentFilter(hostName);
|
||||
final List<InstantAppResolveInfo> resultList = new ArrayList<>(1);
|
||||
resultList.add(response.getInstantAppResolveInfo());
|
||||
callback.onInstantAppResolveInfo(resultList);
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ import java.util.List;
|
||||
*/
|
||||
@SystemApi
|
||||
public abstract class InstantAppResolverService extends Service {
|
||||
private static final boolean DEBUG_EPHEMERAL = Build.IS_DEBUGGABLE;
|
||||
private static final boolean DEBUG_INSTANT = Build.IS_DEBUGGABLE;
|
||||
private static final String TAG = "PackageManager";
|
||||
|
||||
/** @hide */
|
||||
@@ -133,7 +133,7 @@ public abstract class InstantAppResolverService extends Service {
|
||||
@Override
|
||||
public void getInstantAppResolveInfoList(Intent sanitizedIntent, int[] digestPrefix,
|
||||
String token, int sequence, IRemoteCallback callback) {
|
||||
if (DEBUG_EPHEMERAL) {
|
||||
if (DEBUG_INSTANT) {
|
||||
Slog.v(TAG, "[" + token + "] Phase1 called; posting");
|
||||
}
|
||||
final SomeArgs args = SomeArgs.obtain();
|
||||
@@ -148,7 +148,7 @@ public abstract class InstantAppResolverService extends Service {
|
||||
@Override
|
||||
public void getInstantAppIntentFilterList(Intent sanitizedIntent,
|
||||
int[] digestPrefix, String token, IRemoteCallback callback) {
|
||||
if (DEBUG_EPHEMERAL) {
|
||||
if (DEBUG_INSTANT) {
|
||||
Slog.v(TAG, "[" + token + "] Phase2 called; posting");
|
||||
}
|
||||
final SomeArgs args = SomeArgs.obtain();
|
||||
@@ -203,7 +203,7 @@ public abstract class InstantAppResolverService extends Service {
|
||||
final String token = (String) args.arg3;
|
||||
final Intent intent = (Intent) args.arg4;
|
||||
final int sequence = message.arg1;
|
||||
if (DEBUG_EPHEMERAL) {
|
||||
if (DEBUG_INSTANT) {
|
||||
Slog.d(TAG, "[" + token + "] Phase1 request;"
|
||||
+ " prefix: " + Arrays.toString(digestPrefix));
|
||||
}
|
||||
@@ -217,7 +217,7 @@ public abstract class InstantAppResolverService extends Service {
|
||||
final int[] digestPrefix = (int[]) args.arg2;
|
||||
final String token = (String) args.arg3;
|
||||
final Intent intent = (Intent) args.arg4;
|
||||
if (DEBUG_EPHEMERAL) {
|
||||
if (DEBUG_INSTANT) {
|
||||
Slog.d(TAG, "[" + token + "] Phase2 request;"
|
||||
+ " prefix: " + Arrays.toString(digestPrefix));
|
||||
}
|
||||
|
||||
@@ -1553,16 +1553,6 @@ public class Intent implements Parcelable, Cloneable {
|
||||
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
|
||||
public static final String ACTION_INSTALL_FAILURE = "android.intent.action.INSTALL_FAILURE";
|
||||
|
||||
/**
|
||||
* @hide
|
||||
* @removed
|
||||
* @deprecated Do not use. This will go away.
|
||||
* Replace with {@link #ACTION_INSTALL_INSTANT_APP_PACKAGE}.
|
||||
*/
|
||||
@SystemApi
|
||||
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
|
||||
public static final String ACTION_INSTALL_EPHEMERAL_PACKAGE
|
||||
= "android.intent.action.INSTALL_EPHEMERAL_PACKAGE";
|
||||
/**
|
||||
* Activity Action: Launch instant application installer.
|
||||
* <p class="note">
|
||||
@@ -1576,16 +1566,6 @@ public class Intent implements Parcelable, Cloneable {
|
||||
public static final String ACTION_INSTALL_INSTANT_APP_PACKAGE
|
||||
= "android.intent.action.INSTALL_INSTANT_APP_PACKAGE";
|
||||
|
||||
/**
|
||||
* @hide
|
||||
* @removed
|
||||
* @deprecated Do not use. This will go away.
|
||||
* Replace with {@link #ACTION_RESOLVE_INSTANT_APP_PACKAGE}.
|
||||
*/
|
||||
@SystemApi
|
||||
@SdkConstant(SdkConstantType.SERVICE_ACTION)
|
||||
public static final String ACTION_RESOLVE_EPHEMERAL_PACKAGE
|
||||
= "android.intent.action.RESOLVE_EPHEMERAL_PACKAGE";
|
||||
/**
|
||||
* Service Action: Resolve instant application.
|
||||
* <p>
|
||||
@@ -1600,16 +1580,6 @@ public class Intent implements Parcelable, Cloneable {
|
||||
public static final String ACTION_RESOLVE_INSTANT_APP_PACKAGE
|
||||
= "android.intent.action.RESOLVE_INSTANT_APP_PACKAGE";
|
||||
|
||||
/**
|
||||
* @hide
|
||||
* @removed
|
||||
* @deprecated Do not use. This will go away.
|
||||
* Replace with {@link #ACTION_INSTANT_APP_RESOLVER_SETTINGS}.
|
||||
*/
|
||||
@SystemApi
|
||||
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
|
||||
public static final String ACTION_EPHEMERAL_RESOLVER_SETTINGS
|
||||
= "android.intent.action.EPHEMERAL_RESOLVER_SETTINGS";
|
||||
/**
|
||||
* Activity Action: Launch instant app settings.
|
||||
*
|
||||
@@ -4444,32 +4414,77 @@ public class Intent implements Parcelable, Cloneable {
|
||||
|
||||
/**
|
||||
* A {@link IntentSender} to start after ephemeral installation success.
|
||||
* @deprecated Use {@link #EXTRA_INSTANT_APP_SUCCESS).
|
||||
* @removed
|
||||
* @hide
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String EXTRA_EPHEMERAL_SUCCESS = "android.intent.extra.EPHEMERAL_SUCCESS";
|
||||
|
||||
/**
|
||||
* A {@link IntentSender} to start after ephemeral installation failure.
|
||||
* A {@link IntentSender} to start after instant app installation success.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final String EXTRA_INSTANT_APP_SUCCESS =
|
||||
"android.intent.extra.INSTANT_APP_SUCCESS";
|
||||
|
||||
/**
|
||||
* A {@link IntentSender} to start after ephemeral installation failure.
|
||||
* @deprecated Use {@link #EXTRA_INSTANT_APP_FAILURE).
|
||||
* @removed
|
||||
* @hide
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String EXTRA_EPHEMERAL_FAILURE = "android.intent.extra.EPHEMERAL_FAILURE";
|
||||
|
||||
/**
|
||||
* The host name that triggered an ephemeral resolution.
|
||||
* A {@link IntentSender} to start after instant app installation failure.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final String EXTRA_INSTANT_APP_FAILURE =
|
||||
"android.intent.extra.INSTANT_APP_FAILURE";
|
||||
|
||||
/**
|
||||
* The host name that triggered an ephemeral resolution.
|
||||
* @deprecated Use {@link #EXTRA_INSTANT_APP_HOSTNAME).
|
||||
* @removed
|
||||
* @hide
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String EXTRA_EPHEMERAL_HOSTNAME = "android.intent.extra.EPHEMERAL_HOSTNAME";
|
||||
|
||||
/**
|
||||
* An opaque token to track ephemeral resolution.
|
||||
* The host name that triggered an instant app resolution.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final String EXTRA_INSTANT_APP_HOSTNAME =
|
||||
"android.intent.extra.INSTANT_APP_HOSTNAME";
|
||||
|
||||
/**
|
||||
* An opaque token to track ephemeral resolution.
|
||||
* @deprecated Use {@link #EXTRA_INSTANT_APP_TOKEN).
|
||||
* @removed
|
||||
* @hide
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String EXTRA_EPHEMERAL_TOKEN = "android.intent.extra.EPHEMERAL_TOKEN";
|
||||
|
||||
/**
|
||||
* An opaque token to track instant app resolution.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final String EXTRA_INSTANT_APP_TOKEN =
|
||||
"android.intent.extra.INSTANT_APP_TOKEN";
|
||||
|
||||
/**
|
||||
* The action that triggered an instant application resolution.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final String EXTRA_INSTANT_APP_ACTION = "android.intent.extra.INSTANT_APP_ACTION";
|
||||
|
||||
/**
|
||||
@@ -4487,6 +4502,7 @@ public class Intent implements Parcelable, Cloneable {
|
||||
* instant application resolver.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final String EXTRA_INSTANT_APP_EXTRAS =
|
||||
"android.intent.extra.INSTANT_APP_EXTRAS";
|
||||
|
||||
@@ -4512,12 +4528,14 @@ public class Intent implements Parcelable, Cloneable {
|
||||
* The version code of the app to install components from.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final String EXTRA_LONG_VERSION_CODE = "android.intent.extra.LONG_VERSION_CODE";
|
||||
|
||||
/**
|
||||
* The app that triggered the ephemeral installation.
|
||||
* The app that triggered the instant app installation.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final String EXTRA_CALLING_PACKAGE
|
||||
= "android.intent.extra.CALLING_PACKAGE";
|
||||
|
||||
@@ -4526,6 +4544,7 @@ public class Intent implements Parcelable, Cloneable {
|
||||
* installer may use.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final String EXTRA_VERIFICATION_BUNDLE
|
||||
= "android.intent.extra.VERIFICATION_BUNDLE";
|
||||
|
||||
|
||||
@@ -958,6 +958,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
* Version of the sandbox the application wants to run in.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public int targetSandboxVersion;
|
||||
|
||||
/**
|
||||
@@ -1655,7 +1656,11 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_FORWARD_LOCK) != 0;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
/**
|
||||
* True if the application is installed as an instant app.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public boolean isInstantApp() {
|
||||
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_INSTANT) != 0;
|
||||
}
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.content.pm;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.SystemApi;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Information about an ephemeral application intent filter.
|
||||
* @hide
|
||||
* @removed
|
||||
*/
|
||||
@Deprecated
|
||||
@SystemApi
|
||||
public final class EphemeralIntentFilter implements Parcelable {
|
||||
private final InstantAppIntentFilter mInstantAppIntentFilter;
|
||||
|
||||
public EphemeralIntentFilter(@Nullable String splitName, @NonNull List<IntentFilter> filters) {
|
||||
mInstantAppIntentFilter = new InstantAppIntentFilter(splitName, filters);
|
||||
}
|
||||
|
||||
EphemeralIntentFilter(@NonNull InstantAppIntentFilter intentFilter) {
|
||||
mInstantAppIntentFilter = intentFilter;
|
||||
}
|
||||
|
||||
EphemeralIntentFilter(Parcel in) {
|
||||
mInstantAppIntentFilter = in.readParcelable(null /*loader*/);
|
||||
}
|
||||
|
||||
public String getSplitName() {
|
||||
return mInstantAppIntentFilter.getSplitName();
|
||||
}
|
||||
|
||||
public List<IntentFilter> getFilters() {
|
||||
return mInstantAppIntentFilter.getFilters();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
InstantAppIntentFilter getInstantAppIntentFilter() {
|
||||
return mInstantAppIntentFilter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeParcelable(mInstantAppIntentFilter, flags);
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<EphemeralIntentFilter> CREATOR
|
||||
= new Parcelable.Creator<EphemeralIntentFilter>() {
|
||||
@Override
|
||||
public EphemeralIntentFilter createFromParcel(Parcel in) {
|
||||
return new EphemeralIntentFilter(in);
|
||||
}
|
||||
@Override
|
||||
public EphemeralIntentFilter[] newArray(int size) {
|
||||
return new EphemeralIntentFilter[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,224 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.content.pm;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.SystemApi;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.InstantAppResolveInfo.InstantAppDigest;
|
||||
import android.net.Uri;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Information about an ephemeral application.
|
||||
* @hide
|
||||
* @removed
|
||||
*/
|
||||
@Deprecated
|
||||
@SystemApi
|
||||
public final class EphemeralResolveInfo implements Parcelable {
|
||||
/** Algorithm that will be used to generate the domain digest */
|
||||
public static final String SHA_ALGORITHM = "SHA-256";
|
||||
|
||||
private final InstantAppResolveInfo mInstantAppResolveInfo;
|
||||
@Deprecated
|
||||
private final List<IntentFilter> mLegacyFilters;
|
||||
|
||||
@Deprecated
|
||||
public EphemeralResolveInfo(@NonNull Uri uri, @NonNull String packageName,
|
||||
@NonNull List<IntentFilter> filters) {
|
||||
if (uri == null || packageName == null || filters == null || filters.isEmpty()) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
final List<EphemeralIntentFilter> ephemeralFilters = new ArrayList<>(1);
|
||||
ephemeralFilters.add(new EphemeralIntentFilter(packageName, filters));
|
||||
mInstantAppResolveInfo = new InstantAppResolveInfo(uri.getHost(), packageName,
|
||||
createInstantAppIntentFilterList(ephemeralFilters));
|
||||
mLegacyFilters = new ArrayList<IntentFilter>(filters.size());
|
||||
mLegacyFilters.addAll(filters);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public EphemeralResolveInfo(@NonNull EphemeralDigest digest, @Nullable String packageName,
|
||||
@Nullable List<EphemeralIntentFilter> filters) {
|
||||
this(digest, packageName, filters, -1 /*versionCode*/);
|
||||
}
|
||||
|
||||
public EphemeralResolveInfo(@NonNull EphemeralDigest digest, @Nullable String packageName,
|
||||
@Nullable List<EphemeralIntentFilter> filters, int versionCode) {
|
||||
mInstantAppResolveInfo = new InstantAppResolveInfo(
|
||||
digest.getInstantAppDigest(), packageName,
|
||||
createInstantAppIntentFilterList(filters), versionCode);
|
||||
mLegacyFilters = null;
|
||||
}
|
||||
|
||||
public EphemeralResolveInfo(@NonNull String hostName, @Nullable String packageName,
|
||||
@Nullable List<EphemeralIntentFilter> filters) {
|
||||
this(new EphemeralDigest(hostName), packageName, filters);
|
||||
}
|
||||
|
||||
EphemeralResolveInfo(Parcel in) {
|
||||
mInstantAppResolveInfo = in.readParcelable(null /*loader*/);
|
||||
mLegacyFilters = new ArrayList<IntentFilter>();
|
||||
in.readList(mLegacyFilters, null /*loader*/);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public InstantAppResolveInfo getInstantAppResolveInfo() {
|
||||
return mInstantAppResolveInfo;
|
||||
}
|
||||
|
||||
private static List<InstantAppIntentFilter> createInstantAppIntentFilterList(
|
||||
List<EphemeralIntentFilter> filters) {
|
||||
if (filters == null) {
|
||||
return null;
|
||||
}
|
||||
final int filterCount = filters.size();
|
||||
final List<InstantAppIntentFilter> returnList = new ArrayList<>(filterCount);
|
||||
for (int i = 0; i < filterCount; i++) {
|
||||
returnList.add(filters.get(i).getInstantAppIntentFilter());
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
|
||||
public byte[] getDigestBytes() {
|
||||
return mInstantAppResolveInfo.getDigestBytes();
|
||||
}
|
||||
|
||||
public int getDigestPrefix() {
|
||||
return mInstantAppResolveInfo.getDigestPrefix();
|
||||
}
|
||||
|
||||
public String getPackageName() {
|
||||
return mInstantAppResolveInfo.getPackageName();
|
||||
}
|
||||
|
||||
public List<EphemeralIntentFilter> getIntentFilters() {
|
||||
final List<InstantAppIntentFilter> filters = mInstantAppResolveInfo.getIntentFilters();
|
||||
final int filterCount = filters.size();
|
||||
final List<EphemeralIntentFilter> returnList = new ArrayList<>(filterCount);
|
||||
for (int i = 0; i < filterCount; i++) {
|
||||
returnList.add(new EphemeralIntentFilter(filters.get(i)));
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
|
||||
public int getVersionCode() {
|
||||
return mInstantAppResolveInfo.getVersionCode();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public List<IntentFilter> getFilters() {
|
||||
return mLegacyFilters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeParcelable(mInstantAppResolveInfo, flags);
|
||||
out.writeList(mLegacyFilters);
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<EphemeralResolveInfo> CREATOR
|
||||
= new Parcelable.Creator<EphemeralResolveInfo>() {
|
||||
@Override
|
||||
public EphemeralResolveInfo createFromParcel(Parcel in) {
|
||||
return new EphemeralResolveInfo(in);
|
||||
}
|
||||
@Override
|
||||
public EphemeralResolveInfo[] newArray(int size) {
|
||||
return new EphemeralResolveInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper class to generate and store each of the digests and prefixes
|
||||
* sent to the Ephemeral Resolver.
|
||||
* <p>
|
||||
* Since intent filters may want to handle multiple hosts within a
|
||||
* domain [eg “*.google.com”], the resolver is presented with multiple
|
||||
* hash prefixes. For example, "a.b.c.d.e" generates digests for
|
||||
* "d.e", "c.d.e", "b.c.d.e" and "a.b.c.d.e".
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final class EphemeralDigest implements Parcelable {
|
||||
private final InstantAppDigest mInstantAppDigest;
|
||||
|
||||
public EphemeralDigest(@NonNull String hostName) {
|
||||
this(hostName, -1 /*maxDigests*/);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public EphemeralDigest(@NonNull String hostName, int maxDigests) {
|
||||
mInstantAppDigest = new InstantAppDigest(hostName, maxDigests);
|
||||
}
|
||||
|
||||
EphemeralDigest(Parcel in) {
|
||||
mInstantAppDigest = in.readParcelable(null /*loader*/);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
InstantAppDigest getInstantAppDigest() {
|
||||
return mInstantAppDigest;
|
||||
}
|
||||
|
||||
public byte[][] getDigestBytes() {
|
||||
return mInstantAppDigest.getDigestBytes();
|
||||
}
|
||||
|
||||
public int[] getDigestPrefix() {
|
||||
return mInstantAppDigest.getDigestPrefix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeParcelable(mInstantAppDigest, flags);
|
||||
}
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
public static final Parcelable.Creator<EphemeralDigest> CREATOR =
|
||||
new Parcelable.Creator<EphemeralDigest>() {
|
||||
@Override
|
||||
public EphemeralDigest createFromParcel(Parcel in) {
|
||||
return new EphemeralDigest(in);
|
||||
}
|
||||
@Override
|
||||
public EphemeralDigest[] newArray(int size) {
|
||||
return new EphemeralDigest[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user