From d6e44db934916b7ee57e9011d56f1f5e1febbab8 Mon Sep 17 00:00:00 2001 From: Bo-Rong Chen Date: Mon, 6 Jan 2025 01:04:52 -0800 Subject: [PATCH] [android] Fix CommandLine initialization Removed initializing CommandLine from the file `content-shell-command-line`, as Cobalt doesn't need it. b/387917915 --- cobalt/android/BUILD.gn | 1 - .../app/src/main/java/dev/cobalt/coat/CobaltActivity.java | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cobalt/android/BUILD.gn b/cobalt/android/BUILD.gn index 831a54795fc..eb9b6249f6a 100644 --- a/cobalt/android/BUILD.gn +++ b/cobalt/android/BUILD.gn @@ -211,7 +211,6 @@ content_shell_apk_tmpl("cobalt_apk") { ":cobalt_apk_java", ] shared_libraries = [ ":libcobalt_content_shell_content_view" ] - command_line_flags_file = "content-shell-command-line" include_size_info = is_official_build } diff --git a/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java index 0da2663317d..d8cb1139bc9 100644 --- a/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java +++ b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java @@ -35,7 +35,6 @@ import android.widget.LinearLayout; import android.widget.Toast; import androidx.annotation.Nullable; -import dev.cobalt.app.CobaltApplication; import dev.cobalt.coat.javabridge.CobaltJavaScriptAndroidObject; import dev.cobalt.coat.javabridge.CobaltJavaScriptInterface; import dev.cobalt.coat.javabridge.H5vccPlatformService; @@ -102,7 +101,7 @@ public abstract class CobaltActivity extends Activity { protected void createContent(final Bundle savedInstanceState) { // Initializing the command line must occur before loading the library. if (!CommandLine.isInitialized()) { - ((CobaltApplication) getApplication()).initCommandLine(); + CommandLine.init(null); String[] cobaltCommandLineParams = new String[] { @@ -480,7 +479,9 @@ protected void onStop() { super.onStop(); WebContents webContents = getActiveWebContents(); - if (webContents != null) webContents.onHide(); + if (webContents != null) { + webContents.onHide(); + } if (VideoSurfaceView.getCurrentSurface() != null) { forceCreateNewVideoSurfaceView = true;