diff options
author | Dianne Hackborn <hackbod@google.com> | 2012-11-30 10:41:47 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-11-30 10:42:15 -0800 |
commit | 675814d488579582e0214cc720d9ccc310173f25 (patch) | |
tree | e0ac74039f48c5fd99d1d44b03a5e28c485c0716 /services/java/com/android | |
parent | 849f5188e34ea667b689e795d88411a2412db2e8 (diff) | |
parent | 6c5406acd72eed31f2b4e12f5eddc0e2d2a951e2 (diff) | |
download | frameworks_base-675814d488579582e0214cc720d9ccc310173f25.zip frameworks_base-675814d488579582e0214cc720d9ccc310173f25.tar.gz frameworks_base-675814d488579582e0214cc720d9ccc310173f25.tar.bz2 |
Merge "Maybe fix issue #7596986: Frequent runtime restarts; IAE at..." into jb-mr1.1-dev
Diffstat (limited to 'services/java/com/android')
-rw-r--r-- | services/java/com/android/server/LocationManagerService.java | 6 | ||||
-rw-r--r-- | services/java/com/android/server/am/BroadcastQueue.java | 16 |
2 files changed, 19 insertions, 3 deletions
diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java index 7a55497c..0d4a1c2 100644 --- a/services/java/com/android/server/LocationManagerService.java +++ b/services/java/com/android/server/LocationManagerService.java @@ -531,7 +531,7 @@ public class LocationManagerService extends ILocationManager.Stub implements Run synchronized (this) { // synchronize to ensure incrementPendingBroadcastsLocked() // is called before decrementPendingBroadcasts() - mListener.onLocationChanged(location); + mListener.onLocationChanged(new Location(location)); // call this after broadcasting so we do not increment // if we throw an exeption. incrementPendingBroadcastsLocked(); @@ -1323,10 +1323,10 @@ public class LocationManagerService extends ILocationManager.Stub implements Run if (allowedResolutionLevel < RESOLUTION_LEVEL_FINE) { Location noGPSLocation = location.getExtraLocation(Location.EXTRA_NO_GPS_LOCATION); if (noGPSLocation != null) { - return mLocationFudger.getOrCreate(noGPSLocation); + return new Location(mLocationFudger.getOrCreate(noGPSLocation)); } } else { - return location; + return new Location(location); } } return null; diff --git a/services/java/com/android/server/am/BroadcastQueue.java b/services/java/com/android/server/am/BroadcastQueue.java index f9630ae..bada7f0 100644 --- a/services/java/com/android/server/am/BroadcastQueue.java +++ b/services/java/com/android/server/am/BroadcastQueue.java @@ -38,6 +38,7 @@ import android.os.RemoteException; import android.os.SystemClock; import android.os.UserHandle; import android.util.EventLog; +import android.util.Log; import android.util.Slog; /** @@ -779,6 +780,21 @@ public class BroadcastQueue { } catch (RemoteException e) { Slog.w(TAG, "Exception when sending broadcast to " + r.curComponent, e); + } catch (RuntimeException e) { + Log.wtf(TAG, "Failed sending broadcast to " + + r.curComponent + " with " + r.intent, e); + // If some unexpected exception happened, just skip + // this broadcast. At this point we are not in the call + // from a client, so throwing an exception out from here + // will crash the entire system instead of just whoever + // sent the broadcast. + logBroadcastReceiverDiscardLocked(r); + finishReceiverLocked(r, r.resultCode, r.resultData, + r.resultExtras, r.resultAbort, true); + scheduleBroadcastsLocked(); + // We need to reset the state if we failed to start the receiver. + r.state = BroadcastRecord.IDLE; + return; } // If a dead object exception was thrown -- fall through to |