From 5e10834bd8771d435b13bbda0a2fc3325ab1b5c6 Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Thu, 19 Jun 2014 22:21:41 +0000 Subject: [PATCH] Revert "Add default Dialer preference to Settings" This reverts commit d4720d98723db76b8ce9e9e7385582f99d849ee6. Change-Id: I0cfc0506619892360e42a62c6bdbf6d2d3186e1c --- AndroidManifest.xml | 10 -- res/values/strings.xml | 5 - res/xml/wireless_settings.xml | 10 +- .../android/settings/PhoneDefaultDialog.java | 137 ------------------ .../android/settings/WirelessSettings.java | 48 +----- 5 files changed, 5 insertions(+), 205 deletions(-) delete mode 100644 src/com/android/settings/PhoneDefaultDialog.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index d262651a2bf..c8362f0f1c2 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1624,16 +1624,6 @@ - - - - - - - Use %1$s instead of %2$s as your SMS app? Use %s as your SMS app? - - Default phone app - - Change default phone app? - Active network scorer diff --git a/res/xml/wireless_settings.xml b/res/xml/wireless_settings.xml index bad7da66ec2..bf1523e686b 100644 --- a/res/xml/wireless_settings.xml +++ b/res/xml/wireless_settings.xml @@ -4,9 +4,9 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -29,12 +29,6 @@ android:summary="%s" android:persistent="false" /> - - dialers = - PhoneApplication.getInstalledPhoneApplications(getActivity()); - - final int count = dialers.size(); - final String[] packageNames = new String[count]; - for (int i = 0; i < count; i++) { - packageNames[i] = dialers.get(i).getPackageName(); - } - String defaultPackageName = null; - final ComponentName appName = PhoneApplication.getDefaultPhoneApplication(getActivity()); - if (appName != null) { - defaultPackageName = appName.getPackageName(); - } - mDialerApplicationPreference.setPackageNames(packageNames, defaultPackageName); - } - @Override public Dialog onCreateDialog(int dialogId) { log("onCreateDialog: dialogId=" + dialogId); @@ -263,10 +242,6 @@ public class WirelessSettings extends RestrictedSettingsFragment return mTm.isSmsCapable(); } - private boolean isVoiceCapable() { - return mTm.isVoiceCapable(); - } - @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -297,10 +272,6 @@ public class WirelessSettings extends RestrictedSettingsFragment mSmsApplicationPreference.setOnPreferenceChangeListener(this); initSmsApplicationSetting(); - mDialerApplicationPreference = (AppListPreference) findPreference(KEY_PHONE_APPLICATION); - mDialerApplicationPreference.setOnPreferenceChangeListener(this); - initDialerApplicationSetting(); - // Remove NSD checkbox by default getPreferenceScreen().removePreference(nsd); //mNsdEnabler = new NsdEnabler(activity, nsd); @@ -375,11 +346,6 @@ public class WirelessSettings extends RestrictedSettingsFragment removePreference(KEY_SMS_APPLICATION); } - // Remove Dialer setting if the device does not support voice - if (!isVoiceCapable()) { - removePreference(KEY_PHONE_APPLICATION); - } - // Remove Airplane Mode settings if it's a stationary device such as a TV. if (mPm.hasSystemFeature(PackageManager.FEATURE_TELEVISION)) { removePreference(KEY_TOGGLE_AIRPLANE); @@ -488,9 +454,6 @@ public class WirelessSettings extends RestrictedSettingsFragment if (preference == mSmsApplicationPreference && newValue != null) { SmsApplication.setDefaultApplication(newValue.toString(), getActivity()); return true; - } else if (preference == mDialerApplicationPreference && newValue != null) { - PhoneApplication.setDefaultPhoneApplication(newValue.toString(), getActivity()); - return true; } return false; } @@ -550,17 +513,12 @@ public class WirelessSettings extends RestrictedSettingsFragment } // Remove SMS Application if the device does not support SMS - final TelephonyManager tm = + TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); if (!tm.isSmsCapable()) { result.add(KEY_SMS_APPLICATION); } - // Remove Phone Application if the device is not voice capable - if (!tm.isVoiceCapable()) { - result.add(KEY_PHONE_APPLICATION); - } - final PackageManager pm = context.getPackageManager(); // Remove Airplane Mode settings if it's a stationary device such as a TV. @@ -572,8 +530,8 @@ public class WirelessSettings extends RestrictedSettingsFragment result.add(KEY_PROXY_SETTINGS); // Disable Tethering if it's not allowed or if it's a wifi-only device - final ConnectivityManager cm = (ConnectivityManager) context.getSystemService( - Context.CONNECTIVITY_SERVICE); + ConnectivityManager cm = + (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); if (isSecondaryUser || !cm.isTetheringSupported()) { result.add(KEY_TETHER_SETTINGS); }