Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2731)

Unified Diff: device/sensors/sensor_manager_android.cc

Issue 2674613003: git cl format //device/sensors (Closed)
Patch Set: git cl format //device/sensors Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/sensors/data_fetcher_shared_memory_win.cc ('k') | device/sensors/sensor_manager_android_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/sensors/sensor_manager_android.cc
diff --git a/device/sensors/sensor_manager_android.cc b/device/sensors/sensor_manager_android.cc
index 0be733888c16c70005434d12cd8fc517e49aaf33..c896e1a78729123ba2a3858f4cec73016e909df9 100644
--- a/device/sensors/sensor_manager_android.cc
+++ b/device/sensors/sensor_manager_android.cc
@@ -27,7 +27,9 @@ void UpdateDeviceOrientationHistogram(
}
void SetOrientation(device::DeviceOrientationHardwareBuffer* buffer,
- double alpha, double beta, double gamma) {
+ double alpha,
+ double beta,
+ double gamma) {
buffer->seqlock.WriteBegin();
buffer->data.alpha = alpha;
buffer->data.hasAlpha = true;
@@ -65,8 +67,7 @@ SensorManagerAndroid::SensorManagerAndroid()
AttachCurrentThread(), base::android::GetApplicationContext()));
}
-SensorManagerAndroid::~SensorManagerAndroid() {
-}
+SensorManagerAndroid::~SensorManagerAndroid() {}
bool SensorManagerAndroid::Register(JNIEnv* env) {
return RegisterNativesImpl(env);
@@ -95,7 +96,7 @@ void SensorManagerAndroid::GotOrientation(JNIEnv*,
OrientationSensorType type =
static_cast<OrientationSensorType>(GetOrientationSensorTypeUsed());
SetOrientationBufferStatus(device_orientation_buffer_, true,
- type != GAME_ROTATION_VECTOR);
+ type != GAME_ROTATION_VECTOR);
orientation_buffer_initialized_ = true;
UpdateDeviceOrientationHistogram(type);
}
@@ -330,8 +331,9 @@ void SensorManagerAndroid::StopFetchingDeviceMotionData() {
void SensorManagerAndroid::CheckMotionBufferReadyToRead() {
if (received_motion_data_[RECEIVED_MOTION_DATA_ACCELERATION] +
- received_motion_data_[RECEIVED_MOTION_DATA_ACCELERATION_INCL_GRAVITY] +
- received_motion_data_[RECEIVED_MOTION_DATA_ROTATION_RATE] ==
+ received_motion_data_
timvolodine 2017/02/16 23:31:02 yah this one is also weird, I guess the original w
+ [RECEIVED_MOTION_DATA_ACCELERATION_INCL_GRAVITY] +
+ received_motion_data_[RECEIVED_MOTION_DATA_ROTATION_RATE] ==
number_active_device_motion_sensors_) {
device_motion_buffer_->seqlock.WriteBegin();
device_motion_buffer_->data.interval =
@@ -339,13 +341,15 @@ void SensorManagerAndroid::CheckMotionBufferReadyToRead() {
device_motion_buffer_->seqlock.WriteEnd();
SetMotionBufferReadyStatus(true);
- UMA_HISTOGRAM_BOOLEAN("InertialSensor.AccelerometerAndroidAvailable",
+ UMA_HISTOGRAM_BOOLEAN(
+ "InertialSensor.AccelerometerAndroidAvailable",
received_motion_data_[RECEIVED_MOTION_DATA_ACCELERATION] > 0);
UMA_HISTOGRAM_BOOLEAN(
"InertialSensor.AccelerometerIncGravityAndroidAvailable",
- received_motion_data_[RECEIVED_MOTION_DATA_ACCELERATION_INCL_GRAVITY]
- > 0);
- UMA_HISTOGRAM_BOOLEAN("InertialSensor.GyroscopeAndroidAvailable",
+ received_motion_data_[RECEIVED_MOTION_DATA_ACCELERATION_INCL_GRAVITY] >
+ 0);
+ UMA_HISTOGRAM_BOOLEAN(
+ "InertialSensor.GyroscopeAndroidAvailable",
received_motion_data_[RECEIVED_MOTION_DATA_ROTATION_RATE] > 0);
}
}
@@ -383,7 +387,7 @@ void SensorManagerAndroid::StartFetchingDeviceOrientationData(
// If Start() was unsuccessful then set the buffer ready flag to true
// to start firing all-null events.
SetOrientationBufferStatus(buffer, !success /* ready */,
- false /* absolute */);
+ false /* absolute */);
orientation_buffer_initialized_ = !success;
}
@@ -425,7 +429,7 @@ void SensorManagerAndroid::StartFetchingDeviceOrientationAbsoluteData(
// If Start() was unsuccessful then set the buffer ready flag to true
// to start firing all-null events.
SetOrientationBufferStatus(buffer, !success /* ready */,
- false /* absolute */);
+ false /* absolute */);
orientation_absolute_buffer_initialized_ = !success;
}
}
@@ -440,7 +444,7 @@ void SensorManagerAndroid::StopFetchingDeviceOrientationAbsoluteData() {
base::AutoLock autolock(orientation_absolute_buffer_lock_);
if (device_orientation_absolute_buffer_) {
SetOrientationBufferStatus(device_orientation_absolute_buffer_, false,
- false);
+ false);
orientation_absolute_buffer_initialized_ = false;
device_orientation_absolute_buffer_ = nullptr;
}
« no previous file with comments | « device/sensors/data_fetcher_shared_memory_win.cc ('k') | device/sensors/sensor_manager_android_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698