【预期结果】:无sim卡相关项
res/values/arrays.xml <!-- Defined the hide accounts' type --> <string-array name="hide_account_list"> <item>com.android.localphone</item> <item>com.android.sim</item> </string-array>
src/com/android/settings/Utils.java
/** * Returns if need show the account with the given account type. */ public static boolean showAccount(Context context, String accountType) { String[] hideAccounts = context.getResources().getStringArray(R.array.hide_account_list); if (hideAccounts == null || hideAccounts.length == 0) return true; for (String account : hideAccounts) { if (account.equals(accountType)) return false; } return true; } src/com/android/settings/accounts/ChooseAccountActivity.java private void onAuthDescriptionsUpdated() { // Create list of providers to show on preference screen
// Create list of providers to show on preference screen for (int i = 0; i < mAuthDescs.length; i++) {
for (int i = 0; i < mAuthDescs.length; i++) { String accountType = mAuthDescs[i].type;
String accountType = mAuthDescs[i].type; if (!Utils.showAccount(this, accountType)) { // If needn't to show the account, skip this account. continue; }
