Valid HTML 4.01 Transitional

Samsung Galaxy S5
Settings and Setup

Jim Carter, 2015-04-15

Change history:

Table of Contents

Setup After Upgrading

These notes are very specific to jimc's preferences and configuration, but other readers can get an idea of the procedure which I've found to be efficient.

Since CyanogenMod-12 for Galaxy S5 is in nightly builds, new distro images will be frequent. In theory if the major number (CM-12) is not changing, you can install an upgrade without wiping data. However, in the jump from Android-5.0 to 5.1 several users had bootloops and app misbehavior which were cured by a factory reset (wiping data). Before upgrading it's best to back up everything, and to be prepared to follow this procedure.

Welcome App

Basic Settings

Next step is to set a few settings to make the UI a little less annoying while you restore your apps and data. Hit Menu - Settings and pick:

Reinstalling Apps and Data

On your laptop, un-tar your backups of /data/app and /data/data . For people just getting started with UNIX/Linux, here's the procedure. This is copied off my screen using my filenames, and you will have to substitute your own. My total size was 1.05Gb.

In KitKat and before, /{system,data}/app contained APK files, not directories. In Lollipop it's reorganized. This example is from Antutu Benchmark but all the apps downloaded so far look like this (others not yet seen might be more complicated): /data/app/com.antutu.ABenchMark-1 is a directory. It contains base.apk (the Java code), plus ./lib/arm/ and another library. I'm going to restore one KitKat app and see what happens. I used adb install com.farproc.wifi.analyzer-1.apk, picking this app because it's simple and non-critical. It was installed in the new format, and it executed correctly, but this app has no shared libraries. Play Store has no update for it; it's already updated for Lollipop. Success!

Here's how to un-tar the backups:

mkdir -p /home/scratch/restore-0130 #Make a place to un-tar the backups.
cd /home/scratch/restore-0130
mkdir app # Extracting downloaded apps
cd app
tar xf ~jimc/upgrade/selen/files/
cd .. # Return to containing directory, extract data
mkdir data
cd data
tar xzf ~jimc/upgrade/selen/files/ # This one is compressed
cd ../app # Get ready to restore the apps.
ls -1 > ./ # Makes a list of your apps. Option is minus one.
chmod 755 ./

Use your favorite editor on ./ and exclude several items that are already installed or have other contraindications. Likely the already installed apps are specific to me, being carried over from Gingerbread. There's no reason to preserve them.

Now turn the list into a useful script, along these lines.

etc. etc. Remove items to be excluded.
for a in $apps ; do
echo === Installing $a
adb install $a

Execute the script. I always capture the script output and check carefully later to see if anything strange happened. On the phone, the apps all end up in /data/app owned by system:system, and the app's data directory is created, /data/data/${APP} owned by its paranoid UID and group, mode 751.

./ 2>&1 | tee /tmp/logfile

On each install, on the phone it will pop a box asking you to allow Google to check for harmful apps. Just hit accept and it will go a lot smoother. None of my apps were considered harmful.

Check for updates. Firefox and Google Earth needed an update. Also I omitted some apps and installed them by hand from the market: Google Maps, Street View on Google Maps, Google Wallet, Google YouTube. Missing apps that I couldn't find: Apollo (music player).

Now the real trick is to restore the data. In Android each app has its own user ID and group, as an aid to keeping a hostile app from stealing data from others and sending it to the mother ship. The UIDs are assigned in an arbitrary order which changes from one OS version to the next, so the UIDs in your backup will mostly be wrong, and most of the apps will not be able to read or write their data. Here's how I automated fixing the UIDs.

First, only a small subset of the data will be restored: I'll exclude apps that I didn't configure and didn't save a useful history in, and I'll also exclude apps that I put some investment into, but which I suspect have been upgraded in such a way that it would be dangerous to carry over settings from the previous incarnation. I have 171 directories backed up, but I'm excluding the majority, specifically:

I'm restoring these 52 directories:

Some of the apps refer to files on my external SD card, so I'm going to swap the cards now.

You will need to do adb push writing into /data/data, so first do adb root which restarts the phone's ADB agent with escalated privilege.

Create this script (suggestion: on your laptop and push it over). On the phone put it in /data/data and call it untar-data. Change the mode to 755, because it will arrive with mode 777. The next script expects to find it there. Link to premade script, but I'm not giving any warranties etc.

