Example usage for android.hardware Sensor TYPE_PROXIMITY

List of usage examples for android.hardware Sensor TYPE_PROXIMITY

Introduction

In this page you can find the example usage for android.hardware Sensor TYPE_PROXIMITY.

Prototype

int TYPE_PROXIMITY

To view the source code for android.hardware Sensor TYPE_PROXIMITY.

Click Source Link

Document

A constant describing a proximity sensor type.

Usage

From source file:de.tubs.ibr.dtn.dtalkie.TalkieActivity.java

@Override
public void onResume() {
    super.onResume();

    SensorManager sm = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
    List<Sensor> sensors = sm.getSensorList(Sensor.TYPE_PROXIMITY);
    if (sensors.size() > 0) {
        Sensor sensor = sensors.get(0);/*www  .  j  a  v a2s. c  om*/
        sm.registerListener(mSensorListener, sensor, SensorManager.SENSOR_DELAY_NORMAL);
    }

    // set output to speaker
    setAudioOutput();
}

From source file:com.fallahpoor.infocenter.fragments.SensorsFragment.java

@TargetApi(Build.VERSION_CODES.KITKAT)
public ArrayList<String> getSubItemsArrayList() {

    HashMap<Integer, String> sensorsHashMap = new HashMap<>();
    ArrayList<String> subItems = new ArrayList<>();
    Iterator<Integer> iterator;
    String supported = getString(R.string.supported);
    String unsupported = getString(R.string.unsupported);
    ArrayList<Integer> sensorTypes = new ArrayList<>(Arrays.asList(new Integer[] { Sensor.TYPE_ACCELEROMETER,
            Sensor.TYPE_AMBIENT_TEMPERATURE, Sensor.TYPE_GRAVITY, Sensor.TYPE_GYROSCOPE, Sensor.TYPE_LIGHT,
            Sensor.TYPE_LINEAR_ACCELERATION, Sensor.TYPE_MAGNETIC_FIELD, Sensor.TYPE_PRESSURE,
            Sensor.TYPE_PROXIMITY, Sensor.TYPE_RELATIVE_HUMIDITY, Sensor.TYPE_ROTATION_VECTOR }));

    if (mIsApiAtLeast18) {
        sensorTypes.add(Sensor.TYPE_GAME_ROTATION_VECTOR);
        sensorTypes.add(Sensor.TYPE_SIGNIFICANT_MOTION);
    }//  w w w . j a  v  a  2s.  c o m

    if (mIsApiAtLeast19) {
        sensorTypes.add(Sensor.TYPE_GEOMAGNETIC_ROTATION_VECTOR);
        sensorTypes.add(Sensor.TYPE_STEP_COUNTER);
        sensorTypes.add(Sensor.TYPE_STEP_DETECTOR);
    }

    SensorManager sensorManager = (SensorManager) getActivity().getSystemService(Context.SENSOR_SERVICE);

    // Get the list of all available sensors of the device
    List<Sensor> sensors = sensorManager.getSensorList(Sensor.TYPE_ALL);

    iterator = sensorTypes.iterator();

    // Assume all sensor types are unsupported
    while (iterator.hasNext()) {
        sensorsHashMap.put(iterator.next(), unsupported);
    }

    /*
     * For each sensor type that is in sensors change its status from
     * "unsupported" to "supported".
     */
    for (Sensor sensor : sensors) {
        sensorsHashMap.put(sensor.getType(), supported);
    }

    iterator = sensorTypes.iterator();

    while (iterator.hasNext()) {
        subItems.add(sensorsHashMap.get(iterator.next()));
    }

    return subItems;

}

From source file:com.acrr.acdisplay.services.activemode.ActiveModeService.java

public static boolean isSupported(@NonNull Context context) {
    SensorManager sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
    return sensorManager.getSensorList(Sensor.TYPE_PROXIMITY).size() > 0;
}

From source file:it.unime.mobility4ckan.MySensor.java

