Merge branch 'eclair' into eclair-release

This commit is contained in:
The Android Automerger
2009-11-08 08:54:18 -08:00
32 changed files with 1126 additions and 271 deletions

View File

@@ -111799,6 +111799,17 @@
visibility="public"
>
</field>
<field name="DATA_ACTIVITY_DORMANT"
type="int"
transient="false"
volatile="false"
value="4"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="DATA_ACTIVITY_IN"
type="int"
transient="false"
@@ -111939,6 +111950,28 @@
visibility="public"
>
</field>
<field name="NETWORK_TYPE_1xRTT"
type="int"
transient="false"
volatile="false"
value="7"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="NETWORK_TYPE_CDMA"
type="int"
transient="false"
volatile="false"
value="4"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="NETWORK_TYPE_EDGE"
type="int"
transient="false"
@@ -111950,6 +111983,28 @@
visibility="public"
>
</field>
<field name="NETWORK_TYPE_EVDO_0"
type="int"
transient="false"
volatile="false"
value="5"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="NETWORK_TYPE_EVDO_A"
type="int"
transient="false"
volatile="false"
value="6"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="NETWORK_TYPE_GPRS"
type="int"
transient="false"
@@ -111983,6 +112038,17 @@
visibility="public"
>
</field>
<field name="PHONE_TYPE_CDMA"
type="int"
transient="false"
volatile="false"
value="2"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="PHONE_TYPE_GSM"
type="int"
transient="false"

View File

@@ -105888,6 +105888,17 @@
<parameter name="time" type="long">
</parameter>
</method>
<method name="isScreenOn"
return="boolean"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="newWakeLock"
return="android.os.PowerManager.WakeLock"
abstract="false"
@@ -123754,6 +123765,34 @@
</parameter>
</method>
</class>
<class name="WallpaperSettingsActivity"
extends="android.preference.PreferenceActivity"
abstract="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<constructor name="WallpaperSettingsActivity"
type="android.service.wallpaper.WallpaperSettingsActivity"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</constructor>
<field name="EXTRA_PREVIEW_MODE"
type="java.lang.String"
transient="false"
volatile="false"
value="&quot;android.service.wallpaper.PREVIEW_MODE&quot;"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
</class>
</package>
<package name="android.speech"
>
@@ -172849,6 +172888,17 @@
visibility="public"
>
</constructor>
<method name="getContentDisposition"
return="java.lang.String"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="getContentLength"
return="long"
abstract="false"
@@ -172893,6 +172943,17 @@
visibility="public"
>
</method>
<method name="getExpiresString"
return="java.lang.String"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="getHttpStatusCode"
return="int"
abstract="false"
@@ -173017,6 +173078,23 @@
<parameter name="w" type="android.webkit.WebView">
</parameter>
</constructor>
<method name="addMessageToConsole"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="message" type="java.lang.String">
</parameter>
<parameter name="lineNumber" type="int">
</parameter>
<parameter name="sourceID" type="java.lang.String">
</parameter>
</method>
<method name="createWindow"
return="android.webkit.WebView"
abstract="false"
@@ -173069,6 +173147,30 @@
visibility="public"
>
</method>
<method name="getVisitedHistory"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="callback" type="android.webkit.ValueCallback&lt;java.lang.String[]&gt;">
</parameter>
</method>
<method name="getWebChromeClient"
return="android.webkit.WebChromeClient"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="onCloseWindow"
return="void"
abstract="false"
@@ -173141,6 +173243,32 @@
<parameter name="resend" type="android.os.Message">
</parameter>
</method>
<method name="onGeolocationPermissionsHidePrompt"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="onGeolocationPermissionsShowPrompt"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="origin" type="java.lang.String">
</parameter>
<parameter name="callback" type="android.webkit.GeolocationPermissions.Callback">
</parameter>
</method>
<method name="onJsAlert"
return="void"
abstract="false"
@@ -173203,6 +173331,17 @@
<parameter name="defaultValue" type="java.lang.String">
</parameter>
</method>
<method name="onJsTimeout"
return="boolean"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="onLoadResource"
return="void"
abstract="false"
@@ -173257,6 +173396,23 @@
<parameter name="newProgress" type="int">
</parameter>
</method>
<method name="onReachedMaxAppCacheSize"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="spaceNeeded" type="long">
</parameter>
<parameter name="totalUsedQuota" type="long">
</parameter>
<parameter name="quotaUpdater" type="android.webkit.WebStorage.QuotaUpdater">
</parameter>
</method>
<method name="onReceivedError"
return="void"
abstract="false"
@@ -173743,6 +173899,82 @@
visibility="public"
>
</constructor>
<method name="allow"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="origin" type="java.lang.String">
</parameter>
</method>
<method name="clear"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="origin" type="java.lang.String">
</parameter>
</method>
<method name="clearAll"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="getAllowed"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="origin" type="java.lang.String">
</parameter>
<parameter name="callback" type="android.webkit.ValueCallback&lt;java.lang.Boolean&gt;">
</parameter>
</method>
<method name="getInstance"
return="android.webkit.GeolocationPermissions"
abstract="false"
native="false"
synchronized="false"
static="true"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="getOrigins"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="callback" type="android.webkit.ValueCallback&lt;java.util.Set&gt;">
</parameter>
</method>
</class>
<interface name="GeolocationPermissions.Callback"
abstract="true"
@@ -174740,6 +174972,27 @@
>
</method>
</class>
<interface name="ValueCallback"
abstract="true"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<method name="onReceiveValue"
return="void"
abstract="true"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="value" type="T">
</parameter>
</method>
</interface>
<class name="WebBackForwardList"
extends="java.lang.Object"
abstract="false"
@@ -174815,6 +175068,58 @@
visibility="public"
>
</constructor>
<method name="addMessageToConsole"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="message" type="java.lang.String">
</parameter>
<parameter name="lineNumber" type="int">
</parameter>
<parameter name="sourceID" type="java.lang.String">
</parameter>
</method>
<method name="getDefaultVideoPoster"
return="android.graphics.Bitmap"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="getVideoLoadingProgressView"
return="android.view.View"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="getVisitedHistory"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="callback" type="android.webkit.ValueCallback&lt;java.lang.String[]&gt;">
</parameter>
</method>
<method name="onCloseWindow"
return="void"
abstract="false"
@@ -174896,6 +175201,17 @@
<parameter name="callback" type="android.webkit.GeolocationPermissions.Callback">
</parameter>
</method>
<method name="onHideCustomView"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="onJsAlert"
return="boolean"
abstract="false"
@@ -174974,6 +175290,17 @@
<parameter name="result" type="android.webkit.JsPromptResult">
</parameter>
</method>
<method name="onJsTimeout"
return="boolean"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="onProgressChanged"
return="void"
abstract="false"
@@ -174989,6 +175316,23 @@
<parameter name="newProgress" type="int">
</parameter>
</method>
<method name="onReachedMaxAppCacheSize"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="spaceNeeded" type="long">
</parameter>
<parameter name="totalUsedQuota" type="long">
</parameter>
<parameter name="quotaUpdater" type="android.webkit.WebStorage.QuotaUpdater">
</parameter>
</method>
<method name="onReceivedIcon"
return="void"
abstract="false"
@@ -175019,6 +175363,23 @@
<parameter name="title" type="java.lang.String">
</parameter>
</method>
<method name="onReceivedTouchIconUrl"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="view" type="android.webkit.WebView">
</parameter>
<parameter name="url" type="java.lang.String">
</parameter>
<parameter name="precomposed" type="boolean">
</parameter>
</method>
<method name="onRequestFocus"
return="void"
abstract="false"
@@ -175032,7 +175393,41 @@
<parameter name="view" type="android.webkit.WebView">
</parameter>
</method>
<method name="onShowCustomView"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="view" type="android.view.View">
</parameter>
<parameter name="callback" type="android.webkit.WebChromeClient.CustomViewCallback">
</parameter>
</method>
</class>
<interface name="WebChromeClient.CustomViewCallback"
abstract="true"
static="true"
final="false"
deprecated="not deprecated"
visibility="public"
>
<method name="onCustomViewHidden"
return="void"
abstract="true"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
</interface>
<class name="WebHistoryItem"
extends="java.lang.Object"
abstract="false"
@@ -175336,6 +175731,28 @@
visibility="public"
>
</method>
<method name="getDefaultZoom"
return="android.webkit.WebSettings.ZoomDensity"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="getDomStorageEnabled"
return="boolean"
abstract="false"
native="false"
synchronized="true"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="getFantasyFontFamily"
return="java.lang.String"
abstract="false"
@@ -175402,6 +175819,17 @@
visibility="public"
>
</method>
<method name="getLoadWithOverviewMode"
return="boolean"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="getLoadsImagesAutomatically"
return="boolean"
abstract="false"
@@ -175591,6 +176019,45 @@
<parameter name="allow" type="boolean">
</parameter>
</method>
<method name="setAppCacheEnabled"
return="void"
abstract="false"
native="false"
synchronized="true"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="flag" type="boolean">
</parameter>
</method>
<method name="setAppCacheMaxSize"
return="void"
abstract="false"
native="false"
synchronized="true"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="appCacheMaxSize" type="long">
</parameter>
</method>
<method name="setAppCachePath"
return="void"
abstract="false"
native="false"
synchronized="true"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="appCachePath" type="java.lang.String">
</parameter>
</method>
<method name="setBlockNetworkImage"
return="void"
abstract="false"
@@ -175708,6 +176175,32 @@
<parameter name="encoding" type="java.lang.String">
</parameter>
</method>
<method name="setDefaultZoom"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="zoom" type="android.webkit.WebSettings.ZoomDensity">
</parameter>
</method>
<method name="setDomStorageEnabled"
return="void"
abstract="false"
native="false"
synchronized="true"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="flag" type="boolean">
</parameter>
</method>
<method name="setFantasyFontFamily"
return="void"
abstract="false"
@@ -175812,6 +176305,19 @@
<parameter name="enabled" type="boolean">
</parameter>
</method>
<method name="setLoadWithOverviewMode"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="overview" type="boolean">
</parameter>
</method>
<method name="setLoadsImagesAutomatically"
return="void"
abstract="false"
@@ -176249,6 +176755,39 @@
>
</method>
</class>
<class name="WebSettings.ZoomDensity"
extends="java.lang.Enum"
abstract="false"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
<method name="valueOf"
return="android.webkit.WebSettings.ZoomDensity"
abstract="false"
native="false"
synchronized="false"
static="true"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="name" type="java.lang.String">
</parameter>
</method>
<method name="values"
return="android.webkit.WebSettings.ZoomDensity[]"
abstract="false"
native="false"
synchronized="false"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</method>
</class>
<class name="WebStorage"
extends="java.lang.Object"
abstract="false"
@@ -176265,6 +176804,99 @@
visibility="public"
>
</constructor>
<method name="deleteAllData"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="deleteOrigin"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="origin" type="java.lang.String">
</parameter>
</method>
<method name="getInstance"
return="android.webkit.WebStorage"
abstract="false"
native="false"
synchronized="false"
static="true"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="getOrigins"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="callback" type="android.webkit.ValueCallback&lt;java.util.Map&gt;">
</parameter>
</method>
<method name="getQuotaForOrigin"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="origin" type="java.lang.String">
</parameter>
<parameter name="callback" type="android.webkit.ValueCallback&lt;java.lang.Long&gt;">
</parameter>
</method>
<method name="getUsageForOrigin"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="origin" type="java.lang.String">
</parameter>
<parameter name="callback" type="android.webkit.ValueCallback&lt;java.lang.Long&gt;">
</parameter>
</method>
<method name="setQuotaForOrigin"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="origin" type="java.lang.String">
</parameter>
<parameter name="quota" type="long">
</parameter>
</method>
</class>
<interface name="WebStorage.QuotaUpdater"
abstract="true"
@@ -176706,6 +177338,17 @@
<parameter name="vy" type="int">
</parameter>
</method>
<method name="freeMemory"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="getCertificate"
return="android.net.http.SslCertificate"
abstract="false"

