From d5b66ad52b8aa7e1ec82dba88a58ae893b58432e Mon Sep 17 00:00:00 2001 From: Hung-ying Tyan Date: Mon, 9 Jul 2012 14:59:51 +0800 Subject: Add existence check for DevicePolicyManager.getCameraDisabled() Bug: 6706695 Change-Id: Ib8ea8805a4bea862c8407f8c73a6e5ba1e0f49d3 --- gallerycommon/src/com/android/gallery3d/common/ApiHelper.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gallerycommon/src/com/android/gallery3d/common') diff --git a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java index b5db3c88e..4e61c77c9 100644 --- a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java +++ b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java @@ -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); -- cgit v1.2.3