# Question
Title: Setting up new phone for kid: interplay between family link & multiple accounts
I have a OnePlus 5 on which I installed LineageOS 18.1 with Google Apps.

My intention is for this to be my child's phone, who is underage and whose account is limited by Google Family Link. (I'm not particularly in love with Family Link; it just comes automatically with honesty when registering the kid's Google account, i.e. not lying about their age. The screen time limitation is the only feature I actually find useful.)

I also installed Magisk v23 to root the phone. I realize that with enough determination my kid could potentially circumvent Family Link using root and e.g. adb, and don't mind.

I used my own Google account for the initial setup, but eventually I'd like to transfer my kid's apps and data from a previous device.

My first thought was to use the "multiple users" feature. I created an account for the child on the phone, and was going to use Titanium Backup to restore the backups of apps and data from the previous phone.

However, I'm beginning to have second thoughts. Is this a good way of approaching this? For example, if I continue as the "device owner", won't this device pollute my location sharing/location history?

Do I understand correctly that there is no way to change who the owner is (i.e. promote the child from "user" to "owner" and simultaneously demote myself from "owner" to "user")?

Would it be a better idea to instead, in the device owner environment, remove my Google Account and add the child's?

I would like to avoid lengthy experiments if possible, but will answer my own question if it comes to that.

My principal specific question is: what would be the consequences of these two approaches?

1. kid continues as user; I am owner
2. add kid's google account to device owner profile; remove mine

Update: adding kid as user is not straightforward; apparently (and logically) there is a whole new mount namespace so the TitaniumBackup directory I copied to the /sdcard directory of the primary account isn't visible, and even an elevated adb shell doesn't have access to `/storage/emulated/10` (which I gather is where the new storage space lives). I couldn't be bothered to workaround this, so I removed the kid's user.

I then tried adding the kid's account alongside mine, but that doesn't work because it's managed by family link; I have to remove my account first. Did that, and when trying to add the kid's account I get into an endless loop where it says it'll install family link manager, I click next, and it informs me that this step is necessary; repeat ad nauseam. I *think* the issue may be that it doesn't pass the SafetyNet check, because `logcat` has lines like

```
06-16 15:49:05.915 11187 11187 I BaseTask: ScheduleSafetyNetJobTask started. [CONTEXT service_id=42 ]
06-16 15:49:05.916 11187 12931 I KidsJobScheduler: schedule job DEVICE_SETUP_SAFETY_NET [CONTEXT service_id=42 ]
06-16 15:49:05.918  1444  3734 E EdXposed-Bridge: java.lang.ClassCastException: java.lang.String cannot be cast to android.content.Intent
06-16 15:49:05.918  1444  3734 E EdXposed-Bridge:       at com.aviraxp.adblocker.continued.hook.h$a.beforeHookedMethod(ShortcutHook.java:2)
06-16 15:49:05.918  1444  3734 E EdXposed-Bridge:       at de.robv.android.xposed.MethodHooker.handleHookedMethod(MethodHooker.java:61)
06-16 15:49:05.918  1444  3734 E EdXposed-Bridge:       at EdHooker_d6cb3615b07510db932c119335b0668763709397.hook(Unknown Source:171)
06-16 15:49:05.918  1444  3734 E EdXposed-Bridge:       at com.android.server.am.ActivityManagerService.broadcastIntentWithFeature(ActivityManagerService.java:16728)
06-16 15:49:05.918  1444  3734 E EdXposed-Bridge:       at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2283)
06-16 15:49:05.918  1444  3734 E EdXposed-Bridge:       at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2867)
06-16 15:49:05.918  1444  3734 E EdXposed-Bridge:       at android.os.Binder.execTransactInternal(Binder.java:1154)
06-16 15:49:05.918  1444  3734 E EdXposed-Bridge:       at android.os.Binder.execTransact(Binder.java:1123)
06-16 15:49:05.919  1444  3734 E EdXposed-Bridge: java.lang.ClassCastException: java.lang.String cannot be cast to android.content.Intent
06-16 15:49:05.919  1444  3734 E EdXposed-Bridge:       at com.aviraxp.adblocker.continued.hook.h$a.beforeHookedMethod(ShortcutHook.java:2)
06-16 15:49:05.919  1444  3734 E EdXposed-Bridge:       at de.robv.android.xposed.MethodHooker.handleHookedMethod(MethodHooker.java:61)
06-16 15:49:05.919  1444  3734 E EdXposed-Bridge:       at EdHooker_1d32fd428893610d3914110116abed3745926464.hook(Unknown Source:185)
06-16 15:49:05.919  1444  3734 E EdXposed-Bridge:       at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:15914)
06-16 15:49:05.919  1444  3734 E EdXposed-Bridge:       at java.lang.reflect.Method.invoke(Native Method)
06-16 15:49:05.919  1444  3734 E EdXposed-Bridge:       at de.robv.android.xposed.MethodHooker.handleHookedMethod(MethodHooker.java:81)
06-16 15:49:05.919  1444  3734 E EdXposed-Bridge:       at EdHooker_d6cb3615b07510db932c119335b0668763709397.hook(Unknown Source:171)
06-16 15:49:05.919  1444  3734 E EdXposed-Bridge:       at com.android.server.am.ActivityManagerService.broadcastIntentWithFeature(ActivityManagerService.java:16728)
06-16 15:49:05.919  1444  3734 E EdXposed-Bridge:       at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2283)
06-16 15:49:05.919  1444  3734 E EdXposed-Bridge:       at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2867)
06-16 15:49:05.919  1444  3734 E EdXposed-Bridge:       at android.os.Binder.execTransactInternal(Binder.java:1154)
06-16 15:49:05.919  1444  3734 E EdXposed-Bridge:       at android.os.Binder.execTransact(Binder.java:1123)
06-16 15:49:05.921 11187 12930 I BaseTask: ScheduleSafetyNetJobTask finished (5 ms). [CONTEXT service_id=42 ]
06-16 15:49:05.928  1444  3734 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (1954917)
06-16 15:49:05.938 10959 10959 W DeviceAdminAdd: Unable to set profile owner post-setup, no default supervisorprofile owner defined
06-16 15:49:05.993 11187 11187 I BaseTask: ScheduleSafetyNetJobTask started. [CONTEXT service_id=42 ]
06-16 15:49:05.994 11187 12931 I KidsJobScheduler: schedule job DEVICE_SETUP_SAFETY_NET [CONTEXT service_id=42 ]
06-16 15:49:05.996 11187 11187 W System.err: java.lang.Exception: Result is true
06-16 15:49:05.996 11187 11187 W System.err:    at m.cqr.c(:com.google.android.gms.policy_kids@211980404@211980404057.377187554.377187554:6)
06-16 15:49:05.996 11187 11187 W System.err:    at m.cqv.j(:com.google.android.gms.policy_kids@211980404@211980404057.377187554.377187554:0)
06-16 15:49:05.996 11187 11187 W System.err:    at com.google.android.gms.kids.setup.fragment.KidSetupFragment.cm(:com.google.android.gms.policy_kids@211980404@211980404057.377187554.377187554:0)
06-16 15:49:05.996 11187 11187 W System.err:    at com.google.android.gms.kids.setup.fragment.ActivateProfileOwnerFragment.onActivityResult(:com.google.android.gms.policy_kids@211980404@211980404057.377187554.377187554:6)
06-16 15:49:05.996 11187 11187 W System.err:    at com.google.android.chimera.FragmentProxy.onActivityResult(:com.google.android.gms@212116046@21.21.16 (150400-378233385):0)
06-16 15:49:05.996 11187 11187 W System.err:    at fd.ht(:com.google.android.gms@212116046@21.21.16 (150400-378233385):6)
06-16 15:49:05.996 11187 11187 W System.err:    at aes.g(:com.google.android.gms@212116046@21.21.16 (150400-378233385):6)
06-16 15:49:05.996 11187 11187 W System.err:    at eic.onActivityResult(:com.google.android.gms@212116046@21.21.16 (150400-378233385):0)
06-16 15:49:05.996 11187 11187 W System.err:    at eih.onActivityResult(:com.google.android.gms@212116046@21.21.16 (150400-378233385):0)
06-16 15:49:05.996 11187 11187 W System.err:    at edb.support_onActivityResult(:com.google.android.gms@212116046@21.21.16 (150400-378233385):0)
06-16 15:49:05.996 11187 11187 W System.err:    at edg.onActivityResult(:com.google.android.gms@212116046@21.21.16 (150400-378233385):0)
06-16 15:49:05.996 11187 11187 W System.err:    at edg.public_onActivityResult(:com.google.android.gms@212116046@21.21.16 (150400-378233385):0)
06-16 15:49:05.997 11187 11187 W System.err:    at rie.onActivityResult(:com.google.android.gms@212116046@21.21.16 (150400-378233385):4)
06-16 15:49:05.997 11187 11187 W System.err:    at android.app.Activity.dispatchActivityResult(Activity.java:8310)
06-16 15:49:05.997 11187 11187 W System.err:    at android.app.ActivityThread.deliverResults(ActivityThread.java:5002)
06-16 15:49:05.997 11187 11187 W System.err:    at android.app.ActivityThread.handleSendResult(ActivityThread.java:5050)
06-16 15:49:05.997 11187 11187 W System.err:    at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
06-16 15:49:05.997 11187 11187 W System.err:    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
06-16 15:49:05.997 11187 11187 W System.err:    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
06-16 15:49:05.997 11187 11187 W System.err:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
06-16 15:49:05.997 11187 11187 W System.err:    at android.os.Handler.dispatchMessage(Handler.java:106)
06-16 15:49:05.997 11187 11187 W System.err:    at android.os.Looper.loop(Looper.java:223)
06-16 15:49:05.997 11187 11187 W System.err:    at android.app.ActivityThread.main(ActivityThread.java:7660)
06-16 15:49:05.997 11187 11187 W System.err:    at java.lang.reflect.Method.invoke(Native Method)
06-16 15:49:05.997 11187 11187 W System.err:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
06-16 15:49:05.997 11187 11187 W System.err:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge: java.lang.ClassCastException: java.lang.String cannot be cast to android.content.Intent
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at com.aviraxp.adblocker.continued.hook.h$a.beforeHookedMethod(ShortcutHook.java:2)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at de.robv.android.xposed.MethodHooker.handleHookedMethod(MethodHooker.java:61)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at EdHooker_d6cb3615b07510db932c119335b0668763709397.hook(Unknown Source:171)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at com.android.server.am.ActivityManagerService.broadcastIntentWithFeature(ActivityManagerService.java:16728)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2283)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2867)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at android.os.Binder.execTransactInternal(Binder.java:1154)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at android.os.Binder.execTransact(Binder.java:1123)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge: java.lang.ClassCastException: java.lang.String cannot be cast to android.content.Intent
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at com.aviraxp.adblocker.continued.hook.h$a.beforeHookedMethod(ShortcutHook.java:2)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at de.robv.android.xposed.MethodHooker.handleHookedMethod(MethodHooker.java:61)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at EdHooker_1d32fd428893610d3914110116abed3745926464.hook(Unknown Source:185)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:15914)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at java.lang.reflect.Method.invoke(Native Method)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at de.robv.android.xposed.MethodHooker.handleHookedMethod(MethodHooker.java:81)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at EdHooker_d6cb3615b07510db932c119335b0668763709397.hook(Unknown Source:171)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at com.android.server.am.ActivityManagerService.broadcastIntentWithFeature(ActivityManagerService.java:16728)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2283)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2867)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at android.os.Binder.execTransactInternal(Binder.java:1154)
06-16 15:49:05.999  1444  4198 E EdXposed-Bridge:       at android.os.Binder.execTransact(Binder.java:1123)
06-16 15:49:06.003 11187 12930 I BaseTask: ScheduleSafetyNetJobTask finished (9 ms). [CONTEXT service_id=42 ]

```

