summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar V <sravankumar@codeaurora.org>2016-03-21 15:39:48 +0530
committerSravan Kumar V <sravankumar@codeaurora.org>2016-03-21 15:39:48 +0530
commit8d71081e1c7f6ce0ab1c63d4885ddee1539b0116 (patch)
tree673c4da35c98f428ef96d602f815e8d8ca9a301c
parent5ef39577be3c0188651413415182a95a849c9ee3 (diff)
downloadandroid_packages_apps_Bluetooth-8d71081e1c7f6ce0ab1c63d4885ddee1539b0116.tar.gz
android_packages_apps_Bluetooth-8d71081e1c7f6ce0ab1c63d4885ddee1539b0116.tar.bz2
android_packages_apps_Bluetooth-8d71081e1c7f6ce0ab1c63d4885ddee1539b0116.zip
Revert "Multiuser: Check if valid user before starting service"
This reverts commit cd271a3ad8a47bb561292324cf46245bab0435a8 which were preventing services from gettign started. Checks are not required now as handling for socket listening is now added in AdapterService code. Change-Id: I3b819b3fe665951c3d7e0bca13a4da6287c8890e CRs-Fixed: 992642
-rw-r--r--src/com/android/bluetooth/Utils.java4
-rwxr-xr-xsrc/com/android/bluetooth/map/BluetoothMapService.java5
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppReceiver.java7
-rw-r--r--src/com/android/bluetooth/pbap/BluetoothPbapService.java4
4 files changed, 0 insertions, 20 deletions
diff --git a/src/com/android/bluetooth/Utils.java b/src/com/android/bluetooth/Utils.java
index e87a6d9e3..6a467f9c3 100644
--- a/src/com/android/bluetooth/Utils.java
+++ b/src/com/android/bluetooth/Utils.java
@@ -204,19 +204,15 @@ final public class Utils {
int callingUser = UserHandle.getCallingUserId();
int callingUid = Binder.getCallingUid();
long ident = Binder.clearCallingIdentity();
- Log.d(TAG,"callingUid =" + callingUid);
try {
// With calling identity cleared the current user is the foreground user.
int foregroundUser = ActivityManager.getCurrentUser();
ok = (foregroundUser == callingUser);
- Log.e(TAG, "foregroundUser =" + foregroundUser);
- Log.e(TAG, "callingUser =" + callingUser);
if (!ok) {
// Always allow SystemUI/System access.
int systemUiUid = ActivityThread.getPackageManager().getPackageUid(
"com.android.systemui", UserHandle.USER_OWNER);
- Log.d(TAG," systemUiUid :" + systemUiUid);
ok = (systemUiUid == callingUid) || (Process.SYSTEM_UID == callingUid);
}
} catch (Exception ex) {
diff --git a/src/com/android/bluetooth/map/BluetoothMapService.java b/src/com/android/bluetooth/map/BluetoothMapService.java
index 5d0b23aa2..003687658 100755
--- a/src/com/android/bluetooth/map/BluetoothMapService.java
+++ b/src/com/android/bluetooth/map/BluetoothMapService.java
@@ -594,17 +594,12 @@ public class BluetoothMapService extends ProfileService {
if(!VERBOSE)
VERBOSE = Log.isLoggable(LOG_TAG, Log.VERBOSE);
- if (!Utils.checkCaller()) {
- Log.w(TAG, "start received for non-active user, ignoring");
- return false;
- }
//Start MapProfile if not already done.
if (isMapStarted()) {
Log.w(TAG, "start received for already started, ignoring");
return false;
}
-
if (VERBOSE) Log.v(TAG, "verbose logging is enabled");
HandlerThread thread = new HandlerThread("BluetoothMapHandler");
thread.start();
diff --git a/src/com/android/bluetooth/opp/BluetoothOppReceiver.java b/src/com/android/bluetooth/opp/BluetoothOppReceiver.java
index ff56d29b8..b4626c0be 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppReceiver.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppReceiver.java
@@ -48,7 +48,6 @@ import android.database.Cursor;
import android.net.Uri;
import android.util.Log;
import android.widget.Toast;
-import com.android.bluetooth.Utils;
/**
* Receives and handles: system broadcasts; Intents from other applications;
@@ -64,12 +63,6 @@ public class BluetoothOppReceiver extends BroadcastReceiver {
String action = intent.getAction();
if (D) Log.d(TAG, "Action :" + action);
- /* Ignore if Broadcast action is not transfer complete and Invalid user */
- if (!Utils.checkCaller() && !action.equals(BluetoothShare.TRANSFER_COMPLETED_ACTION)) {
- Log.w(TAG, action + " received for non-active user, ignoring!!");
- return;
- }
- if (V) Log.v(TAG, action + " Intent received for active user");
if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
if (BluetoothAdapter.STATE_ON == intent.getIntExtra(
diff --git a/src/com/android/bluetooth/pbap/BluetoothPbapService.java b/src/com/android/bluetooth/pbap/BluetoothPbapService.java
index dcfc5c209..6cfd71339 100644
--- a/src/com/android/bluetooth/pbap/BluetoothPbapService.java
+++ b/src/com/android/bluetooth/pbap/BluetoothPbapService.java
@@ -200,10 +200,6 @@ public class BluetoothPbapService extends Service {
mInterrupted = false;
mAdapter = BluetoothAdapter.getDefaultAdapter();
- if (!Utils.checkCaller()) {
- Log.w(TAG, "onCreate received for non-active user, ignoring");
- return;
- }
if (!mHasStarted) {
mHasStarted = true;