diff options
author | John Huang <jsh@google.com> | 2012-09-16 14:31:16 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-09-16 14:31:16 -0700 |
commit | 4505a43f300568811d3260d25381a61c7fff65ea (patch) | |
tree | 216acd1cc30d12071bfda20d10e4627a746d9830 | |
parent | 306df86302a96c7bf3d86aed81190c10ea6c2ccd (diff) | |
parent | 76a61426876409bc6936697d7560bd8c8a6193c5 (diff) | |
download | frameworks_base-4505a43f300568811d3260d25381a61c7fff65ea.zip frameworks_base-4505a43f300568811d3260d25381a61c7fff65ea.tar.gz frameworks_base-4505a43f300568811d3260d25381a61c7fff65ea.tar.bz2 |
Merge "Add support for per-package policy for sending premium SMS." into jb-mr1-dev
-rw-r--r-- | core/java/android/provider/Settings.java | 52 | ||||
-rw-r--r-- | core/res/res/layout/sms_short_code_confirmation_dialog.xml | 61 | ||||
-rwxr-xr-x | core/res/res/values/strings.xml | 26 | ||||
-rw-r--r-- | core/res/res/values/symbols.xml | 13 |
4 files changed, 121 insertions, 31 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index f3dbecb..b4ea6ec 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -3236,7 +3236,7 @@ public final class Settings { public static final String DISPLAY_DENSITY_FORCED = Global.DISPLAY_DENSITY_FORCED; /** - * @deprecated Use {@link android.provider.Settings.Global#ASSISTED_GPS_ENABLE} instead + * @deprecated Use {@link android.provider.Settings.Global#ASSISTED_GPS_ENABLED} instead * @hide */ @Deprecated @@ -4345,21 +4345,18 @@ public final class Settings { "sync_max_retry_delay_in_seconds"; /** - * The interval in milliseconds at which to check the number of SMS sent - * out without asking for use permit, to limit the un-authorized SMS - * usage. + * @deprecated Use {@link Settings.Global#SMS_OUTGOING_CHECK_INTERVAL_MS} instead. * @hide */ public static final String SMS_OUTGOING_CHECK_INTERVAL_MS = - "sms_outgoing_check_interval_ms"; + Global.SMS_OUTGOING_CHECK_INTERVAL_MS; /** - * The number of outgoing SMS sent without asking for user permit - * (of {@link #SMS_OUTGOING_CHECK_INTERVAL_MS} + * @deprecated Use {@link Settings.Global#SMS_OUTGOING_CHECK_MAX_COUNT} instead. * @hide */ public static final String SMS_OUTGOING_CHECK_MAX_COUNT = - "sms_outgoing_check_max_count"; + Global.SMS_OUTGOING_CHECK_MAX_COUNT; /** * The global search provider chosen by the user (if multiple global @@ -4861,13 +4858,6 @@ public final class Settings { "contacts_preauth_uri_expiration"; /** - * 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_"; - - /** * Overlay display devices setting. * The associated value is a specially formatted string that describes the * size and density of simulated secondary display devices. @@ -5427,6 +5417,38 @@ public final class Settings { "setup_prepaid_detection_redir_host"; /** + * The interval in milliseconds at which to check the number of SMS sent out without asking + * for use permit, to limit the un-authorized SMS usage. + * + * @hide + */ + public static final String SMS_OUTGOING_CHECK_INTERVAL_MS = + "sms_outgoing_check_interval_ms"; + + /** + * The number of outgoing SMS sent without asking for user permit (of {@link + * #SMS_OUTGOING_CHECK_INTERVAL_MS} + * + * @hide + */ + public static final String SMS_OUTGOING_CHECK_MAX_COUNT = + "sms_outgoing_check_max_count"; + + /** + * Used to disable SMS short code confirmation - defaults to true. + * @see com.android.internal.telephony.SmsUsageMonitor + * @hide + */ + public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation"; + + /** + * 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/res/layout/sms_short_code_confirmation_dialog.xml b/core/res/res/layout/sms_short_code_confirmation_dialog.xml new file mode 100644 index 0000000..ed08375 --- /dev/null +++ b/core/res/res/layout/sms_short_code_confirmation_dialog.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 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. +*/ +--> + +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/parentPanel" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="8dip" + android:layout_marginRight="8dip" + android:orientation="vertical"> + + <TextView android:id="@+id/sms_short_code_confirm_message" + style="?android:attr/textAppearanceMedium" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingLeft="16dip" + android:paddingRight="16dip" + android:paddingTop="8dip" + android:paddingBottom="8dip"/> + + <LinearLayout android:id="@+id/sms_short_code_detail_layout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical" + android:minHeight="@dimen/alert_dialog_title_height" + android:layout_marginLeft="16dip" + android:layout_marginRight="16dip"> + <ImageView android:id="@+id/sms_short_code_coins_icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingRight="8dip" + android:src="@null" /> + <TextView android:id="@+id/sms_short_code_detail_message" + style="?android:attr/textAppearanceMedium" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + </LinearLayout> + + <CheckBox android:id="@+id/sms_short_code_remember_choice_checkbox" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/sms_short_code_remember_choice" /> +</LinearLayout> diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 859886b..9a9e971 100755 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -3089,20 +3089,22 @@ <string name="sms_control_no">Deny</string> <!-- SMS short code verification dialog. --> <skip /> - <!-- The dialog title for the SMS short code confirmation dialog. [CHAR LIMIT=30] --> - <string name="sms_short_code_confirm_title">Send SMS to short code?</string> - <!-- The dialog title for the SMS premium short code confirmation dialog. [CHAR LIMIT=30] --> - <string name="sms_premium_short_code_confirm_title">Send premium SMS?</string> <!-- The message text for the SMS short code confirmation dialog. [CHAR LIMIT=NONE] --> - <string name="sms_short_code_confirm_message"><b><xliff:g id="app_name">%1$s</xliff:g></b> would like to send a text message to <b><xliff:g id="dest_address">%2$s</xliff:g></b>, which appears to be an SMS short code.<p>Sending text messages to some short codes may cause your mobile account to be billed for premium services.<p>Do you want to allow this app to send the message?</string> - <!-- The message text for the SMS short code confirmation dialog. [CHAR LIMIT=NONE] --> - <string name="sms_premium_short_code_confirm_message"><b><xliff:g id="app_name">%1$s</xliff:g></b> would like to send a text message to <b><xliff:g id="dest_address">%2$s</xliff:g></b>, which is a premium SMS short code.<p><b>Sending a message to this destination will cause your mobile account to be billed for premium services.</b><p>Do you want to allow this app to send the message?</string> - <!-- Text of the approval button for the SMS short code confirmation dialog. [CHAR LIMIT=50] --> - <string name="sms_short_code_confirm_allow">Send message</string> + <string name="sms_short_code_confirm_message"><b><xliff:g id="app_name">%1$s</xliff:g></b> would like to send a message to <b><xliff:g id="dest_address">%2$s</xliff:g></b>.</string> + <!-- Message details for the SMS short code confirmation dialog (possible premium short code). [CHAR LIMIT=NONE] --> + <string name="sms_short_code_details">This may cause charges on your mobile account.</string> + <!-- Message details for the SMS short code confirmation dialog (premium short code). [CHAR LIMIT=NONE] --> + <string name="sms_premium_short_code_details">This will cause charges on your mobile account.</string> + <!-- Text of the approval button for the SMS short code confirmation dialog. [CHAR LIMIT=30] --> + <string name="sms_short_code_confirm_allow">Send</string> <!-- Text of the cancel button for the SMS short code confirmation dialog. [CHAR LIMIT=30] --> - <string name="sms_short_code_confirm_deny">Don\'t send</string> - <!-- Text of the button for the SMS short code confirmation dialog to report a malicious app. [CHAR LIMIT=30] --> - <string name="sms_short_code_confirm_report">Report malicious app</string> + <string name="sms_short_code_confirm_deny">Cancel</string> + <!-- Text of the checkbox for the SMS short code confirmation dialog to remember the user's choice. [CHAR LIMIT=40] --> + <string name="sms_short_code_remember_choice">Remember my choice</string> + <!-- Text of the approval button for the SMS short code confirmation dialog when checkbox is checked. [CHAR LIMIT=30] --> + <string name="sms_short_code_confirm_always_allow">Always Allow</string> + <!-- Text of the cancel button for the SMS short code confirmation dialog when checkbox is checked. [CHAR LIMIT=30] --> + <string name="sms_short_code_confirm_never_allow">Never Allow</string> <!-- SIM swap and device reboot Dialog --> <skip /> <!-- See SIM_REMOVED_DIALOG. This is the title of that dialog. --> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index d4e82b5..832f04c 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -211,6 +211,10 @@ <java-symbol type="id" name="status_bar_latest_event_content" /> <java-symbol type="id" name="action_divider" /> <java-symbol type="id" name="overflow_divider" /> + <java-symbol type="id" name="sms_short_code_confirm_message" /> + <java-symbol type="id" name="sms_short_code_detail_layout" /> + <java-symbol type="id" name="sms_short_code_detail_message" /> + <java-symbol type="id" name="sms_short_code_remember_choice_checkbox" /> <java-symbol type="attr" name="actionModeShareDrawable" /> <java-symbol type="attr" name="alertDialogCenterButtons" /> @@ -739,13 +743,13 @@ <java-symbol type="string" name="sms_control_title" /> <java-symbol type="string" name="sms_control_no" /> <java-symbol type="string" name="sms_control_yes" /> - <java-symbol type="string" name="sms_premium_short_code_confirm_message" /> - <java-symbol type="string" name="sms_premium_short_code_confirm_title" /> <java-symbol type="string" name="sms_short_code_confirm_allow" /> <java-symbol type="string" name="sms_short_code_confirm_deny" /> + <java-symbol type="string" name="sms_short_code_confirm_always_allow" /> + <java-symbol type="string" name="sms_short_code_confirm_never_allow" /> <java-symbol type="string" name="sms_short_code_confirm_message" /> - <java-symbol type="string" name="sms_short_code_confirm_report" /> - <java-symbol type="string" name="sms_short_code_confirm_title" /> + <java-symbol type="string" name="sms_short_code_details" /> + <java-symbol type="string" name="sms_premium_short_code_details" /> <java-symbol type="string" name="submit" /> <java-symbol type="string" name="sync_binding_label" /> <java-symbol type="string" name="sync_do_nothing" /> @@ -1051,6 +1055,7 @@ <java-symbol type="layout" name="notification_template_inbox" /> <java-symbol type="layout" name="keyguard_multi_user_avatar" /> <java-symbol type="layout" name="keyguard_multi_user_selector_widget" /> + <java-symbol type="layout" name="sms_short_code_confirmation_dialog" /> <java-symbol type="anim" name="slide_in_child_bottom" /> <java-symbol type="anim" name="slide_in_right" /> |