4

I'm running into problems with trying to support restricted profiles on android 4.3+. I have set up the authenticator:

<service
   android:name=".account.AuthenticatorService"
   android:permission="com.example.MANAGE_ACCOUNTS">
   <intent-filter>
     <action android:name="android.accounts.AccountAuthenticator"/>
   </intent-filter>
   <meta-data
     android:name="android.accounts.AccountAuthenticator"
     android:resource="@xml/authenticator" />
</service>

And in the authenticator.xml:

<account-authenticator
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:accountType="com.example"
  android:icon="@drawable/ic_launcher"
  android:smallIcon="@drawable/ic_launcher"
  android:label="@string/label"
/>

I get a list of the available accounts and print their types:

AccountManager am = AccountManager.get(this);
accounts = am.getAccounts();

for (Account account : Accounts) {
  Log.d(TAG, account.type);
}

And get all my google accounts, a github account, a dropbox account and my "com.example" account when I run the app while logged in as the main user. Then I try it with the restricted account.

First I add in the AndroidManifest:

<application
  .
  .
  .
  android:restrictedAccountType="com.example">

and when I run the app when logged in as the restricted user, I get nothing. No accounts at all in the list. If I change the restrictedAccountType to com.google, I get a list of all my google accounts.

The account in itself has no problems as it works quite ok when the user is a "real" user... Is there something extra I need to do to register the account as being available to restricted profiles? The documentation on the feature is scarce at best...

JNissi
  • 1,120
  • 9
  • 22

0 Answers0