diff options
Diffstat (limited to 'src/com/android/contacts/common/preference/ContactsPreferences.java')
-rw-r--r-- | src/com/android/contacts/common/preference/ContactsPreferences.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/com/android/contacts/common/preference/ContactsPreferences.java b/src/com/android/contacts/common/preference/ContactsPreferences.java index 311d0075..5c07f83f 100644 --- a/src/com/android/contacts/common/preference/ContactsPreferences.java +++ b/src/com/android/contacts/common/preference/ContactsPreferences.java @@ -27,6 +27,7 @@ import android.provider.ContactsContract; import android.provider.Settings; import android.provider.Settings.SettingNotFoundException; +import android.text.TextUtils; import com.android.contacts.common.R; /** @@ -54,6 +55,11 @@ public final class ContactsPreferences implements OnSharedPreferenceChangeListen public static final String SORT_ORDER_KEY = "android.contacts.SORT_ORDER"; /** + * The values of SIMs serial numbers that have been imported + */ + public static final String IMPORTED_SIMS_SNS = "android.contacts.IMPORTED_SIMS"; + + /** * The value for the SORT_ORDER key corresponding to sort by family name first. */ public static final int SORT_ORDER_ALTERNATIVE = 2; @@ -105,6 +111,28 @@ public final class ContactsPreferences implements OnSharedPreferenceChangeListen editor.commit(); } + public String[] getImportedSims() { + String imported = mPreferences.getString(IMPORTED_SIMS_SNS, ""); + if (!TextUtils.isEmpty(imported)) { + return imported.split("\\|"); + } else { + return new String[0]; + } + } + + public void addImportedSims(String simSN) { + String imported = mPreferences.getString(IMPORTED_SIMS_SNS, ""); + if (!TextUtils.isEmpty(imported)) { + imported += "|" + simSN; + } else { + imported = simSN; + } + + final Editor editor = mPreferences.edit(); + editor.putString(IMPORTED_SIMS_SNS, imported); + editor.commit(); + } + public boolean isDisplayOrderUserChangeable() { return mContext.getResources().getBoolean(R.bool.config_display_order_user_changeable); } |