Skip to content

Commit 1e90ab5

Browse files
author
The Android Open Source Project
committed
merge from open-source master
2 parents 61bb25f + 27f3de6 commit 1e90ab5

2 files changed

Lines changed: 22 additions & 8 deletions

File tree

graphics/java/android/graphics/drawable/RotateDrawable.java

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,27 @@ public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs)
204204
com.android.internal.R.styleable.RotateDrawable_visible);
205205

206206
TypedValue tv = a.peekValue(com.android.internal.R.styleable.RotateDrawable_pivotX);
207-
boolean pivotXRel = tv.type == TypedValue.TYPE_FRACTION;
208-
float pivotX = pivotXRel ? tv.getFraction(1.0f, 1.0f) : tv.getFloat();
207+
boolean pivotXRel;
208+
float pivotX;
209+
if (tv == null) {
210+
pivotXRel = true;
211+
pivotX = 0.5f;
212+
} else {
213+
pivotXRel = tv.type == TypedValue.TYPE_FRACTION;
214+
pivotX = pivotXRel ? tv.getFraction(1.0f, 1.0f) : tv.getFloat();
215+
}
209216

210217
tv = a.peekValue(com.android.internal.R.styleable.RotateDrawable_pivotY);
211-
boolean pivotYRel = tv.type == TypedValue.TYPE_FRACTION;
212-
float pivotY = pivotYRel ? tv.getFraction(1.0f, 1.0f) : tv.getFloat();
213-
218+
boolean pivotYRel;
219+
float pivotY;
220+
if (tv == null) {
221+
pivotYRel = true;
222+
pivotY = 0.5f;
223+
} else {
224+
pivotYRel = tv.type == TypedValue.TYPE_FRACTION;
225+
pivotY = pivotYRel ? tv.getFraction(1.0f, 1.0f) : tv.getFloat();
226+
}
227+
214228
float fromDegrees = a.getFloat(
215229
com.android.internal.R.styleable.RotateDrawable_fromDegrees, 0.0f);
216230
float toDegrees = a.getFloat(

services/java/com/android/server/WindowManagerService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5355,7 +5355,7 @@ public boolean injectKeyEvent(KeyEvent ev, boolean sync) {
53555355
switch (result) {
53565356
case INJECT_NO_PERMISSION:
53575357
throw new SecurityException(
5358-
"Injecting to another application requires INJECT_EVENT permission");
5358+
"Injecting to another application requires INJECT_EVENTS permission");
53595359
case INJECT_SUCCEEDED:
53605360
return true;
53615361
}
@@ -5383,7 +5383,7 @@ public boolean injectPointerEvent(MotionEvent ev, boolean sync) {
53835383
switch (result) {
53845384
case INJECT_NO_PERMISSION:
53855385
throw new SecurityException(
5386-
"Injecting to another application requires INJECT_EVENT permission");
5386+
"Injecting to another application requires INJECT_EVENTS permission");
53875387
case INJECT_SUCCEEDED:
53885388
return true;
53895389
}
@@ -5411,7 +5411,7 @@ public boolean injectTrackballEvent(MotionEvent ev, boolean sync) {
54115411
switch (result) {
54125412
case INJECT_NO_PERMISSION:
54135413
throw new SecurityException(
5414-
"Injecting to another application requires INJECT_EVENT permission");
5414+
"Injecting to another application requires INJECT_EVENTS permission");
54155415
case INJECT_SUCCEEDED:
54165416
return true;
54175417
}

0 commit comments

Comments
 (0)