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

Commit d7c6ac6f authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7216111 from f0ca8651 to sc-release

Change-Id: I54402cda5afa8504796fa54a0a51e5ab91fac535
parents d39b0f0b f0ca8651
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -448,12 +448,14 @@ typedef struct ASensorEvent {
            float           data[16];
            ASensorVector   vector;
            ASensorVector   acceleration;
            ASensorVector   gyro;
            ASensorVector   magnetic;
            float           temperature;
            float           distance;
            float           light;
            float           pressure;
            float           relative_humidity;
            AUncalibratedEvent uncalibrated_acceleration;
            AUncalibratedEvent uncalibrated_gyro;
            AUncalibratedEvent uncalibrated_magnetic;
            AMetaDataEvent meta_data;
+5 −1
Original line number Diff line number Diff line
@@ -138,7 +138,11 @@ public:
        OP_RECORD_AUDIO_HOTWORD = 102,
        // Ops 103-105 are currently unused in native, and intentionally omitted
        OP_RECORD_AUDIO_OUTPUT = 106,
        _NUM_OP = 107
        OP_SCHEDULE_EXACT_ALARM = 107,
        OP_FINE_LOCATION_SOURCE = 108,
        OP_COARSE_LOCATION_SOURCE = 109,
        OP_MANAGE_MEDIA = 110,
        _NUM_OP = 111
    };

    AppOpsManager();
+5 −4
Original line number Diff line number Diff line
@@ -935,7 +935,8 @@ public:
        return NO_ERROR;
    }

    status_t setDisplayBrightness(const sp<IBinder>& displayToken, float brightness) override {
    status_t setDisplayBrightness(const sp<IBinder>& displayToken,
                                  const gui::DisplayBrightness& brightness) override {
        Parcel data, reply;
        status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        if (error != NO_ERROR) {
@@ -947,7 +948,7 @@ public:
            ALOGE("setDisplayBrightness: failed to write display token: %d", error);
            return error;
        }
        error = data.writeFloat(brightness);
        error = data.writeParcelable(brightness);
        if (error != NO_ERROR) {
            ALOGE("setDisplayBrightness: failed to write brightness: %d", error);
            return error;
@@ -1832,8 +1833,8 @@ status_t BnSurfaceComposer::onTransact(
                ALOGE("setDisplayBrightness: failed to read display token: %d", error);
                return error;
            }
            float brightness = -1.0f;
            error = data.readFloat(&brightness);
            gui::DisplayBrightness brightness;
            error = data.readParcelable(&brightness);
            if (error != NO_ERROR) {
                ALOGE("setDisplayBrightness: failed to read brightness: %d", error);
                return error;
+1 −1
Original line number Diff line number Diff line
@@ -1984,7 +1984,7 @@ bool SurfaceComposerClient::getDisplayBrightnessSupport(const sp<IBinder>& displ
}

status_t SurfaceComposerClient::setDisplayBrightness(const sp<IBinder>& displayToken,
                                                     float brightness) {
                                                     const gui::DisplayBrightness& brightness) {
    return ComposerService::getComposerService()->setDisplayBrightness(displayToken, brightness);
}

+32 −0
Original line number Diff line number Diff line
/*
 * Copyright 2021 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.gui;

/** @hide */
parcelable DisplayBrightness {
    // Range 0-1f, the desired sdr white point brightness
    float sdrWhitePoint = 0f;

    // The SDR white point in nits. -1 if unknown
    float sdrWhitePointNits = -1f;

    // Range 0-1f, the desired brightness of the display itself. -1f to turn the backlight off
    float displayBrightness = 0f;

    // The desired brightness of the display in nits. -1 if unknown
    float displayBrightnessNits = -1f;
}
 No newline at end of file
Loading