Fix issue #7323256: permission dialog has bad layout

Change-Id: I3fc9f9bf492178ba064a4579826f49f252d41a20
diff --git a/res/layout/install_confirm.xml b/res/layout/install_confirm.xml
index 9589e8a..f9fb359 100644
--- a/res/layout/install_confirm.xml
+++ b/res/layout/install_confirm.xml
@@ -44,6 +44,14 @@
             android:background="?android:attr/dividerHorizontal"
             android:visibility="gone" />
 
+    <FrameLayout
+        android:id="@+id/filler"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:visibility="gone">
+    </FrameLayout>
+
     <TabHost
         android:id="@android:id/tabhost"
         android:layout_width="match_parent"
diff --git a/src/com/android/packageinstaller/PackageInstallerActivity.java b/src/com/android/packageinstaller/PackageInstallerActivity.java
index d0c50fc..4a6db21 100644
--- a/src/com/android/packageinstaller/PackageInstallerActivity.java
+++ b/src/com/android/packageinstaller/PackageInstallerActivity.java
@@ -284,19 +284,20 @@
             }
         }
         if (!permVisible) {
-            if (msg == 0) {
-                if (mAppInfo != null) {
-                    // This is an update to an application, but there are no
-                    // permissions at all.
-                    msg = (mAppInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0
-                            ? R.string.install_confirm_question_update_system_no_perms
-                            : R.string.install_confirm_question_update_no_perms;
-                } else {
-                    // This is a new application with no permissions.
-                    msg = R.string.install_confirm_question_no_perms;
-                }
+            if (mAppInfo != null) {
+                // This is an update to an application, but there are no
+                // permissions at all.
+                msg = (mAppInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0
+                        ? R.string.install_confirm_question_update_system_no_perms
+                        : R.string.install_confirm_question_update_no_perms;
+            } else {
+                // This is a new application with no permissions.
+                msg = R.string.install_confirm_question_no_perms;
             }
             tabHost.setVisibility(View.GONE);
+            findViewById(R.id.filler).setVisibility(View.VISIBLE);
+            findViewById(R.id.divider).setVisibility(View.GONE);
+            mScrollView = null;
         }
         if (msg != 0) {
             ((TextView)findViewById(R.id.install_confirm_question)).setText(msg);