Parcourir la source

[RN] Lower Android target SDK version to 22

API level 22 is below 23 (aka Marshmallow), which included an overhaul in the
permissions system. React Native recommends 22 (it's the default when you create
a new app) and there have been reports when set higher [0] and [1].

This also fixes a critical bug, wherein Jitsi Meet wouldn't request permissions
for the camera and microphone.

Last, this change also allows us to get rid of the overlay checking code,
because it was only needed for API level 23 or higher.

[0]: https://github.com/facebook/react-native/pull/10479
[1]: https://github.com/facebook/react-native/issues/10587
master
Saúl Ibarra Corretgé il y a 8 ans
Parent
révision
c9a29153dd

+ 1
- 1
android/build.gradle Voir le fichier

@@ -29,5 +29,5 @@ ext {
29 29
     compileSdkVersion = 23
30 30
     buildToolsVersion = "23.0.1"
31 31
     minSdkVersion    = 16
32
-    targetSdkVersion = 23
32
+    targetSdkVersion = 22
33 33
 }

+ 0
- 44
android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetActivity.java Voir le fichier

@@ -17,10 +17,7 @@
17 17
 package org.jitsi.meet.sdk;
18 18
 
19 19
 import android.content.Intent;
20
-import android.net.Uri;
21
-import android.os.Build;
22 20
 import android.os.Bundle;
23
-import android.provider.Settings;
24 21
 import android.support.annotation.Nullable;
25 22
 import android.support.v7.app.AppCompatActivity;
26 23
 
@@ -38,13 +35,6 @@ import java.net.URL;
38 35
  * <tt>JKConferenceView</tt> static methods.
39 36
  */
40 37
 public class JitsiMeetActivity extends AppCompatActivity {
41
-    /**
42
-     * Code for identifying the permission to draw on top of other apps. The
43
-     * number is chosen arbitrarily and used to correlate the intent with its
44
-     * result.
45
-     */
46
-    public static final int OVERLAY_PERMISSION_REQ_CODE = 4242;
47
-
48 38
     /**
49 39
      * Instance of the {@link JitsiMeetView} which this activity will display.
50 40
      */
@@ -74,26 +64,6 @@ public class JitsiMeetActivity extends AppCompatActivity {
74 64
         view.loadURL(url);
75 65
     }
76 66
 
77
-    /**
78
-     * {@inheritDoc}
79
-     */
80
-    @Override
81
-    protected void onActivityResult(
82
-            int requestCode,
83
-            int resultCode,
84
-            Intent data) {
85
-        if (requestCode == OVERLAY_PERMISSION_REQ_CODE) {
86
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
87
-                if (!Settings.canDrawOverlays(this)) {
88
-                    // Permission not granted.
89
-                    return;
90
-                }
91
-            }
92
-
93
-            setContentView(view);
94
-        }
95
-    }
96
-
97 67
     /**
98 68
      * {@inheritDoc}
99 69
      */
@@ -120,20 +90,6 @@ public class JitsiMeetActivity extends AppCompatActivity {
120 90
         view.setWelcomePageEnabled(welcomePageEnabled);
121 91
         view.loadURL(null);
122 92
 
123
-        // In debug mode React needs permission to write over other apps in
124
-        // order to display the warning and error overlays.
125
-        if (BuildConfig.DEBUG
126
-                && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
127
-                && !Settings.canDrawOverlays(this)) {
128
-            Intent intent
129
-                = new Intent(
130
-                        Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
131
-                        Uri.parse("package:" + getPackageName()));
132
-
133
-            startActivityForResult(intent, OVERLAY_PERMISSION_REQ_CODE);
134
-            return;
135
-        }
136
-
137 93
         setContentView(view);
138 94
     }
139 95
 

Chargement…
Annuler
Enregistrer