Merge "Fix errorprone warnings that should be errors" am: 5744d7c560 am: 7094507528 am: 778ef161bb

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2255054

Change-Id: I1f3cbce7d5de6e63477bc2da2ad115ec53b06472
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/src/com/android/settings/TrustedCredentialsDialogBuilder.java b/src/com/android/settings/TrustedCredentialsDialogBuilder.java
index 0dc8c25..363560e 100644
--- a/src/com/android/settings/TrustedCredentialsDialogBuilder.java
+++ b/src/com/android/settings/TrustedCredentialsDialogBuilder.java
@@ -171,8 +171,8 @@
             } else {
                 new AlertDialog.Builder(mActivity)
                         .setMessage(R.string.trusted_credentials_remove_confirmation)
-                        .setPositiveButton(android.R.string.yes, onConfirm)
-                        .setNegativeButton(android.R.string.no, null)
+                        .setPositiveButton(android.R.string.ok, onConfirm)
+                        .setNegativeButton(android.R.string.cancel, null)
                         .show();
 
             }
diff --git a/src/com/android/settings/accounts/AccountDashboardFragment.java b/src/com/android/settings/accounts/AccountDashboardFragment.java
index 5456f0a..3e83d6f 100644
--- a/src/com/android/settings/accounts/AccountDashboardFragment.java
+++ b/src/com/android/settings/accounts/AccountDashboardFragment.java
@@ -122,6 +122,7 @@
                     return controllers;
                 }
 
