Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Network
KDE Connect Android
Commits
2a61f431
Commit
2a61f431
authored
Mar 27, 2019
by
Nicolas Fella
Browse files
Use more runwithplugin
parent
8b5734db
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisActivity.java
View file @
2a61f431
...
...
@@ -81,14 +81,7 @@ public class MprisActivity extends AppCompatActivity {
private
void
connectToPlugin
(
final
String
targetPlayerName
)
{
BackgroundService
.
RunCommand
(
this
,
service
->
{
final
Device
device
=
service
.
getDevice
(
deviceId
);
final
MprisPlugin
mpris
=
device
.
getPlugin
(
MprisPlugin
.
class
);
if
(
mpris
==
null
)
{
Log
.
e
(
"MprisActivity"
,
"device has no mpris plugin!"
);
return
;
}
BackgroundService
.
RunWithPlugin
(
this
,
deviceId
,
MprisPlugin
.
class
,
mpris
->
{
targetPlayer
=
mpris
.
getPlayerStatus
(
targetPlayerName
);
addSytemvolumeFragment
();
...
...
@@ -172,7 +165,6 @@ public class MprisActivity extends AppCompatActivity {
});
});
}
private
void
addSytemvolumeFragment
()
{
...
...
src/org/kde/kdeconnect/Plugins/SharePlugin/ShareBroadcastReceiver.java
View file @
2a61f431
...
...
@@ -49,9 +49,6 @@ public class ShareBroadcastReceiver extends BroadcastReceiver {
long
jobId
=
intent
.
getLongExtra
(
SharePlugin
.
CANCEL_SHARE_BACKGROUND_JOB_ID_EXTRA
,
-
1
);
String
deviceId
=
intent
.
getStringExtra
(
SharePlugin
.
CANCEL_SHARE_DEVICE_ID_EXTRA
);
BackgroundService
.
RunCommand
(
context
,
service
->
{
SharePlugin
plugin
=
service
.
getDevice
(
deviceId
).
getPlugin
(
SharePlugin
.
class
);
plugin
.
cancelJob
(
jobId
);
});
BackgroundService
.
RunWithPlugin
(
context
,
deviceId
,
SharePlugin
.
class
,
plugin
->
plugin
.
cancelJob
(
jobId
));
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment