blob: 405fe7d41e617314a0918e5cf2393e2c476568f2 [file] [log] [blame]
Gustav Sennton8b179262016-03-14 11:31:14 +00001/*
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
17package com.android.server.webkit;
18
Gustav Sennton8b179262016-03-14 11:31:14 +000019import android.content.Context;
20import android.content.pm.PackageInfo;
Gustav Sennton065b7e62016-04-01 15:11:43 +010021import android.content.pm.PackageManager.NameNotFoundException;
Gustav Sennton86f7bbe2016-10-24 16:49:32 +010022import android.database.ContentObserver;
Gustav Sennton364e1602016-12-14 09:10:50 +000023import android.webkit.UserPackage;
Gustav Sennton065b7e62016-04-01 15:11:43 +010024import android.webkit.WebViewProviderInfo;
Gustav Sennton8b179262016-03-14 11:31:14 +000025
Gustav Sennton364e1602016-12-14 09:10:50 +000026import java.util.List;
27
Gustav Sennton8b179262016-03-14 11:31:14 +000028/**
Gustav Sennton065b7e62016-04-01 15:11:43 +010029 * System interface for the WebViewUpdateService.
Gustav Sennton8b179262016-03-14 11:31:14 +000030 * 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 Sennton065b7e62016-04-01 15:11:43 +010033 *
Gustav Sennton8b179262016-03-14 11:31:14 +000034 * @hide
35 */
Gustav Sennton065b7e62016-04-01 15:11:43 +010036public interface SystemInterface {
Gustav Sennton8b179262016-03-14 11:31:14 +000037 public WebViewProviderInfo[] getWebViewPackages();
38 public int onWebViewProviderChanged(PackageInfo packageInfo);
Dianne Hackborn3accca02013-09-20 09:32:11 -070039 public long getFactoryPackageVersion(String packageName) throws NameNotFoundException;
Gustav Sennton8b179262016-03-14 11:31:14 +000040
41 public String getUserChosenWebViewProvider(Context context);
42 public void updateUserSetting(Context context, String newProviderName);
43 public void killPackageDependents(String packageName);
Gustav Sennton065b7e62016-04-01 15:11:43 +010044
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 Sennton364e1602016-12-14 09:10:50 +000055 /**
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 Sesekded20982016-08-15 13:59:13 -040063
Torne (Richard Coles)1a4c4e32017-01-10 15:57:41 +000064 public int getMultiProcessSetting(Context context);
65 public void setMultiProcessSetting(Context context, int value);
66 public void notifyZygote(boolean enableMultiProcess);
Torne (Richard Coles)dc375072017-01-11 15:48:13 +000067 public boolean isMultiProcessDefaultEnabled();
Gustav Sennton8b179262016-03-14 11:31:14 +000068}