// Path: library/src/main/java/com/reelyactive/blesdk/support/ble/util/Clock.java
// public interface Clock {
// 
//   /**
//    * @return current time in milliseconds
//    */
//   public long currentTimeMillis();
// 
//   /**
//    * @return time since the device was booted, in nanoseconds
//    */
//   public long elapsedRealtimeNanos();
// 
// }
// 
// Path: library/src/main/java/com/reelyactive/blesdk/support/ble/util/Logger.java
// public class Logger {
// 
//   public static final String TAG = "BleScanCompatLib";
// 
//   public static void logVerbose(String message) {
//     if (Log.isLoggable(TAG, Log.VERBOSE)) {
//       Log.v(TAG, message);
//     }
//   }
// 
//   public static void logWarning(String message) {
//     if (Log.isLoggable(TAG, Log.WARN)) {
//       Log.w(TAG, message);
//     }
//   }
// 
//   public static void logDebug(String message) {
//     if (Log.isLoggable(TAG, Log.DEBUG)) {
//       Log.d(TAG, message);
//     }
//   }
// 
//   public static void logInfo(String message) {
//     if (Log.isLoggable(TAG, Log.INFO)) {
//       Log.i(TAG, message);
//     }
//   }
// 
//   public static void logError(String message, Exception... e) {
//     if (Log.isLoggable(TAG, Log.ERROR)) {
//       if (e == null || e.length == 0) {
//         Log.e(TAG, message);
//       } else {
//         Log.e(TAG, message, e[0]);
//       }
//     }
//   }
// }
// 
// Path: library/src/main/java/com/reelyactive/blesdk/support/ble/util/SystemClock.java
// public class SystemClock implements Clock {
// 
//   /**
//    * @return current time in milliseconds
//    */
//   @Override
//   public long currentTimeMillis() {
//     return System.currentTimeMillis();
//   }
// 
//   /**
//    * @return time since the device was booted, in nanoseconds
//    */
//   @Override
//   @TargetApi(VERSION_CODES.JELLY_BEAN_MR1)
//   public long elapsedRealtimeNanos() {
//     return android.os.SystemClock.elapsedRealtimeNanos();
//   }
// }


