summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/le/AdvertisingSet.java
diff options
context:
space:
mode:
authorJack He <siyuanh@google.com>2017-08-22 21:21:23 -0700
committerJack He <siyuanh@google.com>2017-08-24 19:09:58 +0000
commit9e045d26d0128826b40520f523307d8d16473779 (patch)
tree8299c300f3b4dbc2a5360c3319ac41bf1b389e55 /framework/java/android/bluetooth/le/AdvertisingSet.java
parent910201beb0bde1dcf6b33e4ec5d1eb60042419d8 (diff)
Fix checkstyle errors (2/2)
* Manual style corrections with IDE assistance * Variable name refactors are done through IDE * Corrected general style errors such as: - "final private var" -> "private final var" - "&&", "+", "||" should not be at the end of line - Non-static private variable should be like "mVar" - Private static variable should be like "sVar" - Code file should always end with newline - Inherited methods should be annotated with @Override and no @hide tags - Public methods should always have a JavaDoc entry - "int[] array" is preferred over "int array[]" - private methods should be accessed without "this." when there is no name collisions. - "boolean ? true : false" -> boolean - "boolean ? false : true" -> !boolean - "boolean == true" OR "boolean != false" -> boolean - "boolean != true" OR "boolean == false" -> !boolean Bug: 63596319 Test: make checkbuild, no functional changes Change-Id: Iabdc2be912a32dd63a53213d175cf1bfef268ccd
Diffstat (limited to 'framework/java/android/bluetooth/le/AdvertisingSet.java')
-rw-r--r--framework/java/android/bluetooth/le/AdvertisingSet.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/framework/java/android/bluetooth/le/AdvertisingSet.java b/framework/java/android/bluetooth/le/AdvertisingSet.java
index b1c122c9e0..1df35e1e38 100644
--- a/framework/java/android/bluetooth/le/AdvertisingSet.java
+++ b/framework/java/android/bluetooth/le/AdvertisingSet.java
@@ -36,15 +36,15 @@ import android.util.Log;
public final class AdvertisingSet {
private static final String TAG = "AdvertisingSet";
- private final IBluetoothGatt gatt;
- private int advertiserId;
+ private final IBluetoothGatt mGatt;
+ private int mAdvertiserId;
/* package */ AdvertisingSet(int advertiserId,
IBluetoothManager bluetoothManager) {
- this.advertiserId = advertiserId;
+ mAdvertiserId = advertiserId;
try {
- this.gatt = bluetoothManager.getBluetoothGatt();
+ mGatt = bluetoothManager.getBluetoothGatt();
} catch (RemoteException e) {
Log.e(TAG, "Failed to get Bluetooth gatt - ", e);
throw new IllegalStateException("Failed to get Bluetooth");
@@ -52,7 +52,7 @@ public final class AdvertisingSet {
}
/* package */ void setAdvertiserId(int advertiserId) {
- this.advertiserId = advertiserId;
+ mAdvertiserId = advertiserId;
}
/**
@@ -71,7 +71,7 @@ public final class AdvertisingSet {
public void enableAdvertising(boolean enable, int duration,
int maxExtendedAdvertisingEvents) {
try {
- gatt.enableAdvertisingSet(this.advertiserId, enable, duration,
+ mGatt.enableAdvertisingSet(mAdvertiserId, enable, duration,
maxExtendedAdvertisingEvents);
} catch (RemoteException e) {
Log.e(TAG, "remote exception - ", e);
@@ -92,7 +92,7 @@ public final class AdvertisingSet {
*/
public void setAdvertisingData(AdvertiseData advertiseData) {
try {
- gatt.setAdvertisingData(this.advertiserId, advertiseData);
+ mGatt.setAdvertisingData(mAdvertiserId, advertiseData);
} catch (RemoteException e) {
Log.e(TAG, "remote exception - ", e);
}
@@ -109,7 +109,7 @@ public final class AdvertisingSet {
*/
public void setScanResponseData(AdvertiseData scanResponse) {
try {
- gatt.setScanResponseData(this.advertiserId, scanResponse);
+ mGatt.setScanResponseData(mAdvertiserId, scanResponse);
} catch (RemoteException e) {
Log.e(TAG, "remote exception - ", e);
}
@@ -124,7 +124,7 @@ public final class AdvertisingSet {
*/
public void setAdvertisingParameters(AdvertisingSetParameters parameters) {
try {
- gatt.setAdvertisingParameters(this.advertiserId, parameters);
+ mGatt.setAdvertisingParameters(mAdvertiserId, parameters);
} catch (RemoteException e) {
Log.e(TAG, "remote exception - ", e);
}
@@ -137,7 +137,7 @@ public final class AdvertisingSet {
*/
public void setPeriodicAdvertisingParameters(PeriodicAdvertisingParameters parameters) {
try {
- gatt.setPeriodicAdvertisingParameters(this.advertiserId, parameters);
+ mGatt.setPeriodicAdvertisingParameters(mAdvertiserId, parameters);
} catch (RemoteException e) {
Log.e(TAG, "remote exception - ", e);
}
@@ -155,7 +155,7 @@ public final class AdvertisingSet {
*/
public void setPeriodicAdvertisingData(AdvertiseData periodicData) {
try {
- gatt.setPeriodicAdvertisingData(this.advertiserId, periodicData);
+ mGatt.setPeriodicAdvertisingData(mAdvertiserId, periodicData);
} catch (RemoteException e) {
Log.e(TAG, "remote exception - ", e);
}
@@ -170,7 +170,7 @@ public final class AdvertisingSet {
*/
public void setPeriodicAdvertisingEnabled(boolean enable) {
try {
- gatt.setPeriodicAdvertisingEnable(this.advertiserId, enable);
+ mGatt.setPeriodicAdvertisingEnable(mAdvertiserId, enable);
} catch (RemoteException e) {
Log.e(TAG, "remote exception - ", e);
}
@@ -187,7 +187,7 @@ public final class AdvertisingSet {
*/
public void getOwnAddress() {
try {
- gatt.getOwnAddress(this.advertiserId);
+ mGatt.getOwnAddress(mAdvertiserId);
} catch (RemoteException e) {
Log.e(TAG, "remote exception - ", e);
}
@@ -199,6 +199,6 @@ public final class AdvertisingSet {
* @hide
*/
public int getAdvertiserId() {
- return advertiserId;
+ return mAdvertiserId;
}
-} \ No newline at end of file
+}