Merge branch 'eclair' into eclair-release

This commit is contained in:
The Android Automerger
2009-11-03 13:35:45 -08:00
38 changed files with 462 additions and 128 deletions

View File

@@ -6389,6 +6389,72 @@
visibility="public"
>
</field>
<field name="quickContactBadgeStyleSmallWindowLarge"
type="int"
transient="false"
volatile="false"
value="16843443"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="quickContactBadgeStyleSmallWindowMedium"
type="int"
transient="false"
volatile="false"
value="16843442"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="quickContactBadgeStyleSmallWindowSmall"
type="int"
transient="false"
volatile="false"
value="16843441"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="quickContactBadgeStyleWindowLarge"
type="int"
transient="false"
volatile="false"
value="16843440"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="quickContactBadgeStyleWindowMedium"
type="int"
transient="false"
volatile="false"
value="16843439"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="quickContactBadgeStyleWindowSmall"
type="int"
transient="false"
volatile="false"
value="16843438"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="radioButtonStyle"
type="int"
transient="false"
@@ -158042,6 +158108,17 @@
visibility="public"
>
</method>
<method name="isOpaque"
return="boolean"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="isPaddingOffsetRequired"
return="boolean"
abstract="false"

View File

@@ -330,8 +330,8 @@ import java.util.List;
* you'll need to update your searchable activity (or other activities) to receive the intents
* as you've defined them.</li>
* <li>Implement a Content Provider that provides suggestions. If you already have one, and it
* has access to your suggestions data. If not, you'll have to create one.
* You'll also provide information about your Content Provider in your
* has access to your suggestions data, you can use that provider. If not, you'll have to create
* one. You'll also provide information about your Content Provider in your
* package's <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">manifest</a>.</li>
* <li>Update your searchable activity's XML configuration file. There are two categories of
* information used for suggestions:
@@ -1181,7 +1181,7 @@ import java.util.List;
* Bundle appData = new Bundle();
* appData.put...();
* appData.put...();
* startSearch(null, false, appData);
* startSearch(null, false, appData, false);
* return true;
* }</pre>
*

View File

