Loading Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -281,6 +281,7 @@ LOCAL_SRC_FILES += \ core/java/com/android/internal/app/IAppOpsService.aidl \ core/java/com/android/internal/app/IAssistScreenshotReceiver.aidl \ core/java/com/android/internal/app/IBatteryStats.aidl \ core/java/com/android/internal/app/IEphemeralResolver.aidl \ core/java/com/android/internal/app/IProcessStats.aidl \ core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl \ core/java/com/android/internal/app/IVoiceInteractionSessionShowCallback.aidl \ Loading api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -8522,6 +8522,7 @@ package android.content { field public static final java.lang.String ACTION_INPUT_METHOD_CHANGED = "android.intent.action.INPUT_METHOD_CHANGED"; field public static final java.lang.String ACTION_INSERT = "android.intent.action.INSERT"; field public static final java.lang.String ACTION_INSERT_OR_EDIT = "android.intent.action.INSERT_OR_EDIT"; field public static final java.lang.String ACTION_INSTALL_EPHEMERAL_PACKAGE = "android.intent.action.INSTALL_EPHEMERAL_PACKAGE"; field public static final java.lang.String ACTION_INSTALL_PACKAGE = "android.intent.action.INSTALL_PACKAGE"; field public static final java.lang.String ACTION_INTENT_FILTER_NEEDS_VERIFICATION = "android.intent.action.INTENT_FILTER_NEEDS_VERIFICATION"; field public static final java.lang.String ACTION_LOCALE_CHANGED = "android.intent.action.LOCALE_CHANGED"; Loading Loading @@ -8569,6 +8570,7 @@ package android.content { field public static final java.lang.String ACTION_QUERY_PACKAGE_RESTART = "android.intent.action.QUERY_PACKAGE_RESTART"; field public static final java.lang.String ACTION_QUICK_CLOCK = "android.intent.action.QUICK_CLOCK"; field public static final java.lang.String ACTION_REBOOT = "android.intent.action.REBOOT"; field public static final java.lang.String ACTION_RESOLVE_EPHEMERAL_PACKAGE = "android.intent.action.RESOLVE_EPHEMERAL_PACKAGE"; field public static final java.lang.String ACTION_RUN = "android.intent.action.RUN"; field public static final java.lang.String ACTION_SCREEN_OFF = "android.intent.action.SCREEN_OFF"; field public static final java.lang.String ACTION_SCREEN_ON = "android.intent.action.SCREEN_ON"; core/java/android/content/Intent.java +30 −0 Original line number Diff line number Diff line Loading @@ -1425,6 +1425,36 @@ public class Intent implements Parcelable, Cloneable { @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_INSTALL_PACKAGE = "android.intent.action.INSTALL_PACKAGE"; /** * Activity Action: Launch ephemeral installer. * <p> * Input: The data must be a http: URI that the ephemeral application is registered * to handle. * <p class="note"> * This is a protected intent that can only be sent by the system. * </p> * * @hide */ @SystemApi @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_INSTALL_EPHEMERAL_PACKAGE = "android.intent.action.INSTALL_EPHEMERAL_PACKAGE"; /** * Service Action: Resolve ephemeral application. * <p> * The system will have a persistent connection to this service. * This is a protected intent that can only be sent by the system. * </p> * * @hide */ @SystemApi @SdkConstant(SdkConstantType.SERVICE_ACTION) public static final String ACTION_RESOLVE_EPHEMERAL_PACKAGE = "android.intent.action.RESOLVE_EPHEMERAL_PACKAGE"; /** * Used as a string extra field with {@link #ACTION_INSTALL_PACKAGE} to install a * package. Specifies the installer package name; this package will receive the Loading core/java/com/android/internal/app/EphemeralResolveInfo.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /* ** Copyright 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 com.android.internal.app; parcelable EphemeralResolveInfo; core/java/com/android/internal/app/EphemeralResolveInfo.java 0 → 100644 +113 −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 com.android.internal.app; import android.content.IntentFilter; 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; /** * Information that is returned when resolving ephemeral * applications. */ public final class EphemeralResolveInfo implements Parcelable { public static final String SHA_ALGORITHM = "SHA-256"; private byte[] mDigestBytes; private int mDigestPrefix; private final List<IntentFilter> mFilters = new ArrayList<IntentFilter>(); public EphemeralResolveInfo(Uri uri, List<IntentFilter> filters) { generateDigest(uri); mFilters.addAll(filters); } private EphemeralResolveInfo(Parcel in) { readFromParcel(in); } public byte[] getDigestBytes() { return mDigestBytes; } public int getDigestPrefix() { return mDigestPrefix; } public List<IntentFilter> getFilters() { return mFilters; } private void generateDigest(Uri uri) { try { final MessageDigest digest = MessageDigest.getInstance(SHA_ALGORITHM); final byte[] hostBytes = uri.getHost().getBytes(); final byte[] digestBytes = digest.digest(hostBytes); mDigestBytes = digestBytes; mDigestPrefix = digestBytes[0] << 24 | digestBytes[1] << 16 | digestBytes[2] << 8 | digestBytes[3] << 0; } catch (NoSuchAlgorithmException e) { throw new IllegalStateException("could not find digest algorithm"); } } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel out, int flags) { if (mDigestBytes == null) { out.writeInt(0); } else { out.writeInt(mDigestBytes.length); out.writeByteArray(mDigestBytes); } out.writeInt(mDigestPrefix); out.writeList(mFilters); } private void readFromParcel(Parcel in) { int digestBytesSize = in.readInt(); if (digestBytesSize > 0) { mDigestBytes = new byte[digestBytesSize]; in.readByteArray(mDigestBytes); } mDigestPrefix = in.readInt(); in.readList(mFilters, null /*loader*/); } public static final Parcelable.Creator<EphemeralResolveInfo> CREATOR = new Parcelable.Creator<EphemeralResolveInfo>() { public EphemeralResolveInfo createFromParcel(Parcel in) { return new EphemeralResolveInfo(in); } public EphemeralResolveInfo[] newArray(int size) { return new EphemeralResolveInfo[size]; } }; } Loading
Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -281,6 +281,7 @@ LOCAL_SRC_FILES += \ core/java/com/android/internal/app/IAppOpsService.aidl \ core/java/com/android/internal/app/IAssistScreenshotReceiver.aidl \ core/java/com/android/internal/app/IBatteryStats.aidl \ core/java/com/android/internal/app/IEphemeralResolver.aidl \ core/java/com/android/internal/app/IProcessStats.aidl \ core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl \ core/java/com/android/internal/app/IVoiceInteractionSessionShowCallback.aidl \ Loading
api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -8522,6 +8522,7 @@ package android.content { field public static final java.lang.String ACTION_INPUT_METHOD_CHANGED = "android.intent.action.INPUT_METHOD_CHANGED"; field public static final java.lang.String ACTION_INSERT = "android.intent.action.INSERT"; field public static final java.lang.String ACTION_INSERT_OR_EDIT = "android.intent.action.INSERT_OR_EDIT"; field public static final java.lang.String ACTION_INSTALL_EPHEMERAL_PACKAGE = "android.intent.action.INSTALL_EPHEMERAL_PACKAGE"; field public static final java.lang.String ACTION_INSTALL_PACKAGE = "android.intent.action.INSTALL_PACKAGE"; field public static final java.lang.String ACTION_INTENT_FILTER_NEEDS_VERIFICATION = "android.intent.action.INTENT_FILTER_NEEDS_VERIFICATION"; field public static final java.lang.String ACTION_LOCALE_CHANGED = "android.intent.action.LOCALE_CHANGED"; Loading Loading @@ -8569,6 +8570,7 @@ package android.content { field public static final java.lang.String ACTION_QUERY_PACKAGE_RESTART = "android.intent.action.QUERY_PACKAGE_RESTART"; field public static final java.lang.String ACTION_QUICK_CLOCK = "android.intent.action.QUICK_CLOCK"; field public static final java.lang.String ACTION_REBOOT = "android.intent.action.REBOOT"; field public static final java.lang.String ACTION_RESOLVE_EPHEMERAL_PACKAGE = "android.intent.action.RESOLVE_EPHEMERAL_PACKAGE"; field public static final java.lang.String ACTION_RUN = "android.intent.action.RUN"; field public static final java.lang.String ACTION_SCREEN_OFF = "android.intent.action.SCREEN_OFF"; field public static final java.lang.String ACTION_SCREEN_ON = "android.intent.action.SCREEN_ON";
core/java/android/content/Intent.java +30 −0 Original line number Diff line number Diff line Loading @@ -1425,6 +1425,36 @@ public class Intent implements Parcelable, Cloneable { @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_INSTALL_PACKAGE = "android.intent.action.INSTALL_PACKAGE"; /** * Activity Action: Launch ephemeral installer. * <p> * Input: The data must be a http: URI that the ephemeral application is registered * to handle. * <p class="note"> * This is a protected intent that can only be sent by the system. * </p> * * @hide */ @SystemApi @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_INSTALL_EPHEMERAL_PACKAGE = "android.intent.action.INSTALL_EPHEMERAL_PACKAGE"; /** * Service Action: Resolve ephemeral application. * <p> * The system will have a persistent connection to this service. * This is a protected intent that can only be sent by the system. * </p> * * @hide */ @SystemApi @SdkConstant(SdkConstantType.SERVICE_ACTION) public static final String ACTION_RESOLVE_EPHEMERAL_PACKAGE = "android.intent.action.RESOLVE_EPHEMERAL_PACKAGE"; /** * Used as a string extra field with {@link #ACTION_INSTALL_PACKAGE} to install a * package. Specifies the installer package name; this package will receive the Loading
core/java/com/android/internal/app/EphemeralResolveInfo.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /* ** Copyright 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 com.android.internal.app; parcelable EphemeralResolveInfo;
core/java/com/android/internal/app/EphemeralResolveInfo.java 0 → 100644 +113 −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 com.android.internal.app; import android.content.IntentFilter; 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; /** * Information that is returned when resolving ephemeral * applications. */ public final class EphemeralResolveInfo implements Parcelable { public static final String SHA_ALGORITHM = "SHA-256"; private byte[] mDigestBytes; private int mDigestPrefix; private final List<IntentFilter> mFilters = new ArrayList<IntentFilter>(); public EphemeralResolveInfo(Uri uri, List<IntentFilter> filters) { generateDigest(uri); mFilters.addAll(filters); } private EphemeralResolveInfo(Parcel in) { readFromParcel(in); } public byte[] getDigestBytes() { return mDigestBytes; } public int getDigestPrefix() { return mDigestPrefix; } public List<IntentFilter> getFilters() { return mFilters; } private void generateDigest(Uri uri) { try { final MessageDigest digest = MessageDigest.getInstance(SHA_ALGORITHM); final byte[] hostBytes = uri.getHost().getBytes(); final byte[] digestBytes = digest.digest(hostBytes); mDigestBytes = digestBytes; mDigestPrefix = digestBytes[0] << 24 | digestBytes[1] << 16 | digestBytes[2] << 8 | digestBytes[3] << 0; } catch (NoSuchAlgorithmException e) { throw new IllegalStateException("could not find digest algorithm"); } } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel out, int flags) { if (mDigestBytes == null) { out.writeInt(0); } else { out.writeInt(mDigestBytes.length); out.writeByteArray(mDigestBytes); } out.writeInt(mDigestPrefix); out.writeList(mFilters); } private void readFromParcel(Parcel in) { int digestBytesSize = in.readInt(); if (digestBytesSize > 0) { mDigestBytes = new byte[digestBytesSize]; in.readByteArray(mDigestBytes); } mDigestPrefix = in.readInt(); in.readList(mFilters, null /*loader*/); } public static final Parcelable.Creator<EphemeralResolveInfo> CREATOR = new Parcelable.Creator<EphemeralResolveInfo>() { public EphemeralResolveInfo createFromParcel(Parcel in) { return new EphemeralResolveInfo(in); } public EphemeralResolveInfo[] newArray(int size) { return new EphemeralResolveInfo[size]; } }; }