| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.device.bluetooth; | 5 package org.chromium.device.bluetooth; |
| 6 | 6 |
| 7 import android.Manifest; | 7 import android.Manifest; |
| 8 import android.annotation.SuppressLint; |
| 8 import android.annotation.TargetApi; | 9 import android.annotation.TargetApi; |
| 9 import android.bluetooth.BluetoothAdapter; | 10 import android.bluetooth.BluetoothAdapter; |
| 10 import android.bluetooth.BluetoothDevice; | 11 import android.bluetooth.BluetoothDevice; |
| 11 import android.bluetooth.BluetoothGatt; | 12 import android.bluetooth.BluetoothGatt; |
| 12 import android.bluetooth.BluetoothGattCallback; | 13 import android.bluetooth.BluetoothGattCallback; |
| 13 import android.bluetooth.BluetoothGattCharacteristic; | 14 import android.bluetooth.BluetoothGattCharacteristic; |
| 14 import android.bluetooth.BluetoothGattDescriptor; | 15 import android.bluetooth.BluetoothGattDescriptor; |
| 15 import android.bluetooth.BluetoothGattService; | 16 import android.bluetooth.BluetoothGattService; |
| 16 import android.bluetooth.le.BluetoothLeScanner; | 17 import android.bluetooth.le.BluetoothLeScanner; |
| 17 import android.bluetooth.le.ScanCallback; | 18 import android.bluetooth.le.ScanCallback; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 153 } |
| 153 | 154 |
| 154 public boolean disable() { | 155 public boolean disable() { |
| 155 return mAdapter.disable(); | 156 return mAdapter.disable(); |
| 156 } | 157 } |
| 157 | 158 |
| 158 public boolean enable() { | 159 public boolean enable() { |
| 159 return mAdapter.enable(); | 160 return mAdapter.enable(); |
| 160 } | 161 } |
| 161 | 162 |
| 163 @SuppressLint("HardwareIds") |
| 162 public String getAddress() { | 164 public String getAddress() { |
| 163 return mAdapter.getAddress(); | 165 return mAdapter.getAddress(); |
| 164 } | 166 } |
| 165 | 167 |
| 166 public BluetoothLeScannerWrapper getBluetoothLeScanner() { | 168 public BluetoothLeScannerWrapper getBluetoothLeScanner() { |
| 167 BluetoothLeScanner scanner = mAdapter.getBluetoothLeScanner(); | 169 BluetoothLeScanner scanner = mAdapter.getBluetoothLeScanner(); |
| 168 if (scanner == null) { | 170 if (scanner == null) { |
| 169 return null; | 171 return null; |
| 170 } | 172 } |
| 171 if (mScannerWrapper == null) { | 173 if (mScannerWrapper == null) { |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 | 609 |
| 608 public byte[] getValue() { | 610 public byte[] getValue() { |
| 609 return mDescriptor.getValue(); | 611 return mDescriptor.getValue(); |
| 610 } | 612 } |
| 611 | 613 |
| 612 public boolean setValue(byte[] value) { | 614 public boolean setValue(byte[] value) { |
| 613 return mDescriptor.setValue(value); | 615 return mDescriptor.setValue(value); |
| 614 } | 616 } |
| 615 } | 617 } |
| 616 } | 618 } |
| OLD | NEW |