Android 4.4(奇巧巧克力)版本中的短信屏蔽和允许问题

4
我们在Google Play上推出了一个短信阻止应用。如果满足任何阻止条件,它会阻止短信,否则我们允许该短信进入本机收件箱。除了Android 4.4(Kitkat)之外,所有版本都可以正常工作。我们试图实现适用于4.4的新短信API,成功地将该应用程序作为默认短信应用程序后,它可以成功地阻止短信。但问题在于,如果该短信不符合任何短信阻止条件,那么我们就没有任何选项将该短信移动到本机收件箱中。
我们可以选择创建具有所有短信相关功能的完整短信应用程序,但在我们的情况下,这是无用的。
因此,在新的Android Kit Kat中是否有其他可用选项,我可以将短信转移到其他短信应用程序,如果我不想阻止该短信?
请帮帮我..由于这个问题从Kitkat用户那里得到了很多1星评论。
1个回答

3
电信内容提供者(“SMS提供者”)允许应用程序在设备上读取和编写短信和彩信消息。它包括SMS和MMS消息接收、草稿、发送、待处理等表格。
从Android 4.4开始,系统设置允许用户选择“默认短信应用程序”。一旦选择,只有默认短信应用程序才能写入SMS提供程序,并且只有默认短信应用程序在用户接收SMS或WAP_PUSH_DELIVER_ACTION广播时接收SMS_DELIVER_ACTION广播。默认短信应用程序负责在接收或发送新消息时将详细信息写入SMS提供程序。
未被选为默认短信应用程序的其他应用程序只能读取SMS提供程序,但也可以通过监听SMS_RECEIVED_ACTION广播被通知新的SMS到达,该广播是不可中止的广播,可能会传递给多个应用程序。此广播旨在用于未被选为默认短信应用程序的应用程序,以读取特殊的传入消息,例如执行电话号码验证。
有关更多信息,请阅读博客文章“使您的短信应用程序为KitKat做好准备”
来自Android博客的示例清单如下;
<manifest>
    ...
    <application>
        <!-- BroadcastReceiver that listens for incoming SMS messages -->
        <receiver android:name=".SmsReceiver"
                android:permission="android.permission.BROADCAST_SMS">
            <intent-filter>
                <action android:name="android.provider.Telephony.SMS_DELIVER" />
            </intent-filter>
        </receiver>

        <!-- BroadcastReceiver that listens for incoming MMS messages -->
        <receiver android:name=".MmsReceiver"
            android:permission="android.permission.BROADCAST_WAP_PUSH">
            <intent-filter>
                <action android:name="android.provider.Telephony.WAP_PUSH_DELIVER" />
                <data android:mimeType="application/vnd.wap.mms-message" />
            </intent-filter>
        </receiver>

        <!-- Activity that allows the user to send new SMS/MMS messages -->
        <activity android:name=".ComposeSmsActivity" >
            <intent-filter>
                <action android:name="android.intent.action.SEND" />                
                <action android:name="android.intent.action.SENDTO" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="sms" />
                <data android:scheme="smsto" />
                <data android:scheme="mms" />
                <data android:scheme="mmsto" />
            </intent-filter>
        </activity>

        <!-- Service that delivers messages from the phone "quick response" -->
        <service android:name=".HeadlessSmsSendService"
                 android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE"
                 android:exported="true" >
            <intent-filter>
                <action android:name="android.intent.action.RESPOND_VIA_MESSAGE" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="sms" />
                <data android:scheme="smsto" />
                <data android:scheme="mms" />
                <data android:scheme="mmsto" />
            </intent-filter>
        </service>
    </application>
</manifest>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接