# Question
Title: how to always show homescreen after unlocking?
On a Nexus 5 and I am looking for a way to configure it to always show the homescreen after unlocking it. is it possible? how?

Right now, after unlocking it shows the screen exactly as it was left it before being locked. I have not yet managed to get the habit of pressing the home button (i.e. go to homescreen) before I press the power button (i.e. lock my screen)...

p.s. this device is rooted.

# Answer
It seems that the only way to get this without automation is having the habit of pressing "show desktop" before locking.

In case, you are not against automation, you can accomplish your request with MacroDroid, Tasker or other apps.

With MacroDroid

1. In the Triggers section, select Screen Unlocked.
2. In the Actions section, select Launch Home Screen.
3. Give the macro a name, then save it.

When you unlock the screen, the home screen will be shown (there was about 300 ms delay when testing) even if another app was in the foreground.
> 2 votes

---
Tags: root-access, lock-screens, home-screen, gestures
---


# Question
Title: Automating Wi-Fi Calling or Airplane mode toggle with Tasker
I am absolutely 100% new to Tasker. I have bought and installed this app to automate a few things which IFTTT simply can't.

Here is the situation:

My bedroom is in a basement apartment and so I do not get good cell service reception at all while I'm down there, and since it doubles as my office space (on days I work from home) and my gaming area, I tend to spend a decent amount of my time in my room. This being said, I have an LG V30 ThinQ with Android 8.x Oreo and my current service provider offers a Wi-Fi Calling service. Naturally, I turned it on, and bingo... calls are now crisp and text messages sent without a hitch. Well... that's at home at least.

However, at my work, the opposite is true: The Wi-Fi is bad, but the cell service reception is always super strong. Yes, my phone does have a setting to use Wi-Fi calling as a second priority to my cell service (meaning that it will use my cell service before using the Wi-Fi Calling) but instead of switching intelligently based on the strength of the cell service reception strength, it only switches to Wi-Fi Calling once I stop having cell service reception period. Which doesn't work well in the basement, since sometimes I get just enough signal to toggle it back to the bad cell service for calling.

**So, I would like to create a task with Tasker that**, once connected to/disconnected from my home network, would allow either the Wi-Fi Calling to be toggled; or for the airplane mode to be toggled. That way, as long as I'm connected to my home network, my phone will be using the Wi-Fi calling capabilities, without having to toggle them on and off again manually.

The problem is since I'm new to this, I don't know the first thing about programming a task in this version of Tasker. All tutorials I came across were very little help.

Could somebody work me through setting up something along those lines?

# Answer
> 0 votes
Create a profile "Home" with state "Wi-Fi Connected" and SSID set to your home Wi-Fi network name.

On the profile create a task that

1. Turns on Airplane Mode
2. turns on Wi-Fi

This will be triggered when *connected* to your home network.

On the same profile create an exit task that

1. Turns off Airplane Mode

This will be triggered when *disconnected* to your home network.

Finally set your Wi-Fi Calling preference to "Cellular Network Preferred" (or whatever it is on your phone).

---
Tags: wi-fi, calls, tasker, airplane-mode
---


# Question
Title: Is it possible to change file permissions on Android's internal storage?
How can I change file permission of a file on Android without rooting? I actually want to prevent some files from deletion.

**Note:** I am asking of changing the file permissions of user-created files in internal shared storage.

# Answer
On all operating systems based on Linux kernel - like Android is - it's possible to set permissions on files (including directories) provided that filesystem supports UNIX permissions (uid, gid, mode). Common examples of such filesystems are `ext4` and `f2fs`.

However Android's internal (confusingly called external) storage which is accessible by installed apps at `/sdcard`, is not an actual but virtual / emulated filesystem exposing `/data/media` (which is a real filesystem) through `sdcardfs`. sdcardfs and its predecessor `FUSE` expose the emulated filesystem with a fixed set of uid, gid and mask (mode). So the commands `chmod` and `chown` have no impact, whether executed through CLI (adb shell or terminal emulator) or GUI (file explorer).

It's possible to change permission bits of file on underlying actual filesystem, but accessing `/data/media` requires root access because only UID/GID `1023` (aid\_media\_rw) has read access to the directory. And still the permissions will remain same when viewed from emulated view `/sdcard`.

So you can't change permissions of user created files on Android, with or without root.

**Further reading:**

**Related:**
> 12 votes

---
Tags: stock-android, file-system, files, file-permissions
---


# Question
Title: How to remount sdcardfs to allow setting file permisions / ownerships?
I have a rooted OnePlus One running LineageOS 15.1 (Oreo 8.1). I am trying to adjust some file permissions/ownerships on the emulated sdcard partition.
The partition seems to be mounted as an sdcardfs:

```
A0001:/ # mount | grep /storage/emulated
/data/media on /storage/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid)

```

I'm not sure what that means. Some people suggest that Android used to use `mount` then switched to `fuse` and now with Oero uses `sdcardfs`. I'm not sure if that makes any sense, but I'm a bit scared that something like `mount -o remount, rw /mnt/sdcard/` (which apparently is what you had to do in the past to be able to set file permissions on the emulated sdcard partition).

Short demonstration showing that file permissions won't be applied:

```
A0001:/ $ su
A0001:/ # ls -la /storage/emulated
total 12
drwx--x--x  4 root sdcard_rw 4096 2018-07-24 17:44 .
drwxr-xr-x  4 root root        80 2018-07-24 17:21 ..
drwxrwx--x 14 root sdcard_rw 4096 2018-07-24 17:20 0
drwxrwx--x  2 root sdcard_rw 4096 1970-01-01 01:12 obb
A0001:/ # touch /storage/emulated/a
A0001:/ # ls -la /storage/emulated/a
-rw------- 1 root sdcard_rw 0 2018-07-24 17:44 /storage/emulated/a
A0001:/ # chmod 777 /storage/emulated/a
A0001:/ # ls -la /storage/emulated/a
-rw------- 1 root sdcard_rw 0 2018-07-24 17:44 /storage/emulated/a

```

(Note: the same happens if I use `/storage/emulated/0` instead of `/storage/emulated`)

My question is: What do I have to run in order to be able to change the file permissions and file ownerships on this weird sdcardfs partition.

# Answer
> 4 votes
You cannot change permissions and ownerships of files on `sdcardfs`.

On all operating systems based on Linux kernel - like Android is - it's possible to set permissions on files (including directories) provided that filesystem supports UNIX permissions (uid, gid, mode). Common examples of such filesystems are `ext4` and `f2fs`.

However Android's internal (confusingly called external) storage which is accessible by installed apps at `/sdcard`, is not an actual but virtual / emulated filesystem exposing `/data/media` (which is a real filesystem) through `sdcardfs`. sdcardfs and its predecessor `FUSE` expose the emulated filesystem with a fixed set of uid, gid and mask (mode). So the commands `chmod` and `chown` have no impact, whether executed through CLI (adb shell or terminal emulator) or GUI (file explorer).

It's possible to change permission bits of file on underlying actual filesystem, but accessing `/data/media` requires root access because only UID/GID `1023` (aid\_media\_rw) has read access to the directory. And still the permissions will remain same when viewed from emulated view `/sdcard`.

**Further reading:**

**Related:**

---
Tags: sd-card, linux, mount, 8.1-oreo, file-permissions
---


# Question
Title: How to set alarm at a specific date and time?
My phone is a Huawei Ascend Y511 with Android 4.2.2.

I like the Alarms feature in the built-in Clock app, but it only lets me choose a time (and days of the week, if using a recurring alarm), not a date. Any way to set an alarm (reminder) for a specific date and time?

I don't wanna use Google Now's reminders, as I don't like GNow from a privacy standpoint. I tried Google Keep which works but only produces a one-off, short sound, rather than a looped melody, and doesn't show any notification on the screen except a tiny icon in the top black bar.

I'd like something that works close to the Clock app: show a full-screen notification that lets me drag an icon in one of two directions to either snooze or discard the reminder. And don't stop playing the sound until I react.

# Answer
> 2 votes
**Use Early Bird Alarm Clock**.

It has all the features that you wanted.

> ✔ Select alarm date for shift worker
> Complete schedule such as day-night-off-holiday will be okay!

---
Tags: notifications, alarm
---


# Question
Title: USB debugging switches off automatically
I'm using a Huawei P20 Pro.

I'm trying to use `adb` according to this guide: https://developer.android.com/studio/command-line/adb.

I have enabled developer options. I can enable USB debugging, but if I go back one screen and return, USB debugging is off again.

And ideas on how I can enable USB debugging?

# Answer
> 3 votes
What worked for me is choosing "File Transfer" on android when you plug the USB instead of "Charge only"

---
Tags: usb-debugging
---


# Question
Title: How to reset the app icons? - They get substituted by a default icon
Sometimes, the app icons just "switch" to an android icon:

For example in this screenshot, the Dropbox (center row in the left) icon is an android icon. This happens to me from time to time with many different applications.

The bad icon works properly: It still opens the application normally.

If I grab the dropbox from the all-apps folder and drag-and-drop a new shortcut, it displays correctly:

If I remove the bad icon, and leave only the correct icon it seems all normal:

# Questions

1. Why this happens and how can I prevent it happening in the future?
2. Is there any way to "reset" all the bad icons in one shot?

# Answer
It might be the problem of your launcher application.

Try clearing your launcher app's cache.
> 0 votes

---
Tags: launcher, app-icons
---


# Question
Title: When Google removes malicious apps from their Play Store, are users notified?
This Check Point Research article describes over 200 malicious apps on the Google Play Store that were downloaded over 100 million times. Google has now removed the apps from their Play Store.

But what happens to the millions of people who have this software on their Android devices? Are they somehow notified by Google? Does Google automatically offer to uninstall the software for them?

Or are millions of users left with malicious apps on their Android devices?

# Answer
By default, no. This would require Google to sniff the apps in your phone, in which they should ask your permission to do so.

However, there is this:

Google Play Protect

> How Google Play Protect works
>
> Google Play Protect checks apps when you install them. It also periodically scans your device. If it finds a potentially harmful app, it might:
>
> Warn you. If an app is detected that may be harmful to your device, you’ll get a notification. To remove the app, tap Uninstall on the notification. Google Play Protect might also disable the app to keep it from running until you uninstall it.
>
> Remove the app automatically. In some cases, if a harmful app has been detected, you may get a notification saying the app was removed.
> 3 votes

