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

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

Snap for 8404621 from 474079d8 to tm-release

Change-Id: I2e3b0af3d6a9488af5d0de53e5a2ff0ac03f563b
parents 8193dc42 474079d8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -63,6 +63,8 @@ on late-init
    chmod 0666 /sys/kernel/tracing/events/cpuhp/cpuhp_pause/enable
    chmod 0666 /sys/kernel/debug/tracing/events/power/gpu_frequency/enable
    chmod 0666 /sys/kernel/tracing/events/power/gpu_frequency/enable
    chmod 0666 /sys/kernel/debug/tracing/events/power/gpu_work_period/enable
    chmod 0666 /sys/kernel/tracing/events/power/gpu_work_period/enable
    chmod 0666 /sys/kernel/debug/tracing/events/power/suspend_resume/enable
    chmod 0666 /sys/kernel/tracing/events/power/suspend_resume/enable
    chmod 0666 /sys/kernel/debug/tracing/events/cpufreq_interactive/enable
+3 −2
Original line number Diff line number Diff line
@@ -473,7 +473,8 @@ static bool internal_storage_has_project_id() {
                StringPrintf("%smisc/installd/using_project_ids", android_data_dir.c_str());
        sUsingProjectIdsFlag = access(using_project_ids.c_str(), F_OK) == 0;
    });
    return sUsingProjectIdsFlag;
    // return sUsingProjectIdsFlag;
    return false;
}

