diff --git a/libs/android-support-v13.jar b/libs/android-support-v13.jar index e75351a50777951e96f0c379c0cf6940e8bba122..2e31e5962de8e6c2b1a8e6995867e37fb4ac554f 100644 Binary files a/libs/android-support-v13.jar and b/libs/android-support-v13.jar differ diff --git a/src/com/savoirfairelinux/sflphone/client/AccountPreferenceActivity.java b/src/com/savoirfairelinux/sflphone/client/AccountPreferenceActivity.java index 7ff6a69b614d1bd9986af2aefa51e443bfe13440..ded776c39927b43908ab6c95c29f7ab7f765c1ef 100644 --- a/src/com/savoirfairelinux/sflphone/client/AccountPreferenceActivity.java +++ b/src/com/savoirfairelinux/sflphone/client/AccountPreferenceActivity.java @@ -54,7 +54,6 @@ import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; -import android.widget.Toast; import com.savoirfairelinux.sflphone.R; import com.savoirfairelinux.sflphone.account.AccountDetail; @@ -62,7 +61,6 @@ import com.savoirfairelinux.sflphone.account.AccountDetailAdvanced; import com.savoirfairelinux.sflphone.account.AccountDetailBasic; import com.savoirfairelinux.sflphone.account.AccountDetailSrtp; import com.savoirfairelinux.sflphone.account.AccountDetailTls; -import com.savoirfairelinux.sflphone.service.ServiceConstants; public class AccountPreferenceActivity extends PreferenceActivity { private static final String TAG = "AccoutPreferenceActivity"; @@ -243,6 +241,7 @@ public class AccountPreferenceActivity extends PreferenceActivity { } Preference.OnPreferenceChangeListener changeBasicPreferenceListener = new Preference.OnPreferenceChangeListener() { + @Override public boolean onPreferenceChange(Preference preference, Object newValue) { isDifferent = true; @@ -251,7 +250,7 @@ public class AccountPreferenceActivity extends PreferenceActivity { basicDetails.setDetailString(preference.getKey(), ((Boolean) newValue).toString()); } else { preference.setSummary((CharSequence) newValue); - Log.i(TAG, "Changing preference value:" + (CharSequence) newValue); + Log.i(TAG, "Changing preference value:" + newValue); basicDetails.setDetailString(preference.getKey(), ((CharSequence) newValue).toString()); } return true; @@ -259,6 +258,7 @@ public class AccountPreferenceActivity extends PreferenceActivity { }; Preference.OnPreferenceChangeListener changeAdvancedPreferenceListener = new Preference.OnPreferenceChangeListener() { + @Override public boolean onPreferenceChange(Preference preference, Object newValue) { preference.setSummary((CharSequence) newValue); advancedDetails.setDetailString(preference.getKey(), ((CharSequence) newValue).toString()); @@ -267,6 +267,7 @@ public class AccountPreferenceActivity extends PreferenceActivity { }; Preference.OnPreferenceChangeListener changeTlsPreferenceListener = new Preference.OnPreferenceChangeListener() { + @Override public boolean onPreferenceChange(Preference preference, Object newValue) { preference.setSummary((CharSequence) newValue); tlsDetails.setDetailString(preference.getKey(), ((CharSequence) newValue).toString()); @@ -275,6 +276,7 @@ public class AccountPreferenceActivity extends PreferenceActivity { }; Preference.OnPreferenceChangeListener changeSrtpPreferenceListener = new Preference.OnPreferenceChangeListener() { + @Override public boolean onPreferenceChange(Preference preference, Object newValue) { preference.setSummary((CharSequence) newValue); srtpDetails.setDetailString(preference.getKey(), ((CharSequence) newValue).toString()); @@ -346,6 +348,7 @@ public class AccountPreferenceActivity extends PreferenceActivity { Activity ownerActivity = this; AlertDialog.Builder builder = new AlertDialog.Builder(ownerActivity); builder.setMessage(message).setTitle("Missing Parameters").setPositiveButton("Ok", new DialogInterface.OnClickListener() { + @Override public void onClick(DialogInterface dialog, int whichButton) { /* Nothing to be done */ } @@ -359,11 +362,13 @@ public class AccountPreferenceActivity extends PreferenceActivity { Activity ownerActivity = this; AlertDialog.Builder builder = new AlertDialog.Builder(ownerActivity); builder.setMessage("Modifications will be lost").setTitle("Account Edition").setPositiveButton("Ok", new DialogInterface.OnClickListener() { + @Override public void onClick(DialogInterface dialog, int whichButton) { Activity activity = ((Dialog) dialog).getOwnerActivity(); activity.finish(); } }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override public void onClick(DialogInterface dialog, int whichButton) { /* Terminate with no action */ } @@ -379,23 +384,25 @@ public class AccountPreferenceActivity extends PreferenceActivity { Activity ownerActivity = this; AlertDialog.Builder builder = new AlertDialog.Builder(ownerActivity); builder.setMessage("Do you really want to delete this account").setTitle("Delete Account") - .setPositiveButton("Ok", new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int whichButton) { - Bundle bundle = new Bundle(); - bundle.putString("AccountID", mAccountID); + .setPositiveButton("Ok", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int whichButton) { + Bundle bundle = new Bundle(); + bundle.putString("AccountID", mAccountID); - Intent resultIntent = new Intent(); - resultIntent.putExtras(bundle); + Intent resultIntent = new Intent(); + resultIntent.putExtras(bundle); - Activity activity = ((Dialog) dialog).getOwnerActivity(); - activity.setResult(result.ACCOUNT_DELETED, resultIntent); - activity.finish(); - } - }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int whichButton) { - /* Terminate with no action */ - } - }); + Activity activity = ((Dialog) dialog).getOwnerActivity(); + activity.setResult(result.ACCOUNT_DELETED, resultIntent); + activity.finish(); + } + }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int whichButton) { + /* Terminate with no action */ + } + }); AlertDialog alertDialog = builder.create(); alertDialog.setOwnerActivity(ownerActivity); diff --git a/src/com/savoirfairelinux/sflphone/client/CallActivity.java b/src/com/savoirfairelinux/sflphone/client/CallActivity.java index a9e9dfe56686fbe7757437da2f90a2aa53ea52bf..d66fecd9e2a0bf7832fb60fd8191619d0206ab03 100644 --- a/src/com/savoirfairelinux/sflphone/client/CallActivity.java +++ b/src/com/savoirfairelinux/sflphone/client/CallActivity.java @@ -158,18 +158,13 @@ public class CallActivity extends Activity implements CallInterface, CallFragmen private Handler mHandler = new Handler(); private Runnable mUpdateTimeTask = new Runnable() { + @Override public void run() { - final long start = SystemClock.uptimeMillis(); - long millis = SystemClock.uptimeMillis() - start; - int seconds = (int) (millis / 1000); - int minutes = seconds / 60; - seconds = seconds % 60; - if(mCurrentCallFragment != null) mCurrentCallFragment.updateTime(); mCallsFragment.update(); - mHandler.postAtTime(this, start + (((minutes * 60) + seconds + 1) * 1000)); + mHandler.postAtTime(this, SystemClock.uptimeMillis() + 1000); } }; @@ -209,7 +204,7 @@ public class CallActivity extends Activity implements CallInterface, CallFragmen service = ISipService.Stub.asInterface(binder); mCurrentCallFragment = new CallFragment(); - + Uri u = getIntent().getData(); if (u != null) { CallContact c = CallContact.ContactBuilder.buildUnknownContact(u.getSchemeSpecificPart()); @@ -232,7 +227,7 @@ public class CallActivity extends Activity implements CallInterface, CallFragmen if (getIntent().getBooleanExtra("resuming", false)) { Bundle b = new Bundle(); - b.putParcelable("conference", (Conference) getIntent().getParcelableExtra("conference")); + b.putParcelable("conference", getIntent().getParcelableExtra("conference")); mCurrentCallFragment.setArguments(b); } else { diff --git a/src/com/savoirfairelinux/sflphone/client/ZoomOutPageTransformer.java b/src/com/savoirfairelinux/sflphone/client/ZoomOutPageTransformer.java index d2cd1aee8dfec9e530059b70adb929e347119059..b48844c13ac09138bdfb33dfee02c81eb42bcaee 100644 --- a/src/com/savoirfairelinux/sflphone/client/ZoomOutPageTransformer.java +++ b/src/com/savoirfairelinux/sflphone/client/ZoomOutPageTransformer.java @@ -1,9 +1,10 @@ package com.savoirfairelinux.sflphone.client; -import android.view.View; import android.support.v4.view.ViewPager; +import android.view.View; public class ZoomOutPageTransformer implements ViewPager.PageTransformer { + private static final float MIN_ALPHA = .6f; private final float scalingStart; public ZoomOutPageTransformer(float scalingStart) { @@ -15,6 +16,6 @@ public class ZoomOutPageTransformer implements ViewPager.PageTransformer { public void transformPage(View page, float position) { // page.setRotationY(position * -30); final float normalizedposition = Math.abs(Math.abs(position) - 1); - page.setAlpha(normalizedposition); + page.setAlpha(MIN_ALPHA + (1.f-MIN_ALPHA)*normalizedposition); } } \ No newline at end of file diff --git a/src/com/savoirfairelinux/sflphone/service/SipService.java b/src/com/savoirfairelinux/sflphone/service/SipService.java index 91a0d342e17c4adc01c9873aa5581aacc0dd565b..fb78acb233b27a5482ffc136df500d189d8f7b00 100644 --- a/src/com/savoirfairelinux/sflphone/service/SipService.java +++ b/src/com/savoirfairelinux/sflphone/service/SipService.java @@ -121,7 +121,6 @@ public class SipService extends Service { LocalBroadcastManager.getInstance(this).registerReceiver(receiver, callFilter); getExecutor().execute(new StartRunnable()); - } /* called for each startService() */ @@ -232,7 +231,7 @@ public class SipService extends Service { System.loadLibrary("speexresampler"); System.loadLibrary("sflphone"); isPjSipStackStarted = true; - + } catch (UnsatisfiedLinkError e) { Log.e(TAG, "Problem with the current Pj stack...", e); isPjSipStackStarted = false; @@ -246,7 +245,7 @@ public class SipService extends Service { /* set static AppPath before calling manager.init */ -// managerImpl.setPath(sflphoneApp.getAppPath()); + // managerImpl.setPath(sflphoneApp.getAppPath()); callManagerJNI = new CallManager(); callManagerCallBack = new CallManagerCallBack(this); @@ -255,15 +254,15 @@ public class SipService extends Service { configurationManagerJNI = new ConfigurationManager(); configurationManagerCallback = new ConfigurationManagerCallback(this); SFLPhoneservice.setConfigurationCallbackObject(configurationManagerCallback); - + Log.i(TAG, "before init"); managerImpl.init(""); - + Log.i(TAG, "->startPjSipStack"); } - public HashMap<String, SipCall> getCurrent_calls() { + public HashMap<String, SipCall> getCurrent_calls() { return current_calls; } @@ -279,6 +278,7 @@ public class SipService extends Service { public abstract static class SipRunnable implements Runnable { protected abstract void doRun() throws SameThreadException, RemoteException; + @Override public void run() { try { doRun(); @@ -304,6 +304,7 @@ public class SipService extends Service { return done; } + @Override public void run() { try { obj = doRun(); @@ -358,12 +359,12 @@ public class SipService extends Service { protected void doRun() throws SameThreadException { Log.i(TAG, "SipService.placeCall() thread running..."); callManagerJNI.placeCall(call.getAccountID(), call.getCallId(), call.getContact().getPhones().get(0).getNumber()); - + HashMap<String, String> details = CallDetailsHandler.convertSwigToNative(callManagerJNI.getCallDetails(call.getCallId())); // watchout timestamp stored by sflphone is in seconds call.setTimestamp_start(Long.parseLong(details.get(ServiceConstants.call.TIMESTAMP_START))); getCurrent_calls().put(call.getCallId(), call); - + } }); } @@ -422,7 +423,7 @@ public class SipService extends Service { } }); } - + @Override public HashMap<String, String> getCallDetails(String callID) throws RemoteException { class CallDetails extends SipRunnableWithReturn { @@ -449,7 +450,7 @@ public class SipService extends Service { HashMap<String, String> nativemap = CallDetailsHandler.convertSwigToNative(swigmap); return nativemap; - + } @Override @@ -914,7 +915,7 @@ public class SipService extends Service { @Override protected String doRun() throws SameThreadException { Log.i(TAG, "SipService.getRecordPath() thread running..."); - return configurationManagerJNI.getRecordPath(); + return configurationManagerJNI.getRecordPath(); } } @@ -930,7 +931,7 @@ public class SipService extends Service { @Override public boolean toggleRecordingCall(final String id) throws RemoteException { - + class ToggleRecording extends SipRunnableWithReturn { @Override @@ -998,7 +999,7 @@ public class SipService extends Service { @Override protected void doRun() throws SameThreadException, RemoteException { Log.i(TAG, "SipService.setRecordPath() "+path+" thread running..."); - configurationManagerJNI.setRecordPath(path); + configurationManagerJNI.setRecordPath(path); } }); } @@ -1087,7 +1088,7 @@ public class SipService extends Service { } - private int NOTIFICATION_ID = new Random().nextInt(1000); + private final int NOTIFICATION_ID = new Random().nextInt(1000); private void makeNotification() { if (current_calls.size() == 0) { @@ -1098,18 +1099,18 @@ public class SipService extends Service { PendingIntent.FLAG_UPDATE_CURRENT); NotificationManager nm = (NotificationManager) getBaseContext().getSystemService(Context.NOTIFICATION_SERVICE); + nm.cancel(NOTIFICATION_ID); // clear previous notifications. NotificationCompat.Builder builder = new NotificationCompat.Builder(getBaseContext()); // // builder.setContent(view); builder.setContentIntent(contentIntent).setOngoing(true).setSmallIcon(R.drawable.ic_launcher) - .setContentTitle(getCurrent_calls().size() + " ongoing calls").setTicker("Pending calls").setWhen(System.currentTimeMillis()) - .setAutoCancel(false); + .setContentTitle(getCurrent_calls().size() + " ongoing calls").setTicker("Pending calls").setWhen(System.currentTimeMillis()) + .setAutoCancel(false); builder.setPriority(NotificationCompat.PRIORITY_MAX); Notification n = builder.build(); nm.notify(NOTIFICATION_ID, n); - } public void removeNotification() { @@ -1120,14 +1121,14 @@ public class SipService extends Service { @Override public Conference getCurrentCall() throws RemoteException { for (SipCall i : current_calls.values()) { - + // Incoming >> Ongoing if(i.isIncoming()){ Conference tmp = new Conference("-1"); tmp.getParticipants().add(i); return tmp; } - + if (i.isOngoing()) { Conference tmp = new Conference("-1"); tmp.getParticipants().add(i);