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

Commit b464cfd7 authored by Wei Wang's avatar Wei Wang
Browse files

Revert "Revert "APIs for BLE scan, scan filter, batch scan, onFound/onLost and...

Revert "Revert "APIs for BLE scan, scan filter, batch scan, onFound/onLost and multiple advertising.""

This reverts commit b1d9fbc0f8dea0c77ed810190b325bfdaaf21789.

Change-Id: Ic8dec9385a7c763170ebeb1bcddd221c72f46e88
parent 39eb6801
Loading
Loading
Loading
Loading
+32 −0
Original line number Original line Diff line number Diff line
@@ -497,6 +497,34 @@ public final class BluetoothAdapter {
      }
      }
    }
    }


    /**
     * Returns a {@link BluetoothLeAdvertiser} object for Bluetooth LE Advertising operations.
     */
    public BluetoothLeAdvertiser getBluetoothLeAdvertiser() {
        // TODO: Return null if this feature is not supported by hardware.
        try {
            IBluetoothGatt iGatt = mManagerService.getBluetoothGatt();
            return new BluetoothLeAdvertiser(iGatt);
        } catch (RemoteException e) {
            Log.e(TAG, "failed to get BluetoothLeAdvertiser, error: " + e);
            return null;
        }
    }

    /**
     * Returns a {@link BluetoothLeScanner} object for Bluetooth LE scan operations.
     */
    public BluetoothLeScanner getBluetoothLeScanner() {
        // TODO: Return null if BLE scan is not supported by hardware.
        try {
            IBluetoothGatt iGatt = mManagerService.getBluetoothGatt();
            return new BluetoothLeScanner(iGatt);
        } catch (RemoteException e) {
            Log.e(TAG, "failed to get BluetoothLeScanner, error: " + e);
            return null;
        }
    }

    /**
    /**
     * Interface for BLE advertising callback.
     * Interface for BLE advertising callback.
     *
     *
@@ -2024,6 +2052,10 @@ public final class BluetoothAdapter {
            }
            }
        }
        }


        @Override
        public void onMultiAdvertiseCallback(int status) {
            // no op
        }
        /**
        /**
         * Callback reporting LE ATT MTU.
         * Callback reporting LE ATT MTU.
         * @hide
         * @hide
+9 −1
Original line number Original line Diff line number Diff line
@@ -583,6 +583,14 @@ public final class BluetoothGatt implements BluetoothProfile {
                        + state + " status=" + status);
                        + state + " status=" + status);
            }
            }


            /**
             * @hide
             */
            @Override
            public void onMultiAdvertiseCallback(int status) {
                // no op.
            }

            /**
            /**
             * Callback invoked when the MTU for a given connection changes
             * Callback invoked when the MTU for a given connection changes
             * @hide
             * @hide
+19 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2014 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.bluetooth;

parcelable BluetoothLeAdvertiseScanData.AdvertisementData;
 No newline at end of file
Loading