roger xue | b292bf2 | 2017-03-02 16:05:00 -0800 | [diff] [blame] | 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; |
roger xue | 24b5080 | 2017-04-04 11:59:04 -0700 | [diff] [blame] | 20 | import android.os.Bundle; |
roger xue | b292bf2 | 2017-03-02 16:05:00 -0800 | [diff] [blame] | 21 | |
roger xue | 24b5080 | 2017-04-04 11:59:04 -0700 | [diff] [blame] | 22 | import com.android.car.settings.common.ListSettingsFragment; |
roger xue | b292bf2 | 2017-03-02 16:05:00 -0800 | [diff] [blame] | 23 | import com.android.car.settings.common.SimpleTextLineItem; |
| 24 | import com.android.car.settings.common.TypedPagedListAdapter; |
| 25 | import com.android.car.settings.R; |
roger xue | ddb7544 | 2017-03-29 09:27:04 -0700 | [diff] [blame] | 26 | import com.android.car.view.PagedListView; |
roger xue | b292bf2 | 2017-03-02 16:05:00 -0800 | [diff] [blame] | 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 | */ |
roger xue | 24b5080 | 2017-04-04 11:59:04 -0700 | [diff] [blame] | 34 | public class AboutSettingsFragment extends ListSettingsFragment { |
| 35 | |
| 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 | } |
roger xue | b292bf2 | 2017-03-02 16:05:00 -0800 | [diff] [blame] | 43 | |
| 44 | @Override |
| 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 | } |
roger xue | b292bf2 | 2017-03-02 16:05:00 -0800 | [diff] [blame] | 60 | } |