Loading android/app/src/com/android/bluetooth/map/BluetoothMapContentObserver.java +6 −2 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.os.Message; import android.os.ParcelFileDescriptor; import android.os.Process; import android.os.RemoteException; import android.os.UserManager; import android.provider.Telephony; import android.provider.Telephony.Mms; import android.provider.Telephony.MmsSms; Loading Loading @@ -1180,9 +1181,10 @@ public class BluetoothMapContentObserver { private void initMsgList() throws RemoteException { if (V) Log.d(TAG, "initMsgList"); UserManager manager = UserManager.get(mContext); if (manager == null || manager.isUserUnlocked()) return; if (mEnableSmsMms) { HashMap<Long, Msg> msgListSms = new HashMap<Long, Msg>(); Cursor c = mResolver.query(Sms.CONTENT_URI, Loading Loading @@ -3332,6 +3334,8 @@ public class BluetoothMapContentObserver { private void resendPendingMessages() { /* Send pending messages in outbox */ String where = "type = " + Sms.MESSAGE_TYPE_OUTBOX; UserManager manager = UserManager.get(mContext); if (manager == null || !manager.isUserUnlocked()) return; Cursor c = mResolver.query(Sms.CONTENT_URI, SMS_PROJECTION, where, null, null); try { Loading android/app/src/com/android/bluetooth/map/BluetoothMapObexServer.java +33 −3 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.os.Handler; import android.os.Message; import android.os.ParcelUuid; import android.os.RemoteException; import android.os.UserManager; import android.text.format.DateUtils; import android.util.Log; Loading Loading @@ -397,6 +398,11 @@ public class BluetoothMapObexServer extends ServerRequestHandler { return ResponseCodes.OBEX_HTTP_OK; } private boolean isUserUnlocked() { UserManager manager = UserManager.get(mContext); return (manager == null || manager.isUserUnlocked()); } @Override public int onPut(final Operation op) { if (D) Log.d(TAG, "onPut(): enter"); Loading Loading @@ -432,6 +438,10 @@ public class BluetoothMapObexServer extends ServerRequestHandler { Log.d(TAG,"TYPE_SET_NOTIFICATION_FILTER: NotificationFilter: " + appParams.getNotificationFilter()); } if (!isUserUnlocked()) { Log.e(TAG, "Storage locked, " + type + " failed"); return ResponseCodes.OBEX_HTTP_UNAVAILABLE; } mObserver.setNotificationFilter(appParams.getNotificationFilter()); return ResponseCodes.OBEX_HTTP_OK; } else if (type.equals(TYPE_SET_MESSAGE_STATUS)) { Loading @@ -441,6 +451,10 @@ public class BluetoothMapObexServer extends ServerRequestHandler { + ", StatusValue: " + appParams.getStatusValue() + ", ExtentedData: " + "" ); // TODO: appParams.getExtendedImData()); } if (!isUserUnlocked()) { Log.e(TAG, "Storage locked, " + type + " failed"); return ResponseCodes.OBEX_HTTP_UNAVAILABLE; } return setMessageStatus(name, appParams); } else if (type.equals(TYPE_MESSAGE)) { if(V) { Loading @@ -448,6 +462,10 @@ public class BluetoothMapObexServer extends ServerRequestHandler { + ", retry: " + appParams.getRetry() + ", charset: " + appParams.getCharset()); } if (!isUserUnlocked()) { Log.e(TAG, "Storage locked, " + type + " failed"); return ResponseCodes.OBEX_HTTP_UNAVAILABLE; } return pushMessage(op, name, appParams, mMessageVersion); } else if (type.equals(TYPE_SET_OWNER_STATUS)) { if(V) { Loading Loading @@ -881,6 +899,10 @@ public class BluetoothMapObexServer extends ServerRequestHandler { Log.d(TAG,"FilterConvoId = " + ((tmpLongLong == null) ? "" : Long.toHexString(tmpLongLong.getLeastSignificantBits()) ) ); } if (!isUserUnlocked()) { Log.e(TAG, "Storage locked, " + type + " failed"); return ResponseCodes.OBEX_HTTP_UNAVAILABLE; } // Block until all packets have been send. return sendMessageListingRsp(op, appParams, name); Loading @@ -895,6 +917,10 @@ public class BluetoothMapObexServer extends ServerRequestHandler { Log.d(TAG,"FilterReadStatus = " + appParams.getFilterReadStatus()); Log.d(TAG,"FilterRecipient = " + appParams.getFilterRecipient()); } if (!isUserUnlocked()) { Log.e(TAG, "Storage locked, " + type + " failed"); return ResponseCodes.OBEX_HTTP_UNAVAILABLE; } // Block until all packets have been send. return sendConvoListingRsp(op, appParams,name); } else if (type.equals(TYPE_GET_MAS_INSTANCE_INFORMATION)) { Loading @@ -912,6 +938,10 @@ public class BluetoothMapObexServer extends ServerRequestHandler { ", Charset = " + appParams.getCharset() + ", FractionRequest = " + appParams.getFractionRequest()); } if (!isUserUnlocked()) { Log.e(TAG, "Storage locked, " + type + " failed"); return ResponseCodes.OBEX_HTTP_UNAVAILABLE; } // Block until all packets have been send. return sendGetMessageRsp(op, name, appParams, mMessageVersion); } else { Loading Loading
android/app/src/com/android/bluetooth/map/BluetoothMapContentObserver.java +6 −2 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.os.Message; import android.os.ParcelFileDescriptor; import android.os.Process; import android.os.RemoteException; import android.os.UserManager; import android.provider.Telephony; import android.provider.Telephony.Mms; import android.provider.Telephony.MmsSms; Loading Loading @@ -1180,9 +1181,10 @@ public class BluetoothMapContentObserver { private void initMsgList() throws RemoteException { if (V) Log.d(TAG, "initMsgList"); UserManager manager = UserManager.get(mContext); if (manager == null || manager.isUserUnlocked()) return; if (mEnableSmsMms) { HashMap<Long, Msg> msgListSms = new HashMap<Long, Msg>(); Cursor c = mResolver.query(Sms.CONTENT_URI, Loading Loading @@ -3332,6 +3334,8 @@ public class BluetoothMapContentObserver { private void resendPendingMessages() { /* Send pending messages in outbox */ String where = "type = " + Sms.MESSAGE_TYPE_OUTBOX; UserManager manager = UserManager.get(mContext); if (manager == null || !manager.isUserUnlocked()) return; Cursor c = mResolver.query(Sms.CONTENT_URI, SMS_PROJECTION, where, null, null); try { Loading
android/app/src/com/android/bluetooth/map/BluetoothMapObexServer.java +33 −3 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.os.Handler; import android.os.Message; import android.os.ParcelUuid; import android.os.RemoteException; import android.os.UserManager; import android.text.format.DateUtils; import android.util.Log; Loading Loading @@ -397,6 +398,11 @@ public class BluetoothMapObexServer extends ServerRequestHandler { return ResponseCodes.OBEX_HTTP_OK; } private boolean isUserUnlocked() { UserManager manager = UserManager.get(mContext); return (manager == null || manager.isUserUnlocked()); } @Override public int onPut(final Operation op) { if (D) Log.d(TAG, "onPut(): enter"); Loading Loading @@ -432,6 +438,10 @@ public class BluetoothMapObexServer extends ServerRequestHandler { Log.d(TAG,"TYPE_SET_NOTIFICATION_FILTER: NotificationFilter: " + appParams.getNotificationFilter()); } if (!isUserUnlocked()) { Log.e(TAG, "Storage locked, " + type + " failed"); return ResponseCodes.OBEX_HTTP_UNAVAILABLE; } mObserver.setNotificationFilter(appParams.getNotificationFilter()); return ResponseCodes.OBEX_HTTP_OK; } else if (type.equals(TYPE_SET_MESSAGE_STATUS)) { Loading @@ -441,6 +451,10 @@ public class BluetoothMapObexServer extends ServerRequestHandler { + ", StatusValue: " + appParams.getStatusValue() + ", ExtentedData: " + "" ); // TODO: appParams.getExtendedImData()); } if (!isUserUnlocked()) { Log.e(TAG, "Storage locked, " + type + " failed"); return ResponseCodes.OBEX_HTTP_UNAVAILABLE; } return setMessageStatus(name, appParams); } else if (type.equals(TYPE_MESSAGE)) { if(V) { Loading @@ -448,6 +462,10 @@ public class BluetoothMapObexServer extends ServerRequestHandler { + ", retry: " + appParams.getRetry() + ", charset: " + appParams.getCharset()); } if (!isUserUnlocked()) { Log.e(TAG, "Storage locked, " + type + " failed"); return ResponseCodes.OBEX_HTTP_UNAVAILABLE; } return pushMessage(op, name, appParams, mMessageVersion); } else if (type.equals(TYPE_SET_OWNER_STATUS)) { if(V) { Loading Loading @@ -881,6 +899,10 @@ public class BluetoothMapObexServer extends ServerRequestHandler { Log.d(TAG,"FilterConvoId = " + ((tmpLongLong == null) ? "" : Long.toHexString(tmpLongLong.getLeastSignificantBits()) ) ); } if (!isUserUnlocked()) { Log.e(TAG, "Storage locked, " + type + " failed"); return ResponseCodes.OBEX_HTTP_UNAVAILABLE; } // Block until all packets have been send. return sendMessageListingRsp(op, appParams, name); Loading @@ -895,6 +917,10 @@ public class BluetoothMapObexServer extends ServerRequestHandler { Log.d(TAG,"FilterReadStatus = " + appParams.getFilterReadStatus()); Log.d(TAG,"FilterRecipient = " + appParams.getFilterRecipient()); } if (!isUserUnlocked()) { Log.e(TAG, "Storage locked, " + type + " failed"); return ResponseCodes.OBEX_HTTP_UNAVAILABLE; } // Block until all packets have been send. return sendConvoListingRsp(op, appParams,name); } else if (type.equals(TYPE_GET_MAS_INSTANCE_INFORMATION)) { Loading @@ -912,6 +938,10 @@ public class BluetoothMapObexServer extends ServerRequestHandler { ", Charset = " + appParams.getCharset() + ", FractionRequest = " + appParams.getFractionRequest()); } if (!isUserUnlocked()) { Log.e(TAG, "Storage locked, " + type + " failed"); return ResponseCodes.OBEX_HTTP_UNAVAILABLE; } // Block until all packets have been send. return sendGetMessageRsp(op, name, appParams, mMessageVersion); } else { Loading