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

Commit 5d3da032 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 13413506 from 1b14a5f1 to 25Q3-release

Change-Id: I1430adab42a2278e06aefc6c1cf4e8a22ec672d8
parents aec668c9 1b14a5f1
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -18,14 +18,6 @@ package android.app.supervision;

/**
 * A parcelable of the supervision recovery information. This stores information for recovery
 * purposes.
 *
 * <p>Email: The email for recovery. ID: The account id for recovery.
 *
 * @hide
 * purposes for device supervision pin.
 */
@JavaDerive(equals = true, toString = true)
parcelable SupervisionRecoveryInfo {
    @nullable String email;
    @nullable String id;
}
parcelable SupervisionRecoveryInfo;
+178 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 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.supervision;

import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.PersistableBundle;

import androidx.annotation.Keep;

import java.util.Objects;

/**
 * Contains the information needed for recovering the device supervision pin.
 *
 * <p>Returned by {@link SupervisionManager#getSupervisionRecoveryInfo}.
 *
 * @hide
 */
public final class SupervisionRecoveryInfo implements Parcelable {
    /**
     * Extra key used to pass supervision recovery information within an intent.
     *
     * <p>The associated value should be a {@link android.app.supervision.SupervisionRecoveryInfo}
     * object.
     *
     * <p>* This extra is intended for use when launching the PIN recovery activity via {@link
     * com.android.settingslib.supervision.SupervisionIntentProvider#getPinRecoveryIntent }
     */
    public static final String EXTRA_SUPERVISION_RECOVERY_INFO =
            "android.app.supervision.extra.SUPERVISION_RECOVERY_INFO";

    @NonNull
    public static final Creator<SupervisionRecoveryInfo> CREATOR =
            new Creator<SupervisionRecoveryInfo>() {
                @Override
                public SupervisionRecoveryInfo createFromParcel(@NonNull Parcel source) {
                    String accountName = source.readString();
                    String accountType = source.readString();
                    PersistableBundle accountData =
                            source.readPersistableBundle(getClass().getClassLoader());
                    int state = source.readInt();
                    if (accountName != null && accountType != null) {
                        return new SupervisionRecoveryInfo(
                                accountName, accountType, state, accountData);
                    }
                    return null;
                }

                @Override
                public SupervisionRecoveryInfo[] newArray(int size) {
                    return new SupervisionRecoveryInfo[size];
                }
            };

    /** An IntDef which describes the various states of the recovery information. */
    @Keep
    @IntDef({STATE_PENDING, STATE_VERIFIED})
    public @interface State {}

    /** Indicates that the recovery information is pending verification. */
    public static final int STATE_PENDING = 0;

    /** Indicates that the recovery information has been verified. */
    public static final int STATE_VERIFIED = 1;

    @NonNull private String mAccountName;
    @NonNull private String mAccountType;
    @Nullable private PersistableBundle mAccountData;
    @State private int mState;

    public SupervisionRecoveryInfo(
            @NonNull String accountName,
            @NonNull String accountType,
            @State int state,
            @Nullable PersistableBundle accountData) {
        this.mAccountName = accountName;
        this.mAccountType = accountType;
        this.mAccountData = accountData;
        this.mState = state;
    }

    /** Gets the recovery account name. */
    @NonNull
    public String getAccountName() {
        return mAccountName;
    }

    /** Gets the recovery account type. */
    @NonNull
    public String getAccountType() {
        return mAccountType;
    }

    /** Gets the recovery account data. */
    @NonNull
    public PersistableBundle getAccountData() {
        return mAccountData == null ? new PersistableBundle() : mAccountData;
    }

    /**
     * Gets the state of the recovery information.
     *
     * @return One of {@link #STATE_PENDING}, {@link #STATE_VERIFIED}.
     */
    @State
    public int getState() {
        return mState;
    }

    @Override
    public void writeToParcel(@NonNull Parcel parcel, int flag) {
        parcel.writeString(mAccountName);
        parcel.writeString(mAccountType);
        parcel.writePersistableBundle(mAccountData);
        parcel.writeInt(mState);
    }

    /**
     * Reads the SupervisionRecoveryInfo object from the given {@link Parcel}.
     *
     * @param parcel The {@link Parcel} to read from.
     */
    public void readFromParcel(@NonNull Parcel parcel) {
        mAccountName = Objects.requireNonNull(parcel.readString());
        mAccountType = Objects.requireNonNull(parcel.readString());
        mAccountData = parcel.readPersistableBundle(getClass().getClassLoader());
        mState = parcel.readInt();
    }

    @Override
    public String toString() {
        java.util.StringJoiner joiner = new java.util.StringJoiner(", ", "{", "}");
        joiner.add("accountName: " + mAccountName);
        joiner.add("accountType: " + mAccountType);
        joiner.add("accountData: " + mAccountData);
        joiner.add("state: " + mState);
        return "SupervisionRecoveryInfo" + joiner;
    }

