Settings: Add package name to installed app details

Change-Id: I8ce737ec5150f37e61240d8053403046ca9317fb
diff --git a/res/xml/app_info_settings.xml b/res/xml/app_info_settings.xml
index 0782f67..b5c7088 100644
--- a/res/xml/app_info_settings.xml
+++ b/res/xml/app_info_settings.xml
@@ -215,9 +215,16 @@
     <Preference
         android:key="app_version"
         android:selectable="false"
-        android:order="9999"
+        android:order="9998"
         settings:controller="com.android.settings.applications.appinfo.AppVersionPreferenceController"
         settings:allowDividerAbove="true"
         settings:enableCopying="true"/>
 
+    <Preference
+        android:key="app_package_name"
+        android:selectable="false"
+        android:order="9999"
+        settings:controller="com.android.settings.applications.appinfo.AppPackageNamePreferenceController"
+        settings:enableCopying="true"/>
+
 </PreferenceScreen>
diff --git a/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java b/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java
index 82d55f3..b28e371 100644
--- a/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java
+++ b/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java
@@ -178,6 +178,7 @@
         use(AppAllServicesPreferenceController.class).setPackageName(packageName);
         use(AppStoragePreferenceController.class).setParentFragment(this);
         use(AppVersionPreferenceController.class).setParentFragment(this);
+        use(AppPackageNamePreferenceController.class).setParentFragment(this);
         use(InstantAppDomainsPreferenceController.class).setParentFragment(this);
 
         final HibernationSwitchPreferenceController appHibernationSettings =
diff --git a/src/com/android/settings/applications/appinfo/AppPackageNamePreferenceController.java b/src/com/android/settings/applications/appinfo/AppPackageNamePreferenceController.java
new file mode 100644
index 0000000..bd4f12f
--- /dev/null
+++ b/src/com/android/settings/applications/appinfo/AppPackageNamePreferenceController.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2018 The LineageOS 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.
+ */
+
+package com.android.settings.applications.appinfo;
+
+import android.content.Context;
+
+public class AppPackageNamePreferenceController extends AppInfoPreferenceControllerBase {
+
+    public AppPackageNamePreferenceController(Context context, String key) {
+        super(context, key);
+    }
+
+    @Override
+    public CharSequence getSummary() {
+        return mParent.getPackageInfo().packageName;
+    }
+}