--- a/AndroidManifest.xml Fri Jan 15 12:02:29 2010 +0100
+++ b/AndroidManifest.xml Sat Jan 16 21:05:08 2010 +0100
@@ -14,6 +14,7 @@
</activity>
<activity android:name=".ui.LoginAnim" android:label="@string/login_login_progress"
android:launchMode="singleTop" />
+ <activity android:name=".ui.CallScreen" android:label="@string/call_screen" />
<activity android:name=".ui.Settings" android:label="@string/edit_settings_name">
<intent-filter android:label="Beem Connection">
<action
--- a/jni/Application.mk Fri Jan 15 12:02:29 2010 +0100
+++ b/jni/Application.mk Sat Jan 16 21:05:08 2010 +0100
@@ -1,3 +1,3 @@
-APP_PROJECT_PATH := /home/nikita/devel/beem/
+APP_PROJECT_PATH := /home/nikita/devel/beem/beem-audio/
APP_BUILD_SCRIPT := ${APP_PROJECT_PATH}/jni/Android.mk
APP_MODULES := gsm g722 OSNetworkSystem
Binary file libs/armeabi/libOSNetworkSystem.so has changed
Binary file libs/armeabi/libg722.so has changed
Binary file libs/armeabi/libgsm.so has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/layout/incall.xml Sat Jan 16 21:05:08 2010 +0100
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<AbsoluteLayout
+android:id="@+id/top_lvl_layout"
+android:layout_width="fill_parent"
+android:layout_height="fill_parent"
+android:background="#000000"
+xmlns:android="http://schemas.android.com/apk/res/android"
+>
+
+ <FrameLayout android:id="@+id/mainFrame"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:paddingTop="10dip"
+ android:paddingLeft="6dip"
+ android:paddingRight="6dip"
+ >
+
+ <!-- (1) inCallPanel: the main set of in-call UI elements -->
+ <RelativeLayout android:id="@+id/inCallPanel"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
+ <!-- Slide hints: if the "sliding card" feature is enabled,
+ one or the other of these is visible at any given moment
+ (see updateCardSlideHints()). -->
+
+ <!-- Slide hint and arrow *above* the main body of the card,
+ shown when the card is in the *bottom* position. -->
+ <!-- This hint's position onscreen is static: the Y value is set
+ so that the hint will be visible just above the top edge of
+ the CallCard when the CallCard is in the "bottom" position.
+ The resources here describe the portrait mode layout; see
+ InCallScreen.ConfigurationHelper.applyConfigurationToLayout()
+ for the differences in landscape mode. -->
+ <LinearLayout android:id="@+id/slideUp"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:background="@null"
+ android:visibility="gone"
+ >
+ <TextView android:id="@+id/slideUpHint"
+ android:layout_gravity="center_horizontal"
+ android:gravity="center_horizontal"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="?android:attr/textColorSecondary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ />
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:src="@android:drawable/arrow_up_float"
+ />
+ </LinearLayout>
+
+ <!-- Slide hint and arrow *below* the main body of the card,
+ shown when the card is in the *top* position. -->
+ <!-- This hint's position onscreen is static: the Y value is set
+ so that the hint will be visible just below the bottom edge of
+ the CallCard when the CallCard is in the "top" position.
+ The resources here describe the portrait mode layout; see
+ InCallScreen.ConfigurationHelper.applyConfigurationToLayout()
+ for the differences in landscape mode. -->
+ <LinearLayout android:id="@+id/slideDown"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:background="@null"
+ android:visibility="gone"
+ >
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:src="@android:drawable/arrow_down_float"
+ />
+ <TextView
+ android:id="@+id/slideDownHint"
+ android:layout_gravity="center_horizontal"
+ android:gravity="center_horizontal"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="?android:attr/textColorSecondary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ />
+ <TextView
+ android:id="@+id/stats"
+ android:layout_gravity="center_horizontal"
+ android:gravity="center_horizontal"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="?android:attr/textColorSecondary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ />
+ </LinearLayout>
+
+ </RelativeLayout> <!-- End of inCallPanel -->
+
+ </FrameLayout> <!-- End of mainFrame -->
+</AbsoluteLayout>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/layout/ongoing_call_notification.xml Sat Jan 16 21:05:08 2010 +0100
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- Layout file for the custom "expanded view" used by the ongoing call
+ Notification; see NotificationMgr.updateInCallNotification(). -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:baselineAligned="false"
+ android:gravity="center_vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="65sp"
+ android:background="@android:drawable/status_bar_item_background"
+ >
+
+ <ImageView android:id="@+id/icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingLeft="4dip"
+ android:layout_marginRight="6dip" />
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ >
+ <!-- The appearance of these 2 lines of text matches the other
+ kinds of notifications (see status_bar_latest_event.xml).
+ TODO: There should probably be common styles for these, though. -->
+ <Chronometer android:id="@+id/text1"
+ android:textStyle="bold"
+ android:textSize="18sp"
+ android:textColor="#ff000000"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ />
+ <TextView android:id="@+id/text2"
+ android:textSize="14sp"
+ android:textColor="#ff000000"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:text="@string/app_name"
+ />
+ </LinearLayout>
+</LinearLayout>
--- a/res/menu/contactlist_context.xml Fri Jan 15 12:02:29 2010 +0100
+++ b/res/menu/contactlist_context.xml Sat Jan 16 21:05:08 2010 +0100
@@ -2,7 +2,7 @@
<item android:id="@+id/contact_list_context_menu_chat_item"
android:title="@string/CDChat" />
<item android:id="@+id/contact_list_context_menu_call_item"
- android:title="@string/CDCall" android:visible="false" />
+ android:title="@string/CDCall" android:visible="true" />
<item android:id="@+id/contact_list_context_menu_user_info"
android:title="@string/CDInfos">
<menu>
--- a/res/values-fr/strings.xml Fri Jan 15 12:02:29 2010 +0100
+++ b/res/values-fr/strings.xml Sat Jan 16 21:05:08 2010 +0100
@@ -140,6 +140,7 @@
<string name="contact_list_name">Beem - Contacts</string>
<string name="contact_list_tag">Beem - ContactList Activity</string>
<string name="user_info_name">Beem - Informations</string>
+ <string name="call_screen">Beem - Appel</string>
<!--
Buttons
--- a/res/values/strings.xml Fri Jan 15 12:02:29 2010 +0100
+++ b/res/values/strings.xml Sat Jan 16 21:05:08 2010 +0100
@@ -134,6 +134,7 @@
<string name="contact_list_name">Beem - Contacts</string>
<string name="contact_list_tag">Beem - ContactList Activity</string>
<string name="user_info_name">Beem - User Info</string>
+ <string name="call_screen">Beem - Call Screen</string>
<!-- Buttons -->
<string name="button_reset">Reset</string>
--- a/src/com/beem/project/beem/jingle/JingleService.java Fri Jan 15 12:02:29 2010 +0100
+++ b/src/com/beem/project/beem/jingle/JingleService.java Sat Jan 16 21:05:08 2010 +0100
@@ -61,6 +61,9 @@
import android.content.Context;
import android.util.Log;
+import android.content.Intent;
+
+import com.beem.project.beem.ui.CallScreen;
// TODO: Auto-generated Javadoc
/**
@@ -73,6 +76,7 @@
private final List<JingleMediaManager> mMediaManagers;
private JingleSession mIn;
private JingleSession mOut;
+ private Context mContext;
/**
* JingleService constructor.
@@ -82,7 +86,8 @@
BasicTransportManager bt = new BasicTransportManager();
mMediaManagers = new ArrayList<JingleMediaManager>();
mMediaManagers.add(new MicrophoneRTPManager(bt, ctx));
- //CodecManager.load();
+ CodecManager.load();
+ mContext = ctx;
}
/**
@@ -203,7 +208,9 @@
public void sessionEstablished(final PayloadType pt, final TransportCandidate remoteCandidate,
final TransportCandidate localCandidate, final JingleSession jingleSession) {
Log.d(TAG, "Session " + jingleSession.getResponder() + "established");
-
+ Intent callIntent = new Intent(mContext, CallScreen.class);
+ callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ mContext.startActivity(callIntent);
//call(pt, remoteCandidate, localCandidate, jingleSession);
}
--- a/src/com/beem/project/beem/jingle/MicrophoneRTPManager.java Fri Jan 15 12:02:29 2010 +0100
+++ b/src/com/beem/project/beem/jingle/MicrophoneRTPManager.java Sat Jan 16 21:05:08 2010 +0100
@@ -110,7 +110,7 @@
private void setupPayloads() {
mPayloads = new ArrayList<PayloadType>();
mPayloads.add(new PayloadType.Audio(8, "PCMA"));
- mPayloads.add(new PayloadType.Audio(9, "G722"));
- mPayloads.add(new PayloadType.Audio(3, "GSM"));
+// mPayloads.add(new PayloadType.Audio(9, "G722"));
+// mPayloads.add(new PayloadType.Audio(3, "GSM"));
}
}
--- a/src/com/beem/project/beem/jingle/RTPAudioSession.java Fri Jan 15 12:02:29 2010 +0100
+++ b/src/com/beem/project/beem/jingle/RTPAudioSession.java Sat Jan 16 21:05:08 2010 +0100
@@ -39,7 +39,8 @@
final TransportCandidate local, final String mediaLocator, final JingleSession jingleSession, Context ctx) {
super(pt, remote, local, mediaLocator, jingleSession);
- prepareRtpSession(local.getPort(), local.getIp(), remote.getPort());
+ prepareRtpSession(local.getPort(), remote.getIp(), remote.getPort());
+ Log.d("AUDIO", String.format("payload type : %s ipdest %s port dest %d port src %d",pt.getName(), remote.getIp(), remote.getPort(), local.getPort()));
mSender = new RtpStreamSender(CodecManager.getCodecByRtpName(pt.getName()), rtpSession);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/ui/CallScreen.java Sat Jan 16 21:05:08 2010 +0100
@@ -0,0 +1,169 @@
+package com.beem.project.beem.ui;
+
+import org.sipdroid.media.RtpStreamReceiver;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.KeyguardManager;
+import android.content.ActivityNotFoundException;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.media.AudioManager;
+import android.os.Bundle;
+import android.os.SystemClock;
+import android.text.InputType;
+import android.util.Log;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.widget.EditText;
+
+import com.beem.project.beem.R;
+
+/*
+ * Copyright (C) 2009 The Sipdroid Open Source Project
+ *
+ * This file is part of Sipdroid (http://www.sipdroid.org)
+ *
+ * Sipdroid is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This source code is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this source code; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+public class CallScreen extends Activity implements DialogInterface.OnClickListener {
+ public static final int FIRST_MENU_ID = Menu.FIRST;
+ public static final int HANG_UP_MENU_ITEM = FIRST_MENU_ID + 1;
+ public static final int HOLD_MENU_ITEM = FIRST_MENU_ID + 2;
+ public static final int MUTE_MENU_ITEM = FIRST_MENU_ID + 3;
+ public static final int VIDEO_MENU_ITEM = FIRST_MENU_ID + 5;
+ public static final int SPEAKER_MENU_ITEM = FIRST_MENU_ID + 6;
+ public static final int TRANSFER_MENU_ITEM = FIRST_MENU_ID + 7;
+
+ private static EditText transferText;
+
+ @Override
+ public void onCreate(Bundle savedInstance){
+ super.onCreate(savedInstance);
+ setContentView(R.layout.incall);
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ boolean result = super.onCreateOptionsMenu(menu);
+
+ MenuItem m = menu.add(0, HOLD_MENU_ITEM, 0, "R.string.menu_hold");
+ m.setIcon(android.R.drawable.stat_sys_phone_call_on_hold);
+ m = menu.add(0, SPEAKER_MENU_ITEM, 0, "R.string.menu_speaker");
+ m.setIcon(android.R.drawable.stat_sys_speakerphone);
+ m = menu.add(0, MUTE_MENU_ITEM, 0, "R.string.menu_mute");
+ m.setIcon(android.R.drawable.stat_notify_call_mute);
+ m = menu.add(0, TRANSFER_MENU_ITEM, 0, "R.string.menu_transfer");
+ m.setIcon(android.R.drawable.ic_menu_call);
+ m = menu.add(0, VIDEO_MENU_ITEM, 0, "R.string.menu_video");
+ m.setIcon(android.R.drawable.ic_menu_camera);
+ m = menu.add(0, HANG_UP_MENU_ITEM, 0, "R.string.menu_endCall");
+// m.setIcon(android.R.drawable.stat_notify_call_end);
+
+ return result;
+ }
+
+ public void onClick(DialogInterface dialog, int which)
+ {
+ /* if (which == DialogInterface.BUTTON_POSITIVE)
+ Receiver.engine(this).transfer(transferText.getText().toString());*/
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ boolean result = super.onOptionsItemSelected(item);
+ Intent intent = null;
+
+ switch (item.getItemId()) {
+ case HANG_UP_MENU_ITEM:
+ // Receiver.engine(this).rejectcall();
+ break;
+
+ case HOLD_MENU_ITEM:
+ //Receiver.engine(this).togglehold();
+ break;
+
+ case TRANSFER_MENU_ITEM:
+ //transfer();
+ break;
+
+ case MUTE_MENU_ITEM:
+ //Receiver.engine(this).togglemute();
+ break;
+
+ case SPEAKER_MENU_ITEM:
+ //Receiver.engine(this).speaker(RtpStreamReceiver.speakermode == AudioManager.MODE_NORMAL?
+ // AudioManager.MODE_IN_CALL:AudioManager.MODE_NORMAL);
+ break;
+
+ case VIDEO_MENU_ITEM:
+ /*if (Receiver.call_state == UserAgent.UA_STATE_HOLD) Receiver.engine(this).togglehold();
+ try {
+ intent = new Intent(this, org.sipdroid.sipua.ui.VideoCamera.class);
+ startActivity(intent);
+ } catch (ActivityNotFoundException e) {
+ }*/
+ break;
+ }
+
+ return result;
+ }
+
+/* long enabletime;
+ KeyguardManager mKeyguardManager;
+ KeyguardManager.KeyguardLock mKeyguardLock;
+ boolean enabled;
+
+ void disableKeyguard() {
+ if (enabled) {
+ mKeyguardLock.disableKeyguard();
+ enabled = false;
+ enabletime = SystemClock.elapsedRealtime();
+ }
+ }
+
+ void reenableKeyguard() {
+ if (!enabled) {
+ if (SystemClock.elapsedRealtime() < enabletime + 500)
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ }
+ mKeyguardLock.reenableKeyguard();
+ enabled = true;
+ }
+ }
+
+ @Override
+ public void onStart() {
+ super.onStart();
+ if (mKeyguardManager == null) {
+ mKeyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
+ mKeyguardLock = mKeyguardManager.newKeyguardLock("Sipdroid");
+ enabled = true;
+ }
+ disableKeyguard();
+ }
+
+ @Override
+ public void onStop() {
+ super.onStop();
+ reenableKeyguard();
+ }
+ */
+
+}
--- a/src/com/beem/project/beem/ui/ContactList.java Fri Jan 15 12:02:29 2010 +0100
+++ b/src/com/beem/project/beem/ui/ContactList.java Sat Jan 16 21:05:08 2010 +0100
@@ -200,7 +200,7 @@
break;
case R.id.contact_list_context_menu_call_item:
try {
- mXmppFacade.call(mContact.getJID() + "/psi");
+ mXmppFacade.call(mContact.getJID() + "/Beem");
result = true;
} catch (RemoteException e) {
e.printStackTrace();
--- a/src/jlibrtp/RTPSession.java Fri Jan 15 12:02:29 2010 +0100
+++ b/src/jlibrtp/RTPSession.java Sat Jan 16 21:05:08 2010 +0100
@@ -560,7 +560,7 @@
try {
rtpSock.send(packet);
- Log.d("RTP", "packet");
+ //Log.d("RTP", "packet");
// Debug
if (this.debugAppIntf != null) {
this.debugAppIntf
--- a/src/org/sipdroid/media/RtpStreamReceiver.java Fri Jan 15 12:02:29 2010 +0100
+++ b/src/org/sipdroid/media/RtpStreamReceiver.java Sat Jan 16 21:05:08 2010 +0100
@@ -219,12 +219,12 @@
android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_AUDIO);
am = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
cr = mContext.getContentResolver();
- saveSettings();
+ //saveSettings();
Settings.System.putInt(cr, Settings.System.WIFI_SLEEP_POLICY,Settings.System.WIFI_SLEEP_POLICY_NEVER);
- am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER,AudioManager.VIBRATE_SETTING_OFF);
- am.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION,AudioManager.VIBRATE_SETTING_OFF);
- oldvol = am.getStreamVolume(AudioManager.STREAM_MUSIC);
+ //am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER,AudioManager.VIBRATE_SETTING_OFF);
+ //am.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION,AudioManager.VIBRATE_SETTING_OFF);
+ //oldvol = am.getStreamVolume(AudioManager.STREAM_MUSIC);
restoreVolume();
track = new AudioTrack(AudioManager.STREAM_MUSIC, sampling_rate, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT,
@@ -311,23 +311,23 @@
DataFramePool.getInstance().returnFrame(frame);
//println("headroom " + headroom + " user " + user + " server " + server + " luser " + luser + " lserver " + lserver);
if (user >= luser + sampling_rate) {
- if (am.getMode() != speakermode) {
+ /*if (am.getMode() != speakermode) {
am.setMode(speakermode);
switch (speakermode) {
case AudioManager.MODE_IN_CALL:
- /*am.setStreamVolume(AudioManager.STREAM_RING,(int)(
+ am.setStreamVolume(AudioManager.STREAM_RING,(int)(
am.getStreamMaxVolume(AudioManager.STREAM_RING)*
com.mbdsys.sfrdroid.ui.Settings.getEarGain()), 0);
track.setStereoVolume(AudioTrack.getMaxVolume()*
com.mbdsys.sfrdroid.ui.Settings.getEarGain()
,AudioTrack.getMaxVolume()*
- com.mbdsys.sfrdroid.ui.Settings.getEarGain());*/
+ com.mbdsys.sfrdroid.ui.Settings.getEarGain());
//running = false;
case AudioManager.MODE_NORMAL:
track.setStereoVolume(AudioTrack.getMaxVolume(),AudioTrack.getMaxVolume());
//running = false;
}
- }
+ }*/
luser = user;
}
lserver = server;
@@ -338,30 +338,9 @@
track.stop();
//if (Receiver.pstn_state == null || Receiver.pstn_state.equals("IDLE"))
// am.setMode(AudioManager.MODE_NORMAL);
- saveVolume();
- am.setStreamVolume(AudioManager.STREAM_MUSIC,oldvol,0);
- restoreSettings();
- ToneGenerator tg = new ToneGenerator(AudioManager.STREAM_RING,ToneGenerator.MAX_VOLUME/4*3);
- tg.startTone(ToneGenerator.TONE_PROP_PROMPT);
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- }
- tg.stopTone();
- rtpSession = null;
- track = null;
- codec.cleanDecoder(codecCtx);
- codec = null;
- println("rtp receiver terminated");
- }
-
- public void endReceiver() {
- track.stop();
- //if (Receiver.pstn_state == null || Receiver.pstn_state.equals("IDLE"))
- // am.setMode(AudioManager.MODE_NORMAL);
- saveVolume();
- am.setStreamVolume(AudioManager.STREAM_MUSIC,oldvol,0);
- restoreSettings();
+ //saveVolume();
+ //am.setStreamVolume(AudioManager.STREAM_MUSIC,oldvol,0);
+ //restoreSettings();
ToneGenerator tg = new ToneGenerator(AudioManager.STREAM_RING,ToneGenerator.MAX_VOLUME/4*3);
tg.startTone(ToneGenerator.TONE_PROP_PROMPT);
try {