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

Commit 9e76e5cd authored by ChengYou Ho's avatar ChengYou Ho Committed by Automerger Merge Worker
Browse files

Add oemlock AIDL interface am: 109522c0 am: 03375181 am: 491a4c57

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1542664

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I24f26542992b33590103c3ed024eead63bad37ab
parents 32e1de7f 491a4c57
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -286,6 +286,14 @@
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="aidl" optional="true">
        <name>android.hardware.oemlock</name>
        <version>1</version>
        <interface>
            <name>IOemLock</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="hidl" optional="true">
        <name>android.hardware.ir</name>
        <version>1.0</version>
+16 −0
Original line number Diff line number Diff line
aidl_interface {
    name: "android.hardware.oemlock",
    vendor_available: true,
    srcs: ["android/hardware/oemlock/*.aidl"],
    stability: "vintf",
    backend: {
        java: {
            platform_apis: true,
        },
        ndk: {
            vndk: {
                enabled: true,
            },
        },
    },
}
+27 −0
Original line number Diff line number Diff line
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.hardware.oemlock;
@VintfStability
interface IOemLock {
  String getName();
  boolean isOemUnlockAllowedByCarrier();
  boolean isOemUnlockAllowedByDevice();
  android.hardware.oemlock.OemLockSecureStatus setOemUnlockAllowedByCarrier(in boolean allowed, in byte[] signature);
  void setOemUnlockAllowedByDevice(in boolean allowed);
}
+25 −0
Original line number Diff line number Diff line
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.hardware.oemlock;
@Backing(type="int") @VintfStability
enum OemLockSecureStatus {
  OK = 0,
  FAILED = 1,
  INVALID_SIGNATURE = 2,
}
+81 −0
Original line number Diff line number Diff line
/*
 * Copyright 2020 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.hardware.oemlock;

import android.hardware.oemlock.OemLockSecureStatus;

/*
 * The OEM lock prevents the bootloader from allowing the device to be flashed.
 *
 * Both the carrier and the device itself have a say as to whether OEM unlock is
 * allowed and both must agree that is allowed in order for unlock to be
 * possible.
 */
@VintfStability
interface IOemLock {
    /**
     * Returns a vendor specific identifier of the HAL.
     *
     * The name returned must not be interpreted by the framework but must be
     * passed to vendor code which may use it to identify the security protocol
     * used by setOemUnlockAllowedByCarrier. This allows the vendor to identify
     * the protocol without having to maintain a device-to-protocol mapping.
     *
     * @return name of the implementation and STATUS_OK if get name successfully
     */
    String getName();

    /**
     * Returns whether OEM unlock is allowed by the carrier.
     *
     * @return the current state(allowed/not allowed) of the flag
     * and STATUS_OK if the flag was successfully read.
     */
    boolean isOemUnlockAllowedByCarrier();

    /**
     * Returns whether OEM unlock ia allowed by the device.
     *
     * @return the current state(allowed/not allowed) of the flag
     * and STATUS_OK if the flag was successfully read.
     */
    boolean isOemUnlockAllowedByDevice();

    /**
     * Updates whether OEM unlock is allowed by the carrier.
     *
     * The implementation may require a vendor defined signature to prove the
     * validity of this request in order to harden its security.
     *
     * @param allowed is the new value of the flag.
     * @param signature to prove validity of this request or empty if not
     *        required.
     * @return OK if the flag was successfully updated,
     *         INVALID_SIGNATURE if a signature is required but the wrong one
     *         was provided
     *         FAILED if the update was otherwise unsuccessful.
     */
    OemLockSecureStatus setOemUnlockAllowedByCarrier(in boolean allowed, in byte[] signature);

    /**
     * Updates whether OEM unlock is allowed by the device.
     *
     * @param allowed the new value of the flag.
     * @return STATUS_OK if the flag was successfully updated.
     */
    void setOemUnlockAllowedByDevice(in boolean allowed);
}
Loading