diff options
| author | 2018-12-18 21:27:23 +0000 | |
|---|---|---|
| committer | 2018-12-18 21:27:23 +0000 | |
| commit | b0b452931519b55a16f879c91def24afdd20f117 (patch) | |
| tree | 093f4c1e9abb09051bbc70c391e4bcbe5b2dd788 | |
| parent | 0b6adaab7a2ed82b1fafac0241b523d0c7f3b532 (diff) | |
| parent | 61f04dadf6c69df17227f0fc1d0a49459266ae19 (diff) | |
Merge "Remove finacial app sms access temp implementation due to security concern."
| -rw-r--r-- | packages/ExtServices/src/android/ext/services/sms/FinancialSmsServiceImpl.java | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/packages/ExtServices/src/android/ext/services/sms/FinancialSmsServiceImpl.java b/packages/ExtServices/src/android/ext/services/sms/FinancialSmsServiceImpl.java index ab71802102ae..81a63dd80a63 100644 --- a/packages/ExtServices/src/android/ext/services/sms/FinancialSmsServiceImpl.java +++ b/packages/ExtServices/src/android/ext/services/sms/FinancialSmsServiceImpl.java @@ -17,14 +17,10 @@ package android.ext.services.sms; import android.annotation.NonNull; import android.annotation.Nullable; -import android.database.Cursor; import android.database.CursorWindow; -import android.net.Uri; import android.os.Bundle; import android.service.sms.FinancialSmsService; -import android.util.Log; -import java.util.ArrayList; /** * Service to provide financial apps access to sms messages. */ @@ -36,45 +32,6 @@ public class FinancialSmsServiceImpl extends FinancialSmsService { @Nullable @Override public CursorWindow onGetSmsMessages(@NonNull Bundle params) { - ArrayList<String> columnNames = params.getStringArrayList(KEY_COLUMN_NAMES); - if (columnNames == null || columnNames.size() <= 0) { - return null; - } - - Uri inbox = Uri.parse("content://sms/inbox"); - - try (Cursor cursor = getContentResolver().query(inbox, null, null, null, null); - CursorWindow window = new CursorWindow("FinancialSmsMessages")) { - int messageCount = cursor.getCount(); - if (messageCount > 0 && cursor.moveToFirst()) { - window.setNumColumns(columnNames.size()); - for (int row = 0; row < messageCount; row++) { - if (!window.allocRow()) { - Log.e(TAG, "CursorWindow ran out of memory."); - return null; - } - for (int col = 0; col < columnNames.size(); col++) { - String columnName = columnNames.get(col); - int inboxColumnIndex = cursor.getColumnIndexOrThrow(columnName); - String inboxColumnValue = cursor.getString(inboxColumnIndex); - boolean addedToCursorWindow = window.putString(inboxColumnValue, row, col); - if (!addedToCursorWindow) { - Log.e(TAG, "Failed to add:" - + inboxColumnValue - + ";column:" - + columnName); - return null; - } - } - cursor.moveToNext(); - } - } else { - Log.w(TAG, "No sms messages."); - } - return window; - } catch (Exception e) { - Log.e(TAG, "Failed to get sms messages."); - return null; - } + return null; } } |