summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2015-02-09 08:11:37 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2015-02-09 08:11:37 -0800
commita428921bd503a2a5a5acd0750790fb956b616f2e (patch)
tree49d2831288bf15705909c0fa4910b36612095562 /src
parenta920259150436607d91b641b9ab862bc57dcfd71 (diff)
parent6c2635adfd51b6b80a6e572ca7e9b7f769e65010 (diff)
downloadandroid_packages_apps_BluetoothExt-a428921bd503a2a5a5acd0750790fb956b616f2e.tar.gz
android_packages_apps_BluetoothExt-a428921bd503a2a5a5acd0750790fb956b616f2e.tar.bz2
android_packages_apps_BluetoothExt-a428921bd503a2a5a5acd0750790fb956b616f2e.zip
Merge "BT: Remove BluetoothExt process foreground handling."
Diffstat (limited to 'src')
-rw-r--r--src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java21
-rwxr-xr-xsrc/org/codeaurora/bluetooth/map/BluetoothMasService.java40
2 files changed, 2 insertions, 59 deletions
diff --git a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java
index 77737aa..c2b72d8 100644
--- a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java
+++ b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java
@@ -189,8 +189,6 @@ public class BluetoothFtpService extends Service {
private static final int NOTIFICATION_ID_AUTH = -1000006;
- private static final int NOTIFICATION_ID_CONNECTED = -1000010;
-
private static final int FTP_MEDIA_SCANNED = 4;
private static final int FTP_MEDIA_SCANNED_FAILED = 5;
@@ -205,8 +203,6 @@ public class BluetoothFtpService extends Service {
public static boolean isL2capSocket = false;
- private Notification mConnectedNotification = null;
-
private BluetoothAdapter mAdapter;
private RfcommSocketAcceptThread mRfcommAcceptThread = null;
@@ -713,13 +709,8 @@ public class BluetoothFtpService extends Service {
break;
case MSG_SERVERSESSION_CLOSE:
stopObexServerSession();
- stopForeground(true);
- mConnectedNotification = null;
break;
case MSG_SESSION_ESTABLISHED:
- if(mConnectedNotification == null)
- mConnectedNotification = createFtpConnectedNotification();
- startForeground(NOTIFICATION_ID_CONNECTED, mConnectedNotification);
break;
case MSG_SESSION_DISCONNECTED:
break;
@@ -771,18 +762,6 @@ public class BluetoothFtpService extends Service {
}
}
};
- private Notification createFtpConnectedNotification() {
- Log.v(TAG, "Creating FTP access CONNECTED");
-
- Notification notification = new Notification(android.R.drawable.stat_sys_data_bluetooth,
- getString(R.string.ftp_notif_active_session), System.currentTimeMillis());
- notification.setLatestEventInfo(this, getString(R.string.ftp_notif_active_session),
- getString( R.string.ftp_notif_connected , getRemoteDeviceName()), null);
- notification.flags |= Notification.FLAG_AUTO_CANCEL;
- notification.flags |= Notification.FLAG_ONLY_ALERT_ONCE;
- notification.defaults = Notification.DEFAULT_SOUND;
- return notification;
- }
private void createFtpNotification(String action) {
NotificationManager nm = (NotificationManager)
diff --git a/src/org/codeaurora/bluetooth/map/BluetoothMasService.java b/src/org/codeaurora/bluetooth/map/BluetoothMasService.java
index 7ee3d3c..aa6d64e 100755
--- a/src/org/codeaurora/bluetooth/map/BluetoothMasService.java
+++ b/src/org/codeaurora/bluetooth/map/BluetoothMasService.java
@@ -170,10 +170,7 @@ public class BluetoothMasService extends Service {
ParcelUuid.fromString("00001133-0000-1000-8000-00805f9b34fb");
// Ensure not conflict with Opp notification ID
- private static final int NOTIFICATION_ID_ACCESS = -1000007;
- private static final int NOTIFICATION_ID_CONNECTED = -1000008;
-
- private Notification mConnectedNotification = null;
+ private static final int NOTIFICATION_ID_ACCESS = -1000005;
private BluetoothAdapter mAdapter;
@@ -491,25 +488,9 @@ public class BluetoothMasService extends Service {
{
final int masId = msg.arg1;
mConnectionManager.stopObexServerSession(masId);
- //Dismiss CONNECTED Notification if no Active Connections
- boolean stopFgNotification = true;
- for (BluetoothMasObexConnection connection : mConnectionManager.mConnections) {
- if (connection.mConnSocket != null) {
- if(VERBOSE) Log.v(TAG,"Active Session exists ");
- stopFgNotification = false;
- break;
- }
- }
- if(stopFgNotification == true){
- stopForeground(true);
- mConnectedNotification=null;
- }
break;
}
case MSG_SESSION_ESTABLISHED:
- if(mConnectedNotification == null)
- mConnectedNotification = createMapConnectedNotification(mRemoteDevice);
- startForeground(NOTIFICATION_ID_CONNECTED, mConnectedNotification);
break;
case MSG_SESSION_DISCONNECTED:
break;
@@ -519,24 +500,6 @@ public class BluetoothMasService extends Service {
}
};
- private Notification createMapConnectedNotification(BluetoothDevice device) {
- if (VERBOSE) Log.v(TAG, "Creating MAS access CONNECTED");
-
- Notification notification = new Notification(android.R.drawable.stat_sys_data_bluetooth,
- getString(R.string.map_notif_active_session), System.currentTimeMillis());
- String name = device.getName();
- if (TextUtils.isEmpty(name)) {
- name = getString(R.string.defaultname);
- }
- notification.setLatestEventInfo(this, getString(R.string.map_notif_active_session),
- getString( R.string.map_notif_connected ,name), null);
- notification.flags |= Notification.FLAG_AUTO_CANCEL;
- notification.flags |= Notification.FLAG_ONLY_ALERT_ONCE;
- notification.defaults = Notification.DEFAULT_SOUND;
- return notification;
-
-
- }
private void createMapNotification(BluetoothDevice device) {
if (VERBOSE) Log.v(TAG, "Creating MAS access notification");
mIsRequestBeingNotified = true;
@@ -961,6 +924,7 @@ public class BluetoothMasService extends Service {
Log.i(TAG, "CONNECTION SOCKET NULL");
break;
}
+
mRemoteDevice = mConnSocket.getRemoteDevice();
if (mRemoteDevice == null) {
Log.i(TAG, "getRemoteDevice() = null");