• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[ROM] CM10.1 with band selection force close fix. Can now pick USA Band

Search This thread

Serious_Beans

Senior Member
Feb 17, 2011
2,316
332
This is just based off the 2/2 nightly and it just includes a "fix" for the band selection in the phone info menu. For those of you who don't know, T-Mobile has refarmed their towers in a lot of the big cities for their HSPA+ to operate on the 1900mhz band as opposed to the 1700/2100mhz bands it was using before. You can get to the menu by typing *#*#4636#*#* and then go to 'Phone Info' and then click on the menu button and click select radio band, for most or all of you it will probably F/C but I made a little fix for it so that you can select the 1900mhz (USA Band) without a FC.

There is a second option in there "DO NOT PICK" I URGE YOU NOT TO CLICK IT, I don't really know the repercussions of clicking it (maybe your radio will crash and you might have to do a full wipe to get it back or worse...IDK!)but selecting USA will switch you to T-Mobile's 1900mhz towers giving you better building penetration and less ping (based off my experience). The download speeds ARE slower though; normally I get 21mbps down and 2mbps up (NYC) but now I get about 11mbps down and about 3mbps up.

If you want to get back to the 1700/2100 bands you're going to have to restart until I figure out a more elegant solution.

Thanks to all the usual people/teams
CyanogenMod
Google
Anyone else who contributes to Android

I don't know if this is fixed in other ROMs but the ones I have tried have all force closed on me.
Remember do a backup first!

I am NOT responsible for anything bad that might happen to your phone, flash the ROM at your own risk.

Download - md5 bbf82dae12403bb1ab56e56d0b2e12ee
 
Last edited:

dc211

Senior Member
Jul 21, 2010
572
203
Thanks for the fix. I installed your rom and it appears to work.

I'll be able to confirm in a few days if it really is switching to 1900mhz. At a friends house T-mobile has a broken tower and no phone can even get 2g speeds. I've called and called T-mobile for months and they keep reporting it's fine. Switching to Band 2 on a SGS 3 resolves the problem of the broken AWS towers. Once I stop by again I'll check if your fix gets the same result.

Thanks again.
 

Serious_Beans

Senior Member
Feb 17, 2011
2,316
332
Ping is definitely quick mine is under 100 when it used to be anywhere from 150+

Sent from my Nexus 4 using xda premium

Yeah ping is noticeably lower, glad it works for you.


Thanks for the fix. I installed your rom and it appears to work.

I'll be able to confirm in a few days if it really is switching to 1900mhz. At a friends house T-mobile has a broken tower and no phone can even get 2g speeds. I've called and called T-mobile for months and they keep reporting it's fine. Switching to Band 2 on a SGS 3 resolves the problem of the broken AWS towers. Once I stop by again I'll check if your fix gets the same result.

Thanks again.

Alright, let me know how it goes when you go to your friends. Glad it works :)
 
  • Like
Reactions: dc211

hev88

Senior Member
Dec 15, 2010
583
185
Glendale
Do you mind sharing what you did to make this work

Edit - just read your other thread... Dirty or not I think it is worth sharing to have a starting point for a more proper fox if you say yours is dirty

Sent from my Nexus 4 using xda premium
 
Last edited:

Serious_Beans

Senior Member
Feb 17, 2011
2,316
332
Do you mind sharing what you did to make this work

Edit - just read your other thread... Dirty or not I think it is worth sharing to have a starting point for a more proper fox if you say yours is dirty

Sent from my Nexus 4 using xda premium

^ seems more productive than forcing everybody to use a rom.

Alright, I don't mind sharing, I just didn't think many of the other devs would really care since I'm sure they can fix it in a more proper way. Basically in the 'BandMode.java' I just added an extra option to the 6 that were already there. I think the array starts at 0 so since it's saying there are 6 options there is actually 7 (0-6) and in the menu there are only 6, so that was causing a FC from what I understand. I added the "DO NOT PICK" value and then that stopped the FC but left only 2 options available the one I added and the USA band. I'm not too sure how to actually get the whole menu working properly though.

Code:
public class BandMode extends Activity {
    private static final String LOG_TAG = "phone";
    private static final boolean DBG = false;

    private static final int EVENT_BAND_SCAN_COMPLETED = 100;
    private static final int EVENT_BAND_SELECTION_DONE = 200;

