Loading src/com/android/settings/backup/BackupSettingsActivity.java +4 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.app.FragmentManager; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.os.UserHandle; import android.support.annotation.VisibleForTesting; Loading Loading @@ -120,9 +121,9 @@ public class BackupSettingsActivity extends Activity implements Indexable { // For non-primary user, no backup is available, so don't show it in search // TODO: http://b/22388012 if (UserHandle.myUserId() != UserHandle.USER_SYSTEM) { if (!Build.TAGS.equalsIgnoreCase("test-keys,test-release") || UserHandle.myUserId() != UserHandle.USER_SYSTEM) { if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Not a system user, not indexing the screen"); Log.d(TAG, "Build type is non-test or the UserID is not of a system user, not indexing the screen"); } keys.add(BACKUP_SEARCH_INDEX_KEY); } Loading src/com/android/settings/system/SystemDashboardFragment.java +10 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settings.system; import android.content.Context; import android.os.Build; import android.os.Bundle; import android.provider.SearchIndexableResource; import android.support.v7.preference.Preference; Loading @@ -36,6 +37,7 @@ public class SystemDashboardFragment extends DashboardFragment { private static final String TAG = "SystemDashboardFrag"; private static final String KEY_BACKUP = "backup_settings"; private static final String KEY_RESET = "reset_dashboard"; @Override Loading @@ -43,6 +45,13 @@ public class SystemDashboardFragment extends DashboardFragment { super.onCreate(icicle); final PreferenceScreen screen = getPreferenceScreen(); // Remove backup options if we are not on a test build if (!Build.TAGS.equalsIgnoreCase("test-keys,test-release")) { Preference backup = findPreference(KEY_BACKUP); screen.removePreference(backup); } // We do not want to display an advanced button if only one setting is hidden if (getVisiblePreferenceCount(screen) == screen.getInitialExpandedChildrenCount() + 1) { screen.setInitialExpandedChildrenCount(Integer.MAX_VALUE); Loading Loading
src/com/android/settings/backup/BackupSettingsActivity.java +4 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.app.FragmentManager; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.os.UserHandle; import android.support.annotation.VisibleForTesting; Loading Loading @@ -120,9 +121,9 @@ public class BackupSettingsActivity extends Activity implements Indexable { // For non-primary user, no backup is available, so don't show it in search // TODO: http://b/22388012 if (UserHandle.myUserId() != UserHandle.USER_SYSTEM) { if (!Build.TAGS.equalsIgnoreCase("test-keys,test-release") || UserHandle.myUserId() != UserHandle.USER_SYSTEM) { if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Not a system user, not indexing the screen"); Log.d(TAG, "Build type is non-test or the UserID is not of a system user, not indexing the screen"); } keys.add(BACKUP_SEARCH_INDEX_KEY); } Loading
src/com/android/settings/system/SystemDashboardFragment.java +10 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settings.system; import android.content.Context; import android.os.Build; import android.os.Bundle; import android.provider.SearchIndexableResource; import android.support.v7.preference.Preference; Loading @@ -36,6 +37,7 @@ public class SystemDashboardFragment extends DashboardFragment { private static final String TAG = "SystemDashboardFrag"; private static final String KEY_BACKUP = "backup_settings"; private static final String KEY_RESET = "reset_dashboard"; @Override Loading @@ -43,6 +45,13 @@ public class SystemDashboardFragment extends DashboardFragment { super.onCreate(icicle); final PreferenceScreen screen = getPreferenceScreen(); // Remove backup options if we are not on a test build if (!Build.TAGS.equalsIgnoreCase("test-keys,test-release")) { Preference backup = findPreference(KEY_BACKUP); screen.removePreference(backup); } // We do not want to display an advanced button if only one setting is hidden if (getVisiblePreferenceCount(screen) == screen.getInitialExpandedChildrenCount() + 1) { screen.setInitialExpandedChildrenCount(Integer.MAX_VALUE); Loading