blob: 7bde37a5a4fddece832e5f6ed35bac11aa77c227 [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;
22import android.webkit.WebViewProviderInfo;
Gustav Sennton8b179262016-03-14 11:31:14 +000023
24/**
Gustav Sennton065b7e62016-04-01 15:11:43 +010025 * System interface for the WebViewUpdateService.
Gustav Sennton8b179262016-03-14 11:31:14 +000026 * This interface provides a way to test the WebView preparation mechanism - during normal use this
27 * interface is implemented using calls to the Android framework, but by providing an alternative
28 * implementation we can test the WebView preparation logic without reaching other framework code.
Gustav Sennton065b7e62016-04-01 15:11:43 +010029 *
Gustav Sennton8b179262016-03-14 11:31:14 +000030 * @hide
31 */
Gustav Sennton065b7e62016-04-01 15:11:43 +010032public interface SystemInterface {
Gustav Sennton8b179262016-03-14 11:31:14 +000033 public WebViewProviderInfo[] getWebViewPackages();
34 public int onWebViewProviderChanged(PackageInfo packageInfo);
Hui Shu9e8c0582016-03-24 17:02:58 -070035 public int getFactoryPackageVersion(String packageName) throws NameNotFoundException;
Gustav Sennton8b179262016-03-14 11:31:14 +000036
37 public String getUserChosenWebViewProvider(Context context);
38 public void updateUserSetting(Context context, String newProviderName);
39 public void killPackageDependents(String packageName);
Gustav Sennton065b7e62016-04-01 15:11:43 +010040
41 public boolean isFallbackLogicEnabled();
42 public void enableFallbackLogic(boolean enable);
43
44 public void uninstallAndDisablePackageForAllUsers(Context context, String packageName);
45 public void enablePackageForAllUsers(Context context, String packageName, boolean enable);
46 public void enablePackageForUser(String packageName, boolean enable, int userId);
47
48 public boolean systemIsDebuggable();
49 public PackageInfo getPackageInfoForProvider(WebViewProviderInfo configInfo)
50 throws NameNotFoundException;
Gustav Sennton8b179262016-03-14 11:31:14 +000051}