Skip to content

Commit 5cc2351

Browse files
Deprecating methods (and a constant) for JB MR1
Change-Id: I3eb0eaff5ea5d8984ad143f801efa19e25bd0685
1 parent fb3ec44 commit 5cc2351

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
@@ -26996,7 +26996,7 @@ package android.webkit {
2699626996
}
2699726997

2699826998
public abstract class WebSettings {
26999-
method public boolean enableSmoothTransition();
26999+
method public deprecated boolean enableSmoothTransition();
2700027000
method public boolean getAllowContentAccess();
2700127001
method public boolean getAllowFileAccess();
2700227002
method public abstract boolean getAllowFileAccessFromFileURLs();
@@ -27062,7 +27062,7 @@ package android.webkit {
2706227062
method public void setDefaultZoom(android.webkit.WebSettings.ZoomDensity);
2706327063
method public void setDisplayZoomControls(boolean);
2706427064
method public synchronized void setDomStorageEnabled(boolean);
27065-
method public void setEnableSmoothTransition(boolean);
27065+
method public deprecated void setEnableSmoothTransition(boolean);
2706627066
method public synchronized void setFantasyFontFamily(java.lang.String);
2706727067
method public synchronized void setFixedFontFamily(java.lang.String);
2706827068
method public synchronized void setGeolocationDatabasePath(java.lang.String);
@@ -27101,7 +27101,7 @@ package android.webkit {
2710127101
field public static final int LOAD_CACHE_ELSE_NETWORK = 1; // 0x1
2710227102
field public static final int LOAD_CACHE_ONLY = 3; // 0x3
2710327103
field public static final int LOAD_DEFAULT = -1; // 0xffffffff
27104-
field public static final int LOAD_NORMAL = 0; // 0x0
27104+
field public static final deprecated int LOAD_NORMAL = 0; // 0x0
2710527105
field public static final int LOAD_NO_CACHE = 2; // 0x2
2710627106
}
2710727107

@@ -27184,13 +27184,13 @@ package android.webkit {
2718427184
ctor public WebView(android.content.Context);
2718527185
ctor public WebView(android.content.Context, android.util.AttributeSet);
2718627186
ctor public WebView(android.content.Context, android.util.AttributeSet, int);
27187-
ctor public WebView(android.content.Context, android.util.AttributeSet, int, boolean);
27187+
ctor public deprecated WebView(android.content.Context, android.util.AttributeSet, int, boolean);
2718827188
method public void addJavascriptInterface(java.lang.Object, java.lang.String);
2718927189
method public boolean canGoBack();
2719027190
method public boolean canGoBackOrForward(int);
2719127191
method public boolean canGoForward();
27192-
method public boolean canZoomIn();
27193-
method public boolean canZoomOut();
27192+
method public deprecated boolean canZoomIn();
27193+
method public deprecated boolean canZoomOut();
2719427194
method public android.graphics.Picture capturePicture();
2719527195
method public void clearCache(boolean);
2719627196
method public void clearFormData();
@@ -27218,7 +27218,7 @@ package android.webkit {
2721827218
method public java.lang.String[] getHttpAuthUsernamePassword(java.lang.String, java.lang.String);
2721927219
method public java.lang.String getOriginalUrl();
2722027220
method public int getProgress();
27221-
method public float getScale();
27221+
method public deprecated float getScale();
2722227222
method public android.webkit.WebSettings getSettings();
2722327223
method public java.lang.String getTitle();
2722427224
method public java.lang.String getUrl();
@@ -27255,13 +27255,13 @@ package android.webkit {
2725527255
method public android.webkit.WebBackForwardList saveState(android.os.Bundle);
2725627256
method public void saveWebArchive(java.lang.String);
2725727257
method public void saveWebArchive(java.lang.String, boolean, android.webkit.ValueCallback<java.lang.String>);
27258-
method public void setCertificate(android.net.http.SslCertificate);
27258+
method public deprecated void setCertificate(android.net.http.SslCertificate);
2725927259
method public void setDownloadListener(android.webkit.DownloadListener);
2726027260
method public void setFindListener(android.webkit.WebView.FindListener);
2726127261
method public void setHorizontalScrollbarOverlay(boolean);
2726227262
method public void setHttpAuthUsernamePassword(java.lang.String, java.lang.String, java.lang.String, java.lang.String);
2726327263
method public void setInitialScale(int);
27264-
method public void setMapTrackballToArrowKeys(boolean);
27264+
method public deprecated void setMapTrackballToArrowKeys(boolean);
2726527265
method public void setNetworkAvailable(boolean);
2726627266
method public deprecated void setPictureListener(android.webkit.WebView.PictureListener);
2726727267
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
@@ -469,7 +469,13 @@ public WebView(Context context, AttributeSet attrs, int defStyle) {
469469
* @param defStyle the default style resource ID
470470
* @param privateBrowsing whether this WebView will be initialized in
471471
* private mode
472+
*
473+
* @deprecated Private browsing is no longer supported directly via
474+
* WebView and will be removed in a future release. Prefer using
475+
* {@link WebSettings}, {@link WebViewDatabase}, {@link CookieManager}
476+
* and {@link WebStorage} for fine-grained control of privacy data.
472477
*/
478+
@Deprecated
473479
public WebView(Context context, AttributeSet attrs, int defStyle,
474480
boolean privateBrowsing) {
475481
this(context, attrs, defStyle, null, privateBrowsing);
@@ -568,7 +574,11 @@ public SslCertificate getCertificate() {
568574

569575
/**
570576
* Sets the SSL certificate for the main top-level page.
577+
*
578+
* @deprecated Calling this function has no useful effect, and will be
579+
* ignored in future releases.
571580
*/
581+
@Deprecated
572582
public void setCertificate(SslCertificate certificate) {
573583
checkThread();
574584
mProvider.setCertificate(certificate);
@@ -1017,7 +1027,12 @@ public Picture capturePicture() {
10171027
* Gets the current scale of this WebView.
10181028
*
10191029
* @return the current scale
1030+
*
1031+
* @deprecated This method is prone to inaccuracy due to race conditions
1032+
* between the web rendering and UI threads; prefer
1033+
* {@link WebViewClient#onScaleChanged}.
10201034
*/
1035+
@Deprecated
10211036
@ViewDebug.ExportedProperty(category = "webview")
10221037
public float getScale() {
10231038
checkThread();
@@ -1594,6 +1609,10 @@ public void onChildViewRemoved(View p, View child) {}
15941609
public void onGlobalFocusChanged(View oldFocus, View newFocus) {
15951610
}
15961611

1612+
/**
1613+
* @deprecated Only the default case, true, will be supported in a future version.
1614+
*/
1615+
@Deprecated
15971616
public void setMapTrackballToArrowKeys(boolean setMap) {
15981617
checkThread();
15991618
mProvider.setMapTrackballToArrowKeys(setMap);
@@ -1627,7 +1646,12 @@ public View getZoomControls() {
16271646
* Gets whether this WebView can be zoomed in.
16281647
*
16291648
* @return true if this WebView can be zoomed in
1649+
*
1650+
* @deprecated This method is prone to inaccuracy due to race conditions
1651+
* between the web rendering and UI threads; prefer
1652+
* {@link WebViewClient#onScaleChanged}.
16301653
*/
1654+
@Deprecated
16311655
public boolean canZoomIn() {
16321656
checkThread();
16331657
return mProvider.canZoomIn();
@@ -1637,7 +1661,12 @@ public boolean canZoomIn() {
16371661
* Gets whether this WebView can be zoomed out.
16381662
*
16391663
* @return true if this WebView can be zoomed out
1664+
*
1665+
* @deprecated This method is prone to inaccuracy due to race conditions
1666+
* between the web rendering and UI threads; prefer
1667+
* {@link WebViewClient#onScaleChanged}.
16401668
*/
1669+
@Deprecated
16411670
public boolean canZoomOut() {
16421671
checkThread();
16431672
return mProvider.canZoomOut();

0 commit comments

Comments
 (0)