From 3afed57a7d8a6e9d9fcaaa483a3c3e3652e2199a Mon Sep 17 00:00:00 2001 From: Santos Cordon Date: Wed, 21 May 2014 15:22:12 -0700 Subject: Adding ITelecommService definition for Telecomm. Until telecomm code moves into a system service, we need a way for other apps to call into it for call-related functionality. Initial implementation only has silenceRinger. This is to be implemented by the telecomm code and used by TelephonyManager (until we have a TelecommManager). Change-Id: I9180797451dcb2e9029b20bed47f5d5cb8cddb9f (cherry picked from commit b895606acf18dbb050c9a32106b3c9c2e5111829) --- telephony/java/android/telephony/TelephonyManager.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'telephony') diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index a896861..4aed1fe 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -30,6 +30,7 @@ import android.os.SystemProperties; import android.telephony.Rlog; import android.util.Log; +import com.android.internal.telecomm.ITelecommService; import com.android.internal.telephony.IPhoneSubInfo; import com.android.internal.telephony.ITelephony; import com.android.internal.telephony.ITelephonyRegistry; @@ -65,6 +66,8 @@ import java.util.regex.Pattern; public class TelephonyManager { private static final String TAG = "TelephonyManager"; + private static final String TELECOMM_SERVICE_NAME = "telecomm"; + private static ITelephonyRegistry sRegistry; /** @@ -1536,6 +1539,10 @@ public class TelephonyManager { return ITelephony.Stub.asInterface(ServiceManager.getService(Context.TELEPHONY_SERVICE)); } + private ITelecommService getTelecommService() { + return ITelecommService.Stub.asInterface(ServiceManager.getService(TELECOMM_SERVICE_NAME)); + } + // // // PhoneStateListener @@ -2016,9 +2023,9 @@ public class TelephonyManager { @PrivateApi public void silenceRinger() { try { - getITelephony().silenceRinger(); + getTelecommService().silenceRinger(); } catch (RemoteException e) { - Log.e(TAG, "Error calling ITelephony#silenceRinger", e); + Log.e(TAG, "Error calling ITelecommService#silenceRinger", e); } } -- cgit v1.1