Handle When received intent extra in System settings need show dialog
Bug: 128853573 Test: visual, robotest Change-Id: I92337e26f51c3f7ef4033d424ddcf07c6da6805d
This commit is contained in:
@@ -20,12 +20,14 @@ import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.provider.SearchIndexableResource;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceGroup;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settings.search.Indexable;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
@@ -40,6 +42,8 @@ public class SystemDashboardFragment extends DashboardFragment {
|
||||
|
||||
private static final String KEY_RESET = "reset_dashboard";
|
||||
|
||||
public static final String EXTRA_SHOW_AWARE_DISABLED = "show_aware_dialog_disabled";
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
@@ -49,6 +53,17 @@ public class SystemDashboardFragment extends DashboardFragment {
|
||||
if (getVisiblePreferenceCount(screen) == screen.getInitialExpandedChildrenCount() + 1) {
|
||||
screen.setInitialExpandedChildrenCount(Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
showRestrictionDialog();
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public void showRestrictionDialog() {
|
||||
final Bundle args = getArguments();
|
||||
if (args != null && args.getBoolean(EXTRA_SHOW_AWARE_DISABLED, false)) {
|
||||
FeatureFactory.getFactory(getContext()).getAwareFeatureProvider()
|
||||
.showRestrictionDialog(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user