I disabled EdXposed, leaving me with

```
06-16 15:58:55.797  6486  6486 W DeviceAdminAdd: Unable to set profile owner post-setup, no default supervisorprofile owner defined
06-16 15:58:55.852  6269  6269 I BaseTask: ScheduleSafetyNetJobTask started. [CONTEXT service_id=42 ]
06-16 15:58:55.853  6269  6634 I KidsJobScheduler: schedule job DEVICE_SETUP_SAFETY_NET [CONTEXT service_id=42 ]
06-16 15:58:55.855  6269  6269 W System.err: java.lang.Exception: Result is true
06-16 15:58:55.855  6269  6269 W System.err:    at m.cqr.c(:com.google.android.gms.policy_kids@211980404@211980404057.377187554.377187554:6)
06-16 15:58:55.855  6269  6269 W System.err:    at m.cqv.j(:com.google.android.gms.policy_kids@211980404@211980404057.377187554.377187554:0)
06-16 15:58:55.855  6269  6269 W System.err:    at com.google.android.gms.kids.setup.fragment.KidSetupFragment.cm(:com.google.android.gms.policy_kids@211980404@211980404057.377187554.377187554:0)
06-16 15:58:55.855  6269  6269 W System.err:    at com.google.android.gms.kids.setup.fragment.ActivateProfileOwnerFragment.onActivityResult(:com.google.android.gms.policy_kids@211980404@211980404057.377187554.377187554:6)
06-16 15:58:55.855  6269  6269 W System.err:    at com.google.android.chimera.FragmentProxy.onActivityResult(:com.google.android.gms@212116046@21.21.16 (150400-378233385):0)
06-16 15:58:55.855  6269  6269 W System.err:    at fd.ht(:com.google.android.gms@212116046@21.21.16 (150400-378233385):6)
06-16 15:58:55.855  6269  6269 W System.err:    at aes.g(:com.google.android.gms@212116046@21.21.16 (150400-378233385):6)
06-16 15:58:55.855  6269  6269 W System.err:    at eic.onActivityResult(:com.google.android.gms@212116046@21.21.16 (150400-378233385):0)
06-16 15:58:55.855  6269  6269 W System.err:    at eih.onActivityResult(:com.google.android.gms@212116046@21.21.16 (150400-378233385):0)
06-16 15:58:55.855  6269  6269 W System.err:    at edb.support_onActivityResult(:com.google.android.gms@212116046@21.21.16 (150400-378233385):0)
06-16 15:58:55.855  6269  6269 W System.err:    at edg.onActivityResult(:com.google.android.gms@212116046@21.21.16 (150400-378233385):0)
06-16 15:58:55.856  6269  6269 W System.err:    at edg.public_onActivityResult(:com.google.android.gms@212116046@21.21.16 (150400-378233385):0)
06-16 15:58:55.856  6269  6269 W System.err:    at rie.onActivityResult(:com.google.android.gms@212116046@21.21.16 (150400-378233385):4)
06-16 15:58:55.856  6269  6269 W System.err:    at android.app.Activity.dispatchActivityResult(Activity.java:8310)
06-16 15:58:55.856  6269  6269 W System.err:    at android.app.ActivityThread.deliverResults(ActivityThread.java:5002)
06-16 15:58:55.856  6269  6269 W System.err:    at android.app.ActivityThread.handleSendResult(ActivityThread.java:5050)
06-16 15:58:55.856  6269  6269 W System.err:    at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
06-16 15:58:55.856  6269  6269 W System.err:    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
06-16 15:58:55.856  6269  6269 W System.err:    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
06-16 15:58:55.856  6269  6269 W System.err:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
06-16 15:58:55.856  6269  6269 W System.err:    at android.os.Handler.dispatchMessage(Handler.java:106)
06-16 15:58:55.856  6269  6269 W System.err:    at android.os.Looper.loop(Looper.java:223)
06-16 15:58:55.856  6269  6269 W System.err:    at android.app.ActivityThread.main(ActivityThread.java:7660)
06-16 15:58:55.856  6269  6269 W System.err:    at java.lang.reflect.Method.invoke(Native Method)
06-16 15:58:55.856  6269  6269 W System.err:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
06-16 15:58:55.856  6269  6269 W System.err:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
06-16 15:58:55.858  6269  6618 I BaseTask: ScheduleSafetyNetJobTask finished (6 ms). [CONTEXT service_id=42 ]
06-16 15:58:55.952  1395  2506 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4

```

I will now disable all Magisk modules one by one to see if I can get past this step eventually.

Update 2: the "activate family link manager" loop issue might not be related to Magisk at all. It's been reported to Google at e.g. https://support.google.com/googleplay/thread/15850322/activation-family-link-manager-error-message-loop?hl=en and https://support.google.com/googleplay/forum/AAAA8CVOtD88XvbDIUaPF0/?hl=en&gpf=%23!topic%2Fplay%2F8XvbDIUaPF0. For at least one person, hacks like manually making the family link app a device admin in " Settings -\> Security -\> Device administrator" as well as "Settings -\> Application manager -\> Reset app preferences" helped, but "it looks like the Family Link Manager expects to be able to open the settings app on a specific page, which doesn't look to exist on all devices. This also happens on the Xiaomi MiPad as well... https://xiaomi.eu/community/threads/first-xiaomi-eu-rom-released-for-mipad-4.46337/

Manually settings the App as a device admin does not get you past this check.", which I can confirm.

Update 3: I got past the "Next, you'll activate Family Link" loop by manually converting `com.google.android.apps.kids.familylinkhelper` and `com.google.android.apps.kids.familylinkmanager` into system apps. With Magisk, `/system/app` is a writable tmpfs (i.e. not persisent); I remounted / (which the real `/system/app` is on) `rw` using `mount -n / -o rw,remount`, then bind mounted it under a directory: `mkdir /mnt/root; mount --bind / /mnt/root`. I copied the two APKs from my Titanium Backups to `/mnt/root/system/app`, then rebooted and Family Link setup was able to complete.

Now let's see about restoring all the apps from backup.

# Answer
I have a partial answer:

* You apparently can't add two Google accounts to the same Android user profile if one of the accounts is for a minor (and thus under Family Link supervision).
* The multiple users feature is relatively complex and breaks assumptions such as "I can access all files via adb shell if necessary".
* The way to change the device owner is to first remove all Google accounts from the owner's profile, then add the Google account of the new owner.
> 1 votes

---
Tags: google-account, google-family-link
---


# Question
Title: Why is Firefox for Android shown as "offered by" Google Commerce Ltd?
If you look at the page for Firefox for Android on Google Play, and it 'Read more' then scroll all the way down, you will see the following. The question is simple, why is it shows an offered by Google and not Mozilla?

# Answer
> 2 votes
I don't think it's necessarily a glitch. Legally, the offering source depends on your country. For example, in the UK,

> Content on Google Play is offered by Google Commerce Limited, located at Gordon House, Barrow Street, Dublin 4, Ireland. Such Content may originate from another source (such as an app developer, book publisher, movie studio, or music label) (the “Provider” of the Content).

However, in the US:

> Content may be offered by Google or made available by third-parties not affiliated with Google. Google is not responsible for and does not endorse any Content made available through Google Play that originates from a source other than Google.

I guess this is just to comply with legal requirements in certain jurisdictions.

---
Tags: google-play-store
---


# Question
Title: Android IoT device using excessive data over random ports
I have a large number of rooted IoT devices from an industrial supplier that are meant to run as an advertising unit. The goal was to install a standard piece of advertising software designed for android and configure it in it's housing for deployment. These devices are running a rooted `Android 6.0.1 Kernel Version 4.1.17-g900299-dirty`

However some of these devices are consuming insane amounts of data - over a 30 day period, 300gb of ethernet data is being used by the device, this is according to the `Data Usage` view within the OS Settings. However the application causing it is "Android OS"...

I used a packet sniffer to perform a couple 30 second packet captures as well as a couple longer ones. I reviewed the data and I see that across each device affected the port is random, but it's consistent that there's always 1 port transferring 80-90% of the data seen in the capture. The traffic seems mostly upload traffic (bytes sent from device to remote host), but that hasn't always been the case. Triggering a reboot seems to cause the service to pick a new port during boot.

I tried using `netstat -tulpn` in termux to check what process is using this, but the pid section is blank across the board. I see this port is listening, though.

I've looked at `lsof -i | grep <port>` but nothing comes up on any of the affected devices.

`ps aux | grep <port>` is not returning anything either.

Within the captures, it seems like there are a couple consistent hosts that they're reaching out to within a single device, but across devices this is not true. However I'm noticing that the remote host port we're contacting tends to be 4001... is that relevant?

I've read that it's possible it's an OS Upgrade issue where we're downloading updates that somehow fail and cause this awful cycle... but when I looked into the services running that it seems like it's already disabled (as referenced here: Google Play Services High Internet Consumption )

Does anyone have any suggestion of how I can track this down and stop it?

# Answer
I have found the issue. It appears that the application `Apache Storm` was loaded onto these machines.

It was being called by a shell script `install-recovery.sh` that was sitting in the `/system/bin` directory. This shell script was being invoked by the `init.rc` script, a quick search for the shell script name in the init returned it being called as the `flash_recovery` service. Pretty sneaky...

To address some other issues I had, I couldn't find the pid or process name in netstat because I wasn't the right user, swapping to the root user using `su` was wrong, I needed the `tsu` package so that I could retain the bash environment scripts that termux was giving me - going to root caused me to enter a different shell type that had different commands, which is why `netstat` was failing.

Hope that helps someone in the future.

Thanks
> 0 votes

---
Tags: data-monitoring
---


# Question
Title: How do I reduce the amount of storage my Email application data is taking up?
I’m using an LG Tribute phone (Virgin Mobile service). The default email app installed is synced with my Microsoft Outlook account. I only use this account for ticket confirmations, boarding passes and the like. However, recently I noticed it is taking up the following storage:

```
Total: 635 MB
App: 24.5 MB
App (SD Card): 0 MB
Data: 610 MB
Data (SD Card): 0 MB

```

Considering my phone only has 2 GB of storage, the above is a heavy price to pay. When I hit the “Clear Data” button, I get the message “All this app’s data will be deleted permanently. This includes all files, settings, accounts, databases, etc.” I don’t want to delete my account so I was wondering if there is any other way to slim down how much data my Email application is using?

