1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License 15 */ 16 17 package com.android.car.settings.system; 18 19 import android.os.Build; 20 import android.os.Bundle; 21 22 import com.android.car.settings.common.ListSettingsFragment; 23 import com.android.car.settings.common.SimpleTextLineItem; 24 import com.android.car.settings.common.TypedPagedListAdapter; 25 import com.android.car.settings.R; 26 import com.android.car.view.PagedListView; 27 import com.android.settingslib.DeviceInfoUtils; 28 29 import java.util.ArrayList; 30 31 /** 32 * Shows basic info about the system and provide some actions like update, reset etc. 33 */ 34 public class AboutSettingsFragment extends ListSettingsFragment { 35 getInstance()36 public static AboutSettingsFragment getInstance() { 37 AboutSettingsFragment aboutSettingsFragment = new AboutSettingsFragment(); 38 Bundle bundle = ListSettingsFragment.getBundle(); 39 bundle.putInt(EXTRA_TITLE_ID, R.string.about_settings); 40 aboutSettingsFragment.setArguments(bundle); 41 return aboutSettingsFragment; 42 } 43 44 @Override getLineItems()45 public ArrayList<TypedPagedListAdapter.LineItem> getLineItems() { 46 ArrayList<TypedPagedListAdapter.LineItem> lineItems = new ArrayList<>(); 47 lineItems.add(new SimpleTextLineItem( 48 getText(R.string.model_info), Build.MODEL + DeviceInfoUtils.getMsvSuffix())); 49 lineItems.add(new SimpleTextLineItem( 50 getText(R.string.firmware_version), 51 getString(R.string.about_summary, Build.VERSION.RELEASE))); 52 lineItems.add(new SimpleTextLineItem( 53 getText(R.string.security_patch), DeviceInfoUtils.getSecurityPatch())); 54 lineItems.add(new SimpleTextLineItem( 55 getText(R.string.kernel_version), DeviceInfoUtils.getFormattedKernelVersion())); 56 lineItems.add(new SimpleTextLineItem( 57 getText(R.string.build_number), Build.DISPLAY)); 58 return lineItems; 59 } 60 } 61