Skip to content
This repository has been archived by the owner on Mar 11, 2019. It is now read-only.

Broken on 6.0+ #6

Closed
keag-dev opened this issue Jan 21, 2016 · 13 comments
Closed

Broken on 6.0+ #6

keag-dev opened this issue Jan 21, 2016 · 13 comments

Comments

@keag-dev
Copy link

When attempting to use the library on several 6.0 Nexus 5 the access point is neither configured or enabled.

The following error is seen in logcat:

'W/WifiApControl: None found - falling back to the default device name: wlan0'

Got a bunch of 5.1.1 devices that this works on without issue.

@mvdan
Copy link
Owner

mvdan commented Jan 21, 2016

Did you try running the example application?

On my Nexus 6 running 6.0, I also get that logcat line, but since my wireless device is indeed wlan0, it does work.

mvdan added a commit that referenced this issue Jan 21, 2016
Our current method depends on the MAC address, so give up directly. We
will receive a stub address which will yield no match.

Updates #6.
@mvdan
Copy link
Owner

mvdan commented Jan 21, 2016

There is now a better warning message for 6.0+, but wlan0 should work for you and hence the example application should be able to enable/disable the AP.

If not, adb shell into your device and do ip link. You should see the interface name there.

@mvdan
Copy link
Owner

mvdan commented Jan 21, 2016

Huh, it doesn't actually work for me:

01-21 20:37:24.840 10482 10482 E WifiApControl: Caused by: java.lang.SecurityException: cc.mvdan.accesspoint.example was not granted  this permission: android.permission.WRITE_SETTINGS.

@mvdan
Copy link
Owner

mvdan commented Jan 21, 2016

Okay, I need to grab this new permission and do the runtime request that 6.0 added. Might take some time to get it fully working.

@keag-dev
Copy link
Author

Let me know if you need anything else on my end.

@sebastianmaz
Copy link

I can confirm that it doesn't work on my Nexus 7 2013 on android 6.0.1 too. It doesn't even enable access point. Do you have any idea how to make it work ?

@keag-dev
Copy link
Author

Seems like he's working on it as of 3 days ago. It's the weekend, cut him some slack.

@sebastianmaz
Copy link

Sure, I know. I meant if there is anything I can do to help ?

@mvdan
Copy link
Owner

mvdan commented Jan 24, 2016

Well, you can try to get it working and open a PR. I just moved and will be busy for the rest of the coming week, so won't have time for this at least until next weekend.

@mvdan mvdan closed this as completed in 8a0dca4 Jan 24, 2016
@mvdan
Copy link
Owner

mvdan commented Jan 24, 2016

Okay, so I lied. It mostly works for me, but sometimes it takes a few tries for WRITE_SETTINGS to be granted. I'm on a cm13 nightly, so perhaps it's just me.

In any case, that's just the quickly put together example code. The library code is pretty much done and trivial. Test away!

@mvdan
Copy link
Owner

mvdan commented Jan 26, 2016

Remember to let me know whether current master works for you or not. AFAIK the library code is fine, so unless proven otherwise I'll assume it's ready and tag a release.

@keag-dev
Copy link
Author

Confirmed working across multiple 6.0+ devices when we request the WRITE_SETTINGS permission. No change to the function of older devices. Release away sir.

@mvdan
Copy link
Owner

mvdan commented Jan 27, 2016

Done.

slack909 pushed a commit to CmDnoEdition/fdroid that referenced this issue May 2, 2016
This release allows for Android 6+ support, but we'll need to ask for
permissions at runtime too. This commit simply does one half of the work
needed to support Android 6 with all things wi-fi.

See the issue and example app commit for reference:

mvdan/accesspoint#6
mvdan/accesspoint@6284f03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants