2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-29 05:07:40 +00:00

[plugins/photo] Send cancel packet when user aborts camera

This commit is contained in:
Nicolas Fella 2019-07-20 14:04:34 +00:00
parent ea72327abe
commit 6da339028d
2 changed files with 8 additions and 0 deletions

View File

@ -64,6 +64,8 @@ public class PhotoActivity extends AppCompatActivity {
if (resultCode == -1) {
plugin.sendPhoto(photoURI);
} else {
plugin.sendCancel();
}
finish();
}

View File

@ -88,4 +88,10 @@ public class PhotoPlugin extends Plugin {
public Drawable getIcon() {
return ContextCompat.getDrawable(context, R.drawable.ic_camera);
}
void sendCancel() {
NetworkPacket np = new NetworkPacket(PACKET_TYPE_PHOTO);
np.set("cancel", true);
device.sendPacket(np);
}
}