diff options
-rw-r--r-- | gallerycommon/src/com/android/gallery3d/common/ApiHelper.java | 3 | ||||
-rw-r--r-- | src/com/android/gallery3d/ui/GLRootView.java | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java index 20098e4b4..b5db3c88e 100644 --- a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java +++ b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java @@ -70,6 +70,9 @@ public class ApiHelper { public static final boolean HAS_INTENT_EXTRA_LOCAL_ONLY = Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB; + public static final boolean HAS_SET_SYSTEM_UI_VISIBILITY = + hasMethod(View.class, "setSystemUiVisibility", int.class); + private static boolean hasField(Class<?> klass, String fieldName) { try { klass.getDeclaredField(fieldName); diff --git a/src/com/android/gallery3d/ui/GLRootView.java b/src/com/android/gallery3d/ui/GLRootView.java index fe4e19d7b..9fd9473dc 100644 --- a/src/com/android/gallery3d/ui/GLRootView.java +++ b/src/com/android/gallery3d/ui/GLRootView.java @@ -539,6 +539,8 @@ public class GLRootView extends GLSurfaceView @Override @TargetApi(Build.VERSION_CODES.JELLY_BEAN) public void setLightsOutMode(boolean enabled) { + if (!ApiHelper.HAS_SET_SYSTEM_UI_VISIBILITY) return; + int flags = 0; if (enabled) { flags = STATUS_BAR_HIDDEN; |