# $1 = name of tar file, from "tar cf $1 $2"
# $2 = basename of data directory.
# Copy this script to /data/data (executable)

cd /data/data
if [ ! -d $2 ] ; then
echo " On phone: missing directory $2 skipped"
exit 4
uid=`ls -ld $2 | awk '{print $2}'`
if [ -z "$uid" ] ; then
echo " On phone: can't determine UID of $2"
exit 4
tar xpf $1
# We chown $uid $1 because xargs runs the command once even with no input.
find $2 ! -type l ! -user system -print0 | xargs -0 -n 25 chown $uid $1
find $2 ! -type l ! -user system -print0 | xargs -0 -n 25 chgrp $uid $1
rm $1

(end of script)

Create this script, which I called send-data. Put in the ./data directory, i.e. the one containing the app data you're going to send over. Link to premade script, but I'm not giving any warranties etc.

etc. etc., fill in the list of app directories to be restored
for a in $apps ; do
echo === Restoring $a
if [ ! -d $a ] ; then
echo " Missing directory skipped"
tar cf $tfil $a
adb push $tfil /data/data/app.tar
adb shell "/data/data/untar-data /data/data/app.tar $a"

(end of script)

Execute the script. You have to change to the data directory first because the script looks in the current directory for the stuff to be restored.

cd ./data
../send-data |& tee /tmp/errs #I put the script in the containing directory

Check for problems, fix, and restore them again. Edit the list of apps to include only the ones you're going to restore again. I had seven apps with weird symlinks, probably broken in a previous unsuccessful restoration attempt.

Here are the outcomes when I tried each app. On Lollipop apps are supposed to have their own menu button (3 vertical dots, usually in the upper right corner), but a few have not been updated. To get the menu, long-press on the Recent Apps button (left of the Home key, two interlocking squares). It is possible to configure this key so a normal press gives the menu (as in KitKat and before) and a long press gives Recent Apps.

cn.wps.moffice_eng Works incl. document history
com.addz.mediascanner Unfortunately it has stopped and it didn't flag the media to be rescanned.
com.andoku.two.full Works incl. history
com.cadreworks.cadrebible Works, but books are missing, saved on internal flash which was not copied over. Download them again.
com.eclipsim.gpsstatus2 Works incl. my settings Needed to un/reinstall the pro key, then it's honored. Works
com.evanhe.dnsforward Not tested
com.fsck.k9 Works incl. credential and old mail Works Works, reads a barcode
com.highwaynorth.jogtracker Works incl. history Works incl. credential
com.leinardi.kitchentimer Works incl. history
com.neddashfox.nightclock Works Works, sends video
com.rootmetrics (Not tested) Works incl. test call
com.smilerlee.solitaire Icon was missing (botched install?) I reinstalled. Opens and connects Works, installs OpenVPN Will not start, SELinux is blamed.
eu.kowalczuk.rsync4android Not tested yet Works
jackpal.androidterm Works
jackpal.droidexaminer Works Works incl. history Accepted
la.droid.periodic Works
lysesoft.andftp Works incl. history
net.healeys.lexic Works
net.he.networktools Works incl. history
net.simplyadvanced.ltediscovery Works, discovered LTE for the first time!
org.dmfs.caldav.lib Works but you need to set up the account anew.
org.dmfs.carddav.Sync Works but you need to set up the account anew.
org.dmfs.jb.workaround.carddavsync Not tested yet
org.dmfs.tasks Works
org.hermit.tricorder Works (very old)
org.mozilla.firefox Works incl. history
org.openintents.about Infrastructure
org.openintents.filemanager Infrastructure Works incl. secret database
org.pocketworkstation.pckeyboard Not tested yet Not tested yet
org.withouthat.acalendar Not tested yet Works
sk.vx.connectbot Works incl. credentials on SD card
sysinfo.sysinfo.sysinfo If this is Phone Info, it works. Not tested yet Works
web.oss.sshsftpDaemon Will not start, SELinux is blamed. Data restore omitted so I had to authenticate and download my books, but Kindle otherwise works.

Setting the Settings

Now that the apps are restored it's time to set the rest of the settings. In Lollipop (CM-12) the settings have been reorganized again versus KitKat (CM-11). I'm listing only settings that I changed, with only a few exceptions.

Ringtones, Notifications and Alarms

