Skip to content

Commit 2ddc482

Browse files
Android10でChromeからGeolocationAPIが操作できない
## 修正内容 * Android10でChromeからGeolocationAPIが操作できない
1 parent ccf1261 commit 2ddc482

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
2424
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
2525
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
26-
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
26+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
27+
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
2728
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
2829
<uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT" />
2930

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ public String getAttribute() {
7878
@Override
7979
public boolean onRequest(final Intent request, final Intent response) {
8080
PermissionUtility.requestPermissions(getContext(),
81-
new Handler(Looper.getMainLooper()), new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},
81+
new Handler(Looper.getMainLooper()), new String[]{Manifest.permission.ACCESS_FINE_LOCATION,
82+
Manifest.permission.ACCESS_COARSE_LOCATION,
83+
Manifest.permission.ACCESS_BACKGROUND_LOCATION},
8284
new PermissionUtility.PermissionRequestCallback() {
8385
@Override
8486
public void onSuccess() {
@@ -116,7 +118,9 @@ public String getAttribute() {
116118
@Override
117119
public boolean onRequest(final Intent request, final Intent response) {
118120
PermissionUtility.requestPermissions(getContext(),
119-
new Handler(Looper.getMainLooper()), new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},
121+
new Handler(Looper.getMainLooper()), new String[]{Manifest.permission.ACCESS_FINE_LOCATION,
122+
Manifest.permission.ACCESS_COARSE_LOCATION,
123+
Manifest.permission.ACCESS_BACKGROUND_LOCATION},
120124
new PermissionUtility.PermissionRequestCallback() {
121125
@Override
122126
public void onSuccess() {
@@ -159,7 +163,9 @@ public String getAttribute() {
159163
@Override
160164
public boolean onRequest(final Intent request, final Intent response) {
161165
PermissionUtility.requestPermissions(getContext(),
162-
new Handler(Looper.getMainLooper()), new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},
166+
new Handler(Looper.getMainLooper()), new String[]{Manifest.permission.ACCESS_FINE_LOCATION,
167+
Manifest.permission.ACCESS_COARSE_LOCATION,
168+
Manifest.permission.ACCESS_BACKGROUND_LOCATION},
163169
new PermissionUtility.PermissionRequestCallback() {
164170
@Override
165171
public void onSuccess() {

0 commit comments

Comments
 (0)