diff options
| -rw-r--r-- | core/java/android/widget/HorizontalScrollView.java | 4 | ||||
| -rw-r--r-- | core/java/android/widget/ScrollView.java | 4 | ||||
| -rw-r--r-- | docs/html/sdk/android-2.2.jd | 13 | ||||
| -rw-r--r-- | voip/java/com/android/server/sip/SipHelper.java | 4 | ||||
| -rw-r--r-- | voip/java/com/android/server/sip/SipService.java | 69 | ||||
| -rw-r--r-- | voip/java/com/android/server/sip/SipSessionGroup.java | 16 |
6 files changed, 105 insertions, 5 deletions
diff --git a/core/java/android/widget/HorizontalScrollView.java b/core/java/android/widget/HorizontalScrollView.java index d38eef3..fee3455 100644 --- a/core/java/android/widget/HorizontalScrollView.java +++ b/core/java/android/widget/HorizontalScrollView.java @@ -551,6 +551,10 @@ public class HorizontalScrollView extends FrameLayout { mEdgeGlowLeft.onRelease(); } } + if (mEdgeGlowLeft != null + && (!mEdgeGlowLeft.isFinished() || !mEdgeGlowRight.isFinished())) { + invalidate(); + } } } break; diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java index 1daf2ab..2ad67ba 100644 --- a/core/java/android/widget/ScrollView.java +++ b/core/java/android/widget/ScrollView.java @@ -546,6 +546,10 @@ public class ScrollView extends FrameLayout { mEdgeGlowTop.onRelease(); } } + if (mEdgeGlowTop != null + && (!mEdgeGlowTop.isFinished() || !mEdgeGlowBottom.isFinished())) { + invalidate(); + } } } break; diff --git a/docs/html/sdk/android-2.2.jd b/docs/html/sdk/android-2.2.jd index 495fd80..063a10f 100644 --- a/docs/html/sdk/android-2.2.jd +++ b/docs/html/sdk/android-2.2.jd @@ -42,7 +42,7 @@ Differences Report »</a> </li> <p>Android {@sdkPlatformVersion} is a {@sdkPlatformMajorMinor} platform release including user features, developer features, API changes, and bug -fixes. For information on developer features and API changes, see the +fixes. For information on developer features and API changes, see the <a href="#api">Framework API</a> section.</p> <p>For developers, the Android {@sdkPlatformVersion} platform is available as a @@ -62,7 +62,7 @@ first.</p> <h2 id="features">Platform Highlights</h2> -<p>For a list of new user features and platform highlights, see the <a +<p>For a list of new user features and platform highlights, see the <a href="http://developer.android.com/sdk/android-2.2-highlights.html">Android 2.2 Platform Highlights</a> document.</p> @@ -316,8 +316,8 @@ href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/Devi <ul> <li> New <code>android:backupAgent</code> attribute of the -<code><application></code> element. Specifies the component name of the -BackupAgent subclass provided by the application to handle backup/restore +<code><application></code> element. Specifies the component name of the +BackupAgent subclass provided by the application to handle backup/restore operations, if any.</li> <li> New <code>android:restoreAnyVersion</code> attribute of the <code><application></code> element. Boolean value that indicates whether @@ -436,6 +436,11 @@ descriptor).</p> <p>Localized UI strings match the locales that are accessible through Settings.</p> +<p class="note"><strong>Note:</strong> Android supports more locales than are listed above. However, +the entire collection of locale strings cannot fit on a single system image, so the above list is +only what's included in the system image for the SDK. All of Android's supported locales are +available in the <a href="http://source.android.com/">Android Open Source Project</a>.</p> + <h2 id="skins">Emulator Skins</h2> <p>The downloadable platform includes a set of emulator skins that you can use diff --git a/voip/java/com/android/server/sip/SipHelper.java b/voip/java/com/android/server/sip/SipHelper.java index 2514262..13e6f14 100644 --- a/voip/java/com/android/server/sip/SipHelper.java +++ b/voip/java/com/android/server/sip/SipHelper.java @@ -365,6 +365,10 @@ class SipHelper { Response response = mMessageFactory.createResponse( Response.BUSY_HERE, request); + if (inviteTransaction == null) { + inviteTransaction = getServerTransaction(event); + } + if (inviteTransaction.getState() != TransactionState.COMPLETED) { if (DEBUG) Log.d(TAG, "send BUSY HERE: " + response); inviteTransaction.sendResponse(response); diff --git a/voip/java/com/android/server/sip/SipService.java b/voip/java/com/android/server/sip/SipService.java index a6f0d88..84e0803 100644 --- a/voip/java/com/android/server/sip/SipService.java +++ b/voip/java/com/android/server/sip/SipService.java @@ -79,6 +79,7 @@ public final class SipService extends ISipService.Stub { private String mNetworkType; private boolean mConnected; private WakeupTimer mTimer; + private WifiScanProcess mWifiScanProcess; private WifiManager.WifiLock mWifiLock; private boolean mWifiOnly; @@ -371,6 +372,7 @@ public final class SipService extends ISipService.Stub { mContext.getSystemService(Context.WIFI_SERVICE)) .createWifiLock(WifiManager.WIFI_MODE_FULL, TAG); mWifiLock.acquire(); + if (!mConnected) startWifiScanner(); } } @@ -379,6 +381,20 @@ public final class SipService extends ISipService.Stub { if (DEBUG) Log.d(TAG, "~~~~~~~~~~~~~~~~~~~~~ release wifi lock"); mWifiLock.release(); mWifiLock = null; + stopWifiScanner(); + } + } + + private synchronized void startWifiScanner() { + if (mWifiScanProcess == null) { + mWifiScanProcess = new WifiScanProcess(); + } + mWifiScanProcess.start(); + } + + private synchronized void stopWifiScanner() { + if (mWifiScanProcess != null) { + mWifiScanProcess.stop(); } } @@ -413,8 +429,10 @@ public final class SipService extends ISipService.Stub { for (SipSessionGroupExt group : mSipGroups.values()) { group.onConnectivityChanged(true); } + if (isWifi && (mWifiLock != null)) stopWifiScanner(); } else { mMyWakeLock.reset(); // in case there's a leak + if (isWifi && (mWifiLock != null)) startWifiScanner(); } } catch (SipException e) { Log.e(TAG, "onConnectivityChanged()", e); @@ -430,6 +448,21 @@ public final class SipService extends ISipService.Stub { } } + private synchronized boolean callingSelf(SipSessionGroupExt ringingGroup, + SipSessionGroup.SipSessionImpl ringingSession) { + String callId = ringingSession.getCallId(); + for (SipSessionGroupExt group : mSipGroups.values()) { + if ((group != ringingGroup) && group.containsSession(callId)) { + if (DEBUG) Log.d(TAG, "call self: " + + ringingSession.getLocalProfile().getUriString() + + " -> " + group.getLocalProfile().getUriString()); + return true; + } + } + return false; + } + + private class SipSessionGroupExt extends SipSessionAdapter { private SipSessionGroup mSipGroup; private PendingIntent mIncomingCallPendingIntent; @@ -452,6 +485,10 @@ public final class SipService extends ISipService.Stub { return mSipGroup.getLocalProfile(); } + public boolean containsSession(String callId) { + return mSipGroup.containsSession(callId); + } + // network connectivity is tricky because network can be disconnected // at any instant so need to deal with exceptions carefully even when // you think you are connected @@ -551,7 +588,7 @@ public final class SipService extends ISipService.Stub { (SipSessionGroup.SipSessionImpl) s; synchronized (SipService.this) { try { - if (!isRegistered()) { + if (!isRegistered() || callingSelf(this, session)) { session.endCall(); return; } @@ -592,6 +629,36 @@ public final class SipService extends ISipService.Stub { } } + private class WifiScanProcess implements Runnable { + private static final String TAG = "\\WIFI_SCAN/"; + private static final int INTERVAL = 60; + private boolean mRunning = false; + + private WifiManager mWifiManager; + + public void start() { + if (mRunning) return; + mRunning = true; + mTimer.set(INTERVAL * 1000, this); + } + + WifiScanProcess() { + mWifiManager = (WifiManager) + mContext.getSystemService(Context.WIFI_SERVICE); + } + + public void run() { + // scan and associate now + if (DEBUGV) Log.v(TAG, "just wake up here for wifi scanning..."); + mWifiManager.startScanActive(); + } + + public void stop() { + mRunning = false; + mTimer.cancel(this); + } + } + // KeepAliveProcess is controlled by AutoRegistrationProcess. // All methods will be invoked in sync with SipService.this. private class KeepAliveProcess implements Runnable { diff --git a/voip/java/com/android/server/sip/SipSessionGroup.java b/voip/java/com/android/server/sip/SipSessionGroup.java index bb246a6..50ce7dc 100644 --- a/voip/java/com/android/server/sip/SipSessionGroup.java +++ b/voip/java/com/android/server/sip/SipSessionGroup.java @@ -231,6 +231,10 @@ class SipSessionGroup implements SipListener { } } + synchronized boolean containsSession(String callId) { + return mSessionMap.containsKey(callId); + } + private synchronized SipSessionImpl getSipSession(EventObject event) { String key = SipHelper.getCallId(event); SipSessionImpl session = mSessionMap.get(key); @@ -582,6 +586,7 @@ class SipSessionGroup implements SipListener { } private void processCommand(EventObject command) throws SipException { + if (isLoggable(command)) Log.d(TAG, "process cmd: " + command); if (!process(command)) { onError(SipErrorCode.IN_PROGRESS, "cannot initiate a new transaction to execute: " @@ -1050,6 +1055,13 @@ class SipSessionGroup implements SipListener { mSipHelper.sendCancel(mClientTransaction); startSessionTimer(CANCEL_CALL_TIMER); return true; + } else if (isRequestEvent(Request.INVITE, evt)) { + // Call self? Send BUSY HERE so server may redirect the call to + // voice mailbox. + RequestEvent event = (RequestEvent) evt; + mSipHelper.sendInviteBusyHere(event, + event.getServerTransaction()); + return true; } return false; } @@ -1351,6 +1363,10 @@ class SipSessionGroup implements SipListener { return DEBUG; } + private static boolean isLoggable(EventObject evt) { + return isLoggable(null, evt); + } + private static boolean isLoggable(SipSessionImpl s, EventObject evt) { if (!isLoggable(s)) return false; if (evt == null) return false; |
