summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAshwini Munigala <AshwiniM@codeaurora.org>2015-02-02 19:17:08 +0530
committerAshwini Munigala <AshwiniM@codeaurora.org>2015-02-02 19:53:38 +0530
commit6c2635adfd51b6b80a6e572ca7e9b7f769e65010 (patch)
treefb9e3e1bd7873c61895b1c812d3abdc1afea60fb /src
parent56b82b270fcdf18dac6f7034328de2890a1847ba (diff)
downloadandroid_packages_apps_BluetoothExt-6c2635adfd51b6b80a6e572ca7e9b7f769e65010.tar.gz
android_packages_apps_BluetoothExt-6c2635adfd51b6b80a6e572ca7e9b7f769e65010.tar.bz2
android_packages_apps_BluetoothExt-6c2635adfd51b6b80a6e572ca7e9b7f769e65010.zip
BT: Remove BluetoothExt process foreground handling.
FTP Service startForeground was required during a active FTP Session because BluetoothExt process had less proirity than Bluetooth (com.android.bluetooth) process. This is not required anymore due to BluetoothExt process runs in Bluetooth (com.android.bluetooth) process context now. Removed the relevant code changes to mark the FTPService in foreground and back to normal priority while active FTP Session Connect and Disconnect. This actually reverts commit f32eef886d7429dcf07d4499ae970b1e71279b30. Change-Id: If3619f5d0a952ace9e4dcbef3a923fff678fe1a0 CRs-Fixed: 765862
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");