本文主要是介绍android5.1蓝牙opp协议去掉Notification和Dialog操作提示,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、packages/apps/Bluetooth/src/com/android/bluetooth/opp/BluetoothOppIncomingFileConfirmActivity.java
protected void onCreate(Bundle savedInstanceState) {
setupAlert();
mAlert.getButton(DialogInterface.BUTTON_POSITIVE).performClick();//添加
}
2、packages/apps/Bluetooth/src/com/android/bluetooth/opp/BluetoothOppNotification.java
private void updateIncomingFileConfirmNotification() {
intent.setDataAndNormalize(contentUri);
mContext.sendBroadcast(intent, null);//添加
//n.setLatestEventInfo(mContext, title, caption, PendingIntent.getBroadcast(mContext, 0,intent, 0));//删除
mContext.sendBroadcast(intent, null);//添加
//n.deleteIntent = PendingIntent.getBroadcast(mContext, 0, intent, 0);//删除
//mNotificationMgr.notify(id, n);//删除
}
3、packages/apps/Bluetooth/src/com/android/bluetooth/opp/BluetoothOppReceiver.java
else if (action.equals(Constants.ACTION_INCOMING_FILE_CONFIRM)) {
....
/*删除
NotificationManager notMgr = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
if (notMgr != null) {
notMgr.cancel((int)ContentUris.parseId(intent.getData()));
if (V) Log.v(TAG, "notMgr.cancel called");
}
*/
}
这篇关于android5.1蓝牙opp协议去掉Notification和Dialog操作提示的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!