Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
Catch SecurityException in SDL getSerialNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
xyzz committed Mar 5, 2021
1 parent 460a543 commit 4140009
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/main/java/org/libsdl/app/HIDDeviceUSB.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ public int getProductId() {
public String getSerialNumber() {
String result = null;
if (Build.VERSION.SDK_INT >= 21) {
result = mDevice.getSerialNumber();
try {
result = mDevice.getSerialNumber();
}
catch (SecurityException exception) {
result = "";
}
}
if (result == null) {
result = "";
Expand Down

0 comments on commit 4140009

Please sign in to comment.