## Supported Things
-This binding was tested on the Fire TV Stick (android version 7.1.2, volume control not working) and Nexus5x (android version 8.1.0, everything works nice), please update this document if you tested it with other android versions to reflect the compatibility of the biding.
+This binding was tested on the Fire TV Stick (android version 7.1.2, volume control not working) and Nexus5x (android version 8.1.0, everything works nice), please update this document if you tested it with other android versions to reflect the compatibility of the binding.
## Discovery
if (packageActivityName.contains("/"))
return packageActivityName.split("/")[0];
}
- throw new AndroidDebugBridgeDeviceReadException("can read package name");
+ throw new AndroidDebugBridgeDeviceReadException("Unable to read package name");
}
public boolean isAwake()
logger.debug("Unable to parse device wake lock: {}", e.getMessage());
}
}
- throw new AndroidDebugBridgeDeviceReadException("can read screen state");
+ throw new AndroidDebugBridgeDeviceReadException("Unable to read screen state");
}
public boolean isPlayingMedia(String currentApp)
String lockResp = runAdbShell("dumpsys", "power", "|", "grep", "Locks", "|", "grep", "'size='");
if (lockResp.contains("=")) {
try {
- return Integer.parseInt(lockResp.replace("\n", "").split("=")[1]);
+ return Integer.parseInt(lockResp.replace("\n", "").split("=")[1].trim());
} catch (NumberFormatException e) {
logger.debug("Unable to parse device wake lock: {}", e.getMessage());
}
}
- throw new AndroidDebugBridgeDeviceReadException("can read wake lock");
+ throw new AndroidDebugBridgeDeviceReadException("Unable to read wake lock");
}
private void setVolume(int stream, int volume)