# Answer
> 0 votes
Dave, I am using LG nexus. Encountered same problem and concern with yours. Here is what I discover then did: tap "Settings"-"Storage"-"Photos&videos"-"Images"(I've chosen "Photos" app to open images always)-"Assistant"-"Empty your trash-bin". In this last step, you will see some other options that the "Assistant" provided. Choose accordingly. Have a blessed day!

# Answer
> 0 votes
when you delete the *app data* it will delete the account stored on that app data from the smartphone memory only, not the email account from the cloud.

So, you could just clear the data and re-run the app. It should automatically detect the email you configured for android OS (that is auto used by all apps).

Or you can uninstall/disable the app and re-install/enable it, may work too.

What you will DO lose is any other settings you may have made like dark theme, etc. But these are usually easy to set again, if not, just take screenshots.

But, if you want to not risk anything, find a very light email app alternative. It will auto detect email account. Let it sync and compare sizes. If you like it, keep and disable the other. Otherwise, clear the other data, setup it again, and uninstall the new email app.

Ps.: i dont have your device model, this is just my general knowledge

---
Tags: internal-storage, email, storage
---


# Question
Title: How to get Android 11 to trust a user root CA without a private key?
I'm trying to install a new user root CA certificate in DER form (.crt file) on Android 11, without much success. The previous (expired) CA certificate worked just fine from an earlier install on a previous Android version (I don't quite recall, probably 9 or 10), but the same procedure I used back then (*Security \> Encryption & Credentials \> Install a certificate \> CA certificate*) now shows the following error message:

> Private key required to install a certificate

The answer by Benedito Marques in this question works, but as the other commenters say this completely defeats the purpose of having a private CA with a private key. I do not want this key my device, do I have any solution?

# Answer
This page pointed me to the right direction.

Android 11 can only install user-provided root CA certificates to contain the X.509v3 `CA:true` flag, which I suspect wasn't necessary before for some reason, and kept on working after the upgrade until I tried to install a new one because, presumably, the flag is not necessary to validate a TLS trust chain.

---

The following command can check if a certificate contains that flag (replace input format and filename by the one you are using).

```
$ openssl x509 -inform der -in cacert.crt -text
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            ....
        Signature Algorithm: sha256WithRSAEncryption
        Issuer: C = **, O = ***
        ...
        X509v3 extensions:
            X509v3 Basic Constraints:
                CA:TRUE
        ...

```

If `CA:TRUE` is not present under *X509x3 Basic Constraints*, your root certificate is likely not going to work on Android 11.

---

In order to generate a simple self-signed CA root certificate for Android 11, these minimal steps worked for me, and can be customized for your own certificate:

```
$ echo 'basicConstraints=CA:true' > android_options.txt
$ openssl genrsa -out priv_and_pub.key 2048
$ openssl req -new -days 3650 -key priv_and_pub.key -out CA.pem
$ openssl x509 -req -days 3650 -in CA.pem -signkey priv_and_pub.key -extfile ./android_options.txt -out CA.crt
$ openssl x509 -inform PEM -outform DER -in CA.crt -out CA.der.crt

```

The `CA.der.crt` or `CA.crt` files can be installed by going to *Settings* \> *Security* \> *Encryption & credentials* \> *Install a certficate*.

Once installed, it appears proprely in the *User certificates* list, and all apps that try to connect to sites using that CA root succeed.

This answer appears to build on the same foundations but is much more complete and will probably work on more platforms, but the one above should be a good minimal working example.
> 14 votes

---
Tags: system, certificates
---


# Question
Title: How to prevent WhatsApp (Web) from losing received media?
EDIT: The problem described happened to be related with the use of WhatsApp Web instead of WhatsApp app on the phone.

In my WhatsApp chats a couple of months old, I see placeholders for photos, videos, or voice messages. However, the photo itself is not shown, and when I click on it, the error message appears "Photo unavailable. Can't view this photo because it's no longer on your phone."

I myself have never deleted any of these photos from my phone. The message has not been deleted by the other party. I guess it's WhatsApp itself that deletes the media files after a couple of months. How do I stop this? I want all my sent or received WhatsApp media to be kept on my phone for unlimited time.

# Answer
> 0 votes
The described behavior is particular to the use of WhatsApp Web (or, maybe, also the WhatsApp app on the computer, I did not try).

I typically use WhatsApp from the web browser on the computer (WhatsApp Web), not from the phone. When I click on a media in WhatsApp Web, the media is shown, and I assumed that it would be synchronized with the phone (downloaded to the phone, saved there, and then shown on the computer). No. It is not downloaded to the phone, only to the computer. What is more, it is not saved on the computer but is only shown directly in the app.

Consequently, as time passes and the original media is no more available for download, there is no copy saved on the computer, and there was never any copy saved on the phone.

In order to have the media downloaded to the phone, you need to open the WhatsApp physically on the phone and tap the media. Presumably, after that the media would be saved to the phone and will not disappear anymore, as the other answer indicates.

# Answer
> 0 votes
WhatsApp doesn't itself delete photos. I have once faced such a problem myself, and it's nothing serious.

Here are two solutions:

1.Go to the Phone Settings \> App Settings \> WhatsApp and clear the cache. If possible, force stop the app too. Now, restart the aplication and it should work.

2.If the above method doesn't work, restart your phone once.

3.If your WhatsApp data (media files) is set to be stored in any external storage device (SD Card), then go to the relevant phone settings, turn off the option for external storage, and then turn it on again. The problem should be solved by now. If it still doesn't work in this case, then unmount and remount your SD Card.

Hope this helps!

---
Tags: backup, whatsapp-messenger, internal-storage, external-sd, media-files
---


# Question
Title: Access connected Android phone camera from Chrome browser on my Macbook
I know there are programmatic ways to request media from another device's camera, but is there any simple way I can access my phone camera from my (localhost) web app?

I connected my phone to my laptop via USB, but it's not showing up on Camera settings

(You can see that my laptop camera is the only option)

I've tried installing an app called Iriun, but it only transfers video to its own desktop app, not to Chrome.

# Answer
If you have the Iriun app open on your computer, it will appear as a camera in the browser. You just need to iterate through all of the available cameras.

```
function getCamAndMics(){
     // List cameras and microphones. in the menu

     navigator.mediaDevices.enumerateDevices()
     .then(function(devices) {
         devices.forEach(function(device) {
             console.log(device.kind + ": " + device.label +" id = " + device.deviceId);
             var audioSelect = document.getElementById("audioPicker-select");
             var cameraSelect = document.getElementById("cameraPicker-select");
             if(device.kind=="audioinput"){
                 //add a select to the audio dropdown list
                 var option = document.createElement("option");
                 option.value = device.deviceId;
                 option.text = device.label;
                 audioSelect.appendChild(option);
             }else if(device.kind =="videoinput"){
                 //add a select to the camera dropdown list
                 var option = document.createElement("option");
                 option.value = device.deviceId;
                 option.text = device.label;
                 cameraSelect.appendChild(option);

             }
         });
     })
     .catch(function(err) {
         console.log(err.name + ": " + err.message);
     });

}

```

You can see this with https://record.a.video \- just make sure you have Iriun running on your computer when you use the website. Sample code from https://github.com/dougsillars/recordavideo
> 0 votes

---
Tags: video
---


title: Nokia ringtones file location

text:
# Question
Title: Nokia ringtones file location
I have a Nokia 6.1 that has some ringtones that aren't in the system/media/audio directory. Any idea where they'd be?

# Answer
> 1 votes
They are in system/media\_cust/audio

# Answer
> 0 votes
On Nokia 5.4 /system/product/media/audio

---
Tags: 9.0-pie, nokia-6
---


# Question
Title: Do applications run in user profiles that are not active / run in background profiles?
I configured 3 user profiles with each their own google account on my device (Nexus 5 with Android 5.1).

When I switch the user profiles, do the applications keep running in the user profiles that are not active at the moment and consume CPU, RAM, battery and data?

E.g. Does my email app/Facebook/Twitter keep on running and receive Push Mail and consume network traffic while the corresponding profile is not active?

# Answer
I was going to ask this same question. I noticed that there are some anecdotal answers available here, but I wanted to see some documentation. Here is what I've found.

Based on Android Open Source Project documentation it seems that applications do run in the background. It says this:

> **Secondary.** Any user added to the device other than the primary user. Secondary users can be removed (either by themselves or by the primary user) and cannot impact other users on a device. *These users can run in the background and continue to have network connectivity.*

(Archived page: Supporting Multiple Users | Android Open Source Project (User Types))

However, if you're running a version of android built for automotive use, it's a different story:

> The following exceptions apply to headless system user and regular (secondary) Users in Automotive:
>
> * The headless system user does not support work profiles.
> * By default, regular (secondary) users have full access to phone calls and texts.
> * *By default, regular (secondary) users do not run in the background.*

(Archived page: Supporting Multiple Users | Android Open Source Project (Android Automotive Multi-User - Caveats))

Personally I would like the ability to choose whether a user is running or not, Android seems to have the ability to modify this, but unfortunately it's built into the "flavor" of Android that you're using. Perhaps there are some custom roms out there that have modified this.
> 1 votes

---
Tags: battery, multi-user, profiles, 5.1-lollipop, background-data
---


# Question
Title: Reboot Android devices automatically at a specific time (i.e. 3 AM) every day
I have a rooted Lenovo Vibe K5 Plus (A6020a46) running TWRP + Arrow OS. It doesn't provide an automatically scheduled reboot out of the box. None of the apps worked. Also the apps that claim to provide this functionality are suspiciously ad-filled and I'm not comfortable giving root permission to them.

So, here is what I've tried till now:

* SMManager. Didn't work. Also, suspicious app.
* Wrote an infinite loop shell script, but I'm afraid it'll make my system too busy:

```
while true; do
  if [[ "$(date +"%H")" -eq "3" ]] ; then
    reboot
  fi
done

```

But I don't know how to autorun it on boot and I'm afraid it'll break my Android
* Tried Termux (elevated) with `cronie`

I'd put `0 3 * * * /system/bin/sh reboot` in `/data/crontab/root` like mentioned in this link, but `crond` isn't recognised as a valid command in root shell.

Further, the `init.d` directory doesn't even exist, but an `init` directory does with a bunch of `.rc` files.

I've ran `sudo crontab /data/crontab` and then `crontab -l` lists the proper crontab, but it doesn't show up anywhere else. I'm not sure it will work. Further, I'll have to always manually run this (as far as I understand it) and seriously manually rebooting is infinitely easier.

I'm out of ideas. Any suggestions appreciated. I'd prefer shell scripts over shady apps.

# Answer
Run the following shell script from `init.d` (or `/data/adb/*.d/` in case of Magisk). Or run directly from `init`'s `.rc` file. See How to run an executable on boot and keep it running?

