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

Commit f891f7ba authored by Hugh Chen's avatar Hugh Chen Committed by Robert Luo
Browse files

RESTRICT AUTOMERGE Refactoring settings UI

Bug: 248174653
Test: build & boot pass
Change-Id: I124a65941349d3338145865cae2c8354678897fa
parent d1dd1622
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -625,9 +625,6 @@
    <!-- The extra value for battery tip -->
    <integer name="config_battery_extra_tip_value">12</integer>

    <!-- Whether to enable the advanced vpn feature. The default is not to. -->
    <bool name="config_advanced_vpn_enabled">false</bool>

    <!-- An array of uid name for which packages exempt from Wi-Fi permission check. -->
    <string-array name="config_exempt_wifi_permission_uid_name" translatable="false">
        <item>@string/config_settingsintelligence_package_name</item>
+0 −5
Original line number Diff line number Diff line
@@ -16,9 +16,4 @@

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
        android:title="@string/vpn_title">
    <PreferenceCategory
        android:key="advanced_vpn_group"/>

    <PreferenceCategory
        android:key="vpn_group"/>
</PreferenceScreen>
+0 −6
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ import com.android.settings.security.SecurityFeatureProvider;
import com.android.settings.security.SecuritySettingsFeatureProvider;
import com.android.settings.slices.SlicesFeatureProvider;
import com.android.settings.users.UserFeatureProvider;
import com.android.settings.vpn2.AdvancedVpnFeatureProvider;
import com.android.settings.wifi.WifiTrackerLibProvider;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;

@@ -178,11 +177,6 @@ public abstract class FeatureFactory {
     */
    public abstract AccessibilityMetricsFeatureProvider getAccessibilityMetricsFeatureProvider();

    /**
     * Retrieves implementation for advanced vpn feature.
     */
    public abstract AdvancedVpnFeatureProvider getAdvancedVpnFeatureProvider();

    public static final class FactoryNotFoundException extends RuntimeException {
        public FactoryNotFoundException(Throwable throwable) {
            super("Unable to create factory. Did you misconfigure Proguard?", throwable);
+0 −11
Original line number Diff line number Diff line
@@ -71,8 +71,6 @@ import com.android.settings.slices.SlicesFeatureProvider;
import com.android.settings.slices.SlicesFeatureProviderImpl;
import com.android.settings.users.UserFeatureProvider;
import com.android.settings.users.UserFeatureProviderImpl;
import com.android.settings.vpn2.AdvancedVpnFeatureProvider;
import com.android.settings.vpn2.AdvancedVpnFeatureProviderImpl;
import com.android.settings.wifi.WifiTrackerLibProvider;
import com.android.settings.wifi.WifiTrackerLibProviderImpl;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
@@ -108,7 +106,6 @@ public class FeatureFactoryImpl extends FeatureFactory {
    private SecuritySettingsFeatureProvider mSecuritySettingsFeatureProvider;
    private AccessibilitySearchFeatureProvider mAccessibilitySearchFeatureProvider;
    private AccessibilityMetricsFeatureProvider mAccessibilityMetricsFeatureProvider;
    private AdvancedVpnFeatureProvider mAdvancedVpnFeatureProvider;

    @Override
    public SupportFeatureProvider getSupportFeatureProvider(Context context) {
@@ -337,12 +334,4 @@ public class FeatureFactoryImpl extends FeatureFactory {
        }
        return mAccessibilityMetricsFeatureProvider;
    }

    @Override
    public AdvancedVpnFeatureProvider getAdvancedVpnFeatureProvider() {
        if (mAdvancedVpnFeatureProvider == null) {
            mAdvancedVpnFeatureProvider = new AdvancedVpnFeatureProviderImpl();
        }
        return mAdvancedVpnFeatureProvider;
    }
}
+0 −55
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 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.settings.vpn2;

import android.content.Context;

/**
 * Feature Provider used in vpn usage
 */
public interface AdvancedVpnFeatureProvider {

    /**
     * Returns package name of advanced vpn.
     */
    String getAdvancedVpnPackageName();

    /**
     * Returns {@code true} advanced vpn is supported.
     */
    boolean isAdvancedVpnSupported(Context context);

    /**
     * Returns the title of advanced vpn preference group.
     */
    String getAdvancedVpnPreferenceGroupTitle(Context context);

    /**
     * Returns the title of vpn preference group.
     */
    String getVpnPreferenceGroupTitle(Context context);

    /**
     * Returns {@code true} advanced vpn is removable.
     */
    boolean isAdvancedVpnRemovable();

    /**
     * Returns {@code true} if the disconnect dialog is enabled when advanced vpn is connected.
     */
    boolean isDisconnectDialogEnabled();
}
Loading