# Question
Title: 32-bit and 64-bit Android: how to tell before buying a phone
I have been looking into 32-bit or 64-bit Android versions for phones. It seems to me that the information on the number of bits of the installed Android version is always missing from phones' specs, unlike what happens for the CPU. Googling around, the ways I have found to understand whether a phone is running a 32-bit or a 64-bit OS all include actually doing something with the phone, like looking up the kernel version or downloading some app, like AIDA64.

How do I know if a phone I want to buy will come with a 32-bit or a 64-bit Android *before I buy it*? It would be interesting to find a *layman-friendly* criterion or resource that allows me to know this in advance, especially to be able to look into the cheapest phones running a 64-bit Android.

# Answer
> 3 votes
One way to know that the OS is 64-bit is to check the RAM. 32-bit OSes have (see/utilise) a maximum of 4GB of RAM while 64-bit devices see more. Devices with more than 4GB of RAM will be using 64-bit Android.

Limits are as followed:

32-bit: 2^32 = 2^2 * 2^30 = 4GB. A 32-bit OS will go 1 bits up to 4GB.

64-bit: 2^64 = 2^4 * 2^60 = 16EB. A 64-bit OS will go 1 bits up to 16EB.

Up to 4GB, the RAM won't help differentiating whether it is 32 or 64-bit. More than 4GB, then it is more than likely to be 64-bit.

Large Physical Address Extension(LPAE) was implemented to allow physical address up to 40-bit. But as @Irfan as inferred, it is not known (at least publicly) if there are devices in the market which have taken advantage of it.

```
Conversion table
-----------------
2^10 = 1 KB
2^20 = 1 MB
2^30 = 1 GB
2^40 = 1 TB
2^50 = 1 PB
2^60 = 1 EB

```

# Answer
> 1 votes
Until the manufacturer doesn't describe the technical specifications of OS included with a device, it's hard to say if it's 32-bit or 64-bit. But a device with 64-bit hardware is expected to come with 64-bit OS (not always), let's take a look how to identify 64-bit hardware.

To find out if a device is 32-bit or 64-bit, you need to check the specifications of its SoC and then of its processor. For instance SoC in Redmi Note 4 is Qualcomm Snapdragon 625 (MSM 8953), which contains processor `Cortex-A53`. It's evident from technical specifications of Cortex-53 that it's based on `ARMv8` architecture, which can process 2 types of Instruction Sets: `aarch64` (which Android's `arm64-v8a` ABI uses) and `aarch32` (which Android's `armeabi-v7a` ABI uses). So the phone is 64-bit, shipped with a 64-bit OS.

On-device processor/SoC information can be checked using some third party app as you have mentioned, or directly from CLI: `uname -m`, `cat /proc/cpuinfo`, `cat /sys/firmware/devicetree/base/model` etc.

**RELATED:** Android apps for “armeabi-v7a” and “x86” architecture: SoC vs. Processor vs. ABI

---
Tags: operating-system
---


# Question
Title: How to power off when charger is removed?
Device: LG G4
Android version: 6.0
Status: rooted

What can I do to power off the device (with a 20 sec delay) when I remove the charger. I tried with `AutomateIt` app, but after first cycle of power off / power on, it doesn't work if I don't open the app again, to run in the background.

I want to use my old phone in a old car, as a GPS device. I make it power on automatically as is described here: https://forum.xda-developers.com/att-lg-g3/general/lg-d3-d850-autoboot-t3714070

# Answer
> 1 votes
Using Macrodroid:

1. On the Triggers tab, under Battery/Power section select "Power Connected/Disconnected", then choose "Power Disconnected".
2. On the Actions tab, under Macrodroid Specific, select "Wait Before Next Action", then set the delay period to 20 seconds.
3. On the Actions tab, under Device Actions, select Reboot/PowerOff, then choose "Power Off". If "Power Off" does not work on your device, choose "Power Off (Alternative)".
4. Save the macro and give it a name.

When completed, the macro will look like the image below. Use the 3-dot to test the macro.

Note: Powering off requires the device be rooted.

**Update:** The way the macro is programmed above does not allow to stop the device from being power off if the charger is connected again before the 20 seconds delay expires. To stop the trigger, a condition to check the state of the device after the delay expires but before the action to power it off.

Edit the macro. Add a new action. Under the Actions, on the Conditions/Loops section, select "If clause". Add a condition. Select "Power Connected" under the Battery/Power section and choose "Power Disconnected", then OK. Click the up and down arrows button on the Actions box, move the "Power Off" action inside the "If...End If". Save the macro. The macro will look like the image below.

# Answer
> 0 votes
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

is_charging()
{
    [ $(cat /sys/class/power_supply/battery/status) = Charging ] || return 1
}

# keep waiting
while is_charging; do sleep 1; done

# charger is disconnected, countdown
sleep 20

# again start waiting if charger is connected
is_charging && exec $(realpath $0)

# else, shutdown
/system/bin/reboot -p charger_disconnected ||
/system/bin/setprop sys.powerctl shutdown,charger_disconnected

