安卓检查通话自动录音功能是否开启,并跳转到开启页面

介绍

本文章主要介绍安卓检查通话自动录音功能是否开启,并跳转到相应的开启页面,主要介绍小米,华为、vivo和oppo手机,其他手机暂不做介绍

检查手机自动录音

小米

/**
     * 检查小米手机自动录音功能是否开启,true已开启  false未开启
     *
     * @return
     */
    private boolean checkXiaomiRecord() throws Settings.SettingNotFoundException {
        int key = Settings.System.getInt(mContext.getContentResolver(), "button_auto_record_call");
//            XLog.d(TAG, "Xiaomi key:" + key);
        //0是未开启,1是开启
        return key != 0;
    }

OPPO

/**
     * 检查OPPO手机自动录音功能是否开启,true已开启  false未开启
     *
     * @return
     */
    private boolean checkOppoRecord() throws Settings.SettingNotFoundException {
        int key = Settings.Global.getInt(mContext.getContentResolver(), "oplus_customize_all_call_audio_record");
//        int key = Settings.Global.getInt(mContext.getContentResolver(), "oppo_all_call_audio_record");
//            XLog.d(TAG, "Oppo key:" + key);
        //0代表OPPO自动录音未开启,1代表OPPO自动录音已开启
        return key != 0;
    }

VIVO

/**
     * 检查VIVO自动录音功能是否开启,true已开启  false未开启
     *
     * @return
     */
    private boolean checkVivoRecord() throws Settings.SettingNotFoundException {
        int key = Settings.Global.getInt(mContext.getContentResolver(), "call_record_state_global");
//            XLog.d(TAG, "Vivo key:" + key);
        //0代表VIVO自动录音未开启,1代表VIVO所有通话自动录音已开启,2代表指定号码自动录音
        return key == 1;
    }

华为

/**
     * 检查华为手机自动录音功能是否开启,true已开启  false未开启
     *
     * @return
     */
    private boolean checkHuaweiRecord() throws Settings.SettingNotFoundException {
        int key = Settings.Secure.getInt(mContext.getContentResolver(), "enable_record_auto_key");
//            XLog.d(TAG, "Huawei key:" + key);
        //0代表华为自动录音未开启,1代表华为自动录音已开启
        return key != 0;
    }

跳转页面

小米

/**
     * 跳转到小米开启通话自动录音功能页面
     */
    private void startXiaomiRecord() {
        ComponentName componentName = new ComponentName("com.android.phone", "com.android.phone.settings.CallRecordSetting");
        Intent intent = new Intent();
        intent.setComponent(componentName);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mContext.startActivity(intent);
    }

oppo

/**
     * 跳转到OPPO开启通话自动录音功能页面
     */
    private void startOppoRecord() {
        ComponentName componentName = new ComponentName("com.android.phone", "com.android.phone.OplusCallFeaturesSetting");
        Intent intent = new Intent();
        intent.setComponent(componentName);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mContext.startActivity(intent);
    }

vivo

/**
     * 跳转到VIVO开启通话自动录音功能页面
     */
    private void startVivoRecord() {
        ComponentName componentName = new ComponentName("com.android.incallui", "com.android.incallui.record.CallRecordSetting");
        Intent intent = new Intent();
        intent.setComponent(componentName);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mContext.startActivity(intent);
    }

华为

/**
     * 跳转到华为开启通话自动录音功能页面
     */
    private void startHuaweiRecord() {
        ComponentName componentName = new ComponentName("com.android.phone", "com.android.phone.MSimCallFeaturesSetting");
//        ComponentName componentName = new C

相关推荐

  1. uniapp 应用设置等页面

    2024-01-11 11:52:03       24 阅读
  2. 手机APP开发功能之一:通知概述

    2024-01-11 11:52:03       14 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-01-11 11:52:03       19 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-11 11:52:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-11 11:52:03       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-11 11:52:03       20 阅读

热门阅读

  1. golang一个轻量级基于内存的kv存储或缓存

    2024-01-11 11:52:03       33 阅读
  2. Python闭包与装饰

    2024-01-11 11:52:03       40 阅读
  3. Python 函数

    2024-01-11 11:52:03       32 阅读
  4. vue for循环不建议使用index作为key的原因

    2024-01-11 11:52:03       39 阅读
  5. python使用单例模式加载config.ini配置文件

    2024-01-11 11:52:03       34 阅读
  6. C#Selenium WebDriver备忘录

    2024-01-11 11:52:03       34 阅读