[Nexus S General] RogerPodacter:
well i modified the nexus one battery driver and got it accepted into cyanogen ROM source. So i just did some digging for the nexus s driver, and found some interesting differences which likely are the reason why you see this jump in capacity.

as a quick high level summary. the nexus one battery contains an all-in-one fuel gauge chip solution which calculates its own percent readings, and just sends that to the OS to display. however looking at the nexus s driver, it seems they actually have a voltage table. see below:

/*
17 * Battery Table
18 */
19 #define BATT_CAL 2447 /* 3.60V */
20
21 #define BATT_MAXIMUM 406 /* 4.176V */
22 #define BATT_FULL 353 /* 4.10V */
23 #define BATT_SAFE_RECHARGE 353 /* 4.10V */
24 #define BATT_ALMOST_FULL 188 /* 3.8641V */
25 #define BATT_HIGH 112 /* 3.7554V */
26 #define BATT_MED 66 /* 3.6907V */
27 #define BATT_LOW 43 /* 3.6566V */
28 #define BATT_CRITICAL 8 /* 3.6037V */
29 #define BATT_MINIMUM (-28) /* 3.554V */
30 #define BATT_OFF (-128) /* 3.4029V */

Interesting. When your near empty, around 3.5 volts, and you plug in, the voltage jumps considerably. but this should be accounted for. HOWEVER, i'd bet that because you immediately reboot your device, the driver must reload from scratch, and all previous info is wiped. so now it sees it's voltage increase in absolute terms, and thinks it's charge is that much higher. just a hunch anyway.

This might also give hint as to why it drops from 100% to 97% so quickly. Because battery full is likely being used as the full point, but while the charger is still plugged in, there is no voltage drop yet until the charger is removed, immediately dropping the voltage a tad. just look at the voltage table values.

Also interesting which i've not seen before is this in the driver:

#define OFFSET_VIBRATOR_ON (0x1 << 0)
55 #define OFFSET_CAMERA_ON (0x1 << 1)
56 #define OFFSET_MP3_PLAY (0x1 << 2)
57 #define OFFSET_VIDEO_PLAY (0x1 << 3)
58 #define OFFSET_VOICE_CALL_2G (0x1 << 4)
59 #define OFFSET_VOICE_CALL_3G (0x1 << 5)
60 #define OFFSET_DATA_CALL (0x1 << 6)
61 #define OFFSET_LCD_ON (0x1 << 7)
62 #define OFFSET_TA_ATTACHED (0x1 << 8)
63 #define OFFSET_CAM_FLASH (0x1 << 9)
64 #define OFFSET_BOOTING (0x1 << 10)

Above you see these different "tasks" classified into these rough groupings, and each one is bit shifted. but below is the same info taken from the driver as well. it seems to me like samsung has some pre-defined weighted system for each of these tasks, and they are using it in the driver. rather interesting, i've not seen this before. i wonder how accurate it is.

#define COMPENSATE_VIBRATOR 19
71 #define COMPENSATE_CAMERA 25
72 #define COMPENSATE_MP3 17
73 #define COMPENSATE_VIDEO 28
74 #define COMPENSATE_VOICE_CALL_2G 13
75 #define COMPENSATE_VOICE_CALL_3G 14
76 #define COMPENSATE_DATA_CALL 25
77 #define COMPENSATE_LCD 0
78 #define COMPENSATE_TA 0
79 #define COMPENSATE_CAM_FALSH 0
80 #define COMPENSATE_BOOTING 52

anyway i dont know how this battery compares to say the nexus one, which does all of the battery work inside the chip itself. but the nexus s driver also seems like we could do some experimenting with these values and altering them to see if its possible to increase usable capacity, fix some of these "bugs", etc. kinda wish i had a nexus s to compile the kernel and test stuff out.