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

Commit 7b6fc2ce authored by Michael Wright's avatar Michael Wright Committed by Automerger Merge Worker
Browse files

Merge "Move display tests to DisplayServiceTests module" into udc-qpr-dev am:...

Merge "Move display tests to DisplayServiceTests module" into udc-qpr-dev am: ffa5a849 am: d5009cd7

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23810571



Change-Id: Ic9850445d8aeb60abaec1acd764552c64eb68a61
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 5889ec34 d5009cd7
Loading
Loading
Loading
Loading
+19 −3
Original line number Diff line number Diff line
@@ -22,11 +22,20 @@ android_test {
        "src/**/*.java",
    ],

    libs: [
        "android.test.mock",
    ],

    static_libs: [
        "services.core",
        "androidx.test.runner",
        "androidx.test.rules",
        "androidx.test.ext.junit",
        "display-core-libs",
        "frameworks-base-testutils",
        "junit",
        "junit-params",
        "platform-compat-test-rules",
        "platform-test-annotations",
        "services.core",
        "servicestests-utils",
    ],

    defaults: [
@@ -47,3 +56,10 @@ android_test {
        enabled: false,
    },
}

java_library {
    name: "display-core-libs",
    srcs: [
        "src/com/android/server/display/TestUtils.java",
    ],
}
+10 −0
Original line number Diff line number Diff line
@@ -21,6 +21,16 @@
    Insert permissions here. eg:
    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
    -->
    <uses-permission android:name="android.permission.CONTROL_DISPLAY_BRIGHTNESS" />
    <uses-permission android:name="android.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS" />
    <uses-permission android:name="android.permission.DEVICE_POWER" />
    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
    <uses-permission android:name="android.permission.LOG_COMPAT_CHANGE" />
    <uses-permission android:name="android.permission.MANAGE_ACTIVITY_TASKS" />
    <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />
    <uses-permission android:name="android.permission.READ_COMPAT_CHANGE_CONFIG" />
    <uses-permission android:name="android.permission.READ_DEVICE_CONFIG" />
    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />

    <application android:debuggable="true"
                 android:testOnly="true">
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
 * 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
 * limitations under the License.
 */

package com.android.server.display;
+0 −0

File moved.

+7 −7
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
 * 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
 * limitations under the License.
 */

package com.android.server.display;
@@ -206,11 +206,11 @@ public class BrightnessMappingStrategyTest {
        BrightnessMappingStrategy strategy = BrightnessMappingStrategy.create(res, ddc, mMockDwbc);

        strategy.setBrightnessConfiguration(null);
        final int N = DISPLAY_LEVELS_BACKLIGHT.length;
        final int n = DISPLAY_LEVELS_BACKLIGHT.length;
        final float expectedBrightness =
                (float) DISPLAY_LEVELS_BACKLIGHT[N - 1] / PowerManager.BRIGHTNESS_ON;
                (float) DISPLAY_LEVELS_BACKLIGHT[n - 1] / PowerManager.BRIGHTNESS_ON;
        assertEquals(expectedBrightness,
                strategy.getBrightness(LUX_LEVELS[N - 1]), 0.0001f /*tolerance*/);
                strategy.getBrightness(LUX_LEVELS[n - 1]), 0.0001f /*tolerance*/);
    }

    @Test
@@ -270,10 +270,10 @@ public class BrightnessMappingStrategyTest {

        // Check that null returns us to the default configuration.
        strategy.setBrightnessConfiguration(null);
        final int N = DISPLAY_LEVELS_NITS.length;
        final float expectedBrightness = DISPLAY_LEVELS_NITS[N - 1] / DISPLAY_RANGE_NITS[1];
        final int n = DISPLAY_LEVELS_NITS.length;
        final float expectedBrightness = DISPLAY_LEVELS_NITS[n - 1] / DISPLAY_RANGE_NITS[1];
        assertEquals(expectedBrightness,
                strategy.getBrightness(LUX_LEVELS[N - 1]), 0.0001f /*tolerance*/);
                strategy.getBrightness(LUX_LEVELS[n - 1]), 0.0001f /*tolerance*/);
    }

    @Test
Loading