diff options
author | Yorke Lee <yorkelee@google.com> | 2014-07-16 00:06:12 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-07-15 16:05:07 +0000 |
commit | a5b475bbc4a0a41c3d0d8fc31b955e1fd96b1c9f (patch) | |
tree | adeffa3f76467b51a8ec3040327245910e14c2b8 /src | |
parent | 9072432dbf1d46aaeed2c02f48af925b393457bb (diff) | |
parent | af6f195af0bb200d1bb06ad11dac476e8dff0073 (diff) |
Merge "Make ContactPreferences use SharedPreferences instead of System settings (5/5)" into lmp-dev
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 9 | ||||
-rw-r--r-- | src/com/android/dialer/settings/DialerSettingsActivity.java | 54 |
2 files changed, 57 insertions, 6 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 4c54568a5..a19964b60 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -82,6 +82,7 @@ import com.android.dialer.list.RegularSearchFragment; import com.android.dialer.list.SearchFragment; import com.android.dialer.list.SmartDialSearchFragment; import com.android.dialer.list.SpeedDialFragment; +import com.android.dialer.settings.DialerSettingsActivity; import com.android.dialer.util.DialerUtils; import com.android.dialer.widget.ActionBarController; import com.android.dialer.widget.SearchEditTextLayout; @@ -518,12 +519,8 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } protected void handleMenuSettings() { - openTelephonySetting(this); - } - - public static void openTelephonySetting(Activity activity) { - final Intent settingsIntent = getCallSettingsIntent(); - activity.startActivity(settingsIntent); + final Intent intent = new Intent(this, DialerSettingsActivity.class); + startActivity(intent); } @Override diff --git a/src/com/android/dialer/settings/DialerSettingsActivity.java b/src/com/android/dialer/settings/DialerSettingsActivity.java new file mode 100644 index 000000000..904be82b8 --- /dev/null +++ b/src/com/android/dialer/settings/DialerSettingsActivity.java @@ -0,0 +1,54 @@ +package com.android.dialer.settings; + +import android.content.SharedPreferences; +import android.os.Bundle; +import android.preference.PreferenceActivity; +import android.preference.PreferenceManager; +import android.preference.PreferenceActivity.Header; +import android.view.MenuItem; + +import com.android.contacts.common.preference.DisplayOptionsPreferenceFragment; +import com.android.dialer.DialtactsActivity; +import com.android.dialer.R; + +import java.util.List; + +public class DialerSettingsActivity extends PreferenceActivity { + + protected SharedPreferences mPreferences; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + mPreferences = PreferenceManager.getDefaultSharedPreferences(this); + } + + @Override + public void onBuildHeaders(List<Header> target) { + final Header contactDisplayHeader = new Header(); + contactDisplayHeader.titleRes = R.string.settings_contact_display_options_title; + contactDisplayHeader.summaryRes = R.string.settings_contact_display_options_description; + contactDisplayHeader.fragment = DisplayOptionsPreferenceFragment.class.getName(); + target.add(contactDisplayHeader); + + final Header callSettingHeader = new Header(); + callSettingHeader.titleRes = R.string.call_settings_label; + callSettingHeader.summaryRes = R.string.call_settings_description; + callSettingHeader.intent = DialtactsActivity.getCallSettingsIntent(); + target.add(callSettingHeader); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if (item.getItemId() == android.R.id.home) { + onBackPressed(); + return true; + } + return false; + } + + @Override + protected boolean isValidFragment(String fragmentName) { + return true; + } +} |