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

Commit cc51fe28 authored by rambowang's avatar rambowang
Browse files

Clean up aconfig flag hide_preinstalled_carrier_app_at_most_once

Flag hide_preinstalled_carrier_app_at_most_once has been advanced to
next for a while and there is no regression observed. It's time to clean
it up to keep code healthy.

Bug: 158028151
Test: atest CarrierAppUtilsTest
Flag: EXEMPT flag clean up only
Change-Id: I28d55816eb263ca17cdbb00b5d7a13a42400d4ae
parent cf3cd4f6
Loading
Loading
Loading
Loading
+11 −16
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ import android.util.ArrayMap;
import android.util.Log;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.flags.Flags;
import com.android.internal.telephony.util.TelephonyUtils;

import java.util.ArrayList;
@@ -253,11 +252,8 @@ public final class CarrierAppUtils {
                    // 3. It has not been installed as an update from its system built-in version
                    // 4. It is in default state (not explicitly DISABLED/DISABLED_BY_USER/ENABLED)
                    // 5. It is currently installed for the calling user
                    // TODO(b/329739019):
                    // 1. Merge the nested if conditions below during flag cleaning up phase
                    // 2. Support user case that NEW carrier app is added during OTA, when emerge.
                    if (!Flags.hidePreinstalledCarrierAppAtMostOnce() || !hasRunEver) {
                        if (!isUpdatedSystemApp(ai) && enabledSetting
                    // TODO(b/329739019):Support user case that NEW carrier app is added during OTA
                    if (!hasRunEver && !isUpdatedSystemApp(ai) && enabledSetting
                            == PackageManager.COMPONENT_ENABLED_STATE_DEFAULT
                            && (ai.flags & ApplicationInfo.FLAG_INSTALLED) != 0) {
                        Log.i(TAG, "Update state (" + packageName
@@ -268,7 +264,6 @@ public final class CarrierAppUtils {
                                        packageName,
                                        PackageManager.SYSTEM_APP_STATE_UNINSTALLED);
                    }
                    }

                    // Associated apps are more brittle, because we can't rely on the distinction
                    // between "default" and "enabled". To account for this, we have two cases: