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 @@ -352,12 +352,26 @@ export default class ADBUtils {
352
352
const component = `${ apk } /${ apkComponent } ` ;
353
353
354
354
await wrapADBCall ( async ( ) => {
355
- await adbClient . getDevice ( deviceId ) . startActivity ( {
356
- wait : true ,
357
- action : 'android.activity.MAIN' ,
358
- component,
359
- extras,
360
- } ) ;
355
+ try {
356
+ // TODO: once Fenix (release) uses Android 13, we can get rid of this
357
+ // call and only use the second call in the `catch` block.
358
+ await adbClient . getDevice ( deviceId ) . startActivity ( {
359
+ wait : true ,
360
+ action : 'android.activity.MAIN' ,
361
+ component,
362
+ extras,
363
+ } ) ;
364
+ } catch {
365
+ // Android 13+ requires a different action/category but we still need
366
+ // to support older Fenix builds.
367
+ await adbClient . getDevice ( deviceId ) . startActivity ( {
368
+ wait : true ,
369
+ action : 'android.intent.action.MAIN' ,
370
+ category : 'android.intent.category.LAUNCHER' ,
371
+ component,
372
+ extras,
373
+ } ) ;
374
+ }
361
375
} ) ;
362
376
}
363
377
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