app/src/main/java/com/pokevian/app/smartfleet/service/AutoConnectService.java
@Override
    public void onCreate() {
        super.onCreate();
        Logger.getLogger(TAG).trace("onCreate@service");

        acquireWakeLock();

        mSettingsStore = SettingsStore.getInstance();
        mBroadcastManager = LocalBroadcastManager.getInstance(this);

        BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();

        if (btAdapter.isEnabled()) {
            if (AutoStartManager.isPowerSaveMode()) {
                if (isScreenOn()) {
                    registerVehicleReceiver();
                    startAndBindVehicleService();
                } else {
                    stopSelf();
                }
            } else {
                registerVehicleReceiver();
                startAndBindVehicleService();
            }
        } else {
            stopSelf();
        }
    }
//    private static int mTryCount = 0;
private static int mTryCount = 0.
private static int mTryCount = 0 .
@Override
    public void onCreate() {
        super.onCreate();
        Logger.getLogger(TAG).trace("onCreate@service");
        acquireWakeLock();
        mSettingsStore = SettingsStore.getInstance();
        mBroadcastManager = LocalBroadcastManager.getInstance(this);
        BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
        if (btAdapter.isEnabled()) {
            if (AutoStartManager.isPowerSaveMode()) {
                if (isScreenOn()) {
                    registerVehicleReceiver();
                    startAndBindVehicleService();
                } else {
                    stopSelf();
                }
            } else {
                registerVehicleReceiver();
                startAndBindVehicleService();
            }
        } else {
            stopSelf();
        }
    }
@ Override public void onCreate ( ) { super . onCreate ( ) ; Logger . getLogger ( TAG ) . trace ( "onCreate@service" ) ; acquireWakeLock ( ) ; mSettingsStore = SettingsStore . getInstance ( ) ; mBroadcastManager = LocalBroadcastManager . getInstance ( this ) ; BluetoothAdapter btAdapter = BluetoothAdapter . getDefaultAdapter ( ) ; if ( btAdapter . isEnabled ( ) ) { if ( AutoStartManager . isPowerSaveMode ( ) ) { if ( isScreenOn ( ) ) { registerVehicleReceiver ( ) ; startAndBindVehicleService ( ) ; } else { stopSelf ( ) ; } } else { registerVehicleReceiver ( ) ; startAndBindVehicleService ( ) ; } } else { stopSelf ( ) ; } }
private static int mTryCount = 0;
private static int mTryCount = 0 ;