Skip to content

Commit dffe0fb

Browse files
Merge branch 'refs/heads/dev' into feat/proactive-bug-reporting
# Conflicts: # CHANGELOG.md # example/ios/Podfile.lock
2 parents c3c3ddc + 19a600b commit dffe0fb

21 files changed

+733
-118
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
- Add support proactive bug-reporting ([#559](https://github.com/Instabug/Instabug-Flutter/pull/559)).
88

9-
109
## [14.1.0](https://github.com/Instabug/Instabug-Flutter/compare/v14.0.0...v14.1.0) (January 2, 2025)
1110

1211
### Changed

android/src/main/java/com/instabug/flutter/modules/ApmApi.java

Lines changed: 145 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ public static void init(BinaryMessenger messenger) {
3333
ApmPigeon.ApmHostApi.setup(messenger, api);
3434
}
3535

36+
/**
37+
* The function sets the enabled status of APM.
38+
*
39+
* @param isEnabled The `setEnabled` method in the code snippet is used to enable or disable a
40+
* feature, and it takes a `Boolean` parameter named `isEnabled`. When this method is called with
41+
* `true`, it enables the feature, and when called with `false`, it disables the feature. The method
42+
* internally calls
43+
*/
3644
@Override
3745
public void setEnabled(@NonNull Boolean isEnabled) {
3846
try {
@@ -42,6 +50,13 @@ public void setEnabled(@NonNull Boolean isEnabled) {
4250
}
4351
}
4452

53+
/**
54+
* Sets the cold app launch enabled status using the APM library.
55+
*
56+
* @param isEnabled The `isEnabled` parameter is a Boolean value that indicates whether cold app launch
57+
* is enabled or not. When `isEnabled` is set to `true`, cold app launch is enabled, and when it is set
58+
* to `false`, cold app launch is disabled.
59+
*/
4560
@Override
4661
public void setColdAppLaunchEnabled(@NonNull Boolean isEnabled) {
4762
try {
@@ -51,6 +66,14 @@ public void setColdAppLaunchEnabled(@NonNull Boolean isEnabled) {
5166
}
5267
}
5368

69+
/**
70+
* The function sets the auto UI trace enabled status in an APM system, handling any exceptions that
71+
* may occur.
72+
*
73+
* @param isEnabled The `isEnabled` parameter is a Boolean value that indicates whether the Auto UI
74+
* trace feature should be enabled or disabled. When `isEnabled` is set to `true`, the Auto UI trace
75+
* feature is enabled, and when it is set to `false`, the feature is disabled.
76+
*/
5477
@Override
5578
public void setAutoUITraceEnabled(@NonNull Boolean isEnabled) {
5679
try {
@@ -60,6 +83,21 @@ public void setAutoUITraceEnabled(@NonNull Boolean isEnabled) {
6083
}
6184
}
6285

86+
/**
87+
* Starts an execution trace and handles the result
88+
* using callbacks.
89+
*
90+
* @param id The `id` parameter is a non-null String that represents the identifier of the execution
91+
* trace.
92+
* @param name The `name` parameter in the `startExecutionTrace` method represents the name of the
93+
* execution trace that will be started. It is used as a reference to identify the trace during
94+
* execution monitoring.
95+
* @param result The `result` parameter in the `startExecutionTrace` method is an instance of
96+
* `ApmPigeon.Result<String>`. This parameter is used to provide the result of the execution trace
97+
* operation back to the caller. The `success` method of the `result` object is called with the
98+
*
99+
* @deprecated see {@link #startFlow}
100+
*/
63101
@Override
64102
public void startExecutionTrace(@NonNull String id, @NonNull String name, ApmPigeon.Result<String> result) {
65103
ThreadManager.runOnBackground(
@@ -100,6 +138,17 @@ public void run() {
100138
);
101139
}
102140

141+
/**
142+
* Starts an AppFlow with the specified name.
143+
* <br/>
144+
* On starting two flows with the same name the older flow will end with force abandon end reason.
145+
* AppFlow name cannot exceed 150 characters otherwise it's truncated,
146+
* leading and trailing whitespaces are also ignored.
147+
*
148+
* @param name AppFlow name. It can not be empty string or null.
149+
* Starts a new AppFlow, if APM is enabled, feature is enabled
150+
* and Instabug SDK is initialized.
151+
*/
103152
@Override
104153
public void startFlow(@NonNull String name) {
105154
try {
@@ -109,6 +158,26 @@ public void startFlow(@NonNull String name) {
109158
}
110159
}
111160

161+
/**
162+
* Sets custom attributes for AppFlow with a given name.
163+
* <br/>
164+
* Setting an attribute value to null will remove its corresponding key if it already exists.
165+
* <br/>
166+
* Attribute key name cannot exceed 30 characters.
167+
* Leading and trailing whitespaces are also ignored.
168+
* Does not accept empty strings or null.
169+
* <br/>
170+
* Attribute value name cannot exceed 60 characters,
171+
* leading and trailing whitespaces are also ignored.
172+
* Does not accept empty strings.
173+
* <br/>
174+
* If a trace is ended, attributes will not be added and existing ones will not be updated.
175+
* <br/>
176+
*
177+
* @param name AppFlow name. It can not be empty string or null
178+
* @param key AppFlow attribute key. It can not be empty string or null
179+
* @param value AppFlow attribute value. It can not be empty string. Null to remove attribute
180+
*/
112181
@Override
113182
public void setFlowAttribute(@NonNull String name, @NonNull String key, @Nullable String value) {
114183
try {
@@ -118,6 +187,11 @@ public void setFlowAttribute(@NonNull String name, @NonNull String key, @Nullabl
118187
}
119188
}
120189

190+
/**
191+
* Ends AppFlow with a given name.
192+
*
193+
* @param name AppFlow name to be ended. It can not be empty string or null
194+
*/
121195
@Override
122196
public void endFlow(@NonNull String name) {
123197
try {
@@ -127,6 +201,15 @@ public void endFlow(@NonNull String name) {
127201
}
128202
}
129203

204+
/**
205+
* Adds a new attribute to trace
206+
*
207+
* @param id String id of the trace.
208+
* @param key attribute key
209+
* @param value attribute value. Null to remove attribute
210+
*
211+
* @deprecated see {@link #setFlowAttribute}
212+
*/
130213
@Override
131214
public void setExecutionTraceAttribute(@NonNull String id, @NonNull String key, @NonNull String value) {
132215
try {
@@ -136,6 +219,13 @@ public void setExecutionTraceAttribute(@NonNull String id, @NonNull String key,
136219
}
137220
}
138221

222+
/**
223+
* Ends a trace
224+
*
225+
* @param id string id of the trace.
226+
*
227+
* @deprecated see {@link #endFlow}
228+
*/
139229
@Override
140230
public void endExecutionTrace(@NonNull String id) {
141231
try {
@@ -145,6 +235,11 @@ public void endExecutionTrace(@NonNull String id) {
145235
}
146236
}
147237

238+
/**
239+
* Starts a UI trace.
240+
*
241+
* @param name string name of the UI trace.
242+
*/
148243
@Override
149244
public void startUITrace(@NonNull String name) {
150245
try {
@@ -154,6 +249,9 @@ public void startUITrace(@NonNull String name) {
154249
}
155250
}
156251

252+
/**
253+
* This method is used to terminate the currently active UI trace.
254+
*/
157255
@Override
158256
public void endUITrace() {
159257
try {
@@ -163,6 +261,9 @@ public void endUITrace() {
163261
}
164262
}
165263

264+
/**
265+
* This method is used to signal the end of the app launch process.
266+
*/
166267
@Override
167268
public void endAppLaunch() {
168269
try {
@@ -172,6 +273,12 @@ public void endAppLaunch() {
172273
}
173274
}
174275

276+
277+
/**
278+
* logs network-related information
279+
*
280+
* @param data Map of network data object.
281+
*/
175282
@Override
176283
public void networkLogAndroid(@NonNull Map<String, Object> data) {
177284
try {
@@ -265,8 +372,13 @@ public void networkLogAndroid(@NonNull Map<String, Object> data) {
265372
}
266373

267374

268-
269-
375+
/**
376+
* This method is responsible for initiating a custom performance UI trace
377+
* in the APM module. It takes three parameters:
378+
* @param screenName: A string representing the name of the screen or UI element being traced.
379+
* @param microTimeStamp: A number representing the timestamp in microseconds when the trace is started.
380+
* @param traceId: A number representing the unique identifier for the trace.
381+
*/
270382
@Override
271383
public void startCpUiTrace(@NonNull String screenName, @NonNull Long microTimeStamp, @NonNull Long traceId) {
272384
try {
@@ -276,6 +388,17 @@ public void startCpUiTrace(@NonNull String screenName, @NonNull Long microTimeSt
276388
}
277389
}
278390

391+
392+
/**
393+
* This method is responsible for reporting the screen
394+
* loading data from Dart side to Android side. It takes three parameters:
395+
* @param startTimeStampMicro: A number representing the start timestamp in microseconds of the screen
396+
* loading custom performance data.
397+
* @param durationMicro: A number representing the duration in microseconds of the screen loading custom
398+
* performance data.
399+
* @param uiTraceId: A number representing the unique identifier for the UI trace associated with the
400+
* screen loading.
401+
*/
279402
@Override
280403
public void reportScreenLoadingCP(@NonNull Long startTimeStampMicro, @NonNull Long durationMicro, @NonNull Long uiTraceId) {
281404
try {
@@ -285,6 +408,15 @@ public void reportScreenLoadingCP(@NonNull Long startTimeStampMicro, @NonNull Lo
285408
}
286409
}
287410

411+
412+
/**
413+
* This method is responsible for extend the end time if the screen loading custom
414+
* trace. It takes two parameters:
415+
* @param timeStampMicro: A number representing the timestamp in microseconds when the screen loading
416+
* custom trace is ending.
417+
* @param uiTraceId: A number representing the unique identifier for the UI trace associated with the
418+
* screen loading.
419+
*/
288420
@Override
289421
public void endScreenLoadingCP(@NonNull Long timeStampMicro, @NonNull Long uiTraceId) {
290422
try {
@@ -294,11 +426,16 @@ public void endScreenLoadingCP(@NonNull Long timeStampMicro, @NonNull Long uiTra
294426
}
295427
}
296428

429+
430+
/**
431+
* This method is used to check whether the end screen loading feature is enabled or not.
432+
*/
297433
@Override
298434
public void isEndScreenLoadingEnabled(@NonNull ApmPigeon.Result<Boolean> result) {
299435
isScreenLoadingEnabled(result);
300436
}
301437

438+
302439
@Override
303440
public void isEnabled(@NonNull ApmPigeon.Result<Boolean> result) {
304441
try {
@@ -310,6 +447,9 @@ public void isEnabled(@NonNull ApmPigeon.Result<Boolean> result) {
310447
}
311448
}
312449

450+
/**
451+
* checks whether the screen loading feature is enabled.
452+
* */
313453
@Override
314454
public void isScreenLoadingEnabled(@NonNull ApmPigeon.Result<Boolean> result) {
315455
try {
@@ -324,6 +464,9 @@ public void invoke(boolean isFeatureAvailable) {
324464
}
325465
}
326466

467+
/**
468+
* This method is setting the enabled state of the screen loading feature.
469+
*/
327470
@Override
328471
public void setScreenLoadingEnabled(@NonNull Boolean isEnabled) {
329472
try {

0 commit comments

Comments
 (0)