--- /dev/null
+#include "e_mod_main.h"
+#include "e_mod_ivi_home.h"
+#include "e_policy_wl.h"
+#include "e_appinfo.h"
+#include <aul/aul.h>
+#include <pkgmgr-info.h>
+
+#define RESOLUTION_360X360 360
+#define RESOLUTION_440X440 440
+
+static Eina_List *e_policy_wl_hook_handlers;
+
+static void
+_e_wm_policy_cb_base_output_resolution_get(void *data, pid_t pid)
+{
+ int ret = 0;
+ int width = 0, height = 0;
+ char appid[256] = {0};
+ char *resolution = NULL;
+ E_Appinfo *epai = NULL;
+ pkgmgrinfo_appinfo_h appinfo = NULL;
+
+ ret = aul_app_get_appid_bypid(pid, appid, sizeof(appid));
+ if (ret < 0)
+ {
+ ELOGF("CONFIGURED_RES", "APP_ID_GET|failed to get appid", NULL);
+ return;
+ }
+
+ ret = pkgmgrinfo_appinfo_get_appinfo(appid, &appinfo);
+ if (ret != PMINFO_R_OK || appinfo == NULL)
+ {
+ ELOGF("CONFIGURED_RES", "PKG_INFO_GET|failed to get appinfo", NULL);
+ return;
+ }
+
+ ret = pkgmgrinfo_appinfo_get_metadata_value(appinfo,
+ "http://tizen.org/metadata/app_ui_type/base_screen_resolution",
+ &resolution);
+
+ if (ret != PMINFO_R_OK || resolution == NULL)
+ {
+ ELOGF("CONFIGURED_RES", "MEAT_DATA_GET|failed to get metadata", NULL);
+ return;
+ }
+
+ ELOGF("CONFIGURED_RES", "screen size(%dx%d), user apptype(%s)", NULL,
+ e_comp->w, e_comp->h, resolution);
+
+ // set the 440x440 base_screen_resolution when the meta_data from app_info is 4k
+ // TODO: 4k value is used temporary one. AppFW has to define the new value for the 440x440 resolution.
+ if (!e_util_strcmp(resolution, "4k"))
+ {
+ width = RESOLUTION_440X440;
+ height = RESOLUTION_440X440;
+ }
+ else
+ {
+ ELOGF("CONFIGURED_RES", "ERROR: Wrong apptype was used : resolution(%s)", NULL, resolution);
+ width = RESOLUTION_360X360;
+ height = RESOLUTION_360X360;
+ }
+
+ epai = e_appinfo_find_with_pid(pid);
+ if (!epai)
+ {
+ ELOGF("CONFIGURED_RES", "APPINFO_GET|fail to find pid.(pid:%d)", NULL, pid);
+ return;
+ }
+
+ if (!e_appinfo_base_output_resolution_set(epai, width, height))
+ {
+ ELOGF("CONFIGURED_RES", "RESOLUTION_SET|fail to set base_output_resolution (pid:%d)", NULL, pid);
+ return;
+ }
+
+ ELOGF("CONFIGURED_RES", "RESOLUTION_SET|SET base_output_resolution(%d, %d) (pid:%d)", NULL, width, height, pid);
+}
+
+EINTERN void
+e_mod_configured_resolution_init(void)
+{
+ e_policy_wl_hook_handlers = eina_list_append(e_policy_wl_hook_handlers, e_policy_wl_hook_add(E_POLICY_WL_HOOK_BASE_OUTPUT_RESOLUTION_GET,
+ _e_wm_policy_cb_base_output_resolution_get,
+ NULL));
+}
+
+EINTERN void
+e_mod_configured_resolution_shutdown(void)
+{
+ E_FREE_LIST(e_policy_wl_hook_handlers, e_policy_wl_hook_del);
+}
#include "e_mod_rotation.h"
#include "e_mod_pol_pingpong.h"
#include "e_mod_ivi_home.h"
+#include "e_mod_configured_resolution.h"
#include <stdlib.h>
#include <system_info.h>
e_mod_pol_conf_init(mod);
e_mod_pol_rotation_init();
e_mod_pol_pingpong_init();
+ e_mod_configured_resolution_init();
if (_tz_profile_type_get() == TZ_PROFILE_TYPE_IVI)
e_mod_ivi_home_init();
{
Mod *mod = m->data;
+ e_mod_configured_resolution_shutdown();
e_mod_pol_pingpong_shutdown();
e_mod_pol_rotation_shutdown();
e_mod_pol_conf_shutdown(mod);