Remove missing permissions snackbar

This commit is contained in:
Venny 2020-07-17 16:42:11 +02:00
parent 391e09e729
commit b387a6e8de
2 changed files with 4 additions and 14 deletions

View File

@ -52,9 +52,7 @@ public class PeopleServiceImpl extends IPeopleService.Stub {
@Override
public void loadOwners(final IPeopleCallbacks callbacks, boolean var2, boolean var3, final String accountName, String var5, int sortOrder) {
Log.d(TAG, "loadOwners: " + var2 + ", " + var3 + ", " + accountName + ", " + var5 + ", " + sortOrder);
if (context.checkCallingPermission(Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) {
PackageUtils.assertExtendedAccess(context);
}
AccountManager accountManager = AccountManager.get(context);
Bundle accountMetadata = new Bundle();
String accountType = AuthConstants.DEFAULT_ACCOUNT_TYPE;

View File

@ -65,27 +65,19 @@ public class Conditions {
}
}).build();
private static final String[] REQUIRED_PERMISSIONS = new String[]{ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION, READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE, GET_ACCOUNTS, READ_PHONE_STATE};
private static final String[] REQUIRED_PERMISSIONS = new String[]{};
public static final Condition PERMISSIONS = new Condition.Builder()
.title(R.string.cond_perm_title)
.summaryPlurals(R.plurals.cond_perm_summary)
.evaluation(new Condition.Evaluation() {
int count = 0;
@Override
public boolean isActive(Context context) {
count = 0;
if (SDK_INT >= Build.VERSION_CODES.M) {
for (String permission : REQUIRED_PERMISSIONS) {
if (ContextCompat.checkSelfPermission(context, permission) != PERMISSION_GRANTED)
count++;
}
}
return count > 0;
return false;
}
@Override
public int getPluralsCount() {
return count;
return 0;
}
})
.firstActionPlurals(R.plurals.cond_perm_action, new View.OnClickListener() {