Custom notif name, linphoneService
This commit is contained in:
parent
eb3ada3774
commit
e72411efd6
3 changed files with 20 additions and 10 deletions
|
@ -8,5 +8,10 @@
|
|||
<bool name="use_android_contact_picker">true</bool>
|
||||
<!-- <string name="merge_another_contact_provider">content://something</string>-->
|
||||
|
||||
<bool name="useFirstLoginActivity">false</bool>
|
||||
<bool name="useMenuSettings">true</bool>
|
||||
<bool name="useMenuAbout">true</bool>
|
||||
|
||||
<string name="notification_title">Linphone</string>
|
||||
</resources>
|
||||
|
|
@ -80,15 +80,14 @@ public class LinphoneActivity extends TabActivity {
|
|||
|
||||
|
||||
// Customization
|
||||
private static final boolean useFirstLoginActivity = false;
|
||||
private static final boolean useMenuSettings = true;
|
||||
private static final boolean useMenuAbout = true;
|
||||
private boolean checkAccount = !useFirstLoginActivity;
|
||||
private static boolean useFirstLoginActivity;
|
||||
private static boolean useMenuSettings;
|
||||
private static boolean useMenuAbout;
|
||||
private boolean checkAccount;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static final LinphoneActivity instance() {
|
||||
if (instance != null) return instance;
|
||||
|
||||
|
@ -104,7 +103,11 @@ public class LinphoneActivity extends TabActivity {
|
|||
super.onCreate(savedInstanceState);
|
||||
instance = this;
|
||||
setContentView(R.layout.main);
|
||||
|
||||
|
||||
useFirstLoginActivity = getResources().getBoolean(R.bool.useFirstLoginActivity);
|
||||
useMenuSettings = getResources().getBoolean(R.bool.useMenuSettings);
|
||||
useMenuAbout = getResources().getBoolean(R.bool.useMenuAbout);
|
||||
checkAccount = !useFirstLoginActivity;
|
||||
|
||||
// start linphone as background
|
||||
startService(new Intent(ACTION_MAIN).setClass(this, LinphoneService.class));
|
||||
|
|
|
@ -80,7 +80,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
|
|||
|
||||
private Notification mNotif;
|
||||
private PendingIntent mNotifContentIntent;
|
||||
private static final String NOTIF_TITLE = "Linphone";
|
||||
private String notificationTitle;
|
||||
|
||||
|
||||
private static final int IC_LEVEL_ORANGE=0;
|
||||
|
@ -96,6 +96,8 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
|
|||
public void onCreate() {
|
||||
super.onCreate();
|
||||
instance = this;
|
||||
|
||||
notificationTitle = getString(R.string.app_name);
|
||||
|
||||
// Dump some debugging information to the logs
|
||||
Hacks.dumpDeviceInformation();
|
||||
|
@ -107,7 +109,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
|
|||
|
||||
Intent notifIntent = new Intent(this, LinphoneActivity.class);
|
||||
mNotifContentIntent = PendingIntent.getActivity(this, 0, notifIntent, 0);
|
||||
mNotif.setLatestEventInfo(this, NOTIF_TITLE,"", mNotifContentIntent);
|
||||
mNotif.setLatestEventInfo(this, notificationTitle,"", mNotifContentIntent);
|
||||
mNotificationMgr.notify(NOTIF_ID, mNotif);
|
||||
|
||||
|
||||
|
@ -122,7 +124,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
|
|||
private void sendNotification(int level, int text) {
|
||||
mNotif.iconLevel = level;
|
||||
mNotif.when=System.currentTimeMillis();
|
||||
mNotif.setLatestEventInfo(this, NOTIF_TITLE,getString(text), mNotifContentIntent);
|
||||
mNotif.setLatestEventInfo(this, notificationTitle,getString(text), mNotifContentIntent);
|
||||
mNotificationMgr.notify(NOTIF_ID, mNotif);
|
||||
}
|
||||
|
||||
|
@ -130,7 +132,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
|
|||
mNotif.iconLevel = level;
|
||||
mNotif.when=System.currentTimeMillis();
|
||||
String id = LinphoneManager.getLc().getDefaultProxyConfig().getIdentity();
|
||||
mNotif.setLatestEventInfo(this, NOTIF_TITLE,
|
||||
mNotif.setLatestEventInfo(this, notificationTitle,
|
||||
String.format(getString(text), id),
|
||||
mNotifContentIntent);
|
||||
mNotificationMgr.notify(NOTIF_ID, mNotif);
|
||||
|
|
Loading…
Reference in a new issue