import android.annotation.TargetApi;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothManager;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import com.reelyactive.blesdk.support.ble.util.Clock;
import com.reelyactive.blesdk.support.ble.util.Logger;
import com.reelyactive.blesdk.support.ble.util.SystemClock;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
                    long currentTimeInNanos = TimeUnit.MILLISECONDS.toNanos(getClock().currentTimeMillis());
                    ScanResult result = new ScanResult(device, ScanRecord.parseFromBytes(scanRecordBytes), rssi,
                            currentTimeInNanos);
                    onScanResult(device.getAddress(), result);
                    if (crashResolver != null)
                        crashResolver.notifyScannedDevice(device, this);
                }
            };

    /**
     * Package constructor, called from {@link BluetoothLeScannerCompatProvider}.
     */
    JbBluetoothLeScannerCompat(
            Context context, BluetoothManager manager, AlarmManager alarmManager) {
        this(manager, alarmManager, new SystemClock(),
                PendingIntent.getBroadcast(context, 0 /* requestCode */,
                        new Intent(context, ScanWakefulBroadcastReceiver.class).putExtra(ScanWakefulService.EXTRA_USE_LOLLIPOP_API, false), 0 /* flags */));
        this.crashResolver = new BluetoothCrashResolver(context);
        this.crashResolver.start();
        this.mainHandler = new Handler(Looper.getMainLooper());
    }

    /**
     * Testing constructor for the scanner.
     *
     * @VisibleForTesting
     */
    JbBluetoothLeScannerCompat(BluetoothManager manager, AlarmManager alarmManager,
                               Clock clock, PendingIntent alarmIntent) {
        super(clock, alarmManager, alarmIntent);
// Path: library/src/main/java/com/reelyactive/blesdk/support/ble/util/Clock.java
// public interface Clock {
// 
//   /**
//    * @return current time in milliseconds
//    */
//   public long currentTimeMillis();
// 
//   /**
//    * @return time since the device was booted, in nanoseconds
//    */
//   public long elapsedRealtimeNanos();
// 
// }
// 
// Path: library/src/main/java/com/reelyactive/blesdk/support/ble/util/Logger.java
// public class Logger {
// 
//   public static final String TAG = "BleScanCompatLib";
// 
//   public static void logVerbose(String message) {
//     if (Log.isLoggable(TAG, Log.VERBOSE)) {
//       Log.v(TAG, message);
//     }
//   }
// 
//   public static void logWarning(String message) {
//     if (Log.isLoggable(TAG, Log.WARN)) {
//       Log.w(TAG, message);
//     }
//   }
// 
//   public static void logDebug(String message) {
//     if (Log.isLoggable(TAG, Log.DEBUG)) {
//       Log.d(TAG, message);
//     }
//   }
// 
//   public static void logInfo(String message) {
//     if (Log.isLoggable(TAG, Log.INFO)) {
//       Log.i(TAG, message);
//     }
//   }
// 
//   public static void logError(String message, Exception... e) {
//     if (Log.isLoggable(TAG, Log.ERROR)) {
//       if (e == null || e.length == 0) {
//         Log.e(TAG, message);
//       } else {
//         Log.e(TAG, message, e[0]);
//       }
//     }
//   }
// }
// 
// Path: library/src/main/java/com/reelyactive/blesdk/support/ble/util/SystemClock.java
// public class SystemClock implements Clock {
// 
//   /**
//    * @return current time in milliseconds
//    */
//   @Override
//   public long currentTimeMillis() {
//     return System.currentTimeMillis();
//   }
// 
//   /**
//    * @return time since the device was booted, in nanoseconds
//    */
//   @Override
//   @TargetApi(VERSION_CODES.JELLY_BEAN_MR1)
//   public long elapsedRealtimeNanos() {
//     return android.os.SystemClock.elapsedRealtimeNanos();
//   }
// }


// Path: library/src/main/java/com/reelyactive/blesdk/support/ble/JbBluetoothLeScannerCompat.java
import android.annotation.TargetApi;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothManager;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import com.reelyactive.blesdk.support.ble.util.Clock;
import com.reelyactive.blesdk.support.ble.util.Logger;
import com.reelyactive.blesdk.support.ble.util.SystemClock;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;

                    long currentTimeInNanos = TimeUnit.MILLISECONDS.toNanos(getClock().currentTimeMillis());
                    ScanResult result = new ScanResult(device, ScanRecord.parseFromBytes(scanRecordBytes), rssi,
                            currentTimeInNanos);
                    onScanResult(device.getAddress(), result);
                    if (crashResolver != null)
                        crashResolver.notifyScannedDevice(device, this);
                }
            };

    /**
     * Package constructor, called from {@link BluetoothLeScannerCompatProvider}.
     */
    JbBluetoothLeScannerCompat(
            Context context, BluetoothManager manager, AlarmManager alarmManager) {
        this(manager, alarmManager, new SystemClock(),
                PendingIntent.getBroadcast(context, 0 /* requestCode */,
                        new Intent(context, ScanWakefulBroadcastReceiver.class).putExtra(ScanWakefulService.EXTRA_USE_LOLLIPOP_API, false), 0 /* flags */));
        this.crashResolver = new BluetoothCrashResolver(context);
        this.crashResolver.start();
        this.mainHandler = new Handler(Looper.getMainLooper());
    }

    /**
     * Testing constructor for the scanner.
     *
     * @VisibleForTesting
     */
    JbBluetoothLeScannerCompat(BluetoothManager manager, AlarmManager alarmManager,
                               Clock clock, PendingIntent alarmIntent) {
        super(clock, alarmManager, alarmIntent);
        Logger.logDebug("BLE 'JB' hardware access layer activated");