OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.physicalweb; | 5 package org.chromium.chrome.browser.physicalweb; |
6 | 6 |
7 import android.app.AlarmManager; | 7 import android.app.AlarmManager; |
8 import android.app.Notification; | 8 import android.app.Notification; |
9 import android.app.NotificationManager; | 9 import android.app.NotificationManager; |
10 import android.app.PendingIntent; | 10 import android.app.PendingIntent; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 private static final String PREFS_VERSION_KEY = "physicalweb_version"; | 67 private static final String PREFS_VERSION_KEY = "physicalweb_version"; |
68 private static final String PREFS_ALL_URLS_KEY = "physicalweb_all_urls"; | 68 private static final String PREFS_ALL_URLS_KEY = "physicalweb_all_urls"; |
69 private static final String PREFS_NEARBY_URLS_KEY = "physicalweb_nearby_urls
"; | 69 private static final String PREFS_NEARBY_URLS_KEY = "physicalweb_nearby_urls
"; |
70 private static final String PREFS_PWS_RESULTS_KEY = "physicalweb_pws_results
"; | 70 private static final String PREFS_PWS_RESULTS_KEY = "physicalweb_pws_results
"; |
71 private static final String PREFS_NOTIFICATION_UPDATE_TIMESTAMP = | 71 private static final String PREFS_NOTIFICATION_UPDATE_TIMESTAMP = |
72 "physicalweb_notification_update_timestamp"; | 72 "physicalweb_notification_update_timestamp"; |
73 private static final int PREFS_VERSION = 4; | 73 private static final int PREFS_VERSION = 4; |
74 private static final long STALE_NOTIFICATION_TIMEOUT_MILLIS = 30 * 60 * 1000
; // 30 Minutes | 74 private static final long STALE_NOTIFICATION_TIMEOUT_MILLIS = 30 * 60 * 1000
; // 30 Minutes |
75 private static final long MAX_CACHE_TIME = 24 * 60 * 60 * 1000; // 1 Day | 75 private static final long MAX_CACHE_TIME = 24 * 60 * 60 * 1000; // 1 Day |
76 private static final int MAX_CACHE_SIZE = 100; | 76 private static final int MAX_CACHE_SIZE = 100; |
77 private static UrlManager sInstance = null; | 77 private static UrlManager sInstance; |
78 private final Context mContext; | 78 private final Context mContext; |
79 private final ObserverList<Listener> mObservers; | 79 private final ObserverList<Listener> mObservers; |
80 private final Set<String> mNearbyUrls; | 80 private final Set<String> mNearbyUrls; |
81 private final Map<String, UrlInfo> mUrlInfoMap; | 81 private final Map<String, UrlInfo> mUrlInfoMap; |
82 private final Map<String, PwsResult> mPwsResultMap; | 82 private final Map<String, PwsResult> mPwsResultMap; |
83 private final PriorityQueue<String> mUrlsSortedByTimestamp; | 83 private final PriorityQueue<String> mUrlsSortedByTimestamp; |
84 private NotificationManagerProxy mNotificationManager; | 84 private NotificationManagerProxy mNotificationManager; |
85 private PwsClient mPwsClient; | 85 private PwsClient mPwsClient; |
86 private long mNativePhysicalWebDataSourceAndroid; | 86 private long mNativePhysicalWebDataSourceAndroid; |
87 | 87 |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 | 830 |
831 private native long nativeInit(); | 831 private native long nativeInit(); |
832 private native void nativeAppendMetadataItem(long nativePhysicalWebCollectio
n, | 832 private native void nativeAppendMetadataItem(long nativePhysicalWebCollectio
n, |
833 String requestUrl, double distanceEstimate, int scanTimestamp, Strin
g siteUrl, | 833 String requestUrl, double distanceEstimate, int scanTimestamp, Strin
g siteUrl, |
834 String iconUrl, String title, String description, String groupId); | 834 String iconUrl, String title, String description, String groupId); |
835 private native void nativeOnFound(long nativePhysicalWebDataSourceAndroid, S
tring url); | 835 private native void nativeOnFound(long nativePhysicalWebDataSourceAndroid, S
tring url); |
836 private native void nativeOnLost(long nativePhysicalWebDataSourceAndroid, St
ring url); | 836 private native void nativeOnLost(long nativePhysicalWebDataSourceAndroid, St
ring url); |
837 private native void nativeOnDistanceChanged( | 837 private native void nativeOnDistanceChanged( |
838 long nativePhysicalWebDataSourceAndroid, String url, double distance
Changed); | 838 long nativePhysicalWebDataSourceAndroid, String url, double distance
Changed); |
839 } | 839 } |
OLD | NEW |