File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed
android/src/main/java/com/instabug/reactlibrary Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 3
3
4
4
import android .os .Handler ;
5
5
import android .os .Looper ;
6
+ import android .os .SystemClock ;
6
7
7
8
import com .facebook .react .bridge .Callback ;
8
9
import com .facebook .react .bridge .ReactApplicationContext ;
@@ -33,6 +34,21 @@ public String getName() {
33
34
return "IBGAPM" ;
34
35
}
35
36
37
+ /**
38
+ * Sets the printed logs priority. Filter to one of the following levels.
39
+ *
40
+ * @param logLevel the priority level.
41
+ */
42
+ @ ReactMethod
43
+ public void ibgSleep () {
44
+ MainThreadHandler .runOnMainThread (new Runnable () {
45
+ @ Override
46
+ public void run () {
47
+ SystemClock .sleep (3000 );
48
+ }
49
+ });
50
+ }
51
+
36
52
/**
37
53
* Sets the printed logs priority. Filter to one of the following levels.
38
54
*
Original file line number Diff line number Diff line change @@ -35,6 +35,21 @@ - (id) init
35
35
return self;
36
36
}
37
37
38
+ RCT_EXPORT_METHOD (ibgSleep) {
39
+ [NSThread sleepForTimeInterval: 3 .0f ];
40
+ // for (int i = 1; i <= 1000000; i++)
41
+ // {
42
+ // double value = sqrt(i);
43
+
44
+ // printf("%@", [NSNumber numberWithDouble:value]);
45
+ // }
46
+ // [NSThread sleepForTimeInterval:3.0f];
47
+ }
48
+
49
+ RCT_EXPORT_METHOD (setLogLevel:(IBGLogLevel)_logLevel) {
50
+ IBGAPM.logLevel = _logLevel;
51
+ }
52
+
38
53
RCT_EXPORT_METHOD (setEnabled:(BOOL )isEnabled) {
39
54
IBGAPM.enabled = isEnabled;
40
55
}
Original file line number Diff line number Diff line change @@ -100,4 +100,11 @@ export default {
100
100
endUITrace ( ) {
101
101
IBGAPM . endUITrace ( ) ;
102
102
} ,
103
+
104
+ /**
105
+ * Used for internal testing.
106
+ */
107
+ _ibgSleep ( ) {
108
+ IBGAPM . ibgSleep ( ) ;
109
+ }
103
110
} ;
You can’t perform that action at this time.
0 commit comments