@@ -46,13 +46,21 @@ public class Sensor {
/** A constant describing a gyroscope sensor type */
public static final int TYPE_GYROSCOPE = 4;
/** A constant describing a light sensor type */
/**
* A constant describing an light sensor type.
* See {@link android.hardware.SensorEvent SensorEvent}
* for more details.
*/
public static final int TYPE_LIGHT = 5;
/** A constant describing a pressure sensor type */
public static final int TYPE_PRESSURE = 6;
/** A constant describing a temperature sensor type */
public static final int TYPE_TEMPERATURE = 7;
/** A constant describing a proximity sensor type */
/**
* A constant describing an proximity sensor type.
* See {@link android.hardware.SensorEvent SensorEvent}
* for more details.
*/
public static final int TYPE_PROXIMITY = 8;

View File

@@ -115,8 +115,19 @@ public class SensorEvent {
* <p>{@link android.hardware.Sensor#TYPE_MAGNETIC_FIELD Sensor.TYPE_MAGNETIC_FIELD}:<p>
* All values are in micro-Tesla (uT) and measure the ambient magnetic
* field in the X, Y and Z axis.
*
*/
*
* <p>{@link android.hardware.Sensor#TYPE_LIGHT Sensor.TYPE_LIGHT}:<p>
*
* <p>values[0]: Ambient light level in SI lux units
*
* <p>{@link android.hardware.Sensor#TYPE_PROXIMITY Sensor.TYPE_PROXIMITY}:<p>
*
* <p>values[0]: Proximity sensor distance measured in centimeters
*
* <p> Note that some proximity sensors only support a binary "close" or "far" measurement.
* In this case, the sensor should report its maxRange value in the "far" state and a value
* less than maxRange in the "near" state.
*/
public final float[] values;
/**

View File

@@ -313,6 +313,8 @@ public class VCardComposer {
private boolean mIsCallLogComposer = false;
private boolean mNeedPhotoForVCard = true;
private static final String[] sContactsProjection = new String[] {
Contacts._ID,
};
@@ -332,17 +334,17 @@ public class VCardComposer {
private static final String FLAG_TIMEZONE_UTC = "Z";
public VCardComposer(Context context) {
this(context, VCardConfig.VCARD_TYPE_DEFAULT, true, false);
this(context, VCardConfig.VCARD_TYPE_DEFAULT, true, false, true);
}
public VCardComposer(Context context, String vcardTypeStr,
boolean careHandlerErrors) {
this(context, VCardConfig.getVCardTypeFromString(vcardTypeStr),
careHandlerErrors, false);
careHandlerErrors, false, true);
}
public VCardComposer(Context context, int vcardType, boolean careHandlerErrors) {
this(context, vcardType, careHandlerErrors, false);
this(context, vcardType, careHandlerErrors, false, true);
}
/**
@@ -351,11 +353,12 @@ public class VCardComposer {
* @param isCallLogComposer true if this composer is for creating Call Log vCard.
*/
public VCardComposer(Context context, int vcardType, boolean careHandlerErrors,
boolean isCallLogComposer) {
boolean isCallLogComposer, boolean needPhotoInVCard) {
mContext = context;
mVCardType = vcardType;
mCareHandlerErrors = careHandlerErrors;
mIsCallLogComposer = isCallLogComposer;
mNeedPhotoForVCard = needPhotoInVCard;
mContentResolver = context.getContentResolver();
mIsV30 = VCardConfig.isV30(vcardType);
@@ -679,7 +682,9 @@ public class VCardComposer {
appendWebsites(builder, contentValuesListMap);
appendBirthday(builder, contentValuesListMap);
appendOrganizations(builder, contentValuesListMap);
appendPhotos(builder, contentValuesListMap);
if (mNeedPhotoForVCard) {
appendPhotos(builder, contentValuesListMap);
}
appendNotes(builder, contentValuesListMap);
// TODO: GroupMembership

View File

@@ -34,13 +34,13 @@ package android.util;
* <p>This interface provides an efficient mechanism for retrieving
* data from compiled XML files, which can be retrieved for a particular
* XmlPullParser through {@link Xml#asAttributeSet
* Xml.getAttributeSet()}. Normally this will return an implementation
* Xml.asAttributeSet()}. Normally this will return an implementation
* of the interface that works on top of a generic XmlPullParser, however it
* is more useful in conjunction with compiled XML resources:
*
* <pre>
* XmlPullParser parser = resources.getXml(myResouce);
* AttributeSet attributes = Xml.getAttributeSet(parser);</pre>
* AttributeSet attributes = Xml.asAttributeSet(parser);</pre>
*
* <p>The implementation returned here, unlike using
* the implementation on top of a generic XmlPullParser,

View File

@@ -69,7 +69,7 @@ public class DisplayMetrics {
* Density Independent Pixel unit, where one DIP is one pixel on an
* approximately 160 dpi screen (for example a 240x320, 1.5"x2" screen),
* providing the baseline of the system's display. Thus on a 160dpi screen
* this density value will be 1; on a 106 dpi screen it would be .75; etc.
* this density value will be 1; on a 120 dpi screen it would be .75; etc.
*
* <p>This value does not exactly follow the real screen size (as given by
* {@link #xdpi} and {@link #ydpi}, but rather is used to scale the size of

View File

@@ -4956,8 +4956,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
* invalidate/draw passes.
*
* @return True if this View is guaranteed to be fully opaque, false otherwise.
*
* @hide Pending API council approval
*/
@ViewDebug.ExportedProperty
public boolean isOpaque() {

View File

@@ -71,11 +71,6 @@
the slider can be opened (for example, in a pocket or purse). -->
<bool name="config_bypass_keyguard_if_slider_open">true</bool>
<!-- Flag indicating whether the device supports automatic brightness mode in hardware.
WARNING - DO NOT USE THIS FEATURE
Hardware auto brightness support is deprecated and will be removed in the next release. -->
<bool name="config_hardware_automatic_brightness_available">false</bool>
<!-- Flag indicating whether the we should enable the automatic brightness in Settings.
Software implementation will be used if config_hardware_auto_brightness_available is not set -->
<bool name="config_automatic_brightness_available">false</bool>

View File

@@ -1194,4 +1194,12 @@
<public type="drawable" name="screen_background_dark_transparent" />
<public type="drawable" name="screen_background_light_transparent" />
<public type="drawable" name="stat_notify_sdcard_prepare" />
<public type="attr" name="quickContactBadgeStyleWindowSmall" />
<public type="attr" name="quickContactBadgeStyleWindowMedium" />
<public type="attr" name="quickContactBadgeStyleWindowLarge" />
<public type="attr" name="quickContactBadgeStyleSmallWindowSmall" />
<public type="attr" name="quickContactBadgeStyleSmallWindowMedium" />
<public type="attr" name="quickContactBadgeStyleSmallWindowLarge" />
</resources>

View File

@@ -18,7 +18,7 @@ page.title=Android API Levels
</ol>
</li>
<li><a href="#provisional">Using a Provisional API Level</a></li>
<li><a href="#filtering">Filtering the Reference Documentation by API Level</a></li>
<li><a href="#filtering">Filtering the Documentation</a></li>
</ol>
<h2>See also</h2>

View File

@@ -80,7 +80,7 @@ responsive to input and thus avoid ANR dialogs caused by the 5 second input
event timeout. These same practices should be followed for any other threads
that display UI, as they are also subject to the same timeouts.</p>
<p>The specific constraint on IntentReciever execution time emphasizes what
<p>The specific constraint on IntentReceiver execution time emphasizes what
they were meant to do: small, discrete amounts of work in the background such
as saving a setting or registering a Notification. So as with other methods
called in the main thread, applications should avoid potentially long-running

View File

@@ -847,118 +847,118 @@ icons in your applications.</code>.
<tr>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_alarmclock.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_alarmclock.png" alt="Android asset" />
<div class="caption">Alarm Clock</div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_browser.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_browser.png" alt="Android asset" />
<div class="caption">Browser</div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_calculator.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_calculator.png" alt="Android asset" />
<div class="caption">Calculator</div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_calendar.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_calendar.png" alt="Android asset" />
<div class="caption">Calendar</div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_video_camera.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_video_camera.png" alt="Android asset" />
<div class="caption">Camcorder</div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_camera.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_camera.png" alt="Android asset" />
<div class="caption">Camera</div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_contacts.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_contacts.png" alt="Android asset" />
<div class="caption">Contacts</div></td>
</tr>
<tr>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_phone_dialer.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_phone_dialer.png" alt="Android asset" />
<div class="caption">Dialer</div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_email_generic.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_email_generic.png" alt="Android asset" />
<div class="caption">Email</div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_gallery.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_gallery.png" alt="Android asset" />
<div class="caption">Gallery</div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_generic_application.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_generic_application.png" alt="Android asset" />
<div class="caption">Generic application</div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_email.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_email.png" alt="Android asset" />
<div class="caption">Gmail</div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_google_talk.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_google_talk.png" alt="Android asset" />
<div class="caption">Google Talk</div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_IM.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_IM.png" alt="Android asset" />
<div class="caption">IM</div></td>
</tr>
<tr>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_maps.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_maps.png" alt="Android asset" />
<div class="caption">Maps</div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_marketplace.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_marketplace.png" alt="Android asset" />
<div class="caption">Market </div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_sms_mms.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_sms_mms.png" alt="Android asset" />
<div class="caption">Messaging </div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_musicplayer_2.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_musicplayer_2.png" alt="Android asset" />
<div class="caption">Music</div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_settings.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_settings.png" alt="Android asset" />
<div class="caption">Settings</div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_voicedial.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_voicedial.png" alt="Android asset" />
<div class="caption">Voice Dialer</div></td>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_voicesearch.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_voicesearch.png" alt="Android asset" />
<div class="caption">Voice Search</div></td>
</tr>
<tr>
<td class="image-caption-i image-list">
<img src="/images/icon_design/ic_launcher_youtube.png" alt="Android asset" />
<img src="{@docRoot}images/icon_design/ic_launcher_youtube.png" alt="Android asset" />
<div class="caption">YouTube</div></td>
</tr>
</table>

View File

@@ -165,4 +165,4 @@ maximum API Level. </p>
<p>For more information, see the <a
href="{@docRoot}guide/developing/manifest/uses-sdk-element.html"><code>&lt;uses-
sdk&gt;</code></a> manifest element documentation and the <a
href="{@docRoot}guide/appendix/api-levels.htmll">API Levels</a> document.</p>
href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document.</p>

View File

@@ -187,7 +187,7 @@ uninstall procedure and continue to <a href="#installAdt">Install the 0.9 ADT pl
<p>If you encounter problems, ensure your ADT is fully uninstalled and then
follow the guide to
<a href="installingplugin">Installing the ADT Plugin
<a href="installing.html#installingplugin">Installing the ADT Plugin
for Eclipse</a>.</p>
<h3 id="updateEclipsePrefs">Update your Eclipse SDK Preferences</h3>

View File

@@ -360,7 +360,7 @@ begin developing applications. Here are a few ways you can get started: </p>
</ul>
<h2 id="troubleshooting">Installation Troubleshooting</h2>
<h2 id="troubleshooting">Troubleshooting</h2>
<h3>Ubuntu Linux Notes</h3>

View File

@@ -32,6 +32,8 @@
#include <GLES/gl.h>
#include <GLES/glext.h>
struct android_native_buffer_t;
namespace android {
const unsigned int OGLES_NUM_COMPRESSED_TEXTURE_FORMATS = 10;
@@ -602,7 +604,7 @@ struct copybits_context_t {
copybit_device_t* blitEngine;
int32_t minScale;
int32_t maxScale;
buffer_handle_t drawSurfaceBuffer;
android_native_buffer_t* drawSurfaceBuffer;
};
struct ogles_context_t {

View File

@@ -93,6 +93,8 @@ public:
void setIndex(int index);
int getIndex() const;
void setVerticalStride(uint32_t vstride);
uint32_t getVerticalStride() const;
protected:
GraphicBuffer(const Parcel& reply);

View File

@@ -459,6 +459,61 @@ status_t AudioPolicyManagerGeneric::getStreamVolumeIndex(AudioSystem::stream_typ
return NO_ERROR;
}
status_t AudioPolicyManagerGeneric::dump(int fd)
{
const size_t SIZE = 256;
char buffer[SIZE];
String8 result;
snprintf(buffer, SIZE, "\nAudioPolicyManager Dump: %p\n", this);
result.append(buffer);
snprintf(buffer, SIZE, " Hardware Output: %d\n", mHardwareOutput);
result.append(buffer);
snprintf(buffer, SIZE, " Output devices: %08x\n", mAvailableOutputDevices);
result.append(buffer);
snprintf(buffer, SIZE, " Input devices: %08x\n", mAvailableInputDevices);
result.append(buffer);
snprintf(buffer, SIZE, " Phone state: %d\n", mPhoneState);
result.append(buffer);
snprintf(buffer, SIZE, " Ringer mode: %d\n", mRingerMode);
result.append(buffer);
snprintf(buffer, SIZE, " Force use for communications %d\n", mForceUse[AudioSystem::FOR_COMMUNICATION]);
result.append(buffer);
snprintf(buffer, SIZE, " Force use for media %d\n", mForceUse[AudioSystem::FOR_MEDIA]);
result.append(buffer);
snprintf(buffer, SIZE, " Force use for record %d\n", mForceUse[AudioSystem::FOR_RECORD]);
result.append(buffer);
write(fd, result.string(), result.size());
snprintf(buffer, SIZE, "\nOutputs dump:\n");
write(fd, buffer, strlen(buffer));
for (size_t i = 0; i < mOutputs.size(); i++) {
snprintf(buffer, SIZE, "- Output %d dump:\n", mOutputs.keyAt(i));
write(fd, buffer, strlen(buffer));
mOutputs.valueAt(i)->dump(fd);
}
snprintf(buffer, SIZE, "\nInputs dump:\n");
write(fd, buffer, strlen(buffer));
for (size_t i = 0; i < mInputs.size(); i++) {
snprintf(buffer, SIZE, "- Input %d dump:\n", mInputs.keyAt(i));
write(fd, buffer, strlen(buffer));
mInputs.valueAt(i)->dump(fd);
}
snprintf(buffer, SIZE, "\nStreams dump:\n");
write(fd, buffer, strlen(buffer));
snprintf(buffer, SIZE, " Stream Index Min Index Max Index Cur Mute Count Can be muted\n");
write(fd, buffer, strlen(buffer));
for (size_t i = 0; i < AudioSystem::NUM_STREAM_TYPES; i++) {
snprintf(buffer, SIZE, " %02d", i);
mStreams[i].dump(buffer + 3, SIZE);
write(fd, buffer, strlen(buffer));
}
return NO_ERROR;
}
// ----------------------------------------------------------------------------
// AudioPolicyManagerGeneric
// ----------------------------------------------------------------------------
@@ -815,6 +870,35 @@ uint32_t AudioPolicyManagerGeneric::AudioOutputDescriptor::refCount()
return refcount;
}
status_t AudioPolicyManagerGeneric::AudioOutputDescriptor::dump(int fd)
{
const size_t SIZE = 256;
char buffer[SIZE];
String8 result;
snprintf(buffer, SIZE, " Sampling rate: %d\n", mSamplingRate);
result.append(buffer);
snprintf(buffer, SIZE, " Format: %d\n", mFormat);
result.append(buffer);
snprintf(buffer, SIZE, " Channels: %08x\n", mChannels);
result.append(buffer);
snprintf(buffer, SIZE, " Latency: %d\n", mLatency);
result.append(buffer);
snprintf(buffer, SIZE, " Flags %08x\n", mFlags);
result.append(buffer);
snprintf(buffer, SIZE, " Devices %08x\n", mDevice);
result.append(buffer);
snprintf(buffer, SIZE, " Stream refCount\n");
result.append(buffer);
for (int i = 0; i < AudioSystem::NUM_STREAM_TYPES; i++) {
snprintf(buffer, SIZE, " %02d %d\n", i, mRefCount[i]);
result.append(buffer);
}
write(fd, result.string(), result.size());
return NO_ERROR;
}
// --- AudioInputDescriptor class implementation
AudioPolicyManagerGeneric::AudioInputDescriptor::AudioInputDescriptor()
@@ -823,4 +907,39 @@ AudioPolicyManagerGeneric::AudioInputDescriptor::AudioInputDescriptor()
{
}
status_t AudioPolicyManagerGeneric::AudioInputDescriptor::dump(int fd)
{
const size_t SIZE = 256;
char buffer[SIZE];
String8 result;
snprintf(buffer, SIZE, " Sampling rate: %d\n", mSamplingRate);
result.append(buffer);
snprintf(buffer, SIZE, " Format: %d\n", mFormat);
result.append(buffer);
snprintf(buffer, SIZE, " Channels: %08x\n", mChannels);
result.append(buffer);
snprintf(buffer, SIZE, " Acoustics %08x\n", mAcoustics);
result.append(buffer);
snprintf(buffer, SIZE, " Devices %08x\n", mDevice);
result.append(buffer);
snprintf(buffer, SIZE, " Ref Count %d\n", mRefCount);
result.append(buffer);
write(fd, result.string(), result.size());
return NO_ERROR;
}
// --- StreamDescriptor class implementation
void AudioPolicyManagerGeneric::StreamDescriptor::dump(char* buffer, size_t size)
{
snprintf(buffer, size, " %02d %02d %02d %02d %d\n",
mIndexMin,
mIndexMax,
mIndexCur,
mMuteCount,
mCanBeMuted);
}
}; // namespace android

View File

@@ -76,6 +76,8 @@ public:
virtual status_t setStreamVolumeIndex(AudioSystem::stream_type stream, int index);
virtual status_t getStreamVolumeIndex(AudioSystem::stream_type stream, int *index);
virtual status_t dump(int fd);
private:
enum routing_strategy {
@@ -93,6 +95,7 @@ private:
public:
AudioOutputDescriptor();
status_t dump(int fd);
uint32_t device();
void changeRefCount(AudioSystem::stream_type, int delta);
@@ -115,6 +118,8 @@ private:
public:
AudioInputDescriptor();
status_t dump(int fd);
uint32_t mSamplingRate; //
uint32_t mFormat; // input configuration
uint32_t mChannels; //
@@ -130,6 +135,8 @@ private:
StreamDescriptor()
: mIndexMin(0), mIndexMax(1), mIndexCur(1), mMuteCount(0), mCanBeMuted(true) {}
void dump(char* buffer, size_t size);
int mIndexMin; // min volume index
int mIndexMax; // max volume index
int mIndexCur; // current volume index

View File

@@ -43,6 +43,12 @@
namespace android {
static const char* kDeadlockedString = "AudioPolicyService may be deadlocked\n";
static const char* kCmdDeadlockedString = "AudioPolicyService command thread may be deadlocked\n";
static const int kDumpLockRetries = 50;
static const int kDumpLockSleep = 20000;
static bool checkPermission() {
#ifndef HAVE_ANDROID_OS
return true;
@@ -335,17 +341,65 @@ void AudioPolicyService::binderDied(const wp<IBinder>& who) {
LOGW("binderDied() %p, tid %d, calling tid %d", who.unsafe_get(), gettid(), IPCThreadState::self()->getCallingPid());
}
static bool tryLock(Mutex& mutex)
{
bool locked = false;
for (int i = 0; i < kDumpLockRetries; ++i) {
if (mutex.tryLock() == NO_ERROR) {
locked = true;
break;
}
usleep(kDumpLockSleep);
}
return locked;
}
status_t AudioPolicyService::dumpInternals(int fd)
{
const size_t SIZE = 256;
char buffer[SIZE];
String8 result;
snprintf(buffer, SIZE, "PolicyManager Interface: %p\n", mpPolicyManager);
result.append(buffer);
snprintf(buffer, SIZE, "Command Thread: %p\n", mAudioCommandThread.get());
result.append(buffer);
snprintf(buffer, SIZE, "Tones Thread: %p\n", mTonePlaybackThread.get());
result.append(buffer);
write(fd, result.string(), result.size());
return NO_ERROR;
}
status_t AudioPolicyService::dump(int fd, const Vector<String16>& args)
{
if (checkCallingPermission(String16("android.permission.DUMP")) == false) {
dumpPermissionDenial(fd, args);
dumpPermissionDenial(fd);
} else {
bool locked = tryLock(mLock);
if (!locked) {
String8 result(kDeadlockedString);
write(fd, result.string(), result.size());
}
dumpInternals(fd);
if (mAudioCommandThread != NULL) {
mAudioCommandThread->dump(fd);
}
if (mTonePlaybackThread != NULL) {
mTonePlaybackThread->dump(fd);
}
if (mpPolicyManager) {
mpPolicyManager->dump(fd);
}
if (locked) mLock.unlock();
}
return NO_ERROR;
}
status_t AudioPolicyService::dumpPermissionDenial(int fd, const Vector<String16>& args)
status_t AudioPolicyService::dumpPermissionDenial(int fd)
{
const size_t SIZE = 256;
char buffer[SIZE];
@@ -609,6 +663,36 @@ bool AudioPolicyService::AudioCommandThread::threadLoop()
return false;
}
status_t AudioPolicyService::AudioCommandThread::dump(int fd)
{
const size_t SIZE = 256;
char buffer[SIZE];
String8 result;
snprintf(buffer, SIZE, "AudioCommandThread %p Dump\n", this);
result.append(buffer);
write(fd, result.string(), result.size());
bool locked = tryLock(mLock);
if (!locked) {
String8 result2(kCmdDeadlockedString);
write(fd, result2.string(), result2.size());
}
snprintf(buffer, SIZE, "- Commands:\n");
result = String8(buffer);
result.append(" Command Time Status Wait pParam\n");
for (int i = 0; i < (int)mAudioCommands.size(); i++) {
mAudioCommands[i]->dump(buffer, SIZE);
result.append(buffer);
}
write(fd, result.string(), result.size());
if (locked) mLock.unlock();
return NO_ERROR;
}
void AudioPolicyService::AudioCommandThread::startToneCommand(int type, int stream)
{
AudioCommand *command = new AudioCommand();
@@ -808,4 +892,15 @@ void AudioPolicyService::AudioCommandThread::exit()
requestExitAndWait();
}
void AudioPolicyService::AudioCommandThread::AudioCommand::dump(char* buffer, size_t size)
{
snprintf(buffer, size, " %02d %06d.%03d %03d %01u %p\n",
mCommand,
(int)ns2s(mTime),
(int)ns2ms(mTime)%1000,
mStatus,
mWaitStatus,
mParam);
}
}; // namespace android

View File

@@ -111,6 +111,8 @@ private:
AudioPolicyService();
virtual ~AudioPolicyService();
status_t dumpInternals(int fd);
// Thread used for tone playback and to send audio config commands to audio flinger
// For tone playback, using a separate thread is necessary to avoid deadlock with mLock because startTone()
// and stopTone() are normally called with mLock locked and requesting a tone start or stop will cause
@@ -133,6 +135,8 @@ private:
AudioCommandThread ();
virtual ~AudioCommandThread();
status_t dump(int fd);
// Thread virtuals
virtual void onFirstRef();
virtual bool threadLoop();
@@ -149,6 +153,8 @@ private:
// descriptor for requested tone playback event
class AudioCommand {
public:
void dump(char* buffer, size_t size);
int mCommand; // START_TONE, STOP_TONE ...
nsecs_t mTime; // time stamp
Condition mCond; // condition for status return
@@ -188,7 +194,7 @@ private:
};
// Internal dump utilities.
status_t dumpPermissionDenial(int fd, const Vector<String16>& args);
status_t dumpPermissionDenial(int fd);
Mutex mLock; // prevents concurrent access to AudioPolicy manager functions changing device

View File

@@ -132,7 +132,7 @@ MemoryHeapPmem::MemoryHeapPmem(const sp<MemoryHeapBase>& pmemHeap,
char const * const device = pmemHeap->getDevice();
#if HAVE_ANDROID_OS
if (device) {
int fd = open(device, O_RDWR);
int fd = open(device, O_RDWR | (flags & NO_CACHING ? O_SYNC : 0));
LOGE_IF(fd<0, "couldn't open %s (%s)", device, strerror(errno));
if (fd >= 0) {
int err = ioctl(fd, PMEM_CONNECT, pmemHeap->heapID());

View File

@@ -444,6 +444,8 @@ void LayerBuffer::BufferSource::onDraw(const Region& clip) const
GraphicBuffer::USAGE_HW_TEXTURE,
src.img.w, src.img.handle, false);
graphicBuffer->setVerticalStride(src.img.h);
err = mLayer.initializeEglImage(graphicBuffer, &mTexture);
}
#endif

View File

@@ -226,6 +226,14 @@ int GraphicBuffer::getIndex() const {
return mIndex;
}
void GraphicBuffer::setVerticalStride(uint32_t vstride) {
mVStride = vstride;
}
uint32_t GraphicBuffer::getVerticalStride() const {
return mVStride;
}
// ---------------------------------------------------------------------------
}; // namespace android

View File

@@ -126,7 +126,8 @@ void QComHardwareRenderer::publishBuffers(uint32_t pmem_fd) {
master->setDevice("/dev/pmem");
mMemoryHeap = new MemoryHeapPmem(master, 0);
uint32_t heap_flags = master->getFlags() & MemoryHeapBase::NO_CACHING;
mMemoryHeap = new MemoryHeapPmem(master, heap_flags);
mMemoryHeap->slap();
ISurface::BufferHeap bufferHeap(

View File

@@ -226,7 +226,8 @@ public class CameraTest extends ActivityInstrumentationTestCase<MediaFrameworkTe
* Test case 1: Take a picture and verify all the callback
* functions are called properly.
*/
@LargeTest
// TODO: add this back to LargeTest once bug 2141755 is fixed
// @LargeTest
public void testTakePicture() throws Exception {
synchronized (lock) {
initializeMessageLooper();

View File

@@ -83,7 +83,8 @@ public class MediaMimeTest extends ActivityInstrumentationTestCase2<MediaFramewo
assertMediaPlaybackActivityHandles("audio/*");
}
@MediumTest
// TODO: temporarily remove from medium suite because it hangs whole suite
// @MediumTest
// Checks the MediaPlaybackActivity handles application/itunes. Some servers
// set the Content-type header to application/iTunes (with capital T, but
// the download manager downcasts it) for their MP3 podcasts. This is non

View File

@@ -22,6 +22,7 @@ import android.graphics.Bitmap;
import java.io.FileOutputStream;
import android.test.AndroidTestCase;
import com.android.mediaframeworktest.MediaNames;
import com.android.mediaframeworktest.MediaProfileReader;
import android.test.suitebuilder.annotation.*;
/**
@@ -38,10 +39,19 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
public static void testAlbumArt() throws Exception {
Log.v(TAG, "testAlbumArt starts.");
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
MediaProfileReader reader = new MediaProfileReader();
boolean supportWMA = reader.getWMAEnable();
boolean supportWMV = reader.getWMVEnable();
retriever.setMode(MediaMetadataRetriever.MODE_GET_METADATA_ONLY);
for (int i = 0, n = MediaNames.ALBUMART_TEST_FILES.length; i < n; ++i) {
try {
Log.v(TAG, "File " + i + ": " + MediaNames.ALBUMART_TEST_FILES[i]);
if ((MediaNames.ALBUMART_TEST_FILES[i].endsWith(".wma") && !supportWMA) ||
(MediaNames.ALBUMART_TEST_FILES[i].endsWith(".wmv") && !supportWMV)
) {
Log.v(TAG, "windows media is not supported and thus we will skip the test for this file");
continue;
}
retriever.setDataSource(MediaNames.ALBUMART_TEST_FILES[i]);
byte[] albumArt = retriever.extractAlbumArt();
@@ -64,11 +74,20 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
@LargeTest
public static void testThumbnailCapture() throws Exception {
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
MediaProfileReader reader = new MediaProfileReader();
boolean supportWMA = reader.getWMAEnable();
boolean supportWMV = reader.getWMVEnable();
Log.v(TAG, "Thumbnail processing starts");
long startedAt = System.currentTimeMillis();
for(int i = 0, n = MediaNames.THUMBNAIL_CAPTURE_TEST_FILES.length; i < n; ++i) {
try {
Log.v(TAG, "File " + i + ": " + MediaNames.THUMBNAIL_CAPTURE_TEST_FILES[i]);
if ((MediaNames.THUMBNAIL_CAPTURE_TEST_FILES[i].endsWith(".wma") && !supportWMA) ||
(MediaNames.THUMBNAIL_CAPTURE_TEST_FILES[i].endsWith(".wmv") && !supportWMV)
) {
Log.v(TAG, "windows media is not supported and thus we will skip the test for this file");
continue;
}
retriever.setDataSource(MediaNames.THUMBNAIL_CAPTURE_TEST_FILES[i]);
Bitmap bitmap = retriever.captureFrame();
assertTrue(bitmap != null);
@@ -91,10 +110,20 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
@LargeTest
public static void testMetadataRetrieval() throws Exception {
MediaProfileReader reader = new MediaProfileReader();
boolean supportWMA = reader.getWMAEnable();
boolean supportWMV = reader.getWMVEnable();
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
retriever.setMode(MediaMetadataRetriever.MODE_GET_METADATA_ONLY);
for(int i = 0, n = MediaNames.METADATA_RETRIEVAL_TEST_FILES.length; i < n; ++i) {
try {
Log.v(TAG, "File " + i + ": " + MediaNames.METADATA_RETRIEVAL_TEST_FILES[i]);
if ((MediaNames.METADATA_RETRIEVAL_TEST_FILES[i].endsWith(".wma") && !supportWMA) ||
(MediaNames.METADATA_RETRIEVAL_TEST_FILES[i].endsWith(".wmv") && !supportWMV)
) {
Log.v(TAG, "windows media is not supported and thus we will skip the test for this file");
continue;
}
retriever.setDataSource(MediaNames.METADATA_RETRIEVAL_TEST_FILES[i]);
extractAllSupportedMetadataValues(retriever);
} catch(Exception e) {

View File

@@ -46,13 +46,24 @@ namespace android {
static void textureToCopyBitImage(
const GGLSurface* surface, int32_t opFormat,
buffer_handle_t buffer, copybit_image_t* img)
android_native_buffer_t* buffer, copybit_image_t* img)
{
uint32_t vstride = 0;
if (opFormat == COPYBIT_FORMAT_YCbCr_422_SP ||
opFormat == COPYBIT_FORMAT_YCbCr_420_SP) {
// NOTE: this static_cast is really not safe b/c we can't know for
// sure the buffer passed is of the right type.
// However, since we do this only for YUV formats, we should be safe
// since only SurfaceFlinger makes use of them.
GraphicBuffer* graphicBuffer = static_cast<GraphicBuffer*>(buffer);
vstride = graphicBuffer->getVerticalStride();
}
img->w = surface->stride;
img->h = surface->height;
img->h = vstride ? vstride : surface->height;
img->format = opFormat;
img->base = surface->data;
img->handle = (native_handle_t *)buffer;
img->handle = (native_handle_t *)buffer->handle;
}
struct clipRectRegion : public copybit_region_t {
@@ -279,8 +290,8 @@ static bool copybit(GLint x, GLint y,
copybit_device_t* copybit = c->copybits.blitEngine;
copybit_image_t src;
buffer_handle_t source_hnd = textureObject->buffer->handle;
textureToCopyBitImage(&textureObject->surface, opFormat, source_hnd, &src);
textureToCopyBitImage(&textureObject->surface, opFormat,
textureObject->buffer, &src);
copybit_rect_t srect = { Ucr, Vcr + Hcr, Ucr + Wcr, Vcr };
/*
@@ -360,8 +371,8 @@ static bool copybit(GLint x, GLint y,
}
copybit_image_t dst;
buffer_handle_t target_hnd = c->copybits.drawSurfaceBuffer;
textureToCopyBitImage(&cbSurface, cbSurface.format, target_hnd, &dst);
textureToCopyBitImage(&cbSurface, cbSurface.format,
c->copybits.drawSurfaceBuffer, &dst);
copybit_rect_t drect = {x, y, x+w, y+h};

View File

@@ -651,7 +651,7 @@ EGLBoolean egl_window_surface_v2_t::bindDrawSurface(ogles_context_t* gl)
if (supportedCopybitsDestinationFormat(buffer.format)) {
buffer_handle_t handle = this->buffer->handle;
if (handle != NULL) {
gl->copybits.drawSurfaceBuffer = handle;
gl->copybits.drawSurfaceBuffer = this->buffer;
}
}
}

View File

@@ -59,8 +59,6 @@ public class HardwareService extends IHardwareService.Stub {
private boolean mAttentionLightOn;
private boolean mPulsing;
private boolean mAutoBrightnessAvailable;
private class Vibration implements IBinder.DeathRecipient {
private final IBinder mToken;
private final long mTimeout;
@@ -131,9 +129,6 @@ public class HardwareService extends IHardwareService.Stub {
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_SCREEN_OFF);
context.registerReceiver(mIntentReceiver, filter);
mAutoBrightnessAvailable = context.getResources().getBoolean(
com.android.internal.R.bool.config_hardware_automatic_brightness_available);
}
protected void finalize() throws Throwable {
@@ -287,12 +282,6 @@ public class HardwareService extends IHardwareService.Stub {
setLight_native(mNativePointer, light, color, mode, onMS, offMS);
}
void setAutoBrightness_UNCHECKED(boolean on) {
if (mAutoBrightnessAvailable) {
setAutoBrightness_native(mNativePointer, on);
}
}
public void setAttentionLight(boolean on) {
// Not worthy of a permission. We shouldn't have a flashlight permission.
synchronized (this) {
@@ -493,7 +482,6 @@ public class HardwareService extends IHardwareService.Stub {
private static native int init_native();
private static native void finalize_native(int ptr);
private static native void setAutoBrightness_native(int ptr, boolean automatic);
private static native void setLight_native(int ptr, int light, int color, int mode,
int onMS, int offMS);

View File

@@ -218,12 +218,6 @@ class PowerManagerService extends IPowerManager.Stub
private int[] mButtonBacklightValues;
private int[] mKeyboardBacklightValues;
/*
* WARNING - DO NOT USE THE HARDWARE AUTO-BRIGHTNESS FEATURE
* Hardware auto brightness support is deprecated and will be removed in the next release.
*/
private boolean mUseHardwareAutoBrightness;
// Used when logging number and duration of touch-down cycles
private long mTotalTouchDownTime;
private long mLastTouchDown;
@@ -448,17 +442,6 @@ class PowerManagerService extends IPowerManager.Stub
// read settings for auto-brightness
mUseSoftwareAutoBrightness = resources.getBoolean(
com.android.internal.R.bool.config_automatic_brightness_available);
/*
* WARNING - DO NOT USE THE HARDWARE AUTO-BRIGHTNESS FEATURE
* Hardware auto brightness support is deprecated and will be removed in the next release.
*/
mUseHardwareAutoBrightness = resources.getBoolean(
com.android.internal.R.bool.config_hardware_automatic_brightness_available);
if (mUseHardwareAutoBrightness) {
mUseSoftwareAutoBrightness = false;
}
if (mUseSoftwareAutoBrightness) {
mAutoBrightnessLevels = resources.getIntArray(
com.android.internal.R.array.config_autoBrightnessLevels);
@@ -906,7 +889,6 @@ class PowerManagerService extends IPowerManager.Stub
pw.println(" mLightSensorEnabled=" + mLightSensorEnabled);
pw.println(" mLightSensorValue=" + mLightSensorValue);
pw.println(" mLightSensorPendingValue=" + mLightSensorPendingValue);
pw.println(" mUseHardwareAutoBrightness=" + mUseHardwareAutoBrightness);
pw.println(" mUseSoftwareAutoBrightness=" + mUseSoftwareAutoBrightness);
pw.println(" mAutoBrightessEnabled=" + mAutoBrightessEnabled);
mScreenBrightness.dump(pw, " mScreenBrightness: ");
@@ -2086,16 +2068,9 @@ class PowerManagerService extends IPowerManager.Stub
private void setScreenBrightnessMode(int mode) {
boolean enabled = (mode == SCREEN_BRIGHTNESS_MODE_AUTOMATIC);
if (mAutoBrightessEnabled != enabled) {
if (mUseSoftwareAutoBrightness && mAutoBrightessEnabled != enabled) {
mAutoBrightessEnabled = enabled;
if (mUseHardwareAutoBrightness) {
// When setting auto-brightness, must reset the brightness afterwards
mHardware.setAutoBrightness_UNCHECKED(enabled);
if (screenIsOn()) {
setBacklightBrightness((int)mScreenBrightness.curValue);
}
} else if (mUseSoftwareAutoBrightness && screenIsOn()) {
if (screenIsOn()) {
// force recompute of backlight values
if (mLightSensorValue >= 0) {
int value = (int)mLightSensorValue;

View File

@@ -950,8 +950,7 @@ public class StatusBarService extends IStatusBar.Stub
panelSlightlyVisible(true);
updateExpandedViewPos(EXPANDED_LEAVE_ALONE);
mExpandedParams.flags &= ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
mExpandedDialog.getWindow().setAttributes(mExpandedParams);
mExpandedDialog.show();
mExpandedView.requestFocus(View.FOCUS_FORWARD);
mTrackingView.setVisibility(View.VISIBLE);
@@ -1028,8 +1027,7 @@ public class StatusBarService extends IStatusBar.Stub
}
mExpandedVisible = false;
panelSlightlyVisible(false);
mExpandedParams.flags |= WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
mExpandedDialog.getWindow().setAttributes(mExpandedParams);
mExpandedDialog.hide();
mTrackingView.setVisibility(View.GONE);
if ((mDisabled & StatusBarManager.DISABLE_NOTIFICATION_ICONS) == 0) {
@@ -1058,7 +1056,6 @@ public class StatusBarService extends IStatusBar.Stub
else if (mAnimY < mStatusBarView.getHeight()) {
if (SPEW) Log.d(TAG, "Animation completed to collapsed state.");
mAnimating = false;
updateExpandedViewPos(0);
performCollapse();
}
else {
@@ -1511,19 +1508,17 @@ public class StatusBarService extends IStatusBar.Stub
}
}
final int disph = mDisplay.getHeight();
lp = mExpandedDialog.getWindow().getAttributes();
lp.width = ViewGroup.LayoutParams.FILL_PARENT;
lp.height = ViewGroup.LayoutParams.WRAP_CONTENT;
lp.x = 0;
mTrackingPosition = lp.y = -disph; // sufficiently large negative
lp.y = 0;
lp.type = WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL;
lp.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
| WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM
| WindowManager.LayoutParams.FLAG_DITHER
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
| WindowManager.LayoutParams.FLAG_DITHER;
lp.format = pixelFormat;
lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL;
lp.setTitle("StatusBarExpanded");
@@ -1536,6 +1531,7 @@ public class StatusBarService extends IStatusBar.Stub
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
mExpandedDialog.show();
mExpandedDialog.hide();
FrameLayout hack = (FrameLayout)mExpandedView.getParent();
hack.setForeground(null);
}

View File

@@ -55,6 +55,8 @@ public class TrackingPatternView extends View {
final int textureWidth = mTextureWidth;
final int textureHeight = mTextureHeight;
Log.d("TrackingPatternView", "width=" + width + " textureWidth=" + textureWidth);
int x = 0;
int y;

View File

@@ -100,18 +100,6 @@ static void finalize_native(JNIEnv *env, jobject clazz, int ptr)
free(devices);
}
static void setAutoBrightness_native(JNIEnv *env, jobject clazz, int ptr,
jboolean automatic)
{
Devices* devices = (Devices*)ptr;
if (devices->lights[LIGHT_INDEX_BACKLIGHT] == NULL) {
return;
}
devices->lights[LIGHT_INDEX_BACKLIGHT]->set_als_mode(automatic ? 0 : 1);
}
static void setLight_native(JNIEnv *env, jobject clazz, int ptr,
int light, int colorARGB, int flashMode, int onMS, int offMS)
{
@@ -146,7 +134,6 @@ static void vibratorOff(JNIEnv *env, jobject clazz)
static JNINativeMethod method_table[] = {
{ "init_native", "()I", (void*)init_native },
{ "finalize_native", "(I)V", (void*)finalize_native },
{ "setAutoBrightness_native", "(IZ)V", (void*)setAutoBrightness_native },
{ "setLight_native", "(IIIIII)V", (void*)setLight_native },
{ "vibratorOn", "(J)V", (void*)vibratorOn },
{ "vibratorOff", "()V", (void*)vibratorOff }

View File

@@ -41,7 +41,7 @@ public class BridgeXmlBlockParserTest extends TestCase {
parser = new BridgeXmlBlockParser(parser, null, false /* platformResourceFlag */);
InputStream input = this.getClass().getClassLoader().getResourceAsStream(
"/com/android/layoutlib/testdata/layout1.xml");
"com/android/layoutlib/testdata/layout1.xml");
parser.setInput(input, null /*encoding*/);
assertEquals(XmlPullParser.START_DOCUMENT, parser.next());

View File

@@ -13,7 +13,7 @@ public class NinePatchTest extends TestCase {
@Override
protected void setUp() throws Exception {
URL url = this.getClass().getClassLoader().getResource(
"/com/android/layoutlib/testdata/button.9.png");
"com/android/layoutlib/testdata/button.9.png");
mPatch = NinePatch.load(url, false /* convert */);
}