Migrate Legal Information Settings to Preferences.

Note that there is a small change in UI. The supplemental icon on the
right hand side of the preference no longer exists, since Preferences
doesn't support such icons out of the box. This is consistent with what
exists on phone settings.

Third-party licenses also is broken (was already broken, due to "Webpage
at content://com.android.settings.files/my_cache/NOTICE.html could not
be loaded"). Will inspect in a separate CL.

Bug: 117336178
Test: Build, Manual, Robolectric unit tests
Change-Id: If81d3560fac47c1a7e2b4a71c59dc88b73477ca9
diff --git a/src/com/android/car/settings/system/LegalInformationFragment.java b/src/com/android/car/settings/system/LegalInformationFragment.java
index e2dcc37..21c07f0 100644
--- a/src/com/android/car/settings/system/LegalInformationFragment.java
+++ b/src/com/android/car/settings/system/LegalInformationFragment.java
@@ -16,59 +16,19 @@
 
 package com.android.car.settings.system;
 
-import android.content.Context;
-import android.content.Intent;
-
-import androidx.annotation.StringRes;
-import androidx.car.widget.ListItem;
-import androidx.car.widget.ListItemProvider;
-import androidx.car.widget.TextListItem;
+import androidx.annotation.XmlRes;
 
 import com.android.car.settings.R;
-import com.android.car.settings.common.ListItemSettingsFragment;
-
-import java.util.ArrayList;
+import com.android.car.settings.common.BasePreferenceFragment;
 
 /**
  * Fragment showing legal information.
  */
-public class LegalInformationFragment extends ListItemSettingsFragment {
-    private static final String ACTION_WEBVIEW_LICENSE = "android.settings.WEBVIEW_LICENSE";
+public class LegalInformationFragment extends BasePreferenceFragment {
 
     @Override
-    @StringRes
-    protected int getTitleId() {
-        return R.string.legal_information;
-    }
-
-    @Override
-    public ListItemProvider getItemProvider() {
-        return new ListItemProvider.ListProvider(getListItems());
-    }
-
-    private ArrayList<ListItem> getListItems() {
-        ArrayList<ListItem> listItems = new ArrayList<>();
-
-        listItems.add(createSystemWebviewLicensesListItem());
-        listItems.add(createThirdPartyLicensesListItem());
-
-        return listItems;
-    }
-
-    private TextListItem createSystemWebviewLicensesListItem() {
-        Context context = requireContext();
-        return createSimpleListItem(R.string.webview_license_title, v -> {
-            Intent intent = new Intent();
-            intent.setAction(ACTION_WEBVIEW_LICENSE);
-            context.startActivity(intent);
-        });
-    }
-
-    private TextListItem createThirdPartyLicensesListItem() {
-        Context context = requireContext();
-        return createSimpleListItem(R.string.settings_license_activity_title, v -> {
-            Intent intent = new Intent(context, ThirdPartyLicensesActivity.class);
-            context.startActivity(intent);
-        });
+    @XmlRes
+    protected int getPreferenceScreenResId() {
+        return R.xml.legal_information_fragment;
     }
 }