2 个文件变更+6-2
Mbluetooth_ui/entry/src/main/ets/oppability/BluetoothPcReceiveUIAbility.ets+3-1
@@ -49,6 +49,7 @@ const RESULT_ERROR_UNKNOWN: number = 7;
49const RESULT_SUCCESS_DISCONNECT: number = 9;49const RESULT_SUCCESS_DISCONNECT: number = 9;
50 50 
51const USER_CANCEL_REMOVE_NOTIFICATION: number = 1;51const USER_CANCEL_REMOVE_NOTIFICATION: number = 1;
52+const SYSTEM_CANCEL_REMOVE_NOTIFICATION: number = 2;
52const SYSTEM_CANCEL_NOT_USE_BLUETOOTH: number = 9;53const SYSTEM_CANCEL_NOT_USE_BLUETOOTH: number = 9;
53 54 
54const STATUS_PENDING: number = 0;55const STATUS_PENDING: number = 0;
@@ -140,7 +141,8 @@ export default class BluetoothReceiveUIAbility extends UIAbility {
140 this.oppProfile.setIncomingFileConfirmation(false, -1);141 this.oppProfile.setIncomingFileConfirmation(false, -1);
141 this.oppProfile.cancelTransfer();142 this.oppProfile.cancelTransfer();
142 this.handleTerminate();143 this.handleTerminate();
143- } else if (info.reason == SYSTEM_CANCEL_NOT_USE_BLUETOOTH) {144+ } else if (info.reason == SYSTEM_CANCEL_NOT_USE_BLUETOOTH ||
145+ info.reason == SYSTEM_CANCEL_REMOVE_NOTIFICATION) {
144 this.startContinuousTask();146 this.startContinuousTask();
145 }147 }
146 });148 });
Mbluetooth_ui/entry/src/main/ets/oppability/BluetoothReceiveUIAbility.ets+3-1
@@ -49,6 +49,7 @@ const RESULT_ERROR_UNKNOWN: number = 7;
49const RESULT_SUCCESS_DISCONNECT: number = 9;49const RESULT_SUCCESS_DISCONNECT: number = 9;
50 50 
51const USER_CANCEL_REMOVE_NOTIFICATION: number = 1;51const USER_CANCEL_REMOVE_NOTIFICATION: number = 1;
52+const SYSTEM_CANCEL_REMOVE_NOTIFICATION: number = 2;
52const SYSTEM_CANCEL_NOT_USE_BLUETOOTH: number = 9;53const SYSTEM_CANCEL_NOT_USE_BLUETOOTH: number = 9;
53 54 
54const STATUS_PENDING: number = 0;55const STATUS_PENDING: number = 0;
@@ -141,7 +142,8 @@ export default class BluetoothReceiveUIAbility extends UIAbility {
141 this.oppProfile.setIncomingFileConfirmation(false, -1);142 this.oppProfile.setIncomingFileConfirmation(false, -1);
142 this.oppProfile.cancelTransfer();143 this.oppProfile.cancelTransfer();
143 this.handleTerminate();144 this.handleTerminate();
144- } else if (info.reason == SYSTEM_CANCEL_NOT_USE_BLUETOOTH) {145+ } else if (info.reason == SYSTEM_CANCEL_NOT_USE_BLUETOOTH ||
146+ info.reason == SYSTEM_CANCEL_REMOVE_NOTIFICATION) {
145 this.startContinuousTask();147 this.startContinuousTask();
146 }148 }
147 });149 });