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

Commit 32b7fd00 authored by Xin Li's avatar Xin Li
Browse files

Merge 24Q3 (ab/11976889) to aosp-main-future

Bug: 347831320
Merged-In: Ic226cb68160fcb011594b2a07f1502fbc59b567a
Change-Id: Ic954640bcb3538678fe2cfdb25ad6b5e222b505d
parents 20199948 da6a7fa3
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -34,6 +34,24 @@ license {
    ],
}

aidl_interface_defaults {
    name: "audio-aidl-defaults",
    unstable: true,
    host_supported: true,
    backend: {
        cpp: {
            enabled: true,
        },
        java: {
            enabled: true,
        },
        rust: {
            enabled: true,
        },
    },

}

aidl_interface {
    name: "av-types-aidl",
    unstable: true,
@@ -71,6 +89,18 @@ aidl_interface {
    },
}

aidl_interface {
    name: "audio-permission-aidl",
    // TODO remove
    vendor_available: true,
    double_loadable: true,
    defaults: ["audio-aidl-defaults"],
    local_include_dir: "aidl",
    srcs: [
        "aidl/com/android/media/permission/*",
    ],
}

cc_library_headers {
    name: "av-headers",
    export_include_dirs: ["include"],
+46 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 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 com.android.media.permission;

import com.android.media.permission.PermissionEnum;
import com.android.media.permission.UidPackageState;

/**
 * This interface is used by system_server to communicate permission information
 * downwards towards native services.
 * {@hide}
 */
interface INativePermissionController {
    /**
     * Initialize app-ids and their corresponding packages, to be used for package validation.
     */
    void populatePackagesForUids(in List<UidPackageState> initialPackageStates);
    /**
     * Replace or populate the list of packages associated with a given uid.
     * If the list is empty, the package no longer exists.
     */
    void updatePackagesForUid(in UidPackageState newPackageState);
    /**
     * Populate or replace the list of uids which holds a particular permission.
     * Runtime permissions will need additional checks, and should not use the cache as-is.
     * Not virtual device aware.
     * Is is possible for updates to the permission state to be delayed during high traffic.
     * @param perm - Enum representing the permission for which holders are being supplied
     * @param uids - Uids (not app-ids) which hold the permission. Should be sorted
     */
    void populatePermissionState(in PermissionEnum perm, in int[] uids);
}
+31 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 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 com.android.media.permission;

/**
 * Enumerates permissions which are tracked/pushed by NativePermissionController
 * {@hide}
 */
enum PermissionEnum {
    MODIFY_AUDIO_ROUTING = 0,
    MODIFY_PHONE_STATE = 1,
    CALL_AUDIO_INTERCEPTION = 2,
    // This is a runtime + WIU permission, which means data delivery should be protected by AppOps
    // We query the controller only for early fails/hard errors
    RECORD_AUDIO = 3,
    ENUM_SIZE = 4, // Not for actual usage
}
+10 −8
Original line number Diff line number Diff line
/*
 * Copyright 2024 The Android Open Source Project
 * Copyright (C) 2024 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.
@@ -14,12 +14,14 @@
 * limitations under the License.
 */

package android.companion.virtualdevice.flags;
package com.android.media.permission;

/** This file is included only if RELEASE_PACKAGE_VIRTUAL_CAMERA build flag is set.*/
public class VirtualCameraServiceBuildFlag {

    public static boolean isVirtualCameraServiceBuildFlagEnabled() {
        return true;
    }
/**
 * Entity representing the package names associated with a particular uid/app-id
 * {@hide}
 */
@JavaDerive(equals = true, toString = true)
parcelable UidPackageState {
    int uid;
    @utf8InCpp List<String> packageNames;
}
+14 −14
Original line number Diff line number Diff line
@@ -86,40 +86,40 @@ cc_library {

        // Source for camera interface parcelables, and manually-written interfaces
        "Camera.cpp",
        "CameraBase.cpp",
        "CameraMetadata.cpp",
        "CameraParameters.cpp",
        "CaptureResult.cpp",
        "CameraParameters2.cpp",
        "CameraSessionStats.cpp",
        "CameraUtils.cpp",
        "CaptureResult.cpp",
        "ICamera.cpp",
        "ICameraClient.cpp",
        "ICameraRecordingProxy.cpp",
        "VendorTagDescriptor.cpp",
        "camera2/CaptureRequest.cpp",
        "camera2/ConcurrentCamera.cpp",
        "camera2/OutputConfiguration.cpp",
        "camera2/SessionConfiguration.cpp",
        "camera2/SubmitInfo.cpp",
        "CameraBase.cpp",
        "CameraUtils.cpp",
        "VendorTagDescriptor.cpp",
    ],

    shared_libs: [
        "camera_platform_flags_c_lib",
        "lib-platform-compat-native-api",
        "libbase",
        "libcutils",
        "libutils",
        "liblog",
        "libbinder",
        "libgui",
        "libcamera_metadata",
        "libcutils",
        "libgui",
        "liblog",
        "libnativewindow",
        "lib-platform-compat-native-api",
        "libutils",
    ],

    include_dirs: [
        "system/media/private/camera/include",
        "frameworks/native/include/media/openmax",
        "system/media/private/camera/include",
    ],
    export_include_dirs: [
        "include",
@@ -127,13 +127,13 @@ cc_library {
    ],
    export_shared_lib_headers: [
        "libcamera_metadata",
        "libnativewindow",
        "libgui",
        "libnativewindow",
    ],

    cflags: [
        "-Werror",
        "-Wall",
        "-Werror",
        "-Wextra",
    ],

@@ -153,8 +153,8 @@ cc_library_host_static {
    ],

    include_dirs: [
        "system/media/private/camera/include",
        "frameworks/native/include/media/openmax",
        "system/media/private/camera/include",
    ],

    export_include_dirs: [
@@ -168,8 +168,8 @@ filegroup {
    name: "libcamera_client_aidl",
    srcs: [
        "aidl/android/hardware/CameraExtensionSessionStats.aidl",
        "aidl/android/hardware/CameraFeatureCombinationStats.aidl",
        "aidl/android/hardware/ICameraService.aidl",
        "aidl/android/hardware/CameraIdRemapping.aidl",
        "aidl/android/hardware/ICameraServiceListener.aidl",
        "aidl/android/hardware/ICameraServiceProxy.aidl",
        "aidl/android/hardware/camera2/ICameraDeviceCallbacks.aidl",
Loading