• 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(AImageDecoderFrameInfo_create);
21 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderFrameInfo_delete);
22 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderFrameInfo_getBlendOp);
23 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderFrameInfo_getDisposeOp);
24 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderFrameInfo_getDuration);
25 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderFrameInfo_getFrameRect);
26 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderFrameInfo_hasAlphaWithinBounds);
27 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getAlphaFlags);
28 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getAndroidBitmapFormat);
29 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getDataSpace);
30 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getHeight);
31 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getMimeType);
32 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoderHeaderInfo_getWidth);
33 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_advanceFrame);
34 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_computeSampledSize);
35 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_createFromAAsset);
36 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_createFromBuffer);
37 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_createFromFd);
38 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_decodeImage);
39 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_delete);
40 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_getFrameInfo);
41 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_getHeaderInfo);
42 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_getMinimumStride);
43 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_getRepeatCount);
44 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_isAnimated);
45 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_resultToString);
46 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_rewind);
47 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_setAndroidBitmapFormat);
48 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_setCrop);
49 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_setDataSpace);
50 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_setInternallyHandleDisposePrevious);
51 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_setTargetSize);
52 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AImageDecoder_setUnpremultipliedRequired);
53 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_compress);
54 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_getDataSpace);
55 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_getHardwareBuffer);
56 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_getInfo);
57 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_lockPixels);
58 DEFINE_INTERCEPTABLE_STUB_FUNCTION(AndroidBitmap_unlockPixels);
59 
init_stub_library()60 static void __attribute__((constructor(0))) init_stub_library() {
61   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderFrameInfo_create);
62   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderFrameInfo_delete);
63   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderFrameInfo_getBlendOp);
64   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderFrameInfo_getDisposeOp);
65   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderFrameInfo_getDuration);
66   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderFrameInfo_getFrameRect);
67   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderFrameInfo_hasAlphaWithinBounds);
68   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getAlphaFlags);
69   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getAndroidBitmapFormat);
70   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getDataSpace);
71   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getHeight);
72   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getMimeType);
73   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoderHeaderInfo_getWidth);
74   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_advanceFrame);
75   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_computeSampledSize);
76   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_createFromAAsset);
77   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_createFromBuffer);
78   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_createFromFd);
79   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_decodeImage);
80   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_delete);
81   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_getFrameInfo);
82   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_getHeaderInfo);
83   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_getMinimumStride);
84   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_getRepeatCount);
85   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_isAnimated);
86   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_resultToString);
87   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_rewind);
88   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_setAndroidBitmapFormat);
89   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_setCrop);
90   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_setDataSpace);
91   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_setInternallyHandleDisposePrevious);
92   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_setTargetSize);
93   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AImageDecoder_setUnpremultipliedRequired);
94   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_compress);
95   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_getDataSpace);
96   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_getHardwareBuffer);
97   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_getInfo);
98   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_lockPixels);
99   INIT_INTERCEPTABLE_STUB_FUNCTION("libjnigraphics.so", AndroidBitmap_unlockPixels);
100 }
101 // clang-format on
102