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

Commit 9c9341ec authored by David Braun's avatar David Braun
Browse files

Add config setting for default sms app.

Different devices can have different default SMS apps.

Bug: 10818725 Allow OEM to specify or override a default SMS app (package)
Change-Id: I11c9832d2246677231e6a54cb03eb76650c85c98
parent a316d77b
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.provider.Settings;
import android.provider.Telephony.Sms.Intents;

@@ -35,8 +36,6 @@ import java.util.List;
 * {@hide}
 */
public final class SmsApplication {
    private static final String MESSAGING_PACKAGE_NAME = "com.android.mms";

    public static class SmsApplicationData {
        /**
         * Name of this SMS app for display.
@@ -166,8 +165,11 @@ public final class SmsApplication {
        // this if the caller asked us to.
        if (updateIfNeeded) {
            if (applicationData == null) {
                // Do we have a package for Android Messaging?
                applicationData = getApplicationForPackage(applications, MESSAGING_PACKAGE_NAME);
                // Try to find the default SMS package for this device
                Resources r = context.getResources();
                String defaultPackage =
                        r.getString(com.android.internal.R.string.default_sms_application);
                applicationData = getApplicationForPackage(applications, defaultPackage);
            }
            if (applicationData == null) {
                // Are there any applications?