diff --git a/java/com/android/voicemail/impl/configui/ConfigOverrideFragment.java b/java/com/android/voicemail/impl/configui/ConfigOverrideFragment.java
index 6597593..263ae6a 100644
--- a/java/com/android/voicemail/impl/configui/ConfigOverrideFragment.java
+++ b/java/com/android/voicemail/impl/configui/ConfigOverrideFragment.java
@@ -54,10 +54,9 @@
   private static final String CONFIG_OVERRIDE_KEY_PREFIX = "vvm_config_override_key_";
 
   @Override
-  public void onCreate(@Nullable Bundle savedInstanceState) {
-    super.onCreate(savedInstanceState);
+  public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
     PreferenceManager.setDefaultValues(getActivity(), R.xml.vvm_config_override, false);
-    addPreferencesFromResource(R.xml.vvm_config_override);
+    setPreferencesFromResource(R.xml.vvm_config_override, rootKey);
 
     // add listener so the value of a EditTextPreference will be updated to the summary.
     for (int i = 0; i < getPreferenceScreen().getPreferenceCount(); i++) {
@@ -82,17 +81,6 @@
   }
 
   @Override
-  public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
-      setPreferencesFromResource(R.xml.vvm_config_override, rootKey);
-
-      for (int i = 0; i < getPreferenceScreen().getPreferenceCount(); i++) {
-        Preference preference = getPreferenceScreen().getPreference(i);
-        preference.setOnPreferenceChangeListener(this);
-        updatePreference(preference);
-      }
-  }
-
-  @Override
   public boolean onPreferenceTreeClick(Preference preference) {
       if (TextUtils.equals(
           preference.getKey(), getString(R.string.vvm_config_override_load_current_key))) {
diff --git a/java/com/android/voicemail/impl/configui/VoicemailSecretCodeActivity.java b/java/com/android/voicemail/impl/configui/VoicemailSecretCodeActivity.java
index d6b0c4b..aa7e263 100644
--- a/java/com/android/voicemail/impl/configui/VoicemailSecretCodeActivity.java
+++ b/java/com/android/voicemail/impl/configui/VoicemailSecretCodeActivity.java
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2017 The Android Open Source Project
- * Copyright (C) 2023 The LineageOS Project
+ * Copyright (C) 2024 The LineageOS Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,44 +17,21 @@
 
 package com.android.voicemail.impl.configui;
 
-import android.content.Intent;
-import android.preference.PreferenceActivity;
-import android.provider.VoicemailContract;
+import android.os.Bundle;
 
-import java.util.List;
+import androidx.appcompat.app.AppCompatActivity;
+import com.android.dialer.R;
 
 /** Activity launched by simulator->voicemail, provides debug features. */
 @SuppressWarnings("FragmentInjection") // not exported
-public class VoicemailSecretCodeActivity extends PreferenceActivity {
-
-  private Header syncHeader;
+public class VoicemailSecretCodeActivity extends AppCompatActivity {
 
   @Override
-  public void onBuildHeaders(List<Header> target) {
-    super.onBuildHeaders(target);
-    syncHeader = new Header();
-    syncHeader.title = "Sync";
-    target.add(syncHeader);
-
-    Header configOverride = new Header();
-    configOverride.fragment = ConfigOverrideFragment.class.getName();
-    configOverride.title = "VVM config override";
-    target.add(configOverride);
-  }
-
-  @Override
-  public void onHeaderClick(Header header, int position) {
-    if (header == syncHeader) {
-      Intent intent = new Intent(VoicemailContract.ACTION_SYNC_VOICEMAIL);
-      intent.setPackage(getPackageName());
-      sendBroadcast(intent);
-      return;
-    }
-    super.onHeaderClick(header, position);
-  }
-
-  @Override
-  protected boolean isValidFragment(String fragmentName) {
-    return true;
+  protected void onCreate(Bundle savedInstanceState) {
+    super.onCreate(savedInstanceState);
+    setTheme(R.style.SettingsStyle);
+    getSupportFragmentManager().beginTransaction()
+      .replace(android.R.id.content, new VoicemailSecretCodeFragment())
+      .commit();
   }
 }
diff --git a/java/com/android/voicemail/impl/configui/VoicemailSecretCodeFragment.java b/java/com/android/voicemail/impl/configui/VoicemailSecretCodeFragment.java
new file mode 100644
index 0000000..f34fe5a
--- /dev/null
+++ b/java/com/android/voicemail/impl/configui/VoicemailSecretCodeFragment.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2024 The LineageOS 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.voicemail.impl.configui;
+
+import android.os.Bundle;
+import android.text.TextUtils;
+
+import androidx.preference.Preference;
+import androidx.preference.Preference.OnPreferenceClickListener;
+import androidx.preference.PreferenceFragmentCompat;
+
+import android.content.Intent;
+import android.provider.VoicemailContract;
+
+public class VoicemailSecretCodeFragment extends PreferenceFragmentCompat
+    implements OnPreferenceClickListener {
+
+  private Preference syncPreference;
+  private Preference configOverridePreference;
+  private static final String SYNC_KEY = "sync_preference";
+  private static final String CONFIG_OVERRIDE_KEY =
+    "config_override_preference";
+
+  @Override
+  public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
+    setPreferencesFromResource(R.xml.vvm_secret_main, rootKey);
+
+    syncPreference = findPreference(SYNC_KEY);
+    syncPreference.setOnPreferenceClickListener(this);
+
+    configOverridePreference = findPreference(CONFIG_OVERRIDE_KEY);
+    configOverridePreference.setOnPreferenceClickListener(this);
+  }
+
+  @Override
+  public boolean onPreferenceClick(Preference preference) {
+    if (TextUtils.equals(preference.getKey(), SYNC_KEY)) {
+      Intent intent = new Intent(VoicemailContract.ACTION_SYNC_VOICEMAIL);
+      intent.setPackage(requireContext().getPackageName());
+      requireContext().sendBroadcast(intent);
+    } else {
+      getParentFragmentManager().beginTransaction()
+        .replace(android.R.id.content, new ConfigOverrideFragment())
+        .addToBackStack(null)
+        .commit();
+    }
+    return true;
+  }
+}
diff --git a/java/com/android/voicemail/impl/configui/res/values/strings.xml b/java/com/android/voicemail/impl/configui/res/values/strings.xml
index fea76be..6aa214e 100644
--- a/java/com/android/voicemail/impl/configui/res/values/strings.xml
+++ b/java/com/android/voicemail/impl/configui/res/values/strings.xml
@@ -17,5 +17,6 @@
 <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
   <string name="vvm_config_override_load_current_key" translatable="false">vvm_config_override_load_current</string>
   <string name="vvm_config_override_enabled_key" translatable="false">vvm_config_override_enabled</string>
-
+  <string name="sync_preference_title">Sync</string>
+  <string name="config_override_preference_title">VVM config override</string>
 </resources>
diff --git a/java/com/android/voicemail/impl/configui/res/xml/vvm_secret_main.xml b/java/com/android/voicemail/impl/configui/res/xml/vvm_secret_main.xml
new file mode 100644
index 0000000..969b22c
--- /dev/null
+++ b/java/com/android/voicemail/impl/configui/res/xml/vvm_secret_main.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+  <Preference
+    android:key="sync_preference"
+    android:title="@string/sync_preference_title" />
+  <Preference
+    android:key="config_override_preference"
+    android:title="@string/config_override_preference_title" />
+</PreferenceScreen>
