1
0
mirror of https://github.com/moparisthebest/SSLDroid synced 2024-11-23 09:22:16 -05:00

Fixed "running" notification to be persistent, e.g. not clearable by

the user.

Signed-off-by: Balint Kovacs <blint@blint.hu>
This commit is contained in:
Balint Kovacs 2011-04-17 20:44:04 +02:00
parent a447f4419f
commit 7cf08aca6e
4 changed files with 9 additions and 3 deletions

Binary file not shown.

Binary file not shown.

View File

@ -58,7 +58,7 @@ public class SSLDroid extends Service {
keyPass = settingPkcspass;
//Toast.makeText(this, "SSLDroid Service Started", Toast.LENGTH_LONG).show();
createNotification(0, "SSLDroid is running", "SSLDroid service is running");
createNotification(0, true, "SSLDroid is running", "SSLDroid service is running");
Log.d(TAG, "SSLDroid Service Started");
//createNotification("test", "This is a test of the emergency broadcast system");
@ -97,12 +97,13 @@ public class SSLDroid extends Service {
notificationManager.cancel(id);
}
public void createNotification(int id, String title, String text) {
public void createNotification(int id, boolean persistent, String title, String text) {
NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.icon,
"SSLDroid startup", System.currentTimeMillis());
// Hide the notification after its selected
//notification.flags |= Notification.FLAG_AUTO_CANCEL;
if (persistent == true)
notification.flags |= Notification.FLAG_NO_CLEAR;
Intent intent = new Intent(this, SSLDroidGui.class);
PendingIntent activity = PendingIntent.getActivity(this, 0, intent, 0);

View File

@ -48,6 +48,11 @@ public class TcpProxy {
}
server = new TcpProxyServerThread(ss, listenPort, tunnelHost, tunnelPort, keyFile, keyPass);
server.start();
/* try {
server.wait();
} catch (InterruptedException e) {
Log.d("SSLDroid", "Server thread interrupted: " + e.toString());
} */
}
public void stop() {