Skip to content

Commit 1174f5c

Browse files
GeolocationProfileをFusedLocationを使用するように修正。
1 parent e286564 commit 1174f5c

4 files changed

Lines changed: 156 additions & 134 deletions

File tree

dConnectDevicePlugin/dConnectDeviceHost/app/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ dependencies {
100100
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.2.0'
101101
implementation 'androidx.lifecycle:lifecycle-livedata:2.2.0'
102102
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
103+
implementation 'com.google.android.gms:play-services-location:18.0.0'
104+
implementation 'com.google.android.gms:play-services-maps:17.0.1'
103105
implementation 'com.github.pedroSG94.rtmp-rtsp-stream-client-java:rtplibrary:1.9.7'
104106
implementation 'org.deviceconnect:dconnect-device-plugin-sdk:2.8.6'
105107
implementation 'org.deviceconnect:dconnect-demo-lib:1.0.1'

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@
124124
<!-- プラグイン本体サービス -->
125125
<service
126126
android:name=".HostDevicePlugin"
127-
android:exported="true">
127+
android:exported="true"
128+
129+
android:foregroundServiceType="location">
128130
<meta-data
129131
android:name="org.deviceconnect.android.deviceplugin"
130132
android:resource="@xml/org_deviceconnect_android_deviceplugin_host" />

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ public void onCreate(Bundle savedInstanceState) {
5454
android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
5555
try {
5656
startActivity(callGPSSettingIntent);
57+
if (mResponse != null) {
58+
MessageUtils.setIllegalDeviceStateError(mResponse,
59+
"Please retry running Geolocation.");
60+
getBaseContext().sendBroadcast(mResponse);
61+
}
62+
5763
} catch (ActivityNotFoundException e) {
5864
if (mResponse != null) {
5965
MessageUtils.setIllegalDeviceStateError(mResponse,

0 commit comments

Comments
 (0)