blob: e69513fd17ad119011f8f64c9a84f2c2e5bbfb22 [file] [log] [blame]
roger xueb292bf22017-03-02 16:05:00 -08001/*
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
17package com.android.car.settings.system;
18
19import android.os.Build;
roger xue24b50802017-04-04 11:59:04 -070020import android.os.Bundle;
roger xueb292bf22017-03-02 16:05:00 -080021
roger xue24b50802017-04-04 11:59:04 -070022import com.android.car.settings.common.ListSettingsFragment;
roger xueb292bf22017-03-02 16:05:00 -080023import com.android.car.settings.common.SimpleTextLineItem;
24import com.android.car.settings.common.TypedPagedListAdapter;
25import com.android.car.settings.R;
roger xueddb75442017-03-29 09:27:04 -070026import com.android.car.view.PagedListView;
roger xueb292bf22017-03-02 16:05:00 -080027import com.android.settingslib.DeviceInfoUtils;
28
29import java.util.ArrayList;
30
31/**
32 * Shows basic info about the system and provide some actions like update, reset etc.
33 */
roger xue24b50802017-04-04 11:59:04 -070034public 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 xueb292bf22017-03-02 16:05:00 -080043
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 xueb292bf22017-03-02 16:05:00 -080060}