Skip to content

Commit

Permalink
Fix Error Prone (#178)
Browse files Browse the repository at this point in the history
- StaticQualifiedUsingExpression: Static method serializeBluetoothDevice should not be accessed from an object instance; instead use JsonSerializer.serializeBluetoothDevice
- MissingOverride: onReceive implements method in BroadcastReceiver; expected @OverRide
- RemoveUnusedImports: Unused imports: java.lang.reflect.InvocationTargetException, java.lang.reflect.Method
  • Loading branch information
ko1in1u authored Dec 18, 2023
1 parent 3fe3a3b commit 0422da4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
import com.google.android.mobly.snippet.rpc.Rpc;
import com.google.android.mobly.snippet.rpc.RpcMinSdk;
import com.google.android.mobly.snippet.util.Log;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public List<Bundle> btGetPairedDevices()
throws BluetoothAdapterSnippetException, InterruptedException, JSONException {
ArrayList<Bundle> pairedDevices = new ArrayList<>();
for (BluetoothDevice device : mBluetoothAdapter.getBondedDevices()) {
pairedDevices.add(mJsonSerializer.serializeBluetoothDevice(device));
pairedDevices.add(JsonSerializer.serializeBluetoothDevice(device));
}
return pairedDevices;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public PairingBroadcastReceiver(Context context) throws Throwable {
Utils.adaptShellPermissionIfRequired(mContext);
}

@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(BluetoothDevice.ACTION_PAIRING_REQUEST)) {
Expand Down

0 comments on commit 0422da4

Please sign in to comment.