Commit 6d24e357 authored by Nate Fischer's avatar Nate Fischer Committed by Commit Bot

[AW][Dev-UI] always include icon resource

Standalone & Trichrome WebView now unconditionally includes
LauncherActivity (defined in DeveloperUiLauncherManifest), and
conditionally set the enabled state to true/false based on GN args
(webview_devui_show_icon, which is configured by android_channel).

This is a step toward resolving https://crbug.com/1047824, although this
is not a complete solution since this doesn't change the monochrome
behavior.

Fixed: 1140741
Bug: 1047824
Test: aapt dump xmltree TrichromeWebViewGoogle.apk AndroidManifest.xml | grep -A 2 'LauncherActivity'
Test: Same for TrichromeWebViewGoogleBeta, TrichromeWebViewGoogleStable, SystemWebViewGoogle, SystemWebView
Test: adb shell pm enable com.google.android.webview.debug/org.chromium.android_webview.devui.LauncherActivity
Test: adb shell pm disable com.google.android.webview.debug/org.chromium.android_webview.devui.LauncherActivity
Change-Id: Id996965643a6fea31a34ebe39fb5b2b8ac5f5c0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2500435Reviewed-by: default avatarHazem Ashmawy <hazems@chromium.org>
Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Commit-Queue: Richard Coles <torne@chromium.org>
Auto-Submit: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822231}
parent 537a49eb
...@@ -58,6 +58,17 @@ ...@@ -58,6 +58,17 @@
android:targetActivity="org.chromium.android_webview.devui.MainActivity" android:targetActivity="org.chromium.android_webview.devui.MainActivity"
android:visibleToInstantApps="true"> android:visibleToInstantApps="true">
</activity-alias> # DIFF-ANCHOR: b7cc06e9 </activity-alias> # DIFF-ANCHOR: b7cc06e9
<activity-alias # DIFF-ANCHOR: a4f5e364
android:enabled="false"
android:exported="true"
android:label="WebView DevTools"
android:name="org.chromium.android_webview.devui.LauncherActivity"
android:targetActivity="org.chromium.android_webview.devui.MainActivity">
<intent-filter> # DIFF-ANCHOR: a5330430
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> # DIFF-ANCHOR: a5330430
</activity-alias> # DIFF-ANCHOR: a4f5e364
<meta-data android:name="$PACKAGE.WebViewLibrary" android:value="libwebviewchromium.so"/> <meta-data android:name="$PACKAGE.WebViewLibrary" android:value="libwebviewchromium.so"/>
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
<meta-data android:name="org.chromium.content.browser.NUM_PRIVILEGED_SERVICES" android:value="0"/> <meta-data android:name="org.chromium.content.browser.NUM_PRIVILEGED_SERVICES" android:value="0"/>
......
...@@ -58,6 +58,17 @@ ...@@ -58,6 +58,17 @@
android:targetActivity="org.chromium.android_webview.devui.MainActivity" android:targetActivity="org.chromium.android_webview.devui.MainActivity"
android:visibleToInstantApps="true"> android:visibleToInstantApps="true">
</activity-alias> # DIFF-ANCHOR: b7cc06e9 </activity-alias> # DIFF-ANCHOR: b7cc06e9
<activity-alias # DIFF-ANCHOR: a4f5e364
android:enabled="false"
android:exported="true"
android:label="WebView DevTools"
android:name="org.chromium.android_webview.devui.LauncherActivity"
android:targetActivity="org.chromium.android_webview.devui.MainActivity">
<intent-filter> # DIFF-ANCHOR: a5330430
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> # DIFF-ANCHOR: a5330430
</activity-alias> # DIFF-ANCHOR: a4f5e364
<meta-data android:name="$PACKAGE.WebViewLibrary" android:value="libmonochrome.so"/> <meta-data android:name="$PACKAGE.WebViewLibrary" android:value="libmonochrome.so"/>
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
<meta-data android:name="org.chromium.content.browser.NUM_PRIVILEGED_SERVICES" android:value="0"/> <meta-data android:name="org.chromium.content.browser.NUM_PRIVILEGED_SERVICES" android:value="0"/>
......
...@@ -161,9 +161,18 @@ android_resources("devui_resources") { ...@@ -161,9 +161,18 @@ android_resources("devui_resources") {
] ]
} }
_devui_launcher_icon_android_manifest = "$root_gen_dir/android_webview/system_webview_apk/DeveloperUiLauncherManifest.xml"
jinja_template("devui_launcher_icon_manifest") {
input = "java/DeveloperUiLauncherManifest.xml"
output = _devui_launcher_icon_android_manifest
variables = [ "show_devui_icon=$webview_devui_show_icon" ]
}
android_resources("devui_launcher_icon_resources") { android_resources("devui_launcher_icon_resources") {
sources = [] sources = []
android_manifest = "java/DeveloperUiLauncherManifest.xml" android_manifest = _devui_launcher_icon_android_manifest
android_manifest_dep = ":devui_launcher_icon_manifest"
} }
android_resources("monochrome_devui_launcher_icon_resources") { android_resources("monochrome_devui_launcher_icon_resources") {
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
<activity-alias android:name="org.chromium.android_webview.devui.LauncherActivity" <activity-alias android:name="org.chromium.android_webview.devui.LauncherActivity"
android:targetActivity="org.chromium.android_webview.devui.MainActivity" android:targetActivity="org.chromium.android_webview.devui.MainActivity"
android:label="WebView DevTools" android:label="WebView DevTools"
android:exported="true"> android:exported="true"
android:enabled="{{ show_devui_icon|default('true') }}">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
......
...@@ -46,6 +46,7 @@ template("system_webview_apk_or_module_tmpl") { ...@@ -46,6 +46,7 @@ template("system_webview_apk_or_module_tmpl") {
deps += [ deps += [
"//android_webview:locale_pak_assets", "//android_webview:locale_pak_assets",
"//android_webview:pak_file_assets", "//android_webview:pak_file_assets",
"//android_webview/nonembedded:devui_launcher_icon_resources",
] ]
if (_exclude_weblayer_java) { if (_exclude_weblayer_java) {
...@@ -86,10 +87,6 @@ template("system_webview_apk_or_module_tmpl") { ...@@ -86,10 +87,6 @@ template("system_webview_apk_or_module_tmpl") {
alternative_android_sdk_dep = webview_framework_dep alternative_android_sdk_dep = webview_framework_dep
} }
if (webview_devui_show_icon) {
deps += [ "//android_webview/nonembedded:devui_launcher_icon_resources" ]
}
_use_trichrome_library = _use_trichrome_library =
defined(use_trichrome_library) && use_trichrome_library defined(use_trichrome_library) && use_trichrome_library
assert( assert(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment