This repository was archived by the owner on Jul 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
app/src/common/shared/org/mozilla/vrbrowser Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .mozilla .vrbrowser .search .suggestions ;
22
33import android .content .Context ;
4+ import android .util .Log ;
45
56import androidx .annotation .NonNull ;
67
1718
1819public class SuggestionsProvider {
1920
21+ private static final String LOGTAG = SuggestionsProvider .class .getSimpleName ();
22+
2023 public class DefaultSuggestionsComparator implements Comparator {
2124
2225 public int compare (Object obj1 , Object obj2 ) {
@@ -90,6 +93,11 @@ public CompletableFuture<List<SuggestionItem>> getBookmarkSuggestions(@NonNull L
9093 items .sort (mComparator );
9194 }
9295 future .complete (items );
96+
97+ }).exceptionally (th -> {
98+ Log .d (LOGTAG , "Error getting bookmarks suggestions: " + th .getLocalizedMessage ());
99+ future .complete (items );
100+ return null ;
93101 });
94102
95103 return future ;
@@ -111,6 +119,11 @@ public CompletableFuture<List<SuggestionItem>> getHistorySuggestions(@NonNull fi
111119 items .sort (mComparator );
112120 }
113121 future .complete (items );
122+
123+ }).exceptionally (th -> {
124+ Log .d (LOGTAG , "Error getting history suggestions: " + th .getLocalizedMessage ());
125+ future .complete (items );
126+ return null ;
114127 });
115128
116129 return future ;
@@ -152,6 +165,11 @@ public CompletableFuture<List<SuggestionItem>> getSearchEngineSuggestions(@NonNu
152165 items .sort (mComparator );
153166 }
154167 future .complete (items );
168+
169+ }).exceptionally (th -> {
170+ Log .d (LOGTAG , "Error getting search engine suggestions: " + th .getLocalizedMessage ());
171+ future .complete (items );
172+ return null ;
155173 });
156174
157175 return future ;
Original file line number Diff line number Diff line change 1212import android .text .TextWatcher ;
1313import android .text .style .ForegroundColorSpan ;
1414import android .util .AttributeSet ;
15+ import android .util .Log ;
1516import android .util .TypedValue ;
1617import android .view .GestureDetector ;
1718import android .view .MotionEvent ;
5253import mozilla .components .ui .autocomplete .InlineAutocompleteEditText ;
5354
5455public class NavigationURLBar extends FrameLayout {
56+
57+ private static final String LOGTAG = NavigationURLBar .class .getSimpleName ();
58+
5559 private InlineAutocompleteEditText mURL ;
5660 private UIButton mMicrophoneButton ;
5761 private UIButton mUAModeButton ;
@@ -255,7 +259,10 @@ private void handleBookmarkClick() {
255259 bookmarkStore .deleteBookmarkByURL (url );
256260 setBookmarked (false );
257261 }
258- }, mUIThreadExecutor );
262+ }, mUIThreadExecutor ).exceptionally (th -> {
263+ Log .d (LOGTAG , "Error getting bookmarks: " + th .getLocalizedMessage ());
264+ return null ;
265+ });
259266
260267 }
261268
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public class NavigationBarWidget extends UIWidget implements GeckoSession.Naviga
5353 SharedPreferences .OnSharedPreferenceChangeListener , SuggestionsWidget .URLBarPopupDelegate ,
5454 BookmarkListener , TrayListener {
5555
56- private static final String LOGTAG = "VRB" ;
56+ private static final String LOGTAG = NavigationBarWidget . class . getSimpleName () ;
5757
5858 private AudioEngine mAudio ;
5959 private UIButton mBackButton ;
@@ -901,7 +901,10 @@ public void OnShowSearchPopup() {
901901 mPopup .show (CLEAR_FOCUS );
902902 }
903903
904- }, new UIThreadExecutor ());
904+ }, new UIThreadExecutor ()).exceptionally (th -> {
905+ Log .d (LOGTAG , "Error getting suggestions: " + th .getLocalizedMessage ());
906+ return null ;
907+ });
905908 }
906909
907910 @ Override
You can’t perform that action at this time.
0 commit comments