public void registerSensor(Sensor mSensor) {
    LocationListener locationListener = new LocationListener() {
        @Override//  ww w .  jav a 2s  . c o  m
        public void onLocationChanged(Location location) {
            //latitude = location.getLatitude();
            //longitude = location.getLongitude();
            currentSpeed = location.getSpeed();
            //locationText.setText(String.valueOf(latitude)+ "  " +String.valueOf(longitude)+ "  " +String.valueOf(speed));
            //isGPSReady = true;
        }

        @Override
        public void onStatusChanged(String provider, int status, Bundle extras) {
            //
        }

        @Override
        public void onProviderEnabled(String provider) {
            //
        }

        @Override
        public void onProviderDisabled(String provider) {
            //
        }
    };

    SensorEventListener sensorListener = new SensorEventListener() {
        @Override
        public void onSensorChanged(SensorEvent event) {

            switch (event.sensor.getType()) {
            case Sensor.TYPE_AMBIENT_TEMPERATURE: // Gradi Celsius (C)
                currentTemp = event.values[0];
                break;

            case Sensor.TYPE_PRESSURE:
                currentPressure = event.values[0]; // hPa o mbar
                break;

            case Sensor.TYPE_LIGHT: // lx
                currentLight = event.values[0];
                break;

            case Sensor.TYPE_ACCELEROMETER: // m/s2
                currentAcceleration[0] = event.values[0];
                currentAcceleration[1] = event.values[1];
                currentAcceleration[2] = event.values[2];
                break;

            case Sensor.TYPE_GYROSCOPE: // rad/s
                currentGyroscope[0] = event.values[0];
                currentGyroscope[1] = event.values[1];
                currentGyroscope[2] = event.values[2];
                break;

            case Sensor.TYPE_MAGNETIC_FIELD: // T
                currentMagnetic[0] = event.values[0];
                currentMagnetic[1] = event.values[1];
                currentMagnetic[2] = event.values[2];
                break;

            case Sensor.TYPE_PROXIMITY: // cm
                currentProximity = event.values[0];
                break;

            case Sensor.TYPE_ROTATION_VECTOR: // unita di misura sconosciuta
                currentRotation[0] = event.values[0];
                currentRotation[1] = event.values[1];
                currentRotation[2] = event.values[2];
                break;

            case Sensor.TYPE_GRAVITY: // m/s2
                currentGravity[0] = event.values[0];
                currentGravity[1] = event.values[1];
                currentGravity[2] = event.values[2];
                break;

            case Sensor.TYPE_LINEAR_ACCELERATION: // m/s2
                currentLinearAcceleration[0] = event.values[0];
                currentLinearAcceleration[1] = event.values[1];
                currentLinearAcceleration[2] = event.values[2];
                break;

            case Sensor.TYPE_RELATIVE_HUMIDITY: // %
                currentHumidity = event.values[0];
                break;

            default:
                break;
            }

        }

        @Override
        public void onAccuracyChanged(Sensor sensor, int accuracy) {

        }
    };

    //sensorManager.registerListener(locationListener, mSensor, LocationManager.GPS_PROVIDER);
    /*        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
    // TODO: Consider calling
    //    ActivityCompat#requestPermissions
    // here to request the missing permissions, and then overriding
    //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
    //                                          int[] grantResults)
    // to handle the case where the user grants the permission. See the documentation
    // for ActivityCompat#requestPermissions for more details.
    return;
            }*/
    locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
    sensorManager.registerListener(sensorListener, mSensor, SensorManager.SENSOR_DELAY_FASTEST);
}

From source file:de.tudarmstadt.dvs.myhealthassistant.myhealthhub.services.InternalSensorService.java

@Override
public void onCreate() {
    // The service is being created
    Log.e(TAG, "onCreate");

    mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
    pref = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());

    if (pref.getBoolean(getResources().getString(R.string.in_acc), false)) {
        Sensor mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
        mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL);
    }/*from  ww w .  j a  va 2s.com*/
    if (pref.getBoolean(getResources().getString(R.string.in_lig), false)) {
        Sensor mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
        mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL);
    }
    if (pref.getBoolean(getResources().getString(R.string.in_pres), false)) {
        Sensor mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PRESSURE);
        mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL);
    }
    if (pref.getBoolean(getResources().getString(R.string.in_prox), false)) {
        Sensor mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
        mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL);
    }
    if (pref.getBoolean(getResources().getString(R.string.in_mag), false)) {
        Sensor mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
        mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL);
    }
    if (pref.getBoolean(getResources().getString(R.string.in_gyrs), false)) {
        Sensor mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE);
        mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL);
    }
    if (pref.getBoolean(getResources().getString(R.string.in_grav), false)) {
        Sensor mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_GRAVITY);
        mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL);
    }
    if (pref.getBoolean(getResources().getString(R.string.in_hum), false)) {
        Sensor mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_RELATIVE_HUMIDITY);
        mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL);
    }
    if (pref.getBoolean(getResources().getString(R.string.in_lin_acc), false)) {
        Sensor mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_LINEAR_ACCELERATION);
        mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL);
    }
    if (pref.getBoolean(getResources().getString(R.string.in_tem), false)) {
        Sensor mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_AMBIENT_TEMPERATURE);
        mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL);
    }

}

