summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2016-01-15 07:24:58 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-01-15 07:24:58 +0000
commita0e0b5b532958bbebfc29a6c902aa041ffa98807 (patch)
treee83a57b7f49b3b401e2c782b085d939e0fb1a077 /src
parent8e9c4fef04a6964e74a39ab2808d2771b9fe2fa8 (diff)
parenteccff95e32dbf09f0fe6df033daf09e8d3c4212e (diff)
downloadandroid_packages_apps_PackageInstaller-a0e0b5b532958bbebfc29a6c902aa041ffa98807.tar.gz
android_packages_apps_PackageInstaller-a0e0b5b532958bbebfc29a6c902aa041ffa98807.tar.bz2
android_packages_apps_PackageInstaller-a0e0b5b532958bbebfc29a6c902aa041ffa98807.zip
Merge "Revert "Make request permissions dialog layout robost"" am: 41d260fe98
am: eccff95e32 * commit 'eccff95e32dbf09f0fe6df033daf09e8d3c4212e': Revert "Make request permissions dialog layout robost"
Diffstat (limited to 'src')
-rw-r--r--src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java15
-rw-r--r--src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java25
-rw-r--r--src/com/android/packageinstaller/permission/ui/handheld/GrantPermissionsViewHandlerImpl.java1
3 files changed, 6 insertions, 35 deletions
diff --git a/src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java b/src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java
index 3286659d..d02355ee 100644
--- a/src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java
+++ b/src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java
@@ -25,7 +25,6 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.PermissionInfo;
-import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.graphics.drawable.Icon;
@@ -188,20 +187,6 @@ public class GrantPermissionsActivity extends OverlayTouchActivity
}
@Override
- public void onConfigurationChanged(Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- // This is just gross - we need to relayout the window as
- // dialog width may be different in landscape vs portrait
- // which affect the min window height needed to show all
- // content. We have to re-add the window to force it to be
- // resized if needed. The way the permission grant dialog
- // is implemented is not correct and has to be rewritten.
- View decor = getWindow().getDecorView();
- getWindowManager().removeViewImmediate(decor);
- getWindowManager().addView(decor, decor.getLayoutParams());
- }
-
- @Override
public boolean dispatchTouchEvent(MotionEvent ev) {
View rootView = getWindow().getDecorView();
if (rootView.getTop() != 0) {
diff --git a/src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java b/src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java
index 1af400b3..c9ccf9c1 100644
--- a/src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java
+++ b/src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java
@@ -17,6 +17,7 @@ package com.android.packageinstaller.permission.ui;
import android.content.Context;
import android.util.AttributeSet;
+import android.view.View;
import android.widget.FrameLayout;
/**
@@ -26,10 +27,13 @@ import android.widget.FrameLayout;
* but allows the view to grow downwards for animation.
*/
public class ManualLayoutFrame extends FrameLayout {
+
private int mDesiredHeight;
private int mHeight;
private int mWidth;
+ private View mOffsetView;
+
public ManualLayoutFrame(Context context, AttributeSet attrs) {
super(context, attrs);
setClipChildren(false);
@@ -43,29 +47,10 @@ public class ManualLayoutFrame extends FrameLayout {
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (mWidth != 0) {
- int newWidth = mWidth;
- final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
- switch (widthMode) {
- case MeasureSpec.AT_MOST: {
- newWidth = Math.min(mWidth, MeasureSpec.getSize(widthMeasureSpec));
- } break;
- case MeasureSpec.EXACTLY: {
- newWidth = MeasureSpec.getSize(widthMeasureSpec);
- } break;
- }
- // If the width changes we have to re-evaluate the height
- if (newWidth != mWidth) {
- mWidth = newWidth;
- mHeight = 0;
- }
+ // Keep the width constant to avoid weirdness.
widthMeasureSpec = MeasureSpec.makeMeasureSpec(mWidth, MeasureSpec.EXACTLY);
}
-
- // Let the content measure how much it needs to be fully shown
- heightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
-
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
-
mDesiredHeight = getMeasuredHeight();
if (mHeight == 0 && mDesiredHeight != 0) {
// Record the first non-zero width and height, this will be the height henceforth.
diff --git a/src/com/android/packageinstaller/permission/ui/handheld/GrantPermissionsViewHandlerImpl.java b/src/com/android/packageinstaller/permission/ui/handheld/GrantPermissionsViewHandlerImpl.java
index c34a62a3..75fbf5bf 100644
--- a/src/com/android/packageinstaller/permission/ui/handheld/GrantPermissionsViewHandlerImpl.java
+++ b/src/com/android/packageinstaller/permission/ui/handheld/GrantPermissionsViewHandlerImpl.java
@@ -20,6 +20,7 @@ import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Context;
+import android.content.res.Resources;
import android.graphics.drawable.Icon;
import android.os.Bundle;
import android.util.SparseArray;