static int prepare_app_dir(const std::string& path, mode_t target_mode, uid_t uid, gid_t gid,
@@ -3429,7 +3430,7 @@ bool check_if_ioctl_feature_is_supported() {
    auto temp_path = StringPrintf("%smisc/installd/ioctl_check", android_data_dir.c_str());
    if (access(temp_path.c_str(), F_OK) != 0) {
        int fd = open(temp_path.c_str(), O_CREAT | O_TRUNC | O_RDWR | O_CLOEXEC, 0644);
        result = set_quota_project_id(temp_path, 0, true) == 0;
        result = set_quota_project_id(temp_path, 0, false) == 0;
        close(fd);
        // delete the temp file
        remove(temp_path.c_str());
+2 −1
Original line number Diff line number Diff line
@@ -465,7 +465,7 @@ TEST_F(ServiceTest, CalculateCache) {
    EXPECT_TRUE(create_cache_path(buf, "/path/to/file.apk", "isa"));
    EXPECT_EQ("/data/dalvik-cache/isa/path@to@file.apk@classes.dex", std::string(buf));
}
TEST_F(ServiceTest, GetAppSize) {
TEST_F(ServiceTest, GetAppSizeManualForMedia) {
    struct stat s;

    std::string externalPicDir =
@@ -509,6 +509,7 @@ TEST_F(ServiceTest, GetAppSize) {
        system(removeCommand.c_str());
    }
}

TEST_F(ServiceTest, GetAppSizeWrongSizes) {
    int32_t externalStorageAppId = -1;
    std::vector<int64_t> externalStorageSize;
+4 −0
Original line number Diff line number Diff line
@@ -97,6 +97,10 @@ static inline void AIBinder_forceDowngradeToLocalStability(AIBinder* binder) {
 *
 * This interface has system<->vendor stability
 */
// b/227835797 - can't use __INTRODUCED_IN(30) because old targets load this code
#if __ANDROID_MIN_SDK_VERSION__ < 30
__attribute__((weak))
#endif  // __ANDROID_MIN_SDK_VERSION__ < 30
void AIBinder_markVintfStability(AIBinder* binder);

__END_DECLS
+0 −416
Original line number Diff line number Diff line
@@ -226,26 +226,6 @@ public:
        return result;
    }

    void setPowerMode(const sp<IBinder>& display, int mode) override {
        Parcel data, reply;
        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        data.writeStrongBinder(display);
        data.writeInt32(mode);
        remote()->transact(BnSurfaceComposer::SET_POWER_MODE, data, &reply);
    }

    status_t getDisplayState(const sp<IBinder>& display, ui::DisplayState* state) override {
        Parcel data, reply;
        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        data.writeStrongBinder(display);
        remote()->transact(BnSurfaceComposer::GET_DISPLAY_STATE, data, &reply);
        const status_t result = reply.readInt32();
        if (result == NO_ERROR) {
            memcpy(state, reply.readInplace(sizeof(ui::DisplayState)), sizeof(ui::DisplayState));
        }
        return result;
    }

    status_t getStaticDisplayInfo(const sp<IBinder>& display,
                                  ui::StaticDisplayInfo* info) override {
        Parcel data, reply;
@@ -268,20 +248,6 @@ public:
        return reply.read(*info);
    }

    status_t getDisplayStats(const sp<IBinder>& display, DisplayStatInfo* stats) override {
        Parcel data, reply;
        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        data.writeStrongBinder(display);
        remote()->transact(BnSurfaceComposer::GET_DISPLAY_STATS, data, &reply);
        status_t result = reply.readInt32();
        if (result == NO_ERROR) {
            memcpy(stats,
                    reply.readInplace(sizeof(DisplayStatInfo)),
                    sizeof(DisplayStatInfo));
        }
        return result;
    }

    status_t getDisplayNativePrimaries(const sp<IBinder>& display,
                                       ui::DisplayPrimaries& primaries) override {
        Parcel data, reply;
@@ -333,29 +299,6 @@ public:
        return static_cast<status_t>(reply.readInt32());
    }

    // TODO(b/213909104) : Add unit tests to verify surface flinger boot time APIs
    status_t getBootDisplayModeSupport(bool* outSupport) const override {
        Parcel data, reply;
        status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        if (error != NO_ERROR) {
            ALOGE("getBootDisplayModeSupport: failed to write interface token: %d", error);
            return error;
        }
        error = remote()->transact(BnSurfaceComposer::GET_BOOT_DISPLAY_MODE_SUPPORT, data, &reply);
        if (error != NO_ERROR) {
            ALOGE("getBootDisplayModeSupport: failed to transact: %d", error);
            return error;
        }
        bool support;
        error = reply.readBool(&support);
        if (error != NO_ERROR) {
            ALOGE("getBootDisplayModeSupport: failed to read support: %d", error);
            return error;
        }
        *outSupport = support;
        return NO_ERROR;
    }

    status_t setBootDisplayMode(const sp<IBinder>& display,
                                ui::DisplayModeId displayModeId) override {
        Parcel data, reply;
@@ -381,73 +324,6 @@ public:
        return result;
    }

    status_t clearBootDisplayMode(const sp<IBinder>& display) override {
        Parcel data, reply;
        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        if (result != NO_ERROR) {
            ALOGE("clearBootDisplayMode failed to writeInterfaceToken: %d", result);
            return result;
        }
        result = data.writeStrongBinder(display);
        if (result != NO_ERROR) {
            ALOGE("clearBootDisplayMode failed to writeStrongBinder: %d", result);
            return result;
        }
        result = remote()->transact(BnSurfaceComposer::CLEAR_BOOT_DISPLAY_MODE, data, &reply);
        if (result != NO_ERROR) {
            ALOGE("clearBootDisplayMode failed to transact: %d", result);
        }
        return result;
    }

    void setAutoLowLatencyMode(const sp<IBinder>& display, bool on) override {
        Parcel data, reply;
        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        if (result != NO_ERROR) {
            ALOGE("setAutoLowLatencyMode failed to writeInterfaceToken: %d", result);
            return;
        }

        result = data.writeStrongBinder(display);
        if (result != NO_ERROR) {
            ALOGE("setAutoLowLatencyMode failed to writeStrongBinder: %d", result);
            return;
        }
        result = data.writeBool(on);
        if (result != NO_ERROR) {
            ALOGE("setAutoLowLatencyMode failed to writeBool: %d", result);
            return;
        }
        result = remote()->transact(BnSurfaceComposer::SET_AUTO_LOW_LATENCY_MODE, data, &reply);
        if (result != NO_ERROR) {
            ALOGE("setAutoLowLatencyMode failed to transact: %d", result);
            return;
        }
    }

    void setGameContentType(const sp<IBinder>& display, bool on) override {
        Parcel data, reply;
        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        if (result != NO_ERROR) {
            ALOGE("setGameContentType failed to writeInterfaceToken: %d", result);
            return;
        }
        result = data.writeStrongBinder(display);
        if (result != NO_ERROR) {
            ALOGE("setGameContentType failed to writeStrongBinder: %d", result);
            return;
        }
        result = data.writeBool(on);
        if (result != NO_ERROR) {
            ALOGE("setGameContentType failed to writeBool: %d", result);
            return;
        }
        result = remote()->transact(BnSurfaceComposer::SET_GAME_CONTENT_TYPE, data, &reply);
        if (result != NO_ERROR) {
            ALOGE("setGameContentType failed to transact: %d", result);
        }
    }

    status_t clearAnimationFrameStats() override {
        Parcel data, reply;
        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
@@ -722,26 +598,6 @@ public:
        return error;
    }

    status_t isWideColorDisplay(const sp<IBinder>& token,
                                bool* outIsWideColorDisplay) const override {
        Parcel data, reply;
        status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        if (error != NO_ERROR) {
            return error;
        }
        error = data.writeStrongBinder(token);
        if (error != NO_ERROR) {
            return error;
        }

        error = remote()->transact(BnSurfaceComposer::IS_WIDE_COLOR_DISPLAY, data, &reply);
        if (error != NO_ERROR) {
            return error;
        }
        error = reply.readBool(outIsWideColorDisplay);
        return error;
    }

    status_t addRegionSamplingListener(const Rect& samplingArea, const sp<IBinder>& stopLayerHandle,
                                       const sp<IRegionSamplingListener>& listener) override {
        Parcel data, reply;
@@ -974,109 +830,6 @@ public:
        return reply.readInt32();
    }

    status_t getDisplayBrightnessSupport(const sp<IBinder>& displayToken,
                                         bool* outSupport) const override {
        Parcel data, reply;
        status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        if (error != NO_ERROR) {
            ALOGE("getDisplayBrightnessSupport: failed to write interface token: %d", error);
            return error;
        }
        error = data.writeStrongBinder(displayToken);
        if (error != NO_ERROR) {
            ALOGE("getDisplayBrightnessSupport: failed to write display token: %d", error);
            return error;
        }
        error = remote()->transact(BnSurfaceComposer::GET_DISPLAY_BRIGHTNESS_SUPPORT, data, &reply);
        if (error != NO_ERROR) {
            ALOGE("getDisplayBrightnessSupport: failed to transact: %d", error);
            return error;
        }
        bool support;
        error = reply.readBool(&support);
        if (error != NO_ERROR) {
            ALOGE("getDisplayBrightnessSupport: failed to read support: %d", error);
            return error;
        }
        *outSupport = support;
        return NO_ERROR;
    }

    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) {
            ALOGE("setDisplayBrightness: failed to write interface token: %d", error);
            return error;
        }
        error = data.writeStrongBinder(displayToken);
        if (error != NO_ERROR) {
            ALOGE("setDisplayBrightness: failed to write display token: %d", error);
            return error;
        }
        error = data.writeParcelable(brightness);
        if (error != NO_ERROR) {
            ALOGE("setDisplayBrightness: failed to write brightness: %d", error);
            return error;
        }
        error = remote()->transact(BnSurfaceComposer::SET_DISPLAY_BRIGHTNESS, data, &reply);
        if (error != NO_ERROR) {
            ALOGE("setDisplayBrightness: failed to transact: %d", error);
            return error;
        }
        return NO_ERROR;
    }

    status_t addHdrLayerInfoListener(const sp<IBinder>& displayToken,
                                     const sp<gui::IHdrLayerInfoListener>& listener) override {
        Parcel data, reply;
        SAFE_PARCEL(data.writeInterfaceToken, ISurfaceComposer::getInterfaceDescriptor());
        SAFE_PARCEL(data.writeStrongBinder, displayToken);
        SAFE_PARCEL(data.writeStrongBinder, IInterface::asBinder(listener));
        const status_t error =
                remote()->transact(BnSurfaceComposer::ADD_HDR_LAYER_INFO_LISTENER, data, &reply);
        if (error != OK) {
            ALOGE("addHdrLayerInfoListener: Failed to transact; error = %d", error);
        }
        return error;
    }

    status_t removeHdrLayerInfoListener(const sp<IBinder>& displayToken,
                                        const sp<gui::IHdrLayerInfoListener>& listener) override {
        Parcel data, reply;
        SAFE_PARCEL(data.writeInterfaceToken, ISurfaceComposer::getInterfaceDescriptor());
        SAFE_PARCEL(data.writeStrongBinder, displayToken);
        SAFE_PARCEL(data.writeStrongBinder, IInterface::asBinder(listener));
        const status_t error =
                remote()->transact(BnSurfaceComposer::REMOVE_HDR_LAYER_INFO_LISTENER, data, &reply);
        if (error != OK) {
            ALOGE("removeHdrLayerInfoListener: Failed to transact; error = %d", error);
        }
        return error;
    }

    status_t notifyPowerBoost(int32_t boostId) override {
        Parcel data, reply;
        status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        if (error != NO_ERROR) {
            ALOGE("notifyPowerBoost: failed to write interface token: %d", error);
            return error;
        }
        error = data.writeInt32(boostId);
        if (error != NO_ERROR) {
            ALOGE("notifyPowerBoost: failed to write boostId: %d", error);
            return error;
        }
        error = remote()->transact(BnSurfaceComposer::NOTIFY_POWER_BOOST, data, &reply,
                                   IBinder::FLAG_ONEWAY);
        if (error != NO_ERROR) {
            ALOGE("notifyPowerBoost: failed to transact: %d", error);
            return error;
        }
        return NO_ERROR;
    }

    status_t setGlobalShadowSettings(const half4& ambientColor, const half4& spotColor,
                                     float lightPosY, float lightPosZ, float lightRadius) override {
        Parcel data, reply;
@@ -1392,18 +1145,6 @@ status_t BnSurfaceComposer::onTransact(
            reply->writeStrongBinder(IInterface::asBinder(connection));
            return NO_ERROR;
        }
        case GET_DISPLAY_STATE: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            ui::DisplayState state;
            const sp<IBinder> display = data.readStrongBinder();
            const status_t result = getDisplayState(display, &state);
            reply->writeInt32(result);
            if (result == NO_ERROR) {
                memcpy(reply->writeInplace(sizeof(ui::DisplayState)), &state,
                       sizeof(ui::DisplayState));
            }
            return NO_ERROR;
        }
        case GET_STATIC_DISPLAY_INFO: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            ui::StaticDisplayInfo info;
@@ -1424,18 +1165,6 @@ status_t BnSurfaceComposer::onTransact(
            SAFE_PARCEL(reply->write, info);
            return NO_ERROR;
        }
        case GET_DISPLAY_STATS: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            DisplayStatInfo stats;
            sp<IBinder> display = data.readStrongBinder();
            status_t result = getDisplayStats(display, &stats);
            reply->writeInt32(result);
            if (result == NO_ERROR) {
                memcpy(reply->writeInplace(sizeof(DisplayStatInfo)),
                        &stats, sizeof(DisplayStatInfo));
            }
            return NO_ERROR;
        }
        case GET_DISPLAY_NATIVE_PRIMARIES: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            ui::DisplayPrimaries primaries;
@@ -1475,15 +1204,6 @@ status_t BnSurfaceComposer::onTransact(
            result = reply->writeInt32(result);
            return result;
        }
        case GET_BOOT_DISPLAY_MODE_SUPPORT: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            bool support = false;
            status_t result = getBootDisplayModeSupport(&support);
            if (result == NO_ERROR) {
                reply->writeBool(support);
            }
            return result;
        }
        case SET_BOOT_DISPLAY_MODE: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = nullptr;
@@ -1500,50 +1220,6 @@ status_t BnSurfaceComposer::onTransact(
            }
            return setBootDisplayMode(display, displayModeId);
        }
        case CLEAR_BOOT_DISPLAY_MODE: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = nullptr;
            status_t result = data.readStrongBinder(&display);
            if (result != NO_ERROR) {
                ALOGE("clearBootDisplayMode failed to readStrongBinder: %d", result);
                return result;
            }
            return clearBootDisplayMode(display);
        }
        case SET_AUTO_LOW_LATENCY_MODE: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = nullptr;
            status_t result = data.readStrongBinder(&display);
            if (result != NO_ERROR) {
                ALOGE("setAutoLowLatencyMode failed to readStrongBinder: %d", result);
                return result;
            }
            bool setAllm = false;
            result = data.readBool(&setAllm);
            if (result != NO_ERROR) {
                ALOGE("setAutoLowLatencyMode failed to readBool: %d", result);
                return result;
            }
            setAutoLowLatencyMode(display, setAllm);
            return result;
        }
        case SET_GAME_CONTENT_TYPE: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = nullptr;
            status_t result = data.readStrongBinder(&display);
            if (result != NO_ERROR) {
                ALOGE("setGameContentType failed to readStrongBinder: %d", result);
                return result;
            }
            bool setGameContentTypeOn = false;
            result = data.readBool(&setGameContentTypeOn);
            if (result != NO_ERROR) {
                ALOGE("setGameContentType failed to readBool: %d", result);
                return result;
            }
            setGameContentType(display, setGameContentTypeOn);
            return result;
        }
        case CLEAR_ANIMATION_FRAME_STATS: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            status_t result = clearAnimationFrameStats();
