Loading core/java/android/accounts/ChooseTypeAndAccountActivity.java +14 −5 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.os.UserManager; import android.text.TextUtils; import android.util.Log; import android.view.View; import android.view.Window; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; Loading Loading @@ -127,6 +128,7 @@ public class ChooseTypeAndAccountActivity extends Activity private int mCallingUid; private String mCallingPackage; private boolean mDisallowAddAccounts; private boolean mDontShowPicker; @Override public void onCreate(Bundle savedInstanceState) { Loading Loading @@ -189,11 +191,23 @@ public class ChooseTypeAndAccountActivity extends Activity mSetOfRelevantAccountTypes = getReleventAccountTypes(intent); mAlwaysPromptForAccount = intent.getBooleanExtra(EXTRA_ALWAYS_PROMPT_FOR_ACCOUNT, false); mDescriptionOverride = intent.getStringExtra(EXTRA_DESCRIPTION_TEXT_OVERRIDE); // Need to do this once here to request the window feature. Can't do it in onResume mAccounts = getAcceptableAccountChoices(AccountManager.get(this)); if (mAccounts.isEmpty() && mDisallowAddAccounts) { requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.app_not_authorized); mDontShowPicker = true; } } @Override protected void onResume() { super.onResume(); if (mDontShowPicker) return; final AccountManager accountManager = AccountManager.get(this); mAccounts = getAcceptableAccountChoices(accountManager); Loading @@ -206,11 +220,6 @@ public class ChooseTypeAndAccountActivity extends Activity // If there are no relevant accounts and only one relevant account type go directly to // add account. Otherwise let the user choose. if (mAccounts.isEmpty()) { if (mDisallowAddAccounts) { setContentView(R.layout.app_not_authorized); setTitle(R.string.error_message_title); return; } if (mSetOfRelevantAccountTypes.size() == 1) { runAddAccountForAuthenticator(mSetOfRelevantAccountTypes.iterator().next()); } else { Loading core/res/AndroidManifest.xml +1 −2 Original line number Diff line number Diff line Loading @@ -2298,8 +2298,7 @@ <activity android:name="android.accounts.CantAddAccountActivity" android:excludeFromRecents="true" android:exported="true" android:theme="@android:style/Theme.Holo.Dialog" android:label="@string/error_message_title" android:theme="@android:style/Theme.Holo.Dialog.NoActionBar" android:process=":ui"> </activity> Loading core/res/res/values/strings.xml +1 −1 Original line number Diff line number Diff line Loading @@ -4123,7 +4123,7 @@ <!-- Error message title [CHAR LIMIT=35] --> <string name="error_message_title">Error</string> <!-- Message informing user that app is not permitted to access accounts. [CHAR LIMIT=none] --> <string name="app_no_restricted_accounts">This application does not support accounts for restricted profiles</string> <string name="app_no_restricted_accounts">This app doesn\'t support accounts for restricted profiles</string> <!-- Message informing user that the requested activity could not be found [CHAR LIMIT=none] --> <string name="app_not_found">No application found to handle this action</string> <string name="revoke">Revoke</string> Loading Loading
core/java/android/accounts/ChooseTypeAndAccountActivity.java +14 −5 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.os.UserManager; import android.text.TextUtils; import android.util.Log; import android.view.View; import android.view.Window; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; Loading Loading @@ -127,6 +128,7 @@ public class ChooseTypeAndAccountActivity extends Activity private int mCallingUid; private String mCallingPackage; private boolean mDisallowAddAccounts; private boolean mDontShowPicker; @Override public void onCreate(Bundle savedInstanceState) { Loading Loading @@ -189,11 +191,23 @@ public class ChooseTypeAndAccountActivity extends Activity mSetOfRelevantAccountTypes = getReleventAccountTypes(intent); mAlwaysPromptForAccount = intent.getBooleanExtra(EXTRA_ALWAYS_PROMPT_FOR_ACCOUNT, false); mDescriptionOverride = intent.getStringExtra(EXTRA_DESCRIPTION_TEXT_OVERRIDE); // Need to do this once here to request the window feature. Can't do it in onResume mAccounts = getAcceptableAccountChoices(AccountManager.get(this)); if (mAccounts.isEmpty() && mDisallowAddAccounts) { requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.app_not_authorized); mDontShowPicker = true; } } @Override protected void onResume() { super.onResume(); if (mDontShowPicker) return; final AccountManager accountManager = AccountManager.get(this); mAccounts = getAcceptableAccountChoices(accountManager); Loading @@ -206,11 +220,6 @@ public class ChooseTypeAndAccountActivity extends Activity // If there are no relevant accounts and only one relevant account type go directly to // add account. Otherwise let the user choose. if (mAccounts.isEmpty()) { if (mDisallowAddAccounts) { setContentView(R.layout.app_not_authorized); setTitle(R.string.error_message_title); return; } if (mSetOfRelevantAccountTypes.size() == 1) { runAddAccountForAuthenticator(mSetOfRelevantAccountTypes.iterator().next()); } else { Loading
core/res/AndroidManifest.xml +1 −2 Original line number Diff line number Diff line Loading @@ -2298,8 +2298,7 @@ <activity android:name="android.accounts.CantAddAccountActivity" android:excludeFromRecents="true" android:exported="true" android:theme="@android:style/Theme.Holo.Dialog" android:label="@string/error_message_title" android:theme="@android:style/Theme.Holo.Dialog.NoActionBar" android:process=":ui"> </activity> Loading
core/res/res/values/strings.xml +1 −1 Original line number Diff line number Diff line Loading @@ -4123,7 +4123,7 @@ <!-- Error message title [CHAR LIMIT=35] --> <string name="error_message_title">Error</string> <!-- Message informing user that app is not permitted to access accounts. [CHAR LIMIT=none] --> <string name="app_no_restricted_accounts">This application does not support accounts for restricted profiles</string> <string name="app_no_restricted_accounts">This app doesn\'t support accounts for restricted profiles</string> <!-- Message informing user that the requested activity could not be found [CHAR LIMIT=none] --> <string name="app_not_found">No application found to handle this action</string> <string name="revoke">Revoke</string> Loading