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

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

Snap for 9018797 from f5f9c1ec to tm-qpr1-release

Change-Id: I2e61c5fbfc84e35eb3cfadbe2baa3f3f6324a003
parents 5dcafc8c f5f9c1ec
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -286,7 +286,8 @@ package android.app {
    method @RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE) public void setActiveDream(@Nullable android.content.ComponentName);
    method @RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE) public void setDreamOverlay(@Nullable android.content.ComponentName);
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void setScreensaverEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE) public void startDream(@NonNull android.content.ComponentName);
    method @RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE) public void setSystemDreamComponent(@Nullable android.content.ComponentName);
    method @RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE) public void startDream();
    method @RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE) public void stopDream();
  }

@@ -3398,6 +3399,7 @@ package android.window {
    method @NonNull public android.window.WindowContainerTransaction createTaskFragment(@NonNull android.window.TaskFragmentCreationParams);
    method @NonNull public android.window.WindowContainerTransaction deleteTaskFragment(@NonNull android.window.WindowContainerToken);
    method public int describeContents();
    method @NonNull public android.window.WindowContainerTransaction removeTask(@NonNull android.window.WindowContainerToken);
    method @NonNull public android.window.WindowContainerTransaction reorder(@NonNull android.window.WindowContainerToken, boolean);
    method @NonNull public android.window.WindowContainerTransaction reparent(@NonNull android.window.WindowContainerToken, @Nullable android.window.WindowContainerToken, boolean);
    method @NonNull public android.window.WindowContainerTransaction reparentActivityToTaskFragment(@NonNull android.os.IBinder, @NonNull android.os.IBinder);
+51 −11
Original line number Diff line number Diff line
@@ -47,6 +47,13 @@ public final class AutomaticZenRule implements Parcelable {
    private boolean mModified = false;
    private String mPkg;

    /**
     * The maximum string length for any string contained in this automatic zen rule. This pertains
     * both to fields in the rule itself (such as its name) and items with sub-fields.
     * @hide
     */
    public static final int MAX_STRING_LENGTH = 1000;

    /**
     * Creates an automatic zen rule.
     *
@@ -93,10 +100,10 @@ public final class AutomaticZenRule implements Parcelable {
    public AutomaticZenRule(@NonNull String name, @Nullable ComponentName owner,
            @Nullable ComponentName configurationActivity, @NonNull Uri conditionId,
            @Nullable ZenPolicy policy, int interruptionFilter, boolean enabled) {
        this.name = name;
        this.owner = owner;
        this.configurationActivity = configurationActivity;
        this.conditionId = conditionId;
        this.name = getTrimmedString(name);
        this.owner = getTrimmedComponentName(owner);
        this.configurationActivity = getTrimmedComponentName(configurationActivity);
        this.conditionId = getTrimmedUri(conditionId);
        this.interruptionFilter = interruptionFilter;
        this.enabled = enabled;
        this.mZenPolicy = policy;
@@ -115,12 +122,14 @@ public final class AutomaticZenRule implements Parcelable {
    public AutomaticZenRule(Parcel source) {
        enabled = source.readInt() == ENABLED;
        if (source.readInt() == ENABLED) {
            name = source.readString();
            name = getTrimmedString(source.readString());
        }
        interruptionFilter = source.readInt();
        conditionId = source.readParcelable(null, android.net.Uri.class);
        owner = source.readParcelable(null, android.content.ComponentName.class);
        configurationActivity = source.readParcelable(null, android.content.ComponentName.class);
        conditionId = getTrimmedUri(source.readParcelable(null, android.net.Uri.class));
        owner = getTrimmedComponentName(
                source.readParcelable(null, android.content.ComponentName.class));
        configurationActivity = getTrimmedComponentName(
                source.readParcelable(null, android.content.ComponentName.class));
        creationTime = source.readLong();
        mZenPolicy = source.readParcelable(null, android.service.notification.ZenPolicy.class);
        mModified = source.readInt() == ENABLED;
@@ -196,7 +205,7 @@ public final class AutomaticZenRule implements Parcelable {
     * Sets the representation of the state that causes this rule to become active.
     */
    public void setConditionId(Uri conditionId) {
        this.conditionId = conditionId;
        this.conditionId = getTrimmedUri(conditionId);
    }

    /**
@@ -211,7 +220,7 @@ public final class AutomaticZenRule implements Parcelable {
     * Sets the name of this rule.
     */
    public void setName(String name) {
        this.name = name;
        this.name = getTrimmedString(name);
    }

    /**
@@ -243,7 +252,7 @@ public final class AutomaticZenRule implements Parcelable {
     * that are not backed by {@link android.service.notification.ConditionProviderService}.
     */
    public void setConfigurationActivity(@Nullable ComponentName componentName) {
        this.configurationActivity = componentName;
        this.configurationActivity = getTrimmedComponentName(componentName);
    }

    /**
@@ -333,4 +342,35 @@ public final class AutomaticZenRule implements Parcelable {
            return new AutomaticZenRule[size];
        }
    };

    /**
     * If the package or class name of the provided ComponentName are longer than MAX_STRING_LENGTH,
     * return a trimmed version that truncates each of the package and class name at the max length.
     */
    private static ComponentName getTrimmedComponentName(ComponentName cn) {
        if (cn == null) return null;
        return new ComponentName(getTrimmedString(cn.getPackageName()),
                getTrimmedString(cn.getClassName()));
    }

    /**
     * Returns a truncated copy of the string if the string is longer than MAX_STRING_LENGTH.
     */
    private static String getTrimmedString(String input) {
        if (input != null && input.length() > MAX_STRING_LENGTH) {
            return input.substring(0, MAX_STRING_LENGTH);
        }
        return input;
    }

    /**
     * Returns a truncated copy of the Uri by trimming the string representation to the maximum
     * string length.
     */
    private static Uri getTrimmedUri(Uri input) {
        if (input != null && input.toString().length() > MAX_STRING_LENGTH) {
            return Uri.parse(getTrimmedString(input.toString()));
        }
        return input;
    }
}
+28 −3
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package android.app;

import static android.Manifest.permission.WRITE_SECURE_SETTINGS;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SystemService;
@@ -86,16 +85,23 @@ public class DreamManager {
    }

    /**
     * Starts dream service with name "name".
     * Starts dreaming.
     *
     * The system dream component, if set by {@link DreamManager#setSystemDreamComponent}, will be
     * started.
     * Otherwise, starts the active dream set by {@link DreamManager#setActiveDream}.
     *
     * <p>This is only used for testing the dream service APIs.
     *
     * @see DreamManager#setActiveDream(ComponentName)
     * @see DreamManager#setSystemDreamComponent(ComponentName)
     *
     * @hide
     */
    @TestApi
    @UserHandleAware
    @RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE)
    public void startDream(@NonNull ComponentName name) {
    public void startDream() {
        try {
            mService.dream();
        } catch (RemoteException e) {
@@ -141,6 +147,25 @@ public class DreamManager {
        }
    }

    /**
     * Sets or clears the system dream component.
     *
     * The system dream component, when set, will be shown instead of the user configured dream
     * when the system starts dreaming (not dozing). If the system is dreaming at the time the
     * system dream is set or cleared, it immediately switches dream.
     *
     * @hide
     */
    @TestApi
    @RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE)
    public void setSystemDreamComponent(@Nullable ComponentName dreamComponent) {
        try {
            mService.setSystemDreamComponent(dreamComponent);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Sets the active dream on the device to be "dreamComponent".
     *
+10 −3
Original line number Diff line number Diff line
@@ -1433,10 +1433,17 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
    }

    @NonNull
    private static float[] createEnrollStageThresholds(@NonNull Context context) {
    @RequiresPermission(USE_BIOMETRIC_INTERNAL)
    private float[] createEnrollStageThresholds(@NonNull Context context) {
        // TODO(b/200604947): Fetch this value from FingerprintService, rather than internal config
        final String[] enrollStageThresholdStrings = context.getResources().getStringArray(
        final String[] enrollStageThresholdStrings;
        if (isPowerbuttonFps()) {
            enrollStageThresholdStrings = context.getResources().getStringArray(
                    com.android.internal.R.array.config_sfps_enroll_stage_thresholds);
        } else {
            enrollStageThresholdStrings = context.getResources().getStringArray(
                    com.android.internal.R.array.config_udfps_enroll_stage_thresholds);
        }

        final float[] enrollStageThresholds = new float[enrollStageThresholdStrings.length];
        for (int i = 0; i < enrollStageThresholds.length; i++) {
+4 −2
Original line number Diff line number Diff line
@@ -438,8 +438,11 @@ public class BaseBundle {
            map.ensureCapacity(count);
        }
        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 */ true, mClassLoader);
                    /* lazy */ recycleParcel, mClassLoader);
        } catch (BadParcelableException e) {
            if (sShouldDefuse) {
                Log.w(TAG, "Failed to parse Bundle, but defusing quietly", e);
@@ -1845,7 +1848,6 @@ public class BaseBundle {
            // bundle immediately; neither of which is obvious.
            synchronized (this) {
                initializeFromParcelLocked(parcel, /*recycleParcel=*/ false, isNativeBundle);
                unparcel(/* itemwise */ true);
            }
            return;
        }
Loading