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 | 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 | |
| 25 | /** |
Gustav Sennton | 065b7e6 | 2016-04-01 15:11:43 +0100 | [diff] [blame] | 26 | * System interface for the WebViewUpdateService. |
Gustav Sennton | 8b17926 | 2016-03-14 11:31:14 +0000 | [diff] [blame] | 27 | * This interface provides a way to test the WebView preparation mechanism - during normal use this |
| 28 | * interface is implemented using calls to the Android framework, but by providing an alternative |
| 29 | * 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] | 30 | * |
Gustav Sennton | 8b17926 | 2016-03-14 11:31:14 +0000 | [diff] [blame] | 31 | * @hide |
| 32 | */ |
Gustav Sennton | 065b7e6 | 2016-04-01 15:11:43 +0100 | [diff] [blame] | 33 | public interface SystemInterface { |
Gustav Sennton | 8b17926 | 2016-03-14 11:31:14 +0000 | [diff] [blame] | 34 | public WebViewProviderInfo[] getWebViewPackages(); |
| 35 | public int onWebViewProviderChanged(PackageInfo packageInfo); |
Hui Shu | 9e8c058 | 2016-03-24 17:02:58 -0700 | [diff] [blame] | 36 | public int getFactoryPackageVersion(String packageName) throws NameNotFoundException; |
Gustav Sennton | 8b17926 | 2016-03-14 11:31:14 +0000 | [diff] [blame] | 37 | |
| 38 | public String getUserChosenWebViewProvider(Context context); |
| 39 | public void updateUserSetting(Context context, String newProviderName); |
| 40 | public void killPackageDependents(String packageName); |
Gustav Sennton | 065b7e6 | 2016-04-01 15:11:43 +0100 | [diff] [blame] | 41 | |
| 42 | public boolean isFallbackLogicEnabled(); |
| 43 | public void enableFallbackLogic(boolean enable); |
| 44 | |
| 45 | public void uninstallAndDisablePackageForAllUsers(Context context, String packageName); |
| 46 | public void enablePackageForAllUsers(Context context, String packageName, boolean enable); |
| 47 | public void enablePackageForUser(String packageName, boolean enable, int userId); |
| 48 | |
| 49 | public boolean systemIsDebuggable(); |
| 50 | public PackageInfo getPackageInfoForProvider(WebViewProviderInfo configInfo) |
| 51 | throws NameNotFoundException; |
Robert Sesek | ded2098 | 2016-08-15 13:59:13 -0400 | [diff] [blame] | 52 | |
Gustav Sennton | 86f7bbe | 2016-10-24 16:49:32 +0100 | [diff] [blame] | 53 | public void setMultiProcessEnabledFromContext(Context context); |
| 54 | public void registerContentObserver(Context context, ContentObserver contentObserver); |
Gustav Sennton | 8b17926 | 2016-03-14 11:31:14 +0000 | [diff] [blame] | 55 | } |