不能从三星手机通话记录删除短信记录 [英] Can't remove SMS logs from call log on Samsung devices

查看:343
本文介绍了不能从三星手机通话记录删除短信记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过我的应用程序从设备中删除的所有短信,但由于某些原因SMS日志仍出现在通话记录上的一些三星设备。

I'm trying to remove all SMS messages from the device via my app, but for some reason SMS logs still appear on the call log on some of the Samsung devices.

我已经尝试了更激进的做法,并删除了以下URI的使用 ContentResolver的

I've tried a more "radical" approach, and deleted the following URI's using the ContentResolver:


  • 内容:// call_log /电话

  • 内容://短信

  • 内容://短信/收件箱

  • 内容://短信/发送

  • 内容:// MMS /收件箱

  • 内容://彩信

  • 内容:// MMS短信

  • 内容:// MMS /地址

  • 内容:// MMS /部分

  • 内容:// MMS /发送

  • 内容:// MMS /发件箱

  • content://call_log/calls
  • content://sms
  • content://sms/inbox
  • content://sms/sent
  • content://mms/inbox
  • content://mms
  • content://mms-sms
  • content://mms/address
  • content://mms/part
  • content://mms/sent
  • content://mms/outbox

删除与下面的简单code完成的:

Delete was done with the following simple code:

ContentResolver cr = mContext.getContentResolver() ;
cr.delete(uri, null, null) ;

结果是,所有的文本信息从设备中删除,通话记录从通话清晰,但仍然包含短信日志(不存在短信)。

The result was that all text messages are deleted from the device, call log is clear from calls, BUT still contains SMS logs (for SMS messages that does not exist).

这是上面提到的所有表都在过程结束确实是空的,但我找不到它的通话记录获取它的短信数据相关来源。

All the tables which are mentioned above are indeed empty at the end of the process, but I can't find the relevant source which the call log fetches it's SMS data from.

我发现关于这个问题的下列职位,但仍没有有效的解决方案:

I've found the following posts on the subject, but still with no working solution:

  • SMS are duplicated as Calls(Samsung galaxy S II)
  • Samsung device returns text messages when querying for call-log

我要事先声明,我知道在 CallLog.Calls.CONTENT_URI 的LOGTYPE列..不相关由于这样的事实,该表是现在空的,数据不会从那里来了。

I'll state in advance that I know about the "logtype" column at CallLog.Calls.CONTENT_URI.. Not relevant due to the fact that this table is now empty, and data is not coming from there.

推荐答案

找到了答案 -

为了获得访问,我们需要一对夫妇的权限添加到清单三星通话记录:

In order to get access to Samsung call logs we need to add a couple of Permissions to the manifest:

<uses-permission android:name="com.sec.android.provider.logsprovider.permission.READ_LOGS" />
<uses-permission android:name="com.sec.android.provider.logsprovider.permission.WRITE_LOGS" />

现在,我们所要做的就是使用的内容解析删除日志类型400,410,700,200,300,从内容600和500://日志/ historys如下:

Now, all we have to do is to use the content resolver to delete log types 400, 410, 700, 200, 300, 600 and 500 from content://logs/historys as follows:

    mContext = getActivity(); // Assuming that you are doing this from within a Fragment

    try
    {
        mContext.getContentResolver().delete(Uri.parse("content://logs/historys"), "logtype='400'", null);
        mContext.getContentResolver().delete(Uri.parse("content://logs/historys"), "logtype='410'", null);
        mContext.getContentResolver().delete(Uri.parse("content://logs/historys"), "logtype='700'", null);
        mContext.getContentResolver().delete(Uri.parse("content://logs/historys"), "logtype='200'", null);
        mContext.getContentResolver().delete(Uri.parse("content://logs/historys"), "logtype='300'", null);
        mContext.getContentResolver().delete(Uri.parse("content://logs/historys"), "logtype='600'", null);
        mContext.getContentResolver().delete(Uri.parse("content://logs/historys"), "logtype='500'", null);
    }
    catch(Exception exception)
    {
        exception.printStackTrace();
    }

工作就像一个魅力对我来说。

Worked like a charm for me.

这篇关于不能从三星手机通话记录删除短信记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