Merge branch 'eclair' into eclair-release

This commit is contained in:
The Android Open Source Project
2009-10-08 14:44:36 -07:00
14 changed files with 109 additions and 17 deletions

View File

@@ -563,7 +563,19 @@ status_t CameraService::Client::setOverlay()
status_t ret = NO_ERROR;
if (mSurface != 0) {
if (mOverlayRef.get() == NULL) {
mOverlayRef = mSurface->createOverlay(w, h, OVERLAY_FORMAT_DEFAULT);
// FIXME:
// Surfaceflinger may hold onto the previous overlay reference for some
// time after we try to destroy it. retry a few times. In the future, we
// should make the destroy call block, or possibly specify that we can
// wait in the createOverlay call if the previous overlay is in the
// process of being destroyed.
for (int retry = 0; retry < 50; ++retry) {
mOverlayRef = mSurface->createOverlay(w, h, OVERLAY_FORMAT_DEFAULT);
if (mOverlayRef != NULL) break;
LOGD("Overlay create failed - retrying");
usleep(20000);
}
if ( mOverlayRef.get() == NULL )
{
LOGE("Overlay Creation Failed!");

View File

@@ -110,7 +110,7 @@ static void dumpstate(int full) {
PRINT("------ PACKAGE UID ERRORS ------");
DUMP("/data/system/uiderrors.txt");
dump_kernel_log("/data/dontpanic/last_kmsg", "RAMCONSOLE");
dump_kernel_log("/data/dontpanic/last_kmsg", "LAST KMSG");
dump_kernel_log("/data/dontpanic/apanic_console",
"PANIC CONSOLE");
dump_kernel_log("/data/dontpanic/apanic_threads",

View File

@@ -146,7 +146,7 @@ public class AuthenticatorBindHelper {
Log.v(TAG, "there are no more callbacks for service "
+ authenticatorType + ", unbinding service");
}
unbindFromService(authenticatorType);
unbindFromServiceLocked(authenticatorType);
} else {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "leaving service " + authenticatorType
@@ -161,7 +161,10 @@ public class AuthenticatorBindHelper {
}
}
private void unbindFromService(String authenticatorType) {
/**
* You must synchronized on mServiceConnections before calling this
*/
private void unbindFromServiceLocked(String authenticatorType) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "unbindService from " + authenticatorType);
}
@@ -217,15 +220,18 @@ public class AuthenticatorBindHelper {
// post a message for each service user to tell them that the service is disconnected,
// and unbind from the service.
synchronized (mServiceConnections) {
for (Callback callback : mServiceUsers.get(mAuthenticatorType)) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "the service became disconnected, scheduling a "
+ "disconnected message for "
+ mAuthenticatorType);
final ArrayList<Callback> callbackList = mServiceUsers.get(mAuthenticatorType);
if (callbackList != null) {
for (Callback callback : callbackList) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "the service became disconnected, scheduling a "
+ "disconnected message for "
+ mAuthenticatorType);
}
mHandler.obtainMessage(mMessageWhatDisconnected, callback).sendToTarget();
}
mHandler.obtainMessage(mMessageWhatDisconnected, callback).sendToTarget();
unbindFromServiceLocked(mAuthenticatorType);
}
unbindFromService(mAuthenticatorType);
}
}
}

View File

