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

Unverified Commit 23cb9807 authored by Marvin W.'s avatar Marvin W. 🐿️
Browse files

Push: Add minor features

parent 3388f593
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.os.Parcelable;
import android.os.PowerManager;
import android.os.SystemClock;
import android.os.UserHandle;
import android.util.Base64;
import android.util.Log;

import androidx.annotation.Nullable;
@@ -549,15 +550,17 @@ public class McsService extends Service implements Handler.Callback {
        intent.setAction(ACTION_C2DM_RECEIVE);
        intent.putExtra(EXTRA_FROM, msg.from);
        intent.putExtra(EXTRA_MESSAGE_ID, msg.id);
        if (msg.persistent_id != null) {
            intent.putExtra(EXTRA_MESSAGE_ID, msg.persistent_id);
        if (msg.persistent_id != null) intent.putExtra(EXTRA_MESSAGE_ID, msg.persistent_id);
        if (msg.token != null) intent.putExtra(EXTRA_COLLAPSE_KEY, msg.token);
        if (msg.raw_data != null) {
            intent.putExtra(EXTRA_RAWDATA_BASE64, Base64.encodeToString(msg.raw_data.toByteArray(), Base64.DEFAULT));
            intent.putExtra(EXTRA_RAWDATA, msg.raw_data.toByteArray());
        }
        if (app.wakeForDelivery) {
            intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
        } else {
            intent.addFlags(Intent.FLAG_EXCLUDE_STOPPED_PACKAGES);
        }
        if (msg.token != null) intent.putExtra(EXTRA_COLLAPSE_KEY, msg.token);
        for (AppData appData : msg.app_data) {
            intent.putExtra(appData.key, appData.value_);
        }
+1 −1
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ public class PushRegisterManager {
                    resultBundle.putString(EXTRA_REGISTRATION_ID, attachRequestId(response.token, requestId));
                }
            } else {
                if (!request.app.equals(response.deleted) && !request.app.equals(response.token)) {
                if (!request.app.equals(response.deleted) && !request.app.equals(response.token) && !request.sender.equals(response.token)) {
                    database.noteAppRegistrationError(request.app, response.responseText);
                    resultBundle.putString(EXTRA_ERROR, attachRequestId(ERROR_SERVICE_NOT_AVAILABLE, requestId));
                } else {
+5 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@

    <SwitchPreference
        android:defaultValue="false"
        android:persistent="false"
        android:key="gcm_confirm_new_apps"
        android:summary="@string/pref_gcm_confirm_new_apps_summary"
        android:title="@string/pref_gcm_confirm_new_apps_title"/>
@@ -29,6 +30,7 @@

        <ListPreference
            android:defaultValue="0"
            android:persistent="false"
            android:entries="@array/gcm_network_config_names"
            android:entryValues="@array/gcm_network_config_values"
            android:key="gcm_network_mobile"
@@ -37,6 +39,7 @@

        <ListPreference
            android:defaultValue="0"
            android:persistent="false"
            android:entries="@array/gcm_network_config_names"
            android:entryValues="@array/gcm_network_config_values"
            android:key="gcm_network_wifi"
@@ -45,6 +48,7 @@

        <ListPreference
            android:defaultValue="0"
            android:persistent="false"
            android:entries="@array/gcm_network_config_names"
            android:entryValues="@array/gcm_network_config_values"
            android:key="gcm_network_roaming"
@@ -53,6 +57,7 @@

        <ListPreference
            android:defaultValue="0"
            android:persistent="false"
            android:entries="@array/gcm_network_config_names"
            android:entryValues="@array/gcm_network_config_values"
            android:key="gcm_network_other"