From c7c7afd7a1af36e787266815487f4600196406b8 Mon Sep 17 00:00:00 2001
From: Dirk Dougherty
Date: Mon, 24 May 2010 09:07:14 -0700
Subject: [PATCH 1/4] Doc change: Fix incorrect adt version reference etc.
Change-Id: I79b3f43c64f3c0cd98b245dac001fca4a1008bda
---
docs/html/index.jd | 5 ++---
docs/html/resources/tutorials/hello-world.jd | 4 ++--
docs/html/sdk/eclipse-adt.jd | 2 +-
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/docs/html/index.jd b/docs/html/index.jd
index 0ba5e08184b17..01940e82b31bf 100644
--- a/docs/html/index.jd
+++ b/docs/html/index.jd
@@ -14,9 +14,8 @@ home=true
diff --git a/docs/html/resources/tutorials/hello-world.jd b/docs/html/resources/tutorials/hello-world.jd
index 7bad0541114aa..77ffc6f46b9f2 100644
--- a/docs/html/resources/tutorials/hello-world.jd
+++ b/docs/html/resources/tutorials/hello-world.jd
@@ -299,7 +299,7 @@ programmatically-constructed example:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@id+/textview"
+ android:id="@+id/textview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/hello"/>
@@ -410,7 +410,7 @@ the following XML:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@id+/textview"
+ android:id="@+id/textview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/hello"/>
diff --git a/docs/html/sdk/eclipse-adt.jd b/docs/html/sdk/eclipse-adt.jd
index 57eac1f0320ce..f5558ab831a68 100644
--- a/docs/html/sdk/eclipse-adt.jd
+++ b/docs/html/sdk/eclipse-adt.jd
@@ -95,7 +95,7 @@ padding: .25em 1em;
-ADT 0.9.6 (March 2010)
+ADT 0.9.7
(May 2010)
From 7e5e3745cf0103219a13071fbd488c3c01da85d9 Mon Sep 17 00:00:00 2001
From: Adam Powell
Date: Mon, 24 May 2010 15:13:41 -0700
Subject: [PATCH 2/4] Fix bug 2710825 - Prevent ExpandableListView from
scrolling too far when expanding children.
Change-Id: I21b37647c5ad16e4f57fdda433e3b3ee2c7c83ad
---
core/java/android/widget/AbsListView.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 48e7f79d38e41..fcfecb30ca70f 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -2645,7 +2645,7 @@ public abstract class AbsListView extends AdapterView implements Te
mScrollDuration);
mLastSeenPos = lastPos;
- if (lastPos != mTargetPos) {
+ if (lastPos < mTargetPos) {
post(this);
}
break;
@@ -2671,7 +2671,7 @@ public abstract class AbsListView extends AdapterView implements Te
final int nextViewHeight = nextView.getHeight();
final int nextViewTop = nextView.getTop();
final int extraScroll = mExtraScroll;
- if (nextPos != mBoundPos) {
+ if (nextPos < mBoundPos) {
smoothScrollBy(Math.max(0, nextViewHeight + nextViewTop - extraScroll),
mScrollDuration);
@@ -2704,7 +2704,7 @@ public abstract class AbsListView extends AdapterView implements Te
mLastSeenPos = firstPos;
- if (firstPos != mTargetPos) {
+ if (firstPos > mTargetPos) {
post(this);
}
break;
@@ -2728,7 +2728,7 @@ public abstract class AbsListView extends AdapterView implements Te
final int lastViewTop = lastView.getTop();
final int lastViewPixelsShowing = listHeight - lastViewTop;
mLastSeenPos = lastPos;
- if (lastPos != mBoundPos) {
+ if (lastPos > mBoundPos) {
smoothScrollBy(-(lastViewPixelsShowing - mExtraScroll), mScrollDuration);
post(this);
} else {
From d1055a250c00b0c2516ec406a8cf9a5ab1c0b7ae Mon Sep 17 00:00:00 2001
From: Robert Greenwalt
Date: Tue, 25 May 2010 15:54:52 -0700
Subject: [PATCH 3/4] Make the NTP Cache max-age gservices-settable
Trying to make Throttle polling more energy efficient.
bug:2708119
Change-Id: I2b75639e202dcbcee11047c43407a22de04ce350
---
core/java/android/provider/Settings.java | 8 ++++++++
.../java/com/android/server/ThrottleService.java | 13 ++++++++++---
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index e8c09b0d9f9ec..9f19f119f827a 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -3332,6 +3332,14 @@ public final class Settings {
*/
public static final String THROTTLE_HELP_URI = "throttle_help_uri";
+ /**
+ * The length of time in Sec that we allow our notion of NTP time
+ * to be cached before we refresh it
+ * @hide
+ */
+ public static final String THROTTLE_MAX_NTP_CACHE_AGE_SEC =
+ "throttle_max_ntp_cache_age_sec";
+
/**
* @hide
diff --git a/services/java/com/android/server/ThrottleService.java b/services/java/com/android/server/ThrottleService.java
index 23c1adcc288c0..f0b2210c33886 100644
--- a/services/java/com/android/server/ThrottleService.java
+++ b/services/java/com/android/server/ThrottleService.java
@@ -197,6 +197,8 @@ public class ThrottleService extends IThrottleManager.Stub {
Settings.Secure.THROTTLE_NOTIFICATION_TYPE), false, this);
resolver.registerContentObserver(Settings.Secure.getUriFor(
Settings.Secure.THROTTLE_HELP_URI), false, this);
+ resolver.registerContentObserver(Settings.Secure.getUriFor(
+ Settings.Secure.THROTTLE_MAX_NTP_CACHE_AGE_SEC), false, this);
}
@Override
@@ -432,10 +434,13 @@ public class ThrottleService extends IThrottleManager.Stub {
mPolicyNotificationsAllowedMask = Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.THROTTLE_NOTIFICATION_TYPE, defaultNotificationType);
+ mMaxNtpCacheAgeSec = Settings.Secure.getInt(mContext.getContentResolver(),
+ Settings.Secure.THROTTLE_MAX_NTP_CACHE_AGE_SEC, MAX_NTP_CACHE_AGE_SEC);
+
Slog.d(TAG, "onPolicyChanged testing=" + testing +", period=" + mPolicyPollPeriodSec +
", threshold=" + mPolicyThreshold + ", value=" + mPolicyThrottleValue +
", resetDay=" + mPolicyResetDay + ", noteType=" +
- mPolicyNotificationsAllowedMask);
+ mPolicyNotificationsAllowedMask + ", maxNtpCacheAge=" + mMaxNtpCacheAgeSec);
// force updates
mThrottleIndex = THROTTLE_INDEX_UNINITIALIZED;
@@ -715,8 +720,9 @@ public class ThrottleService extends IThrottleManager.Stub {
getBestTime();
}
- private static final int MAX_NTP_CACHE_AGE = 30 * 1000;
+ private static final int MAX_NTP_CACHE_AGE_SEC = 60 * 60 * 24; // 1 day
private static final int MAX_NTP_FETCH_WAIT = 10 * 1000;
+ private int mMaxNtpCacheAgeSec = MAX_NTP_CACHE_AGE_SEC;
private long cachedNtp;
private long cachedNtpTimestamp;
@@ -724,7 +730,7 @@ public class ThrottleService extends IThrottleManager.Stub {
if (mNtpServer != null) {
if (mNtpActive) {
long ntpAge = SystemClock.elapsedRealtime() - cachedNtpTimestamp;
- if (ntpAge < MAX_NTP_CACHE_AGE) {
+ if (ntpAge < mMaxNtpCacheAgeSec * 1000) {
if (VDBG) Slog.v(TAG, "using cached time");
return cachedNtp + ntpAge;
}
@@ -1091,6 +1097,7 @@ public class ThrottleService extends IThrottleManager.Stub {
" seconds.");
pw.println("Polling every " + mPolicyPollPeriodSec + " seconds");
pw.println("Current Throttle Index is " + mThrottleIndex);
+ pw.println("Max NTP Cache Age is " + mMaxNtpCacheAgeSec);
for (int i = 0; i < mRecorder.getPeriodCount(); i++) {
pw.println(" Period[" + i + "] - read:" + mRecorder.getPeriodRx(i) + ", written:" +
From 48584d7b8f5e56b73bb13180bf6546b2647c1b28 Mon Sep 17 00:00:00 2001
From: Yu Shan Emily Lau
Date: Tue, 25 May 2010 14:13:10 -0700
Subject: [PATCH 4/4] Added the runtime parameters for the mediarecorder stress
test. Set the total number of the stress loops of camera preview memory test
to 200.
Change-Id: I5a0278095155afd669ffee9bd599ddfffdcc42bf
---
.../MediaRecorderStressTestRunner.java | 59 ++++++++++++++++++
.../performance/MediaPlayerPerformance.java | 26 ++++----
.../stress/MediaRecorderStressTest.java | 61 ++++++++++++++++---
3 files changed, 126 insertions(+), 20 deletions(-)
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaRecorderStressTestRunner.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaRecorderStressTestRunner.java
index ae9e102c10b45..3e46e27a80aba 100755
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaRecorderStressTestRunner.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaRecorderStressTestRunner.java
@@ -16,6 +16,8 @@
package com.android.mediaframeworktest;
+import android.media.MediaRecorder;
+import android.os.Bundle;
import android.test.InstrumentationTestRunner;
import android.test.InstrumentationTestSuite;
import com.android.mediaframeworktest.stress.MediaRecorderStressTest;
@@ -25,6 +27,17 @@ import junit.framework.TestSuite;
public class MediaRecorderStressTestRunner extends InstrumentationTestRunner {
+ // Default recorder settings
+ public static int mIterations = 100;
+ public static int mVideoEncoder = MediaRecorder.VideoEncoder.H263;
+ public static int mAudioEncdoer = MediaRecorder.AudioEncoder.AMR_NB;
+ public static int mFrameRate = 20;
+ public static int mVideoWidth = 352;
+ public static int mVideoHeight = 288;
+ public static int mBitRate = 100;
+ public static boolean mRemoveVideo = true;
+ public static int mDuration = 10000;
+
@Override
public TestSuite getAllTests() {
TestSuite suite = new InstrumentationTestSuite(this);
@@ -37,4 +50,50 @@ public class MediaRecorderStressTestRunner extends InstrumentationTestRunner {
public ClassLoader getLoader() {
return MediaRecorderStressTestRunner.class.getClassLoader();
}
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ String iterations = (String) icicle.get("iterations");
+ String video_encoder = (String) icicle.get("video_encoder");
+ String audio_encoder = (String) icicle.get("audio_encoder");
+ String frame_rate = (String) icicle.get("frame_rate");
+ String video_width = (String) icicle.get("video_width");
+ String video_height = (String) icicle.get("video_height");
+ String bit_rate = (String) icicle.get("bit_rate");
+ String record_duration = (String) icicle.get("record_duration");
+ String remove_videos = (String) icicle.get("remove_videos");
+
+ if (iterations != null ) {
+ mIterations = Integer.parseInt(iterations);
+ }
+ if ( video_encoder != null) {
+ mVideoEncoder = Integer.parseInt(video_encoder);
+ }
+ if ( audio_encoder != null) {
+ mAudioEncdoer = Integer.parseInt(audio_encoder);
+ }
+ if (frame_rate != null) {
+ mFrameRate = Integer.parseInt(frame_rate);
+ }
+ if (video_width != null) {
+ mVideoWidth = Integer.parseInt(video_width);
+ }
+ if (video_height != null) {
+ mVideoHeight = Integer.parseInt(video_height);
+ }
+ if (bit_rate != null) {
+ mBitRate = Integer.parseInt(bit_rate);
+ }
+ if (record_duration != null) {
+ mDuration = Integer.parseInt(record_duration);
+ }
+ if (remove_videos != null) {
+ if (remove_videos.compareTo("true") == 0) {
+ mRemoveVideo = true;
+ } else {
+ mRemoveVideo = false;
+ }
+ }
+ }
}
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java
index 265228155c3f0..a0ef90532cd10 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java
@@ -237,18 +237,20 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase