Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3dc86e6 authored by Jonathan Dixon's avatar Jonathan Dixon
Browse files

Hide the public constructors for singleton classes

WebStorage and GeolocationPermissions are not intended for direct use
by application code. Existing APKs using this will still work (as well
as they ever could have), but this change will cause a compile break if they
move to SDK >= 16, which should be fixed by using getInstance() instead.

Bug: 6238010
Change-Id: I75789cc260c8fe005c42942bc81483193cc54f17
parent 39edeeef
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -24839,7 +24839,6 @@ package android.webkit {
  }
  public final class GeolocationPermissions {
    ctor public GeolocationPermissions();
    method public void allow(java.lang.String);
    method public void clear(java.lang.String);
    method public void clearAll();
@@ -25129,7 +25128,6 @@ package android.webkit {
  }
  public final class WebStorage {
    ctor public WebStorage();
    method public void deleteAllData();
    method public void deleteOrigin(java.lang.String);
    method public static android.webkit.WebStorage getInstance();
+0 −2
Original line number Diff line number Diff line
@@ -25430,7 +25430,6 @@ package android.webkit {
  }
  public final class GeolocationPermissions {
    ctor public GeolocationPermissions();
    method public void allow(java.lang.String);
    method public void clear(java.lang.String);
    method public void clearAll();
@@ -25720,7 +25719,6 @@ package android.webkit {
  }
  public final class WebStorage {
    ctor public WebStorage();
    method public void deleteAllData();
    method public void deleteOrigin(java.lang.String);
    method public static android.webkit.WebStorage getInstance();
+10 −0
Original line number Diff line number Diff line
@@ -293,6 +293,16 @@ public final class GeolocationPermissions {
        postMessage(Message.obtain(null, CLEAR_ALL));
    }

    /**
     * This class should not be instantiated directly, applications must only use
     * {@link #getInstance()} to obtain the instance.
     * Note this constructor was erroneously public and published in SDK levels prior to 16, but
     * applications using it would receive a non-functional instance of this class (there was no
     * way to call createHandler() and createUIHandler(), so it would not work).
     * @hide
     */
    public GeolocationPermissions() {}

    // Native functions, run on the WebKit thread.
    private static native Set nativeGetOrigins();
    private static native boolean nativeGetAllowed(String origin);
+10 −0
Original line number Diff line number Diff line
@@ -418,6 +418,16 @@ public final class WebStorage {
        }
    }

    /**
     * This class should not be instantiated directly, applications must only use
     * {@link #getInstance()} to obtain the instance.
     * Note this constructor was erroneously public and published in SDK levels prior to 16, but
     * applications using it would receive a non-functional instance of this class (there was no
     * way to call createHandler() and createUIHandler(), so it would not work).
     * @hide
     */
    public WebStorage() {}

    // Native functions
    private static native Set nativeGetOrigins();
    private static native long nativeGetUsageForOrigin(String origin);