Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65284100 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes Ia080132f,I0d344b5f am: 1f50b0ed am: 069fa357 am: e67e5b02

parents 7bf2643d e67e5b02
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -368,8 +368,9 @@ runs the service.
  given console.
  given console.


`task_profiles <profile> [ <profile>\* ]`
`task_profiles <profile> [ <profile>\* ]`
> Set task profiles for the process when it forks. This is designed to replace the use of
> Set task profiles. Before Android U, the profiles are applied to the main thread of the service.
  writepid option for moving a process into a cgroup.
  For Android U and later, the profiles are applied to the entire service process. This is designed
  to replace the use of writepid option for moving a process into a cgroup.


`timeout_period <seconds>`
`timeout_period <seconds>`
> Provide a timeout after which point the service will be killed. The oneshot keyword is respected
> Provide a timeout after which point the service will be killed. The oneshot keyword is respected
+3 −0
Original line number Original line Diff line number Diff line
@@ -29,6 +29,9 @@
#define __ANDROID_API_P__ 28
#define __ANDROID_API_P__ 28
#define __ANDROID_API_Q__ 29
#define __ANDROID_API_Q__ 29
#define __ANDROID_API_R__ 30
#define __ANDROID_API_R__ 30
#define __ANDROID_API_S__ 31
#define __ANDROID_API_T__ 33
#define __ANDROID_API_U__ 34


// sys/system_properties.h
// sys/system_properties.h
#define PROP_VALUE_MAX 92
#define PROP_VALUE_MAX 92
+12 −2
Original line number Original line Diff line number Diff line
@@ -546,9 +546,19 @@ void Service::RunService(const std::vector<Descriptor>& descriptors,
        _exit(EXIT_FAILURE);
        _exit(EXIT_FAILURE);
    }
    }


    if (task_profiles_.size() > 0 && !SetTaskProfiles(getpid(), task_profiles_)) {
    if (task_profiles_.size() > 0) {
        bool succeeded = SelinuxGetVendorAndroidVersion() < __ANDROID_API_U__
                                 ?
                                 // Compatibility mode: apply the task profiles to the current
                                 // thread.
                                 SetTaskProfiles(getpid(), task_profiles_)
                                 :
                                 // Apply the task profiles to the current process.
                                 SetProcessProfiles(getuid(), getpid(), task_profiles_);
        if (!succeeded) {
            LOG(ERROR) << "failed to set task profiles";
            LOG(ERROR) << "failed to set task profiles";
        }
        }
    }


    // As requested, set our gid, supplemental gids, uid, context, and
    // As requested, set our gid, supplemental gids, uid, context, and
    // priority. Aborts on failure.
    // priority. Aborts on failure.