Merge "Add test for fq reference to local type."
diff --git a/camera/device/1.0/default/CameraDevice.cpp b/camera/device/1.0/default/CameraDevice.cpp
index c53c0d8..a03bbc8 100644
--- a/camera/device/1.0/default/CameraDevice.cpp
+++ b/camera/device/1.0/default/CameraDevice.cpp
@@ -377,10 +377,14 @@
     hidl_handle hidlHandle = mem->mHidlHandle;
     MemoryId id = object->mDeviceCallback->registerMemory(hidlHandle, buf_size, num_bufs);
     mem->handle.mId = id;
-    if (object->mMemoryMap.count(id) != 0) {
-        ALOGE("%s: duplicate MemoryId %d returned by client!", __FUNCTION__, id);
+
+    {
+        Mutex::Autolock _l(object->mMemoryMapLock);
+        if (object->mMemoryMap.count(id) != 0) {
+            ALOGE("%s: duplicate MemoryId %d returned by client!", __FUNCTION__, id);
+        }
+        object->mMemoryMap[id] = mem;
     }
-    object->mMemoryMap[id] = mem;
     mem->handle.mDevice = object;
     return &mem->handle;
 }
@@ -398,7 +402,10 @@
         ALOGE("%s: camera HAL return memory while camera is not opened!", __FUNCTION__);
     }
     device->mDeviceCallback->unregisterMemory(mem->handle.mId);
-    device->mMemoryMap.erase(mem->handle.mId);
+    {
+        Mutex::Autolock _l(device->mMemoryMapLock);
+        device->mMemoryMap.erase(mem->handle.mId);
+    }
     mem->decStrong(mem);
 }
 
@@ -826,7 +833,16 @@
         return;
     }
     if (mDevice->ops->release_recording_frame) {
-        CameraHeapMemory* camMemory = mMemoryMap.at(memId);
+        CameraHeapMemory* camMemory;
+        {
+            Mutex::Autolock _l(mMemoryMapLock);
+            auto it = mMemoryMap.find(memId);
+            if (it == mMemoryMap.end() || it->second == nullptr) {
+                ALOGE("%s unknown memoryId %d", __FUNCTION__, memId);
+                return;
+            }
+            camMemory = it->second;
+        }
         if (bufferIndex >= camMemory->mNumBufs) {
             ALOGE("%s: bufferIndex %d exceeds number of buffers %d",
                     __FUNCTION__, bufferIndex, camMemory->mNumBufs);
diff --git a/camera/device/1.0/default/CameraDevice_1_0.h b/camera/device/1.0/default/CameraDevice_1_0.h
index c078596..2c980f0 100644
--- a/camera/device/1.0/default/CameraDevice_1_0.h
+++ b/camera/device/1.0/default/CameraDevice_1_0.h
@@ -165,6 +165,8 @@
 
     sp<ICameraDeviceCallback> mDeviceCallback = nullptr;
 
+    mutable Mutex mMemoryMapLock; // gating access to mMemoryMap
+                                  // must not hold mLock after this lock is acquired
     std::unordered_map<MemoryId, CameraHeapMemory*> mMemoryMap;
 
     bool mMetadataMode = false;
diff --git a/current.txt b/current.txt
index c152bb1..0828c6e 100644
--- a/current.txt
+++ b/current.txt
@@ -189,4 +189,7 @@
 
 # ABI preserving changes to HALs released in Android O
 
-28e929b453df3d9f5060af2764e6cdb123ddb893e3e86923c877f6ff7e5f02c9 android.hardware.wifi@1.0::types
\ No newline at end of file
+28e929b453df3d9f5060af2764e6cdb123ddb893e3e86923c877f6ff7e5f02c9 android.hardware.wifi@1.0::types
+
+# HALs released in Android O MR1 (Final Set)
+0a159f81359cd4f71bbe00972ee8403ea79351fb7c0cd48be72ebb3e424dbaef android.hardware.radio@1.0::types
diff --git a/radio/1.0/types.hal b/radio/1.0/types.hal
index c5d7f8a..4d22bc0 100644
--- a/radio/1.0/types.hal
+++ b/radio/1.0/types.hal
@@ -1507,8 +1507,8 @@
     int32_t lac;                          // 16-bit Location Area Code, 0..65535, INT_MAX if unknown
     int32_t cid;                          // 16-bit GSM Cell Identity described in
                                           // TS 27.007, 0..65535, INT_MAX if unknown
-    int32_t arfcn;                        // 16-bit GSM Absolute RF channel number, INT_MAX if
-                                          // unknown
+    int32_t arfcn;                        // 16-bit GSM Absolute RF channel number; this value must
+                                          // be valid
     uint8_t bsic;                         // 6-bit Base Station Identity Code, 0xFF if unknown
 };
 
@@ -1520,9 +1520,9 @@
     int32_t cid;                          // 28-bit UMTS Cell Identity described in
                                           // TS 25.331, 0..268435455, INT_MAX if unknown
     int32_t psc;                          // 9-bit UMTS Primary Scrambling Code described in
-                                          // TS 25.331, 0..511, INT_MAX if unknown
-    int32_t uarfcn;                       // 16-bit UMTS Absolute RF Channel Number, INT_MAX if
-                                          // unknown
+                                          // TS 25.331, 0..511; this value must be valid
+    int32_t uarfcn;                       // 16-bit UMTS Absolute RF Channel Number; this value must
+                                          // be valid
 };
 
 struct CellIdentityCdma {
@@ -1547,10 +1547,10 @@
                                           // unknown
     int32_t ci;                           // 28-bit Cell Identity described in TS TS 27.007, INT_MAX
                                           // if unknown
-    int32_t pci;                          // physical cell id 0..503, INT_MAX if unknown
+    int32_t pci;                          // physical cell id 0..503; this value must be valid
     int32_t tac;                          // 16-bit tracking area code, INT_MAX if unknown
-    int32_t earfcn;                       // 18-bit LTE Absolute RC Channel Number, INT_MAX if
-                                          // unknown
+    int32_t earfcn;                       // 18-bit LTE Absolute RF Channel Number; this value must
+                                          // be valid
 };
 
 struct CellIdentityTdscdma {
diff --git a/sensors/1.0/default/OWNERS b/sensors/1.0/default/OWNERS
new file mode 100644
index 0000000..6a38a1f
--- /dev/null
+++ b/sensors/1.0/default/OWNERS
@@ -0,0 +1,2 @@
+ashutoshj@google.com
+pengxu@google.com
diff --git a/sensors/1.0/vts/functional/OWNERS b/sensors/1.0/vts/functional/OWNERS
new file mode 100644
index 0000000..8715e5d
--- /dev/null
+++ b/sensors/1.0/vts/functional/OWNERS
@@ -0,0 +1,7 @@
+# Sensors team
+ashutoshj@google.com
+pengxu@google.com
+
+# VTS team
+trong@google.com
+yim@google.com