```

# Answer
> 0 votes
Try Automate (free):

1. Power source plugged block
2. Delay block; 20s
3. Device shutdown block (rooted device required)

---
Tags: 6.0-marshmallow, root-access, automation, power-on
---


# Question
Title: How to get my phone to access WIFI channel 13?
My phone can't see Wifi 2.4 Channel 13. Why? How can I fix it?

I have an android phone (Moto E4, Android 7.1.1, Not rooted) that was purchased in the US about 12 months ago. Just after purchase,I came to China for a few months, and it worked perfectly on the Wifi here in my home. I had a Chinese sim card. I don't know what channel my home Wifi was working on last year.

In September, I returned to the US and swapped out the sim card for a US carrier. It continued to work perfectly.

I have just now returned to China, and my phone no longer can see the wifi signal in my home. When I look on my PC, it shows that the Wifi is transmitting on channel 13. When I look in my android app "Wifi Analyzer" it shows a blank space for channel 13. (Also, I forgot my Chinese sim card in the US)

Is this a hardware or a software issue? How to fix this?

# Answer
> 4 votes
My phone can now detect ch 13 on 2.4 GHz wifi.

Here's how I did it. I borrowed a local sim card. As soon as the phone booted up, if was able to see the wifi signal. I confirmed that it indeed was on ch 13 with both wifi analyzer and on my pc.

I have since removed the borrowed sim card, and the phone continues to see channel 13. So indeed, as suggested in the comments by @Robert,

> auto detection of the country you are in e.g. via used SIM card

Is the correct answer.

# Answer
> 1 votes
WiFi Channels are a regionally/country regulatory issue.

In the United States the 2.4 GHz bands are 1 through 11.

You can either:

* Change your router's 2.4 GHz band to fit the U.S. firmware/ROM limitations.
* Switch to using a router on the 5 GHz band as there is overlap with China and the United States.
* Risk bricking your phone with a Custom ROM. Note that the Moto E4 appears to have only U.S. and European versions, and each version is using a different CPU manufacturer so trying put International ROM on a U.S. phone would not work and may brick the device.

---
Tags: wi-fi, localization
---


# Question
Title: 2-step Verification No Popup only hear the sound?
The 2-step verification used to work. But today, when I sign in the account, my android device does not popup the verificaiton window at all. I only hear the notification sound, but no popup and no notification at all. This is just weird.

All special actions I did after its last working time are (1) create a second user account on android mobile (2) this is dual-sim cards mobile. I removed my primary sim card.

I am not sure if the above two actions are the cause or not. But I do hear a notification sound, but with no popup window at all.

So What is the problem? and How can I do the 2-step verification now?

Thanks a lot.

# Answer
I found the solution. I have disabled some permission on Google play services. This is used to work well. BUT maybe due to google play services upgrade automatically or something else I don't know, it no longer works with some permissions disabled. After enabling all permissions to Google play services, it works again.
> 1 votes

---
Tags: 2-step-verification
---


# Question
Title: Is it true, that Trump sanctions as of 01.06.2019 have started battery drainage on Huawei Android mobile phones?
It is 1st of June 2019 and new round of sanctions have started under Trump. And severe drainage of battery of my Huawei Android phone has started as well. 20% of batter is gone under just 1 hour. Android System is the main user of battery - around 30%, then WhatsApp follow with 23%. Remaining apps consume less. I have pending update from Android 5.x to Android 6.x on my device but there is button to download this update and I have choosen not to do any activity. Why such unexpected drainage. Is it due to Trump?

p.s. and my Grindr application is ceased to start as well. Who knows what else will happen?

# Answer
No, it not because of Trump. Why? Because Huawei was granted 90 days during which it will still continue to support equipment.

> The Trump administration is working to ban Huawei products from the US market and ban US companies from supplying the Chinese company with software and components. The move will have wide-ranging consequences for Huawei's smartphone, laptop, and telecom-equipment businesses. For the next 90 days, though, Huawei will be allowed to support those products. The US Department of Commerce (DOC) has granted temporary general export license for 90 days, so while the company is still banned from doing business with most US companies, it is allowed to continue critical product support.

Even if it was not granted an extension period, I don't see how suddenly the battery will start draining.

By the way, Huawei and Google are still working together on security issues during the 90-day exemption

> The 90-day license means Google can work with Huawei again on smartphone updates. A Google spokesperson told CNBC, "Keeping phones up to date and secure is in everyone's best interests, and this temporary license allows us to continue to provide software updates and security patches to existing models for the next 90 days."

From the second listed source:

> Existing owners of Huawei smartphones can continue to enjoy Google apps and services, such as Google Maps, Gmail and YouTube. They can still use the Google Play Store and receive security and software updates for Google apps and services.

> Existing Huawei smartphones, like the recent Huawei P30 Pro, will continue to have access to Google apps and services, as well as security updates. But Huawei may not be able to update the Android software to the next version promptly, if at all.
>
> Since most Android smartphone makers, such as Samsung, take months to update the Android software with the latest features, consumers may not be overly concerned about this.

In mid August, if the exemption is not renewed, your battery will still work fine (assuming it is not old or damaged already).

Check your running services and processes to find out what is causing the battery to drain.

You question will be great at Skeptics StackExchange.

Source:

1. The US DOC gives Huawei a 90-day window to support existing devices
2. Huawei barred from Google updates: What you need to know if you own a Huawei or Honor phone
> 2 votes

# Answer
I have Huawei P9, been going grand for a few years, I kept it on old Android version, heavy ish use though loads of apps installed battery would last a day, less if I had maps/gps route tracking.

Tuesday this week 25/6/2019 quite inconveniently big battery drain started happening. Google Play Services listed as top user along with Android OS. I did a big cleanup, got rid of some big apps, got rid of an unused account, tightened up on apps, upgraded OS.

Then finally **disabled automatic app updates.** This seemed to stop the battery drain!

The OS upgrade has changed look/feel but has made phone have faster response which is also a good thing.
> 1 votes

# Answer
This is just political nonsense. Awaiting the day rest of world is bleeding out of rare earth minerals now, china has the monopol.. good by apple, hello huawei :D Check your background data usage, then you will know who is leading the war of data gathering. Delete Instagram Facebook and WhatsApp, this will really save your battery (and privacy)
> 0 votes

---
Tags: updates, battery, huawei
---


title: Android system battery drain

text:
# Question
Title: Android system battery drain
My android phone has heavy abnormal battery drains coming from Android system. **2000mAh and above on a single charge! I know for certain this is a software issue and not hardware.**

Before I hit the sack. Battery was around 96%, next morning 80%! Normal overnight drains on my mobile model is 1-2%, I am having around 15%.

1. During sleep, All my radios are usually off (WiFi, NFC, Bluetooth, Data, location), except phone.
2. My phone seems to be in deep sleep a good portion of that time (See WLD statistics - attachment #1).
3. Android system sucks my battery during sleep and it was at 90% relative consumption when I woke up (See screen shot #1, **Android sys has consumed 1840mAh in such a short time span!! This is ridiculously high for a phone that is apparently in Deep Sleep!**)
4. Also attached screen shots from WLD for Summary, Kernal / Partial wakelocks & Alarms.
5. Device is rooted.
6. Google sync is off, Backup is off.

I have searched all over. Read numerous threads from numerous forums. Some users have faced this issue on the same ROM while some others haven't. I have done my "homework". But this is one issue that I do not see any solutions wherever I look. I have searched days, not hours!!

Hence I decided to post over here. This is my hail mary attempt at solving this. If the experts here can't solve it, then I guess it would be pointless to search anymore.

**What is the issue that is causing this battery drain from Android System?** I have noted that many users using my model (Huawei Mate 8) do not face this issue, while some users do face it.

# Answer
Disabling automatic app updates has, for me, solved a severe battery drain problem that started a few days ago. Huawei P9.

For me Google Play Services and AndroidOS were the top users of battery.
> 0 votes

---
Tags: 6.0-marshmallow, battery, bugs, troubleshooting
---


# Question
Title: Google Services is killing my battery by keeping phone awake
In the last few days my Galaxy S3 has gone from lasting 12-13 hours to about 6 hours. On checking the battery monitor it seems to suggest that the phone is constantly staying awake and that Google Services are to blame.

I was recently experiencing real problems with Google Chrome freezing the phone so I have uninstalled and gone back to the native browser but the battery issue persists...

Has anyone experienced anything similar....is a factory reset the only solution? (Android version 4.1.1)

# Answer
After trawling through all manner of options I isolated the root cause of this issue.

Within Google Account Sync I had a look at all available settings and the one that seemed to be causing an issue was 'Sync Internet' option which was just constantly running (and appearing to be keeping the phone awake.

Switching this off has got back my battery back to normal.

I still have no idea why my phone was trying to sync the ***entire*** internet :-)
> 9 votes

# Answer
To add to Dean's answer, I also had a number of Android apps that drained my battery by using Sync all day long. The apps listed in your Accounts tab under Settings all sync through Google Services. By using Tasker, I scheduled Sync to run every hour for 3 minutes. My battery life improved significantly after that. Here is the recipe for the Tasker profile:

Sync Scheduler Profile

* Time: From 06:00 Till 23:00 (repeat every 1h)

Task

* Action 1 (optional): Notify \[ Title: Sync Scheduler, Text: Now Syncing!, Icon: your choice \]
* Action 2: Auto-Sync \[ Set:On \]
* Action 3: Wait \[ MS:0, Seconds:0, Minutes:3, Hours:0, Days:0 \]
* Action 4: Auto-Sync \[ Set:Off \]
> 1 votes

# Answer
Just wanted to thank Dean for his answer. "Google services" was draining my battery like crazy as well, and after turning off a bunch of Google account sync options - including "Sync internet" - my S3's battery life has noticeably improved. I now only sync email, calendar, and contacts. (I also outright disabled the Google Search app, though, which includes Google Now, so that could be playing a part as well.)
> 0 votes

# Answer
I don't see this answer here, so adding this as the problem described is similar to a problem that I had just this week.

Battery drain started happening for my huawei p9 a few days ago all of a sudden, no apparent cause. Google Play Services top battery user but also a variety of other apps.

A suggestion to **turn off automatic app updates** solved the problem for me (after I had done general cleanup and os upgrade and removed a google account(for which authentication was out of date) which had not solved problem).
> 0 votes

---
Tags: samsung-galaxy-s-3, battery-life, google-apps
---


# Question
Title: Gmail suddenly not showing recipient names in "Sent" folder
The Sent folders in Gmail on both my Galaxy phone and my Nexus tablet are suddenly showing only "me" as the sender.

I want to quickly see who I sent them to without having to open every one to look at the details.

Is it a bug? Otherwise, is it possible to fix/workaround this?

# Answer
> 2 votes
It is a known issue. You can use the app feedback to send a report to Google. To my knowledge, there is no fix. You will just have to live with it until they fix it, which considering the post date on some of the places that others have complained, it might not get fixed anytime soon.

Other places this issue has been posted at:

Sent folder showing sender instead of recipient - 9/12/18

Sent Items Show Sender Not Recipient In Sent Folder - 3/17/17

Showing recipient name in the sent label/folder in Gmail on Android - 2/4/14

# Answer
> 0 votes
Very annoying problem. I noticed it recently. Until Google fix it, one solution is to use another mailbox company who isn't plagued by this problem (Yahoo, for instance) and switch your gmail account there. Not perfect but if enough people do it, maybe Google will start working on it.

---
Tags: gmail
---


# Question
Title: Can android device issue adb commants to itself?
I made a simple shell (actually windows batch) script that automates a task on android phone. It can be ran on any computer. I thought that if I convert the batch to linux `sh` script, I could issue the commands without `adb shell` before them.

So this (`.exe` added for clarity):

```
adb.exe shell sleep 1

```

becomes this:

```
sleep 1

```

Well it works with `sleep` in particular, but not with `sendevent`. I made a script to press and release focus button:

```
#!/bin/sh
# Simply send two key events to see if it works (spoiler: it doesn't)
sendevent /dev/input/event0 1 212 1
sendevent /dev/input/event0 0 0 0
sleep 1
sendevent /dev/input/event0 1 212 0
sendevent /dev/input/event0 0 0 0

```

But I cannot execute the `sendevent` commands:

That's ridiculous. Obviously my phone is capable of executing the commands from external source, so why the hell not from itself? Am I going to need a computer to work with the shell?

What can I do to issue adb commands to my own phone? (**I am not using rooted device.** Android developers made it too much painful to achieve.)

# Answer
> 1 votes
Adb is a two-part system, the "ADB" command that runs on your computer, and a daemon that runs on the device to receive the commands you send to it.

To run it on the device you need a version of ADB that is compiled to run on the device. There are several of these on the play store (Search "Adb Shell") on Google Play, such as Adb Shell.

There is also an "ADBLib" by Cameron Guzman on GitHub that can be compiled into an Android App and allow run Adb Shell commands from there.

# Answer
> 0 votes
on a rooted phone you can do this by download linux deploy termius and any adb over wifi app on the play store all you have to do is set up linux deploy on Debian with root as the user name and ssh access. connect to it with termius run sudo apt-get install adb when that finishes turn on the adb over wifi app go back to termius adn type adb devices it should come up with emulator-5554 device during this prosess it may ask you to athenticate the rsa key just say yes ass well as tick the box that says always then you can run your adb commands

---
Tags: adb, terminal
---


# Question
Title: How to prevent an app's notification from updating while the screen is off?
I have a bootleggers ROM (Android 9 pie) installed on a Motorola Moto E 2015 phone. I have a setting, enabled in adaptive display settings, which makes the screen to turn on, when a new notification is received. It is a good feature, but my music player (AIMP) updates it's notification each time a new song starts playing, which makes the display to turn on (pulse) often and use additional battery. I could avoid that by turning off the notifications for AIMP completely, but I want to see the notification when the screen is on.

Is it possible to prevent the notification from updating while the screen is off?

Another way to solve this would be to turn off the notifications for AIMP, when the screen is turned off, and then turn them on again when the screen turns on (using tasker, for example). But the drawback of this approach is that once turned on, the notification does not appear until the next song, so it is not possible to see the current song in the notification this way.

# Answer
The preferred way would be if your media player has an option in it's settings to disable notifications, do it that way.

The other method would be to use the embedded features of Android to disable the notifications, when a notification from your media player pops up, pull down the notification shade and long-press the notification tile, and select "Stop Notifications". This will disable the notifications by taking away the apps permissions to do so. To re-enable notifications, go to Settings - Apps and find the apps, and turn the notifications back on there.

Otherwise the device is working exactly as designed with the settings you have.
> 0 votes

# Answer
So, this may not be the most sophisticated solution, but I managed to do this by using the Automate app. This is not a universal solution for every app's notifications either, but it works for controlling a music player's notification (for AIMP at least), and that was what I wanted to do.

I used the "Display on" block to check when the screen is turned on or off. Also I added the condition to check if music is playing (using the "Media playing" block), so the notifications are only toggled on and off when the music is playing. And for the actual toggling of the AIMP's notifications I used the block "App notifications set state". Finally, to make the AIMP notification actually appear after it was enabled, I used the block "Audio player control" twice to pause and then immediately play the music again. This way the notification appears without waiting for the next song to start, and since the pause and play actions are executed in sequence without a delay, there is no audible pause in the music.

Currently, the only thing I would like to improve is to change the condition which checks if music is playing to a condition which checks if the music player app is started and would only then check when the screen is turned on and off. In hope that it would help save some battery. But I will have to see if there is a difference in battery consumption with my current Automate flow enabled and disabled. Maybe the constant check for screen on/off doesn't affect the standby battery consumption.

Also, I have to note, that I had achieved the same result using Tasker and Secure settings plugin. But it seemed this approach was not as responsive as Automate's way. This may be because my phone is quite low spec and there would be no difference on a more powerful device. But based on my short experience with Automate, it seems to be better optimized for my device and my typical usage. Probably because Tasker has to use an additional plugin and Automate has the functions I need built in. Though, if anybody's interested in the Tasker way, I may edit the answer to include it in more detail.
> 0 votes

# Answer
Nice question you have there. To solve that, I recommend you using Automate, which, apparently, you already do. You want to prevent your Music App from flashing the Ambient Screen every time it sends a notification, and you want to have that solved with Automate in a way as efficient as possible. First of all, it is important to have a Flow that only runs when your Media Player is running. As you cannot set "Media Player Running?" as a condition to start your flow (You could make another flow that waits for your Media Player to start, but any way, you always have one flow running all the time), you can do a little workaround: You can start flows just WITH your Media Player App by using Automate. Make a flow that starts your Media Player AND the flow that enables/disables notifications later on:

This flow, when launched will start the Media Player and another flow that I'll show later on. Now: On the default Android Home Screen, you can add Shortcuts. For that, you can go into the Flowchart Editor, click the Flow Beginning block and then "Install Home Screen Shortcut". When you choose the flow we just created, you can open the flow and the media player by clicking on your new home screen button.

Now, we still need to properly control the notifications to prevent them from appearing while the screen is off whilst considering your wishes. Automate CAN check whether an app is running or not. When using the flows the way I described in here, we know that the Media Player WILL be running. What we can do is to stop the flow when it detects that the Media Player has been closed.

We want to prevent the Media Player from posting notifications while the screen is off. So, what we can do is to prevent the player from showing notifcations at all. We have a condition: Player Update == true | AND | Screen == 'on' But, we are smart: We can simply wait for the player update, and THEN wait for the screen to turn on. This is most power efficient way. We have one programming step each time the track changes/is paused/is resumed/etc - We simply force a notification each time the track changes, or when the screen is turned on the next time after the last track change.

You are using the "Enable Notifications" block. In my example I chose "App OP mode set" which is because I use that block a lot for other things, but your block should be fine too. NOTE: Disabling notifications whilst the screen is on might cancel the notification. If that applies to you, and the flow immediately cancels the notification after the Media Player posted it, you have to add a block that waits until the screen is turned off again. ANOTHER NOTE: The first "Is Display On" is set to 'Immediately', whilst the second one is 'When changed'. This together makes a "Wait until: Screen On". You could also do that by using a "Is Display On" block set to immediately, where NO connects back into the input of the block, thus create a loop, but we don't want to have that.

Now, for battery efficiency we want to stop this flow when the Media Player is stopped. I thought it would be easy, but actually isn't. Automate has blocks to see which app is in foreground, but doesn't directly offer blocks for "Process running?". This has two obvious workarounds: Shell Commands. Linux offers the "ps" command to view running processes, and Automate can run Shell Commands, but there is a way much easier than that: Android Usage statistics. Android holds record of when which app has been used. We can make use from that and determine whether the app is being used right now. Because, when the last time it has been used is longer than 60 seconds ago, we can safely assume that it is closed right now. So, we check whether the app is running by comparing "App last time used" to "Current Time", and if these values are about the same, the app IS running.

With the "App Usage" block we can determine the moment an app has been used, and assign that value to a variable. I called it "Time". You get that block, and choose your Media Player as app package. The timestamp values can be ignored. With the "Expression True" block, you can now compare that value to current time:

I also added a 5 second buffer. Between the moment the app usage data is retrieved and the moment this block will be checked will pass some time, which might lead to the effect that it will always say that "Last Time Used" is smaller than "Now". NOTE: "Now" is a built-in variable. You do NOT need to replace that one.

Should the result be NO (App Running), it will wait 2 minutes until it asks again. I thought about a "Media Playing" set to "When Changed" block, but that would collide with the five seconds buffer. Should the result be YES (App not Running), it will proceed into a "Fiber Stop" block. With that block, you can stop specific fibers, even in other flows/scripts. All you need to do is to enter the URI the Notification Control flow has. You can find that one by going into the script of the Notification Control flow, clicking on the Flow Beginning block and scrolling to the bottom.

After all, you now have two flows: The first flow opens the Media Player and the Second Flow, then waits for the Media Player to stop and then cancels the Second Flow. The second flow controls the Media Players' notification by disabling them entirely, waiting for a track change, then forcing a notification, but only when the screen is on.

NOTE: My player is weird (I don't like to use it in general) and only reacts to Play/Pause. Usually, when you have an "When Media Playing" block set to "When Changed" it reacts to track changes. With my current player, it doesn't. Should you have the same problem, you can save music title into a variable and periodically compare that title to the title of the current track. I hope it doesn't have to come to such a thing. Good luck!
> 0 votes

# Answer
I have read through the comments of the other answer that has been posted and can come up with an answer: Yes! Just keep in mind that this solution DOES NOT feature Media Player control buttons.

What we want to do is two things:

1) Prevent the Media Player from posting Notifications while screen is turned off

2) Create a Notification when the screen turns back on, and only when the media player hasn't already created one. PLUS, delete our own notification as soon as soon as the Media Player posts one again.

The first thing is easy:

Utilizing the power of a "Display On?" block set to "When Changed", can precisely enable or disable notifications for your player app. When the screen state changes to off, the fiber will proceed through No. The AppOp block disables the permission to post notifications. You used the Allow Notifications block before, you can use that one either. After disabling them, the fiber returns into the "Display On?" block. Now, when the screen changes into "Turned On", it will proceed through Yes and execute the other AppOp block, enabling notifications again.

Now, this script is easy and will be running alongside our script that creates a notification as soon as the screen is turned back on. This will come in the second part:

The "Display On?" block at the very top is the first block we need. It is set to "When Changed" and only proceeds when the display is TURNED ON. As soon as that happens we want to know whether the Media Player has already posted a notification. To do that, we can use the "Notification Posted?" block (which, in the flow is labelled "Has notification"). It is set to Immediately and simply asks whether an app has posted a notification or not. Our app in this case is your Media Player. You need to write that into the block. If it already has, we don't need to create a notification, so the fiber returns to "Display On?". If it has NOT created a notification, we proceed to create our notification.

You want that notification to tell the Title and the Artist and or Album of the current running track. To find that info, we use the "Media Playing?" block set to "Immediately". You can assign a lot of values to variables, including Title, Album, Artist, Duration (in sec), Current Position (in sec) and more. Only Title, Album and Artist are relevant for us now.

Now, you need to listen up. We cannot simply tell Automate to cancel the notification after "Time X" (Timeout) or when "Media Player Changed". We need to do that manually. Automate does not feature a Timeout option for notifications (I'm not sure, but I think it did a long time ago..). So, we make one script that posts the notification and waits until it is clicked to open the Media Player, and make another one that CANCELS this notification as soon as the Media Player posted one by itself.

The script on the left creates a notification. It is set to "When clicked".

In this notification, you can set Title and Message. Instead of entering plain text, you can also use the content of variables, as known from java.println(). Be sure to go into Variable Enter mode, as it will otherwise process "Title" as text. You would then see "Title" in the message of your notification, not the content of the variable.

After that block, we can proceed. When you click the notification, the fiber will proceed through Yes and go into the "App start" block. In here, you can enter the package of your app. So, as soon as your notification is clicked, it will open the Media Player. PLUS: The notification already shows the title, album and artist of the currently running track. Now we just need to cancel the notification.

We cannot just wait until the Media Player has posted a new notification. That is important! We must wait until the TRACK HAS CHANGED.

In this part of the script, the fiber enters the "Media Playing?" block. This one is set to "When Changed" no further input arguments (other than the app package). It is just there to wait until the track has been changed or paused. As soon as that happens, we now want to remove our notification. To remove a notification using the "Notification Cancel" block, we need to specify the ID of the notification we want to remove. We don't have it, right now. BUT, the "Notification Posted?" block can help with that. We use the "Has Notification" block, and check whether the com.android.automate has posted a notification, and if yes, assign its ID to a variable. NOTE: Beware of the "Running..." notification! If you don't have it disabled already, you should do that now. Automate might return the ID of THAT notification, which is not the one we want to remove.

Now, the fiber continues into the Notification Cancel block, in which you need to enter the ID variable. As soon as the notification is cancelled, the Notification Show block will proceed through the NO-Path. This one leads back to "Display On?" at the beginning.

NOTE: We cannot wait for the Media Player to post a notfication instead for the track to change! Would we wait until the Media Player posts a new notification, we could have THIS scenario:

Screen On - Automate posts notification - Screen Off (Automate Notification persists) - Media Player track changes (but does not send a notification, because the screen is off) - Screen On - Automate still shows the notification from the track before (The notification is outdated).

The "When track changes" will delete Automates' notification. When the screen is on, the Media Player will post a new notification. But when the screen is off, our current notification will be deleted, and a new one created as soon as the screen is turned back on.

Here is the entire script with all of its parts. NOTE: Be aware of these Fork blocks. I haven't mentioned them in the answer.

I've uploaded this script to the community. You can find it HERE. You now simply need to change the values in the blocks and the names of the app packages.

I hope this helps you! Good luck!

EDIT: This script does not include features my other answer did. This script does not automatically stop as soon as the Media Player is closed. And so far, you also need to start this script manually. Both things could be included though.
> 0 votes

# Answer
I've finally found the ultime answer to your question. I didn't think it would be that simple. I was blinded by the thought that immediately pausing and resuming playback would create an audible interruption. But you said it doesn't, so here it is:

Simply disable notifications when the screen is off, re-enable them when it does back on and force the first notification. Done.

One thing I kept thinking about: What if there was no playback? Any way, every time you turn on your screen, this script would resume playback. Even if you just paused it for a minute. That problem would be easily solved by asking for Media Playback right after the "Screen On?" block. Should it return "No" by proceeding through that path, you would just go back into the Display On? block.
> 0 votes

---
Tags: notifications, 9.0-pie
---


# Question
Title: How to fix phone always booting into recovery even when system exists
I installed CM 14.1 on a Nexus 6 and the first update booted into TWRP automatically to install but failed.

I manually installed the zip from the cmupdater folder and rebooted.

Now every time I try to reboot my phone or power it on from powered off it goes straight into TWRP.

Currently I have to boot into the bootloader and choose the `Start` option to get into my system.

Tried clearing dalvik/cache & internal storage in case something was cached somewhere. No dice.

# Answer
> 1 votes
Since you've already cleared your internal storage, I assume you backed up your important data already. In that case, flash a factory image and get a fresh start.

Just don't do CM updates via the built-in updater, it's designed to work well only with CM Recovery (which is pathetically weak).

EDIT: From your feedback it seems CM Recovery is what's required to finish the update (or at least get you out of the process). Just flash it and boot into it. Replace it with a recovery of choice later.

# Answer
> 4 votes
Mammuth's comment points to a very simple solution that worked for me, once I adjusted it. Here's what I did:

Go to TWRP recovery terminal commands, and enter the following:

First navigate into */dev/block/platform/soc/*:

> cd /dev/block/platform/soc/

Now take a look at the contents of that folder by typing:

> ls

If all is well, there will be a subfolder named *xx.sdhci*, where the *xx* is a string of numbers, e.g. *7464900.sdhci*.

Now issue the following command, taking care to replace **xx.sdhci** with the folder name found in the previous step:

> dd if=/dev/zero of=/dev/block/platform/soc/**xx.sdhci**/by-name/misc

Finally reboot by typing:

> reboot

This fixed it for me. I hope it works for you as well!

# Answer
> 0 votes
If you can access twrp i sugest to download the last cm version from web and install it doing the same method that used to flash cm for the first time, not update, install gaps and see if boots into cm.

# Answer
> 0 votes
I had this problem on a Motorola Moto Z.

Here's how I fixed it:

1. Make sure fastboot is installed on your computer
2. Boot your phone into bootloader (usually by holding volume keys while powering up)
3. Connect the phone to the computer via an USB cable
4. Issue the following command on your computer: `fastboot oem fb_mode_clear`
5. Power phone off.

The next time the phone should directly boot as usual.

# Answer
> 0 votes
This usually happens when the ROM is not installed properly, try flashing the factory image and start over the process again, install the latest vendor firmware(if there's one) and install the latest TWRP and then flash the ROM file, In my experience you don't have to wipe the internal storage every single time if your device is not encrypted, just the system, data, Dalvik/ART Cache, is enough.

# Answer
> -1 votes
I have LineageOS. And an a/b device, and what i did fixed it for me. Basically i switched from A partrition to B throu twrp then i rebooted

---
Tags: cyanogenmod, recovery-mode, twrp, nexus-6
---


# Question
Title: Wi-fi wont turn on after root. Not even with factory reset!!! please help me
so, my phone went completely bananas today. It was charging and i swear out of the blue a messange showed up saying the sd card memory was being deleted. So in panick i turned it off. The cellphone then turned itself on and showed a message saying android was being deleted, again in panick i took the battery off. When i turned it on, a message with a "dead" android avatar showed on the screen and the boot options screen showed up. I clicked on reeboot and it had been reseted to factory settings. I was so angry and upset because my whole life and work was on my phone. I spent the entire afternoon dedicated into recovering the data. The only software that seems to find my files costed $50. i live in a 3rd world country so thats impossible for me to pay. Then looking online i found another one that seem promising but i had to root my phone for it. in the past i used to be really afraid of doing it but as i had an old phone i rooted once for some trivial stuff i decided to do it. Big mistake. After rooting my wi-fi turned off...for good. When i click the wi-fi switch it turns on for a aplit of a second and back off. i CANNOT turn it on. So i decided to hard reset it again, i mean, i had nothing to lose. NOTHING. I STILL CANT TURN IT ON.

i really need this phone for work, and i do not have money to get a new one. im desesperate. really. i reaaly hope someone can help I understand so little about this but im great at following intructions. I will be so thankfull if anyone can help.

its a samsung Galaxy J5, with android 6.0.1

# Answer
Since you have nothing left on your device, you can try re-flashing the stock ROM by downloading the flash file and flashing it via Odin. It should reinstall the corrupted modem drivers and system files.
> 0 votes

---
Tags: wi-fi, rooting, factory-reset, hard-reset
---


title: Redmi Note 7 factory reset via PC

text:
# Question
Title: Redmi Note 7 factory reset via PC
I was just trying to flash Lineage OS on my new Redmi Note 7, since MIUI kinda sucks, and it didn't really seem to work. So after a few tries and restarts, my phone started requesting the password for an email address I entered into my lock screen when I first got the phone, in case I'd ever lose it and someone would find the person could message me. But as it turns out, the m in my email address' .com is missing and the phone keeps asking for the email's password to start Android instead of the usual PIN code.

I figured I should just try wiping it completely, but after a lot of wasted time and energy, I still haven't found a method to factory reset it. Please help, I know this is a very specific issue, but maybe there is someone here who could just help me out.

# Answer
If you're on Stock Recovery, Reboot into recovery and choose Wipe Data(Factory Reset).

If you're on TWRP Recovery, Reboot into recovery and select Wipe -\> Swipe to Factory Reset.

EDIT: The FRP lock usually gets nuked when flashed under EDL mode, refer to your device forums about booting your phone to EDL mode, usually this will require jumping contacts in the motherboard while connecting phone to the PC, be careful with that.
> 0 votes

---
Tags: rom-flashing, factory-reset, hardware, rom, xiaomi
---


# Question
Title: Differences between fastboot erase and fastboot format
I have an asus zenfone 2 laser with radio problem:it doesn't take the line.I want to format modem partition to see if the problem could be solved.I jave a doubt:what is the difference between fastboot erase and fastboot format?What command have I use before flash the modem?

# Answer
I just found the answer regarding `Format` and `Erase`. Format : Fastboot will create allocate new block / create file system to the target partition. Not all partition support format feature. System, userdata, cache, boot, recovery.

Erase : Fastboot will wipe out the entire partition target. All partition support this erase feature as long as permitted by bootloader.

Both command will "destroy" partition content. You will need any compatible firmware to fix it.

About that modem case :

fastboot erase modem \< modem was the partition name.

fastboot flash modem "modem-file\*.\*"
> 2 votes

---
Tags: adb, stock-android, fastboot, baseband
---


# Question
Title: Whatsapp's "WhatsApp Video" folder not visible from my PC
I'm using Whatsapp on Nexus 5 (Android 6.0.1) and several folders used by Whatsapp are not visible when accessed from a Windows 10 PC (connected through USB in MTP, file transfer mode).

From my PC "Whatsapp/Media" shows:  while when accessed from the phone itself using my storage explorer I see 4 additional items:

* .Statuses
* Whatsapp Animated Gifs
* Whatsapp Audio
* Whatsapp Video

No .nomedia files inside those directories. Any suggestions?

# Answer
> 1 votes
Settings -\> Apps -\> tap the 3 vertical dots in upper right -\> Show System -\> scroll down to Media Storage and tap it -\> tap Storage -\> tap Clear Data, and tap Clear Cache.

Then do a full power down reboot of your Nexus. After it comes up wait a few minutes before connecting to your PC to allow the file system to be re-indexed the file system.

please try this :- Whastapp path has changed, it's now Android -\> media -\> com.whatsapp -\> whatsapp

# Answer
> 0 votes
Found the issue! It was a problem with "Google Photos" definition of media directories excluded from backup. All the missing folders were excluded from the backup definitions in Google Photos and when included (see image below) the directories became visible from the PC.

This seems to be a bug or some inconsistent situation, as removing them again from the backup definitions didn't cause the problem to return.

---
Tags: whatsapp-messenger, windows, media-files
---


# Question
Title: SimpleSSHD - create reusable user/password?
I have downloaded SimpleSSHD (aka Dropbear) to access my Android via SSH.

I am able to do so with the one-time password, but I'm trying to write a Python script that can access the phone.

Is there a way to add a "username/password" to SimpleSSHD so I can put that in to my Python program?

Edit: (I'm really new to this) - it looks like I need to create `authorized_keys` on my RPi somehow, but am not sure how. Following this didn't seem to do it.

# Answer
I am new myself, but this is how I managed to do it

1. Generate SSH keys on your client (RPi in this case) system

A. Use the command `ssh-keygen -t rsa -b 4096 -C "optional_identifying_comment"` to generate the key pair

B. When the shell prompts `Enter file in which to save the key` it is asking for a file name. Provide your own, or press `Enter` to accept the default 'id\_rsa'

C. The shell will prompt for a password, provide one (it will have to be used each time you use the key) or press `Enter` to leave it empty.

D. Confirm your password

E. You should now have a pair of keys, a private key (ie. `id_rsa`) and a public key (ie. `id_rsa.pub`), usually stored in `/home/user/.ssh`. The private key is for the client computer (RPi in this case) and the public key is for the server (Android in this case)
2. Transfer the public key to your Android

A. Figure out the target address for your Android. You can do so by opening SimpleSSHD, clicking the three dots in the top-right corner and selecting `Copy App-private path`

B. Add the public key to the SimpleSSHD `authorized_keys` file. One option is to use `cat`:

```
cat ~/.ssh/id_rsa.pub | ssh username@hostname -p 2222 "cat >> /data/data/org.galexander.sshd/files/authorized_keys"

