Coder Social home page Coder Social logo

Comments (3)

Naturalclar avatar Naturalclar commented on May 27, 2024 3

@fonov thanks for raising the issue!
the issue seems to be related to the privacy change in Android 10
https://developer.android.com/about/versions/10/privacy/changes#clipboard-data
I'll look further into a possible workaround on this

from clipboard.

joelfernandes19 avatar joelfernandes19 commented on May 27, 2024

@Naturalclar Facing the same issue, and it's throwing security exception on another app that is trying to read clipboard data when my app (which is in focus) is calling setPrimaryClip. Unable to reproduce the issue though. Is there any workaround you found for this?

from clipboard.

outofmemory avatar outofmemory commented on May 27, 2024

APP A: foreground app
APP B: background app which setup 'addPrimaryClipChangedListener'

  1. APP A calls setPrimaryClipboard.
  2. then ClipboardService will broadcast the event to PrimaryClipChangedListener (e.g. APP B) and will also make a call to AppOpsManager.noteOp to inform about READ_CLIPBOARD operation.
  3. If the listener(APP B) is not allowed to READ_CLIPBOARD, AppOpsManager.noteOp will throw a SecurityException and will crash the foreground app(APP A).
  4. and the clipboard is set successful

HOW TO REPRODUCE:
we can disable READ_CLIPBOARD permission manually for reproducing

HOW TO DISABLE READ_CLIPBOARD:
step 1: connect adb
step 2: adb shell
step 3: cmd appops set app.package.name READ_CLIPBOARD deny

from clipboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.