---
Tags: malware, google, google-apps
---


# Question
Title: Is there a way to fine tune locale settings?
I have had this question for quite a long time and I hope that it can actually be done.

I live in Greece, but I mainly use my Android (Lollipop 5.0.2) mobile phone in English (US). The reason is that this is my personal preference. I feel a lot more comfortable having a UI in English.

The problem I have is that when using applications that operate based on locale settings (distance, decimal points, etc) everything is according to the US locale and that's normal.

But I live in Greece and would like, for example, Foursquare to display km instead of miles by default. Even though that's something you can change in settings, the decimal point in the Calculator app cannot be changed (US locale uses `.` for the decimal point and `,` for the thousands, while in Greek locale it is the other way around).

So, is there a way (not necessarily a user-friendly one) to fine tune these settings to match the Greek locale, while still using EN\_US as the display language?

This does not answer my question. I would also be interested in manually editing the US locale, if necessary and possible.

# Answer
In principle, no need to download any extra application to your cell phone to solve this problem. Try going to the region or language configuration and change from English from the United States to English from Europe, at least it worked for me like this.
> 0 votes

---
Tags: settings, localization, locale
---


# Question
Title: Can any computer connect to a SSH server running on an android phone connected to a wireless mobile network?
I run a ssh server on an Android phone using SimpleSSHD.

When the phone is connected to a wifi network, I can connect to the SSH server from a computer in the same wifi network.

When the phone is connected to a carrier's wireless mobile network, I found an IP address on the android phone in "Settings-\> About Phone -\> Status". How can I find out if the IP address is a public IP address for the phone's network interface, or shared by many devices in the same LAN? Can any computer connected to the Internet connect to the SSH server using the phone's IP address? It seems that I can't, and I was wondering why?

```
$ ssh -p 2222 11.22.333.444
ssh: connect to host 11.22.333.444 port 2222: Connection timed out

```

Thanks.

# Answer
For running a SSH server on a Smartphone connected via mobile data to the Internet you need a public IP address on the mobile network interface.

You can simple check if your IP is a public one: Enable mobile data and disable Wifi on your phone and check the IP address you have (Phone status in Android settings). If the IP address starts with 10.x.x.x or 192.168.x.x it is obviously a private IP address. If not open your web browser on the phone and go to https://www.whatismyip.com. Compare the IP address shown there with the one one in your phone settings. If they match your IP is a public one.

Unless you have a special mobile data plan, the majority of mobile network operators (MSO) will not assign your device a public IP address. Instead you are getting a private IP address that needs to pass a NAT gateway running in the MNO's network. The main reason for this situation is that the IPv4 addresses are rare - most MNOs don't have enough IPv4 addresses to assign every mobile device a public IPv4 address.

Some MNO offer special data plans with a public IP address - usually only for business customers and with higher prices.

The whole situation is similar to a Smartphone connected to a Wifi in a network with a NAT router that is connected via DSL/cable to the Internet. But in difference the NAT router is not accessible so that nobody can open up ports (port forwarding) to make a service accessible running on a system in the network behind the NAT router.
> 1 votes

# Answer
> Can any computer connected to the Internet connect to the SSH server using the phone's IP address?

depends on how your ssh server is configured, along with TCP wrappers. By default, that is typically yes. However you can restrict who and from where can successfully connect via SSH by editing `/etc/hosts.allow` and changing

```
SSHD : ALL : ALLOW

```

to something more restrictive. There is also `/etc/hosts.deny` you can play with, along with editting `/etc/ssh/sshd_config`. Realize SSH is the protocol and is completely independent of the computer system... if my dell laptop *follows* the SSH protocol and a coke machine follows the same version of the SSH protocol, then a valid communication link can be established between the two... over TCP/IP. When this will not work is when that communication is blocked via some other means. Not to mention firewall settings...

> How can I find out if the IP address is a public IP address for the phone's network interface.

use a browser on the phone and go to a website that will report back to you the \[public\] ip address it sees your phone as. If that reported address matches what is in Phone\_Settings, then that would be a yes. But I can tell you what ip address your phone settings is saying is not a public ip address, for the same reason my home computer through the comcast modem gives my home computer 10.0.0.1. Simply web search `what is my public ip` to find any of a hundred sites that will tell you your public IP.

unix&linux \> AndroidEnthusiasts :)
> 0 votes

---
Tags: ssh, ip-address
---


# Question
Title: Is it better to use Android System Webview when not using Chrome as default browser?
I've a phone and tablet running Android 7.0. In both cases I do not use Chrome as my default browser.

I believe that the use of Chrome Webview was to reduce resource use by sharing code.

Does it make sense, when one is not using Chrome, to disable Chrome and use Android System webview as default?

# Answer
From Nougat onwards Chrome *is* web view. It replaces web view and web view is not available on Play Store as an independent app to install / update separately. In other words, web view is integrated with Chrome

> ....WebView component will actually become a part of Chrome to bring in more data and memory efficiency.

> ....Starting in Android 7.0 Nougat, WebView will actually be Chrome....The standalone WebView APK will no longer be updated via the Play Store as long as the Chrome rendering remains enabled on your device.

> You can choose your WebView provider by enabling Developer Options and selecting WebView implementation. You can use any compatible Chrome version (Dev, Beta or Stable) that is installed on your device or the standalone Webview APK to act as the WebView implementation.

But webview is not updated anymore nor available , so using Chrome is the way forward.

You can also try Chromer a lightweight open sourced Chrome which is less resource hungry
> 4 votes

# Answer
Just to clarify, Android System WebView is still updated, even in 2019. (For those using it)

> Android System WebView, last updated Mar 1, 2019

Yes, Chrome is trying to be like WebView with multiple similarities, but it is different. There is no plans to get rid of until Chrome can catch up, but it has a long ways to go.
> 0 votes

---
Tags: 7.0-nougat, webview
---


# Question
Title: How to navigate to top/bottom of page in mobile firefox
Is there a way to quickly navigate to the top/bottom of the current page in mobile firefox (i.e. the equivalent of using the home/end keys in the desktop version)?

# Answer
You should add an add-on to help accomplish what you asked. Top and Bottom scroll buttons adds buttons to scroll to the top or bottom of a page.

> This extension adds two beautiful buttons at the corner of each page for fast scrolling to the top or the bottom of the page.
>
> The buttons are customisable. You can change its size, transparency, position and the way they are scrolling. You can also set the buttons to auto hide so you'll see them only when you want.

**Disclaimer:** I am just a user of the addon, not related to its developer.
> 3 votes

# Answer
You can get these two extensions:

Go to Top of Page Button

Got to Bottom of Page Button

They will put a button in the toolbar labeled `Top` and `Bottom`
> 2 votes

---
Tags: firefox-for-android, user-interface
---


# Question
Title: How Android's permissions mapping with UIDs/GIDs works?
Reading the book: Android Security Internals I'm reading at **Chapter 2** \- *Permission Management* paragraph that permissions are assigned to application at install time by the package manager with a mapping like Apk's UID \<-\> Permissions.

Later in the book (*Permission Assignment - Permissions and Process Attributes* paragraph) I read that

> If additional permissions have been assigned to the application, they are mapped to GIDs and assigned as supplementary GIDs to the process.

And, since *android.permission.INTERNET* permission is associated with *inet* GID:

> any process for an app that has been granted the INTERNET permission is associated with the supplementary GID correspond- ing to the inet group

But I was asking me if this is always necessary.

Imagining a case where you install APK *X* declaring *android.permission.INTERNET* permission in *AndroidManifest.xml*, since mapping of permissions with UIDs is done at install time, *PackageManager* should be able to map the permission directly with the APK's UID instead of adding *inet* GID to your APK package. So I'm wondering why it has to be that:

> any process for an app that has been granted the INTERNET permission is associated with the supplementary GID correspond- ing to the inet group

Anyone can clarify me this?

# Answer
Android's permission management can be divided majorly in two parts: Linux kernel and Android framework.

**DISCRETIONARY ACCESS CONTROL:**

Discretionary Access Control (DAC) based on users, groups and access mode predates back to early days of UNIX. Every file (including directories) and process has a user owner (UID) and a group owner (GID). So a process is allowed to Read Write and eXecute a resource depending on its access mode bits (`RWX`) for User, Group and Others (`UGO`). These permissions attributes are saved along with files on filesystem.
UID/GID `0` is special for Linux kernel; it's the super user (administrator) that is never denied from doing anything. All other users in range `1-65534` are non-privileged IDs which an OS can use in whatever way it wants to control access.

Android reserves UIDs in range `1000-9999` for system use unlike Linux distros where 1000 is usually the first UID assigned to human users. Android is designed for single human user but every Java app, whether preinstalled (as system or user app) or installed by user, is treated as a user. UID range `10000-19999` is reserved for these apps. At first boot (for preinstalled apps) or when installing a new app, a unique UID/GID is assigned to the app which is static unless the app is uninstalled. This app vs. UID mapping can be seen in file `/data/system/packages.list` or using command `id` <sup>()</sup> if the app provides a shell or can execute native binaries.

All of these UID's have hard-coded names on Android which are predefined, unlike Linux distros, where there are almost standardized naming conventions for users and groups which can be added / removed in `/etc/passwd` and `/etc/group`. Android shares only `root` user name with Linux. However these names are only for the ease of human users, for kernel only numbers (UID/GID) mean.

*Access Control Lists (ACLs) can be used to extend DAC for more granular privileges but those are rarely used on Linux and (AFAIK) not used on Android.*

**LINUX CAPABILITIES:**

Root user's authorities are further divided into subgroups called capabilities. Instead of using UID 0 whenever an elevated task is to be performed, a non-privileged UID can be granted only the required capability. File capabilities which are attached to files using Extended Attributes (XATTR), can also be used to elevate process capabilities whenever required. Android makes use of File Capabilities as well as Ambient Capabilities. See this thread for more details.

**MANDATORY ACCESS CONTROL:**

