Merge "audio policy: add method to query dB attenuation for a certain volume and device" into oc-dr1-dev
am: 1165cb67e8

Change-Id: Ic29287cbd4f368146f656e173db51f187435167d
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..8f405e9
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,4 @@
+elaurent@google.com
+etalvala@google.com
+lajos@google.com
+marcone@google.com
diff --git a/camera/OWNERS b/camera/OWNERS
new file mode 100644
index 0000000..18acfee
--- /dev/null
+++ b/camera/OWNERS
@@ -0,0 +1,6 @@
+cychen@google.com
+epeev@google.com
+etalvala@google.com
+shuzhenwang@google.com
+yinchiayeh@google.com
+zhijunhe@google.com
diff --git a/cmds/OWNERS b/cmds/OWNERS
new file mode 100644
index 0000000..0d32aac
--- /dev/null
+++ b/cmds/OWNERS
@@ -0,0 +1,3 @@
+elaurent@google.com
+lajos@google.com
+marcone@google.com
diff --git a/drm/OWNERS b/drm/OWNERS
new file mode 100644
index 0000000..e788754
--- /dev/null
+++ b/drm/OWNERS
@@ -0,0 +1 @@
+jtinker@google.com
diff --git a/include/OWNERS b/include/OWNERS
new file mode 100644
index 0000000..0ec7529
--- /dev/null
+++ b/include/OWNERS
@@ -0,0 +1,5 @@
+elaurent@google.com
+gkasten@android.com
+hunga@google.com
+lajos@google.com
+marcone@google.com
diff --git a/media/OWNERS b/media/OWNERS
new file mode 100644
index 0000000..cd4afb4
--- /dev/null
+++ b/media/OWNERS
@@ -0,0 +1,5 @@
+hunga@google.com
+lajos@google.com
+marcone@google.com
+robertshih@google.com
+wjia@google.com
diff --git a/media/libmedia/CharacterEncodingDetector.cpp b/media/libmedia/CharacterEncodingDetector.cpp
index 3020136..808c2b5 100644
--- a/media/libmedia/CharacterEncodingDetector.cpp
+++ b/media/libmedia/CharacterEncodingDetector.cpp
@@ -85,6 +85,8 @@
         UErrorCode status = U_ZERO_ERROR;
         UCharsetDetector *csd = ucsdet_open(&status);
         const UCharsetMatch *ucm;
+        bool goodmatch = true;
+        int highest = 0;
 
         // try combined detection of artist/album/title etc.
         char buf[1024];
@@ -116,8 +118,6 @@
             ucsdet_setText(csd, buf, strlen(buf), &status);
             int32_t matches;
             const UCharsetMatch** ucma = ucsdet_detectAll(csd, &matches, &status);
-            bool goodmatch = true;
-            int highest = 0;
             const UCharsetMatch* bestCombinedMatch = getPreferred(buf, strlen(buf),
                     ucma, matches, &goodmatch, &highest);
 
