Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3027e70 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "profcollect: Fix NPE when invoking UsbManager" into main

parents 7c8b795e 69abc0d7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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");
        }