Skip to content

Commit be91215

Browse files
Merge pull request #545 from TakayukiHoshi1984/feature_host_camera
HostプラグインのRecorder周りの修正
2 parents 7fa38ba + 590f917 commit be91215

90 files changed

Lines changed: 1965 additions & 2636 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dConnectDevicePlugin/dConnectDeviceHost/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ dependencies {
103103
implementation 'com.github.pedroSG94.rtmp-rtsp-stream-client-java:rtplibrary:1.9.7'
104104
implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.6'
105105
implementation 'org.deviceconnect:dconnect-demo-lib:1.0.1'
106-
implementation 'org.deviceconnect:libmedia:1.2.0'
107-
implementation 'org.deviceconnect:libsrt:1.2.0'
106+
implementation 'org.deviceconnect:libmedia:1.2.2'
107+
implementation 'org.deviceconnect:libsrt:1.2.2'
108108
// implementation project(':libmedia')
109109
// implementation project(':libsrt')
110110
}

dConnectDevicePlugin/dConnectDeviceHost/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,23 @@
6262
android:exported="false"
6363
android:launchMode="singleInstance"
6464
android:taskAffinity=".canvas"
65-
android:theme="@style/AppCompatTheme" />
65+
android:theme="@style/AppCompatTheme.NoActionBar" />
6666

6767
<activity
6868
android:name="org.deviceconnect.android.deviceplugin.host.activity.profile.TouchProfileActivity"
6969
android:excludeFromRecents="true"
7070
android:exported="false"
7171
android:launchMode="singleInstance"
7272
android:taskAffinity=".touch"
73-
android:theme="@style/AppCompatTheme" />
73+
android:theme="@style/AppCompatTheme.NoActionBar" />
7474

7575
<activity
7676
android:name="org.deviceconnect.android.deviceplugin.host.activity.profile.KeyEventProfileActivity"
7777
android:excludeFromRecents="true"
7878
android:exported="false"
7979
android:launchMode="singleInstance"
8080
android:taskAffinity=".keyevent"
81-
android:theme="@style/AppCompatTheme" />
81+
android:theme="@style/AppCompatTheme.NoActionBar" />
8282

8383
<!-- パーミッション要求画面 -->
8484

dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/activity/HostDevicePluginBindActivity.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ public void onCreate(Bundle savedInstanceState) {
4444
@Override
4545
public void onResume() {
4646
super.onResume();
47-
48-
if (isManagerStarted()) {
49-
bindService();
50-
}
47+
bindService();
5148
}
5249

5350
@Override
@@ -75,7 +72,7 @@ public boolean isManagerStarted() {
7572
ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
7673
for (ActivityManager.RunningServiceInfo serviceInfo : manager.getRunningServices(Integer.MAX_VALUE)) {
7774
if ("org.deviceconnect.android.manager".equals(serviceInfo.service.getPackageName())) {
78-
return true;
75+
return serviceInfo.started;
7976
}
8077
}
8178
return false;

dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/activity/fragment/HostDevicePluginBindFragment.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,20 @@ public void showToast(int resId) {
113113
});
114114
}
115115

116+
/**
117+
* トーストを表示します.
118+
*
119+
* @param message メッセージ
120+
*/
121+
public void showToast(String message) {
122+
runOnUiThread(() -> {
123+
Context context = getContext();
124+
if (context != null) {
125+
Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
126+
}
127+
});
128+
}
129+
116130
/**
117131
* UI スレッドで Runnable を実行します.
118132
*

dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/activity/fragment/HostDevicePluginBindPreferenceFragment.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616

1717
import org.deviceconnect.android.deviceplugin.host.HostDevicePlugin;
1818
import org.deviceconnect.android.deviceplugin.host.activity.HostDevicePluginBindActivity;
19-
import org.deviceconnect.android.deviceplugin.host.activity.recorder.camera.CameraActivity;
2019

21-
public abstract class HostDevicePluginBindPreferenceFragment extends PreferenceFragmentCompat implements CameraActivity.OnHostDevicePluginListener {
20+
public abstract class HostDevicePluginBindPreferenceFragment extends PreferenceFragmentCompat implements HostDevicePluginBindActivity.OnHostDevicePluginListener {
2221

2322
private final Handler mUIHandler = new Handler(Looper.getMainLooper());
2423

dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/activity/profile/CanvasProfileActivity.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,22 +153,21 @@ protected void onCreate(final Bundle savedInstanceState) {
153153
@Override
154154
protected void onResume() {
155155
super.onResume();
156-
157156
mForegroundFlag = true;
158157

159-
IntentFilter filter = new IntentFilter();
160-
filter.addAction(CanvasDrawImageObject.ACTION_DRAW_CANVAS);
161-
filter.addAction(CanvasDrawImageObject.ACTION_DELETE_CANVAS);
162-
LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, filter);
163-
164-
refreshImage(mIntent);
165-
166158
if (mDownloadThread != null) {
167159
mDownloadThread.terminate();
168160
}
169161
mDownloadThread = new DownloadThread();
170162
mDownloadThread.setName("Canvas-Download-Thread");
171163
mDownloadThread.start();
164+
165+
refreshImage(mIntent);
166+
167+
IntentFilter filter = new IntentFilter();
168+
filter.addAction(CanvasDrawImageObject.ACTION_DRAW_CANVAS);
169+
filter.addAction(CanvasDrawImageObject.ACTION_DELETE_CANVAS);
170+
LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, filter);
172171
}
173172

174173
@Override

dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/activity/recorder/camera/CameraActivity.java

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)