Improve Galaxy S support. Add hack preferences.

- Switching to earpiece/speaker shouldn't mute the mic anymore
- Enable hidden audio hacks by removing "android:layout="@layout/hidden"
  from "pref_audio_hacks_title" PreferenceScreen.
This commit is contained in:
Guillaume Beraudo 2011-04-20 15:41:52 +02:00
parent 4404fea296
commit a66eb9aee5
2 changed files with 26 additions and 5 deletions

View file

@ -30,9 +30,6 @@ public final class Hacks {
return isGT9000() || isSC02B();
}
public static boolean needGalaxySAudioHack() {
return isGalaxySOrTab();
}
public static boolean isGalaxySOrTabWithFrontCamera() {
return isGalaxySOrTab() && !isGalaxySOrTabWithoutFrontCamera();
@ -93,10 +90,23 @@ public final class Hacks {
//sb.append("MANUFACTURER=").append(Build.MANUFACTURER).append("\n");
sb.append("SDK=").append(Build.VERSION.SDK);
Log.d(Version.TAG, sb.toString());
Log.i(Version.TAG, sb.toString());
}
public static boolean needSoftvolume() {
return isGalaxySOrTab();
}
public static boolean needRoutingAPI() {
return Version.sdkStrictlyBelow(5) /*<donut*/;
}
public static boolean needGalaxySAudioHack() {
return isGalaxySOrTab() && !isSC02B();
}
public static boolean needPausingCallForSpeakers() {
// return false;
return isGalaxySOrTab() && !isSC02B();
}
}

View file

@ -96,7 +96,9 @@ class LinphoneCoreImpl implements LinphoneCore {
private native void setSignalingTransportPorts(long nativePtr, int udp, int tcp, int tls);
private native void enableIpv6(long nativePtr,boolean enable);
private native void adjustSoftwareVolume(long nativePtr,int db);
private native int pauseCall(long nativePtr, long callPtr);
private native int pauseAllCalls(long nativePtr);
private native int resumeCall(long nativePtr, long callPtr);
LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object userdata) throws IOException {
mListener=listener;
nativePtr = newLinphoneCore(listener,userConfig.getCanonicalPath(),factoryConfig.getCanonicalPath(),userdata);
@ -472,4 +474,13 @@ class LinphoneCoreImpl implements LinphoneCore {
adjustSoftwareVolume(nativePtr, i);
}
public synchronized boolean pauseCall(LinphoneCall call) {
return 0 == pauseCall(nativePtr, ((LinphoneCallImpl) call).nativePtr);
}
public synchronized boolean resumeCall(LinphoneCall call) {
return 0 == resumeCall(nativePtr, ((LinphoneCallImpl) call).nativePtr);
}
public synchronized boolean pauseAllCalls() {
return 0 == pauseAllCalls(nativePtr);
}
}