require-api.patch 1.5 KB

1234567891011121314151617181920212223242526272829
  1. diff --git a/service/src/main/java/org/torproject/android/service/TorService.java b/service/src/main/java/org/torproject/android/service/TorService.java
  2. index d280a29..beb2b02 100644
  3. --- a/service/src/main/java/org/torproject/android/service/TorService.java
  4. +++ b/service/src/main/java/org/torproject/android/service/TorService.java
  5. @@ -12,7 +12,10 @@ import android.net.ConnectivityManager;
  6. import android.net.NetworkInfo;
  7. import android.os.Build;
  8. import android.os.IBinder;
  9. -import android.support.annotation.RequiresApi;
  10. +// Not available in 23.4.0
  11. +// https://developer.android.com/reference/android/support/annotation/RequiresApi
  12. +//import android.support.annotation.RequiresApi;
  13. +import android.annotation.TargetApi;
  14. import android.text.TextUtils;
  15. import android.util.Log;
  16. import com.msopentech.thali.android.toronionproxy.AndroidOnionProxyManager;
  17. @@ -93,7 +96,10 @@ public final class TorService extends Service implements TorServiceConstants, Or
  18. startService(intentVpn);
  19. }
  20. - @RequiresApi(api = Build.VERSION_CODES.O)
  21. + // Use TargetApi until we use a support library version that adds the
  22. + // RequriesApi annotation
  23. + //@RequiresApi(api = Build.VERSION_CODES.O)
  24. + @TargetApi(value = Build.VERSION_CODES.O)
  25. private void createNotificationChannel(String appName, String appDescription) {
  26. int importance = NotificationManager.IMPORTANCE_LOW;
  27. NotificationChannel mChannel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, appName,