Galaxy tab doesn't require Galaxy S speaker hack.
This commit is contained in:
parent
9b9243fafc
commit
cda0da706b
2 changed files with 14 additions and 6 deletions
|
@ -22,12 +22,20 @@ import android.media.AudioManager;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
public class Hacks {
|
public final class Hacks {
|
||||||
|
|
||||||
private Hacks() {}
|
private Hacks() {}
|
||||||
|
|
||||||
public static boolean isGalaxyS() {
|
public static boolean isGalaxyS() {
|
||||||
return Build.DEVICE.startsWith("GT-I9000") || Build.DEVICE.startsWith("GT-P1000");
|
return Build.DEVICE.startsWith("GT-I9000");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isGalaxySOrTab() {
|
||||||
|
return isGalaxyS() || isGalaxyTab();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isGalaxyTab() {
|
||||||
|
return Build.DEVICE.startsWith("GT-P1000");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* private static final boolean log(final String msg) {
|
/* private static final boolean log(final String msg) {
|
||||||
|
|
|
@ -27,7 +27,7 @@ class AndroidCameraConf {
|
||||||
|
|
||||||
public void findFrontAndRearCameraIds(int[] frontCameraId, int[] rearCameraId, int[] cameraId) {
|
public void findFrontAndRearCameraIds(int[] frontCameraId, int[] rearCameraId, int[] cameraId) {
|
||||||
Log.i(tag, "Detecting cameras");
|
Log.i(tag, "Detecting cameras");
|
||||||
if (Hacks.isGalaxyS()) {
|
if (Hacks.isGalaxySOrTab()) {
|
||||||
Log.d(tag, "Hack Galaxy S : has 2 cameras front=2; rear=1");
|
Log.d(tag, "Hack Galaxy S : has 2 cameras front=2; rear=1");
|
||||||
frontCameraId[0] = 2;
|
frontCameraId[0] = 2;
|
||||||
rearCameraId[0] = 1;
|
rearCameraId[0] = 1;
|
||||||
|
@ -41,7 +41,7 @@ class AndroidCameraConf {
|
||||||
public int getNumberOfCameras() {
|
public int getNumberOfCameras() {
|
||||||
Log.i(tag, "Detecting the number of cameras");
|
Log.i(tag, "Detecting the number of cameras");
|
||||||
// Use hacks to guess the number of cameras
|
// Use hacks to guess the number of cameras
|
||||||
if (Hacks.isGalaxyS()) {
|
if (Hacks.isGalaxySOrTab()) {
|
||||||
Log.d(tag, "Hack Galaxy S : has 2 cameras");
|
Log.d(tag, "Hack Galaxy S : has 2 cameras");
|
||||||
return 2;
|
return 2;
|
||||||
} else
|
} else
|
||||||
|
@ -52,7 +52,7 @@ class AndroidCameraConf {
|
||||||
|
|
||||||
public int getCameraOrientation(int cameraId) {
|
public int getCameraOrientation(int cameraId) {
|
||||||
// Use hacks to guess orientation of the camera
|
// Use hacks to guess orientation of the camera
|
||||||
if (cameraId == 2 && Hacks.isGalaxyS()) {
|
if (cameraId == 2 && Hacks.isGalaxySOrTab()) {
|
||||||
Log.d(tag, "Hack Galaxy S : rear camera id=2 ; mounted landscape");
|
Log.d(tag, "Hack Galaxy S : rear camera id=2 ; mounted landscape");
|
||||||
// mounted in landscape for a portrait phone orientation
|
// mounted in landscape for a portrait phone orientation
|
||||||
return 90;
|
return 90;
|
||||||
|
@ -65,7 +65,7 @@ class AndroidCameraConf {
|
||||||
|
|
||||||
public boolean isFrontCamera(int cameraId) {
|
public boolean isFrontCamera(int cameraId) {
|
||||||
// Use hacks to guess facing of the camera
|
// Use hacks to guess facing of the camera
|
||||||
if (cameraId == 2 && Hacks.isGalaxyS()) {
|
if (cameraId == 2 && Hacks.isGalaxySOrTab()) {
|
||||||
Log.d(tag, "Hack Galaxy S : front camera has id=2");
|
Log.d(tag, "Hack Galaxy S : front camera has id=2");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue