127 lines
4.9 KiB
Diff
127 lines
4.9 KiB
Diff
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
|
Date: Sun, 3 Nov 2019 08:22:29 +0100
|
|
Subject: Remove SMS integration
|
|
|
|
---
|
|
.../content/browser/sms/SmsReceiver.java | 30 +++----------------
|
|
.../content/browser/sms/Wrappers.java | 11 +------
|
|
2 files changed, 5 insertions(+), 36 deletions(-)
|
|
|
|
diff --git a/content/public/android/java/src/org/chromium/content/browser/sms/SmsReceiver.java b/content/public/android/java/src/org/chromium/content/browser/sms/SmsReceiver.java
|
|
--- a/content/public/android/java/src/org/chromium/content/browser/sms/SmsReceiver.java
|
|
+++ b/content/public/android/java/src/org/chromium/content/browser/sms/SmsReceiver.java
|
|
@@ -11,11 +11,6 @@ import android.content.IntentFilter;
|
|
|
|
import androidx.annotation.VisibleForTesting;
|
|
|
|
-import com.google.android.gms.auth.api.phone.SmsRetriever;
|
|
-import com.google.android.gms.common.api.CommonStatusCodes;
|
|
-import com.google.android.gms.common.api.Status;
|
|
-import com.google.android.gms.tasks.Task;
|
|
-
|
|
import org.chromium.base.ContextUtils;
|
|
import org.chromium.base.Log;
|
|
import org.chromium.base.annotations.CalledByNative;
|
|
@@ -42,18 +37,6 @@ public class SmsReceiver extends BroadcastReceiver {
|
|
mSmsProviderAndroid = smsProviderAndroid;
|
|
|
|
mContext = new Wrappers.SmsReceiverContext(ContextUtils.getApplicationContext());
|
|
-
|
|
- // A broadcast receiver is registered upon the creation of this class
|
|
- // which happens when the SMS Retriever API is used for the first time
|
|
- // since chrome last restarted (which, on android, happens frequently).
|
|
- // The broadcast receiver is fairly lightweight (e.g. it responds
|
|
- // quickly without much computation).
|
|
- // If this broadcast receiver becomes more heavyweight, we should make
|
|
- // this registration expire after the SMS message is received.
|
|
- if (DEBUG) Log.d(TAG, "Registering intent filters.");
|
|
- IntentFilter filter = new IntentFilter();
|
|
- filter.addAction(SmsRetriever.SMS_RETRIEVED_ACTION);
|
|
- mContext.registerReceiver(this, filter);
|
|
}
|
|
|
|
@CalledByNative
|
|
@@ -66,7 +49,6 @@ public class SmsReceiver extends BroadcastReceiver {
|
|
private void destroy() {
|
|
if (DEBUG) Log.d(TAG, "Destroying SmsReceiver.");
|
|
mDestroyed = true;
|
|
- mContext.unregisterReceiver(this);
|
|
}
|
|
|
|
@Override
|
|
@@ -77,7 +59,7 @@ public class SmsReceiver extends BroadcastReceiver {
|
|
return;
|
|
}
|
|
|
|
- if (!SmsRetriever.SMS_RETRIEVED_ACTION.equals(intent.getAction())) {
|
|
+/* if (!SmsRetriever.SMS_RETRIEVED_ACTION.equals(intent.getAction())) {
|
|
return;
|
|
}
|
|
|
|
@@ -104,22 +86,18 @@ public class SmsReceiver extends BroadcastReceiver {
|
|
if (DEBUG) Log.d(TAG, "Timeout");
|
|
SmsReceiverJni.get().onTimeout(mSmsProviderAndroid);
|
|
break;
|
|
- }
|
|
+ } */
|
|
}
|
|
|
|
@CalledByNative
|
|
private void listen() {
|
|
- Wrappers.SmsRetrieverClientWrapper client = getClient();
|
|
- Task<Void> task = client.startSmsRetriever();
|
|
-
|
|
- if (DEBUG) Log.d(TAG, "Installed task");
|
|
}
|
|
|
|
private Wrappers.SmsRetrieverClientWrapper getClient() {
|
|
- if (mClient != null) {
|
|
+/* if (mClient != null) {
|
|
return mClient;
|
|
}
|
|
- mClient = new Wrappers.SmsRetrieverClientWrapper(SmsRetriever.getClient(mContext));
|
|
+ mClient = new Wrappers.SmsRetrieverClientWrapper(SmsRetriever.getClient(mContext)); */
|
|
return mClient;
|
|
}
|
|
|
|
diff --git a/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java b/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java
|
|
--- a/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java
|
|
+++ b/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java
|
|
@@ -10,9 +10,6 @@ import android.content.ContextWrapper;
|
|
import android.content.Intent;
|
|
import android.content.IntentFilter;
|
|
|
|
-import com.google.android.gms.auth.api.phone.SmsRetrieverClient;
|
|
-import com.google.android.gms.tasks.Task;
|
|
-
|
|
class Wrappers {
|
|
// Prevent instantiation.
|
|
private Wrappers() {}
|
|
@@ -21,11 +18,9 @@ class Wrappers {
|
|
* Wraps com.google.android.gms.auth.api.phone.SmsRetrieverClient.
|
|
*/
|
|
static class SmsRetrieverClientWrapper {
|
|
- private final SmsRetrieverClient mSmsRetrieverClient;
|
|
private SmsReceiverContext mContext;
|
|
|
|
- public SmsRetrieverClientWrapper(SmsRetrieverClient smsRetrieverClient) {
|
|
- mSmsRetrieverClient = smsRetrieverClient;
|
|
+ public SmsRetrieverClientWrapper() {
|
|
}
|
|
|
|
public void setContext(SmsReceiverContext context) {
|
|
@@ -35,10 +30,6 @@ class Wrappers {
|
|
public SmsReceiverContext getContext() {
|
|
return mContext;
|
|
}
|
|
-
|
|
- public Task<Void> startSmsRetriever() {
|
|
- return mSmsRetrieverClient.startSmsRetriever();
|
|
- }
|
|
}
|
|
|
|
/**
|
|
--
|
|
2.17.1
|
|
|