```

Adjust the above to your environment.
> 9 votes

---
Tags: ssh, file-permissions
---


# Question
Title: E:failed to mount /cache (invalid argument) - how to format?
I have a Asus Zenfone 2 and a few days ago it ran out of battery and turned off. Then after I charged it up and restarted it, it wouldn't turn on. It gets to the logo and the loading circle and just gets stuck there forever.

I can get into recovery, but can't do anything in recovery, because everything gives this error:

> E:failed to mount /cache (invalid argument)

Trying to wipe cache, factory reset the phone, mount /system, flash a ROM from SD card, ADB sideload, everything gives the error multiple times. Factory reset formats /data fine, but when it gets to /cache, gives the error and aborts.

Same thing with fastboot. I tried to flash TWRP (I have stock recovery) and I tried to erase and format cache through fastboot, but both give this error:

> FAILED (remote: 'Can not mount the necessary partition')
>
> fastboot: error: Command failed

Is there anything I can do to format the phone or somehow rebuild the partitions without being able to flash anything via recovery or fastboot?

I don't know if tools like AFT or xfstk can do anything for me.

Edit: I don't think the EMMC chip is dead, because the recovery partition is still fine, I can still boot into recovery and when I did a factory reset, it formatted /data without any errors, only had an error when it started formatting /cache.

When I was looking for a solution to this problem, I read somewhere that sometimes when the device gets interrupted, like when it shuts down suddenly, to prevent data loss android would change permissions on the /cache partition to read only or something like that. This would certainly explain what happened to my phone. Just need to think of a way to access ADB shell on it to try to change permissions. Shell doesn't work in ADB sideload mode, that's the only ADB thing the stock recovery has. Is that a similar thing in fastboot by any chance?

# Answer
> 0 votes
download TWRP for your device, then `fastboot boot C:\adb\twrp-3.3.1-0-Z00*.img` from twrp: `adb shell` from shell: `mke2fs -t ext4 /dev/block/bootdevice/by-name/cache`

---
Tags: internal-storage, unbricking, mount, partitions, cache
---


# Question
Title: After android system update (Oxygen OS 9.0.3) Google can't reached via hotspot
After the system update for Oxygen OS 9.0.3, my OnePlus 3 hotspot has weird problem.

If enable hotspot on my phone and use laptop to browse google.com, the url is not loading.

If I use a VPN in my laptop and use the same hotspot, everything is fine (so it's not problem in browser/browser plugins). If I directly use phone to reach google.com, no problem there too (so it's not ISP blocking).

So url filter is happening only in my phone when I use hotspot.

Could someone help me to narrow down the problem?

# Answer
> 0 votes
After another update today (OS 9.0.4) the problem got fixed! But still it would be good to know what screw up has happened in the last update.

---
Tags: oneplus-3
---


# Question
Title: Cannot flash factory images to Google Pixel 2 XL
**Device**: Google Pixel 2 XL (taimen)

**Carrier**: Unlocked (purchased from the Play store)

**Image**: image-taimen-opm1.171019.011.zip

Ultimately, I'm trying to root the phone by flashing a batched `boot.img` to the stock image, but I'm unable to flash *any* images, whether that's the patched boot.img, TWRP, or even the stock factory images themselves. I've already unlocked the bootloader, using `fastboot flashing unlock_critical`.

I am running the newest version of adb and fastboot, downloaded yesterday:

```
$ fastboot --version
fastboot version 0.0.1-4500957
Installed as [REDACTED]