@@ -1314,13 +1314,13 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
// source. this is because GlobalSearch may not have permission to launch the
// intent, and to avoid the extra step of going through GlobalSearch.
if (mGlobalSearchMode) {
launchGlobalSearchIntent(intent);
if (mStoredComponentName != null) {
// If we're embedded in an application, dismiss the dialog.
// This ensures that if the intent is handled by the current
// activity, it's not obscured by the dialog.
dismiss();
}
launchGlobalSearchIntent(intent);
} else {
// If the intent was created from a suggestion, it will always have an explicit
// component here.

View File

@@ -287,9 +287,13 @@ public final class BluetoothDevice implements Parcelable {
/** A bond attempt failed because of repeated attempts
* @hide */
public static final int UNBOND_REASON_REPEATED_ATTEMPTS = 7;
/** A bond attempt failed because we received an Authentication Cancel
* by remote end
* @hide */
public static final int UNBOND_REASON_REMOTE_AUTH_CANCELED = 8;
/** An existing bond was explicitly revoked
* @hide */
public static final int UNBOND_REASON_REMOVED = 8;
public static final int UNBOND_REASON_REMOVED = 9;
/** The user will be prompted to enter a pin
* @hide */

View File

@@ -698,6 +698,7 @@ public class ContactStruct {
mPhotoList = new ArrayList<PhotoData>(1);
}
final PhotoData photoData = new PhotoData(0, null, photoBytes);
mPhotoList.add(photoData);
}
/**

View File

@@ -54,6 +54,7 @@ class BluetoothEventLoop {
private static final int EVENT_AUTO_PAIRING_FAILURE_ATTEMPT_DELAY = 1;
private static final int EVENT_RESTART_BLUETOOTH = 2;
private static final int EVENT_PAIRING_CONSENT_DELAYED_ACCEPT = 3;
private static final int EVENT_AGENT_CANCEL = 4;
private static final int CREATE_DEVICE_ALREADY_EXISTS = 1;
private static final int CREATE_DEVICE_SUCCESS = 0;
@@ -90,6 +91,22 @@ class BluetoothEventLoop {
mBluetoothService.setPairingConfirmation(address, true);
}
break;
case EVENT_AGENT_CANCEL:
// Set the Bond State to BOND_NONE.
// We always have only 1 device in BONDING state.
String[] devices =
mBluetoothService.getBondState().listInState(BluetoothDevice.BOND_BONDING);
if (devices.length == 0) {
break;
} else if (devices.length > 1) {
Log.e(TAG, " There is more than one device in the Bonding State");
break;
}
address = devices[0];
mBluetoothService.getBondState().setBondState(address,
BluetoothDevice.BOND_NONE,
BluetoothDevice.UNBOND_REASON_REMOTE_AUTH_CANCELED);
break;
}
}
};
@@ -544,6 +561,10 @@ class BluetoothEventLoop {
private void onAgentCancel() {
Intent intent = new Intent(BluetoothDevice.ACTION_PAIRING_CANCEL);
mContext.sendBroadcast(intent, BLUETOOTH_ADMIN_PERM);
mHandler.sendMessageDelayed(mHandler.obtainMessage(EVENT_AGENT_CANCEL),
1500);
return;
}

View File

@@ -571,7 +571,7 @@ public class BluetoothService extends IBluetooth.Stub {
return state.intValue();
}
private synchronized String[] listInState(int state) {
/*package*/ synchronized String[] listInState(int state) {
ArrayList<String> result = new ArrayList<String>(mState.size());
for (Map.Entry<String, Integer> e : mState.entrySet()) {
if (e.getValue().intValue() == state) {

View File

@@ -6189,7 +6189,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
final int drawingCacheBackgroundColor = mDrawingCacheBackgroundColor;
final boolean opaque = drawingCacheBackgroundColor != 0 || isOpaque();
final boolean translucentWindow = attachInfo.mTranslucentWindow;
final boolean translucentWindow = attachInfo != null && attachInfo.mTranslucentWindow;
if (width <= 0 || height <= 0 ||
// Projected bitmap size in bytes

View File

@@ -262,6 +262,13 @@ public interface WindowManagerPolicy {
*/
boolean isVisibleLw();
/**
* Like {@link #isVisibleLw}, but also counts a window that is currently
* "hidden" behind the keyguard as visible. This allows us to apply
* things like window flags that impact the keyguard.
*/
boolean isVisibleOrBehindKeyguardLw();
/**
* Is this window currently visible to the user on-screen? It is
* displayed either if it is visible or it is currently running an

View File

@@ -158,4 +158,6 @@
<!-- Allow the menu hard key to be disabled in LockScreen on some devices -->
<bool name="config_disableMenuKeyInLockScreen">false</bool>
<!-- Control whether status bar should distinguish HSPA data icon form UMTS data icon on devices -->
<bool name="config_hspa_data_distinguishable">false</bool>
</resources>

View File

@@ -382,7 +382,12 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
}
public void locationCallbackFinished(ILocationListener listener) {
Receiver receiver = getReceiver(listener);
//Do not use getReceiver here as that will add the ILocationListener to
//the receiver list if it is not found. If it is not found then the
//LocationListener was removed when it had a pending broadcast and should
//not be added back.
IBinder binder = listener.asBinder();
Receiver receiver = mReceivers.get(binder);
if (receiver != null) {
synchronized (receiver) {
// so wakelock calls will succeed
@@ -921,6 +926,12 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
try {
if (mReceivers.remove(receiver.mKey) != null && receiver.isListener()) {
receiver.getListener().asBinder().unlinkToDeath(receiver, 0);
synchronized(receiver) {
if(receiver.mPendingBroadcasts > 0) {
decrementPendingBroadcasts();
receiver.mPendingBroadcasts = 0;
}
}
}
// Record which providers were associated with this listener

View File

@@ -7573,6 +7573,21 @@ public class WindowManagerService extends IWindowManager.Stub
&& !mExiting && !mDestroying;
}
/**
* Like {@link #isVisibleLw}, but also counts a window that is currently
* "hidden" behind the keyguard as visible. This allows us to apply
* things like window flags that impact the keyguard.
* XXX I am starting to think we need to have ANOTHER visibility flag
* for this "hidden behind keyguard" state rather than overloading
* mPolicyVisibility. Ungh.
*/
public boolean isVisibleOrBehindKeyguardLw() {
final AppWindowToken atoken = mAppToken;
return mSurface != null && !mAttachedHidden
&& (atoken == null ? mPolicyVisibility : !atoken.hiddenRequested)
&& !mExiting && !mDestroying;
}
/**
* Is this window visible, ignoring its app token? It is not visible
* if there is no surface, or we are in the process of running an exit animation

View File

@@ -272,6 +272,7 @@ public class StatusBarPolicy {
private IBinder mDataIcon;
private IconData mDataData;
private boolean mDataIconVisible;
private boolean mHspaDataDistinguishable;
// ringer volume
private IBinder mVolumeIcon;
@@ -517,6 +518,14 @@ public class StatusBarPolicy {
filter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
filter.addAction(TtyIntent.TTY_ENABLED_CHANGE_ACTION);
mContext.registerReceiver(mIntentReceiver, filter, null, mHandler);
// load config to determine if to distinguish Hspa data icon
try {
mHspaDataDistinguishable = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_hspa_data_distinguishable);
} catch (Exception e) {
mHspaDataDistinguishable = false;
}
}
public static void installIcons(Context context, StatusBarService service) {
@@ -960,7 +969,11 @@ public class StatusBarPolicy {
case TelephonyManager.NETWORK_TYPE_HSDPA:
case TelephonyManager.NETWORK_TYPE_HSUPA:
case TelephonyManager.NETWORK_TYPE_HSPA:
mDataIconList = sDataNetType_h;
if (mHspaDataDistinguishable) {
mDataIconList = sDataNetType_h;
} else {
mDataIconList = sDataNetType_3g;
}
break;
case TelephonyManager.NETWORK_TYPE_CDMA:
// display 1xRTT for IS95A/B