Browse 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é 8 years ago
parent
commit
c9a29153dd

+ 1
- 1
android/build.gradle View File

29
     compileSdkVersion = 23
29
     compileSdkVersion = 23
30
     buildToolsVersion = "23.0.1"
30
     buildToolsVersion = "23.0.1"
31
     minSdkVersion    = 16
31
     minSdkVersion    = 16
32
-    targetSdkVersion = 23
32
+    targetSdkVersion = 22
33
 }
33
 }

+ 0
- 44
android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetActivity.java View File

17
 package org.jitsi.meet.sdk;
17
 package org.jitsi.meet.sdk;
18
 
18
 
19
 import android.content.Intent;
19
 import android.content.Intent;
20
-import android.net.Uri;
21
-import android.os.Build;
22
 import android.os.Bundle;
20
 import android.os.Bundle;
23
-import android.provider.Settings;
24
 import android.support.annotation.Nullable;
21
 import android.support.annotation.Nullable;
25
 import android.support.v7.app.AppCompatActivity;
22
 import android.support.v7.app.AppCompatActivity;
26
 
23
 
38
  * <tt>JKConferenceView</tt> static methods.
35
  * <tt>JKConferenceView</tt> static methods.
39
  */
36
  */
40
 public class JitsiMeetActivity extends AppCompatActivity {
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
      * Instance of the {@link JitsiMeetView} which this activity will display.
39
      * Instance of the {@link JitsiMeetView} which this activity will display.
50
      */
40
      */
74
         view.loadURL(url);
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
      * {@inheritDoc}
68
      * {@inheritDoc}
99
      */
69
      */
120
         view.setWelcomePageEnabled(welcomePageEnabled);
90
         view.setWelcomePageEnabled(welcomePageEnabled);
121
         view.loadURL(null);
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
         setContentView(view);
93
         setContentView(view);
138
     }
94
     }
139
 
95
 

Loading…
Cancel
Save