Home | History | Annotate | Download | only in service
      1 /*
      2  * Copyright (C) 2014 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 android.assist.service;
     18 
     19 import android.app.Activity;
     20 import android.assist.common.Utils;
     21 import android.content.Intent;
     22 import android.content.ComponentName;
     23 import android.os.Bundle;
     24 import android.util.Log;
     25 
     26 public class DelayedAssistantActivity extends Activity {
     27     static final String TAG = "DelayedAssistantActivity";
     28 
     29     @Override
     30     public void onCreate(Bundle savedInstanceState) {
     31         super.onCreate(savedInstanceState);
     32         Intent intent = new Intent();
     33         intent.setComponent(new ComponentName(this, MainInteractionService.class));
     34         intent.putExtra(Utils.EXTRA_REGISTER_RECEIVER, true);
     35         intent.putExtra(Utils.TESTCASE_TYPE, getIntent().getStringExtra(Utils.TESTCASE_TYPE));
     36         intent.putExtra(Utils.DISPLAY_WIDTH_KEY,
     37                 getIntent().getIntExtra(Utils.DISPLAY_WIDTH_KEY, 0));
     38         intent.putExtra(Utils.DISPLAY_HEIGHT_KEY,
     39                 getIntent().getIntExtra(Utils.DISPLAY_HEIGHT_KEY, 0));
     40         finish();
     41         ComponentName serviceName = startService(intent);
     42         Log.i(TAG, "Started service: " + serviceName);
     43     }
     44 }
     45