@@ -180,8 +180,24 @@
                     !strcmp(name, "genre") ||
                     !strcmp(name, "album") ||
                     !strcmp(name, "title"))) {
-                // use encoding determined from the combination of artist/album/title etc.
-                enc = combinedenc;
+                if (!goodmatch && highest < 0) {
+                    // Give it one more chance if there is no good match.
+                    ALOGV("Trying to detect %s separately", name);
+                    int32_t matches;
+                    bool goodmatchSingle = true;
+                    int highestSingle = 0;
+                    ucsdet_setText(csd, s, inputLength, &status);
+                    const UCharsetMatch** ucma = ucsdet_detectAll(csd, &matches, &status);
+                    const UCharsetMatch* bestSingleMatch = getPreferred(s, inputLength,
+                            ucma, matches, &goodmatchSingle, &highestSingle);
+                    if (goodmatchSingle || highestSingle > highest)
+                        enc = ucsdet_getName(bestSingleMatch, &status);
+                    else
+                        enc = combinedenc;
+                } else {
+                    // use encoding determined from the combination of artist/album/title etc.
+                    enc = combinedenc;
+                }
             } else {
                 if (isPrintableAscii(s, inputLength)) {
                     enc = "UTF-8";
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index bdeecb0..142ae07 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -4838,9 +4838,9 @@
                             rect.nTop < 0 ||
                             rect.nLeft + rect.nWidth > videoDef->nFrameWidth ||
                             rect.nTop + rect.nHeight > videoDef->nFrameHeight) {
-                            ALOGE("Wrong cropped rect (%d, %d) - (%u, %u) vs. frame (%u, %u)",
+                            ALOGE("Wrong cropped rect (%d, %d, %u, %u) vs. frame (%u, %u)",
                                     rect.nLeft, rect.nTop,
-                                    rect.nLeft + rect.nWidth, rect.nTop + rect.nHeight,
+                                    rect.nWidth, rect.nHeight,
                                     videoDef->nFrameWidth, videoDef->nFrameHeight);
                             return BAD_VALUE;
                         }
diff --git a/radio/OWNERS b/radio/OWNERS
new file mode 100644
index 0000000..4b38a35
--- /dev/null
+++ b/radio/OWNERS
@@ -0,0 +1,2 @@
+elaurent@google.com
+twasilczyk@google.com
diff --git a/services/OWNERS b/services/OWNERS
new file mode 100644
index 0000000..d500dce
--- /dev/null
+++ b/services/OWNERS
@@ -0,0 +1,4 @@
+elaurent@google.com
+etalvala@google.com
+gkasten@android.com
+hunga@google.com
diff --git a/services/camera/OWNERS b/services/camera/OWNERS
new file mode 100644
index 0000000..18acfee
--- /dev/null
+++ b/services/camera/OWNERS
@@ -0,0 +1,6 @@
+cychen@google.com
+epeev@google.com
+etalvala@google.com
+shuzhenwang@google.com
+yinchiayeh@google.com
+zhijunhe@google.com
diff --git a/services/mediacodec/OWNERS b/services/mediacodec/OWNERS
new file mode 100644
index 0000000..c716cce
--- /dev/null
+++ b/services/mediacodec/OWNERS
@@ -0,0 +1,2 @@
+jeffv@google.com
+marcone@google.com
diff --git a/services/mediadrm/OWNERS b/services/mediadrm/OWNERS
new file mode 100644
index 0000000..6d3b533
--- /dev/null
+++ b/services/mediadrm/OWNERS
@@ -0,0 +1,2 @@
+jtinker@google.com
+marcone@google.com
diff --git a/services/mediaextractor/OWNERS b/services/mediaextractor/OWNERS
new file mode 100644
index 0000000..c716cce
--- /dev/null
+++ b/services/mediaextractor/OWNERS
@@ -0,0 +1,2 @@
+jeffv@google.com
+marcone@google.com
diff --git a/services/medialog/OWNERS b/services/medialog/OWNERS
new file mode 100644
index 0000000..fb8b8ee
--- /dev/null
+++ b/services/medialog/OWNERS
@@ -0,0 +1,3 @@
+elaurent@google.com
+gkasten@android.com
+hunga@google.com
diff --git a/services/mediaresourcemanager/OWNERS b/services/mediaresourcemanager/OWNERS
new file mode 100644
index 0000000..82abf8f
--- /dev/null
+++ b/services/mediaresourcemanager/OWNERS
@@ -0,0 +1 @@
+dwkang@google.com
diff --git a/services/radio/OWNERS b/services/radio/OWNERS
new file mode 100644
index 0000000..eb9549a
--- /dev/null
+++ b/services/radio/OWNERS
@@ -0,0 +1,3 @@
+elaurent@google.com
+hunga@google.com
+twasilczyk@google.com
diff --git a/services/soundtrigger/OWNERS b/services/soundtrigger/OWNERS
new file mode 100644
index 0000000..e83f6b9
--- /dev/null
+++ b/services/soundtrigger/OWNERS
@@ -0,0 +1,2 @@
+elaurent@google.com
+thorntonc@google.com
diff --git a/soundtrigger/OWNERS b/soundtrigger/OWNERS
new file mode 100644
index 0000000..e83f6b9
--- /dev/null
+++ b/soundtrigger/OWNERS
@@ -0,0 +1,2 @@
+elaurent@google.com
+thorntonc@google.com
diff --git a/tools/OWNERS b/tools/OWNERS
new file mode 100644
index 0000000..6dcb035
--- /dev/null
+++ b/tools/OWNERS
@@ -0,0 +1 @@
+gkasten@android.com