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

Commit 094d46dd authored by Meng Wang's avatar Meng Wang Committed by Android (Google) Code Review
Browse files

Merge "Telephony: do not use hidden API"

parents f96fed1d f77ad42d
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -1295,17 +1295,6 @@ public final class Telephony {
            public static final String ACTION_EXTERNAL_PROVIDER_CHANGE =
                          "android.provider.action.EXTERNAL_PROVIDER_CHANGE";

            /**
             * Same as {@link #ACTION_DEFAULT_SMS_PACKAGE_CHANGED} but it's implicit (e.g. sent to
             * all apps) and requires
             * {@link android.Manifest.permission#MONITOR_DEFAULT_SMS_PACKAGE} to receive.
             *
             * @hide
             */
            @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
            public static final String ACTION_DEFAULT_SMS_PACKAGE_CHANGED_INTERNAL =
                    "android.provider.action.DEFAULT_SMS_PACKAGE_CHANGED_INTERNAL";

            /**
             * Broadcast action: When SMS-MMS db is being created. If file-based encryption is
             * supported, this broadcast indicates creation of the db in credential-encrypted
+16 −4
Original line number Diff line number Diff line
@@ -665,10 +665,22 @@ public final class SmsApplication {
        }
    }

    /**
     * Broadcast action:
     * Same as {@link Intent#ACTION_DEFAULT_SMS_PACKAGE_CHANGED} but it's implicit (e.g. sent to
     * all apps) and requires
     * {@link #PERMISSION_MONITOR_DEFAULT_SMS_PACKAGE} to receive.
     */
    public static final String ACTION_DEFAULT_SMS_PACKAGE_CHANGED_INTERNAL =
            "android.provider.action.DEFAULT_SMS_PACKAGE_CHANGED_INTERNAL";

    public static final String PERMISSION_MONITOR_DEFAULT_SMS_PACKAGE =
            "android.permission.MONITOR_DEFAULT_SMS_PACKAGE";

    /**
     * Sends broadcasts on sms app change:
     * {@link Intent#ACTION_DEFAULT_SMS_PACKAGE_CHANGED}
     * {@link Intents.ACTION_DEFAULT_SMS_PACKAGE_CHANGED_INTERNAL}
     * {@link #ACTION_DEFAULT_SMS_PACKAGE_CHANGED_INTERNAL}
     */
    public static void broadcastSmsAppChange(Context context,
            UserHandle userHandle, @Nullable String oldPackage, @Nullable String newPackage) {
@@ -718,11 +730,11 @@ public final class SmsApplication {
        }

        // Send an implicit broadcast for the system server.
        // (or anyone with MONITOR_DEFAULT_SMS_PACKAGE, really.)
        // (or anyone with PERMISSION_MONITOR_DEFAULT_SMS_PACKAGE, really.)
        final Intent intent =
                new Intent(Intents.ACTION_DEFAULT_SMS_PACKAGE_CHANGED_INTERNAL);
                new Intent(ACTION_DEFAULT_SMS_PACKAGE_CHANGED_INTERNAL);
        context.sendBroadcastAsUser(intent, userHandle,
                permission.MONITOR_DEFAULT_SMS_PACKAGE);
                PERMISSION_MONITOR_DEFAULT_SMS_PACKAGE);
    }

    /**