Merge branch 'eclair' into eclair-release
This commit is contained in:
@@ -54,7 +54,7 @@ public class Resources {
|
||||
// Use the current SDK version code. If we are a development build,
|
||||
// also allow the previous SDK version + 1.
|
||||
private static final int sSdkVersion = Build.VERSION.SDK_INT
|
||||
+ ("REL".equals(Build.VERSION.CODENAME) ? 1 : 0);
|
||||
+ ("REL".equals(Build.VERSION.CODENAME) ? 0 : 1);
|
||||
private static final Object mSync = new Object();
|
||||
private static Resources mSystem = null;
|
||||
|
||||
|
||||
@@ -257,11 +257,12 @@ public:
|
||||
DEVICE_IN_WIRED_HEADSET = 0x100000,
|
||||
DEVICE_IN_AUX_DIGITAL = 0x200000,
|
||||
DEVICE_IN_VOICE_CALL = 0x400000,
|
||||
DEVICE_IN_BACK_MIC = 0x800000,
|
||||
DEVICE_IN_DEFAULT = 0x80000000,
|
||||
|
||||
DEVICE_IN_ALL = (DEVICE_IN_COMMUNICATION | DEVICE_IN_AMBIENT | DEVICE_IN_BUILTIN_MIC |
|
||||
DEVICE_IN_BLUETOOTH_SCO_HEADSET | DEVICE_IN_WIRED_HEADSET | DEVICE_IN_AUX_DIGITAL |
|
||||
DEVICE_IN_VOICE_CALL| DEVICE_IN_DEFAULT)
|
||||
DEVICE_IN_VOICE_CALL | DEVICE_IN_BACK_MIC | DEVICE_IN_DEFAULT)
|
||||
};
|
||||
|
||||
// device connection states used for setDeviceConnectionState()
|
||||
|
||||
@@ -41,7 +41,8 @@ enum audio_source {
|
||||
AUDIO_SOURCE_VOICE_UPLINK = 2,
|
||||
AUDIO_SOURCE_VOICE_DOWNLINK = 3,
|
||||
AUDIO_SOURCE_VOICE_CALL = 4,
|
||||
AUDIO_SOURCE_MAX = AUDIO_SOURCE_VOICE_CALL,
|
||||
AUDIO_SOURCE_CAMCORDER = 5,
|
||||
AUDIO_SOURCE_MAX = AUDIO_SOURCE_CAMCORDER,
|
||||
|
||||
AUDIO_SOURCE_LIST_END // must be last - used to validate audio source type
|
||||
};
|
||||
|
||||
@@ -1272,7 +1272,7 @@ struct ResTable_config
|
||||
|
||||
if (version || o.version) {
|
||||
if ((sdkVersion != o.sdkVersion) && requested->sdkVersion) {
|
||||
return (sdkVersion);
|
||||
return (sdkVersion > o.sdkVersion);
|
||||
}
|
||||
|
||||
if ((minorVersion != o.minorVersion) &&
|
||||
@@ -1384,7 +1384,7 @@ struct ResTable_config
|
||||
}
|
||||
if (version != 0) {
|
||||
if (settings.sdkVersion != 0 && sdkVersion != 0
|
||||
&& sdkVersion != settings.sdkVersion) {
|
||||
&& sdkVersion > settings.sdkVersion) {
|
||||
return false;
|
||||
}
|
||||
if (settings.minorVersion != 0 && minorVersion != 0
|
||||
|
||||
@@ -1162,7 +1162,7 @@ AudioFlinger::MixerThread::~MixerThread()
|
||||
|
||||
bool AudioFlinger::MixerThread::threadLoop()
|
||||
{
|
||||
uint32_t sleepTime = 0;
|
||||
uint32_t sleepTime = 1000;
|
||||
uint32_t maxBufferRecoveryInUsecs = getMaxBufferRecoveryInUsecs();
|
||||
int16_t* curBuf = mMixBuffer;
|
||||
Vector< sp<Track> > tracksToRemove;
|
||||
@@ -1224,6 +1224,7 @@ bool AudioFlinger::MixerThread::threadLoop()
|
||||
}
|
||||
|
||||
standbyTime = systemTime() + kStandbyTimeInNsecs;
|
||||
sleepTime = 1000;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -1591,7 +1592,7 @@ AudioFlinger::DirectOutputThread::~DirectOutputThread()
|
||||
|
||||
bool AudioFlinger::DirectOutputThread::threadLoop()
|
||||
{
|
||||
uint32_t sleepTime = 0;
|
||||
uint32_t sleepTime = 1000;
|
||||
uint32_t maxBufferRecoveryInUsecs = getMaxBufferRecoveryInUsecs();
|
||||
sp<Track> trackToRemove;
|
||||
sp<Track> activeTrack;
|
||||
@@ -1643,6 +1644,7 @@ bool AudioFlinger::DirectOutputThread::threadLoop()
|
||||
}
|
||||
|
||||
standbyTime = systemTime() + kStandbyTimeInNsecs;
|
||||
sleepTime = 1000;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -1879,7 +1881,7 @@ AudioFlinger::DuplicatingThread::~DuplicatingThread()
|
||||
|
||||
bool AudioFlinger::DuplicatingThread::threadLoop()
|
||||
{
|
||||
uint32_t sleepTime = 0;
|
||||
uint32_t sleepTime = 1000;
|
||||
uint32_t maxBufferRecoveryInUsecs = getMaxBufferRecoveryInUsecs();
|
||||
int16_t* curBuf = mMixBuffer;
|
||||
Vector< sp<Track> > tracksToRemove;
|
||||
@@ -1940,6 +1942,7 @@ bool AudioFlinger::DuplicatingThread::threadLoop()
|
||||
}
|
||||
|
||||
standbyTime = systemTime() + kStandbyTimeInNsecs;
|
||||
sleepTime = 1000;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,8 @@ Allocation::Allocation(Context *rsc, const Type *type) : ObjectBase(rsc)
|
||||
|
||||
Allocation::~Allocation()
|
||||
{
|
||||
free(mPtr);
|
||||
mPtr = NULL;
|
||||
}
|
||||
|
||||
void Allocation::setCpuWritable(bool)
|
||||
|
||||
@@ -350,6 +350,7 @@ void * Context::threadProc(void *vrsc)
|
||||
rsc->deinitEGL();
|
||||
pthread_mutex_unlock(&gInitMutex);
|
||||
|
||||
rsc->mObjDestroy.mNeedToEmpty = true;
|
||||
rsc->objDestroyOOBRun();
|
||||
LOGV("RS Thread exited");
|
||||
return NULL;
|
||||
@@ -421,6 +422,7 @@ Context::~Context()
|
||||
|
||||
mIO.shutdown();
|
||||
int status = pthread_join(mThreadId, &res);
|
||||
mObjDestroy.mNeedToEmpty = true;
|
||||
objDestroyOOBRun();
|
||||
|
||||
// Global structure cleanup.
|
||||
@@ -431,6 +433,7 @@ Context::~Context()
|
||||
if (!gThreadTLSKeyCount) {
|
||||
pthread_key_delete(gThreadTLSKey);
|
||||
}
|
||||
mDev = NULL;
|
||||
}
|
||||
pthread_mutex_unlock(&gInitMutex);
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ ObjectBase::~ObjectBase()
|
||||
rsAssert(!mUserRefCount);
|
||||
rsAssert(!mSysRefCount);
|
||||
remove();
|
||||
delete[] mName;
|
||||
}
|
||||
|
||||
void ObjectBase::dumpLOGV(const char *op) const
|
||||
|
||||
@@ -99,6 +99,8 @@ SimpleMeshContext::SimpleMeshContext()
|
||||
|
||||
SimpleMeshContext::~SimpleMeshContext()
|
||||
{
|
||||
delete[] mVertexTypes;
|
||||
delete[] mVertexBuffers;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ TypeState::TypeState()
|
||||
|
||||
TypeState::~TypeState()
|
||||
{
|
||||
delete[] mLODs;
|
||||
}
|
||||
|
||||
size_t Type::getOffsetForFace(uint32_t face) const
|
||||
|
||||
@@ -1509,6 +1509,7 @@ void MediaPlayerService::AudioOutput::pause()
|
||||
{
|
||||
LOGV("pause");
|
||||
if (mTrack) mTrack->pause();
|
||||
lastWriteTime = 0;
|
||||
}
|
||||
|
||||
void MediaPlayerService::AudioOutput::close()
|
||||
|
||||
@@ -76,6 +76,7 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
class BackupManagerService extends IBackupManager.Stub {
|
||||
private static final String TAG = "BackupManagerService";
|
||||
@@ -85,6 +86,9 @@ class BackupManagerService extends IBackupManager.Stub {
|
||||
// trigger an immediate pass.
|
||||
private static final long BACKUP_INTERVAL = AlarmManager.INTERVAL_HOUR;
|
||||
|
||||
// Random variation in backup scheduling time to avoid server load spikes
|
||||
private static final int FUZZ_MILLIS = 5 * 60 * 1000;
|
||||
|
||||
// The amount of time between the initial provisioning of the device and
|
||||
// the first backup pass.
|
||||
private static final long FIRST_BACKUP_INTERVAL = 12 * AlarmManager.INTERVAL_HOUR;
|
||||
@@ -1949,9 +1953,15 @@ class BackupManagerService extends IBackupManager.Stub {
|
||||
}
|
||||
|
||||
private void startBackupAlarmsLocked(long delayBeforeFirstBackup) {
|
||||
long when = System.currentTimeMillis() + delayBeforeFirstBackup;
|
||||
mAlarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, when,
|
||||
BACKUP_INTERVAL, mRunBackupIntent);
|
||||
// We used to use setInexactRepeating(), but that may be linked to
|
||||
// backups running at :00 more often than not, creating load spikes.
|
||||
// Schedule at an exact time for now, and also add a bit of "fuzz".
|
||||
|
||||
Random random = new Random();
|
||||
long when = System.currentTimeMillis() + delayBeforeFirstBackup +
|
||||
random.nextInt(FUZZ_MILLIS);
|
||||
mAlarmManager.setRepeating(AlarmManager.RTC_WAKEUP, when,
|
||||
BACKUP_INTERVAL + random.nextInt(FUZZ_MILLIS), mRunBackupIntent);
|
||||
mNextBackupPass = when;
|
||||
}
|
||||
|
||||
|
||||
@@ -1803,6 +1803,8 @@ class PowerManagerService extends IPowerManager.Stub
|
||||
}
|
||||
|
||||
private void forceUserActivityLocked() {
|
||||
// cancel animation so userActivity will succeed
|
||||
mScreenBrightness.animating = false;
|
||||
boolean savedActivityAllowed = mUserActivityAllowed;
|
||||
mUserActivityAllowed = true;
|
||||
userActivity(SystemClock.uptimeMillis(), false);
|
||||
@@ -2079,7 +2081,6 @@ class PowerManagerService extends IPowerManager.Stub
|
||||
public void enableUserActivity(boolean enabled) {
|
||||
synchronized (mLocks) {
|
||||
mUserActivityAllowed = enabled;
|
||||
mLastEventTime = SystemClock.uptimeMillis(); // we might need to pass this in
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -950,7 +950,8 @@ public class StatusBarService extends IStatusBar.Stub
|
||||
panelSlightlyVisible(true);
|
||||
|
||||
updateExpandedViewPos(EXPANDED_LEAVE_ALONE);
|
||||
mExpandedDialog.show();
|
||||
mExpandedParams.flags &= ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||
mExpandedDialog.getWindow().setAttributes(mExpandedParams);
|
||||
mExpandedView.requestFocus(View.FOCUS_FORWARD);
|
||||
mTrackingView.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -1027,7 +1028,8 @@ public class StatusBarService extends IStatusBar.Stub
|
||||
}
|
||||
mExpandedVisible = false;
|
||||
panelSlightlyVisible(false);
|
||||
mExpandedDialog.hide();
|
||||
mExpandedParams.flags |= WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||
mExpandedDialog.getWindow().setAttributes(mExpandedParams);
|
||||
mTrackingView.setVisibility(View.GONE);
|
||||
|
||||
if ((mDisabled & StatusBarManager.DISABLE_NOTIFICATION_ICONS) == 0) {
|
||||
@@ -1056,6 +1058,7 @@ 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 {
|
||||
@@ -1508,17 +1511,19 @@ 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;
|
||||
lp.y = 0;
|
||||
mTrackingPosition = lp.y = -disph; // sufficiently large negative
|
||||
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_DITHER
|
||||
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||
lp.format = pixelFormat;
|
||||
lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL;
|
||||
lp.setTitle("StatusBarExpanded");
|
||||
@@ -1531,7 +1536,6 @@ 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);
|
||||
}
|
||||
|
||||
@@ -55,8 +55,6 @@ 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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user