Add impl for force stop action
Also refactor the AnomalyAction so it could take source id as a parameter, which represents the fragment that invokes it. Bug: 36924669 Test: RunSettingsRoboTests Change-Id: Ib53865f92e1a6f1e9dcc1480c0c74fbcfb0226f4
This commit is contained in:
@@ -42,11 +42,19 @@ public class AnomalySummaryPreferenceController {
|
||||
List<Anomaly> mAnomalies;
|
||||
private SettingsActivity mSettingsActivity;
|
||||
|
||||
/**
|
||||
* Metrics key about fragment that create this controller
|
||||
*
|
||||
* @see com.android.internal.logging.nano.MetricsProto.MetricsEvent
|
||||
*/
|
||||
private int mMetricsKey;
|
||||
|
||||
public AnomalySummaryPreferenceController(SettingsActivity activity,
|
||||
PreferenceFragment fragment) {
|
||||
PreferenceFragment fragment, int metricsKey) {
|
||||
mFragment = fragment;
|
||||
mSettingsActivity = activity;
|
||||
mAnomalyPreference = mFragment.getPreferenceScreen().findPreference(ANOMALY_KEY);
|
||||
mMetricsKey = metricsKey;
|
||||
hideHighUsagePreference();
|
||||
}
|
||||
|
||||
@@ -54,7 +62,8 @@ public class AnomalySummaryPreferenceController {
|
||||
if (mAnomalies != null && ANOMALY_KEY.equals(preference.getKey())) {
|
||||
if (mAnomalies.size() == 1) {
|
||||
final Anomaly anomaly = mAnomalies.get(0);
|
||||
AnomalyDialogFragment dialogFragment = AnomalyDialogFragment.newInstance(anomaly);
|
||||
AnomalyDialogFragment dialogFragment = AnomalyDialogFragment.newInstance(anomaly,
|
||||
mMetricsKey);
|
||||
dialogFragment.setTargetFragment(mFragment, REQUEST_ANOMALY_ACTION);
|
||||
dialogFragment.show(mFragment.getFragmentManager(), TAG);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user