OSDN Git Service

Add existence check for DevicePolicyManager.getCameraDisabled()
authorHung-ying Tyan <tyanh@google.com>
Mon, 9 Jul 2012 06:59:51 +0000 (14:59 +0800)
committerHung-ying Tyan <tyanh@google.com>
Tue, 10 Jul 2012 07:08:21 +0000 (15:08 +0800)
Bug: 6706695
Change-Id: Ib8ea8805a4bea862c8407f8c73a6e5ba1e0f49d3

gallerycommon/src/com/android/gallery3d/common/ApiHelper.java

index b5db3c8..4e61c77 100644 (file)
@@ -17,6 +17,8 @@
 package com.android.gallery3d.common;
 
 import android.app.Activity;
+import android.app.admin.DevicePolicyManager;
+import android.content.ComponentName;
 import android.os.Build;
 import android.provider.MediaStore.MediaColumns;
 import android.view.View;
@@ -73,6 +75,9 @@ public class ApiHelper {
     public static final boolean HAS_SET_SYSTEM_UI_VISIBILITY =
             hasMethod(View.class, "setSystemUiVisibility", int.class);
 
+    public static final boolean HAS_GET_CAMERA_DISABLED =
+            hasMethod(DevicePolicyManager.class, "getCameraDisabled", ComponentName.class);
+
     private static boolean hasField(Class<?> klass, String fieldName) {
         try {
             klass.getDeclaredField(fieldName);