New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android O compatibility issues #1227

Closed
ameshkov opened this Issue May 18, 2017 · 5 comments

Comments

Projects
None yet
1 participant
@ameshkov
Member

ameshkov commented May 18, 2017

Here is the main issue:

The VpnService of VPN apps must now call its startForeground() method after launch. Because the Android system starts a VPN app's service directly, transitioning to the foreground is the app's responsibility. Android O shuts down VPN apps that don't transition the VPN service to the foreground.

So, in VPN mode Android O won't support the "no icon" mode.

Next, if we want to have target SDK level equal to 25, we should consider broadcast receivers restriction. For instance, this one (about CONNECTIVITY_ACTION):

Apps targeting Android 7.0 (API level 24) and higher do not receive this broadcast if they declare the broadcast receiver in their manifest. Apps will still receive broadcasts if they register their BroadcastReceiver with Context.registerReceiver() and that context is still valid.

@ameshkov ameshkov added this to the 2.9 R2 milestone May 18, 2017

@ameshkov ameshkov self-assigned this May 18, 2017

@ameshkov

This comment has been minimized.

Show comment
Hide comment
@ameshkov

ameshkov May 26, 2017

Member

Startup delay should be set to zero for Android O, otherwise service is killed immediately.

Member

ameshkov commented May 26, 2017

Startup delay should be set to zero for Android O, otherwise service is killed immediately.

@ameshkov

This comment has been minimized.

Show comment
Hide comment
@ameshkov

ameshkov May 26, 2017

Member

If app targets Android O:

The system properties net.dns1, net.dns2, net.dns3, and net.dns4 are no longer available, a change that improves privacy on the platform.
To obtain networking information such as DNS servers, apps with the ACCESS_NETWORK_STATE permission can register a NetworkRequest or NetworkCallback object. These classes are available in Android 5.0 (API level 21) and higher.

Member

ameshkov commented May 26, 2017

If app targets Android O:

The system properties net.dns1, net.dns2, net.dns3, and net.dns4 are no longer available, a change that improves privacy on the platform.
To obtain networking information such as DNS servers, apps with the ACCESS_NETWORK_STATE permission can register a NetworkRequest or NetworkCallback object. These classes are available in Android 5.0 (API level 21) and higher.

@ameshkov

This comment has been minimized.

Show comment
Hide comment
@ameshkov

ameshkov May 26, 2017

Member

So, after all, what's done:

  • Receiver that handles connectivity change removed from the app manifest and registered with Context.registerReceiver
  • Startup delay is now 0 for Android O (which resolves the startup on boot issue)

Other compatibility changes will be handled in v2.10.

Review ID: AFA-CR-17

Member

ameshkov commented May 26, 2017

So, after all, what's done:

  • Receiver that handles connectivity change removed from the app manifest and registered with Context.registerReceiver
  • Startup delay is now 0 for Android O (which resolves the startup on boot issue)

Other compatibility changes will be handled in v2.10.

Review ID: AFA-CR-17

@ameshkov ameshkov closed this May 26, 2017

@ameshkov

This comment has been minimized.

Show comment
Hide comment
@ameshkov

ameshkov May 27, 2017

Member

Android O detection does not work properly yet (they didn't yet add the API level 26?)

Member

ameshkov commented May 27, 2017

Android O detection does not work properly yet (they didn't yet add the API level 26?)

@ameshkov ameshkov reopened this May 27, 2017

@ameshkov

This comment has been minimized.

Show comment
Hide comment
@ameshkov

ameshkov Jun 2, 2017

Member
    public static boolean isAndroidO() {
        return Build.VERSION.SDK_INT >= 26 ||
                // In case of Android O preview
                (Build.VERSION.SDK_INT == 25 && Build.VERSION.PREVIEW_SDK_INT > 0);
    }
Member

ameshkov commented Jun 2, 2017

    public static boolean isAndroidO() {
        return Build.VERSION.SDK_INT >= 26 ||
                // In case of Android O preview
                (Build.VERSION.SDK_INT == 25 && Build.VERSION.PREVIEW_SDK_INT > 0);
    }

@ameshkov ameshkov closed this Jun 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment