Remove code for SDKs lower than 36 - #63
Conversation
| Data.STATUS_ICON, | ||
| Data.STATUS_LABEL, | ||
| Data.STATUS_TIMESTAMP, | ||
| Data.CARRIER_PRESENCE, |
There was a problem hiding this comment.
Looks like this shifts the sequence: everything after it moves by one, but the index constants below still point at the old positions, so photoUri, customRingtone, sendToVoicemail and isUserProfile all read the wrong column. Worth appending it at the end of the array instead.
There was a problem hiding this comment.
Ah, missed the indexes below.
| Build.VERSION.SDK_INT < Build.VERSION_CODES.M | ||
| && !mContactData.isUserProfile() | ||
| && mArePhoneOptionsChangable); | ||
| sendToVoiceMailMenuItem.setVisible(mArePhoneOptionsChangable); |
There was a problem hiding this comment.
The old condition started with SDK_INT < M, always false at minSdk 36, so this item was always hidden. Now it's visible, and the !mContactData.isUserProfile() guard is gone (the ringtone item above still has it). Please check this.
There was a problem hiding this comment.
You are totally right. But that means this feature disappears from the app, since I found no other flow to manager route/unroute to voicemail. Google's Contacts app maintains this feature. Could have this been a bug?
There was a problem hiding this comment.
I think isAtLeastO() should also be removed, plus @TargetApi and @RequiresApi annotations.
| } | ||
| activity.startActivityForResult(intent, 0); | ||
| telecomManager.placeCall(intent.getData(), intent.getExtras()); | ||
| return; |
| import androidx.annotation.Nullable; | ||
|
|
||
| public class TelephonyManagerCompat { | ||
| public static final String TELEPHONY_MANAGER_CLASS = "android.telephony.TelephonyManager"; |
There was a problem hiding this comment.
Only existed for the removed isMethodAvailable.
|
|
||
| private void setStarred(Intent intent) { | ||
| ContentResolver contentResolver = getContentResolver(); | ||
| if (contentResolver == null) return; |
There was a problem hiding this comment.
I think getContentResolver() won't return null here.
There was a problem hiding this comment.
I moved it here because it was checking for null inside PinnedPositionsCompat.undemote. But I guess the rest of the code was already trusting it.
d18ccea to
4096704
Compare
Closes #64