Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit abe8442c authored by Jorge Ruesga's avatar Jorge Ruesga Committed by Gerrit Code Review
Browse files

Frameworks Base: Mock SMS (1/4)

This change brings the possibility of simulate the reception of SMS on real devices.
This change includes the setting and security permission.

Ported from http://review.cyanogenmod.org/#/c/23017



Patchset 2: Rebased

Change-Id: I535d5e69fbd9d612f7ed1a635032be7caefeda04
Signed-off-by: default avatarJorge Ruesga <jorge@ruesga.com>
parent 4e57aa3f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -4156,6 +4156,13 @@ public final class Settings {
         */
        public static final String ALLOW_MOCK_LOCATION = "mock_location";

        /**
         * Setting to allow the use of com.android.internal.telephony.SMSDispatcher#MockSmsReceiver
         * to simulate the reception of SMS for testing purposes during application development.
         * @hide
         */
         public static final String ALLOW_MOCK_SMS = "mock_sms";

        /**
         * A 64-bit number (as a hex string) that is randomly
         * generated on the device's first boot and should remain
@@ -5212,6 +5219,7 @@ public final class Settings {
        public static final String[] SETTINGS_TO_BACKUP = {
            BUGREPORT_IN_POWER_MENU,                            // moved to global
            ALLOW_MOCK_LOCATION,
            ALLOW_MOCK_SMS,
            PARENTAL_CONTROL_ENABLED,
            PARENTAL_CONTROL_REDIRECT_URL,
            USB_MASS_STORAGE_ENABLED,                           // moved to global
+7 −0
Original line number Diff line number Diff line
@@ -218,6 +218,13 @@
        android:label="@string/permlab_sendSms"
        android:description="@string/permdesc_sendSms" />

    <!-- Allows an application to send mock SMS messages. -->
    <permission android:name="android.permission.SEND_MOCK_SMS"
        android:permissionGroup="android.permission-group.MESSAGES"
        android:protectionLevel="dangerous"
        android:label="@string/permlab_sendMockSms"
        android:description="@string/permdesc_sendMockSms" />

    <!-- Allows an application (Phone) to send a request to other applications
         to handle the respond-via-message action during incoming calls.
         <p>Not for use by third-party applications. -->
+7 −0
Original line number Diff line number Diff line
@@ -81,6 +81,13 @@
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permdesc_fm_radio_transmitter">Allows the app to control the FM transmitter.</string>

    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permlab_sendMockSms">Send mock SMS messages</string>
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permdesc_sendMockSms">Allows the app to send mock SMS messages.
        This allows an app send SMS to trusted applications. Malicious apps could send messages
        continuously, blocking the device notification system and disrupting the user.</string>

    <string name="lockscreen_discharging">Discharging, <xliff:g id="number">%d</xliff:g><xliff:g id="percent">%%</xliff:g></string>

    <!-- Storage description for the SD card on the dock. [CHAR LIMIT=NONE] -->