File tree Expand file tree Collapse file tree
ShimmerDriver/src/main/java/com/shimmerresearch Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1408,5 +1408,7 @@ public static boolean isOsMac() {
14081408 return System .getProperty ("os.name" ).toLowerCase ().contains ("mac" );
14091409 }
14101410
1411-
1411+ public static boolean isOsWindows () {
1412+ return System .getProperty ("os.name" ).toLowerCase ().contains ("win" );
1413+ }
14121414}
Original file line number Diff line number Diff line change 11package com .shimmerresearch .usb ;
22
3+ import com .shimmerresearch .driverUtilities .UtilShimmer ;
4+
35public class PlatformHwManagerUsbExample {
46
57 private UsbDebugListener mUSBDebugListener ;
68
79 public void startWindowsUsbListener () {
8-
9- String os = System .getProperty ("os.name" ).toLowerCase ();
10-
11- if (os .contains ("win" )) {
10+ if (UtilShimmer .isOsWindows ()) {
1211 System .out .println ("Running on Windows" );
1312 mUSBDebugListener = new UsbDebugListenerWindows (new UsbDockChangeListener () {
1413 @ Override
@@ -24,7 +23,7 @@ public void onUsbDeviceDisconnected() {
2423 }
2524 });
2625
27- } else if (os . contains ( "mac" )) {
26+ } else if (UtilShimmer . isOsMac ( )) {
2827 System .out .println ("Running on macOS" );
2928 mUSBDebugListener = new UsbDebugListenerMacOS (new UsbDockChangeListener () {
3029 @ Override
@@ -41,7 +40,7 @@ public void onUsbDeviceDisconnected() {
4140 });
4241
4342 } else {
44- System .out .println ("Other OS: " + os );
43+ System .out .println ("Other OS: " + System . getProperty ( "os.name" ) );
4544 }
4645
4746
You can’t perform that action at this time.
0 commit comments