Merge "Remove unused data repository."
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index ce774d8..9f9269e 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -22,10 +22,6 @@
android:sharedUserLabel="@string/phoneAppLabel"
>
- <uses-sdk
- android:minSdkVersion="23"
- android:targetSdkVersion="26" />
-
<original-package android:name="com.android.phone" />
<protected-broadcast android:name="android.telecom.action.TTY_PREFERRED_MODE_CHANGED" />
@@ -92,6 +88,10 @@
<protected-broadcast android:name= "android.telephony.action.SIM_SLOT_STATUS_CHANGED" />
<protected-broadcast android:name= "android.telephony.action.SUBSCRIPTION_CARRIER_IDENTITY_CHANGED" />
<protected-broadcast android:name= "android.telephony.action.SUBSCRIPTION_PRECISE_CARRIER_IDENTITY_CHANGED" />
+ <protected-broadcast android:name= "android.telephony.action.NETWORK_COUNTRY_CHANGED" />
+
+ <!-- For Vendor Debugging in Telephony -->
+ <protected-broadcast android:name="android.telephony.debug.action.DEBUG_EVENT" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.CALL_PHONE" />
diff --git a/res/layout/pref_dialog_editpin.xml b/res/layout/pref_dialog_editpin.xml
index a278690..94cdadf 100644
--- a/res/layout/pref_dialog_editpin.xml
+++ b/res/layout/pref_dialog_editpin.xml
@@ -22,7 +22,7 @@
android:orientation="vertical"
android:padding="?android:attr/dialogPreferredPadding">
- <TextView android:id="@+android:id/message"
+ <TextView android:id="@android:id/message"
style="?android:attr/textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index 86babd5..465b89a 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -485,7 +485,7 @@
public void onIntentUpdate(Intent intent) {
if (!mUnavailable) {
- updateCurrentTab(intent);
+ updateCurrentTab(intent.getExtras());
}
}
@@ -583,8 +583,7 @@
}
};
- private int getSlotIdFromIntent(Intent intent) {
- Bundle data = intent.getExtras();
+ private int getSlotIdFromBundle(Bundle data) {
int subId = -1;
if (data != null) {
subId = data.getInt(Settings.EXTRA_SUB_ID, -1);
@@ -754,8 +753,8 @@
mEmptyTabContent);
}
- private void updateCurrentTab(Intent intent) {
- int slotId = getSlotIdFromIntent(intent);
+ private void updateCurrentTab(Bundle data) {
+ int slotId = getSlotIdFromBundle(data);
if (slotId >= 0 && mTabHost != null && mTabHost.getCurrentTab() != slotId) {
mTabHost.setCurrentTab(slotId);
}
@@ -768,6 +767,9 @@
// If advanced fields are already expanded, we save it and expand it
// when it's re-created.
outState.putBoolean(EXPAND_ADVANCED_FIELDS, mExpandAdvancedFields);
+
+ // Save subId of currently shown tab.
+ outState.putInt(Settings.EXTRA_SUB_ID, mSubId);
}
@Override
@@ -851,7 +853,12 @@
getActivity().setContentView(R.layout.telephony_disallowed_preference_screen);
} else {
initializeSubscriptions();
- updateCurrentTab(getActivity().getIntent());
+
+ if (savedInstanceState != null) {
+ updateCurrentTab(savedInstanceState);
+ } else {
+ updateCurrentTab(getActivity().getIntent().getExtras());
+ }
}
}
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index ccbb4d0..a5cd06b 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -44,6 +44,7 @@
import android.provider.Settings;
import android.telecom.TelecomManager;
import android.telephony.CarrierConfigManager;
+import android.telephony.DebugEventReporter;
import android.telephony.ServiceState;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
@@ -283,6 +284,9 @@
// getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY_VOICE_CALLS);
if (mCM == null) {
+ // Initialize DebugEventReporter early so that it can be used
+ DebugEventReporter.initialize(this);
+
// Inject telephony component factory if configured using other jars.
XmlResourceParser parser = getResources().getXml(R.xml.telephony_injection);
TelephonyComponentFactory.getInstance().injectTheComponentFactory(parser);
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 5947024..e251516 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -265,6 +265,9 @@
private static final String PREF_CARRIERS_SUBSCRIBER_PREFIX = "carrier_subscriber_";
private static final String PREF_PROVISION_IMS_MMTEL_PREFIX = "provision_ims_mmtel_";
+ // String to store multi SIM allowed
+ private static final String PREF_MULTI_SIM_RESTRICTED = "multisim_restricted";
+
// The AID of ISD-R.
private static final String ISDR_AID = "A0000005591010FFFFFFFF8900000100";
@@ -2816,6 +2819,9 @@
} catch (ImsException e) {
Log.w(LOG_TAG, "IMS isCapable - service unavailable: " + e.getMessage());
return false;
+ } catch (IllegalArgumentException e) {
+ Log.i(LOG_TAG, "isCapable: " + subId + " is inactive, returning false.");
+ return false;
} finally {
Binder.restoreCallingIdentity(token);
}
@@ -3400,7 +3406,7 @@
private int getSlotIndexOrException(int subId) throws IllegalArgumentException {
int slotId = SubscriptionManager.getSlotIndex(subId);
if (!SubscriptionManager.isValidSlotIndex(slotId)) {
- throw new IllegalArgumentException("Invalid Subscription Id.");
+ throw new IllegalArgumentException("Invalid Subscription Id, subId=" + subId);
}
return slotId;
}
@@ -4269,8 +4275,9 @@
*/
@Override
public int getPreferredNetworkType(int subId) {
- TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege(
- mApp, subId, "getPreferredNetworkType");
+ TelephonyPermissions
+ .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
+ mApp, subId, "getPreferredNetworkType");
final long identity = Binder.clearCallingIdentity();
try {
@@ -6448,4 +6455,83 @@
Binder.restoreCallingIdentity(identity);
}
}
+
+ @Override
+ public void setMultisimCarrierRestriction(boolean isMultisimCarrierRestricted) {
+ enforceModifyPermission();
+
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ mTelephonySharedPreferences.edit()
+ .putBoolean(PREF_MULTI_SIM_RESTRICTED, isMultisimCarrierRestricted)
+ .commit();
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ @Override
+ public boolean isMultisimCarrierRestricted() {
+ enforceReadPrivilegedPermission("isMultisimCarrierRestricted");
+
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ // If the device has less than 2 SIM cards, indicate that multisim is restricted.
+ int numPhysicalSlots = UiccController.getInstance().getUiccSlots().length;
+ if (numPhysicalSlots < 2) {
+ loge("isMultisimCarrierRestricted: requires at least 2 cards");
+ return true;
+ }
+
+ // Default value is false. Multi SIM is allowed unless explicitly restricted.
+ return mTelephonySharedPreferences.getBoolean(PREF_MULTI_SIM_RESTRICTED, false);
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ /**
+ * Switch configs to enable multi-sim or switch back to single-sim
+ * @param numOfSims number of active sims we want to switch to
+ */
+ @Override
+ public void switchMultiSimConfig(int numOfSims) {
+ TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege(
+ mApp, SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, "switchMultiSimConfig");
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ mPhoneConfigurationManager.switchMultiSimConfig(numOfSims);
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ /**
+ * Get how many sims have been activated on the phone
+ */
+ @Override
+ public int getNumOfActiveSims() {
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ return mPhoneConfigurationManager.getNumOfActiveSims();
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ /**
+ * Get whether reboot is required or not after making changes to modem configurations.
+ * Return value defaults to false
+ */
+ @Override
+ public boolean isRebootRequiredForModemConfigChange() {
+ enforceReadPrivilegedPermission("isRebootRequiredForModemConfigChange");
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ return mPhoneConfigurationManager.isRebootRequiredForModemConfigChange();
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
}
diff --git a/src/com/android/phone/settings/PhoneAccountSettingsFragment.java b/src/com/android/phone/settings/PhoneAccountSettingsFragment.java
index 670f98d..41063e2 100644
--- a/src/com/android/phone/settings/PhoneAccountSettingsFragment.java
+++ b/src/com/android/phone/settings/PhoneAccountSettingsFragment.java
@@ -18,6 +18,7 @@
import android.telecom.TelecomManager;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
+import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
@@ -76,6 +77,15 @@
private SwitchPreference mSipReceiveCallsPreference;
private SipPreferences mSipPreferences;
+ private final SubscriptionManager.OnSubscriptionsChangedListener
+ mOnSubscriptionsChangeListener =
+ new SubscriptionManager.OnSubscriptionsChangedListener() {
+ @Override
+ public void onSubscriptionsChanged() {
+ updateAccounts();
+ }
+ };
+
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
@@ -122,34 +132,8 @@
*/
mAccountList = (PreferenceCategory) getPreferenceScreen().findPreference(
ACCOUNTS_LIST_CATEGORY_KEY);
- List<PhoneAccountHandle> allNonSimAccounts =
- getCallingAccounts(false /* includeSims */, true /* includeDisabled */);
- // Check to see if we should show the entire section at all.
- if (shouldShowConnectionServiceList(allNonSimAccounts)) {
- List<PhoneAccountHandle> enabledAccounts =
- getCallingAccounts(true /* includeSims */, false /* includeDisabled */);
- // Initialize the account list with the set of enabled & SIM accounts.
- initAccountList(enabledAccounts);
- mDefaultOutgoingAccount = (AccountSelectionPreference)
- getPreferenceScreen().findPreference(DEFAULT_OUTGOING_ACCOUNT_KEY);
- mDefaultOutgoingAccount.setListener(this);
-
- // Only show the 'Make Calls With..." option if there are multiple accounts.
- if (enabledAccounts.size() > 1) {
- updateDefaultOutgoingAccountsModel();
- } else {
- mAccountList.removePreference(mDefaultOutgoingAccount);
- }
-
- Preference allAccounts = getPreferenceScreen().findPreference(ALL_CALLING_ACCOUNTS_KEY);
- // If there are no third party (nonSim) accounts, then don't show enable/disable dialog.
- if (allNonSimAccounts.isEmpty() && allAccounts != null) {
- mAccountList.removePreference(allAccounts);
- }
- } else {
- getPreferenceScreen().removePreference(mAccountList);
- }
+ updateAccounts();
if (isPrimaryUser() && SipUtil.isVoipSupported(getActivity())) {
mSipPreferences = new SipPreferences(getActivity());
@@ -183,6 +167,16 @@
getPreferenceScreen().removePreference(
getPreferenceScreen().findPreference(SIP_SETTINGS_CATEGORY_PREF_KEY));
}
+
+ SubscriptionManager.from(getActivity()).addOnSubscriptionsChangedListener(
+ mOnSubscriptionsChangeListener);
+ }
+
+ @Override
+ public void onPause() {
+ SubscriptionManager.from(getActivity()).removeOnSubscriptionsChangedListener(
+ mOnSubscriptionsChangeListener);
+ super.onPause();
}
/**
@@ -391,6 +385,44 @@
return mTelephonyManager.isMultiSimEnabled() || allNonSimAccounts.size() > 0;
}
+ private void updateAccounts() {
+ if (mAccountList != null) {
+ mAccountList.removeAll();
+ List<PhoneAccountHandle> allNonSimAccounts =
+ getCallingAccounts(false /* includeSims */, true /* includeDisabled */);
+ // Check to see if we should show the entire section at all.
+ if (shouldShowConnectionServiceList(allNonSimAccounts)) {
+ List<PhoneAccountHandle> enabledAccounts =
+ getCallingAccounts(true /* includeSims */, false /* includeDisabled */);
+ // Initialize the account list with the set of enabled & SIM accounts.
+ initAccountList(enabledAccounts);
+
+ mDefaultOutgoingAccount = (AccountSelectionPreference)
+ getPreferenceScreen().findPreference(DEFAULT_OUTGOING_ACCOUNT_KEY);
+ if (mDefaultOutgoingAccount != null) {
+ mDefaultOutgoingAccount.setListener(this);
+
+ // Only show the 'Make Calls With..." option if there are multiple accounts.
+ if (enabledAccounts.size() > 1) {
+ updateDefaultOutgoingAccountsModel();
+ } else {
+ mAccountList.removePreference(mDefaultOutgoingAccount);
+ }
+ }
+
+ Preference allAccounts =
+ getPreferenceScreen().findPreference(ALL_CALLING_ACCOUNTS_KEY);
+ // If there are no third party (nonSim) accounts,
+ // then don't show enable/disable dialog.
+ if (allNonSimAccounts.isEmpty() && allAccounts != null) {
+ mAccountList.removePreference(allAccounts);
+ }
+ } else {
+ getPreferenceScreen().removePreference(mAccountList);
+ }
+ }
+ }
+
private List<PhoneAccountHandle> getCallingAccounts(
boolean includeSims, boolean includeDisabledAccounts) {
PhoneAccountHandle emergencyAccountHandle = getEmergencyPhoneAccount();
diff --git a/src/com/android/services/telephony/TelecomAccountRegistry.java b/src/com/android/services/telephony/TelecomAccountRegistry.java
index 37c5d7c..f925dd6 100644
--- a/src/com/android/services/telephony/TelecomAccountRegistry.java
+++ b/src/com/android/services/telephony/TelecomAccountRegistry.java
@@ -46,6 +46,7 @@
import android.telephony.SubscriptionManager;
import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener;
import android.telephony.TelephonyManager;
+import android.telephony.ims.ImsException;
import android.telephony.ims.ImsMmTelManager;
import android.telephony.ims.feature.MmTelFeature;
import android.telephony.ims.stub.ImsRegistrationImplBase;
@@ -114,10 +115,10 @@
}
try {
- mMmTelManager = ImsMmTelManager.createForSubscriptionId(mContext, getSubId());
+ mMmTelManager = ImsMmTelManager.createForSubscriptionId(getSubId());
} catch (IllegalArgumentException e) {
Log.i(this, "Not registering MmTel capabilities listener because the subid '"
- + getSubId() + "' is invalid");
+ + getSubId() + "' is invalid: " + e.getMessage());
return;
}
@@ -151,9 +152,13 @@
try {
mMmTelManager.registerMmTelCapabilityCallback(mContext.getMainExecutor(),
mMmtelCapabilityCallback);
- } catch (IllegalStateException e) {
+ } catch (ImsException e) {
Log.w(this, "registerMmTelCapabilityCallback: registration failed, no ImsService"
- + " available.");
+ + " available. Exception: " + e.getMessage());
+ return;
+ } catch (IllegalArgumentException e) {
+ Log.w(this, "registerMmTelCapabilityCallback: registration failed, invalid"
+ + " subscription, Exception" + e.getMessage());
return;
}
}
@@ -316,6 +321,8 @@
&& isImsVoiceAvailable()) {
capabilities |= PhoneAccount.CAPABILITY_RTT;
mIsRttCapable = true;
+ } else {
+ mIsRttCapable = false;
}
extras.putBoolean(PhoneAccount.EXTRA_SUPPORTS_VIDEO_CALLING_FALLBACK,
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index d2ba8f1..3886e58 100644
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -46,6 +46,7 @@
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallFailCause;
import com.android.internal.telephony.CallStateException;
+import com.android.internal.telephony.Call.HoldingRequestState;
import com.android.internal.telephony.Connection.Capability;
import com.android.internal.telephony.Connection.PostDialListener;
import com.android.internal.telephony.Phone;
@@ -952,6 +953,7 @@
// instead of actually putting it on hold.
if (ringingCall.getState() != Call.State.WAITING) {
phone.switchHoldingAndActive();
+ mOriginalConnection.getCall().updateHoldingRequestState(HoldingRequestState.STARTED);
}
// TODO: Cdma calls are slightly different.
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index ab9e211..e0db44e 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -71,6 +71,8 @@
import java.util.Queue;
import java.util.regex.Pattern;
+import javax.annotation.Nullable;
+
/**
* Service for making GSM and CDMA connections.
*/
@@ -321,8 +323,8 @@
if (PhoneAccount.SCHEME_VOICEMAIL.equals(scheme)) {
// TODO: We don't check for SecurityException here (requires
// CALL_PRIVILEGED permission).
- final Phone phone = getPhoneForAccount(request.getAccountHandle(), false,
- handle.getSchemeSpecificPart());
+ final Phone phone = getPhoneForAccount(request.getAccountHandle(),
+ false /* isEmergencyCall */, null /* not an emergency call */);
if (phone == null) {
Log.d(this, "onCreateOutgoingConnection, phone is null");
return Connection.createFailedConnection(
@@ -360,8 +362,8 @@
"Unable to parse number"));
}
- final Phone phone = getPhoneForAccount(request.getAccountHandle(), false,
- handle.getSchemeSpecificPart());
+ final Phone phone = getPhoneForAccount(request.getAccountHandle(),
+ false /* isEmergencyCall*/, null /* not an emergency call */);
if (phone != null && CDMA_ACTIVATION_CODE_REGEX_PATTERN.matcher(number).matches()) {
// Obtain the configuration for the outgoing phone's SIM. If the outgoing number
// matches the *228 regex pattern, fail the call. This number is used for OTASP, and
@@ -468,7 +470,8 @@
// Get the right phone object from the account data passed in.
final Phone phone = getPhoneForAccount(request.getAccountHandle(), isEmergencyNumber,
- handle.getSchemeSpecificPart());
+ /* Note: when not an emergency, handle can be null for unknown callers */
+ handle == null ? null : handle.getSchemeSpecificPart());
Connection resultConnection = getTelephonyConnection(request, numberToDial,
isEmergencyNumber, handle, phone);
// If there was a failure, the resulting connection will not be a TelephonyConnection,
@@ -512,8 +515,9 @@
if (isRadioReady) {
// Get the right phone object since the radio has been turned on
// successfully.
- final Phone phone = getPhoneForAccount(request.getAccountHandle(),
- isEmergencyNumber, handle.getSchemeSpecificPart());
+ final Phone phone = getPhoneForAccount(request.getAccountHandle(), isEmergencyNumber,
+ /* Note: when not an emergency, handle can be null for unknown callers */
+ handle == null ? null : handle.getSchemeSpecificPart());
// If the PhoneType of the Phone being used is different than the Default Phone, then we
// need create a new Connection using that PhoneType and replace it in Telecom.
if (phone.getPhoneType() != originalPhoneType) {
@@ -732,7 +736,8 @@
isEmergency = true;
}
Phone phone = getPhoneForAccount(accountHandle, isEmergency,
- request.getAddress().getSchemeSpecificPart());
+ /* Note: when not an emergency, handle can be null for unknown callers */
+ request.getAddress() == null ? null : request.getAddress().getSchemeSpecificPart());
if (phone == null) {
return Connection.createFailedConnection(
DisconnectCauseUtil.toTelecomDisconnectCause(
@@ -844,7 +849,8 @@
isEmergency = true;
}
Phone phone = getPhoneForAccount(accountHandle, isEmergency,
- request.getAddress().getSchemeSpecificPart());
+ /* Note: when not an emergency, handle can be null for unknown callers */
+ request.getAddress() == null ? null : request.getAddress().getSchemeSpecificPart());
if (phone == null) {
return Connection.createFailedConnection(
DisconnectCauseUtil.toTelecomDisconnectCause(
@@ -1234,8 +1240,17 @@
return false;
}
+ /**
+ * Determines which {@link Phone} will be used to place the call.
+ * @param accountHandle The {@link PhoneAccountHandle} which was sent from Telecom to place the
+ * call on.
+ * @param isEmergency {@code true} if this is an emergency call, {@code false} otherwise.
+ * @param emergencyNumberAddress When {@code isEmergency} is {@code true}, will be the phone
+ * of the emergency call. Otherwise, this can be {@code null} .
+ * @return
+ */
private Phone getPhoneForAccount(PhoneAccountHandle accountHandle, boolean isEmergency,
- String emergencyNumberAddress) {
+ @Nullable String emergencyNumberAddress) {
Phone chosenPhone = null;
int subId = PhoneUtils.getSubIdForPhoneAccountHandle(accountHandle);
if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
diff --git a/testapps/ImsTestService/src/com/android/phone/testapps/imstestapp/ImsCallingActivity.java b/testapps/ImsTestService/src/com/android/phone/testapps/imstestapp/ImsCallingActivity.java
index fea2bf8..0ff6cc1 100644
--- a/testapps/ImsTestService/src/com/android/phone/testapps/imstestapp/ImsCallingActivity.java
+++ b/testapps/ImsTestService/src/com/android/phone/testapps/imstestapp/ImsCallingActivity.java
@@ -20,6 +20,7 @@
import android.content.Context;
import android.os.Bundle;
import android.telephony.SubscriptionManager;
+import android.telephony.ims.ImsException;
import android.telephony.ims.ImsMmTelManager;
import android.telephony.ims.feature.MmTelFeature;
import android.telephony.ims.stub.ImsRegistrationImplBase;
@@ -162,12 +163,12 @@
mListView = (ListView) findViewById(R.id.cap_cb_list);
mListView.setAdapter(mCapabiltyEventAdapter);
try {
- mImsManager = ImsMmTelManager.createForSubscriptionId(this,
+ mImsManager = ImsMmTelManager.createForSubscriptionId(
SubscriptionManager.getDefaultVoiceSubscriptionId());
Log.i("ImsCallingActivity", "onResume");
mImsManager.registerMmTelCapabilityCallback(getMainExecutor(), mCapabilityCallback);
- } catch (IllegalArgumentException e) {
- Log.w("ImsCallingActivity", "illegal subscription ID.");
+ } catch (IllegalArgumentException | ImsException e) {
+ Log.w("ImsCallingActivity", "Exception: " + e.getMessage());
}
}
diff --git a/testapps/ImsTestService/src/com/android/phone/testapps/imstestapp/ImsRegistrationActivity.java b/testapps/ImsTestService/src/com/android/phone/testapps/imstestapp/ImsRegistrationActivity.java
index 3317ff1..e4a4e6f 100644
--- a/testapps/ImsTestService/src/com/android/phone/testapps/imstestapp/ImsRegistrationActivity.java
+++ b/testapps/ImsTestService/src/com/android/phone/testapps/imstestapp/ImsRegistrationActivity.java
@@ -20,6 +20,7 @@
import android.content.Context;
import android.os.Bundle;
import android.telephony.SubscriptionManager;
+import android.telephony.ims.ImsException;
import android.telephony.ims.ImsMmTelManager;
import android.telephony.ims.ImsReasonInfo;
import android.telephony.ims.stub.ImsRegistrationImplBase;
@@ -177,10 +178,10 @@
mListView = (ListView) findViewById(R.id.reg_cb_list);
mListView.setAdapter(mRegItemAdapter);
try {
- mImsManager = ImsMmTelManager.createForSubscriptionId(this,
+ mImsManager = ImsMmTelManager.createForSubscriptionId(
SubscriptionManager.getDefaultVoiceSubscriptionId());
mImsManager.registerImsRegistrationCallback(getMainExecutor(), mRegistrationCallback);
- } catch (IllegalArgumentException e) {
+ } catch (IllegalArgumentException | ImsException e) {
Log.w("ImsCallingActivity", "illegal subscription ID.");
}
diff --git a/testapps/TelephonyRegistryTestApp/AndroidManifest.xml b/testapps/TelephonyRegistryTestApp/AndroidManifest.xml
index 708ea66..1cfd3ba 100644
--- a/testapps/TelephonyRegistryTestApp/AndroidManifest.xml
+++ b/testapps/TelephonyRegistryTestApp/AndroidManifest.xml
@@ -19,6 +19,7 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"/>
+ <uses-permission android:name="android.permission.READ_PRECISE_PHONE_STATE"/>
<application android:label="TelephonyRegistryTestApp">
<activity
android:name=".TelephonyRegistryTestApp"