| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package com.android.webview.chromium; | 5 package com.android.webview.chromium; |
| 6 | 6 |
| 7 import android.Manifest; | 7 import android.Manifest; |
| 8 import android.app.ActivityManager; | 8 import android.app.ActivityManager; |
| 9 import android.content.ComponentCallbacks2; | 9 import android.content.ComponentCallbacks2; |
| 10 import android.content.Context; | 10 import android.content.Context; |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 if (lastVersion != currentVersion) { | 270 if (lastVersion != currentVersion) { |
| 271 mWebViewPrefs.edit().putInt(VERSION_CODE_PREF, currentVersion).apply
(); | 271 mWebViewPrefs.edit().putInt(VERSION_CODE_PREF, currentVersion).apply
(); |
| 272 } | 272 } |
| 273 | 273 |
| 274 mShouldDisableThreadChecking = | 274 mShouldDisableThreadChecking = |
| 275 shouldDisableThreadChecking(ContextUtils.getApplicationContext()
); | 275 shouldDisableThreadChecking(ContextUtils.getApplicationContext()
); |
| 276 // Now safe to use WebView data directory. | 276 // Now safe to use WebView data directory. |
| 277 } | 277 } |
| 278 | 278 |
| 279 static void checkStorageIsNotDeviceProtected(Context context) { | 279 static void checkStorageIsNotDeviceProtected(Context context) { |
| 280 if ((Build.VERSION.CODENAME.equals("N") || Build.VERSION.SDK_INT > Build
.VERSION_CODES.M) | 280 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && context.isDevicePr
otectedStorage()) { |
| 281 && context.isDeviceProtectedStorage()) { | |
| 282 throw new IllegalArgumentException( | 281 throw new IllegalArgumentException( |
| 283 "WebView cannot be used with device protected storage"); | 282 "WebView cannot be used with device protected storage"); |
| 284 } | 283 } |
| 285 } | 284 } |
| 286 | 285 |
| 287 /** | 286 /** |
| 288 * Both versionCodes should be from a WebView provider package implemented b
y Chromium. | 287 * Both versionCodes should be from a WebView provider package implemented b
y Chromium. |
| 289 * VersionCodes from other kinds of packages won't make any sense in this me
thod. | 288 * VersionCodes from other kinds of packages won't make any sense in this me
thod. |
| 290 * | 289 * |
| 291 * An introduction to Chromium versionCode scheme: | 290 * An introduction to Chromium versionCode scheme: |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 WebViewDelegate getWebViewDelegate() { | 696 WebViewDelegate getWebViewDelegate() { |
| 698 return mWebViewDelegate; | 697 return mWebViewDelegate; |
| 699 } | 698 } |
| 700 | 699 |
| 701 // The method to support unreleased Android. | 700 // The method to support unreleased Android. |
| 702 WebViewContentsClientAdapter createWebViewContentsClientAdapter(WebView webV
iew, | 701 WebViewContentsClientAdapter createWebViewContentsClientAdapter(WebView webV
iew, |
| 703 Context context) { | 702 Context context) { |
| 704 return new WebViewContentsClientAdapter(webView, context, mWebViewDelega
te); | 703 return new WebViewContentsClientAdapter(webView, context, mWebViewDelega
te); |
| 705 } | 704 } |
| 706 } | 705 } |
| OLD | NEW |