mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[simulator/android] Handle getSerialNumber exception
Based on SDL commit :
85c1d40792
Change-Id: Ie6810dae48f5944a515ee016f228ecf33edd8fc4
This commit is contained in:
@@ -51,7 +51,12 @@ class HIDDeviceUSB implements HIDDevice {
|
||||
public String getSerialNumber() {
|
||||
String result = null;
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
result = mDevice.getSerialNumber();
|
||||
try {
|
||||
result = mDevice.getSerialNumber();
|
||||
}
|
||||
catch (SecurityException exception) {
|
||||
//Log.w(TAG, "App permissions mean we cannot get serial number for device " + getDeviceName() + " message: " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
if (result == null) {
|
||||
result = "";
|
||||
|
||||
Reference in New Issue
Block a user