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

Commit 02afa0c9 authored by Shaoxu Liu's avatar Shaoxu Liu Committed by Gerrit - the friendly Code Review server
Browse files

SysytemUI: Show the operator name in keyguard and notify bar

Add a flag to check if the operator label in Keyguard is needed.
Move the operator name from status bar to notify bar to make sure
it could be shown even when there is any notify.

By default, it shows operator name in Keyguard but not in notify bar
to follow the Android original design.
Customize to show/hide operator name label in overlay of data package
if needed.

Change-Id: Ieb540f25c384fafa840c06c2691e91506e9ef5a6
parent f5c82e61
Loading
Loading
Loading
Loading
+12 −13
Original line number Diff line number Diff line
@@ -62,6 +62,18 @@
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                >
                <com.android.keyguard.CarrierText
                    android:id="@+id/status_carrier_text"
                    android:layout_width="wrap_content"
                    android:layout_height="@dimen/match_parent"
                    android:layout_marginStart="@dimen/keyguard_carrier_text_margin"
                    android:gravity="center_vertical"
                    android:ellipsize="marquee"
                    android:textAppearance="?android:attr/textAppearanceSmall"
                    android:textColor="#ffffff"
                    android:singleLine="true"
                    android:visibility="gone"/>

                <com.android.systemui.statusbar.StatusBarIconView android:id="@+id/moreIcon"
                    android:layout_width="@dimen/status_bar_icon_size"
                    android:layout_height="match_parent"
@@ -76,19 +88,6 @@
                    android:orientation="horizontal"/>
            </com.android.keyguard.AlphaOptimizedLinearLayout>

            <com.android.keyguard.CarrierText
                android:id="@+id/status_carrier_text"
                android:layout_width="match_parent"
                android:layout_height="@dimen/match_parent"
                android:layout_marginStart="@dimen/keyguard_carrier_text_margin"
                android:layout_toStartOf="@id/notification_icon_area_inner"
                android:gravity="center_vertical"
                android:ellipsize="marquee"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="#ffffff"
                android:singleLine="true"
                android:visibility="gone"/>

        </com.android.systemui.statusbar.AlphaOptimizedFrameLayout>

        <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@+id/system_icon_area"
+3 −0
Original line number Diff line number Diff line
@@ -322,6 +322,9 @@
    <!-- Duration of the expansion animation in the volume dialog -->
    <item name="volume_expand_animation_duration" type="integer">300</item>

    <!-- Whether or not to show operator name in Keyguard, true by Android original default -->
    <bool name="config_showOperatorInKeyguard">true</bool>

    <!-- Whether or not to show battery level text. -->
    <bool name="config_showBatteryPercentage">false</bool>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -107,6 +107,8 @@ public class KeyguardStatusBarView extends RelativeLayout
        boolean showBatteryLevel = getResources().getBoolean(R.bool.config_showBatteryPercentage);
        mBatteryLevel.setVisibility(
                mBatteryCharging || showBatteryLevel ? View.VISIBLE : View.GONE);
        boolean showCarrierText = getResources().getBoolean(R.bool.config_showOperatorInKeyguard);
        mCarrierLabel.setVisibility(showCarrierText ? View.VISIBLE : View.GONE);
    }

    private void updateSystemIconsLayoutParams() {
+2 −8
Original line number Diff line number Diff line
@@ -1523,17 +1523,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                && mCarrierText != null) {
            if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
                mCarrierText.setVisibility(View.GONE);
            } else {
                ArrayList<Entry> activeNotifications = mNotificationData.getActiveNotifications();
                final int N = activeNotifications.size();
                if (N > 0) {
                    mCarrierText.setVisibility(View.GONE);
            } else {
                mCarrierText.setVisibility(View.VISIBLE);
            }
        }
    }
    }

    @Override
    protected void updateRowStates() {