1. 各携帯電話は、次のように自動録音コードがオンになっているかどうかを確認します。
/** * Xiaomi 携帯電話の自動録音機能が有効になっているかどうかを確認します。 true は有効、false は無効です * * @return */ private boolean checkXiaomiRecord() { try { int key = Settings.System.getInt(RecordApp. context.getContentResolver(), "button_auto_record_call"); XLog.d(TAG, "Xiaomi key:" + key); //0 は無効、1 は有効 return key != 0; } catch (Settings.SettingNotFoundException e) { e.printStackTrace() ; } return true; } /** * OPPO携帯電話の自動録画機能が有効かどうかを確認、trueは有効、falseは無効 * * @return */ private boolean checkOppoRecord() { try { int key = android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1 ?Settings.Global.getInt(RecordApp.context.getContentResolver(), "oppo_all_call_audio_record") : 0; XLog.d(TAG , "Oppo key:" + key); //0 は OPPO 自動録画が有効になっていないことを意味し、1 は OPPO 自動録画が有効であることを意味します return key != 0; } catch (Settings.SettingNotFoundException e) { e.printStackTrace(); } return true; } /** * VIVOの自動録画機能が有効かどうかを確認、trueは有効、falseは無効 * * @return */ private boolean checkVivoRecord() { try { int key = android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1 ? Settings.Global.getInt(RecordApp.context.getContentResolver(), "call_record_state_global") : 0; XLog.d(TAG , "Vivo key:" + key); //0 は VIVO 自動録音が有効になっていないことを意味します、1 はすべての通話の VIVO 自動録音が有効であることを意味します、2 は指定された番号の自動録音を意味します return key == 1; } catch (Settings.SettingNotFoundException e) { e.printStackTrace(); } return true; } /** * Huawei携帯電話の自動録音機能が有効かどうかを確認、trueは有効、falseは無効 * * @return */ private boolean checkHuaweiRecord() { 試してみましょう{ int key = Settings.Secure.getInt(RecordApp.context.getContentResolver(), "enable_record_auto_key"); XLog.d(TAG, "Huawei key:" + key); //0 は Huawei 自動録画が有効になっていないことを意味し、1 は Huawei 自動録画が有効であることを意味します return key != 0; } catch (Settings.SettingNotFoundException e) { e. printStackTrace (); } true を返します; }
2. 各携帯電話は次のように自動録画ページにジャンプします。
/** * VIVO で自動通話録音機能を有効にするページにジャンプします */ private void startVivoRecord() { ComponentNameComponentName = new ComponentName("com.android.incallui", "com.android.incallui.record.CallRecordSetting") ; インテントtent = new Intent(); tent.setComponent(componentName); tent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); RecordApp.context.startActivity(intent); ToastUtil.getInstance().showToast("VIVO通話自動録音機能を有効にしてください") ; } /** * Xiaomi が自動通話録音機能を開始するページにジャンプします */ private void startXiaomiRecord() { ComponentNameコンポーネントName = new ComponentName("com.android.phone", "com.android.phone.settings .CallRecordSetting") ; Intenttent = new Intent(); tent.setComponent(componentName); tent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK ); RecordApp.context.startActivity(intent); ToastUtil.getInstance().showToast("Xiaomi の自動通話録音機能をオンにしてください"); } / ** * Huawei 社の自動通話録音機能を有効にするページにジャンプします */ private void startHuaweiRecord() { ComponentName コンポーネント名 = new ComponentName("com.android.phone", "com.android.phone.MSimCallFeatureSetting"); インテント インテント = new Intent(); tent.setComponent(componentName); tent.setFlags(Intent .FLAG_ACTIVITY_NEW_TASK); RecordApp.context.startActivity(intent); ToastUtil.getInstance().showToast("Huawei の自動通話録音機能を有効にしてください"); } / ** * OPPO の自動通話録音機能を有効にするページにジャンプします */ private void startOppoRecord() { ComponentName コンポーネント名 = new ComponentName("com.android.phone", "com.android.phone.OppoCallFeatureSetting"); インテント インテント = new Intent(); tent.setComponent(componentName); tent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK) ; 。 context.startActivity(intent); ToastUtil.getInstance().showToast("OPPO 通話自動録音機能を有効にしてください"); }
3. 次のように、対応するキー値を見つけます。
//[設定] の [システム]、[セキュア]、および [グローバル] のキーと値を調べて表示します。
//1.Secure if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { カーソル カーソル = RecordApp.context.getContentResolver().query(Settings.Secure.CONTENT_URI, null, null, null); String[] 列名 = カーソル.getColumnNames(); StringBuilder ビルダー = new StringBuilder(); while (cursor.moveToNext()) { for (String columnName : columnNames) { String string =cursor.getString(cursor.getColumnIndex(columnName)); builder.append(列名).append(":").append(string).append("\n"); Log.e (TAG, builder.toString ()); } //2.グローバル if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { カーソル カーソル = RecordApp.context.getContentResolver().query(Settings.Global.CONTENT_URI, null, null, null); String[] 列名 = カーソル.getColumnNames(); StringBuilder ビルダー = new StringBuilder(); while (cursor.moveToNext()) { for (String columnName : columnNames) { String string =cursor.getString(cursor.getColumnIndex(columnName)); builder.append(列名).append(":").append(string).append("\n"); Log.e (TAG, builder.toString ()); // 3.システム if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { カーソル カーソル = RecordApp.context.getContentResolver().query(Settings.System.CONTENT_URI, null, null, null); String[] 列名 = カーソル.getColumnNames(); StringBuilder ビルダー = new StringBuilder(); while (cursor.moveToNext()) { for (String columnName : columnNames) { String string =cursor.getString(cursor.getColumnIndex(columnName)); builder.append(列名).append(":").append(string).append("\n"); Log.e (TAG, builder.toString ()); }
//------------------------------------------------ -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ------------------------ ---------------------------- ------------------------
//------------------------------------------------ - - - - - 終わり - - - - - - - - - - - - - - - - - - - - ------------------------