use of com.android.server.ServiceThread in project android_frameworks_base by ResurrectionRemix.
the class RetailDemoModeService method onStart.
@Override
public void onStart() {
if (DEBUG) {
Slog.d(TAG, "Service starting up");
}
mHandlerThread = new ServiceThread(TAG, android.os.Process.THREAD_PRIORITY_FOREGROUND, false);
mHandlerThread.start();
mHandler = new MainHandler(mHandlerThread.getLooper());
publishLocalService(RetailDemoModeServiceInternal.class, mLocalService);
}
use of com.android.server.ServiceThread in project android_frameworks_base by crdroidandroid.
the class NetworkLogger method startNetworkLogging.
boolean startNetworkLogging() {
Log.d(TAG, "Starting network logging.");
if (!checkIpConnectivityMetricsService()) {
// the IIpConnectivityMetrics service should have been present at this point
Slog.wtf(TAG, "Failed to register callback with IIpConnectivityMetrics.");
return false;
}
try {
if (mIpConnectivityMetrics.registerNetdEventCallback(mNetdEventCallback)) {
mHandlerThread = new ServiceThread(TAG, Process.THREAD_PRIORITY_BACKGROUND, /* allowIo */
false);
mHandlerThread.start();
mNetworkLoggingHandler = new NetworkLoggingHandler(mHandlerThread.getLooper(), mDpm);
mNetworkLoggingHandler.scheduleBatchFinalization();
mIsLoggingEnabled.set(true);
return true;
} else {
return false;
}
} catch (RemoteException re) {
Slog.wtf(TAG, "Failed to make remote calls to register the callback", re);
return false;
}
}
use of com.android.server.ServiceThread in project platform_frameworks_base by android.
the class RetailDemoModeService method onStart.
@Override
public void onStart() {
if (DEBUG) {
Slog.d(TAG, "Service starting up");
}
mHandlerThread = new ServiceThread(TAG, android.os.Process.THREAD_PRIORITY_FOREGROUND, false);
mHandlerThread.start();
mHandler = new MainHandler(mHandlerThread.getLooper());
publishLocalService(RetailDemoModeServiceInternal.class, mLocalService);
}
use of com.android.server.ServiceThread in project android_frameworks_base by DirtyUnicorns.
the class NetworkLogger method startNetworkLogging.
boolean startNetworkLogging() {
Log.d(TAG, "Starting network logging.");
if (!checkIpConnectivityMetricsService()) {
// the IIpConnectivityMetrics service should have been present at this point
Slog.wtf(TAG, "Failed to register callback with IIpConnectivityMetrics.");
return false;
}
try {
if (mIpConnectivityMetrics.registerNetdEventCallback(mNetdEventCallback)) {
mHandlerThread = new ServiceThread(TAG, Process.THREAD_PRIORITY_BACKGROUND, /* allowIo */
false);
mHandlerThread.start();
mNetworkLoggingHandler = new NetworkLoggingHandler(mHandlerThread.getLooper(), mDpm);
mNetworkLoggingHandler.scheduleBatchFinalization();
mIsLoggingEnabled.set(true);
return true;
} else {
return false;
}
} catch (RemoteException re) {
Slog.wtf(TAG, "Failed to make remote calls to register the callback", re);
return false;
}
}
use of com.android.server.ServiceThread in project android_frameworks_base by DirtyUnicorns.
the class RetailDemoModeService method onStart.
@Override
public void onStart() {
if (DEBUG) {
Slog.d(TAG, "Service starting up");
}
mHandlerThread = new ServiceThread(TAG, android.os.Process.THREAD_PRIORITY_FOREGROUND, false);
mHandlerThread.start();
mHandler = new MainHandler(mHandlerThread.getLooper());
publishLocalService(RetailDemoModeServiceInternal.class, mLocalService);
}
Aggregations