已合并
修复windowmanager依赖问题 #6
jiangdayuan创建于 2022年1月4日
修复windowmanager依赖问题 #6
已合并
jiangdayuan创建于 2022年1月4日
从refs/pull/6/head合入到master
共 15 个文件变更+40-22
@@ -14,6 +14,9 @@
14 */14 */
15 15 
16#include "display_manager.h"16#include "display_manager.h"
17+ 
18+#include <inttypes.h>
19+ 
17#include "display_manager_adapter.h"20#include "display_manager_adapter.h"
18#include "window_manager_hilog.h"21#include "window_manager_hilog.h"
19 22 
@@ -89,7 +92,7 @@ std::vector<const sptr<Display>> DisplayManager::GetAllDisplays()
89 if (display != nullptr) {92 if (display != nullptr) {
90 res.push_back(display);93 res.push_back(display);
91 } else {94 } else {
92- WLOGFE("DisplayManager::GetAllDisplays display %llu nullptr!", displayId);95+ WLOGFE("DisplayManager::GetAllDisplays display %" PRIu64" nullptr!", displayId);
93 }96 }
94 }97 }
95 return res;98 return res;
@@ -15,6 +15,7 @@
15 15 
16#include "display_manager_proxy.h"16#include "display_manager_proxy.h"
17 17 
18+#include <inttypes.h>
18#include <ipc_types.h>19#include <ipc_types.h>
19 20 
20#include "window_manager_hilog.h"21#include "window_manager_hilog.h"
@@ -69,7 +70,7 @@ DisplayId DisplayManagerProxy::GetDefaultDisplayId()
69 }70 }
70 71 
71 DisplayId displayId = reply.ReadUint64();72 DisplayId displayId = reply.ReadUint64();
72- WLOGFI("DisplayManagerProxy::GetDefaultDisplayId %llu", displayId);73+ WLOGFI("DisplayManagerProxy::GetDefaultDisplayId %" PRIu64"", displayId);
73 return displayId;74 return displayId;
74}75}
75 76 
@@ -16,6 +16,7 @@
16#include "display_manager_service_inner.h"16#include "display_manager_service_inner.h"
17 17 
18#include <cinttypes>18#include <cinttypes>
19+#include <inttypes.h>
19#include <unistd.h>20#include <unistd.h>
20 21 
21#include <ipc_skeleton.h>22#include <ipc_skeleton.h>
@@ -81,7 +82,7 @@ std::vector<const sptr<DisplayScreen>> DisplayManagerServiceInner::GetAllDisplay
81 if (display != nullptr) {82 if (display != nullptr) {
82 res.push_back(display);83 res.push_back(display);
83 } else {84 } else {
84- WLOGFE("GetAllDisplays display %llu nullptr!", displayId);85+ WLOGFE("GetAllDisplays display %" PRIu64" nullptr!", displayId);
85 }86 }
86 }87 }
87 return res;88 return res;
@@ -13,8 +13,11 @@
13 * limitations under the License.13 * limitations under the License.
14 */14 */
15 15 
16-#include "display_manager.h"
17#include "native_display_module.h"16#include "native_display_module.h"
17+ 
18+#include <inttypes.h>
19+ 
20+#include "display_manager.h"
18#include "wm_common.h"21#include "wm_common.h"
19#include "wm_napi_common.h"22#include "wm_napi_common.h"
20 23 
@@ -40,7 +43,7 @@ void Async(napi_env env, std::unique_ptr<Param> &param)
40 param->wret = WMError::WM_ERROR_NULLPTR;43 param->wret = WMError::WM_ERROR_NULLPTR;
41 return;44 return;
42 }45 }
43- GNAPI_LOG("GetDefaultDisplay: id %llu, w %d, h %d",46+ GNAPI_LOG("GetDefaultDisplay: id %" PRIu64", w %d, h %d",
44 param->display->GetId(), param->display->GetWidth(), param->display->GetHeight());47 param->display->GetId(), param->display->GetWidth(), param->display->GetHeight());
45 param->wret = WMError::WM_OK;48 param->wret = WMError::WM_OK;
46}49}
@@ -24,7 +24,7 @@
24namespace OHOS {24namespace OHOS {
25namespace Rosen {25namespace Rosen {
26namespace {26namespace {
27-napi_value g_classWindow;27+thread_local napi_value g_classWindow;
28napi_status GetAbility(napi_env env, napi_callback_info info, AppExecFwk::Ability* &pAbility)28napi_status GetAbility(napi_env env, napi_callback_info info, AppExecFwk::Ability* &pAbility)
29{29{
30 napi_value global;30 napi_value global;
@@ -23,4 +23,4 @@
23 <distributed>false</distributed> <!-- "true" means the system ability supports distributed scheduling while "false" is not.-->23 <distributed>false</distributed> <!-- "true" means the system ability supports distributed scheduling while "false" is not.-->
24 <dump-level>1</dump-level> <!-- Declare the dump level. 1-high; 2-media; 3-low -->24 <dump-level>1</dump-level> <!-- Declare the dump level. 1-high; 2-media; 3-low -->
25 </systemability>25 </systemability>
26-</info>26+</info>
Rsa_profile/4605.xml→sa_profile/4607.xml+1-1
@@ -15,7 +15,7 @@
15<info>15<info>
16 <process>foundation</process>16 <process>foundation</process>
17 <systemability> <!--Declare a system ability and its profile-->17 <systemability> <!--Declare a system ability and its profile-->
18- <name>4605</name> <!--Declare the name of system ability-->18+ <name>4607</name> <!--Declare the name of system ability-->
19 <libpath>libwms.z.so</libpath> <!--Declare the path of .so file which includes the system ability; Note: 1 .so file have 1 to N sysytem abilities. -->19 <libpath>libwms.z.so</libpath> <!--Declare the path of .so file which includes the system ability; Note: 1 .so file have 1 to N sysytem abilities. -->
20 <!--<depend></depend>--> <!--Declare the name of system abilities which the system ability depends on,using the system ability would start on demand. -->20 <!--<depend></depend>--> <!--Declare the name of system abilities which the system ability depends on,using the system ability would start on demand. -->
21 <!--<depend-time-out></depend-time-out> --> <!-- Check all dependencies are available before the timeout period ended. The MAX_DEPENDENCY_TIMEOUT is 60s. -->21 <!--<depend-time-out></depend-time-out> --> <!-- Check all dependencies are available before the timeout period ended. The MAX_DEPENDENCY_TIMEOUT is 60s. -->
@@ -15,8 +15,8 @@ import("//build/ohos/sa_profile/sa_profile.gni")
15 15 
16ohos_sa_profile("wms_sa_profile") {16ohos_sa_profile("wms_sa_profile") {
17 sources = [17 sources = [
18- "4605.xml",
19 "4606.xml",18 "4606.xml",
19+ "4607.xml",
20 ]20 ]
21 part_name = "window_manager"21 part_name = "window_manager"
22}22}
@@ -14,6 +14,9 @@
14 */14 */
15 15 
16#include "display_manager.h"16#include "display_manager.h"
17+ 
18+#include <inttypes.h>
19+ 
17#include "display_manager_adapter.h"20#include "display_manager_adapter.h"
18#include "window_manager_hilog.h"21#include "window_manager_hilog.h"
19 22 
@@ -89,7 +92,7 @@ std::vector<const sptr<Display>> DisplayManager::GetAllDisplays()
89 if (display != nullptr) {92 if (display != nullptr) {
90 res.push_back(display);93 res.push_back(display);
91 } else {94 } else {
92- WLOGFE("DisplayManager::GetAllDisplays display %llu nullptr!", displayId);95+ WLOGFE("DisplayManager::GetAllDisplays display %" PRIu64" nullptr!", displayId);
93 }96 }
94 }97 }
95 return res;98 return res;
@@ -15,6 +15,7 @@
15 15 
16#include "display_manager_proxy.h"16#include "display_manager_proxy.h"
17 17 
18+#include <inttypes.h>
18#include <ipc_types.h>19#include <ipc_types.h>
19 20 
20#include "window_manager_hilog.h"21#include "window_manager_hilog.h"
@@ -69,7 +70,7 @@ DisplayId DisplayManagerProxy::GetDefaultDisplayId()
69 }70 }
70 71 
71 DisplayId displayId = reply.ReadUint64();72 DisplayId displayId = reply.ReadUint64();
72- WLOGFI("DisplayManagerProxy::GetDefaultDisplayId %llu", displayId);73+ WLOGFI("DisplayManagerProxy::GetDefaultDisplayId %" PRIu64"", displayId);
73 return displayId;74 return displayId;
74}75}
75 76 
@@ -16,6 +16,7 @@
16#include "display_manager_service_inner.h"16#include "display_manager_service_inner.h"
17 17 
18#include <cinttypes>18#include <cinttypes>
19+#include <inttypes.h>
19#include <unistd.h>20#include <unistd.h>
20 21 
21#include <ipc_skeleton.h>22#include <ipc_skeleton.h>
@@ -81,7 +82,7 @@ std::vector<const sptr<DisplayScreen>> DisplayManagerServiceInner::GetAllDisplay
81 if (display != nullptr) {82 if (display != nullptr) {
82 res.push_back(display);83 res.push_back(display);
83 } else {84 } else {
84- WLOGFE("GetAllDisplays display %llu nullptr!", displayId);85+ WLOGFE("GetAllDisplays display %" PRIu64" nullptr!", displayId);
85 }86 }
86 }87 }
87 return res;88 return res;
@@ -13,8 +13,11 @@
13 * limitations under the License.13 * limitations under the License.
14 */14 */
15 15 
16-#include "display_manager.h"
17#include "native_display_module.h"16#include "native_display_module.h"
17+ 
18+#include <inttypes.h>
19+ 
20+#include "display_manager.h"
18#include "wm_common.h"21#include "wm_common.h"
19#include "wm_napi_common.h"22#include "wm_napi_common.h"
20 23 
@@ -40,7 +43,7 @@ void Async(napi_env env, std::unique_ptr<Param> &param)
40 param->wret = WMError::WM_ERROR_NULLPTR;43 param->wret = WMError::WM_ERROR_NULLPTR;
41 return;44 return;
42 }45 }
43- GNAPI_LOG("GetDefaultDisplay: id %llu, w %d, h %d",46+ GNAPI_LOG("GetDefaultDisplay: id %" PRIu64", w %d, h %d",
44 param->display->GetId(), param->display->GetWidth(), param->display->GetHeight());47 param->display->GetId(), param->display->GetWidth(), param->display->GetHeight());
45 param->wret = WMError::WM_OK;48 param->wret = WMError::WM_OK;
46}49}
Rwmtest/sa_profile/4605.xml→wmtest/sa_profile/4607.xml+2-2
@@ -15,7 +15,7 @@
15<info>15<info>
16 <process>foundation</process>16 <process>foundation</process>
17 <systemability> <!--Declare a system ability and its profile-->17 <systemability> <!--Declare a system ability and its profile-->
18- <name>4605</name> <!--Declare the name of system ability-->18+ <name>4607</name> <!--Declare the name of system ability-->
19 <libpath>libwms.z.so</libpath> <!--Declare the path of .so file which includes the system ability; Note: 1 .so file have 1 to N sysytem abilities. -->19 <libpath>libwms.z.so</libpath> <!--Declare the path of .so file which includes the system ability; Note: 1 .so file have 1 to N sysytem abilities. -->
20 <!--<depend></depend>--> <!--Declare the name of system abilities which the system ability depends on,using the system ability would start on demand. -->20 <!--<depend></depend>--> <!--Declare the name of system abilities which the system ability depends on,using the system ability would start on demand. -->
21 <!--<depend-time-out></depend-time-out> --> <!-- Check all dependencies are available before the timeout period ended. The MAX_DEPENDENCY_TIMEOUT is 60s. -->21 <!--<depend-time-out></depend-time-out> --> <!-- Check all dependencies are available before the timeout period ended. The MAX_DEPENDENCY_TIMEOUT is 60s. -->
@@ -23,4 +23,4 @@
23 <distributed>false</distributed> <!-- "true" means the system ability supports distributed scheduling while "false" is not.-->23 <distributed>false</distributed> <!-- "true" means the system ability supports distributed scheduling while "false" is not.-->
24 <dump-level>1</dump-level> <!-- Declare the dump level. 1-high; 2-media; 3-low -->24 <dump-level>1</dump-level> <!-- Declare the dump level. 1-high; 2-media; 3-low -->
25 </systemability>25 </systemability>
26-</info>26+</info>
@@ -15,8 +15,8 @@ import("//build/ohos/sa_profile/sa_profile.gni")
15 15 
16ohos_sa_profile("wms_sa_profile") {16ohos_sa_profile("wms_sa_profile") {
17 sources = [17 sources = [
18- "4605.xml",
19 "4606.xml",18 "4606.xml",
19+ "4607.xml",
20 ]20 ]
21 part_name = "window_manager"21 part_name = "window_manager"
22}22}
@@ -16,7 +16,9 @@
16#include "dm_native_test.h"16#include "dm_native_test.h"
17 17 
18#include <cstdio>18#include <cstdio>
19+#include <inttypes.h>
19#include <unistd.h>20#include <unistd.h>
21+ 
20#include "wm_common.h"22#include "wm_common.h"
21#include "display_manager.h"23#include "display_manager.h"
22#include "singleton_container.h"24#include "singleton_container.h"
@@ -61,13 +63,13 @@ void DMNativeTest::Run(int32_t argc, const char **argv)
61 }63 }
62 64 
63 DisplayId displayId = dms->GetDefaultDisplayId();65 DisplayId displayId = dms->GetDefaultDisplayId();
64- printf("defaultDisplayId: %llu\n", displayId);66+ printf("defaultDisplayId: %" PRIu64"\n", displayId);
65 67 
66 auto display = dms->GetDefaultDisplay();68 auto display = dms->GetDefaultDisplay();
67 if (display == nullptr) {69 if (display == nullptr) {
68 printf("GetDefaultDisplay: failed!\n");70 printf("GetDefaultDisplay: failed!\n");
69 } else {71 } else {
70- printf("GetDefaultDisplay: id %llu, w %d, h %d, fps %u\n", display->GetId(), display->GetWidth(),72+ printf("GetDefaultDisplay: id %" PRIu64", w %d, h %d, fps %u\n", display->GetId(), display->GetWidth(),
71 display->GetHeight(), display->GetFreshRate());73 display->GetHeight(), display->GetFreshRate());
72 }74 }
73 75 
@@ -75,9 +77,9 @@ void DMNativeTest::Run(int32_t argc, const char **argv)
75 for (auto id: ids) {77 for (auto id: ids) {
76 display = dms->GetDisplayById(displayId);78 display = dms->GetDisplayById(displayId);
77 if (display == nullptr) {79 if (display == nullptr) {
78- printf("GetDisplayById(%llu): failed!\n", id);80+ printf("GetDisplayById(%" PRIu64"): failed!\n", id);
79 } else {81 } else {
80- printf("GetDisplayById(%llu): id %llu, w %d, h %d, fps %u\n", id, display->GetId(), display->GetWidth(),82+ printf("GetDisplayById(%" PRIu64"): id %" PRIu64", w %d, h %d, fps %u\n", id, display->GetId(), display->GetWidth(),
81 display->GetHeight(), display->GetFreshRate());83 display->GetHeight(), display->GetFreshRate());
82 }84 }
83 }85 }
@@ -87,7 +89,7 @@ void DMNativeTest::Run(int32_t argc, const char **argv)
87 if (disp == nullptr) {89 if (disp == nullptr) {
88 printf("GetAllDisplays: failed!\n");90 printf("GetAllDisplays: failed!\n");
89 } else {91 } else {
90- printf("GetAllDisplays: id %llu, w %d, h %d, fps %u\n", disp->GetId(), disp->GetWidth(),92+ printf("GetAllDisplays: id %" PRIu64", w %d, h %d, fps %u\n", disp->GetId(), disp->GetWidth(),
91 disp->GetHeight(), disp->GetFreshRate());93 disp->GetHeight(), disp->GetFreshRate());
92 }94 }
93 }95 }