Merge "Revert "Recommend writeTypedObject()"" into main
diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp
index 4492c85..001653b 100644
--- a/media/jni/android_media_MediaCodec.cpp
+++ b/media/jni/android_media_MediaCodec.cpp
@@ -1461,6 +1461,21 @@
             break;
         }
 
+        case MediaCodec::CB_METRICS_FLUSHED:
+        {
+            sp<WrapperObject<std::unique_ptr<mediametrics::Item>>> metrics;
+            CHECK(msg->findObject("metrics", (sp<RefBase>*)&metrics));
+
+            // metrics should never be null. Not sure if checking it here adds any value.
+            if (metrics == nullptr) {
+                return;
+            }
+
+            mediametrics::Item *item = metrics->value.get();
+            obj = MediaMetricsJNI::writeMetricsToBundle(env, item, NULL);
+            break;
+        }
+
         default:
             TRESPASS();
     }
diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml
index c440a07..dd6545b 100644
--- a/packages/SettingsLib/res/values/strings.xml
+++ b/packages/SettingsLib/res/values/strings.xml
@@ -823,6 +823,8 @@
     <string name="enable_linux_terminal_title">Linux development environment</string>
     <!-- Summary of checkbox setting that enables the Linux terminal app. [CHAR LIMIT=64] -->
     <string name="enable_linux_terminal_summary">Run Linux terminal on Android</string>
+    <!-- Disclaimer below the checkbox that disabling the Linux terminal app would clear its data. [CHAR LIMIT=64] -->
+    <string name="disable_linux_terminal_disclaimer">If you disable, Linux terminal data will be cleared</string>
 
     <!-- HDCP checking title, used for debug purposes only. [CHAR LIMIT=25] -->
     <string name="hdcp_checking_title">HDCP checking</string>