+                @SuppressWarnings("MissingSuperCall") // TODO: Fix me
                 @Override
                 public List<SearchIndexableRaw> getDynamicRawDataToIndex(Context context,
                         boolean enabled) {
diff --git a/src/com/android/settings/applications/intentpicker/SupportedLinkWrapper.java b/src/com/android/settings/applications/intentpicker/SupportedLinkWrapper.java
index 0db4361..f8f9a71 100644
--- a/src/com/android/settings/applications/intentpicker/SupportedLinkWrapper.java
+++ b/src/com/android/settings/applications/intentpicker/SupportedLinkWrapper.java
@@ -31,7 +31,7 @@
  *  A buffer of the supported link data. This {@link SupportedLinkWrapper} wraps the host, enabled
  *  and a list of {@link DomainOwner}.
  */
-public class SupportedLinkWrapper implements Comparable {
+public class SupportedLinkWrapper implements Comparable<SupportedLinkWrapper> {
     private static final String TAG = "SupportedLinkWrapper";
 
     private String mHost;
@@ -112,8 +112,7 @@
     }
 
     @Override
-    public int compareTo(Object o) {
-        final SupportedLinkWrapper that = (SupportedLinkWrapper) o;
+    public int compareTo(SupportedLinkWrapper that) {
         if (this.mIsEnabled != that.mIsEnabled) {
             return this.mIsEnabled ? -1 : 1;
         }
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java
index 9598019..9b5f549 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java
@@ -1038,6 +1038,7 @@
         }
     }
 
+    @SuppressWarnings("MissingSuperCall") // TODO: Fix me
     @Override
     public void onConfigurationChanged(@NonNull Configuration newConfig) {
         switch(newConfig.orientation) {
diff --git a/src/com/android/settings/development/DisableLogPersistWarningDialog.java b/src/com/android/settings/development/DisableLogPersistWarningDialog.java
index 76035cc..4514b1b 100644
--- a/src/com/android/settings/development/DisableLogPersistWarningDialog.java
+++ b/src/com/android/settings/development/DisableLogPersistWarningDialog.java
@@ -57,8 +57,8 @@
         return new AlertDialog.Builder(getActivity())
                 .setTitle(R.string.dev_logpersist_clear_warning_title)
                 .setMessage(R.string.dev_logpersist_clear_warning_message)
-                .setPositiveButton(android.R.string.yes, this /* onClickListener */)
-                .setNegativeButton(android.R.string.no, this /* onClickListener */)
+                .setPositiveButton(android.R.string.ok, this /* onClickListener */)
+                .setNegativeButton(android.R.string.cancel, this /* onClickListener */)
                 .create();
     }
 
diff --git a/src/com/android/settings/development/EnableAdbWarningDialog.java b/src/com/android/settings/development/EnableAdbWarningDialog.java
index 1fcd350..5204130 100644
--- a/src/com/android/settings/development/EnableAdbWarningDialog.java
+++ b/src/com/android/settings/development/EnableAdbWarningDialog.java
@@ -52,8 +52,8 @@
         return new AlertDialog.Builder(getActivity())
                 .setTitle(R.string.adb_warning_title)
                 .setMessage(R.string.adb_warning_message)
-                .setPositiveButton(android.R.string.yes, this /* onClickListener */)
-                .setNegativeButton(android.R.string.no, this /* onClickListener */)
+                .setPositiveButton(android.R.string.ok, this /* onClickListener */)
+                .setNegativeButton(android.R.string.cancel, this /* onClickListener */)
                 .create();
     }
 
diff --git a/src/com/android/settings/development/EnableDevelopmentSettingWarningDialog.java b/src/com/android/settings/development/EnableDevelopmentSettingWarningDialog.java
index 983f55e..6b84cdc 100644
--- a/src/com/android/settings/development/EnableDevelopmentSettingWarningDialog.java
+++ b/src/com/android/settings/development/EnableDevelopmentSettingWarningDialog.java
@@ -53,8 +53,8 @@
         return new AlertDialog.Builder(getActivity())
                 .setMessage(R.string.dev_settings_warning_message)
                 .setTitle(R.string.dev_settings_warning_title)
-                .setPositiveButton(android.R.string.yes, this)
-                .setNegativeButton(android.R.string.no, this)
+                .setPositiveButton(android.R.string.ok, this)
+                .setNegativeButton(android.R.string.cancel, this)
                 .create();
     }
 
diff --git a/src/com/android/settings/homepage/contextualcards/ContextualCardLookupTable.java b/src/com/android/settings/homepage/contextualcards/ContextualCardLookupTable.java
index 4a02d91..a74204a 100644
--- a/src/com/android/settings/homepage/contextualcards/ContextualCardLookupTable.java
+++ b/src/com/android/settings/homepage/contextualcards/ContextualCardLookupTable.java
@@ -34,7 +34,6 @@
 import java.util.Comparator;
 import java.util.List;
 import java.util.Set;
-import java.util.TreeSet;
 import java.util.stream.Collectors;
 
 public class ContextualCardLookupTable {
@@ -65,41 +64,39 @@
     }
 
     @VisibleForTesting
-    static final Set<ControllerRendererMapping> LOOKUP_TABLE =
-            new TreeSet<ControllerRendererMapping>() {{
-                add(new ControllerRendererMapping(CardType.CONDITIONAL,
-                        ConditionContextualCardRenderer.VIEW_TYPE_HALF_WIDTH,
-                        ConditionContextualCardController.class,
-                        ConditionContextualCardRenderer.class));
-                add(new ControllerRendererMapping(CardType.CONDITIONAL,
-                        ConditionContextualCardRenderer.VIEW_TYPE_FULL_WIDTH,
-                        ConditionContextualCardController.class,
-                        ConditionContextualCardRenderer.class));
-                add(new ControllerRendererMapping(CardType.LEGACY_SUGGESTION,
-                        LegacySuggestionContextualCardRenderer.VIEW_TYPE,
-                        LegacySuggestionContextualCardController.class,
-                        LegacySuggestionContextualCardRenderer.class));
-                add(new ControllerRendererMapping(CardType.SLICE,
-                        SliceContextualCardRenderer.VIEW_TYPE_FULL_WIDTH,
-                        SliceContextualCardController.class,
-                        SliceContextualCardRenderer.class));
-                add(new ControllerRendererMapping(CardType.SLICE,
-                        SliceContextualCardRenderer.VIEW_TYPE_HALF_WIDTH,
-                        SliceContextualCardController.class,
-                        SliceContextualCardRenderer.class));
-                add(new ControllerRendererMapping(CardType.SLICE,
-                        SliceContextualCardRenderer.VIEW_TYPE_STICKY,
-                        SliceContextualCardController.class,
-                        SliceContextualCardRenderer.class));
-                add(new ControllerRendererMapping(CardType.CONDITIONAL_FOOTER,
-                        ConditionFooterContextualCardRenderer.VIEW_TYPE,
-                        ConditionContextualCardController.class,
-                        ConditionFooterContextualCardRenderer.class));
-                add(new ControllerRendererMapping(CardType.CONDITIONAL_HEADER,
-                        ConditionHeaderContextualCardRenderer.VIEW_TYPE,
-                        ConditionContextualCardController.class,
-                        ConditionHeaderContextualCardRenderer.class));
-            }};
+    static final Set<ControllerRendererMapping> LOOKUP_TABLE = Set.of(
+            new ControllerRendererMapping(CardType.CONDITIONAL,
+                    ConditionContextualCardRenderer.VIEW_TYPE_HALF_WIDTH,
+                    ConditionContextualCardController.class,
+                    ConditionContextualCardRenderer.class),
+            new ControllerRendererMapping(CardType.CONDITIONAL,
+                    ConditionContextualCardRenderer.VIEW_TYPE_FULL_WIDTH,
+                    ConditionContextualCardController.class,
+                    ConditionContextualCardRenderer.class),
+            new ControllerRendererMapping(CardType.LEGACY_SUGGESTION,
+                    LegacySuggestionContextualCardRenderer.VIEW_TYPE,
+                    LegacySuggestionContextualCardController.class,
+                    LegacySuggestionContextualCardRenderer.class),
+            new ControllerRendererMapping(CardType.SLICE,
+                    SliceContextualCardRenderer.VIEW_TYPE_FULL_WIDTH,
+                    SliceContextualCardController.class,
+                    SliceContextualCardRenderer.class),
+            new ControllerRendererMapping(CardType.SLICE,
+                    SliceContextualCardRenderer.VIEW_TYPE_HALF_WIDTH,
+                    SliceContextualCardController.class,
+                    SliceContextualCardRenderer.class),
+            new ControllerRendererMapping(CardType.SLICE,
+                    SliceContextualCardRenderer.VIEW_TYPE_STICKY,
+                    SliceContextualCardController.class,
+                    SliceContextualCardRenderer.class),
+            new ControllerRendererMapping(CardType.CONDITIONAL_FOOTER,
+                    ConditionFooterContextualCardRenderer.VIEW_TYPE,
+                    ConditionContextualCardController.class,
+                    ConditionFooterContextualCardRenderer.class),
+            new ControllerRendererMapping(CardType.CONDITIONAL_HEADER,
+                    ConditionHeaderContextualCardRenderer.VIEW_TYPE,
+                    ConditionContextualCardController.class,
+                    ConditionHeaderContextualCardRenderer.class));
 
     public static Class<? extends ContextualCardController> getCardControllerClass(
             @CardType int cardType) {
diff --git a/src/com/android/settings/homepage/contextualcards/ContextualCardManager.java b/src/com/android/settings/homepage/contextualcards/ContextualCardManager.java
index ac35017..f5d0e66 100644
--- a/src/com/android/settings/homepage/contextualcards/ContextualCardManager.java
+++ b/src/com/android/settings/homepage/contextualcards/ContextualCardManager.java
@@ -55,7 +55,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.TreeSet;
 import java.util.stream.Collectors;
 
 /**
@@ -196,11 +195,10 @@
         // except Conditional cards, all other cards are from the database. So when the map sent
         // here is empty, we only keep Conditional cards.
         if (cardTypes.isEmpty()) {
-            final Set<Integer> conditionalCardTypes = new TreeSet<Integer>() {{
-                add(ContextualCard.CardType.CONDITIONAL);
-                add(ContextualCard.CardType.CONDITIONAL_HEADER);
-                add(ContextualCard.CardType.CONDITIONAL_FOOTER);
-            }};
+            final Set<Integer> conditionalCardTypes = Set.of(
+                    ContextualCard.CardType.CONDITIONAL,
+                    ContextualCard.CardType.CONDITIONAL_HEADER,
+                    ContextualCard.CardType.CONDITIONAL_FOOTER);
             cardsToKeep = mContextualCards.stream()
                     .filter(card -> conditionalCardTypes.contains(card.getCardType()))
                     .collect(Collectors.toList());
diff --git a/src/com/android/settings/localepicker/LocaleListEditor.java b/src/com/android/settings/localepicker/LocaleListEditor.java
index eac2dd1..5947a87 100644
--- a/src/com/android/settings/localepicker/LocaleListEditor.java
+++ b/src/com/android/settings/localepicker/LocaleListEditor.java
@@ -202,7 +202,7 @@
             new AlertDialog.Builder(getActivity())
                     .setTitle(R.string.dlg_remove_locales_error_title)
                     .setMessage(R.string.dlg_remove_locales_error_message)
-                    .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
+                    .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                         @Override
                         public void onClick(DialogInterface dialog, int which) {
                         }
@@ -228,7 +228,7 @@
         }
 
         builder.setTitle(title)
-                .setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
+                .setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
                     @Override
                     public void onClick(DialogInterface dialog, int which) {
                         setRemoveMode(false);
diff --git a/src/com/android/settings/network/TetherProvisioningCarrierDialogActivity.java b/src/com/android/settings/network/TetherProvisioningCarrierDialogActivity.java
index 2506229..a8b02ac 100644
--- a/src/com/android/settings/network/TetherProvisioningCarrierDialogActivity.java
+++ b/src/com/android/settings/network/TetherProvisioningCarrierDialogActivity.java
@@ -35,7 +35,7 @@
                 .setTitle(R.string.wifi_tether_carrier_unsupport_dialog_title)
                 .setMessage(R.string.wifi_tether_carrier_unsupport_dialog_content)
                 .setCancelable(false)
-                .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
+                .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                     public void onClick(DialogInterface dialog, int which) {
                         dialog.cancel();
                         finish();
diff --git a/src/com/android/settings/network/apn/ApnEditor.java b/src/com/android/settings/network/apn/ApnEditor.java
index bfb4943..25d8e84 100644
--- a/src/com/android/settings/network/apn/ApnEditor.java
+++ b/src/com/android/settings/network/apn/ApnEditor.java
@@ -580,7 +580,7 @@
                 // Network code
                 final String mnc = (subInfo == null) ? null : subInfo.getMncString();
 
-                if ((!TextUtils.isEmpty(mcc)) && (!TextUtils.isEmpty(mcc))) {
+                if (!TextUtils.isEmpty(mcc)) {
                     // Auto populate MNC and MCC for new entries, based on what SIM reports
                     mMcc.setText(mcc);
                     mMnc.setText(mnc);
diff --git a/src/com/android/settings/network/telephony/RoamingDialogFragment.java b/src/com/android/settings/network/telephony/RoamingDialogFragment.java
index 3e9875e..5b57992 100644
--- a/src/com/android/settings/network/telephony/RoamingDialogFragment.java
+++ b/src/com/android/settings/network/telephony/RoamingDialogFragment.java
@@ -70,8 +70,8 @@
         builder.setMessage(getResources().getString(message))
                 .setTitle(title)
                 .setIconAttribute(android.R.attr.alertDialogIcon)
-                .setPositiveButton(android.R.string.yes, this)
-                .setNegativeButton(android.R.string.no, this);
+                .setPositiveButton(android.R.string.ok, this)
+                .setNegativeButton(android.R.string.cancel, this);
         AlertDialog dialog = builder.create();
         dialog.setCanceledOnTouchOutside(false);
         return dialog;
diff --git a/src/com/android/settings/notification/SoundWorkSettingsController.java b/src/com/android/settings/notification/SoundWorkSettingsController.java
index c14a7fe..10a3483 100644
--- a/src/com/android/settings/notification/SoundWorkSettingsController.java
+++ b/src/com/android/settings/notification/SoundWorkSettingsController.java
@@ -363,7 +363,7 @@
                             () -> context.getString(R.string.work_sync_dialog_message)))
                     .setPositiveButton(R.string.work_sync_dialog_yes,
                             SoundWorkSettingsController.UnifyWorkDialogFragment.this)
-                    .setNegativeButton(android.R.string.no, /* listener= */ null)
+                    .setNegativeButton(android.R.string.cancel, /* listener= */ null)
                     .create();
         }
 
