mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-31 22:25:08 +00:00
Compare commits
1 Commits
master
...
work/remov
Author | SHA1 | Date | |
---|---|---|---|
|
8eac1d7f6b |
@@ -100,7 +100,7 @@ public class SystemVolumeFragment
|
||||
}
|
||||
this.plugin = plugin;
|
||||
plugin.addSinkListener(SystemVolumeFragment.this);
|
||||
plugin.requestSinkList();
|
||||
sinksChanged();
|
||||
}
|
||||
|
||||
private void disconnectFromPlugin(final String deviceId) {
|
||||
|
@@ -113,12 +113,6 @@ public class SystemVolumePlugin extends Plugin {
|
||||
getDevice().sendPacket(np);
|
||||
}
|
||||
|
||||
void requestSinkList() {
|
||||
NetworkPacket np = new NetworkPacket(PACKET_TYPE_SYSTEMVOLUME_REQUEST);
|
||||
np.set("requestSinks", true);
|
||||
getDevice().sendPacket(np);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull String[] getSupportedPacketTypes() {
|
||||
return new String[]{PACKET_TYPE_SYSTEMVOLUME};
|
||||
|
@@ -155,21 +155,21 @@ class SystemVolumeProvider private constructor(plugin: SystemVolumePlugin) :
|
||||
return sink != null
|
||||
}
|
||||
|
||||
fun startListeningForSinks() {
|
||||
systemVolumePlugin.addSinkListener(this)
|
||||
systemVolumePlugin.requestSinkList()
|
||||
}
|
||||
|
||||
fun release() {
|
||||
stopListeningForSinks()
|
||||
stateListeners.clear()
|
||||
currentProvider = null
|
||||
}
|
||||
|
||||
private fun startListeningForSinks() {
|
||||
systemVolumePlugin.addSinkListener(this)
|
||||
sinksChanged();
|
||||
}
|
||||
|
||||
private fun stopListeningForSinks() {
|
||||
for (sink in systemVolumePlugin.sinks) {
|
||||
sink.removeListener(this)
|
||||
}
|
||||
systemVolumePlugin.removeSinkListener(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user