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 17package com.android.server.webkit; 18 19import android.content.Context; 20import android.content.pm.PackageInfo; 21import android.content.pm.PackageManager.NameNotFoundException; 22import android.webkit.WebViewProviderInfo; 23 24/** 25 * System interface for the WebViewUpdateService. 26 * 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. 29 * 30 * @hide 31 */ 32public interface SystemInterface { 33 public WebViewProviderInfo[] getWebViewPackages(); 34 public int onWebViewProviderChanged(PackageInfo packageInfo); 35 public int getFactoryPackageVersion(String packageName) throws NameNotFoundException; 36 37 public String getUserChosenWebViewProvider(Context context); 38 public void updateUserSetting(Context context, String newProviderName); 39 public void killPackageDependents(String packageName); 40 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; 51} 52