Loading src/com/android/settings/SettingsPreferenceFragment.java +22 −1 Original line number Diff line number Diff line Loading @@ -55,6 +55,8 @@ import com.android.settingslib.core.instrumentation.Instrumentable; import com.android.settingslib.search.Indexable; import com.android.settingslib.widget.LayoutPreference; import com.google.android.setupcompat.util.WizardManagerHelper; import java.util.UUID; /** Loading @@ -63,7 +65,7 @@ import java.util.UUID; public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceFragment implements DialogCreatable, HelpResourceProvider, Indexable { private static final String TAG = "SettingsPreference"; private static final String TAG = "SettingsPreferenceFragment"; private static final String SAVE_HIGHLIGHTED_KEY = "android:preference_highlighted"; Loading Loading @@ -123,6 +125,15 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF @VisibleForTesting public boolean mPreferenceHighlighted = false; @Override public void onAttach(Context context) { if (shouldSkipForInitialSUW() && !WizardManagerHelper.isDeviceProvisioned(getContext())) { Log.w(TAG, "Skip " + getClass().getSimpleName() + " before SUW completed."); finish(); } super.onAttach(context); } @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Loading Loading @@ -270,6 +281,16 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF || (mAdapter.getPreferenceAdapterPosition(preference) != RecyclerView.NO_POSITION)); } /** * Whether UI should be skipped in the initial SUW flow. * * @return {@code true} when UI should be skipped in the initial SUW flow. * {@code false} when UI should not be skipped in the initial SUW flow. */ protected boolean shouldSkipForInitialSUW() { return false; } protected void onDataSetChanged() { highlightPreferenceIfNeeded(); updateEmptyView(); Loading src/com/android/settings/accounts/AccountDashboardFragment.java +5 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,11 @@ public class AccountDashboardFragment extends DashboardFragment { return buildPreferenceControllers(context, this /* parent */, authorities); } @Override protected boolean shouldSkipForInitialSUW() { return true; } private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, SettingsPreferenceFragment parent, String[] authorities) { final List<AbstractPreferenceController> controllers = new ArrayList<>(); Loading src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java 100755 → 100644 +12 −1 Original line number Diff line number Diff line Loading @@ -373,7 +373,13 @@ public class AppInfoDashboardFragment extends DashboardFragment return; } super.onPrepareOptionsMenu(menu); menu.findItem(UNINSTALL_ALL_USERS_MENU).setVisible(shouldShowUninstallForAll(mAppEntry)); final MenuItem uninstallAllUsersItem = menu.findItem(UNINSTALL_ALL_USERS_MENU); uninstallAllUsersItem.setVisible( shouldShowUninstallForAll(mAppEntry) && !mAppsControlDisallowedBySystem); if (uninstallAllUsersItem.isVisible()) { RestrictedLockUtilsInternal.setMenuItemAsDisabledByAdmin(getActivity(), uninstallAllUsersItem, mAppsControlDisallowedAdmin); } mUpdatedSysApp = (mAppEntry.info.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0; final MenuItem uninstallUpdatesItem = menu.findItem(UNINSTALL_UPDATES); final boolean uninstallUpdateDisabled = getContext().getResources().getBoolean( Loading Loading @@ -491,6 +497,11 @@ public class AppInfoDashboardFragment extends DashboardFragment return true; } @Override protected boolean shouldSkipForInitialSUW() { return true; } private void uninstallPkg(String packageName, boolean allUsers, boolean andDisable) { stopListeningToPackageRemove(); // Create new intent to launch Uninstaller activity Loading src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java +5 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,11 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra } } @Override protected boolean shouldSkipForInitialSUW() { return true; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Loading src/com/android/settings/system/ResetDashboardFragment.java +5 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,11 @@ public class ResetDashboardFragment extends DashboardFragment { return buildPreferenceControllers(context, getSettingsLifecycle()); } @Override protected boolean shouldSkipForInitialSUW() { return true; } private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, Lifecycle lifecycle) { final List<AbstractPreferenceController> controllers = new ArrayList<>(); Loading Loading
src/com/android/settings/SettingsPreferenceFragment.java +22 −1 Original line number Diff line number Diff line Loading @@ -55,6 +55,8 @@ import com.android.settingslib.core.instrumentation.Instrumentable; import com.android.settingslib.search.Indexable; import com.android.settingslib.widget.LayoutPreference; import com.google.android.setupcompat.util.WizardManagerHelper; import java.util.UUID; /** Loading @@ -63,7 +65,7 @@ import java.util.UUID; public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceFragment implements DialogCreatable, HelpResourceProvider, Indexable { private static final String TAG = "SettingsPreference"; private static final String TAG = "SettingsPreferenceFragment"; private static final String SAVE_HIGHLIGHTED_KEY = "android:preference_highlighted"; Loading Loading @@ -123,6 +125,15 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF @VisibleForTesting public boolean mPreferenceHighlighted = false; @Override public void onAttach(Context context) { if (shouldSkipForInitialSUW() && !WizardManagerHelper.isDeviceProvisioned(getContext())) { Log.w(TAG, "Skip " + getClass().getSimpleName() + " before SUW completed."); finish(); } super.onAttach(context); } @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Loading Loading @@ -270,6 +281,16 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF || (mAdapter.getPreferenceAdapterPosition(preference) != RecyclerView.NO_POSITION)); } /** * Whether UI should be skipped in the initial SUW flow. * * @return {@code true} when UI should be skipped in the initial SUW flow. * {@code false} when UI should not be skipped in the initial SUW flow. */ protected boolean shouldSkipForInitialSUW() { return false; } protected void onDataSetChanged() { highlightPreferenceIfNeeded(); updateEmptyView(); Loading
src/com/android/settings/accounts/AccountDashboardFragment.java +5 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,11 @@ public class AccountDashboardFragment extends DashboardFragment { return buildPreferenceControllers(context, this /* parent */, authorities); } @Override protected boolean shouldSkipForInitialSUW() { return true; } private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, SettingsPreferenceFragment parent, String[] authorities) { final List<AbstractPreferenceController> controllers = new ArrayList<>(); Loading
src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java 100755 → 100644 +12 −1 Original line number Diff line number Diff line Loading @@ -373,7 +373,13 @@ public class AppInfoDashboardFragment extends DashboardFragment return; } super.onPrepareOptionsMenu(menu); menu.findItem(UNINSTALL_ALL_USERS_MENU).setVisible(shouldShowUninstallForAll(mAppEntry)); final MenuItem uninstallAllUsersItem = menu.findItem(UNINSTALL_ALL_USERS_MENU); uninstallAllUsersItem.setVisible( shouldShowUninstallForAll(mAppEntry) && !mAppsControlDisallowedBySystem); if (uninstallAllUsersItem.isVisible()) { RestrictedLockUtilsInternal.setMenuItemAsDisabledByAdmin(getActivity(), uninstallAllUsersItem, mAppsControlDisallowedAdmin); } mUpdatedSysApp = (mAppEntry.info.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0; final MenuItem uninstallUpdatesItem = menu.findItem(UNINSTALL_UPDATES); final boolean uninstallUpdateDisabled = getContext().getResources().getBoolean( Loading Loading @@ -491,6 +497,11 @@ public class AppInfoDashboardFragment extends DashboardFragment return true; } @Override protected boolean shouldSkipForInitialSUW() { return true; } private void uninstallPkg(String packageName, boolean allUsers, boolean andDisable) { stopListeningToPackageRemove(); // Create new intent to launch Uninstaller activity Loading
src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java +5 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,11 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra } } @Override protected boolean shouldSkipForInitialSUW() { return true; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Loading
src/com/android/settings/system/ResetDashboardFragment.java +5 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,11 @@ public class ResetDashboardFragment extends DashboardFragment { return buildPreferenceControllers(context, getSettingsLifecycle()); } @Override protected boolean shouldSkipForInitialSUW() { return true; } private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, Lifecycle lifecycle) { final List<AbstractPreferenceController> controllers = new ArrayList<>(); Loading