mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-31 14:15:14 +00:00
Check for different format of logcat line for Android 15 and up when detecting a failed clipboard access in logs
After upgrading to Android 15 I noticed the automatic clipboard push from Android stopped working, debugging it, figured out that it looks like the format of lines in the logcat has changed, this patch got it working again.
This commit is contained in:
committed by
Simon Redman
parent
d4b8a07ee7
commit
938df620fa
@@ -75,7 +75,13 @@ public class ClipboardListener {
|
||||
try {
|
||||
String timeStamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.US).format(new Date());
|
||||
// Listen only ClipboardService errors after now
|
||||
Process process = Runtime.getRuntime().exec(new String[]{"logcat", "-T", timeStamp, "ClipboardService:E", "*:S"});
|
||||
String logcatFilter;
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.VANILLA_ICE_CREAM) {
|
||||
logcatFilter = "E ClipboardService";
|
||||
} else {
|
||||
logcatFilter = "ClipboardService:E";
|
||||
}
|
||||
Process process = Runtime.getRuntime().exec(new String[]{"logcat", "-T", timeStamp, logcatFilter, "*:S"});
|
||||
BufferedReader bufferedReader = new BufferedReader(
|
||||
new InputStreamReader(
|
||||
process.getInputStream()
|
||||
|
Reference in New Issue
Block a user