Fixed
Status Update
Comments
ar...@google.com <ar...@google.com> #2
I've found this code fragment in the newest API 23 SDK's source code
WifiServiceImpl.java Line964
if (!canReadPeerMacAddresses && !isActiveNetworkScorer && !isLocationEnabled()) {
return new ArrayList<ScanResult>();
}
It could explain this issue.The method "isLocationEnabled" read Location settings then returns false at this condition, and getScanResults returns null.
WifiServiceImpl.java Line964
if (!canReadPeerMacAddresses && !isActiveNetworkScorer && !isLocationEnabled()) {
return new ArrayList<ScanResult>();
}
It could explain this issue.The method "isLocationEnabled" read Location settings then returns false at this condition, and getScanResults returns null.
ma...@tomtom.com <ma...@tomtom.com> #3
Thank you for your comment.
getScanResults() returns current results on Lollipop and older even if GPS is disabled.
Scan results should have no relation to GPS.
getScanResults() returns current results on Lollipop and older even if GPS is disabled.
Scan results should have no relation to GPS.
ar...@google.com <ar...@google.com> #4
I had confirmed the same with Nexus 5 Preview 3 (build num.: MPA44G).
ma...@tomtom.com <ma...@tomtom.com> #5
This is affecting App which need scanned wifi networks but not necessarily want GPS enabled. And by enabling GPS it is gonna drain the battery faster. Which may result in inefficient user experience..
Why location service is mandated now. Is google collecting geo location along with wifi networks for other project?
Why location service is mandated now. Is google collecting geo location along with wifi networks for other project?
ar...@google.com <ar...@google.com> #6
I also asked this problem on M-preview issue tracker.
On MRA58K, we still have to enable GPS to get ScanResults.
https://code.google.com/p/android-developer-preview/issues/detail?id=3163
For typical android users, it is may be quite difficult to find relation between Wi-Fi scanning and location settings.
ScanResults should be available if location permission is granted.
On MRA58K, we still have to enable GPS to get ScanResults.
For typical android users, it is may be quite difficult to find relation between Wi-Fi scanning and location settings.
ScanResults should be available if location permission is granted.
ar...@google.com <ar...@google.com>
nk...@google.com <nk...@google.com>
nk...@google.com <nk...@google.com> #7
Thanks for the suggestion. Our development team has looked into this bug and decided that it is working as per the design.
WifiManager#getScanResults() returns an empty list if location is turned off for the device.
WifiManager#getScanResults() returns an empty list if location is turned off for the device.
nk...@google.com <nk...@google.com> #8
Let me know the reason why it returns an empty list if GPS disabled.
It seems like degrading.
It seems like degrading.
nk...@google.com <nk...@google.com> #9
Also could you please mention this in documentation, currently it just mentions APP must have ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission.
It doesn't mention Location must be turned on to get network list.
http://developer.android.com/reference/android/net/wifi/WifiManager.html#getScanResults()
It doesn't mention Location must be turned on to get network list.
ma...@tomtom.com <ma...@tomtom.com> #10
Any alternative method to get Wifi SSID's available for connection without switching on location
My application needs to connect to a specific wifi network in the background .
My application needs to connect to a specific wifi network in the background .
Description
E/TestExecutor: Fatal exception when running tests
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/app/DialogFragment;
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:400)
at android.support.test.internal.runner.TestLoader.doCreateRunner(TestLoader.java:76)
at android.support.test.internal.runner.TestLoader.getRunnersFor(TestLoader.java:104)
at android.support.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:808)
at android.support.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:481)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:367)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1962)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.app.DialogFragment" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.extension.runnercrashapp.test-2/base.apk"],nativeLibraryDirectories=[/data/app/com.extension.runnercrashapp.test-2/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:400)
at android.support.test.internal.runner.TestLoader.doCreateRunner(TestLoader.java:76)
at android.support.test.internal.runner.TestLoader.getRunnersFor(TestLoader.java:104)
at android.support.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:808)
at android.support.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:481)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:367)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1962)
it happens only if module from gradle dependency is excluded, for example:
implementation ("com.google.android.gms:play-services-analytics:11.0.4") {
exclude group: 'com.android.support', module: 'support-v4'
}
Tested on devices with Android 5 and 7.
With version 0.5 of com.android.support.test:runner it wasn't happening.
To reproduce, run android tests from android studio or gradle connectedCheck
Small example project is available here: