CD settings: clean up null handling
Keep a non-null injector in the ExternalDisplayPreferenceFragment so that we don't need to check it whenever it is used. This makes the wrappers in ExternalDisplaySettingsConfiguration redundant, since their main purpose was to check for a null injector. Stop passing a Context object around several methods. Instead, just use requireContext() whenever we need a context. Only a fraction of the methods actually need to use the context directly. getPrefContext() does not work because it cannot be overridden in tests (it is final) and requires PreferenceFragmentCompat.mPreferenceManager to be set. Bug: b/352648432 Flag: EXEMPT refactor Test: ExternalDisplayUpdaterTest Test: ExternalDisplayPreferenceFragmentTest Change-Id: I5aa3703c2646fc12fb9b77661fc2f3c35388f61b
Loading
Please register or sign in to comment