diff --git a/services/ans/include/advanced_notification_service.h b/services/ans/include/advanced_notification_service.h index 05f1c035da2f79d7f31b95dead678dddd9ea95b4..ecb5dfddd3d0167dcf655b2a4da95b0bbb423f7d 100644 --- a/services/ans/include/advanced_notification_service.h +++ b/services/ans/include/advanced_notification_service.h @@ -1473,7 +1473,8 @@ private: const sptr &callback, const sptr &callerToken, const sptr bundleOption, - const bool innerLake); + const bool innerLake, + const bool easyAbroad); void ClearSlotTypeData(const sptr &request, int32_t callingUid, int32_t sourceType); bool GetSystemBoolParameter(const std::string &key, const bool defaultValue); diff --git a/services/ans/include/notification_dialog.h b/services/ans/include/notification_dialog.h index 0703496def6aabd945964f6b9c0f64f37527619f..81b36ded6e8aedcf1ac8f145c8831d8660df1c72 100644 --- a/services/ans/include/notification_dialog.h +++ b/services/ans/include/notification_dialog.h @@ -35,7 +35,8 @@ public: int32_t uid, std::string appBundleName, const sptr &callerToken, - const bool innerLake); + const bool innerLake, + const bool easyAbroad); static int32_t GetUidByBundleName(const std::string &bundleName); }; diff --git a/services/ans/include/notification_dialog_manager.h b/services/ans/include/notification_dialog_manager.h index dc5f848cd314aea402024a188f24db80ba9693d8..0212faef06ab56e000621d91f450d1d3dd6a3922 100644 --- a/services/ans/include/notification_dialog_manager.h +++ b/services/ans/include/notification_dialog_manager.h @@ -85,7 +85,8 @@ public: const sptr& bundle, const sptr& callback, const sptr& callerToken, - const bool innerLake + const bool innerLake, + const bool easyAbroad ); /* diff --git a/services/ans/src/advanced_notification_publish_service.cpp b/services/ans/src/advanced_notification_publish_service.cpp index cc15e96dbddcd6335806030d0dad413cfeb1ca61..5db64d57c695b57707fe6fb5f915a67ad7071d29 100644 --- a/services/ans/src/advanced_notification_publish_service.cpp +++ b/services/ans/src/advanced_notification_publish_service.cpp @@ -75,8 +75,9 @@ constexpr const char *CONTACT_DATA = "datashare:///com.ohos.contactsdataability/ constexpr const char *SUPPORT_INTEGELLIGENT_SCENE = "true"; constexpr int32_t OPERATION_TYPE_COMMON_EVENT = 4; const static std::string BUNDLE_NAME_ZYT = "com.zhuoyi.appstore.lite"; -const static std::string BUNDLE_NAME_ABROAD = "com.easy.transfer.abroad"; +const static std::string BUNDLE_NAME_ABROAD = "com.easy.abroad"; const static std::string INSTALL_SOURCE_EASYABROAD = "com.easy.abroad"; +constexpr int32_t ZERO_USER_ID = 0; constexpr int32_t BADGE_NUM_LIMIT = 0; constexpr int32_t CLEAR_SLOT_FROM_AVSEESAION = 1; constexpr int32_t CLEAR_SLOT_FROM_RSS = 2; @@ -1023,7 +1024,7 @@ ErrCode AdvancedNotificationService::RequestEnableNotification(const std::string return ERR_ANS_INVALID_PARAM; } sptr bundleOption = GenerateBundleOption(); - return CommonRequestEnableNotification(deviceId, callback, callerToken, bundleOption, false); + return CommonRequestEnableNotification(deviceId, callback, callerToken, bundleOption, false, false); } ErrCode AdvancedNotificationService::RequestEnableNotification(const std::string bundleName, const int32_t uid) @@ -1038,20 +1039,24 @@ ErrCode AdvancedNotificationService::RequestEnableNotification(const std::string } AppExecFwk::BundleInfo bundleInfo; - BundleManagerHelper::GetInstance()->GetBundleInfoV9(bundleName, 1, bundleInfo, 0); + bool ret = BundleManagerHelper::GetInstance()->GetBundleInfoV9(bundleName, + static_cast(AppExecFwk::GetBundleInfoFlag::GET_BUNDLE_INFO_WITH_APPLICATION), + bundleInfo, ZERO_USER_ID); + bool easyAbroad = false; if (bundleInfo.applicationInfo.installSource == INSTALL_SOURCE_EASYABROAD) { ANS_LOGI("RequestEnableNotification abroad app"); - return ERR_ANS_NOT_ALLOWED; + easyAbroad = true; } sptr bundleOption = new (std::nothrow) NotificationBundleOption(bundleName, uid); - return CommonRequestEnableNotification("", nullptr, nullptr, bundleOption, true); + return CommonRequestEnableNotification("", nullptr, nullptr, bundleOption, true, easyAbroad); } ErrCode AdvancedNotificationService::CommonRequestEnableNotification(const std::string &deviceId, const sptr &callback, const sptr &callerToken, const sptr bundleOption, - const bool innerLake) + const bool innerLake, + const bool easyAbroad) { ANS_LOGI("%{public}s", __FUNCTION__); ErrCode result = ERR_OK; @@ -1100,7 +1105,8 @@ ErrCode AdvancedNotificationService::CommonRequestEnableNotification(const std:: return ERROR_INTERNAL_ERROR; } - result = dialogManager_->RequestEnableNotificationDailog(bundleOption, callback, callerToken, innerLake); + result = dialogManager_->RequestEnableNotificationDailog(bundleOption, + callback, callerToken, innerLake, easyAbroad); if (result == ERR_OK) { result = ERR_ANS_DIALOG_POP_SUCCEEDED; } diff --git a/services/ans/src/notification_dialog.cpp b/services/ans/src/notification_dialog.cpp index ac53a95455c63f714aec08c964cb18b8356c0532..49414be2c16b2f09dfa9e0a77d4f94f69401a133 100644 --- a/services/ans/src/notification_dialog.cpp +++ b/services/ans/src/notification_dialog.cpp @@ -45,7 +45,8 @@ ErrCode NotificationDialog::StartEnableNotificationDialogAbility( int32_t uid, std::string appBundleName, const sptr &callerToken, - const bool innerLake) + const bool innerLake, + const bool easyAbroad) { ANS_LOGD("%{public}s, Enter.", __func__); @@ -78,6 +79,7 @@ ErrCode NotificationDialog::StartEnableNotificationDialogAbility( root["bundleUid"] = uid; root["ability.want.params.uiExtensionType"] = uiExtensionType; root["innerLake"] = innerLake; + root["easyAbroad"] = easyAbroad; std::string command = root.dump(); auto connection_ = sptr(new (std::nothrow) SystemDialogConnectStb(command)); diff --git a/services/ans/src/notification_dialog_manager.cpp b/services/ans/src/notification_dialog_manager.cpp index 80e17b778ed2f86745e10187a2cec13953a013fa..eae96cf6d29b16b083baf196b2f1eb1ff2dc7191 100644 --- a/services/ans/src/notification_dialog_manager.cpp +++ b/services/ans/src/notification_dialog_manager.cpp @@ -89,7 +89,8 @@ ErrCode NotificationDialogManager::RequestEnableNotificationDailog( const sptr& bundle, const sptr& callback, const sptr& callerToken, - const bool innerLake) + const bool innerLake, + const bool easyAbroad) { if (!AddDialogInfoIfNotExist(bundle, callback)) { ANS_LOGE("AddDialogIfNotExist failed. Dialog already exists. bundle = %{public}s", @@ -102,7 +103,8 @@ ErrCode NotificationDialogManager::RequestEnableNotificationDailog( bundle->GetUid(), bundle->GetBundleName(), callerToken, - innerLake); + innerLake, + easyAbroad); if (result != ERR_OK) { ANS_LOGE("StartEnableNotificationDialogAbility failed, result = %{public}d", result); std::unique_ptr dialogInfoRemoved = nullptr; diff --git a/services/ans/test/unittest/notification_dialog_test/notification_dialog_test.cpp b/services/ans/test/unittest/notification_dialog_test/notification_dialog_test.cpp index b7f5b3e98d036bc614c09d8fb6a9305316c1801a..845f035512fefc2cad60aef0679ff2c88e9d7e32 100644 --- a/services/ans/test/unittest/notification_dialog_test/notification_dialog_test.cpp +++ b/services/ans/test/unittest/notification_dialog_test/notification_dialog_test.cpp @@ -75,6 +75,7 @@ HWTEST_F(NotificationDialogTest, NotificationDialog_00300, Function | SmallTest uid, bundleName, callerToken, + false, false); ASSERT_EQ(result3, ERR_ANS_INVALID_BUNDLE); } @@ -101,6 +102,7 @@ HWTEST_F(NotificationDialogTest, NotificationDialog_00400, Function | SmallTest uid, bundleName, callerToken, + false, false); ASSERT_EQ(result3, ERR_ANS_INVALID_BUNDLE); } diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/ServiceExtAbility/NotificationServiceExtAbility.ts b/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/ServiceExtAbility/NotificationServiceExtAbility.ts index 286cd20273a1dd9f655e341e82c499dd6d827d2c..3b17ff7539748000562a74d0ddd5e7ce380f65f5 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/ServiceExtAbility/NotificationServiceExtAbility.ts +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/ServiceExtAbility/NotificationServiceExtAbility.ts @@ -94,8 +94,9 @@ export class EnableNotificationDialog { subWindow: window.Window; initSubWindowSize: boolean; innerLake: boolean; + easyAbroad: boolean; - constructor(id: number, want: Want, stageModel: boolean, innerLake: boolean) { + constructor(id: number, want: Want, stageModel: boolean, innerLake: boolean, easyAbroad: boolean) { this.id = id; this.want = want; this.stageModel = stageModel; @@ -103,6 +104,7 @@ export class EnableNotificationDialog { this.extensionWindow = undefined; this.initSubWindowSize = false; this.innerLake = innerLake; + this.easyAbroad = easyAbroad; } @@ -286,6 +288,7 @@ class NotificationDialogServiceExtensionAbility extends UIExtensionAbility { let bundleName = want.parameters['ohos.aafwk.param.callerBundleName']; let bundleUid = want.parameters['ohos.aafwk.param.callerUid']; let innerLake = false; + let easyAbroad = false; if (bundleName !== EnableNotificationDialog.SCENEBOARD_BUNDLE && bundleName !== EnableNotificationDialog.SYSTEMUI_BUNDLE) { want.parameters.bundleName = bundleName; @@ -295,11 +298,12 @@ class NotificationDialogServiceExtensionAbility extends UIExtensionAbility { } else { stageModel = false; innerLake = Boolean(want.parameters.innerLake); - console.log(TAG, ` un stage model innerLake = , ${innerLake}`); + easyAbroad = Boolean(want.parameters.easyAbroad); + console.log(TAG, ` un stage model innerLake = ${innerLake}, easyAbroad = ${easyAbroad}`); } console.log(TAG, `UIExtAbility onSessionCreate bundleName ${want.parameters.bundleName}` + `uid ${want.parameters.bundleUid}`); - let dialog = new EnableNotificationDialog(1, want, stageModel, innerLake); + let dialog = new EnableNotificationDialog(1, want, stageModel, innerLake, easyAbroad); await dialog.createUiExtensionWindow(session, stageModel); AppStorage.setOrCreate('dialog', dialog); } catch (err) { diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/pages/notificationDialog.ets b/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/pages/notificationDialog.ets index d17bf72ec6398e255dda38162bd3162508f5f298..881bb7da733be770aebd5b9ab3657feb8adfa6d6 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/pages/notificationDialog.ets +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/pages/notificationDialog.ets @@ -151,10 +151,12 @@ struct PermissionDialog { Row() { Flex({ justifyContent: FlexAlign.Center }) { Text() { - if (!this.dialog.innerLake) { - Span(permission.reason) - } else { + if (this.dialog.easyAbroad) { + Span($r('app.string.reason_cjy')) + } else if (this.dialog.innerLake) { Span($r('app.string.reason_zyt')) + } else { + Span(permission.reason) } } .fontSize(Constants.DIALOG_DESP_FONT_SIZE) diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/base/element/string.json b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/base/element/string.json index e0aebc605dc930e085d3dfbcacbe46aff54c0924..1105e854ca4dbd4705d0f54da0de2c4341b04c8e 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/base/element/string.json +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/base/element/string.json @@ -22,7 +22,11 @@ }, { "name":"reason_zyt", - "value":"These may include lock screen and banner notifications as well as sounds and vibration. You can modify these settings in EasyAbroad > App management." + "value":"These may include lock screen notifications, banners, badges, sounds, and vibration. You can change these settings in DroiTong > App management." + }, + { + "name":"reason_cjy", + "value":"These may include lock screen notifications, banners, badges, sounds, and vibration. You can change these settings in EasyAbroad > App management." }, { "name":"ALLOW", diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/bo_CN/element/string.json b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/bo_CN/element/string.json index b10e0f9b7048c3628807e832166855aa60601b1a..8005286b0d68a9e3fc5a5f2678813e41e1d617bf 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/bo_CN/element/string.json +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/bo_CN/element/string.json @@ -22,7 +22,11 @@ }, { "name":"reason_zyt", - "value":"བརྡ་ཐོའི་དྲན་སྐུལ་གྱི་ཐབས་ལམ་ལ་སྒོ་ལྕགས་བརྙན་ཡོལ་དང་། འཕྲེད་བྱང་། དྲིལ་སྒྲ། སྦིར་བརྡ་སོགས་ཚུད་སྲིད། ༼ཀྲུའོ་དབྱི་ཐུང་༽>༼ ཉེར་སྤྱོད་དོ་དམ་༽ལ་བསྐྱོད་ནས་བཅོས་ཆོག" + "value":"བརྡ་ཐོའི་དྲན་སྐུལ་གྱི་ཐབས་ལམ་ལ་སྒོ་ལྕགས་བརྙན་ཡོལ་དང་། འཕྲེད་བྱང་། ཟུར་རྟགས། དྲིལ་སྒྲ། སྦིར་བརྡ་བཅས་ཚུད་སྲིད། ༼DroiTong༽>༼ ཉེར་སྤྱོད་དོ་དམ་༽ལ་བསྐྱོད་ནས་བཅོས་ཆོག" + }, + { + "name":"reason_cjy", + "value":"བརྡ་ཐོའི་དྲན་སྐུལ་གྱི་ཐབས་ལམ་ལ་སྒོ་ལྕགས་བརྙན་ཡོལ་དང་། འཕྲེད་བྱང་། ཟུར་རྟགས། དྲིལ་སྒྲ། སྦིར་བརྡ་བཅས་ཚུད་སྲིད། ༼ཁོངས་བརྒལ་བདེ་༽>༼ ཉེར་སྤྱོད་དོ་དམ་༽ལ་བསྐྱོད་ནས་བཅོས་ཆོག" }, { "name":"ALLOW", diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/ug/element/string.json b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/ug/element/string.json index 3dc2ca7d03d18a18d9ddd64729c2844320c27205..3ae91b8e3e5cd604a2db7b8987d2fc20c2d6b45c 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/ug/element/string.json +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/ug/element/string.json @@ -22,7 +22,11 @@ }, { "name":"reason_zyt", - "value":"قۇلۇپ ئېكرانى، بالداق، ئاۋاز ۋە تىترەش قاتارلىقلار شۇنىڭ ئىچىدە. DroiTong > ئەپ باشقۇرۇش دېگەن ئورۇندىن ئۆزگەرتەلەيسىز." + "value":"قۇلۇپ ئېكرانى، بالداق، تامغا، ئاۋاز ۋە تىترەش شۇنىڭ ئىچىدە. DroiTong > ئەپ باشقۇرۇش دېگەن ئورۇندىن ئۆزگەرتەلەيسىز." + }, + { + "name":"reason_cjy", + "value":"قۇلۇپ ئېكرانى، بالداق، تامغا، ئاۋاز ۋە تىترەش شۇنىڭ ئىچىدە. چۇجىڭيى (چېگرا قولايلىقى) > ئەپ باشقۇرۇش دېگەن ئورۇندىن ئۆزگەرتەلەيسىز." }, { "name":"ALLOW", diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_CN/element/string.json b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_CN/element/string.json index 6fea84da71fc8f7095a461ed44a59011bb8cb156..42858e4c4db85c84d4e5802a0c3607d740eb0738 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_CN/element/string.json +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_CN/element/string.json @@ -22,7 +22,11 @@ }, { "name":"reason_zyt", - "value":"通知提醒方式可能包括锁屏、横幅、响铃、振动等。可前往“卓易通”>“应用管理”更改。" + "value":"通知提醒方式可能包括锁屏、横幅、角标、响铃、振动。可前往“卓易通”>“应用管理”更改。" + }, + { + "name":"reason_cjy", + "value":"通知提醒方式可能包括锁屏、横幅、角标、响铃、振动。可前往“出境易”>“应用管理”更改。" }, { "name":"ALLOW", diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_HK/element/string.json b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_HK/element/string.json index ad424151c3658ce393bdf423b2aa420e2360cf44..581988e83007a5f5b5f31d5b33c382511ac5201e 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_HK/element/string.json +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_HK/element/string.json @@ -22,7 +22,11 @@ }, { "name":"reason_zyt", - "value":"通知提醒方式可能包括鎖屏、橫幅、響鬧和震動等。可前往「卓易通」>「應用程式管理」更改。" + "value":"通知提醒方式可能包括鎖屏、橫幅、徽章圖標、響鬧、震動。可前往「卓易通」>「應用程式管理」更改。" + }, + { + "name":"reason_cjy", + "value":"通知提醒方式可能包括鎖屏、橫幅、徽章圖標、響鬧、震動。可前往「出境易」>「應用程式管理」更改。" }, { "name":"ALLOW", diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_TW/element/string.json b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_TW/element/string.json index 728172bed8eafd1d379437ca584d15e4424b920e..ab97ad28932eb4ebdc664a7129365512e010d588 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_TW/element/string.json +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_TW/element/string.json @@ -22,7 +22,11 @@ }, { "name":"reason_zyt", - "value":"通知提醒方式可能包括鎖定螢幕、橫幅、響鈴、振動等。您可以前往「卓易通」>「應用程式管理」變更。" + "value":"通知提醒方式可能包括鎖定螢幕、橫幅、徽章圖示、響鈴和振動。您可以前往「卓易通」>「應用程式管理」變更。" + }, + { + "name":"reason_cjy", + "value":"通知提醒方式可能包括鎖定螢幕、橫幅、徽章圖示、響鈴和振動。您可以前往「出境易」>「應用程式管理」變更。" }, { "name":"ALLOW",