version:1.5.5
fix: update:对接通话白名单
This commit is contained in:
@@ -15,8 +15,8 @@ android {
|
|||||||
applicationId "com.xxpatx.os"
|
applicationId "com.xxpatx.os"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 1052
|
versionCode 1055
|
||||||
versionName "1.5.2"
|
versionName "1.5.5"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ interface IZkwlContactManager {
|
|||||||
|
|
||||||
List<String> getAllBlockedContactNumbers();
|
List<String> getAllBlockedContactNumbers();
|
||||||
|
|
||||||
|
void controlWhitelistContactEnable(boolean enable);
|
||||||
|
|
||||||
|
boolean getWhitelistContactEnableStatus();
|
||||||
|
|
||||||
void addWhitelistContactNumber(String phoneNumber);
|
void addWhitelistContactNumber(String phoneNumber);
|
||||||
|
|
||||||
void deleteWhitelistContactNumber(String phoneNumber);
|
void deleteWhitelistContactNumber(String phoneNumber);
|
||||||
|
|||||||
@@ -474,6 +474,7 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
|||||||
mMMKV.encode(CommonConfig.HOURLY_TIME_SIGNAL_KEY, systemSettings.getHour_notify());
|
mMMKV.encode(CommonConfig.HOURLY_TIME_SIGNAL_KEY, systemSettings.getHour_notify());
|
||||||
mMMKV.encode(CommonConfig.VOICE_SPEAKER_KEY, systemSettings.getVoice_speaker());
|
mMMKV.encode(CommonConfig.VOICE_SPEAKER_KEY, systemSettings.getVoice_speaker());
|
||||||
mMMKV.encode(CommonConfig.PHONE_WHITE_LIST, systemSettings.getPhone_white_list());
|
mMMKV.encode(CommonConfig.PHONE_WHITE_LIST, systemSettings.getPhone_white_list());
|
||||||
|
ContactManager.getInstance().controlWhitelistContactEnable(systemSettings.getPhone_white_list() == 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.xxpatx.os.activity.phone;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.telecom.TelecomManager;
|
import android.telecom.TelecomManager;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
@@ -73,8 +74,13 @@ public class WhiteListActivity extends BaseMvvmActivity<WhiteListViewModel, Acti
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void openWhiteList(View view) {
|
public void openWhiteList(View view) {
|
||||||
// int phone_white_list = mMMKV.decodeInt(CommonConfig.PHONE_WHITE_LIST, 0);
|
int phone_white_list = mMMKV.decodeInt(CommonConfig.PHONE_WHITE_LIST, 0);
|
||||||
|
ContactManager.getInstance().controlWhitelistContactEnable(phone_white_list != 1);
|
||||||
|
boolean enable = ContactManager.getInstance().getWhitelistContactEnableStatus();
|
||||||
|
Log.e(TAG, "openWhiteList: " + enable);
|
||||||
|
|
||||||
|
mMMKV.encode(CommonConfig.PHONE_WHITE_LIST, enable ? 1 : 0);
|
||||||
|
mViewDataBinding.setWhiteList(enable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,4 +123,34 @@ public class ContactManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void controlWhitelistContactEnable(boolean enable) {
|
||||||
|
if (mZkwlContactManager == null) {
|
||||||
|
Toaster.show("服务未连接");
|
||||||
|
bindService();
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
mZkwlContactManager.controlWhitelistContactEnable(enable);
|
||||||
|
Log.e(TAG, "controlWhitelistContactEnable: " + enable);
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getWhitelistContactEnableStatus() {
|
||||||
|
if (mZkwlContactManager == null) {
|
||||||
|
Toaster.show("服务未连接");
|
||||||
|
bindService();
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
boolean enable = mZkwlContactManager.getWhitelistContactEnableStatus();
|
||||||
|
Log.e(TAG, "getWhitelistContactEnableStatus: " + enable);
|
||||||
|
return enable;
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1181,6 +1181,7 @@ public class NetInterfaceManager {
|
|||||||
mMMKV.encode("is_info", systemSettings.getIs_info());
|
mMMKV.encode("is_info", systemSettings.getIs_info());
|
||||||
String s = systemSettings.getSetting_sos();
|
String s = systemSettings.getSetting_sos();
|
||||||
mMMKV.encode(CommonConfig.PHONE_WHITE_LIST, systemSettings.getPhone_white_list());
|
mMMKV.encode(CommonConfig.PHONE_WHITE_LIST, systemSettings.getPhone_white_list());
|
||||||
|
ContactManager.getInstance().controlWhitelistContactEnable(systemSettings.getPhone_white_list() == 1);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
mCacheHelper.put(UrlAddress.GET_SETTINGS, "");
|
mCacheHelper.put(UrlAddress.GET_SETTINGS, "");
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ public class WeAccessibilityService extends AccessibilityService {
|
|||||||
mCurrentStep = Step.WECHAT_HANDS_FREE;
|
mCurrentStep = Step.WECHAT_HANDS_FREE;
|
||||||
Toast.makeText(this, "已自动接听视频/语音", Toast.LENGTH_LONG).show();
|
Toast.makeText(this, "已自动接听视频/语音", Toast.LENGTH_LONG).show();
|
||||||
} else {
|
} else {
|
||||||
|
mCurrentStep = Step.WAITING;
|
||||||
// clickAnswer();
|
// clickAnswer();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -582,6 +583,7 @@ public class WeAccessibilityService extends AccessibilityService {
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
Log.e(TAG, "handsFree: not found");
|
Log.e(TAG, "handsFree: not found");
|
||||||
|
mCurrentStep = Step.WAITING;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user