OSDN Git Service

Explicitly ask for option menu in Fragments
authorLifu Tang <lifu@google.com>
Wed, 23 Sep 2015 21:16:13 +0000 (14:16 -0700)
committerLifu Tang <lifu@google.com>
Wed, 23 Sep 2015 21:16:13 +0000 (14:16 -0700)
commit4148f17616173a0bb475ed3b09ed90fc17540cc6
tree0a81ed96c89eec4ae8a2758e37496d27467a4486
parent43014ea5bf66b8cc18027188b6ef198d6a8d5bd7
Explicitly ask for option menu in Fragments

If a Fragment needs option menu, it has to ask for it explicitly by calling
setHasOptionsMenu(true). If a preference screen contains help URL, this
method is called automatically in the base class. However, if a preference
screen doesn't have help URL, this method will not be called. So any other
extra option menu will not be added correctly.

Typically we won't be able to see this bug. Because on standard Nexus builds,
all settings screen have their own help URL. But on AOSP build, as help URL
is empty by default, if the vendor doesn't modify the resource to provide
their own help URL, we'll end up missing some of the option menus.

Bug: 24241310
Change-Id: Iaabc91a1d102e21254b518ec23459025efbdcc84
src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
src/com/android/settings/location/LocationSettings.java