Fix issue where SmartAutoRotateController tries to unregister an unregistered receiver

Controllers are automatically bound to a lifecycle if registered in the xml file. Manually binding a lifecycle can cause multiple receivers to be unregistered/registered. Removing the manual binding will prevent this case from causing a potential exception.

Bug: 227762968

Test: none
Change-Id: I9c8ddc6f82b19cd4a9c8a4aec3c9c744935cd542
This commit is contained in:
Abel Tesfaye
2022-04-20 00:14:13 +00:00
parent 3adc967449
commit 8814d96884
2 changed files with 0 additions and 6 deletions

View File

@@ -35,7 +35,6 @@ import android.provider.Settings;
import android.service.rotationresolver.RotationResolverService;
import android.text.TextUtils;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;
import androidx.preference.Preference;
@@ -82,10 +81,6 @@ public class SmartAutoRotateController extends TogglePreferenceController implem
context);
}
public void init(Lifecycle lifecycle) {
lifecycle.addObserver(this);
}
@Override
public int getAvailabilityStatus() {
if (!isRotationResolverServiceAvailable(mContext)) {