| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 package org.appspot.apprtc; | 11 package org.appspot.apprtc; |
| 12 | 12 |
| 13 import org.appspot.apprtc.util.AppRTCUtils; |
| 14 |
| 13 import android.content.Context; | 15 import android.content.Context; |
| 14 import android.hardware.Sensor; | 16 import android.hardware.Sensor; |
| 15 import android.hardware.SensorEvent; | 17 import android.hardware.SensorEvent; |
| 16 import android.hardware.SensorEventListener; | 18 import android.hardware.SensorEventListener; |
| 17 import android.hardware.SensorManager; | 19 import android.hardware.SensorManager; |
| 18 import android.os.Build; | 20 import android.os.Build; |
| 19 import android.util.Log; | 21 import android.util.Log; |
| 20 | 22 |
| 21 import org.appspot.apprtc.util.AppRTCUtils; | |
| 22 import org.webrtc.ThreadUtils; | 23 import org.webrtc.ThreadUtils; |
| 23 | 24 |
| 24 /** | 25 /** |
| 25 * AppRTCProximitySensor manages functions related to the proximity sensor in | 26 * AppRTCProximitySensor manages functions related to the proximity sensor in |
| 26 * the AppRTC demo. | 27 * the AppRTC demo. |
| 27 * On most device, the proximity sensor is implemented as a boolean-sensor. | 28 * On most device, the proximity sensor is implemented as a boolean-sensor. |
| 28 * It returns just two values "NEAR" or "FAR". Thresholding is done on the LUX | 29 * It returns just two values "NEAR" or "FAR". Thresholding is done on the LUX |
| 29 * value i.e. the LUX value of the light sensor is compared with a threshold. | 30 * value i.e. the LUX value of the light sensor is compared with a threshold. |
| 30 * A LUX-value more than the threshold means the proximity sensor returns "FAR". | 31 * A LUX-value more than the threshold means the proximity sensor returns "FAR". |
| 31 * Anything less than the threshold value and the sensor returns "NEAR". | 32 * Anything less than the threshold value and the sensor returns "NEAR". |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | 163 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { |
| 163 // Added in API level 21. | 164 // Added in API level 21. |
| 164 info.append(", max delay: ").append(proximitySensor.getMaxDelay()); | 165 info.append(", max delay: ").append(proximitySensor.getMaxDelay()); |
| 165 info.append(", reporting mode: ").append(proximitySensor.getReportingMode(
)); | 166 info.append(", reporting mode: ").append(proximitySensor.getReportingMode(
)); |
| 166 info.append(", isWakeUpSensor: ").append(proximitySensor.isWakeUpSensor())
; | 167 info.append(", isWakeUpSensor: ").append(proximitySensor.isWakeUpSensor())
; |
| 167 } | 168 } |
| 168 Log.d(TAG, info.toString()); | 169 Log.d(TAG, info.toString()); |
| 169 } | 170 } |
| 170 | 171 |
| 171 } | 172 } |
| OLD | NEW |