1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "ProfileUnlockerAndroid.h"
6 #include "nsPrintfCString.h"
11 ProfileUnlockerAndroid::ProfileUnlockerAndroid(const pid_t aPid
) : mPid(aPid
) {}
13 ProfileUnlockerAndroid::~ProfileUnlockerAndroid() {}
15 NS_IMPL_ISUPPORTS(ProfileUnlockerAndroid
, nsIProfileUnlocker
)
18 ProfileUnlockerAndroid::Unlock(uint32_t aSeverity
) {
19 if (aSeverity
!= FORCE_QUIT
) {
20 return NS_ERROR_NOT_IMPLEMENTED
;
23 NS_WARNING(nsPrintfCString("Process %d has the profile "
24 "lock, will try to kill it.",
27 if (mPid
== getpid()) {
28 NS_ERROR("Lock held by current process !?");
29 return NS_ERROR_FAILURE
;
31 if (kill(mPid
, SIGKILL
) != 0) {
32 NS_WARNING("Could not kill process.");
37 } // namespace mozilla