Chromium Code Reviews| Index: chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/ShellActivity.java |
| diff --git a/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/ShellActivity.java b/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/ShellActivity.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..068f8ad15152937422c161233d5bcb03ecebc027 |
| --- /dev/null |
| +++ b/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/ShellActivity.java |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.webapk.shell_apk; |
| + |
| +import android.app.Activity; |
| +import android.os.Build; |
| +import android.os.Bundle; |
| + |
| +/** |
| + * WebAPK's activity which launches host browser and is shown in recents on L+. |
| + */ |
| +public class ShellActivity extends Activity { |
|
Yaron
2017/03/29 14:07:33
i think we need a better name for this. Perhaps so
Xi Han
2017/03/29 15:16:43
Done.
|
| + @Override |
| + protected void onCreate(Bundle savedInstanceState) { |
| + super.onCreate(savedInstanceState); |
| + assert Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP; |
|
Yaron
2017/03/29 14:07:33
This should only be called on L+? Then why the con
Xi Han
2017/03/29 15:16:43
Removed. I though assert is used like DCHECK, isn'
|
| + |
| + LaunchWebApkHelper helper = new LaunchWebApkHelper(); |
| + if (!helper.launch(this)) { |
| + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { |
| + finishAndRemoveTask(); |
| + } else { |
| + finish(); |
| + } |
| + } |
| + } |
| +} |