Pixel Launcher crashing due to missing STATUS_BAR and MANAGE_ACTIVITY_STACKS permissions


Question

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?


Answer

I rebooted into TWRP and edited /data/system/packages.xml. Under <package name="com.google.android.apps.nexuslauncher" and <perms>, I added the following lines:



<item name="android.permission.STATUS_BAR" granted="true" flags="0" />
<item name="android.permission.MANAGE_ACTIVITY_STACKS" granted="true" flags="0" />


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


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes