From 547cdbe3fafe8f88ee5a09cc53581433765fe57e Mon Sep 17 00:00:00 2001 From: Chaohui Wang Date: Tue, 22 Nov 2022 17:36:05 +0800 Subject: [PATCH] Fix duplicated SettingsEnums.TRUSTED_CREDENTIALS The target page have nested fragments, remove the enum from inner fragment to fix this issue. Fix: 260055184 Test: Manually with Settings Change-Id: Iee51df18ab6810147857703678482a62f34228fe --- .../android/settings/TrustedCredentialsFragment.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/com/android/settings/TrustedCredentialsFragment.java b/src/com/android/settings/TrustedCredentialsFragment.java index ca565a46c1e..c90a44d17a9 100644 --- a/src/com/android/settings/TrustedCredentialsFragment.java +++ b/src/com/android/settings/TrustedCredentialsFragment.java @@ -25,7 +25,6 @@ import android.annotation.UiThread; import android.app.Activity; import android.app.KeyguardManager; import android.app.admin.DevicePolicyManager; -import android.app.settings.SettingsEnums; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -68,7 +67,7 @@ import com.android.internal.annotations.GuardedBy; import com.android.internal.app.UnlaunchableAppActivity; import com.android.internal.widget.LockPatternUtils; import com.android.settings.TrustedCredentialsSettings.Tab; -import com.android.settings.core.InstrumentedFragment; +import com.android.settingslib.core.lifecycle.ObservableFragment; import java.security.cert.CertificateEncodingException; import java.security.cert.X509Certificate; @@ -81,7 +80,7 @@ import java.util.function.IntConsumer; /** * Fragment to display trusted credentials settings for one tab. */ -public class TrustedCredentialsFragment extends InstrumentedFragment +public class TrustedCredentialsFragment extends ObservableFragment implements TrustedCredentialsDialogBuilder.DelegateInterface { public static final String ARG_POSITION = "tab"; @@ -176,11 +175,6 @@ public class TrustedCredentialsFragment extends InstrumentedFragment return mFragmentView; } - @Override - public int getMetricsCategory() { - return SettingsEnums.TRUSTED_CREDENTIALS; - } - private void createChildView( LayoutInflater inflater, ViewGroup parent, Bundle childState, int i) { boolean isWork = mGroupAdapter.getUserInfoByGroup(i).isManagedProfile();