Merge change 22178 into eclair
* changes:
- add a reset to EntityIterator to allow it to go back to the beginning - clean up the debug printing of SyncResult
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp
index 185e6ac..6b2d8ad 100644
--- a/cmds/stagefright/stagefright.cpp
+++ b/cmds/stagefright/stagefright.cpp
@@ -23,6 +23,8 @@
#include <binder/IServiceManager.h>
#include <binder/ProcessState.h>
#include <media/IMediaPlayerService.h>
+#include <media/stagefright/CachingDataSource.h>
+#include <media/stagefright/HTTPDataSource.h>
#include <media/stagefright/MediaDebug.h>
#include <media/stagefright/MediaPlayerImpl.h>
#include <media/stagefright/MediaExtractor.h>
@@ -191,7 +193,13 @@
for (int k = 0; k < argc; ++k) {
const char *filename = argv[k];
- sp<MmapSource> dataSource = new MmapSource(filename);
+ sp<DataSource> dataSource;
+ if (!strncasecmp("http://", filename, 7)) {
+ dataSource = new HTTPDataSource(filename);
+ dataSource = new CachingDataSource(dataSource, 64 * 1024, 10);
+ } else {
+ dataSource = new MmapSource(filename);
+ }
bool isJPEG = false;
diff --git a/core/java/android/net/SSLCertificateSocketFactory.java b/core/java/android/net/SSLCertificateSocketFactory.java
index deaa3c3..a97b9e5 100644
--- a/core/java/android/net/SSLCertificateSocketFactory.java
+++ b/core/java/android/net/SSLCertificateSocketFactory.java
@@ -41,6 +41,7 @@
import org.apache.harmony.xnet.provider.jsse.SSLClientSessionCache;
import org.apache.harmony.xnet.provider.jsse.SSLContextImpl;
+import org.apache.harmony.xnet.provider.jsse.SSLParameters;
/**
* SSLSocketFactory that provides optional (on debug devices, only) skipping of ssl certificfate
@@ -54,28 +55,6 @@
private static final String LOG_TAG = "SSLCertificateSocketFactory";
- private static X509TrustManager sDefaultTrustManager;
-
- static {
- try {
- TrustManagerFactory tmf = TrustManagerFactory.getInstance("X509");
- tmf.init((KeyStore)null);
- TrustManager[] tms = tmf.getTrustManagers();
- if (tms != null) {
- for (TrustManager tm : tms) {
- if (tm instanceof X509TrustManager) {
- sDefaultTrustManager = (X509TrustManager)tm;
- break;
- }
- }
- }
- } catch (NoSuchAlgorithmException e) {
- Log.e(LOG_TAG, "Unable to get X509 Trust Manager ", e);
- } catch (KeyStoreException e) {
- Log.e(LOG_TAG, "Key Store exception while initializing TrustManagerFactory ", e);
- }
- }
-
private static final TrustManager[] TRUST_MANAGER = new TrustManager[] {
new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
@@ -155,20 +134,13 @@
private boolean hasValidCertificateChain(Certificate[] certs)
throws IOException {
- if (sDefaultTrustManager == null) {
- if (Config.LOGD) {
- Log.d(LOG_TAG,"hasValidCertificateChain():" +
- " null default trust manager!");
- }
- throw new IOException("null default trust manager");
- }
-
boolean trusted = (certs != null && (certs.length > 0));
if (trusted) {
try {
// the authtype we pass in doesn't actually matter
- sDefaultTrustManager.checkServerTrusted((X509Certificate[]) certs, "RSA");
+ SSLParameters.getDefaultTrustManager()
+ .checkServerTrusted((X509Certificate[]) certs, "RSA");
} catch (GeneralSecurityException e) {
String exceptionMessage = e != null ? e.getMessage() : "none";
if (Config.LOGD) {
diff --git a/core/java/android/net/http/CertificateChainValidator.java b/core/java/android/net/http/CertificateChainValidator.java
index 91fa900..ed6b4c2 100644
--- a/core/java/android/net/http/CertificateChainValidator.java
+++ b/core/java/android/net/http/CertificateChainValidator.java
@@ -16,6 +16,8 @@
package android.net.http;
+import org.apache.harmony.xnet.provider.jsse.SSLParameters;
+
import java.io.IOException;
import java.security.cert.Certificate;
@@ -47,11 +49,6 @@
= new CertificateChainValidator();
/**
- * Default trust manager (used to perform CA certificate validation)
- */
- private X509TrustManager mDefaultTrustManager;
-
- /**
* @return The singleton instance of the certificator chain validator
*/
public static CertificateChainValidator getInstance() {
@@ -62,28 +59,7 @@
* Creates a new certificate chain validator. This is a pivate constructor.
* If you need a Certificate chain validator, call getInstance().
*/
- private CertificateChainValidator() {
- try {
- TrustManagerFactory trustManagerFactory
- = TrustManagerFactory.getInstance("X509");
- trustManagerFactory.init((KeyStore)null);
- TrustManager[] trustManagers =
- trustManagerFactory.getTrustManagers();
- if (trustManagers != null && trustManagers.length > 0) {
- for (TrustManager trustManager : trustManagers) {
- if (trustManager instanceof X509TrustManager) {
- mDefaultTrustManager = (X509TrustManager)(trustManager);
- break;
- }
- }
- }
- } catch (Exception exc) {
- if (HttpLog.LOGV) {
- HttpLog.v("CertificateChainValidator():" +
- " failed to initialize the trust manager");
- }
- }
- }
+ private CertificateChainValidator() {}
/**
* Performs the handshake and server certificates validation
@@ -156,7 +132,7 @@
// report back to the user.
//
try {
- mDefaultTrustManager.checkServerTrusted(
+ SSLParameters.getDefaultTrustManager().checkServerTrusted(
serverCertificates, "RSA");
// no errors!!!
@@ -186,7 +162,7 @@
// check if the last certificate in the chain (root) is trusted
X509Certificate[] rootCertificateChain = { currCertificate };
try {
- mDefaultTrustManager.checkServerTrusted(
+ SSLParameters.getDefaultTrustManager().checkServerTrusted(
rootCertificateChain, "RSA");
} catch (CertificateExpiredException e) {
String errorMessage = e.getMessage();
diff --git a/core/java/android/widget/FastScroller.java b/core/java/android/widget/FastScroller.java
index 2da777a..67c0def 100644
--- a/core/java/android/widget/FastScroller.java
+++ b/core/java/android/widget/FastScroller.java
@@ -55,7 +55,7 @@
private int mThumbY;
private RectF mOverlayPos;
- private int mOverlaySize = 104;
+ private int mOverlaySize;
private AbsListView mList;
private boolean mScrollCompleted;
@@ -119,10 +119,10 @@
private void useThumbDrawable(Context context, Drawable drawable) {
mThumbDrawable = drawable;
- mThumbW = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
- 64, context.getResources().getDisplayMetrics());
- mThumbH = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
- 52, context.getResources().getDisplayMetrics());
+ mThumbW = context.getResources().getDimensionPixelSize(
+ com.android.internal.R.dimen.fastscroll_thumb_width);
+ mThumbH = context.getResources().getDimensionPixelSize(
+ com.android.internal.R.dimen.fastscroll_thumb_height);
mChangedBounds = true;
}
@@ -138,7 +138,9 @@
mScrollCompleted = true;
getSectionsFromIndexer();
-
+
+ mOverlaySize = context.getResources().getDimensionPixelSize(
+ com.android.internal.R.dimen.fastscroll_overlay_size);
mOverlayPos = new RectF();
mScrollFade = new ScrollFade();
mPaint = new Paint();
diff --git a/core/res/res/drawable/contact_picture_bg.9.png b/core/res/res/drawable/contact_picture_bg.9.png
deleted file mode 100644
index ae9c709..0000000
--- a/core/res/res/drawable/contact_picture_bg.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable/fasttrack_badge_middle.xml b/core/res/res/drawable/fasttrack_badge_middle.xml
new file mode 100644
index 0000000..6df230a
--- /dev/null
+++ b/core/res/res/drawable/fasttrack_badge_middle.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:state_focused="false"
+ android:state_selected="false"
+ android:state_pressed="false"
+ android:drawable="@drawable/fasttrack_badge_middle_normal" />
+
+ <item
+ android:state_pressed="true"
+ android:drawable="@drawable/fasttrack_badge_middle_pressed" />
+
+</selector>
\ No newline at end of file
diff --git a/core/res/res/drawable/fasttrack_badge_middle_normal.9.png b/core/res/res/drawable/fasttrack_badge_middle_normal.9.png
new file mode 100644
index 0000000..1ac6ef9
--- /dev/null
+++ b/core/res/res/drawable/fasttrack_badge_middle_normal.9.png
Binary files differ
diff --git a/core/res/res/drawable/fasttrack_badge_middle_pressed.9.png b/core/res/res/drawable/fasttrack_badge_middle_pressed.9.png
new file mode 100644
index 0000000..33921ba
--- /dev/null
+++ b/core/res/res/drawable/fasttrack_badge_middle_pressed.9.png
Binary files differ
diff --git a/core/res/res/layout-ja/contact_header_name.xml b/core/res/res/layout-ja/contact_header_name.xml
index 20df5c6..9dceeb6 100644
--- a/core/res/res/layout-ja/contact_header_name.xml
+++ b/core/res/res/layout-ja/contact_header_name.xml
@@ -27,8 +27,8 @@
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="end"
- android:textAppearance="?android:attr/textAppearanceLargeInverse"
- android:textColor="@android:color/secondary_text_light"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textStyle="bold"
/>
<TextView android:id="@+id/phonetic_name"
@@ -36,8 +36,7 @@
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="end"
- android:textAppearance="?android:attr/textAppearanceSmallInverse"
- android:textColor="@android:color/secondary_text_light"
+ android:textAppearance="?android:attr/textAppearanceSmall"
/>
</LinearLayout>
diff --git a/core/res/res/layout/contact_header.xml b/core/res/res/layout/contact_header.xml
index 73e379b..8c1957d 100644
--- a/core/res/res/layout/contact_header.xml
+++ b/core/res/res/layout/contact_header.xml
@@ -15,26 +15,27 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/banner"
+ android:id="@+id/banner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
- android:background="@drawable/contact_header_bg"
+ android:background="@drawable/title_bar_tall"
android:paddingRight="5dip"
android:gravity="center_vertical">
<ImageView android:id="@+id/photo"
- android:layout_width="64dip"
+ android:layout_width="56dip"
android:layout_height="64dip"
- android:layout_marginRight="7dip"
- android:layout_marginLeft="2dip"
+ android:layout_marginRight="10dip"
+ android:layout_marginLeft="10dip"
android:scaleType="fitCenter"
- android:background="@drawable/contact_picture_bg"/>
+ android:background="@drawable/fasttrack_badge_middle"/>
<LinearLayout
android:layout_width="0dip"
- android:layout_height="fill_parent"
+ android:layout_height="wrap_content"
android:layout_weight="1"
+ android:layout_marginTop="5dip"
android:orientation="vertical">
<!-- "Name" field is locale-specific. -->
@@ -42,9 +43,11 @@
<TextView android:id="@+id/status"
android:layout_width="fill_parent"
- android:layout_height="wrap_content"
+ android:layout_height="0dip"
+ android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:maxLines="2"/>
+ android:maxLines="2"
+ android:ellipsize="end"/>
</LinearLayout>
diff --git a/core/res/res/layout/contact_header_name.xml b/core/res/res/layout/contact_header_name.xml
index 9039702..9a56fb4 100644
--- a/core/res/res/layout/contact_header_name.xml
+++ b/core/res/res/layout/contact_header_name.xml
@@ -19,8 +19,8 @@
android:id="@+id/name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMediumInverse"
- android:textColor="@android:color/secondary_text_light"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textStyle="bold"
android:singleLine="true"
android:ellipsize="end"
/>
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 6461460a..6a3538d 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -28,4 +28,10 @@
<dimen name="toast_y_offset">64dip</dimen>
<!-- Height of the status bar -->
<dimen name="status_bar_height">25dip</dimen>
+ <!-- Size of the fastscroll hint letter -->
+ <dimen name="fastscroll_overlay_size">104dp</dimen>
+ <!-- Width of the fastscroll thumb -->
+ <dimen name="fastscroll_thumb_width">64dp</dimen>
+ <!-- Height of the fastscroll thumb -->
+ <dimen name="fastscroll_thumb_height">52dp</dimen>
</resources>
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs
index 11f8c7b..0b33739 100644
--- a/docs/html/guide/guide_toc.cs
+++ b/docs/html/guide/guide_toc.cs
@@ -139,6 +139,7 @@
<li><a href="<?cs var:toroot ?>guide/topics/manifest/intent-filter-element.html"><intent-filter></a></li>
<li><a href="<?cs var:toroot ?>guide/topics/manifest/manifest-element.html"><manifest></a></li>
<li><a href="<?cs var:toroot ?>guide/topics/manifest/meta-data-element.html"><meta-data></a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/path-permission-element.html"><path-permission></a></li>
<li><a href="<?cs var:toroot ?>guide/topics/manifest/permission-element.html"><permission></a></li>
<li><a href="<?cs var:toroot ?>guide/topics/manifest/permission-group-element.html"><permission-group></a></li>
<li><a href="<?cs var:toroot ?>guide/topics/manifest/permission-tree-element.html"><permission-tree></a></li>
diff --git a/docs/html/guide/topics/manifest/manifest-intro.jd b/docs/html/guide/topics/manifest/manifest-intro.jd
index 9e1b18d..89171c1 100644
--- a/docs/html/guide/topics/manifest/manifest-intro.jd
+++ b/docs/html/guide/topics/manifest/manifest-intro.jd
@@ -112,6 +112,7 @@
<a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a>
<a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html"><grant-uri-permission /></a>
+ <a href="{@docRoot}guide/topics/manifest/path-permission-element.html"><path-permission /></a>
<a href="{@docRoot}guide/topics/manifest/meta-data-element.html"><meta-data /></a>
<a href="{@docRoot}guide/topics/manifest/provider-element.html"></provider></a>
@@ -140,6 +141,7 @@
<br/><code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html"><meta-data></a></code>
+<br/><code><a href="{@docRoot}guide/topics/manifest/path-permission-element.html"><path-permission /></a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/permission-element.html"><permission></a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/permission-group-element.html"><permission-group></a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/permission-tree-element.html"><permission-tree></a></code>
diff --git a/docs/html/guide/topics/manifest/path-permission-element.jd b/docs/html/guide/topics/manifest/path-permission-element.jd
new file mode 100644
index 0000000..5c271a7
--- /dev/null
+++ b/docs/html/guide/topics/manifest/path-permission-element.jd
@@ -0,0 +1,104 @@
+page.title=<path-permission>
+@jd:body
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">
+<path-permission android:<a href="#path">path</a>="<i>string</i>"
+ android:<a href="#pathPrefix">pathPrefix</a>="<i>string</i>"
+ android:<a href="#pathPattern">pathPattern</a>="<i>string</i>"
+ android:<a href="#permission">permission</a>="<i>string</i>"
+ android:<a href="#readPermission">readPermission</a>="<i>string</i>"
+ android:<a href="#writePermission">writePermission</a>="<i>string</i>" />
+</pre></dd>
+
+<dt>contained in:</dt>
+<dd><code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code></dd>
+
+<!--
+<dt>can contain:</dt>
+</dd>
+-->
+
+<dt>description:</dt>
+<dd>Defines the path and required permissions for a specific subset of data
+within a content provider. This element can be
+specified multiple times to supply multiple paths.
+
+</dd>
+
+<dt>attributes:</dt>
+
+<dd><dl class="attr">
+<dt><a name="path"></a>{@code android:path}</dt>
+<dd>A complete URI path for a subset of content provider data.
+Permission can be granted only to the particular data identified by this path.
+When used to provide search suggestion content, it must be appended
+with "/search_suggest_query".
+</dd>
+
+<dt><a name="pathPrefix"></a>{@code android:pathPrefix}</dt>
+<dd>The initial part of a URI path for a subset of content provider data.
+Permission can be granted to all data subsets with paths that share this initial part.
+</dd>
+
+<dt><a name="pathPattern"></a>{@code android:pathPattern}</dt>
+<dd>A complete URI path for a subset of content provider data,
+but one that can use the following wildcards:
+
+<ul>
+<li>An asterisk ('<code class="Code prettyprint">*</code>'). This matches a sequence of 0 to many occurrences of
+the immediately preceding character.</li>
+
+<li>A period followed by an asterisk ("<code class="Code prettyprint">.*</code>"). This matches any sequence of
+0 or more characters.</li>
+</ul>
+
+<p>
+Because '<code class="Code prettyprint">\</code>' is used as an escape character when the string is read
+from XML (before it is parsed as a pattern), you will need to double-escape.
+For example, a literal '<code class="Code prettyprint">*</code>' would be written as "<code class="Code prettyprint">\\*</code>" and a
+literal '<code class="Code prettyprint">\</code>' would be written as "<code class="Code prettyprint">\\</code>". This is basically
+the same as what you would need to write if constructing the string in Java code.
+</p>
+<p>
+For more information on these types of patterns, see the descriptions of
+<a href="/reference/android/os/PatternMatcher.html#PATTERN_LITERAL">PATTERN_LITERAL</a>,
+<a href="/reference/android/os/PatternMatcher.html#PATTERN_PREFIX">PATTERN_PREFIX</a>, and
+<a href="/reference/android/os/PatternMatcher.html#PATTERN_SIMPLE_GLOB">PATTERN_SIMPLE_GLOB</a> in the
+<a href="/reference/android/os/PatternMatcher.html">PatternMatcher</a> class.
+</p>
+</dd>
+
+<dt><a name="permission"></a>{@code android:permission}</dt>
+<dd>The name of a permission that clients must have in order to read or write the
+content provider's data. This attribute is a convenient way of setting a
+single permission for both reading and writing. However, the
+<code>readPermission</code> and
+<code>writePermission</code> attributes take precedence
+over this one.
+</dd>
+
+<dt><a name="readPermission"></a>{@code android:readPermission}</dt>
+<dd>A permission that clients must have in order to query the content provider.
+</dd>
+
+<dt><a name="writePermission"></a>{@code android:writePermission}</dt>
+<dd>A permission that clients must have in order to make changes to the data controlled by the content provider.
+</dd>
+
+
+
+</dl></dd>
+
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 4</dd>
+
+<dt>see also:</dt>
+<dd>{@link android.app.SearchManager}</dd>
+<dd>{@link android.Manifest.permission}</dd>
+<dd><a href="/guide/topics/security/security.html">Security and
+Permissions</a></dd>
+
+</dl>
diff --git a/docs/html/guide/topics/manifest/provider-element.jd b/docs/html/guide/topics/manifest/provider-element.jd
index 2bb4ff4..3942f95 100644
--- a/docs/html/guide/topics/manifest/provider-element.jd
+++ b/docs/html/guide/topics/manifest/provider-element.jd
@@ -25,7 +25,9 @@
<dt>can contain:</dt>
<dd><code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html"><meta-data></a></code>
-<br/><code><a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html"><grant-uri-permission></a></code></dd>
+<br/><code><a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html"><grant-uri-permission></a></code>
+<br/><code><a href="{@docRoot}guide/topics/manifest/path-permission-element.html"><path-permission /></a></code>
+</dd>
<dt>description:</dt>
<dd>Declares a content provider — a subclass of
diff --git a/graphics/java/android/renderscript/Element.java b/graphics/java/android/renderscript/Element.java
index 3f75069..aeec739 100644
--- a/graphics/java/android/renderscript/Element.java
+++ b/graphics/java/android/renderscript/Element.java
@@ -111,7 +111,8 @@
NX (15),
NY (16),
NZ (17),
- INDEX (18);
+ INDEX (18),
+ POINT_SIZE(19);
int mID;
DataKind(int id) {
@@ -241,13 +242,18 @@
add(DataType.FLOAT, DataKind.Z, false, 32, null);
return this;
}
-
+
public Builder addFloatST() {
add(DataType.FLOAT, DataKind.S, false, 32, null);
add(DataType.FLOAT, DataKind.T, false, 32, null);
return this;
}
+ public Builder addFloatPointSize() {
+ add(DataType.FLOAT, DataKind.POINT_SIZE, false, 32, null);
+ return this;
+ }
+
public Builder addFloatRGB() {
add(DataType.FLOAT, DataKind.RED, false, 32, null);
add(DataType.FLOAT, DataKind.GREEN, false, 32, null);
diff --git a/graphics/java/android/renderscript/ProgramFragment.java b/graphics/java/android/renderscript/ProgramFragment.java
index aad09f6..392d93d 100644
--- a/graphics/java/android/renderscript/ProgramFragment.java
+++ b/graphics/java/android/renderscript/ProgramFragment.java
@@ -68,6 +68,7 @@
RenderScript mRS;
Element mIn;
Element mOut;
+ boolean mPointSpriteEnable;
private class Slot {
Type mType;
@@ -85,6 +86,7 @@
mIn = in;
mOut = out;
mSlots = new Slot[MAX_SLOT];
+ mPointSpriteEnable = false;
for(int ct=0; ct < MAX_SLOT; ct++) {
mSlots[ct] = new Slot();
}
@@ -117,6 +119,9 @@
mSlots[slot].mEnv = env;
}
+ public void setPointSpriteTexCoordinateReplacement(boolean enable) {
+ mPointSpriteEnable = enable;
+ }
static synchronized ProgramFragment internalCreate(RenderScript rs, Builder b) {
int inID = 0;
@@ -127,21 +132,18 @@
if (b.mOut != null) {
outID = b.mOut.mID;
}
- rs.nProgramFragmentBegin(inID, outID);
+ rs.nProgramFragmentBegin(inID, outID, b.mPointSpriteEnable);
for(int ct=0; ct < MAX_SLOT; ct++) {
if(b.mSlots[ct].mTexEnable) {
Slot s = b.mSlots[ct];
+ int typeID = 0;
if(s.mType != null) {
- rs.nProgramFragmentSetType(ct, s.mType.mID);
+ typeID = s.mType.mID;
}
- rs.nProgramFragmentSetTexEnable(ct, true);
- if(s.mEnv != null) {
- rs.nProgramFragmentSetEnvMode(ct, s.mEnv.mID);
- }
+ rs.nProgramFragmentSetSlot(ct, true, s.mEnv.mID, typeID);
}
}
-
int id = rs.nProgramFragmentCreate();
return new ProgramFragment(id, rs);
}
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index fca1c7a..1bdabe7 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -158,12 +158,10 @@
native void nProgramFragmentStoreDither(boolean enable);
native int nProgramFragmentStoreCreate();
- native void nProgramFragmentBegin(int in, int out);
+ native void nProgramFragmentBegin(int in, int out, boolean pointSpriteEnable);
native void nProgramFragmentBindTexture(int vpf, int slot, int a);
native void nProgramFragmentBindSampler(int vpf, int slot, int s);
- native void nProgramFragmentSetType(int slot, int vt);
- native void nProgramFragmentSetEnvMode(int slot, int env);
- native void nProgramFragmentSetTexEnable(int slot, boolean enable);
+ native void nProgramFragmentSetSlot(int slot, boolean enable, int env, int vt);
native int nProgramFragmentCreate();
native void nProgramVertexBindAllocation(int pv, int mID);
@@ -283,7 +281,11 @@
// Root state
public void contextBindRootScript(Script s) {
- nContextBindRootScript(s.mID);
+ int id = 0;
+ if(s != null) {
+ id = s.mID;
+ }
+ nContextBindRootScript(id);
}
//public void contextBindSampler(Sampler s, int slot) {
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index 001ecd0..fede0e50 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -952,11 +952,11 @@
// ---------------------------------------------------------------------------
static void
-nProgramFragmentBegin(JNIEnv *_env, jobject _this, jint in, jint out)
+nProgramFragmentBegin(JNIEnv *_env, jobject _this, jint in, jint out, jboolean pointSpriteEnable)
{
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
- LOG_API("nProgramFragmentBegin, con(%p), in(%p), out(%p)", con, (RsElement)in, (RsElement)out);
- rsProgramFragmentBegin(con, (RsElement)in, (RsElement)out);
+ LOG_API("nProgramFragmentBegin, con(%p), in(%p), out(%p) PointSprite(%i)", con, (RsElement)in, (RsElement)out, pointSpriteEnable);
+ rsProgramFragmentBegin(con, (RsElement)in, (RsElement)out, pointSpriteEnable);
}
static void
@@ -976,27 +976,11 @@
}
static void
-nProgramFragmentSetType(JNIEnv *_env, jobject _this, jint slot, jint vt)
+nProgramFragmentSetSlot(JNIEnv *_env, jobject _this, jint slot, jboolean enable, jint env, jint vt)
{
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
- LOG_API("nProgramFragmentSetType, con(%p), slot(%i), vt(%p)", con, slot, (RsType)vt);
- rsProgramFragmentSetType(con, slot, (RsType)vt);
-}
-
-static void
-nProgramFragmentSetEnvMode(JNIEnv *_env, jobject _this, jint slot, jint env)
-{
- RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
- LOG_API("nProgramFragmentSetEnvMode, con(%p), slot(%i), vt(%i)", con, slot, env);
- rsProgramFragmentSetEnvMode(con, slot, (RsTexEnvMode)env);
-}
-
-static void
-nProgramFragmentSetTexEnable(JNIEnv *_env, jobject _this, jint slot, jboolean enable)
-{
- RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
- LOG_API("nProgramFragmentSetTexEnable, con(%p), slot(%i), enable(%i)", con, slot, enable);
- rsProgramFragmentSetTexEnable(con, slot, enable);
+ LOG_API("nProgramFragmentSetType, con(%p), slot(%i), enable(%i), env(%i), vt(%p)", con, slot, enable, env, (RsType)vt);
+ rsProgramFragmentSetSlot(con, slot, enable, (RsTexEnvMode)env, (RsType)vt);
}
static jint
@@ -1305,12 +1289,10 @@
{"nProgramFragmentStoreDither", "(Z)V", (void*)nProgramFragmentStoreDither },
{"nProgramFragmentStoreCreate", "()I", (void*)nProgramFragmentStoreCreate },
-{"nProgramFragmentBegin", "(II)V", (void*)nProgramFragmentBegin },
+{"nProgramFragmentBegin", "(IIZ)V", (void*)nProgramFragmentBegin },
{"nProgramFragmentBindTexture", "(III)V", (void*)nProgramFragmentBindTexture },
{"nProgramFragmentBindSampler", "(III)V", (void*)nProgramFragmentBindSampler },
-{"nProgramFragmentSetType", "(II)V", (void*)nProgramFragmentSetType },
-{"nProgramFragmentSetEnvMode", "(II)V", (void*)nProgramFragmentSetEnvMode },
-{"nProgramFragmentSetTexEnable", "(IZ)V", (void*)nProgramFragmentSetTexEnable },
+{"nProgramFragmentSetSlot", "(IZII)V", (void*)nProgramFragmentSetSlot },
{"nProgramFragmentCreate", "()I", (void*)nProgramFragmentCreate },
{"nProgramVertexBindAllocation", "(II)V", (void*)nProgramVertexBindAllocation },
diff --git a/libs/rs/RenderScript.h b/libs/rs/RenderScript.h
index e4cf00f..2f60c9f 100644
--- a/libs/rs/RenderScript.h
+++ b/libs/rs/RenderScript.h
@@ -80,7 +80,8 @@
RS_KIND_NX,
RS_KIND_NY,
RS_KIND_NZ,
- RS_KIND_INDEX
+ RS_KIND_INDEX,
+ RS_KIND_POINT_SIZE
};
enum RsElementPredefined {
diff --git a/libs/rs/java/Galaxy/src/com/android/galaxy/rs/GalaxyRS.java b/libs/rs/java/Galaxy/src/com/android/galaxy/rs/GalaxyRS.java
index c6f5816..fae92f7 100644
--- a/libs/rs/java/Galaxy/src/com/android/galaxy/rs/GalaxyRS.java
+++ b/libs/rs/java/Galaxy/src/com/android/galaxy/rs/GalaxyRS.java
@@ -115,7 +115,7 @@
loadTextures();
ScriptC.Builder sb = new ScriptC.Builder(mRS);
- sb.setType(mStateType, "State", 0);
+ sb.setType(mStateType, "State", RSID_STATE);
sb.setScript(mResources, R.raw.galaxy);
sb.setRoot(true);
diff --git a/libs/rs/rs.spec b/libs/rs/rs.spec
index 1a81021..e275f27 100644
--- a/libs/rs/rs.spec
+++ b/libs/rs/rs.spec
@@ -361,6 +361,7 @@
ProgramFragmentBegin {
param RsElement in
param RsElement out
+ param bool pointSpriteEnable
}
ProgramFragmentBindTexture {
@@ -375,19 +376,11 @@
param RsSampler s
}
-ProgramFragmentSetType {
- param uint32_t slot
- param RsType t
- }
-
-ProgramFragmentSetEnvMode {
- param uint32_t slot
- param RsTexEnvMode env
- }
-
-ProgramFragmentSetTexEnable {
+ProgramFragmentSetSlot {
param uint32_t slot
param bool enable
+ param RsTexEnvMode env
+ param RsType t
}
ProgramFragmentCreate {
diff --git a/libs/rs/rsComponent.cpp b/libs/rs/rsComponent.cpp
index b88710c..4a043f3 100644
--- a/libs/rs/rsComponent.cpp
+++ b/libs/rs/rsComponent.cpp
@@ -24,7 +24,7 @@
Component::Component()
{
mType = FLOAT;
- mKind = NONE;
+ mKind = USER;
mIsNormalized = false;
mBits = 0;
}
diff --git a/libs/rs/rsComponent.h b/libs/rs/rsComponent.h
index 6342f1b..5856524 100644
--- a/libs/rs/rsComponent.h
+++ b/libs/rs/rsComponent.h
@@ -34,13 +34,13 @@
};
enum DataKind {
- NONE,
+ USER,
RED, GREEN, BLUE, ALPHA, LUMINANCE, INTENSITY,
X, Y, Z, W,
S, T, Q, R,
NX, NY, NZ,
INDEX,
- USER
+ POINT_SIZE
};
diff --git a/libs/rs/rsProgramFragment.cpp b/libs/rs/rsProgramFragment.cpp
index 9df07bf..4ef6835 100644
--- a/libs/rs/rsProgramFragment.cpp
+++ b/libs/rs/rsProgramFragment.cpp
@@ -24,7 +24,7 @@
using namespace android::renderscript;
-ProgramFragment::ProgramFragment(Element *in, Element *out) :
+ProgramFragment::ProgramFragment(Element *in, Element *out, bool pointSpriteEnable) :
Program(in, out)
{
for (uint32_t ct=0; ct < MAX_TEXTURE; ct++) {
@@ -32,6 +32,7 @@
mTextureDimensions[ct] = 2;
}
mTextureEnableMask = 0;
+ mPointSpriteEnable = pointSpriteEnable;
mEnvModes[1] = RS_TEX_ENV_MODE_DECAL;
}
@@ -54,6 +55,7 @@
}
glEnable(GL_TEXTURE_2D);
+ //glTexEnvi(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, mPointSpriteEnable);
glBindTexture(GL_TEXTURE_2D, mTextures[ct]->getTextureID());
switch(mEnvModes[ct]) {
@@ -94,7 +96,6 @@
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_ALPHA);
}
}
-
glActiveTexture(GL_TEXTURE0);
mDirty = false;
}
@@ -178,7 +179,7 @@
void ProgramFragmentState::init(Context *rsc, int32_t w, int32_t h)
{
- ProgramFragment *pf = new ProgramFragment(NULL, NULL);
+ ProgramFragment *pf = new ProgramFragment(NULL, NULL, false);
mDefault.set(pf);
}
@@ -186,10 +187,10 @@
namespace android {
namespace renderscript {
-void rsi_ProgramFragmentBegin(Context * rsc, RsElement in, RsElement out)
+void rsi_ProgramFragmentBegin(Context * rsc, RsElement in, RsElement out, bool pointSpriteEnable)
{
delete rsc->mStateFragment.mPF;
- rsc->mStateFragment.mPF = new ProgramFragment((Element *)in, (Element *)out);
+ rsc->mStateFragment.mPF = new ProgramFragment((Element *)in, (Element *)out, pointSpriteEnable);
}
void rsi_ProgramFragmentBindTexture(Context *rsc, RsProgramFragment vpf, uint32_t slot, RsAllocation a)
@@ -204,27 +205,20 @@
pf->bindSampler(slot, static_cast<Sampler *>(s));
}
-void rsi_ProgramFragmentSetType(Context *rsc, uint32_t slot, RsType vt)
+void rsi_ProgramFragmentSetSlot(Context *rsc, uint32_t slot, bool enable, RsTexEnvMode env, RsType vt)
{
const Type *t = static_cast<const Type *>(vt);
- uint32_t dim = 1;
- if (t->getDimY()) {
- dim ++;
- if (t->getDimZ()) {
+ if (t) {
+ uint32_t dim = 1;
+ if (t->getDimY()) {
dim ++;
+ if (t->getDimZ()) {
+ dim ++;
+ }
}
+ rsc->mStateFragment.mPF->setType(slot, t->getElement(), dim);
}
-
- rsc->mStateFragment.mPF->setType(slot, t->getElement(), dim);
-}
-
-void rsi_ProgramFragmentSetEnvMode(Context *rsc, uint32_t slot, RsTexEnvMode env)
-{
rsc->mStateFragment.mPF->setEnvMode(slot, env);
-}
-
-void rsi_ProgramFragmentSetTexEnable(Context *rsc, uint32_t slot, bool enable)
-{
rsc->mStateFragment.mPF->setTexEnable(slot, enable);
}
diff --git a/libs/rs/rsProgramFragment.h b/libs/rs/rsProgramFragment.h
index 57fb6a5..bd45342 100644
--- a/libs/rs/rsProgramFragment.h
+++ b/libs/rs/rsProgramFragment.h
@@ -32,7 +32,7 @@
- ProgramFragment(Element *in, Element *out);
+ ProgramFragment(Element *in, Element *out, bool pointSpriteEnable);
virtual ~ProgramFragment();
virtual void setupGL(ProgramFragmentState *);
@@ -64,6 +64,7 @@
// Hacks to create a program for now
RsTexEnvMode mEnvModes[MAX_TEXTURE];
uint32_t mTextureEnableMask;
+ bool mPointSpriteEnable;
};
class ProgramFragmentState
diff --git a/libs/rs/rsSampler.cpp b/libs/rs/rsSampler.cpp
index c14c371..332d532 100644
--- a/libs/rs/rsSampler.cpp
+++ b/libs/rs/rsSampler.cpp
@@ -143,6 +143,7 @@
ss->mWrapS,
ss->mWrapT,
ss->mWrapR);
+ s->incRef();
return s;
}
diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp
index 5f8ee2a..84a39aa 100644
--- a/libs/rs/rsScriptC_Lib.cpp
+++ b/libs/rs/rsScriptC_Lib.cpp
@@ -729,7 +729,7 @@
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, s);
}
-static void SC_hsb(float h, float s, float b, float a)
+static void SC_hsbToRgb(float h, float s, float b, float* rgb)
{
float red = 0.0f;
float green = 0.0f;
@@ -779,7 +779,26 @@
break;
}
- glColor4f(red, green, blue, a);
+ rgb[0] = red;
+ rgb[1] = green;
+ rgb[2] = blue;
+}
+
+static int SC_hsbToAbgr(float h, float s, float b, float a)
+{
+ float rgb[3];
+ SC_hsbToRgb(h, s, b, rgb);
+ return int(a * 255.0f) << 24 |
+ int(rgb[2] * 255.0f) << 16 |
+ int(rgb[1] * 255.0f) << 8 |
+ int(rgb[0] * 255.0f);
+}
+
+static void SC_hsb(float h, float s, float b, float a)
+{
+ float rgb[3];
+ SC_hsbToRgb(h, s, b, rgb);
+ glColor4f(rgb[0], rgb[1], rgb[2], a);
}
static void SC_uploadToTexture(RsAllocation va, uint32_t baseMipLevel)
@@ -809,11 +828,21 @@
LOGE("%s %f", s, f);
}
+static void SC_debugHexF(const char *s, float f)
+{
+ LOGE("%s 0x%x", s, *((int *) (&f)));
+}
+
static void SC_debugI32(const char *s, int32_t i)
{
LOGE("%s %i", s, i);
}
+static void SC_debugHexI32(const char *s, int32_t i)
+{
+ LOGE("%s 0x%x", s, i);
+}
+
static uint32_t SC_getWidth()
{
GET_TLS();
@@ -1055,6 +1084,10 @@
"void", "(float, float, float, float)" },
{ "hsb", (void *)&SC_hsb,
"void", "(float, float, float, float)" },
+ { "hsbToRgb", (void *)&SC_hsbToRgb,
+ "void", "(float, float, float, float*)" },
+ { "hsbToAbgr", (void *)&SC_hsbToAbgr,
+ "int", "(float, float, float, float)" },
{ "ambient", (void *)&SC_ambient,
"void", "(float, float, float, float)" },
{ "diffuse", (void *)&SC_diffuse,
@@ -1088,6 +1121,10 @@
"void", "(void *, float)" },
{ "debugI32", (void *)&SC_debugI32,
"void", "(void *, int)" },
+ { "debugHexF", (void *)&SC_debugHexF,
+ "void", "(void *, float)" },
+ { "debugHexI32", (void *)&SC_debugHexI32,
+ "void", "(void *, int)" },
{ NULL, NULL, NULL, NULL }
diff --git a/libs/rs/rsTriangleMesh.cpp b/libs/rs/rsTriangleMesh.cpp
index 8c7bc92..99f8adb 100644
--- a/libs/rs/rsTriangleMesh.cpp
+++ b/libs/rs/rsTriangleMesh.cpp
@@ -199,6 +199,7 @@
memcpy(tm->mIndexData, tmc->mIndexData.array(), tm->mIndexDataSize);
tm->analyzeElement();
+ tm->incRef();
return tm;
}
@@ -248,16 +249,16 @@
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, tm->mBufferObjects[1]);
glEnableClientState(GL_VERTEX_ARRAY);
- glVertexPointer(tm->mSizeCoord,
- GL_FLOAT,
- tm->mVertexElement->getSizeBytes(),
+ glVertexPointer(tm->mSizeCoord,
+ GL_FLOAT,
+ tm->mVertexElement->getSizeBytes(),
(void *)tm->mVertexElement->getComponentOffsetBytes(tm->mOffsetCoord));
if (tm->mSizeTex) {
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glTexCoordPointer(tm->mSizeTex,
- GL_FLOAT,
- tm->mVertexElement->getSizeBytes(),
+ glTexCoordPointer(tm->mSizeTex,
+ GL_FLOAT,
+ tm->mVertexElement->getSizeBytes(),
(void *)tm->mVertexElement->getComponentOffsetBytes(tm->mOffsetTex));
} else {
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
@@ -265,8 +266,8 @@
if (tm->mSizeNorm) {
glEnableClientState(GL_NORMAL_ARRAY);
- glNormalPointer(GL_FLOAT,
- tm->mVertexElement->getSizeBytes(),
+ glNormalPointer(GL_FLOAT,
+ tm->mVertexElement->getSizeBytes(),
(void *)tm->mVertexElement->getComponentOffsetBytes(tm->mOffsetNorm));
} else {
glDisableClientState(GL_NORMAL_ARRAY);
diff --git a/libs/rs/rsType.cpp b/libs/rs/rsType.cpp
index a40a152..5a9090e 100644
--- a/libs/rs/rsType.cpp
+++ b/libs/rs/rsType.cpp
@@ -230,6 +230,13 @@
mGL.mTex[texNum].size = 4;
break;
+ case Component::POINT_SIZE:
+ rsAssert(!mGL.mPointSize.size);
+ mGL.mPointSize.size = 1;
+ mGL.mPointSize.offset = mElement->getComponentOffsetBytes(ct);
+ mGL.mPointSize.type = c->getGLType();
+ break;
+
default:
break;
}
@@ -280,6 +287,13 @@
}
glClientActiveTexture(GL_TEXTURE0);
+ if (mGL.mPointSize.size) {
+ glEnableClientState(GL_POINT_SIZE_ARRAY_OES);
+ glPointSizePointerOES(mGL.mPointSize.type,
+ stride,
+ (void *)mGL.mPointSize.offset);
+ }
+
}
diff --git a/libs/rs/rsType.h b/libs/rs/rsType.h
index 60d75d7..6c39a4c 100644
--- a/libs/rs/rsType.h
+++ b/libs/rs/rsType.h
@@ -118,6 +118,7 @@
VertexComponent_t mNorm;
VertexComponent_t mColor;
VertexComponent_t mTex[RS_MAX_TEXTURE];
+ VertexComponent_t mPointSize;
};
GLState_t mGL;
void makeGLComponents();
diff --git a/opengl/java/android/opengl/GLSurfaceView.java b/opengl/java/android/opengl/GLSurfaceView.java
index 132473a..022da0c 100644
--- a/opengl/java/android/opengl/GLSurfaceView.java
+++ b/opengl/java/android/opengl/GLSurfaceView.java
@@ -655,25 +655,27 @@
EGLConfig closestConfig = null;
int closestDistance = 1000;
for(EGLConfig config : configs) {
- int r = findConfigAttrib(egl, display, config,
- EGL10.EGL_RED_SIZE, 0);
- int g = findConfigAttrib(egl, display, config,
- EGL10.EGL_GREEN_SIZE, 0);
- int b = findConfigAttrib(egl, display, config,
- EGL10.EGL_BLUE_SIZE, 0);
- int a = findConfigAttrib(egl, display, config,
- EGL10.EGL_ALPHA_SIZE, 0);
int d = findConfigAttrib(egl, display, config,
EGL10.EGL_DEPTH_SIZE, 0);
int s = findConfigAttrib(egl, display, config,
EGL10.EGL_STENCIL_SIZE, 0);
- int distance = Math.abs(r - mRedSize)
- + Math.abs(g - mGreenSize)
- + Math.abs(b - mBlueSize) + Math.abs(a - mAlphaSize)
- + Math.abs(d - mDepthSize) + Math.abs(s - mStencilSize);
- if (distance < closestDistance) {
- closestDistance = distance;
- closestConfig = config;
+ if (d >= mDepthSize && s>= mStencilSize) {
+ int r = findConfigAttrib(egl, display, config,
+ EGL10.EGL_RED_SIZE, 0);
+ int g = findConfigAttrib(egl, display, config,
+ EGL10.EGL_GREEN_SIZE, 0);
+ int b = findConfigAttrib(egl, display, config,
+ EGL10.EGL_BLUE_SIZE, 0);
+ int a = findConfigAttrib(egl, display, config,
+ EGL10.EGL_ALPHA_SIZE, 0);
+ int distance = Math.abs(r - mRedSize)
+ + Math.abs(g - mGreenSize)
+ + Math.abs(b - mBlueSize)
+ + Math.abs(a - mAlphaSize);
+ if (distance < closestDistance) {
+ closestDistance = distance;
+ closestConfig = config;
+ }
}
}
return closestConfig;
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp
index 445e681..d51b333 100644
--- a/opengl/libs/EGL/Loader.cpp
+++ b/opengl/libs/EGL/Loader.cpp
@@ -224,12 +224,12 @@
void *Loader::load_driver(const char* driver, gl_hooks_t* hooks, uint32_t mask)
{
- //LOGD("%s", driver);
void* dso = dlopen(driver, RTLD_NOW | RTLD_LOCAL);
- LOGE_IF(!dso, "%s", dlerror());
if (dso == 0)
return 0;
+ LOGD("loaded %s", driver);
+
if (mask & EGL) {
getProcAddress = (getProcAddressType)dlsym(dso, "eglGetProcAddress");
diff --git a/tests/DumpRenderTree/assets/run_layout_tests.py b/tests/DumpRenderTree/assets/run_layout_tests.py
index 49165d0..c056de5 100755
--- a/tests/DumpRenderTree/assets/run_layout_tests.py
+++ b/tests/DumpRenderTree/assets/run_layout_tests.py
@@ -22,7 +22,7 @@
use --refresh-test-list option *once* to re-generate test list on the card.
Some other options are:
- --rebaseline generates expected layout tests results under /sdcard/android/expected_result/
+ --rebaseline generates expected layout tests results under /sdcard/android/expected_result/
--time-out-ms (default is 8000 millis) for each test
--adb-options="-e" passes option string to adb
--results-directory=..., (default is ./layout-test-results) directory name under which results are stored.
@@ -51,11 +51,11 @@
def DumpRenderTreeFinished(adb_cmd):
""" Check if DumpRenderTree finished running tests
-
+
Args:
output: adb_cmd string
"""
-
+
# pull /sdcard/android/running_test.txt, if the content is "#DONE", it's done
shell_cmd_str = adb_cmd + " shell cat /sdcard/android/running_test.txt"
adb_output = subprocess.Popen(shell_cmd_str, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
@@ -69,7 +69,7 @@
"""
old_file = open(old_results, "r")
new_file = open(new_results, "r")
- diff_file = open(diff_results, "a")
+ diff_file = open(diff_results, "a")
# Read lines from each file
ndict = new_file.readlines()
@@ -122,7 +122,7 @@
"""
logging.info("Comparing results to " + ref_dir)
- diff_result = os.path.join(results_dir, "layout_tests_diff.txt")
+ diff_result = os.path.join(results_dir, "layout_tests_diff.txt")
if os.path.exists(diff_result):
os.remove(diff_result)
@@ -136,7 +136,7 @@
def main(options, args):
"""Run the tests. Will call sys.exit when complete.
-
+
Args:
options: a dictionary of command line options
args: a list of sub directories or files to test
@@ -198,7 +198,7 @@
shell_cmd_str = adb_cmd + " shell cat /sdcard/android/running_test.txt"
crashed_test = subprocess.Popen(shell_cmd_str, shell=True, stdout=subprocess.PIPE).communicate()[0]
-
+
logging.info(crashed_test + " CRASHED");
crashed_tests.append(crashed_test);
@@ -226,14 +226,15 @@
result_files = ["/sdcard/layout_tests_passed.txt",
"/sdcard/layout_tests_failed.txt",
"/sdcard/layout_tests_nontext.txt"]
- for file in result_files:
+ for file in result_files:
shell_cmd_str = adb_cmd + " pull " + file + " " + results_dir
adb_output = subprocess.Popen(shell_cmd_str, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
logging.debug(adb_output)
-
+
# Create the crash list.
fp = open(results_dir + "/layout_tests_crashed.txt", "w");
- fp.writelines('\n'.join(crashed_tests))
+ for crashed_test in crashed_tests:
+ fp.writelines(crashed_test + '\n')
fp.close()
# Count the number of tests in each category.