diff options
| author | Jack He <siyuanh@google.com> | 2018-01-10 00:36:06 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2018-01-10 00:36:06 +0000 |
| commit | 570c270d7b35d58d68c85877774f779b38b86618 (patch) | |
| tree | 12e266e2b1b2f2068c779c796d39e7c3f0155935 /core/java | |
| parent | d6808dc0c00ba45fd589449647f792daf9fa8126 (diff) | |
| parent | 96a01775ac4ae1493e17f382f0cfaa6373d3c69d (diff) | |
Merge "HFP: Add isInbandRingingEnabled() API (1/4)" am: b1065d6995 am: 8dbfc24e5f
am: 96a01775ac
Change-Id: I3a6d80fcc6c510ceec1b4f1411344cf644093677
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/bluetooth/BluetoothHeadset.java | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/core/java/android/bluetooth/BluetoothHeadset.java b/core/java/android/bluetooth/BluetoothHeadset.java index 55a6b4c6b4d4..c94540a48ec1 100644 --- a/core/java/android/bluetooth/BluetoothHeadset.java +++ b/core/java/android/bluetooth/BluetoothHeadset.java @@ -1071,9 +1071,35 @@ public final class BluetoothHeadset implements BluetoothProfile { } /** - * check if in-band ringing is supported for this platform. + * Check if in-band ringing is currently enabled. In-band ringing could be disabled during an + * active connection. * - * @return true if in-band ringing is supported false if in-band ringing is not supported + * @return true if in-band ringing is enabled, false if in-band ringing is disabled + * @hide + */ + @RequiresPermission(android.Manifest.permission.BLUETOOTH) + public boolean isInbandRingingEnabled() { + if (DBG) { + log("isInbandRingingEnabled()"); + } + final IBluetoothHeadset service = mService; + if (service != null && isEnabled()) { + try { + return service.isInbandRingingEnabled(); + } catch (RemoteException e) { + Log.e(TAG, Log.getStackTraceString(new Throwable())); + } + } + if (service == null) { + Log.w(TAG, "Proxy not attached to service"); + } + return false; + } + + /** + * Check if in-band ringing is supported for this platform. + * + * @return true if in-band ringing is supported, false if in-band ringing is not supported * @hide */ public static boolean isInbandRingingSupported(Context context) { |
