// 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.BluetoothManager;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
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.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
        }
        if (filter.getServiceUuid() != null) {
            if (filter.getServiceUuidMask() != null) {
                builder.setServiceUuid(filter.getServiceUuid(), filter.getServiceUuidMask());
            } else {
                builder.setServiceUuid(filter.getServiceUuid());
            }
        }
        return builder.build();
    }

    private static List<ScanResult> fromOs(List<android.bluetooth.le.ScanResult> osResults) {
        List<ScanResult> results = new ArrayList<ScanResult>(osResults.size());
        for (android.bluetooth.le.ScanResult result : osResults) {
            results.add(fromOs(result));
        }
        return results;
    }

    private static ScanResult fromOs(android.bluetooth.le.ScanResult osResult) {
        return new ScanResult(
                osResult.getDevice(),
                fromOs(osResult.getScanRecord()),
                osResult.getRssi(),
                // Convert the osResult timestamp from 'nanos since boot' to 'nanos since epoch'.
                osResult.getTimestampNanos() + getActualBootTimeNanos());
    }

    private static long getActualBootTimeNanos() {
        long currentTimeNanos = TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis());
// 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/LBluetoothLeScannerCompat.java
import android.annotation.TargetApi;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.bluetooth.BluetoothAdapter;
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 android.text.TextUtils;
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.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;

        }
        if (filter.getServiceUuid() != null) {
            if (filter.getServiceUuidMask() != null) {
                builder.setServiceUuid(filter.getServiceUuid(), filter.getServiceUuidMask());
            } else {
                builder.setServiceUuid(filter.getServiceUuid());
            }
        }
        return builder.build();
    }

    private static List<ScanResult> fromOs(List<android.bluetooth.le.ScanResult> osResults) {
        List<ScanResult> results = new ArrayList<ScanResult>(osResults.size());
        for (android.bluetooth.le.ScanResult result : osResults) {
            results.add(fromOs(result));
        }
        return results;
    }

    private static ScanResult fromOs(android.bluetooth.le.ScanResult osResult) {
        return new ScanResult(
                osResult.getDevice(),
                fromOs(osResult.getScanRecord()),
                osResult.getRssi(),
                // Convert the osResult timestamp from 'nanos since boot' to 'nanos since epoch'.
                osResult.getTimestampNanos() + getActualBootTimeNanos());
    }

    private static long getActualBootTimeNanos() {
        long currentTimeNanos = TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis());
        long elapsedRealtimeNanos = android.os.SystemClock.elapsedRealtimeNanos();