Mandatory Access Control (MAC) was introduced later to supplement DAC for better security. Android uses SELinux as part of its security implementations. SELinux also makes use of Extended Attributes to label files with a context while every process is also run with a SELinux context. Then a policy is defined which includes thousands of rules allowing one context access the other, denied otherwise by default. See this answer for more details on SELinux and an example how Android makes use of DAC, capabilities and MAC.

By making use of Linux kernel's DAC, MAC and capabilities, Android launches every app in a sandboxed virtual machine forked from `zygote` process, with its unique ID and with all capabilities dropped, so that forced to access only it's own files in `/data/data/<app_pkg_name>` or in external storage. See this answer for more details.

**MANIFEST PERMISSIONS:**

To have a further fine-grained control of system resources, in addition to Linux's access control mechanisms at kernel level, Android enforces it's own Manifest Permissions to installed apps within its core framework. These permissions are of three types: Normal, Dangerous and Signature.
All normal permission are granted to a requesting app without human interaction. For instance a user can't restrict an app from accessing internet if the app is requesting `android.permission.INTERNET`. Some of such permissions are controlled by using third party tools.
Dangerous permissions - such as `READ_CONTACTS` \- aren't granted to an app without user's approval. Some of Signature permissions treated as Special permissions \- such as `REQUEST_INSTALL_PACKAGES` \- can also be controlled from `Settings app > Apps & notifications > Advanced > Special app access` menu on newer Android versions.
Additionally some of the permissions for which user doesn't have independent control such as GET\_ACCOUNTS, or the operations which don't have corresponding permissions at all such as RUN\_IN\_BACKGROUND, can be controlled from a hidden permissions manager of Android: AppOps. But this is meant only for OS use and not for end users.

**PERMISSION CHECKING AND ENFORCING:**

Permission preferences are stored by Android Package Manager in different files such as `/data/system/packages.list`, `/data/system/packages.xml`, `/data/system/users/0/runtime-permissions.xml` at app install time or at runtime. These permission checks are then enforced on multiple events such as when accessing intents, starting an activity, sending/receiving broadcast, accessing a content provider, starting/binding to a service etc.

Though the whole permission checking and enforcing process happens under `zygote` in which ActivityManager and PackageManager \- which are part of `system_server` \- play major role, the core framework doesn't handle every permission check on its own. It again takes help from kernel to make permission checks more robust and efficient.
For instance READ/WRITE\_EXTERNAL\_STORAGE permissions are enforced through UIDs/GIDs by bind-mounting different views of Storage in a mount namespace for every app. See this answer for further details.

**PERMISSION \<--\> GID MAPPING:**

Another special case where Android relies on Linux kernel for permission check is `android.permission.INTERNET`. As stated earlier, only UID/GID `0` is special for standard Linux kernel. However Android applied a special patch PARANOID\_NETWORKING to Linux kernel which maps certain capabilities to certain group IDs in range `3000-3999` making them special. One of those is INET (3003) group which allows its members to access internet (create PACKET sockets) which isn't possible without capability NET\_RAW otherwise. All `permission <-> GID` mappings can be found in file /system/etc/permissions/platform.xml.

Coming to your question:

> since mapping of permissions with UIDs is done at install time, PackageManager should be able to map the permission directly with the APK's UID instead of adding inet GID to your APK package

So the answer is, `PackageManager` doesn't handle `android.permission.INTERNET` on its own. It just adds the app to INET group and saves the configuration. Let's take example of Termux:

```
~# grep termux /data/system/packages.list
com.termux 10142 0 /data/user/0/com.termux default:targetSdkVersion=28 3003

```

Next time the app is launched with 3003 in its supplementary groups so that kernel doesn't restrict the app from accessing internet when enforcing DAC:

```
~# ps -p $(pgrep com.termux) -o cmd,uid,gid,supgrp
CMD                           UID   GID SUPGRP
com.termux                  10142 10142 3003,9997,20142,50142

```

**SOURCES:**
> 12 votes

---
Tags: permissions
---


# Question
Title: Can I change which SIM a phone is using for its LTE interface using ADB?
I have a set of phones that have dual SIM cards. What I would like to do is have them connected to one network using SIM card 1, run some test, disconnect from the network, then have them connect to a second network using SIM card 2. Is there a way to do this through ADB? Preferably without root access, but if that's not possible, then with root access is okay.

# Answer
This post didn't get much attention, so I don't know if it's worth posting the answer, but I did find a solution.

I didn't know when posting this that the solution is dependent on the version of Android. In my case, the phones have Android 9 (Pie).

The command that I found to turn on/off SIM cards is:

```
adb shell service call phone 180 i32 X i32 Y

```

where X is the SIM card number (1 and 2, in my case) and Y is 1 for enable and 0 for disable.

If anyone is interested, I found the solution by digging through source code on android.googlesource.com. Once I found the interface for ITelephony (it was a .aidl file), I had to count the functions, because the number 180 in the command meant the 180th function in that file. I also derived the arguments i32 X i32 Y from the arguments to that function. The answer here helped me a ton: https://stackoverflow.com/questions/20227326/where-to-find-info-on-androids-service-call-shell-command.
> 4 votes

---
Tags: adb, dual-sim
---


title: Securing a young child's tablet

text:
# Question
Title: Securing a young child's tablet
My wife has decided to get the kids a set of android tablets for christmas. These are Coby Kyros 4GB wi-fi only models. The kids are ages 6-10 so I don’t particularly want to let them have free reign of the internet or the app stores. I also want to make sure the tablets are protected from the various forms of malware.

Ideally I would like to be able to establish a white list for the websites they are allowed to visit, and make it so that they are not able to add any apps or modify the white list without parental intervention. However I am not familiar enough with the android platform to know where to start on any of this.

Google has helped me find out that apps exist which claim to be able to restrict access to other apps, but almost all of them have comments indicating that they are very easy to bypass. Likewise I have been seeing mixed reviews as to the effectiveness and value of the antivirus options that are out there. So far I have not been able to find anything about building a whitelist, or restricting content accessible from the web.

So I am asking for suggestions as to specific topics/apps that I should be reading up on, and/or other approaches that I can take to reach these goals.

EDIT: I should note that this model does not come with the android market pre installed, it has some third party app store on it. It does come with an apk manager installed, and I have played with one of them enough to get the market and gmail onto it. So I should be able to get most anything installed/removed if I can figgure out what it is I actually need to do.

# Answer
As I noted in your other thread, your best bet is probably to manually set a web proxy server via the devices network settings that filters by keyword or whitelists. Even if they do go to another person's house or try to get on another network, they will be unable to browse (especially if you are hosting the proxy server yourself on your own network; in that case, they most likely won't be able to browse to anything at all).

From wikipedia:

> In computer networks, a proxy server is a server (a computer system or an application) that acts as an intermediary for requests from clients seeking resources from other servers. A client connects to the proxy server, requesting some service, such as a file, connection, web page, or other resource available from a different server. The proxy server evaluates the request according to its filtering rules. For example, it may filter traffic by IP address or protocol. If the request is validated by the filter, the proxy provides the resource by connecting to the relevant server and requesting the service on behalf of the client. A proxy server may optionally alter the client's request or the server's response, and sometimes it may serve the request without contacting the specified server. In this case, it 'caches' responses from the remote server, and returns subsequent requests for the same content directly.
> 6 votes

# Answer
The overall outlook is not so great for you, AFAIK.

The Market has content filtering, check the Settings in the Market app.

For the browser, that's a wholly different kettle of fish. The built-in browser doesn't have any kind of filtering available. 3rd party browsers might, but they'll be trivial to sidestep (by simply opening the built-in browser).

The next best thing you can do is filter the tablets at the router, if it allows for that. However, that's only useful when they're at home (or other places where you can control their internet connection).
> 8 votes

# Answer
This isn't really manageable from a technical perspective (you could go some way towards it by sorting out your own firmware, using something like Cyanogen) as we often point out over on security.stackexchange.com once an attacker (in this case, your children) have a device, they control it.

So, my alternate course of action would be as detailed in this question over on parenting stackexchange \- start off with visibility, using the devices together, and education - that will go much further towards making your children safe than any technical control you can implement.

What I have done with my 3 (now 5, 9 and 11) was let them use computers in the main room while we were there (aged 3 - 5) and then unsupervised until about 8 (but knowing we would be walking in and out) and over 8 year's old I trust them not to be stupid.

It helps that their dad is a security and privacy specialist who often provides awareness training in this area :-)
> 6 votes

# Answer
Use OpenDNS on your router at home. As long as they are accessing the Internet from home then you can whitelist or greatly restrict what sites they can visit. I use OpenDNS currently to restrict my children's access with the browser on their Nintendo 3DS. Since it is at the router level it doesn't require any support at the device level.

If they are accessing wifi outside the house then there isn't much you can do - for example at the library. But they could just as easily use an unrestricted computer at the library instead of the restricted tablet.

If you can remove the app store from the device, and then just manually install the apps you want them to use, that is probably the best way to go. You will be pretty close to a walled garden.

Additionally I would suggest you perform an "audit" on the devices weekly or at least regularly. Check out what is installed, and look for any worrying activity, or lack of normal activity. Also use that as a chance to talk to the kids about the devices and see if there are new apps they want you to get for them. If you install a new game or something every time you audit their tablets then they will be looking forward to it! Actual communication generally trumps technology.
> 3 votes

# Answer
Try using **Surelock** And **Surefox**. They will lock it down and give you a white list provisioning.
> 2 votes

# Answer
Note: the following extension has a whitelist feature as well. Works on Android. But might be a little harder to install.

What works best for me is a keyword filter. This is the best way to filter any content because it can catch almost 100% of what you target. Eg. if you're addicted to the game Warcraft, you simply add that to the keyword, and that will be gone from the internet.

It works only on Firefox version 56.0, using Procon latte filter. This extension no longer works on the later versions, and it's no longer on the addon store.

Introduction, https://www.howtogeek.com/howto/2617/filter-web-content-in-firefox-with-procon-latte/

What sets it apart from other keyword based filters, is the accuracy, and minimal false positives. Plus its totally free and has password protection on addons page.

Some keyword blockers are overly aggressive. eg. if you set it to block the word, "bra", it will block "branding", "brain", "library" as well. This makes it pretty much unusable.

For instructions on how to set this up on Firefox Windows and Android, https://github.com/hpaolini/procon/issues/29
> 0 votes

