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