diff --git a/src/com/android/settings/vpn2/AppVpnInfo.java b/src/com/android/settings/vpn2/AppVpnInfo.java
index 079f8d5..f225470 100644
--- a/src/com/android/settings/vpn2/AppVpnInfo.java
+++ b/src/com/android/settings/vpn2/AppVpnInfo.java
@@ -10,7 +10,7 @@
  * Holds packageName:userId pairs without any heavyweight fields.
  * {@see ApplicationInfo}
  */
-class AppVpnInfo implements Comparable {
+class AppVpnInfo implements Comparable<AppVpnInfo> {
     public final int userId;
     public final String packageName;
 
@@ -20,12 +20,10 @@
     }
 
     @Override
-    public int compareTo(Object other) {
-        AppVpnInfo that = (AppVpnInfo) other;
-
-        int result = packageName.compareTo(that.packageName);
+    public int compareTo(AppVpnInfo other) {
+        int result = packageName.compareTo(other.packageName);
         if (result == 0) {
-            result = that.userId - userId;
+            result = other.userId - userId;
         }
         return result;
     }
diff --git a/src/com/android/settings/wifi/WifiDialog.java b/src/com/android/settings/wifi/WifiDialog.java
index 9d0ab47..a1ff1ac 100644
--- a/src/com/android/settings/wifi/WifiDialog.java
+++ b/src/com/android/settings/wifi/WifiDialog.java
@@ -117,6 +117,7 @@
         }
     }
 
