Clean up lifecycle in MobileNetworkSettings
To avoid double registering, which prevent potential issues and could improve latency. Since DashboardFragment already supported register lifecycle automatically for the controllers bound by XML which implements androidx.lifecycle.Lifecycle, so doing a cleanup to prevent register lifecycle event manually (doubling). Bug: 149338098 Test: temporarily add logging to make sure the lifecycle method is called and only called once Change-Id: I4dbc36414991ef6b599be61aa77ff0dc8c52468c
This commit is contained in:
@@ -61,12 +61,9 @@ public class ContactDiscoveryPreferenceController extends TelephonyTogglePrefere
|
||||
mCarrierConfigCache = CarrierConfigCache.getInstance(context);
|
||||
}
|
||||
|
||||
public ContactDiscoveryPreferenceController init(FragmentManager fragmentManager, int subId,
|
||||
Lifecycle lifecycle) {
|
||||
void init(FragmentManager fragmentManager, int subId) {
|
||||
mFragmentManager = fragmentManager;
|
||||
mSubId = subId;
|
||||
lifecycle.addObserver(this);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user