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
diff --git a/res/xml/device_info_settings_v2.xml b/res/xml/device_info_settings_v2.xml
new file mode 100644
index 0000000..e5c2b0e
--- /dev/null
+++ b/res/xml/device_info_settings_v2.xml
@@ -0,0 +1,23 @@
+<?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
diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java
index abf68f2..c584ac2 100644
--- a/src/com/android/settings/DeviceInfoSettings.java
+++ b/src/com/android/settings/DeviceInfoSettings.java
@@ -21,6 +21,7 @@
 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 @@
     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 @@
 
     @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 @@
 
     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 @@
                 }
 
                 @Override
-                public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+                public List<AbstractPreferenceController> getPreferenceControllers(
+                        Context context) {
                     return buildPreferenceControllers(context, null /*activity */,
                             null /* fragment */, null /* lifecycle */);
                 }