From 783f66f0bdff23db0ee680e949c5279a56c6e996 Mon Sep 17 00:00:00 2001 From: Brad Ebinger Date: Thu, 15 Jul 2021 16:09:56 -0700 Subject: Gate CDMA Supplementary Services on a CarrierConfig item Introduce the KEY_SUPPORT_SS_OVER_CDMA_BOOL carrier config, which allows Supplementary Services to be changed via carrier USSD codes. This is disabled by default because the current USSD codes are not configurable per carrier, so it can not be widely enabled. Bug: 191057045 Test: manual, configuration changes Change-Id: I3aeb1793c0df4f52764fef5fd09db47efe841dc2 --- .../java/android/telephony/CarrierConfigManager.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'telephony/java/android') diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 9954de2da67e..f01519f934f3 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -285,6 +285,21 @@ public class CarrierConfigManager { public static final String KEY_CALL_BARRING_DEFAULT_SERVICE_CLASS_INT = "call_barring_default_service_class_int"; + /** + * This carrier supports dialing USSD codes to enable/disable supplementary services such as + * call forwarding and call waiting over CDMA. + *

+ * The supplementary service menu will still need to be set as visible, see + * {@link #KEY_CALL_FORWARDING_VISIBILITY_BOOL} and + * {@link #KEY_ADDITIONAL_SETTINGS_CALL_WAITING_VISIBILITY_BOOL}. + *

+ * If this is set as false and the supplementary service menu is visible, the associated setting + * will be enabled and disabled based on the availability of supplementary services over UT. See + * {@link #KEY_CARRIER_SUPPORTS_SS_OVER_UT_BOOL}. + * @hide + */ + public static final String KEY_SUPPORT_SS_OVER_CDMA_BOOL = "support_ss_over_cdma_bool"; + /** * Flag indicating whether the Phone app should ignore EVENT_SIM_NETWORK_LOCKED * events from the Sim. @@ -5120,6 +5135,7 @@ public class CarrierConfigManager { sDefaults.putBoolean(KEY_CALL_BARRING_SUPPORTS_PASSWORD_CHANGE_BOOL, true); sDefaults.putBoolean(KEY_CALL_BARRING_SUPPORTS_DEACTIVATE_ALL_BOOL, true); sDefaults.putInt(KEY_CALL_BARRING_DEFAULT_SERVICE_CLASS_INT, SERVICE_CLASS_VOICE); + sDefaults.putBoolean(KEY_SUPPORT_SS_OVER_CDMA_BOOL, false); sDefaults.putBoolean(KEY_CALL_FORWARDING_VISIBILITY_BOOL, true); sDefaults.putBoolean(KEY_CALL_FORWARDING_WHEN_UNREACHABLE_SUPPORTED_BOOL, true); sDefaults.putBoolean(KEY_CALL_FORWARDING_WHEN_UNANSWERED_SUPPORTED_BOOL, true); -- cgit v1.2.3 From 588ec9f398b00216219a5e3973ab75a3bd791c85 Mon Sep 17 00:00:00 2001 From: Rambo Wang Date: Mon, 19 Jul 2021 12:27:38 -0700 Subject: Clear binder identity in callback of IMS IPC interfaces The binder identity does get cleared when goes from client process into phone process. When it comes back from phone to client, the binder identity should also be cleared. Bug: 193923945 Test: atest android.telephony.cts.TelephonyManagerTest Test: atest ImsServiceTest RcsFeatureControllerTest ImsMmTelManagerTest Merged-In: I34225e32111879e155c9f7865f0045430d171467 Change-Id: I34225e32111879e155c9f7865f0045430d171467 (cherry picked from commit c18002c465912eed70c2c22755949b06849a8f08) --- .../java/android/telephony/TelephonyManager.java | 7 +++++- .../android/telephony/ims/ImsMmTelManager.java | 28 ++++++++++++++++++---- .../java/android/telephony/ims/ImsRcsManager.java | 14 +++++++++-- 3 files changed, 42 insertions(+), 7 deletions(-) (limited to 'telephony/java/android') diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index e0ab0a368a4f..255a61266ebf 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -13965,7 +13965,12 @@ public class TelephonyManager { IBooleanConsumer aidlConsumer = callback == null ? null : new IBooleanConsumer.Stub() { @Override public void accept(boolean result) { - executor.execute(() -> callback.accept(result)); + final long identity = Binder.clearCallingIdentity(); + try { + executor.execute(() -> callback.accept(result)); + } finally { + Binder.restoreCallingIdentity(identity); + } } }; diff --git a/telephony/java/android/telephony/ims/ImsMmTelManager.java b/telephony/java/android/telephony/ims/ImsMmTelManager.java index 53922ed27c10..36082dc8180e 100644 --- a/telephony/java/android/telephony/ims/ImsMmTelManager.java +++ b/telephony/java/android/telephony/ims/ImsMmTelManager.java @@ -445,7 +445,12 @@ public class ImsMmTelManager implements RegistrationManager { iTelephony.getImsMmTelRegistrationState(mSubId, new IIntegerConsumer.Stub() { @Override public void accept(int result) { - executor.execute(() -> stateCallback.accept(result)); + final long identity = Binder.clearCallingIdentity(); + try { + executor.execute(() -> stateCallback.accept(result)); + } finally { + Binder.restoreCallingIdentity(identity); + } } }); } catch (ServiceSpecificException | RemoteException e) { @@ -487,7 +492,12 @@ public class ImsMmTelManager implements RegistrationManager { new IIntegerConsumer.Stub() { @Override public void accept(int result) { - executor.execute(() -> transportTypeCallback.accept(result)); + final long identity = Binder.clearCallingIdentity(); + try { + executor.execute(() -> transportTypeCallback.accept(result)); + } finally { + Binder.restoreCallingIdentity(identity); + } } }); } catch (ServiceSpecificException | RemoteException e) { @@ -807,7 +817,12 @@ public class ImsMmTelManager implements RegistrationManager { iTelephony.isMmTelCapabilitySupported(mSubId, new IIntegerConsumer.Stub() { @Override public void accept(int result) { - executor.execute(() -> callback.accept(result == 1)); + final long identity = Binder.clearCallingIdentity(); + try { + executor.execute(() -> callback.accept(result == 1)); + } finally { + Binder.restoreCallingIdentity(identity); + } } }, capability, transportType); } catch (ServiceSpecificException sse) { @@ -1452,7 +1467,12 @@ public class ImsMmTelManager implements RegistrationManager { iTelephony.getImsMmTelFeatureState(mSubId, new IIntegerConsumer.Stub() { @Override public void accept(int result) { - executor.execute(() -> callback.accept(result)); + final long identity = Binder.clearCallingIdentity(); + try { + executor.execute(() -> callback.accept(result)); + } finally { + Binder.restoreCallingIdentity(identity); + } } }); } catch (ServiceSpecificException sse) { diff --git a/telephony/java/android/telephony/ims/ImsRcsManager.java b/telephony/java/android/telephony/ims/ImsRcsManager.java index 91c53244a780..8d6fa4141b5c 100644 --- a/telephony/java/android/telephony/ims/ImsRcsManager.java +++ b/telephony/java/android/telephony/ims/ImsRcsManager.java @@ -299,7 +299,12 @@ public class ImsRcsManager { imsRcsController.getImsRcsRegistrationState(mSubId, new IIntegerConsumer.Stub() { @Override public void accept(int result) { - executor.execute(() -> stateCallback.accept(result)); + final long identity = Binder.clearCallingIdentity(); + try { + executor.execute(() -> stateCallback.accept(result)); + } finally { + Binder.restoreCallingIdentity(identity); + } } }); } catch (ServiceSpecificException | RemoteException e) { @@ -345,7 +350,12 @@ public class ImsRcsManager { new IIntegerConsumer.Stub() { @Override public void accept(int result) { - executor.execute(() -> transportTypeCallback.accept(result)); + final long identity = Binder.clearCallingIdentity(); + try { + executor.execute(() -> transportTypeCallback.accept(result)); + } finally { + Binder.restoreCallingIdentity(identity); + } } }); } catch (ServiceSpecificException | RemoteException e) { -- cgit v1.2.3