--- a/.hgtags Tue Dec 29 17:32:05 2009 +0100
+++ b/.hgtags Tue Dec 29 20:48:16 2009 +0100
@@ -1,2 +1,1 @@
16373c4cd73330fa568960a11a6ee7aea6886a4d sfr-release
-bccd99644eac57bb19a239697704db089dd585f7 0.1
--- a/AndroidManifest.xml Tue Dec 29 17:32:05 2009 +0100
+++ b/AndroidManifest.xml Tue Dec 29 20:48:16 2009 +0100
@@ -65,6 +65,12 @@
android:name="com.beem.project.beem.service.XmppConnectionAdapter.CONNECTION_CLOSED" />
</intent-filter>
</activity>
+ <!-- Could be interesting if we would launch beem at startup
+ <receiver android:name=".tool.BeemBroadcastReceiver" android:enabled="true">
+ <intent-filter>
+ <action android:name="android.intent.action.BOOT_COMPLETED" />
+ </intent-filter>
+ </receiver> -->
<service android:name="BeemService" android:enabled="true"
android:label="Beem Service" android:permission="com.beem.project.beem.BEEM_SERVICE">
<intent-filter>
--- a/build.xml Tue Dec 29 17:32:05 2009 +0100
+++ b/build.xml Tue Dec 29 20:48:16 2009 +0100
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="Beem" default="help">
+<project name="Beem">
<!-- The local.properties file is created and updated by the 'android' tool.
It contain the path to the SDK. It should *NOT* be checked in in Version
--- a/src/com/beem/project/beem/BeemService.java Tue Dec 29 17:32:05 2009 +0100
+++ b/src/com/beem/project/beem/BeemService.java Tue Dec 29 20:48:16 2009 +0100
@@ -40,7 +40,7 @@
Flavien Astraud, November 26, 2009
Head of the EIP Laboratory.
-*/
+ */
package com.beem.project.beem;
import org.jivesoftware.smack.ConnectionConfiguration;
@@ -220,7 +220,7 @@
Roster.setDefaultSubscriptionMode(SubscriptionMode.manual);
mJingle = new JingleService(mConnection.getAdaptee());
- mBind = new XmppFacade(mConnection, this, mJingle);
+ mBind = new XmppFacade(mConnection, mJingle);
Log.d(TAG, "ONCREATE");
}
@@ -323,8 +323,8 @@
// Chat State
pm.addExtensionProvider("active", "http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
pm
- .addExtensionProvider("composing", "http://jabber.org/protocol/chatstates",
- new ChatStateExtension.Provider());
+ .addExtensionProvider("composing", "http://jabber.org/protocol/chatstates",
+ new ChatStateExtension.Provider());
pm.addExtensionProvider("paused", "http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
pm.addExtensionProvider("inactive", "http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
pm.addExtensionProvider("gone", "http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
--- a/src/com/beem/project/beem/service/XmppFacade.java Tue Dec 29 17:32:05 2009 +0100
+++ b/src/com/beem/project/beem/service/XmppFacade.java Tue Dec 29 20:48:16 2009 +0100
@@ -49,7 +49,6 @@
import android.os.RemoteException;
-import com.beem.project.beem.BeemService;
import com.beem.project.beem.jingle.JingleService;
import com.beem.project.beem.service.aidl.IChatManager;
import com.beem.project.beem.service.aidl.IPrivacyListManager;
@@ -65,7 +64,6 @@
public class XmppFacade extends IXmppFacade.Stub {
private final XmppConnectionAdapter mConnexion;
- private final BeemService mBeemService;
private final JingleService mJingle;
/**
@@ -74,9 +72,8 @@
* @param service the service which holds the facade
* @param jingle the jingle session
*/
- public XmppFacade(final XmppConnectionAdapter connection, final BeemService service, final JingleService jingle) {
+ public XmppFacade(final XmppConnectionAdapter connection, final JingleService jingle) {
this.mConnexion = connection;
- this.mBeemService = service;
this.mJingle = jingle;
}
--- a/src/com/beem/project/beem/ui/ChangeStatus.java Tue Dec 29 17:32:05 2009 +0100
+++ b/src/com/beem/project/beem/ui/ChangeStatus.java Tue Dec 29 20:48:16 2009 +0100
@@ -68,8 +68,8 @@
import com.beem.project.beem.R;
import com.beem.project.beem.service.aidl.IXmppFacade;
import com.beem.project.beem.utils.BeemBroadcastReceiver;
+import com.beem.project.beem.utils.BeemConnectivity;
import com.beem.project.beem.utils.Status;
-import com.beem.project.beem.utils.BeemConnectivity;
/**
* This Activity is used to change the status.
@@ -149,9 +149,12 @@
protected void onResume() {
super.onResume();
if (!BeemConnectivity.isConnected(getApplicationContext())) {
- startActivity(new Intent(this, Login.class));
+ Intent i = new Intent(this, Login.class);
+ startActivity(i);
+ finish();
}
bindService(new Intent(this, BeemService.class), mServConn, BIND_AUTO_CREATE);
+
}
/**
--- a/src/com/beem/project/beem/ui/dialogs/builders/Alias.java Tue Dec 29 17:32:05 2009 +0100
+++ b/src/com/beem/project/beem/ui/dialogs/builders/Alias.java Tue Dec 29 20:48:16 2009 +0100
@@ -1,3 +1,46 @@
+/*
+ BEEM is a videoconference application on the Android Platform.
+
+ Copyright (C) 2009 by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ This file is part of BEEM.
+
+ BEEM 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.
+
+ BEEM 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 BEEM. If not, see <http://www.gnu.org/licenses/>.
+
+ Please send bug reports with examples or suggestions to
+ contact@beem-project.com or http://dev.beem-project.com/
+
+ Epitech, hereby disclaims all copyright interest in the program "Beem"
+ written by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ Nicolas Sadirac, November 26, 2009
+ President of Epitech.
+
+ Flavien Astraud, November 26, 2009
+ Head of the EIP Laboratory.
+
+*/
package com.beem.project.beem.ui.dialogs.builders;
import android.app.AlertDialog;
@@ -28,17 +71,19 @@
* Constructor.
* @param context context activity.
*/
- public Alias(final Context context, IRoster roster, Contact contact) {
+ public Alias(final Context context, final IRoster roster, final Contact contact) {
super(context);
mRoster = roster;
mContact = contact;
LayoutInflater factory = LayoutInflater.from(context);
- final View textEntryView = factory.inflate(R.layout.contactdialogaliasdialog, null);
+ final View textEntryView = factory.inflate(
+ R.layout.contactdialogaliasdialog, null);
setTitle(mContact.getJID());
setView(textEntryView);
- mEditTextAlias = (EditText) textEntryView.findViewById(R.id.CDAliasDialogName);
+ mEditTextAlias = (EditText) textEntryView.findViewById(
+ R.id.CDAliasDialogName);
mEditTextAlias.setText(mContact.getName());
setPositiveButton(R.string.OkButton, new DialogClickListener());
setNegativeButton(R.string.CancelButton, new DialogClickListener());
@@ -55,16 +100,14 @@
public DialogClickListener() {
}
- /*
- * (non-Javadoc)
- * @see android.content.DialogInterface.OnClickListener#onClick(android.content.DialogInterface, int)
- */
+
@Override
- public void onClick(DialogInterface dialog, int which) {
+ public void onClick(final DialogInterface dialog, final int which) {
if (which == DialogInterface.BUTTON_POSITIVE) {
String name = mEditTextAlias.getText().toString();
- if (name.length() == 0)
+ if (name.length() == 0) {
name = mContact.getJID();
+ }
try {
mRoster.setContactName(mContact.getJID(), name);
} catch (RemoteException e) {
--- a/src/com/beem/project/beem/ui/dialogs/builders/CreatePrivacyList.java Tue Dec 29 17:32:05 2009 +0100
+++ b/src/com/beem/project/beem/ui/dialogs/builders/CreatePrivacyList.java Tue Dec 29 20:48:16 2009 +0100
@@ -1,3 +1,46 @@
+/*
+ BEEM is a videoconference application on the Android Platform.
+
+ Copyright (C) 2009 by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ This file is part of BEEM.
+
+ BEEM 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.
+
+ BEEM 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 BEEM. If not, see <http://www.gnu.org/licenses/>.
+
+ Please send bug reports with examples or suggestions to
+ contact@beem-project.com or http://dev.beem-project.com/
+
+ Epitech, hereby disclaims all copyright interest in the program "Beem"
+ written by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ Nicolas Sadirac, November 26, 2009
+ President of Epitech.
+
+ Flavien Astraud, November 26, 2009
+ Head of the EIP Laboratory.
+
+*/
package com.beem.project.beem.ui.dialogs.builders;
import java.util.ArrayList;
@@ -31,19 +74,23 @@
* Constructor.
* @param context context activity.
*/
- public CreatePrivacyList(final Context context, IPrivacyListManager privacyListManager) {
+ public CreatePrivacyList(final Context context,
+ final IPrivacyListManager privacyListManager) {
super(context);
LayoutInflater factory = LayoutInflater.from(context);
-
- mTextEntryView = factory.inflate(R.layout.privacy_list_create_dialog, null);
+
+ mTextEntryView = factory.inflate(
+ R.layout.privacy_list_create_dialog, null);
setView(mTextEntryView);
-
+
mPrivacyListManager = privacyListManager;
- mListNameField = (EditText) mTextEntryView.findViewById(R.id.privacy_list_create_dialog_list_name);
-
+ mListNameField = (EditText) mTextEntryView.findViewById(
+ R.id.privacy_list_create_dialog_list_name);
+
setTitle(R.string.privacy_list_create_dialog_title);
- setPositiveButton(R.string.privacy_list_create_dialog_create_button, new DialogClickListener());
+ setPositiveButton(R.string.privacy_list_create_dialog_create_button,
+ new DialogClickListener());
setNegativeButton(R.string.CancelButton, new DialogClickListener());
}
@@ -58,12 +105,8 @@
public DialogClickListener() {
}
- /*
- * (non-Javadoc)
- * @see android.content.DialogInterface.OnClickListener#onClick(android.content.DialogInterface, int)
- */
@Override
- public void onClick(DialogInterface dialog, int which) {
+ public void onClick(final DialogInterface dialog, final int which) {
if (which == DialogInterface.BUTTON_POSITIVE) {
try {
Log.d(TAG, "mPrivacyListManager ## " + mPrivacyListManager);
--- a/src/com/beem/project/beem/ui/dialogs/builders/DeleteContact.java Tue Dec 29 17:32:05 2009 +0100
+++ b/src/com/beem/project/beem/ui/dialogs/builders/DeleteContact.java Tue Dec 29 20:48:16 2009 +0100
@@ -1,3 +1,46 @@
+/*
+ BEEM is a videoconference application on the Android Platform.
+
+ Copyright (C) 2009 by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ This file is part of BEEM.
+
+ BEEM 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.
+
+ BEEM 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 BEEM. If not, see <http://www.gnu.org/licenses/>.
+
+ Please send bug reports with examples or suggestions to
+ contact@beem-project.com or http://dev.beem-project.com/
+
+ Epitech, hereby disclaims all copyright interest in the program "Beem"
+ written by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ Nicolas Sadirac, November 26, 2009
+ President of Epitech.
+
+ Flavien Astraud, November 26, 2009
+ Head of the EIP Laboratory.
+
+*/
package com.beem.project.beem.ui.dialogs.builders;
import android.app.AlertDialog;
@@ -21,7 +64,8 @@
* Constructor.
* @param context context activity.
*/
- public DeleteContact(final Context context, IRoster roster, Contact contact) {
+ public DeleteContact(final Context context, final IRoster roster,
+ final Contact contact) {
super(context);
mContact = contact;
@@ -45,7 +89,7 @@
}
@Override
- public void onClick(DialogInterface dialog, int which) {
+ public void onClick(final DialogInterface dialog, final int which) {
if (which == DialogInterface.BUTTON_POSITIVE) {
try {
mRoster.deleteContact(mContact);
--- a/src/com/beem/project/beem/ui/dialogs/builders/DeletePrivacyList.java Tue Dec 29 17:32:05 2009 +0100
+++ b/src/com/beem/project/beem/ui/dialogs/builders/DeletePrivacyList.java Tue Dec 29 20:48:16 2009 +0100
@@ -1,3 +1,46 @@
+/*
+ BEEM is a videoconference application on the Android Platform.
+
+ Copyright (C) 2009 by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ This file is part of BEEM.
+
+ BEEM 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.
+
+ BEEM 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 BEEM. If not, see <http://www.gnu.org/licenses/>.
+
+ Please send bug reports with examples or suggestions to
+ contact@beem-project.com or http://dev.beem-project.com/
+
+ Epitech, hereby disclaims all copyright interest in the program "Beem"
+ written by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ Nicolas Sadirac, November 26, 2009
+ President of Epitech.
+
+ Flavien Astraud, November 26, 2009
+ Head of the EIP Laboratory.
+
+*/
package com.beem.project.beem.ui.dialogs.builders;
import android.app.AlertDialog;
@@ -20,13 +63,15 @@
* Constructor.
* @param context context activity.
*/
- public DeletePrivacyList(final Context context, IPrivacyListManager privacyListManager, String privacyListName) {
+ public DeletePrivacyList(final Context context,
+ final IPrivacyListManager privacyListManager, final String privacyListName) {
super(context);
mPrivacyListManager = privacyListManager;
mPrivacyListName = privacyListName;
- setMessage(context.getString(R.string.privacy_list_delete_dialog_msg, privacyListName));
+ setMessage(context.getString(
+ R.string.privacy_list_delete_dialog_msg, privacyListName));
DialogClickListener dl = new DialogClickListener();
setPositiveButton(R.string.privacy_list_delete_dialog_yes, dl);
setNegativeButton(R.string.privacy_list_delete_dialog_no, dl);
@@ -44,7 +89,7 @@
}
@Override
- public void onClick(DialogInterface dialog, int which) {
+ public void onClick(final DialogInterface dialog, final int which) {
if (which == DialogInterface.BUTTON_POSITIVE) {
try {
mPrivacyListManager.removePrivacyList(mPrivacyListName);
--- a/src/com/beem/project/beem/ui/dialogs/builders/ResendSubscription.java Tue Dec 29 17:32:05 2009 +0100
+++ b/src/com/beem/project/beem/ui/dialogs/builders/ResendSubscription.java Tue Dec 29 20:48:16 2009 +0100
@@ -1,3 +1,46 @@
+/*
+ BEEM is a videoconference application on the Android Platform.
+
+ Copyright (C) 2009 by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ This file is part of BEEM.
+
+ BEEM 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.
+
+ BEEM 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 BEEM. If not, see <http://www.gnu.org/licenses/>.
+
+ Please send bug reports with examples or suggestions to
+ contact@beem-project.com or http://dev.beem-project.com/
+
+ Epitech, hereby disclaims all copyright interest in the program "Beem"
+ written by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ Nicolas Sadirac, November 26, 2009
+ President of Epitech.
+
+ Flavien Astraud, November 26, 2009
+ Head of the EIP Laboratory.
+
+*/
package com.beem.project.beem.ui.dialogs.builders;
import org.jivesoftware.smack.packet.Presence;
@@ -26,7 +69,8 @@
* Constructor.
* @param context context activity
*/
- public ResendSubscription(final Context context, IXmppFacade xmppFacade, Contact contact) {
+ public ResendSubscription(final Context context,
+ final IXmppFacade xmppFacade, final Contact contact) {
super(context);
mContext = context;
@@ -50,18 +94,16 @@
DialogClickListener() {
}
- /*
- * (non-Javadoc)
- * @see android.content.DialogInterface.OnClickListener#onClick(android.content.DialogInterface, int)
- */
@Override
- public void onClick(DialogInterface dialog, int which) {
+ public void onClick(final DialogInterface dialog, final int which) {
if (which == DialogInterface.BUTTON_POSITIVE) {
Presence presencePacket = new Presence(Presence.Type.subscribe);
presencePacket.setTo(mContact.getJID());
try {
- mXmppFacade.sendPresencePacket(new PresenceAdapter(presencePacket));
- Toast.makeText(mContext, mContext.getString(R.string.userinfo_resend), Toast.LENGTH_SHORT).show();
+ mXmppFacade.sendPresencePacket(
+ new PresenceAdapter(presencePacket));
+ Toast.makeText(mContext, mContext.getString(
+ R.string.userinfo_resend), Toast.LENGTH_SHORT).show();
} catch (RemoteException e) {
Log.e(TAG, e.getMessage());
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/ui/dialogs/builders/package-info.java Tue Dec 29 20:48:16 2009 +0100
@@ -0,0 +1,48 @@
+/*
+ BEEM is a videoconference application on the Android Platform.
+
+ Copyright (C) 2009 by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ This file is part of BEEM.
+
+ BEEM 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.
+
+ BEEM 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 BEEM. If not, see <http://www.gnu.org/licenses/>.
+
+ Please send bug reports with examples or suggestions to
+ contact@beem-project.com or http://dev.beem-project.com/
+
+ Epitech, hereby disclaims all copyright interest in the program "Beem"
+ written by Frederic-Charles Barthelery,
+ Jean-Manuel Da Silva,
+ Nikita Kozlov,
+ Philippe Lago,
+ Jean Baptiste Vergely,
+ Vincent Veronis.
+
+ Nicolas Sadirac, November 26, 2009
+ President of Epitech.
+
+ Flavien Astraud, November 26, 2009
+ Head of the EIP Laboratory.
+
+*/
+/**
+ * This package contains Beem dialog builder's.
+ */
+package com.beem.project.beem.ui.dialogs.builders;
+
--- a/src/com/beem/project/beem/utils/BeemBroadcastReceiver.java Tue Dec 29 17:32:05 2009 +0100
+++ b/src/com/beem/project/beem/utils/BeemBroadcastReceiver.java Tue Dec 29 20:48:16 2009 +0100
@@ -40,7 +40,7 @@
Flavien Astraud, November 26, 2009
Head of the EIP Laboratory.
-*/
+ */
package com.beem.project.beem.utils;
import android.app.Activity;
@@ -48,7 +48,6 @@
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
-import android.util.Log;
import android.widget.Toast;
import com.beem.project.beem.BeemService;
@@ -72,13 +71,9 @@
* {@inheritDoc}
*/
@Override
- public void onReceive(Context context, Intent intent) {
- Log.d("Broadcast", "onReceive");
- // TODO ce code est comment car il empeche de gerer un cancel sur une connexion
- // start activity if unexpected disconnection
- // if (!intent.getBooleanExtra("normally", false))
- // context.startActivity(new Intent(context, Login.class));
- if (intent.getAction().equals(BEEM_CONNECTION_CLOSED)) {
+ public void onReceive(final Context context, final Intent intent) {
+ String intentAction = intent.getAction();
+ if (intentAction.equals(BEEM_CONNECTION_CLOSED)) {
CharSequence message = intent.getCharSequenceExtra("message");
Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
if (context instanceof Activity) {
@@ -86,9 +81,8 @@
act.finish();
// The service will be unbinded in the destroy of the activity.
}
- } else if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
+ } else if (intentAction.equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
if (intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, false)) {
- Log.d("Broadcast", "stopService");
context.stopService(new Intent(context, BeemService.class));
}
}
--- a/src/com/beem/project/beem/utils/BeemConnectivity.java Tue Dec 29 17:32:05 2009 +0100
+++ b/src/com/beem/project/beem/utils/BeemConnectivity.java Tue Dec 29 20:48:16 2009 +0100
@@ -40,7 +40,7 @@
Flavien Astraud, November 26, 2009
Head of the EIP Laboratory.
-*/
+ */
package com.beem.project.beem.utils;
import android.content.Context;
@@ -66,8 +66,9 @@
* @param ctx the ctx
* @return true, if is connected
*/
- public static boolean isConnected(Context ctx) {
- ConnectivityManager cm = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
+ public static boolean isConnected(final Context ctx) {
+ ConnectivityManager cm = (ConnectivityManager) ctx.getSystemService(
+ Context.CONNECTIVITY_SERVICE);
NetworkInfo ni = cm.getActiveNetworkInfo();
return ni != null && ni.isConnected();
}
@@ -77,14 +78,15 @@
* @param ctx the ctx
* @return true, if is wifi
*/
- public static boolean isWifi(Context ctx) {
- WifiManager wm = (WifiManager) ctx.getSystemService(Context.WIFI_SERVICE);
+ public static boolean isWifi(final Context ctx) {
+ WifiManager wm = (WifiManager) ctx.getSystemService(
+ Context.WIFI_SERVICE);
WifiInfo wi = wm.getConnectionInfo();
- if (wi != null)
- return false;
if (wi != null
- && (WifiInfo.getDetailedStateOf(wi.getSupplicantState()) == DetailedState.OBTAINING_IPADDR || WifiInfo
- .getDetailedStateOf(wi.getSupplicantState()) == DetailedState.CONNECTED)) {
+ && (WifiInfo.getDetailedStateOf(wi.getSupplicantState())
+ == DetailedState.OBTAINING_IPADDR
+ || WifiInfo.getDetailedStateOf(wi.getSupplicantState())
+ == DetailedState.CONNECTED)) {
return false;
}
return false;
@@ -95,11 +97,10 @@
* @param ctx the ctx
* @return true, if is umts
*/
- public static boolean isUmts(Context ctx) {
- TelephonyManager tm = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);
- if (tm.getNetworkType() >= TelephonyManager.NETWORK_TYPE_UMTS)
- return true;
- return false;
+ public static boolean isUmts(final Context ctx) {
+ TelephonyManager tm = (TelephonyManager) ctx.getSystemService(
+ Context.TELEPHONY_SERVICE);
+ return tm.getNetworkType() >= TelephonyManager.NETWORK_TYPE_UMTS;
}
/**
@@ -107,11 +108,10 @@
* @param ctx the ctx
* @return true, if is edge
*/
- public static boolean isEdge(Context ctx) {
- TelephonyManager tm = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);
- if (tm.getNetworkType() == TelephonyManager.NETWORK_TYPE_EDGE)
- return true;
- return false;
+ public static boolean isEdge(final Context ctx) {
+ TelephonyManager tm = (TelephonyManager) ctx.getSystemService(
+ Context.TELEPHONY_SERVICE);
+ return tm.getNetworkType() == TelephonyManager.NETWORK_TYPE_EDGE;
}
}
--- a/src/com/beem/project/beem/utils/PresenceType.java Tue Dec 29 17:32:05 2009 +0100
+++ b/src/com/beem/project/beem/utils/PresenceType.java Tue Dec 29 20:48:16 2009 +0100
@@ -84,7 +84,7 @@
* @param presence the presence type
* @return an int representing the presence type
*/
- public static int getPresenceType(Presence presence) {
+ public static int getPresenceType(final Presence presence) {
int res = PresenceType.ERROR;
switch (presence.getType()) {
case available:
@@ -117,7 +117,7 @@
* @param type the status type in beem
* @return the presence mode to use in presence packet or null if there is no mode to use
*/
- public static Presence.Type getPresenceTypeFrom(int type) {
+ public static Presence.Type getPresenceTypeFrom(final int type) {
Presence.Type res;
switch (type) {
case AVAILABLE:
--- a/src/com/beem/project/beem/utils/Status.java Tue Dec 29 17:32:05 2009 +0100
+++ b/src/com/beem/project/beem/utils/Status.java Tue Dec 29 20:48:16 2009 +0100
@@ -81,7 +81,7 @@
* @param status the status in beem
* @return the presence mode to use in presence packet or null if there is no mode to use
*/
- public static Presence.Mode getPresenceModeFromStatus(int status) {
+ public static Presence.Mode getPresenceModeFromStatus(final int status) {
Presence.Mode res;
switch (status) {
case CONTACT_STATUS_AVAILABLE:
@@ -110,7 +110,7 @@
* @param presence the presence containing status
* @return an int representing the status
*/
- public static int getStatusFromPresence(Presence presence) {
+ public static int getStatusFromPresence(final Presence presence) {
int res = Status.CONTACT_STATUS_DISCONNECT;
if (presence.getType().equals(Presence.Type.unavailable)) {
res = Status.CONTACT_STATUS_DISCONNECT;
@@ -149,7 +149,7 @@
* @param status contact status
* @return is obline
*/
- public static boolean statusOnline(int status) {
+ public static boolean statusOnline(final int status) {
return status != Status.CONTACT_STATUS_DISCONNECT && status != Status.CONTACT_STATUS_UNAVAILABLE;
}