forked from upstream-mirrors/quik
Merge branch 'should-I-answer'
This commit is contained in:
@@ -450,6 +450,13 @@
|
|||||||
android:name=".receiver.UnreadBadgeService"
|
android:name=".receiver.UnreadBadgeService"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
|
|
||||||
|
<service
|
||||||
|
android:name=".service.ShouldIAnswerService">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="com.moez.QKSMS.ShouldIAnswerService" />
|
||||||
|
</intent-filter>
|
||||||
|
</service>
|
||||||
|
|
||||||
<!-- Service that delivers messages from the phone "quick response" -->
|
<!-- Service that delivers messages from the phone "quick response" -->
|
||||||
<service
|
<service
|
||||||
android:name=".service.HeadlessSmsSendService"
|
android:name=".service.HeadlessSmsSendService"
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.moez.QKSMS.common.utils;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
|
||||||
|
public class PackageUtils {
|
||||||
|
|
||||||
|
public static boolean isAppInstalled(Context context, String packageName) {
|
||||||
|
try {
|
||||||
|
context.getPackageManager().getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
|
||||||
|
return true;
|
||||||
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,25 +11,33 @@ import android.telephony.SmsMessage;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import com.moez.QKSMS.common.BlockedConversationHelper;
|
import com.moez.QKSMS.common.BlockedConversationHelper;
|
||||||
import com.moez.QKSMS.common.ConversationPrefsHelper;
|
import com.moez.QKSMS.common.ConversationPrefsHelper;
|
||||||
|
import com.moez.QKSMS.common.utils.PackageUtils;
|
||||||
import com.moez.QKSMS.data.Message;
|
import com.moez.QKSMS.data.Message;
|
||||||
import com.moez.QKSMS.service.NotificationService;
|
import com.moez.QKSMS.service.NotificationService;
|
||||||
import com.moez.QKSMS.transaction.NotificationManager;
|
import com.moez.QKSMS.transaction.NotificationManager;
|
||||||
import com.moez.QKSMS.transaction.SmsHelper;
|
import com.moez.QKSMS.transaction.SmsHelper;
|
||||||
|
import com.moez.QKSMS.ui.settings.SettingsFragment;
|
||||||
|
import org.mistergroup.muzutozvednout.ShouldIAnswerBinder;
|
||||||
|
|
||||||
public class MessagingReceiver extends BroadcastReceiver {
|
public class MessagingReceiver extends BroadcastReceiver {
|
||||||
private final String TAG = "MessagingReceiver";
|
private final String TAG = "MessagingReceiver";
|
||||||
|
|
||||||
String address;
|
private Context mContext;
|
||||||
String body;
|
private SharedPreferences mPrefs;
|
||||||
long date;
|
|
||||||
|
|
||||||
Uri uri;
|
private String mAddress;
|
||||||
|
private String mBody;
|
||||||
|
private long mDate;
|
||||||
|
|
||||||
|
private Uri mUri;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
Log.i(TAG, "onReceive");
|
||||||
abortBroadcast();
|
abortBroadcast();
|
||||||
|
|
||||||
Log.i(TAG, "Received text message");
|
mContext = context;
|
||||||
|
mPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
|
||||||
if (intent.getExtras() != null) {
|
if (intent.getExtras() != null) {
|
||||||
Object[] pdus = (Object[]) intent.getExtras().get("pdus");
|
Object[] pdus = (Object[]) intent.getExtras().get("pdus");
|
||||||
@@ -40,49 +48,88 @@ public class MessagingReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
SmsMessage sms = messages[0];
|
SmsMessage sms = messages[0];
|
||||||
if (messages.length == 1 || sms.isReplace()) {
|
if (messages.length == 1 || sms.isReplace()) {
|
||||||
body = sms.getDisplayMessageBody();
|
mBody = sms.getDisplayMessageBody();
|
||||||
} else {
|
} else {
|
||||||
StringBuilder bodyText = new StringBuilder();
|
StringBuilder bodyText = new StringBuilder();
|
||||||
for (SmsMessage message : messages) {
|
for (SmsMessage message : messages) {
|
||||||
bodyText.append(message.getMessageBody());
|
bodyText.append(message.getMessageBody());
|
||||||
}
|
}
|
||||||
body = bodyText.toString();
|
mBody = bodyText.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
address = sms.getDisplayOriginatingAddress();
|
mAddress = sms.getDisplayOriginatingAddress();
|
||||||
date = sms.getTimestampMillis();
|
mDate = sms.getTimestampMillis();
|
||||||
|
|
||||||
uri = SmsHelper.addMessageToInbox(context, address, body, date);
|
if (mPrefs.getBoolean(SettingsFragment.SHOULD_I_ANSWER, false) &&
|
||||||
|
PackageUtils.isAppInstalled(mContext, "org.mistergroup.muzutozvednout")) {
|
||||||
|
|
||||||
Message message = new Message(context, uri);
|
ShouldIAnswerBinder shouldIAnswerBinder = new ShouldIAnswerBinder();
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
shouldIAnswerBinder.setCallback(new ShouldIAnswerBinder.Callback() {
|
||||||
ConversationPrefsHelper conversationPrefs = new ConversationPrefsHelper(context, message.getThreadId());
|
@Override
|
||||||
|
public void onNumberRating(String number, int rating) {
|
||||||
|
Log.i(TAG, "onNumberRating " + number + ": " + String.valueOf(rating));
|
||||||
|
shouldIAnswerBinder.unbind(context.getApplicationContext());
|
||||||
|
if (rating != ShouldIAnswerBinder.RATING_NEGATIVE) {
|
||||||
|
insertMessageAndNotify();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (BlockedConversationHelper.isFutureBlocked(prefs, address)) {
|
@Override
|
||||||
BlockedConversationHelper.unblockFutureConversation(prefs, address);
|
public void onServiceConnected() {
|
||||||
BlockedConversationHelper.blockConversation(prefs, message.getThreadId());
|
try {
|
||||||
message.markSeen();
|
shouldIAnswerBinder.getNumberRating(mAddress);
|
||||||
BlockedConversationHelper.FutureBlockedConversationObservable.getInstance().futureBlockedConversationReceived();
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else if (conversationPrefs.getNotificationsEnabled() && !BlockedConversationHelper.getBlockedConversationIds(
|
@Override
|
||||||
PreferenceManager.getDefaultSharedPreferences(context)).contains(message.getThreadId())) {
|
public void onServiceDisconnected() {
|
||||||
Intent messageHandlerIntent = new Intent(context, NotificationService.class);
|
}
|
||||||
messageHandlerIntent.putExtra(NotificationService.EXTRA_POPUP, true);
|
});
|
||||||
messageHandlerIntent.putExtra(NotificationService.EXTRA_URI, uri.toString());
|
|
||||||
context.startService(messageHandlerIntent);
|
|
||||||
|
|
||||||
UnreadBadgeService.update(context);
|
shouldIAnswerBinder.bind(context.getApplicationContext());
|
||||||
NotificationManager.create(context);
|
|
||||||
} else {
|
} else {
|
||||||
message.markSeen();
|
insertMessageAndNotify();
|
||||||
}
|
|
||||||
|
|
||||||
if (conversationPrefs.getWakePhoneEnabled()) {
|
|
||||||
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
|
||||||
PowerManager.WakeLock wakeLock = pm.newWakeLock((PowerManager.SCREEN_DIM_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP), "MessagingReceiver");
|
|
||||||
wakeLock.acquire();
|
|
||||||
wakeLock.release();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void insertMessageAndNotify() {
|
||||||
|
mUri = SmsHelper.addMessageToInbox(mContext, mAddress, mBody, mDate);
|
||||||
|
|
||||||
|
Message message = new Message(mContext, mUri);
|
||||||
|
ConversationPrefsHelper conversationPrefs = new ConversationPrefsHelper(mContext, message.getThreadId());
|
||||||
|
|
||||||
|
// The user has set messages from this address to be blocked, but we at the time there weren't any
|
||||||
|
// messages from them already in the database, so we couldn't block any thread URI. Now that we have one,
|
||||||
|
// we can block it, so that the conversation list adapter knows to ignore this thread in the main list
|
||||||
|
if (BlockedConversationHelper.isFutureBlocked(mPrefs, mAddress)) {
|
||||||
|
BlockedConversationHelper.unblockFutureConversation(mPrefs, mAddress);
|
||||||
|
BlockedConversationHelper.blockConversation(mPrefs, message.getThreadId());
|
||||||
|
message.markSeen();
|
||||||
|
BlockedConversationHelper.FutureBlockedConversationObservable.getInstance().futureBlockedConversationReceived();
|
||||||
|
|
||||||
|
// If we have notifications enabled and this conversation isn't blocked
|
||||||
|
} else if (conversationPrefs.getNotificationsEnabled() && !BlockedConversationHelper.getBlockedConversationIds(
|
||||||
|
PreferenceManager.getDefaultSharedPreferences(mContext)).contains(message.getThreadId())) {
|
||||||
|
Intent messageHandlerIntent = new Intent(mContext, NotificationService.class);
|
||||||
|
messageHandlerIntent.putExtra(NotificationService.EXTRA_POPUP, true);
|
||||||
|
messageHandlerIntent.putExtra(NotificationService.EXTRA_URI, mUri.toString());
|
||||||
|
mContext.startService(messageHandlerIntent);
|
||||||
|
|
||||||
|
UnreadBadgeService.update(mContext);
|
||||||
|
NotificationManager.create(mContext);
|
||||||
|
|
||||||
|
} else { // We shouldn't show a notification for this message
|
||||||
|
message.markSeen();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (conversationPrefs.getWakePhoneEnabled()) {
|
||||||
|
PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
|
||||||
|
PowerManager.WakeLock wakeLock = pm.newWakeLock((PowerManager.SCREEN_DIM_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP), "MessagingReceiver");
|
||||||
|
wakeLock.acquire();
|
||||||
|
wakeLock.release();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.moez.QKSMS.service;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.Service;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.IBinder;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.os.Messenger;
|
||||||
|
import android.os.RemoteException;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
import com.moez.QKSMS.ui.settings.SettingsFragment;
|
||||||
|
|
||||||
|
public class ShouldIAnswerService extends Service {
|
||||||
|
|
||||||
|
private Messenger mMessenger = new Messenger(new BlockingEnabledHandler(this));
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public IBinder onBind(Intent intent) {
|
||||||
|
return mMessenger.getBinder();
|
||||||
|
}
|
||||||
|
|
||||||
|
private class BlockingEnabledHandler extends Handler {
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
private BlockingEnabledHandler(Context context) {
|
||||||
|
mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("CommitPrefEdits")
|
||||||
|
@Override
|
||||||
|
public void handleMessage(Message msg) {
|
||||||
|
super.handleMessage(msg);
|
||||||
|
|
||||||
|
Messenger messenger = msg.replyTo;
|
||||||
|
if (messenger != null && (msg.what == 918 || msg.what == 919)) {
|
||||||
|
Bundle data = new Bundle();
|
||||||
|
|
||||||
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext);
|
||||||
|
if (msg.what == 919) {
|
||||||
|
boolean enabled=msg.getData().getBoolean("enabled");
|
||||||
|
prefs.edit().putBoolean(SettingsFragment.SHOULD_I_ANSWER, enabled).commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
data.putBoolean("blocking_enabled", prefs.getBoolean(SettingsFragment.SHOULD_I_ANSWER, false));
|
||||||
|
|
||||||
|
Message message = new Message();
|
||||||
|
message.what = msg.what;
|
||||||
|
message.setData(data);
|
||||||
|
|
||||||
|
try {
|
||||||
|
messenger.send(message);
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -665,6 +665,10 @@ public class NotificationManager {
|
|||||||
*/
|
*/
|
||||||
public static void initQuickCompose(Context context, boolean override, boolean overrideCancel) {
|
public static void initQuickCompose(Context context, boolean override, boolean overrideCancel) {
|
||||||
|
|
||||||
|
if (sPrefs == null) {
|
||||||
|
init(context);
|
||||||
|
}
|
||||||
|
|
||||||
if (sPrefs.getBoolean(SettingsFragment.QUICKCOMPOSE, false) || override) {
|
if (sPrefs.getBoolean(SettingsFragment.QUICKCOMPOSE, false) || override) {
|
||||||
Intent composeIntent = new Intent(context, QKComposeActivity.class);
|
Intent composeIntent = new Intent(context, QKComposeActivity.class);
|
||||||
PendingIntent composePI = PendingIntent.getActivity(context, 9, composeIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
PendingIntent composePI = PendingIntent.getActivity(context, 9, composeIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import android.content.res.Resources;
|
|||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.preference.CheckBoxPreference;
|
||||||
import android.preference.EditTextPreference;
|
import android.preference.EditTextPreference;
|
||||||
import android.preference.ListPreference;
|
import android.preference.ListPreference;
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
@@ -36,6 +38,7 @@ import com.moez.QKSMS.common.ListviewHelper;
|
|||||||
import com.moez.QKSMS.common.LiveViewManager;
|
import com.moez.QKSMS.common.LiveViewManager;
|
||||||
import com.moez.QKSMS.common.utils.DateFormatter;
|
import com.moez.QKSMS.common.utils.DateFormatter;
|
||||||
import com.moez.QKSMS.common.utils.KeyboardUtils;
|
import com.moez.QKSMS.common.utils.KeyboardUtils;
|
||||||
|
import com.moez.QKSMS.common.utils.PackageUtils;
|
||||||
import com.moez.QKSMS.interfaces.LiveView;
|
import com.moez.QKSMS.interfaces.LiveView;
|
||||||
import com.moez.QKSMS.receiver.NightModeAutoReceiver;
|
import com.moez.QKSMS.receiver.NightModeAutoReceiver;
|
||||||
import com.moez.QKSMS.transaction.EndlessJabber;
|
import com.moez.QKSMS.transaction.EndlessJabber;
|
||||||
@@ -107,6 +110,7 @@ public class SettingsFragment extends PreferenceFragment implements Preference.O
|
|||||||
public static final String BLOCKED_ENABLED = "pref_key_blocked_enabled";
|
public static final String BLOCKED_ENABLED = "pref_key_blocked_enabled";
|
||||||
public static final String BLOCKED_SENDERS = "pref_key_blocked_senders";
|
public static final String BLOCKED_SENDERS = "pref_key_blocked_senders";
|
||||||
public static final String BLOCKED_FUTURE = "pref_key_block_future";
|
public static final String BLOCKED_FUTURE = "pref_key_block_future";
|
||||||
|
public static final String SHOULD_I_ANSWER = "pref_key_should_i_answer";
|
||||||
public static final String MOBILE_ONLY = "pref_key_mobile_only";
|
public static final String MOBILE_ONLY = "pref_key_mobile_only";
|
||||||
public static final String COMPOSE_GROUP = "pref_key_compose_group";
|
public static final String COMPOSE_GROUP = "pref_key_compose_group";
|
||||||
public static final String SPLIT_SMS = "pref_key_split";
|
public static final String SPLIT_SMS = "pref_key_split";
|
||||||
@@ -530,6 +534,30 @@ public class SettingsFragment extends PreferenceFragment implements Preference.O
|
|||||||
case BLOCKED_FUTURE:
|
case BLOCKED_FUTURE:
|
||||||
BlockedNumberDialog.showDialog(mContext);
|
BlockedNumberDialog.showDialog(mContext);
|
||||||
break;
|
break;
|
||||||
|
case SHOULD_I_ANSWER:
|
||||||
|
final String packageName = "org.mistergroup.muzutozvednout";
|
||||||
|
if (!PackageUtils.isAppInstalled(mContext, packageName)) {
|
||||||
|
String referrer="referrer=utm_source%3Dqksms%26utm_medium%3Dapp%26utm_campaign%3Dqksmssettings";
|
||||||
|
new QKDialog()
|
||||||
|
.setContext(mContext)
|
||||||
|
.setTitle(R.string.dialog_should_i_answer_title)
|
||||||
|
.setMessage(R.string.dialog_should_i_answer_message)
|
||||||
|
.setNegativeButton(R.string.cancel, null)
|
||||||
|
.setPositiveButton(R.string.okay, v -> {
|
||||||
|
try {
|
||||||
|
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName + "&" + referrer)));
|
||||||
|
} catch (android.content.ActivityNotFoundException anfe) {
|
||||||
|
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageName + "&" + referrer)));
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.show();
|
||||||
|
|
||||||
|
new Handler().postDelayed(() -> {
|
||||||
|
mPrefs.edit().putBoolean(SHOULD_I_ANSWER, false).commit();
|
||||||
|
((CheckBoxPreference) preference).setChecked(false);
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case NOTIFICATION_LED_COLOR:
|
case NOTIFICATION_LED_COLOR:
|
||||||
mLedColorPickerDialog.show(getActivity().getFragmentManager(), "colorpicker");
|
mLedColorPickerDialog.show(getActivity().getFragmentManager(), "colorpicker");
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package org.mistergroup.muzutozvednout;
|
||||||
|
|
||||||
|
import android.content.ComponentName;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.ServiceConnection;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.IBinder;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.os.Messenger;
|
||||||
|
import android.os.RemoteException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Mister Group s.r.o. on 30.11.2015.
|
||||||
|
*/
|
||||||
|
public class ShouldIAnswerBinder {
|
||||||
|
public static final int RATING_UNKNOWN = 0;
|
||||||
|
public static final int RATING_POSITIVE = 1;
|
||||||
|
public static final int RATING_NEGATIVE = 2;
|
||||||
|
public static final int RATING_NEUTRAL = 3;
|
||||||
|
|
||||||
|
private Callback callback;
|
||||||
|
public boolean isBound;
|
||||||
|
|
||||||
|
public interface Callback {
|
||||||
|
void onNumberRating(String number, int rating);
|
||||||
|
|
||||||
|
void onServiceConnected();
|
||||||
|
|
||||||
|
void onServiceDisconnected();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCallback(Callback callback) {
|
||||||
|
this.callback = callback;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void bind(Context context) {
|
||||||
|
Intent intent=new Intent("org.mistergroup.muzutozvednout.PublicService");
|
||||||
|
intent.setPackage("org.mistergroup.muzutozvednout");
|
||||||
|
context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unbind(Context context) {
|
||||||
|
if ((isBound) && (serviceMessenger != null)) {
|
||||||
|
context.unbindService(mConnection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getNumberRating(String number) throws RemoteException {
|
||||||
|
Message msg = new Message();
|
||||||
|
msg.what = 1;
|
||||||
|
Bundle data = new Bundle();
|
||||||
|
data.putString("number", number);
|
||||||
|
msg.setData(data);
|
||||||
|
msg.replyTo = messenger;
|
||||||
|
serviceMessenger.send(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
private final Messenger messenger = new Messenger(new IncomingHandler());
|
||||||
|
private static Messenger serviceMessenger = null;
|
||||||
|
|
||||||
|
private ServiceConnection mConnection = new ServiceConnection() {
|
||||||
|
public void onServiceConnected(ComponentName className, IBinder service) {
|
||||||
|
serviceMessenger = new Messenger(service);
|
||||||
|
isBound = true;
|
||||||
|
if (callback != null)
|
||||||
|
callback.onServiceConnected();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onServiceDisconnected(ComponentName className) {
|
||||||
|
serviceMessenger = null;
|
||||||
|
isBound = false;
|
||||||
|
if (callback != null)
|
||||||
|
callback.onServiceDisconnected();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private class IncomingHandler extends Handler {
|
||||||
|
static final int GET_NUMBER_RATING = 1;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleMessage(Message msg) {
|
||||||
|
switch (msg.what) {
|
||||||
|
case GET_NUMBER_RATING:
|
||||||
|
Bundle inData = msg.getData();
|
||||||
|
String number = inData.getString("number");
|
||||||
|
int rating = inData.getInt("rating");
|
||||||
|
if (callback != null)
|
||||||
|
callback.onNumberRating(number, rating);
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
super.handleMessage(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -110,6 +110,7 @@
|
|||||||
<string name="pref_category_summary_appearance">Themes, fonts, colors, avatars, and more</string>
|
<string name="pref_category_summary_appearance">Themes, fonts, colors, avatars, and more</string>
|
||||||
<string name="pref_category_general">General</string>
|
<string name="pref_category_general">General</string>
|
||||||
<string name="pref_category_summary_general">Delivery, message sending, formatting</string>
|
<string name="pref_category_summary_general">Delivery, message sending, formatting</string>
|
||||||
|
<string name="pref_category_blocking">Message blocking</string>
|
||||||
<string name="pref_category_notifications">Notifications</string>
|
<string name="pref_category_notifications">Notifications</string>
|
||||||
<string name="pref_category_summary_notifications">Sounds, LED, privacy</string>
|
<string name="pref_category_summary_notifications">Sounds, LED, privacy</string>
|
||||||
<string name="pref_category_mms">MMS</string>
|
<string name="pref_category_mms">MMS</string>
|
||||||
@@ -170,6 +171,8 @@
|
|||||||
<string name="pref_blocked_conversations_summary">Long-press on a conversation and block to move to blocked inbox and stop notifications</string>
|
<string name="pref_blocked_conversations_summary">Long-press on a conversation and block to move to blocked inbox and stop notifications</string>
|
||||||
<string name="pref_block_future">Block future messages</string>
|
<string name="pref_block_future">Block future messages</string>
|
||||||
<string name="pref_block_future_summary">Add additional phone numbers to block</string>
|
<string name="pref_block_future_summary">Add additional phone numbers to block</string>
|
||||||
|
<string name="pref_should_i_answer">Should I Answer? Integration</string>
|
||||||
|
<string name="pref_should_i_answer_summary">Automatically delete incoming messages from numbers which are blocked through Should I Answer?</string>
|
||||||
<string name="pref_mobile_only">Mobile numbers</string>
|
<string name="pref_mobile_only">Mobile numbers</string>
|
||||||
<string name="pref_mobile_only_summary">Only show mobile numbers in contact suggestions</string>
|
<string name="pref_mobile_only_summary">Only show mobile numbers in contact suggestions</string>
|
||||||
<string name="pref_auto_emoji">Automatic emoji</string>
|
<string name="pref_auto_emoji">Automatic emoji</string>
|
||||||
@@ -575,6 +578,8 @@
|
|||||||
<string name="dialog_conversation_details_last_message_date">Last message date</string>
|
<string name="dialog_conversation_details_last_message_date">Last message date</string>
|
||||||
<string name="dialog_conversation_details_message_count">Message count</string>
|
<string name="dialog_conversation_details_message_count">Message count</string>
|
||||||
<string name="dialog_conversation_details_recipients">Recipients (%s)</string>
|
<string name="dialog_conversation_details_recipients">Recipients (%s)</string>
|
||||||
|
<string name="dialog_should_i_answer_title">Should I Answer? not installed</string>
|
||||||
|
<string name="dialog_should_i_answer_message">Would you like to download the app from Google Play now?</string>
|
||||||
|
|
||||||
<!-- Title for audio file picker -->
|
<!-- Title for audio file picker -->
|
||||||
<string name="select_audio">Choose audio</string>
|
<string name="select_audio">Choose audio</string>
|
||||||
|
|||||||
@@ -88,7 +88,7 @@
|
|||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:layout="@layout/list_item_preference_category"
|
android:layout="@layout/list_item_preference_category"
|
||||||
android:title="@string/pref_category_general">
|
android:title="@string/pref_category_blocking">
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="pref_key_blocked_enabled"
|
android:key="pref_key_blocked_enabled"
|
||||||
@@ -103,6 +103,17 @@
|
|||||||
android:layout="@layout/list_item_preference"
|
android:layout="@layout/list_item_preference"
|
||||||
android:summary="@string/pref_block_future_summary"
|
android:summary="@string/pref_block_future_summary"
|
||||||
android:title="@string/pref_block_future" />
|
android:title="@string/pref_block_future" />
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="pref_key_should_i_answer"
|
||||||
|
android:layout="@layout/list_item_preference"
|
||||||
|
android:summary="@string/pref_should_i_answer_summary"
|
||||||
|
android:title="@string/pref_should_i_answer"
|
||||||
|
android:widgetLayout="@layout/view_switch" />
|
||||||
|
</PreferenceCategory>
|
||||||
|
<PreferenceCategory
|
||||||
|
android:layout="@layout/list_item_preference_category"
|
||||||
|
android:title="@string/pref_category_general">
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="pref_key_mobile_only"
|
android:key="pref_key_mobile_only"
|
||||||
|
|||||||
Reference in New Issue
Block a user