    private static final String[] BAND_NAMES = new String[] {
            "Automatic",
            "EURO Band",
            "USA Band",
            "JAPAN Band",
            "AUS Band",
            "AUS2 Band",
	        "DO NOT PICK!"
    };

I wasn't trying to force anyone to use this ROM, I just didn't think my method was good enough to be considered a real fix and I felt other developers would be able to fix it better than I did. Sorry for forcing people to use this ROM lol.
 

hev88

Senior Member
Dec 15, 2010
583
185
Glendale
Alright, I don't mind sharing, I just didn't think many of the other devs would really care since I'm sure they can fix it in a more proper way. Basically in the 'BandMode.java' I just added an extra option to the 6 that were already there. I think the array starts at 0 so since it's saying there are 6 options there is actually 7 (0-6) and in the menu there are only 6, so that was causing a FC from what I understand. I added the "DO NOT PICK" value and then that stopped the FC but left only 2 options available the one I added and the USA band. I'm not too sure how to actually get the whole menu working properly though.

Code:
public class BandMode extends Activity {
    private static final String LOG_TAG = "phone";
    private static final boolean DBG = false;

    private static final int EVENT_BAND_SCAN_COMPLETED = 100;
    private static final int EVENT_BAND_SELECTION_DONE = 200;

    private static final String[] BAND_NAMES = new String[] {
            "Automatic",
            "EURO Band",
            "USA Band",
            "JAPAN Band",
            "AUS Band",
            "AUS2 Band",
        "DO NOT PICK!"
    };

I wasn't trying to force anyone to use this ROM, I just didn't think my method was good enough to be considered a real fix and I felt other developers would be able to fix it better than I did. Sorry for forcing people to use this ROM lol.

Don't be sorry man. If you found a fix, you found a fix. Dirty or not if it fixes the issue, props to you man. Thanks for sharing BTW.

Sent from my Nexus 4 using xda premium
 
  • Like
Reactions: Serious_Beans

Serious_Beans

Senior Member
Feb 17, 2011
2,316
332
Don't be sorry man. If you found a fix, you found a fix. Dirty or not if it fixes the issue, props to you man. Thanks for sharing BTW.

Sent from my Nexus 4 using xda premium

Yeah, no problem. Thanks
I hope someone figures out a way to fix it properly though, don't want to trap people on 1 band lol. I'll try to figure it out though. Glad I can help in anyway.
 
  • Like
Reactions: dc211

zephiK

Inactive Recognized Developer
Aug 23, 2009
21,656
37,705
New York, NY
I wasn't trying to force anyone to use this ROM, I just didn't think my method was good enough to be considered a real fix and I felt other developers would be able to fix it better than I did. Sorry for forcing people to use this ROM lol.

Hehe it's okay. I know you didn't mean to force people to Download it. I just thought it would be more versatile to have info on how to fix it rather than downloading a full rom.

Thanks for the info (points given)

Sent from my Nexus 4 using xda premium
 
  • Like
Reactions: Serious_Beans

Serious_Beans

Senior Member
Feb 17, 2011
2,316
332
Hehe it's okay. I know you didn't mean to force people to Download it. I just thought it would be more versatile to have info on how to fix it rather than downloading a full rom.

Thanks for the info (points given)

Sent from my Nexus 4 using xda premium

Yeah I hope the fix or possibly even a better one is implemented into all ROMs.

Sent from my Nexus 4 using Tapatalk 2
 
  • Like
Reactions: Nilsonf and dc211

dc211

Senior Member
Jul 21, 2010
572
203
Alright, let me know how it goes when you go to your friends. Glad it works :)

I was able to confirm picking USA does lock it on to 1900Mhz.

Here is what my broken tower looks like. The bottom speed test is after selecting USA Band (1 or 2 bars of signal) and the top is AWS (full bars of signal) after a reboot.

2013-02-04%2012.37.32.png


Thanks for finding a fix and getting it out there.
 
