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

Commit 2a75ed35 authored by Tommaso Fonda's avatar Tommaso Fonda
Browse files

fixup! SystemUI: Register content observer for clock position

There already is another ContentObserver serving the same purpose in
packages/SystemUI/src/com/android/systemui/statusbar/phone/ClockController.java

Change-Id: I85f8c0a0388c816cb126751f751b3e4674bebb76
parent 34db116b
Loading
Loading
Loading
Loading
+0 −22
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@ package com.android.systemui.statusbar.phone.fragment;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
import android.app.Fragment;
import android.content.Context;
import android.database.ContentObserver;
import android.os.Bundle;
import android.os.Parcelable;
@@ -151,8 +150,6 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
    private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;

    private ClockController mClockController;
    private Context mContext;
    private boolean mIsClockDenylisted;

    private List<String> mBlockedIcons = new ArrayList<>();
    private Map<Startable, Startable.State> mStartableStates = new ArrayMap<>();
@@ -329,25 +326,6 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
        initOperatorName();
        initNotificationIconArea();

        mContext = getContext();

        ContentObserver contentObserver = new ContentObserver(null) {
            @Override
            public void onChange(boolean selfChange) {
                boolean wasClockDenylisted = mIsClockDenylisted;
                mIsClockDenylisted = StatusBarIconController.getIconHideList(mContext,
                        Settings.Secure.getString(mContext.getContentResolver(),
                                StatusBarIconController.ICON_HIDE_LIST)).contains("clock");
                if (wasClockDenylisted && !mIsClockDenylisted) {
                    showClock(false);
                }
            }
        };
        mContext.getContentResolver().registerContentObserver(
                Settings.Secure.getUriFor(StatusBarIconController.ICON_HIDE_LIST), false,
                contentObserver);
        contentObserver.onChange(true);

        mSystemEventAnimator = getSystemEventAnimator();
        mCarrierConfigTracker.addCallback(mCarrierConfigCallback);
        mCarrierConfigTracker.addDefaultDataSubscriptionChangedListener(mDefaultDataListener);