Loading services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java +11 −5 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.server.profcollect; import android.Manifest; import android.annotation.RequiresPermission; import android.app.job.JobInfo; import android.app.job.JobParameters; import android.app.job.JobScheduler; Loading Loading @@ -88,10 +90,11 @@ public final class ProfcollectForwardingService extends SystemService { createAndUploadReport(sSelfService); } if (UsbManager.ACTION_USB_STATE.equals(intent.getAction())) { boolean connected = intent.getBooleanExtra(UsbManager.USB_CONNECTED, false); boolean isADB = intent.getBooleanExtra(UsbManager.USB_FUNCTION_ADB, false); if (isADB) { Log.d(LOG_TAG, "Received broadcast that ADB became " + connected); boolean connected = intent.getBooleanExtra(UsbManager.USB_CONNECTED, false); Log.d(LOG_TAG, "Received broadcast that ADB became " + connected + ", was " + mAdbActive); mAdbActive = connected; } } Loading @@ -117,9 +120,6 @@ public final class ProfcollectForwardingService extends SystemService { mUploadEnabled = context.getResources().getBoolean(R.bool.config_profcollectReportUploaderEnabled); // TODO: ADB might already be active when our service started. mAdbActive = false; final IntentFilter filter = new IntentFilter(); filter.addAction(INTENT_UPLOAD_PROFILES); filter.addAction(UsbManager.ACTION_USB_STATE); Loading @@ -140,7 +140,13 @@ public final class ProfcollectForwardingService extends SystemService { } @Override @RequiresPermission(Manifest.permission.MANAGE_USB) public void onBootPhase(int phase) { if (phase == PHASE_SYSTEM_SERVICES_READY) { UsbManager usbManager = getContext().getSystemService(UsbManager.class); mAdbActive = ((usbManager.getCurrentFunctions() & UsbManager.FUNCTION_ADB) == 1); Log.d(LOG_TAG, "ADB is " + mAdbActive + " on system startup"); } if (phase == PHASE_BOOT_COMPLETED) { if (mIProfcollect == null) { return; Loading Loading
services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java +11 −5 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.server.profcollect; import android.Manifest; import android.annotation.RequiresPermission; import android.app.job.JobInfo; import android.app.job.JobParameters; import android.app.job.JobScheduler; Loading Loading @@ -88,10 +90,11 @@ public final class ProfcollectForwardingService extends SystemService { createAndUploadReport(sSelfService); } if (UsbManager.ACTION_USB_STATE.equals(intent.getAction())) { boolean connected = intent.getBooleanExtra(UsbManager.USB_CONNECTED, false); boolean isADB = intent.getBooleanExtra(UsbManager.USB_FUNCTION_ADB, false); if (isADB) { Log.d(LOG_TAG, "Received broadcast that ADB became " + connected); boolean connected = intent.getBooleanExtra(UsbManager.USB_CONNECTED, false); Log.d(LOG_TAG, "Received broadcast that ADB became " + connected + ", was " + mAdbActive); mAdbActive = connected; } } Loading @@ -117,9 +120,6 @@ public final class ProfcollectForwardingService extends SystemService { mUploadEnabled = context.getResources().getBoolean(R.bool.config_profcollectReportUploaderEnabled); // TODO: ADB might already be active when our service started. mAdbActive = false; final IntentFilter filter = new IntentFilter(); filter.addAction(INTENT_UPLOAD_PROFILES); filter.addAction(UsbManager.ACTION_USB_STATE); Loading @@ -140,7 +140,13 @@ public final class ProfcollectForwardingService extends SystemService { } @Override @RequiresPermission(Manifest.permission.MANAGE_USB) public void onBootPhase(int phase) { if (phase == PHASE_SYSTEM_SERVICES_READY) { UsbManager usbManager = getContext().getSystemService(UsbManager.class); mAdbActive = ((usbManager.getCurrentFunctions() & UsbManager.FUNCTION_ADB) == 1); Log.d(LOG_TAG, "ADB is " + mAdbActive + " on system startup"); } if (phase == PHASE_BOOT_COMPLETED) { if (mIProfcollect == null) { return; Loading