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

Commit 8a0a2a46 authored by Xin Li's avatar Xin Li
Browse files

DO NOT MERGE - Merge qt-qpr1-dev-plus-aosp@6304901 into stage-aosp-master

Bug: 151763422
Change-Id: If071a5adc6b838a4ab01508da14c1853db14155c
parents 8c35f81d b72ede4a
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -134,12 +134,8 @@ static const std::string getSystemNativeLibraries(NativeLibrary type) {
    return env;
}

int GraphicsEnv::getCanLoadSystemLibraries() {
    if (property_get_bool("ro.debuggable", false) && prctl(PR_GET_DUMPABLE, 0, 0, 0, 0)) {
        // Return an integer value since this crosses library boundaries
        return 1;
    }
    return 0;
bool GraphicsEnv::isDebuggable() {
    return prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) > 0;
}

void GraphicsEnv::setDriverPathAndSphalLibraries(const std::string path,
+10 −1
Original line number Diff line number Diff line
@@ -84,7 +84,16 @@ private:
public:
    static GraphicsEnv& getInstance();

    int getCanLoadSystemLibraries();
    // Check if the process is debuggable. It returns false except in any of the
    // following circumstances:
    // 1. ro.debuggable=1 (global debuggable enabled).
    // 2. android:debuggable="true" in the manifest for an individual app.
    // 3. An app which explicitly calls prctl(PR_SET_DUMPABLE, 1).
    // 4. GraphicsEnv calls prctl(PR_SET_DUMPABLE, 1) in the presence of
    //    <meta-data android:name="com.android.graphics.injectLayers.enable"
    //               android:value="true"/>
    //    in the application manifest.
    bool isDebuggable();

    // Set a search path for loading graphics drivers. The path is a list of
    // directories separated by ':'. A directory can be contained in a zip file
+2 −2
Original line number Diff line number Diff line
@@ -42,13 +42,13 @@ const struct timeval& TouchVideoFrame::getTimestamp() const { return mTimestamp;
void TouchVideoFrame::rotate(int32_t orientation) {
    switch (orientation) {
        case DISPLAY_ORIENTATION_90:
            rotateQuarterTurn(true /*clockwise*/);
            rotateQuarterTurn(false /*clockwise*/);
            break;
        case DISPLAY_ORIENTATION_180:
            rotate180();
            break;
        case DISPLAY_ORIENTATION_270:
            rotateQuarterTurn(false /*clockwise*/);
            rotateQuarterTurn(true /*clockwise*/);
            break;
    }
}
+4 −4
Original line number Diff line number Diff line
@@ -85,14 +85,14 @@ TEST(TouchVideoFrame, Rotate90_1x1) {

TEST(TouchVideoFrame, Rotate90_2x2) {
    TouchVideoFrame frame(2, 2, {1, 2, 3, 4}, TIMESTAMP);
    TouchVideoFrame frameRotated(2, 2, {3, 1, 4, 2}, TIMESTAMP);
    TouchVideoFrame frameRotated(2, 2, {2, 4, 1, 3}, TIMESTAMP);
    frame.rotate(DISPLAY_ORIENTATION_90);
    ASSERT_EQ(frame, frameRotated);
}

TEST(TouchVideoFrame, Rotate90_3x2) {
    TouchVideoFrame frame(3, 2, {1, 2, 3, 4, 5, 6}, TIMESTAMP);
    TouchVideoFrame frameRotated(2, 3, {5, 3, 1, 6, 4, 2}, TIMESTAMP);
    TouchVideoFrame frameRotated(2, 3, {2, 4, 6, 1, 3, 5}, TIMESTAMP);
    frame.rotate(DISPLAY_ORIENTATION_90);
    ASSERT_EQ(frame, frameRotated);
}
@@ -170,14 +170,14 @@ TEST(TouchVideoFrame, Rotate270_1x1) {

TEST(TouchVideoFrame, Rotate270_2x2) {
    TouchVideoFrame frame(2, 2, {1, 2, 3, 4}, TIMESTAMP);
    TouchVideoFrame frameRotated(2, 2, {2, 4, 1, 3}, TIMESTAMP);
    TouchVideoFrame frameRotated(2, 2, {3, 1, 4, 2}, TIMESTAMP);
    frame.rotate(DISPLAY_ORIENTATION_270);
    ASSERT_EQ(frame, frameRotated);
}

TEST(TouchVideoFrame, Rotate270_3x2) {
    TouchVideoFrame frame(3, 2, {1, 2, 3, 4, 5, 6}, TIMESTAMP);
    TouchVideoFrame frameRotated(2, 3, {2, 4, 6, 1, 3, 5}, TIMESTAMP);
    TouchVideoFrame frameRotated(2, 3, {5, 3, 1, 6, 4, 2}, TIMESTAMP);
    frame.rotate(DISPLAY_ORIENTATION_270);
    ASSERT_EQ(frame, frameRotated);
}
+1 −1
Original line number Diff line number Diff line
@@ -337,7 +337,7 @@ void LayerLoader::LoadLayers() {

    // Only enable the system search path for non-user builds
    std::string system_path;
    if (property_get_bool("ro.debuggable", false) && prctl(PR_GET_DUMPABLE, 0, 0, 0, 0)) {
    if (android::GraphicsEnv::getInstance().isDebuggable()) {
        system_path = kSystemLayerLibraryDir;
    }

Loading