summaryrefslogtreecommitdiffstats
path: root/services/tests
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2015-09-08 14:36:35 -0700
committerThe Android Automerger <android-build@google.com>2015-09-08 18:44:29 -0700
commit40bb46d77f3decad35273d509f32fd05bd2ed2ac (patch)
tree064394ac685d16dc0d454d0bc268688deac924cd /services/tests
parent704a5a0c72a95d2b12b3410fb0a26399908055d4 (diff)
downloadframeworks_base-40bb46d77f3decad35273d509f32fd05bd2ed2ac.zip
frameworks_base-40bb46d77f3decad35273d509f32fd05bd2ed2ac.tar.gz
frameworks_base-40bb46d77f3decad35273d509f32fd05bd2ed2ac.tar.bz2
Add get_accounts app op
For each runtime permission we have an app op to toggle the permission for legacy apps as they cannot handle permission revocations. We were lacking an app op for get_accounts which prevented the user from controlling access to accounts regardelss that they change the state of the permission toggle in the UI. Even worse the permission UI is written with the assumption that every runtime permission has an app op and as a result revoking the contacts group (if the app requests the get_accounts permission) is reset back to allowed in the UI. bug:23854618 Change-Id: I9e3f9bfeb320bed561d718db99ee285915d5701b
Diffstat (limited to 'services/tests')
-rw-r--r--services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java
index 0f20dde..f9aa124 100644
--- a/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java
@@ -82,7 +82,7 @@ public class AccountManagerServiceTest extends AndroidTestCase {
mAms.addAccountExplicitly(a31, "p31", null);
mAms.addAccountExplicitly(a32, "p32", null);
- Account[] accounts = mAms.getAccounts(null);
+ Account[] accounts = mAms.getAccounts(null, mContext.getOpPackageName());
Arrays.sort(accounts, new AccountSorter());
assertEquals(6, accounts.length);
assertEquals(a11, accounts[0]);
@@ -92,7 +92,7 @@ public class AccountManagerServiceTest extends AndroidTestCase {
assertEquals(a22, accounts[4]);
assertEquals(a32, accounts[5]);
- accounts = mAms.getAccounts("type1" );
+ accounts = mAms.getAccounts("type1", mContext.getOpPackageName());
Arrays.sort(accounts, new AccountSorter());
assertEquals(3, accounts.length);
assertEquals(a11, accounts[0]);
@@ -101,7 +101,7 @@ public class AccountManagerServiceTest extends AndroidTestCase {
mAms.removeAccountInternal(a21);
- accounts = mAms.getAccounts("type1" );
+ accounts = mAms.getAccounts("type1", mContext.getOpPackageName());
Arrays.sort(accounts, new AccountSorter());
assertEquals(2, accounts.length);
assertEquals(a11, accounts[0]);