Commit 8d732971 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Use TileManager for missed calls

parent 03c71e60
......@@ -88,6 +88,7 @@
<Compile Include="LinphoneScheduledAgent.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RegistrationHelper.cs" />
<Compile Include="TileManager.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Core\Core.vcxproj">
......
......@@ -6,6 +6,7 @@
<SilverlightMobileCSProjectFlavor>
<FullDeploy>True</FullDeploy>
<DebuggerType>Managed</DebuggerType>
<DebuggerAgentType>Managed</DebuggerAgentType>
<Tombstone>False</Tombstone>
</SilverlightMobileCSProjectFlavor>
</FlavorProperties>
......
......@@ -35,26 +35,12 @@ namespace Linphone.Agents
this.isIncomingCallAgent = true;
Debug.WriteLine("[IncomingCallAgent] Received VoIP Incoming Call task");
//ShellToast toast = new Microsoft.Phone.Shell.ShellToast();
//toast.Content = "PN received";
//toast.Title = "Linphone";
//toast.NavigationUri = new System.Uri("/Views/Dialer.xaml", System.UriKind.RelativeOrAbsolute);
//toast.Show();
// Initiate incoming call processing
// If you want to pass in additional information such as pushNotification.Number, you can
VoipPhoneCall call = Globals.Instance.CallController.OnIncomingCallReceived(null, "miaou", "miaou@sip.linphone.org", this.OnIncomingCallDialogDismissed);
if (call == null)
{
// For some reasons, the incoming call processing was not started.
// There is nothing more to do.
base.NotifyComplete();
}
TileManager.Instance.UpdateTileWithMissedCalls(Globals.Instance.LinphoneCore.GetMissedCallsCount());
}
else
{
VoipKeepAliveTask keepAliveTask = task as VoipKeepAliveTask;
Debug.WriteLine("[KeepAliveAgent] Keep Alive");
if (keepAliveTask != null)
{
this.isIncomingCallAgent = false;
......
......@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Linphone.Model
namespace Linphone.Agents
{
/// <summary>
/// Utility class used to handle everything that is Tile related
......
......@@ -702,12 +702,14 @@ void Linphone::Core::LinphoneCore::SetCPUCount(int count)
int Linphone::Core::LinphoneCore::GetMissedCallsCount()
{
return -1;
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
return linphone_core_get_missed_calls_count(this->lc);
}
void Linphone::Core::LinphoneCore::ResetMissedCallsCount()
{
std::lock_guard<std::recursive_mutex> lock(g_apiLock);
linphone_core_reset_missed_calls_count(this->lc);
}
void Linphone::Core::LinphoneCore::RefreshRegisters()
......
......@@ -213,13 +213,13 @@ namespace Linphone
}
else
{
// The keep-alive task has been scheduled and is still scheduled so there is nothing more to do
// The keep-alive task has been scheduled and is still scheduled so there is nothing more to do
return;
}
}
keepAliveTask = new VoipKeepAliveTask(keepAliveTaskName);
keepAliveTask.Interval = new TimeSpan(10000000 * Int32.Parse(DefaultValues.KeepAlive));
keepAliveTask.Interval = new TimeSpan(10000000 * 5);
keepAliveTask.Description = "keep-alive task";
ScheduledActionService.Add(keepAliveTask);
}
......
......@@ -118,7 +118,6 @@
<Compile Include="Model\LinphoneManager.cs" />
<Compile Include="Model\Logger.cs" />
<Compile Include="Model\SettingsManager.cs" />
<Compile Include="Model\TileManager.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Resources\AppResources.Designer.cs">
<AutoGen>True</AutoGen>
......
......@@ -18,6 +18,7 @@ using Windows.Phone.Media.Devices;
using System.Reflection;
using Microsoft.Phone.Net.NetworkInformation;
using Windows.Storage;
using Linphone.Agents;
namespace Linphone.Model
{
......@@ -513,6 +514,10 @@ namespace Linphone.Model
CallListener.PauseStateChanged(false);
});
}
else if (state == LinphoneCallState.Released)
{
TileManager.Instance.UpdateTileWithMissedCalls(LinphoneCore.GetMissedCallsCount());
}
}
/// <summary>
......
......@@ -236,7 +236,7 @@
</Grid.ColumnDefinitions>
<Button
Grid.Column="1"
Grid.Column="0"
x:Name="call"
Background="{StaticResource PhoneAccentBrush}"
Content="{Binding Path=LocalizedResources.Call, Source={StaticResource LocalizedStrings}}"
......
......@@ -9,6 +9,7 @@ using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Linphone.Model;
using Linphone.Resources;
using Linphone.Agents;
namespace Linphone.Views
{
......@@ -41,6 +42,7 @@ namespace Linphone.Views
TileManager tileManager = TileManager.Instance;
tileManager.RemoveMissedCallsTile();
LinphoneManager.Instance.LinphoneCore.ResetMissedCallsCount();
List<CallLogs> callsHistory = LinphoneManager.Instance.GetCallsHistory();
history.ItemsSource = callsHistory;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment