зеркало из https://github.com/mozilla/gecko-dev.git
Bug 776223 - Catch NullPointerException from Samsung's buggy clipboard API. r=blassey
This commit is contained in:
Родитель
834455b9d8
Коммит
8d3d6a45a6
|
@ -1297,7 +1297,14 @@ public class GeckoAppShell
|
|||
if (android.os.Build.VERSION.SDK_INT >= 11) {
|
||||
android.content.ClipboardManager cm = (android.content.ClipboardManager)
|
||||
context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
cm.setPrimaryClip(ClipData.newPlainText("Text", text));
|
||||
ClipData clip = ClipData.newPlainText("Text", text);
|
||||
try {
|
||||
cm.setPrimaryClip(clip);
|
||||
} catch (NullPointerException e) {
|
||||
// Bug 776223: This is a Samsung clipboard bug. setPrimaryClip() can throw
|
||||
// a NullPointerException if Samsung's /data/clipboard directory is full.
|
||||
// Fortunately, the text is still successfully copied to the clipboard.
|
||||
}
|
||||
} else {
|
||||
android.text.ClipboardManager cm = (android.text.ClipboardManager)
|
||||
context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
|
|
Загрузка…
Ссылка в новой задаче