diff options
author | Dianne Hackborn <hackbod@google.com> | 2012-10-03 16:38:22 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2012-10-03 18:07:23 -0700 |
commit | c428aae6429c3fd5e2037c3793af399d9f6e23bf (patch) | |
tree | ea5452cc311e5440b6e3dbce5f856fbc8915b653 /core | |
parent | 2e307a61a3730e6b65906f575d85258b197e3494 (diff) | |
download | frameworks_base-c428aae6429c3fd5e2037c3793af399d9f6e23bf.zip frameworks_base-c428aae6429c3fd5e2037c3793af399d9f6e23bf.tar.gz frameworks_base-c428aae6429c3fd5e2037c3793af399d9f6e23bf.tar.bz2 |
Fix issue #7267494, issue #7212347
7267494 Calendar is not syncing
Check for whether a content provider is dead before returning
it. This is kind-of a band-aid, but probably the right thing
to do; I'm just not sure exactly the full details of why this
problem is happening. Hopefully this "fixes" it, though I don't
have a way to repro to tell.
7212347 System power off dialog is only visible to user 0
Make it visible. Also turn on some battery debugging stuff and
clean it up so we can just keep it.
Change-Id: I5add25bf2a763c8dfe1df23bc5c753a9ea5d157a
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/app/ActivityThread.java | 62 | ||||
-rw-r--r-- | core/java/android/os/IPowerManager.aidl | 3 | ||||
-rw-r--r-- | core/java/android/os/PowerManager.java | 2 |
3 files changed, 40 insertions, 27 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index ef9f6d4..5f65f08 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -4530,6 +4530,14 @@ public final class ActivityThread { IContentProvider provider = pr.mProvider; IBinder jBinder = provider.asBinder(); + if (!jBinder.isBinderAlive()) { + // The hosting process of the provider has died; we can't + // use this one. + Log.i(TAG, "Acquiring provider " + auth + " for user " + userId + + ": existing object's process dead"); + handleUnstableProviderDiedLocked(jBinder, true); + return null; + } // Only increment the ref count if we have one. If we don't then the // provider is not reference counted and never needs to be released. @@ -4670,33 +4678,37 @@ public final class ActivityThread { } final void handleUnstableProviderDied(IBinder provider, boolean fromClient) { - synchronized(mProviderMap) { - ProviderRefCount prc = mProviderRefCountMap.get(provider); - if (prc != null) { - if (DEBUG_PROVIDER) Slog.v(TAG, "Cleaning up dead provider " - + provider + " " + prc.holder.info.name); - mProviderRefCountMap.remove(provider); - if (prc.client != null && prc.client.mNames != null) { - for (String name : prc.client.mNames) { - ProviderClientRecord pr = mProviderMap.get(name); - if (pr != null && pr.mProvider.asBinder() == provider) { - Slog.i(TAG, "Removing dead content provider: " + name); - mProviderMap.remove(name); - } + synchronized (mProviderMap) { + handleUnstableProviderDiedLocked(provider, fromClient); + } + } + + final void handleUnstableProviderDiedLocked(IBinder provider, boolean fromClient) { + ProviderRefCount prc = mProviderRefCountMap.get(provider); + if (prc != null) { + if (DEBUG_PROVIDER) Slog.v(TAG, "Cleaning up dead provider " + + provider + " " + prc.holder.info.name); + mProviderRefCountMap.remove(provider); + if (prc.client != null && prc.client.mNames != null) { + for (String name : prc.client.mNames) { + ProviderClientRecord pr = mProviderMap.get(name); + if (pr != null && pr.mProvider.asBinder() == provider) { + Slog.i(TAG, "Removing dead content provider: " + name); + mProviderMap.remove(name); } } - if (fromClient) { - // We found out about this due to execution in our client - // code. Tell the activity manager about it now, to ensure - // that the next time we go to do anything with the provider - // it knows it is dead (so we don't race with its death - // notification). - try { - ActivityManagerNative.getDefault().unstableProviderDied( - prc.holder.connection); - } catch (RemoteException e) { - //do nothing content provider object is dead any way - } + } + if (fromClient) { + // We found out about this due to execution in our client + // code. Tell the activity manager about it now, to ensure + // that the next time we go to do anything with the provider + // it knows it is dead (so we don't race with its death + // notification). + try { + ActivityManagerNative.getDefault().unstableProviderDied( + prc.holder.connection); + } catch (RemoteException e) { + //do nothing content provider object is dead any way } } } diff --git a/core/java/android/os/IPowerManager.aidl b/core/java/android/os/IPowerManager.aidl index 557d3f3..6d6d147 100644 --- a/core/java/android/os/IPowerManager.aidl +++ b/core/java/android/os/IPowerManager.aidl @@ -37,7 +37,8 @@ interface IPowerManager void nap(long time); boolean isScreenOn(); - void reboot(String reason); + void reboot(boolean confirm, String reason, boolean wait); + void shutdown(boolean confirm, boolean wait); void crash(String message); void setStayOnSetting(int val); diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java index ae50ddb..fb02c0a 100644 --- a/core/java/android/os/PowerManager.java +++ b/core/java/android/os/PowerManager.java @@ -596,7 +596,7 @@ public final class PowerManager { */ public void reboot(String reason) { try { - mService.reboot(reason); + mService.reboot(false, reason, true); } catch (RemoteException e) { } } |