File tree Expand file tree Collapse file tree 2 files changed +33
-7
lines changed Expand file tree Collapse file tree 2 files changed +33
-7
lines changed Original file line number Diff line number Diff line change @@ -355,12 +355,26 @@ export default class ADBUtils {
355
355
}
356
356
357
357
await wrapADBCall ( async ( ) => {
358
- await adbClient . getDevice ( deviceId ) . startActivity ( {
359
- wait : true ,
360
- action : 'android.activity.MAIN' ,
361
- component,
362
- extras,
363
- } ) ;
358
+ try {
359
+ // TODO: once Fenix (release) uses Android 13, we can get rid of this
360
+ // call and only use the second call in the `catch` block.
361
+ await adbClient . getDevice ( deviceId ) . startActivity ( {
362
+ wait : true ,
363
+ action : 'android.activity.MAIN' ,
364
+ component,
365
+ extras,
366
+ } ) ;
367
+ } catch {
368
+ // Android 13+ requires a different action/category but we still need
369
+ // to support older Fenix builds.
370
+ await adbClient . getDevice ( deviceId ) . startActivity ( {
371
+ wait : true ,
372
+ action : 'android.intent.action.MAIN' ,
373
+ category : 'android.intent.category.LAUNCHER' ,
374
+ component,
375
+ extras,
376
+ } ) ;
377
+ }
364
378
} ) ;
365
379
}
366
380
Original file line number Diff line number Diff line change @@ -819,7 +819,7 @@ describe('utils/adb', () => {
819
819
} ,
820
820
} ) ;
821
821
822
- sinon . assert . calledOnce ( adb . fakeADBDevice . startActivity ) ;
822
+ sinon . assert . calledTwice ( adb . fakeADBDevice . startActivity ) ;
823
823
sinon . assert . calledWithMatch ( adb . fakeADBDevice . startActivity , {
824
824
action : 'android.activity.MAIN' ,
825
825
component : 'org.mozilla.firefox_mybuild/.App' ,
@@ -831,6 +831,18 @@ describe('utils/adb', () => {
831
831
] ,
832
832
wait : true ,
833
833
} ) ;
834
+ sinon . assert . calledWithMatch ( adb . fakeADBDevice . startActivity , {
835
+ action : 'android.intent.action.MAIN' ,
836
+ category : 'android.intent.category.LAUNCHER' ,
837
+ component : 'org.mozilla.firefox_mybuild/.App' ,
838
+ extras : [
839
+ {
840
+ key : 'args' ,
841
+ value : '-profile /fake/custom/profile/path' ,
842
+ } ,
843
+ ] ,
844
+ wait : true ,
845
+ } ) ;
834
846
} ) ;
835
847
836
848
it ( 'starts Firefox APK on a custom profile (only used by Fennec)' , async ( ) => {
You can’t perform that action at this time.
0 commit comments