From c6fa237daeaae6107174a9b9d4f591ea8cd26d86 Mon Sep 17 00:00:00 2001 From: Robert Greenwalt Date: Mon, 24 Sep 2012 13:57:16 -0700 Subject: [PATCH] Use updatable file for premium-sms filter The data is really to big for a gservices-driven secure setting. bug:7221402 Change-Id: Ie3d4a1a0aeb69b9ef8fad360fa7ec32e927644e8 --- core/java/android/provider/Settings.java | 7 - core/res/AndroidManifest.xml | 6 + core/res/res/values/symbols.xml | 1 - core/res/res/xml/sms_short_codes.xml | 189 ------------------ .../updates/ConfigUpdateInstallReceiver.java | 6 +- .../updates/SmsShortCodesInstallReceiver.java | 24 +++ 6 files changed, 33 insertions(+), 200 deletions(-) delete mode 100644 core/res/res/xml/sms_short_codes.xml create mode 100644 services/java/com/android/server/updates/SmsShortCodesInstallReceiver.java diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 550713ddc15fd..3d6bf01448de1 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -4618,13 +4618,6 @@ public final class Settings { */ public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule"; - /** - * Prefix for SMS short code regex patterns (country code is appended). - * @see com.android.internal.telephony.SmsUsageMonitor - * @hide - */ - public static final String SMS_SHORT_CODES_PREFIX = "sms_short_codes_"; - /** * Used to disable Tethering on a device - defaults to true * @hide diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 8dbaa2604a8aa..a16f2ae628a12 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -2152,6 +2152,12 @@ + + + + + + diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 9a4136b2a29c1..76af68154597a 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1088,7 +1088,6 @@ - diff --git a/core/res/res/xml/sms_short_codes.xml b/core/res/res/xml/sms_short_codes.xml deleted file mode 100644 index 8b395af0a7b3c..0000000000000 --- a/core/res/res/xml/sms_short_codes.xml +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/services/java/com/android/server/updates/ConfigUpdateInstallReceiver.java b/services/java/com/android/server/updates/ConfigUpdateInstallReceiver.java index e07230d463dea..4480151b21e60 100644 --- a/services/java/com/android/server/updates/ConfigUpdateInstallReceiver.java +++ b/services/java/com/android/server/updates/ConfigUpdateInstallReceiver.java @@ -126,7 +126,7 @@ public class ConfigUpdateInstallReceiver extends BroadcastReceiver { CertificateFactory cf = CertificateFactory.getInstance("X.509"); return (X509Certificate) cf.generateCertificate(istream); } catch (CertificateException e) { - throw new IllegalStateException("Got malformed certificate from settings, ignoring", e); + throw new IllegalStateException("Got malformed certificate from settings, ignoring"); } } @@ -167,7 +167,7 @@ public class ConfigUpdateInstallReceiver extends BroadcastReceiver { String strVersion = IoUtils.readFileAsString(updateVersion.getCanonicalPath()).trim(); return Integer.parseInt(strVersion); } catch (IOException e) { - Slog.i(TAG, "Couldn't find current metadata, assuming first update", e); + Slog.i(TAG, "Couldn't find current metadata, assuming first update"); return 0; } } @@ -181,7 +181,7 @@ public class ConfigUpdateInstallReceiver extends BroadcastReceiver { try { return IoUtils.readFileAsString(updateContent.getCanonicalPath()).trim(); } catch (IOException e) { - Slog.i(TAG, "Failed to read current content, assuming first update!", e); + Slog.i(TAG, "Failed to read current content, assuming first update!"); return null; } } diff --git a/services/java/com/android/server/updates/SmsShortCodesInstallReceiver.java b/services/java/com/android/server/updates/SmsShortCodesInstallReceiver.java new file mode 100644 index 0000000000000..0f14f57cbd5a3 --- /dev/null +++ b/services/java/com/android/server/updates/SmsShortCodesInstallReceiver.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.server.updates; + +public class SmsShortCodesInstallReceiver extends ConfigUpdateInstallReceiver { + + public SmsShortCodesInstallReceiver() { + super("/data/misc/sms/", "codes", "metadata/", "version"); + } +}