From source file:com.configurer.easyscreenlock.service.ForegroundSensorService.java

public boolean isSensorAvailable() {
    boolean available = false;
    try {/* ww w. ja  v a  2 s.  co m*/

        List<Sensor> list = mSensorManager.getSensorList(Sensor.TYPE_PROXIMITY);
        if (list != null)
            available = !list.isEmpty();

    } catch (Exception e) {
        available = false;
        Log.e(TAG, e.getMessage());
    }

    return available;
}

From source file:com.vonglasow.michael.satstat.SensorSectionFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    mainActivity = (MainActivity) this.getContext();
    View rootView = inflater.inflate(R.layout.fragment_main_sensors, container, false);

    Sensor mAccSensor = mainActivity.sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
    Sensor mGyroSensor = mainActivity.sensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE);
    Sensor mMagSensor = mainActivity.sensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
    Sensor mLightSensor = mainActivity.sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
    Sensor mProximitySensor = mainActivity.sensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
    Sensor mPressureSensor = mainActivity.sensorManager.getDefaultSensor(Sensor.TYPE_PRESSURE);
    Sensor mHumiditySensor = mainActivity.sensorManager.getDefaultSensor(Sensor.TYPE_RELATIVE_HUMIDITY);
    Sensor mTempSensor = mainActivity.sensorManager.getDefaultSensor(Sensor.TYPE_AMBIENT_TEMPERATURE);

    mAccSensorRes = getSensorDecimals(mAccSensor, mAccSensorRes);
    mGyroSensorRes = getSensorDecimals(mGyroSensor, mGyroSensorRes);
    mMagSensorRes = getSensorDecimals(mMagSensor, mMagSensorRes);
    mLightSensorRes = getSensorDecimals(mLightSensor, mLightSensorRes);
    mProximitySensorRes = getSensorDecimals(mProximitySensor, mProximitySensorRes);
    mPressureSensorRes = getSensorDecimals(mPressureSensor, mPressureSensorRes);
    mHumiditySensorRes = getSensorDecimals(mHumiditySensor, mHumiditySensorRes);
    mTempSensorRes = getSensorDecimals(mTempSensor, mTempSensorRes);

    // Initialize controls
    accStatus = (TextView) rootView.findViewById(R.id.accStatus);
    accHeader = (TextView) rootView.findViewById(R.id.accHeader);
    accX = (TextView) rootView.findViewById(R.id.accX);
    accY = (TextView) rootView.findViewById(R.id.accY);
    accZ = (TextView) rootView.findViewById(R.id.accZ);
    accTotal = (TextView) rootView.findViewById(R.id.accTotal);
    rotStatus = (TextView) rootView.findViewById(R.id.rotStatus);
    rotHeader = (TextView) rootView.findViewById(R.id.rotHeader);
    rotX = (TextView) rootView.findViewById(R.id.rotX);
    rotY = (TextView) rootView.findViewById(R.id.rotY);
    rotZ = (TextView) rootView.findViewById(R.id.rotZ);
    rotTotal = (TextView) rootView.findViewById(R.id.rotTotal);
    magStatus = (TextView) rootView.findViewById(R.id.magStatus);
    magHeader = (TextView) rootView.findViewById(R.id.magHeader);
    magX = (TextView) rootView.findViewById(R.id.magX);
    magY = (TextView) rootView.findViewById(R.id.magY);
    magZ = (TextView) rootView.findViewById(R.id.magZ);
    magTotal = (TextView) rootView.findViewById(R.id.magTotal);
    orStatus = (TextView) rootView.findViewById(R.id.orStatus);
    orHeader = (TextView) rootView.findViewById(R.id.orHeader);
    orAzimuth = (TextView) rootView.findViewById(R.id.orAzimuth);
    orAziText = (TextView) rootView.findViewById(R.id.orAziText);
    orPitch = (TextView) rootView.findViewById(R.id.orPitch);
    orRoll = (TextView) rootView.findViewById(R.id.orRoll);
    miscHeader = (TextView) rootView.findViewById(R.id.miscHeader);
    tempStatus = (TextView) rootView.findViewById(R.id.tempStatus);
    tempHeader = (TextView) rootView.findViewById(R.id.tempHeader);
    metTemp = (TextView) rootView.findViewById(R.id.metTemp);
    pressureStatus = (TextView) rootView.findViewById(R.id.pressureStatus);
    pressureHeader = (TextView) rootView.findViewById(R.id.pressureHeader);
    metPressure = (TextView) rootView.findViewById(R.id.metPressure);
    humidStatus = (TextView) rootView.findViewById(R.id.humidStatus);
    humidHeader = (TextView) rootView.findViewById(R.id.humidHeader);
    metHumid = (TextView) rootView.findViewById(R.id.metHumid);
    lightStatus = (TextView) rootView.findViewById(R.id.lightStatus);
    lightHeader = (TextView) rootView.findViewById(R.id.lightHeader);
    light = (TextView) rootView.findViewById(R.id.light);
    proximityStatus = (TextView) rootView.findViewById(R.id.proximityStatus);
    proximityHeader = (TextView) rootView.findViewById(R.id.proximityHeader);
    proximity = (TextView) rootView.findViewById(R.id.proximity);

    mainActivity.sensorSectionFragment = this;

    return rootView;
}

