Home | History | Annotate | Download | only in managedprovisioning
      1 /*
      2  * Copyright (C) 2012 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.app.Activity;
     20 import android.content.Intent;
     21 import android.os.Bundle;
     22 import android.view.View;
     23 import android.view.View.OnClickListener;
     24 import android.widget.TextView;
     25 
     26 import com.android.cts.verifier.R;
     27 
     28 /**
     29  * Test activity for work status tests.
     30  */
     31 public class WorkStatusTestActivity extends Activity {
     32     public static final String ACTION_WORK_STATUS_ICON
     33             = "com.android.cts.verifier.managedprovisioning.WORK_STATUS_ICON";
     34     public static final String ACTION_WORK_STATUS_TOAST
     35             = "com.android.cts.verifier.managedprovisioning.WORK_STATUS_TOAST";
     36 
     37     @Override
     38     public void onCreate(Bundle savedInstanceState) {
     39         super.onCreate(savedInstanceState);
     40         setContentView(R.layout.provisioning_cross_profile);
     41 
     42         findViewById(R.id.button_finish).setOnClickListener(new OnClickListener() {
     43             @Override
     44             public void onClick(View v) {
     45                 WorkStatusTestActivity.this.finish();
     46             }
     47         });
     48     }
     49 
     50     @Override
     51     public void onStart() {
     52         super.onStart();
     53         String action = getIntent().getAction();
     54         TextView textView = (TextView) findViewById(R.id.text);
     55         if (ACTION_WORK_STATUS_ICON.equals(action)) {
     56             textView.setText(R.string.provisioning_byod_work_status_icon_activity);
     57         } else if (ACTION_WORK_STATUS_TOAST.equals(action)) {
     58             textView.setText(R.string.provisioning_byod_work_status_toast_activity);
     59         }
     60     }
     61 }
     62