$ adb version
Android Debug Bridge version 1.0.39
Version 0.0.1-4500957
Installed as [REDACTED]

```

Here's what happens when I try to flash the stock factory images, downloaded straight from Google:

```
$ adb reboot bootloader
$ ./flash-all.sh
target didn't report max-download-size
sending 'bootloader' (36344 KB)...
FAILED (remote: Requested download size is more than max allowed
)
finished. total time: 0.000s
rebooting into bootloader...
OKAY [  0.000s]
finished. total time: 0.201s
target didn't report max-download-size
sending 'radio' (60428 KB)...
FAILED (remote: Requested download size is more than max allowed
)
finished. total time: 0.000s
rebooting into bootloader...
OKAY [  0.001s]
finished. total time: 0.201s
extracting android-info.txt (0 MB) to RAM...
Warning: Could not determine slot for secondary images. Ignoring.
extracting boot.img (40 MB) to disk... took 0.289s
target didn't report max-download-size
archive does not contain 'boot.sig'
extracting dtbo.img (8 MB) to disk... took 0.039s
archive does not contain 'dtbo.sig'
archive does not contain 'dt.img'
archive does not contain 'recovery.img'
extracting system.img (1936 MB) to disk...
archive does not contain 'system.sig'
extracting vbmeta.img (0 MB) to disk... took 0.000s
archive does not contain 'vbmeta.sig'
extracting vendor.img (349 MB) to disk... took 4.445s
error: Failed to identify current slot

```

Other commands fail with inconsistent error messages or failure modes. For example:

```
$ fastboot flash boot boot.img
target didn't report max-download-size
sending 'boot' (40960 KB)...
FAILED (remote: Requested download size is more than max allowed
)
finished. total time: 0.000s

```

If I retry with `-S`

```
$ fastboot -S 512K flash boot boot.img
Invalid sparse file format at header magic
sending sparse 'boot' 1/51 (508 KB)...

```

which hangs indefinitely, never sending the first segment.

I can try booting directly, which yields the same problem:

```
$ fastboot boot boot.img
downloading 'boot.img'...
# hangs indefinitely

```

Similarly:

```
$ fastboot --set-active=_a

```

will just hang indefinitely as well. I have to restart the bootloader to kill it, at which point it just prints the cryptic `error: Device does not support slots` (the Pixel 2 XL does support slots!).

The error messages aren't always consistent; sometimes the first `fastboot flash boot boot.img` command will appear to hang (requiring a restart, similar to `--set-active`) instead of printing the error message about `max-download-size`. I've let that run for about fifteen minutes before having to kill it. Unlike system.img, boot.img is only about 40MB, so it shouldn't take that long to flash - something is clearly wrong.

I've also tried this with multiple cables on different USB ports, with the same results.

# Answer
> 1 votes
Ultimately, I solved this by using a Macbook Pro with a USB-C to USB-C cable.

Previously, I had tried it with two different USB-A to micro-USB cables, using two different micro-USB to USB-C adapters, on a Linux laptop with two different USB-A ports and the then-latest version of fastboot/adb downloaded. Unfortunately, I can't be certain what the issue was, but since it happened consistently with multiple cables (and those cables still appear to be working), my guess is that there was a bug with the Linux version of adb/fastboot.

# Answer
> 0 votes
Are you tried to unlock using only "fastboot flashing unlock\_critical" ? You need "fastboot flashing unlock" and then "fastboot flashing unlock\_critical"

# Answer
> 0 votes
I had this problem when I got my new Pixel 2 XL. And after I test three computers, I find that it is causing by my laptop USB ports. So this problem is not related to Windows or MacOS or Linux. And if I connect my phone to laptop through a hub, it works too.

# Answer
> 0 votes
I had some similar weirdness with a lenovo x1 gen 5. The factory image installer would hang at the system image 4/5 and a few other wierdnesses.
I had been using a usb-C\<\>usb-C cable. When I changed to a usb-A-\>usb-C cable, the problems vanished.

# Answer
> -1 votes
did you ever solve this? I have exactly the same issues top to bottom. thanks.

EDIT: wow tried my 5th cable and it worked. Used a USB 3.0 to C (Anker brand)

Used this... https://forum.xda-developers.com/pixel-2-xl/development/tool-deuces-bootloop-recovery-flashing-t3704761

Made sure to install the Google USB driver

---
Tags: rooting, rom-flashing, fastboot, factory-image, google-pixel-2
---


# Question
Title: Are there any downsides or risks to limiting background processes?
I enabled developer options on my Samsung Galaxy Grand Duos and then changed "Limit background process" option from *Standard limit* to *No background process*.

After that my phone is working fine, with no hanging problems or no slowness as before.

But my doubt is, will this change affect any process, updates, applications or anything which might cause an error or failure?

# Answer
> 58 votes
Setting this option forces Android to stop each process as soon as it is *empty* (that is, when no *services* are started and no *activities* are on screen for that app).

To be clear: this option won't stop apps that would normally *run* in the background from doing so. Your mail client will still run periodically to check mail, if it's configured to do that. Apps that use Google Cloud Messaging to receive push messages from Internet servers (such as Gmail and Facebook) will still be able to do so. The option would be better named "**Cached** background process limit", since it limits apps that would otherwise show up with that label in the apps manager.

This should lead to your phone working faster. It might use slightly more or less battery, since it'll use some power to unloading apps from memory earlier than Android usually does it.

The battery impact will depend on your personal usage; If your device doesn't have much ram and/or you don't only use the same few apps all the time, you should get a small battery boost. If you only use the same few apps all the time, you might experience a larger battery drain (from unloading and reloading the apps from memory every time).

Because this is a development option, it can also trigger rare bugs in certain apps, and those apps' developers may not be keen to fix them. One example is that, on Nexus devices running 4.2.2, when this option is on, the in-built Calendar app will keep restarting itself with this option set, because stopping the cached background process causes the calendar's *content provider* to be removed, which causes a loop of services restarting each other to check for calendar updates. If this happens, the loop will run down your battery very quickly.

**Automation**

The setting will be reset every time your device is shut down. If you want to automate setting your preference at boot, you can use tasker with this task: https://taskernet.com/shares/?user=AS35m8mXwt%2Bxy%2Bkh8K4BRW8pJsHtAYqKGwf%2F0NNidJ2TYe0iDRQsJInNDFFMCPaPm1pYHKuaTMU%3D&id=Task%3AToggle+Background+Process+Limit

You will need to give tasker »Set proces limit permission« using adb with `adb shell pm grant net.dinglisch.android.taskerm android.permission.SET_PROCESS_LIMIT`.

Source: https://www.reddit.com/r/tasker/comments/cn5ufe/task\_toggle\_androids\_background\_process\_limit/

# Answer
> 10 votes
I recently found that same setting (i.e., number of processes allowed to run in background), and I reduced that setting on my GT-S7562L from "Standard Limit" to only 1. I immediately saw a significant improvement in performance, and so far there have been no problems. I made the change out of desperation - my phone had nearly morphed into a brick. It was continually running slow, and would often just simply lock up. I have read that a shortfall of Android systems is that they allow applications to keep grabbing memory until it's gone. Maybe I have solved that problem for my phone. I guess I'll know in a few days, but so far I'm quite happy.

# Answer
> 4 votes
I keep my phone at 4 background processes max, and it has much higher performance than on standard. I receive all my notifications (which I have personally managed in the notifications setting) without any notable difference. I am very pleased that this setting exists in developer options. Also provides for enhanced security and lower battery consumption.

# Answer
> 2 votes
Setting limit to phone background process can really improve the performance of your phone. Only, if you open an application, the phone will take a few seconds to load since it will load first the necessary files to be used by a certain apps.

Another advantage, you can prolong the battery life since there is no background process running.

# Answer
> 1 votes
One of the problems you may face yourself with is that certain services that run in the background (Tasker, Google Location Services, etc) may quit unexpectedly. Other than that, I think that there are no other problem with limiting background apps.

Edit: what you selected makes it impossible for apps like I mentioned above to stop working. It won't be possible for gmail, for example, to update you on your received emails.

# Answer
> 1 votes
If you will choose `no background processes` your phone will revert ro 1995 Nokia mobile. It will stop all types of notification update and prosser data transmission, your phone will only perform for taking a call or messages from your mobile number service provider.

Keep your phone in standard background process until it's not become 2 year old and performing very slow.

You should keep at least 1 or 2 background processes to be in touch with smart and latest information.

There is one other option available which is to just selectively stop all background activities, it's will save your battery life and also reduce (prevent ?) heating problems.

---
Tags: settings, performance, processes
---


# Question
Title: WhatsApp contact has wrong name associated with it in contacts (but correct name within WhatsApp itself) - How to fix?
In setting up my new Samsung S4 mini one contact (guy) got confused with another (girl). When the girl would phone me, I'd see the guy's picture (via google) and name. Somehow I changed the number and saved the girl as a separate new entry. Along the way, I must have done something wrong, cuz as a result I've now got the following entries in contacts:

* guy: `Phone`, `Google`, `WhatsApp`
* girl: `Phone`, `Google`
* (same) **guy**'s name: `WhatsApp` of the **girl** ( ! )

In contrast, within `WhatsApp` itself, the names of the guy & girl are correct.

How to fix?

---

PS: If I try to delete the *guy's name girl's `WhatsApp`* contact, I get the following message popup:

> You cannot delete contacts from **read-only** accounts, but you can hide them in your contacts lists.

# Answer
> 3 votes
I was facing the same problem. I followed following steps which resolved the issue.

1. Removed the WhatsApp from Setting--\>Account (no Impact on whatsApp).
2. Removed the Google account & added back.

This solved my problem.

# Answer
> 1 votes
Go to your contact list and select the girl's contact,

Hit *Edit* \- the icon that looks like a pen

Then *Settings* \- three dots on the top right corner and choose "Join"

This will take you back to your contact list. From here choose the correct What's app id

# Answer
> 1 votes
The problem on an Android phone could be that you inappropriately merged two contacts for two different people into one.

The solution that worked for me was to delete both person's contacts on the Google contacts list and on the cell phone contacts list. Sometimes one person can be listed twice or more times in your contact list so all of their listings need to be removed. Then add the two people back to the google contact list making sure not to have any overlapping phone numbers. Overlapping phone numbers is what caused the inappropriate merging in the first place.

To delete and add to the Google contact list:

1. Open up Google Chrome.
2. Click on the 9-dots in the upper-right hand corner.
3. Scroll down in the pop-up box until you get to contacts
4. Click on contacts.
5. Type in person's phone number with area code.
6. Click on person's name.
7. Click on 3-vertical-dots in upper right hand corner.
8. Click delete.
9. Click delete in the new pop-up box.
10. Repeat for all contacts sharing same phone number used in the WhatsApp app. 10. Add back the contacts by clicking on the rainbow-colored cross in the upper left corner.

---
Tags: contacts, whatsapp-messenger
---


title: How to disable "logd" logging?

text:
# Question
Title: How to disable "logd" logging?
The `/data/misc/logd/` directory is filled with 256 MB log files. Currently I don't need debug log files, so I would like to turn off logging.

Partial solution:
It seems I can turn off with the following command from terminal:

```
stop logd

