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

Commit 0928e019 authored by Jim Miller's avatar Jim Miller
Browse files

Fix emergency call area updates.

This fixes a bug where the emergency call button doesn't reflect the current
state.

Fixes bug 7482869

Change-Id: I7de2100f10a078943cb92c13d638c72e99c7a643
parent 51117262
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -85,10 +85,21 @@ public class CarrierText extends TextView {
    protected void onFinishInflate() {
        super.onFinishInflate();
        mSeparator = getResources().getString(R.string.kg_text_message_separator);
        KeyguardUpdateMonitor.getInstance(mContext).registerCallback(mCallback);
        setSelected(true); // Allow marquee to work.
    }

    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        KeyguardUpdateMonitor.getInstance(mContext).registerCallback(mCallback);
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        KeyguardUpdateMonitor.getInstance(mContext).removeCallback(mCallback);
    }

    /**
     * Top-level function for creating carrier text. Makes text based on simState, PLMN
     * and SPN as well as device capabilities, such as being emergency call capable.
+12 −0
Original line number Diff line number Diff line
@@ -63,6 +63,18 @@ public class EmergencyButton extends Button {
        super(context, attrs);
    }

    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        KeyguardUpdateMonitor.getInstance(mContext).registerCallback(mInfoCallback);
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        KeyguardUpdateMonitor.getInstance(mContext).removeCallback(mInfoCallback);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();