Fixed
Status Update
Comments
st...@gmail.com <st...@gmail.com> #3
Oh, and I'm seeing this on both the emulator and a Galaxy Nexus. Simply launching an activity that does something like this is enough to reproduce:
ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
manager.addPrimaryClipChangedListener(new ClipboardManager.OnPrimaryClipChangedListener() {
@Override
public void onPrimaryClipChanged() { }
});
ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
manager.addPrimaryClipChangedListener(new ClipboardManager.OnPrimaryClipChangedListener() {
@Override
public void onPrimaryClipChanged() { }
});
ss...@google.com <ss...@google.com> #4
Could you please give full steps to reproduce, including the app to run that is causing it? The crash here shows it failing when setting the clipboard, which generally works; I need to to be able to see more specifically what this particular app is doing.
Also the API demo "Clipboard/Data Types" does use addPrimaryClipChangedListener() and doesn't have this problem, and the stack crawl originally shown doesn't have anything about addPrimaryClipChangedListener() in it, so there is some information I am missing.
Thanks!
Also the API demo "Clipboard/Data Types" does use addPrimaryClipChangedListener() and doesn't have this problem, and the stack crawl originally shown doesn't have anything about addPrimaryClipChangedListener() in it, so there is some information I am missing.
Thanks!
st...@gmail.com <st...@gmail.com> #5
What application are you trying to copy text from after adding a listener? I'm copying text from other apps like Messaging or Search and not the application the listener itself is from.
I have no idea if I'm on the right track, but my personal hypothesis is that this is caused because AppOpsService's uid verification is trying to verify the uid for the *listener's* application but the calling uid (Binder.getCallingUid()) is that of the application the text is being copied from. This leads to the permission check for UPDATE_APP_OPS_STATS which will obviously fail.
The code snippet I posted is basically the full "application" you should be able to reproduce this with. So this should be it:
1. Create a new Android app in $IDE_OF_CHOICE
2. Add a new OnPrimaryClipChangedListener in the onCreate of that application's activity -- it's contents don't matter
3. Install and launch the activity
4. Copy text from any other application
5. Crash.
I have no idea if I'm on the right track, but my personal hypothesis is that this is caused because AppOpsService's uid verification is trying to verify the uid for the *listener's* application but the calling uid (Binder.getCallingUid()) is that of the application the text is being copied from. This leads to the permission check for UPDATE_APP_OPS_STATS which will obviously fail.
The code snippet I posted is basically the full "application" you should be able to reproduce this with. So this should be it:
1. Create a new Android app in $IDE_OF_CHOICE
2. Add a new OnPrimaryClipChangedListener in the onCreate of that application's activity -- it's contents don't matter
3. Install and launch the activity
4. Copy text from any other application
5. Crash.
cy...@gmail.com <cy...@gmail.com> #6
I'm experiencing similar bug. for example, go to message app, tap and hold a message and copy text. the app will crash (the copy will save in clipboard though)
pa...@etnetera.cz <pa...@etnetera.cz> #7
I have the same problem, I have an app that starts observing clipboard and since I updated to 4.3 that app crashes with similar exception to this from the first post (android.permission.UPDATE_APP_OPS_STATS)
then every other app that tries to copy something crashes with this exception:
W/dalvikvm(5446): threadid=1: thread exiting with uncaught exception (group=0x419c0700)
W/clipboard(431): Exception:
W/clipboard(431): java.lang.IllegalStateException: beginBroadcast() called while already in a broadcast
W/clipboard(431): at android.os.RemoteCallbackList.beginBroadcast(RemoteCallbackList.java:229)
W/clipboard(431): at com.android.server.ClipboardService.setPrimaryClip(ClipboardService.java:165)
W/clipboard(431): at android.content.IClipboard$Stub.onTransact(IClipboard.java:62)
W/clipboard(431): at com.android.server.ClipboardService.onTransact(ClipboardService.java:123)
W/clipboard(431): at android.os.Binder.execTransact(Binder.java:388)
W/clipboard(431): at dalvik.system.NativeStart.run(Native Method)
E/AndroidRuntime(5446): FATAL EXCEPTION: main
E/AndroidRuntime(5446): java.lang.IllegalStateException: beginBroadcast() called while already in a broadcast
E/AndroidRuntime(5446): at android.os.Parcel.readException(Parcel.java:1439)
E/AndroidRuntime(5446): at android.os.Parcel.readException(Parcel.java:1385)
E/AndroidRuntime(5446): at android.content.IClipboard$Stub$Proxy.setPrimaryClip(IClipboard.java:171)
E/AndroidRuntime(5446): at android.content.ClipboardManager.setPrimaryClip(ClipboardManager.java:125)
E/AndroidRuntime(5446): at android.content.ClipboardManager.setText(ClipboardManager.java:208)
E/AndroidRuntime(5446): at com.google.android.apps.authenticator.AuthenticatorActivity.onContextItemSelected(AuthenticatorActivity.java:927)
E/AndroidRuntime(5446): at com.google.android.apps.authenticator.AuthenticatorActivity.access$200(AuthenticatorActivity.java:73)
E/AndroidRuntime(5446): at com.google.android.apps.authenticator.AuthenticatorActivity$3.onActionItemClicked(AuthenticatorActivity.java:353)
E/AndroidRuntime(5446): at android.widget.AbsListView$MultiChoiceModeWrapper.onActionItemClicked(AbsListView.java:6058)
E/AndroidRuntime(5446): at com.android.internal.policy.impl.PhoneWindow$DecorView$ActionModeCallbackWrapper.onActionItemClicked(PhoneWindow.java:2569)
E/AndroidRuntime(5446): at com.android.internal.app.ActionBarImpl$ActionModeImpl.onMenuItemSelected(ActionBarImpl.java:962)
E/AndroidRuntime(5446): at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
E/AndroidRuntime(5446): at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)
E/AndroidRuntime(5446): at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
E/AndroidRuntime(5446): at com.android.internal.view.menu.ActionMenuView.invokeItem(ActionMenuView.java:547)
E/AndroidRuntime(5446): at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:115)
E/AndroidRuntime(5446): at android.view.View.performClick(View.java:4240)
E/AndroidRuntime(5446): at android.view.View$PerformClick.run(View.java:17721)
E/AndroidRuntime(5446): at android.os.Handler.handleCallback(Handler.java:730)
E/AndroidRuntime(5446): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime(5446): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(5446): at android.app.ActivityThread.main(ActivityThread.java:5103)
E/AndroidRuntime(5446): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(5446): at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime(5446): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E/AndroidRuntime(5446): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime(5446): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager(431): Force finishing activity com.google.android.apps.authenticator2/com.google.android.apps.authenticator.AuthenticatorActivity
or similar. Once I disabled clipboard monitoring app and rebooted Nexus 7 the copying worked for sometime.
then every other app that tries to copy something crashes with this exception:
W/dalvikvm(5446): threadid=1: thread exiting with uncaught exception (group=0x419c0700)
W/clipboard(431): Exception:
W/clipboard(431): java.lang.IllegalStateException: beginBroadcast() called while already in a broadcast
W/clipboard(431): at android.os.RemoteCallbackList.beginBroadcast(RemoteCallbackList.java:229)
W/clipboard(431): at com.android.server.ClipboardService.setPrimaryClip(ClipboardService.java:165)
W/clipboard(431): at android.content.IClipboard$Stub.onTransact(IClipboard.java:62)
W/clipboard(431): at com.android.server.ClipboardService.onTransact(ClipboardService.java:123)
W/clipboard(431): at android.os.Binder.execTransact(Binder.java:388)
W/clipboard(431): at dalvik.system.NativeStart.run(Native Method)
E/AndroidRuntime(5446): FATAL EXCEPTION: main
E/AndroidRuntime(5446): java.lang.IllegalStateException: beginBroadcast() called while already in a broadcast
E/AndroidRuntime(5446): at android.os.Parcel.readException(Parcel.java:1439)
E/AndroidRuntime(5446): at android.os.Parcel.readException(Parcel.java:1385)
E/AndroidRuntime(5446): at android.content.IClipboard$Stub$Proxy.setPrimaryClip(IClipboard.java:171)
E/AndroidRuntime(5446): at android.content.ClipboardManager.setPrimaryClip(ClipboardManager.java:125)
E/AndroidRuntime(5446): at android.content.ClipboardManager.setText(ClipboardManager.java:208)
E/AndroidRuntime(5446): at com.google.android.apps.authenticator.AuthenticatorActivity.onContextItemSelected(AuthenticatorActivity.java:927)
E/AndroidRuntime(5446): at com.google.android.apps.authenticator.AuthenticatorActivity.access$200(AuthenticatorActivity.java:73)
E/AndroidRuntime(5446): at com.google.android.apps.authenticator.AuthenticatorActivity$3.onActionItemClicked(AuthenticatorActivity.java:353)
E/AndroidRuntime(5446): at android.widget.AbsListView$MultiChoiceModeWrapper.onActionItemClicked(AbsListView.java:6058)
E/AndroidRuntime(5446): at com.android.internal.policy.impl.PhoneWindow$DecorView$ActionModeCallbackWrapper.onActionItemClicked(PhoneWindow.java:2569)
E/AndroidRuntime(5446): at com.android.internal.app.ActionBarImpl$ActionModeImpl.onMenuItemSelected(ActionBarImpl.java:962)
E/AndroidRuntime(5446): at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
E/AndroidRuntime(5446): at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)
E/AndroidRuntime(5446): at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
E/AndroidRuntime(5446): at com.android.internal.view.menu.ActionMenuView.invokeItem(ActionMenuView.java:547)
E/AndroidRuntime(5446): at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:115)
E/AndroidRuntime(5446): at android.view.View.performClick(View.java:4240)
E/AndroidRuntime(5446): at android.view.View$PerformClick.run(View.java:17721)
E/AndroidRuntime(5446): at android.os.Handler.handleCallback(Handler.java:730)
E/AndroidRuntime(5446): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime(5446): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(5446): at android.app.ActivityThread.main(ActivityThread.java:5103)
E/AndroidRuntime(5446): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(5446): at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime(5446): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E/AndroidRuntime(5446): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime(5446): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager(431): Force finishing activity com.google.android.apps.authenticator2/com.google.android.apps.authenticator.AuthenticatorActivity
or similar. Once I disabled clipboard monitoring app and rebooted Nexus 7 the copying worked for sometime.
cr...@shou.tv <cr...@shou.tv> #9
Yes, It's happening to my NEXUS 4 also. Once you launch any app monitoring clipboard then copying in any app crashes the app.
[Deleted User] <[Deleted User]> #10
i've noticed that even if app crashes, copying still works and I can paste copied data. So I've changed code in my app to:
public static void setClipData(Context context, String text) {
try {
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("", text);
clipboard.setPrimaryClip(clip);
Toast.makeText(context.getApplicationContext(), R.string.url_copied, Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Toast.makeText(context.getApplicationContext(), R.string.url_copying_error, Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}
But copying from contextual action bar still crashes and observing clipboard doesn't work at all. I think this is because ofhttp://www.androidpolice.com/2013/07/25/app-ops-android-4-3s-hidden-app-permission-manager-control-permissions-for-individual-apps/ :)
public static void setClipData(Context context, String text) {
try {
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("", text);
clipboard.setPrimaryClip(clip);
Toast.makeText(context.getApplicationContext(), R.string.url_copied, Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Toast.makeText(context.getApplicationContext(), R.string.url_copying_error, Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}
But copying from contextual action bar still crashes and observing clipboard doesn't work at all. I think this is because of
[Deleted User] <[Deleted User]> #11
I face the same issue on my Galaxy Nexus. I have an app "Clipper" (clipboard manager) running in background. The moment some text is copied from any app, that particular app would crash. After uninstalling app "Clipper" (a clipboard manager), the crashes stopped. I had to reboot after uninstalling.
ma...@gmail.com <ma...@gmail.com> #12
Could someone *please* post complete steps to reproduce. This means either:
(1) Attaching a complete code project that can be built and run to cause the problem to happen, or
(2) A pointer to an app on the play store to install with steps to reproduce in that app.
Thanks.
(1) Attaching a complete code project that can be built and run to cause the problem to happen, or
(2) A pointer to an app on the play store to install with steps to reproduce in that app.
Thanks.
ba...@takeshifters.com <ba...@takeshifters.com> #13
Diana Install https://play.google.com/store/apps/details?id=org.rojekti.clipper set it to have it monitoring in the notifaction bar then try copying anything from anywhere ;)
wa...@google.com <wa...@google.com> #14
As I mentioned here[1], it happens on pretty much any app, Google's included, in example:
1. Open YouTube (I have version 4.5.17).
2. Open a video (any video).
3. Overflow menu > Copy URL
Same with GMail:
1. Open GMail (I have version 4.5.2-714156).
2. Open a conversation
3. Long press on text to action bar mode to appear
4. Tap on copy action
1.https://plus.google.com/103638111379552295023/posts/hZMgjN2qSUU
1. Open YouTube (I have version 4.5.17).
2. Open a video (any video).
3. Overflow menu > Copy URL
Same with GMail:
1. Open GMail (I have version 4.5.2-714156).
2. Open a conversation
3. Long press on text to action bar mode to appear
4. Tap on copy action
1.
al...@gmail.com <al...@gmail.com> #15
Diane,
I've attached a sample application. Like I mentioned before, it's just a blank activity that attaches a listener to the clipboard service.
Once you've built, installed and run this application and its activity, simply open any other application and copy something. For example, open Google Search, type anything in the search bar, copy it and a crash will occur.
The important part here is that the copying must occur in _another application_ separate from the listener. This causes the uid mismatch in AppOpsService's verifyIncomingUid and throws an exception.
Alternatively, install the Clipper application linked in #13, complete the tutorial so that it registers a listener, and copy from any other application. A crash will occur.
I've attached a sample application. Like I mentioned before, it's just a blank activity that attaches a listener to the clipboard service.
Once you've built, installed and run this application and its activity, simply open any other application and copy something. For example, open Google Search, type anything in the search bar, copy it and a crash will occur.
The important part here is that the copying must occur in _another application_ separate from the listener. This causes the uid mismatch in AppOpsService's verifyIncomingUid and throws an exception.
Alternatively, install the Clipper application linked in #13, complete the tutorial so that it registers a listener, and copy from any other application. A crash will occur.
ma...@gmail.com <ma...@gmail.com> #16
[Comment deleted]
ma...@gmail.com <ma...@gmail.com> #17
indeed, it does! please make some noise in bug 36949180
wa...@gmail.com <wa...@gmail.com> #18
Basically it happens with any app monitoring clipboard. 100% reproducible and very much easy to repro.
1) installhttps://play.google.com/store/apps/details?id=net.daum.android.dictionary
2) launch the app
3) launch or switch to other app(Chrome, Gmail, ''') which has texts can be copied to clipboard
4) copy text then the app crashes.
1) install
2) launch the app
3) launch or switch to other app(Chrome, Gmail, ''') which has texts can be copied to clipboard
4) copy text then the app crashes.
lb...@gmail.com <lb...@gmail.com> #19
Thanks for the help in reproducing! We now have a fix.
sm...@gmail.com <sm...@gmail.com> #20
I am also having this issue on the n
New Nexus 7 (2013)
New Nexus 7 (2013)
de...@gmail.com <de...@gmail.com> #21
Can confirm that my Nexus 7 2013 has this bug. Every time I copy the app being copied from crashes. Google or non-violent, makes no difference.
li...@gmail.com <li...@gmail.com> #22
I am also having this issue on my Nexus 4 after the 4.3 update. I use the clipboard very often, the only way I find to solve the issue is to do a factory reset (Settings -> Backup & Reset -> Factory data reset)
ku...@gmail.com <ku...@gmail.com> #23
Folks, there is no need to comment further. :) This bug has been marked as fixed, as noted.
lb...@gmail.com <lb...@gmail.com> #24
Not fixed on my Nexus 7 2013. Where is the note?
ok...@gmail.com <ok...@gmail.com> #25
The bug may be fixed on some internal development version of Android, but in reality there are tens of thousands of affected devices out there right now. I am starting to get bad ratings over this bug and the clipboard is rendered unusable for many people.
When can we expect device updates to correct the issue? Are we talking about days, weeks or months? Will other device manufacturers ship the same broken code with their own updates?
When can we expect device updates to correct the issue? Are we talking about days, weeks or months? Will other device manufacturers ship the same broken code with their own updates?
ma...@gmail.com <ma...@gmail.com> #26
Still experiencing this bug.
is...@google.com <is...@google.com>
su...@gmail.com <su...@gmail.com> #27
Bug still happening on my nexus 10.
ad...@google.com <ad...@google.com> #28
I have the same problem. Apps (Chrome, GMail, Phone) crashes after copying text. But after crash the text still in clipboard, and I can paste it. Nexus 4.
mu...@gmail.com <mu...@gmail.com> #29
Still happening on my Nexus 7
ra...@google.com <ra...@google.com> #30
Could someone shut down comments on this, please? :)
It's been marked as fixed, just not released yet.
It's been marked as fixed, just not released yet.
Description
Further, on a phone, an app can open this Settings window for the user (to grant the permission) by calling
startActivity(new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION));
This call will fail on Android Wear (the intent doesn't resolve), indicating that the Settings window in question does not exist.