```

But I think this will work until you restart the device.

# Answer
> 2 votes
`stop logd` or `setprop ctl.stop logd` makes `logcat` completely unavailable (which may break some apps/daemons) and isn't persistent across reboots. For permanently removing `logd` you need to delete `/system/etc/init/logd.rc` file which defines this `init` service. But it's not recommended.

The `/data/misc/logd/` directory is filled by `logcatd` which is a sub-service of main `logd` service. `256 MB` is the default size but can be changed if required ().

`logd` mainly covers the functionality of its desktop counterpart syslogd, but also includes klogd and partially auditd to get logs from SELinux subsystem of kernel. However `logd` just reads from (RAM) memory buffers and doesn't save to persistent memory (files) by default. Reason is evident, these saved logs are of no use to a majority of users (as you), but too many write requests for these logs reduce flash memory (eMMC) life unnecessarily.

If one needs these logs as files, a separate service named `logcatd` (`logcat` daemon which itself reads from `logd`) can save them to filesystem (on `userdebug` and `eng` builds only since Oreo ()). Going through the resources (, ), it's easy to control this service permanently (persistent across reboots) by setting property `persist.logd.logpersistd` (to `logcatd` or `clear`) or by using shell scripts `/system/bin/logpersist.[start|stop]`.

---
Tags: logging, services, debug
---


# Question
Title: Why is TRIM not supported on encrypted "/data" partition?
I have a rooted `Lenovo A369i`. I use `LagFix (fstrim)` to TRIM partitions. Previously it was working well with `/data` but after I encrypted my phone it doesn't. I decrypted my phone by formatting. But now in the app it shows `/data` partition having kernel or hardware issues. It's not hardware because before encryption it was working well.

# Answer
> 1 votes
Just if someone stumbles upon this, following conditions should be met for TRIM to work:

* Underlying hardware (eMMC) must support TRIM. For instance `Redmi Note 4` comes with MCP: RX1BMB which contains `eMMC 5.1` and hence supports TRIM.
* Kernel must have support for TRIM, was added in v3.1, but it is disabled by default and `vold` daemon must map `userdata` partition with `allow_discards` option, which it didn't in my case.

If your `/data` partition is encrypted (FDE), ***Support for allow\_discards was added in version 1.11.0*** () of device-mapper ***crypt*** () target, but may not work e.g. on devices with Qualcomm SoCs. See this issue for more details.
* Filesystem must also support TRIM () (except if you want to TRIM a whole partition with `blkdiscard`). Android uses `ext4` or `f2fs` on `/data` partition, both support TRIM.

If these conditions meet, you can perform `TRIM` manually (`fstrim -v /data`) or periodically (scheduled service) or continuously (with `discard` mount option). See this answer for details on how often you should perform `fstrim`.

---
Tags: file-system, encryption, kernel, lagging, maintenance
---


# Question
Title: what in xposed caused this bootloop and how to prevent it from happening again?
My android phone is stuck in a boot loop. To troubleshoot it I was able to boot into TWPR and use `adb pull /sys/fs/pstore/console-ramoops` to get some boot logs (is that even the right file?).

When opening the file in a text viewer it is very corrupted, with missing letters like in this example...

Is there another procedure I can follow to either get a correctly encoded or uncorrupted log file or fix the one I got? It was literally the only way I found of pulling some logs from TWRP terminal...

On the troubleshooting part: prior to last known good status no particular action was done... just using telegram briefly.

Then I started getting crashes of system app so I rebooted. This now is the result...

**Update**: it seems that adb connects during the boot animation. I was able to do `adb logcat -v time -b events -b main -b system -b radio >> boot.log` and i got a stream of logs, will post the result once it's done boot looping or battery dies.

**Update**: indeed I was able to get real-time log of the boot process. It *is* boot looping since my logfile is growing bigger, so it's not "stuck".

Trying to look for information in the log I found this pattern of "waited one second"... which seems to indicate that something is not running or failing to run.

Here is a screenshot of what I mean:

The figure of 838 seconds waited seems right since I had my phone logging for about 15 minutes...

I am continuing to log until something happen, but now I think I need some help debugging this problem...

There seem to be two things that are waited for:

```
07-01 22:58:59.863 W/slim_daemon(  951): Waited one second for android.frameworks.sensorservice@1.0::ISensorManager/default. Waiting another...

```

and

```
07-01 22:59:02.359 W//system/bin/cameraserver( 3000): Waited one second for android.hardware.camera.provider@2.4::ICameraProvider/legacy/0. Waiting another...

```

My conclusion for now is that there may be something wrong with camera or sensors...

This seems to be readings for temperature.. 53° is pretty hot...

Also this seems to imply that the battery stats dumping took 262k milliseconds. (?)

Are there things I can look for *specifically* in the log, like some known line or checkpoints like

*I would attach the log file, but how can I clean any private data that may be in in there?*

---

## Initial problem is solved

---

I was finally able to boot, disabling the `Xposed` module did the trick: 1. booted to TWRP recovery
2. flashed Magisk Manager for Recovery Mode(mm-201904040.zip)
3. run it in TWRP's terminal with `*/mm`
4. selected `m) Magic mount`
5. selected `xposed_27`
6. confirmed
7. rebooted with the `reboot` command

It booted in safe mode, since I previously had modified some files to induce that, so I rebooted again from power menu and it booted normally.

Now I think I want to know what happened specifically so that I can re-enable xposed, since I have some modules I rely on for customizations.

Also with no configuration changes I'm still baffled at how the phone got bootlooped, i remember frequent ANRs of the system app to the point of not able to run anythng and rebooting.

Is it really xposed fault or merely disabling it removed a symptom of something else ?

So the question should be **what in xposed caused this bootloop and how to prevent it from happening again** ?

# Answer
> 0 votes
Bootlooping with logs this messed up probably suggests that some other process is arbitrarily reading and writing from the io stream of the log file. In layman's terms, very bad stuff.

I think your best option is to just recover as much data as you can and reflash the ROM. Something has clearly gone very wrong.

---
Tags: adb, boot-loop, lineageos, logging, oneplus-3
---


title: "Waxl dyne untherhouze" bug

text:
# Question
Title: "Waxl dyne untherhouze" bug
Every time I start my device a Cleaner window appears. And in the window these words appear: "Waxl dyne untherhouze".

What does that mean? Is there a bug involved?

# Answer
Sounds like you have malware. Look through your installed apps (from settings) and see if anything sticks out as fake. Uninstall it.

If nothing appears off, then the next step is doing a factory reset. Back up your information first!

If even that doesn't work, call the manufacturer for service. Fixing malware that can survive a factory reset is a very technical and risky process.
> 0 votes

---
Tags: bugs
---


# Question
Title: How do you select a large number of rows in Google Sheets without endless scrolling downward after selecting the first row?
In a spreadsheet of 40,000 rows, I want to select the first 2,500 rows to copy them to another sheet. The only way I've seen is to select the first row and tediously scroll the "dot" down to include all 2,500 rows. On a computer, this would be a breeze with the Shift key. How to accomplish something similar in Android Sheets? The keyboard doesn't open unless I'm editing a cell, so any keyboard-based solution seems to be a non-starter. Thanks.

# Answer
Here is how you can select a range when using Google Sheets:

1. Select a row or cell.
2. Click the 3-dot on the top right, then select "Select cell or range".
3. Enter your range. For example 1:2500 will select row 1 to row 2500.
4. Click Ok. Done.
> 1 votes

---
Tags: google-sheets
---


title: Historical data usage on Android Pie

text:
# Question
Title: Historical data usage on Android Pie
I'm trying to check my historical data usage on my OnePlus 6 (OxygenOS 9.0.6).

I used to be able to go to the Data Usage settings and use a drop-down list at the top to select different time periods, but trying this just now it only shows me the usage since the start of my current billing cycle, with no option to show any other period.

This is not the behaviour I was expecting, so I wonder if this specific to Android Pie on my OnePlus 7, or has Android Pie (or earlier) removed the ability to display data usage history.

Noticing that my billing cycle start date was wrong, I corrected it and found that the usage data shown now goes back to the start of the new billing cycle start date, so obviously it stores more data than is displays.

If more history is still recorded somewhere, how can I get access to it, and how far back would the history go? I'm comfortable with using `adb` if necessary.

My device is not rooted, nor can it be, but I'm comfortable with using ADB if necessary.

# Answer
> -1 votes
I use this apps to monitor my data usage I found it useful. You should try if you want.

https://play.google.com/store/apps/details?id=com.internet.speed.meter.lite&hl=en&referrer=utm\_source%3Dgoogle%26utm\_medium%3Dorganic%26utm\_term%3Dinternet+monitor+android&pcampaignid=APPU\_1\_6egZXfunKIv6wAP8\_ovoCA

https://play.google.com/store/apps/details?id=com.glasswire.android&hl=en&referrer=utm\_source%3Dgoogle%26utm\_medium%3Dorganic%26utm\_term%3Dglasswire&pcampaignid=APPU\_1\_segZXchYxdb5BvHunLAF

---
Tags: 9.0-pie, data-monitoring, oxygenos, oneplus-6
---


# Question
Title: I got some files to flash Samsung stock ROM, how to use them with Odin?
*My original problem is at https://android.stackexchange.com/questions/214200/. You can simply ignore my original problem since it's kinda not related to this question. Just share some backgrounds.*

---

Now, I am trying a different (first stock release) ROM and hopefully, this time, it can work. After downloading this ROM, I got the following 5 files:

```
camera.pit
CODE_GC100XXALJF_413474_REV00_user_low_ship.tar.md5
CSC_HOME_OLB_GC100OLBALJB_409864_REV00_user_low_ship.tar.md5
CSC_OLB_GC100OLBALJB_409864_REV00_user_low_ship.tar.md5
MODEM_GC100XXALJG_REV01_CL1210642.tar.md5

