Merge "Improve docs around ActionBar as noted in bug 3111444."
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index b143325..fbc8549 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -305,6 +305,8 @@
int mTextSelectHandleRes;
int mTextEditPasteWindowLayout;
int mTextEditNoPasteWindowLayout;
+ Drawable mEditTextMultilineBackground;
+ Drawable mEditTextSingleLineBackground;
Drawable mSelectHandleLeft;
Drawable mSelectHandleRight;
@@ -751,6 +753,10 @@
mTextEditNoPasteWindowLayout = a.getResourceId(attr, 0);
break;
+ case com.android.internal.R.styleable.TextView_multilineBackground:
+ mEditTextMultilineBackground = a.getDrawable(attr);
+ break;
+
case com.android.internal.R.styleable.TextView_textLineHeight:
int lineHeight = a.getDimensionPixelSize(attr, 0);
if (lineHeight != 0) {
@@ -765,6 +771,7 @@
}
a.recycle();
+ mEditTextSingleLineBackground = getBackground();
BufferType bufferType = BufferType.EDITABLE;
final int variation =
@@ -6192,12 +6199,14 @@
if (applyTransformation) {
setTransformationMethod(SingleLineTransformationMethod.getInstance());
}
+ setBackgroundDrawable(mEditTextSingleLineBackground);
} else {
setMaxLines(Integer.MAX_VALUE);
setHorizontallyScrolling(false);
if (applyTransformation) {
setTransformationMethod(null);
}
+ setBackgroundDrawable(mEditTextMultilineBackground);
}
}
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 1018ddb..e50233e 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -1194,6 +1194,7 @@
REG_JNI(register_android_text_AndroidBidi),
REG_JNI(register_android_text_KeyCharacterMap),
REG_JNI(register_android_os_Process),
+ REG_JNI(register_android_os_SystemProperties),
REG_JNI(register_android_os_Binder),
REG_JNI(register_android_view_Display),
REG_JNI(register_android_nio_utils),
@@ -1251,7 +1252,6 @@
REG_JNI(register_android_os_ParcelFileDescriptor),
REG_JNI(register_android_os_Power),
REG_JNI(register_android_os_StatFs),
- REG_JNI(register_android_os_SystemProperties),
REG_JNI(register_android_os_UEventObserver),
REG_JNI(register_android_net_LocalSocketImpl),
REG_JNI(register_android_net_NetworkUtils),
diff --git a/core/res/res/drawable-hdpi/textfield_active_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_active_holo_dark.9.png
new file mode 100644
index 0000000..a38c03a
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_active_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_active_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_active_holo_light.9.png
new file mode 100644
index 0000000..6a88a69
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_active_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_default_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_default_holo_dark.9.png
index 7ec2192..87d9c21 100644
--- a/core/res/res/drawable-hdpi/textfield_default_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/textfield_default_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_default_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_default_holo_light.9.png
index c03e4f6..720ee78 100644
--- a/core/res/res/drawable-hdpi/textfield_default_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/textfield_default_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_dark.9.png
new file mode 100644
index 0000000..4275da07
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_light.9.png
new file mode 100644
index 0000000..3ec9c1f
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_disabled_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_disabled_holo_dark.9.png
index 6642717..227bde2 100644
--- a/core/res/res/drawable-hdpi/textfield_disabled_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/textfield_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_disabled_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_disabled_holo_light.9.png
index 9572752..6ddfab0 100644
--- a/core/res/res/drawable-hdpi/textfield_disabled_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/textfield_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_dark.9.png
deleted file mode 100644
index 0ad248c..0000000
--- a/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_light.9.png
deleted file mode 100644
index b7a07c4..0000000
--- a/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_multiline_active_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_multiline_active_holo_dark.9.png
new file mode 100644
index 0000000..7528479
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_multiline_active_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_multiline_active_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_multiline_active_holo_light.9.png
new file mode 100644
index 0000000..4c7d9e7
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_multiline_active_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_multiline_default_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_multiline_default_holo_dark.9.png
new file mode 100644
index 0000000..09ca253
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_multiline_default_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_multiline_default_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_multiline_default_holo_light.9.png
new file mode 100644
index 0000000..0a7d3a1
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_multiline_default_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_dark.9.png
new file mode 100644
index 0000000..54a1519
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_light.9.png
new file mode 100644
index 0000000..06ca0d4
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_dark.9.png
new file mode 100644
index 0000000..9015299
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_light.9.png
new file mode 100644
index 0000000..b355cb3
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_pressed.9.png b/core/res/res/drawable-hdpi/textfield_pressed.9.png
deleted file mode 100644
index a42d87f..0000000
--- a/core/res/res/drawable-hdpi/textfield_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_pressed_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_pressed_holo_dark.9.png
deleted file mode 100644
index a271ac9b..0000000
--- a/core/res/res/drawable-hdpi/textfield_pressed_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_pressed_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_pressed_holo_light.9.png
deleted file mode 100644
index 521722d..0000000
--- a/core/res/res/drawable-hdpi/textfield_pressed_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_selected_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_selected_holo_dark.9.png
deleted file mode 100644
index a271ac9b..0000000
--- a/core/res/res/drawable-hdpi/textfield_selected_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_selected_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_selected_holo_light.9.png
deleted file mode 100644
index 521722d..0000000
--- a/core/res/res/drawable-hdpi/textfield_selected_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-ldpi/textfield_pressed.9.png b/core/res/res/drawable-ldpi/textfield_pressed.9.png
deleted file mode 100644
index 1433365..0000000
--- a/core/res/res/drawable-ldpi/textfield_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_active_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_active_holo_dark.9.png
new file mode 100644
index 0000000..d37c8b2
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_active_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_active_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_active_holo_light.9.png
new file mode 100644
index 0000000..16f2197
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_active_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_default_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_default_holo_dark.9.png
index 3a5f36d..c98c951 100644
--- a/core/res/res/drawable-mdpi/textfield_default_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/textfield_default_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_default_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_default_holo_light.9.png
index b8cc76f..7691f81 100644
--- a/core/res/res/drawable-mdpi/textfield_default_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/textfield_default_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_dark.9.png
new file mode 100644
index 0000000..500ede3
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_light.9.png
new file mode 100644
index 0000000..99f7f38
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_disabled_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_disabled_holo_dark.9.png
index a1f0c71..fab86ac 100644
--- a/core/res/res/drawable-mdpi/textfield_disabled_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/textfield_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_disabled_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_disabled_holo_light.9.png
index 71e3103..876eb794 100644
--- a/core/res/res/drawable-mdpi/textfield_disabled_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/textfield_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_dark.9.png
deleted file mode 100644
index ac6d406..0000000
--- a/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_light.9.png
deleted file mode 100644
index bb6e953..0000000
--- a/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_multiline_active_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_multiline_active_holo_dark.9.png
new file mode 100644
index 0000000..2646899
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_multiline_active_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_multiline_active_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_multiline_active_holo_light.9.png
new file mode 100644
index 0000000..374d457
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_multiline_active_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_multiline_default_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_multiline_default_holo_dark.9.png
new file mode 100644
index 0000000..65c87ba
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_multiline_default_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_multiline_default_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_multiline_default_holo_light.9.png
new file mode 100644
index 0000000..724b3fd
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_multiline_default_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_dark.9.png
new file mode 100644
index 0000000..5f0ad56
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_light.9.png
new file mode 100644
index 0000000..df03a15
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_dark.9.png
new file mode 100644
index 0000000..2cc7f62
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_light.9.png
new file mode 100644
index 0000000..a2d9d8a
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_pressed.9.png b/core/res/res/drawable-mdpi/textfield_pressed.9.png
deleted file mode 100644
index c909ad2..0000000
--- a/core/res/res/drawable-mdpi/textfield_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_pressed_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_pressed_holo_dark.9.png
deleted file mode 100644
index 7667d95..0000000
--- a/core/res/res/drawable-mdpi/textfield_pressed_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_pressed_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_pressed_holo_light.9.png
deleted file mode 100644
index 269affd..0000000
--- a/core/res/res/drawable-mdpi/textfield_pressed_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_selected_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_selected_holo_dark.9.png
deleted file mode 100644
index 7667d95..0000000
--- a/core/res/res/drawable-mdpi/textfield_selected_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_selected_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_selected_holo_light.9.png
deleted file mode 100644
index 269affd..0000000
--- a/core/res/res/drawable-mdpi/textfield_selected_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable/edit_text.xml b/core/res/res/drawable/edit_text.xml
index 315278d..e9ba84b 100644
--- a/core/res/res/drawable/edit_text.xml
+++ b/core/res/res/drawable/edit_text.xml
@@ -15,11 +15,8 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_window_focused="false" android:state_enabled="true"
- android:drawable="@drawable/textfield_default" />
- <item android:state_window_focused="false" android:state_enabled="false"
- android:drawable="@drawable/textfield_disabled" />
- <item android:state_pressed="true" android:drawable="@drawable/textfield_pressed" />
+ <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_default" />
+ <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_disabled" />
<item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_selected" />
<item android:state_enabled="true" android:drawable="@drawable/textfield_default" />
<item android:state_focused="true" android:drawable="@drawable/textfield_disabled_selected" />
diff --git a/core/res/res/drawable/edit_text_holo_dark.xml b/core/res/res/drawable/edit_text_holo_dark.xml
index b7d24ff..63ccd1d 100644
--- a/core/res/res/drawable/edit_text_holo_dark.xml
+++ b/core/res/res/drawable/edit_text_holo_dark.xml
@@ -15,14 +15,11 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_window_focused="false" android:state_enabled="true"
- android:drawable="@drawable/textfield_default_holo_dark" />
- <item android:state_window_focused="false" android:state_enabled="false"
- android:drawable="@drawable/textfield_disabled_holo_dark" />
- <item android:state_pressed="true" android:drawable="@drawable/textfield_pressed_holo_dark" />
- <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_selected_holo_dark" />
+ <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_default_holo_dark" />
+ <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_disabled_holo_dark" />
+ <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_active_holo_dark" />
<item android:state_enabled="true" android:drawable="@drawable/textfield_default_holo_dark" />
- <item android:state_focused="true" android:drawable="@drawable/textfield_disabled_selected_holo_dark" />
+ <item android:state_focused="true" android:drawable="@drawable/textfield_disabled_focused_holo_dark" />
<item android:drawable="@drawable/textfield_disabled_holo_dark" />
</selector>
diff --git a/core/res/res/drawable/edit_text_holo_light.xml b/core/res/res/drawable/edit_text_holo_light.xml
index dae39e3..324acda 100644
--- a/core/res/res/drawable/edit_text_holo_light.xml
+++ b/core/res/res/drawable/edit_text_holo_light.xml
@@ -15,14 +15,11 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_window_focused="false" android:state_enabled="true"
- android:drawable="@drawable/textfield_default_holo_light" />
- <item android:state_window_focused="false" android:state_enabled="false"
- android:drawable="@drawable/textfield_disabled_holo_light" />
- <item android:state_pressed="true" android:drawable="@drawable/textfield_pressed_holo_light" />
- <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_selected_holo_light" />
+ <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_default_holo_light" />
+ <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_disabled_holo_light" />
+ <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_active_holo_light" />
<item android:state_enabled="true" android:drawable="@drawable/textfield_default_holo_light" />
- <item android:state_focused="true" android:drawable="@drawable/textfield_disabled_selected_holo_light" />
+ <item android:state_focused="true" android:drawable="@drawable/textfield_disabled_focused_holo_light" />
<item android:drawable="@drawable/textfield_disabled_holo_light" />
</selector>
diff --git a/core/res/res/drawable/edit_text_multiline_holo_dark.xml b/core/res/res/drawable/edit_text_multiline_holo_dark.xml
new file mode 100644
index 0000000..67d2748
--- /dev/null
+++ b/core/res/res/drawable/edit_text_multiline_holo_dark.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_multiline_default_holo_dark" />
+ <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_multiline_disabled_holo_dark" />
+ <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_multiline_active_holo_dark" />
+ <item android:state_enabled="true" android:drawable="@drawable/textfield_multiline_default_holo_dark" />
+ <item android:state_focused="true" android:drawable="@drawable/textfield_multiline_disabled_focused_holo_dark" />
+ <item android:drawable="@drawable/textfield_multiline_disabled_holo_dark" />
+</selector>
diff --git a/core/res/res/drawable/edit_text_multiline_holo_light.xml b/core/res/res/drawable/edit_text_multiline_holo_light.xml
new file mode 100644
index 0000000..08b3ec6
--- /dev/null
+++ b/core/res/res/drawable/edit_text_multiline_holo_light.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_multiline_default_holo_light" />
+ <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_multiline_disabled_holo_light" />
+ <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_multiline_active_holo_light" />
+ <item android:state_enabled="true" android:drawable="@drawable/textfield_multiline_default_holo_light" />
+ <item android:state_focused="true" android:drawable="@drawable/textfield_multiline_disabled_focused_holo_light" />
+ <item android:drawable="@drawable/textfield_multiline_disabled_holo_light" />
+</selector>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 0b61202..55b3258 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -142,6 +142,8 @@
<attr name="editTextColor" format="reference|color" />
<!-- EditText background drawable. -->
<attr name="editTextBackground" format="reference" />
+ <!-- EditText background drawable for multiline EditText. -->
+ <attr name="editTextMultilineBackground" format="reference" />
<!-- A styled string, specifying the style to be used for showing
inline candidate text when composing with an input method. The
@@ -2508,7 +2510,8 @@
<attr name="textLineHeight" />
<!-- Indicates that a non-editable text can be selected. -->
<attr name="textIsSelectable" />
-
+ <!-- A specific background drawable used by multi-line EditText only. -->
+ <attr name="multilineBackground" format="reference"/>
</declare-styleable>
<!-- An <code>input-extras</code> is a container for extra data to supply to
an input method. Contains
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index b2db9b4..dc67f45 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -422,6 +422,7 @@
<item name="android:focusableInTouchMode">true</item>
<item name="android:clickable">true</item>
<item name="android:background">?android:attr/editTextBackground</item>
+ <item name="android:multilineBackground">?android:attr/editTextMultilineBackground</item>
<item name="android:textAppearance">?android:attr/textAppearanceMediumInverse</item>
<item name="android:textColor">?android:attr/editTextColor</item>
<item name="android:gravity">center_vertical</item>
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 88e755f..dd7c8e48 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -72,6 +72,7 @@
<item name="editTextColor">?android:attr/textColorPrimaryInverse</item>
<item name="editTextBackground">@android:drawable/edit_text</item>
+ <item name="editTextMultilineBackground">@android:drawable/edit_text</item>
<item name="candidatesTextStyleSpans">@android:string/candidates_style</item>
@@ -685,6 +686,7 @@
<item name="editTextColor">?android:attr/textColorPrimary</item>
<item name="editTextBackground">@android:drawable/edit_text_holo_dark</item>
+ <item name="editTextMultilineBackground">@android:drawable/edit_text_multiline_holo_dark</item>
<item name="candidatesTextStyleSpans">@android:string/candidates_style</item>
@@ -917,10 +919,11 @@
<item name="textAppearanceSearchResultSubtitle">@android:style/TextAppearance.Holo.Light.SearchResult.Subtitle</item>
<item name="textAppearanceButton">@android:style/TextAppearance.Holo.Light.Widget.Button</item>
-
+
<item name="editTextColor">?android:attr/textColorPrimary</item>
<item name="editTextBackground">@android:drawable/edit_text_holo_light</item>
-
+ <item name="editTextMultilineBackground">@android:drawable/edit_text_multiline_holo_light</item>
+
<item name="candidatesTextStyleSpans">@android:string/candidates_style</item>
<item name="textCheckMark">@android:drawable/indicator_check_mark_light</item>
diff --git a/include/media/IMediaPlayer.h b/include/media/IMediaPlayer.h
index 3d77278..bba7ed7 100644
--- a/include/media/IMediaPlayer.h
+++ b/include/media/IMediaPlayer.h
@@ -34,7 +34,6 @@
virtual void disconnect() = 0;
- virtual status_t setVideoISurface(const sp<ISurface>& surface) = 0;
virtual status_t setVideoSurface(const sp<Surface>& surface) = 0;
virtual status_t prepareAsync() = 0;
virtual status_t start() = 0;
diff --git a/include/media/IOMX.h b/include/media/IOMX.h
index fa775e7..cb36bbb 100644
--- a/include/media/IOMX.h
+++ b/include/media/IOMX.h
@@ -120,30 +120,6 @@
node_id node,
const char *parameter_name,
OMX_INDEXTYPE *index) = 0;
-
- virtual sp<IOMXRenderer> createRenderer(
- const sp<ISurface> &surface,
- const char *componentName,
- OMX_COLOR_FORMATTYPE colorFormat,
- size_t encodedWidth, size_t encodedHeight,
- size_t displayWidth, size_t displayHeight) = 0;
-
- // Note: These methods are _not_ virtual, it exists as a wrapper around
- // the virtual "createRenderer" method above facilitating extraction
- // of the ISurface from a regular Surface or a java Surface object.
- sp<IOMXRenderer> createRenderer(
- const sp<Surface> &surface,
- const char *componentName,
- OMX_COLOR_FORMATTYPE colorFormat,
- size_t encodedWidth, size_t encodedHeight,
- size_t displayWidth, size_t displayHeight);
-
- sp<IOMXRenderer> createRendererFromJavaSurface(
- JNIEnv *env, jobject javaSurface,
- const char *componentName,
- OMX_COLOR_FORMATTYPE colorFormat,
- size_t encodedWidth, size_t encodedHeight,
- size_t displayWidth, size_t displayHeight);
};
struct omx_message {
@@ -190,13 +166,6 @@
virtual void onMessage(const omx_message &msg) = 0;
};
-class IOMXRenderer : public IInterface {
-public:
- DECLARE_META_INTERFACE(OMXRenderer);
-
- virtual void render(IOMX::buffer_id buffer) = 0;
-};
-
////////////////////////////////////////////////////////////////////////////////
class BnOMX : public BnInterface<IOMX> {
@@ -213,13 +182,6 @@
uint32_t flags = 0);
};
-class BnOMXRenderer : public BnInterface<IOMXRenderer> {
-public:
- virtual status_t onTransact(
- uint32_t code, const Parcel &data, Parcel *reply,
- uint32_t flags = 0);
-};
-
} // namespace android
#endif // ANDROID_IOMX_H_
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index 2d55a55..672931e 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -106,7 +106,6 @@
const KeyedVector<String8, String8> *headers = NULL) = 0;
virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0;
- virtual status_t setVideoISurface(const sp<ISurface>& surface) = 0;
virtual status_t setVideoSurface(const sp<Surface>& surface) = 0;
virtual status_t prepare() = 0;
virtual status_t prepareAsync() = 0;
diff --git a/include/media/stagefright/HardwareAPI.h b/include/media/stagefright/HardwareAPI.h
index 4fd281b..17908b4 100644
--- a/include/media/stagefright/HardwareAPI.h
+++ b/include/media/stagefright/HardwareAPI.h
@@ -19,8 +19,6 @@
#define HARDWARE_API_H_
#include <media/stagefright/OMXPluginBase.h>
-#include <media/stagefright/VideoRenderer.h>
-#include <surfaceflinger/ISurface.h>
#include <ui/android_native_buffer.h>
#include <utils/RefBase.h>
@@ -91,13 +89,6 @@
} // namespace android
-extern android::VideoRenderer *createRenderer(
- const android::sp<android::ISurface> &surface,
- const char *componentName,
- OMX_COLOR_FORMATTYPE colorFormat,
- size_t displayWidth, size_t displayHeight,
- size_t decodedWidth, size_t decodedHeight);
-
extern android::OMXPluginBase *createOMXPlugin();
#endif // HARDWARE_API_H_
diff --git a/include/media/stagefright/VideoRenderer.h b/include/media/stagefright/VideoRenderer.h
deleted file mode 100644
index f80b277..0000000
--- a/include/media/stagefright/VideoRenderer.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef VIDEO_RENDERER_H_
-
-#define VIDEO_RENDERER_H_
-
-#include <sys/types.h>
-
-namespace android {
-
-class VideoRenderer {
-public:
- virtual ~VideoRenderer() {}
-
- virtual void render(
- const void *data, size_t size, void *platformPrivate) = 0;
-
-protected:
- VideoRenderer() {}
-
- VideoRenderer(const VideoRenderer &);
- VideoRenderer &operator=(const VideoRenderer &);
-};
-
-} // namespace android
-
-#endif // VIDEO_RENDERER_H_
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp
index 033f316..072cc168 100644
--- a/libs/rs/rsScriptC.cpp
+++ b/libs/rs/rsScriptC.cpp
@@ -65,12 +65,11 @@
void **dest = ((void ***)mEnviroment.mFieldAddress)[ct];
if (rsc->props.mLogScripts) {
- LOGV("%p ScriptC::setupScript slot=%i dst=%p src=%p type=%p", rsc, ct, dest, ptr, mSlots[ct]->getType());
-
- //const uint32_t *p32 = (const uint32_t *)ptr;
- //for (uint32_t ct2=0; ct2 < mSlots[ct]->getType()->getDimX(); ct2++) {
- //LOGE(" %i = 0x%08x ", ct2, p32[ct2]);
- //}
+ if (mSlots[ct].get() != NULL) {
+ LOGV("%p ScriptC::setupScript slot=%i dst=%p src=%p type=%p", rsc, ct, dest, ptr, mSlots[ct]->getType());
+ } else {
+ LOGV("%p ScriptC::setupScript slot=%i dst=%p src=%p type=null", rsc, ct, dest, ptr);
+ }
}
if (dest) {
diff --git a/media/libmedia/IMediaPlayer.cpp b/media/libmedia/IMediaPlayer.cpp
index 1a46715..c287c0a 100644
--- a/media/libmedia/IMediaPlayer.cpp
+++ b/media/libmedia/IMediaPlayer.cpp
@@ -29,7 +29,6 @@
enum {
DISCONNECT = IBinder::FIRST_CALL_TRANSACTION,
SET_VIDEO_SURFACE,
- SET_VIDEO_ISURFACE,
PREPARE_ASYNC,
START,
STOP,
@@ -65,15 +64,6 @@
remote()->transact(DISCONNECT, data, &reply);
}
- status_t setVideoISurface(const sp<ISurface>& surface)
- {
- Parcel data, reply;
- data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor());
- data.writeStrongBinder(surface->asBinder());
- remote()->transact(SET_VIDEO_ISURFACE, data, &reply);
- return reply.readInt32();
- }
-
status_t setVideoSurface(const sp<Surface>& surface)
{
Parcel data, reply;
@@ -245,12 +235,6 @@
disconnect();
return NO_ERROR;
} break;
- case SET_VIDEO_ISURFACE: {
- CHECK_INTERFACE(IMediaPlayer, data, reply);
- sp<ISurface> surface = interface_cast<ISurface>(data.readStrongBinder());
- reply->writeInt32(setVideoISurface(surface));
- return NO_ERROR;
- } break;
case SET_VIDEO_SURFACE: {
CHECK_INTERFACE(IMediaPlayer, data, reply);
sp<Surface> surface = Surface::readFromParcel(data);
diff --git a/media/libmedia/IOMX.cpp b/media/libmedia/IOMX.cpp
index f975217..9ce6738 100644
--- a/media/libmedia/IOMX.cpp
+++ b/media/libmedia/IOMX.cpp
@@ -31,48 +31,9 @@
FILL_BUFFER,
EMPTY_BUFFER,
GET_EXTENSION_INDEX,
- CREATE_RENDERER,
OBSERVER_ON_MSG,
- RENDERER_RENDER,
};
-sp<IOMXRenderer> IOMX::createRenderer(
- const sp<Surface> &surface,
- const char *componentName,
- OMX_COLOR_FORMATTYPE colorFormat,
- size_t encodedWidth, size_t encodedHeight,
- size_t displayWidth, size_t displayHeight) {
- return createRenderer(
- surface->getISurface(),
- componentName, colorFormat, encodedWidth, encodedHeight,
- displayWidth, displayHeight);
-}
-
-sp<IOMXRenderer> IOMX::createRendererFromJavaSurface(
- JNIEnv *env, jobject javaSurface,
- const char *componentName,
- OMX_COLOR_FORMATTYPE colorFormat,
- size_t encodedWidth, size_t encodedHeight,
- size_t displayWidth, size_t displayHeight) {
- jclass surfaceClass = env->FindClass("android/view/Surface");
- if (surfaceClass == NULL) {
- LOGE("Can't find android/view/Surface");
- return NULL;
- }
-
- jfieldID surfaceID = env->GetFieldID(surfaceClass, ANDROID_VIEW_SURFACE_JNI_ID, "I");
- if (surfaceID == NULL) {
- LOGE("Can't find Surface.mSurface");
- return NULL;
- }
-
- sp<Surface> surface = (Surface *)env->GetIntField(javaSurface, surfaceID);
-
- return createRenderer(
- surface, componentName, colorFormat, encodedWidth,
- encodedHeight, displayWidth, displayHeight);
-}
-
class BpOMX : public BpInterface<IOMX> {
public:
BpOMX(const sp<IBinder> &impl)
@@ -395,28 +356,6 @@
return err;
}
-
- virtual sp<IOMXRenderer> createRenderer(
- const sp<ISurface> &surface,
- const char *componentName,
- OMX_COLOR_FORMATTYPE colorFormat,
- size_t encodedWidth, size_t encodedHeight,
- size_t displayWidth, size_t displayHeight) {
- Parcel data, reply;
- data.writeInterfaceToken(IOMX::getInterfaceDescriptor());
-
- data.writeStrongBinder(surface->asBinder());
- data.writeCString(componentName);
- data.writeInt32(colorFormat);
- data.writeInt32(encodedWidth);
- data.writeInt32(encodedHeight);
- data.writeInt32(displayWidth);
- data.writeInt32(displayHeight);
-
- remote()->transact(CREATE_RENDERER, data, &reply);
-
- return interface_cast<IOMXRenderer>(reply.readStrongBinder());
- }
};
IMPLEMENT_META_INTERFACE(OMX, "android.hardware.IOMX");
@@ -767,33 +706,6 @@
return OK;
}
- case CREATE_RENDERER:
- {
- CHECK_INTERFACE(IOMX, data, reply);
-
- sp<ISurface> isurface =
- interface_cast<ISurface>(data.readStrongBinder());
-
- const char *componentName = data.readCString();
-
- OMX_COLOR_FORMATTYPE colorFormat =
- static_cast<OMX_COLOR_FORMATTYPE>(data.readInt32());
-
- size_t encodedWidth = (size_t)data.readInt32();
- size_t encodedHeight = (size_t)data.readInt32();
- size_t displayWidth = (size_t)data.readInt32();
- size_t displayHeight = (size_t)data.readInt32();
-
- sp<IOMXRenderer> renderer =
- createRenderer(isurface, componentName, colorFormat,
- encodedWidth, encodedHeight,
- displayWidth, displayHeight);
-
- reply->writeStrongBinder(renderer->asBinder());
-
- return OK;
- }
-
default:
return BBinder::onTransact(code, data, reply, flags);
}
@@ -839,44 +751,4 @@
}
}
-////////////////////////////////////////////////////////////////////////////////
-
-class BpOMXRenderer : public BpInterface<IOMXRenderer> {
-public:
- BpOMXRenderer(const sp<IBinder> &impl)
- : BpInterface<IOMXRenderer>(impl) {
- }
-
- virtual void render(IOMX::buffer_id buffer) {
- Parcel data, reply;
- data.writeInterfaceToken(IOMXRenderer::getInterfaceDescriptor());
- data.writeIntPtr((intptr_t)buffer);
-
- // NOTE: Do NOT make this a ONE_WAY call, it must be synchronous
- // so that the caller knows when to recycle the buffer.
- remote()->transact(RENDERER_RENDER, data, &reply);
- }
-};
-
-IMPLEMENT_META_INTERFACE(OMXRenderer, "android.hardware.IOMXRenderer");
-
-status_t BnOMXRenderer::onTransact(
- uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags) {
- switch (code) {
- case RENDERER_RENDER:
- {
- CHECK_INTERFACE(IOMXRenderer, data, reply);
-
- IOMX::buffer_id buffer = (void*)data.readIntPtr();
-
- render(buffer);
-
- return NO_ERROR;
- }
-
- default:
- return BBinder::onTransact(code, data, reply, flags);
- }
-}
-
} // namespace android
diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp
index 34e41a1..54b292c 100644
--- a/media/libmedia/mediaplayer.cpp
+++ b/media/libmedia/mediaplayer.cpp
@@ -198,13 +198,6 @@
Mutex::Autolock _l(mLock);
if (mPlayer == 0) return NO_INIT;
- status_t err = mPlayer->setVideoISurface(
- surface == NULL ? NULL : surface->getISurface());
-
- if (err != OK) {
- return err;
- }
-
return mPlayer->setVideoSurface(surface);
}
diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp
index e84c2dc..00e510b 100644
--- a/media/libmediaplayerservice/MediaPlayerService.cpp
+++ b/media/libmediaplayerservice/MediaPlayerService.cpp
@@ -864,14 +864,6 @@
return mStatus;
}
-status_t MediaPlayerService::Client::setVideoISurface(const sp<ISurface>& surface)
-{
- LOGV("[%d] setVideoISurface(%p)", mConnId, surface.get());
- sp<MediaPlayerBase> p = getPlayer();
- if (p == 0) return UNKNOWN_ERROR;
- return p->setVideoISurface(surface);
-}
-
status_t MediaPlayerService::Client::setVideoSurface(const sp<Surface>& surface)
{
LOGV("[%d] setVideoSurface(%p)", mConnId, surface.get());
diff --git a/media/libmediaplayerservice/MediaPlayerService.h b/media/libmediaplayerservice/MediaPlayerService.h
index e197cde..184324c 100644
--- a/media/libmediaplayerservice/MediaPlayerService.h
+++ b/media/libmediaplayerservice/MediaPlayerService.h
@@ -206,7 +206,6 @@
// IMediaPlayer interface
virtual void disconnect();
- virtual status_t setVideoISurface(const sp<ISurface>& surface);
virtual status_t setVideoSurface(const sp<Surface>& surface);
virtual status_t prepareAsync();
virtual status_t start();
diff --git a/media/libmediaplayerservice/MidiFile.h b/media/libmediaplayerservice/MidiFile.h
index 06e4b70..aa8f3f0e 100644
--- a/media/libmediaplayerservice/MidiFile.h
+++ b/media/libmediaplayerservice/MidiFile.h
@@ -35,7 +35,6 @@
const char* path, const KeyedVector<String8, String8> *headers);
virtual status_t setDataSource(int fd, int64_t offset, int64_t length);
- virtual status_t setVideoISurface(const sp<ISurface>& surface) { return UNKNOWN_ERROR; }
virtual status_t setVideoSurface(const sp<Surface>& surface) { return UNKNOWN_ERROR; }
virtual status_t prepare();
virtual status_t prepareAsync();
diff --git a/media/libmediaplayerservice/StagefrightPlayer.cpp b/media/libmediaplayerservice/StagefrightPlayer.cpp
index e0957f6..58ef99b 100644
--- a/media/libmediaplayerservice/StagefrightPlayer.cpp
+++ b/media/libmediaplayerservice/StagefrightPlayer.cpp
@@ -44,13 +44,6 @@
return mPlayer->setDataSource(dup(fd), offset, length);
}
-status_t StagefrightPlayer::setVideoISurface(const sp<ISurface> &surface) {
- LOGV("setVideoISurface");
-
- mPlayer->setISurface(surface);
- return OK;
-}
-
status_t StagefrightPlayer::setVideoSurface(const sp<Surface> &surface) {
LOGV("setVideoSurface");
diff --git a/media/libmediaplayerservice/StagefrightPlayer.h b/media/libmediaplayerservice/StagefrightPlayer.h
index 3899447..c4a2588 100644
--- a/media/libmediaplayerservice/StagefrightPlayer.h
+++ b/media/libmediaplayerservice/StagefrightPlayer.h
@@ -35,7 +35,6 @@
const char *url, const KeyedVector<String8, String8> *headers);
virtual status_t setDataSource(int fd, int64_t offset, int64_t length);
- virtual status_t setVideoISurface(const sp<ISurface> &surface);
virtual status_t setVideoSurface(const sp<Surface> &surface);
virtual status_t prepare();
virtual status_t prepareAsync();
diff --git a/media/libmediaplayerservice/TestPlayerStub.h b/media/libmediaplayerservice/TestPlayerStub.h
index 5eaf592..6abd8e3 100644
--- a/media/libmediaplayerservice/TestPlayerStub.h
+++ b/media/libmediaplayerservice/TestPlayerStub.h
@@ -75,9 +75,6 @@
// All the methods below wrap the mPlayer instance.
- virtual status_t setVideoISurface(const android::sp<android::ISurface>& s) {
- return mPlayer->setVideoISurface(s);
- }
virtual status_t setVideoSurface(const android::sp<android::Surface>& s) {
return mPlayer->setVideoSurface(s);
}
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 41f5f30..ff9f255 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -79,39 +79,16 @@
AwesomeEvent &operator=(const AwesomeEvent &);
};
-struct AwesomeRemoteRenderer : public AwesomeRenderer {
- AwesomeRemoteRenderer(const sp<IOMXRenderer> &target)
- : mTarget(target) {
- }
-
- virtual void render(MediaBuffer *buffer) {
- void *id;
- if (buffer->meta_data()->findPointer(kKeyBufferID, &id)) {
- mTarget->render((IOMX::buffer_id)id);
- }
- }
-
-private:
- sp<IOMXRenderer> mTarget;
-
- AwesomeRemoteRenderer(const AwesomeRemoteRenderer &);
- AwesomeRemoteRenderer &operator=(const AwesomeRemoteRenderer &);
-};
-
struct AwesomeLocalRenderer : public AwesomeRenderer {
AwesomeLocalRenderer(
- bool previewOnly,
- const char *componentName,
OMX_COLOR_FORMATTYPE colorFormat,
- const sp<ISurface> &isurface,
const sp<Surface> &surface,
size_t displayWidth, size_t displayHeight,
size_t decodedWidth, size_t decodedHeight)
- : mTarget(NULL),
- mLibHandle(NULL) {
- init(previewOnly, componentName,
- colorFormat, isurface, surface, displayWidth,
- displayHeight, decodedWidth, decodedHeight);
+ : mTarget(NULL) {
+ init(colorFormat, surface,
+ displayWidth, displayHeight,
+ decodedWidth, decodedHeight);
}
virtual void render(MediaBuffer *buffer) {
@@ -127,22 +104,13 @@
virtual ~AwesomeLocalRenderer() {
delete mTarget;
mTarget = NULL;
-
- if (mLibHandle) {
- dlclose(mLibHandle);
- mLibHandle = NULL;
- }
}
private:
- VideoRenderer *mTarget;
- void *mLibHandle;
+ SoftwareRenderer *mTarget;
void init(
- bool previewOnly,
- const char *componentName,
OMX_COLOR_FORMATTYPE colorFormat,
- const sp<ISurface> &isurface,
const sp<Surface> &surface,
size_t displayWidth, size_t displayHeight,
size_t decodedWidth, size_t decodedHeight);
@@ -152,48 +120,13 @@
};
void AwesomeLocalRenderer::init(
- bool previewOnly,
- const char *componentName,
OMX_COLOR_FORMATTYPE colorFormat,
- const sp<ISurface> &isurface,
const sp<Surface> &surface,
size_t displayWidth, size_t displayHeight,
size_t decodedWidth, size_t decodedHeight) {
- if (!previewOnly) {
- // We will stick to the vanilla software-color-converting renderer
- // for "previewOnly" mode, to avoid unneccessarily switching overlays
- // more often than necessary.
-
- mLibHandle = dlopen("libstagefrighthw.so", RTLD_NOW);
-
- if (mLibHandle) {
- typedef VideoRenderer *(*CreateRendererFunc)(
- const sp<ISurface> &surface,
- const char *componentName,
- OMX_COLOR_FORMATTYPE colorFormat,
- size_t displayWidth, size_t displayHeight,
- size_t decodedWidth, size_t decodedHeight);
-
- CreateRendererFunc func =
- (CreateRendererFunc)dlsym(
- mLibHandle,
- "_Z14createRendererRKN7android2spINS_8ISurfaceEEEPKc20"
- "OMX_COLOR_FORMATTYPEjjjj");
-
- if (func) {
- mTarget =
- (*func)(isurface, componentName, colorFormat,
- displayWidth, displayHeight,
- decodedWidth, decodedHeight);
- }
- }
- }
-
- if (mTarget == NULL) {
- mTarget = new SoftwareRenderer(
- colorFormat, surface, displayWidth, displayHeight,
- decodedWidth, decodedHeight);
- }
+ mTarget = new SoftwareRenderer(
+ colorFormat, surface, displayWidth, displayHeight,
+ decodedWidth, decodedHeight);
}
struct AwesomeNativeWindowRenderer : public AwesomeRenderer {
@@ -867,54 +800,41 @@
}
void AwesomePlayer::initRenderer_l() {
- if (mSurface != NULL || mISurface != NULL) {
- sp<MetaData> meta = mVideoSource->getFormat();
+ if (mSurface == NULL) {
+ return;
+ }
- int32_t format;
- const char *component;
- int32_t decodedWidth, decodedHeight;
- CHECK(meta->findInt32(kKeyColorFormat, &format));
- CHECK(meta->findCString(kKeyDecoderComponent, &component));
- CHECK(meta->findInt32(kKeyWidth, &decodedWidth));
- CHECK(meta->findInt32(kKeyHeight, &decodedHeight));
+ sp<MetaData> meta = mVideoSource->getFormat();
- mVideoRenderer.clear();
+ int32_t format;
+ const char *component;
+ int32_t decodedWidth, decodedHeight;
+ CHECK(meta->findInt32(kKeyColorFormat, &format));
+ CHECK(meta->findCString(kKeyDecoderComponent, &component));
+ CHECK(meta->findInt32(kKeyWidth, &decodedWidth));
+ CHECK(meta->findInt32(kKeyHeight, &decodedHeight));
- // Must ensure that mVideoRenderer's destructor is actually executed
- // before creating a new one.
- IPCThreadState::self()->flushCommands();
+ mVideoRenderer.clear();
- if (mSurface != NULL) {
- if (USE_SURFACE_ALLOC && strncmp(component, "OMX.", 4) == 0) {
- // Hardware decoders avoid the CPU color conversion by decoding
- // directly to ANativeBuffers, so we must use a renderer that
- // just pushes those buffers to the ANativeWindow.
- mVideoRenderer = new AwesomeNativeWindowRenderer(mSurface);
- } else {
- // Other decoders are instantiated locally and as a consequence
- // allocate their buffers in local address space. This renderer
- // then performs a color conversion and copy to get the data
- // into the ANativeBuffer.
- mVideoRenderer = new AwesomeLocalRenderer(
- false, // previewOnly
- component,
- (OMX_COLOR_FORMATTYPE)format,
- mISurface,
- mSurface,
- mVideoWidth, mVideoHeight,
- decodedWidth, decodedHeight);
- }
- } else {
- // Our OMX codecs allocate buffers on the media_server side
- // therefore they require a remote IOMXRenderer that knows how
- // to display them.
- mVideoRenderer = new AwesomeRemoteRenderer(
- mClient.interface()->createRenderer(
- mISurface, component,
- (OMX_COLOR_FORMATTYPE)format,
- decodedWidth, decodedHeight,
- mVideoWidth, mVideoHeight));
- }
+ // Must ensure that mVideoRenderer's destructor is actually executed
+ // before creating a new one.
+ IPCThreadState::self()->flushCommands();
+
+ if (USE_SURFACE_ALLOC && strncmp(component, "OMX.", 4) == 0) {
+ // Hardware decoders avoid the CPU color conversion by decoding
+ // directly to ANativeBuffers, so we must use a renderer that
+ // just pushes those buffers to the ANativeWindow.
+ mVideoRenderer = new AwesomeNativeWindowRenderer(mSurface);
+ } else {
+ // Other decoders are instantiated locally and as a consequence
+ // allocate their buffers in local address space. This renderer
+ // then performs a color conversion and copy to get the data
+ // into the ANativeBuffer.
+ mVideoRenderer = new AwesomeLocalRenderer(
+ (OMX_COLOR_FORMATTYPE)format,
+ mSurface,
+ mVideoWidth, mVideoHeight,
+ decodedWidth, decodedHeight);
}
}
@@ -958,12 +878,6 @@
return (mFlags & PLAYING) || (mFlags & CACHE_UNDERRUN);
}
-void AwesomePlayer::setISurface(const sp<ISurface> &isurface) {
- Mutex::Autolock autoLock(mLock);
-
- mISurface = isurface;
-}
-
void AwesomePlayer::setSurface(const sp<Surface> &surface) {
Mutex::Autolock autoLock(mLock);
@@ -1897,13 +1811,10 @@
mFlags = state->mFlags & (AUTO_LOOPING | LOOPING | AT_EOS);
- if (state->mLastVideoFrame && (mSurface != NULL || mISurface != NULL)) {
+ if (state->mLastVideoFrame && mSurface != NULL) {
mVideoRenderer =
new AwesomeLocalRenderer(
- true, // previewOnly
- "",
(OMX_COLOR_FORMATTYPE)state->mColorFormat,
- mISurface,
mSurface,
state->mVideoWidth,
state->mVideoHeight,
diff --git a/media/libstagefright/include/AwesomePlayer.h b/media/libstagefright/include/AwesomePlayer.h
index 302a1ba..4e63b7a 100644
--- a/media/libstagefright/include/AwesomePlayer.h
+++ b/media/libstagefright/include/AwesomePlayer.h
@@ -79,7 +79,6 @@
bool isPlaying() const;
- void setISurface(const sp<ISurface> &isurface);
void setSurface(const sp<Surface> &surface);
void setAudioSink(const sp<MediaPlayerBase::AudioSink> &audioSink);
status_t setLooping(bool shouldLoop);
@@ -130,7 +129,6 @@
bool mQueueStarted;
wp<MediaPlayerBase> mListener;
- sp<ISurface> mISurface;
sp<Surface> mSurface;
sp<MediaPlayerBase::AudioSink> mAudioSink;
diff --git a/media/libstagefright/include/OMX.h b/media/libstagefright/include/OMX.h
index 5a6c96f9..5fed98a 100644
--- a/media/libstagefright/include/OMX.h
+++ b/media/libstagefright/include/OMX.h
@@ -97,13 +97,6 @@
const char *parameter_name,
OMX_INDEXTYPE *index);
- virtual sp<IOMXRenderer> createRenderer(
- const sp<ISurface> &surface,
- const char *componentName,
- OMX_COLOR_FORMATTYPE colorFormat,
- size_t encodedWidth, size_t encodedHeight,
- size_t displayWidth, size_t displayHeight);
-
virtual void binderDied(const wp<IBinder> &the_late_who);
OMX_ERRORTYPE OnEvent(
diff --git a/media/libstagefright/include/SoftwareRenderer.h b/media/libstagefright/include/SoftwareRenderer.h
index 8d58056..198bfd6 100644
--- a/media/libstagefright/include/SoftwareRenderer.h
+++ b/media/libstagefright/include/SoftwareRenderer.h
@@ -19,15 +19,13 @@
#define SOFTWARE_RENDERER_H_
#include <media/stagefright/ColorConverter.h>
-#include <media/stagefright/VideoRenderer.h>
#include <utils/RefBase.h>
namespace android {
class Surface;
-class MemoryHeapBase;
-class SoftwareRenderer : public VideoRenderer {
+class SoftwareRenderer {
public:
SoftwareRenderer(
OMX_COLOR_FORMATTYPE colorFormat,
@@ -35,9 +33,9 @@
size_t displayWidth, size_t displayHeight,
size_t decodedWidth, size_t decodedHeight);
- virtual ~SoftwareRenderer();
+ ~SoftwareRenderer();
- virtual void render(
+ void render(
const void *data, size_t size, void *platformPrivate);
private:
diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp
index f9f638f..4e9920b 100644
--- a/media/libstagefright/omx/OMX.cpp
+++ b/media/libstagefright/omx/OMX.cpp
@@ -24,14 +24,11 @@
#include <sys/resource.h>
#include "../include/OMX.h"
-#include "OMXRenderer.h"
#include "../include/OMXNodeInstance.h"
-#include "../include/SoftwareRenderer.h"
#include <binder/IMemory.h>
#include <media/stagefright/MediaDebug.h>
-#include <media/stagefright/VideoRenderer.h>
#include <utils/threads.h>
#include "OMXMaster.h"
@@ -442,110 +439,4 @@
mNodeIDToInstance.removeItem(node);
}
-////////////////////////////////////////////////////////////////////////////////
-
-struct SharedVideoRenderer : public VideoRenderer {
- SharedVideoRenderer(void *libHandle, VideoRenderer *obj)
- : mLibHandle(libHandle),
- mObj(obj) {
- }
-
- virtual ~SharedVideoRenderer() {
- delete mObj;
- mObj = NULL;
-
- dlclose(mLibHandle);
- mLibHandle = NULL;
- }
-
- virtual void render(
- const void *data, size_t size, void *platformPrivate) {
- return mObj->render(data, size, platformPrivate);
- }
-
-private:
- void *mLibHandle;
- VideoRenderer *mObj;
-
- SharedVideoRenderer(const SharedVideoRenderer &);
- SharedVideoRenderer &operator=(const SharedVideoRenderer &);
-};
-
-sp<IOMXRenderer> OMX::createRenderer(
- const sp<ISurface> &surface,
- const char *componentName,
- OMX_COLOR_FORMATTYPE colorFormat,
- size_t encodedWidth, size_t encodedHeight,
- size_t displayWidth, size_t displayHeight) {
- Mutex::Autolock autoLock(mLock);
-
- VideoRenderer *impl = NULL;
-
- void *libHandle = dlopen("libstagefrighthw.so", RTLD_NOW);
-
- if (libHandle) {
- typedef VideoRenderer *(*CreateRendererFunc)(
- const sp<ISurface> &surface,
- const char *componentName,
- OMX_COLOR_FORMATTYPE colorFormat,
- size_t displayWidth, size_t displayHeight,
- size_t decodedWidth, size_t decodedHeight);
-
- CreateRendererFunc func =
- (CreateRendererFunc)dlsym(
- libHandle,
- "_Z14createRendererRKN7android2spINS_8ISurfaceEEEPKc20"
- "OMX_COLOR_FORMATTYPEjjjj");
-
- if (func) {
- impl = (*func)(surface, componentName, colorFormat,
- displayWidth, displayHeight, encodedWidth, encodedHeight);
-
- if (impl) {
- impl = new SharedVideoRenderer(libHandle, impl);
- libHandle = NULL;
- }
- }
-
- if (libHandle) {
- dlclose(libHandle);
- libHandle = NULL;
- }
- }
-
- if (!impl) {
-#if 0
- LOGW("Using software renderer.");
- impl = new SoftwareRenderer(
- colorFormat,
- surface,
- displayWidth, displayHeight,
- encodedWidth, encodedHeight);
-#else
- CHECK(!"Should not be here.");
- return NULL;
-#endif
- }
-
- return new OMXRenderer(impl);
-}
-
-OMXRenderer::OMXRenderer(VideoRenderer *impl)
- : mImpl(impl) {
-}
-
-OMXRenderer::~OMXRenderer() {
- delete mImpl;
- mImpl = NULL;
-}
-
-void OMXRenderer::render(IOMX::buffer_id buffer) {
- OMX_BUFFERHEADERTYPE *header = (OMX_BUFFERHEADERTYPE *)buffer;
-
- mImpl->render(
- header->pBuffer + header->nOffset,
- header->nFilledLen,
- header->pPlatformPrivate);
-}
-
} // namespace android
diff --git a/media/libstagefright/omx/OMXRenderer.h b/media/libstagefright/omx/OMXRenderer.h
deleted file mode 100644
index 4d194ce..0000000
--- a/media/libstagefright/omx/OMXRenderer.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef OMX_RENDERER_H_
-
-#define OMX_RENDERER_H_
-
-#include <media/IOMX.h>
-
-namespace android {
-
-class VideoRenderer;
-
-class OMXRenderer : public BnOMXRenderer {
-public:
- // Assumes ownership of "impl".
- OMXRenderer(VideoRenderer *impl);
- virtual ~OMXRenderer();
-
- virtual void render(IOMX::buffer_id buffer);
-
-private:
- VideoRenderer *mImpl;
-
- OMXRenderer(const OMXRenderer &);
- OMXRenderer &operator=(const OMXRenderer &);
-};
-
-} // namespace android
-
-#endif // OMX_RENDERER_H_
diff --git a/media/tests/players/invoke_mock_media_player.cpp b/media/tests/players/invoke_mock_media_player.cpp
index 53308be..1e3731e 100644
--- a/media/tests/players/invoke_mock_media_player.cpp
+++ b/media/tests/players/invoke_mock_media_player.cpp
@@ -68,7 +68,6 @@
}
virtual status_t setDataSource(int fd, int64_t offset, int64_t length) {return OK;}
- virtual status_t setVideoISurface(const sp<ISurface>& surface) {return OK;}
virtual status_t setVideoSurface(const sp<Surface>& surface) {return OK;}
virtual status_t prepare() {return OK;}
virtual status_t prepareAsync() {return OK;}
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index cd58284..a0a1974 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -7327,16 +7327,22 @@
pw.println(" ");
pw.println("Package warning messages:");
File fname = getSettingsProblemFile();
- FileInputStream in;
+ FileInputStream in = null;
try {
in = new FileInputStream(fname);
int avail = in.available();
byte[] data = new byte[avail];
in.read(data);
pw.print(new String(data));
- in.close();
} catch (FileNotFoundException e) {
} catch (IOException e) {
+ } finally {
+ if (in != null) {
+ try {
+ in.close();
+ } catch (IOException e) {
+ }
+ }
}
}
}
diff --git a/services/java/com/android/server/ProcessStats.java b/services/java/com/android/server/ProcessStats.java
index 43dbcc0..1a12a84 100644
--- a/services/java/com/android/server/ProcessStats.java
+++ b/services/java/com/android/server/ProcessStats.java
@@ -799,8 +799,9 @@
}
private String readFile(String file, char endChar) {
+ FileInputStream is = null;
try {
- FileInputStream is = new FileInputStream(file);
+ is = new FileInputStream(file);
int len = is.read(mBuffer);
is.close();
@@ -815,6 +816,13 @@
}
} catch (java.io.FileNotFoundException e) {
} catch (java.io.IOException e) {
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (java.io.IOException e) {
+ }
+ }
}
return null;
}
@@ -841,4 +849,3 @@
}
}
}
-