• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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 
17 package android.webkit;
18 
19 import android.content.pm.PackageInfo;
20 import android.webkit.WebViewProviderInfo;
21 import android.webkit.WebViewProviderResponse;
22 
23 /**
24  * Private service to wait for the updatable WebView to be ready for use.
25  * @hide
26  */
27 interface IWebViewUpdateService {
28 
29     /**
30      * Used by the relro file creator to notify the service that it's done.
31      */
notifyRelroCreationCompleted()32     void notifyRelroCreationCompleted();
33 
34     /**
35      * Used by WebViewFactory to block loading of WebView code until
36      * preparations are complete. Returns the package used as WebView provider.
37      */
waitForAndGetProvider()38     WebViewProviderResponse waitForAndGetProvider();
39 
40     /**
41      * 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.
47      */
48     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS)")
changeProviderAndSetting(String newProvider)49     String changeProviderAndSetting(String newProvider);
50 
51     /**
52      * DevelopmentSettings uses this to get the current available WebView
53      * providers (to display as choices to the user).
54      */
55     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
getValidWebViewPackages()56     WebViewProviderInfo[] getValidWebViewPackages();
57 
58     /**
59      * Fetch all packages that could potentially implement WebView.
60      */
getAllWebViewPackages()61     WebViewProviderInfo[] getAllWebViewPackages();
62 
63     /**
64      * Used by DevelopmentSetting to get the name of the WebView provider currently in use.
65      */
66     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
getCurrentWebViewPackageName()67     String getCurrentWebViewPackageName();
68 
69     /**
70      * Used by public API for debugging purposes.
71      */
getCurrentWebViewPackage()72     PackageInfo getCurrentWebViewPackage();
73 
74     /**
75      * Used by Settings to determine whether multiprocess is enabled.
76      */
isMultiProcessEnabled()77     boolean isMultiProcessEnabled();
78 
79     /**
80      * Used by Settings to enable/disable multiprocess.
81      */
enableMultiProcess(boolean enable)82     void enableMultiProcess(boolean enable);
83 
84     /**
85      * Used by Settings to get the default WebView package.
86      */
getDefaultWebViewPackage()87     WebViewProviderInfo getDefaultWebViewPackage();
88 }
89