• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright (C) 2020 The Android Open Source Project
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 // clang-format off
18 #include "native_bridge_support/vdso/interceptable_functions.h"
19 
20 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getAlphaFlags);
21 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getAndroidBitmapFormat);
22 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getDataSpace);
23 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getHeight);
24 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getMimeType);
25 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getWidth);
26 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_computeSampledSize);
27 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_createFromAAsset);
28 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_createFromBuffer);
29 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_createFromFd);
30 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_decodeImage);
31 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_delete);
32 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_getHeaderInfo);
33 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_getMinimumStride);
34 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_setAndroidBitmapFormat);
35 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_setCrop);
36 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_setDataSpace);
37 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_setTargetSize);
38 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_setUnpremultipliedRequired);
39 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_compress);
40 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_getDataSpace);
41 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_getHardwareBuffer);
42 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_getInfo);
43 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_lockPixels);
44 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_unlockPixels);
45 
init_stub_library()46 static void __attribute__((constructor(0))) init_stub_library() {
47   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getAlphaFlags);
48   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getAndroidBitmapFormat);
49   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getDataSpace);
50   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getHeight);
51   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getMimeType);
52   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getWidth);
53   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_computeSampledSize);
54   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_createFromAAsset);
55   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_createFromBuffer);
56   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_createFromFd);
57   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_decodeImage);
58   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_delete);
59   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_getHeaderInfo);
60   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_getMinimumStride);
61   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_setAndroidBitmapFormat);
62   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_setCrop);
63   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_setDataSpace);
64   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_setTargetSize);
65   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_setUnpremultipliedRequired);
66   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_compress);
67   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_getDataSpace);
68   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_getHardwareBuffer);
69   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_getInfo);
70   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_lockPixels);
71   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_unlockPixels);
72 }
73 // clang-format on
74