# Answer
You can try Pluckeye android browser. Easy to install, and disables ALL images/videos. Might be blocking too much, but it's definitely safe.
> 0 votes

# Answer
Once you've decided on the browser to use, you will need to use an applocker to disable the playstore, and other browsers and apps that have open access to the internet.

Highly recommend Applock.

It's a free app locker, that is very full featured. Allows you to toggle between different groups of apps to be blocked/allowed. Password protection and email reset.
> 0 votes

---
Tags: applications, security, browser, malware, kiosk-mode
---


title: How to get why an app crashed?

text:
# Question
Title: How to get why an app crashed?
I regularly obtain the infamously unhelpful "unfortunately crappyApp has stopped working". How to figure out what actually went wrong? I guess there's a stack trace somewhere, though ideally I'd like to modify the unhelpful message itself if that is possible on a rooted device.

# Answer
> 4 votes
You can simply see the crash stack trace after any crash happens. Use ADB command below,

```
adb logcat -b crash #default
adb -d logcat -b crash #show from device when multiple device
adb -s logcat -b crash #show from simulator when multiple device

```

# Answer
> 2 votes
There are multiple ways to obtain useful information. But as Dan pointed out, on-device solutions will require root (starting with JellyBean) – and off-device solutions ADB:

* `adb logcat` was already described in Dan's answer. For more details, you can see our tag-wiki.
* `adb bugreport > report.txt` gives very detailed information, including details from the `dumpsys`, `dumpstate`, and `logcat` tools. Several tools for easier analysis of its output can be found e.g. in the answers to Better method of viewing “adb bugreport” output? on our sister-site.
* there are tools to be installed on your computer which utilize the above (or at least parts of it), like QtADB (for Linux, Mac, and Windows)
* there are Android apps like Bug Reporter; but as pointed out, most of them will require root. Bug Report Reader however claims to *read system logs (logcat, dumpsys, dmesg, top and much more) on your device, without root*, so that might be worth trying.

# Answer
> 1 votes
In most cases, if USB debugging is turned on, you can use `adb logcat` to see the exception output. This usually includes a stack trace, but that's not often useful unless you have the app's source code. All the same, the developer of the app will probably be grateful if you include it in any bug report.

# Answer
> 0 votes
Read the files under `/data/anr/` which stands for "apps not responding". I use `adb shell cat /data/anr/$FILE`

There will be one for every app which force closes, or is not responding for some reason.

---
Tags: crashes, troubleshooting
---


# Question
Title: lsusb returns "permission denied" in Termux
When I run `lsusb` in Termux, the output is `permission denied`. I don't have root access.

Perhaps the Android system allows me to get specific access in root?

# Answer
`lsusb` command lists entries in `/sys/bus/usb/devices` which is world-readable but SELinux would be denying access because `u:r:untrusted_app:s0` context isn't allowed to access `u:object_r:sysfs:s0`.

However you can try `adb shell lsusb` because sepolicy allows `u:r:shell:s0` to read the directory as defined here:

```
allow shell sysfs:dir r_dir_perms

```

And here:

```
define(`r_dir_perms', `{ open getattr read search ioctl lock }')

```
> 1 votes

---
Tags: root-access, usb, permissions, termux, selinux
---


title: How to change icons on EMUI

text:
# Question
Title: How to change icons on EMUI
I want to change a few particular icons without giving up the look of the EMUI.

I tried IconChanger, but it leaves a water mark on the new icon. I also tried NovaLauncher; however, it doesn't support font customization and I'm not a fan of the elongated font it uses.

Is there a way to change the icon files manually? Is there a launcher that will enable icon changes without changing other aspects of the GUI? Just to be clear I'm not looking for an icon pack. I want to make use of a few specific icons that I've created.

# Answer
> 0 votes
a lancher won't change things like the notification panel and other UI elements you can get icon packs for android however i am not sure if EMUI default launcher supports them try and go to settings search for font i know lawncher launcher support's icon packs and can change the font colour on the home screen

https://play.google.com/store/apps/details?id=ch.deletescape.lawnchair.plah&hl=en\_US&referrer=utm\_source%3Dgoogle%26utm\_medium%3Dorganic%26utm\_term%3Dlawnchair&pcampaignid=APPU\_1\_WqyLXJP9KdqG1fAP2cKgyAE

what version of Android are you running?

---
Tags: nova-launcher, emui
---


# Question
Title: How to change language to English in Oppo A59s?
All the RAM result are in Chinese, and I can't read it. I have an OPPO A59s running Android version 5.1, and a ColorOS version 3.0. All output is really difficult to understand and operate. What to do?

# Answer
Try going into the settings, and search for language.

Unfortunately, that version of Android and colorOS is very old and outdated. Try and see if you can update it to a newer version.

Some oppo apps may of not been translated into languages other than Chinese.
> 1 votes

---
Tags: languages, oppo-coloros
---


# Question
Title: Keeping passwords/credentials out of the cloud
Under what circumstances will a current Android sync or otherwise send passwords off the device? The credentials in question are for:

* WiFI
* Non-Gmail email accounts accessed through the stock Gmail app
* Other apps, eg. Twitter

This question is on behalf of a family member looking at acquiring a Pixel 3, but concerned over how such is handled (including whether apps are able to read each other's data). I've been able to find details of how the Gmail app works with credentials for Gmail accounts, but for other email types and the other cases the details seem more fuzzy (or the answers more than five years old).

It is of course expected that for email protocols such as POP3 the client will need to submit the credentials off the device to authenticate with the service; this question is about whether they might get sent somewhere else as well, for whatever reason, and whether this can be controlled.

# Answer
The Wifi credentials are automatically synced to the Google Cloud if you have enabled the setting "Backup to Google Drive" (Android settings).

Regarding the credentials (e.g. username and password) used by other apps there is no way to say something in general. Those apps may or may not store the required credentials in a secure way. Modern Android systems (Android 5 and newer) provide some relative secure mechanisms for using encryption keys that are maintained by Android itself. Those keys can then be used for encrypting the credentials before saving them to the flash memory. But using encryption the correct and secure way isn't easy. A lot of app developers use the easy and sloppy way and store credentials more or less in plain text.

Also the automatic backup into the cloud comes into play - if the app developer has not configured it correctly the stored credentials are backuped/synced into the Google cloud (if enabled system-wide, see first section).

Last but not least the is your question about the possibility to detect if an app sends credentials into the net. Unfortunately the only answer is: If the app developer wants to do so the app can do it. Additionally this can also be done by any development library the developer includes into the app (advertising, tracking, ...).
> 1 votes

---
Tags: sync, gmail, privacy, wifi-password
---


# Question
Title: Call custom emergency number from lockscreen
Ok, basically, what I want, is to provide Android phone to child, locked by passcode (or gesture), and allow the child to call parents (two numbers) from locked device.

My current available target device is SDK 22, Android 5.1, but I will not limit the answers to this target.

What is not correct answer:

* something along the lines of setting ICE info, this won't allow to call, just to display ICE phone numbers
* modifying the SIM card data, as this is not possible generally and not available in my case
* solutions requiring ROOTing the device, as this is not possible in my case
* solutions using CALL\_PRIVILEGED, as this permission is protected and not achievable without ROOTing the device or having custom ROM
* Solutions using Samsung or other proprietary emergency dialers, as the devices I target, do not use any such measure, and look like this

What I've tried to do is

* Creating custom notification intent on the lockscreen, which would use ACTION\_CALL intent and `android.permission.CALL_PHONE` permission
    + this is not working solution, as CALL\_PHONE requires unlocking the device
* Creating custom notification intent on the lockscreen, which would send out SMS to pre-defined numbers
    + this works, however it might be pricey, and I consider this the last resort option
    + this also does/might not resolve the `emergency` cases, child might got into, because the reaction time depends on parents having the phone volume up and calling back right-away

# Answer
> 2 votes
The feature you are looking for already exists in Android 7.0+. Upgrade your device if you can.

---
Tags: lock-screens, 5.1-lollipop, emergency-calls
---


# Question
Title: How to download apk file of telegram app on android?
Telegram allow to install app only on Google Play Store but I want to download apk file and send to my friend because his Android device which does not have access to Google Play Store. Is it possible to download apk file of Telegram app on android without any apk website downloader only from right apps or right ways?

Thank in advance for all of you Stackexchange Community!

# Answer
You can use the app APK Extractor to get the APK of the application you want on your device to send, or you can find a version of the app on a mirror site, like APKMirror.

I have used both in the past and have not had problems with them.

There are other apps similar to APK Extractor that allows you to obtain the APK, like Backup & Restore. I have not used this one personally, but people have recommended it before.
> 1 votes

# Answer
Yalp Store has the option to select the download directory to store the downloaded APKs. Yalp Store fetches apps from Play Store.
> 0 votes

---
Tags: applications, apk, downloading, telegram
---


title: Log off animation in Pac-man rom

text:
# Question
Title: Log off animation in Pac-man rom
How can i change the default log-off animation in my nexus4(PAC man ROM). I was able to change the boot animation in data folder but unable to find the logoff animation.

# Answer
Try this: How to Change Shutdown animation

As it says, you'll find the location of the animation is *"/system/media/video/shutdown"*
> 0 votes

# Answer
I'm not sure about your device specifically, but the structure i have is a bootanimation.zip & SHUTanimation.zip
> 0 votes

---
Tags: nexus-4, boot-animation, pac-rom
---


# Question
Title: using printenv in script sh in recovery TWRP return error execv failed : Exec format error
for example just try this script

```
#!/sbin/sh

printenv | grep sdcard >> /tmp/tong.txt

```

in recovery.log i've

```
run_program: execv failed: Exec format error
run_program: child exited with status 1

```

I think it's about printenv but i don't understand what is wrong. Using printenv in a terminal emulator works but not in my script sh

# Answer
> 0 votes
printenv doesn't work but using env works well

so i changed my script like this

```
env > /tmp/tong.txt

