I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 6c803935 authored by zzz's avatar zzz
Browse files

- Top-level uri fixup part 3: Set base uri when loading from cache

- More debugging in WVC
parent a88edb8e
No related branches found
No related tags found
Loading
......@@ -4,6 +4,7 @@ import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.AsyncTask;
import android.view.Gravity;
......@@ -149,6 +150,18 @@ class I2PWebViewClient extends WebViewClient {
super.onReceivedError(view, errorCode, description, failingUrl);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
Util.e("OPS URL: " + url);
super.onPageStarted(view, url, favicon);
}
@Override
public void onPageFinished(WebView view, String url) {
Util.e("OPF URL: " + url);
super.onPageFinished(view, url);
}
/******
API 11 :(
......
......@@ -115,14 +115,19 @@ public class AppCache {
/**
* Return a content:// uri for any cached content in question.
* The file may or may not exist, and it may be deleted at any time.
* Side effect: If exists, sets as current base
*
* @param key no fragment allowed
*/
public Uri getCacheUri(Uri key) {
int hash = toHash(key);
// poke the LRU
Object present = null;
synchronized(_cache) {
_cache.get(Integer.valueOf(hash));
present = _cache.get(Integer.valueOf(hash));
}
if (present != null)
setAsCurrentBase(key);
return CacheProvider.getContentUri(key);
}
......@@ -253,6 +258,17 @@ public class AppCache {
return null;
}
/**
* Set key as current base. May be content or i2p key.
*/
private static void setAsCurrentBase(Uri key) {
ContentValues cv = new ContentValues();
cv.put(CacheProvider.CURRENT_BASE, Boolean.TRUE);
Uri uri = CacheProvider.getContentUri(key);
if (uri != null)
_resolver.insert(uri, cv);
}
/** ok for now but we will need to store key in the map and delete by integer */
private static void deleteContent(Uri key) {
Uri uri = CacheProvider.getContentUri(key);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment