am 568cae57: Fix issue #2171460: Turn off background blurring of power dialog

Merge commit '568cae571a3d74d1992176a21722e07b44e9a3c4' into eclair-mr2

* commit '568cae571a3d74d1992176a21722e07b44e9a3c4':
  Fix issue #2171460: Turn off background blurring of power dialog
This commit is contained in:
Dianne Hackborn
2009-10-07 17:45:14 -07:00
committed by Android Git Automerger
3 changed files with 24 additions and 7 deletions

View File

@@ -32,6 +32,7 @@ import android.os.RemoteException;
import android.os.Power; import android.os.Power;
import android.os.ServiceManager; import android.os.ServiceManager;
import android.os.SystemClock; import android.os.SystemClock;
import com.android.internal.telephony.ITelephony; import com.android.internal.telephony.ITelephony;
import android.util.Log; import android.util.Log;
import android.view.WindowManager; import android.view.WindowManager;
@@ -91,7 +92,10 @@ public final class ShutdownThread extends Thread {
.setNegativeButton(com.android.internal.R.string.no, null) .setNegativeButton(com.android.internal.R.string.no, null)
.create(); .create();
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG); dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
if (!context.getResources().getBoolean(
com.android.internal.R.bool.config_sf_slowBlur)) {
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND); dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
}
dialog.show(); dialog.show();
} else { } else {
beginShutdownSequence(context); beginShutdownSequence(context);
@@ -111,7 +115,10 @@ public final class ShutdownThread extends Thread {
pd.setIndeterminate(true); pd.setIndeterminate(true);
pd.setCancelable(false); pd.setCancelable(false);
pd.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG); pd.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
if (!context.getResources().getBoolean(
com.android.internal.R.bool.config_sf_slowBlur)) {
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND); pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
}
pd.show(); pd.show();

View File

@@ -26,6 +26,11 @@
strictly needed. --> strictly needed. -->
<bool name="config_sf_limitedAlpha">false</bool> <bool name="config_sf_limitedAlpha">false</bool>
<!-- Flag indicating whether the surface flinger is inefficient
at performing a blur. Used by parts of the UI to turn off
the blur effect where it isn't worth the performance hit. -->
<bool name="config_sf_slowBlur">false</bool>
<!-- The duration (in milliseconds) of a short animation. --> <!-- The duration (in milliseconds) of a short animation. -->
<integer name="config_shortAnimTime">150</integer> <integer name="config_shortAnimTime">150</integer>

View File

@@ -624,15 +624,20 @@ public class StatusBarPolicy {
pixelFormat = bg.getOpacity(); pixelFormat = bg.getOpacity();
} }
int flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
| WindowManager.LayoutParams.FLAG_DIM_BEHIND;
if (!mContext.getResources().getBoolean(
com.android.internal.R.bool.config_sf_slowBlur)) {
flags |= WindowManager.LayoutParams.FLAG_BLUR_BEHIND;
}
WindowManager.LayoutParams lp = new WindowManager.LayoutParams( WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_TOAST, WindowManager.LayoutParams.TYPE_TOAST,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE flags, pixelFormat);
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
| WindowManager.LayoutParams.FLAG_BLUR_BEHIND
| WindowManager.LayoutParams.FLAG_DIM_BEHIND,
pixelFormat);
// Get the dim amount from the theme // Get the dim amount from the theme
TypedArray a = mContext.obtainStyledAttributes( TypedArray a = mContext.obtainStyledAttributes(