Skip to content

Remove code for SDKs lower than 36 - #63

Open
sdsantos wants to merge 2 commits into
GrapheneOS:mainfrom
sdsantos:remove-sdk-checks
Open

Remove code for SDKs lower than 36#63
sdsantos wants to merge 2 commits into
GrapheneOS:mainfrom
sdsantos:remove-sdk-checks

Conversation

@sdsantos

@sdsantos sdsantos commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Closes #64

@sdsantos
sdsantos requested review from RankoR and m4pl August 12, 2026 12:50
Data.STATUS_ICON,
Data.STATUS_LABEL,
Data.STATUS_TIMESTAMP,
Data.CARRIER_PRESENCE,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, missed the indexes below.

Build.VERSION.SDK_INT < Build.VERSION_CODES.M
&& !mContactData.isUserProfile()
&& mArePhoneOptionsChangable);
sendToVoiceMailMenuItem.setVisible(mArePhoneOptionsChangable);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Related: https://www.reddit.com/r/AndroidQuestions/comments/11nu4iz/is_it_just_me_or_does_the_option_to_route_to/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think isAtLeastO() should also be removed, plus @TargetApi and @RequiresApi annotations.

}
activity.startActivityForResult(intent, 0);
telecomManager.placeCall(intent.getData(), intent.getExtras());
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this return; should go.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TAG is unused now that Log is gone.

import androidx.annotation.Nullable;

public class TelephonyManagerCompat {
public static final String TELEPHONY_MANAGER_CLASS = "android.telephony.TelephonyManager";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only existed for the removed isMethodAvailable.


private void setStarred(Intent intent) {
ContentResolver contentResolver = getContentResolver();
if (contentResolver == null) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think getContentResolver() won't return null here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sdsantos
sdsantos requested a review from m4pl August 13, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove code for Android SDKs lower than 36

2 participants