Loading services/tests/displayservicetests/Android.bp +19 −3 Original line number Diff line number Diff line Loading @@ -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: [ Loading @@ -47,3 +56,10 @@ android_test { enabled: false, }, } java_library { name: "display-core-libs", srcs: [ "src/com/android/server/display/TestUtils.java", ], } services/tests/displayservicetests/AndroidManifest.xml +10 −0 Original line number Diff line number Diff line Loading @@ -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"> Loading services/tests/servicestests/src/com/android/server/display/AmbientBrightnessStatsTrackerTest.java→services/tests/displayservicetests/src/com/android/server/display/AmbientBrightnessStatsTrackerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading services/tests/servicestests/src/com/android/server/display/AutomaticBrightnessControllerTest.java→services/tests/displayservicetests/src/com/android/server/display/AutomaticBrightnessControllerTest.java +0 −0 File moved. View file services/tests/servicestests/src/com/android/server/display/BrightnessMappingStrategyTest.java→services/tests/displayservicetests/src/com/android/server/display/BrightnessMappingStrategyTest.java +7 −7 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 Loading Loading @@ -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 Loading
services/tests/displayservicetests/Android.bp +19 −3 Original line number Diff line number Diff line Loading @@ -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: [ Loading @@ -47,3 +56,10 @@ android_test { enabled: false, }, } java_library { name: "display-core-libs", srcs: [ "src/com/android/server/display/TestUtils.java", ], }
services/tests/displayservicetests/AndroidManifest.xml +10 −0 Original line number Diff line number Diff line Loading @@ -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"> Loading
services/tests/servicestests/src/com/android/server/display/AmbientBrightnessStatsTrackerTest.java→services/tests/displayservicetests/src/com/android/server/display/AmbientBrightnessStatsTrackerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading
services/tests/servicestests/src/com/android/server/display/AutomaticBrightnessControllerTest.java→services/tests/displayservicetests/src/com/android/server/display/AutomaticBrightnessControllerTest.java +0 −0 File moved. View file
services/tests/servicestests/src/com/android/server/display/BrightnessMappingStrategyTest.java→services/tests/displayservicetests/src/com/android/server/display/BrightnessMappingStrategyTest.java +7 −7 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 Loading Loading @@ -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