@@ -1558,13 +1234,6 @@ status_t BnSurfaceComposer::onTransact(
            reply->writeInt32(result);
            return NO_ERROR;
        }
        case SET_POWER_MODE: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = data.readStrongBinder();
            int32_t mode = data.readInt32();
            setPowerMode(display, mode);
            return NO_ERROR;
        }
        case ENABLE_VSYNC_INJECTIONS: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            bool enable = false;
@@ -1714,20 +1383,6 @@ status_t BnSurfaceComposer::onTransact(
            }
            return error;
        }
        case IS_WIDE_COLOR_DISPLAY: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = nullptr;
            status_t error = data.readStrongBinder(&display);
            if (error != NO_ERROR) {
                return error;
            }
            bool result;
            error = isWideColorDisplay(display, &result);
            if (error == NO_ERROR) {
                reply->writeBool(result);
            }
            return error;
        }
        case ADD_REGION_SAMPLING_LISTENER: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            Rect samplingArea;
@@ -1925,77 +1580,6 @@ status_t BnSurfaceComposer::onTransact(
            reply->writeInt32(result);
            return result;
        }
        case GET_DISPLAY_BRIGHTNESS_SUPPORT: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> displayToken;
            status_t error = data.readNullableStrongBinder(&displayToken);
            if (error != NO_ERROR) {
                ALOGE("getDisplayBrightnessSupport: failed to read display token: %d", error);
                return error;
            }
            bool support = false;
            error = getDisplayBrightnessSupport(displayToken, &support);
            reply->writeBool(support);
            return error;
        }
        case SET_DISPLAY_BRIGHTNESS: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> displayToken;
            status_t error = data.readNullableStrongBinder(&displayToken);
            if (error != NO_ERROR) {
                ALOGE("setDisplayBrightness: failed to read display token: %d", error);
                return error;
            }
            gui::DisplayBrightness brightness;
            error = data.readParcelable(&brightness);
            if (error != NO_ERROR) {
                ALOGE("setDisplayBrightness: failed to read brightness: %d", error);
                return error;
            }
            return setDisplayBrightness(displayToken, brightness);
        }
        case ADD_HDR_LAYER_INFO_LISTENER: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> displayToken;
            status_t error = data.readNullableStrongBinder(&displayToken);
            if (error != NO_ERROR) {
                ALOGE("addHdrLayerInfoListener: Failed to read display token");
                return error;
            }
            sp<gui::IHdrLayerInfoListener> listener;
            error = data.readNullableStrongBinder(&listener);
            if (error != NO_ERROR) {
                ALOGE("addHdrLayerInfoListener: Failed to read listener");
                return error;
            }
            return addHdrLayerInfoListener(displayToken, listener);
        }
        case REMOVE_HDR_LAYER_INFO_LISTENER: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> displayToken;
            status_t error = data.readNullableStrongBinder(&displayToken);
            if (error != NO_ERROR) {
                ALOGE("removeHdrLayerInfoListener: Failed to read display token");
                return error;
            }
            sp<gui::IHdrLayerInfoListener> listener;
            error = data.readNullableStrongBinder(&listener);
            if (error != NO_ERROR) {
                ALOGE("removeHdrLayerInfoListener: Failed to read listener");
                return error;
            }
            return removeHdrLayerInfoListener(displayToken, listener);
        }
        case NOTIFY_POWER_BOOST: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            int32_t boostId;
            status_t error = data.readInt32(&boostId);
            if (error != NO_ERROR) {
                ALOGE("notifyPowerBoost: failed to read boostId: %d", error);
                return error;
            }
            return notifyPowerBoost(boostId);
        }
        case SET_GLOBAL_SHADOW_SETTINGS: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);

Loading