permission check not for own app

This commit is contained in:
Dominik 2012-11-17 20:06:39 +01:00
parent 0123bef9ce
commit e8ec4d280c

View File

@ -141,12 +141,13 @@ public class OtherHelper {
for (int i = 0; i < restrictedActions.length; i++) { for (int i = 0; i < restrictedActions.length; i++) {
if (restrictedActions[i].equals(action)) { if (restrictedActions[i].equals(action)) {
if (pkgName != null 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 " Log.d(Constants.TAG, pkgName + " has permission " + permName + ". Action "
+ action + " was granted!"); + action + " was granted!");
} else { } else {
String error = pkgName + " does NOT have permission " + permName + ". Action " String error = pkgName + " does NOT have permission " + permName
+ action + " was NOT granted!"; + ". Action " + action + " was NOT granted!";
Log.e(Constants.TAG, error); Log.e(Constants.TAG, error);
Toast.makeText(activity, activity.getString(R.string.errorMessage, error), Toast.makeText(activity, activity.getString(R.string.errorMessage, error),
Toast.LENGTH_LONG).show(); Toast.LENGTH_LONG).show();