diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2010-02-11 11:20:40 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-02-11 11:20:40 -0800 |
commit | 3941411a21b0ccbfb2843dd8c7c7fbe9f8e85abb (patch) | |
tree | e19dd952cf8c80039bbc8bb5c751d6433ae96222 | |
parent | 777db0c08a1bee45acc2ca3fcc62ef1db6d0e221 (diff) | |
parent | 1e90ab542d675616e9370ab7e5add99d7af12587 (diff) | |
download | frameworks_base-3941411a21b0ccbfb2843dd8c7c7fbe9f8e85abb.zip frameworks_base-3941411a21b0ccbfb2843dd8c7c7fbe9f8e85abb.tar.gz frameworks_base-3941411a21b0ccbfb2843dd8c7c7fbe9f8e85abb.tar.bz2 |
am 1e90ab54: merge from open-source master
Merge commit '1e90ab542d675616e9370ab7e5add99d7af12587'
* commit '1e90ab542d675616e9370ab7e5add99d7af12587':
Fixs the incorrect message for SecurityException
Default RotateDrawable's pivot set to (50%, 50%)
-rw-r--r-- | graphics/java/android/graphics/drawable/RotateDrawable.java | 24 | ||||
-rw-r--r-- | services/java/com/android/server/WindowManagerService.java | 6 |
2 files changed, 22 insertions, 8 deletions
diff --git a/graphics/java/android/graphics/drawable/RotateDrawable.java b/graphics/java/android/graphics/drawable/RotateDrawable.java index c4a7822..2083e05 100644 --- a/graphics/java/android/graphics/drawable/RotateDrawable.java +++ b/graphics/java/android/graphics/drawable/RotateDrawable.java @@ -204,13 +204,27 @@ public class RotateDrawable extends Drawable implements Drawable.Callback { com.android.internal.R.styleable.RotateDrawable_visible); TypedValue tv = a.peekValue(com.android.internal.R.styleable.RotateDrawable_pivotX); - boolean pivotXRel = tv.type == TypedValue.TYPE_FRACTION; - float pivotX = pivotXRel ? tv.getFraction(1.0f, 1.0f) : tv.getFloat(); + boolean pivotXRel; + float pivotX; + if (tv == null) { + pivotXRel = true; + pivotX = 0.5f; + } else { + pivotXRel = tv.type == TypedValue.TYPE_FRACTION; + pivotX = pivotXRel ? tv.getFraction(1.0f, 1.0f) : tv.getFloat(); + } tv = a.peekValue(com.android.internal.R.styleable.RotateDrawable_pivotY); - boolean pivotYRel = tv.type == TypedValue.TYPE_FRACTION; - float pivotY = pivotYRel ? tv.getFraction(1.0f, 1.0f) : tv.getFloat(); - + boolean pivotYRel; + float pivotY; + if (tv == null) { + pivotYRel = true; + pivotY = 0.5f; + } else { + pivotYRel = tv.type == TypedValue.TYPE_FRACTION; + pivotY = pivotYRel ? tv.getFraction(1.0f, 1.0f) : tv.getFloat(); + } + float fromDegrees = a.getFloat( com.android.internal.R.styleable.RotateDrawable_fromDegrees, 0.0f); float toDegrees = a.getFloat( diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index b57e543..73223ee 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -5355,7 +5355,7 @@ public class WindowManagerService extends IWindowManager.Stub switch (result) { case INJECT_NO_PERMISSION: throw new SecurityException( - "Injecting to another application requires INJECT_EVENT permission"); + "Injecting to another application requires INJECT_EVENTS permission"); case INJECT_SUCCEEDED: return true; } @@ -5383,7 +5383,7 @@ public class WindowManagerService extends IWindowManager.Stub switch (result) { case INJECT_NO_PERMISSION: throw new SecurityException( - "Injecting to another application requires INJECT_EVENT permission"); + "Injecting to another application requires INJECT_EVENTS permission"); case INJECT_SUCCEEDED: return true; } @@ -5411,7 +5411,7 @@ public class WindowManagerService extends IWindowManager.Stub switch (result) { case INJECT_NO_PERMISSION: throw new SecurityException( - "Injecting to another application requires INJECT_EVENT permission"); + "Injecting to another application requires INJECT_EVENTS permission"); case INJECT_SUCCEEDED: return true; } |