1 // Copyright 2020 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 package org.chromium.components.browser_ui.photo_picker;
6 
7 import android.app.Service;
8 import android.content.Intent;
9 import android.os.IBinder;
10 
11 import org.chromium.base.annotations.MainDex;
12 import org.chromium.base.library_loader.LibraryLoader;
13 
14 /**
15  * A service to accept requests to take image file contents and decode them, used for tests.
16  */
17 @MainDex
18 public class TestImageDecoderService extends Service {
19     private final ImageDecoder mDecoder = new ImageDecoder();
20 
21     @Override
onCreate()22     public void onCreate() {
23         LibraryLoader.getInstance().ensureInitialized();
24         mDecoder.initializeSandbox();
25     }
26 
27     @Override
onBind(Intent intent)28     public IBinder onBind(Intent intent) {
29         return mDecoder;
30     }
31 }
32