diff options
author | Chirayu Desai <cdesai@cyanogenmod.org> | 2014-01-23 19:08:29 +0530 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-11-07 13:57:46 -0800 |
commit | 7462f4ee60fea3f68ec388b3a86de5a8e688b89a (patch) | |
tree | 331b7a1163f3f0df454dc950416c108f3e3720b7 /src/com/android | |
parent | 8d464436b97de1aace612fbcb4cb40af6f3eec83 (diff) | |
download | packages_apps_Browser-7462f4ee60fea3f68ec388b3a86de5a8e688b89a.zip packages_apps_Browser-7462f4ee60fea3f68ec388b3a86de5a8e688b89a.tar.gz packages_apps_Browser-7462f4ee60fea3f68ec388b3a86de5a8e688b89a.tar.bz2 |
Show a startup page in incognito mode
Change-Id: Ib1d4be6890c81b73a46f026b6fcbb2f1e8de567d
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/browser/homepages/HomeProvider.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/browser/homepages/HomeProvider.java b/src/com/android/browser/homepages/HomeProvider.java index 49ae694..dc55944 100644 --- a/src/com/android/browser/homepages/HomeProvider.java +++ b/src/com/android/browser/homepages/HomeProvider.java @@ -20,6 +20,8 @@ import android.content.ContentProvider; import android.content.ContentValues;
import android.content.Context;
import android.content.res.AssetFileDescriptor;
+import android.content.res.Resources;
+import android.content.res.Resources.NotFoundException;
import android.database.Cursor;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
@@ -106,6 +108,17 @@ public class HomeProvider extends ContentProvider { return new WebResourceResponse("text/html", "utf-8", ins);
}
} catch (Exception e) {}
+ if ("browser:incognito".equals(url)) {
+ try {
+ Resources res = context.getResources();
+ InputStream ins = res.openRawResource(
+ com.android.internal.R.raw.incognito_mode_start_page);
+ return new WebResourceResponse("text/html", "utf8", ins);
+ } catch (NotFoundException ex) {
+ // This shouldn't happen, but try and gracefully handle it jic
+ Log.w(TAG, "Failed opening raw.incognito_mode_start_page", ex);
+ }
+ }
return null;
}
|