Loading core/java/android/appwidget/AppWidgetHostView.java +0 −4 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.app.Activity; import android.app.ActivityOptions; import android.app.LoadedApk; import android.compat.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; Loading Loading @@ -733,9 +732,6 @@ public class AppWidgetHostView extends FrameLayout implements AppWidgetHost.AppW */ protected Context getRemoteContextEnsuringCorrectCachedApkPath() { try { ApplicationInfo expectedAppInfo = mInfo.providerInfo.applicationInfo; LoadedApk.checkAndUpdateApkPaths(expectedAppInfo); // Return if cloned successfully, otherwise default Context newContext = mContext.createApplicationContext( mInfo.providerInfo.applicationInfo, Context.CONTEXT_RESTRICTED); Loading core/java/android/hardware/biometrics/BiometricPrompt.java +14 −0 Original line number Diff line number Diff line Loading @@ -433,6 +433,20 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan return this; } /** * Set the class name of ConfirmDeviceCredentialActivity. * * @return This builder. * @hide */ @NonNull @RequiresPermission(anyOf = {TEST_BIOMETRIC, USE_BIOMETRIC_INTERNAL}) public Builder setClassNameIfItIsConfirmDeviceCredentialActivity() { mPromptInfo.setClassNameIfItIsConfirmDeviceCredentialActivity( mContext.getClass().getName()); return this; } /** * Creates a {@link BiometricPrompt}. * Loading core/java/android/hardware/biometrics/PromptInfo.java +20 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ public class PromptInfo implements Parcelable { private boolean mAllowBackgroundAuthentication; private boolean mIgnoreEnrollmentState; private boolean mIsForLegacyFingerprintManager = false; private String mClassNameIfItIsConfirmDeviceCredentialActivity = null; public PromptInfo() { Loading @@ -70,6 +71,7 @@ public class PromptInfo implements Parcelable { mAllowBackgroundAuthentication = in.readBoolean(); mIgnoreEnrollmentState = in.readBoolean(); mIsForLegacyFingerprintManager = in.readBoolean(); mClassNameIfItIsConfirmDeviceCredentialActivity = in.readString(); } public static final Creator<PromptInfo> CREATOR = new Creator<PromptInfo>() { Loading Loading @@ -108,6 +110,7 @@ public class PromptInfo implements Parcelable { dest.writeBoolean(mAllowBackgroundAuthentication); dest.writeBoolean(mIgnoreEnrollmentState); dest.writeBoolean(mIsForLegacyFingerprintManager); dest.writeString(mClassNameIfItIsConfirmDeviceCredentialActivity); } public boolean containsTestConfigurations() { Loading @@ -119,6 +122,8 @@ public class PromptInfo implements Parcelable { return true; } else if (mAllowBackgroundAuthentication) { return true; } else if (mClassNameIfItIsConfirmDeviceCredentialActivity != null) { return true; } return false; } Loading Loading @@ -213,6 +218,13 @@ public class PromptInfo implements Parcelable { mAllowedSensorIds.add(sensorId); } /** * Set the class name of ConfirmDeviceCredentialActivity. */ void setClassNameIfItIsConfirmDeviceCredentialActivity(String className) { mClassNameIfItIsConfirmDeviceCredentialActivity = className; } // Getters public CharSequence getTitle() { Loading Loading @@ -290,4 +302,12 @@ public class PromptInfo implements Parcelable { public boolean isForLegacyFingerprintManager() { return mIsForLegacyFingerprintManager; } /** * Get the class name of ConfirmDeviceCredentialActivity. Returns null if the direct caller is * not ConfirmDeviceCredentialActivity. */ public String getClassNameIfItIsConfirmDeviceCredentialActivity() { return mClassNameIfItIsConfirmDeviceCredentialActivity; } } core/java/android/os/BaseBundle.java +7 −2 Original line number Diff line number Diff line Loading @@ -437,12 +437,15 @@ public class BaseBundle { map.erase(); map.ensureCapacity(count); } int[] numLazyValues = new int[]{0}; try { // recycleParcel being false implies that we do not own the parcel. In this case, do // not use lazy values to be safe, as the parcel could be recycled outside of our // control. recycleParcel &= parcelledData.readArrayMap(map, count, !parcelledByNative, /* lazy */ recycleParcel, mClassLoader); parcelledData.readArrayMap(map, count, !parcelledByNative, /* lazy */ recycleParcel, mClassLoader, numLazyValues); } catch (BadParcelableException e) { if (sShouldDefuse) { Log.w(TAG, "Failed to parse Bundle, but defusing quietly", e); Loading @@ -451,6 +454,8 @@ public class BaseBundle { throw e; } } finally { recycleParcel &= (numLazyValues[0] == 0); mMap = map; if (recycleParcel) { recycleParcel(parcelledData); Loading core/java/android/os/Parcel.java +5 −7 Original line number Diff line number Diff line Loading @@ -5265,7 +5265,7 @@ public final class Parcel { private void readArrayMapInternal(@NonNull ArrayMap<? super String, Object> outVal, int size, @Nullable ClassLoader loader) { readArrayMap(outVal, size, /* sorted */ true, /* lazy */ false, loader); readArrayMap(outVal, size, /* sorted */ true, /* lazy */ false, loader, null); } /** Loading @@ -5275,17 +5275,16 @@ public final class Parcel { * @param lazy Whether to populate the map with lazy {@link Supplier} objects for * length-prefixed values. See {@link Parcel#readLazyValue(ClassLoader)} for more * details. * @return whether the parcel can be recycled or not. * @param lazyValueCount number of lazy values added here * @hide */ boolean readArrayMap(ArrayMap<? super String, Object> map, int size, boolean sorted, boolean lazy, @Nullable ClassLoader loader) { boolean recycle = true; void readArrayMap(ArrayMap<? super String, Object> map, int size, boolean sorted, boolean lazy, @Nullable ClassLoader loader, int[] lazyValueCount) { while (size > 0) { String key = readString(); Object value = (lazy) ? readLazyValue(loader) : readValue(loader); if (value instanceof LazyValue) { recycle = false; lazyValueCount[0]++; } if (sorted) { map.append(key, value); Loading @@ -5297,7 +5296,6 @@ public final class Parcel { if (sorted) { map.validate(); } return recycle; } /** Loading Loading
core/java/android/appwidget/AppWidgetHostView.java +0 −4 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.app.Activity; import android.app.ActivityOptions; import android.app.LoadedApk; import android.compat.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; Loading Loading @@ -733,9 +732,6 @@ public class AppWidgetHostView extends FrameLayout implements AppWidgetHost.AppW */ protected Context getRemoteContextEnsuringCorrectCachedApkPath() { try { ApplicationInfo expectedAppInfo = mInfo.providerInfo.applicationInfo; LoadedApk.checkAndUpdateApkPaths(expectedAppInfo); // Return if cloned successfully, otherwise default Context newContext = mContext.createApplicationContext( mInfo.providerInfo.applicationInfo, Context.CONTEXT_RESTRICTED); Loading
core/java/android/hardware/biometrics/BiometricPrompt.java +14 −0 Original line number Diff line number Diff line Loading @@ -433,6 +433,20 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan return this; } /** * Set the class name of ConfirmDeviceCredentialActivity. * * @return This builder. * @hide */ @NonNull @RequiresPermission(anyOf = {TEST_BIOMETRIC, USE_BIOMETRIC_INTERNAL}) public Builder setClassNameIfItIsConfirmDeviceCredentialActivity() { mPromptInfo.setClassNameIfItIsConfirmDeviceCredentialActivity( mContext.getClass().getName()); return this; } /** * Creates a {@link BiometricPrompt}. * Loading
core/java/android/hardware/biometrics/PromptInfo.java +20 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ public class PromptInfo implements Parcelable { private boolean mAllowBackgroundAuthentication; private boolean mIgnoreEnrollmentState; private boolean mIsForLegacyFingerprintManager = false; private String mClassNameIfItIsConfirmDeviceCredentialActivity = null; public PromptInfo() { Loading @@ -70,6 +71,7 @@ public class PromptInfo implements Parcelable { mAllowBackgroundAuthentication = in.readBoolean(); mIgnoreEnrollmentState = in.readBoolean(); mIsForLegacyFingerprintManager = in.readBoolean(); mClassNameIfItIsConfirmDeviceCredentialActivity = in.readString(); } public static final Creator<PromptInfo> CREATOR = new Creator<PromptInfo>() { Loading Loading @@ -108,6 +110,7 @@ public class PromptInfo implements Parcelable { dest.writeBoolean(mAllowBackgroundAuthentication); dest.writeBoolean(mIgnoreEnrollmentState); dest.writeBoolean(mIsForLegacyFingerprintManager); dest.writeString(mClassNameIfItIsConfirmDeviceCredentialActivity); } public boolean containsTestConfigurations() { Loading @@ -119,6 +122,8 @@ public class PromptInfo implements Parcelable { return true; } else if (mAllowBackgroundAuthentication) { return true; } else if (mClassNameIfItIsConfirmDeviceCredentialActivity != null) { return true; } return false; } Loading Loading @@ -213,6 +218,13 @@ public class PromptInfo implements Parcelable { mAllowedSensorIds.add(sensorId); } /** * Set the class name of ConfirmDeviceCredentialActivity. */ void setClassNameIfItIsConfirmDeviceCredentialActivity(String className) { mClassNameIfItIsConfirmDeviceCredentialActivity = className; } // Getters public CharSequence getTitle() { Loading Loading @@ -290,4 +302,12 @@ public class PromptInfo implements Parcelable { public boolean isForLegacyFingerprintManager() { return mIsForLegacyFingerprintManager; } /** * Get the class name of ConfirmDeviceCredentialActivity. Returns null if the direct caller is * not ConfirmDeviceCredentialActivity. */ public String getClassNameIfItIsConfirmDeviceCredentialActivity() { return mClassNameIfItIsConfirmDeviceCredentialActivity; } }
core/java/android/os/BaseBundle.java +7 −2 Original line number Diff line number Diff line Loading @@ -437,12 +437,15 @@ public class BaseBundle { map.erase(); map.ensureCapacity(count); } int[] numLazyValues = new int[]{0}; try { // recycleParcel being false implies that we do not own the parcel. In this case, do // not use lazy values to be safe, as the parcel could be recycled outside of our // control. recycleParcel &= parcelledData.readArrayMap(map, count, !parcelledByNative, /* lazy */ recycleParcel, mClassLoader); parcelledData.readArrayMap(map, count, !parcelledByNative, /* lazy */ recycleParcel, mClassLoader, numLazyValues); } catch (BadParcelableException e) { if (sShouldDefuse) { Log.w(TAG, "Failed to parse Bundle, but defusing quietly", e); Loading @@ -451,6 +454,8 @@ public class BaseBundle { throw e; } } finally { recycleParcel &= (numLazyValues[0] == 0); mMap = map; if (recycleParcel) { recycleParcel(parcelledData); Loading
core/java/android/os/Parcel.java +5 −7 Original line number Diff line number Diff line Loading @@ -5265,7 +5265,7 @@ public final class Parcel { private void readArrayMapInternal(@NonNull ArrayMap<? super String, Object> outVal, int size, @Nullable ClassLoader loader) { readArrayMap(outVal, size, /* sorted */ true, /* lazy */ false, loader); readArrayMap(outVal, size, /* sorted */ true, /* lazy */ false, loader, null); } /** Loading @@ -5275,17 +5275,16 @@ public final class Parcel { * @param lazy Whether to populate the map with lazy {@link Supplier} objects for * length-prefixed values. See {@link Parcel#readLazyValue(ClassLoader)} for more * details. * @return whether the parcel can be recycled or not. * @param lazyValueCount number of lazy values added here * @hide */ boolean readArrayMap(ArrayMap<? super String, Object> map, int size, boolean sorted, boolean lazy, @Nullable ClassLoader loader) { boolean recycle = true; void readArrayMap(ArrayMap<? super String, Object> map, int size, boolean sorted, boolean lazy, @Nullable ClassLoader loader, int[] lazyValueCount) { while (size > 0) { String key = readString(); Object value = (lazy) ? readLazyValue(loader) : readValue(loader); if (value instanceof LazyValue) { recycle = false; lazyValueCount[0]++; } if (sorted) { map.append(key, value); Loading @@ -5297,7 +5296,6 @@ public final class Parcel { if (sorted) { map.validate(); } return recycle; } /** Loading