Skip to content

Commit 305f240

Browse files
Syed Ibrahim MMatthew Xie
authored andcommitted
handle NullPointerException in cases where a proxy
call to AdapterService is called after Adapter Service is stopped. Change-Id: I009787f03f9a013b9b06fcb7e3f6241c850f8cd2
1 parent 33806e2 commit 305f240

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/java/android/bluetooth/BluetoothDevice.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,12 @@ public int getBondState() {
786786
try {
787787
return sService.getBondState(this);
788788
} catch (RemoteException e) {Log.e(TAG, "", e);}
789+
catch (NullPointerException npe) {
790+
// Handle case where bluetooth service proxy
791+
// is already null.
792+
Log.e(TAG, "NullPointerException for getBondState() of device ("+
793+
getAddress()+")", npe);
794+
}
789795
return BOND_NONE;
790796
}
791797

0 commit comments

Comments
 (0)