diff options
| -rw-r--r-- | services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java b/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java index 4e868887ea1b..e307e529a40b 100644 --- a/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java +++ b/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java @@ -144,6 +144,10 @@ public final class ProfcollectForwardingService extends SystemService { public void onBootPhase(int phase) { if (phase == PHASE_SYSTEM_SERVICES_READY) { UsbManager usbManager = getContext().getSystemService(UsbManager.class); + if (usbManager == null) { + mAdbActive = false; + return; + } mAdbActive = ((usbManager.getCurrentFunctions() & UsbManager.FUNCTION_ADB) == 1); Log.d(LOG_TAG, "ADB is " + mAdbActive + " on system startup"); } |