Merge change 8380

* changes:
  Improvements to dragging on the WebTextView.
diff --git a/libs/audioflinger/AudioFlinger.cpp b/libs/audioflinger/AudioFlinger.cpp
index c05ab77..bc0854e 100644
--- a/libs/audioflinger/AudioFlinger.cpp
+++ b/libs/audioflinger/AudioFlinger.cpp
@@ -781,9 +781,8 @@
 
 AudioFlinger::PlaybackThread::PlaybackThread(const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output)
     :   ThreadBase(audioFlinger),
-        mOutput(output),
-        mLastWriteTime(0), mNumWrites(0), mNumDelayedWrites(0),
-        mInWrite(false), mMixBuffer(0), mSuspended(false), mBytesWritten(0)
+        mMixBuffer(0), mSuspended(false), mBytesWritten(0), mOutput(output),
+        mLastWriteTime(0), mNumWrites(0), mNumDelayedWrites(0), mInWrite(false)
 {
     readOutputParameters();
 
@@ -1007,7 +1006,7 @@
         sp<Track> t = mActiveTracks[i].promote();
         if (t == 0) continue;
         Track* const track = t.get();
-        if (t->mStreamType == AudioSystem::MUSIC)
+        if (t->type() == AudioSystem::MUSIC)
             return true;
     }
     return false;
diff --git a/libs/audioflinger/AudioFlinger.h b/libs/audioflinger/AudioFlinger.h
index 7d78749..06c5846 100644
--- a/libs/audioflinger/AudioFlinger.h
+++ b/libs/audioflinger/AudioFlinger.h
@@ -251,6 +251,10 @@
         protected:
             friend class ThreadBase;
             friend class RecordHandle;
+            friend class PlaybackThread;
+            friend class RecordThread;
+            friend class MixerThread;
+            friend class DirectOutputThread;
 
                                 TrackBase(const TrackBase&);
                                 TrackBase& operator = (const TrackBase&);
@@ -318,6 +322,8 @@
                     void        sendConfigEvent(int event, int param = 0);
                     void        processConfigEvents();
 
+        mutable     Mutex                   mLock;
+
     protected:
 
         friend class Track;
@@ -329,7 +335,6 @@
         friend class RecordThread;
         friend class RecordTrack;
 
-        mutable     Mutex                   mLock;
                     Condition               mWaitWorkCV;
                     sp<AudioFlinger>        mAudioFlinger;
                     uint32_t                mSampleRate;
@@ -388,7 +393,10 @@
         protected:
             friend class ThreadBase;
             friend class AudioFlinger;
-            friend class AudioFlinger::TrackHandle;
+            friend class TrackHandle;
+            friend class PlaybackThread;
+            friend class MixerThread;
+            friend class DirectOutputThread;
 
                                 Track(const Track&);
                                 Track& operator = (const Track&);
@@ -510,6 +518,14 @@
             bool        mute;
         };
 
+    protected:
+        int                             mType;
+        int16_t*                        mMixBuffer;
+        bool                            mSuspended;
+        int                             mBytesWritten;
+        bool                            mMasterMute;
+        SortedVector< wp<Track> >       mActiveTracks;
+
     private:
 
         friend class AudioFlinger;
@@ -531,21 +547,15 @@
         virtual status_t    dumpInternals(int fd, const Vector<String16>& args);
         status_t    dumpTracks(int fd, const Vector<String16>& args);
 
-        SortedVector< wp<Track> >       mActiveTracks;
         SortedVector< sp<Track> >       mTracks;
         // mStreamTypes[] uses 1 additionnal stream type internally for the OutputTrack used by DuplicatingThread
         stream_type_t                   mStreamTypes[AudioSystem::NUM_STREAM_TYPES + 1];
         AudioStreamOut*                 mOutput;
         float                           mMasterVolume;
-        bool                            mMasterMute;
         nsecs_t                         mLastWriteTime;
         int                             mNumWrites;
         int                             mNumDelayedWrites;
         bool                            mInWrite;
-        int16_t*                        mMixBuffer;
-        bool                            mSuspended;
-        int                             mType;
-        int                             mBytesWritten;
         int                             mMinBytesToWrite;
     };
 
@@ -661,6 +671,7 @@
 
         private:
             friend class AudioFlinger;
+            friend class RecordThread;
 
                                 RecordTrack(const RecordTrack&);
                                 RecordTrack& operator = (const RecordTrack&);
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 7d4a2c2..8a4b8f9 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -729,6 +729,11 @@
     Configuration mConfiguration = new Configuration();
 
     /**
+     * Hardware-reported OpenGLES version.
+     */
+    final int GL_ES_VERSION;
+
+    /**
      * List of initialization arguments to pass to all processes when binding applications to them.
      * For example, references to the commonly used services.
      */
@@ -1401,6 +1406,9 @@
         mUsageStatsService = new UsageStatsService( new File(
                 systemDir, "usagestats").toString());
 
+        GL_ES_VERSION = SystemProperties.getInt("ro.opengles.version",
+            ConfigurationInfo.GL_ES_VERSION_UNDEFINED);
+
         mConfiguration.makeDefault();
         mProcessStats.init();
         
@@ -11888,6 +11896,7 @@
                     && mConfiguration.keyboard != Configuration.KEYBOARD_NOKEYS) {
                 config.reqInputFeatures |= ConfigurationInfo.INPUT_FEATURE_HARD_KEYBOARD;
             }
+            config.reqGlEsVersion = GL_ES_VERSION;
         }
         return config;
     }