Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0dbe6f7a authored by Ruoyao Liu's avatar Ruoyao Liu Committed by Lin Lili
Browse files

fix google widget timing issue

If the user of QuckContactBadge widget do not assign extras,
widget will create one, wrappter URI data in it and use this extra for
all requests,if multiple click events happened in short time it may
cause a bug as the first query finished and URI data will be removed
from extras, but the next query already sent, so when the second query
complete, there is no URI in extra and result in null pointer exception.

Don't remove the URI from extra directly,but copy the extra to
another one and send it out after remove the URI, so the URI null
pointer exception wouldn't happened anymore.

Change-Id: I4ef56d29883f79f115e4b9523ced0abfd0978fd7
Bug: 195089668
parent 03a24f50
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -396,8 +396,9 @@ public class QuickContactBadge extends ImageView implements OnClickListener {
                // Prompt user to add this person to contacts
                final Intent intent = new Intent(Intents.SHOW_OR_CREATE_CONTACT, createUri);
                if (extras != null) {
                    extras.remove(EXTRA_URI_CONTENT);
                    intent.putExtras(extras);
                    Bundle bundle = new Bundle(extras);
                    bundle.remove(EXTRA_URI_CONTENT);
                    intent.putExtras(bundle);
                }
                getContext().startActivity(intent);
            }