1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.cts.verifier.managedprovisioning; 18 19 import android.content.Intent; 20 import android.os.Bundle; 21 import android.view.View; 22 import android.widget.EditText; 23 24 import com.android.cts.verifier.PassFailButtons; 25 import com.android.cts.verifier.R; 26 27 /** 28 * Test class to verify Organization Info. 29 */ 30 public class OrganizationInfoTestActivity extends PassFailButtons.Activity 31 implements View.OnClickListener { 32 33 public static final String EXTRA_ORGANIZATION_NAME = "extra_organization_name"; 34 35 @Override onCreate(Bundle savedInstanceState)36 protected void onCreate(Bundle savedInstanceState) { 37 super.onCreate(savedInstanceState); 38 setContentView(R.layout.organization_info); 39 setPassFailButtonClickListeners(); 40 setButtonClickListeners(); 41 } 42 setButtonClickListeners()43 private void setButtonClickListeners() { 44 findViewById(R.id.organization_info_set_button).setOnClickListener(this); 45 findViewById(R.id.go_button).setOnClickListener(this); 46 } 47 48 @Override onClick(View view)49 public void onClick(View view) { 50 if (view.getId() == R.id.organization_info_set_button) { 51 EditText organizationNameEditText = (EditText) findViewById( 52 R.id.organization_name_edit_text); 53 Intent intent = new Intent(ByodHelperActivity.ACTION_SET_ORGANIZATION_INFO); 54 intent.putExtra(EXTRA_ORGANIZATION_NAME, organizationNameEditText.getText().toString()); 55 startActivity(intent); 56 } else if (view.getId() == R.id.go_button) { 57 Intent intent = new Intent(ByodHelperActivity.ACTION_LAUNCH_CONFIRM_WORK_CREDENTIALS); 58 startActivity(intent); 59 } 60 } 61 } 62