Fix NPE in user builds

In user builds, we were not creating the menu item for the prototype but
we were toggling it. Now just make it visible or not depending on the
build.

Test: manual
Change-Id: I8ab6bf229b08c0819e4c1484fafa86a7c0019b9d
This commit is contained in:
Fabian Kozynski
2020-12-16 10:03:31 -05:00
parent f426672fc2
commit 1fff41fb3b

View File

@@ -77,11 +77,11 @@ public class QSCustomizer extends LinearLayout {
toolbar.getMenu().add(Menu.NONE, MENU_RESET, 0,
mContext.getString(com.android.internal.R.string.reset));
if (Build.IS_ENG || Build.IS_USERDEBUG) {
// Prototype menu item
toolbar.getMenu().add(Menu.NONE, MENU_REMOVE_LABELS, Menu.NONE, "Remove labels")
.setCheckable(true);
}
// Prototype menu item
toolbar.getMenu()
.add(Menu.NONE, MENU_REMOVE_LABELS, Menu.NONE, "Remove labels")
.setCheckable(true)
.setVisible(Build.IS_ENG || Build.IS_USERDEBUG);
toolbar.setTitle(R.string.qs_edit);
mRecyclerView = findViewById(android.R.id.list);
mTransparentView = findViewById(R.id.customizer_transparent_view);