blob: 10cfea166abd5867e84f188aed404b5053bd87fa [file] [log] [blame]
Torne (Richard Coles)08cfaf62014-05-08 16:07:05 +01001/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.webkit;
18
Gustav Sennton6258dcd2015-10-30 19:25:37 +000019import android.content.pm.PackageInfo;
20import android.webkit.WebViewProviderInfo;
21import android.webkit.WebViewProviderResponse;
22
Torne (Richard Coles)08cfaf62014-05-08 16:07:05 +010023/**
24 * Private service to wait for the updatable WebView to be ready for use.
25 * @hide
26 */
27interface IWebViewUpdateService {
28
29 /**
30 * Used by the relro file creator to notify the service that it's done.
31 */
Gustav Sennton6258dcd2015-10-30 19:25:37 +000032 void notifyRelroCreationCompleted();
Torne (Richard Coles)08cfaf62014-05-08 16:07:05 +010033
34 /**
35 * Used by WebViewFactory to block loading of WebView code until
Gustav Sennton6258dcd2015-10-30 19:25:37 +000036 * preparations are complete. Returns the package used as WebView provider.
Torne (Richard Coles)08cfaf62014-05-08 16:07:05 +010037 */
Gustav Sennton6258dcd2015-10-30 19:25:37 +000038 WebViewProviderResponse waitForAndGetProvider();
Torne (Richard Coles)08cfaf62014-05-08 16:07:05 +010039
Gustav Sennton6258dcd2015-10-30 19:25:37 +000040 /**
Gustav Senntonc83e3fa2016-02-18 12:19:13 +000041 * DevelopmentSettings uses this to notify WebViewUpdateService that a new provider has been
42 * selected by the user. Returns the provider we end up switching to, this could be different to
43 * the one passed as argument to this method since the Dev Setting calling this method could be
44 * stale. I.e. the Dev setting could be letting the user choose uninstalled/disabled packages,
45 * it would then try to update the provider to such a package while in reality the update
46 * service would switch to another one.
Gustav Sennton6258dcd2015-10-30 19:25:37 +000047 */
Gustav Senntonc83e3fa2016-02-18 12:19:13 +000048 String changeProviderAndSetting(String newProvider);
Gustav Sennton6258dcd2015-10-30 19:25:37 +000049
50 /**
51 * DevelopmentSettings uses this to get the current available WebView
52 * providers (to display as choices to the user).
53 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +000054 @UnsupportedAppUsage
Gustav Sennton6258dcd2015-10-30 19:25:37 +000055 WebViewProviderInfo[] getValidWebViewPackages();
56
57 /**
Gustav Sennton8b179262016-03-14 11:31:14 +000058 * Fetch all packages that could potentially implement WebView.
59 */
60 WebViewProviderInfo[] getAllWebViewPackages();
61
62 /**
Gustav Sennton6258dcd2015-10-30 19:25:37 +000063 * Used by DevelopmentSetting to get the name of the WebView provider currently in use.
64 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +000065 @UnsupportedAppUsage
Gustav Sennton6258dcd2015-10-30 19:25:37 +000066 String getCurrentWebViewPackageName();
Gustav Senntonc83e3fa2016-02-18 12:19:13 +000067
68 /**
Gustav Senntonbf683e02016-09-15 14:42:50 +010069 * Used by public API for debugging purposes.
70 */
71 PackageInfo getCurrentWebViewPackage();
72
73 /**
Gustav Senntonc83e3fa2016-02-18 12:19:13 +000074 * Used by Settings to determine whether a certain package can be enabled/disabled by the user -
75 * the package should not be modifiable in this way if it is a fallback package.
76 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +000077 @UnsupportedAppUsage
Gustav Senntonc83e3fa2016-02-18 12:19:13 +000078 boolean isFallbackPackage(String packageName);
79
80 /**
81 * Enable or disable the WebView package fallback mechanism.
82 */
83 void enableFallbackLogic(boolean enable);
Torne (Richard Coles)1a4c4e32017-01-10 15:57:41 +000084
85 /**
86 * Used by Settings to determine whether multiprocess is enabled.
87 */
88 boolean isMultiProcessEnabled();
89
90 /**
91 * Used by Settings to enable/disable multiprocess.
92 */
93 void enableMultiProcess(boolean enable);
Torne (Richard Coles)08cfaf62014-05-08 16:07:05 +010094}