summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorAhan Wu <ahanwu@google.com>2020-01-02 19:23:27 +0800
committerWu Ahan <ahanwu@google.com>2020-01-02 11:38:41 +0000
commitc54169a04606ea175fb28207e370782bb5f1169d (patch)
treec0a0322e44575084d169734603eccf2e77d9ce4c /core/java/android
parentce0a793da137213541d68bdef9e75c7c081e0593 (diff)
Make some apis @TestApi and @hide for usage in tests
Some apis in class, WallpaperManager and Display, are not visible in tests, make them visible for tests usage. Bug: 142845271 Test: atest android.display.cts.DisplayTest#testGetSupportedWideColorGamut --rerun-until-failure 10 Test: atest android.app.cts.WallpaperManagerTest#testWallpaperSupportsWcg --rerun-until-failure 20 Test: atest android.app.cts.WallpaperManagerTest#testWideGamutWallpaper --rerun-until-failure 20 Change-Id: I1958df1e53aa7f65a2eb9ee7fe2a6b098ac2ab39
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/WallpaperManager.java7
-rw-r--r--core/java/android/view/Display.java4
2 files changed, 10 insertions, 1 deletions
diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java
index 2507991362a5..8eee73c882e2 100644
--- a/core/java/android/app/WallpaperManager.java
+++ b/core/java/android/app/WallpaperManager.java
@@ -568,8 +568,10 @@ public class WallpaperManager {
*
* @see Configuration#isScreenWideColorGamut()
* @return True if wcg should be enabled for this device.
+ * @hide
*/
- private boolean shouldEnableWideColorGamut() {
+ @TestApi
+ public boolean shouldEnableWideColorGamut() {
return mWcgEnabled;
}
@@ -877,6 +879,7 @@ public class WallpaperManager {
* @see #FLAG_SYSTEM
* @hide
*/
+ @TestApi
@RequiresPermission(android.Manifest.permission.READ_EXTERNAL_STORAGE)
public boolean wallpaperSupportsWcg(int which) {
if (!shouldEnableWideColorGamut()) {
@@ -893,6 +896,8 @@ public class WallpaperManager {
*
* @hide
*/
+ @TestApi
+ @Nullable
@UnsupportedAppUsage
public Bitmap getBitmap() {
return getBitmap(false);
diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java
index 4368115917e5..178b3c0cb94e 100644
--- a/core/java/android/view/Display.java
+++ b/core/java/android/view/Display.java
@@ -19,6 +19,7 @@ package android.view;
import static android.Manifest.permission.CONFIGURE_DISPLAY_COLOR_MODE;
import android.annotation.IntDef;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SuppressLint;
@@ -1010,6 +1011,9 @@ public final class Display {
* @return Supported WCG color spaces.
* @hide
*/
+ @SuppressLint("VisiblySynchronized")
+ @NonNull
+ @TestApi
public @ColorMode ColorSpace[] getSupportedWideColorGamut() {
synchronized (this) {
final ColorSpace[] defaultColorSpaces = new ColorSpace[0];