Loading packages/SystemUI/src/com/android/keyguard/CarrierTextManager.java +20 −37 Original line number Diff line number Diff line Loading @@ -16,11 +16,6 @@ package com.android.keyguard; import static com.android.keyguard.logging.CarrierTextManagerLogger.REASON_ACTIVE_DATA_SUB_CHANGED; import static com.android.keyguard.logging.CarrierTextManagerLogger.REASON_ON_SIM_STATE_CHANGED; import static com.android.keyguard.logging.CarrierTextManagerLogger.REASON_ON_TELEPHONY_CAPABLE; import static com.android.keyguard.logging.CarrierTextManagerLogger.REASON_REFRESH_CARRIER_INFO; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; Loading @@ -37,7 +32,6 @@ import android.util.Log; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import com.android.keyguard.logging.CarrierTextManagerLogger; import com.android.settingslib.WirelessUtils; import com.android.systemui.R; import com.android.systemui.dagger.qualifiers.Background; Loading @@ -46,7 +40,6 @@ import com.android.systemui.keyguard.WakefulnessLifecycle; import com.android.systemui.statusbar.pipeline.wifi.data.repository.WifiRepository; import com.android.systemui.telephony.TelephonyListenerManager; import java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.concurrent.Executor; Loading Loading @@ -75,7 +68,6 @@ public class CarrierTextManager { private final AtomicBoolean mNetworkSupported = new AtomicBoolean(); @VisibleForTesting protected KeyguardUpdateMonitor mKeyguardUpdateMonitor; private final CarrierTextManagerLogger mLogger; private final WifiRepository mWifiRepository; private final boolean[] mSimErrorState; private final int mSimSlotsNumber; Loading Loading @@ -105,13 +97,19 @@ public class CarrierTextManager { protected final KeyguardUpdateMonitorCallback mCallback = new KeyguardUpdateMonitorCallback() { @Override public void onRefreshCarrierInfo() { mLogger.logUpdateCarrierTextForReason(REASON_REFRESH_CARRIER_INFO); if (DEBUG) { Log.d(TAG, "onRefreshCarrierInfo(), mTelephonyCapable: " + Boolean.toString(mTelephonyCapable)); } updateCarrierText(); } @Override public void onTelephonyCapable(boolean capable) { mLogger.logUpdateCarrierTextForReason(REASON_ON_TELEPHONY_CAPABLE); if (DEBUG) { Log.d(TAG, "onTelephonyCapable() mTelephonyCapable: " + Boolean.toString(capable)); } mTelephonyCapable = capable; updateCarrierText(); } Loading @@ -123,7 +121,7 @@ public class CarrierTextManager { return; } mLogger.logUpdateCarrierTextForReason(REASON_ON_SIM_STATE_CHANGED); if (DEBUG) Log.d(TAG, "onSimStateChanged: " + getStatusForIccState(simState)); if (getStatusForIccState(simState) == CarrierTextManager.StatusMode.SimIoError) { mSimErrorState[slotId] = true; updateCarrierText(); Loading @@ -139,7 +137,6 @@ public class CarrierTextManager { @Override public void onActiveDataSubscriptionIdChanged(int subId) { if (mNetworkSupported.get() && mCarrierTextCallback != null) { mLogger.logUpdateCarrierTextForReason(REASON_ACTIVE_DATA_SUB_CHANGED); updateCarrierText(); } } Loading Loading @@ -178,9 +175,7 @@ public class CarrierTextManager { WakefulnessLifecycle wakefulnessLifecycle, @Main Executor mainExecutor, @Background Executor bgExecutor, KeyguardUpdateMonitor keyguardUpdateMonitor, CarrierTextManagerLogger logger) { KeyguardUpdateMonitor keyguardUpdateMonitor) { mContext = context; mIsEmergencyCallCapable = telephonyManager.isVoiceCapable(); Loading @@ -196,7 +191,6 @@ public class CarrierTextManager { mMainExecutor = mainExecutor; mBgExecutor = bgExecutor; mKeyguardUpdateMonitor = keyguardUpdateMonitor; mLogger = logger; mBgExecutor.execute(() -> { boolean supported = mContext.getPackageManager() .hasSystemFeature(PackageManager.FEATURE_TELEPHONY); Loading Loading @@ -321,7 +315,7 @@ public class CarrierTextManager { subOrderBySlot[i] = -1; } final CharSequence[] carrierNames = new CharSequence[numSubs]; mLogger.logUpdate(numSubs); if (DEBUG) Log.d(TAG, "updateCarrierText(): " + numSubs); for (int i = 0; i < numSubs; i++) { int subId = subs.get(i).getSubscriptionId(); Loading @@ -331,7 +325,9 @@ public class CarrierTextManager { int simState = mKeyguardUpdateMonitor.getSimState(subId); CharSequence carrierName = subs.get(i).getCarrierName(); CharSequence carrierTextForSimState = getCarrierTextForSimState(simState, carrierName); mLogger.logUpdateLoopStart(subId, simState, String.valueOf(carrierName)); if (DEBUG) { Log.d(TAG, "Handling (subId=" + subId + "): " + simState + " " + carrierName); } if (carrierTextForSimState != null) { allSimsMissing = false; carrierNames[i] = carrierTextForSimState; Loading @@ -344,7 +340,9 @@ public class CarrierTextManager { // Wi-Fi is disassociated or disabled if (ss.getRilDataRadioTechnology() != ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN || mWifiRepository.isWifiConnectedWithValidSsid()) { mLogger.logUpdateWfcCheck(); if (DEBUG) { Log.d(TAG, "SIM ready and in service: subId=" + subId + ", ss=" + ss); } anySimReadyAndInService = true; } } Loading Loading @@ -381,7 +379,7 @@ public class CarrierTextManager { if (i.getBooleanExtra(TelephonyManager.EXTRA_SHOW_PLMN, false)) { plmn = i.getStringExtra(TelephonyManager.EXTRA_PLMN); } mLogger.logUpdateFromStickyBroadcast(plmn, spn); if (DEBUG) Log.d(TAG, "Getting plmn/spn sticky brdcst " + plmn + "/" + spn); if (Objects.equals(plmn, spn)) { text = plmn; } else { Loading Loading @@ -411,7 +409,6 @@ public class CarrierTextManager { !allSimsMissing, subsIds, airplaneMode); mLogger.logCallbackSentFromUpdate(info); postToCallback(info); Trace.endSection(); } Loading Loading @@ -648,7 +645,6 @@ public class CarrierTextManager { private final Executor mMainExecutor; private final Executor mBgExecutor; private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; private final CarrierTextManagerLogger mLogger; private boolean mShowAirplaneMode; private boolean mShowMissingSim; Loading @@ -662,8 +658,7 @@ public class CarrierTextManager { WakefulnessLifecycle wakefulnessLifecycle, @Main Executor mainExecutor, @Background Executor bgExecutor, KeyguardUpdateMonitor keyguardUpdateMonitor, CarrierTextManagerLogger logger) { KeyguardUpdateMonitor keyguardUpdateMonitor) { mContext = context; mSeparator = resources.getString( com.android.internal.R.string.kg_text_message_separator); Loading @@ -674,7 +669,6 @@ public class CarrierTextManager { mMainExecutor = mainExecutor; mBgExecutor = bgExecutor; mKeyguardUpdateMonitor = keyguardUpdateMonitor; mLogger = logger; } /** */ Loading @@ -694,7 +688,7 @@ public class CarrierTextManager { return new CarrierTextManager( mContext, mSeparator, mShowAirplaneMode, mShowMissingSim, mWifiRepository, mTelephonyManager, mTelephonyListenerManager, mWakefulnessLifecycle, mMainExecutor, mBgExecutor, mKeyguardUpdateMonitor, mLogger); mMainExecutor, mBgExecutor, mKeyguardUpdateMonitor); } } /** Loading Loading @@ -722,17 +716,6 @@ public class CarrierTextManager { this.subscriptionIds = subscriptionIds; this.airplaneMode = airplaneMode; } @Override public String toString() { return "CarrierTextCallbackInfo{" + "carrierText=" + carrierText + ", listOfCarriers=" + Arrays.toString(listOfCarriers) + ", anySimReady=" + anySimReady + ", subscriptionIds=" + Arrays.toString(subscriptionIds) + ", airplaneMode=" + airplaneMode + '}'; } } /** Loading packages/SystemUI/src/com/android/keyguard/logging/CarrierTextManagerLogger.ktdeleted 100644 → 0 +0 −135 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.keyguard.logging import androidx.annotation.IntDef import com.android.keyguard.CarrierTextManager.CarrierTextCallbackInfo import com.android.systemui.dagger.SysUISingleton import com.android.systemui.log.LogBuffer import com.android.systemui.log.LogLevel import com.android.systemui.log.dagger.CarrierTextManagerLog import javax.inject.Inject /** Logger adapter for [CarrierTextManager] to add detailed messages in a [LogBuffer] */ @SysUISingleton class CarrierTextManagerLogger @Inject constructor(@CarrierTextManagerLog val buffer: LogBuffer) { /** * This method and the methods below trace the execution of CarrierTextManager.updateCarrierText */ fun logUpdate(numSubs: Int) { buffer.log( TAG, LogLevel.VERBOSE, { int1 = numSubs }, { "updateCarrierText: numSubs=$int1" }, ) } fun logUpdateLoopStart(sub: Int, simState: Int, carrierName: String) { buffer.log( TAG, LogLevel.VERBOSE, { int1 = sub int2 = simState str1 = carrierName }, { "┣ updateCarrierText: updating sub=$int1 simState=$int2 carrierName=$str1" }, ) } fun logUpdateWfcCheck() { buffer.log( TAG, LogLevel.VERBOSE, {}, { "┣ updateCarrierText: found WFC state" }, ) } fun logUpdateFromStickyBroadcast(plmn: String, spn: String) { buffer.log( TAG, LogLevel.VERBOSE, { str1 = plmn str2 = spn }, { "┣ updateCarrierText: getting PLMN/SPN sticky brdcst. plmn=$str1, spn=$str1" }, ) } /** De-structures the info object so that we don't have to generate new strings */ fun logCallbackSentFromUpdate(info: CarrierTextCallbackInfo) { buffer.log( TAG, LogLevel.VERBOSE, { str1 = "${info.carrierText}" bool1 = info.anySimReady bool2 = info.airplaneMode }, { "┗ updateCarrierText: " + "result=(carrierText=$str1, anySimReady=$bool1, airplaneMode=$bool2)" }, ) } /** * Used to log the starting point for _why_ the carrier text is updating. In order to keep us * from holding on to too many objects, we'll just use simple ints for reasons here */ fun logUpdateCarrierTextForReason(@CarrierTextRefreshReason reason: Int) { buffer.log( TAG, LogLevel.DEBUG, { int1 = reason }, { "refreshing carrier info for reason: ${reason.reasonMessage()}" } ) } companion object { const val REASON_REFRESH_CARRIER_INFO = 1 const val REASON_ON_TELEPHONY_CAPABLE = 2 const val REASON_ON_SIM_STATE_CHANGED = 3 const val REASON_ACTIVE_DATA_SUB_CHANGED = 4 @Retention(AnnotationRetention.SOURCE) @IntDef( value = [ REASON_REFRESH_CARRIER_INFO, REASON_ON_TELEPHONY_CAPABLE, REASON_ON_SIM_STATE_CHANGED, REASON_ACTIVE_DATA_SUB_CHANGED, ] ) annotation class CarrierTextRefreshReason private fun @receiver:CarrierTextRefreshReason Int.reasonMessage() = when (this) { REASON_REFRESH_CARRIER_INFO -> "REFRESH_CARRIER_INFO" REASON_ON_TELEPHONY_CAPABLE -> "ON_TELEPHONY_CAPABLE" REASON_ON_SIM_STATE_CHANGED -> "SIM_STATE_CHANGED" REASON_ACTIVE_DATA_SUB_CHANGED -> "ACTIVE_DATA_SUB_CHANGED" else -> "unknown" } } } private const val TAG = "CarrierTextManagerLog" packages/SystemUI/src/com/android/systemui/log/dagger/CarrierTextManagerLog.ktdeleted 100644 → 0 +0 −9 Original line number Diff line number Diff line package com.android.systemui.log.dagger import javax.inject.Qualifier /** A [LogBuffer] for detailed carrier text logs. */ @Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class CarrierTextManagerLog packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java +0 −10 Original line number Diff line number Diff line Loading @@ -372,16 +372,6 @@ public class LogModule { return factory.create("KeyguardUpdateMonitorLog", 400); } /** * Provides a {@link LogBuffer} for use by {@link com.android.keyguard.KeyguardUpdateMonitor}. */ @Provides @SysUISingleton @CarrierTextManagerLog public static LogBuffer provideCarrierTextManagerLog(LogBufferFactory factory) { return factory.create("CarrierTextManagerLog", 100); } /** * Provides a {@link LogBuffer} for use by {@link com.android.systemui.ScreenDecorations}. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcher.kt +0 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import androidx.annotation.VisibleForTesting import com.android.settingslib.SignalIcon import com.android.settingslib.mobile.MobileMappings import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.demomode.DemoMode import com.android.systemui.demomode.DemoModeController Loading Loading @@ -63,7 +62,6 @@ import kotlinx.coroutines.flow.stateIn */ @Suppress("EXPERIMENTAL_IS_NOT_ENABLED") @OptIn(ExperimentalCoroutinesApi::class) @SysUISingleton class MobileRepositorySwitcher @Inject constructor( Loading Loading
packages/SystemUI/src/com/android/keyguard/CarrierTextManager.java +20 −37 Original line number Diff line number Diff line Loading @@ -16,11 +16,6 @@ package com.android.keyguard; import static com.android.keyguard.logging.CarrierTextManagerLogger.REASON_ACTIVE_DATA_SUB_CHANGED; import static com.android.keyguard.logging.CarrierTextManagerLogger.REASON_ON_SIM_STATE_CHANGED; import static com.android.keyguard.logging.CarrierTextManagerLogger.REASON_ON_TELEPHONY_CAPABLE; import static com.android.keyguard.logging.CarrierTextManagerLogger.REASON_REFRESH_CARRIER_INFO; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; Loading @@ -37,7 +32,6 @@ import android.util.Log; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import com.android.keyguard.logging.CarrierTextManagerLogger; import com.android.settingslib.WirelessUtils; import com.android.systemui.R; import com.android.systemui.dagger.qualifiers.Background; Loading @@ -46,7 +40,6 @@ import com.android.systemui.keyguard.WakefulnessLifecycle; import com.android.systemui.statusbar.pipeline.wifi.data.repository.WifiRepository; import com.android.systemui.telephony.TelephonyListenerManager; import java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.concurrent.Executor; Loading Loading @@ -75,7 +68,6 @@ public class CarrierTextManager { private final AtomicBoolean mNetworkSupported = new AtomicBoolean(); @VisibleForTesting protected KeyguardUpdateMonitor mKeyguardUpdateMonitor; private final CarrierTextManagerLogger mLogger; private final WifiRepository mWifiRepository; private final boolean[] mSimErrorState; private final int mSimSlotsNumber; Loading Loading @@ -105,13 +97,19 @@ public class CarrierTextManager { protected final KeyguardUpdateMonitorCallback mCallback = new KeyguardUpdateMonitorCallback() { @Override public void onRefreshCarrierInfo() { mLogger.logUpdateCarrierTextForReason(REASON_REFRESH_CARRIER_INFO); if (DEBUG) { Log.d(TAG, "onRefreshCarrierInfo(), mTelephonyCapable: " + Boolean.toString(mTelephonyCapable)); } updateCarrierText(); } @Override public void onTelephonyCapable(boolean capable) { mLogger.logUpdateCarrierTextForReason(REASON_ON_TELEPHONY_CAPABLE); if (DEBUG) { Log.d(TAG, "onTelephonyCapable() mTelephonyCapable: " + Boolean.toString(capable)); } mTelephonyCapable = capable; updateCarrierText(); } Loading @@ -123,7 +121,7 @@ public class CarrierTextManager { return; } mLogger.logUpdateCarrierTextForReason(REASON_ON_SIM_STATE_CHANGED); if (DEBUG) Log.d(TAG, "onSimStateChanged: " + getStatusForIccState(simState)); if (getStatusForIccState(simState) == CarrierTextManager.StatusMode.SimIoError) { mSimErrorState[slotId] = true; updateCarrierText(); Loading @@ -139,7 +137,6 @@ public class CarrierTextManager { @Override public void onActiveDataSubscriptionIdChanged(int subId) { if (mNetworkSupported.get() && mCarrierTextCallback != null) { mLogger.logUpdateCarrierTextForReason(REASON_ACTIVE_DATA_SUB_CHANGED); updateCarrierText(); } } Loading Loading @@ -178,9 +175,7 @@ public class CarrierTextManager { WakefulnessLifecycle wakefulnessLifecycle, @Main Executor mainExecutor, @Background Executor bgExecutor, KeyguardUpdateMonitor keyguardUpdateMonitor, CarrierTextManagerLogger logger) { KeyguardUpdateMonitor keyguardUpdateMonitor) { mContext = context; mIsEmergencyCallCapable = telephonyManager.isVoiceCapable(); Loading @@ -196,7 +191,6 @@ public class CarrierTextManager { mMainExecutor = mainExecutor; mBgExecutor = bgExecutor; mKeyguardUpdateMonitor = keyguardUpdateMonitor; mLogger = logger; mBgExecutor.execute(() -> { boolean supported = mContext.getPackageManager() .hasSystemFeature(PackageManager.FEATURE_TELEPHONY); Loading Loading @@ -321,7 +315,7 @@ public class CarrierTextManager { subOrderBySlot[i] = -1; } final CharSequence[] carrierNames = new CharSequence[numSubs]; mLogger.logUpdate(numSubs); if (DEBUG) Log.d(TAG, "updateCarrierText(): " + numSubs); for (int i = 0; i < numSubs; i++) { int subId = subs.get(i).getSubscriptionId(); Loading @@ -331,7 +325,9 @@ public class CarrierTextManager { int simState = mKeyguardUpdateMonitor.getSimState(subId); CharSequence carrierName = subs.get(i).getCarrierName(); CharSequence carrierTextForSimState = getCarrierTextForSimState(simState, carrierName); mLogger.logUpdateLoopStart(subId, simState, String.valueOf(carrierName)); if (DEBUG) { Log.d(TAG, "Handling (subId=" + subId + "): " + simState + " " + carrierName); } if (carrierTextForSimState != null) { allSimsMissing = false; carrierNames[i] = carrierTextForSimState; Loading @@ -344,7 +340,9 @@ public class CarrierTextManager { // Wi-Fi is disassociated or disabled if (ss.getRilDataRadioTechnology() != ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN || mWifiRepository.isWifiConnectedWithValidSsid()) { mLogger.logUpdateWfcCheck(); if (DEBUG) { Log.d(TAG, "SIM ready and in service: subId=" + subId + ", ss=" + ss); } anySimReadyAndInService = true; } } Loading Loading @@ -381,7 +379,7 @@ public class CarrierTextManager { if (i.getBooleanExtra(TelephonyManager.EXTRA_SHOW_PLMN, false)) { plmn = i.getStringExtra(TelephonyManager.EXTRA_PLMN); } mLogger.logUpdateFromStickyBroadcast(plmn, spn); if (DEBUG) Log.d(TAG, "Getting plmn/spn sticky brdcst " + plmn + "/" + spn); if (Objects.equals(plmn, spn)) { text = plmn; } else { Loading Loading @@ -411,7 +409,6 @@ public class CarrierTextManager { !allSimsMissing, subsIds, airplaneMode); mLogger.logCallbackSentFromUpdate(info); postToCallback(info); Trace.endSection(); } Loading Loading @@ -648,7 +645,6 @@ public class CarrierTextManager { private final Executor mMainExecutor; private final Executor mBgExecutor; private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; private final CarrierTextManagerLogger mLogger; private boolean mShowAirplaneMode; private boolean mShowMissingSim; Loading @@ -662,8 +658,7 @@ public class CarrierTextManager { WakefulnessLifecycle wakefulnessLifecycle, @Main Executor mainExecutor, @Background Executor bgExecutor, KeyguardUpdateMonitor keyguardUpdateMonitor, CarrierTextManagerLogger logger) { KeyguardUpdateMonitor keyguardUpdateMonitor) { mContext = context; mSeparator = resources.getString( com.android.internal.R.string.kg_text_message_separator); Loading @@ -674,7 +669,6 @@ public class CarrierTextManager { mMainExecutor = mainExecutor; mBgExecutor = bgExecutor; mKeyguardUpdateMonitor = keyguardUpdateMonitor; mLogger = logger; } /** */ Loading @@ -694,7 +688,7 @@ public class CarrierTextManager { return new CarrierTextManager( mContext, mSeparator, mShowAirplaneMode, mShowMissingSim, mWifiRepository, mTelephonyManager, mTelephonyListenerManager, mWakefulnessLifecycle, mMainExecutor, mBgExecutor, mKeyguardUpdateMonitor, mLogger); mMainExecutor, mBgExecutor, mKeyguardUpdateMonitor); } } /** Loading Loading @@ -722,17 +716,6 @@ public class CarrierTextManager { this.subscriptionIds = subscriptionIds; this.airplaneMode = airplaneMode; } @Override public String toString() { return "CarrierTextCallbackInfo{" + "carrierText=" + carrierText + ", listOfCarriers=" + Arrays.toString(listOfCarriers) + ", anySimReady=" + anySimReady + ", subscriptionIds=" + Arrays.toString(subscriptionIds) + ", airplaneMode=" + airplaneMode + '}'; } } /** Loading
packages/SystemUI/src/com/android/keyguard/logging/CarrierTextManagerLogger.ktdeleted 100644 → 0 +0 −135 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.keyguard.logging import androidx.annotation.IntDef import com.android.keyguard.CarrierTextManager.CarrierTextCallbackInfo import com.android.systemui.dagger.SysUISingleton import com.android.systemui.log.LogBuffer import com.android.systemui.log.LogLevel import com.android.systemui.log.dagger.CarrierTextManagerLog import javax.inject.Inject /** Logger adapter for [CarrierTextManager] to add detailed messages in a [LogBuffer] */ @SysUISingleton class CarrierTextManagerLogger @Inject constructor(@CarrierTextManagerLog val buffer: LogBuffer) { /** * This method and the methods below trace the execution of CarrierTextManager.updateCarrierText */ fun logUpdate(numSubs: Int) { buffer.log( TAG, LogLevel.VERBOSE, { int1 = numSubs }, { "updateCarrierText: numSubs=$int1" }, ) } fun logUpdateLoopStart(sub: Int, simState: Int, carrierName: String) { buffer.log( TAG, LogLevel.VERBOSE, { int1 = sub int2 = simState str1 = carrierName }, { "┣ updateCarrierText: updating sub=$int1 simState=$int2 carrierName=$str1" }, ) } fun logUpdateWfcCheck() { buffer.log( TAG, LogLevel.VERBOSE, {}, { "┣ updateCarrierText: found WFC state" }, ) } fun logUpdateFromStickyBroadcast(plmn: String, spn: String) { buffer.log( TAG, LogLevel.VERBOSE, { str1 = plmn str2 = spn }, { "┣ updateCarrierText: getting PLMN/SPN sticky brdcst. plmn=$str1, spn=$str1" }, ) } /** De-structures the info object so that we don't have to generate new strings */ fun logCallbackSentFromUpdate(info: CarrierTextCallbackInfo) { buffer.log( TAG, LogLevel.VERBOSE, { str1 = "${info.carrierText}" bool1 = info.anySimReady bool2 = info.airplaneMode }, { "┗ updateCarrierText: " + "result=(carrierText=$str1, anySimReady=$bool1, airplaneMode=$bool2)" }, ) } /** * Used to log the starting point for _why_ the carrier text is updating. In order to keep us * from holding on to too many objects, we'll just use simple ints for reasons here */ fun logUpdateCarrierTextForReason(@CarrierTextRefreshReason reason: Int) { buffer.log( TAG, LogLevel.DEBUG, { int1 = reason }, { "refreshing carrier info for reason: ${reason.reasonMessage()}" } ) } companion object { const val REASON_REFRESH_CARRIER_INFO = 1 const val REASON_ON_TELEPHONY_CAPABLE = 2 const val REASON_ON_SIM_STATE_CHANGED = 3 const val REASON_ACTIVE_DATA_SUB_CHANGED = 4 @Retention(AnnotationRetention.SOURCE) @IntDef( value = [ REASON_REFRESH_CARRIER_INFO, REASON_ON_TELEPHONY_CAPABLE, REASON_ON_SIM_STATE_CHANGED, REASON_ACTIVE_DATA_SUB_CHANGED, ] ) annotation class CarrierTextRefreshReason private fun @receiver:CarrierTextRefreshReason Int.reasonMessage() = when (this) { REASON_REFRESH_CARRIER_INFO -> "REFRESH_CARRIER_INFO" REASON_ON_TELEPHONY_CAPABLE -> "ON_TELEPHONY_CAPABLE" REASON_ON_SIM_STATE_CHANGED -> "SIM_STATE_CHANGED" REASON_ACTIVE_DATA_SUB_CHANGED -> "ACTIVE_DATA_SUB_CHANGED" else -> "unknown" } } } private const val TAG = "CarrierTextManagerLog"
packages/SystemUI/src/com/android/systemui/log/dagger/CarrierTextManagerLog.ktdeleted 100644 → 0 +0 −9 Original line number Diff line number Diff line package com.android.systemui.log.dagger import javax.inject.Qualifier /** A [LogBuffer] for detailed carrier text logs. */ @Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class CarrierTextManagerLog
packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java +0 −10 Original line number Diff line number Diff line Loading @@ -372,16 +372,6 @@ public class LogModule { return factory.create("KeyguardUpdateMonitorLog", 400); } /** * Provides a {@link LogBuffer} for use by {@link com.android.keyguard.KeyguardUpdateMonitor}. */ @Provides @SysUISingleton @CarrierTextManagerLog public static LogBuffer provideCarrierTextManagerLog(LogBufferFactory factory) { return factory.create("CarrierTextManagerLog", 100); } /** * Provides a {@link LogBuffer} for use by {@link com.android.systemui.ScreenDecorations}. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcher.kt +0 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import androidx.annotation.VisibleForTesting import com.android.settingslib.SignalIcon import com.android.settingslib.mobile.MobileMappings import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.demomode.DemoMode import com.android.systemui.demomode.DemoModeController Loading Loading @@ -63,7 +62,6 @@ import kotlinx.coroutines.flow.stateIn */ @Suppress("EXPERIMENTAL_IS_NOT_ENABLED") @OptIn(ExperimentalCoroutinesApi::class) @SysUISingleton class MobileRepositorySwitcher @Inject constructor( Loading