First, there are zillions of ringtones and notification sounds. The following are found in Media Gallery. Idiots, they've changed the map from names to ringtones! Pyxis used to be an antique phone ringer; now it's some dumb music. For future reference here are my ratings of 9 of the better tones. I'm going to try Eridani but may not stick with it.

Similarly, here are some of the better notification sounds. I'm using CyanDoink.

Procedure to use your own music as an alarm: The clock app and/or the audio flinger do not have permission to read music on the external SD card or other unapproved places. On Android-5.x Lollipop you could copy sound files to /sdcard/Alarms/ (this all works similarly with Ringtones and Notifications), but on Android-6.x Marshmallow the media scanner includes its contents, but if you select it, the alarm background process lacks permission to read it and falls back to an annoying default. The system location is /system/media/audio/alarms (or ringtones or notifications, lower case). Remount /system read-write, then copy/move your music file there. Permissions on the provided files are 644 root:root. Both MP3 and Ogg work. Avoid having another file elsewhere on the machine with the same basename, because both will be shown in the Media Gallery list, and if you guess the wrong one the player will not have permission to read it and you will get a really annoying default alarm. After moving the file you need to reboot, whereupon it rebuilds the Gallery list. There are media rescanners on Play Store. ScanMediaPlease by Zhuowei Zhang seems to work on Marshmallow.

Music is in /sdcard/Music and subdirectories recursively. Players such as VLC do have permission to read this directory.

Call Settings

To get to this page, start the phone app (icon of a phone), hit Menu, and pick Settings, and under that, General.

Under Phone Number Lookup: It has three features, all on by default (and I left them on):

Under Calls (Call Settings):

Wireless and Network Section

From here on are major sections in the main Settings app. You can get to it several ways: the white gear icon in the App Drawer (white circle with 6 dots); icon in the Quick Settings page (swipe down from the upper left corner); long press in the main screen background; or hit the Menu key.

Device Section

Personal Section

System Section

Desktop Setup

The controls for the desktop (home screen, window manager, Trebuchet) used to be mixed with the general settings, but in CyanogenMod-11 and following, you get to them by long-pressing in the desktop background (or press the menu key if you have one). It shows you an icon of a house, at the top; press this to make the current page the default one. At the bottom are icons for setting wallpaper, widgets and themes. In the center is a cluster of 3 small dots. Click on the dots to open the settings menu. The default scroll effects are actually decent, and None is not really none; you can leave it on None. My major change was to disable the ubiquitous and annoying Google search bar. Click the dots again to close this menu.

On the phone (Selen) I use a 4x4 array of icons. On the tablet (Mica) I use 5x8, of which the left three columns are occupied by a photo widget. The default spacing of Comfortable works out; Crammed puts them too close together.

To create a new page, put an app icon or widget on the rightmost existing page and drag it off the right margin. This also works directly from the app drawer. To make a page disappear, including interior pages, remove (or relocate) all icons on it.

Wallpaper: I'm using Phase Beam from Live Wallpapers. Others are included in CM-12, and lots more are available on the Play Store.

My Desktop Icons -- Selen

I'm trying to use a similar layout on both Mica and Selen. The bottom row of special icons are phone (vacant on Mica), app drawer, and Firefox. I've set 3 pages of icons. On Mica they are in the upper right 4x4 region and a photo or widget (3x3 or 3x4) goes on the vacant left side. I'm using the Simple Photo Widget. The provided Photo Widget (part of Gallery) is fine except that you have to crop the picture and let it store the cropped version, and when you go to change to a different photo, I can't get Gallery to finish, i.e. you pick the photo and then what?

Page 0 (Left): Games and Miscellaneous
-- -- Thermostat H.E. Net Tools
-- -- -- --
Air Control Mahjongg -- --
Andoku Lexic Solitaire (DSP)
Page 1 (Center): Often Used Apps
K-9 Mail Tasks Google Wallet Phone Tester
ClockSync Gallery Camera Barcode Scanner
Kitchen Timer Amazon Kindle Jog Tracker Google Music
Night Clock Jota+ Text Edit Maps by Google --
Page 2 (Right): Technical Apps
StrongSwan OpenVPN Set Wifi Analyzer GPS Status
Messaging Xabber Google Sch Play Store
VX ConnectBot Dropbear SSH aCalendar Contacts
ES File Mgr WPS Office RealCalc CadreBible

Setup and testing for particularly troublesome apps is described on a separate page.