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 33
44import android .os .Handler ;
55import android .os .Looper ;
6+ import android .os .SystemClock ;
67
78import com .facebook .react .bridge .Callback ;
89import com .facebook .react .bridge .ReactApplicationContext ;
@@ -33,6 +34,21 @@ public String getName() {
3334 return "IBGAPM" ;
3435 }
3536
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+
3652 /**
3753 * Sets the printed logs priority. Filter to one of the following levels.
3854 *
Original file line number Diff line number Diff line change @@ -35,6 +35,21 @@ - (id) init
3535 return self;
3636}
3737
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+
3853RCT_EXPORT_METHOD (setEnabled:(BOOL )isEnabled) {
3954 IBGAPM.enabled = isEnabled;
4055}
Original file line number Diff line number Diff line change @@ -100,4 +100,11 @@ export default {
100100 endUITrace ( ) {
101101 IBGAPM . endUITrace ( ) ;
102102 } ,
103+
104+ /**
105+ * Used for internal testing.
106+ */
107+ _ibgSleep ( ) {
108+ IBGAPM . ibgSleep ( ) ;
109+ }
103110} ;
You can’t perform that action at this time.
0 commit comments