diff --git a/api/current.xml b/api/current.xml index b4161ae2381e2..3abd38b6a16ed 100644 --- a/api/current.xml +++ b/api/current.xml @@ -6389,6 +6389,72 @@ visibility="public" > + + + + + + + + + + + + + + *
  • 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 manifest.
  • *
  • 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; * } * diff --git a/core/java/android/hardware/Sensor.java b/core/java/android/hardware/Sensor.java index 0ce2f7bc84784..f5fed4f9031dd 100644 --- a/core/java/android/hardware/Sensor.java +++ b/core/java/android/hardware/Sensor.java @@ -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; diff --git a/core/java/android/hardware/SensorEvent.java b/core/java/android/hardware/SensorEvent.java index cf939c52a5e3e..32d56910c3659 100644 --- a/core/java/android/hardware/SensorEvent.java +++ b/core/java/android/hardware/SensorEvent.java @@ -115,8 +115,19 @@ public class SensorEvent { *

    {@link android.hardware.Sensor#TYPE_MAGNETIC_FIELD Sensor.TYPE_MAGNETIC_FIELD}:

    * All values are in micro-Tesla (uT) and measure the ambient magnetic * field in the X, Y and Z axis. - * - */ + * + *

    {@link android.hardware.Sensor#TYPE_LIGHT Sensor.TYPE_LIGHT}:

    + * + *

    values[0]: Ambient light level in SI lux units + * + *

    {@link android.hardware.Sensor#TYPE_PROXIMITY Sensor.TYPE_PROXIMITY}:

    + * + *

    values[0]: Proximity sensor distance measured in centimeters + * + *

    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; /** diff --git a/core/java/android/pim/vcard/VCardComposer.java b/core/java/android/pim/vcard/VCardComposer.java index c4711f820d5a8..9638262faee0d 100644 --- a/core/java/android/pim/vcard/VCardComposer.java +++ b/core/java/android/pim/vcard/VCardComposer.java @@ -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 diff --git a/core/java/android/util/AttributeSet.java b/core/java/android/util/AttributeSet.java index 01a7ad4840c26..82592b9f7e061 100644 --- a/core/java/android/util/AttributeSet.java +++ b/core/java/android/util/AttributeSet.java @@ -34,13 +34,13 @@ package android.util; *

    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: * *

      * XmlPullParser parser = resources.getXml(myResouce);
    - * AttributeSet attributes = Xml.getAttributeSet(parser);
    + * AttributeSet attributes = Xml.asAttributeSet(parser); * *

    The implementation returned here, unlike using * the implementation on top of a generic XmlPullParser, diff --git a/core/java/android/util/DisplayMetrics.java b/core/java/android/util/DisplayMetrics.java index 74f01cc871975..2628eb4026d58 100644 --- a/core/java/android/util/DisplayMetrics.java +++ b/core/java/android/util/DisplayMetrics.java @@ -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. * *

    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 diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index eb3e52398825c..ef306fec445fa 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -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() { diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index bd6e7b4096ad9..90582214bfecb 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -71,11 +71,6 @@ the slider can be opened (for example, in a pocket or purse). --> true - - false - false diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 52e3200211ebc..a0b56101b9433 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1194,4 +1194,12 @@ + + + + + + + + diff --git a/docs/html/guide/appendix/api-levels.jd b/docs/html/guide/appendix/api-levels.jd index 083003236a25b..cebd2d43891ad 100644 --- a/docs/html/guide/appendix/api-levels.jd +++ b/docs/html/guide/appendix/api-levels.jd @@ -18,7 +18,7 @@ page.title=Android API Levels

  • Using a Provisional API Level
  • -
  • Filtering the Reference Documentation by API Level
  • +
  • Filtering the Documentation
  • See also

    diff --git a/docs/html/guide/practices/design/responsiveness.jd b/docs/html/guide/practices/design/responsiveness.jd index ecd743d59550b..1d5a235e821d0 100644 --- a/docs/html/guide/practices/design/responsiveness.jd +++ b/docs/html/guide/practices/design/responsiveness.jd @@ -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.

    -

    The specific constraint on IntentReciever execution time emphasizes what +

    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 diff --git a/docs/html/guide/practices/ui_guidelines/icon_design.jd b/docs/html/guide/practices/ui_guidelines/icon_design.jd index 5f0a278bed92d..e5a1b5e29895f 100644 --- a/docs/html/guide/practices/ui_guidelines/icon_design.jd +++ b/docs/html/guide/practices/ui_guidelines/icon_design.jd @@ -847,118 +847,118 @@ icons in your applications.. - Android asset + Android asset

    Alarm Clock
    - Android asset + Android asset
    Browser
    - Android asset + Android asset
    Calculator
    - Android asset + Android asset
    Calendar
    - Android asset + Android asset
    Camcorder
    - Android asset + Android asset
    Camera
    - Android asset + Android asset
    Contacts
    - Android asset + Android asset
    Dialer
    - Android asset + Android asset
    Email
    - Android asset + Android asset
    Gallery
    - Android asset + Android asset
    Generic application
    - Android asset + Android asset
    Gmail
    - Android asset + Android asset
    Google Talk
    - Android asset + Android asset
    IM
    - Android asset + Android asset
    Maps
    - Android asset + Android asset
    Market
    - Android asset + Android asset
    Messaging
    - Android asset + Android asset
    Music
    - Android asset + Android asset
    Settings
    - Android asset + Android asset
    Voice Dialer
    - Android asset + Android asset
    Voice Search
    - Android asset + Android asset
    YouTube
    diff --git a/docs/html/guide/publishing/versioning.jd b/docs/html/guide/publishing/versioning.jd index 8d8b3041ebfa2..0bec658c9dc9c 100644 --- a/docs/html/guide/publishing/versioning.jd +++ b/docs/html/guide/publishing/versioning.jd @@ -165,4 +165,4 @@ maximum API Level.

    For more information, see the <uses- sdk> manifest element documentation and the API Levels document.

    +href="{@docRoot}guide/appendix/api-levels.html">API Levels document.

    diff --git a/docs/html/sdk/1.5_r3/upgrading.jd b/docs/html/sdk/1.5_r3/upgrading.jd index c79b65682a07f..f853d252dc015 100644 --- a/docs/html/sdk/1.5_r3/upgrading.jd +++ b/docs/html/sdk/1.5_r3/upgrading.jd @@ -187,7 +187,7 @@ uninstall procedure and continue to Install the 0.9 ADT pl

    If you encounter problems, ensure your ADT is fully uninstalled and then follow the guide to -Installing the ADT Plugin +Installing the ADT Plugin for Eclipse.

    Update your Eclipse SDK Preferences

    diff --git a/docs/html/sdk/installing.jd b/docs/html/sdk/installing.jd index 66c6bdccaadc7..edc77e83855f2 100644 --- a/docs/html/sdk/installing.jd +++ b/docs/html/sdk/installing.jd @@ -360,7 +360,7 @@ begin developing applications. Here are a few ways you can get started:

    -

    Installation Troubleshooting

    +

    Troubleshooting

    Ubuntu Linux Notes

    diff --git a/include/private/opengles/gl_context.h b/include/private/opengles/gl_context.h index 67c2dd80681fd..26cde38693b9a 100644 --- a/include/private/opengles/gl_context.h +++ b/include/private/opengles/gl_context.h @@ -32,6 +32,8 @@ #include #include +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 { diff --git a/include/ui/GraphicBuffer.h b/include/ui/GraphicBuffer.h index 21725360d1d9d..b9c491be1a6cc 100644 --- a/include/ui/GraphicBuffer.h +++ b/include/ui/GraphicBuffer.h @@ -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); diff --git a/libs/audioflinger/AudioPolicyManagerGeneric.cpp b/libs/audioflinger/AudioPolicyManagerGeneric.cpp index 632385915a32c..8cfc20433a354 100644 --- a/libs/audioflinger/AudioPolicyManagerGeneric.cpp +++ b/libs/audioflinger/AudioPolicyManagerGeneric.cpp @@ -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 diff --git a/libs/audioflinger/AudioPolicyManagerGeneric.h b/libs/audioflinger/AudioPolicyManagerGeneric.h index d904520cbca13..4997cdf1499bc 100644 --- a/libs/audioflinger/AudioPolicyManagerGeneric.h +++ b/libs/audioflinger/AudioPolicyManagerGeneric.h @@ -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 diff --git a/libs/audioflinger/AudioPolicyService.cpp b/libs/audioflinger/AudioPolicyService.cpp index f71c99c0c4ae0..97236973e6402 100644 --- a/libs/audioflinger/AudioPolicyService.cpp +++ b/libs/audioflinger/AudioPolicyService.cpp @@ -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& 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& 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& 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 diff --git a/libs/audioflinger/AudioPolicyService.h b/libs/audioflinger/AudioPolicyService.h index 11a1214489065..7c1bb85993ca9 100644 --- a/libs/audioflinger/AudioPolicyService.h +++ b/libs/audioflinger/AudioPolicyService.h @@ -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& args); + status_t dumpPermissionDenial(int fd); Mutex mLock; // prevents concurrent access to AudioPolicy manager functions changing device diff --git a/libs/binder/MemoryHeapPmem.cpp b/libs/binder/MemoryHeapPmem.cpp index 3806a42d37c5a..c66094761df53 100644 --- a/libs/binder/MemoryHeapPmem.cpp +++ b/libs/binder/MemoryHeapPmem.cpp @@ -132,7 +132,7 @@ MemoryHeapPmem::MemoryHeapPmem(const sp& 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()); diff --git a/libs/surfaceflinger/LayerBuffer.cpp b/libs/surfaceflinger/LayerBuffer.cpp index 82a8e519f8738..a36304c8de785 100644 --- a/libs/surfaceflinger/LayerBuffer.cpp +++ b/libs/surfaceflinger/LayerBuffer.cpp @@ -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 diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp index efe2d786cf1f6..6a5c8a9c4ca53 100644 --- a/libs/ui/GraphicBuffer.cpp +++ b/libs/ui/GraphicBuffer.cpp @@ -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 diff --git a/media/libstagefright/omx/QComHardwareRenderer.cpp b/media/libstagefright/omx/QComHardwareRenderer.cpp index 7dc368f16520e..c65d1f3bebc40 100644 --- a/media/libstagefright/omx/QComHardwareRenderer.cpp +++ b/media/libstagefright/omx/QComHardwareRenderer.cpp @@ -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( diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/CameraTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/CameraTest.java index fa0986ab68d81..e66e560cc5062 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/CameraTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/CameraTest.java @@ -226,7 +226,8 @@ public class CameraTest extends ActivityInstrumentationTestCase(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}; diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index d04900e870541..80ddc0280f9ac 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -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; } } } diff --git a/services/java/com/android/server/HardwareService.java b/services/java/com/android/server/HardwareService.java index 7c56a30804e81..b1d58ce8d1b01 100755 --- a/services/java/com/android/server/HardwareService.java +++ b/services/java/com/android/server/HardwareService.java @@ -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); diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java index 8a7c28fc1fc17..f75f7195be0a4 100644 --- a/services/java/com/android/server/PowerManagerService.java +++ b/services/java/com/android/server/PowerManagerService.java @@ -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; diff --git a/services/java/com/android/server/status/StatusBarService.java b/services/java/com/android/server/status/StatusBarService.java index 8dded1a8a6e84..59e9832c18fe6 100644 --- a/services/java/com/android/server/status/StatusBarService.java +++ b/services/java/com/android/server/status/StatusBarService.java @@ -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); } diff --git a/services/java/com/android/server/status/TrackingPatternView.java b/services/java/com/android/server/status/TrackingPatternView.java index 4cb8eff5043a7..0ae9984cb348c 100644 --- a/services/java/com/android/server/status/TrackingPatternView.java +++ b/services/java/com/android/server/status/TrackingPatternView.java @@ -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; diff --git a/services/jni/com_android_server_HardwareService.cpp b/services/jni/com_android_server_HardwareService.cpp index a17e29fbf60d5..22d4bd8766e89 100644 --- a/services/jni/com_android_server_HardwareService.cpp +++ b/services/jni/com_android_server_HardwareService.cpp @@ -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 } diff --git a/tools/layoutlib/bridge/tests/com/android/layoutlib/bridge/BridgeXmlBlockParserTest.java b/tools/layoutlib/bridge/tests/com/android/layoutlib/bridge/BridgeXmlBlockParserTest.java index 9e2987a4d33e8..db1262f8b19b5 100644 --- a/tools/layoutlib/bridge/tests/com/android/layoutlib/bridge/BridgeXmlBlockParserTest.java +++ b/tools/layoutlib/bridge/tests/com/android/layoutlib/bridge/BridgeXmlBlockParserTest.java @@ -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()); diff --git a/tools/layoutlib/bridge/tests/com/android/layoutlib/bridge/NinePatchTest.java b/tools/layoutlib/bridge/tests/com/android/layoutlib/bridge/NinePatchTest.java index 5314976ff89a7..d5993dbb7f378 100644 --- a/tools/layoutlib/bridge/tests/com/android/layoutlib/bridge/NinePatchTest.java +++ b/tools/layoutlib/bridge/tests/com/android/layoutlib/bridge/NinePatchTest.java @@ -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 */); }