```

I guess `CODE_GC100XXALJF_413474_REV00_user_low_ship.tar.md5` is **AP** option because it has the biggest size. But just a guess.

How to use them with Odin? Which one belongs to which option?

# Answer
> 1 votes
* AP: CODE
* CP: MODEM
* BL: BOOTLOADER (you don't seem to have that)
* CSC: CSC or HOME\_CSC
* USERDATA: USERDATA (same for when you need to wipe the user data)

In your case, you'll only need 3 files: AP, MODEM, and CSC/HOME\_CSC which contain your carrier-specific files, settings, etc.

Note that the firmware you are trying to flash needs to have the same version as your current version on the device or higher, otherwise you'll get the error you are getting in your third screenshot.

Important: do not use the PIT file as it reparts the internal memory and can cause a brick, and actually it is the cause of the flash failing message, so it is not advised to use it.

---
Tags: samsung, rom-flashing, device-firmware, odin
---


# Question
Title: Cannot communicate on LAN when WIFI doesnt have internet
This is pertaining to a smart phone with data.

My phone is connected to my WIFI which lacks internet currently. It is also connected to the cell network and using it for data. When I ifconfig it tells me I am connected on wlan with 192.168.1.4 and rmnet at 10.124.121.12. I am trying to ping a device on 192.168.1.55 for purposes.

If I turn off my cell network I can ping it fine. With my cell network on its unreachable.

How do I get my android to allow me to ping 192.168.1.55 while being on the cell network? I have only noticed this since the internet went out on my WIFI so its a strange and new problem.

# Answer
> 0 votes
I have the same setup. I have a local WiFi network that is not connected to the internet. I found that if you go to settings on your phone, then select “Developer options” and tick “Cellular data always active” that you will have access to the WiFi network and the cell network simultaneously.

On my LG, I can be on the web with cell data and print to the printer on the local WiFi network. I just now tested a ping just to make sure and it works just as you would expect.

# Answer
> 0 votes
you cannot ping that device via Mobile Data. You have Device 1 (yours) and Device 2 (device to be pinged). Telling from the IPs given, both devices are on the same WiFi network. Device 1 can connect to Device 2 by requesting a ping to Device 2 on your router (Device 3).

Your router is most likely having the IP 192.168.1.1

As your router knows that you are connected to it, it will forward your ping request to Device 2 and back again.

When connected to your mobile carrier, you have a different IP. But, your router uses IPs to determine whether it knows a device or not. As you have a different IP and your ping request comes from the outside now, it does it's job: Not forwarding your ping requests. That's what the router is there for (besides establishing connections). It is a firewall and it's trying to prevent people from outside harming your devices.

When you are connected to WiFi

When you are connected to Mobile Service Data Provider

This means, that you are not actually having an Android Problem. What you need to do is to tell your router to forward PING packets. That's difficult. For that, you should head over to the Servers Fault community and ask them how you can do exactly that.

https://serverfault.com/

---
Tags: networking, android-versions
---


# Question
Title: Is there a way to backup contents of internal SD, while preserving the file's modification date?
I'm having problems with my internal flash storage (namely not being able to create folders in root, which prevents some apps from working, plus periodic unmounts), and I have tried unsuccessfully to run `fsck` on it, so I figured I would back up my data, format the internal flash storage, and restore. Running `adb pull /storge/sdcard0` will, however, replace the files' modification date, which will be an issue with photos, for example, since the Gallery depends on those dates to sort pics. My question is if there is a way to preserve that data.

# Answer
> 4 votes
There are several ways you could accomplish that:

* if you have sufficient free storage available, archiving the contents (zip, tar, whatever other archiver) and then copying the archive file would be a way. Pulling the archive would change the archive file's timestamp, but contents would be preserved as-is, and restored with their original timestamps. This could be done either from a terminal app, or via `adb shell`. On one device I've checked, `tar` and `gzip` are available, and even `bzip2`. Successfully tested on another one, and adapted to your specifications: `tar czf backup.tar.gz /storge/sdcard0` run from a location with sufficient space would create the archive, which you then could pull.
* you could utilize a sync app like FolderSync, and simply sync all the contents to your computer (via SFTP, Samba/Windows-Share, or any of the other supported protocols). After having formatted the storage, you could sync it back the very same way.
* if your device supports an external SDCard, you could copy your files over there, which also should preserve timestamps

There might be even other possibilities, but these are the ones coming to my mind first.

# Answer
> 18 votes
Try using the `-a` option to copy all file attributes:

`adb pull -p -a /sdcard/`

(The `-p` is for progress indication.)

# Answer
> 1 votes
Over ssh, we can also use rsync with the `-a` option:

```
rsync -a /sdcard/ <destination>

```

---
Tags: adb, backup, internal-sd
---


# Question
Title: Xperia XA2: Stuck on "Sending 'boot.img'"
I unlocked my bootloader, and did:

```
sudo adb reboot bootloader
sudo ./fastboot boot ~/Downloads/twrp-3.2.2-0-pioneer.img

```

But it gets stuck on sending:

```
creating boot image...
creating boot image - 10240 bytes
Sending 'boot.img' (10 KB)

```

I'm doing this on Linux and using the latest platform tools.

# Answer
> 0 votes
Apparently the XA2 doesn't play well with Linux and USB 3 so I solved it by using an old laptop with USB 2.0 https://together.jolla.com/question/193348/xa2-flashing-issues/

---
Tags: fastboot, sony-xperia
---


# Question
Title: Sensible method to edit contacts on a Samsung phone?
Currently the Samsung app for Contacts is driving me nuts on my S9+.

I used to have my contacts entered as I wanted them into the Phone address book (only one other phone number on the SIM). But then the Contacts app started to pester me about wanting to merge contacts. Dismissing those notifications by touching that X in the top right of the notification window ended up removing the one contact that was most complete for my significant other (in a sense the master contact which also contained address, birthday, siblings and stuff, aside from the phone numbers). Instead I now have her Telegram and Skype contacts as a single entry in the Contacts app. Alas, that single entry *cannot be edited, only deleted*. But given the intransparent handling of this stuff, I'm really afraid to delete it, because it warns me that the contacts will disappear from where ever they are defined (so presumably deleting this *one* entry from Contacts will end up deleting the contacts in Telegram and Skype respectively).

Anyway, so I figured I'd simply start creating a new contact for the Phone app to use, even though the phone number was already mentioned in the combined Telegram and Skype entry.

Guess what, when I create a new entry it cannot be named the same as the existing one, even though the existing one **cannot be edited**. I'm out of words for how badly this software is designed ...

How can I manage the contacts on my Samsung S9+ in a fashion that makes explicit where a contact is stored (i.e. where the respective data comes from), lets me merge them in either direction and lets me move them between the different address books of connected accounts (SIM, Phone, Google, mail provider)?

NB: I'd like to avoid any method involving syncing to Google or so ...

# Answer
> 0 votes
Try to go into your contacts (in the app you use to phone people), then click a button that says Create Contact and put the number, name, and whatever more info it needs.

---
Tags: contacts, samsung-galaxy-s-9
---


# Question
Title: Phone won't boot/start after successful flashing through QFIL
My phone was bricked, so I decided to flash my phone LYF f1s with the stock ROM through QFIL, but after after successful flashing it won't start !! Nothing happens, no matter which combination of volume and power buttons I press, only the charging light blinks or keep flashing when I connect it to my charger or laptop. Please help !!

# Answer
Looks like some of the images are incorrect for your phone? or maybe you can try to remove the battery, then put it back and try again.
> 0 votes

# Answer
You can take the battery out, plug in the charger, ad see if the phone can at least give an unable to charge error.
> 0 votes

# Answer
Just unplug your battery and wait for 5 to 10 min until phone get back to its normal temperature. Then plug the battery as it was earlier and start your phone.
> -1 votes

---
Tags: adb, rom-flashing, recovery-mode, fastboot, unbricking
---


# Question
Title: Unable to clear user data in Google Play Music
Google Play music occupies more than 1GB on my mobile phone. As you can see in the screenshot below, User Data accounts for most storage around ~1GB.

When I press the Clear Data button, the screen shows that storage is freed, but the data is there as soon I go back.

I have tried:

1. Clearing Data
2. Clearing Cache
3. Disabling app

My mobile is 10.or D2 and runs Android 8.1.0

# Answer
After trying the steps mentioned by Reddy Lutonadio in the comments, I performed a factory reset of my device. This solved the issue.
> 0 votes

---
Tags: storage, google-play-music, 8.1-oreo, app-data
---


# Question
Title: Netffos X9 always starts each app / activity as new
I have TP-Link's Netffos X9 and from the very beginning I noticed a weird thing. Each application or activity is always started as brand new. Always, no matter, if I saw or was using given app just like 5 minutes ago, I see loader screen and a home / startup screen, instead of the one, which I left off.

I've been using around a dozen different mobile devices with Android 8.1 and hundreds other with other (older) versions of Android and this is the first time I see such a weird situation.

I have enabled Developers Options and tripple-checked that option *Don't keep activities* / *Destroy every activity as soon as the user leaves it* is **disabled**. I have also checked that a few applications in topic are listed among *Developers options \> Inactive apps* as **active**. And yet, each time I start it up, they seems to be starting up as freshly new, showing welcome / home / startup screen.

Does anyone have any idea what is going on and how to prevent such behavior?

# Answer
> 1 votes
Netffos X9 (and probably all other TP-LINK's phones) comes with a handy battery optimization functionality which actually kills all the applications that are in background 3 minutes after phone's screen turns off.

One need to go to: `⚙ > Battery > Off-screen cleanup` and disable this feature for all applications that should stay in background (and eventually be turned off by system default process, i.e. after few hours).

All applications in question were listed and enabled on the above mentioned list. Turning off this feature for all those applications resolved the issue.

---
Tags: applications
---


title: Stock rom installation using twrp?

text:
# Question
Title: Stock rom installation using twrp?
I have a rooted Huawei G Play Mini. Boot loader is unlocked. Also, I have custom recovery (TWRP) installed. And, I need to upgrade my phone from lollipop to marshmallow. But, I do not have stock recovery back up. I can't find it anywhere. Tell me where to find it, or tell me how to how to install the official stock rom by using TWRP.

# Answer
Before you do the upgrade, via TWRP, select backup\> the select system, data (if you want yours apps), boot, and recovery. This will backup what is currently installed on your phone. Once this completes, go ahead and install the MM update for your phone. Do this within twrp as well to keep the custom recovery.
> 1 votes

# Answer
Download the rom at http://download-c.huawei.com/download/downloadCenter?downloadId=79304

To install the rom follow instructions at https://huaweiflash.com/how-to-flash-huawei-stock-firmware-all-methods/
> 0 votes

---
Tags: updates, rom-flashing, backup
---


# Question
Title: How to identify the app/process which re-mounts partitions R/W, creates files and changes file permissions?
I have a rooted device, with superuser rights granted to a few apps I trust. I have often found my `/system` or `/vendor` partition mounted read/write, and some files `chmod`ed to `0777`. Similarly directories/files with random names are created/deleted (e.g. `/sdcard/.a03Degpoif`), `.nomedia` files are created inside them to hide their contents from gallery etc.

`logcat`/`dmesg` contains no traces of all this happening in background. This doesn't happen periodically but in a slapdash way, internet connectivity isn't a condition either. I have tried disabling/uninstalling apps, looking for any suspicious processes running, but couldn't identify the culprit(s).

Is there a way to figure out who is doing this?

# Answer
> 5 votes
***Note****: Following solution requires a rooted device. Kernel must be built with `AUDIT_WATCH`, preferably `AUDIT_TREE`.*

The only good thing Google did was to choose the flexible and configurable Linux kernel for Android, not going for something like a crippled kernel and trying to handle everything from userspace, including running a Linux kernel ().

Linux kernel's Audit System makes it possible to log any system calls or filesystem changes made by a process. In our case we need to identify the process(es) which are writing to `/sdcard` or `/system` and making syscalls `mount` and `chmod`.

Linux distributions have a service auditd which communicates with kernel to get information about security-related events. On Android we have already `logd`, not as configurable as `auditd` but enough for basic monitoring. `logd` mainly covers the functionality of its desktop counterpart syslogd, but also includes klogd and partially auditd to get logs from SELinux subsystem of kernel.

We can add a few more rules using auditctl to also report events we are interested in. You can use `auditctl` from a minimal Linux environment on your Android device, or compile the binary from source code (should be built with --with-arm / --with-aarch64 whatever your devices' architecture is), or get one pre-compiled here.

Now create rules files in `/etc` or wherever you want to:

```
# /etc/audit-start.rules