View File

@@ -1215,20 +1215,27 @@ void CameraService::Client::copyFrameAndPostCopiedFrame(const sp<ICameraClient>&
// the callback. For efficiency, reuse the same MemoryHeapBase
// provided it's big enough. Don't allocate the memory or
// perform the copy if there's no callback.
if (mPreviewBuffer == 0) {
mPreviewBuffer = new MemoryHeapBase(size, 0, NULL);
} else if (size > mPreviewBuffer->virtualSize()) {
mPreviewBuffer.clear();
mPreviewBuffer = new MemoryHeapBase(size, 0, NULL);
// hold the lock while we grab a reference to the preview buffer
sp<MemoryHeapBase> previewBuffer;
{
Mutex::Autolock lock(mLock);
if (mPreviewBuffer == 0) {
mPreviewBuffer = new MemoryHeapBase(size, 0, NULL);
} else if (size > mPreviewBuffer->virtualSize()) {
mPreviewBuffer.clear();
mPreviewBuffer = new MemoryHeapBase(size, 0, NULL);
}
if (mPreviewBuffer == 0) {
LOGE("failed to allocate space for preview buffer");
return;
}
previewBuffer = mPreviewBuffer;
}
memcpy(mPreviewBuffer->base(),
memcpy(previewBuffer->base(),
(uint8_t *)heap->base() + offset, size);
sp<MemoryBase> frame = new MemoryBase(mPreviewBuffer, 0, size);
sp<MemoryBase> frame = new MemoryBase(previewBuffer, 0, size);
if (frame == 0) {
LOGE("failed to allocate space for frame callback");
return;

View File

@@ -437,6 +437,9 @@ bool BootAnimation::movie()
nsecs_t lastFrame = systemTime();
nsecs_t frameDuration = s2ns(1) / animation.fps;
Region clearReg(Rect(mWidth, mHeight));
clearReg.subtractSelf(Rect(xc, yc, xc+animation.width, yc+animation.height));
for (int i=0 ; i<pcount && !exitPending() ; i++) {
const Animation::Part& part(animation.parts[i]);
const size_t fcount = part.frames.size();
@@ -460,6 +463,18 @@ bool BootAnimation::movie()
frame.map->getDataLength());
}
if (!clearReg.isEmpty()) {
Region::const_iterator head(clearReg.begin());
Region::const_iterator tail(clearReg.end());
glEnable(GL_SCISSOR_TEST);
while (head != tail) {
const Rect& r(*head++);
glScissor(r.left, mHeight - r.bottom,
r.width(), r.height());
glClear(GL_COLOR_BUFFER_BIT);
}
glDisable(GL_SCISSOR_TEST);
}
glDrawTexiOES(xc, yc, 0, animation.width, animation.height);
eglSwapBuffers(mDisplay, mSurface);

View File

@@ -1447,7 +1447,6 @@ public final class ActivityThread {
Bundle instrumentationArgs, IInstrumentationWatcher instrumentationWatcher,
int debugMode, boolean isRestrictedBackupMode, Configuration config,
Map<String, IBinder> services) {
Process.setArgV0(processName);
if (services != null) {
// Setup the service cache in the ServiceManager
@@ -3818,6 +3817,7 @@ public final class ActivityThread {
//Process.setUid(data.appInfo.uid);
// send up app name; do this *before* waiting for debugger
Process.setArgV0(data.processName);
android.ddm.DdmHandleAppName.setAppName(data.processName);
/*

View File

@@ -1646,8 +1646,11 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
Intent intent = new Intent(action);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// We need CLEAR_TOP to avoid reusing an old task that has other activities
// on top of the one we want.
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
// on top of the one we want. We don't want to do this in in-app search though,
// as it can be destructive to the activity stack.
if (mGlobalSearchMode) {
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
}
if (data != null) {
intent.setData(data);
}

View File

@@ -126,8 +126,9 @@ public final class BluetoothAdapter {
* <p>Notification of the result of this activity is posted using the
* {@link android.app.Activity#onActivityResult} callback. The
* <code>resultCode</code>
* will be the duration (in seconds) of discoverability, or a negative
* value if the user rejected discoverability.
* will be the duration (in seconds) of discoverability or
* {@link android.app.Activity#RESULT_CANCELED} if the user rejected
* discoverability or an error has occurred.
* <p>Applications can also listen for {@link #ACTION_SCAN_MODE_CHANGED}
* for global notification whenever the scan mode changes.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}
@@ -153,8 +154,9 @@ public final class BluetoothAdapter {
* <p>Notification of the result of this activity is posted using the
* {@link android.app.Activity#onActivityResult} callback. The
* <code>resultCode</code>
* will be negative if the user did not turn on Bluetooth, and non-negative
* if Bluetooth has been turned on.
* will be {@link android.app.Activity#RESULT_OK} if Bluetooth has been
* turned on or {@link android.app.Activity#RESULT_CANCELED} if the user
* has rejected the request or an error has occurred.
* <p>Applications can also listen for {@link #ACTION_STATE_CHANGED}
* for global notification whenever Bluetooth is turned on or off.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}

View File

@@ -31,6 +31,7 @@ interface IPowerManager
long getScreenOnTime();
void preventScreenOn(boolean prevent);
void setScreenBrightnessOverride(int brightness);
boolean isScreenOn();
// sets the brightness of the backlights (screen, keyboard, button) 0-255
void setBacklightBrightness(int brightness);

View File

@@ -420,6 +420,26 @@ public class PowerManager
}
}
/**
* Returns whether the screen is currently on. The screen could be bright
* or dim.
*
* {@samplecode
* PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
* boolean isScreenOn = pm.isScreenOn();
* }
*
* @return whether the screen is on (bright or dim).
*/
public boolean isScreenOn()
{
try {
return mService.isScreenOn();
} catch (RemoteException e) {
return false;
}
}
private PowerManager()
{
}

View File

@@ -24,7 +24,6 @@ import android.preference.PreferenceActivity;
* Base class for activities that will be used to configure the settings of
* a wallpaper. You should derive from this class to allow it to select the
* proper theme of the activity depending on how it is being used.
* @hide Live Wallpaper
*/
public class WallpaperSettingsActivity extends PreferenceActivity {
/**

View File

@@ -109,9 +109,6 @@ public final class CacheManager {
return expires;
}
/**
* @hide Pending API council approval
*/
public String getExpiresString() {
return expiresString;
}
@@ -136,9 +133,6 @@ public final class CacheManager {
return encoding;
}
/**
* @hide Pending API council approval
*/
public String getContentDisposition() {
return contentdisposition;
}

View File

@@ -159,8 +159,6 @@ class CallbackProxy extends Handler {
/**
* Get the WebChromeClient.
* @return the current WebChromeClient instance.
*
*@hide pending API council approval.
*/
public WebChromeClient getWebChromeClient() {
return mWebChromeClient;
@@ -1237,7 +1235,6 @@ class CallbackProxy extends Handler {
* @param quotaUpdater An instance of a class encapsulating a callback
* to WebViewCore to run when the decision to allow or deny a bigger
* app cache size has been made.
* @hide pending API council approval.
*/
public void onReachedMaxAppCacheSize(long spaceNeeded,
long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater) {
@@ -1261,7 +1258,6 @@ class CallbackProxy extends Handler {
* @param origin The origin requesting Geolocation permsissions.
* @param callback The callback to call once a permission state has been
* obtained.
* @hide pending API council review.
*/
public void onGeolocationPermissionsShowPrompt(String origin,
GeolocationPermissions.Callback callback) {
@@ -1281,8 +1277,6 @@ class CallbackProxy extends Handler {
/**
* Called by WebViewCore to instruct the browser to hide the Geolocation
* permissions prompt.
* origin.
* @hide pending API council review.
*/
public void onGeolocationPermissionsHidePrompt() {
if (mWebChromeClient == null) {
@@ -1301,7 +1295,6 @@ class CallbackProxy extends Handler {
* occurred.
* @param sourceID The filename of the source file in which the error
* occurred.
* @hide pending API counsel.
*/
public void addMessageToConsole(String message, int lineNumber, String sourceID) {
if (mWebChromeClient == null) {
@@ -1315,9 +1308,6 @@ class CallbackProxy extends Handler {
sendMessage(msg);
}
/**
* @hide pending API council approval
*/
public boolean onJsTimeout() {
//always interrupt timedout JS by default
if (mWebChromeClient == null) {
@@ -1337,9 +1327,6 @@ class CallbackProxy extends Handler {
return result.getResult();
}
/**
* @hide pending API council approval
*/
public void getVisitedHistory(ValueCallback<String[]> callback) {
if (mWebChromeClient == null) {
return;

View File

@@ -71,7 +71,6 @@ public final class GeolocationPermissions {
/**
* Gets the singleton instance of the class.
* @hide
*/
public static GeolocationPermissions getInstance() {
if (sInstance == null) {
@@ -188,7 +187,6 @@ public final class GeolocationPermissions {
* WebCore::SecurityOrigin::toString(). As long as all 'HTML 5 modules'
* (Database, Geolocation etc) do so, it's safe to match up origins for the
* purposes of displaying UI.
* @hide
*/
public void getOrigins(ValueCallback<Set> callback) {
if (callback != null) {
@@ -212,7 +210,6 @@ public final class GeolocationPermissions {
/**
* Gets the permission state for the specified origin.
* @hide
*/
public void getAllowed(String origin, ValueCallback<Boolean> callback) {
if (callback == null) {
@@ -245,7 +242,6 @@ public final class GeolocationPermissions {
* Clears the permission state for the specified origin. This method may be
* called before the WebKit thread has intialized the message handler.
* Messages will be queued until this time.
* @hide
*/
public void clear(String origin) {
// Called on the UI thread.
@@ -266,7 +262,6 @@ public final class GeolocationPermissions {
* Allows the specified origin. This method may be called before the WebKit
* thread has intialized the message handler. Messages will be queued until
* this time.
* @hide
*/
public void allow(String origin) {
// Called on the UI thread.
@@ -285,7 +280,6 @@ public final class GeolocationPermissions {
/**
* Clears the permission state for all origins.
* @hide
*/
public void clearAll() {
// Called on the UI thread.

View File

@@ -30,9 +30,8 @@ import android.webkit.WebViewCore;
/**
* Implements the Java side of GeolocationServiceAndroid.
* @hide Pending API council review.
*/
public final class GeolocationService implements LocationListener {
final class GeolocationService implements LocationListener {
// Log tag
private static final String TAG = "geolocationService";

View File

@@ -32,7 +32,6 @@ import java.util.HashSet;
* Security - Share with Google' and the browser. When this setting is set
* to true, we allow Geolocation for Google origins. When this setting is
* set to false, we clear Geolocation permissions for Google origins.
* @hide pending API council review
*/
class GoogleLocationSettingManager {
// The observer used to listen to the system setting.

View File

@@ -19,7 +19,7 @@ package android.webkit;
/**
* This class is simply a container for the methods used to configure WebKit's
* mock Geolocation service for use in LayoutTests.
* @hide Pending API council review.
* @hide
*/
public final class MockGeolocation {

View File

@@ -18,12 +18,10 @@ package android.webkit;
/**
* A callback interface used to returns values asynchronously
*
* @hide pending council approval
*/
public interface ValueCallback<T> {
/**
* Invoked when we have the result
*/
public void onReceiveValue(T value);
public interface ValueCallback<T> {
/**
* Invoked when we have the result
*/
public void onReceiveValue(T value);
};

View File

@@ -49,7 +49,6 @@ public class WebChromeClient {
* @param view The WebView that initiated the callback.
* @param url The icon url.
* @param precomposed True if the url is for a precomposed touch icon.
* @hide pending council approval
*/
public void onReceivedTouchIconUrl(WebView view, String url,
boolean precomposed) {}
@@ -57,8 +56,6 @@ public class WebChromeClient {
/**
* A callback interface used by the host application to notify
* the current page that its custom view has been dismissed.
*
* @hide pending council approval
*/
public interface CustomViewCallback {
/**
@@ -74,16 +71,12 @@ public class WebChromeClient {
* @param view is the View object to be shown.
* @param callback is the callback to be invoked if and when the view
* is dismissed.
*
* @hide pending council approval
*/
public void onShowCustomView(View view, CustomViewCallback callback) {};
/**
* Notify the host application that the current page would
* like to hide its custom view.
*
* @hide pending council approval
*/
public void onHideCustomView() {}
@@ -230,7 +223,6 @@ public class WebChromeClient {
* @param quotaUpdater A callback to inform the WebCore thread that a new
* app cache size is available. This callback must always be executed at
* some point to ensure that the sleeping WebCore thread is woken up.
* @hide pending API council approval.
*/
public void onReachedMaxAppCacheSize(long spaceNeeded, long totalUsedQuota,
WebStorage.QuotaUpdater quotaUpdater) {
@@ -258,7 +250,6 @@ public class WebChromeClient {
* will continue to occur if the script does not finish at the next check
* point.
* @return boolean Whether the JavaScript execution should be interrupted.
* @hide pending API Council approval
*/
public boolean onJsTimeout() {
return true;
@@ -270,7 +261,6 @@ public class WebChromeClient {
* @param message The error message to report.
* @param lineNumber The line number of the error.
* @param sourceID The name of the source file that caused the error.
* @hide pending API council.
*/
public void addMessageToConsole(String message, int lineNumber, String sourceID) {}
@@ -279,7 +269,6 @@ public class WebChromeClient {
* This icon will be used if the Web page did not specify a poster attribute.
*
* @return Bitmap The icon or null if no such icon is available.
* @hide pending API Council approval
*/
public Bitmap getDefaultVideoPoster() {
return null;
@@ -290,14 +279,12 @@ public class WebChromeClient {
* a <video> is loading.
*
* @return View The progress view.
* @hide pending API Council approval
*/
public View getVideoLoadingProgressView() {
return null;
}
/** Obtains a list of all visited history items, used for link coloring
* @hide pending API Council approval
*/
public void getVisitedHistory(ValueCallback<String[]> callback) {
}

View File

@@ -74,7 +74,6 @@ public class WebSettings {
* FAR makes 100% looking like in 240dpi
* MEDIUM makes 100% looking like in 160dpi
* CLOSE makes 100% looking like in 120dpi
* @hide Pending API council approval
*/
public enum ZoomDensity {
FAR(150), // 240dpi
@@ -452,7 +451,6 @@ public class WebSettings {
/**
* Set whether the WebView loads a page with overview mode.
* @hide Pending API council approval
*/
public void setLoadWithOverviewMode(boolean overview) {
mLoadWithOverviewMode = overview;
@@ -460,7 +458,6 @@ public class WebSettings {
/**
* Returns true if this WebView loads page with overview mode
* @hide Pending API council approval
*/
public boolean getLoadWithOverviewMode() {
return mLoadWithOverviewMode;
@@ -522,7 +519,6 @@ public class WebSettings {
* thread.
* @param zoom A ZoomDensity value
* @see WebSettings.ZoomDensity
* @hide Pending API council approval
*/
public void setDefaultZoom(ZoomDensity zoom) {
if (mDefaultZoom != zoom) {
@@ -536,7 +532,6 @@ public class WebSettings {
* thread.
* @return A ZoomDensity value
* @see WebSettings.ZoomDensity
* @hide Pending API council approval
*/
public ZoomDensity getDefaultZoom() {
return mDefaultZoom;
@@ -1016,7 +1011,6 @@ public class WebSettings {
/**
* Tell the WebView to enable Application Caches API.
* @param flag True if the WebView should enable Application Caches.
* @hide pending api council approval
*/
public synchronized void setAppCacheEnabled(boolean flag) {
if (mAppCacheEnabled != flag) {
@@ -1031,7 +1025,6 @@ public class WebSettings {
* @param appCachePath String path to the directory containing Application
* Caches files. The appCache path can be the empty string but should not
* be null. Passing null for this parameter will result in a no-op.
* @hide pending api council approval
*/
public synchronized void setAppCachePath(String appCachePath) {
if (appCachePath != null && !appCachePath.equals(mAppCachePath)) {
@@ -1043,8 +1036,6 @@ public class WebSettings {
/**
* Set the maximum size for the Application Caches content.
* @param appCacheMaxSize the maximum size in bytes.
*
* @hide pending api council approval
*/
public synchronized void setAppCacheMaxSize(long appCacheMaxSize) {
if (appCacheMaxSize != mAppCacheMaxSize) {
@@ -1069,7 +1060,6 @@ public class WebSettings {
* Set whether the DOM storage API is enabled.
* @param flag boolean True if the WebView should use the DOM storage
* API.
* @hide pending API council.
*/
public synchronized void setDomStorageEnabled(boolean flag) {
if (mDomStorageEnabled != flag) {
@@ -1081,7 +1071,6 @@ public class WebSettings {
/**
* Returns true if the DOM Storage API's are enabled.
* @return True if the DOM Storage API's are enabled.
* @hide pending API council.
*/
public synchronized boolean getDomStorageEnabled() {
return mDomStorageEnabled;

View File

@@ -229,7 +229,6 @@ public final class WebStorage {
*/
/**
* @hide
* Returns a list of origins having a database
*/
public void getOrigins(ValueCallback<Map> callback) {
@@ -256,7 +255,6 @@ public final class WebStorage {
}
/**
* @hide
* Returns the use for a given origin
*/
public void getUsageForOrigin(String origin, ValueCallback<Long> callback) {
@@ -280,7 +278,6 @@ public final class WebStorage {
}
/**
* @hide
* Returns the quota for a given origin
*/
public void getQuotaForOrigin(String origin, ValueCallback<Long> callback) {
@@ -304,7 +301,6 @@ public final class WebStorage {
}
/**
* @hide
* Set the quota for a given origin
*/
public void setQuotaForOrigin(String origin, long quota) {
@@ -319,7 +315,6 @@ public final class WebStorage {
}
/**
* @hide
* Delete a given origin
*/
public void deleteOrigin(String origin) {
@@ -334,7 +329,6 @@ public final class WebStorage {
}
/**
* @hide
* Delete all databases
*/
public void deleteAllData() {
@@ -364,7 +358,6 @@ public final class WebStorage {
}
/**
* @hide
* Get the global instance of WebStorage.
* @return A single instance of WebStorage.
*/

View File

@@ -1713,6 +1713,7 @@ public class WebView extends AbsoluteLayout
* as the data member with "url" as key. The result can be null.
*/
public void requestImageRef(Message msg) {
if (0 == mNativeClass) return; // client isn't initialized
int contentX = viewToContentX((int) mLastTouchX + mScrollX);
int contentY = viewToContentY((int) mLastTouchY + mScrollY);
String ref = nativeImageURI(contentX, contentY);
@@ -2264,7 +2265,6 @@ public class WebView extends AbsoluteLayout
/**
* Call this to inform the view that memory is low so that it can
* free any available memory.
* @hide
*/
public void freeMemory() {
mWebViewCore.sendMessage(EventHub.FREE_MEMORY);
@@ -2331,6 +2331,7 @@ public class WebView extends AbsoluteLayout
* @param forward Direction to search.
*/
public void findNext(boolean forward) {
if (0 == mNativeClass) return; // client isn't initialized
nativeFindNext(forward);
}
@@ -2341,6 +2342,7 @@ public class WebView extends AbsoluteLayout
* that were found.
*/
public int findAll(String find) {
if (0 == mNativeClass) return 0; // client isn't initialized
if (mFindIsUp == false) {
recordNewContentSize(mContentWidth, mContentHeight + mFindHeight,
false);
@@ -3431,6 +3433,7 @@ public class WebView extends AbsoluteLayout
* @hide
*/
public void emulateShiftHeld() {
if (0 == mNativeClass) return; // client isn't initialized
mExtendSelection = false;
mShiftIsPressed = true;
nativeHideCursor();

View File

@@ -2203,6 +2203,9 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
clearScrollingCache();
}
mLastY = Integer.MIN_VALUE;
if (mTouchMode == TOUCH_MODE_FLING) {
return true;
}
break;
}

View File

@@ -200,6 +200,11 @@
<integer-array name="config_autoBrightnessKeyboardBacklightValues">
</integer-array>
<!-- Amount of time it takes for the light sensor to warm up in milliseconds.
For this time after the screen turns on, the Power Manager
will not debounce light sensor readings -->
<integer name="config_lightSensorWarmupTime">0</integer>
<!-- Enables swipe versus poly-finger touch disambiguation in the KeyboardView -->
<bool name="config_swipeDisambiguation">true</bool>
</resources>

View File

@@ -11,8 +11,16 @@ page.title=Developing on a Device
<li><a href="#dev-phone-1">Android Dev Phone 1</a></li>
</ol>
</li>
<li><a href="#setting-up">Setting up a Device for Development</a></li>
<li><a href="#WinUsbDriver">Installing the WinUsb Driver</a></li>
<li><a href="#setting-up">Setting up a Device for Development</a>
<ol>
<li><a href="#VendorIds">USB Vendor IDs</a></li>
</ol>
</li>
</ol>
<h2>See also</h2>
<ol>
<li><a
href="{@docRoot}sdk/win-usb.html">USB Driver for Windows</a></li>
</ol>
</div>
</div>
@@ -117,27 +125,36 @@ would on the emulator. There are just a few things to do before you can start.</
<li>Turn on "USB Debugging" on your device.
<p>On the device, go to the home screen, press <b>MENU</b>, select <b>Applications</b> > <b>Development</b>,
then enable <b>USB debugging</b>.</p>
</li>
<li>Setup your system to detect your device.
<ul>
<li>If you're developing on Windows, you need to install a USB driver for adb.
Follow the steps below for <a href="#WinUsbDriver">Installing the WinUsb Driver</a>.</li>
<li>If you're developing on Windows, you need to install a USB driver
for adb. See the <a href="{@docRoot}sdk/win-usb.html">Windows USB
Driver</a> documentation.</li>
<li>If you're developing on Mac OS X, it just works. Skip this step.</li>
<li>If you're developing on Ubuntu Linux, you need to add a rules file:
<li>If you're developing on Ubuntu Linux, you need to add a rules file
that contains a USB configuration for each type of device you want to use for
development. Each device manufacturer uses a different vendor ID. The
example rules files below show how to add an entry for a single vendor ID
(the HTC vendor ID). In order to support more devices, you will need additional
lines of the same format that provide a different value for the
<code>SYSFS{idVendor}</code> property. For other IDs, see the table of <a
href="#VendorIds">USB Vendor IDs</a>, below.
<ol>
<li>Login as root and create this file: <code>/etc/udev/rules.d/51-android.rules</code>.
<p>For Gusty/Hardy, edit the file to read: <br/>
<code>SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"</code></p>
<li>Log in as root and create this file:
<code>/etc/udev/rules.d/51-android.rules</code>.
<p>For Gusty/Hardy, edit the file to read:<br/>
<code>SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4",
MODE="0666"</code></p>
<p>For Dapper, edit the file to read: <br/>
<code>SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"</code></p>
<p>For Dapper, edit the file to read:<br/>
<code>SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4",
MODE="0666"</code></p>
</li>
<li>Now execute:<br/>
<code>chmod a+r /etc/udev/rules.d/51-android.rules</code>
</li>
</ol>
</li>
</ul>
</li>
@@ -149,157 +166,30 @@ with a <b>Device Chooser</b> dialog that lists the available emulator(s) and con
Select the device to install and run the application there.</p>
<p>If using the <a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a> (adb),
you can issue commands with the <code>-d</code> flag to target your connected device.</p>
<h2 id="WinUsbDriver">Installing the WinUsb Driver</h2>
<p>A WinUsb-based driver is needed in order to use your Android-powered device for development on a Windows machine.
The USB installation package can be found in the <code><em>&lt;sdk></em>\usb_driver\</code>
folder of your SDK package.</p>
<p class="note"><strong>Note:</strong> If you are connecting an Android-powered device to your computer
for the first time, folllow the procedure to "Perform a fresh installation."
Android SDKs older than version 1.6 included a non-WinUsb-based driver
for connecting your device. If you installed the older USB driver and it is working properly,
you do not need to upgrade to the new driver. However, if you are having problems with the driver or
would simply like to upgrade to the latest version, follow the procedure to "Upgrade an existing
driver." </p>
<p>Before you begin installing or upgrading the USB driver, you must
copy the USB installation package to a secure location on your computer.
For example, you might want to create a directory at <code>C:\Android\Windows\USB\install\</code> and
move it there. Once you've moved the installation package, select the appropriate procedure below,
based on your operating system and whether you're installing for the first time or upgrading.</p>
<ol class="nolist">
<li>Windows Vista:
<ol class="nolist">
<li><a href="#VistaFreshInstall">Perform a fresh installation</a></li>
<li><a href="#VistaUprade">Upgrade an existing driver</a></li>
</ol>
</li>
<li>Windows XP:
<ol class="nolist">
<li><a href="#XPFreshInstall">Perform a fresh installation</a></li>
<li><a href="#XPUpgrade">Upgrade an existing driver</a></li>
</ol>
</li>
</ol>
<p class="caution"><strong>Caution:</strong>
You may make changes to <code>android_winusb.inf</code> file found inside <code>usb_driver\</code>
(e.g., to add support for new devices),
however, this will lead to security warnings when you install or upgrade the
driver. Making any other changes to the driver files may break the installation process.</p>
<h3 id="VistaFreshInstall">Windows Vista: Perform a fresh installation</h3>
<p>To install the Android USB driver on Windows Vista for the first time:</p>
<ol>
<li>Connect your Android-powered device to your computer's USB port. Windows will detect the device
and launch the Found New Hardware wizard.</li>
<li>Select "Locate and install driver software."</li>
<li>Select "Don't search online."</li>
<li>Select "I don't have the disk. Show me other options."</li>
<li>Select "Browse my computer for driver software."</li>
<li>Click "Browse..." and locate the folder where you copied the
installation package. As long as you specified the exact location of the
installation package, you may leave "Include subfolders" checked or unchecked&mdash;it doesn't matter.</li>
<li>Click "Next." Vista may prompt you to confirm the privilege elevation required for driver
installation. Confirm it.</li>
<li>When Vista asks if you'd like to install the Google ADB Interface device, click "Install"
to install the driver.</li>
</ol>
<p>Return to <a href="#setting-up">Setting up a Device for Development</a>.</p>
<h3 id="VistaUpgrade">Windows Vista: Upgrade an existing driver</h3>
<p>To upgrade an existing Android USB driver on Windows Vista with the new one:</p>
<ol>
<li>Connect your Android-powered device to your computer's USB port.</li>
<li>Right-click on "Computer" from your desktop or Windows Explorer,
and select "Manage."</li>
<li>Select "Device Manager" in the left pane of the Computer Management window.</li>
<li>Locate and expand "ADB Interface" in the right pane.</li>
<li>Right-click on "HTC Dream Composite ADB Interface", and select "Update Driver Software..."</li>
<li>When Vista starts updating the driver, a prompt will ask how you want to search for the driver
software. Select "Browse my computer for driver software."</li>
<li>Click "Browse..." and locate the folder where you copied the
installation package. As long as you specified the exact location of the
installation package, you may leave "Include subfolders" checked or unchecked&mdash;it doesn't matter.</li>
<li>Click "Next." Vista may prompt you to confirm the privilege elevation required for driver
installation. Confirm it.</li>
<li>When Vista asks if you'd like to install the Google ADB Interface device, click "Install"
to install the driver.</li>
</ol>
<p>Return to <a href="#setting-up">Setting up a Device for Development</a>.</p>
<h3 id="XPFreshInstall">Windows XP: Perform a fresh installation</h3>
<p>To install the Android USB driver on Windows XP for the first time:</p>
<ol>
<li>Connect your Android-powered device to your computer's USB port. Windows
will detect the device and launch the Hardware Update Wizard.</li>
<li>Select "Install from a list or specific location" and click
"Next."</li>
<li>Select "Search for the best driver in these locations"; uncheck "Search
removable media"; and check "Include this location in the search."</li>
<li>Click "Browse..." and locate the folder where you copied the installation
package.</li>
<li>Click "Next" to install the driver.</li>
</ol>
<p>Return to <a href="#setting-up">Setting up a Device for Development</a>.</p>
<h3 id="XPUpgrade">Windows XP: Upgrade an existing driver</h3>
<p>To upgrade an existing Android USB driver on Windows XP with the new one:</p>
<ol>
<li>Connect your Android-powered device to your computer's USB port.</li>
<li>Right-click on "My Computer" from your desktop or Windows Explorer,
and select "Manage."</li>
<li>Select "Device Manager" in the left pane of the Computer Management window.</li>
<li>Locate and expand "Android Phone" in the right pane.</li>
<li>Right-click "Android Composite ADB Interface" and select "Update Driver..."
This will launch the Hardware Update Wizard.</li>
<li>Select "Install from a list or specific location" and click
"Next."</li>
<li>Select "Search for the best driver in these locations"; uncheck "Search
removable media"; and check "Include this location in the search."</li>
<li>Click "Browse..." and locate the folder where you copied the installation
package.</li>
<li>Click "Next" to install the driver.</li>
</ol>
<p>Return to <a href="#setting-up">Setting up a Device for Development</a>.</p>
you can issue commands with the <code>-d</code> flag to target your
connected device.</p>
<h3 id="VendorIds">USB Vendor IDs</h3>
<p>This table provides a reference to the vendor IDs needed in order to add
device support on Linux. The USB Vendor ID is the value given to the
<code>SYSFS{idVendor}</code> property in the rules file.</p>
<table>
<tr>
<th>Manufacturer</th><th>USB Vendor ID</th></tr>
<tr>
<td>Acer</td><td>0502</td></tr>
<tr>
<td>HTC</td><td>0bb4</td></tr>
<tr>
<td>Huawei</td><td>12d1</td></tr>
<tr>
<td>LG</td><td>1004</td></tr>
<tr>
<td>Motorola</td><td>22b8</td></tr>
<tr>
<td>Samsung</td><td>04e8</td></tr>
<tr>
<td>Sony Ericsson</td><td>0fce</td></tr>
</table>

View File

@@ -75,7 +75,11 @@
</li>
</ul>
<ul>
<li><a href="<?cs var:toroot ?>sdk/tools-notes.html">SDK Tools, Revision 3</a>
<li><a href="<?cs var:toroot ?>sdk/tools-notes.html">SDK Tools, r3</a>
<span class="new">new!</span>
</li>
<li><a href="<?cs var:toroot ?>sdk/win-usb.html">USB Driver for
Windows, r2</a>
<span class="new">new!</span>
</li>
</ul>

200
docs/html/sdk/win-usb.jd Normal file
View File

@@ -0,0 +1,200 @@
page.title=USB Driver for Windows
@jd:body
<div id="qv-wrapper">
<div id="qv">
<h2>In this document</h2>
<ol>
<li><a href="#RevisionNotes">Revision Notes</a></li>
<li><a href="#WinUsbDriver">Installing the USB Driver for Windows</a></li>
</ol>
<h2>See also</h2>
<ol>
<li><a
href="{@docRoot}guide/developing/device.html">Developing on a
Device</a></li>
<li><a
href="adding-components.html">Adding SDK Components</a></li>
</ol>
</div>
</div>
<p>The USB driver for Windows is a downloadable component for the
Android SDK. If you are developing on Windows and would like to
connect an Android-powered device to test your applications, then you will need
to install the USB driver.</p>
<p>This document provides information about the latest version of the
USB driver and a guide to installing the driver on your development
computer.</p>
<p class="note"><strong>Note:</strong>
If you're developing on Mac OS X or Linux, then you do not need to install a
USB driver. Refer to <a
href="{@docRoot}guide/developing/device.html#setting-up">Setting up a
Device</a> to start development with a device.</p>
<h2 id="RevisionNotes">Revision Notes</h2>
<h4>Revision 2</h4>
<p>Adds support for the Verizon Droid (or similar hardware on
other carriers). Released November 2009.</p>
<h4>Revision 1</h4>
<p>This was the initial release of the WinUsb-based driver, with support
for the T-Mobile G1 and myTouch 3G (and similar devices).</p>
<h2 id="WinUsbDriver">Installing the USB Driver for Windows</h2>
<div class="sidebox-wrapper">
<div class="sidebox-inner">
<p>The USB driver for Windows provides support for the following
Android-powered
devices:</p>
<ul>
<li>T-Mobile G1* / ADP1</li>
<li>T-Mobile myTouch 3G* / Google Ion</li>
<li>Verizon Droid*</li>
</ul>
<p>* <em>Or similar hardware on other carriers</em></p>
<p>Any additional devices will require Windows drivers provided by
the hardware manufacturer.</p>
</div>
</div>
<p>Before you perform the installation below, you must have the USB
driver saved to your development computer. To get the USB driver, use
the AVD and SDK Manager included with the SDK Tools to download the USB driver
as an SDK component. For more information, read <a
href="adding-components.html">Adding SDK Components</a>.</p>
<p>Once you have the USB driver saved to your computer, select the
appropriate procedure below, based on your operating system and whether you're
installing for the first time or upgrading.</p>
<p>If you are connecting an Android-powered
device to your computer for the first time, follow the below procedure to
"Perform a fresh installation." If you have installed one of the older
USB drivers and would like to upgrade to the latest version, follow the
procedure to "Upgrade an existing driver."</p>
<p>Once you've completed the USB driver installation,
please see <a
href="{@docRoot}guide/developing/device.html">Developing on a Device</a> for
other important information about using an Android-powered device for
development.</p>
<ol class="nolist">
<li><strong>Windows Vista:</strong>
<ol class="nolist">
<li><a href="#VistaFreshInstall">Perform a fresh installation</a></li>
<li><a href="#VistaUprade">Upgrade an existing driver</a></li>
</ol>
</li>
<li><strong>Windows XP:</strong>
<ol class="nolist">
<li><a href="#XPFreshInstall">Perform a fresh installation</a></li>
<li><a href="#XPUpgrade">Upgrade an existing driver</a></li>
</ol>
</li>
</ol>
<p class="caution"><strong>Caution:</strong>
You may make changes to <code>android_winusb.inf</code> file found inside
<code>usb_driver\</code> (for example, to add support for other devices),
however, this will lead to security warnings when you install or upgrade the
driver. Making any other changes to the driver files may break the installation
process.</p>
<h3 id="VistaFreshInstall">Windows Vista: Perform a fresh installation</h3>
<p>To install the Android USB driver on Windows Vista for the first time:</p>
<ol>
<li>Connect your Android-powered device to your computer's USB port. Windows
will detect the device and launch the Found New Hardware wizard.</li>
<li>Select "Locate and install driver software."</li>
<li>Select "Don't search online."</li>
<li>Select "I don't have the disk. Show me other options."</li>
<li>Select "Browse my computer for driver software."</li>
<li>Click "Browse..." and locate the folder where you copied the
installation package. As long as you specified the exact location of the
installation package, you may leave "Include subfolders" checked or
unchecked&mdash;it doesn't matter.</li>
<li>Click "Next." Vista may prompt you to confirm the privilege elevation
required for driver installation. Confirm it.</li>
<li>When Vista asks if you'd like to install the Google ADB Interface device,
click "Install" to install the driver.</li>
</ol>
<h3 id="VistaUpgrade">Windows Vista: Upgrade an existing driver</h3>
<p>To upgrade an existing Android USB driver on Windows Vista with the new
driver:</p>
<ol>
<li>Connect your Android-powered device to your computer's USB port.</li>
<li>Right-click on "Computer" from your desktop or Windows Explorer,
and select "Manage."</li>
<li>Select "Device Manager" in the left pane of the Computer Management
window.</li>
<li>Locate and expand "ADB Interface" in the right pane.</li>
<li>Right-click on "HTC Dream Composite ADB Interface", and select "Update
Driver Software..."</li>
<li>When Vista starts updating the driver, a prompt will ask how you want to
search for the driver
software. Select "Browse my computer for driver software."</li>
<li>Click "Browse..." and locate the folder where you copied the
installation package. As long as you specified the exact location of the
installation package, you may leave "Include subfolders" checked or
unchecked&mdash;it doesn't matter.</li>
<li>Click "Next." Vista may prompt you to confirm the privilege elevation
required for driver installation. Confirm it.</li>
<li>When Vista asks if you'd like to install the Google ADB Interface device,
click "Install" to install the driver.</li>
</ol>
<h3 id="XPFreshInstall">Windows XP: Perform a fresh installation</h3>
<p>To install the Android USB driver on Windows XP for the first time:</p>
<ol>
<li>Connect your Android-powered device to your computer's USB port. Windows
will detect the device and launch the Hardware Update Wizard.</li>
<li>Select "Install from a list or specific location" and click
"Next."</li>
<li>Select "Search for the best driver in these locations"; un-check "Search
removable media"; and check "Include this location in the search."</li>
<li>Click "Browse..." and locate the folder where you copied the installation
package.</li>
<li>Click "Next" to install the driver.</li>
</ol>
<h3 id="XPUpgrade">Windows XP: Upgrade an existing driver</h3>
<p>To upgrade an existing Android USB driver on Windows XP with the new
driver:</p>
<ol>
<li>Connect your Android-powered device to your computer's USB port.</li>
<li>Right-click on "My Computer" from your desktop or Windows Explorer,
and select "Manage."</li>
<li>Select "Device Manager" in the left pane of the Computer Management
window.</li>
<li>Locate and expand "Android Phone" in the right pane.</li>
<li>Right-click "Android Composite ADB Interface" and select "Update
Driver..."
This will launch the Hardware Update Wizard.</li>
<li>Select "Install from a list or specific location" and click
"Next."</li>
<li>Select "Search for the best driver in these locations"; un-check "Search
removable media"; and check "Include this location in the search."</li>
<li>Click "Browse..." and locate the folder where you copied the installation
package.</li>
<li>Click "Next" to install the driver.</li>
</ol>

View File

@@ -14,6 +14,7 @@
* limitations under the License.
*/
//#define LOG_NDEBUG 0
#define LOG_TAG "AudioPlayer"
#include <utils/Log.h>
@@ -136,7 +137,7 @@ void AudioPlayer::stop() {
// Make sure to release any buffer we hold onto so that the
// source is able to stop().
if (mInputBuffer != NULL) {
LOGI("AudioPlayer releasing input buffer.");
LOGV("AudioPlayer releasing input buffer.");
mInputBuffer->release();
mInputBuffer = NULL;
@@ -176,7 +177,7 @@ void AudioPlayer::AudioCallback(int event, void *info) {
void AudioPlayer::fillBuffer(void *data, size_t size) {
if (mNumFramesPlayed == 0) {
LOGI("AudioCallback");
LOGV("AudioCallback");
}
size_t size_done = 0;
@@ -222,6 +223,11 @@ void AudioPlayer::fillBuffer(void *data, size_t size) {
mPositionTimeRealUs =
((mNumFramesPlayed + size_done / mFrameSize) * 1000000)
/ mSampleRate;
LOGV("buffer->size() = %d, "
"mPositionTimeMediaUs=%.2f mPositionTimeRealUs=%.2f",
mInputBuffer->range_length(),
mPositionTimeMediaUs / 1E6, mPositionTimeRealUs / 1E6);
}
if (mInputBuffer->range_length() == 0) {

View File

@@ -157,7 +157,15 @@ void MediaPlayerImpl::play() {
if (mAudioSource != NULL) {
mAudioPlayer = new AudioPlayer(mAudioSink);
mAudioPlayer->setSource(mAudioDecoder);
mAudioPlayer->start();
if (mVideoDecoder == NULL) {
// If there is no video, start playing right away,
// otherwise we'll start the audio player after we decode
// the first video frame, this way we won't be behind right
// away.
mAudioPlayer->start();
}
mTimeSource = mAudioPlayer;
} else {
mTimeSource = new SystemTimeSource;
@@ -285,6 +293,10 @@ void MediaPlayerImpl::videoEntry() {
}
if (firstFrame || seeking) {
if (firstFrame && mAudioPlayer != NULL) {
// We've deferred starting the audio player until now.
mAudioPlayer->start();
}
mTimeSourceDeltaUs = mTimeSource->getRealTimeUs() - pts_us;
firstFrame = false;
}

View File

@@ -1281,8 +1281,8 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
public void start(GLThread thread) throws InterruptedException {
GLThread oldThread = null;
synchronized(this) {
mMostRecentGLThread = thread;
oldThread = mMostRecentGLThread;
mMostRecentGLThread = thread;
}
if (oldThread != null) {
synchronized(oldThread) {

View File

@@ -212,8 +212,12 @@ class PowerManagerService extends IPowerManager.Stub
private volatile boolean mPokeAwakeOnSet = false;
private volatile boolean mInitComplete = false;
private HashMap<IBinder,PokeLock> mPokeLocks = new HashMap<IBinder,PokeLock>();
// mScreenOnTime and mScreenOnStartTime are used for computing total time screen
// has been on since boot
private long mScreenOnTime;
private long mScreenOnStartTime;
// mLastScreenOnTime is the time the screen was last turned on
private long mLastScreenOnTime;
private boolean mPreventScreenOn;
private int mScreenBrightnessOverride = -1;
private boolean mUseSoftwareAutoBrightness;
@@ -222,6 +226,7 @@ class PowerManagerService extends IPowerManager.Stub
private int[] mLcdBacklightValues;
private int[] mButtonBacklightValues;
private int[] mKeyboardBacklightValues;
private int mLightSensorWarmupTime;
// Used when logging number and duration of touch-down cycles
private long mTotalTouchDownTime;
@@ -456,6 +461,8 @@ class PowerManagerService extends IPowerManager.Stub
com.android.internal.R.array.config_autoBrightnessButtonBacklightValues);
mKeyboardBacklightValues = resources.getIntArray(
com.android.internal.R.array.config_autoBrightnessKeyboardBacklightValues);
mLightSensorWarmupTime = resources.getInteger(
com.android.internal.R.integer.config_lightSensorWarmupTime);
}
ContentResolver resolver = mContext.getContentResolver();
@@ -886,6 +893,7 @@ class PowerManagerService extends IPowerManager.Stub
pw.println(" mPreventScreenOn=" + mPreventScreenOn
+ " mScreenBrightnessOverride=" + mScreenBrightnessOverride);
pw.println(" mTotalDelaySetting=" + mTotalDelaySetting);
pw.println(" mLastScreenOnTime=" + mLastScreenOnTime);
pw.println(" mBroadcastWakeLock=" + mBroadcastWakeLock);
pw.println(" mStayOnWhilePluggedInScreenDimLock=" + mStayOnWhilePluggedInScreenDimLock);
pw.println(" mStayOnWhilePluggedInPartialLock=" + mStayOnWhilePluggedInPartialLock);
@@ -1299,15 +1307,18 @@ class PowerManagerService extends IPowerManager.Stub
private int setScreenStateLocked(boolean on) {
int err = Power.setScreenState(on);
if (err == 0 && mUseSoftwareAutoBrightness) {
enableLightSensor(on);
if (!on) {
// make sure button and key backlights are off too
mHardware.setLightBrightness_UNCHECKED(HardwareService.LIGHT_ID_BUTTONS, 0);
mHardware.setLightBrightness_UNCHECKED(HardwareService.LIGHT_ID_KEYBOARD, 0);
// clear current value so we will update based on the new conditions
// when the sensor is reenabled.
mLightSensorValue = -1;
if (err == 0) {
mLastScreenOnTime = (on ? SystemClock.elapsedRealtime() : 0);
if (mUseSoftwareAutoBrightness) {
enableLightSensor(on);
if (!on) {
// make sure button and key backlights are off too
mHardware.setLightBrightness_UNCHECKED(HardwareService.LIGHT_ID_BUTTONS, 0);
mHardware.setLightBrightness_UNCHECKED(HardwareService.LIGHT_ID_KEYBOARD, 0);
// clear current value so we will update based on the new conditions
// when the sensor is reenabled.
mLightSensorValue = -1;
}
}
}
return err;
@@ -1780,13 +1791,13 @@ class PowerManagerService extends IPowerManager.Stub
}
}
boolean screenIsOn() {
public boolean isScreenOn() {
synchronized (mLocks) {
return (mPowerState & SCREEN_ON_BIT) != 0;
}
}
boolean screenIsBright() {
boolean isScreenBright() {
synchronized (mLocks) {
return (mPowerState & SCREEN_BRIGHT) == SCREEN_BRIGHT;
}
@@ -2089,7 +2100,7 @@ class PowerManagerService extends IPowerManager.Stub
boolean enabled = (mode == SCREEN_BRIGHTNESS_MODE_AUTOMATIC);
if (mUseSoftwareAutoBrightness && mAutoBrightessEnabled != enabled) {
mAutoBrightessEnabled = enabled;
if (screenIsOn()) {
if (isScreenOn()) {
// force recompute of backlight values
if (mLightSensorValue >= 0) {
int value = (int)mLightSensorValue;
@@ -2431,13 +2442,15 @@ class PowerManagerService extends IPowerManager.Stub
public void onSensorChanged(SensorEvent event) {
synchronized (mLocks) {
int value = (int)event.values[0];
long milliseconds = event.timestamp / 1000000;
if (mDebugLightSensor) {
Log.d(TAG, "onSensorChanged: light value: " + value);
}
mHandler.removeCallbacks(mAutoBrightnessTask);
if (mLightSensorValue != value) {
if (mLightSensorValue == -1) {
// process the value immediately
if (mLightSensorValue == -1 ||
milliseconds < mLastScreenOnTime + mLightSensorWarmupTime) {
// process the value immediately if screen has just turned on
lightSensorChangedLocked(value);
} else {
// delay processing to debounce the sensor

View File

@@ -6095,8 +6095,8 @@ public class WindowManagerService extends IWindowManager.Stub
}
// XXX end hack
boolean screenIsOff = !mPowerManager.screenIsOn();
boolean screenIsDim = !mPowerManager.screenIsBright();
boolean screenIsOff = !mPowerManager.isScreenOn();
boolean screenIsDim = !mPowerManager.isScreenBright();
int actions = mPolicy.interceptKeyTq(event, !screenIsOff);
if ((actions & WindowManagerPolicy.ACTION_GO_TO_SLEEP) != 0) {
@@ -6126,8 +6126,8 @@ public class WindowManagerService extends IWindowManager.Stub
}
case RawInputEvent.EV_REL: {
boolean screenIsOff = !mPowerManager.screenIsOn();
boolean screenIsDim = !mPowerManager.screenIsBright();
boolean screenIsOff = !mPowerManager.isScreenOn();
boolean screenIsDim = !mPowerManager.isScreenBright();
if (screenIsOff) {
if (!mPolicy.isWakeRelMovementTq(event.deviceId,
device.classes, event)) {
@@ -6143,8 +6143,8 @@ public class WindowManagerService extends IWindowManager.Stub
}
case RawInputEvent.EV_ABS: {
boolean screenIsOff = !mPowerManager.screenIsOn();
boolean screenIsDim = !mPowerManager.screenIsBright();
boolean screenIsOff = !mPowerManager.isScreenOn();
boolean screenIsDim = !mPowerManager.isScreenBright();
if (screenIsOff) {
if (!mPolicy.isWakeAbsMovementTq(event.deviceId,
device.classes, event)) {

View File

@@ -846,6 +846,12 @@ public class CdmaSmsTest extends AndroidTestCase {
ArrayList<String> fragments = android.telephony.SmsMessage.fragmentText(text1);
assertEquals(fragments.size(), 1);
}
/*
This is not a valid test: we will never encode a single-segment
EMS message. Leaving this here, since we may try to support
this in the future.
// Valid 160 character GSM text -- the last character is
// non-ASCII, and so this will currently generate a singleton
// EMS message, which is not necessarily supported by Verizon.
@@ -860,5 +866,22 @@ public class CdmaSmsTest extends AndroidTestCase {
ArrayList<String> fragments = android.telephony.SmsMessage.fragmentText(text2);
assertEquals(fragments.size(), 1);
}
*/
// *IF* we supported single-segment EMS, this text would result in a
// single fragment with 7-bit encoding. But we don't, so this text
// results in three fragments of 16-bit encoding.
String text2 = "123456789012345678901234567890123456789012345678901234567890" +
"1234567890123456789012345678901234567890123456789012345678901234567890" +
"12345678901234567890123456789\u00a3"; // Trailing pound-currency sign.
ted = SmsMessage.calculateLength(text2, false);
assertEquals(3, ted.msgCount);
assertEquals(160, ted.codeUnitCount);
assertEquals(3, ted.codeUnitSize);
if (isCdmaPhone) {
ArrayList<String> fragments = android.telephony.SmsMessage.fragmentText(text2);
assertEquals(3, fragments.size());
}
}
}