Loading src/com/android/settings/bluetooth/BlockingPrefWithSliceController.java +14 −2 Original line number Diff line number Diff line Loading @@ -113,15 +113,27 @@ public class BlockingPrefWithSliceController extends BasePreferenceController im @Override public void onStart() { if (mLiveData != null) { if (mLiveData == null) { return; } try { mLiveData.observeForever(this); } catch (SecurityException e) { Log.w(TAG, "observeForever - no permission"); } } @Override public void onStop() { if (mLiveData != null) { if (mLiveData == null) { return; } try { mLiveData.removeObserver(this); } catch (SecurityException e) { Log.w(TAG, "removeObserver - no permission"); } } Loading src/com/android/settings/slices/SlicePreferenceController.java +14 −5 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ public class SlicePreferenceController extends BasePreferenceController implemen LiveData<Slice> mLiveData; @VisibleForTesting SlicePreference mSlicePreference; private boolean mIsObservering = false; private Uri mUri; public SlicePreferenceController(Context context, String preferenceKey) { Loading Loading @@ -74,9 +73,14 @@ public class SlicePreferenceController extends BasePreferenceController implemen @Override public void onStart() { if (mLiveData != null && !mIsObservering) { mIsObservering = true; if (mLiveData == null) { return; } try { mLiveData.observeForever(this); } catch (SecurityException e) { Log.w(TAG, "observeForever - no permission"); } } Loading @@ -91,9 +95,14 @@ public class SlicePreferenceController extends BasePreferenceController implemen } private void removeLiveDataObserver() { if (mLiveData != null && mIsObservering && mLiveData.hasActiveObservers()) { mIsObservering = false; if (mLiveData == null) { return; } try { mLiveData.removeObserver(this); } catch (SecurityException e) { Log.w(TAG, "removeLiveDataObserver - no permission"); } } } Loading
src/com/android/settings/bluetooth/BlockingPrefWithSliceController.java +14 −2 Original line number Diff line number Diff line Loading @@ -113,15 +113,27 @@ public class BlockingPrefWithSliceController extends BasePreferenceController im @Override public void onStart() { if (mLiveData != null) { if (mLiveData == null) { return; } try { mLiveData.observeForever(this); } catch (SecurityException e) { Log.w(TAG, "observeForever - no permission"); } } @Override public void onStop() { if (mLiveData != null) { if (mLiveData == null) { return; } try { mLiveData.removeObserver(this); } catch (SecurityException e) { Log.w(TAG, "removeObserver - no permission"); } } Loading
src/com/android/settings/slices/SlicePreferenceController.java +14 −5 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ public class SlicePreferenceController extends BasePreferenceController implemen LiveData<Slice> mLiveData; @VisibleForTesting SlicePreference mSlicePreference; private boolean mIsObservering = false; private Uri mUri; public SlicePreferenceController(Context context, String preferenceKey) { Loading Loading @@ -74,9 +73,14 @@ public class SlicePreferenceController extends BasePreferenceController implemen @Override public void onStart() { if (mLiveData != null && !mIsObservering) { mIsObservering = true; if (mLiveData == null) { return; } try { mLiveData.observeForever(this); } catch (SecurityException e) { Log.w(TAG, "observeForever - no permission"); } } Loading @@ -91,9 +95,14 @@ public class SlicePreferenceController extends BasePreferenceController implemen } private void removeLiveDataObserver() { if (mLiveData != null && mIsObservering && mLiveData.hasActiveObservers()) { mIsObservering = false; if (mLiveData == null) { return; } try { mLiveData.removeObserver(this); } catch (SecurityException e) { Log.w(TAG, "removeLiveDataObserver - no permission"); } } }