Loading android/app/src/com/android/bluetooth/pbap/BluetoothPbapService.java +25 −5 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.os.HandlerThread; import android.os.Looper; import android.os.Message; import android.os.PowerManager; import android.os.UserManager; import android.support.annotation.VisibleForTesting; import android.telephony.TelephonyManager; import android.text.TextUtils; Loading Loading @@ -175,6 +176,11 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect @Override public void onChange(boolean selfChange) { Log.d(TAG, " onChange on contact uri "); sendUpdateRequest(); } } private void sendUpdateRequest() { if (mContactsLoaded) { if (!mSessionStatusHandler.hasMessages(CHECK_SECONDARY_VERSION_COUNTER)) { mSessionStatusHandler.sendMessage( Loading @@ -182,7 +188,6 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect } } } } private BluetoothPbapContentObserver mContactChangeObserver; Loading Loading @@ -565,6 +570,21 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect sBluetoothPbapService = instance; } @Override protected void setCurrentUser(int userId) { Log.i(TAG, "setCurrentUser(" + userId + ")"); UserManager userManager = (UserManager) getSystemService(Context.USER_SERVICE); if (userManager.isUserUnlocked(userId)) { setUserUnlocked(userId); } } @Override protected void setUserUnlocked(int userId) { Log.i(TAG, "setUserUnlocked(" + userId + ")"); sendUpdateRequest(); } private static class PbapBinder extends IBluetoothPbap.Stub implements IProfileServiceBinder { private BluetoothPbapService mService; Loading Loading
android/app/src/com/android/bluetooth/pbap/BluetoothPbapService.java +25 −5 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.os.HandlerThread; import android.os.Looper; import android.os.Message; import android.os.PowerManager; import android.os.UserManager; import android.support.annotation.VisibleForTesting; import android.telephony.TelephonyManager; import android.text.TextUtils; Loading Loading @@ -175,6 +176,11 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect @Override public void onChange(boolean selfChange) { Log.d(TAG, " onChange on contact uri "); sendUpdateRequest(); } } private void sendUpdateRequest() { if (mContactsLoaded) { if (!mSessionStatusHandler.hasMessages(CHECK_SECONDARY_VERSION_COUNTER)) { mSessionStatusHandler.sendMessage( Loading @@ -182,7 +188,6 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect } } } } private BluetoothPbapContentObserver mContactChangeObserver; Loading Loading @@ -565,6 +570,21 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect sBluetoothPbapService = instance; } @Override protected void setCurrentUser(int userId) { Log.i(TAG, "setCurrentUser(" + userId + ")"); UserManager userManager = (UserManager) getSystemService(Context.USER_SERVICE); if (userManager.isUserUnlocked(userId)) { setUserUnlocked(userId); } } @Override protected void setUserUnlocked(int userId) { Log.i(TAG, "setUserUnlocked(" + userId + ")"); sendUpdateRequest(); } private static class PbapBinder extends IBluetoothPbap.Stub implements IProfileServiceBinder { private BluetoothPbapService mService; Loading