# enable auditing, won't work in PID namespace
# won't work if permanently disabled with kernel parameter "audit=0"
-e 1

# delete previous rules (though there are none on Android)
-D

# increase the buffers to avoid failure
# no. of event to be queued, waiting for logd to read them
-b 10000

# disable rate limit (msgs/sec) to avoid failure
-r 0

# this determines how long to wait in burst of events
--backlog_wait_time 0

# set failure mode to dmesg
-f 1

# define filesystem rules, whatever file/directory you want to watch
-w /system -p wa -k FILESYSTEM_AUDIT

# define syscall rules, see all syscalls with 'ausyscall --dump' or
# here: github.com/linux-audit/audit-userspace/blob/master/lib/aarch64_table.h
-a always,exit -S fchmod -S fchmodat -k CHMOD_AUDIT
-a always,exit -S mount -k MOUNT_AUDIT

```

```
# /etc/audit-stop.rules

# clear on exit, restore Android default values
-e 0
-D
-b 64
-r 5
--backlog_wait_time 18000

```

Apply rules:

```
~# auditctl -R /etc/audit-start.rules

```

Now make changes; mount `/system` R/W, write/delete something there and change file permissions.

Depending on `logd` configuration, you can get `audit` log in one or more of different logs () including `events` buffer () of `logcat` and `main` buffer ():

```
~# logcat -d -b events,main | grep _AUDIT

```

Or in kernel's `printk` buffer () and `logact`'s `kernel` buffer ():

```
~# dmesg | grep _AUDIT
~# logcat -d -b kernel | grep _AUDIT

```

```
audit(0.0:16122): arch=c00000b7 syscall=40 success=yes exit=0 a0=7fcec5db38 a1=7fcec5db3f a2=0 a3=8021 items=1 ppid=761 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="busybox" exe="/data/data/com.mixplorer/files/busybox/busybox" subj=u:r:magisk:s0 key="MOUNT_AUDIT"
audit(0.0:16126): arch=c00000b7 syscall=53 success=yes exit=0 a0=ffffff9c a1=7b839180c0 a2=81a4 a3=0 items=1 ppid=11687 auid=4294967295 uid=10135 gid=10135 euid=10135 suid=10135 fsuid=10135 egid=10135 sgid=10135 fsgid=10135 tty=(none) ses=4294967295 comm="Thread-7" exe="/system/bin/app_process64" subj=u:r:untrusted_app:s0:c135,c256,c512,c768 key="CHMOD_AUDIT"
audit(0.0:16141): arch=c00000b7 syscall=35 success=yes exit=0 a0=ffffff9c a1=7bc22a3c40 a2=0 a3=7bdfbd3098 items=2 ppid=11687 auid=4294967295 uid=10135 gid=10135 euid=10135 suid=10135 fsuid=10135 egid=10135 sgid=10135 fsgid=10135 tty=(none) ses=4294967295 comm="pool-2-thread-1" exe="/system/bin/app_process64" subj=u:r:untrusted_app:s0:c135,c256,c512,c768 key="FILESYSTEM_AUDIT"

```

First line shows that some process running as root with Magisk's SELinux context has made syscall `40` (`mount`) and the command shows it's MiXplorer app (just as example, I did that myself). Second line indicates that the app running with UID `10135` has `chmod`ed something.
Third line shows the same app (by making syscall `35`) deleted something in `/system` partition.

This is a simple use case. More recursive rules can be defined to deal with complex situations, interpreting other fields of log as well, as explained here.

To clear rules:

```
~# auditctl -R /etc/audit-stop.rules

```

**NOTE:**

* For simple cases where the objective is just to get notified of some filesystem changes (and not to trace the originator), `inotify` API can be used instead as explained in this answer.
* In order to mark all the processes that run before the audit starts auditable by kernel, pass `audit=1` boot parameter to kernel, either by editing `cmdline` in `boot.img` or use `fastboot -c` option.
* To save audit log to a file, run `logcat` in background:

```
logcat -s auditd -b events -f /data/media/0/auditd.log &

```

---
Tags: file-system, malware, mount, processes, unwanted-files
---


# Question
Title: How to find out which apps are creating *.space files in Internal Storage?
There is a folder at internal memory: `.space/`

Inside it has one folder that is a big hash name (probably sha1sum), and inside that folder there are lots of files (also named as a hash something like `60b725f10c9c85c70d97880dfe8191b3.space`) occupying 2.7GB of my smartphone precious internal memory.

In hexa/chars/bytes, thru X-Plore File Manager, I saw that they begin with "PK", which means they are ZIP files. So, after renaming them to .ZIP, I saw many pictures inside them that were all about games, and the manifest.xml was Uber annoying to try to read.

My conclusion, they were all unwanted, unasked, auto-downloaded .ZIP (.APK?) games.

Now I need to stop the app doing that kind of thing on my precious cellphone's memory.

# Answer
It looks like a malicious or spamming app. Did you download any app from a suspicious looking website in a date close to the date the `.space` files were created/modified, as mentioned in the explorer app? Then that downloaded app could be the culprit.

It is not usually possible to directly check what app downloads a specific file, but you can try checking Data Usage and look for apps using suspiciously large bandwidth amounts.

The location of the Data Usage statistics is sometimes different depending on the device and the Android version, but you can usually find the statistics in `Settings > Wireless & Networks > Data Usage`. If you can't find it there you can try typing "Data Usage" in the settings search box. You can choose to show Wi-Fi usage from the menu button on top right corner, and then you can look for any suspicious apps using large amounts of bandwidth and uninstall them.
> 0 votes

# Answer
Since Android is based on Linux kernel, you can make use of its `Auditing System` to find the process which is making changes to your device. For that you need to use `auditctl` tool for defining rules (***root required***), and you would get details about the changes in logs through `dmesg` or `logcat`. Fo more details on how to define rules, see this answer.
> 0 votes

---
Tags: applications, internal-storage, processes, unwanted-files
---


title: Copy messages from my old phone

text:
# Question
Title: Copy messages from my old phone
How can I transfer my SMS and MMS messages from my old phone to my new phone?

My old phone uses Android 2.1 and it seems that you currently need at least Android 2.2 to log in to a Google account. Therefore, I can't use any tools which require a Google account, such as Android Market/Google Play.

# Answer
> 0 votes
You can try SMS Backup & Restore. Install it on both phones. Backup the messages from the old phone (preferably in xml format). Transfer the file on the new phone, then use the app to restore the messages.

You can also try the method described in this answer.

**Disclaimer:** I am not related to the app's developer(s), just used it a few times.

**Note:** I am not sure if it still supports Android 2.1 or not.

---
Tags: sms, 2.1-eclair
---


# Question
Title: How do I prevent my phone from restarting after a System Update?
Phone: *Mobicel TRENDY\_LITE*
Android: *8.1.0*

For about two days now, I have been receiving many Security and System Updates.

Every time an update is ready, my phone restarts without permission.

After each update, my phone seems slower than the last one.

What can I do? All the help is appreciated.

# Answer
When a system update is performed, the phone reboots to allow the new files to take over the old (the old files will be removed from the system). On some devices, it is possible to delay the update, but when it (the update) is done, one has to restart the device.

If you don't want to update at all, then install a firewall and block the wireless update app from accessing the internet.
> 1 votes

---
Tags: updates, security, reboot
---