+    @SuppressWarnings("MissingSuperCall") // TODO: Fix me
     @Override
     protected void onStart() {
         final ImageButton ssidScannerButton = findViewById(R.id.ssid_scanner_button);
diff --git a/src/com/android/settings/wifi/WifiDialog2.java b/src/com/android/settings/wifi/WifiDialog2.java
index 05dad3f..26951d1 100644
--- a/src/com/android/settings/wifi/WifiDialog2.java
+++ b/src/com/android/settings/wifi/WifiDialog2.java
@@ -137,6 +137,7 @@
         window.setAttributes(lp);
     }
 
+    @SuppressWarnings("MissingSuperCall") // TODO: Fix me
     @Override
     protected void onStart() {
         final ImageButton ssidScannerButton = findViewById(R.id.ssid_scanner_button);
diff --git a/tests/robotests/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragmentTest.java
index 25548f8..a596d93 100644
--- a/tests/robotests/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragmentTest.java
@@ -398,6 +398,7 @@
             // do nothing
         }
 
+        @SuppressWarnings("MissingSuperCall")
         @Override
         public void onDestroyView() {
             // do nothing
diff --git a/tests/robotests/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragmentTest.java
index 4e74048..4bb5935 100644
--- a/tests/robotests/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragmentTest.java
@@ -489,6 +489,7 @@
             // do nothing
         }
 
