Project

General

Profile

Android 11 target query.

Added by Marc Williams over 2 years ago

I only recently discovered Privacy Cell and noticed it works with Android 11 and higher. Was hoping to run it on my other phones due to the great amount of info it provides. None of these drives (will ever) run A11.

Was just wondering what the technical limitations are that prevents it from being used on older Androids.

Currently looking around for something like Privacy Cell.


Replies (5)

RE: Android 11 target query. - Added by Marc Williams over 2 years ago

drives = devices

[didn't see a way to edit once posted]

RE: Android 11 target query. - Added by Soren Stoutner over 2 years ago

I would love to lower the minimum API for Privacy Cell if it were possible, but, unfortunately, the APIs that are used by Privacy Cell to determine which cell protocols the phone is connected to were only added in API 30 (Android 11).

Specifically, Privacy Cell uses the following three APIs:

https://developer.android.com/reference/android/telephony/NetworkRegistrationInfo#getAccessNetworkTechnology()
https://developer.android.com/reference/android/telephony/TelephonyDisplayInfo#getNetworkType()
https://developer.android.com/reference/android/telephony/TelephonyDisplayInfo#getOverrideNetworkType()

RE: Android 11 target query. - Added by Soren Stoutner over 2 years ago

Looking at the details, it might be possible to recreate some of Privacy Cell's functionality using older APIs, but I don't currently have the time available to chase that down, and it might or might not be possible to create a user experience that works as well.

Specifically, some of the data used by Privacy Cell can be accessed on older devices using:

https://developer.android.com/reference/android/telephony/TelephonyManager#getNetworkType()
https://developer.android.com/reference/android/telephony/TelephonyManager#getVoiceNetworkType()
https://developer.android.com/reference/android/telephony/TelephonyManager#getDataNetworkType()

RE: Android 11 target query. - Added by Marc Williams over 2 years ago

Ah I see. Thanks very much for the info and the links. I just may experiment and see what I can come up with.

RE: Android 11 target query. - Added by Soren Stoutner over 2 years ago

I am open to receiving any code submissions (see the Code Submission Agreement at https://www.stoutner.com/privacy-cell/contributors), or you are welcome to fork Privacy Cell and modify it as long as you comply with the GPLv3+.

It wouldn't be possible to differentiate between a 5G SA and 5G NSA network on a device < API 30, which was the original idea behind Privacy Cell. However, it would be possible to build a system that notified the user when they switched between a 3G and a 4G network, which was the feature added in version 1.7. Note that for older versions of Android you will probably have to change the intents that launch the notification settings, as those are different on older APIs. Also, if you are targeting API <= 22 you will need to delete the overrides that remove android.permission.WAKE_LOCK and android.permission.ACCESS_NETWORK_STATE added by androidx.work. You will probably have to do a bunch of testing on each API to make sure that the service is propery restarted if it is killed in the background. It took me quite a while to work through all the possible scenarios for that, and it isn't something that you can test well in an emulator, although the current solution might be backwards compatible with older APIs.

Of course, a bunch of the text would need to be modified for older APIs, specifically relating to anything that differentiates between 5G SA and 5G NSA. There are probably other things I haven't thought of. But if you just want something that makes a sound every time you connect to a 3G network it should be possible.

    (1-5/5)