From source file:de.sixtyfourktec.mirrorhub.Main.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Log.i(TAG, "Starting MirrorHub v" + BuildConfig.VERSION_NAME + " (" + BuildConfig.BUILD_TIME + "/"
            + BuildConfig.GIT_SHA + ")");

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    setContentView(R.layout.main);//  www .ja v  a2 s.com

    moduleManager = ModuleManager.init(this);

    if (ActivityCompat.checkSelfPermission(this,
            Manifest.permission.READ_CALENDAR) != PackageManager.PERMISSION_GRANTED) {
        ActivityCompat.requestPermissions(this, new String[] { Manifest.permission.READ_CALENDAR },
                PERMISSIONS_REQUEST_READ_CALENDAR);
    } else
        moduleManager.enableCalendarModule();

    if (BuildConfig.ENABLE_PROXIMITY_SENSOR) {
        sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
        proximitySensor = sensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
        dimHandler = new Handler();
    }
}

From source file:uk.ac.horizon.ubihelper.service.Service.java

@Override
public void onCreate() {
    // One-time set-up...
    Log.d(TAG, "onCreate()");
    // TODO/*w  w  w  .j a v  a 2  s . com*/
    super.onCreate();
    // handler for requests
    mHandler = new Handler();
    // create taskbar notification
    int icon = R.drawable.service_notification_icon;
    CharSequence tickerText = getText(R.string.notification_start_message);
    long when = System.currentTimeMillis();

    Notification notification = new Notification(icon, tickerText, when);

    Context context = this;
    CharSequence contentTitle = getText(R.string.notification_title);
    CharSequence contentText = getText(R.string.notification_description);
    Intent notificationIntent = new Intent(this, MainPreferences.class);
    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);

    notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);

    startForeground(RUNNING_ID, notification);

    channelManager = new ChannelManager(peerChannelFactory);
    // sensors
    if (!isEmulator()) {
        Log.d(TAG, "Create sensor channels...");

        SensorChannel magnetic = new SensorChannel("magnetic", this, Sensor.TYPE_MAGNETIC_FIELD);
        channelManager.addChannel(magnetic);
        SensorChannel accelerometer = new SensorChannel("accelerometer", this, Sensor.TYPE_ACCELEROMETER);
        channelManager.addChannel(accelerometer);
        SensorChannel gyro = new SensorChannel("gyro", this, Sensor.TYPE_GYROSCOPE);
        channelManager.addChannel(gyro);
        SensorChannel light = new SensorChannel("light", this, Sensor.TYPE_LIGHT);
        channelManager.addChannel(light);
        SensorChannel pressure = new SensorChannel("pressure", this, Sensor.TYPE_PRESSURE);
        channelManager.addChannel(pressure);
        SensorChannel proximity = new SensorChannel("proximity", this, Sensor.TYPE_PROXIMITY);
        channelManager.addChannel(proximity);
        SensorChannel temperature = new SensorChannel("temperature", this, Sensor.TYPE_TEMPERATURE);
        channelManager.addChannel(temperature);

        try {
            Field f = Sensor.class.getField("TYPE_AMBIENT_TEMPERATURE");
            SensorChannel sc = new SensorChannel("ambientTemperature", this, f.getInt(null));
            channelManager.addChannel(sc);
        } catch (Exception e) {
            Log.d(TAG, "Could not get field Sensor.TYPE_AMBIENT_TEMPERATURE");
        }
        try {
            Field f = Sensor.class.getField("TYPE_RELATIVE_HUMIDITY");
            SensorChannel sc = new SensorChannel("relativeHumidity", this, f.getInt(null));
            channelManager.addChannel(sc);
        } catch (Exception e) {
            Log.d(TAG, "Could not get field Sensor.TYPE_AMBIENT_TEMPERATURE");
        }

        // all sensors by full name
        SensorManager sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
        if (sensorManager != null) {
            List<Sensor> sensors = sensorManager.getSensorList(Sensor.TYPE_ALL);
            for (Sensor sensor : sensors) {
                SensorChannel sc = new SensorChannel("sensor." + sensor.getName(), this, sensor);
                channelManager.addChannel(sc);
            }
        }
        BluetoothDiscoveryChannel btchannel = new BluetoothDiscoveryChannel(this, mHandler, "bluetooth");
        channelManager.addChannel(btchannel);
        WifiScannerChannel wifichannel = new WifiScannerChannel(this, mHandler, "wifi");
        channelManager.addChannel(wifichannel);
        GpsStatusChannel gpsstatus = new GpsStatusChannel("gpsstatus", this);
        channelManager.addChannel(gpsstatus);
        CellLocationChannel cellchannel = new CellLocationChannel(mHandler, this, "cell.location", false);
        channelManager.addChannel(cellchannel);
        CellLocationChannel cellchannel2 = new CellLocationChannel(mHandler, this, "cell.neighbors", true);
        channelManager.addChannel(cellchannel2);
        CellStrengthChannel cellchannel3 = new CellStrengthChannel(this, "cell.strength");
        channelManager.addChannel(cellchannel3);
    }
    channelManager.addChannel(new TimeChannel(mHandler, "time"));
    List<String> locationProviders = LocationChannel.getAllProviders(this);
    for (String provider : locationProviders) {
        LocationChannel locchannel = new LocationChannel("location." + provider, this, provider);
        channelManager.addChannel(locchannel);
    }

    channelManager.addChannel(new MicChannel(mHandler, "mic"));

    Log.d(TAG, "Create http server...");

    // http server
    httpPort = getPort();

    httpListener = new HttpListener(this, httpPort);
    httpListener.start();

    // peer communication
    peerManager = new PeerManager(this);
    int serverPort = peerManager.getServerPort();

    channelManager.addChannel(new EnabledPeersChannel(this, peerManager, "peers"));

    // wifi discovery
    wifiDiscoveryManager = new WifiDiscoveryManager(this);
    wifiDiscoverable = getWifiDiscoverable();
    wifiDiscoveryManager.setServerPort(serverPort);
    wifiDiscoveryManager.setEnabled(wifiDiscoverable);

    bluetooth = BluetoothAdapter.getDefaultAdapter();
    if (bluetooth != null)
        btmac = bluetooth.getAddress();

    telephony = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
    if (telephony != null)
        imei = telephony.getDeviceId();

    logManager = new LogManager(this, channelManager);
    logManager.checkPreferences();

    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
    prefs.registerOnSharedPreferenceChangeListener(onRunChangeListener);

    Log.d(TAG, "onCreate() finished");
}

