Fixed strict mode violation in history
Bug: 3257747
Fixes a strict mode violation in BrowserHistoryPage. onPrepareOptionsMenu
is doing a query on the UI thread to determine if it should show clear
history or not. Fixed by having it ask the adapter, which is loaded async
Change-Id: I12338987098d093e63f1944f2a1458ad962d0c78
diff --git a/src/com/android/browser/BrowserHistoryPage.java b/src/com/android/browser/BrowserHistoryPage.java
index 5cd9545..2fdfedd 100644
--- a/src/com/android/browser/BrowserHistoryPage.java
+++ b/src/com/android/browser/BrowserHistoryPage.java
@@ -214,7 +214,7 @@
@Override
public void onPrepareOptionsMenu(Menu menu) {
menu.findItem(R.id.clear_history_menu_id).setVisible(
- Browser.canClearHistory(getActivity().getContentResolver()));
+ mAdapter != null && !mAdapter.isEmpty());
}
@Override