  • Like
Reactions: Serious_Beans

bigxie

Senior Member
Nov 14, 2010
1,374
5,860
Bay Area, CA
www.twitter.com
Serious_Beans,

Thanks for your findings! It really helped me out while I was investigating this tonight. I found some interesting results, and I figured out why adding a string to the BAND_NAMES array fixed the FC.

What's going on here is when we hit the 'select radio band' option, the radio is queried to see which bands are supported. In the case of the N4, there's 3 modes supported. The reply can be seen using adb logcat -b radio:

Code:
D/RILJ    (  810): [4137]> QUERY_AVAILABLE_BAND_MODE
D/RILJ    (  810): [4137]< QUERY_AVAILABLE_BAND_MODE {3, 2, 6, 7}

Once it knows the modes, it needs to draw the list of selections, but FC's when trying to access BAND_NAMES[6], since it's not defined up top (index 6 refers to the 7th element in the array, which is out of bounds). So adding a string fixes it and allows the list to draw.

But I did some further investigation, since there's another mode (7), which it never gets to! It turns out that a for loop is run to catch all the modes, and the number of times it loops is defined by the "size", which is the first element of the array (3, in this case). But the loop only runs 2 times since the condition is while i<size, and i starts at 1. Changing it to i<=size allows it to catch the last frequency mode (7).

But, then, what do modes 6 and 7 mean? For that, I looked in /hardware/ril/include/telephony/ril.h

Code:
/**
 * RIL_REQUEST_SET_BAND_MODE
 *
 * Assign a specified band for RF configuration.
 *
 * "data" is int *
 * ((int *)data)[0] is == 0 for "unspecified" (selected by baseband automatically)
 * ((int *)data)[0] is == 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
 * ((int *)data)[0] is == 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
 * ((int *)data)[0] is == 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
 * ((int *)data)[0] is == 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
 * ((int *)data)[0] is == 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
 * ((int *)data)[0] is == 6 for "Cellular (800-MHz Band)"
 * ((int *)data)[0] is == 7 for "PCS (1900-MHz Band)"
 * ((int *)data)[0] is == 8 for "Band Class 3 (JTACS Band)"
 * ((int *)data)[0] is == 9 for "Band Class 4 (Korean PCS Band)"
 * ((int *)data)[0] is == 10 for "Band Class 5 (450-MHz Band)"
 * ((int *)data)[0] is == 11 for "Band Class 6 (2-GMHz IMT2000 Band)"
 * ((int *)data)[0] is == 12 for "Band Class 7 (Upper 700-MHz Band)"
 * ((int *)data)[0] is == 13 for "Band Class 8 (1800-MHz Band)"
 * ((int *)data)[0] is == 14 for "Band Class 9 (900-MHz Band)"
 * ((int *)data)[0] is == 15 for "Band Class 10 (Secondary 800-MHz Band)"
 * ((int *)data)[0] is == 16 for "Band Class 11 (400-MHz European PAMR Band)"
 * ((int *)data)[0] is == 17 for "Band Class 15 (AWS Band)"
 * ((int *)data)[0] is == 18 for "Band Class 16 (US 2.5-GHz Band)"
 *
 * "response" is NULL
 *
 * Valid errors:
 *  SUCCESS
 *  RADIO_NOT_AVAILABLE
 *  GENERIC_FAILURE
 */

So I added their meanings to the BAND_NAMES array and compiled, and voila, the list is working and all the options are listed too.

I attached my BandMode.java file if anyone wants to look it over. I commented on the debugging stuff I put in there to figure out the array values and why the for loop was incorrect.

Also, I'm not sure if what I did will break this feature on any other devices, since I don't know if the output of their QUERY_AVAILABLE_BAND_MODE will behave the same as the N4 (size, mode 1, mode 2, etc...).

And finally, I find it strange that Google only defined the first 6 elements of the BAND_NAMES array in AOSP. Our N4 goes up to mode 7, what if other devices go even higher?

Any thoughts are appreciated. It's a bit late at night and I may not be thinking of everything or made a mistake. I did test the USA bands option, since I knew of some 1900MHz towers in town, and it was working. I did not test Cellular and PCS since I didn't make those fixes until after I got back home.

Thanks!
 

Attachments

