Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: device/bluetooth/android/java/src/org/chromium/device/bluetooth/Wrappers.java

Issue 2248913002: bluetooth: Implement RSSI and Tx Power on macOS and Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-refactor-adv-data
Patch Set: Address jyasskin's comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.TargetApi; 8 import android.annotation.TargetApi;
9 import android.bluetooth.BluetoothAdapter; 9 import android.bluetooth.BluetoothAdapter;
10 import android.bluetooth.BluetoothDevice; 10 import android.bluetooth.BluetoothDevice;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 private final ScanResult mScanResult; 230 private final ScanResult mScanResult;
231 231
232 public ScanResultWrapper(ScanResult scanResult) { 232 public ScanResultWrapper(ScanResult scanResult) {
233 mScanResult = scanResult; 233 mScanResult = scanResult;
234 } 234 }
235 235
236 public BluetoothDeviceWrapper getDevice() { 236 public BluetoothDeviceWrapper getDevice() {
237 return new BluetoothDeviceWrapper(mScanResult.getDevice()); 237 return new BluetoothDeviceWrapper(mScanResult.getDevice());
238 } 238 }
239 239
240 public int getRssi() {
241 return mScanResult.getRssi();
242 }
243
240 public List<ParcelUuid> getScanRecord_getServiceUuids() { 244 public List<ParcelUuid> getScanRecord_getServiceUuids() {
241 return mScanResult.getScanRecord().getServiceUuids(); 245 return mScanResult.getScanRecord().getServiceUuids();
242 } 246 }
247
248 public int getScanRecord_getTxPowerLevel() {
249 return mScanResult.getScanRecord().getTxPowerLevel();
250 }
243 } 251 }
244 252
245 /** 253 /**
246 * Wraps android.bluetooth.BluetoothDevice. 254 * Wraps android.bluetooth.BluetoothDevice.
247 */ 255 */
248 static class BluetoothDeviceWrapper { 256 static class BluetoothDeviceWrapper {
249 private final BluetoothDevice mDevice; 257 private final BluetoothDevice mDevice;
250 private final HashMap<BluetoothGattCharacteristic, BluetoothGattCharacte risticWrapper> 258 private final HashMap<BluetoothGattCharacteristic, BluetoothGattCharacte risticWrapper>
251 mCharacteristicsToWrappers; 259 mCharacteristicsToWrappers;
252 private final HashMap<BluetoothGattDescriptor, BluetoothGattDescriptorWr apper> 260 private final HashMap<BluetoothGattDescriptor, BluetoothGattDescriptorWr apper>
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 560
553 public byte[] getValue() { 561 public byte[] getValue() {
554 return mDescriptor.getValue(); 562 return mDescriptor.getValue();
555 } 563 }
556 564
557 public boolean setValue(byte[] value) { 565 public boolean setValue(byte[] value) {
558 return mDescriptor.setValue(value); 566 return mDescriptor.setValue(value);
559 } 567 }
560 } 568 }
561 } 569 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698