mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-02 07:05:09 +00:00
[plugins/photo] Send cancel packet when user aborts camera
This commit is contained in:
@@ -64,6 +64,8 @@ public class PhotoActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (resultCode == -1) {
|
if (resultCode == -1) {
|
||||||
plugin.sendPhoto(photoURI);
|
plugin.sendPhoto(photoURI);
|
||||||
|
} else {
|
||||||
|
plugin.sendCancel();
|
||||||
}
|
}
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
@@ -88,4 +88,10 @@ public class PhotoPlugin extends Plugin {
|
|||||||
public Drawable getIcon() {
|
public Drawable getIcon() {
|
||||||
return ContextCompat.getDrawable(context, R.drawable.ic_camera);
|
return ContextCompat.getDrawable(context, R.drawable.ic_camera);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sendCancel() {
|
||||||
|
NetworkPacket np = new NetworkPacket(PACKET_TYPE_PHOTO);
|
||||||
|
np.set("cancel", true);
|
||||||
|
device.sendPacket(np);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user