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:
parent
ea72327abe
commit
6da339028d
@ -64,6 +64,8 @@ public class PhotoActivity extends AppCompatActivity {
|
||||
|
||||
if (resultCode == -1) {
|
||||
plugin.sendPhoto(photoURI);
|
||||
} else {
|
||||
plugin.sendCancel();
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user