#define PID_BUFFER_SIZE 64
#define APPID_BUFFER_SIZE 1024
-namespace AskUser {
-
-namespace Notification {
+namespace {
const char* LAUNCH_MODE_GROUP = "group";
const char* LAUNCH_MODE_SINGLE = "single";
}
switch(app_type) {
- case APP_INFO_APP_COMPONENT_TYPE_SERVICE_APP:
- case APP_INFO_APP_COMPONENT_TYPE_WIDGET_APP:
- case APP_INFO_APP_COMPONENT_TYPE_WATCH_APP:
- return LAUNCH_MODE_SINGLE;
-
case APP_INFO_APP_COMPONENT_TYPE_UI_APP :
return LAUNCH_MODE_GROUP;
+ case APP_INFO_APP_COMPONENT_TYPE_SERVICE_APP:
+ case APP_INFO_APP_COMPONENT_TYPE_WIDGET_APP:
+ case APP_INFO_APP_COMPONENT_TYPE_WATCH_APP:
case APP_INFO_APP_COMPONENT_TYPE_COMPONENT_BASED_APP:
default:
- component_info_h component;
- ret = component_info_create(app_id.c_str(), &component);
+ return LAUNCH_MODE_SINGLE;
+ }
+}
- if (ret) {
- ALOGE("Cannot retrieve component info for app id : " << app_id);
- return LAUNCH_MODE_SINGLE;
- }
+} // namespace anonymous
- component_info_component_type_e component_type;
- ret = component_info_get_component_type(component, &component_type);
- component_info_destroy(component);
+namespace AskUser {
- if (ret) {
- ALOGE("Cannot retrieve component info for app id : " << app_id);
- return LAUNCH_MODE_SINGLE;
- }
+namespace Notification {
- return component_type == COMPONENT_INFO_COMPONENT_TYPE_FRAME ? LAUNCH_MODE_GROUP : LAUNCH_MODE_SINGLE;
- }
-}
bool UIAppInvoker::invoke(int popup_id, pid_t caller_app_pid, const std::string &pkg_id, const std::vector<std::string> &privacies) {
ALOGD("Launching popup app for popup_id: " << popup_id << ", pkg_id of requestor app: " << pkg_id);