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

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

Snap for 11432641 from 25d17ff3 to 24Q2-release

Change-Id: I569c27c213232df70c89a825fe737e1f1edec01b
parents bdeb9b12 25d17ff3
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -317,7 +317,7 @@ on late-init && property:ro.boot.fastboot.boottrace=
# Only create the tracing instance if persist.mm_events.enabled
# Attempting to remove the tracing instance after it has been created
# will likely fail with EBUSY as it would be in use by traced_probes.
on post-fs-data && property:persist.mm_events.enabled=true
on mm_events_property_available && property:persist.mm_events.enabled=true
# Create MM Events Tracing Instance for Kmem Activity Trigger
    mkdir /sys/kernel/debug/tracing/instances/mm_events 0755 system system
    mkdir /sys/kernel/tracing/instances/mm_events 0755 system system
@@ -402,6 +402,9 @@ on post-fs-data && property:persist.mm_events.enabled=true
    chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu23/trace
    chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu23/trace

on property:ro.persistent_properties.ready=true
    trigger mm_events_property_available

# Handle hyp tracing instance
on late-init && property:ro.boot.hypervisor.vm.supported=1

+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ cc_library_shared {
filegroup {
    name: "libsensorprivacy_aidl",
    srcs: [
        "aidl/android/hardware/CameraPrivacyAllowlistEntry.aidl",
        "aidl/android/hardware/ISensorPrivacyListener.aidl",
        "aidl/android/hardware/ISensorPrivacyManager.aidl",
    ],
+34 −1
Original line number Diff line number Diff line
@@ -143,6 +143,39 @@ status_t SensorPrivacyManager::isToggleSensorPrivacyEnabled(int toggleType, int
    return UNKNOWN_ERROR;
}

int SensorPrivacyManager::getToggleSensorPrivacyState(int toggleType, int sensor)
{
    sp<hardware::ISensorPrivacyManager> service = getService();
    if (service != nullptr) {
        int result;
        service->getToggleSensorPrivacyState(toggleType, sensor, &result);
        return result;
    }
    // if the SensorPrivacyManager is not available then assume sensor privacy is disabled
    return DISABLED;
}

std::vector<hardware::CameraPrivacyAllowlistEntry>
        SensorPrivacyManager::getCameraPrivacyAllowlist(){
    sp<hardware::ISensorPrivacyManager> service = getService();
    std::vector<hardware::CameraPrivacyAllowlistEntry> result;
    if (service != nullptr) {
        service->getCameraPrivacyAllowlist(&result);
        return result;
    }
    return result;
}

bool SensorPrivacyManager::isCameraPrivacyEnabled(String16 packageName){
    sp<hardware::ISensorPrivacyManager> service = getService();
    if (service != nullptr) {
        bool result;
        service->isCameraPrivacyEnabled(packageName, &result);
        return result;
    }
    return false;
}

status_t SensorPrivacyManager::linkToDeath(const sp<IBinder::DeathRecipient>& recipient)
{
    sp<hardware::ISensorPrivacyManager> service = getService();
+22 −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 android.hardware;

parcelable CameraPrivacyAllowlistEntry {
    String packageName;
    boolean isMandatory;
}
+1 −0
Original line number Diff line number Diff line
@@ -21,4 +21,5 @@ package android.hardware;
 */
oneway interface ISensorPrivacyListener {
    void onSensorPrivacyChanged(int toggleType, int sensor, boolean enabled);
    void onSensorPrivacyStateChanged(int toggleType, int sensor, int state);
}
Loading