summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2025-04-10 16:21:45 -0700
committer Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2025-04-10 16:21:45 -0700
commitd97422fc9616e082788016bf1c3a0c110aaae02c (patch)
tree53908886a16902a3e908e42890e06b777ca77471
parentea39268231d379acaf5ed243ea64f5ba37c638c3 (diff)
parent6219daf776c77d3053b9d1ea7b63324285c302ea (diff)
Merge cherrypicks of ['googleplex-android-review.googlesource.com/32899522', 'googleplex-android-review.googlesource.com/32921343'] into 25Q2-release.
Change-Id: I215ab0888dfd4b6a86e4001101f1d560df30d893
-rw-r--r--services/accessibility/java/com/android/server/accessibility/magnification/FullScreenMagnificationGestureHandler.java12
-rw-r--r--telecomm/java/android/telecom/Call.java5
2 files changed, 11 insertions, 6 deletions
diff --git a/services/accessibility/java/com/android/server/accessibility/magnification/FullScreenMagnificationGestureHandler.java b/services/accessibility/java/com/android/server/accessibility/magnification/FullScreenMagnificationGestureHandler.java
index 59b4a1613e08..919b33415646 100644
--- a/services/accessibility/java/com/android/server/accessibility/magnification/FullScreenMagnificationGestureHandler.java
+++ b/services/accessibility/java/com/android/server/accessibility/magnification/FullScreenMagnificationGestureHandler.java
@@ -1745,6 +1745,7 @@ public class FullScreenMagnificationGestureHandler extends MagnificationGestureH
* BroadcastReceiver used to cancel the magnification shortcut when the screen turns off
*/
private static class ScreenStateReceiver extends BroadcastReceiver {
+ private static final String TAG = ScreenStateReceiver.class.getName();
private final Context mContext;
private final FullScreenMagnificationGestureHandler mGestureHandler;
@@ -1759,7 +1760,16 @@ public class FullScreenMagnificationGestureHandler extends MagnificationGestureH
}
public void unregister() {
- mContext.unregisterReceiver(this);
+ try {
+ mContext.unregisterReceiver(this);
+ } catch (IllegalArgumentException exception) {
+ // b/399282180: the unregister happens when the handler is destroyed (cleanup). The
+ // cleanup process should not cause the system crash, also the failure of unregister
+ // will not affect the user experience since it's for the destroyed handler.
+ // Therefore, we use try-catch here, to catch the exception to prevent crash, and
+ // log the exception for future investigations.
+ Slog.e(TAG, "Failed to unregister receiver: " + exception);
+ }
}
@Override
diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java
index 51ce144881b7..f534b4ca9cd9 100644
--- a/telecomm/java/android/telecom/Call.java
+++ b/telecomm/java/android/telecom/Call.java
@@ -23,7 +23,6 @@ import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
-import android.content.Intent;
import android.content.pm.ServiceInfo;
import android.net.Uri;
import android.os.BadParcelableException;
@@ -1175,10 +1174,6 @@ public final class Call {
int callerNumberVerificationStatus,
Uri contactPhotoUri,
UserHandle originatingUser) {
- if (extras == null) {
- extras = new Bundle();
- }
- extras.putParcelable(Intent.EXTRA_USER_HANDLE, originatingUser);
mState = state;
mTelecomCallId = telecomCallId;
mHandle = handle;