Fix Developer options appears after first boot, disappers on Settings Menu Reload

The Tiles are updated to disabled via PackageManager, which takes a few
seconds to kick in and hence the user sees the option appear and then
disappear. Making Developer Options disabled by default fixes the flash.

Note now the opposite happens, on eng builds where Developer Settings
are on by default they will not appear until the PackageManager update
has cleared.

Bug: 28121698
Change-Id: Ic7147e4430e2332d596ce37dbbce30e330dcf551
This commit is contained in:
Clara Bayarri
2016-04-20 11:29:04 +01:00
parent 39975a60cc
commit cd6a2115c6
2 changed files with 3 additions and 3 deletions

View File

@@ -1885,7 +1885,8 @@
android:label="@string/development_settings_title" android:label="@string/development_settings_title"
android:icon="@drawable/ic_settings_development" android:icon="@drawable/ic_settings_development"
android:taskAffinity="com.android.settings" android:taskAffinity="com.android.settings"
android:parentActivityName="Settings"> android:parentActivityName="Settings"
android:enabled="false">
<intent-filter android:priority="1"> <intent-filter android:priority="1">
<action android:name="android.settings.APPLICATION_DEVELOPMENT_SETTINGS" /> <action android:name="android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
<action android:name="com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS" /> <action android:name="com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />

View File

@@ -1096,8 +1096,7 @@ public class SettingsActivity extends SettingsDrawerActivity
enabled = false; enabled = false;
} }
int state = pm.getComponentEnabledSetting(component); int state = pm.getComponentEnabledSetting(component);
boolean isEnabled = state == PackageManager.COMPONENT_ENABLED_STATE_DEFAULT boolean isEnabled = state == PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
|| state == PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
if (isEnabled != enabled) { if (isEnabled != enabled) {
pm.setComponentEnabledSetting(component, enabled pm.setComponentEnabledSetting(component, enabled
? PackageManager.COMPONENT_ENABLED_STATE_ENABLED ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED