23 July, 2009

Avoiding ATT "last transaction" messages with the Android ADP1

I have been using ATT pay as you go for almost a year. About 6 months ago, I picked up an ADP1 and have been using it on my ATT pay as you go plan ever since. It worked just fine for the first few months, especially considering the fact that ATT has a decent data plan that you can get with it (2G only for the ADP1, however).

The one annoying thing was ATT "last transaction" balance nag messages every time you use the phone. With a regular phone, it is not too bad since you only get these nag messages when you make voice calls. With the ADP1 (and presumably any smart phone) these messages come much more frequently due to data access. If you haven't used the phone is a while, you end up with a huge stack of these messages that have to be dispatched before you can use the phone for anything but answering calls.

So I was left with two choices - either disable data access on the ATT network, or fix the problem. I decided to fix the problem. I downloaded the Android source for version 1.1, found the spot in the code to make the change, recompiled the relevant module, and installed it. Just this week I did the same for 1.5 (cupcake).

It turns out that these nag messages are unsolicited USSD messages. The PhoneUtils class in the Android Phone app is what handles USSD messages in Android. I modified it so that USSD messages that result in a simple alert beginning with the text "The last transaction cost" are discarded.

If you would like to do this yourself, I have attached the modified PhoneUtils class, as well as the complete Phone.apk. Either way, once you have newly modified the Phone.apk, follow the following instructions to get it loaded onto your ADP1:

* Android development kit
* Phone.apk
* Mini sdcard
* USB cable

Installing the patched Phone app:
1. Copy Phone.apk to your sdcard.

2. Attach your Phone to your computer via usb

3. Open a shell on the phone witht the command
adb shell

4. Login as root
su -

5. Mount the system dir as writeable
mount -o remount,rw /dev/block/mtdblock3 /system

6. Go to the dir where the built-in apps are stored
cd /system/app

7. Backup the existing Phone app (in case you change your mind)
cat Phone.apk > /sdcard/Phone.apk.bkp

8. Remove the old Phone app
rm Phone.apk

9. Install the replacement Phone app
cat /sdcard/Phone_1.5_Att.apk > Phone.apk

10. Switch mount back to readonly
mount -o remount,ro /dev/block/mtdblock3 /system

If you get an error on the last step that filesystem is busy, simply reboot your phone to restore the system dir as read-only.

That's it, your all set to not be annoyed by ATT nag messages.

One final note, since you won't be getting any last transaction messages, you may want to actually know your balance. If so, you can simply ask for it by dialing *777# on your phone.


  1. Outstanding! Nice job figuring all of this out.

  2. This is one of the meaningful and knowledgeable post.I like your blog quality.This is one of the interesting post.
    Android app developers