1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- From a99a14cefc17e50dc2eafb0c99760dd8e09aaabd Mon Sep 17 00:00:00 2001
- From: Matthew Finkel <Matthew.Finkel@gmail.com>
- Date: Sat, 24 Nov 2018 04:49:59 +0000
- Subject: [PATCH 08/13] Bug 28051 - Make TorService compatible with the support
- libraries
- ---
- .../org/torproject/android/service/TorService.java | 11 ++++++++---
- 1 file changed, 8 insertions(+), 3 deletions(-)
- diff --git a/orbotservice/src/main/java/org/torproject/android/service/TorService.java b/orbotservice/src/main/java/org/torproject/android/service/TorService.java
- index edd0e3d5..a12a97bd 100644
- --- a/orbotservice/src/main/java/org/torproject/android/service/TorService.java
- +++ b/orbotservice/src/main/java/org/torproject/android/service/TorService.java
- @@ -35,7 +35,10 @@ import android.os.Build;
- import android.os.IBinder;
- import android.os.RemoteException;
- import android.provider.BaseColumns;
- -import android.support.annotation.RequiresApi;
- +// Not available in 23.4.0
- +// https://developer.android.com/reference/android/support/annotation/RequiresApi
- +//import android.support.annotation.RequiresApi;
- +import android.annotation.TargetApi;
- import android.support.v4.app.NotificationCompat;
- import android.support.v4.content.LocalBroadcastManager;
- import android.text.TextUtils;
- @@ -250,7 +253,10 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
-
- private final static String NOTIFICATION_CHANNEL_ID = "orbot_channel_1";
-
- - @RequiresApi(api = Build.VERSION_CODES.O)
- + // Use TargetApi until we use a support library version that adds the
- + // RequriesApi annotation
- + //@RequiresApi(api = Build.VERSION_CODES.O)
- + @TargetApi(value = Build.VERSION_CODES.O)
- private void createNotificationChannel ()
- {
- NotificationManager mNotificationManager =
- @@ -300,7 +306,6 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
-
- mNotifyBuilder.setCategory(Notification.CATEGORY_SERVICE);
-
- - mNotifyBuilder.setChannelId(NOTIFICATION_CHANNEL_ID);
-
-
- Intent intentRefresh = new Intent();
- --
- 2.17.1
|