mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2024-11-18 18:19:26 +01:00
Remove missing permissions snackbar
This commit is contained in:
parent
391e09e729
commit
b387a6e8de
@ -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;
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user