From f98f51411753e9f763a954c4fc79b76505dc7ce1 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 15 Feb 2015 09:08:42 +0100 Subject: [PATCH] Updated requirements to prevent warning Refs #1757 --- src/biz/bokhorst/xprivacy/Requirements.java | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/biz/bokhorst/xprivacy/Requirements.java b/src/biz/bokhorst/xprivacy/Requirements.java index ab71d2d56..5e92fba6f 100644 --- a/src/biz/bokhorst/xprivacy/Requirements.java +++ b/src/biz/bokhorst/xprivacy/Requirements.java @@ -150,20 +150,21 @@ public void onClick(DialogInterface dialog, int which) { reportClass(InterfaceAddress.class, context); // Check package manager service - try { - Class clazz = Class.forName("com.android.server.pm.PackageManagerService", false, null); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) try { + Class clazz = Class.forName("com.android.server.pm.PackageManagerService", false, null); try { - clazz.getDeclaredMethod("getPackageUid", String.class, int.class); - } catch (NoSuchMethodException ignored) { - clazz.getDeclaredMethod("getPackageUid", String.class); + try { + clazz.getDeclaredMethod("getPackageUid", String.class, int.class); + } catch (NoSuchMethodException ignored) { + clazz.getDeclaredMethod("getPackageUid", String.class); + } + } catch (NoSuchMethodException ex) { + reportClass(clazz, context); } - } catch (NoSuchMethodException ex) { - reportClass(clazz, context); + } catch (ClassNotFoundException ex) { + sendSupportInfo(ex.toString(), context); } - } catch (ClassNotFoundException ex) { - sendSupportInfo(ex.toString(), context); - } // Check GPS status if (!checkField(GpsStatus.class, "mSatellites"))