Fixes ApnEditor not restoring previous UI

ApnEditor tries read and set the UI in onCreate, before the previous bundle
is restored. This caused problems when the configuration has changed (such
as switching to Dark Theme).

This moves the UI changes to onViewRestored

Fixes: 146399432
Test: make SettingsGoogle and manual test UI
Change-Id: I8147ec96569fa28867c088d6c36584aa344f40ed
diff --git a/src/com/android/settings/network/ApnEditor.java b/src/com/android/settings/network/ApnEditor.java
index 091e7f5..6de2550 100644
--- a/src/com/android/settings/network/ApnEditor.java
+++ b/src/com/android/settings/network/ApnEditor.java
@@ -39,6 +39,7 @@
 import android.view.View;
 import android.view.View.OnKeyListener;
 
+import androidx.annotation.Nullable;
 import androidx.annotation.VisibleForTesting;
 import androidx.appcompat.app.AlertDialog;
 import androidx.preference.EditTextPreference;
@@ -388,8 +389,12 @@
         for (int i = 0; i < getPreferenceScreen().getPreferenceCount(); i++) {
             getPreferenceScreen().getPreference(i).setOnPreferenceChangeListener(this);
         }
+    }
 
-        fillUI(icicle == null);
+    @Override
+    public void onViewStateRestored(@Nullable Bundle savedInstanceState) {
+        super.onViewStateRestored(savedInstanceState);
+        fillUI(savedInstanceState == null);
     }
 
     @VisibleForTesting