Skip to content
This repository was archived by the owner on Mar 6, 2022. It is now read-only.

Phone app missing permission for secret codes #5

@losuler

Description

@losuler

Background

There's currently a bug with microG where Google/Firebase Cloud Messaging doesn't connect (in settings shows as Current state: Disconnected). There is a way to fix it which involves typing the secret code *#*#2432546#*#* to do a manual device registration or running the command adb shell am broadcast [...].

Issue

The issue in Android 10 is that there is now restrictions on starting activities from the background and the Phone app built with AOSP lacks the permission START_ACTIVITIES_FROM_BACKGROUND required to run secret codes.

When you attempt to run any secret code the Phone app simply crashes and the following error comes up in logcat:

java.lang.SecurityException: Permission Denial: android.provider.Telephony.SECRET_CODE broadcast from com.android.phone (pid=1810, uid=1001) requires android.permission.START_ACTIVITIES_FROM_BACKGROUND

This permissions issue in the AOSP Phone app also effects every other secret code such as *#*#4636#*#*, which among other things, allows you to lock to 4G only (Preferred network type in settings can't do this).

The adb shell am broadcast [...] command also cannot be run also in AOSP/RattlesnakeOS as it requires root. Unless you also patched this in.

Possible solutions

Unless this is fixed in microG (has been outstanding for about a year), I assume this may be able to be fixed in AOSP if the Phone app is patched to include the permission START_ACTIVITIES_FROM_BACKGROUND. However I don't know enough about AOSP to know how to create a patch like this.

Note

I just thought I'd mention this here because it's likely someone else will come across this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions