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

Commit f2ff33e8 authored by Zhibin Liu's avatar Zhibin Liu Committed by Automerger Merge Worker
Browse files

Merge "Add support to configure state of operator name in status bar [1/2]"...

Merge "Add support to configure state of operator name in status bar [1/2]" into main am: ee18dbb3

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3530124



Change-Id: I490000e2182043e82a3bb3a822f0aad6db65ece4
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents af3ac7f2 ee18dbb3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -4091,6 +4091,11 @@
        <item>-44</item>
    </integer-array>

    <!-- Provides default value for operator name in status bar option in  setting:
         0 - Hide operator name in status bar
         1 - Show operator name in status bar (default) -->
    <integer name="config_showOperatorNameDefault">1</integer>

    <!-- Enabled built-in zen mode condition providers -->
    <string-array translatable="false" name="config_system_condition_providers">
        <item>countdown</item>
+3 −0
Original line number Diff line number Diff line
@@ -2719,6 +2719,9 @@
  <java-symbol type="string" name="muted_by" />
  <java-symbol type="string" name="zen_mode_alarm" />

  <!-- For default state of operator name in status bar -->
  <java-symbol type="integer" name="config_showOperatorNameDefault"/>

  <java-symbol type="string" name="select_day" />
  <java-symbol type="string" name="select_year" />

+10 −0
Original line number Diff line number Diff line
@@ -16,10 +16,12 @@

package com.android.systemui.statusbar

import android.content.res.Resources
import android.telephony.ServiceState
import android.telephony.SubscriptionInfo
import android.telephony.TelephonyManager
import android.telephony.telephonyManager
import android.testing.TestableResources
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.keyguard.keyguardUpdateMonitor
@@ -70,10 +72,18 @@ class OperatorNameViewControllerTest : SysuiTestCase() {
    private val airplaneModeRepository = FakeAirplaneModeRepository()
    private val connectivityRepository = FakeConnectivityRepository()

    @Mock private lateinit var resources: Resources
    private lateinit var testableResources: TestableResources

    @Before
    fun setup() {
        MockitoAnnotations.initMocks(this)

        testableResources = mContext.getOrCreateTestableResources()
        testableResources.addOverride(
            com.android.internal.R.integer.config_showOperatorNameDefault,
                1)

        airplaneModeInteractor =
            AirplaneModeInteractor(
                airplaneModeRepository,
+7 −1
Original line number Diff line number Diff line
@@ -97,7 +97,13 @@ public class OperatorNameViewController extends ViewController<OperatorNameView>
        boolean showOperatorName =
                mCarrierConfigTracker
                        .getShowOperatorNameInStatusBarConfig(defaultSubInfo.getSubId())
                        && (mTunerService.getValue(KEY_SHOW_OPERATOR_NAME, 1) != 0);
                        && (mTunerService.getValue(
                                KEY_SHOW_OPERATOR_NAME,
                                mView.getResources()
                                        .getInteger(
                                                com.android.internal.R.integer
                                                        .config_showOperatorNameDefault))
                                != 0);
        mView.update(
                showOperatorName,
                mTelephonyManager.isDataCapable(),