+        @SuppressWarnings("MissingSuperCall")
         @Override
         public void onDestroyView() {
             // do nothing
diff --git a/tests/robotests/src/com/android/settings/applications/manageapplications/AppFilterItemTest.java b/tests/robotests/src/com/android/settings/applications/manageapplications/AppFilterItemTest.java
index 0ef94ec..36c0ab8 100644
--- a/tests/robotests/src/com/android/settings/applications/manageapplications/AppFilterItemTest.java
+++ b/tests/robotests/src/com/android/settings/applications/manageapplications/AppFilterItemTest.java
@@ -50,6 +50,7 @@
         assertThat(item).isEqualTo(item2);
     }
 
+    @SuppressWarnings("SelfComparison")
     @Test
     public void compare_sameContent_return0() {
         final AppFilterItem item = AppFilterRegistry.getInstance().get(FILTER_APPS_USAGE_ACCESS);
diff --git a/tests/robotests/src/com/android/settings/development/bluetooth/BluetoothSampleRateDialogPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/bluetooth/BluetoothSampleRateDialogPreferenceControllerTest.java
index fa4a79c..b37a212 100644
--- a/tests/robotests/src/com/android/settings/development/bluetooth/BluetoothSampleRateDialogPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/bluetooth/BluetoothSampleRateDialogPreferenceControllerTest.java
@@ -141,10 +141,9 @@
 
     @Test
     public void getSelectableIndex_verifyList() {
-        List<BluetoothCodecConfig> mCodecConfigs = new ArrayList() {{
-                    add(mCodecConfigAAC);
-                    add(mCodecConfigSBC);
-                }};
+        List<BluetoothCodecConfig> mCodecConfigs = List.of(
+                mCodecConfigAAC,
+                mCodecConfigSBC);
         mCodecStatus = new BluetoothCodecStatus.Builder()
                 .setCodecConfig(mCodecConfigAAC)
                 .setCodecsSelectableCapabilities(mCodecConfigs)
diff --git a/tests/robotests/src/com/android/settings/password/ConfirmCredentialTest.java b/tests/robotests/src/com/android/settings/password/ConfirmCredentialTest.java
index cef43dd..e210c5f 100644
--- a/tests/robotests/src/com/android/settings/password/ConfirmCredentialTest.java
+++ b/tests/robotests/src/com/android/settings/password/ConfirmCredentialTest.java
@@ -43,16 +43,16 @@
 
         // Launch only one instance at a time.
         assertThat(LastTryDialog.show(
-                fm, "title", mContext.getString(android.R.string.yes),
+                fm, "title", mContext.getString(android.R.string.ok),
                 android.R.string.ok, false)).isTrue();
         assertThat(LastTryDialog.show(
-                fm, "title", mContext.getString(android.R.string.yes),
+                fm, "title", mContext.getString(android.R.string.ok),
                 android.R.string.ok, false)).isFalse();
 
         // After cancelling, the dialog should be re-shown when asked for.
         LastTryDialog.hide(fm);
         assertThat(LastTryDialog.show(
-                fm, "title", mContext.getString(android.R.string.yes),
+                fm, "title", mContext.getString(android.R.string.ok),
                 android.R.string.ok, false)).isTrue();
     }
 }
