Commit c8c8e276 authored by Peter Kotwicz's avatar Peter Kotwicz Committed by Commit Bot

[Android WebAPK] Switch N+ behaviour to be the default for new-style WebAPKs

This CL changes the activity which is launched on first run for new-style
WebAPKs. The CL changes the default to H2OOpaqueMainActivity which has
a solid color background theme. This change means:
- On N+, users will get a faster pixels-on-screen first run experience
  for WebAPKs that they install
- Pre-N, on first run, H2OOpaqueMainActivity will be launched, finished,
  and the app will be relaunched with H2OMainActivity. The relaunch is
  necessary in order to switch which android.intent.action.MAIN is enabled.

BUG=817263

Change-Id: I7728a26e9d41024fdc53db97b97116c863b449b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1638237Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665116}
parent d0dfeb21
......@@ -53,7 +53,6 @@
android:theme="@style/SplashTheme"
android:relinquishTaskIdentity="true"
android:excludeFromRecents="true"
android:enabled="false"
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......@@ -70,6 +69,7 @@
[[/use_new_splash]]
<activity android:name="org.chromium.webapk.shell_apk.[[#use_new_splash]]h2o.H2O[[/use_new_splash]]MainActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
[[#use_new_splash]]android:enabled="false"[[/use_new_splash]]
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......
......@@ -12,4 +12,4 @@
# //chrome/android/webapk/shell_apk:webapk is changed. This includes
# Java files, Android resource files and AndroidManifest.xml. Does not affect
# Chrome.apk
current_shell_apk_version = 89
current_shell_apk_version = 90
......@@ -25,9 +25,8 @@ public class H2OMainActivity extends TransparentLauncherActivity {
PackageManager pm = context.getPackageManager();
ComponentName component = new ComponentName(context, H2OMainActivity.class);
int enabledSetting = pm.getComponentEnabledSetting(component);
// Component is enabled by default.
return enabledSetting == PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|| enabledSetting == PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
// Component is disabled by default.
return enabledSetting == PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
}
@Override
......
......@@ -23,8 +23,9 @@ public class H2OOpaqueMainActivity extends Activity {
PackageManager pm = context.getPackageManager();
ComponentName component = new ComponentName(context, H2OOpaqueMainActivity.class);
int enabledSetting = pm.getComponentEnabledSetting(component);
// Component is disabled by default.
return enabledSetting == PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
// Component is enabled by default.
return enabledSetting == PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|| enabledSetting == PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
}
@Override
......
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