```
#!/system/bin/sh -e

# ignore signals
for i in $(seq 64); do trap '' "$i"; done

# seconds until today 3AM
SECS=$(( $(date -d '03:00' +%s) - $(date +%s) ))

# if today's 3AM has passed, set it to tomorrow's
[ SECS -gt 0 ] || SECS=$((SECS + 86400))

# wait until 3AM
echo "${0##*/}: sleeping for $SECS seconds"
sleep $SECS

# Reboot device
echo "${0##*/}: restarting"
/system/bin/reboot scheduled-reboot ||
/system/bin/setprop sys.powerctl reboot,scheduled-reboot

```
> 3 votes

---
Tags: shell, reboot, automation
---


title: Contact Images location

text:
# Question
Title: Contact Images location
Where are the contact images kept?
I have a contact image that is no longer in my gallery but it is one of my contact's avatar. I remember taking the photo and making it the avatar. I've went into my Google Contacts via the web but it is not there. The contact does not have a facebook or any other type of account. So it must be somewhere on the phone.

I have a Droid X with Gingerbread.

# Answer
> 3 votes
The contacts is actually an app, hence as other Android apps store it's data, this app also stores in a SQLite database. Images are part of contact data and are spotted in database. It is stored in `/data/data/com.Android.providers/contacta/databases/contracts.db`

# Answer
> 1 votes
What I do is simply create a separate folder in Internal Storage, which contains all my 'pics for Contacts' -- SD content always tends to change OR you change the SD card throughout years/lengthy periods of time. Whenever I get a new phone, I simply transfer/copy the contents of my 'pics for Contacts' folder, which is located in my Internal Storage folder, via Bluetooth to the new phone.

A SIMPLIER WAY of course would be to just start saving your Contacts in your Google account under your main account. This way, any contact, together with its contact photo, will be saved in Google Cloud. You stated that this does not seem to work for you. Everytimre I buy a new phone and connect it to my main Google account during initial phone setup, my Contacts and their pics transfer onto my new phone without a problem.

# Answer
> 0 votes
I found an idea. You should download program from Google Play called "Save Contact photo" then you will see all your contacts there and you can share those contact photos via Bluetooth(should have another phone for that!). And then you can see that photo in another phone's gallery, so you can easily transfer it via Facebook or Whatsapp.

---
Tags: 2.3-gingerbread, contacts, motorola-droid-x, images
---


# Question
Title: How to install a mobile-only Android app on an Android tablet?
How to install a mobile-only Android app on an Android tablet? By "mobile-only", I meant the app has only released a mobile version and no tablet version. For example, DoorDash is one such app.

# Answer
> 3 votes
In case of the DoorDash app I would say the developers are simply too stupid to understand that in the Android eco system there are still tablets without cellular.

From my perspective the only functionality of this app which requires a mobile is the function to make phone calls from within the app (Android `CALL_PHONE` permission). I am not familiar with DoorDash but I would assume that is is not a fundamental problem if you just want to order something.

If Google Play Store refuses app installation then you can still use one of the free APK sources like https://ApkMirror.com or https://ApkPure.com (as long as you trust those sites).

Both provide the DoorDash app and it can be installed on a non-cellular tablet without problem.

# Answer
> 0 votes
You can try finding an APK for the app online. If it's not on the Play Store, it probably won't work with your device. Normally, apps are available for both phone and tablet, whether or not it's made for mobile. Correct me if I am wrong.

---
Tags: google-play-store, tablet
---


title: Move contacts between 2 accounts

text:
# Question
Title: Move contacts between 2 accounts
On my Samsung Phone with Andorid 11 and OneUI Core 3.1 I have 2 google accounts. Lets call them ACC1 (private) and ACC2 (corporate).

By default when I add new contacts, phone add them to google ACC2.

Very often I change the destination account in time when I create new contact, but also very often forget to change them.

I do not see possibilty to change account after the creation process is done.

As I have them both (google accounts) configured on my Phone I want to ask:

How to easily move specific contact from google ACC2 to ACC1 ?

# Answer
> 0 votes
If you want to copy multiple accounts you can use Google Contacts web UI and their export/import function:

Step 1: Export existing Gmail contacts

* On your computer, go to Google Contacts
* At the left, click Export.
* Select which contacts to export.
* Select Google CSV.
* Click Export.
* At the top right, click your profile picture and then Sign out.

Step 2: Import the file

* On your computer, go to Google Contacts, then sign in with your other Gmail account.
* At the left, click Import.
* Click Select File.
* Choose your file.
* Click Import.

https://support.google.com/contacts/answer/1069522/add-move-or-import-contacts-computer?co=GENIE.Platform%3DDesktop#zippy=%2Cfrom-a-gmail-account

---
Tags: contacts, google-contacts
---


# Question
Title: Android seems to be overriding my Messnger Lite app
I am not tech savvy so am hoping someone can help and in a way I can understand. I was trying to free up some space on my phone and moved a bunch of files on my phone to the SD card I have in it. Since doing that I cannot control the notification sound for my Messenger Lite app I have installed. When I get a message and receive the popup notification on my phone from that app, the little popup box with still say Messenger Lite at the top, but instead of seeing the little icon associated with that app, it shows the Android robot symbol. I am just hoping by including that bit of info it will help pinpoint the issue. The best way to describe it is that Android is overriding that app. It won't let me set any custom sound for the app, not even ones that came preinstalled on my phone. I know I somehow combined files or must have somehow overwritten a file when transferring them to my SD card. I tried uninstalling and reinstalling the Messenger Lite app, but that didn't fix it. Can anyone help?

# Answer
I have similar problem. Notify icon is a robot, but I can change the sound of notification. What's is your android ROM? My is lineage os 16

For notify sound change I am using this Google app. https://play.google.com/store/apps/details?id=com.google.android.soundpicker
> 0 votes

---
Tags: notifications, files
---


# Question
Title: How to have a different input/output audio source
I have a one plus pro 8. It has excellent microphone (output) noise cancelling. I also have a Bose quiet comfort 35 II which has excellent noise (input) cancelling as well.

My problem is they when I ride the bus and talk to people:

1. If I use the phone default speaker they can hear me great but I cannot hear them
2. If I use the bose speaker then I hear them great but they don't hear me

Question: how can I speak using the phone microphone (output) but listen (input) using my Bose earphones?

# Answer
> 0 votes
As long as you have an Android phone, you can use Lesser AudioSwitch, an Android app found on the Play Store that allows you to switch between input and output for microphone and headphones both connected via Bluetooth or wires.

---
Tags: audio, bluetooth-audio, audio-controls
---


# Question
Title: How can I view a .docx document using dark mode on Android?
How can I view a .docx document using dark mode on Android?

# Answer
> 1 votes
If you are running Android 11 *(Not sure about lower versions if they have the system-wide dark theme)* and system-wide dark theme is enabled. Google Docs will open the document in dark mode.

*It'll be helpful if you provide more details about your device.*

# Answer
> 0 votes
Firelord mentioned that WPS Office allows users to view a .docx document using dark mode on Android:

> Wps office supports night mode which acts as dark mode actually, though you have to enable it explicitly for every document. – Firelord Jun 7 '20 at 4:20

---
Tags: dark-mode
---


title: Import settings from Habit Browser

text:
# Question
Title: Import settings from Habit Browser
I'm trying to import settings for Habit Browser. After navigating to Settings -\> Advanced -\> Import Settings, I get:

```
0
../

```

How can I change the location to the Download folder? Alternatively, what's the `../`? - So that I could move my backup file to that location?

# Answer
> 1 votes
Storage access permission should be granted manually.

Many thanks to user Hardon from Android Forums.

> OK, I think I see what it's doing, and I might have a guess at what your problem was. Have you granted it storage access permission? Without that it cannot see any of your directories, and because it's an old app (not updated for 4 years) it doesn't know how to request that permission from a modern Android version. So you need to go into Settings \> Apps \> Habit \> Permissions and grant it storage access. I think that should fix it for you (it did for me).

---
Tags: settings, browser
---


# Question
Title: Is there a container-izer for Android, to run an untrusted app that insists to have access to local photos etc?
I need to run an IoT control Android app with network access that also insists to have permission to access local media files, or its a no-go.

I don't fully trust this app and I don't want to grant it such permission.

Is there a way to run it inside a container of some sort, where it will just see "empty" local storage.

The phone is Pixel 5 with all the latest updates.

# Answer
We don't have anything like this, but we do have Multiple User and you can probably Add Guest User *(Not sure about functionalities)* to test it.
> 1 votes

---
Tags: security, android-11
---


# Question
Title: Multi-window display keeps disabling itself
I have Samsung Galaxy Tab Active2 with Android 9 Pie. When running two apps simultaneously in the multi-window mode, it frequently happens that the multi-window display gets suddenly disabled with the following notification: "Multi-window closed. Your tablet is too hot. Let it cool before using Multi window again". The options to display an app in a multi-window or pop-up views then disappear from the task manager menu, and the Multi-window option also gets greyed-out in the Settings. This is really annoying as I need to have two apps running side by side for my work. I searched the web but was unable to find any posts mentioning this behavior at all (so I suspect this may not be a general feature of Android but some specific set-up of Samsung...). Would anyone know how to disable/override this feature, please? I know that overheating can be dangerous to the hardware, but this way of handling it is very problematic for me.

Thanks in advance for your help.

# Answer
I'd say to try running it on power saving mode while multitasking. Or just limit the cpu in some way if that's possible without compromising your work.
> 1 votes

---
Tags: multi-window
---


# Question
Title: Is there any virtual webcam on Android that can remove the background?
I use Snap Camera on Microsoft Windows as a virtual webcam to remove the background when I use Meet/Skype/Teams/Zoom/etc.

Is there any virtual webcam on Android that can remove the background?

I am using the Android version of Meet/Skype/Teams/Zoom.

# Answer
The Android framework has no exposed APIs for third-party plugin app camera filters.

If a third-party program can inject itself into the Camera API, it would need to read the image data, if it can read the image data, it could exfiltrate the image which would be a security issue.

Applications themselves provide any visual features generally with OpenGL shader code or a ML pipeline.

My only suggestion is to submit feedback to the various Android apps the need for such a feature.

For an example of the complexity to developers see my answer to taking a picture with a Depth of Field camera.
> 1 votes

---
Tags: applications, webcam, video-conference
---


# Question
Title: Recurring crash from Google app with error message "EXCLUSIVE background task UPDATE_HOTWORD_MODELS crashed"
My mom's Xiaomi phone started displaying the error message:

> The Google application has suffered an error again. Please send a report to Xiaomi.

The code under the "see more" button is extensive, but the gist of it is that the "EXCLUSIVE background task UPDATE\_HOTWORD\_MODELS crashed".

The error message pops up every 2 seconds. What should I do to help my mom return her phone to a usable condition? Restarts do not help; I purged the settings of Google apps, that did not help either.

# Answer
**This seemed to be caused by the latest update (12.22.8.23, 12.23.16.23.arm64, 12.24.7.29.arm64 beta) to the Google App.**

As covered by many sources, the issue was caused by an update to the Google app and affected other features that use Google app:

**Known problematic versions**:

* 12.22.8.23
* 12.23.16.23.arm64
* 12.24.7.29.arm64 (beta)

**Affected apps and features**:

* Google app
* Google Podcasts
* Google Lens
* Google Assistant

### Possible fixes

* **Uninstall the problematic update**:

Settings \> Apps & notifications \> See all \> \[scroll to\] Google \> overflow menu (in the top-right corner) \> Uninstall updates
* **Clear Google's data**

Settings \> Apps & notifications \> See all apps \> \[scroll to\] Google \> Storage & cache \> Clear storage / Manage space \> Clear all data

Note: This will clear some settings for the Google app. Please review the settings if you have changed from default.
* **Join Beta program**
> 2 votes

---
Tags: google, system-error
---


# Question
Title: Can an app still send notifications if running in the background is disabled?
I have some apps which show me promotional notifications of new features, deals, etc. I know I can turn these notifications off, but I tried disabling the app running in the background altogether instead (Android 10), so it does not run at all by itself unless I start it explicitly.

Apparently, some of these apps still send me suprise notifications from time to time. How is it possible? Can apps still work and send notifications even if they are not started by me and cannot run in the background?

# Answer
> 2 votes
That depends on which pushing mechanism your app uses.

In China, many applications use some pushing sdk, as long as there is one application using the same pushing sdk running, the pushing sdk will use the running application to launch stopped-running app(even force-stopped) and make it running;

however, recently many chinese customized os has been modified to prevent this behavir

