camera gts

GTS fail

 

run gts -m GtsAssistantHostTestCases

 

<Test result="fail" name="testAssistantTakePhotoWithVoiceInteraction">
<Test result="fail" name="testAssistantTakeSelfieWithVoiceInteraction">
<Test result="fail" name="testAssistantOpenRearCameraWithoutVoiceInteraction">
<Test result="fail" name="testAssistantOpenFrontCameraWithoutVoiceInteraction">

 

首先看 fail的log

抽取  action  和 intent 参数

16823 16823 I MainInteractionSession: starting_voiceactivity: Intent { act=android.media.action.STILL_IMAGE_CAMERA flg=0x10018000 (has extras) }
1379  2616 I ActivityTaskManager: START u0 {act=android.media.action.STILL_IMAGE_CAMERA typ=null flg=0x18018000 cmp=ComponentInfo{com.sec.android.app.camera/com.sec.android.app.camera.Camera}} from uid 10216
1379  2616 D ApplicationPolicy: getApplicationStateEnabled : pkg = com.sec.android.app.camera userId : 0

------action: android.media.action.STILL_IMAGE_CAMERA


SnapCam_CaptureModule: initModeByIntent myExtras Bundle[{com.google.assistant.extra.USE_FRONT_CAMERA=true, android.intent.extra.REFERRER_NAME=android-app://com.google.android.googlequicksearchbox/https/www.google.com, isVoiceQuery=true, android.intent.extra.USE_FRONT_CAMERA=true, NoUiQuery=true}]

22335 22335 I MainInteractionSession: in onTaskFinished: testcasetype = TAKE_SELFIE, intent: Intent { act=android.media.action.STILL_IMAGE_CAMERA cat=[android.intent.category.VOICE] flg=0x18018000 cmp=com.sec.android.app.camera/.Camera (has extras) }extras: (com.google.assistant.extra.USE_FRONT_CAMERA = true), (android.intent.extra.REFERRER_NAME = android-app://com.google.android.googlequicksearchbox/https/www.google.com), (isVoiceQuery = true), (android.intent.extra.USE_FRONT_CAMERA = true), (NoUiQuery = true), 
06-28 16:14:07.210 22335 22335 I MainInteractionSession: sending_broadcast: Bundle = extras: (com.google.assistant.extra.USE_FRONT_CAMERA = true), (Testcase_type = TAKE_SELFIE), (android.intent.extra.REFERRER_NAME = android-app://com.google.android.googlequicksearchbox/https/www.google.com), (isVoiceQuery = true), (android.intent.extra.USE_FRONT_CAMERA = true), (NoUiQuery = true), , intent = Intent { act=android.intent.action.FROM_UTIL_CTS_TEST_TAKE_SELFIE (has extras) }

6885 16878 D SnapCam_CaptureModule: initModeByIntent myExtras Bundle[{android.intent.extra.REFERRER_NAME=android-app://com.google.android.googlequicksearchbox/https/www.google.com, isVoiceQuery=true, NoUiQuery=true}]
17540 17600 D SnapCam_CaptureModule: initModeByIntent myExtras Bundle[{com.google.assistant.extra.USE_FRONT_CAMERA=true, android.intent.extra.REFERRER_NAME=android-app://com.google.android.googlequicksearchbox/https/www.google.com, isVoiceQuery=true, android.intent.extra.USE_FRONT_CAMERA=true, NoUiQuery=true}]
18806 18862 D SnapCam_CaptureModule: initModeByIntent myExtras Bundle[{com.google.assistant.extra.USE_FRONT_CAMERA=true, com.google.assistant.extra.CAMERA_OPEN_ONLY=true, android.intent.extra.REFERRER_NAME=android-app://com.google.android.googlequicksearchbox/https/www.google.com, isVoiceQuery=true, android.intent.extra.USE_FRONT_CAMERA=true, android.intent.extra.CAMERA_OPEN_ONLY=true, NoUiQuery=true}]
19454 19515 D SnapCam_CaptureModule: initModeByIntent myExtras Bundle[{com.google.assistant.extra.CAMERA_OPEN_ONLY=true, android.intent.extra.REFERRER_NAME=android-app://com.google.android.googlequicksearchbox/https/www.google.com, isVoiceQuery=true, android.intent.extra.CAMERA_OPEN_ONLY=true, NoUiQuery=true}]
20049 20112 D SnapCam_CaptureModule: initModeByIntent myExtras Bundle[{android.intent.extra.REFERRER_NAME=android-app://com.google.android.googlequicksearchbox/https/www.google.com, isVoiceQuery=true, NoUiQuery=true}]
20694 20750 D SnapCam_CaptureModule: initModeByIntent myExtras Bundle[{com.google.assistant.extra.CAMERA_OPEN_ONLY=true, android.intent.extra.REFERRER_NAME=android-app://com.google.android.googlequicksearchbox/https/www.google.com, isVoiceQuery=true, android.intent.extra.CAMERA_OPEN_ONLY=true, NoUiQuery=true}]
21327 21388 D SnapCam_CaptureModule: initModeByIntent myExtras Bundle[{com.google.assistant.extra.USE_FRONT_CAMERA=true, com.google.assistant.extra.CAMERA_OPEN_ONLY=true, android.intent.extra.REFERRER_NAME=android-app://com.google.android.googlequicksearchbox/https/www.google.com, isVoiceQuery=true, android.intent.extra.USE_FRONT_CAMERA=true, android.intent.extra.CAMERA_OPEN_ONLY=true, NoUiQuery=true}]
22368 22428 D SnapCam_CaptureModule: initModeByIntent myExtras Bundle[{android.intent.extra.REFERRER_NAME=android-app://com.google.android.googlequicksearchbox/https/www.google.com, isVoiceQuery=true, NoUiQuery=true}]
24447 24504 D SnapCam_CaptureModule: initModeByIntent myExtras Bundle[{com.google.assistant.extra.USE_FRONT_CAMERA=true, com.google.assistant.extra.CAMERA_OPEN_ONLY=true, android.intent.extra.REFERRER_NAME=android-app://com.google.android.googlequicksearchbox/https/www.google.com, isVoiceQuery=true, android.intent.extra.USE_FRONT_CAMERA=true, android.intent.extra.CAMERA_OPEN_ONLY=true, NoUiQuery=true}]
25097 25159 D SnapCam_CaptureModule: initModeByIntent myExtras Bundle[{com.google.assistant.extra.CAMERA_OPEN_ONLY=true, android.intent.extra.REFERRER_NAME=android-app://com.google.android.googlequicksearchbox/https/www.google.com, isVoiceQuery=true, android.intent.extra.CAMERA_OPEN_ONLY=true, NoUiQuery=true}]
25698 25758 D SnapCam_CaptureModule: initModeByIntent myExtras Bundle[{android.intent.extra.REFERRER_NAME=android-app://com.google.android.googlequicksearchbox/https/www.google.com, isVoiceQuery=true, NoUiQuery=true}]
27032 27094 D SnapCam_CaptureModule: initModeByIntent myExtras Bundle[{com.google.assistant.extra.USE_FRONT_CAMERA=true, com.google.assistant.extra.CAMERA_OPEN_ONLY=true, android.intent.extra.REFERRER_NAME=android-app://com.google.android.googlequicksearchbox/https/www.google.com, isVoiceQuery=true, android.intent.extra.USE_FRONT_CAMERA=true, android.intent.extra.CAMERA_OPEN_ONLY=true, NoUiQuery=true}]

 

adb命令模拟:
1.后摄自动拍照
adb shell am start -a android.media.action.STILL_IMAGE_CAMERA -c android.intent.category.VOICE --ez isVoiceQuery true --ez NoUiQuery true --es android.intent.extra.REFERRER_NAME android-app://com.google.android.googlequicksearchbox/https/www.google.com --activity-clear-task
2.前摄自动拍照
adb shell am start -a android.media.action.STILL_IMAGE_CAMERA -c android.intent.category.VOICE --ez com.google.assistant.extra.USE_FRONT_CAMERA true --ez android.intent.extra.USE_FRONT_CAMERA true --ez isVoiceQuery true --ez NoUiQuery true --es android.intent.extra.REFERRER_NAME android-app://com.google.android.googlequicksearchbox/https/www.google.com --activity-clear-task

 

  修改完成后,模拟命令测试

 


public boolean needAotuCaptureGoogleGTS = false;





f(ACTION_STILL_IMAGE_CAMERA.equals(getIntent().getAction())) {

boolean mGoogleAssistantVOICE = getIntent().hasCategory("android.intent.category.VOICE");
boolean mGoogleAssistantOpenOnly = getIntent().getBooleanExtra("com.google.assistant.extra.CAMERA_OPEN_ONLY", false);
int mGoogleAssistantTimer = getIntent().getIntExtra("com.google.assistant.extra.TIMER_DURATION_SECONDS", 0);
boolean mGoogleAssistantFrontCamera = getIntent().getBooleanExtra("com.google.assistant.extra.USE_FRONT_CAMERA", false);
String mGoogleAssistantMode = getIntent().getStringExtra("com.google.assistant.extra.CAMERA_MODE");

Log.d(TAG, "intent google assistant VOICE " + mGoogleAssistantVOICE + " OPEN_ONLY " + mGoogleAssistantOpenOnly + " Timer " +
                      mGoogleAssistantTimer + " FrontCamera " + mGoogleAssistantFrontCamera + " Mode " + mGoogleAssistantMode);

needAotuCaptureGoogleGTS = mGoogleAssistantVOICE && !mGoogleAssistantOpenOnly;
Log.d(TAG, "needAotuCaptureGoogleGTS = " + needAotuCaptureGoogleGTS);
          
}

  // GTS  test front
  if(mGoogleAssistantFrontCamera){
                  settingsManager.setValue(SettingsManager.KEY_CAMERA_ID,"1");
    } else {
                  settingsManager.setValue(SettingsManager.KEY_CAMERA_ID,"0");
  }




private CameraCaptureSession.CaptureCallback mCaptureCallback
            = new CameraCaptureSession.CaptureCallback() {


 @Override
        public void onCaptureCompleted(CameraCaptureSession session,
                                       CaptureRequest request,
                                       TotalCaptureResult result) {

       //if gts test capture
            if (mActivity.isNeedAotuCaptureGoogleGTS()) {
                mHandler.sendEmptyMessage(MSG_TAKE_PICTURE);
            }

}

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

空白的泡

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值