sunnygoyal / PowerToggles

An advanced power control widget for android
MIT License
81 stars 36 forks source link

NFC toggle linked to wrong setting activity #20

Open circlehk opened 6 years ago

circlehk commented 6 years ago

https://github.com/sunnygoyal/PowerToggles/blob/cdea5964817dea8a9781a592e2967166a515a12e/src/com/painless/pc/tracker/NfcStateTracker.java#L42

Since Android 8.x (or 7.x - I am not 100% certain), the system menu split "Wireless & Networks" menu item into 2 separate ones, namely "Network & Internet" and "Connected devices". Bluetooth and NFC is changed to the latter. (see screenshot below) device-2018-08-22-184319

so clicking on the NFC toggle is now launching the wrong activity. the intent should be revised to android.provider.Settings.ACTION_NFC_SETTINGS https://developer.android.com/reference/android/provider/Settings#ACTION_NFC_SETTINGS

p.s. Understood the developer is no longer maintaining this app. Solution is posted here for anyone who is interested to build their own version.

It seems that there is no popular fork on Play Store yet. Perhaps it's partially due to the decreasing demand on similar widgets when modern Android comes with "Quick Settings" feature. It does most of the job, but unfortunately NFC isn't there yet (in stock image by Google). Anyone has a better solution?