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

Commit ec8c4df8 authored by Hunsuk Choi's avatar Hunsuk Choi Committed by Android (Google) Code Review
Browse files

Merge "Allow to disable domain selection service manually" into main

parents 26b7b332 03dec7b9
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Nullable;
import android.content.ComponentName;
import android.content.ComponentName;
import android.content.Context;
import android.content.Context;
import android.os.SystemProperties;
import android.telephony.DomainSelectionService;
import android.telephony.DomainSelectionService;
import android.text.TextUtils;
import android.text.TextUtils;
import android.util.IndentingPrintWriter;
import android.util.IndentingPrintWriter;
@@ -34,6 +35,7 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.flags.Flags;
import com.android.internal.telephony.flags.Flags;
import com.android.internal.telephony.util.TelephonyUtils;


import java.io.FileDescriptor;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.io.PrintWriter;
@@ -48,6 +50,10 @@ public class DomainSelectionResolver {
    @VisibleForTesting
    @VisibleForTesting
    protected static final String PACKAGE_NAME_NONE = "none";
    protected static final String PACKAGE_NAME_NONE = "none";
    private static final String TAG = DomainSelectionResolver.class.getSimpleName();
    private static final String TAG = DomainSelectionResolver.class.getSimpleName();
    private static final boolean DBG = TelephonyUtils.IS_DEBUGGABLE;
    /** For test purpose only with userdebug release */
    private static final String PROP_DISABLE_DOMAIN_SELECTION =
            "telephony.test.disable_domain_selection";
    private static DomainSelectionResolver sInstance = null;
    private static DomainSelectionResolver sInstance = null;


    /**
    /**
@@ -132,6 +138,10 @@ public class DomainSelectionResolver {
     *         {@code false} otherwise.
     *         {@code false} otherwise.
     */
     */
    public boolean isDomainSelectionSupported() {
    public boolean isDomainSelectionSupported() {
        if (DBG && SystemProperties.getBoolean(PROP_DISABLE_DOMAIN_SELECTION, false)) {
            logi("Disabled for test");
            return false;
        }
        return mDefaultComponentName != null && PhoneFactory.getDefaultPhone()
        return mDefaultComponentName != null && PhoneFactory.getDefaultPhone()
                .getHalVersion(HAL_SERVICE_NETWORK).greaterOrEqual(RADIO_HAL_VERSION_2_1);
                .getHalVersion(HAL_SERVICE_NETWORK).greaterOrEqual(RADIO_HAL_VERSION_2_1);
    }
    }