[Settings] Support getSystemService(Class<T>)
Add getSystemService(Class<T>) to align the capability with framework part. Bug: 179640862 Test: local Change-Id: I278951c2402aa8551cee37923f45626ab1830dd3
This commit is contained in:
@@ -438,6 +438,13 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF
|
||||
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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user