diff options
author | Bjorn Bringert <bringert@android.com> | 2010-10-12 10:53:12 +0100 |
---|---|---|
committer | Bjorn Bringert <bringert@android.com> | 2010-10-12 10:55:28 +0100 |
commit | b1402a5c3e1617867c58d32d1fe9782cf6de423f (patch) | |
tree | 5fd13ed8e0c139f9ab3d315c81e8e249a244c2a9 /src/com/android/browser | |
parent | f0ef6a989031f461761b1c453318135e0af4dde1 (diff) | |
download | packages_apps_Browser-b1402a5c3e1617867c58d32d1fe9782cf6de423f.zip packages_apps_Browser-b1402a5c3e1617867c58d32d1fe9782cf6de423f.tar.gz packages_apps_Browser-b1402a5c3e1617867c58d32d1fe9782cf6de423f.tar.bz2 |
Remove some unnecessary use of hidden APIs
Change-Id: Ie72947017550d759994e34d7db8087d1f9e6d63a
Diffstat (limited to 'src/com/android/browser')
-rw-r--r-- | src/com/android/browser/AddBookmarkPage.java | 10 | ||||
-rw-r--r-- | src/com/android/browser/BrowserActivity.java | 4 | ||||
-rw-r--r-- | src/com/android/browser/Dots.java | 2 | ||||
-rw-r--r-- | src/com/android/browser/HistoryItem.java | 6 | ||||
-rw-r--r-- | src/com/android/browser/Tab.java | 2 | ||||
-rw-r--r-- | src/com/android/browser/TabBar.java | 2 | ||||
-rw-r--r-- | src/com/android/browser/TabControl.java | 2 | ||||
-rw-r--r-- | src/com/android/browser/UrlInputView.java | 1 |
8 files changed, 16 insertions, 13 deletions
diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/browser/AddBookmarkPage.java index 593c247..707126f 100644 --- a/src/com/android/browser/AddBookmarkPage.java +++ b/src/com/android/browser/AddBookmarkPage.java @@ -102,6 +102,10 @@ public class AddBookmarkPage extends Activity private Handler mHandler; + private InputMethodManager getInputMethodManager() { + return (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); + } + @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (v == mFolderNamer) { @@ -149,7 +153,7 @@ public class AddBookmarkPage extends Activity mFolderNamer.setText(R.string.new_folder); mFolderNamer.requestFocus(); mAddNewFolder.setVisibility(View.GONE); - InputMethodManager.getInstance(this).showSoftInput(mFolderNamer, + getInputMethodManager().showSoftInput(mFolderNamer, InputMethodManager.SHOW_IMPLICIT); } } @@ -161,7 +165,7 @@ public class AddBookmarkPage extends Activity descendInto(name, id); mFolderNamer.setVisibility(View.GONE); mAddNewFolder.setVisibility(View.VISIBLE); - InputMethodManager.getInstance(this).hideSoftInputFromWindow( + getInputMethodManager().hideSoftInputFromWindow( mFolderNamer.getWindowToken(), 0); } } @@ -447,7 +451,7 @@ public class AddBookmarkPage extends Activity if (mFolderNamer.getVisibility() == View.VISIBLE) { mFolderNamer.setVisibility(View.GONE); mAddNewFolder.setVisibility(View.VISIBLE); - InputMethodManager.getInstance(this).hideSoftInputFromWindow( + getInputMethodManager().hideSoftInputFromWindow( mFolderNamer.getWindowToken(), 0); } else { int size = mPaths.size(); diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index 8b737a7..6f0ee75 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -180,7 +180,7 @@ public class BrowserActivity extends Activity BitmapFactory.setDefaultConfig(Bitmap.Config.ARGB_8888); } - if (AccessibilityManager.getInstance(this).isEnabled()) { + if (((AccessibilityManager) getSystemService(ACCESSIBILITY_SERVICE)).isEnabled()) { setDefaultKeyMode(DEFAULT_KEYS_DISABLE); } else { setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL); @@ -211,7 +211,7 @@ public class BrowserActivity extends Activity == Configuration.SCREENLAYOUT_SIZE_XLARGE; FrameLayout frameLayout = (FrameLayout) getWindow().getDecorView() - .findViewById(com.android.internal.R.id.content); + .findViewById(android.R.id.content); mBrowserFrameLayout = (FrameLayout) LayoutInflater.from(this) .inflate(R.layout.custom_screen, null); mContentView = (FrameLayout) mBrowserFrameLayout.findViewById( diff --git a/src/com/android/browser/Dots.java b/src/com/android/browser/Dots.java index eb8d493..e28d868 100644 --- a/src/com/android/browser/Dots.java +++ b/src/com/android/browser/Dots.java @@ -48,7 +48,7 @@ class Dots extends LinearLayout { LayoutParams.WRAP_CONTENT); for (int i = 0; i < MAX_DOTS; i++) { - ImageView dotView = new ImageView(mContext); + ImageView dotView = new ImageView(getContext()); dotView.setImageResource(R.drawable.page_indicator_unselected2); addView(dotView, lp); } diff --git a/src/com/android/browser/HistoryItem.java b/src/com/android/browser/HistoryItem.java index a03c29f..11198f0 100644 --- a/src/com/android/browser/HistoryItem.java +++ b/src/com/android/browser/HistoryItem.java @@ -43,11 +43,11 @@ import android.widget.CompoundButton; if (isChecked) { // FIXME: For now, add at the root level. Should we // open AddBookmark from here? - Bookmarks.addBookmark(mContext, true, mUrl, getName(), null, true, 0); + Bookmarks.addBookmark(getContext(), true, mUrl, getName(), null, true, 0); LogTag.logBookmarkAdded(mUrl, "history"); } else { - Bookmarks.removeFromBookmarks(mContext, - mContext.getContentResolver(), mUrl, getName()); + Bookmarks.removeFromBookmarks(getContext(), + getContext().getContentResolver(), mUrl, getName()); } } }; diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java index 5e02f2d..cb70e01 100644 --- a/src/com/android/browser/Tab.java +++ b/src/com/android/browser/Tab.java @@ -845,7 +845,7 @@ class Tab { if (!mInForeground || mActivity.mActivityInPause) { return; } - if (event.isDown()) { + if (event.getAction() == KeyEvent.ACTION_DOWN) { mActivity.onKeyDown(event.getKeyCode(), event); } else { mActivity.onKeyUp(event.getKeyCode(), event); diff --git a/src/com/android/browser/TabBar.java b/src/com/android/browser/TabBar.java index 696301e..432df9f 100644 --- a/src/com/android/browser/TabBar.java +++ b/src/com/android/browser/TabBar.java @@ -225,7 +225,7 @@ public class TabBar extends LinearLayout setGravity(Gravity.CENTER_VERTICAL); setOrientation(LinearLayout.HORIZONTAL); setBackgroundResource(R.drawable.tab_background); - LayoutInflater inflater = LayoutInflater.from(mContext); + LayoutInflater inflater = LayoutInflater.from(getContext()); mTabContent = inflater.inflate(R.layout.tab_title, this, true); mTitle = (TextView) mTabContent.findViewById(R.id.title); mIconView = (ImageView) mTabContent.findViewById(R.id.favicon); diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java index e417a39..264550b 100644 --- a/src/com/android/browser/TabControl.java +++ b/src/com/android/browser/TabControl.java @@ -604,7 +604,7 @@ class TabControl { private WebView createNewWebView(boolean privateBrowsing) { // Create a new WebView ScrollWebView w = new ScrollWebView(mActivity, null, - com.android.internal.R.attr.webViewStyle, privateBrowsing); + android.R.attr.webViewStyle, privateBrowsing); w.setScrollListener(mActivity.getScrollListener()); w.setScrollbarFadingEnabled(true); w.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY); diff --git a/src/com/android/browser/UrlInputView.java b/src/com/android/browser/UrlInputView.java index daf879f..18c5fe6 100644 --- a/src/com/android/browser/UrlInputView.java +++ b/src/com/android/browser/UrlInputView.java @@ -64,7 +64,6 @@ public class UrlInputView extends AutoCompleteTextView mInputManager = (InputMethodManager) ctx.getSystemService(Context.INPUT_METHOD_SERVICE); setOnEditorActionListener(this); super.setOnFocusChangeListener(this); - final ContentResolver cr = mContext.getContentResolver(); mAdapter = new SuggestionsAdapter(ctx, this); setAdapter(mAdapter); setSelectAllOnFocus(false); |