Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(758)

Unified Diff: shell/android/apk/src/org/chromium/mojo/shell/IntentReceiverService.java

Issue 1116653002: Introduce authentication service. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: shell/android/apk/src/org/chromium/mojo/shell/IntentReceiverService.java
diff --git a/shell/android/apk/src/org/chromium/mojo/shell/IntentReceiverService.java b/shell/android/apk/src/org/chromium/mojo/shell/IntentReceiverService.java
index 0a7a3ad84407492380c0f991787f1eb0c6a25549..d08adaea971fce9602d935ae63c3e0083936177f 100644
--- a/shell/android/apk/src/org/chromium/mojo/shell/IntentReceiverService.java
+++ b/shell/android/apk/src/org/chromium/mojo/shell/IntentReceiverService.java
@@ -7,10 +7,15 @@ package org.chromium.mojo.shell;
import android.app.IntentService;
import android.content.Intent;
+import org.chromium.base.ApplicationStatus;
+
/**
* IntentService that will forward received intents to the {@link IntentReceiverRegistry}.
*/
public class IntentReceiverService extends IntentService {
+ public static final String CATEGORY_START_ACTIVITY_FOR_RESULT = "C_startActivityForResult";
+ public static final String EXTRA_START_ACTIVITY_FOR_RESULT_INTENT = "intent";
+
public IntentReceiverService() {
super("IntentReceiverService");
}
@@ -20,6 +25,15 @@ public class IntentReceiverService extends IntentService {
*/
@Override
protected void onHandleIntent(Intent intent) {
+ if (intent.getCategories().contains(CATEGORY_START_ACTIVITY_FOR_RESULT)) {
+ if (!intent.hasExtra(EXTRA_START_ACTIVITY_FOR_RESULT_INTENT)) {
+ return;
+ }
+ ApplicationStatus.getLastTrackedFocusedActivity().startActivityForResult(
+ intent.<Intent>getParcelableExtra(EXTRA_START_ACTIVITY_FOR_RESULT_INTENT),
+ Integer.parseInt(intent.getAction()));
+ return;
+ }
IntentReceiverRegistry.getInstance().onIntentReceived(intent);
}
}

Powered by Google App Engine
This is Rietveld 408576698