Thoughts on Smartphones

Table of Contents

Published: 2017-12-26

Part 1, Part 2

(This has been sitting in my proofreading queue for far too long–a couple of months. The holiday season was busy!)

Computerized clinic
For superior cynics
Who dance to a synthetic band

In their own image
Their world is fashioned
No wonder they don't understand

        – Rush, "Natural Science"

A couple of months ago, my Nexus 4 finally crashed.

This was scary. At that point, my phone already become long of tooth and needed to be replaced, but coping with the problems all at once felt like more than I could handle. (Hint: it wasn't!)

The ensuing adventure took wild turns as I banished unstable software and replaced aging hardware. However, it also opened my eyes as to why the current "smartphone ecosystem" is such a mess, and how most of these problems can be solved.

What happened?

This Nexus 4 was running an old Lollipop (Android 5) build of CyanogenMod with Google Apps installed. (Yeah, I know I should have updated it long ago.)

The problems started occurring shortly after I launched the Google Play Store on 8 November to upgrade every app I have on my device. This is something I do in batches every one or two weeks apart (or whenever I remember).

After upgrading, I noticed intermittent "<App name> has crashed (Report OK)" dialog boxes. The disturbing part was that usually, the app in question was either Hayai Launcher (which would intermittently crash when pressing the home button) or Settings (which would intermittently crash when entering the "Apps" section of the settings app).

Seeing that imminent doom lied ahead, I backed up everything I cared about.

And it's a good thing I did, because after resetting the launcher back to the default CyanogenMod Trebuchet, I performed a reboot at some point. Unfortunately, it turned out CyanogenMod Trebuchet was also affected. After rebooting, I was greeted with, "Google Play Services has crashed." This error message was launched repeatedly, so I could not use the phone at all in any way possible.

After exhausting every trick up my sleeve, I took the last resort. I rebooted into recovery mode and performed a factory reset on my phone.

I set up my phone just like I would setup a new Android phone. However, the welcome wizard never prompted me to sign in to my Google Account, which was strange. What was even stranger was the fact that Google Play Store crashed whenever I launched it.

I want to emphasize this: Google Play Store silently crashed whenever I launched it. There was no error message. Yes, I did look at the logcat output. No, I don't have it anymore because I could discern nothing of use from it, and ultimately I don't care because I prefer to banish such garbage from my production systems. Applications should fail noisily when they fail, with meaningful and concise error messages.

I imported my address book from a vCard text file and called it a night. My phone ran in this basic stripped down state for about a week. After a week, I concluded that this was a software problem and re-imaged the Nexus 4 with the latest LineageOS build, which is free of all Google applications (i.e. no Play Store, no Google Play Services). (More about Google-free LineageOS later)

The search for a better phone

God looks after drunks and smartphone owners. – Doug McIntyre

Every system design starts with a list of requirements. Here are mine:

  • Must make phone calls
  • Must handle SMS text messages
  • Must provide a mobile hotspot for my "real" computers when I am on the go.
  • Must have a replaceable battery (I am OK with opening the phone to replace the battery as long as opening the phone does not require special tools like a pentalobe screwdriver.)
  • (Optional) Camera to take pictures

So, I looked at dumb phones. Nowadays, if you want a new dumb phone, you can either get a flip phone or a low-end keyboard-less slab smartphone. I ideally want something with a full keyboard. I have yet to find someone who is still manufacturing such a device. (I can always buy old hardware, but in a world that tries to obsolesce hardware after two years, I would prefer to buy something newer that will last longer.)

So, I looked at smart phones. Anything worth value is absurdly expensive right now in late 2017 ($500-$1000 USD).

And then there are issues such as the Android dialer rebooting the OnePlus 5 when dialing 911. Even worse, a couple of Reddit threads (1 2) have found the same problem on other phones, pointing at the possibility that this bug could be in Android Open Source Project (AOSP).

Nevertheless, the OnePlus 5T is a strong contender. (The 911 issue has been resolved.) I am just waiting for a LineageOS port. LineageOS still supports the older OnePlus phones several years later, which is a good sign in a world that tries to obsolesce hardware after two years.

I could get an older iPhone, but I will need to borrow another person's machine for access to iTunes. I would lose root access and all the power and responsibilities root access entails. I would also be subject to underclocking at Apple's discretion because of the lack of root access.

If I am buying a smartphone, I want root access to my own hardware. I want full control of the system so I can make it do my bidding–not the bidding of a corporation, a carrier, or any other entity.

Most importantly, I want the phone to last several years. Lithium ion batteries lose their ability to hold a charge after a few hundred charge cycles (couple years). Therefore the battery must be replaceable because the battery is almost always the first component to age. The iPhone is out. Opening the iPhone requires a heat press.

Also, stock ROMs are out until vendors can prove that they are willing to support hardware longer than 2-3 years. This means the phone must be supported by a community ROM such as LineageOS.

Ultimately, I am most likely buying the OnePlus 5T (once there is a LineageOS port) and installing LineageOS on it the day I receive it.

You probably noticed a theme by now. I like LineageOS.

LineageOS to the rescue!

A year ago, CyanogenMod lost their build infrastructure. Fortunately, the same developers staged new infrastructure and re-branded the project as LineageOS.

I have failed to keep up with developments in the Android world for several years now. So, I was pleasantly surprised to see CyanogenMod development continue.

I pulled an old Nexus 5 (which a friend gave me several months ago) off the shelf and decided to try it out. If it worked, I decided I could simply swap my SIM card into the Nexus 5 and use it as my primary device until I find a phone that I like.

The install went smoothly. There are very nice instructions for every supported device. The instructions guided me through installing a custom recovery, installing the LineageOS ZIP, and then optionally installing add-on packages (such as Google Apps and superuser daemon).

This is where I decided to do something differently. I chose not to install the Google Apps package. Why? Whenever I had problems with Android, usually the problem was tied to Google Play Services in some inexplicable way.

I did, of course, install the superuser daemon.

I was quite impressed. No longer was my device waking up arbitrarily to acquire a GPS lock. No longer were things updating automatically behind my back.

(While you can disable applications from updating automatically, it is impossible to disable background services like Google Play Services from updating automatically.)

In some ways, installing LineageOS on a phone felt like installing a full-blown Linux on a desktop. Installing an OS from scratch gives a very gratifying feeling of "freeing" your device from overlords. The opportunity to make decisions like whether to include Google Apps and/or root access is very empowering.

Working without Google Apps meant making some sacrifices, most notably Google synchronization (e.g. Contacts, Calendar) was not present. However, I quickly found workarounds and sometimes better alternatives. My Google-free setup works for me.

  • F-Droid is a nice repository of open source applications.
  • Contacts can be imported via a vCard (plain text) file
  • Google Calendar, Gmail, Google Voice, and friends can be accessed via mobile Web interfaces. The mobile web interfaces are actually half-decent (with the exception of Google Calendar, which is pathetic). Also, there is a dedicated app that sandboxes all of the Google websites to eliminate the need to sign in on the device's primary web browser.
  • There is hope for synchronization of contacts, calender, and files using NextCloud and Syncthing. If I can get these two projects setup on my Slackware box, I might be able to design a synchronization system that talks directly to my computer without any "cloud" middleman involved–for the first time since Palm OS!
  • Nothing updates automatically behind my back.

When I decided that the Nexus 5 was usable, I swapped SIM cards. However, after much troubleshooting, I was saddened to discover that the SIM card reader was missing a prong. Therefore, the phone will never be used as a phone again. (The SIM card reader is soldered onto the motherboard, so replacing the SIM card reader requires replacing the whole motherboard ($$).)

At this point, my Nexus 4 had been running for a week without a problem in it's "dumb phone" mode (other than Google Play not launching). So, I concluded that my problem was software instead of hardware. I installed LineageOS on my Nexus 4 (which is still supported despite the hardware being 5 years old) and configured it like I configured my Nexus 5–without Google Apps.

New requirement: replaceable battery

After installing a Google-free LineageOS, the Nexus 4 ran great. (Imagine that! Android Nougat (7.1.2) on a five-year-old device!) However, it did not run long.

I still had the original battery installed. This battery was five years old at this point, and it had easily been through 1000 charge cycles.

Solution: replace the battery. iFixit says it's easy, right?

Easy is relative.

Opening the phone was easy. However, the battery was taped into the chassis quite well. After some prying, it finally came loose (bending the body of the old battery in the process), and I installed the new battery.

The new battery lasts about 48 hours of moderate to heavy usage. I am very impressed. I can finally go two days without touching a charger. After installing a new ROM, replacing the battery, and cleaning grime off of the phone, my Nexus 4 actually feels like a new phone.

This is money/effort well spent. After buying a new phone, I plan on keeping the Nexus 4 and Nexus 5 around to test other projects (e.g. PostmarketOS).

Smartphones have made zero progress

Firstly, I am thankful for the efforts of the LineageOS team for wrangling Android into a usable package. LineageOS just breathed life into my five-year-old phone. I am very grateful that there are people who fight the good fight.

However, I am deeply disappointed with state of things in the wider smartphone universe.

Five years ago, I bought a Nexus 4 because it was the only device at the time that supported a bootloader unlock. (Everything else relied on exploits or leaked vendor tools.) After ordering my Nexus 4, I waited about two months before I finally had it in my hands because Google was so back-ordered. (It turned out there were thousands of fellow geeks who, just like me, wanted a geek-friendly phone.)

Android had its share of problems back then. Five years later, we are still talking about the same problems.

Phones are born into obsolescence. Vendors release a new phone every year and have little interest to support anything that is older than two years. Some vendors are better than others (e.g. OnePlus and Google). Most are irresponsible.

Phones do not receive updates because vendors do not have the manpower to support all of their models (because a new one is released every year). The really bad news are security updates. If there is a problem in a core library, it will likely never be patched.

The development model is still backwards and unsustainable. Each vendor forks Android upstream to run on each device. Each vendor starts with Android Open Source Project (AOSP) and customizes it with their own UI tweaks and kernel drivers. Furthermore, these changes are never integrated upstream into AOSP, so the work must be performed again with every update to AOSP.

The result: software marches on, but the hardware is left behind. There is an extraordinary pressure to purchase new hardware to run new software. What happened to the world where hardware came first and software followed?

LineageOS is indeed a fork of AOSP, but at least they try to integrate support for many devices in one project, unlike most other development efforts. There are advantages to developing a system this way: common libraries, common configuration, and a strong united community.

Android is still unfriendly toward geeks. Ten years ago, we were promised an open source platform that will act in our interest, not the interests of Google, any carrier, or any device vendor. Where is that platform?

The alternatives are disappointing. On one hand, there is Apple iOS, where everything is tightly controlled and you can't even start a process unless its binary is signed by an approved Apple key.

On the other hand, there are a bunch of projects that have either flopped or have yet to rise to fruition. Firefox OS was flawed from the start. By requiring everything to be a web app, they sacrificed performance dearly. Ubuntu Mobile showed great potential, but I could not buy an Ubuntu Mobile device in the US. Ultimately Canonical pulled the plug because they could not justify the bottom line.

And what happened to webOS, Sailfish OS, Blackberry OS, and Maemo?

PostmarketOS has the right model–put every port into one central repository and contribute changes upstream whenever possible. However, they have a long way to go. (Currently, you can't use PostmarketOS as a plain phone.)

What is a real smartphone OS?

In my opinion, it's a stretch of the imagination to call Apple iOS or Android a "smartphone" OS.

Why? Each has a bunch of apps, but they still can't link the apps together in new and novel ways. This simple fact hasn't changed after several years of "rapid" development.

Unix popularized inter-process communication decades ago. One process's output could be "piped" (i.e. used as input) into another process. In a world where everything was text, this made sense.

How can I take the output of one smartphone app and feed it into another? In Android, I can use an app's "share" menu, but apps need to declare what they can share first (and the app from which I am initiating the share must have a share menu). There is no way I can share things in ways the app developers have yet to imagine. (Coincidentally, iOS copied Android's share feature, so its design suffers from the same flaw as Android's.)

Unix/Linux has strong support for scripting via the shell. Where is scripting support in today's smartphones? How can I automate things?

Unix/Linux has scheduling daemons such as cron (now replaced by systemd). How can I setup a scheduled task (e.g. text a friend at a given time to remind him/her of something) in today's smartphones?

Coming from the Linux side of the world, I imagine that such a smartphone OS will be text-based to some degree. I hope I am wrong. Going back to text feels like a step backward to most people. Such a smartphone OS will need to somehow get over that hurdle.

And what is the rationale behind "activities?" The way that Android and iOS handle multiple concurrent processes makes no sense. Which apps are actually running? Which apps are suspended? Does navigating to another app make it stop what it's doing, or does it continue in the background? Sometimes navigating away kills the task, but sometimes the task will continue. Smartphones need some real process management.

The Hellaphone, which was a research port of Inferno to the Nexus S had the right idea. (You mean I can dial a number simply by echoing a phone number to a special file? Yep.) Unfortunately, it was just a summer research project. Where is a Unix-like mobile OS?


If you have been considering running Android without Google Apps, there is no time like the present. Check out LineageOS. I have made Android without Google Apps work for me, and it feels awesome!

Someone really needs to upset the mobile world. Despite my five years of owning a Nexus 4, there are still only a few phones made for geeks, and there is still no real open Unix-like smartphone OS.

The "next big thing" is due. What will it be? Will it actually solve more problems than it creates?

Part 1, Part 2