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

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

release-request-051da47e-713f-4e09-8f6c-698fb4d4e92e-for-git_oc-dr1-release-39...

release-request-051da47e-713f-4e09-8f6c-698fb4d4e92e-for-git_oc-dr1-release-3997165 snap-temp-L04400000062809322

Change-Id: If291bb48a0dcb5cdcdb68a4ff1bf44a198542caf
parents 5f88a3df c0a749ef
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1202,7 +1202,11 @@ bool open_vdex_files(const char* apk_path, const char* out_oat_path, int dexopt_
    if (dexopt_action == DEX2OAT_FOR_BOOT_IMAGE &&
            in_vdex_wrapper_fd->get() != -1 &&
            in_vdex_path_str == out_vdex_path_str) {
        out_vdex_wrapper_fd->reset(in_vdex_wrapper_fd->get());
        // We unlink the file in case the invocation of dex2oat fails, to ensure we don't
        // have bogus stale vdex files.
        out_vdex_wrapper_fd->reset(
              in_vdex_wrapper_fd->get(),
              [out_vdex_path_str]() { unlink(out_vdex_path_str.c_str()); });
        // Disable auto close for the in wrapper fd (it will be done when destructing the out
        // wrapper).
        in_vdex_wrapper_fd->DisableAutoClose();
+104 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 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.
 */

#ifndef _LIBINPUT_DISPLAY_VIEWPORT_H
#define _LIBINPUT_DISPLAY_VIEWPORT_H

#include <ui/DisplayInfo.h>
#include <input/Input.h>

namespace android {

/*
 * Describes how coordinates are mapped on a physical display.
 * See com.android.server.display.DisplayViewport.
 */
struct DisplayViewport {
    int32_t displayId; // -1 if invalid
    int32_t orientation;
    int32_t logicalLeft;
    int32_t logicalTop;
    int32_t logicalRight;
    int32_t logicalBottom;
    int32_t physicalLeft;
    int32_t physicalTop;
    int32_t physicalRight;
    int32_t physicalBottom;
    int32_t deviceWidth;
    int32_t deviceHeight;
    String8 uniqueId;

    DisplayViewport() :
            displayId(ADISPLAY_ID_NONE), orientation(DISPLAY_ORIENTATION_0),
            logicalLeft(0), logicalTop(0), logicalRight(0), logicalBottom(0),
            physicalLeft(0), physicalTop(0), physicalRight(0), physicalBottom(0),
            deviceWidth(0), deviceHeight(0) {
    }

    bool operator==(const DisplayViewport& other) const {
        return displayId == other.displayId
                && orientation == other.orientation
                && logicalLeft == other.logicalLeft
                && logicalTop == other.logicalTop
                && logicalRight == other.logicalRight
                && logicalBottom == other.logicalBottom
                && physicalLeft == other.physicalLeft
                && physicalTop == other.physicalTop
                && physicalRight == other.physicalRight
                && physicalBottom == other.physicalBottom
                && deviceWidth == other.deviceWidth
                && deviceHeight == other.deviceHeight
                && uniqueId == other.uniqueId;
    }

    bool operator!=(const DisplayViewport& other) const {
        return !(*this == other);
    }

    inline bool isValid() const {
        return displayId >= 0;
    }

    void setNonDisplayViewport(int32_t width, int32_t height) {
        displayId = ADISPLAY_ID_NONE;
        orientation = DISPLAY_ORIENTATION_0;
        logicalLeft = 0;
        logicalTop = 0;
        logicalRight = width;
        logicalBottom = height;
        physicalLeft = 0;
        physicalTop = 0;
        physicalRight = width;
        physicalBottom = height;
        deviceWidth = width;
        deviceHeight = height;
        uniqueId.clear();
    }
};

/**
 * Describes the different type of viewports supported by input flinger.
 * Keep in sync with values in InputManagerService.java.
 */
enum class ViewportType : int32_t {
    VIEWPORT_INTERNAL = 1,
    VIEWPORT_EXTERNAL = 2,
    VIEWPORT_VIRTUAL = 3,
};

} // namespace android

#endif // _LIBINPUT_DISPLAY_VIEWPORT_H
+28 −0
Original line number Diff line number Diff line
// Copyright (C) 2017 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.

cc_library_shared {
    name: "libgraphicsenv",

    srcs: [
        "GraphicsEnv.cpp",
    ],

    shared_libs: [
        "libnativeloader",
        "liblog",
    ],

    export_include_dirs: ["include"],
}
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

//#define LOG_NDEBUG 1
#define LOG_TAG "GraphicsEnv"
#include <ui/GraphicsEnv.h>
#include <graphicsenv/GraphicsEnv.h>

#include <mutex>

Loading