    @Override
    public boolean equals(Object other) {
        if (this == other) return true;
        if (!(other instanceof SupervisionRecoveryInfo)) return false;
        SupervisionRecoveryInfo that = (SupervisionRecoveryInfo) other;
        return Objects.equals(mAccountName, that.mAccountName)
                && Objects.equals(mAccountType, that.mAccountType)
                && Objects.equals(mAccountData, that.mAccountData)
                && mState == that.mState;
    }

    @Override
    public int hashCode() {
        return Objects.hash(mAccountName, mAccountType, mAccountData, mState);
    }

    @Override
    public int describeContents() {
        return 0;
    }
}
+3 −3
Original line number Diff line number Diff line
@@ -131,11 +131,11 @@ public enum DesktopExperienceFlags {
    ENABLE_MULTIPLE_DESKTOPS_FRONTEND(Flags::enableMultipleDesktopsFrontend, false,
            Flags.FLAG_ENABLE_MULTIPLE_DESKTOPS_FRONTEND),
    ENABLE_PERSISTING_DISPLAY_SIZE_FOR_CONNECTED_DISPLAYS(
            Flags::enablePersistingDisplaySizeForConnectedDisplays, false,
            Flags::enablePersistingDisplaySizeForConnectedDisplays, true,
            Flags.FLAG_ENABLE_PERSISTING_DISPLAY_SIZE_FOR_CONNECTED_DISPLAYS),
    ENABLE_PER_DISPLAY_DESKTOP_WALLPAPER_ACTIVITY(Flags::enablePerDisplayDesktopWallpaperActivity,
            false, Flags.FLAG_ENABLE_PER_DISPLAY_DESKTOP_WALLPAPER_ACTIVITY),
    ENABLE_PRESENTATION_FOR_CONNECTED_DISPLAYS(Flags::enablePresentationForConnectedDisplays, false,
    ENABLE_PRESENTATION_FOR_CONNECTED_DISPLAYS(Flags::enablePresentationForConnectedDisplays, true,
            Flags.FLAG_ENABLE_PRESENTATION_FOR_CONNECTED_DISPLAYS),
    ENABLE_PROJECTED_DISPLAY_DESKTOP_MODE(Flags::enableProjectedDisplayDesktopMode, false,
            Flags.FLAG_ENABLE_PROJECTED_DISPLAY_DESKTOP_MODE),
@@ -144,7 +144,7 @@ public enum DesktopExperienceFlags {
    ENABLE_SEE_THROUGH_TASK_FRAGMENTS(Flags::enableSeeThroughTaskFragments,
            false, Flags.FLAG_ENABLE_SEE_THROUGH_TASK_FRAGMENTS),
    ENABLE_SIZE_COMPAT_MODE_IMPROVEMENTS_FOR_CONNECTED_DISPLAYS(
            Flags::enableSizeCompatModeImprovementsForConnectedDisplays, false,
            Flags::enableSizeCompatModeImprovementsForConnectedDisplays, true,
            Flags.FLAG_ENABLE_SIZE_COMPAT_MODE_IMPROVEMENTS_FOR_CONNECTED_DISPLAYS),
    ENABLE_SYS_DECORS_CALLBACKS_VIA_WM(Flags::enableSysDecorsCallbacksViaWm,
            false, Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM),
+9 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ public class LocaleStore {
    private static final HashMap<String, LocaleInfo> sLocaleCache = new HashMap<>();
    private static final String TAG = LocaleStore.class.getSimpleName();
    private static boolean sFullyInitialized = false;
    private static boolean sLocationAvailable = false;

    public static class LocaleInfo implements Serializable {
        public static final int SUGGESTION_TYPE_NONE = 0;
@@ -317,6 +318,13 @@ public class LocaleStore {
        return result;
    }

    /**
     * @return whether SIM country or network country code is available during locale initialization
     */
    public static boolean isSimOrNwCountryAvailable() {
        return sLocationAvailable;
    }

    /*
     * This method is added for SetupWizard, to force an update of the suggested locales
     * when the SIM is initialized.
@@ -463,6 +471,7 @@ public class LocaleStore {
        }

        Set<String> simCountries = getSimCountries(context);
        sLocationAvailable = !simCountries.isEmpty();

        final boolean isInDeveloperMode = Settings.Global.getInt(context.getContentResolver(),
                Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0;
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ val androidTop: String = File(rootDir, "../../../../..").canonicalPath

allprojects {
    extra["androidTop"] = androidTop
    extra["jetpackComposeVersion"] = "1.8.0-rc02"
    extra["jetpackComposeVersion"] = "1.8.0"
}

subprojects {
Loading