Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

frameworks-native: Commit

frameworks/native


Commit MetaInfo

Revision0cd66b9e4a3303f15af350c820488b44070dac60 (tree)
Time2014-08-27 19:07:29
AuthorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

Android 4.4.4 Release 2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEABECAAYFAlO7IasACgkQ6K0/gZqxDnissgCghiWMtk4owpXqeDIGBKsl0XAD
QaIAniO0um7XkckUlzgpop7hkCtXJ9hR
=LdPI
-----END PGP SIGNATURE-----

Merge tag 'android-4.4.4_r2' into kitkat-x86

Android 4.4.4 Release 2

Conflicts:
libs/binder/Parcel.cpp

Change Summary

Incremental Difference

--- a/cmds/flatland/Android.mk
+++ b/cmds/flatland/Android.mk
@@ -1,3 +1,4 @@
1+local_target_dir := $(TARGET_OUT_DATA)/local/tmp
12 LOCAL_PATH:= $(call my-dir)
23 include $(CLEAR_VARS)
34
@@ -11,6 +12,8 @@ LOCAL_MODULE:= flatland
1112
1213 LOCAL_MODULE_TAGS := tests
1314
15+LOCAL_MODULE_PATH := $(local_target_dir)
16+
1417 LOCAL_SHARED_LIBRARIES := \
1518 libEGL \
1619 libGLESv2 \
--- a/include/binder/Parcel.h
+++ b/include/binder/Parcel.h
@@ -102,6 +102,7 @@ public:
102102 status_t writeStrongBinder(const sp<IBinder>& val);
103103 status_t writeWeakBinder(const wp<IBinder>& val);
104104 status_t writeInt32Array(size_t len, const int32_t *val);
105+ status_t writeByteArray(size_t len, const uint8_t *val);
105106
106107 template<typename T>
107108 status_t write(const Flattenable<T>& val);
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -628,6 +628,16 @@ status_t Parcel::writeInt32Array(size_t len, const int32_t *val) {
628628 }
629629 return ret;
630630 }
631+status_t Parcel::writeByteArray(size_t len, const uint8_t *val) {
632+ if (!val) {
633+ return writeAligned(-1);
634+ }
635+ status_t ret = writeAligned(len);
636+ if (ret == NO_ERROR) {
637+ ret = write(val, len * sizeof(*val));
638+ }
639+ return ret;
640+}
631641
632642 status_t Parcel::writeInt64(int64_t val)
633643 {
@@ -898,7 +908,8 @@ void Parcel::remove(size_t start, size_t amt)
898908
899909 status_t Parcel::read(void* outData, size_t len) const
900910 {
901- if ((mDataPos+PAD_SIZE(len)) >= mDataPos && (mDataPos+PAD_SIZE(len)) <= mDataSize) {
911+ if ((mDataPos+PAD_SIZE(len)) >= mDataPos && (mDataPos+PAD_SIZE(len)) <= mDataSize
912+ && len <= PAD_SIZE(len)) {
902913 memcpy(outData, mData+mDataPos, len);
903914 mDataPos += PAD_SIZE(len);
904915 ALOGV("read Setting data pos of %p to %d\n", this, mDataPos);
@@ -909,7 +920,8 @@ status_t Parcel::read(void* outData, size_t len) const
909920
910921 const void* Parcel::readInplace(size_t len) const
911922 {
912- if ((mDataPos+PAD_SIZE(len)) >= mDataPos && (mDataPos+PAD_SIZE(len)) <= mDataSize) {
923+ if ((mDataPos+PAD_SIZE(len)) >= mDataPos && (mDataPos+PAD_SIZE(len)) <= mDataSize
924+ && len <= PAD_SIZE(len)) {
913925 const void* data = mData+mDataPos;
914926 mDataPos += PAD_SIZE(len);
915927 ALOGV("readInplace Setting data pos of %p to %d\n", this, mDataPos);
@@ -1334,8 +1346,8 @@ void Parcel::ipcSetDataReference(const uint8_t* data, size_t dataSize,
13341346 for (size_t i = 0; i < mObjectsSize; i++) {
13351347 size_t offset = mObjects[i];
13361348 if (offset < minOffset) {
1337- ALOGE("%s: bad object offset %d < %d\n",
1338- __func__, offset, minOffset);
1349+ ALOGE("%s: bad object offset %zu < %zu\n",
1350+ __func__, offset, minOffset);
13391351 mObjectsSize = 0;
13401352 break;
13411353 }
--- a/services/sensorservice/SensorFusion.cpp
+++ b/services/sensorservice/SensorFusion.cpp
@@ -102,15 +102,6 @@ status_t SensorFusion::activate(void* ident, bool enabled) {
102102 }
103103 }
104104
105- if (enabled) {
106- ALOGD_IF(DEBUG_CONNECTIONS, "SensorFusion calling batch ident=%p ", ident);
107- // Activating a sensor in continuous mode is equivalent to calling batch with the default
108- // period and timeout equal to ZERO, followed by a call to activate.
109- mSensorDevice.batch(ident, mAcc.getHandle(), 0, DEFAULT_EVENTS_PERIOD, 0);
110- mSensorDevice.batch(ident, mMag.getHandle(), 0, DEFAULT_EVENTS_PERIOD, 0);
111- mSensorDevice.batch(ident, mGyro.getHandle(), 0, DEFAULT_EVENTS_PERIOD, 0);
112- }
113-
114105 mSensorDevice.activate(ident, mAcc.getHandle(), enabled);
115106 mSensorDevice.activate(ident, mMag.getHandle(), enabled);
116107 mSensorDevice.activate(ident, mGyro.getHandle(), enabled);
@@ -127,9 +118,10 @@ status_t SensorFusion::activate(void* ident, bool enabled) {
127118 }
128119
129120 status_t SensorFusion::setDelay(void* ident, int64_t ns) {
130- mSensorDevice.setDelay(ident, mAcc.getHandle(), ns);
131- mSensorDevice.setDelay(ident, mMag.getHandle(), ms2ns(20));
132- mSensorDevice.setDelay(ident, mGyro.getHandle(), mTargetDelayNs);
121+ // Call batch with timeout zero instead of setDelay().
122+ mSensorDevice.batch(ident, mAcc.getHandle(), 0, ns, 0);
123+ mSensorDevice.batch(ident, mMag.getHandle(), 0, ms2ns(20), 0);
124+ mSensorDevice.batch(ident, mGyro.getHandle(), 0, mTargetDelayNs, 0);
133125 return NO_ERROR;
134126 }
135127
--- a/services/sensorservice/SensorFusion.h
+++ b/services/sensorservice/SensorFusion.h
@@ -37,7 +37,6 @@ class SensorDevice;
3737
3838 class SensorFusion : public Singleton<SensorFusion> {
3939 friend class Singleton<SensorFusion>;
40- static const nsecs_t DEFAULT_EVENTS_PERIOD = 200000000; // 5 Hz
4140
4241 SensorDevice& mSensorDevice;
4342 Sensor mAcc;
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -426,20 +426,21 @@ bool SensorService::threadLoop()
426426 }
427427
428428 void SensorService::recordLastValue(
429- sensors_event_t const * buffer, size_t count)
430-{
429+ const sensors_event_t* buffer, size_t count) {
431430 Mutex::Autolock _l(mLock);
432- // record the last event for each sensor
433- int32_t prev = buffer[0].sensor;
434- for (size_t i=1 ; i<count ; i++) {
435- // record the last event of each sensor type in this buffer
436- int32_t curr = buffer[i].sensor;
437- if (curr != prev) {
438- mLastEventSeen.editValueFor(prev) = buffer[i-1];
439- prev = curr;
431+ const sensors_event_t* last = NULL;
432+ for (size_t i = 0; i < count; i++) {
433+ const sensors_event_t* event = &buffer[i];
434+ if (event->type != SENSOR_TYPE_META_DATA) {
435+ if (last && event->sensor != last->sensor) {
436+ mLastEventSeen.editValueFor(last->sensor) = *last;
437+ }
438+ last = event;
440439 }
441440 }
442- mLastEventSeen.editValueFor(prev) = buffer[count-1];
441+ if (last) {
442+ mLastEventSeen.editValueFor(last->sensor) = *last;
443+ }
443444 }
444445
445446 void SensorService::sortEventBuffer(sensors_event_t* buffer, size_t count)
--- a/services/sensorservice/SensorService.h
+++ b/services/sensorservice/SensorService.h
@@ -131,7 +131,7 @@ class SensorService :
131131
132132 String8 getSensorName(int handle) const;
133133 bool isVirtualSensor(int handle) const;
134- void recordLastValue(sensors_event_t const * buffer, size_t count);
134+ void recordLastValue(const sensors_event_t* buffer, size_t count);
135135 static void sortEventBuffer(sensors_event_t* buffer, size_t count);
136136 Sensor registerSensor(SensorInterface* sensor);
137137 Sensor registerVirtualSensor(SensorInterface* sensor);
Show on old repository browser