Browser.java revision 08c7116ab9cd04ad6dd3c04aa1017237e7f409ac
1/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.provider;
18
19import android.content.ContentResolver;
20import android.content.ContentUris;
21import android.content.ContentValues;
22import android.content.Context;
23import android.content.Intent;
24import android.database.Cursor;
25import android.database.DatabaseUtils;
26import android.graphics.BitmapFactory;
27import android.net.Uri;
28import android.provider.BrowserContract.Bookmarks;
29import android.provider.BrowserContract.Combined;
30import android.provider.BrowserContract.History;
31import android.provider.BrowserContract.Searches;
32import android.util.Log;
33import android.webkit.WebIconDatabase;
34
35public class Browser {
36    private static final String LOGTAG = "browser";
37
38    /**
39     * A table containing both bookmarks and history items. The columns of the table are defined in
40     * {@link BookmarkColumns}. Reading this table requires the
41     * {@link android.Manifest.permission#READ_HISTORY_BOOKMARKS} permission and writing to it
42     * requires the {@link android.Manifest.permission#WRITE_HISTORY_BOOKMARKS} permission.
43     */
44    public static final Uri BOOKMARKS_URI = Uri.parse("content://browser/bookmarks");
45
46    /**
47     * The name of extra data when starting Browser with ACTION_VIEW or
48     * ACTION_SEARCH intent.
49     * <p>
50     * The value should be an integer between 0 and 1000. If not set or set to
51     * 0, the Browser will use default. If set to 100, the Browser will start
52     * with 100%.
53     */
54    public static final String INITIAL_ZOOM_LEVEL = "browser.initialZoomLevel";
55
56    /**
57     * The name of the extra data when starting the Browser from another
58     * application.
59     * <p>
60     * The value is a unique identification string that will be used to
61     * identify the calling application. The Browser will attempt to reuse the
62     * same window each time the application launches the Browser with the same
63     * identifier.
64     */
65    public static final String EXTRA_APPLICATION_ID = "com.android.browser.application_id";
66
67    /**
68     * The name of the extra data in the VIEW intent. The data are key/value
69     * pairs in the format of Bundle. They will be sent in the HTTP request
70     * headers for the provided url. The keys can't be the standard HTTP headers
71     * as they are set by the WebView. The url's schema must be http(s).
72     * <p>
73     */
74    public static final String EXTRA_HEADERS = "com.android.browser.headers";
75
76    /* if you change column order you must also change indices
77       below */
78    public static final String[] HISTORY_PROJECTION = new String[] {
79            BookmarkColumns._ID, // 0
80            BookmarkColumns.URL, // 1
81            BookmarkColumns.VISITS, // 2
82            BookmarkColumns.DATE, // 3
83            BookmarkColumns.BOOKMARK, // 4
84            BookmarkColumns.TITLE, // 5
85            BookmarkColumns.FAVICON, // 6
86            BookmarkColumns.THUMBNAIL, // 7
87            BookmarkColumns.TOUCH_ICON, // 8
88            BookmarkColumns.USER_ENTERED, // 9
89    };
90
91    /* these indices dependent on HISTORY_PROJECTION */
92    public static final int HISTORY_PROJECTION_ID_INDEX = 0;
93    public static final int HISTORY_PROJECTION_URL_INDEX = 1;
94    public static final int HISTORY_PROJECTION_VISITS_INDEX = 2;
95    public static final int HISTORY_PROJECTION_DATE_INDEX = 3;
96    public static final int HISTORY_PROJECTION_BOOKMARK_INDEX = 4;
97    public static final int HISTORY_PROJECTION_TITLE_INDEX = 5;
98    public static final int HISTORY_PROJECTION_FAVICON_INDEX = 6;
99    /**
100     * @hide
101     */
102    public static final int HISTORY_PROJECTION_THUMBNAIL_INDEX = 7;
103    /**
104     * @hide
105     */
106    public static final int HISTORY_PROJECTION_TOUCH_ICON_INDEX = 8;
107
108    /* columns needed to determine whether to truncate history */
109    public static final String[] TRUNCATE_HISTORY_PROJECTION = new String[] {
110            BookmarkColumns._ID,
111            BookmarkColumns.DATE,
112    };
113
114    public static final int TRUNCATE_HISTORY_PROJECTION_ID_INDEX = 0;
115
116    /* truncate this many history items at a time */
117    public static final int TRUNCATE_N_OLDEST = 5;
118
119    /**
120     * A table containing a log of browser searches. The columns of the table are defined in
121     * {@link SearchColumns}. Reading this table requires the
122     * {@link android.Manifest.permission#READ_HISTORY_BOOKMARKS} permission and writing to it
123     * requires the {@link android.Manifest.permission#WRITE_HISTORY_BOOKMARKS} permission.
124     */
125    public static final Uri SEARCHES_URI = Uri.parse("content://browser/searches");
126
127    /**
128     * A projection of {@link #SEARCHES_URI} that contains {@link SearchColumns#_ID},
129     * {@link SearchColumns#SEARCH}, and {@link SearchColumns#DATE}.
130     */
131    public static final String[] SEARCHES_PROJECTION = new String[] {
132            // if you change column order you must also change indices below
133            SearchColumns._ID, // 0
134            SearchColumns.SEARCH, // 1
135            SearchColumns.DATE, // 2
136    };
137
138    /* these indices dependent on SEARCHES_PROJECTION */
139    public static final int SEARCHES_PROJECTION_SEARCH_INDEX = 1;
140    public static final int SEARCHES_PROJECTION_DATE_INDEX = 2;
141
142    /* Set a cap on the count of history items in the history/bookmark
143       table, to prevent db and layout operations from dragging to a
144       crawl.  Revisit this cap when/if db/layout performance
145       improvements are made.  Note: this does not affect bookmark
146       entries -- if the user wants more bookmarks than the cap, they
147       get them. */
148    private static final int MAX_HISTORY_COUNT = 250;
149
150    /**
151     *  Open an activity to save a bookmark. Launch with a title
152     *  and/or a url, both of which can be edited by the user before saving.
153     *
154     *  @param c        Context used to launch the activity to add a bookmark.
155     *  @param title    Title for the bookmark. Can be null or empty string.
156     *  @param url      Url for the bookmark. Can be null or empty string.
157     */
158    public static final void saveBookmark(Context c,
159                                          String title,
160                                          String url) {
161        Intent i = new Intent(Intent.ACTION_INSERT, Browser.BOOKMARKS_URI);
162        i.putExtra("title", title);
163        i.putExtra("url", url);
164        c.startActivity(i);
165    }
166
167    /**
168     * Boolean extra passed along with an Intent to a browser, specifying that
169     * a new tab be created.  Overrides EXTRA_APPLICATION_ID; if both are set,
170     * a new tab will be used, rather than using the same one.
171     */
172    public static final String EXTRA_CREATE_NEW_TAB = "create_new_tab";
173
174    /**
175     * Stores a Bitmap extra in an {@link Intent} representing the screenshot of
176     * a page to share.  When receiving an {@link Intent#ACTION_SEND} from the
177     * Browser, use this to access the screenshot.
178     * @hide
179     */
180    public final static String EXTRA_SHARE_SCREENSHOT = "share_screenshot";
181
182    /**
183     * Stores a Bitmap extra in an {@link Intent} representing the favicon of a
184     * page to share.  When receiving an {@link Intent#ACTION_SEND} from the
185     * Browser, use this to access the favicon.
186     * @hide
187     */
188    public final static String EXTRA_SHARE_FAVICON = "share_favicon";
189
190    /**
191     * Sends the given string using an Intent with {@link Intent#ACTION_SEND} and a mime type
192     * of text/plain. The string is put into {@link Intent#EXTRA_TEXT}.
193     *
194     * @param context the context used to start the activity
195     * @param string the string to send
196     */
197    public static final void sendString(Context context, String string) {
198        sendString(context, string, context.getString(com.android.internal.R.string.sendText));
199    }
200
201    /**
202     *  Find an application to handle the given string and, if found, invoke
203     *  it with the given string as a parameter.
204     *  @param c Context used to launch the new activity.
205     *  @param stringToSend The string to be handled.
206     *  @param chooserDialogTitle The title of the dialog that allows the user
207     *  to select between multiple applications that are all capable of handling
208     *  the string.
209     *  @hide pending API council approval
210     */
211    public static final void sendString(Context c,
212                                        String stringToSend,
213                                        String chooserDialogTitle) {
214        Intent send = new Intent(Intent.ACTION_SEND);
215        send.setType("text/plain");
216        send.putExtra(Intent.EXTRA_TEXT, stringToSend);
217
218        try {
219            Intent i = Intent.createChooser(send, chooserDialogTitle);
220            // In case this is called from outside an Activity
221            i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
222            c.startActivity(i);
223        } catch(android.content.ActivityNotFoundException ex) {
224            // if no app handles it, do nothing
225        }
226    }
227
228    /**
229     *  Return a cursor pointing to a list of all the bookmarks. The cursor will have a single
230     *  column, {@link BookmarkColumns#URL}.
231     *  <p>
232     *  Requires {@link android.Manifest.permission#READ_HISTORY_BOOKMARKS}
233     *
234     *  @param cr   The ContentResolver used to access the database.
235     */
236    public static final Cursor getAllBookmarks(ContentResolver cr) throws
237            IllegalStateException {
238        return cr.query(Bookmarks.CONTENT_URI,
239                new String[] { Bookmarks.URL },
240                Bookmarks.IS_FOLDER + " = 0", null, null);
241    }
242
243    /**
244     *  Return a cursor pointing to a list of all visited site urls. The cursor will
245     *  have a single column, {@link BookmarkColumns#URL}.
246     *  <p>
247     *  Requires {@link android.Manifest.permission#READ_HISTORY_BOOKMARKS}
248     *
249     *  @param cr   The ContentResolver used to access the database.
250     */
251    public static final Cursor getAllVisitedUrls(ContentResolver cr) throws
252            IllegalStateException {
253        return cr.query(Combined.CONTENT_URI,
254                new String[] { Combined.URL }, null, null,
255                Combined.DATE_CREATED + " ASC");
256    }
257
258    private static final void addOrUrlEquals(StringBuilder sb) {
259        sb.append(" OR " + BookmarkColumns.URL + " = ");
260    }
261
262    private static final Cursor getVisitedLike(ContentResolver cr, String url) {
263        boolean secure = false;
264        String compareString = url;
265        if (compareString.startsWith("http://")) {
266            compareString = compareString.substring(7);
267        } else if (compareString.startsWith("https://")) {
268            compareString = compareString.substring(8);
269            secure = true;
270        }
271        if (compareString.startsWith("www.")) {
272            compareString = compareString.substring(4);
273        }
274        StringBuilder whereClause = null;
275        if (secure) {
276            whereClause = new StringBuilder(Bookmarks.URL + " = ");
277            DatabaseUtils.appendEscapedSQLString(whereClause,
278                    "https://" + compareString);
279            addOrUrlEquals(whereClause);
280            DatabaseUtils.appendEscapedSQLString(whereClause,
281                    "https://www." + compareString);
282        } else {
283            whereClause = new StringBuilder(Bookmarks.URL + " = ");
284            DatabaseUtils.appendEscapedSQLString(whereClause,
285                    compareString);
286            addOrUrlEquals(whereClause);
287            String wwwString = "www." + compareString;
288            DatabaseUtils.appendEscapedSQLString(whereClause,
289                    wwwString);
290            addOrUrlEquals(whereClause);
291            DatabaseUtils.appendEscapedSQLString(whereClause,
292                    "http://" + compareString);
293            addOrUrlEquals(whereClause);
294            DatabaseUtils.appendEscapedSQLString(whereClause,
295                    "http://" + wwwString);
296        }
297        return cr.query(History.CONTENT_URI, new String[] { History._ID, History.VISITS },
298                whereClause.toString(), null, null);
299    }
300
301    /**
302     *  Update the visited history to acknowledge that a site has been
303     *  visited.
304     *  Requires {@link android.Manifest.permission#READ_HISTORY_BOOKMARKS}
305     *  Requires {@link android.Manifest.permission#WRITE_HISTORY_BOOKMARKS}
306     *  @param cr   The ContentResolver used to access the database.
307     *  @param url  The site being visited.
308     *  @param real If true, this is an actual visit, and should add to the
309     *              number of visits.  If false, the user entered it manually.
310     */
311    public static final void updateVisitedHistory(ContentResolver cr,
312                                                  String url, boolean real) {
313        long now = System.currentTimeMillis();
314        Cursor c = null;
315        try {
316            c = getVisitedLike(cr, url);
317            /* We should only get one answer that is exactly the same. */
318            if (c.moveToFirst()) {
319                ContentValues values = new ContentValues();
320                if (real) {
321                    values.put(History.VISITS, c.getInt(1) + 1);
322                } else {
323                    values.put(History.USER_ENTERED, 1);
324                }
325                values.put(History.DATE_LAST_VISITED, now);
326                cr.update(ContentUris.withAppendedId(History.CONTENT_URI, c.getLong(0)),
327                        values, null, null);
328            } else {
329                truncateHistory(cr);
330                ContentValues values = new ContentValues();
331                int visits;
332                int user_entered;
333                if (real) {
334                    visits = 1;
335                    user_entered = 0;
336                } else {
337                    visits = 0;
338                    user_entered = 1;
339                }
340                values.put(History.URL, url);
341                values.put(History.VISITS, visits);
342                values.put(History.DATE_LAST_VISITED, now);
343                values.put(History.TITLE, url);
344                values.put(History.DATE_CREATED, 0);
345                values.put(History.USER_ENTERED, user_entered);
346                cr.insert(History.CONTENT_URI, values);
347            }
348        } catch (IllegalStateException e) {
349            Log.e(LOGTAG, "updateVisitedHistory", e);
350        } finally {
351            if (c != null) c.close();
352        }
353    }
354
355    /**
356     *  Returns all the URLs in the history.
357     *  Requires {@link android.Manifest.permission#READ_HISTORY_BOOKMARKS}
358     *  @param cr   The ContentResolver used to access the database.
359     *  @hide pending API council approval
360     */
361    public static final String[] getVisitedHistory(ContentResolver cr) {
362        Cursor c = null;
363        String[] str = null;
364        try {
365            String[] projection = new String[] {
366                    History.URL,
367            };
368            c = cr.query(History.CONTENT_URI, projection, History.VISITS + " > 0", null, null);
369            if (c == null) return new String[0];
370            str = new String[c.getCount()];
371            int i = 0;
372            while (c.moveToNext()) {
373                str[i] = c.getString(0);
374                i++;
375            }
376        } catch (IllegalStateException e) {
377            Log.e(LOGTAG, "getVisitedHistory", e);
378            str = new String[0];
379        } finally {
380            if (c != null) c.close();
381        }
382        return str;
383    }
384
385    /**
386     * If there are more than MAX_HISTORY_COUNT non-bookmark history
387     * items in the bookmark/history table, delete TRUNCATE_N_OLDEST
388     * of them.  This is used to keep our history table to a
389     * reasonable size.  Note: it does not prune bookmarks.  If the
390     * user wants 1000 bookmarks, the user gets 1000 bookmarks.
391     *  Requires {@link android.Manifest.permission#READ_HISTORY_BOOKMARKS}
392     *  Requires {@link android.Manifest.permission#WRITE_HISTORY_BOOKMARKS}
393     *
394     * @param cr The ContentResolver used to access the database.
395     */
396    public static final void truncateHistory(ContentResolver cr) {
397        // TODO make a single request to the provider to do this in a single transaction
398        Cursor cursor = null;
399        try {
400
401            // Select non-bookmark history, ordered by date
402            cursor = cr.query(History.CONTENT_URI,
403                    new String[] { History._ID, History.URL, History.DATE_LAST_VISITED },
404                    null, null, History.DATE_LAST_VISITED + " ASC");
405
406            if (cursor.moveToFirst() && cursor.getCount() >= MAX_HISTORY_COUNT) {
407                /* eliminate oldest history items */
408                for (int i = 0; i < TRUNCATE_N_OLDEST; i++) {
409                    cr.delete(ContentUris.withAppendedId(History.CONTENT_URI, cursor.getLong(0)),
410                        null, null);
411                    if (!cursor.moveToNext()) break;
412                }
413            }
414        } catch (IllegalStateException e) {
415            Log.e(LOGTAG, "truncateHistory", e);
416        } finally {
417            if (cursor != null) cursor.close();
418        }
419    }
420
421    /**
422     * Returns whether there is any history to clear.
423     *  Requires {@link android.Manifest.permission#READ_HISTORY_BOOKMARKS}
424     * @param cr   The ContentResolver used to access the database.
425     * @return boolean  True if the history can be cleared.
426     */
427    public static final boolean canClearHistory(ContentResolver cr) {
428        Cursor cursor = null;
429        boolean ret = false;
430        try {
431            cursor = cr.query(History.CONTENT_URI,
432                new String [] { History._ID, History.VISITS },
433                null, null, null);
434            ret = cursor.getCount() > 0;
435        } catch (IllegalStateException e) {
436            Log.e(LOGTAG, "canClearHistory", e);
437        } finally {
438            if (cursor != null) cursor.close();
439        }
440        return ret;
441    }
442
443    /**
444     *  Delete all entries from the bookmarks/history table which are
445     *  not bookmarks.  Also set all visited bookmarks to unvisited.
446     *  Requires {@link android.Manifest.permission#WRITE_HISTORY_BOOKMARKS}
447     *  @param cr   The ContentResolver used to access the database.
448     */
449    public static final void clearHistory(ContentResolver cr) {
450        deleteHistoryWhere(cr, null);
451    }
452
453    /**
454     * Helper function to delete all history items and release the icons for them in the
455     * {@link WebIconDatabase}.
456     *
457     * Requires {@link android.Manifest.permission#READ_HISTORY_BOOKMARKS}
458     * Requires {@link android.Manifest.permission#WRITE_HISTORY_BOOKMARKS}
459     *
460     * @param cr   The ContentResolver used to access the database.
461     * @param whereClause   String to limit the items affected.
462     *                      null means all items.
463     */
464    private static final void deleteHistoryWhere(ContentResolver cr, String whereClause) {
465        Cursor cursor = null;
466        try {
467            cursor = cr.query(History.CONTENT_URI, new String[] { History.URL }, whereClause,
468                    null, null);
469            if (cursor.moveToFirst()) {
470                cr.delete(History.CONTENT_URI, whereClause, null);
471            }
472        } catch (IllegalStateException e) {
473            Log.e(LOGTAG, "deleteHistoryWhere", e);
474            return;
475        } finally {
476            if (cursor != null) cursor.close();
477        }
478    }
479
480    /**
481     * Delete all history items from begin to end.
482     *  Requires {@link android.Manifest.permission#WRITE_HISTORY_BOOKMARKS}
483     * @param cr    The ContentResolver used to access the database.
484     * @param begin First date to remove.  If -1, all dates before end.
485     *              Inclusive.
486     * @param end   Last date to remove. If -1, all dates after begin.
487     *              Non-inclusive.
488     */
489    public static final void deleteHistoryTimeFrame(ContentResolver cr,
490            long begin, long end) {
491        String whereClause;
492        String date = BookmarkColumns.DATE;
493        if (-1 == begin) {
494            if (-1 == end) {
495                clearHistory(cr);
496                return;
497            }
498            whereClause = date + " < " + Long.toString(end);
499        } else if (-1 == end) {
500            whereClause = date + " >= " + Long.toString(begin);
501        } else {
502            whereClause = date + " >= " + Long.toString(begin) + " AND " + date
503                    + " < " + Long.toString(end);
504        }
505        deleteHistoryWhere(cr, whereClause);
506    }
507
508    /**
509     * Remove a specific url from the history database.
510     *  Requires {@link android.Manifest.permission#WRITE_HISTORY_BOOKMARKS}
511     * @param cr    The ContentResolver used to access the database.
512     * @param url   url to remove.
513     */
514    public static final void deleteFromHistory(ContentResolver cr,
515                                               String url) {
516        cr.delete(History.CONTENT_URI, History.URL + "=?", new String[] { url });
517    }
518
519    /**
520     * Add a search string to the searches database.
521     *  Requires {@link android.Manifest.permission#READ_HISTORY_BOOKMARKS}
522     *  Requires {@link android.Manifest.permission#WRITE_HISTORY_BOOKMARKS}
523     * @param cr   The ContentResolver used to access the database.
524     * @param search    The string to add to the searches database.
525     */
526    public static final void addSearchUrl(ContentResolver cr, String search) {
527        // The content provider will take care of updating existing searches instead of duplicating
528        ContentValues values = new ContentValues();
529        values.put(Searches.SEARCH, search);
530        values.put(Searches.DATE, System.currentTimeMillis());
531        cr.insert(Searches.CONTENT_URI, values);
532    }
533
534    /**
535     * Remove all searches from the search database.
536     *  Requires {@link android.Manifest.permission#WRITE_HISTORY_BOOKMARKS}
537     * @param cr   The ContentResolver used to access the database.
538     */
539    public static final void clearSearches(ContentResolver cr) {
540        // FIXME: Should this clear the urls to which these searches lead?
541        // (i.e. remove google.com/query= blah blah blah)
542        try {
543            cr.delete(Searches.CONTENT_URI, null, null);
544        } catch (IllegalStateException e) {
545            Log.e(LOGTAG, "clearSearches", e);
546        }
547    }
548
549    /**
550     *  Request all icons from the database.  This call must either be called
551     *  in the main thread or have had Looper.prepare() invoked in the calling
552     *  thread.
553     *  Requires {@link android.Manifest.permission#READ_HISTORY_BOOKMARKS}
554     *  @param  cr The ContentResolver used to access the database.
555     *  @param  where Clause to be used to limit the query from the database.
556     *          Must be an allowable string to be passed into a database query.
557     *  @param  listener IconListener that gets the icons once they are
558     *          retrieved.
559     */
560    public static final void requestAllIcons(ContentResolver cr, String where,
561            WebIconDatabase.IconListener listener) {
562        // Do nothing: this is no longer used.
563    }
564
565    /**
566     * Column definitions for the mixed bookmark and history items available
567     * at {@link #BOOKMARKS_URI}.
568     */
569    public static class BookmarkColumns implements BaseColumns {
570        /**
571         * The URL of the bookmark or history item.
572         * <p>Type: TEXT (URL)</p>
573         */
574        public static final String URL = "url";
575
576        /**
577         * The number of time the item has been visited.
578         * <p>Type: NUMBER</p>
579         */
580        public static final String VISITS = "visits";
581
582        /**
583         * The date the item was last visited, in milliseconds since the epoch.
584         * <p>Type: NUMBER (date in milliseconds since January 1, 1970)</p>
585         */
586        public static final String DATE = "date";
587
588        /**
589         * Flag indicating that an item is a bookmark. A value of 1 indicates a bookmark, a value
590         * of 0 indicates a history item.
591         * <p>Type: INTEGER (boolean)</p>
592         */
593        public static final String BOOKMARK = "bookmark";
594
595        /**
596         * The user visible title of the bookmark or history item.
597         * <p>Type: TEXT</p>
598         */
599        public static final String TITLE = "title";
600
601        /**
602         * The date the item created, in milliseconds since the epoch.
603         * <p>Type: NUMBER (date in milliseconds since January 1, 1970)</p>
604         */
605        public static final String CREATED = "created";
606
607        /**
608         * The favicon of the bookmark. Must decode via {@link BitmapFactory#decodeByteArray}.
609         * <p>Type: BLOB (image)</p>
610         */
611        public static final String FAVICON = "favicon";
612
613        /**
614         * @hide
615         */
616        public static final String THUMBNAIL = "thumbnail";
617
618        /**
619         * @hide
620         */
621        public static final String TOUCH_ICON = "touch_icon";
622
623        /**
624         * @hide
625         */
626        public static final String USER_ENTERED = "user_entered";
627    }
628
629    /**
630     * Column definitions for the search history table, available at {@link #SEARCHES_URI}.
631     */
632    public static class SearchColumns implements BaseColumns {
633        /**
634         * @deprecated Not used.
635         */
636        @Deprecated
637        public static final String URL = "url";
638
639        /**
640         * The user entered search term.
641         */
642        public static final String SEARCH = "search";
643
644        /**
645         * The date the search was performed, in milliseconds since the epoch.
646         * <p>Type: NUMBER (date in milliseconds since January 1, 1970)</p>
647         */
648        public static final String DATE = "date";
649    }
650}
651