summaryrefslogtreecommitdiffstats
path: root/sip/src/com/android/services/telephony/sip
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2014-09-15 17:58:14 -0700
committerNancy Chen <nancychen@google.com>2014-09-16 13:58:56 -0700
commit90f2ffdd00b47e2cd863d4361204c1a6fb31e3a0 (patch)
treed6ed64932dce94f74314c99eee4e7f259b871bd4 /sip/src/com/android/services/telephony/sip
parentcbc6088645d1eb1054f48af4e48730084dbcbf9f (diff)
downloadandroid_packages_services_Telephony-90f2ffdd00b47e2cd863d4361204c1a6fb31e3a0.tar.gz
android_packages_services_Telephony-90f2ffdd00b47e2cd863d4361204c1a6fb31e3a0.tar.bz2
android_packages_services_Telephony-90f2ffdd00b47e2cd863d4361204c1a6fb31e3a0.zip
Remove ability to enable/disable phoneaccounts (2/6)
Enabling/disabling of phone accounts was only used for SIP accounts and is no longer necessary for the purpose it was put in. - Remove all references to enabling/disabling phone accounts - Remove PhoneAccountSelectionPreferenceActivity and related UI code + Rename getEnabledPhoneAccounts -> getCallCapablePhoneAccounts Bug: 17510811 Change-Id: I6ea5c73bc62f35c2e487dd4d1262c0336b8b6e1e
Diffstat (limited to 'sip/src/com/android/services/telephony/sip')
-rw-r--r--sip/src/com/android/services/telephony/sip/SipAccountRegistry.java52
-rw-r--r--sip/src/com/android/services/telephony/sip/SipBroadcastReceiver.java14
-rw-r--r--sip/src/com/android/services/telephony/sip/SipSettings.java6
-rw-r--r--sip/src/com/android/services/telephony/sip/SipUtil.java14
4 files changed, 4 insertions, 82 deletions
diff --git a/sip/src/com/android/services/telephony/sip/SipAccountRegistry.java b/sip/src/com/android/services/telephony/sip/SipAccountRegistry.java
index 9c52324d6..c80813339 100644
--- a/sip/src/com/android/services/telephony/sip/SipAccountRegistry.java
+++ b/sip/src/com/android/services/telephony/sip/SipAccountRegistry.java
@@ -177,38 +177,6 @@ final class SipAccountRegistry {
}
/**
- * Handles a {@link PhoneAccount} becoming enabled by starting the SIP service for the
- * {@link SipProfile} associated with that {@linke PhoneAccount}.
- *
- * @param context The context.
- * @param phoneAccountHandle The handle for the {@link PhoneAccount} which is enabled.
- */
- void setPhoneAccountEnabled(Context context, PhoneAccountHandle phoneAccountHandle) {
- String sipUri = SipUtil.getSipUriFromPhoneAccount(phoneAccountHandle);
- if (sipUri == null) {
- return;
- }
-
- startSipService(context, sipUri);
- }
-
- /**
- * Handles a {@link PhoneAccount} becoming disabled by stopping the SIP service for the
- * {@link SipProfile} associated with that {@linke PhoneAccount}.
- *
- * @param context The context.
- * @param phoneAccountHandle The handle for the {@link PhoneAccount} which is disabled.
- */
- void setPhoneAccountDisabled(Context context, PhoneAccountHandle phoneAccountHandle) {
- String sipUri = SipUtil.getSipUriFromPhoneAccount(phoneAccountHandle);
- if (sipUri == null) {
- return;
- }
-
- stopSipService(context, sipUri);
- }
-
- /**
* Performs an asynchronous call to
* {@link SipAccountRegistry#startSipProfiles(android.content.Context, String)}, starting the
* specified SIP profile and registering its {@link android.telecom.PhoneAccount}.
@@ -232,11 +200,6 @@ final class SipAccountRegistry {
* each with the telecom framework. If a specific sipUri is specified, this will only register
* the associated SIP account.
*
- * Also handles migration from using the primary account shared preference to indicate the
- * {@link SipProfile} to be used for outgoing Sip connections to using the enabled flag on
- * {@link android.telecom.PhoneAccount}s to indicate which profiles can be used for outgoing
- * or ingoing calls.
- *
* @param context The context.
* @param sipUri A specific SIP uri to start, or {@code null} to start all.
*/
@@ -255,21 +218,10 @@ final class SipAccountRegistry {
if (sipUri == null || Objects.equals(sipUri, profile.getUriString())) {
PhoneAccount phoneAccount = SipUtil.createPhoneAccount(context, profile);
telecomManager.registerPhoneAccount(phoneAccount);
-
- // If this profile was the primary profile in the past, mark it as enabled.
- boolean isPrimaryProfile = primaryProfile != null &&
- profile.getUriString().equals(primaryProfile);
- if (isPrimaryProfile) {
- telecomManager.setPhoneAccountEnabled(
- phoneAccount.getAccountHandle(), true);
- }
}
- // Start the SIP service for the profile.
- if (SipUtil.isPhoneAccountEnabled(context, profile)) {
- if (sipUri == null || Objects.equals(sipUri, profile.getUriString())) {
- startSipServiceForProfile(profile, sipManager, context, isReceivingCalls);
- }
+ if (sipUri == null || Objects.equals(sipUri, profile.getUriString())) {
+ startSipServiceForProfile(profile, sipManager, context, isReceivingCalls);
}
}
diff --git a/sip/src/com/android/services/telephony/sip/SipBroadcastReceiver.java b/sip/src/com/android/services/telephony/sip/SipBroadcastReceiver.java
index d3d274d44..0b701ce66 100644
--- a/sip/src/com/android/services/telephony/sip/SipBroadcastReceiver.java
+++ b/sip/src/com/android/services/telephony/sip/SipBroadcastReceiver.java
@@ -51,20 +51,6 @@ public class SipBroadcastReceiver extends BroadcastReceiver {
if (VERBOSE) log("SIP_REMOVE_PHONE " +
intent.getStringExtra(SipManager.EXTRA_LOCAL_URI));
sipAccountRegistry.removeSipProfile(intent.getStringExtra(SipManager.EXTRA_LOCAL_URI));
- } else if (action.equals(TelecomManager.ACTION_PHONE_ACCOUNT_ENABLED)) {
- PhoneAccountHandle phoneAccountHandle = intent.getParcelableExtra(
- TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE);
- if (phoneAccountHandle == null) {
- return;
- }
- sipAccountRegistry.setPhoneAccountEnabled(context, phoneAccountHandle);
- } else if (action.equals(TelecomManager.ACTION_PHONE_ACCOUNT_DISABLED)) {
- PhoneAccountHandle phoneAccountHandle = intent.getParcelableExtra(
- TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE);
- if (phoneAccountHandle == null) {
- return;
- }
- sipAccountRegistry.setPhoneAccountDisabled(context, phoneAccountHandle);
} else {
if (VERBOSE) log("onReceive, action not processed: " + action);
}
diff --git a/sip/src/com/android/services/telephony/sip/SipSettings.java b/sip/src/com/android/services/telephony/sip/SipSettings.java
index 875b31264..525fd0faa 100644
--- a/sip/src/com/android/services/telephony/sip/SipSettings.java
+++ b/sip/src/com/android/services/telephony/sip/SipSettings.java
@@ -99,8 +99,7 @@ public class SipSettings extends PreferenceActivity {
void setProfile(SipProfile p) {
mProfile = p;
setTitle(getProfileName(p));
- boolean isEnabled = SipUtil.isPhoneAccountEnabled(getContext(), p);
- updateSummary(isEnabled && mSipSharedPreferences.isReceivingCallsEnabled()
+ updateSummary(mSipSharedPreferences.isReceivingCallsEnabled()
? getString(R.string.registration_status_checking_status)
: getString(R.string.registration_status_not_receiving));
}
@@ -300,8 +299,7 @@ public class SipSettings extends PreferenceActivity {
if (!mSipSharedPreferences.isReceivingCallsEnabled()) return;
for (SipProfile p : mSipProfileList) {
- if (mUid == p.getCallingUid() &&
- SipUtil.isPhoneAccountEnabled(getApplicationContext(), p)) {
+ if (mUid == p.getCallingUid()) {
try {
mSipManager.setRegistrationListener(
p.getUriString(), createRegistrationListener());
diff --git a/sip/src/com/android/services/telephony/sip/SipUtil.java b/sip/src/com/android/services/telephony/sip/SipUtil.java
index 458aaeb1d..e4d5d4ca4 100644
--- a/sip/src/com/android/services/telephony/sip/SipUtil.java
+++ b/sip/src/com/android/services/telephony/sip/SipUtil.java
@@ -95,20 +95,6 @@ public class SipUtil {
}
/**
- * Determines if the {@link android.tlecom.PhoneAccount} associated with a {@link SipProfile}
- * is enabled.
- *
- * @param context The {@link Context}.
- * @param profile The {@link SipProfile}.
- * @return {@code True} if the {@code PhoneAccount} is enabled.
- */
- static boolean isPhoneAccountEnabled(Context context, SipProfile profile) {
- PhoneAccount phoneAccount = TelecomManager.from(context)
- .getPhoneAccount(SipUtil.createAccountHandle(context, profile.getUriString()));
- return phoneAccount != null && phoneAccount.isEnabled();
- }
-
- /**
* Creates a PhoneAccount for a SipProfile.
*
* @param context The context