Search in sources :

Example 66 with WebViewProviderInfo

use of android.webkit.WebViewProviderInfo in project android_frameworks_base by crdroidandroid.

the class WebViewUpdateServiceTest method testWithSinglePackage.

// ****************
// Tests
// ****************
public void testWithSinglePackage() {
    String testPackageName = "test.package.name";
    checkCertainPackageUsedAfterWebViewBootPreparation(testPackageName, new WebViewProviderInfo[] { new WebViewProviderInfo(testPackageName, "", true, /*default available*/
    false, /* fallback */
    null) });
}
Also used : WebViewProviderInfo(android.webkit.WebViewProviderInfo)

Example 67 with WebViewProviderInfo

use of android.webkit.WebViewProviderInfo in project android_frameworks_base by crdroidandroid.

the class WebViewUpdateServiceTest method testSeveralRelros.

public void testSeveralRelros() {
    String singlePackage = "singlePackage";
    checkCertainPackageUsedAfterWebViewBootPreparation(singlePackage, new WebViewProviderInfo[] { new WebViewProviderInfo(singlePackage, "", true, /*def av*/
    false, null) }, 2);
}
Also used : WebViewProviderInfo(android.webkit.WebViewProviderInfo)

Example 68 with WebViewProviderInfo

use of android.webkit.WebViewProviderInfo in project platform_packages_apps_Settings by BlissRoms.

the class WebViewUpdateServiceWrapper method getValidWebViewApplicationInfos.

/**
 * Fetches ApplicationInfo objects for all currently valid WebView packages.
 * A WebView package is considered valid if it can be used as a WebView implementation. The
 * validity of a package is not dependent on whether the package is installed/enabled.
 */
public List<ApplicationInfo> getValidWebViewApplicationInfos(Context context) {
    WebViewProviderInfo[] providers = null;
    try {
        providers = WebViewFactory.getUpdateService().getValidWebViewPackages();
    } catch (RemoteException e) {
    }
    List<ApplicationInfo> pkgs = new ArrayList<>();
    for (WebViewProviderInfo provider : providers) {
        try {
            pkgs.add(context.getPackageManager().getApplicationInfo(provider.packageName, PACKAGE_FLAGS));
        } catch (PackageManager.NameNotFoundException e) {
        }
    }
    return pkgs;
}
Also used : PackageManager(android.content.pm.PackageManager) WebViewProviderInfo(android.webkit.WebViewProviderInfo) ApplicationInfo(android.content.pm.ApplicationInfo) ArrayList(java.util.ArrayList) RemoteException(android.os.RemoteException)

Aggregations

WebViewProviderInfo (android.webkit.WebViewProviderInfo)68 WebViewProviderResponse (android.webkit.WebViewProviderResponse)28 RemoteException (android.os.RemoteException)8 MediumTest (android.test.suitebuilder.annotation.MediumTest)8 ArrayList (java.util.ArrayList)8 Test (org.junit.Test)8 ApplicationInfo (android.content.pm.ApplicationInfo)7 PackageManager (android.content.pm.PackageManager)7 BroadcastReceiver (android.content.BroadcastReceiver)4 Context (android.content.Context)4 Intent (android.content.Intent)4 IntentFilter (android.content.IntentFilter)4 NameNotFoundException (android.content.pm.PackageManager.NameNotFoundException)4 Signature (android.content.pm.Signature)4 CountDownLatch (java.util.concurrent.CountDownLatch)4 DialogInterface (android.content.DialogInterface)1 OnClickListener (android.content.DialogInterface.OnClickListener)1