```

it works as expected

---
Tags: recovery-mode, twrp, scripts
---


# Question
Title: Is it possible to run applications with different locales (languages)?
I want to run some applications in one language and the rest with the others. Specifically, I'd like to run maps in Russian (I really don't need names transliterated to Latin) and everything else in English (Russian translations are usually very poor and I just cannot understand what the app wants to tell me. English translations are usually good enough for me to understand).

I run stock android 4.2.2 on rooted Texet X-basic tm-4072. The solution involving Tasker does not apply for me because Google Play says Takser is not compatible with my phone. There was an application for this, but now it's outdated and I don't know how to reach the author (he suggests to send the newer version to those who write to him).

In desktop Linux I'd simply run app with different LANG value, does something like that work for Android?

# Answer
This module for Xposed Framework should do the trick if your device is rooted.

1. Install Xposed Installer.
2. Run Xposed Installer and use it to install Xposed Framework. It's a two-tap operation followed by a reboot.
3. Find the App Settings module in Xposed Installer, install and enable it. Reboot device.
4. Click the module in Xposed Installer to show its GUI. You'll be presented with available features, including changing app locale.
> 1 votes

# Answer
Locales are programmed on a per app basis,

For example, if i developed an application with hard coded string characters in English, the hard coded characters will always be in that language...

It requires translations, string's of characters to replace per locale...

If you are sure it supports the language then it is hypothetically possible, however the developer defines the the default language...

You can manipulate or MOD the APK with something like APK Editor or APK Tool to set Russian as the default locale in the application.

The problem i think you are having is that your specific app needs an update to one with a larger selection of translations.
> 1 votes

# Answer
This app Xposed App Locale helped me to change locale per application.
> 0 votes

---
Tags: languages, locale
---


# Question
Title: How do I stop Android speaking my commands?
Suddenly (OK so I may accidentally have triggered a setting somewhere) my android phone (LG v20 Standard Android) has started speaking all the touch commands I do.

For example, if I start from a blanked locked screen and turn it on the device says "Screen on. the time" Then after a pause, "Screen Off" as it turns off the screen

If I type in characters it speaks every letter/character as I press the key (makes passwords tricky!!)

If I try to close an app with the X I press the x it says "Dismiss button. Double tap to activate" I double tap and it says " app dismissed"

But worst of all swipe no longer works. So I cant swipe up to see what is on the bottom of a page; I cant swipe left to see other pages of apps etc etc

Please, how do I get back to a normal silent android! TFAI

# Answer
**Method 1**

Tap Home key \> Tools \> Settings \> General tab \> Accessibility \> Vision. Then, disable Talkback

**Method 2**

Hold `Volume Up` \+ `Volume Down` for more than 3 seconds to disable (or enable) Talkback as described in this answer from XDA.
> 1 votes

---
Tags: voice-command
---


# Question
Title: Linux command 'w' - how is this as command written in Android shell?
I am searching for similiar commands in Android shell - as they are used in Linux like these commands - what can I type in Android terminal for :

> w
>
> who
>
> whoami

?

Thank you.

# Answer
Linux commands `w` and `who` read login information from file `/var/run/utmp`. Traditional Linux sysV login records/logs like utmp, `wtmp`, `btmp` and `lastlog` are set and read by some programs that make use of GNU libc (the most commonly used C library on Linux distros) and other libc's. These files contain information about currently and previously logged-in users.

However there is no concept of Linux console login on Android as it isn't designed for multiple user logins. Virtual terminals are disabled on Android by default, `init` doesn't start `getty`, and hence there is no login, no login manager (like `logind`), no `shell` at startup and no user sessions, and therefore no login files. Android boots directly to GUI. Other CLI programs like `sshd` that read/write these login files are also not part of Android. So Android's Bionic libc neither provides the functions of utmp.h, nor filesystem hierarchy contains `/var/log` or `/var/run`. However if a program linked against standard Linux libc's is used on Android, it will try to access these login files. But if a program - like `w`, `who`, `users`, `last` and `lastlog` \- is totally dependent on these files, it simply won't work. You can use busybox such as yashdsaraf's to get all these commands on Android.

Linux command `whoami` gets the (effective) UID of process by making syscall geteuid directly to kernel and then on Linux , if possible, resolves ID to name using name resolution mechanisms like directly from /etc/passwd, /etc/group or through NSS, NSCD etc. `id` command additionally does `getgid` and `getgroups` as well. So these commands work on Android as expected and - along with other similar tools `logname` and `groups` \- are part of toybox; Android's choice for all-in-one Linux command line tool.
Bionic libc's wrapper functions (that apps actaully use through Android APIs to get UID) and kernel syscalls are also identical as is the case with other libc's:

```
~# nm -C /system/lib64/libc.so | grep geteuid$
0000000000070d58 T geteuid
~# grep geteuid$ /proc/kallsyms
0000000000000000 T sys_geteuid

```

**RELATED:** HOW TO SETUP LINUX LOGIN ENVIRONMENT ON ANDROID
> 3 votes

---
Tags: command-line
---


title: Google Services

text:
# Question
Title: Google Services
Good day to you, I have an ALPS MT702t phone (MEDIATECH MT6572) Android phone. It has Android 4.4.2 on it. This phone does not have on it Google Services, and Google Framework. I can install applications using Aptoide, FDroid, etc. To have some of these apps on my phone it is necessary Google Services.

Using GAPPS, when I install them I get Unfortunately Google Services has stopped (I used the XIAOMI installer, I rooted the phone, nothing works)

Is there something to use instead of Google Services, please (to have the apps that do not work without Google Services)?

# Answer
> 0 votes
There is something called Microg, which is an open-source alternative to the Google Play Services Framework, and this allows you to use apps that depend on it without having any Google Services on your phone. Though I'm not sure if you can install it without having rooted your phone.

---
Tags: google, services
---


# Question
Title: Clear HTML5 storage in Samsung Internet?
I have a problem using Samsung Internet Mobile Browser on my NoteFE running non-rooted Android 8.0.

Some websites (like mega.nz) use - what I suppose - HTML5 to store data/files offline somewhere. To access the downloaded data as file, Samsung Internet then copies the download from the internal storage to a normal file. This looks like a download, but the data is already in some kind of cache. Chrome does the same, also on PC.

Now, it seems like Samsung Internet doesn't delete this background data. However, looking at app details, I see "data" (not "cache"!) growing with each download, filling up my phones memory. It's already a couple of GB in size.

How do I reclaim this space? Only option seems to be to 'clear data', which includes all bookmarks, site info, and what not.

# Answer
Never mind. I found it:

Menu - Settings - Advanced - Manage website data

This list distinguishes between normal and https, and I failed to find the item as it was saved from a page without https, while the site generally is served with https. So 2 entries, the one was the one with the big size.

Problem solved!
> 0 votes

---
Tags: samsung, browser, storage, 8.0-oreo, html5
---


# Question
Title: Why is the '/storage/emulated/' directory inaccessible?
The **/storage** directory and the **/storage/emulated/0** directory is accessible in a non-rooted Android OS.
So, why is the ***/storage/emulated*** directory not accessible in a non-rooted Android OS ?

# Answer
On Android 6+ `/storage` is a mountpoint where `tmpfs` is (bind) mounted (from `/mnt/runtime/default`) with mode `0755` i.e. it's world-readable.

For every app `/storage/emulated` is a bind mount in an isolated mount namespace, from `/mnt/runtime/VIEW/emulated` which is an emulated/virtual filesystem from `/data/media` having mode `0711` and owner `root`. So the directory is only traversable, not readable by non-root users that includes all apps.

*VIEW is one of `read` (for apps with permission.READ\_EXTERNAL\_STORAGE) or `write` (permission.WRITE\_EXTERNAL\_STORAGE) or `default` (for all other apps and processes running in root/global mount namespace i.e. outside zygote).*

`/storage/emulated/0` is traversable, readable or writeable to apps depending on the status of manifest permissions READ/WRITE\_EXTERNAL\_STORAGE.

These measurements are a part of Android's app sandboxing approach for better isolation, security and privacy.

**Related:** What is /storage/emulated/0?
> 3 votes

---
Tags: stock-android, file-system, file-permissions
---


# Question
Title: problem installing Xprivacy : where is the install button?
I try to install Xprivacy but I cannot find the install button. When I click on the app logo on my phone, I get the below screen.

Clicking on check for root, gets me the new message "Device is rooted" even if I am quite sure it is not.
Probably the missing check mark means that it is not rooted (a bit confusing).

I assume that I first need to root the phone

Correct ?

# Answer
Your device need to be rooted for Xprivacy to work, be installed properly. Even before installing it, you must install Xposed framework which requires root.

From Xprivacy Github page:

> XPrivacy is built using the Xposed framework, which it uses to tap into a vast number of carefully selected Android functions.

> Root access is needed to install the Xposed framework.

The process is:

1. Root your device.
2. Install Xposed installer.
3. Install Xposed framework.
4. Install Xprivacy.
> 0 votes

---
Tags: xprivacy
---


# Question
Title: How to copy the phone number of the sender of a text message in Android default messaging program?
How to copy the phone number of the sender of a text message in Android default messaging program? Does one have to go through "create a new contact" through the `+` menu, or is there any faster way?

I use unrooted Android 6.0 on LG4.

I don't see any "people & options" in the menu:

# Answer
> 1 votes
> Does one have to go through "create a new contact" through the + menu, or is there any faster way?

You can copy the phone number without selecting "Create a new contact". I don't know if there is a faster way but here is how to do it:

1. On the default messaging app, open the text message (SMS) whose phone number you want to copy.
2. Click the 3-dot, then "People & options".
3. Long press the phone number. A message "Copy to clipboard?" will appear, click on "Copy".

Edit: The answer is probably more useful if using Android 7 and above. I deleted, then restored it based on the comments. If it is against the rules, moderators please take the appropriate action(s).

---
Tags: 6.0-marshmallow, sms
---


# Question
Title: How to Get Back the External SD Card Notification
I used to have a notification whenever the external SD card was in the tablet. Recently that notification has disappeared. How can I get this notification back.

I like this notification since I am able to eject the card from it without needing to go thru the settings menu to get to it.

What is interesting is that when I insert a different card the notification is back. I only am missing it for the original card. Last time I had this problem I factory reset my tablet. I would rather not have to do this again.

I searched for a solution but only found solutions to get rid of the notification, not the opposite. I tried to reboot my device but that didn't help.

Any suggestions will be greatly appreciated.

# Answer
> 0 votes
**Another great solution**, but your device must be rooted to be able to use this option (ASFAIK).

Use the sm tool `sm forget [UUID | all]` This makes the device forget the storage device with the given UUID or if you do all it forgets all the devices.

If your using Termux terminal emulator (as I am) you need to do `tsu -p` in order to be able to use the `sm` tool. If not you get an error. Basically what you need is for the `LD_LIBRARY_PATH` to point first to the android library path and `-p` prepends those paths **BEFORE** the termux library path.

I didn't try this in any other shell or terminal, but I'm assuming it should work there as well.

# Answer
> 1 votes
Change the volume serial number of the sd card.

There might be various ways to do it, this one worked for me when I had the same problem after touching "clear all" when displaying notifications.

Mount the SD card on a windows PC.

Note the drive letter of the sd card by opening a windows explorer window. For example let's say it was mounted as E:

In a command prompt window type the following command to find out the current volume id of the sd card, assuming the SD card is E: drive.

```
vol E:

