|
|
Created:
4 years, 8 months ago by please use gerrit instead Modified:
4 years, 8 months ago Reviewers:
Ted C Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionReceive intent callbacks without launching intents
This patch enables non-activities to receive intent callbacks for
intents that they have not launched. For example, Android Pay API
launches an intent with the given callback ID on your behalf:
Wallet.Payments.loadFullWallet(apiClient, dataRequest, CALLBACK_ID);
https://developers.google.com/android-pay/android/tutorial#request_the_full_wallet
BUG=602658
Committed: https://crrev.com/8b5d6c6d5e245701177ddee3697a34d5c9b4d5e3
Cr-Commit-Position: refs/heads/master@{#388544}
Patch Set 1 #
Total comments: 1
Patch Set 2 : intent trigger #
Total comments: 2
Patch Set 3 : Mention request code in comment #
Messages
Total messages: 21 (11 generated)
Patchset #1 (id:1) has been deleted
Description was changed from ========== Receive intent callbacks without launching intents This patch enables non-activities to receive intent callbacks for intents that they have not launched. For example, Android Pay API launches an intent with the given callback ID on your behalf: // https://developers.google.com/android-pay/android/tutorial#request_the_full_w... Wallet.Payments.loadFullWallet(apiClient, dataRequest, CALLBACK_ID); BUG=602658 ========== to ========== Receive intent callbacks without launching intents This patch enables non-activities to receive intent callbacks for intents that they have not launched. For example, Android Pay API launches an intent with the given callback ID on your behalf: // https://developers.google.com/android-pay/android/tutorial#request_the_full_w... Wallet.Payments.loadFullWallet(apiClient, dataRequest, CALLBACK_ID); BUG=602658 ==========
Description was changed from ========== Receive intent callbacks without launching intents This patch enables non-activities to receive intent callbacks for intents that they have not launched. For example, Android Pay API launches an intent with the given callback ID on your behalf: // https://developers.google.com/android-pay/android/tutorial#request_the_full_w... Wallet.Payments.loadFullWallet(apiClient, dataRequest, CALLBACK_ID); BUG=602658 ========== to ========== Receive intent callbacks without launching intents This patch enables non-activities to receive intent callbacks for intents that they have not launched. For example, Android Pay API launches an intent with the given callback ID on your behalf: Wallet.Payments.loadFullWallet(apiClient, dataRequest, CALLBACK_ID); https://developers.google.com/android-pay/android/tutorial#request_the_full_w... BUG=602658 ==========
rouslan@chromium.org changed reviewers: + tedchoc@chromium.org
tedchoc@, do you think this is the right approach to Android Pay integration? Android Pay requires an intent callback ID, but it launches the intent for you. So I'm thinking we should do the following: Wallet.Payments.loadFullWallet(mApiClient, mDataRequest, mWindowAndroid.addIntentCallback( this, R.string.failed_to_launch_android_pay)); See the bug report for more information.
a different idea, but it should be doable https://codereview.chromium.org/1902903003/diff/20001/ui/android/java/src/org... File ui/android/java/src/org/chromium/ui/base/ActivityWindowAndroid.java (right): https://codereview.chromium.org/1902903003/diff/20001/ui/android/java/src/org... ui/android/java/src/org/chromium/ui/base/ActivityWindowAndroid.java:133: public int addIntentCallback(IntentCallback callback, Integer errorId) { I'd be tempted to do something more like this: public int showCancelableIntent( Callback<Integer> intentTrigger, IntentCallback callback, Integer errorId) { Activity activity = getActivity().get(); if (activity == null) return START_INTENT_FAILURE; int requestCode = generateNextRequestCode(); intentTrigger.onResult(requestCocde); storeCallbackData(requestCode, callback, errorId); return requestCode; } A bit more verbose but it keeps this in line w/ the above calls. I don't feel too strongly though as they both aren't exactly ideal.
The CQ bit was checked by rouslan@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1902903003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1902903003/60001
Patchset #2 (id:40001) has been deleted
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromeos_amd64-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-...) chromeos_daisy_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_...) chromeos_x86-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_x86-ge...)
tedchoc@, ptal patch 2.
lgtm https://codereview.chromium.org/1902903003/diff/60001/ui/android/java/src/org... File ui/android/java/src/org/chromium/ui/base/WindowAndroid.java (right): https://codereview.chromium.org/1902903003/diff/60001/ui/android/java/src/org... ui/android/java/src/org/chromium/ui/base/WindowAndroid.java:240: * @param intentTrigger The callback that triggers the intent that needs to be shown. We should mention that the value passed to the trigger is the requestCode used for issuing the intent.
Sending to cq. https://codereview.chromium.org/1902903003/diff/60001/ui/android/java/src/org... File ui/android/java/src/org/chromium/ui/base/WindowAndroid.java (right): https://codereview.chromium.org/1902903003/diff/60001/ui/android/java/src/org... ui/android/java/src/org/chromium/ui/base/WindowAndroid.java:240: * @param intentTrigger The callback that triggers the intent that needs to be shown. On 2016/04/20 16:46:59, Ted C wrote: > We should mention that the value passed to the trigger is the requestCode used > for issuing the intent. Done.
The CQ bit was checked by rouslan@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from tedchoc@chromium.org Link to the patchset: https://codereview.chromium.org/1902903003/#ps80001 (title: "Mention request code in comment")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1902903003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1902903003/80001
Message was sent while issue was closed.
Description was changed from ========== Receive intent callbacks without launching intents This patch enables non-activities to receive intent callbacks for intents that they have not launched. For example, Android Pay API launches an intent with the given callback ID on your behalf: Wallet.Payments.loadFullWallet(apiClient, dataRequest, CALLBACK_ID); https://developers.google.com/android-pay/android/tutorial#request_the_full_w... BUG=602658 ========== to ========== Receive intent callbacks without launching intents This patch enables non-activities to receive intent callbacks for intents that they have not launched. For example, Android Pay API launches an intent with the given callback ID on your behalf: Wallet.Payments.loadFullWallet(apiClient, dataRequest, CALLBACK_ID); https://developers.google.com/android-pay/android/tutorial#request_the_full_w... BUG=602658 ==========
Message was sent while issue was closed.
Committed patchset #3 (id:80001)
Message was sent while issue was closed.
Description was changed from ========== Receive intent callbacks without launching intents This patch enables non-activities to receive intent callbacks for intents that they have not launched. For example, Android Pay API launches an intent with the given callback ID on your behalf: Wallet.Payments.loadFullWallet(apiClient, dataRequest, CALLBACK_ID); https://developers.google.com/android-pay/android/tutorial#request_the_full_w... BUG=602658 ========== to ========== Receive intent callbacks without launching intents This patch enables non-activities to receive intent callbacks for intents that they have not launched. For example, Android Pay API launches an intent with the given callback ID on your behalf: Wallet.Payments.loadFullWallet(apiClient, dataRequest, CALLBACK_ID); https://developers.google.com/android-pay/android/tutorial#request_the_full_w... BUG=602658 Committed: https://crrev.com/8b5d6c6d5e245701177ddee3697a34d5c9b4d5e3 Cr-Commit-Position: refs/heads/master@{#388544} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/8b5d6c6d5e245701177ddee3697a34d5c9b4d5e3 Cr-Commit-Position: refs/heads/master@{#388544} |