  • bands.jpg
    bands.jpg
    22.5 KB · Views: 1,080
  • BandMode.txt
    6.9 KB · Views: 239

cb474

Senior Member
Oct 25, 2010
1,042
390
Without this fix does that mean that the Nexus 4 won't automatically connect to 1900 Mhz 3G if that signal is stronger or for say someone with an AT&T sim? In other words, is 1900 Mhz 3G simply not working at all on the Nexus 4 in it's current state? Or is it simply that we cannot force the Nexus 4 onto 1900 Mhz 3G?
 
Last edited:

cb474

Senior Member
Oct 25, 2010
1,042
390
Download - md5 bbf82dae12403bb1ab5e56d0b2e12ee
Is it possible that there's a typo in this md5sum?

When I ran a md5sum on the download I got: bbf82dae12403bb1ab56e56d0b2e12ee. This differs only by one additional digit, a "6" after the first "5." It seems a little improbable that a corrupted md5sum is otherwise identical. And shouldn't md5sum's all be the same number of characters (32) anyway (yours is only 31)?
 

Serious_Beans

Senior Member
Feb 17, 2011
2,316
332
Is it possible that there's a typo in this md5sum?

When I ran a md5sum on the download I got: bbf82dae12403bb1ab56e56d0b2e12ee. This differs only by one additional digit, a "6" after the first "5." It seems a little improbable that a corrupted md5sum is otherwise identical. And shouldn't md5sum's all be the same number of characters (32) anyway (yours is only 31)?
Yeah probably a typo Lol. I'll fix it.






How could we add this to other roms or be able to do this without the fc?

Sent from my Nexus 4 using xda premium


You need to compile a ROM. I'm going to be building an AOSP ROM with the fix.




Without this fix does that mean that the Nexus 4 won't automatically connect to 1900 Mhz 3G if that signal is stronger or for say someone with an AT&T sim? In other words, is 1900 Mhz 3G simply not working at all on the Nexus 4 in it's current state? Or is it simply that we cannot force the Nexus 4 onto 1900 Mhz 3G?




For at&t no, I believe for the phone to connect to hspa it needs to be on 1900mhz. For T-Mobile on the other hand it starts at 1700/2100mhz.


Serious_Beans,

Thanks for your findings! It really helped me out while I was investigating this tonight. I found some interesting results, and I figured out why adding a string to the BAND_NAMES array fixed the FC.

What's going on here is when we hit the 'select radio band' option, the radio is queried to see which bands are supported. In the case of the N4, there's 3 modes supported. The reply can be seen using adb logcat -b radio:

Code:
D/RILJ    (  810): [4137]> QUERY_AVAILABLE_BAND_MODE
D/RILJ    (  810): [4137]< QUERY_AVAILABLE_BAND_MODE {3, 2, 6, 7}

Once it knows the modes, it needs to draw the list of selections, but FC's when trying to access BAND_NAMES[6], since it's not defined up top (index 6 refers to the 7th element in the array, which is out of bounds). So adding a string fixes it and allows the list to draw.

But I did some further investigation, since there's another mode (7), which it never gets to! It turns out that a for loop is run to catch all the modes, and the number of times it loops is defined by the "size", which is the first element of the array (3, in this case). But the loop only runs 2 times since the condition is while i<size, and i starts at 1. Changing it to i<=size allows it to catch the last frequency mode (7).

But, then, what do modes 6 and 7 mean? For that, I looked in /hardware/ril/include/telephony/ril.h

Code:
/**
 * RIL_REQUEST_SET_BAND_MODE
 *
 * Assign a specified band for RF configuration.
 *
 * "data" is int *
 * ((int *)data)[0] is == 0 for "unspecified" (selected by baseband automatically)
 * ((int *)data)[0] is == 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
 * ((int *)data)[0] is == 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
 * ((int *)data)[0] is == 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
 * ((int *)data)[0] is == 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
 * ((int *)data)[0] is == 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
 * ((int *)data)[0] is == 6 for "Cellular (800-MHz Band)"
 * ((int *)data)[0] is == 7 for "PCS (1900-MHz Band)"
 * ((int *)data)[0] is == 8 for "Band Class 3 (JTACS Band)"
 * ((int *)data)[0] is == 9 for "Band Class 4 (Korean PCS Band)"
 * ((int *)data)[0] is == 10 for "Band Class 5 (450-MHz Band)"
 * ((int *)data)[0] is == 11 for "Band Class 6 (2-GMHz IMT2000 Band)"
 * ((int *)data)[0] is == 12 for "Band Class 7 (Upper 700-MHz Band)"
 * ((int *)data)[0] is == 13 for "Band Class 8 (1800-MHz Band)"
 * ((int *)data)[0] is == 14 for "Band Class 9 (900-MHz Band)"
 * ((int *)data)[0] is == 15 for "Band Class 10 (Secondary 800-MHz Band)"
 * ((int *)data)[0] is == 16 for "Band Class 11 (400-MHz European PAMR Band)"
 * ((int *)data)[0] is == 17 for "Band Class 15 (AWS Band)"
 * ((int *)data)[0] is == 18 for "Band Class 16 (US 2.5-GHz Band)"
 *
 * "response" is NULL
 *
 * Valid errors:
 *  SUCCESS
 *  RADIO_NOT_AVAILABLE
 *  GENERIC_FAILURE
 */

So I added their meanings to the BAND_NAMES array and compiled, and voila, the list is working and all the options are listed too.

I attached my BandMode.java file if anyone wants to look it over. I commented on the debugging stuff I put in there to figure out the array values and why the for loop was incorrect.

Also, I'm not sure if what I did will break this feature on any other devices, since I don't know if the output of their QUERY_AVAILABLE_BAND_MODE will behave the same as the N4 (size, mode 1, mode 2, etc...).

And finally, I find it strange that Google only defined the first 6 elements of the BAND_NAMES array in AOSP. Our N4 goes up to mode 7, what if other devices go even higher?

Any thoughts are appreciated. It's a bit late at night and I may not be thinking of everything or made a mistake. I did test the USA bands option, since I knew of some 1900MHz towers in town, and it was working. I did not test Cellular and PCS since I didn't make those fixes until after I got back home.

Thanks!

Thank you! It makes total sense though, awesome work bigxie. I'm going to put this fix in the aosp ROM I'm working on. I guess this would be as complete of a fix if any. Will test it out and make my decision after. Glad we are getting somewhere with this ;D. Its good you thought of that because I don't think I would have anytime soon Lol.

Sent from my Nexus 4 using Tapatalk 2
 

Top Liked Posts

