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

Commit 1ff3518a authored by Shaoxu Liu's avatar Shaoxu Liu
Browse files

SystemUI: Operator name show on status bar

The Status bar will show opertor name above every
application when there is no notification.Set
"enable_operator_name" in System UI as "true"
can enable this function.

Change-Id: I2772bcc69f2a9f0cbd44b217d5ac6cb865c1c37a
CRs-Fixed: 832630
parent 31d1bcfd
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -75,6 +75,20 @@
                    android:gravity="center_vertical"
                    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
@@ -290,6 +290,9 @@
    <!-- Enable the default volume dialog -->
    <bool name="enable_volume_ui">true</bool>

    <!-- Enable operator name on status bar -->
    <bool name="enable_operator_name">false</bool>

    <!-- Duration of the full carrier network change icon animation. -->
    <integer name="carrier_network_change_anim_time">3000</integer>

+21 −0
Original line number Diff line number Diff line
@@ -290,6 +290,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,

    StatusBarIconController mIconController;

    private View mCarrierText = null;

    // expanded notifications
    NotificationPanelView mNotificationPanel; // the sliding/resizing panel within the notification window
    View mExpandedContents;
@@ -722,6 +724,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        // figure out which pixel-format to use for the status bar.
        mPixelFormat = PixelFormat.OPAQUE;

        if (mContext.getResources().getBoolean(R.bool.enable_operator_name)) {
            mCarrierText = mStatusBarView.findViewById(R.id.status_carrier_text);
        }

        mStackScroller = (NotificationStackScrollLayout) mStatusBarWindow.findViewById(
                R.id.notification_stack_scroller);
        mStackScroller.setLongPressListener(getNotificationLongClicker());
@@ -1461,6 +1467,21 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,

        updateNotificationShade();
        mIconController.updateNotificationIcons(mNotificationData);

        if (mContext.getResources().getBoolean(R.bool.enable_operator_name)
                && 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