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

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

Snap for 8561975 from cd58d789 to tm-release

Change-Id: Ib35dbd9159896d66ebea3dfe4300a6ac1b78a34d
parents af4d0824 cd58d789
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
@@ -17,8 +17,10 @@
package android.app.admin;

import static android.app.admin.DevicePolicyManager.ACTION_PROVISION_MANAGED_DEVICE_FROM_TRUSTED_SOURCE;
import static android.app.admin.DevicePolicyManager.EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE;
import static android.app.admin.DevicePolicyManager.EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME;
import static android.app.admin.DevicePolicyManager.EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME;
import static android.app.admin.DevicePolicyManager.EXTRA_PROVISIONING_ROLE_HOLDER_EXTRAS_BUNDLE;
import static android.app.admin.DevicePolicyManager.EXTRA_PROVISIONING_TRIGGER;
import static android.app.admin.DevicePolicyManager.MIME_TYPE_PROVISIONING_NFC;
import static android.app.admin.DevicePolicyManager.PROVISIONING_TRIGGER_NFC;
@@ -36,12 +38,14 @@ import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;
import android.os.Bundle;
import android.os.Parcelable;
import android.os.PersistableBundle;
import android.util.Log;

import java.io.IOException;
import java.io.StringReader;
import java.util.Enumeration;
import java.util.Properties;
import java.util.Set;

/**
 * Utility class that provides functionality to create provisioning intents from nfc intents.
@@ -124,12 +128,46 @@ final class ProvisioningIntentHelper {
            ComponentName componentName = ComponentName.unflattenFromString(
                    properties.getProperty(propertyName));
            bundle.putParcelable(propertyName, componentName);
        } else if (EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE.equals(propertyName)
                || EXTRA_PROVISIONING_ROLE_HOLDER_EXTRAS_BUNDLE.equals(propertyName)) {
            try {
                bundle.putParcelable(propertyName,
                        deserializeExtrasBundle(properties, propertyName));
            } catch (IOException e) {
                Log.e(TAG,
                        "Failed to parse " + propertyName + ".", e);
            }
        }
        else {
            bundle.putString(propertyName, properties.getProperty(propertyName));
        }
    }

    /**
     * Get a {@link PersistableBundle} from a {@code String} property in a {@link Properties}
     * object.
     * @param properties the source of the extra
     * @param extraName key into the {@link Properties} object
     * @return the {@link PersistableBundle} or {@code null} if there was no property with the
     * given name
     * @throws IOException if there was an error parsing the property
     */
    private static PersistableBundle deserializeExtrasBundle(
            Properties properties, String extraName) throws IOException {
        String serializedExtras = properties.getProperty(extraName);
        if (serializedExtras == null) {
            return null;
        }
        Properties bundleProperties = new Properties();
        bundleProperties.load(new StringReader(serializedExtras));
        PersistableBundle extrasBundle = new PersistableBundle(bundleProperties.size());
        Set<String> propertyNames = bundleProperties.stringPropertyNames();
        for (String propertyName : propertyNames) {
            extrasBundle.putString(propertyName, bundleProperties.getProperty(propertyName));
        }
        return extrasBundle;
    }

    private static Intent createProvisioningIntentFromBundle(Bundle bundle) {
        requireNonNull(bundle);

+6 −1
Original line number Diff line number Diff line
@@ -567,9 +567,14 @@ public class ApkLiteParseUtils {
                    targetCode = minCode;
                }

                boolean allowUnknownCodenames = false;
                if ((flags & FrameworkParsingPackageUtils.PARSE_APK_IN_APEX) != 0) {
                    allowUnknownCodenames = true;
                }

                ParseResult<Integer> targetResult = FrameworkParsingPackageUtils.computeTargetSdkVersion(
                        targetVer, targetCode, SDK_CODENAMES, input,
                        /* allowUnknownCodenames= */ false);
                        allowUnknownCodenames);
                if (targetResult.isError()) {
                    return input.error(targetResult);
                }
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ public class FrameworkParsingPackageUtils {
    private static final int MAX_FILE_NAME_SIZE = 223;

    public static final int PARSE_IGNORE_OVERLAY_REQUIRED_SYSTEM_PROPERTY = 1 << 7;
    public static final int PARSE_APK_IN_APEX = 1 << 9;

    /**
     * Check if the given name is valid.
+8 −0
Original line number Diff line number Diff line
@@ -738,6 +738,14 @@ public final class DeviceConfig {
     */
    public static final String NAMESPACE_VENDOR_SYSTEM_NATIVE = "vendor_system_native";

    /**
     * Namespace for DevicePolicyManager related features.
     *
     * @hide
     */
    public static final String NAMESPACE_DEVICE_POLICY_MANAGER =
            "device_policy_manager";

    private static final Object sLock = new Object();
    @GuardedBy("sLock")
    private static ArrayMap<OnPropertiesChangedListener, Pair<String, Executor>> sListeners =
+6 −2
Original line number Diff line number Diff line
@@ -3108,10 +3108,14 @@ public interface WindowManager extends ViewManager {

        /**
         * The preferred refresh rate for the window.
         *
         * <p>
         * This must be one of the supported refresh rates obtained for the display(s) the window
         * is on. The selected refresh rate will be applied to the display's default mode.
         *
         * <p>
         * This should be used in favor of {@link LayoutParams#preferredDisplayModeId} for
         * applications that want to specify the refresh rate, but do not want to specify a
         * preference for any other displayMode properties (e.g., resolution).
         * <p>
         * This value is ignored if {@link #preferredDisplayModeId} is set.
         *
         * @see Display#getSupportedRefreshRates()
Loading