Merge Android Pie into master

Bug: 112104996
Change-Id: I4c66fc140a17a0f313ced4675227229a0756c7ef
diff --git a/res/values-en-rCA/strings.xml b/res/values-en-rCA/strings.xml
new file mode 100644
index 0000000..d25e400
--- /dev/null
+++ b/res/values-en-rCA/strings.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="app_label" msgid="7454398782183407432">"TV Storage"</string>
+    <string name="permlab_readTvListings" msgid="5272001606068276291">"Read all TV listings"</string>
+    <string name="permdesc_readTvListings" msgid="1165157606059567535">"read all TV listings available on your device"</string>
+</resources>
diff --git a/res/values-en-rXC/strings.xml b/res/values-en-rXC/strings.xml
new file mode 100644
index 0000000..6b11ad9
--- /dev/null
+++ b/res/values-en-rXC/strings.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="app_label" msgid="7454398782183407432">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‏‎‏‏‎‎‎‏‎‏‏‏‏‏‏‏‏‏‏‎‎‏‏‏‎‏‏‏‎‎‏‏‎‏‎‏‏‎‎‎‎‎‏‏‎‎‏‎‏‎‎‎‎‎‏‎‎‎‏‎‎‏‎‏‎‏‏‏‏‏‏‏‎‏‎‎‏‎‎‎‎TV Storage‎‏‎‎‏‎"</string>
+    <string name="permlab_readTvListings" msgid="5272001606068276291">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‏‎‏‏‎‎‎‏‎‏‏‏‏‏‏‏‏‏‎‎‏‎‎‏‎‎‏‎‏‎‎‏‏‏‏‎‏‎‎‏‏‎‎‎‎‏‏‏‎‏‎‎‏‎‎‎‏‏‏‏‏‏‎‏‎‎‎‎‏‏‎‎‎‏‎‎‎‎‏‏‎read all TV listings‎‏‎‎‏‎"</string>
+    <string name="permdesc_readTvListings" msgid="1165157606059567535">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‏‎‏‏‎‎‎‏‎‏‏‏‏‏‏‎‏‏‎‎‎‎‎‎‏‎‏‎‏‏‎‏‏‏‏‎‎‎‏‎‏‎‏‎‏‏‎‏‏‎‎‎‎‎‏‎‎‎‎‏‏‎‎‏‏‎‏‎‎‏‏‎‏‎‏‏‏‏‎read all TV listings available on your device‎‏‎‎‏‎"</string>
+</resources>
diff --git a/res/values-mr/strings.xml b/res/values-mr/strings.xml
index b8be32f..734ddc2 100644
--- a/res/values-mr/strings.xml
+++ b/res/values-mr/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label" msgid="7454398782183407432">"टीव्ही संचय"</string>
+    <string name="app_label" msgid="7454398782183407432">"टीव्ही स्टोरेज"</string>
     <string name="permlab_readTvListings" msgid="5272001606068276291">"सर्व टीव्ही सूची वाचा"</string>
     <string name="permdesc_readTvListings" msgid="1165157606059567535">"आपल्या डिव्हाइसवर उपलब्ध असलेल्या सर्व टीव्ही सूची वाचा"</string>
 </resources>
diff --git a/src/com/android/providers/tv/TvProvider.java b/src/com/android/providers/tv/TvProvider.java
index 6968196..01bc833 100644
--- a/src/com/android/providers/tv/TvProvider.java
+++ b/src/com/android/providers/tv/TvProvider.java
@@ -1166,7 +1166,8 @@
                     default:
                         return null;
                 }
-                try (SQLiteDatabase db = mOpenHelper.getWritableDatabase()) {
+                SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+                try {
                     db.execSQL("ALTER TABLE " + tableName + " ADD "
                             + columnName + " " + dataType + defaultValue + ";");
                     projectionMap.put(columnName.toString(), tableName + '.' + columnName);
@@ -1588,7 +1589,7 @@
 
     private static void updateProjectionMap(SQLiteDatabase db, String tableName,
             Map<String, String> projectionMap) {
-        try(Cursor cursor = db.rawQuery("SELECT * FROM " + tableName + " LIMIT 0", null)) {
+        try (Cursor cursor = db.rawQuery("SELECT * FROM " + tableName + " LIMIT 0", null)) {
             for (String columnName : cursor.getColumnNames()) {
                 if (!projectionMap.containsKey(columnName)) {
                     projectionMap.put(columnName, tableName + '.' + columnName);