From source file:org.awokenwell.proximity.ProximitySensorListener.java

/**
 * Start listening for compass sensor./*from   w w w  . j a v a  2 s . c o m*/
 *
 * @return          status of listener
 */
public int start() {

    // If already starting or running, then just return
    if ((this.status == ProximitySensorListener.RUNNING) || (this.status == ProximitySensorListener.STARTING)) {
        return this.status;
    }

    // Get proximity sensor from sensor manager
    //@SuppressWarnings("deprecation")
    //List<Sensor> list = this.sensorManager.getSensorList(Sensor.TYPE_PROXIMITY);

    this.mSensor = sensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
    sensorManager.registerListener(this, this.mSensor, SensorManager.SENSOR_DELAY_NORMAL);
    this.lastAccessTime = System.currentTimeMillis();
    this.setStatus(ProximitySensorListener.STARTING);

    //        // If found, then register as listener
    //        if (list != null && list.size() > 0) {
    //            this.mSensor = list.get(0);
    //            this.sensorManager.registerListener(this, this.mSensor, SensorManager.SENSOR_DELAY_NORMAL);
    //            this.lastAccessTime = System.currentTimeMillis();
    //            this.setStatus(ProximitySensorListener.STARTING);
    //        }
    //
    //        // If error, then set status to error
    //        else {
    //            this.setStatus(ProximitySensorListener.ERROR_FAILED_TO_START);
    //        }

    return this.status;
}