  • There are no posts matching your filters.
  • 20
    This is just based off the 2/2 nightly and it just includes a "fix" for the band selection in the phone info menu. For those of you who don't know, T-Mobile has refarmed their towers in a lot of the big cities for their HSPA+ to operate on the 1900mhz band as opposed to the 1700/2100mhz bands it was using before. You can get to the menu by typing *#*#4636#*#* and then go to 'Phone Info' and then click on the menu button and click select radio band, for most or all of you it will probably F/C but I made a little fix for it so that you can select the 1900mhz (USA Band) without a FC.

    There is a second option in there "DO NOT PICK" I URGE YOU NOT TO CLICK IT, I don't really know the repercussions of clicking it (maybe your radio will crash and you might have to do a full wipe to get it back or worse...IDK!)but selecting USA will switch you to T-Mobile's 1900mhz towers giving you better building penetration and less ping (based off my experience). The download speeds ARE slower though; normally I get 21mbps down and 2mbps up (NYC) but now I get about 11mbps down and about 3mbps up.

    If you want to get back to the 1700/2100 bands you're going to have to restart until I figure out a more elegant solution.

    Thanks to all the usual people/teams
    CyanogenMod
    Google
    Anyone else who contributes to Android

    I don't know if this is fixed in other ROMs but the ones I have tried have all force closed on me.
    Remember do a backup first!

    I am NOT responsible for anything bad that might happen to your phone, flash the ROM at your own risk.

    Download - md5 bbf82dae12403bb1ab56e56d0b2e12ee
    10
    Do you mind sharing what you did to make this work

    Edit - just read your other thread... Dirty or not I think it is worth sharing to have a starting point for a more proper fox if you say yours is dirty

    Sent from my Nexus 4 using xda premium

    ^ seems more productive than forcing everybody to use a rom.

    Alright, I don't mind sharing, I just didn't think many of the other devs would really care since I'm sure they can fix it in a more proper way. Basically in the 'BandMode.java' I just added an extra option to the 6 that were already there. I think the array starts at 0 so since it's saying there are 6 options there is actually 7 (0-6) and in the menu there are only 6, so that was causing a FC from what I understand. I added the "DO NOT PICK" value and then that stopped the FC but left only 2 options available the one I added and the USA band. I'm not too sure how to actually get the whole menu working properly though.

    Code:
    public class BandMode extends Activity {
        private static final String LOG_TAG = "phone";
        private static final boolean DBG = false;
    
        private static final int EVENT_BAND_SCAN_COMPLETED = 100;
        private static final int EVENT_BAND_SELECTION_DONE = 200;
    
        private static final String[] BAND_NAMES = new String[] {
                "Automatic",
                "EURO Band",
                "USA Band",
                "JAPAN Band",
                "AUS Band",
                "AUS2 Band",
    	        "DO NOT PICK!"
        };

    I wasn't trying to force anyone to use this ROM, I just didn't think my method was good enough to be considered a real fix and I felt other developers would be able to fix it better than I did. Sorry for forcing people to use this ROM lol.
    7
    Serious_Beans,

    Thanks for your findings! It really helped me out while I was investigating this tonight. I found some interesting results, and I figured out why adding a string to the BAND_NAMES array fixed the FC.

