Add InstrumentFragment for non-PreferenceFragment types.

This allows app fragment use a less heavyweight fragment as super class
if they don't need PreferenceFragment. Using this class as base is
generally easier to set up robolectric tests too.

Bug: 33354536
Test: RunSettingsRoboTests
Change-Id: I91c4d242ea0333c76c8767c03c3f18dee6b6e104
This commit is contained in:
Fan Zhang
2016-12-05 17:02:33 -08:00
parent da32519ef4
commit 2d0b344736
24 changed files with 224 additions and 66 deletions

View File

@@ -17,7 +17,7 @@ package com.android.settings;
import android.os.Bundle;
import com.android.settings.core.InstrumentedFragment;
import com.android.settings.core.InstrumentedPreferenceFragment;
/**
* Base class for a fragment that has the options menu.
@@ -25,7 +25,7 @@ import com.android.settings.core.InstrumentedFragment;
* preferences, and we need to call setHasOptionsMenu(true) for the back button on action bar.
* For preference fragments, use SettingsPreferenceFragment.
*/
public abstract class OptionsMenuFragment extends InstrumentedFragment {
public abstract class OptionsMenuFragment extends InstrumentedPreferenceFragment {
@Override
public void onActivityCreated(Bundle savedInstanceState) {