Merge "[Settings] Support getSystemService(Class<T>)" am: 513da92357

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1639943

Change-Id: Id7a6f8c0c21d2bf5112a91554f608974586588c1
This commit is contained in:
Bonian Chen
2021-03-22 08:56:21 +00:00
committed by Automerger Merge Worker

View File

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