    What's going on here is when we hit the 'select radio band' option, the radio is queried to see which bands are supported. In the case of the N4, there's 3 modes supported. The reply can be seen using adb logcat -b radio:

    Code:
    D/RILJ    (  810): [4137]> QUERY_AVAILABLE_BAND_MODE
    D/RILJ    (  810): [4137]< QUERY_AVAILABLE_BAND_MODE {3, 2, 6, 7}

    Once it knows the modes, it needs to draw the list of selections, but FC's when trying to access BAND_NAMES[6], since it's not defined up top (index 6 refers to the 7th element in the array, which is out of bounds). So adding a string fixes it and allows the list to draw.

    But I did some further investigation, since there's another mode (7), which it never gets to! It turns out that a for loop is run to catch all the modes, and the number of times it loops is defined by the "size", which is the first element of the array (3, in this case). But the loop only runs 2 times since the condition is while i<size, and i starts at 1. Changing it to i<=size allows it to catch the last frequency mode (7).

    But, then, what do modes 6 and 7 mean? For that, I looked in /hardware/ril/include/telephony/ril.h

    Code:
    /**
     * RIL_REQUEST_SET_BAND_MODE
     *
     * Assign a specified band for RF configuration.
     *
     * "data" is int *
     * ((int *)data)[0] is == 0 for "unspecified" (selected by baseband automatically)
     * ((int *)data)[0] is == 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
     * ((int *)data)[0] is == 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
     * ((int *)data)[0] is == 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
     * ((int *)data)[0] is == 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
     * ((int *)data)[0] is == 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
     * ((int *)data)[0] is == 6 for "Cellular (800-MHz Band)"
     * ((int *)data)[0] is == 7 for "PCS (1900-MHz Band)"
     * ((int *)data)[0] is == 8 for "Band Class 3 (JTACS Band)"
     * ((int *)data)[0] is == 9 for "Band Class 4 (Korean PCS Band)"
     * ((int *)data)[0] is == 10 for "Band Class 5 (450-MHz Band)"
     * ((int *)data)[0] is == 11 for "Band Class 6 (2-GMHz IMT2000 Band)"
     * ((int *)data)[0] is == 12 for "Band Class 7 (Upper 700-MHz Band)"
     * ((int *)data)[0] is == 13 for "Band Class 8 (1800-MHz Band)"
     * ((int *)data)[0] is == 14 for "Band Class 9 (900-MHz Band)"
     * ((int *)data)[0] is == 15 for "Band Class 10 (Secondary 800-MHz Band)"
     * ((int *)data)[0] is == 16 for "Band Class 11 (400-MHz European PAMR Band)"
     * ((int *)data)[0] is == 17 for "Band Class 15 (AWS Band)"
     * ((int *)data)[0] is == 18 for "Band Class 16 (US 2.5-GHz Band)"
     *
     * "response" is NULL
     *
     * Valid errors:
     *  SUCCESS
     *  RADIO_NOT_AVAILABLE
     *  GENERIC_FAILURE
     */

    So I added their meanings to the BAND_NAMES array and compiled, and voila, the list is working and all the options are listed too.

    I attached my BandMode.java file if anyone wants to look it over. I commented on the debugging stuff I put in there to figure out the array values and why the for loop was incorrect.

    Also, I'm not sure if what I did will break this feature on any other devices, since I don't know if the output of their QUERY_AVAILABLE_BAND_MODE will behave the same as the N4 (size, mode 1, mode 2, etc...).

    And finally, I find it strange that Google only defined the first 6 elements of the BAND_NAMES array in AOSP. Our N4 goes up to mode 7, what if other devices go even higher?

    Any thoughts are appreciated. It's a bit late at night and I may not be thinking of everything or made a mistake. I did test the USA bands option, since I knew of some 1900MHz towers in town, and it was working. I did not test Cellular and PCS since I didn't make those fixes until after I got back home.

    Thanks!
    2
    Hehe it's okay. I know you didn't mean to force people to Download it. I just thought it would be more versatile to have info on how to fix it rather than downloading a full rom.

    Thanks for the info (points given)

    Sent from my Nexus 4 using xda premium

    Yeah I hope the fix or possibly even a better one is implemented into all ROMs.

    Sent from my Nexus 4 using Tapatalk 2
    2
    BandMode.java is in settings directory in source?

    Sent from my Nexus 4 using xda premium

    cm10.1/packages/apps/Settings/src/com/android/settings

    That's the exact directory.