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:
Sunny Shao
2021-03-29 21:11:45 +08:00
parent f7586147f8
commit 13f36a58dc
2 changed files with 16 additions and 12 deletions

View File

@@ -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.
*/