According to Google FCM(Google's pushing service), FCM won't send push message for forced-stopped application, but will do it for other situations.

So, according to this , you won't receive any notifications if you diable your application by force-stop

---
Tags: android-10, background-process
---


# Question
Title: Offline safe sync directory on sd card on non-rooted Android with Ubuntu PC
Is there a way how to offline safely synchronize directories between sd card on Android which is not rooted and PC with Ubuntu?

*Safely* = using secured connection between the devices (for example using ssh).

*Offline* = without Internet access, but the PC and smartphone are connected through LAN.

*Synchronize directories* = a process which transfers data between smartphone and PC in a way that at the end of the process, both devices contain exactly same data in selected directories (preferably, but not necessarily, excluding filtered files). The process is able to detect deleted data so it doesn't copy file which was originally on both devices and later deleted on one of them.

**My systems**

* Android 6.0.1 (not rooted)
* Xubuntu 18.04 64 bit PC

**What I already tried/checked (without success)**

*Unison*

*Unison for Android*

* https://play.google.com/store/apps/details?id=com.nerdysoftware.unison
* Not secure - from application description: "No SSH access is necessary - clients connect directly via socket. Because Unison clients connect to your device over a direct socket connection instead of over SSH, the server should only be run when your Android device is connected to a trusted network, like a home WiFi. Running the server on other networks could expose files on your device to untrusted parties."
* Also seems to use older version of Unison (this application requires exactly same versions on server and client to allow data transfer).

*Rsync*

*SSHDroid*

* https://play.google.com/store/apps/details?id=berserker.android.apps.sshdroid
* For using SSH with another software (see bellow)
* Cannot write/modify SD card using the ssh connection. I went to settings -\> Applications -\> SSHDroid -\> Permissions: storage is enabled. There I opened context menu -\> all permissions: reading SD card available. Modification/deleting data on SD card available. In other words, I checked the application has permission to modify the SD card: it has.

*SSHFS with SSHHelper*

*SSHFS with SimpleSSHD*

**What I already tried (with mixed/partial success)**

*Combination: Unison (on PC) + some SSH server (Android) + SSHFS (on PC)*

* In case I could find working SSH server; use SSHFS to mount remote Android device locally and then use Unison for synchronization.
* Results:
    + When the SSH is actually rw, then it works, but it's so slow that it's impractical - it must ask for every single file and directory over the network. Of course, other apps (like Unison) must do that too, but they don't ask for every single file sequentially (not: client send request for single file - latency - server checks and sends response - client receive response and go to next file).
    + Unison requires permission to rename files; it always creates temporary files and directories and when everything is downloaded and double-checked, then old files (if any) are deleted and new files renamed. So if renaming is not allowed, it doesn't work.

*SSH/SFTP Server - Terminal*

* https://play.google.com/store/apps/details?id=net.xnano.android.sshserver
* This *actually* works but has two problems;
    + It requires entering password several (\>10) times when mounted as sshfs (I tried trivial one and and made sure it's not typo) and doesn't support ssh keys. I was able to solve this problem with a hack: `zenity --password | sshfs user@host:/ "$PWD/data" -o reconnect,password_stdin`, but I'm not sure how secure it is.
    + This ssh is unbelievably *slow*. Much slower when compared with SSHDroid and SSHHelper (not only with sshfs, but also when I simply connect using ssh and terminal; typing and responses are really, really slow). Maximum speed is 2 MB/s, but most of the time it's ~500kB/s.
    + Cannot rename files (permission error) so it makes it unusable with Unison (on PC).

*Syncthing*

* https://play.google.com/store/apps/details?id=com.nutomic.syncthingandroid
* Problem: cannot modify SD card (on non-rooted systems) and devs are not going to fix this anytime soon.
* The only solution is to use obscure, hard-to-reach deep directory structure: `/storage/XXXX-XXXX/Android/data/com.nutomic.syncthingandroid/files`.
* But for this particular directory, it works. It's speed is about 5 - 10 MB/s and I suspect that it's being throttled down by SD card itself (or Android). For now, I'm using this solution, but the directory is really inconvenient.
* Smaller problems:
    + It doesn't support following symlinks and until someone (other than current devs) implement it, it's not going to be supported.

**What problem I'm trying to solve**

I "just" want to synchronize data on file level (some pdfs, images, etc.) between my PC and Android smartphone. I use multiple devices (desktop, laptop, etc.) and use Unison (note: I do not insist on this app) to synchronize data between them. Because I switch environment quite offten, I need it to work on one button press and to be fast as possible (which, for example, Unison does greatly). Because I work on different environments, I need to cover my cases: sometimes I'm without Internet access. Other times I'm connected to untrusted network.

This is also reason why I cannot use cloud (like Dropbox): it's slower than two devices communicating directly and sometimes I'm without Internet connection so I cannot synchronize even when the devices are connected on same network.

The reason why I want to sync with SD card is simply because it has bigger capacity so my files fits.

# Answer
At the end, I settled with Syncthing. So, how does it fulfil my requirements:

**Safely**

It uses encryption. I didn't analyse how secure it is, so this is more matter of trust, but at least it shouldn't send data unencrypted.

**Offline**

Works exceptionally well. Local LAN detection seems reliable and is able to connect clients directly. I use it also at work (Windows-to-Windows and Windows-to-Linux) to share data with co-workers without exposing them to 3rd-party companies, it's fast and reliable. (Tens of gigabytes are transferred pretty quickly, so it seems the only bottleneck is the local network.)

**Synchronize directories**

Works well, but at the end, I decided to synchronize two-ways only one subdirectory instead of all data. It seems like Android likes to modify my files without my consent (especially media files), so except certain working directory, I block any changes done by the Android. It's inconvenient, but it's not issue with Syncthing.

Another problem is when synchronizing big files (thousands of megabytes and more), but again, it seems like issue with my device, but after a few system crashes, Syncthing eventually manages to transfer the data. (Later edit: it seems this issue really happens only on my Android device. Syncing single ~25GB file with a co-worked, Windows-to-Windows was without any problems.)

**Pros**

* Reliable across platforms.
* You just configure it and it works in background. If you're used, for example, to Dropbox, it's similar, except you don't share your data with 3rd party company. And it's actually faster (ymmv), because it synchronizes data between clients directly, not with server.
* The application can be configured through browser. You can enable access from outer device (I recommend to enable password in this case!!!) which allows you to configure Android Syncthing through your desktop browser (you just need to find out IP address of your phone), which is really convenient.

**Cons**

* As already mentioned in question, only directory on SD card, which can be synced, is `/storage/XXXX-XXXX/Android/data/com.nutomic.syncthingandroid/files`. It's really inconvenient, but I got used to it, somehow.
* Linux desktop version doesn't handle symlinks. I solved it by using mount `bindfs --resolve-symlinks --no-allow-other "srcDir" "shareDir"`.

**Notes**

I miss option to review data changes before they're synchronized, but this is matter of preference and application design, not an issue. And as stated in question, I couldn't find reliable Unison implementation on Android.
> 3 votes

# Answer
I used to plug in the mobile and mount the directories using simple-mtpfs

```
  mkdir /mnt/phone
  simple-mtpfs -o enable-move /mnt/phone

```

I could then use unison directly between appropriate directories

It worked great for many years over 3 different phones.

Additional I was hoping to use unison for android, but it cant create a lock file on the sdcard which it wants to use for its one phone files. (Mistakenly thinks there is one, and asks to delete it)

Only problem is the plug on my current phone is so loose I can't get a file transfer connection, only power charging. Which is why I am here looking for a network solution.
> 0 votes

---
Tags: sync, linux
---


# Question
Title: How to delete a file registered in Word for Android recent files list?
The file in this picture within the `recent` list is an old competition fixtures file I want to delete.

I click on the three dots to the right of the file and select `delete` and it says I don't have permission to delete the file.

This file opens OK so it exists and it happens with all files in the recents list. This is a file which is obviously on my device but I can't even find the `data` folder using a file management app let alone

> ≫ data ≫ user ≫ 0 ≫ com.microsoft.word...

How do I delete this file?

Word version info provided by app

# Answer
In an answer provided by EdwinSleepDoc to a similar question in Microsoft Forums, it says

> When you open a password protected Word or Excel file on Android Word or Excel, it opens the file and then dumps an unprotected version of that file deep into Android's file system. Later, when you delete the original on your phone, the file still shows up in your Android Word or Excel 'recents' list and you can just tap it and open it. It is quite disturbing. It has a long file path usually users\>\>data\>\>0 ...

I cannot yet confirm that it is true about password protected files being handled like this, but I have found that this is true of files downloaded and opened from websites or opened from emails.

Following the instructions in the answer, the only way to delete this copy is to go to Settings \> Apps \> Word or Excel \> Storage \> Clear data.

This will clear that folder of these files and reset your app. You do not have access to that folder to delete these files individually. This is the only way.

**NOTE FOR SENSITIVE FILES: The "remove from list" option within the `recents` list does not delete the file from the device. It will remain in that folder, just no longer in the list.**
> 1 votes

---
Tags: file-management, file-permissions
---


# Question
Title: The default Full Disk Encryption feature (known as Secure Startup on Samsung phones) is not working for me
In the past, with older Samsung devices, whenever I have enabled Secure Startup to fully encrypt a device, I have gotten an instruction to charge it to at least 80% and leave it plugged in, as it would reboot and take about an hour for this procedure to finalize (maybe not word for word, but iirc that was pretty much what it would say).

I've a used stock ROM Galaxy S9 here and I enabled Secure Startup, and it *simply* said that it is enabled... No restart, not an ~hour long activation process... Nothing, it just says it is enabled. When I restart the phone, it *does* ask for my password, but I suspect it just might be a UI/visual thing and that it does not really encrypt the device.

I checked if the Knox fuse was tripped and it wasn't. Also, because I had the phone heavily debloated, I suspected maybe I have uninstalled a crucial Secure Startup related system app, so I hard reset it and tried again with no default apps being uninstalled. But still the same thing. It says it *is* enabled, but did not say anything about charging the phone to 80% and that it would take about an hour, or prompt me to reboot, etc.

Again, this is a Galaxy S9 and I'm definitely sure it uses Full Disk Encryption (**FDE**) as its encryption method (I googled this). The reason why that is relevant, is because if it was File Based Encryption (**FBE**), I'd suspect it would be normal to enable Secure Startup instantly—as it seems to be doing it now—and not have to reboot and take about an hour to encrypt the entire phone.

What am I missing here?

# Answer
> 0 votes
It doesn't matter if it uses FBE or FDE. The reason why it is so fast when you activated encryption is that all Android devices come nowadays encrypted by default. Therefore all your user data were already encrypted when ever you write it to flash (even without a PIN or password set).

Therefore if you enable secure startup all files are already encrypted. The only part that has to be updated is the master encryption key (and may be some managing data). As such a key has only a few bytes activating secure startup is done in less than a second.

CPUs often contain hardware encryption/decryption commands which work pretty fast and require very little battery. This makes it possible to have it enabled all the time. This also has the positive effect that a factory reset is very fast (just eliminate the master key) and very secure as without the key all data is gone.

---
Tags: samsung, encryption
---


title: Increase RAM through SD Card

text:
# Question
Title: Increase RAM through SD Card
In Windows, it's possible to use SD card as RAM.

Is something similar possible in Android (with and without root)?

# Answer
> 0 votes
Yes it is. As on Linux, it's called Swap. It might be useful on devices with minimal RAM (512MB and less), but unlinkely on those coming with 1GB and more.

There are apps available helping you to configure swapping. You find most of them searching for `swapper`.

# Answer
> 0 votes
It's possible but I would not suggest you as the SD card is way too slow to use as RAM. You can use "ROEHSOFT RAM Expander (SWAP)" app on a rooted Android device to increase RAM.

Source: XDA Forums - \[Guide\] \[RAM EXPANDER swap\] Easiest Way To Increase Ram in Galaxy Y

# Answer
> 0 votes
It's possbile. However SD Card is extremely slow, so Android don't use SD Card as a swap, using ZRAM instead

ZRAM will allocate a memory area as swap, compress unused allocated memory into this area;

ZRAM usually used on low-ram device.

However, ZRAM is battery consuming when you are in low memory situation;

If you ram is not enough, better policy is keeping as less backgourd application as possible by increasing LMK paramters;

---
Tags: stock-android, ram
---


# Question
Title: If I own Google Pixel and iPhone with same Google account, do I get unlimited upload for Google Photos?
Google Photos changed the policy so that only Google Pixel owners get to upload to Google Photos for free.

If I own an iPhone and Google Pixel both connected to the same Google account, does iPhone also get unlimited uploads?

# Answer
> 2 votes
**The offer is device-dependent and only applicable for Pixel devices.**

This is explained in more detail on Google Photos Help - Choose the upload size of your photos & videos under Android's tab - "Pixel storage info".

> **Important:** If you have a Pixel 5 device or earlier, your current backup options and benefits remain unchanged. Photos and videos backed up in Storage saver quality (previously named High quality) from your Pixel 2-5 devices will continue to receive unlimited free storage. However, as of June 1, 2021 **any new photos or videos you back up *from other devices* in Storage saver quality will count toward your Google Account storage**.
>
> (Emphasis mine)

Note that such info is not mentioned on the "Computer" tab and "iPhone & iPad" tab. Even for Android devices that are usually more prone to hack, the available hacks to disguise them as Pixel devices have also been patched.

The in-app Settings also makes it clear based on the device:

Left: Pixel 3a, "*Free and unlimited on this device*" | Right: Nexus 5, "*Store more at a slightly reduced quality*"

---
Tags: google-photos
---


# Question
Title: Android 10 on car doesn't have a sleep mode option
I got a head unit in my car that runs android 10. I'm kind of disappoint with this unit, and the most annoying thing is the loading time at boot, since I need to go reverse and need to wait for the rear camera.

I saw on youtube that there is an option to make the device not going to sleep for hours/days (under Settings \> Car settings)... but I can't find "Car settings" on my device. I was also looking for it under Settings \> Display, but no luck again.

Any suggestions? Thanks

# Answer
I am new so I may be totally wrong here but...

You could root the device and change the sleep file/delete it.

Also, for me personally, I would take maybe 20 minutes to study all the device's content especially the settings.

Cheers!
> 0 votes

---
Tags: android-10, standby, sleep, automotive-head-unit
---


title: Auto voice reply to phone calls?

text:
# Question
Title: Auto voice reply to phone calls?
I'm looking for a way to automatically answer any incoming phone calls with a voice message, i.e. an autoresponder.

So actually much like voicemail, except I don't want people to leave me messages. I just want to play a welcome message or "I'm currently not available by phone" and refer them to my email address or Whatsapp.

Upon looking around I find tons of solutions which can auto respond by SMS, i.e. sending an auto reply text message. But that's not what I'm looking for, I prefer to play back a voice message.

Is there a way to do this, either natively from within Android or with an app?

# Answer
> 1 votes
That is possible, you can record a greeting in the Google Voice app. Take a further look here. Hope that helps.

---
Tags: automation, voicemail
---


# Question
Title: Has the floating calendar icon feature and "Aa" button been removed from Google Sheets on Android?
I found a screenshot of the buttons I am trying to describe on this other post. Thanks.

But the actual feature is no longer appearing on my app. I recently updated it (8 Jun 2021) so I'm worried that it's been removed.

Anybody know?

# Answer
> 0 votes
\[!\[enter image description here\]\[1\]\]\[1\]

Eureka! \[1\]: https://i.stack.imgur.com/f33wG.jpg

---
Tags: google, calendar
---


# Question
Title: dex2oat64 is eating battery on Android 12 (Beta). What is it?
I have updated my Pixel 5 to Android 12 Beta, and in the last update, the "app" or service called "dex2oat64" eats too much battery.

I found some thread in Reddit, but they also don't know the answers like me.

What is this app/service?

# Answer
> 6 votes
dex2oat is a utility used when installing or updating applications, so that was likely just a remnant of your "Android is upgrading" phase that you saw after the initial/first reboot after the system/software update.

Most likely you have just installed Android 12 and it's setting up everything/caching process in the background. See if it get fixed in a few days (3-4 days usually).

---
Tags: battery, google-pixel, android-beta-program, android-12
---


title: Download queued and stuck

text:
# Question
Title: Download queued and stuck
I have Android 5.0.2. A notification showing in Line 1 "Downloading English (US) and Line 2 "Queued". I long touched on it and the text changes to Download Manager. How to get rid of this annoying notification?

Screenshots (click images for larger variants)

# Answer
This issue could be because of **Google Keyboard** or **Text to speech**.

1. Go to your download manager and **force stop** it.
2. Clear its cache data. (You can do it by going to `Settings -> apps`)
3. Go to Google **Text to speech** from `Language and input -> Text-to-speech-output` and disable `update automatically` from its settings.

In case you didn't find any TTS then do the same with Google Keyboard.
> 1 votes

# Answer
It was Google Photos for me. I do not use Google Photos so I disabled it and it went away.

Otherwise, I am thinking it is waiting for WiFi to download. Connect to WiFi and it will download and install and go away. The burning thing is that it attempts this without permission and I have not found a setting to disable the update in the app without disabling the app.
> 0 votes

# Answer
I think it's from Google Text to speech

Go to Settings - Apps/App Manager

Check for Google Text to speech app

Navigate to notifications section and turn it off
> 0 votes

---
Tags: 5.0-lollipop, downloading
---


title: Are push notifications normally slow?

text:
# Question
Title: Are push notifications normally slow?
I have a persistent problem with notifications to all apps on my OnePlus6+ where they typically are delayed 30-60s, often I will get several notifications showing at once or when I unlock my phone suddenly I get notifications.

I can test with gmail, Slack, Messenger, WhatsApp and any other app where I have a version open on my PC at the same time

I've only ever owned Android smartphones, and only from OnePlus so I do not know if this is just how Android works or is a 'feature' of OxygenOS/OnePlus hardware. But it's happened across multiple versions of Android and hardware for several years.

It suggest PUSH notifications are not really being PUSHed but polled, like the phone is only checking periodically.

I see it whether on WiFi or cellular networks and it's quite irritating. Can anyone give me any information or advice about it?

# Answer
> 2 votes
That push messages are not delivered in real-time is because of the battery optimization Android applies (this optimization may additionally also be applied by the Google servers providing the push messages).

The main idea behind the function to concentrate/group multiple notifications is that if you have multiple apps running waiting for incoming push messages it may end up that your device has to wake-up every few seconds and check for incoming push messages. A device that wakes up that often has a negative effect on on the battery so Google decided to group the messages and only check in every few minutes especially when the phone is not used for a certain time.

If I remember correctly this feature was introduced first in Android 7 and more and more extended with every new Android version.

---
Tags: push-notifications, oxygenos
---


# Question
Title: Tablet battery replacement and alloc_device_open fail?
I had to do a battery replacement on an Android 4.x tablet Denver TAC-97032.

The battery had been obtained from the manufacturer as aftermarket part; it is however not of the same size as the original one.

Still, I opened the tabled, desoldered the old battery, and soldered the new one; behavior thereafter is:

* If I just plug in the charger, I get the Android "battery fills" animation for a while, the animation shows charging, and then it disappears, as usual. Good - means battery is detected and is mounted properly.
* If I boot with Power + Vol Up, I get into the recovery, which here just shows the "dead android" picture; there are no extra menus for ADB sideload or similar, so basically it just sits there; `adb` can also see a "recovery" device, and `adb reboot` is also recognized and works
* If I boot with just Power: first the DENVER splash is shows, then an Android splash screen is shown, then screen goes black (but there is still backlight it seems); device appears dead, but if I hold Power to force shutdown, at end a click from the speaker is heard and flash from screen seen - meaning the device ran also under the black screen.

At the black screen, I tried `adb` \- and luckily, it worked:

```
$ ./adb.exe logcat
--------- beginning of /dev/log/main
I//system/bin/e2fsck(   67): e2fsck 1.41.11 (14-Mar-2010)
I//system/bin/e2fsck(   67): /dev/block/nande: clean, 5183/76800 files, 205676/307200 blocks
I/logwrapper(   67): /system/bin/e2fsck terminated by exit(0)
I//system/bin/e2fsck(   72): e2fsck 1.41.11 (14-Mar-2010)
I//system/bin/e2fsck(   72): /dev/block/nandh: clean, 15/20496 files, 2623/81920 blocks
I/logwrapper(   72): /system/bin/e2fsck terminated by exit(0)
--------- beginning of /dev/log/system
I/USB3G   (   85): usb 3g monitor v0.1 start
I/USB3G   (   85): event { 'add', '/devices/platform/sw_hcd_host0/usb1', 'usb', '', 189, 0 }
I/USB3G   (   85): event { 'add', '/devices/platform/sw-ehci.1/usb2', 'usb', '', 189, 128 }
I/USB3G   (   85): event { 'add', '/devices/platform/sw-ohci.1/usb3', 'usb', '', 189, 256 }
I/Netd    (   80): Netd 1.0 starting
I/Vold    (   79): Vold 2.1 (the revenge) firing up
D/Vold    (   79): Volume sdcard state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    (   79): Volume extsd state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    (   79): Volume usbhost1 state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    (   79): Volume sdcard state changing 0 (No-Media) -> 1 (Idle-Unmounted)
I/SurfaceFlinger(   81): SurfaceFlinger is starting
I/SurfaceFlinger(   81): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
E/[Gralloc-ERROR](   81): int alloc_device_open(const hw_module_t*, const char*, hw_device_t**):436 UMP open failed with 1
E/FramebufferNativeWindow(   81): couldn't open framebuffer HAL (Operation not permitted)
E/[Gralloc-ERROR](   81): int alloc_device_open(const hw_module_t*, const char*, hw_device_t**):436 UMP open failed with 1
E/FramebufferNativeWindow(   81): couldn't open gralloc HAL (Operation not permitted)
E/SurfaceFlinger(   81): Display subsystem failed to initialize. check logs. exiting...
I/        (   82): ServiceManager: 0xf958
I/AudioFlinger(   82): Loaded primary audio interface from sunxi audio HW HAL (audio)
I/AudioFlinger(   82): Using 'sunxi audio HW HAL' (audio.primary) as the primary audio interface
I/CameraService(   82): CameraService started (pid=82)
I/AudioFlinger(   82): AudioFlinger's thread 0x1c7b0 ready to run
W/AudioFlinger(   82): Thread AudioOut_1 cannot connect to the power manager service
I/AudioPolicyService(   82): Loaded audio policy from LEGACY Audio Policy HAL (audio_policy)
I/SurfaceFlinger(  129): SurfaceFlinger is starting
I/SurfaceFlinger(  129): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
I/[Gralloc](  129): using (fd=10)
I/[Gralloc](  129): id           =
I/[Gralloc](  129): xres         = 1024 px
I/[Gralloc](  129): yres         = 768 px
I/[Gralloc](  129): xres_virtual = 1024 px
I/[Gralloc](  129): yres_virtual = 1536 px
I/[Gralloc](  129): bpp          = 32
I/[Gralloc](  129): r            = 16:8
I/[Gralloc](  129): g            =  8:8
I/[Gralloc](  129): b            =  0:8
I/[Gralloc](  129): width        = 163 mm (159.568100 dpi)
I/[Gralloc](  129): height       = 122 mm (159.895081 dpi)
I/[Gralloc](  129): refresh rate = 60.12 Hz
D/libEGL  (  129): loaded /system/lib/egl/libEGL_mali.so
D/libEGL  (  129): loaded /system/lib/egl/libGLESv1_CM_mali.so
D/libEGL  (  129): loaded /system/lib/egl/libGLESv2_mali.so
E/SurfaceFlinger(  129): couldn't find an EGLConfig matching the screen format
W/SurfaceFlinger(  129): ro.sf.lcd_density not defined, using 160 dpi by default.
I/SurfaceFlinger(  129): EGL informations:
I/SurfaceFlinger(  129): # of configs : 21
I/SurfaceFlinger(  129): vendor    : Android
I/SurfaceFlinger(  129): version   : 1.4 Android META-EGL
I/SurfaceFlinger(  129): extensions: EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_fence_sync EGL_ANDROID_image_native_buffer
I/SurfaceFlinger(  129): Client API: OpenGL ES
I/SurfaceFlinger(  129): EGLSurface: 5-6-5-0, config=0x0
I/SurfaceFlinger(  129): OpenGL informations:
I/SurfaceFlinger(  129): vendor    : ARM
I/SurfaceFlinger(  129): renderer  : Mali-400 MP
I/SurfaceFlinger(  129): version   : OpenGL ES-CM 1.1
I/SurfaceFlinger(  129): extensions: GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_point_size_array GL_OES_point_sprite GL_OES_texture_npot GL_OES_query_matrix GL_OES_matrix_palette GL_OES_extended_matrix_palette GL_OES_compressed_ETC1_RGB8_texture GL_OES_EGL_image GL_OES_draw_texture GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_OES_framebuffer_object GL_OES_stencil8 GL_OES_depth24 GL_ARM_rgba8 GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_rgb8_rgba8 GL_EXT_multisampled_render_to_texture GL_OES_texture_cube_map GL_EXT_discard_framebuffer GL_EXT_robustness
I/SurfaceFlinger(  129): GL_MAX_TEXTURE_SIZE = 4096
I/SurfaceFlinger(  129): GL_MAX_VIEWPORT_DIMS = 4096 x 4096
I/SurfaceFlinger(  129): flags = 00000000
D/display (  129): ####disp_init, mode:0,out_type:1,tv_mode:0,app_width:1024,app_height:768
D/DisplayDispatcher(  129): display dispatcher enabled

```

... and here logcat stops - there are no further messages.

So, the primary error seems to be "Display subsystem failed to initialize", and it explains the black screen; however I cannot really tell:

* Is this a hardware cause: maybe during battery replacement, I accidentally disconnected some pin from the display, so even if I get splash screens shown at start, there is an error later when normal operation is initialized?
* There are very few resources online mentioning this error, and I think I got to an IRC chat log, where a factory reset was recommended for an error like this. I would imagine, that maybe there is an ID on the battery of sorts, and since now it is changed from the original one, the OS sees that as an error, and refuses to proceed. Obviously, I do NOT want to do a factory reset - because then, I lose all of the data on the device (I'd do an `adb` backup, but that typically raises a prompt on the device, and since the screen does not work, I couldn't have allowed it even if the system booted to a state where it would have shown the prompt)

So, my questions are:

* Would anyone know what is more likely as the cause of `ump_open` error: hardware wire misconnection, or maybe differing ID of the battery?
* Is it realistic to hope that factory reset would solve this problem?
* If I need to do factory reset, is there any way I can back up this device purely from adb (but not using any GUI elements on the target device)?
* Logcat says: "Display subsystem failed to initialize. check logs." - are there other logs than logcat I could check; and if so, which are they?
* Is there anything else I could try, to get this tablet to boot fully?

# Answer
Well, that was a doozy for me...

First of all, I found that the previous state of this tablet was not quite working - old battery ended up discharging completely; after that, plugging in charger only showed the "battery charging" splash screen, but device refused to boot; and at that point it was stashed away - until now.

Anyways: first of all, as documented here Why would Android list some files that are not accessible (I/O error)?, I discovered there were some system files which caused I/O error. That made me think that there is a possible corruption of the `/system` flash partition - in which case, a factory reset would indeed help.

First of all, mounts visible at this time via `adb` (at this time, I still run it from a folder under MSYS2 bash, therefore the doubled slashes) were:

```
root@android:/ # mount
mount
rootfs / rootfs rw 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600,ptmxmode=000 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
/dev/block/nandd /system ext4 rw,nodev,noatime,user_xattr,barrier=0,data=ordered 0 0

```

Cool, so we know now `nandd` is the `/system` partition. Let's check all block devices:

```
root@android:/ # ls /dev/block
loop0
loop1
loop2
loop3
loop4
loop5
loop6
loop7
nanda
nandb
nandc
nandd
nande
nandf
nandg
nandh
nandi
nandj
ram0
ram1
vold

```

(`vold` is some old Android init, which only appears, it seems, when there is a "normal" `adb` connection - not when in recovery).

So, I thought, I should try a backup, and somehow check for corruption; first I tried this for backup:

```
$ ./adb.exe backup -apk -shared -all -f /c/BACKUP/2021_06_26_DENVER_TAC_97032.ab
WARNING: adb backup is deprecated and may be removed in a future release
Now unlock your device and confirm the backup operation...

```

... but this needs an active GUI for confirmation - and my display here won't boot... so no dice.

Then I found https://github.com/TissueFluid/yaffs2-recovery which made me try:

```
$ ./adb shell 'nandread -d /dev/block/nandd -f /dev/tty' > nandd.bin

```

Problem being, I don't really have spare disk space at this point, so I tried redirecting to `/dev/stdout` (so I can save the stream on the PC) but it didn't exist; and finally I tried `/dev/tty` \- but all I got were some text error messages in the output file: "`failed get mtd info for /dev/block/nandd, Not a typewriter`".

Ok, so I thought, let me check for corruption:

```
root@android:/ # e2fsck /dev/block/nandd
e2fsck /dev/block/nandd
e2fsck 1.41.11 (14-Mar-2010)
e2fsck: Device or resource busy while trying to open /dev/block/nandd
Filesystem mounted or opened exclusively by another program?

root@android:/ # umount /system
umount /system
failed: Device or resource busy

```

Eh yeah, can't really unmount the `/system` partition, when it is the system in use ...

Then I found this: https://superuser.com/questions/401217/how-to-check-root-partition-with-fsck \- none if it is really applicable here.

Then I made a bad mistake: I found there is a program `directiotest` \- so I thought, what could go wrong, it is a "test" of block devices? **BAD** mistake:

```
root@android:/ # /system/xbin/directiotest
/system/xbin/directiotest
Usage: directiotest blkdev_path

1|root@android:/ # /system/xbin/directiotest /dev/block/nandd
/system/xbin/directiotest /dev/block/nandd
Starting test
Testing area 8192/8192 (100.00% complete)
Test complete

root@android:/ # ls -la /system/xbin
ls -la /system/xbin

```

Ouch ...

```
$ ./adb logcat
- exec '/system/bin/sh' failed: No such file or directory (2) -

```

Oops ... the *entire `/system` filesystem is now gone*! Looking at the source afterwards https://android.googlesource.com/platform/system/extras/+/master/tests/directiotest/directiotest.c \- it turns out that it "tests" by writing bytes in Flash memory, then reading them; which (now) obviously causes the entire content to be wiped!

Oh damn; only recovery left to try: turn off tablet; Power + Vol Up to get to "dead droid" splash; and the Power + Vol Up + Vol Down (or some other combo) - and I could see that `/sdcard` files were still live and listed! Boy, I better back that up ... but if I couldn't do it with `adb backup` earlier, I would be even less able to use it now ...

Then I found https://stackoverflow.com/questions/19908641/how-do-you-use-force-adb-to-backup-without-user-confirmation, which suggests:

```
sudo adb shell dd if=/dev/block/bootdevice/by-name/boot > boot.bin

```

Well, I didn't have `dd` before, and now I don't even have `shell` \- so nope ...

Funny enough, as suggested in https://stackoverflow.com/questions/10050925/how-do-i-adb-pull-all-files-of-a-folder-present-in-sd-card -- I could still use `adb pull` to copy files from sdcard; but:

```
$ ../adb pull '//sdcard'
adb: error: cannot create '.\sdcard\Android\data\net.nurik.roman.muzei\cache\artcache\net.nurik.roman.muzei_com.google.android.apps.muzei.gallery.GalleryArtSource\file__external_images_media_16730_a40e97f6903cd2217b225c5fcec4cfcc_6d89a17d2a7ee168c95d93662a817314': Not a directory
pull: building file list...

```

So, this *might* have worked - unfortunately, `adb` breaks the process at first error, and apparently also `/sdcard` got corrupt ...

To solve this, ADB pull stops after first error suggests `tar` \- but yeah, I do not have `tar` anymore, as it resided on the wiped `/system` ... I also found a suggestion for:

```
$ ../adb-sync --adb=../adb --reverse //sdcard/ .
INFO:root:Sync: local b'.', remote b'//sdcard/'
ERROR:root:Device not connected or not working.

```

Yup, this also uses `/system` commands, which are now wiped...

And finally, this https://stackoverflow.com/questions/29442630/copy-full-disk-image-from-android-to-computer helped:

> As said in comment, `adb pull /dev/block/mmcblk0 mmcblk0.img` worked for me

Nice:

```
$ ../adb pull //dev/block/nanda nanda.img
//dev/block/nanda: 1 file pulled, 0 skipped. 5.9 MB/s (16777216 bytes in 2.702s)
...
$ ../adb pull //dev/block/nandj nandj.img
//dev/block/nandj: 1 file pulled, 0 skipped. 4.3 MB/s (5519704064 bytes in 1237.721s)

```

Yup, got all `nand` devices now; quick check:

```
$ for ix in *.img; do echo "$(du -hs $ix); $(file $ix)"; done
16M     nanda.img; nanda.img: , code offset 0x0+3, OEM-ID "        ", sectors/cluster 4, root entries 256, sectors 32768 (volumes <=32 MB), Media descriptor 0xf8, sectors/FAT 32, sectors/track 0, dos < 4.0 BootSector (0x0), FAT (16 bit)
16M     nandb.img; nandb.img: data
32M     nandc.img; nandc.img: Android bootimg, kernel (0x40008000), ramdisk (0x41000000), page size: 2048, cmdline (console=ttyS0,115200 rw init=/init loglevel=8)
512M    nandd.img; nandd.img: data
1.2G    nande.img; nande.img: Linux rev 1.0 ext4 filesystem data, UUID=57f8f4bc-ffffabf4-655f-ffffbf67-946fc0f9fffff25b (extents) (large files)
16M     nandf.img; nandf.img: data
32M     nandg.img; nandg.img: Android bootimg, kernel (0x40008000), ramdisk (0x41000000), page size: 2048, cmdline (console=ttyS0,115200 rw init=/init loglevel=8)
256M    nandi.img; nandi.img: Linux rev 1.0 ext4 filesystem data, UUID=57f8f4bc-ffffabf4-655f-ffffbf67-946fc0f9fffff25b (extents) (large files)
5.2G    nandj.img; nandj.img: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "android ", sectors/cluster 8, sectors/track 63, heads 64, sectors 10776527 (volumes > 32 MB), FAT (32 bit), sectors/FAT 10504, serial number 0x7d690be0, label: "CRANE      "

```

Nice, so apparently `nandj` here is `/sdcard` ... Now I can `fsck` the image files instead, but I have to boot to Linux for that ...

---

Right, so - as per https://askubuntu.com/questions/1147586/identifying-the-file-system-of-an-img-file-and-mount-it , it turns out that the images which are Android bootimg are mountable as sysfs:

```
$ mkdir /tmp/nandc
$ sudo mount -t sysfs -o loop nandc.img /tmp/nandc
$ ls /tmp/nandc
block  class  devices   fs          kernel  power
bus    dev    firmware  hypervisor  module

$ mkdir /tmp/nandg
$ sudo mount -t sysfs -o loop nandg.img /tmp/nandg
$ ls /tmp/nandg
block  class  devices   fs          kernel  power
bus    dev    firmware  hypervisor  module

```

However, since sysfs is is a pseudo file system provided by the Linux kernel, there seems to be no `fsck` for it. So, we can only do a file system check on the ext4 and DOS partitions.

```
$ e2fsck -p -f nande.img
nande.img: Directory inode 61534, block #0, offset 0: directory corrupted

nande.img: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
    (i.e., without -a or -p options)

$ e2fsck -f nande.img
e2fsck 1.45.5 (07-Jan-2020)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Directory inode 61534, block #0, offset 0: directory corrupted
Salvage<y>?
...

$ e2fsck -y -f nande.img
...
Free inodes count wrong (71634, counted=71639).
Fix? yes

nande.img: ***** FILE SYSTEM WAS MODIFIED *****
nande.img: 5161/76800 files (4.9% non-contiguous), 204247/307200 blocks

$ e2fsck -f nande.img
e2fsck 1.45.5 (07-Jan-2020)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
nande.img: 5161/76800 files (4.9% non-contiguous), 204247/307200 blocks

$ e2fsck -y -f nandi.img
...
nandi.img: ***** FILE SYSTEM WAS MODIFIED *****
nandi.img: 11/16384 files (0.0% non-contiguous), 2089/65536 blocks

$ e2fsck -f nandi.img
e2fsck 1.45.5 (07-Jan-2020)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
nandi.img: 11/16384 files (0.0% non-contiguous), 2089/65536 blocks

$ fsck.vfat nanda.img
fsck.fat 4.1 (2017-01-24)
nanda.img: 44 files, 4188/8171 clusters

...
  Bad short file name (╗ö2╜Uδ┐F.pAñ).
1) Drop file
2) Rename file
3) Auto-rename
4) Keep it
? 3
...
Orphaned long file name part "img-28773653"
1: Delete.
2: Leave it.
? 2
Reclaimed 98484 unused clusters (403390464 bytes).
Free cluster summary wrong (321342 vs. really 419828)
1) Correct
2) Don't correct
? 1
Perform changes ? (y/n) y
nandj.img: 2483 files, 924607/1344435 clusters

```

So, quite a bit of corruption - unfortunately, repeated fsck of nandj does not seem to clear the errors ...

Regardless, I have as good nand backup as I can now, so I can try "wipe data/factory reset" from the Android system recovery \<3e\> menu ... Unfortunately, the end result now is:

```
-- Wiping data...
Formatting /data...
Formatting /cache...
E:failed to mount /system (Invalid argument)
Data wipe complete.

```

Eh, so apparently you cannot recover `/system` on this device ...

So my best bet now, is to somehow find the original firmware to restore.

In summary: the old battery, upon failing, probably caused some flash corruption -- which was first revealed upon the installation of the new battery. In spite of my error of wiping `/system`, it was corrupt to begin with, and factory reset would not have helped even if I did not make the mistake of wiping it.
> 1 votes

---
Tags: battery, screen, tablet, graphics
---


title: Problem restoring my .ab backup file

text:
# Question
Title: Problem restoring my .ab backup file
I know this might be duplicate but I couldn't find any relevant solution myself.

Today I tried to be adventurous and install Ubuntu Touch on my Nexus 7 and it was a failure. As a safety measure I backed up my device's data using the following command on a Windows 7 OS:

```
adb backup all -f ./nexus.ab -shared -apk

```

It took forever and created a 1.6GB file (sounds reasonable to me). But the thing is, when it was done even though the back up screen on my device was gone but the command didn't return in Windows and I had to press ctrl+c.

So I went through my adventure and in the process I had to unlock my bootloader and as a result all my data was wiped out (I read that it will happen and I was ok with it since I had already backed up my data). Once I was through with my adventure (and failed), I tried to restore my data using the following command (on the same machine as I created the back up):

```
adb restore ./nexus.ab

```

It takes for ages and after it is done, it prompts nothing (no success or failure). I can tell that it is done since the restore screen on device will be gone and the command will return in Windows. But when I turn on my device it's the same as it came out of the box. So is there any hope left? How can I make sure if my back up file is corrupted or everything is going fine? Do I need to do anything after my back up file is restored?

# Answer
Try looking at the `logcat` output. I had a similar issue with multiple devices (all of the same manufacturer, though not yours) -- and it turned out they obviously had a bug in ADB implementation (`logcat` showed a parse error for the backup file).

If your situation is comparable (some ADB bug on your device's firmware), you can forget restoring that backup *using ADB.* Still, there are alternatives:

As you can read in the tag-wiki or our tag, there are other apps which can read and restore from ADB backups. Such as e.g. Titanium Backup. I'm not sure if this feature is reserved for the Pro version, but it's at least worth a try with the free one. And even if, this app is worth buying. Note, however, that **your device must be rooted** for this.

Copy your `nexus.ab` to the SDCard of your Nexus (I know it has no microSD slot, but the internal SD should do). Then use *TiBu* to restore from that backup file. You might not be able to restore *everything* (I never tried, so I'm not sure how far it goes) -- but at least your apps and their data should be able to get restored.

A second way (to be used for the remaining things) is to manually unpack the backup archive. Details can be found here:

You might also wish to consult other questions tagged "adb+backup" for additional information.
> 3 votes

# Answer
Use `adb logcat` command to check system log for exceptions during the restore process. Try looking for BackupManagerService messages like these:

```
I/BackupManagerService(  716): Reusing existing agent instance
D/BackupManagerService(  716): Invoking agent to restore file fbreader.ui.xml
E/BackupManagerService(  716): Unknown tar entity type: 76
E/BackupManagerService(  716): Parse error in header: Unknown entity type 76
W/BackupManagerService(  716): io exception on restore socket read
W/BackupManagerService(  716): java.io.IOException: Unknown entity type 76
W/BackupManagerService(  716):  at com.android.server.BackupManagerService$PerformFullRestoreTask.readTarHeaders(BackupManagerService.java:4117)
W/BackupManagerService(  716):  at com.android.server.BackupManagerService$PerformFullRestoreTask.restoreOneFile(BackupManagerService.java:3406)
W/BackupManagerService(  716):  at com.android.server.BackupManagerService$PerformFullRestoreTask.run(BackupManagerService.java:3282)
W/BackupManagerService(  716):  at java.lang.Thread.run(Thread.java:841)
D/BackupManagerService(  716): Killing host process
I/BackupManagerService(  716): Full restore processing complete.
D/BackupManagerService(  716): Full restore pass complete.

```

In above example, you find a message `E/BackupManagerService: Unknown entity type 76`. It means that the .tar archive inside the .ab file was created with GNU version of the tar tool and used GNUTYPE\_LONGNAME ('L') in a file's header.typeflag field, which is not understood by your Android's BackupManagerService. Using `tar --format=posix` should fix the problem.
> 1 votes

# Answer
As said in `tomasz` answer it may have to do with format of tar archive, but using `posix` format didn't help me and i still got errors, after trying diffrent formats i find out that `--format=ustar` (which is older posix format) works just fine, since it doesn't create any PaxHeaders which break stucture of archive.
> 0 votes

---
Tags: nexus-7, restore
---