Bug P2
Status Update
Comments
sl...@google.com <sl...@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.
ze...@gmail.com <ze...@gmail.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.
ze...@gmail.com <ze...@gmail.com> #4
I had confirmed the same with Nexus 5 Preview 3 (build num.: MPA44G).
sl...@google.com <sl...@google.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?
ze...@gmail.com <ze...@gmail.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.
ta...@gmail.com <ta...@gmail.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.
sl...@google.com <sl...@google.com>
eg...@gmail.com <eg...@gmail.com> #8
Let me know the reason why it returns an empty list if GPS disabled.
It seems like degrading.
It seems like degrading.
be...@gmail.com <be...@gmail.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.
sl...@google.com <sl...@google.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 .
ri...@gmail.com <ri...@gmail.com> #11
I also was also suffering for more than 24 hours with the same contents. Cause look at this topic was found. However, it should not at all relevant to that thing and GPS to get a list of wifi has become ON. Is totally. I am pleased if you can explain why satisfactory.
fr...@gmail.com <fr...@gmail.com> #12
Why device of the Nexus 5 can obtain a list of the wi-fi location information even OFF?
[Deleted User] <[Deleted User]> #13
#12: confirmed, Nexus 5 hammerhead-mra58k.
Makes the "working as intended" seem fishy.
I have a small app for managing WiFi networks and it shows the list of scanned and known networks in its UI (just like the system WiFi app does), it has nothing to do with GPS, has the right permissions ("access WiFi state").
Are you saying that any app that wants scan for WiFi networks is now tied to location settings?
What's the relation to *GPS* or location, anyway?
Speaking of GPS, all my devices have GPS turned off, and WiFi on, just because I'm indoors most of the time (so as to not waste the battery) -- and I suspect a lot of users have it set up the same way.
Makes the "working as intended" seem fishy.
I have a small app for managing WiFi networks and it shows the list of scanned and known networks in its UI (just like the system WiFi app does), it has nothing to do with GPS, has the right permissions ("access WiFi state").
Are you saying that any app that wants scan for WiFi networks is now tied to location settings?
What's the relation to *GPS* or location, anyway?
Speaking of GPS, all my devices have GPS turned off, and WiFi on, just because I'm indoors most of the time (so as to not waste the battery) -- and I suspect a lot of users have it set up the same way.
nk...@google.com <nk...@google.com> #14
We have passed this on to the development team and will update this issue with more information as it becomes available.
dr...@gmail.com <dr...@gmail.com> #15
I tested on beta1 for ACCESS_FINE_LOCATION and it still does not work.
nk...@google.com <nk...@google.com>
vb...@gmail.com <vb...@gmail.com> #16
Same (difficult to diagnose) problem on 6.0 release.
My users want to use wifi scanning for location ('I'm at the office because I see my AP') because GPS is too battery draining, requiring GPS for wifi scanning is nonsensical in relation to that.
Pent
My users want to use wifi scanning for location ('I'm at the office because I see my AP') because GPS is too battery draining, requiring GPS for wifi scanning is nonsensical in relation to that.
Pent
lu...@gmail.com <lu...@gmail.com> #17
You don't need GPS explicitly. You must enable location services, but you can select "Battery saving" location mode (that uses Wi-Fi and celluar network to determine location). Anyway, to get around this, I show a content view with a message describing a problem to the user and a button that starts android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS Activity.
mu...@gmail.com <mu...@gmail.com> #18
The development team has fixed the issue that you have reported and it will be available in a future build.
pa...@finanzen.net <pa...@finanzen.net> #19
When can we expect this change ?
Will it be a new SDK release and a security update on present devices running Android M ?
Thanks for the fix
Will it be a new SDK release and a security update on present devices running Android M ?
Thanks for the fix
al...@gmail.com <al...@gmail.com> #20
On Nexus Player (Asus) running Android 6 now, i can't manage at all to get a wifi scanlist. Do you know a workaround as long as the future build is not available?
Jens
Jens
sl...@google.com <sl...@google.com>
gu...@gmail.com <gu...@gmail.com> #21
Re: #18 -- what was the change?
What are the new requirements for being able to obtain the list of scanned networks?
Is holding the below permissions, but not ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION going to be enough?
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
Will all Nexus devices get updated? What about Samsung, Sony, LG, etc (not sure if they've shipped 6.0 devices yet)?
What are the new requirements for being able to obtain the list of scanned networks?
Is holding the below permissions, but not ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION going to be enough?
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
Will all Nexus devices get updated? What about Samsung, Sony, LG, etc (not sure if they've shipped 6.0 devices yet)?
su...@gmail.com <su...@gmail.com> #22
same problem when update to android 6.0
using nexus 5
only enable WLAN scan will do nothing to improve location accuracy.
you should enable WLAN scan & enable system location service;
using nexus 5
only enable WLAN scan will do nothing to improve location accuracy.
you should enable WLAN scan & enable system location service;
av...@gmail.com <av...@gmail.com> #23
tools:node="replace" adding this to permission on manifest worked for me.
ae...@google.com <ae...@google.com> #24
Also having the same problem.
Just to confirm, the dependency on location services is being removed for WifiManager#getScanResults ?
If so when will a build with this change start rolling out?
Just to confirm, the dependency on location services is being removed for WifiManager#getScanResults ?
If so when will a build with this change start rolling out?
Description
Version used: Rules 1.0.0
What steps will reproduce the problem?
1. Use new GrantPermissionRule with WRITE_EXTERNAL_STORAGE in your test
@Rule
public GrantPermissionRule mRuntimePermissionRule =
GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE);
2. Use a method in app code which tries to write to internal sdcard (create a new folder on external sdcard)
In my Application.java:
public void createDir() throws IOException {
new File(Environment.getExternalStorageDirectory() + "/test").createNewFile();
}
How are you running your tests (via Android Studio, Gradle, adb, etc.)?
Android Studio
What is the expected output? What do you see instead?
In the app settings the permission is enabled and the call should work but it throws the following exception:
java.io.IOException: Permission denied
at java.io.UnixFileSystem.createFileExclusively0(Native Method)
at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java:280)
at java.io.File.createNewFile(File.java:948)
at test.app.directory.Application.createDir(EarApplication.java:253)
at test.app.directory.ExternalDirTest.test(ExternalDirTest.java:24)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at android.support.test.rule.GrantPermissionRule$RequestPermissionStatement.evaluate(GrantPermissionRule.java:109)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:58)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:369)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1932)