<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Android 10: need to toggle location permission to see BLE devices</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53938/android-10-need-to-toggle-location-permission-to-see-ble-devices</link><description>There are many one star reviews for nRF Toolbox on the Android Play Store (not from me!). These one star reviews are from users complaining that the application does not find any BLE devices. The answer from Nordic is that the locate permission needs</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 05 Nov 2019 16:58:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53938/android-10-need-to-toggle-location-permission-to-see-ble-devices" /><item><title>RE: Android 10: need to toggle location permission to see BLE devices</title><link>https://devzone.nordicsemi.com/thread/218660?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2019 16:58:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5973e49-ec98-4de0-9eb4-bb3a2dd9b826</guid><dc:creator>Bernard</dc:creator><description>&lt;p&gt;I not only have a point I also verified that changing the code does fix the issue! No toggling of the permission needed,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android 10: need to toggle location permission to see BLE devices</title><link>https://devzone.nordicsemi.com/thread/218424?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2019 07:46:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4828d015-ce2b-4452-b228-6acd24915216</guid><dc:creator>Roshan Rajaratnam</dc:creator><description>&lt;p&gt;Hi Bernard, you may have a point here, I see that it used to be ACCESS_COARSE_LOCATION&amp;nbsp; that was required for ble scanning. However the documentation seem to have been updated according to &lt;a href="https://developer.android.com/guide/topics/connectivity/bluetooth-le#permissions"&gt;this&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android 10: need to toggle location permission to see BLE devices</title><link>https://devzone.nordicsemi.com/thread/218391?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2019 02:05:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5c1e53b-0b3c-4adb-92e4-ad4497b64201</guid><dc:creator>Bernard</dc:creator><description>&lt;p&gt;As I was expecting the problem is really on the Nordic side. The problem is located in your scanner. If you look at:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicSemiconductor/Android-nRF-Toolbox/blob/master/app/src/main/java/no/nordicsemi/android/nrftoolbox/scanner/ScannerFragment.java"&gt;https://github.com/NordicSemiconductor/Android-nRF-Toolbox/blob/master/app/src/main/java/no/nordicsemi/android/nrftoolbox/scanner/ScannerFragment.java&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;at line 231 you have:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;	private void startScan() {
		// Since Android 6.0 we need to obtain either Manifest.permission.ACCESS_COARSE_LOCATION or Manifest.permission.ACCESS_FINE_LOCATION to be able to scan for
		// Bluetooth LE devices. This is related to beacons as proximity devices.
		// On API older than Marshmallow the following code does nothing.
		if (ContextCompat.checkSelfPermission(requireContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
			// When user pressed Deny and still wants to use this functionality, show the rationale
			if (ActivityCompat.shouldShowRequestPermissionRationale(requireActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) &amp;amp;&amp;amp; mPermissionRationale.getVisibility() == View.GONE) {
				mPermissionRationale.setVisibility(View.VISIBLE);
				return;
			}

			requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, REQUEST_PERMISSION_REQ_CODE);
			return;
		}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In order for Android 10 to detect BLE devices, the permission must be set to&amp;nbsp;ACCESS_FINE_LOCATION (and not ACCESS_COARSE_LOCATION). It is possible that toggling the permission in the Android setting set the permission to the Manifest value instead of what was requested at run time but that is a side effect, not a bug.&lt;/p&gt;
&lt;p&gt;If Nordic re-release the Toolbox with this change, it will make a lot of people happy (also send an apology to the Android/Google team for blaming them&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f609.svg" title="Wink"&gt;&amp;#x1f609;&lt;/span&gt;&amp;nbsp;!)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android 10: need to toggle location permission to see BLE devices</title><link>https://devzone.nordicsemi.com/thread/218224?ContentTypeID=1</link><pubDate>Mon, 04 Nov 2019 13:05:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc498bf6-c606-48e8-87bb-e102f35d09ee</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Bernard,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Is there a better explanation other than this is Android/Google fault?[/quote]
&lt;div&gt;&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;There is an issue on Android 10, where users have to manually go into app settings and disable and enable location permissions for it to work. They might have to do it a couple of times to get the apps working. This was an issue that popped right after users upgraded their devices to Android 10.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;What we believe is that the Android 10 upgrade did not restore the permissions granted to the apps properly.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Is there a programmatic solution to this problem?[/quote]
&lt;p&gt;&amp;nbsp;Unfortunately, No. We faced the same issue and the above fix is what we had to do.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>