Pixel Launcher crashing due to missing STATUS_BAR and MANAGE_ACTIVITY_STACKS permissions I'm running LineageOS 16 on a OnePlus 3T. Whenever I try to open the Pixel Launcher, it crashes. In adb logcat, I saw the following lines that looked relevant:

05-25 16:13:31.293 16356 16356 W TaskStackChangeListeners: java.lang.SecurityException: Permission Denial: registerTaskStackListener() from pid=16356, uid=10003 requires android.permission.MANAGE_ACTIVITY_STACKS
05-25 16:13:31.476 16356 16356 E AndroidRuntime: java.lang.RuntimeException: Unable to resume activity {com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity}: java.lang.SecurityException: Permission Denial: setShelfHeight() from pid=16356, uid=10003 requires android.permission.STATUS_BAR


I tried running these commands to fix the problem:

adb shell pm grant com.google.android.apps.nexuslauncher android.permission.MANAGE_ACTIVITY_STACKS
adb shell pm grant com.google.android.apps.nexuslauncher android.permission.STATUS_BAR


However, they failed:

java.lang.SecurityException: Package com.google.android.apps.nexuslauncher has not requested permission android.permission.MANAGE_ACTIVITY_STACKS
java.lang.SecurityException: Package com.google.android.apps.nexuslauncher has not requested permission android.permission.STATUS_BAR


I searched for this and found a post on XDA with someone having the same problem: https://forum.xda-developers.com/android/software/pa-gapps-continuation-t3098071/post77695616#post77695616

Responses weren't very useful though. They basically boiled down to "your ROM is broken; ask your ROM developer to fix it."

So how can I fix this crash?
I rebooted into TWRP and edited /data/system/packages.xml. Under &lt;package name="com.google.android.apps.nexuslauncher" and &lt;perms&gt;, I added the following lines:

&lt;item name="android.permission.STATUS_BAR" granted="true" flags="0" /&gt;
&lt;item name="android.permission.MANAGE_ACTIVITY_STACKS" granted="true" flags="0" /&gt;


When I rebooted back into Android, the crash was fixed.