Fix runInstrumentableFragmentCodeInspection test case fail
- Replace DialogFragment with InstrumentedDialogFragment. - Remove the redundant code in the SupportedLinksDialogFragment. Fixes: 183918543 Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.core Change-Id: I2a5eb97ec6669853f158a21695e49339aeb5808d
This commit is contained in:
@@ -34,19 +34,19 @@ import android.widget.ProgressBar;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||
import com.android.settingslib.utils.ThreadUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/** A customized {@link DialogFragment} with a progress bar. */
|
||||
public class ProgressDialogFragment extends DialogFragment {
|
||||
/** A customized {@link InstrumentedDialogFragment} with a progress bar. */
|
||||
public class ProgressDialogFragment extends InstrumentedDialogFragment {
|
||||
private static final String TAG = "ProgressDialogFragment";
|
||||
private static final String DLG_ID = "ProgressDialog";
|
||||
private static final int PROGRESS_BAR_STEPPING_TIME = 20;
|
||||
@@ -110,6 +110,11 @@ public class ProgressDialogFragment extends DialogFragment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* To generate a progress alter dialog and invoke the supported links dialog.
|
||||
*/
|
||||
|
@@ -26,19 +26,19 @@ import android.util.ArraySet;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/** A customized {@link DialogFragment} with multiple checkboxes. */
|
||||
public class SupportedLinksDialogFragment extends DialogFragment {
|
||||
/** A customized {@link InstrumentedDialogFragment} with multiple checkboxes. */
|
||||
public class SupportedLinksDialogFragment extends InstrumentedDialogFragment {
|
||||
private static final String TAG = "SupportedLinksDialogFrg";
|
||||
private static final String DLG_ID = "SupportedLinksDialog";
|
||||
|
||||
@@ -54,11 +54,6 @@ public class SupportedLinksDialogFragment extends DialogFragment {
|
||||
mSupportedLinkWrapperList = mViewModel.getSupportedLinkWrapperList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final Context context = getActivity();
|
||||
@@ -70,13 +65,17 @@ public class SupportedLinksDialogFragment extends DialogFragment {
|
||||
.setAdapter(adapter, /* listener= */ null)
|
||||
.setCancelable(true)
|
||||
.setPositiveButton(R.string.app_launch_supported_links_add, (dialog, id) -> {
|
||||
// addSelectedItems(((AlertDialog) dialog).getListView());
|
||||
doSelectedAction();
|
||||
})
|
||||
.setNegativeButton(R.string.app_launch_dialog_cancel, /* listener= */ null);
|
||||
return builder.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Display the dialog. */
|
||||
public void showDialog(FragmentManager manager) {
|
||||
show(manager, DLG_ID);
|
||||
|
Reference in New Issue
Block a user