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

Commit f73fb38d authored by Kshitij's avatar Kshitij
Browse files

chore: PhoneStatusBarView: Address CR

- Drop useless comments
- Move BLISS_LAUNCHER_DOCK_WIDTH to appropriate section
- Rename LAUNCHER_DOCK_WIDTH to BLISS_LAUNCHER_DOCK_WIDTH
parent 82df8f45
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -74,6 +74,7 @@ import java.util.Objects;


public class PhoneStatusBarView extends FrameLayout implements Callbacks {
public class PhoneStatusBarView extends FrameLayout implements Callbacks {
    private static final String TAG = "PhoneStatusBarView";
    private static final String TAG = "PhoneStatusBarView";
    private static final String BLISS_LAUNCHER_DOCK_WIDTH = "bliss_launcher_dock_width";
    private final CommandQueue mCommandQueue;
    private final CommandQueue mCommandQueue;
    private final StatusBarContentInsetsProvider mContentInsetsProvider;
    private final StatusBarContentInsetsProvider mContentInsetsProvider;


@@ -96,7 +97,6 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks {
     */
     */
    private int mCutoutSideNudge = 0;
    private int mCutoutSideNudge = 0;


    private static final String LAUNCHER_DOCK_WIDTH = "launcher_dock_width";
    private String mPreviousApp;
    private String mPreviousApp;
    private IActivityTaskManager mActivityTaskManager;
    private IActivityTaskManager mActivityTaskManager;
    private Handler mHandler = new Handler(Looper.getMainLooper());
    private Handler mHandler = new Handler(Looper.getMainLooper());
@@ -153,17 +153,16 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks {
                    () -> getDisplay().getRotation());
                    () -> getDisplay().getRotation());
            mRotationButtonController.setRotationButton(floatingRotationButton, null);
            mRotationButtonController.setRotationButton(floatingRotationButton, null);
        }
        }
        // Make a listener
        ContentObserver observer = new ContentObserver(new Handler()) {
        ContentObserver observer = new ContentObserver(new Handler()) {
            @Override
            @Override
            public void onChange(boolean selfChange, Uri uri) {
            public void onChange(boolean selfChange, Uri uri) {
                if (uri.equals(Settings.Secure.getUriFor(LAUNCHER_DOCK_WIDTH))) {
                if (uri.equals(Settings.Secure.getUriFor(BLISS_LAUNCHER_DOCK_WIDTH))) {
                    updateStatusBarHeight();
                    updateStatusBarHeight();
                }
                }
            }
            }
        };
        };
        context.getContentResolver().registerContentObserver(
        context.getContentResolver().registerContentObserver(
                        Settings.Secure.getUriFor(LAUNCHER_DOCK_WIDTH), false, observer, UserHandle.USER_ALL);
                        Settings.Secure.getUriFor(BLISS_LAUNCHER_DOCK_WIDTH), false, observer, UserHandle.USER_ALL);


        try {
        try {
            mActivityTaskManager = ActivityTaskManager.getService();
            mActivityTaskManager = ActivityTaskManager.getService();
@@ -359,7 +358,7 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks {
            homePackageName = resolveInfo.activityInfo.packageName;
            homePackageName = resolveInfo.activityInfo.packageName;
            isHomePackage = getForegroundApp().equals(homePackageName);
            isHomePackage = getForegroundApp().equals(homePackageName);
        }
        }
        int dockWidth = !isHomePackage ? 0 : Settings.Secure.getInt(getContext().getContentResolver(), LAUNCHER_DOCK_WIDTH, 0);
        int dockWidth = !isHomePackage ? 0 : Settings.Secure.getInt(getContext().getContentResolver(), BLISS_LAUNCHER_DOCK_WIDTH, 0);
        View sbContents = findViewById(R.id.status_bar_contents);
        View sbContents = findViewById(R.id.status_bar_contents);
        sbContents.setPaddingRelative(
        sbContents.setPaddingRelative(
                statusBarPaddingStart + (mRotationOrientation == RotationUtils.ROTATION_SEASCAPE ? dockWidth : 0),
                statusBarPaddingStart + (mRotationOrientation == RotationUtils.ROTATION_SEASCAPE ? dockWidth : 0),