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

Commit 280a4cfb authored by Yurii Zubrytskyi's avatar Yurii Zubrytskyi
Browse files

[idmap] Add logging for the service start/stop

As of now it's impossible to tell what happened or is happening
to idmap2d - and that's the important thing in the bug. Adding
some logging to help investigating it if it happens again

Bug: 219393586
Test: manual
Change-Id: Ia6615f80d8a4b7ba94714f0af10e09ba9d709bb6
parent fc5f85a8
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -15,14 +15,14 @@
 */

#define ATRACE_TAG ATRACE_TAG_RESOURCES
#define LOG_TAG "idmap2d"
#include "android-base/logging.h"

#include <binder/BinderService.h>
#include <binder/IPCThreadState.h>
#include <binder/ProcessState.h>

#include <cstdlib>  // EXIT_{FAILURE,SUCCESS}
#include <iostream>
#include <sstream>

#include "Idmap2Service.h"
#include "android-base/macros.h"
@@ -35,14 +35,17 @@ using android::status_t;
using android::os::Idmap2Service;

int main(int argc ATTRIBUTE_UNUSED, char** argv ATTRIBUTE_UNUSED) {
  LOG(INFO) << "Starting";
  IPCThreadState::disableBackgroundScheduling(true);
  status_t ret = BinderService<Idmap2Service>::publish();
  if (ret != android::OK) {
    LOG(ERROR) << "Failed to start: " << ret;
    return EXIT_FAILURE;
  }
  sp<ProcessState> ps(ProcessState::self());
  ps->startThreadPool();
  ps->giveThreadPoolName();
  IPCThreadState::self()->joinThreadPool();
  LOG(INFO) << "Exiting";
  return EXIT_SUCCESS;
}