mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-04 09:17:29 +01:00
fix privacy caller ID selection (#962)
This commit is contained in:
parent
0c907f0ba1
commit
0313500652
@ -171,12 +171,12 @@ public class GBDeviceService implements DeviceService {
|
|||||||
public void onSetCallState(CallSpec callSpec) {
|
public void onSetCallState(CallSpec callSpec) {
|
||||||
Context context = GBApplication.getContext();
|
Context context = GBApplication.getContext();
|
||||||
String currentPrivacyMode = GBApplication.getPrefs().getString("pref_call_privacy_mode", GBApplication.getContext().getString(R.string.p_call_privacy_mode_off));
|
String currentPrivacyMode = GBApplication.getPrefs().getString("pref_call_privacy_mode", GBApplication.getContext().getString(R.string.p_call_privacy_mode_off));
|
||||||
if (context.getString(R.string.p_call_privacy_mode_name).equals(currentPrivacyMode)) {
|
if (currentPrivacyMode.equals(context.getString(R.string.p_call_privacy_mode_name))) {
|
||||||
callSpec.name = callSpec.number;
|
callSpec.name = callSpec.number;
|
||||||
} else if (context.getString(R.string.p_call_privacy_mode_complete).equals(currentPrivacyMode)) {
|
} else if (currentPrivacyMode.equals(context.getString(R.string.p_call_privacy_mode_complete))) {
|
||||||
callSpec.number = null;
|
callSpec.number = null;
|
||||||
callSpec.name = null;
|
callSpec.name = null;
|
||||||
} else if (context.getString(R.string.pref_call_privacy_mode_number).equals(currentPrivacyMode)) {
|
} else if (currentPrivacyMode.equals(context.getString(R.string.p_call_privacy_mode_number))){
|
||||||
callSpec.name = coalesce(callSpec.name, getContactDisplayNameByNumber(callSpec.number));
|
callSpec.name = coalesce(callSpec.name, getContactDisplayNameByNumber(callSpec.number));
|
||||||
if (callSpec.name != null && !callSpec.name.equals(callSpec.number)) {
|
if (callSpec.name != null && !callSpec.name.equals(callSpec.number)) {
|
||||||
callSpec.number = null;
|
callSpec.number = null;
|
||||||
|
@ -198,7 +198,7 @@
|
|||||||
<string-array name="pref_call_privacy_mode_values">
|
<string-array name="pref_call_privacy_mode_values">
|
||||||
<item>@string/p_call_privacy_mode_off</item>
|
<item>@string/p_call_privacy_mode_off</item>
|
||||||
<item>@string/p_call_privacy_mode_name</item>
|
<item>@string/p_call_privacy_mode_name</item>
|
||||||
<item>@string/pref_call_privacy_mode_number</item>
|
<item>@string/p_call_privacy_mode_number</item>
|
||||||
<item>@string/p_call_privacy_mode_complete</item>
|
<item>@string/p_call_privacy_mode_complete</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
@ -35,5 +35,6 @@
|
|||||||
|
|
||||||
<item name="p_call_privacy_mode_off" type="string">off</item>
|
<item name="p_call_privacy_mode_off" type="string">off</item>
|
||||||
<item name="p_call_privacy_mode_name" type="string">name</item>
|
<item name="p_call_privacy_mode_name" type="string">name</item>
|
||||||
|
<item name="p_call_privacy_mode_number" type="string">number</item>
|
||||||
<item name="p_call_privacy_mode_complete" type="string">complete</item>
|
<item name="p_call_privacy_mode_complete" type="string">complete</item>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -169,11 +169,11 @@
|
|||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:title="@string/pref_header_privacy">
|
android:title="@string/pref_header_privacy">
|
||||||
<ListPreference
|
<ListPreference
|
||||||
|
android:defaultValue="@string/p_call_privacy_mode_off"
|
||||||
android:key="pref_call_privacy_mode"
|
android:key="pref_call_privacy_mode"
|
||||||
android:title="@string/pref_title_call_privacy_mode"
|
android:title="@string/pref_title_call_privacy_mode"
|
||||||
android:entries="@array/pref_call_privacy_mode"
|
android:entries="@array/pref_call_privacy_mode"
|
||||||
android:entryValues="@array/pref_call_privacy_mode_values"
|
android:entryValues="@array/pref_call_privacy_mode_values"
|
||||||
android:defaultValue="@string/pref_call_privacy_mode_off"
|
|
||||||
android:summary="%s" />
|
android:summary="%s" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user