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

Commit d7128492 authored by /e/ robot's avatar /e/ robot
Browse files

Merge remote-tracking branch 'origin/lineage-21.0' into a14

parents 521b7db7 9caa8e70
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -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;
@@ -749,9 +748,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);
+14 −0
Original line number Diff line number Diff line
@@ -591,6 +591,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}.
         *
+20 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ public class PromptInfo implements Parcelable {
    private boolean mIsForLegacyFingerprintManager = false;
    private boolean mShowEmergencyCallButton = false;
    private boolean mUseParentProfileForDeviceCredential = false;
    private String mClassNameIfItIsConfirmDeviceCredentialActivity = null;

    public PromptInfo() {

@@ -87,6 +88,7 @@ public class PromptInfo implements Parcelable {
        mIsForLegacyFingerprintManager = in.readBoolean();
        mShowEmergencyCallButton = in.readBoolean();
        mUseParentProfileForDeviceCredential = in.readBoolean();
        mClassNameIfItIsConfirmDeviceCredentialActivity = in.readString();
    }

    public static final Creator<PromptInfo> CREATOR = new Creator<PromptInfo>() {
@@ -132,6 +134,7 @@ public class PromptInfo implements Parcelable {
        dest.writeBoolean(mIsForLegacyFingerprintManager);
        dest.writeBoolean(mShowEmergencyCallButton);
        dest.writeBoolean(mUseParentProfileForDeviceCredential);
        dest.writeString(mClassNameIfItIsConfirmDeviceCredentialActivity);
    }

    // LINT.IfChange
@@ -148,6 +151,8 @@ public class PromptInfo implements Parcelable {
            return true;
        } else if (mIgnoreEnrollmentState) {
            return true;
        } else if (mClassNameIfItIsConfirmDeviceCredentialActivity != null) {
            return true;
        }
        return false;
    }
@@ -296,6 +301,13 @@ public class PromptInfo implements Parcelable {
        mUseParentProfileForDeviceCredential = useParentProfileForDeviceCredential;
    }

    /**
     * Set the class name of ConfirmDeviceCredentialActivity.
     */
    void setClassNameIfItIsConfirmDeviceCredentialActivity(String className) {
        mClassNameIfItIsConfirmDeviceCredentialActivity = className;
    }

    // Getters
    @DrawableRes
    public int getLogoRes() {
@@ -409,4 +421,12 @@ public class PromptInfo implements Parcelable {
                    "Exclusively one of logo resource or logo bitmap can be set");
        }
    }

    /**
     * Get the class name of ConfirmDeviceCredentialActivity. Returns null if the direct caller is
     * not ConfirmDeviceCredentialActivity.
     */
    public String getClassNameIfItIsConfirmDeviceCredentialActivity() {
        return mClassNameIfItIsConfirmDeviceCredentialActivity;
    }
}
+5 −5
Original line number Diff line number Diff line
@@ -472,10 +472,10 @@ public class BaseBundle {
            map.erase();
            map.ensureCapacity(count);
        }
        int numLazyValues = 0;
        int[] numLazyValues = new int[]{0};
        try {
            numLazyValues = parcelledData.readArrayMap(map, count, !parcelledByNative,
                    /* lazy */ ownsParcel, mClassLoader);
            parcelledData.readArrayMap(map, count, !parcelledByNative,
                    /* lazy */ ownsParcel, mClassLoader, numLazyValues);
        } catch (BadParcelableException e) {
            if (sShouldDefuse) {
                Log.w(TAG, "Failed to parse Bundle, but defusing quietly", e);
@@ -486,14 +486,14 @@ public class BaseBundle {
        } finally {
            mWeakParcelledData = null;
            if (ownsParcel) {
                if (numLazyValues == 0) {
                if (numLazyValues[0] == 0) {
                    recycleParcel(parcelledData);
                } else {
                    mWeakParcelledData = new WeakReference<>(parcelledData);
                }
            }

            mLazyValues = numLazyValues;
            mLazyValues = numLazyValues[0];
            mParcelledByNative = false;
            mMap = map;
            // Set field last as it is volatile
+5 −7
Original line number Diff line number Diff line
@@ -5482,7 +5482,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);
    }

    /**
@@ -5492,17 +5492,16 @@ public final class Parcel {
     * @param lazy   Whether to populate the map with lazy {@link Function} objects for
     *               length-prefixed values. See {@link Parcel#readLazyValue(ClassLoader)} for more
     *               details.
     * @return a count of the lazy values in the map
     * @param lazyValueCount number of lazy values added here
     * @hide
     */
    int readArrayMap(ArrayMap<? super String, Object> map, int size, boolean sorted,
            boolean lazy, @Nullable ClassLoader loader) {
        int lazyValues = 0;
    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) {
                lazyValues++;
                lazyValueCount[0]++;
            }
            if (sorted) {
                map.append(key, value);
@@ -5514,7 +5513,6 @@ public final class Parcel {
        if (sorted) {
            map.validate();
        }
        return lazyValues;
    }

    /**
Loading