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

Commit 5fd5d74f authored by Steve Block's avatar Steve Block
Browse files

No longer need to pass storage paths to WebRequestContext.cleanupPrivateBrowsingFiles()

Requires the following changes to external/webkit and packages/apps/Browser
https://android-git.corp.google.com/g/81781
https://android-git.corp.google.com/g/81780

Bug: 3232569
Change-Id: I0247f3db25edfdc95363a5a94296458b20456a46
parent b416a71e
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -1923,25 +1923,15 @@ public class WebView extends AbsoluteLayout
     * browsing session and clears any internal state associated with that
     * session. The consequences of calling this method while a private
     * browsing session is active are unspecified.
     * @param context The same context which was used to create the private
     *                browsing WebView.
     * @return True if the private browsing files were successfully deleted,
     *         false otherwise.
     * @hide pending API council approval.
     */
    public static boolean cleanupPrivateBrowsingFiles(Context context) {
        // It seems wrong that we have to pass the storage locations here, given
        // that the storage files are created native-side in WebRequestContext
        // (albeit using a dumb getter on BrowserFrame to get the paths from
        // Java). It looks like this is required because we may need to call
        // this method before the BrowserFrame has been set up.
        // TODO: Investigate whether this can be avoided.
        return nativeCleanupPrivateBrowsingFiles(context.getDatabasePath("dummy").getParent(),
                                                 context.getCacheDir().getAbsolutePath());
    public static boolean cleanupPrivateBrowsingFiles() {
        return nativeCleanupPrivateBrowsingFiles();
    }

    private static native boolean nativeCleanupPrivateBrowsingFiles(String databaseDirectory,
                                                                    String cacheDirectory);
    private static native boolean nativeCleanupPrivateBrowsingFiles();

    private boolean extendScroll(int y) {
        int finalY = mScroller.getFinalY();