summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/storage/StorageUserConnection.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/storage/StorageUserConnection.java b/services/core/java/com/android/server/storage/StorageUserConnection.java
index c207a7b4039b..c18a6ebc32ef 100644
--- a/services/core/java/com/android/server/storage/StorageUserConnection.java
+++ b/services/core/java/com/android/server/storage/StorageUserConnection.java
@@ -242,7 +242,13 @@ public final class StorageUserConnection {
}
if (oldConnection != null) {
- mContext.unbindService(oldConnection);
+ try {
+ mContext.unbindService(oldConnection);
+ } catch (Exception e) {
+ // Handle IllegalArgumentException that may be thrown if the user is already
+ // stopped when we try to unbind
+ Slog.w(TAG, "Failed to unbind service", e);
+ }
}
}