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

Commit 7c2d1353 authored by Elliott Slaughter's avatar Elliott Slaughter
Browse files

Cleanup temporary incognito mode files after last tab closes.

Change-Id: Iae5df353fdfd36c8eefa273a8812e80309e42841
parent c9ad7c6d
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -1812,6 +1812,23 @@ public class WebView extends AbsoluteLayout
        }
    }

    /**
     * Deletes any files that were created as a part of the last private
     * 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) {
        return nativeCleanupPrivateBrowsingFiles(context.getFilesDir().getParent());
    }

    private static native boolean nativeCleanupPrivateBrowsingFiles(String dataDirectory);

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