Merge "[Settings] Support getSystemService(Class<T>)"

This commit is contained in:
Bonian Chen
2021-03-22 08:18:59 +00:00
committed by Gerrit Code Review

View File

@@ -438,6 +438,13 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF
return getActivity().getSystemService(name); return getActivity().getSystemService(name);
} }
/**
* Returns the specified system service from the owning Activity.
*/
protected <T> T getSystemService(final Class<T> serviceClass) {
return getActivity().getSystemService(serviceClass);
}
/** /**
* Returns the PackageManager from the owning Activity. * Returns the PackageManager from the owning Activity.
*/ */