Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de269fc5 authored by Matthew Xie's avatar Matthew Xie
Browse files

Block ble adv api based on resource config

bug 10516911

Change-Id: I7a62103a1116ffbf7c3c934c1794384c0e6fbdd3
parent 701e77fc
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -702,6 +702,10 @@ public final class BluetoothGatt implements BluetoothProfile {
     * @param start Start or stop advertising
     * @param start Start or stop advertising
     */
     */
    /*package*/ void listen(boolean start) {
    /*package*/ void listen(boolean start) {
        if (mContext == null || !mContext.getResources().
            getBoolean(com.android.internal.R.bool.config_bluetooth_le_peripheral_mode_supported)) {
            throw new UnsupportedOperationException("BluetoothGatt#listen is blocked");
        }
        if (DBG) Log.d(TAG, "listen() - start: " + start);
        if (DBG) Log.d(TAG, "listen() - start: " + start);
        if (mService == null || mClientIf == 0) return;
        if (mService == null || mClientIf == 0) return;


@@ -728,6 +732,10 @@ public final class BluetoothGatt implements BluetoothProfile {
    /*package*/ void setAdvData(boolean advData, boolean includeName, boolean includeTxPower,
    /*package*/ void setAdvData(boolean advData, boolean includeName, boolean includeTxPower,
                           Integer minInterval, Integer maxInterval,
                           Integer minInterval, Integer maxInterval,
                           Integer appearance, Byte[] manufacturerData) {
                           Integer appearance, Byte[] manufacturerData) {
        if (mContext == null || !mContext.getResources().
            getBoolean(com.android.internal.R.bool.config_bluetooth_le_peripheral_mode_supported)) {
            throw new UnsupportedOperationException("BluetoothGatt#setAdvData is blocked");
        }
        if (DBG) Log.d(TAG, "setAdvData()");
        if (DBG) Log.d(TAG, "setAdvData()");
        if (mService == null || mClientIf == 0) return;
        if (mService == null || mClientIf == 0) return;