The ClipboardManager is instantiated by the first call to
ServiceManager.getClipboardManager().
Now that scrcpy uses android.content.ClipboardManager directly, it must
ensure that it is created on the main thread (or at least on a thread
with a Looper), to avoid the following error:
> Can't create handler inside thread that has not called
> Looper.prepare()
Refs 8a02e3c2f5Fixes#6151 <https://github.com/Genymobile/scrcpy/issues/6151>
Since a main looper is explicitly run in the main process, the
initialization of workarounds no longer calls
Looper.prepareMainLooper(), leading to a crash:
java.lang.RuntimeException: Can't create handler inside thread
Thread[main,5,main] that has not called Looper.prepare()
As a result, --power-off-on-close was broken.
Refs 283326b2f6Fixes#6146 <https://github.com/Genymobile/scrcpy/issues/6146>
Some devices require a specific option to be enabled in Developer
Options to avoid a permission issue when injecting input events.
When this error occurs, hide the stack trace and print a human-readable
message explaining how to fix the issue.
PR #6080 <https://github.com/Genymobile/scrcpy/pull/6080>
Although "licence" is correct in British English, the rest of the
statement uses "license," so change it for consistency.
PR #6017 <https://github.com/Genymobile/scrcpy/pull/6017>
Signed-off-by: Romain Vimont <rom@rom1v.com>
Since #5804, controls have been enabled even with --no-window. As a
result, the Android clipboard is synchronized with the computer, causing
SDL to trigger an SDL_CLIPBOARDUPDATE event.
This event is ignored by scrcpy, but it was still transmitted to the
sc_screen instance, even if it had not been initialized.
Fix the issue by calling sc_screen_handle_event() only when a screen
instance exists.
Refs #5804 <https://github.com/Genymobile/scrcpy/pull/5804>
Fixes#5970 <https://github.com/Genymobile/scrcpy/issues/5970>
Store the target audio source integer (one of the constants from
android.media.MediaRecorder.AudioSource) in the AudioSource enum (or -1
if not relevant).
This will simplify adding new audio sources.
PR #5870 <https://github.com/Genymobile/scrcpy/pull/5870>
The audio regulator assumed a continuous audio stream. But some audio
sources (like the "voice call" audio source) do not produce any packets
on silence, breaking this assumption.
Use PTS to detect such discontinuities.
PR #5870 <https://github.com/Genymobile/scrcpy/pull/5870>
The default OPUS and FLAC encoders on Android rewrite the input PTS so
that they exactly match the number of samples.
As a consequence:
- audio clock drift is not compensated
- implicit silences (without packets) are ignored
To work around this behavior, generate new PTS based on the current time
(after encoding) and the packet duration.
PR #5870 <https://github.com/Genymobile/scrcpy/pull/5870>
Add an option to select where the IME should be displayed.
Possible values are "local", "fallback" and "hide".
PR #5703 <https://github.com/Genymobile/scrcpy/pull/5703>
Signed-off-by: Romain Vimont <rom@rom1v.com>