From 34b47532d6f6e29913d8507037392226acdb7226 Mon Sep 17 00:00:00 2001 From: Anna Zappone Date: Thu, 14 Jan 2021 18:14:37 +0000 Subject: [PATCH] Default configuration activity to CANCELLED result In recent android builds, I've seen launcher freeze if the ConfigurationActivity is closed without finishing successfully (rather than ignored like in older builds). Manually setting the default result as CANCELLED appears to fix it. Test: local Change-Id: Iba6bb0c68cbeb632cf01fad09433b8096baf86b5 --- .../com/android/systemui/people/PeopleSpaceActivity.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceActivity.java b/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceActivity.java index 065920c9778bf..a8761a63f6ad6 100644 --- a/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceActivity.java +++ b/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceActivity.java @@ -80,6 +80,7 @@ public class PeopleSpaceActivity extends Activity { INVALID_APPWIDGET_ID); mShowSingleConversation = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.PEOPLE_SPACE_CONVERSATION_TYPE, 0) == 0; + setResult(RESULT_CANCELED); // Finish the configuration activity immediately if a widget is added for multiple // conversations. If the mAppWidgetId is INVALID, then the activity wasn't launched as a // widget configuration activity. @@ -151,10 +152,14 @@ public class PeopleSpaceActivity extends Activity { private void finishActivity() { if (PeopleSpaceUtils.DEBUG) Log.d(TAG, "Widget added!"); mUiEventLogger.log(PeopleSpaceUtils.PeopleSpaceWidgetEvent.PEOPLE_SPACE_WIDGET_ADDED); + setActivityResult(RESULT_OK); + finish(); + } + + private void setActivityResult(int result) { Intent resultValue = new Intent(); resultValue.putExtra(EXTRA_APPWIDGET_ID, mAppWidgetId); - setResult(RESULT_OK, resultValue); - finish(); + setResult(result, resultValue); } @Override