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

Commit d1104cbf authored by Yiling Chuang's avatar Yiling Chuang
Browse files

Remove wirless charging warning related methods.

Bug: 316239566
Test: robotests
Change-Id: Ic61c95b75ace45d7f38266af0c85cd59e2b310a0
parent 398b1a12
Loading
Loading
Loading
Loading
+0 −26
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@ import android.os.UserHandle;
import android.os.UserManager;
import android.print.PrintManager;
import android.provider.Settings;
import android.provider.Settings.Secure;
import android.telephony.AccessNetworkConstants;
import android.telephony.NetworkRegistrationInfo;
import android.telephony.ServiceState;
@@ -784,29 +783,4 @@ public class Utils {
        }
        return false;
    }

    /** Whether to show the wireless charging warning in Settings. */
    public static boolean shouldShowWirelessChargingWarningTip(
            @NonNull Context context, @NonNull String tag) {
        try {
            return Secure.getInt(context.getContentResolver(), WIRELESS_CHARGING_WARNING_ENABLED, 0)
                    == 1;
        } catch (Exception e) {
            Log.e(tag, "shouldShowWirelessChargingWarningTip()", e);
        }
        return false;
    }

    /** Stores the state of whether the wireless charging warning in Settings is enabled. */
    public static void updateWirelessChargingWarningEnabled(
            @NonNull Context context, boolean enabled, @NonNull String tag) {
        try {
            Secure.putInt(
                    context.getContentResolver(),
                    WIRELESS_CHARGING_WARNING_ENABLED,
                    enabled ? 1 : 0);
        } catch (Exception e) {
            Log.e(tag, "setWirelessChargingWarningEnabled()", e);
        }
    }
}
+0 −15
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@
package com.android.settingslib;

import static com.android.settingslib.Utils.STORAGE_MANAGER_ENABLED_PROPERTY;
import static com.android.settingslib.Utils.shouldShowWirelessChargingWarningTip;

import static com.google.common.truth.Truth.assertThat;

@@ -543,20 +542,6 @@ public class UtilsTest {
        assertThat(Utils.containsIncompatibleChargers(mContext, TAG)).isFalse();
    }

    @Test
    public void shouldShowWirelessChargingWarningTip_enabled_returnTrue() {
        Utils.updateWirelessChargingWarningEnabled(mContext, true, TAG);

        assertThat(shouldShowWirelessChargingWarningTip(mContext, TAG)).isTrue();
    }

    @Test
    public void shouldShowWirelessChargingWarningTip_disabled_returnFalse() {
        Utils.updateWirelessChargingWarningEnabled(mContext, false, TAG);

        assertThat(shouldShowWirelessChargingWarningTip(mContext, TAG)).isFalse();
    }

    private void setupIncompatibleCharging() {
        setupIncompatibleCharging(UsbPortStatus.COMPLIANCE_WARNING_DEBUG_ACCESSORY);
    }