Commit eb91d635 authored by Nate Fischer's avatar Nate Fischer Committed by Commit Bot

AW: use distinct task affinities for each channel

Previously all WebView providers on the device would use the same
(global) taskAffinity for developer UI. This means launching Dev UI from
one channel would obliterate the previous Dev UI session, re-using the
original channel's icon for the task (which may no longer be correct).

The simplest solution to ensure we always have the right icon is to let
different channels launch in different tasks. We achieve this by using
the package name as part of the taskAffinity. This uses a "." instead of
a ":" delimiter because ":" is apparently an illegal character for
taskAffinity (can't compile).

Fixed: 1060013
Test: Manual - build 2 local builds and verify I can launch each
Test: side-by-side
Change-Id: If8b1def9a4d8af9187a117f39816dcce2c77913b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2095930Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748885}
parent 30eedfbd
...@@ -58,4 +58,5 @@ other: ...@@ -58,4 +58,5 @@ other:
declare either process depending on what it needs. declare either process depending on what it needs.
- Activities also need an explicit `android:taskAffinity`, otherwise using the - Activities also need an explicit `android:taskAffinity`, otherwise using the
WebView Activity will replace the current Chrome session from the task stack WebView Activity will replace the current Chrome session from the task stack
(or vice versa). (or vice versa). The taskAffinity should include the WebView package name,
otherwise Activities from different WebView channels will trample each other.
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
android:icon="@drawable/icon_webview" android:icon="@drawable/icon_webview"
android:theme="@style/Theme.DevUi.DayNight" android:theme="@style/Theme.DevUi.DayNight"
android:launchMode="singleTask" android:launchMode="singleTask"
android:taskAffinity="org.chromium.android_webview.devui" {# Explicit taskAffinity to distinguish from monochrome browser task. #} android:taskAffinity="{{ manifest_package }}.org.chromium.android_webview.devui" {# Explicit taskAffinity to distinguish from monochrome browser task. #}
android:process=":webview_apk"> {# Explicit process required for monochrome compatibility. #} android:process=":webview_apk"> {# Explicit process required for monochrome compatibility. #}
<intent-filter> <intent-filter>
<action android:name="com.android.webview.SHOW_DEV_UI" /> <action android:name="com.android.webview.SHOW_DEV_UI" />
...@@ -55,14 +55,14 @@ ...@@ -55,14 +55,14 @@
android:label="WebView Crashes" android:label="WebView Crashes"
android:theme="@style/Theme.DevUi.DayNight" android:theme="@style/Theme.DevUi.DayNight"
android:launchMode="singleTop" android:launchMode="singleTop"
android:taskAffinity="org.chromium.android_webview.devui" {# Explicit taskAffinity to distinguish from monochrome browser task. #} android:taskAffinity="{{ manifest_package }}.org.chromium.android_webview.devui" {# Explicit taskAffinity to distinguish from monochrome browser task. #}
android:process=":webview_apk"> {# Explicit process required for monochrome compatibility. #} android:process=":webview_apk"> {# Explicit process required for monochrome compatibility. #}
</activity> </activity>
<activity android:name="org.chromium.android_webview.devui.FlagsActivity" <activity android:name="org.chromium.android_webview.devui.FlagsActivity"
android:label="WebView Flags" android:label="WebView Flags"
android:theme="@style/Theme.DevUi.DayNight" android:theme="@style/Theme.DevUi.DayNight"
android:launchMode="singleTop" android:launchMode="singleTop"
android:taskAffinity="org.chromium.android_webview.devui" {# Explicit taskAffinity to distinguish from monochrome browser task. #} android:taskAffinity="{{ manifest_package }}.org.chromium.android_webview.devui" {# Explicit taskAffinity to distinguish from monochrome browser task. #}
android:process=":webview_apk"> {# Explicit process required for monochrome compatibility. #} android:process=":webview_apk"> {# Explicit process required for monochrome compatibility. #}
</activity> </activity>
<!-- End of WebView Developer UI Activities --> <!-- End of WebView Developer UI Activities -->
......
...@@ -1003,7 +1003,7 @@ ...@@ -1003,7 +1003,7 @@
android:launchMode="singleTask" android:launchMode="singleTask"
android:name="org.chromium.android_webview.devui.MainActivity" android:name="org.chromium.android_webview.devui.MainActivity"
android:process=":webview_apk" android:process=":webview_apk"
android:taskAffinity="org.chromium.android_webview.devui" android:taskAffinity="org.chromium.chrome.org.chromium.android_webview.devui"
android:theme="@style/Theme.DevUi.DayNight"> android:theme="@style/Theme.DevUi.DayNight">
<intent-filter> <intent-filter>
<action android:name="com.android.webview.SHOW_DEV_UI"/> <action android:name="com.android.webview.SHOW_DEV_UI"/>
...@@ -1028,7 +1028,7 @@ ...@@ -1028,7 +1028,7 @@
android:launchMode="singleTop" android:launchMode="singleTop"
android:name="org.chromium.android_webview.devui.CrashesListActivity" android:name="org.chromium.android_webview.devui.CrashesListActivity"
android:process=":webview_apk" android:process=":webview_apk"
android:taskAffinity="org.chromium.android_webview.devui" android:taskAffinity="org.chromium.chrome.org.chromium.android_webview.devui"
android:theme="@style/Theme.DevUi.DayNight"/> android:theme="@style/Theme.DevUi.DayNight"/>
<activity <activity
android:label="WebView android:label="WebView
...@@ -1036,7 +1036,7 @@ ...@@ -1036,7 +1036,7 @@
android:launchMode="singleTop" android:launchMode="singleTop"
android:name="org.chromium.android_webview.devui.FlagsActivity" android:name="org.chromium.android_webview.devui.FlagsActivity"
android:process=":webview_apk" android:process=":webview_apk"
android:taskAffinity="org.chromium.android_webview.devui" android:taskAffinity="org.chromium.chrome.org.chromium.android_webview.devui"
android:theme="@style/Theme.DevUi.DayNight"/> android:theme="@style/Theme.DevUi.DayNight"/>
<activity <activity
android:enabled="false" android:enabled="false"
......
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