Commit 6da33902 authored by Nicolas Fella's avatar Nicolas Fella

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

parent ea72327a
......@@ -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);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment