Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 49cdb602 authored by Bonian Chen's avatar Bonian Chen
Browse files

[Settings] Support getSystemService(Class<T>)

Add getSystemService(Class<T>) to align the capability with framework
part.

Bug: 179640862
Test: local
Change-Id: I278951c2402aa8551cee37923f45626ab1830dd3
parent d248042a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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.
     */