ADBService extends IntentService { @Override protected void onHandleIntent(Intent workIntent) { Log.d("ADBService", "Got intent"); if (workIntent.getStringExtra("cmd") != null && !"".equals(workIntent.getStringExtra("cmd"))) { try { Log.d("ADBService", "Got create intent"); AdbConnection connection = connectNetworkADB(); spawnApp(connection, workIntent.getStringExtra("cmd")); Log.d("ADBService", "Launched adb connection"); } catch (Exception e) { Log.d("ADBService", "Failed to start the adb service", e); } return; } Log.d("ADBService", "Get action"); try { Log.d("ADBService", workIntent.getAction()); switch (Objects.requireNonNull(workIntent.getAction())) { case "stream": Log.d("ADBService", "Start proxy..."); Socket s = new Socket("127.0.0.1", 1337); Log.d("ADBService", "Proxy connected"); InputStream ss = ConnectionSigleton.getInstance().inputStream; new Thread(() -> { try { Log.d("ADBService", "Proxy piping..."); IOUtils.copyStream(ss, s.getOutputStream()); Log.d("ADBService", "Proxy done piping"); } catch (Exception e) { Log.d("ADBService", "Failed to pipe", e); } }).start(); } } catch (Exception e) { Log.d("ADBService", "Failed to connect to ADB", e); } } ADBService(String name);  ADBService(); @Override void onDestroy(); @Override void onCreate(); AdbCrypto setupADBCrypto();  }
@Test public void onHandleIntentNull() { service.onHandleIntent(null); }