From e8ec4d280c75dc1aa5eb58dfaf49b35c9b6c8776 Mon Sep 17 00:00:00 2001 From: Dominik Date: Sat, 17 Nov 2012 20:06:39 +0100 Subject: [PATCH] permission check not for own app --- .../src/org/thialfihar/android/apg/helper/OtherHelper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/org_apg/src/org/thialfihar/android/apg/helper/OtherHelper.java b/org_apg/src/org/thialfihar/android/apg/helper/OtherHelper.java index 7d618406b..bd5db2410 100644 --- a/org_apg/src/org/thialfihar/android/apg/helper/OtherHelper.java +++ b/org_apg/src/org/thialfihar/android/apg/helper/OtherHelper.java @@ -141,12 +141,13 @@ public class OtherHelper { for (int i = 0; i < restrictedActions.length; i++) { if (restrictedActions[i].equals(action)) { if (pkgName != null - && pkgManager.checkPermission(permName, pkgName) == PackageManager.PERMISSION_GRANTED) { + && (pkgManager.checkPermission(permName, pkgName) == PackageManager.PERMISSION_GRANTED || pkgName + .equals(Constants.PACKAGE_NAME))) { Log.d(Constants.TAG, pkgName + " has permission " + permName + ". Action " + action + " was granted!"); } else { - String error = pkgName + " does NOT have permission " + permName + ". Action " - + action + " was NOT granted!"; + String error = pkgName + " does NOT have permission " + permName + + ". Action " + action + " was NOT granted!"; Log.e(Constants.TAG, error); Toast.makeText(activity, activity.getString(R.string.errorMessage, error), Toast.LENGTH_LONG).show();