OSDN Git Service

とりあえず、Power Shot Zoomから画像をダウンロードできるところまで。
[gokigen/PKRemote.git] / app / src / main / java / net / osdn / gokigen / pkremote / camera / vendor / ptpip / wrapper / connection / CanonCameraDisconnectSequence.java
1 package net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.connection;
2
3 import android.app.Activity;
4 import android.util.Log;
5
6 import androidx.annotation.NonNull;
7
8 import net.osdn.gokigen.pkremote.camera.vendor.ptpip.IPtpIpInterfaceProvider;
9 import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.IPtpIpCommunication;
10
11
12 class CanonCameraDisconnectSequence implements Runnable
13 {
14     private final String TAG = this.toString();
15     private final Activity activity;
16     private final IPtpIpCommunication command;
17     private final IPtpIpCommunication async;
18     private final IPtpIpCommunication liveview;
19
20     CanonCameraDisconnectSequence(Activity activity, @NonNull IPtpIpInterfaceProvider interfaceProvider)
21     {
22         this.activity = activity;
23         this.command = interfaceProvider.getCommandCommunication();
24         this.async = interfaceProvider.getAsyncEventCommunication();
25         this.liveview = interfaceProvider.getLiveviewCommunication();
26     }
27
28     @Override
29     public void run()
30     {
31         try
32         {
33             Log.v(TAG, " disconnect");
34             liveview.disconnect();
35             async.disconnect();
36             command.disconnect();
37         }
38         catch (Exception e)
39         {
40             e.printStackTrace();
41         }
42     }
43 }