Skip to content

Commit bd0fe87

Browse files
kristianmonsenAndroid (Google) Code Review
authored andcommitted
Merge "Deprecating methods (and a constant) for JB MR1" into jb-mr1-dev
2 parents 568e3eb + 5cc2351 commit bd0fe87

File tree

3 files changed

+49
-9
lines changed

3 files changed

+49
-9
lines changed

api/current.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27067,7 +27067,7 @@ package android.webkit {
2706727067
}
2706827068

2706927069
public abstract class WebSettings {
27070-
method public boolean enableSmoothTransition();
27070+
method public deprecated boolean enableSmoothTransition();
2707127071
method public boolean getAllowContentAccess();
2707227072
method public boolean getAllowFileAccess();
2707327073
method public abstract boolean getAllowFileAccessFromFileURLs();
@@ -27133,7 +27133,7 @@ package android.webkit {
2713327133
method public void setDefaultZoom(android.webkit.WebSettings.ZoomDensity);
2713427134
method public void setDisplayZoomControls(boolean);
2713527135
method public synchronized void setDomStorageEnabled(boolean);
27136-
method public void setEnableSmoothTransition(boolean);
27136+
method public deprecated void setEnableSmoothTransition(boolean);
2713727137
method public synchronized void setFantasyFontFamily(java.lang.String);
2713827138
method public synchronized void setFixedFontFamily(java.lang.String);
2713927139
method public synchronized void setGeolocationDatabasePath(java.lang.String);
@@ -27172,7 +27172,7 @@ package android.webkit {
2717227172
field public static final int LOAD_CACHE_ELSE_NETWORK = 1; // 0x1
2717327173
field public static final int LOAD_CACHE_ONLY = 3; // 0x3
2717427174
field public static final int LOAD_DEFAULT = -1; // 0xffffffff
27175-
field public static final int LOAD_NORMAL = 0; // 0x0
27175+
field public static final deprecated int LOAD_NORMAL = 0; // 0x0
2717627176
field public static final int LOAD_NO_CACHE = 2; // 0x2
2717727177
}
2717827178

@@ -27255,13 +27255,13 @@ package android.webkit {
2725527255
ctor public WebView(android.content.Context);
2725627256
ctor public WebView(android.content.Context, android.util.AttributeSet);
2725727257
ctor public WebView(android.content.Context, android.util.AttributeSet, int);
27258-
ctor public WebView(android.content.Context, android.util.AttributeSet, int, boolean);
27258+
ctor public deprecated WebView(android.content.Context, android.util.AttributeSet, int, boolean);
2725927259
method public void addJavascriptInterface(java.lang.Object, java.lang.String);
2726027260
method public boolean canGoBack();
2726127261
method public boolean canGoBackOrForward(int);
2726227262
method public boolean canGoForward();
27263-
method public boolean canZoomIn();
27264-
method public boolean canZoomOut();
27263+
method public deprecated boolean canZoomIn();
27264+
method public deprecated boolean canZoomOut();
2726527265
method public android.graphics.Picture capturePicture();
2726627266
method public void clearCache(boolean);
2726727267
method public void clearFormData();
@@ -27289,7 +27289,7 @@ package android.webkit {
2728927289
method public java.lang.String[] getHttpAuthUsernamePassword(java.lang.String, java.lang.String);
2729027290
method public java.lang.String getOriginalUrl();
2729127291
method public int getProgress();
27292-
method public float getScale();
27292+
method public deprecated float getScale();
2729327293
method public android.webkit.WebSettings getSettings();
2729427294
method public java.lang.String getTitle();
2729527295
method public java.lang.String getUrl();
@@ -27326,13 +27326,13 @@ package android.webkit {
2732627326
method public android.webkit.WebBackForwardList saveState(android.os.Bundle);
2732727327
method public void saveWebArchive(java.lang.String);
2732827328
method public void saveWebArchive(java.lang.String, boolean, android.webkit.ValueCallback<java.lang.String>);
27329-
method public void setCertificate(android.net.http.SslCertificate);
27329+
method public deprecated void setCertificate(android.net.http.SslCertificate);
2733027330
method public void setDownloadListener(android.webkit.DownloadListener);
2733127331
method public void setFindListener(android.webkit.WebView.FindListener);
2733227332
method public void setHorizontalScrollbarOverlay(boolean);
2733327333
method public void setHttpAuthUsernamePassword(java.lang.String, java.lang.String, java.lang.String, java.lang.String);
2733427334
method public void setInitialScale(int);
27335-
method public void setMapTrackballToArrowKeys(boolean);
27335+
method public deprecated void setMapTrackballToArrowKeys(boolean);
2733627336
method public void setNetworkAvailable(boolean);
2733727337
method public deprecated void setPictureListener(android.webkit.WebView.PictureListener);
2733827338
method public void setVerticalScrollbarOverlay(boolean);

core/java/android/webkit/WebSettings.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,12 @@ public enum ZoomDensity {
102102

103103
/**
104104
* Normal cache usage mode. Use with {@link #setCacheMode}.
105+
*
106+
* @deprecated This value is obsolete, as from API level
107+
* {@link android.os.Build.VERSION_CODES#HONEYCOMB} and onwards it has the
108+
* same effect as {@link #LOAD_DEFAULT}.
105109
*/
110+
@Deprecated
106111
public static final int LOAD_NORMAL = 0;
107112

108113
/**
@@ -333,7 +338,10 @@ public boolean getLoadWithOverviewMode() {
333338
* If it is true, WebView will choose a solution to maximize the performance.
334339
* e.g. the WebView's content may not be updated during the transition.
335340
* If it is false, WebView will keep its fidelity. The default value is false.
341+
*
342+
* @deprecated This method is now obsolete, and will become a no-op in future.
336343
*/
344+
@Deprecated
337345
public void setEnableSmoothTransition(boolean enable) {
338346
throw new MustOverrideException();
339347
}
@@ -343,7 +351,10 @@ public void setEnableSmoothTransition(boolean enable) {
343351
* zooming.
344352
*
345353
* @see #setEnableSmoothTransition
354+
*
355+
* @deprecated This method is now obsolete, and will become a no-op in future.
346356
*/
357+
@Deprecated
347358
public boolean enableSmoothTransition() {
348359
throw new MustOverrideException();
349360
}

core/java/android/webkit/WebView.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,13 @@ public WebView(Context context, AttributeSet attrs, int defStyle) {
470470
* @param defStyle the default style resource ID
471471
* @param privateBrowsing whether this WebView will be initialized in
472472
* private mode
473+
*
474+
* @deprecated Private browsing is no longer supported directly via
475+
* WebView and will be removed in a future release. Prefer using
476+
* {@link WebSettings}, {@link WebViewDatabase}, {@link CookieManager}
477+
* and {@link WebStorage} for fine-grained control of privacy data.
473478
*/
479+
@Deprecated
474480
public WebView(Context context, AttributeSet attrs, int defStyle,
475481
boolean privateBrowsing) {
476482
this(context, attrs, defStyle, null, privateBrowsing);
@@ -569,7 +575,11 @@ public SslCertificate getCertificate() {
569575

570576
/**
571577
* Sets the SSL certificate for the main top-level page.
578+
*
579+
* @deprecated Calling this function has no useful effect, and will be
580+
* ignored in future releases.
572581
*/
582+
@Deprecated
573583
public void setCertificate(SslCertificate certificate) {
574584
checkThread();
575585
mProvider.setCertificate(certificate);
@@ -1018,7 +1028,12 @@ public Picture capturePicture() {
10181028
* Gets the current scale of this WebView.
10191029
*
10201030
* @return the current scale
1031+
*
1032+
* @deprecated This method is prone to inaccuracy due to race conditions
1033+
* between the web rendering and UI threads; prefer
1034+
* {@link WebViewClient#onScaleChanged}.
10211035
*/
1036+
@Deprecated
10221037
@ViewDebug.ExportedProperty(category = "webview")
10231038
public float getScale() {
10241039
checkThread();
@@ -1598,6 +1613,10 @@ public void onChildViewRemoved(View p, View child) {}
15981613
public void onGlobalFocusChanged(View oldFocus, View newFocus) {
15991614
}
16001615

1616+
/**
1617+
* @deprecated Only the default case, true, will be supported in a future version.
1618+
*/
1619+
@Deprecated
16011620
public void setMapTrackballToArrowKeys(boolean setMap) {
16021621
checkThread();
16031622
mProvider.setMapTrackballToArrowKeys(setMap);
@@ -1631,7 +1650,12 @@ public View getZoomControls() {
16311650
* Gets whether this WebView can be zoomed in.
16321651
*
16331652
* @return true if this WebView can be zoomed in
1653+
*
1654+
* @deprecated This method is prone to inaccuracy due to race conditions
1655+
* between the web rendering and UI threads; prefer
1656+
* {@link WebViewClient#onScaleChanged}.
16341657
*/
1658+
@Deprecated
16351659
public boolean canZoomIn() {
16361660
checkThread();
16371661
return mProvider.canZoomIn();
@@ -1641,7 +1665,12 @@ public boolean canZoomIn() {
16411665
* Gets whether this WebView can be zoomed out.
16421666
*
16431667
* @return true if this WebView can be zoomed out
1668+
*
1669+
* @deprecated This method is prone to inaccuracy due to race conditions
1670+
* between the web rendering and UI threads; prefer
1671+
* {@link WebViewClient#onScaleChanged}.
16441672
*/
1673+
@Deprecated
16451674
public boolean canZoomOut() {
16461675
checkThread();
16471676
return mProvider.canZoomOut();

0 commit comments

Comments
 (0)