OSDN Git Service

Nikon対応の開始。
[gokigen/PKRemote.git] / app / src / main / java / net / osdn / gokigen / pkremote / camera / vendor / ptpip / wrapper / connection / NikonCameraDisconnectSequence.java
1 package net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.connection;
2
3 import android.app.Activity;
4
5 import androidx.annotation.NonNull;
6
7 import net.osdn.gokigen.pkremote.camera.vendor.nikon.INikonInterfaceProvider;
8 import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.IPtpIpCommunication;
9
10
11 class NikonCameraDisconnectSequence implements Runnable
12 {
13     private final String TAG = this.toString();
14     private final Activity activity;
15     private final IPtpIpCommunication command;
16     private final IPtpIpCommunication async;
17     private final IPtpIpCommunication liveview;
18
19     NikonCameraDisconnectSequence(Activity activity, @NonNull INikonInterfaceProvider interfaceProvider)
20     {
21         this.activity = activity;
22         this.command = interfaceProvider.getCommandCommunication();
23         this.async = interfaceProvider.getAsyncEventCommunication();
24         this.liveview = interfaceProvider.getLiveviewCommunication();
25     }
26
27     @Override
28     public void run()
29     {
30         try
31         {
32             liveview.disconnect();
33             async.disconnect();
34             command.disconnect();
35         }
36         catch (Exception e)
37         {
38             e.printStackTrace();
39         }
40     }
41 }