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

Commit a19fd7a0 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 1466

* changes:
  define Intent.ACTION_REMOTE_INTENT, which replaces the old GTalk data messaging intent "android.intent.action.GTALK_DATA_MESSAGE_RECEIVED".
parents a086a973 97ecc9cb
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -31502,6 +31502,17 @@
 visibility="public"
>
</field>
<field name="ACTION_REMOTE_INTENT"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;android.intent.action.REMOTE_INTENT&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="ACTION_RUN"
 type="java.lang.String"
 transient="false"
@@ -32040,6 +32051,17 @@
 visibility="public"
>
</field>
<field name="EXTRA_REMOTE_INTENT_TOKEN"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;android.intent.extra.remote_intent_token&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="EXTRA_REPLACING"
 type="java.lang.String"
 transient="false"
+22 −0
Original line number Diff line number Diff line
@@ -1542,6 +1542,21 @@ public class Intent implements Parcelable {
    public static final String ACTION_REBOOT =
            "android.intent.action.REBOOT";

    /**
     * Broadcast Action: a remote intent is to be broadcasted.
     *
     * A remote intent is used for remote RPC between devices. The remote intent
     * is serialized and sent from one device to another device. The receiving
     * device parses the remote intent and broadcasts it. Note that anyone can
     * broadcast a remote intent. However, if the intent receiver of the remote intent
     * does not trust intent broadcasts from arbitrary intent senders, it should require
     * the sender to hold certain permissions so only trusted sender's broadcast will be
     * let through.
     */
    public static final String ACTION_REMOTE_INTENT =
            "android.intent.action.REMOTE_INTENT";


    // ---------------------------------------------------------------------
    // ---------------------------------------------------------------------
    // Standard intent categories (see addCategory()).
@@ -1782,6 +1797,13 @@ public class Intent implements Parcelable {
     */
    public static final String EXTRA_ALARM_COUNT = "android.intent.extra.ALARM_COUNT";

    /**
     * Used in the extra field in the remote intent. It's astring token passed with the
     * remote intent.
     */
    public static final String EXTRA_REMOTE_INTENT_TOKEN =
            "android.intent.extra.remote_intent_token";

    // ---------------------------------------------------------------------
    // ---------------------------------------------------------------------
    // Intent flags (see mFlags variable).
+1 −1
Original line number Diff line number Diff line
@@ -1037,7 +1037,7 @@
        <receiver android:name="com.android.server.MasterClearReceiver"
            android:permission="android.permission.MASTER_CLEAR" >
            <intent-filter>
                <action android:name="android.intent.action.GTALK_DATA_MESSAGE_RECEIVED" />
                <action android:name="android.intent.action.REMOTE_INTENT" />
                <category android:name="android.intent.category.MASTER_CLEAR" />
            </intent-filter>
        </receiver>
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
                android:writePermission="android.permission.SUBSCRIBED_FEEDS_WRITE" />
        <receiver android:name="SubscribedFeedsBroadcastReceiver">
            <intent-filter>
                <action android:name="android.intent.action.GTALK_DATA_MESSAGE_RECEIVED" />
                <action android:name="android.intent.action.REMOTE_INTENT" />
                <category android:name="GSYNC_TICKLE"/>
            </intent-filter>
            <intent-filter>
+4 −4
Original line number Diff line number Diff line
@@ -43,8 +43,7 @@ public class SubscribedFeedsIntentService extends IntentService {

    private static final String sSubscribedFeedsPrefs = "subscribedFeeds";

    private static final String GTALK_DATA_MESSAGE_RECEIVED =
            "android.intent.action.GTALK_DATA_MESSAGE_RECEIVED";
    private static final String REMOTE_INTENT_ACTION = Intent.ACTION_REMOTE_INTENT;

    private static final String SUBSCRIBED_FEEDS_REFRESH_ACTION =
            "com.android.subscribedfeeds.action.REFRESH";
@@ -56,8 +55,9 @@ public class SubscribedFeedsIntentService extends IntentService {
    }

    protected void onHandleIntent(Intent intent) {
        if (GTALK_DATA_MESSAGE_RECEIVED.equals(intent.getAction())) {
            boolean fromTrustedServer = intent.getBooleanExtra("from_trusted_server", false);
        if (REMOTE_INTENT_ACTION.equals(intent.getAction())) {
            boolean fromTrustedServer = intent.getBooleanExtra(
                    "android.intent.extra.from_trusted_server", false);
            if (fromTrustedServer) {
                String accountName = intent.getStringExtra("account");
                String token = intent.getStringExtra("message_token");
Loading