diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-08-05 14:17:53 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2010-08-05 14:19:36 -0700 |
commit | 80f32627140aefe828ad539f66fc439d1580bae7 (patch) | |
tree | 4891f062acddb31dd1d55d8f8b899cc96cb6ffe2 /src/com/android | |
parent | 942fa124f64bcbad24510043b0ffbf54b904ae6d (diff) | |
download | packages_apps_Browser-80f32627140aefe828ad539f66fc439d1580bae7.zip packages_apps_Browser-80f32627140aefe828ad539f66fc439d1580bae7.tar.gz packages_apps_Browser-80f32627140aefe828ad539f66fc439d1580bae7.tar.bz2 |
Fix build.
Change-Id: Ibd26d72bbe94c7de66849310d1cca0b75fb83963
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/browser/BrowserActivity.java | 12 | ||||
-rw-r--r-- | src/com/android/browser/BrowserBookmarksPage.java | 13 | ||||
-rw-r--r-- | src/com/android/browser/BrowserHistoryPage.java | 12 |
3 files changed, 10 insertions, 27 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index 8afd3b4..69e0ee5 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -22,6 +22,7 @@ import android.app.ProgressDialog; import android.app.SearchManager; import android.content.ActivityNotFoundException; import android.content.BroadcastReceiver; +import android.content.ClipboardManager; import android.content.ComponentName; import android.content.ContentProvider; import android.content.ContentProviderClient; @@ -66,7 +67,6 @@ import android.provider.Downloads; import android.provider.MediaStore; import android.provider.ContactsContract.Intents.Insert; import android.speech.RecognizerResultsIntent; -import android.text.IClipboard; import android.text.TextUtils; import android.text.format.DateFormat; import android.util.Log; @@ -2007,14 +2007,8 @@ public class BrowserActivity extends Activity } private void copy(CharSequence text) { - try { - IClipboard clip = IClipboard.Stub.asInterface(ServiceManager.getService("clipboard")); - if (clip != null) { - clip.setClipboardText(text); - } - } catch (android.os.RemoteException e) { - Log.e(LOGTAG, "Copy failed", e); - } + ClipboardManager cm = (ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE); + cm.setText(text); } /** diff --git a/src/com/android/browser/BrowserBookmarksPage.java b/src/com/android/browser/BrowserBookmarksPage.java index 6af14e8..cd2abd9 100644 --- a/src/com/android/browser/BrowserBookmarksPage.java +++ b/src/com/android/browser/BrowserBookmarksPage.java @@ -18,6 +18,8 @@ package com.android.browser; import android.app.Activity; import android.app.AlertDialog; +import android.content.ClipboardManager; +import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; @@ -29,7 +31,6 @@ import android.os.Handler; import android.os.Message; import android.os.ServiceManager; import android.provider.Browser; -import android.text.IClipboard; import android.util.Log; import android.view.ContextMenu; import android.view.Menu; @@ -629,14 +630,8 @@ public class BrowserBookmarksPage extends Activity implements } private void copy(CharSequence text) { - try { - IClipboard clip = IClipboard.Stub.asInterface(ServiceManager.getService("clipboard")); - if (clip != null) { - clip.setClipboardText(text); - } - } catch (android.os.RemoteException e) { - Log.e(LOGTAG, "Copy failed", e); - } + ClipboardManager cm = (ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE); + cm.setText(text); } public String getBookmarkTitle(int position) { diff --git a/src/com/android/browser/BrowserHistoryPage.java b/src/com/android/browser/BrowserHistoryPage.java index 0281087..b01f7c1 100644 --- a/src/com/android/browser/BrowserHistoryPage.java +++ b/src/com/android/browser/BrowserHistoryPage.java @@ -18,6 +18,7 @@ package com.android.browser; import android.app.Activity; import android.app.ExpandableListActivity; +import android.content.ClipboardManager; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; @@ -31,7 +32,6 @@ import android.os.Handler; import android.os.Message; import android.os.ServiceManager; import android.provider.Browser; -import android.text.IClipboard; import android.util.Log; import android.view.ContextMenu; import android.view.Menu; @@ -85,14 +85,8 @@ public class BrowserHistoryPage extends ExpandableListActivity { } private void copy(CharSequence text) { - try { - IClipboard clip = IClipboard.Stub.asInterface(ServiceManager.getService("clipboard")); - if (clip != null) { - clip.setClipboardText(text); - } - } catch (android.os.RemoteException e) { - Log.e(LOGTAG, "Copy failed", e); - } + ClipboardManager cm = (ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE); + cm.setText(text); } private static final int ADAPTER_CREATED = 1000; |