~phablet-team/platform-api/mir-packaging

« back to all changes in this revision

Viewing changes to android/hybris/lifecycle_helpers.h

  • Committer: Tarmac
  • Author(s): Ricardo Mendoza
  • Date: 2013-06-11 07:26:38 UTC
  • mfrom: (61.2.2 working-trunk)
  • Revision ID: tarmac-20130611072638-u7qim1u78yeovkbd
Allow remote App Manager to take care of signalling processes.

Approved by Ricardo Salveti, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
{
29
29
struct ProcessKiller : public android::Thread
30
30
{
31
 
    ProcessKiller(const android::sp<ubuntu::detail::ApplicationSession>& as) : as(as)
 
31
    ProcessKiller(const android::sp<ubuntu::detail::ApplicationSession>& as,
 
32
                  const android::sp<android::IAMTaskController>& controller) : as(as),
 
33
                                                                               task_controller(controller)
32
34
    {
33
35
    }
34
36
 
40
42
        if (as->running_state == ubuntu::application::ui::process_suspended)
41
43
        {
42
44
            ALOGI("%s() Suspending process", __PRETTY_FUNCTION__);
43
 
            kill(as->pid, SIGSTOP); // delegate timer elapsed
 
45
            if (task_controller == NULL)
 
46
                kill(as->pid, SIGSTOP); // delegate timer elapsed
 
47
            else
 
48
                task_controller->suspend_task(as->remote_pid);
44
49
        }
45
50
 
46
51
        return false;
47
52
    }
48
53
 
 
54
    android::sp<android::IAMTaskController> task_controller;
49
55
    android::sp<ubuntu::detail::ApplicationSession> as;
50
56
    android::Mutex state_lock;
51
57
    android::Condition state_cond;