```

It should give you a number like 1234-5678

Download the Microsoft utility "volumeid" from this link at Microsoft:

Follow the instructions at the link for using the utility and give the SD card a new volume id.

Make sure you use the right drive letter, the drive letter of the SD card. You don't want to change your hard disk by mistake.

In a command prompt window, the syntax is:

```
volumeid E: 1234-5679

```

This will change the volume id of E: drive to 1234-5679

When you put the SD card back in you android device the device will think it's a different card and show the sd card mounted notification.

# Answer
> 0 votes
To add to @Morris's answer a way to do it in Linux (or on the Android device itself using Termux)

Run `sudo blkid` to find which device is the sd card. (On my device it was `/dev/block/mmcblk1p1`)

Now run `sudo mlabel -i REPLACE-WITH-YOUR-SD-CARD-DEVICE -n` (`-n` generates a random Serial Number you can use `-N xxxxxxxx` where you replace the x's with hex digits for the serial number you want see the man pages for `mlabel`).

The idea of using `blkid` and `mlabel` I took form Here! See JonathanS answer. and the exact way of writing the `mlabel` command to use the undocumented `-i` option I took from Here!

\[I ran these commands on the tablet using termux and instead of `sudo` I ran it as superuser doing `tsu -p` and then eliminating the `sudo` part of the commands. I also needed to downgrade my `libandroid-support.so` library for it to work. I found that just doing `tsudo` (termux's version of `sudo`) gave me a large number of devices when I ran `blkid` and it was hard to figure out which one was the sd card.\]

---
Tags: notifications, external-sd
---


# Question
Title: Can't Flash Google Factory Image - No Boot Partition
I seem to have bricked my phone but thankfully the bootloader is unlocked so I'm sure there is a way to fix it. I am having a hell of a time though, I think I need to re-create the boot partition manually. Here is what I get when I try `flash-all.bat`

I can't find instructions how to re-create partitions, but I noticed this in `fastboot --help`, does anybody have experience creating partitons with fastboot? And/Or can somebody get the partition map from their device and/or share/extrapolate the commands needed.

```
  erase <partition>                        Erase a flash partition.
  format[:[<fs type>][:[<size>]] <partition>
                                           Format a flash partition. Can
                                           override the fs type and/or size
                                           the bootloader reports.

```

I get the same in both `slot_a` and `slot_b` and I have manually flashed `bootloader.img` & `boot.img`

```
C:\Program Files (x86)\Minimal ADB and Fastboot>flash-all.bat
target reported max download size of 536870912 bytes
sending 'bootloaderb' (36336 KB)...
OKAY [  0.156s]
writing 'bootloaderb'...
OKAY [  0.516s]
finished. total time: 0.672s
rebooting into bootloader...
OKAY [  0.016s]
finished. total time: 0.016s
target reported max download size of 536870912 bytes
sending 'radiob' (60388 KB)...
OKAY [  0.261s]
writing 'radiob'...
OKAY [  0.837s]
finished. total time: 1.101s
rebooting into bootloader...
OKAY [  0.002s]
finished. total time: 0.003s
target reported max download size of 536870912 bytes
archive does not contain 'boot.sig'
archive does not contain 'recovery.img'
archive does not contain 'system.sig'
archive does not contain 'vendor.sig'
wiping userdata...
Creating filesystem with parameters:
    Size: 120909180928
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 8192
    Inode size: 256
    Journal blocks: 32768
    Label:
    Blocks: 29518843
    Block groups: 901
    Reserved block group size: 1024
Created filesystem with 11/7380992 inodes and 511380/29518843 blocks
--------------------------------------------
Bootloader Version...: TMZ20k
Baseband Version.....: g8998-00253-1809191716
Serial Number........: 710KPMZ0311515
--------------------------------------------
checking product...
OKAY [  0.000s]
checking version-bootloader...
OKAY [  0.000s]
checking version-baseband...
OKAY [  0.000s]
sending 'bootb' (40960 KB)...
OKAY [  0.188s]
writing 'bootb'...
FAILED (remote: No such partition.)
finished. total time: 0.219s
Press any key to exit...

```

# Answer
Well I'm into TWRP but still things awry, but this post is resolved. I had to specify `boot_a` or it tried to use `boota`.

```
fastboot format:ext4 boot_a
fastboot flash boot_a boot.img

```

Finally got fully back to stock, which is what I like to do after a soft brick. I did it by manually typing `fastboot flash foo_a foo.img` for EVERY IMAGE. Then I finished by re-locking the bootloader.

Note: It's scary to lock bootloader while softbricked but I can confirm I have locked/failed to fix brick/re-unlocked bootloader from Fastboot. As long as your "brick" starts with the bootloader unlocked you should be good!

Here is my rediclous fix of my problem:

```
C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash boot boot.img
target reported max download size of 536870912 bytes
sending 'boota' (40960 KB)...
OKAY [  0.156s]
writing 'boota'...
FAILED (remote: No such partition.)
finished. total time: 0.156s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot --slot:boot_aflash boot boot.img
fastboot: unknown option -- slot:boot_aflash

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot --slot:boot_a flash boot boot.img
fastboot: unknown option -- slot:boot_a

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot --slot boot_a flash boot boot.img
Slot boot_a does not exist. supported slots are:
a
b

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot --slot a flash boot boot.img
target reported max download size of 536870912 bytes
sending 'boota' (40960 KB)...
OKAY [  0.172s]
writing 'boota'...
FAILED (remote: No such partition.)
finished. total time: 0.172s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot --slot all flash boot boot.img
target reported max download size of 536870912 bytes
sending 'boota' (40960 KB)...
OKAY [  0.156s]
writing 'boota'...
FAILED (remote: No such partition.)
finished. total time: 0.172s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase boot
erasing 'boota'...
FAILED (remote: Check device console.)
finished. total time: 0.000s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase boot_a
erasing 'boot_a'...
OKAY [  0.016s]
finished. total time: 0.031s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot erase boot_b
erasing 'boot_b'...
OKAY [  0.016s]
finished. total time: 0.016s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash boot_a boot.img
target reported max download size of 536870912 bytes
sending 'boot_a' (40960 KB)...
OKAY [  0.156s]
writing 'boot_a'...
OKAY [  0.577s]
finished. total time: 0.733s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash boot_b boot.img
target reported max download size of 536870912 bytes
sending 'boot_b' (40960 KB)...
OKAY [  0.172s]
writing 'boot_b'...
OKAY [  0.562s]
finished. total time: 0.750s

C:\Program Files (x86)\Minimal ADB and Fastboot>

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash bootloader bootloader-taimen-tmz20k.img
target reported max download size of 536870912 bytes
sending 'bootloaderb' (36336 KB)...
OKAY [  0.141s]
writing 'bootloaderb'...
OKAY [  0.531s]
finished. total time: 0.672s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot reboot-bootloader
rebooting into bootloader...
OKAY [  0.000s]
finished. total time: 0.000s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash radio_a radio-taimen-g8998-00253-1809191716.img
target reported max download size of 536870912 bytes
sending 'radio_a' (60388 KB)...
OKAY [  0.219s]
writing 'radio_a'...
OKAY [  0.859s]
finished. total time: 1.078s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash radio_b radio-taimen-g8998-00253-1809191716.img
target reported max download size of 536870912 bytes
sending 'radio_b' (60388 KB)...
OKAY [  0.235s]
writing 'radio_b'...
OKAY [  0.859s]
finished. total time: 1.094s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot reboot-bootloader
rebooting into bootloader...
OKAY [  0.000s]
finished. total time: 0.000s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash boot_a boot.img
target reported max download size of 536870912 bytes
sending 'boot_a' (40960 KB)...
OKAY [  0.156s]
writing 'boot_a'...
OKAY [  0.547s]
finished. total time: 0.703s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash boot_b boot.img
target reported max download size of 536870912 bytes
sending 'boot_b' (40960 KB)...
OKAY [  0.156s]
writing 'boot_b'...
OKAY [  0.750s]
finished. total time: 0.906s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash vendor_a vendor.img
target reported max download size of 536870912 bytes
erasing 'vendor_a'...
OKAY [  0.030s]
sending 'vendor_a' (360328 KB)...
OKAY [  1.339s]
writing 'vendor_a'...
OKAY [  1.563s]
finished. total time: 2.931s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash vendor_b vendor.img
target reported max download size of 536870912 bytes
erasing 'vendor_b'...
OKAY [  0.031s]
sending 'vendor_b' (360328 KB)...
OKAY [  1.354s]
writing 'vendor_b'...
OKAY [  1.542s]
finished. total time: 2.943s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash system_a system.img
target reported max download size of 536870912 bytes
erasing 'system_a'...
OKAY [  0.078s]
sending sparse 'system_a' 1/5 (524284 KB)...
OKAY [  2.610s]
writing 'system_a' 1/5...
OKAY [  2.235s]
sending sparse 'system_a' 2/5 (524284 KB)...
OKAY [  2.625s]
writing 'system_a' 2/5...
OKAY [  2.266s]
sending sparse 'system_a' 3/5 (524284 KB)...
OKAY [  2.469s]
writing 'system_a' 3/5...
OKAY [  2.266s]
sending sparse 'system_a' 4/5 (521176 KB)...
OKAY [  2.454s]
writing 'system_a' 4/5...
OKAY [  2.261s]
sending sparse 'system_a' 5/5 (167104 KB)...
OKAY [  0.797s]
writing 'system_a' 5/5...
OKAY [  0.734s]
finished. total time: 20.794s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash system_b system.img
target reported max download size of 536870912 bytes
erasing 'system_b'...
OKAY [  0.062s]
sending sparse 'system_b' 1/5 (524284 KB)...
OKAY [  2.469s]
writing 'system_b' 1/5...
OKAY [  2.294s]
sending sparse 'system_b' 2/5 (524284 KB)...
OKAY [  2.453s]
writing 'system_b' 2/5...
OKAY [  2.250s]
sending sparse 'system_b' 3/5 (524284 KB)...
OKAY [  2.453s]
writing 'system_b' 3/5...
OKAY [  2.250s]
sending sparse 'system_b' 4/5 (521176 KB)...
OKAY [  2.449s]
writing 'system_b' 4/5...
OKAY [  2.276s]
sending sparse 'system_b' 5/5 (167104 KB)...
OKAY [  0.781s]
writing 'system_b' 5/5...
OKAY [  0.734s]
finished. total time: 20.474s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash modem_a modem.img
target reported max download size of 536870912 bytes
sending 'modem_a' (60380 KB)...
OKAY [  0.231s]
writing 'modem_a'...
OKAY [  1.312s]
finished. total time: 1.543s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash modem_b modem.img
target reported max download size of 536870912 bytes
sending 'modem_b' (60380 KB)...
OKAY [  0.250s]
writing 'modem_b'...
OKAY [  1.328s]
finished. total time: 1.578s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash abl_a abl.img
target reported max download size of 536870912 bytes
sending 'abl_a' (540 KB)...
OKAY [ -0.000s]
writing 'abl_a'...
OKAY [  0.031s]
finished. total time: 0.031s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash --slot all abl.img
unknown partition 'abl.img'
error: cannot determine image filename for 'abl.img'

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe --slot all flash abl.img
unknown partition 'abl.img'
error: cannot determine image filename for 'abl.img'

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash abl_b abl.img
target reported max download size of 536870912 bytes
sending 'abl_b' (540 KB)...
OKAY [  0.016s]
writing 'abl_b'...
OKAY [  0.016s]
finished. total time: 0.031s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash aes_a aes.img
target reported max download size of 536870912 bytes
sending 'aes_a' (48 KB)...
OKAY [ -0.000s]
writing 'aes_a'...
OKAY [  0.016s]
finished. total time: 0.016s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash aes_b aes.img
target reported max download size of 536870912 bytes
sending 'aes_b' (48 KB)...
OKAY [  0.000s]
writing 'aes_b'...
OKAY [  0.016s]
finished. total time: 0.016s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash cmnlib_a cmnlib.img
target reported max download size of 536870912 bytes
sending 'cmnlib_a' (220 KB)...
OKAY [ -0.000s]
writing 'cmnlib_a'...
OKAY [  0.016s]
finished. total time: 0.016s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash cmnlib_b cmnlib.img
target reported max download size of 536870912 bytes
sending 'cmnlib_b' (220 KB)...
OKAY [ -0.000s]
writing 'cmnlib_b'...
OKAY [  0.016s]
finished. total time: 0.016s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash cmnlib64_a cmnlib64.img
target reported max download size of 536870912 bytes
sending 'cmnlib64_a' (288 KB)...
OKAY [  0.016s]
writing 'cmnlib64_a'...
OKAY [  0.016s]
finished. total time: 0.031s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash cmnlib64_b cmnlib64.img
target reported max download size of 536870912 bytes
sending 'cmnlib64_b' (288 KB)...
OKAY [ -0.000s]
writing 'cmnlib64_b'...
OKAY [  0.017s]
finished. total time: 0.017s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash devcfg_a devcfg.img
target reported max download size of 536870912 bytes
sending 'devcfg_a' (60 KB)...
OKAY [ -0.000s]
writing 'devcfg_a'...
OKAY [  0.016s]
finished. total time: 0.016s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash devcfg_b devcfg.img
target reported max download size of 536870912 bytes
sending 'devcfg_b' (60 KB)...
OKAY [  0.016s]
writing 'devcfg_b'...
OKAY [  0.013s]
finished. total time: 0.029s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash dtbo_a dtbo.img
target reported max download size of 536870912 bytes
sending 'dtbo_a' (8192 KB)...
OKAY [  0.037s]
writing 'dtbo_a'...
OKAY [  0.109s]
finished. total time: 0.146s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash dtbo_b dtbo.img
target reported max download size of 536870912 bytes
sending 'dtbo_b' (8192 KB)...
OKAY [  0.031s]
writing 'dtbo_b'...
OKAY [  0.141s]
finished. total time: 0.172s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash hyp_a hyp.img
target reported max download size of 536870912 bytes
sending 'hyp_a' (264 KB)...
OKAY [  0.000s]
writing 'hyp_a'...
OKAY [  0.020s]
finished. total time: 0.020s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash hyp_b hyp.img
target reported max download size of 536870912 bytes
sending 'hyp_b' (264 KB)...
OKAY [  0.014s]
writing 'hyp_b'...
OKAY [  0.000s]
finished. total time: 0.015s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash keymaster_a keymaster.img
target reported max download size of 536870912 bytes
sending 'keymaster_a' (308 KB)...
OKAY [  0.000s]
writing 'keymaster_a'...
OKAY [  0.026s]
finished. total time: 0.026s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash keymaster_b keymaster.img
target reported max download size of 536870912 bytes
sending 'keymaster_b' (308 KB)...
OKAY [  0.012s]
writing 'keymaster_b'...
OKAY [ -0.000s]
finished. total time: 0.012s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash laf_a laf.img
target reported max download size of 536870912 bytes
sending 'laf_a' (29800 KB)...
OKAY [  0.125s]
writing 'laf_a'...
OKAY [  0.406s]
finished. total time: 0.547s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash laf_b laf.img
target reported max download size of 536870912 bytes
sending 'laf_b' (29800 KB)...
OKAY [  0.110s]
writing 'laf_b'...
OKAY [  0.125s]
finished. total time: 0.250s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash pmic_a pmic.img
target reported max download size of 536870912 bytes
sending 'pmic_a' (52 KB)...
OKAY [ -0.000s]
writing 'pmic_a'...
OKAY [  0.016s]
finished. total time: 0.016s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash pmic_b pmic.img
target reported max download size of 536870912 bytes
sending 'pmic_b' (52 KB)...
OKAY [ -0.000s]
writing 'pmic_b'...
OKAY [  0.016s]
finished. total time: 0.016s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash rpm_a rpm.img
target reported max download size of 536870912 bytes
sending 'rpm_a' (232 KB)...
OKAY [  0.016s]
writing 'rpm_a'...
OKAY [  0.009s]
finished. total time: 0.024s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash rpm_b rpm.img
target reported max download size of 536870912 bytes
sending 'rpm_b' (232 KB)...
OKAY [ -0.000s]
writing 'rpm_b'...
OKAY [  0.000s]
finished. total time: 0.017s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash tz_a tz.img
target reported max download size of 536870912 bytes
sending 'tz_a' (1868 KB)...
OKAY [  0.016s]
writing 'tz_a'...
OKAY [  0.026s]
finished. total time: 0.045s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash tz_b tz.img
target reported max download size of 536870912 bytes
sending 'tz_b' (1868 KB)...
OKAY [  0.016s]
writing 'tz_b'...
OKAY [  0.016s]
finished. total time: 0.045s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash vbmeta_a vbmeta.img
target reported max download size of 536870912 bytes
sending 'vbmeta_a' (4 KB)...
OKAY [ -0.000s]
writing 'vbmeta_a'...
OKAY [  0.016s]
finished. total time: 0.016s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash vbmeta_b vbmeta.img
target reported max download size of 536870912 bytes
sending 'vbmeta_b' (4 KB)...
OKAY [  0.000s]
writing 'vbmeta_b'...
OKAY [  0.017s]
finished. total time: 0.020s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash xbl_a xbl.img
target reported max download size of 536870912 bytes
sending 'xbl_a' (2620 KB)...
OKAY [  0.016s]
writing 'xbl_a'...
OKAY [  0.016s]
finished. total time: 0.031s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flash xbl_b xbl.img
target reported max download size of 536870912 bytes
sending 'xbl_b' (2620 KB)...
OKAY [  0.016s]
writing 'xbl_b'...
OKAY [  0.016s]
finished. total time: 0.031s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot.exe flashing lock

```
> 1 votes

---
Tags: boot-loop, boot, fastboot, factory-image
---


# Question
Title: Why does MTP show wrong directory location?
MTP (*Miserable Transfer Protocol*) failed once again.

After moving a directory to a different path, it is still on the same path as before according to MTP.

I already tried re-plugging the USB port and reading it from a different computer. Same result.

Why is MTP so bogus that it shows a moved folder on its previous path?

# Answer
**What is Content Provider?**

It seems to be a problem related to Media Providers. As the name suggests, they provide a database of available media in a more organized way to other apps as the `Contacts Storage` (*com.android.providers.contacts*) provides contacts to requesting apps. Purpose is to scan and store media file info for quick access so that individual apps don't have to scan folders manually for an up-to-date library, reducing time and effort.

**Android's built-in Media Providers:**

Some file explorers, media players and gallery apps depend on the files database (*/data/data/com.android.providers.media/databases/external.db*) built by `Media Storage` app for MediaStore content provider from the contents of external storage (`/sdcard` and external SD card; removable storage like USB isn't indexed). Apps `Media Storage` (*com.android.providers.media* under which *com.process.media* runs), `Downloads` (*com.android.providers.downloads.ui*), `Download Manager` (*com.android.providers.downloads*) and `MTP Host` (*com.android.mtp*) work in collaboration under same UID.

Database is built/updated as `MediaScanner` (*android.process.media*) is invoked by some app such as by sending broadcast MEDIA\_SCANNER\_SCAN\_FILE or through scanFile. Broadcast receiver `com.android.providers.media.MediaScannerReceiver` is launched on boot that listens for android.intent.action.BOOT\_COMPLETED, so MediaScannerService will also launch on boot. But restarting phone sometimes doesn't update whole external database (or at least delays). MediaScanner is also triggered when a new storage device is mounted i.e. on MEDIA\_MOUNTED which could possibly be manually broadcasted to force updation on pre KitKat versions.
In response, apps are informed of updated databases such as by receiving broadcast MEDIA\_SCANNER\_FINISHED or through onScanCompleted.

**Problem with Media Providers:**

MtpService is also a part of Media Storage. Due to some bugs (acknowledged since 2012) in implementation of MTP, database isn't updated or is delayed or isn't properly communicated with the client as the files change, so MTP shows outdated / incomplete contents. The same can happen if an app creating or downloading a new file fails to trigger the MediaScanner or fails to receive back the updated information.

**Solution:**

In order to force database updation, delete the file and run some media scanner app. Non-root users can delete this file by clearing data of `Media Storage` app.
But be aware, it'll also clear `internal.db` which will make ringtones unavailable and a new database will be built from `/system/media` on next reboot i.e. on `BOOT_COMPLETED`.

**PS:** Note that the internal SD card we see is emulated from `/data/media/` using `sdcardfs` (or `FUSE` in older versions of Android). Actual contents of internal memory can be seen directly from `/data/media/` (root required). UMS used to expose the `/data` block device to PC but was deprecated in favor of MTP. It's a good option when larger size of data is to be transferred at high speeds. It can be enabled by some workaround.
There are also other reasonable alternatives for MTP like FTP, SFTP/SSHFS, adbfs etc.

**RESOURCES:**
> 5 votes

---
Tags: usb, storage, bugs, mtp, media-scanner
---


# Question
Title: How to change the lowest and highest screen brightness in Android?
Is there any way to reduce the lowest and highest screen brightness settings by editing the build.prop file in Android? If yes, then how?

# Answer
> 2 votes
Change/set the following parameters in the build.prop to set the brightness.

```
ro.lcd_min_brightness=50
ro.lcd_brightness=255

```

The above is an example. The first set the minimum.

The range is from 1 to 255. 1 being the minimum level that can be set while 255 is the maximum.

---
Tags: stock-android, screen-brightness
---


# Question
Title: How can run native executables compiled for ARM on unrooted Android devices?
Following this tutorial I have compiled a *Hello World!* ARM binary from C source using `gcc`. I want to run this program on my unrooted Android phone but I can't figure out an easy way to do it.

What I've tried:

1. Copying `hello` to `/sdcard` and trying to run it from there. This doesn't work because the internal storage is mounted with the `noexec` flag.
2. Copying `hello` to `/data/local/` using `cp hello /data/local/` or `cat hello > /data/local/hello` as explained here. This also doesn't work and I get a "permission denied" error.
3. Installing a terminal emulator program such as Termux and using the Termux app to copy `hello` from `/sdcard/hello` to `/data/data/com.termux/files/home`, running `chmod +x hello` and then running `./hello` from the Termux home directory **within the Termux app**. This works but is not a feasible solution.

Is there a better/easier way to run native ELF executables on an unrooted Android phone directly through ADB and doesn't involve installing any apps?

# Answer
> 4 votes
1. In addition to `noexec` mount option, `/sdcard` is emulated filesystem with fixed file permissions. So files can't be set executable. But some file explorers like MiXplorer support executing binaries/scripts from `/sdcard` through `/system/bin/sh`.
2. `/data/local` has permissions `0751`, owner `root.root` , so normal apps can't access it. However from `adb shell` use `/data/local/tmp` which has user/group owner `2000` (aid\_shell)  and selinux is also allowed . So you won't get permission denied.
3. If you don't want to use PC, terminal emulator is the only option. On Termux you can also add `/data/local/tmp` (or a subdirectory) to `$PATH` by editing `~/.profile` if you want to avoid placing binaries on multiple locations. But the directory should be world-readable and selinux must not be denying the access or execution of binaries.

---
Tags: adb, shell, terminal, command-line, arm-processors
---


# Question
Title: How do I group emails with same subject and sender in the Outlook app on Android?
How do I group emails by subject in the Outlook app on Android?

In Gmail, if 100 emails are received from the same address and have the same subject, they are grouped into a single item with a number in parenthesis showing how many emails are inside.

How do I achieve the equivalent in Android Outlook app? Or web app? Otherwise, there are 100 elements that fill up the list of unread in the inbox.

# Answer
> 0 votes
In the settings, turn on "Organize mail by thread" to ensure responses sent back and forth on the same thread are grouped together.

From what I can tell, there is no setting in the Outlook Android app that will group multiple independent emails with the same sender / subject.

---
Tags: outlook
---


# Question
Title: Removing multiple entries easily from the Google Play Store's "My apps & games" library
I have so many apps in my Google Play Store's library, and I want to delete all of them. However, individually deleting each one would be tedious.

Are there any easier/more convenient ways to remove multiple apps from there?

# Answer
> 1 votes
Google Store doesn't offer a public API like most Google products/services, thus writing an app or service with this capability would be a tedious work, and would require probably some low-level hacking and analyzing the protocols of the Google. On my best knowledge, no one did it until now.

According this answer, until around 2012, we could uninstall our apps from the web, which could have been a quicker option. Since then, even that was not possible any more.

# Answer
> 0 votes
You can use "Tasker" or any other type of automation apps to automate the process of removing each item (app) from the library. Then, program the tasker to repeat that process. I generally do this for repeated actions.

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


title: How to give a wakelock to an app?

text:
# Question
Title: How to give a wakelock to an app?
How can I give a CPU wakelock to an app so that It can **work even when the screen is off?**

(Usually android halts CPU too, when screen is off)

# Answer
> 1 votes
If you don't have root access in your phone, there are many apps in the Play Store which can take a **partial wake lock**. Just start the app **manually** when you need it. Because, if one app takes a partial wake lock, other apps can also take the advantage.

---
Tags: applications, power-on, wakelock
---


title: Xiaomi A1 Android 8 update fix

text:
# Question
Title: Xiaomi A1 Android 8 update fix
Any fixes or recommendations for fixing the issue with no sound from receiver on Xiaomi A1. It plays fine through the loud speaker but not through the normal receiver. The issue started with the new android 8 update.

# Answer
I would try updating the device, latest software will put Android Pie on the device, so if the issue is linked to Android 8, you should find it resolved.
> 0 votes

---
Tags: xiaomi, mi-a1
---


title: Default google search country

text:
# Question
Title: Default google search country
I am normally fairly astute at being able to change settings etc, however, I have hit a problem I cannot overcome and thought to ask here:

In android chrome, when I perform a search the searches (as of Wednesday) are all performed in google.nl and the results are returned in English. This means the results are more appropriate for someone living in the Netherlands and not in the UK. I was wondering how I change the default search location as I cannot find it in Android at all (My PC based Chrome works as normal, and I can change that quite straightforwardly).

Would love to know how to set the default google search location for chrome back to google.com or google.co.uk.

All assistance gratefully accepted!

Cheers!

# Answer
> 0 votes
Turns out there is no simple way that also preserves open tabs etc... The only way I have found to do it, through trial and error is to go to **Settings \> apps\> chrome** and clear all data, then when you -rerun chrome it sets the default search locale back to the country you are in.

# Answer
> 0 votes
In chrome, you are able to use the 3 dots menu, navigate to settings, click on search engine and choose your preferred search engine, in this case. Google.

mine reads as google.com, location allowed. (which is clickable), clicking on the location allowed, provides a settings page which allows you to clear and reset permissions as well as alter permissions individually.

@user145490 does make a good point, if you are using a VPN or something similar, the locale is set by the network, irrespective of GPS.

---
Tags: chrome-for-android, search, google-search
---


# Question
Title: Why can't Android phones record VoIP calls?
I use Republic Wireless so the majority of my voice calls are VoIP.

I use a call recording app to help me recall conversations after the fact. But in order for it to work, I have to turn off wifi and make the call over the cell network.

The recording app made me acknowledge that I understand that no app can record VoIP calls.

Question: why is cell recording allowed, but not VoIP. Is it the OS limitation? Is it for security? Is it a legal reason?

# Answer
> ....why is cell recording allowed,...

AFAIK call recording is not a feature of stock Android, though certain OEMs and custom ROMs enable it or can be done using apps. I guess legal restrictions is the reason for not enabling this feature, as call recording laws widely vary

**VOIP recording** is quite different from voice recording

Firstly, it is possible:

* App recording VOIP calls is possible, see Call Recorder - IntCall for instance. There may be others too
* Non app based services that record VOIP calls seem to be more - Dingtone, for example

What is *common* for VOIP recording and *different* from voice recording is that VOIP recording is done when it is routed through **the servers provided by the app** (see description in both links above). Ordinary voice recording is not bound by such limitations and can be natively record if enabled on device

Call Recording Software Wiki

> VoIP Recording is usually restricted to streaming media recorders or software developed by the softphone or IP PBX creator. There are also solutions which use packet capture technology to passively record VoIP phone calls on the LAN.

Since VOIP is using data packets to transmit voice, these packets need to be *actively or passively sniffed* ( see wiki above for details) and this requires dedicated setup unlike voice recording ( which can be done natively on phone (if enabled) or using apps ). Hence, VOIP recording is not simple to implement on device like voice recording- a technology constraint
> 4 votes

# Answer
Please don't misguide. VOIP recording isn't possible due to sound Input device restriction. If a VOIP is working it occupies the "sound input device", as a result recorders will fail to record. It is simple as that. No other guesses.
> 1 votes

# Answer
Please don't misguide? I guess the one misguiding is you. If you call through the sip protocol, then you can use CSipSimple. In call options, you can activate the call recording feature. It works just fine.
> 0 votes

# Answer
VoIP calls cannot be recorded as of now in Android.

Normal Calls dont use microphone so another app can acquire microphone and record the conversation.

But in VoIP calls, the app would be using the microphone so another app cannot acquire, if it tries it fails with an error. If the recorder app tries to acquire microphone before the VoIP call then during the call the other side will not be able to hear anything.

So bottom line is, there is no such app as of now to record VoIP calls in Android.
> 0 votes

---
Tags: 6.0-marshmallow, voip, call-recording
---