Gustav Sennton | 8b17926 | 2016-03-14 11:31:14 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 com.android.server.webkit; |
| 18 | |
Gustav Sennton | 8b17926 | 2016-03-14 11:31:14 +0000 | [diff] [blame] | 19 | import android.content.Context; |
| 20 | import android.content.pm.PackageInfo; |
Gustav Sennton | 065b7e6 | 2016-04-01 15:11:43 +0100 | [diff] [blame] | 21 | import android.content.pm.PackageManager.NameNotFoundException; |
Gustav Sennton | 364e160 | 2016-12-14 09:10:50 +0000 | [diff] [blame] | 22 | import android.webkit.UserPackage; |
Gustav Sennton | 065b7e6 | 2016-04-01 15:11:43 +0100 | [diff] [blame] | 23 | import android.webkit.WebViewProviderInfo; |
Gustav Sennton | 8b17926 | 2016-03-14 11:31:14 +0000 | [diff] [blame] | 24 | |
Gustav Sennton | 364e160 | 2016-12-14 09:10:50 +0000 | [diff] [blame] | 25 | import java.util.List; |
| 26 | |
Gustav Sennton | 8b17926 | 2016-03-14 11:31:14 +0000 | [diff] [blame] | 27 | /** |
Gustav Sennton | 065b7e6 | 2016-04-01 15:11:43 +0100 | [diff] [blame] | 28 | * System interface for the WebViewUpdateService. |
Gustav Sennton | 8b17926 | 2016-03-14 11:31:14 +0000 | [diff] [blame] | 29 | * This interface provides a way to test the WebView preparation mechanism - during normal use this |
| 30 | * interface is implemented using calls to the Android framework, but by providing an alternative |
| 31 | * implementation we can test the WebView preparation logic without reaching other framework code. |
Gustav Sennton | 065b7e6 | 2016-04-01 15:11:43 +0100 | [diff] [blame] | 32 | * |
Gustav Sennton | 8b17926 | 2016-03-14 11:31:14 +0000 | [diff] [blame] | 33 | * @hide |
| 34 | */ |
Gustav Sennton | 065b7e6 | 2016-04-01 15:11:43 +0100 | [diff] [blame] | 35 | public interface SystemInterface { |
Gustav Sennton | 8b17926 | 2016-03-14 11:31:14 +0000 | [diff] [blame] | 36 | public WebViewProviderInfo[] getWebViewPackages(); |
| 37 | public int onWebViewProviderChanged(PackageInfo packageInfo); |
Dianne Hackborn | 3accca0 | 2013-09-20 09:32:11 -0700 | [diff] [blame] | 38 | public long getFactoryPackageVersion(String packageName) throws NameNotFoundException; |
Gustav Sennton | 8b17926 | 2016-03-14 11:31:14 +0000 | [diff] [blame] | 39 | |
| 40 | public String getUserChosenWebViewProvider(Context context); |
| 41 | public void updateUserSetting(Context context, String newProviderName); |
| 42 | public void killPackageDependents(String packageName); |
Gustav Sennton | 065b7e6 | 2016-04-01 15:11:43 +0100 | [diff] [blame] | 43 | |
| 44 | public boolean isFallbackLogicEnabled(); |
| 45 | public void enableFallbackLogic(boolean enable); |
| 46 | |
Gustav Sennton | 065b7e6 | 2016-04-01 15:11:43 +0100 | [diff] [blame] | 47 | public void enablePackageForAllUsers(Context context, String packageName, boolean enable); |
Gustav Sennton | 065b7e6 | 2016-04-01 15:11:43 +0100 | [diff] [blame] | 48 | |
| 49 | public boolean systemIsDebuggable(); |
| 50 | public PackageInfo getPackageInfoForProvider(WebViewProviderInfo configInfo) |
| 51 | throws NameNotFoundException; |
Gustav Sennton | 364e160 | 2016-12-14 09:10:50 +0000 | [diff] [blame] | 52 | /** |
| 53 | * Get the PackageInfos of all users for the package represented by {@param configInfo}. |
| 54 | * @return an array of UserPackages for a certain package, each UserPackage being belonging to a |
| 55 | * certain user. The returned array can contain null PackageInfos if the given package |
| 56 | * is uninstalled for some user. |
| 57 | */ |
| 58 | public List<UserPackage> getPackageInfoForProviderAllUsers(Context context, |
| 59 | WebViewProviderInfo configInfo); |
Robert Sesek | ded2098 | 2016-08-15 13:59:13 -0400 | [diff] [blame] | 60 | |
Torne (Richard Coles) | 1a4c4e3 | 2017-01-10 15:57:41 +0000 | [diff] [blame] | 61 | public int getMultiProcessSetting(Context context); |
| 62 | public void setMultiProcessSetting(Context context, int value); |
| 63 | public void notifyZygote(boolean enableMultiProcess); |
Torne (Richard Coles) | 05a766e | 2019-04-10 17:55:53 -0400 | [diff] [blame] | 64 | /** Start the zygote if it's not already running. */ |
| 65 | public void ensureZygoteStarted(); |
Torne (Richard Coles) | dc37507 | 2017-01-11 15:48:13 +0000 | [diff] [blame] | 66 | public boolean isMultiProcessDefaultEnabled(); |
Gustav Sennton | 8b17926 | 2016-03-14 11:31:14 +0000 | [diff] [blame] | 67 | } |