hey wanna see something kinda interesting? this was the entire fix to the iPhone Antennagate in 2010. 20 bytes.

(this is going to be a very long thread 🧵)

For context, back in 2010 when the iPhone 4 came out, people noticed you could grip the phone in a certain way and the signal bars would plummet from 5 to, like, 2.

A few weeks later, they published a letter (https://www.apple.com/newsroom/2010/07/02Letter-from-Apple-Regarding-iPhone-4/) admitting fault, blaming a bad formula.

The letter was shared around and clowned upon (https://daringfireball.net/2010/07/translation_iphone_4) but nobody really looked into what the formula between 4.0 and the patch in 4.0.1

I was a stupid eight-year-old at the time, but now I’m a stupid adult with access to a disassembler.

I downloaded both firmwares and started poking around. In the CoreTelephony framework, I found a promising looking binary: CommCenter. Looking at the strings gave me a pretty good sense that this is where the bar formula was.

The actual calculation is dead simple. When converting signal strength to bars, CommCenter loads each threshold from memory and compares until it finds the right range.

This code is not the problem...

...this is. This is the lookup table. When you convert the bytes to actual dBm values, you get:
-115, -111, -107, -103, and -99

(the closer to zero, the better the signal)

For example, here you need -107 or better signal to see 3 bars.

When you plot this onto a chart, you can see how the values are kinda screwed up since the values are really optimistic. Most of the time, you would see 4-5 bars. But when you gripped it, since the falloff is so sharp, you’d see a catastrophic drop from 5 to 2 bars.
In 4.0.1, they changed these values to be way smoother. Mapped onto a chart, you can see that it takes a lot to drop from 5 to 0 bars. It’s harder to see 5 bars, but it’s harder to plummet bars.

So there ya go. 20 bytes.

This has concluded a Tech Thread. Back to shitposting.

oh also in 4.0.1 they changed the height of the lower bars to be taller lmao
@samhenrigold which is funny as the graph show the lowest bar now show for lower signal

@samhenrigold I’m reminded again of a change I made in Mac OS 8.1 for HFS Plus.

I had to change the Start Manager code that loaded extensions so extensions would continue to load in MacRoman order. To keep Conflict Catcher working, I had to add new API it could use to control the order of extension loading.

Another engineer at Apple (IIRC, Mike Pucket) saw the new Start Manager API and changed the boot progress bar code to use the new API to make the progress bar’s updates smoother and more accurate, and that made Mac OS “seem” to boot much faster.

It’s funny how small UI changes can fool the mind.

@jimluther @samhenrigold Since I've been spending time in System 7 again (because, let's find any mechanism to distract my from the outside world) and have to reboot a lot (hey, memory management is hard) it's funny how I use the extensions loading as the progress bar and it took me a beat to realize that I missed the progress bar in the startup window.

@jimluther @samhenrigold there are studies about the perception of progress based on how the progress bar, well, progresses.

Fascinating!

@jimluther @samhenrigold gah, autocorrupt did me in - although it works with printers, too, but the studies are more general than that.
@samhenrigold Oh, now, that was just to make them “easier to see” of course. https://onefoottsunami.com/2010/07/16/have-you-gotten-taller/
Have You Gotten Taller?

Visit One Foot Tsunami to read more.

@samhenrigold I’d heard about the antenna issue but never looked into it. So if I understand you correctly the issue was strictly the perception of signal based on the bars shown, and not the actual signal itself?
@joey It was probably both, the fact that they did a significant reworking of the antenna in the next model is damning

@samhenrigold @joey

Back then the rumor was about the frame in metal that had no plastic cut to break the loop. Was is a real cause of trouble?

In Pixel 9 that reuses the iphone4 shape there are 6 plastic cuts in the metal frame...

@samhenrigold @joey It was definitely both. I remember looking in the cellular diagnostics applet which gave you the raw dBm value and "holding it wrong" could see a >15dBm drop in signal strength

@lilstevie @samhenrigold @joey where “holding it wrong” is just the way I naturally held an iPhone when talking on it, and still do 😉

My iPhone 4 was terrible for calls until i got the bumper.

@samhenrigold
This really strikes me as being the difference between a linear and nonlinear gas gauge in a car. If you have a linear gas gauge it really *feels* like you are using gas faster because most cars are nonlinear and stay at the full mark much longer and fall more rapidly as your tank gets lower.

In this case holding the cell phone a certain way *does* weaken signal but not as drastically as the display was showing.

But despite what the display makes you *feel* the reality is that your car will run out of gas at some point and you body will affect signal strength to some extent even if it now *feels* like it doesn't.
@joey

@samhenrigold is the current lookup table the same or has it changed since?
@samhenrigold So they "solved" the problem by changing what the bars mean? That's a very post-97 Apple solution.
@samhenrigold how do they map it now, for 3G signal strength?
@yertle I haven't looked into it but I'm sure modern signal bar calculation is way more complex. You gotta consider RSRP, RSRQ, and SINR, you gotta figure out what you wanna do for different network types (3G/LTE/5G). I'm willing to bet there's a little ML model somewhere that anticipates signal changes too for predictive smoothing.
@[email protected]
A lot of stuff Apple gets bad rap for us like that. Remember that update that enabled more aggressive CPU throttling on old phones? A lot of people were like: "Apple is slowing down old phones to force you into biting new ones!!! 😱",— but no, it's not that, I have a phone that never got such an update, it has an old battery that can't hold the voltage steadily and when you start doing CPU-intense things, the phone may just shut off randomly — is that any better than being throttled? Don't think so!
And this Antennagate always seemed a nothingburger to me, thanks for detailed explanation!
Apple does a lot of bad things — but some of them are hardly as bad as people think of them and are just hard to fix PR disasters.
@samhenrigold neat! it kind of hurts my brain to have someone who was 8 at the time explain the flaw in the iPhone announced at my first WWDC 😵‍💫 2010, that was like, five years ago?
@samhenrigold don’t forget the free bumper (or not holding it wrong)
@samhenrigold this is genuinely so cool, thanks for sharing!

@samhenrigold This one goes to 11.

Nice writeup!

@samhenrigold so we have to deal with people taking speaker calls in public while holding their phones "that" way to this day... not even because there was any practical drop in reception, but because the UI was not deceiving enough? 😵‍💫
@samhenrigold cc: @mhoye 👀↑↓
@gnomon @samhenrigold The incredible thing is that they rush-shipped rubber bumper cases to anyone who asked for them when it was really a display error fixed in a lookup table.
@mhoye @gnomon @samhenrigold it wasn’t just the display “error”. In the right circumstances it definitely did drop in actual signal level dramatically when you bridged the antenna gap (which I every time with my natural grip). It dropped calls a lot of the time. The bumper fixed this for me and it was a non issue on the 4s with the extra antenna gap. It was probably more of an issue when you spent time in marginal signal level areas.

@mhoye @gnomon @samhenrigold It wasn't "really a display error".

Rather, they modified the display code to cover up the physical design bug.

@mhoye @gnomon @samhenrigold
I had some former SEMC colleagues in T&V who moved to silicon valley to work at Apple. We made lots of fun at their expense when the "hold your phone wrong" problem was revealed. Of course, they were still working at Apple and we at SEMC, so obvz we were the real dumbasses and even we knew that at the time.
@samhenrigold Very interesting, nice work. The fix actually makes sense from a user perspective. The thresholds should be different according to technology (GSM, 3G, and today 4G, 5G). -122 dBm does not make sense for a GSM phone when sensitivity should be around -104 or 108 dBm.
For instance, -99 dBm for 5 bars in GSM is wrong. -80 dBm is correct. Even for 3G or CDMA the new values are better representation for the user.
@pfernandes There are different tables and a lot of early exits in the procedure before it hits this table but they don’t change in the patch

@samhenrigold I just watched this video yesterday. In combination with your thread, it seems that "Antennagate" was actually a combination of hardware and software issues.

https://youtu.be/RppnQ28BsiE

How CLEVER Design Made Antennas Disappear

YouTube
@rvajay That video was the spark for this! Those kinds of nerdy deep dive videos are my dinnertime entertainment