| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.base; | 5 package org.chromium.base; |
| 6 | 6 |
| 7 import android.app.Service; | 7 import android.app.Service; |
| 8 import android.content.Intent; | 8 import android.content.Intent; |
| 9 import android.os.Bundle; | 9 import android.os.Bundle; |
| 10 import android.os.Handler; | 10 import android.os.Handler; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 public IBinder onBind(Intent intent) { | 157 public IBinder onBind(Intent intent) { |
| 158 return mBinder; | 158 return mBinder; |
| 159 } | 159 } |
| 160 | 160 |
| 161 private void loadLibraries() { | 161 private void loadLibraries() { |
| 162 try { | 162 try { |
| 163 LibraryLoader.get(LibraryProcessType.PROCESS_CHILD).loadNow(); | 163 LibraryLoader.get(LibraryProcessType.PROCESS_CHILD).loadNow(); |
| 164 } catch (ProcessInitException pie) { | 164 } catch (ProcessInitException pie) { |
| 165 Log.e(TAG, "Unable to load native libraries.", pie); | 165 Log.e(TAG, "Unable to load native libraries.", pie); |
| 166 } | 166 } |
| 167 ContextUtils.initApplicationContextForNative(); | |
| 168 } | 167 } |
| 169 | 168 |
| 170 private void setMainReturnValue(int result) { | 169 private void setMainReturnValue(int result) { |
| 171 synchronized (mResultLock) { | 170 synchronized (mResultLock) { |
| 172 mResult = new MainReturnCodeResult(result, false /* timed-out */); | 171 mResult = new MainReturnCodeResult(result, false /* timed-out */); |
| 173 mResultLock.notifyAll(); | 172 mResultLock.notifyAll(); |
| 174 } | 173 } |
| 175 } | 174 } |
| 176 | 175 |
| 177 private static void markInitialized() { | 176 private static void markInitialized() { |
| 178 // We don't set sAlreadyInitialized directly in onCreate to avoid FindBu
gs complaining about | 177 // We don't set sAlreadyInitialized directly in onCreate to avoid FindBu
gs complaining about |
| 179 // a static member been set from a non-static function. | 178 // a static member been set from a non-static function. |
| 180 sAlreadyInitialized = true; | 179 sAlreadyInitialized = true; |
| 181 } | 180 } |
| 182 } | 181 } |
| OLD | NEW |