Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d81622e7 authored by jeffreyhuang's avatar jeffreyhuang
Browse files

Fork a new about phone layout

 - Used a feature flag to hide the new about phone page

Bug: 36458278
Test: make RunSettingsRoboTests -j40
Change-Id: Ie7b6afa58b301128d1c60513ae4ee48d6ec6679b
parent d50363b4
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2017 The Android Open Source Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->

<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:key="device_info_pref_screen"
    android:title="@string/about_settings">

</PreferenceScreen>
 No newline at end of file
+11 −2
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.app.Fragment;
import android.content.Context;
import android.content.Intent;
import android.provider.SearchIndexableResource;
import android.util.FeatureFlagUtils;

import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.dashboard.DashboardFragment;
@@ -51,6 +52,7 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {
    private static final String LOG_TAG = "DeviceInfoSettings";

    private static final String KEY_LEGAL_CONTAINER = "legal_container";
    private static final String DEVICE_INFO_V2_FEATURE_FLAG = "device_info_v2";

    @Override
    public int getMetricsCategory() {
@@ -79,7 +81,8 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {

    @Override
    protected int getPreferenceScreenResId() {
        return R.xml.device_info_settings;
        return FeatureFlagUtils.isEnabled(DEVICE_INFO_V2_FEATURE_FLAG)
                ? R.xml.device_info_settings_v2 : R.xml.device_info_settings;
    }

    @Override
@@ -115,6 +118,11 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {

    private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
            Activity activity, Fragment fragment, Lifecycle lifecycle) {
        if (FeatureFlagUtils.isEnabled(DEVICE_INFO_V2_FEATURE_FLAG)) {
            final List<AbstractPreferenceController> controllers = new ArrayList<>();
            return controllers;
        }

        final List<AbstractPreferenceController> controllers = new ArrayList<>();
        controllers.add(
                new BuildNumberPreferenceController(context, activity, fragment, lifecycle));
@@ -147,7 +155,8 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {
                }

                @Override
                public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
                public List<AbstractPreferenceController> getPreferenceControllers(
                        Context context) {
                    return buildPreferenceControllers(context, null /*activity */,
                            null /* fragment */, null /* lifecycle */);
                }