mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 04:28:10 +00:00
Removed camera testing on startup.
This commit is contained in:
parent
069c31c2dd
commit
39caf85271
2 changed files with 26 additions and 0 deletions
18
Hacks.java
18
Hacks.java
|
|
@ -18,6 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
import android.hardware.Camera;
|
||||
import android.media.AudioManager;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
|
@ -126,4 +127,21 @@ public final class Hacks {
|
|||
public static boolean hasTwoCameras() {
|
||||
return isSPHD700() || isGalaxySOrTabWithFrontCamera();
|
||||
}
|
||||
|
||||
public static boolean hasCamera() {
|
||||
if (Version.sdkAboveOrEqual(Version.API09_GINGERBREAD_23)) {
|
||||
int nb = 0;
|
||||
try {
|
||||
nb = (Integer) Camera.class.getMethod("getNumberOfCameras", (Class[])null).invoke(null);
|
||||
} catch (Exception e) {
|
||||
Log.wtf(Version.TAG, "Error getting number of cameras");
|
||||
}
|
||||
return nb > 0;
|
||||
}
|
||||
|
||||
Log.i(Version.TAG, "Hack: considering there IS a camera.\n"
|
||||
+ "If it is not the case, report DEVICE and MODEL to linphone-users@nongnu.org");
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,14 @@ public class Version {
|
|||
|
||||
public static final String TAG="Linphone";
|
||||
|
||||
public static final int API03_CUPCAKE_15 = 3;
|
||||
public static final int API04_DONUT_16 = 4;
|
||||
public static final int API06_ECLAIR_20 = 6;
|
||||
public static final int API07_ECLAIR_21 = 7;
|
||||
public static final int API08_FROYO_22 = 8;
|
||||
public static final int API09_GINGERBREAD_23 = 9;
|
||||
public static final int API11_HONEYCOMB_30 = 11;
|
||||
|
||||
private static native boolean nativeHasNeon();
|
||||
private static Boolean hasNeon;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue