Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e0c9196 authored by Patrick Baumann's avatar Patrick Baumann
Browse files

Revert "Removes EphemrealResolverService and related"

This reverts commit 5564f880.

Reason for revert: Resolve merge conflict for another revert (ag/3537193)
Bug: 72710855
Change-Id: Id7c3a3993a45c588ee4668d7486d67d764541b1e
parent 5564f880
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -11608,15 +11608,15 @@ package android.content.res {
  public final class AssetManager implements java.lang.AutoCloseable {
    method public void close();
    method public final java.lang.String[] getLocales();
    method public final java.lang.String[] list(java.lang.String) throws java.io.IOException;
    method public final java.io.InputStream open(java.lang.String) throws java.io.IOException;
    method public final java.io.InputStream open(java.lang.String, int) throws java.io.IOException;
    method public final android.content.res.AssetFileDescriptor openFd(java.lang.String) throws java.io.IOException;
    method public final android.content.res.AssetFileDescriptor openNonAssetFd(java.lang.String) throws java.io.IOException;
    method public final android.content.res.AssetFileDescriptor openNonAssetFd(int, java.lang.String) throws java.io.IOException;
    method public final android.content.res.XmlResourceParser openXmlResourceParser(java.lang.String) throws java.io.IOException;
    method public final android.content.res.XmlResourceParser openXmlResourceParser(int, java.lang.String) throws java.io.IOException;
    method public java.lang.String[] getLocales();
    method public java.lang.String[] list(java.lang.String) throws java.io.IOException;
    method public java.io.InputStream open(java.lang.String) throws java.io.IOException;
    method public java.io.InputStream open(java.lang.String, int) throws java.io.IOException;
    method public android.content.res.AssetFileDescriptor openFd(java.lang.String) throws java.io.IOException;
    method public android.content.res.AssetFileDescriptor openNonAssetFd(java.lang.String) throws java.io.IOException;
    method public android.content.res.AssetFileDescriptor openNonAssetFd(int, java.lang.String) throws java.io.IOException;
    method public android.content.res.XmlResourceParser openXmlResourceParser(java.lang.String) throws java.io.IOException;
    method public android.content.res.XmlResourceParser openXmlResourceParser(int, java.lang.String) throws java.io.IOException;
    field public static final int ACCESS_BUFFER = 3; // 0x3
    field public static final int ACCESS_RANDOM = 1; // 0x1
    field public static final int ACCESS_STREAMING = 2; // 0x2
+50 −0
Original line number Diff line number Diff line
package android.app {

  public abstract deprecated class EphemeralResolverService extends android.app.InstantAppResolverService {
    ctor public EphemeralResolverService();
    method public android.os.Looper getLooper();
    method public abstract deprecated java.util.List<android.content.pm.EphemeralResolveInfo> onEphemeralResolveInfoList(int[], int);
    method public android.content.pm.EphemeralResolveInfo onGetEphemeralIntentFilter(java.lang.String);
    method public java.util.List<android.content.pm.EphemeralResolveInfo> onGetEphemeralResolveInfo(int[]);
  }

  public class Notification implements android.os.Parcelable {
    method public static java.lang.Class<? extends android.app.Notification.Style> getNotificationStyleClass(java.lang.String);
  }
@@ -23,7 +31,10 @@ package android.content {

  public class Intent implements java.lang.Cloneable android.os.Parcelable {
    field public static final deprecated java.lang.String ACTION_DEVICE_INITIALIZATION_WIZARD = "android.intent.action.DEVICE_INITIALIZATION_WIZARD";
    field public static final deprecated java.lang.String ACTION_EPHEMERAL_RESOLVER_SETTINGS = "android.intent.action.EPHEMERAL_RESOLVER_SETTINGS";
    field public static final deprecated java.lang.String ACTION_INSTALL_EPHEMERAL_PACKAGE = "android.intent.action.INSTALL_EPHEMERAL_PACKAGE";
    field public static final deprecated java.lang.String ACTION_MASTER_CLEAR = "android.intent.action.MASTER_CLEAR";
    field public static final deprecated java.lang.String ACTION_RESOLVE_EPHEMERAL_PACKAGE = "android.intent.action.RESOLVE_EPHEMERAL_PACKAGE";
    field public static final deprecated java.lang.String ACTION_SERVICE_STATE = "android.intent.action.SERVICE_STATE";
    field public static final deprecated java.lang.String EXTRA_CDMA_DEFAULT_ROAMING_INDICATOR = "cdmaDefaultRoamingIndicator";
    field public static final deprecated java.lang.String EXTRA_CDMA_ROAMING_INDICATOR = "cdmaRoamingIndicator";
@@ -51,6 +62,45 @@ package android.content {

}

package android.content.pm {

  public final deprecated class EphemeralIntentFilter implements android.os.Parcelable {
    ctor public EphemeralIntentFilter(java.lang.String, java.util.List<android.content.IntentFilter>);
    method public int describeContents();
    method public java.util.List<android.content.IntentFilter> getFilters();
    method public java.lang.String getSplitName();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.EphemeralIntentFilter> CREATOR;
  }

  public final deprecated class EphemeralResolveInfo implements android.os.Parcelable {
    ctor public deprecated EphemeralResolveInfo(android.net.Uri, java.lang.String, java.util.List<android.content.IntentFilter>);
    ctor public deprecated EphemeralResolveInfo(android.content.pm.EphemeralResolveInfo.EphemeralDigest, java.lang.String, java.util.List<android.content.pm.EphemeralIntentFilter>);
    ctor public EphemeralResolveInfo(android.content.pm.EphemeralResolveInfo.EphemeralDigest, java.lang.String, java.util.List<android.content.pm.EphemeralIntentFilter>, int);
    ctor public EphemeralResolveInfo(java.lang.String, java.lang.String, java.util.List<android.content.pm.EphemeralIntentFilter>);
    method public int describeContents();
    method public byte[] getDigestBytes();
    method public int getDigestPrefix();
    method public deprecated java.util.List<android.content.IntentFilter> getFilters();
    method public java.util.List<android.content.pm.EphemeralIntentFilter> getIntentFilters();
    method public java.lang.String getPackageName();
    method public int getVersionCode();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.EphemeralResolveInfo> CREATOR;
    field public static final java.lang.String SHA_ALGORITHM = "SHA-256";
  }

  public static final class EphemeralResolveInfo.EphemeralDigest implements android.os.Parcelable {
    ctor public EphemeralResolveInfo.EphemeralDigest(java.lang.String);
    method public int describeContents();
    method public byte[][] getDigestBytes();
    method public int[] getDigestPrefix();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.EphemeralResolveInfo.EphemeralDigest> CREATOR;
  }

}

package android.media.tv {

  public final class TvInputManager {
+104 −0
Original line number Diff line number Diff line
/*
 * 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);
    }
}
+5 −5
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ import java.util.List;
 */
@SystemApi
public abstract class InstantAppResolverService extends Service {
    private static final boolean DEBUG_INSTANT = Build.IS_DEBUGGABLE;
    private static final boolean DEBUG_EPHEMERAL = 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_INSTANT) {
                if (DEBUG_EPHEMERAL) {
                    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_INSTANT) {
                if (DEBUG_EPHEMERAL) {
                    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_INSTANT) {
                    if (DEBUG_EPHEMERAL) {
                        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_INSTANT) {
                    if (DEBUG_EPHEMERAL) {
                        Slog.d(TAG, "[" + token + "] Phase2 request;"
                                + " prefix: " + Arrays.toString(digestPrefix));
                    }
+30 −0
Original line number Diff line number Diff line
@@ -1553,6 +1553,16 @@ 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">
@@ -1566,6 +1576,16 @@ 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>
@@ -1580,6 +1600,16 @@ 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.
     *
Loading