diff --git a/tests/uitests/src/com/android/settings/ui/SoundSettingsTest.java b/tests/uitests/src/com/android/settings/ui/SoundSettingsTest.java
index 735992b..0c2a33f 100644
--- a/tests/uitests/src/com/android/settings/ui/SoundSettingsTest.java
+++ b/tests/uitests/src/com/android/settings/ui/SoundSettingsTest.java
@@ -29,7 +29,7 @@
 import android.test.suitebuilder.annotation.MediumTest;
 import android.test.suitebuilder.annotation.Suppress;
 
-import java.util.HashMap;
+import java.util.Map;
 
 public class SoundSettingsTest extends InstrumentationTestCase {
     private static final String PAGE = Settings.ACTION_SOUND_SETTINGS;
@@ -40,60 +40,54 @@
     private SettingsHelper mHelper;
 
 
-    private HashMap ringtoneSounds = new HashMap<String, String>() {{
-        put("angler","Dione");
-        put("bullhead","Dione");
-        put("marlin","Spaceship");
-        put("sailfish","Spaceship");
-        put("walleye","Copycat");
-        put("taimen","Copycat");
-    }};
+    private final Map<String, String> ringtoneSounds = Map.of(
+            "angler", "Dione",
+            "bullhead", "Dione",
+            "marlin", "Spaceship",
+            "sailfish", "Spaceship",
+            "walleye", "Copycat",
+            "taimen", "Copycat");
 
-    private HashMap ringtoneCodes = new HashMap<String, String>() {{
-        put("angler","38");
-        put("bullhead","38");
-        put("marlin","37");
-        put("sailfish","37");
-        put("walleye","26");
-        put("taimen","26");
-    }};
+    private final Map<String, String> ringtoneCodes = Map.of(
+            "angler", "38",
+            "bullhead", "38",
+            "marlin", "37",
+            "sailfish", "37",
+            "walleye", "26",
+            "taimen", "26");
 
-    private HashMap alarmSounds = new HashMap<String, String>() {{
-        put("angler","Awaken");
-        put("bullhead","Awaken");
-        put("marlin","Bounce");
-        put("sailfish","Bounce");
-        put("walleye","Cuckoo clock");
-        put("taimen","Cuckoo clock");
-    }};
+    private final Map<String, String> alarmSounds = Map.of(
+            "angler", "Awaken",
+            "bullhead", "Awaken",
+            "marlin", "Bounce",
+            "sailfish", "Bounce",
+            "walleye", "Cuckoo clock",
+            "taimen", "Cuckoo clock");
 
-    private HashMap alarmCodes = new HashMap<String, String>() {{
-        put("angler","6");
-        put("bullhead","6");
-        put("marlin","49");
-        put("sailfish","49");
-        put("walleye","15");
-        put("taimen","15");
-    }};
+    private final Map<String, String> alarmCodes = Map.of(
+            "angler", "6",
+            "bullhead", "6",
+            "marlin", "49",
+            "sailfish", "49",
+            "walleye", "15",
+            "taimen", "15");
 
-    private HashMap notificationSounds = new HashMap<String, String>() {{
-        put("angler","Ceres");
-        put("bullhead","Ceres");
-        put("marlin","Trill");
-        put("sailfish","Trill");
-        put("walleye","Pipes");
-        put("taimen","Pipes");
-    }};
+    private final Map<String, String> notificationSounds = Map.of(
+            "angler", "Ceres",
+            "bullhead", "Ceres",
+            "marlin", "Trill",
+            "sailfish", "Trill",
+            "walleye", "Pipes",
+            "taimen", "Pipes");
 
 
-    private HashMap notificationCodes = new HashMap<String, String>() {{
-        put("angler","26");
-        put("bullhead","26");
-        put("marlin","57");
-        put("sailfish","57");
-        put("walleye","69");
-        put("taimen","69");
-    }};
+    private final Map<String, String> notificationCodes = Map.of(
+            "angler", "26",
+            "bullhead", "26",
+            "marlin", "57",
+            "sailfish", "57",
+            "walleye", "69",
+            "taimen", "69");
 
     @Override
     public void setUp() throws Exception {