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

Commit 0207c099 authored by Adam Cohen's avatar Adam Cohen
Browse files

Fixing a coupld lockscreen bugs

-> Showing correct page, as per discussions (issue 7205431)
-> Hide the time when the system status widget is showsing (issue 7216577)

Change-Id: I5b79d72e8fd8226952f6a8ea99b776feb4ddde1f
parent b35000f3
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@ public class KeyguardHostView extends KeyguardViewBase {
                        // from AudioManager
                        KeyguardHostView.this.addView(mTransportControl);
                        mTransportControl.setVisibility(View.GONE);
                        showAppropriateWidgetPage();
                    }
                }

@@ -178,6 +179,7 @@ public class KeyguardHostView extends KeyguardViewBase {
                        mTransportControl.setVisibility(View.VISIBLE);
                        // Once shown, leave it showing
                        mSticky = true;
                        showAppropriateWidgetPage();
                    }
                }
            });
@@ -736,6 +738,15 @@ public class KeyguardHostView extends KeyguardViewBase {
                addWidget(widgets[i]);
            }
        }
        showAppropriateWidgetPage();
    }

    private void showAppropriateWidgetPage() {
        int page = mAppWidgetContainer.indexOfChild(findViewById(R.id.keyguard_status_view));
        if (mAppWidgetContainer.indexOfChild(mTransportControl) != -1) {
            page = mAppWidgetContainer.indexOfChild(mTransportControl);
        }
        mAppWidgetContainer.setCurrentPage(page);
    }

    private void inflateAndAddUserSelectorWidgetIfNecessary() {
+16 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.internal.policy.impl.keyguard;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.android.internal.R;
@@ -70,5 +71,20 @@ public class KeyguardWidgetRegion extends LinearLayout implements PageSwitchList
    @Override
    public void onPageSwitch(View newPage, int newPageIndex) {
        mPage = newPageIndex;

        // If we're showing the default system status widget, then we want to hide the clock
        boolean hideClock = false;
        if ((newPage instanceof ViewGroup)) {
            ViewGroup vg = (ViewGroup) newPage;
            if (vg.getChildAt(0) instanceof KeyguardStatusView) {
                hideClock = true;
            }
        }

        if (hideClock) {
            setSystemUiVisibility(getSystemUiVisibility() | View.STATUS_BAR_DISABLE_CLOCK);
        } else {
            setSystemUiVisibility(getSystemUiVisibility() & ~View.STATUS_BAR_DISABLE_CLOCK);
        }
    }
}