blob: 2d7a99872284161c15ad278ecf05b30e3fc4efc7 [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 Sennton065b7e62016-04-01 15:11:43 +010023import android.webkit.WebViewProviderInfo;
Gustav Sennton8b179262016-03-14 11:31:14 +000024
25/**
Gustav Sennton065b7e62016-04-01 15:11:43 +010026 * System interface for the WebViewUpdateService.
Gustav Sennton8b179262016-03-14 11:31:14 +000027 * 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 Sennton065b7e62016-04-01 15:11:43 +010030 *
Gustav Sennton8b179262016-03-14 11:31:14 +000031 * @hide
32 */
Gustav Sennton065b7e62016-04-01 15:11:43 +010033public interface SystemInterface {
Gustav Sennton8b179262016-03-14 11:31:14 +000034 public WebViewProviderInfo[] getWebViewPackages();
35 public int onWebViewProviderChanged(PackageInfo packageInfo);
Hui Shu9e8c0582016-03-24 17:02:58 -070036 public int getFactoryPackageVersion(String packageName) throws NameNotFoundException;
Gustav Sennton8b179262016-03-14 11:31:14 +000037
38 public String getUserChosenWebViewProvider(Context context);
39 public void updateUserSetting(Context context, String newProviderName);
40 public void killPackageDependents(String packageName);
Gustav Sennton065b7e62016-04-01 15:11:43 +010041
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 Sesekded20982016-08-15 13:59:13 -040052
Gustav Sennton86f7bbe2016-10-24 16:49:32 +010053 public void setMultiProcessEnabledFromContext(Context context);
54 public void registerContentObserver(Context context, ContentObserver contentObserver);
Gustav Sennton8b179262016-03-14 11:31:14 +000055}