Use ShareMyCamera settings when video call

This commit is contained in:
Sylvain Berfini 2012-03-14 10:35:52 +01:00
parent 9991f9b249
commit b726a7b0c8
3 changed files with 17 additions and 3 deletions

View file

@ -115,6 +115,7 @@ public class IncallActivity extends AbstractCalleesActivity implements
}
setContentView(R.layout.incall_layout);
instance = this;
LinphoneManager.getInstance().setVideoInitiator(false);
mAllowTransfers = getResources().getBoolean(R.bool.allow_transfers);
@ -217,7 +218,6 @@ public class IncallActivity extends AbstractCalleesActivity implements
}
@Override
//FIXME : Store texts into resources
protected Dialog onCreateDialog(final int id) {
switch (id) {
case promptVideoId:

View file

@ -136,6 +136,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
private String lastLcStatusMessage;
private String basePath;
private static boolean sExited;
private boolean videoInitiator = false;
private WakeLock mIncallWakeLock;
@ -149,6 +150,14 @@ public final class LinphoneManager implements LinphoneCoreListener {
simpleListeners.remove(listener);
}
public boolean isVideoInitiator() {
return videoInitiator;
}
public void setVideoInitiator(boolean b) {
videoInitiator = b;
}
private LinphoneManager(final Context c, LinphoneServiceListener listener) {
sExited=false;
@ -1155,6 +1164,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
public boolean addVideo() {
LinphoneCall call = mLc.getCurrentCall();
enableCamera(call, true);
setVideoInitiator(true);
return reinviteWithVideo();
}

View file

@ -109,10 +109,14 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
videoCall = LinphoneManager.getLc().getCurrentCall();
if (videoCall != null) {
LinphoneManager lm = LinphoneManager.getInstance();
if (!lm.shareMyCamera() && !lm.isVideoInitiator() && videoCall.cameraEnabled()) {
lm.sendStaticImage(true);
}
updatePreview(videoCall.cameraEnabled());
}
PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK|PowerManager.ON_AFTER_RELEASE,Log.TAG);
mWakeLock.acquire();