1 /* 2 * Copyright (C) 2009 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.phone; 18 19 import com.android.internal.telephony.Phone; 20 21 import android.app.Activity; 22 import android.app.PendingIntent; 23 import android.content.Intent; 24 import android.os.Bundle; 25 import android.util.Log; 26 27 /** 28 * Trampoline to InCallScreen protected by PERFORM_CDMA_PROVISIONING permission 29 * to only expose SHOW_ACTIVATION. 30 */ 31 public class InCallScreenShowActivation extends Activity { 32 private static final String LOG_TAG = "InCallScreenShowActivation"; 33 34 // the pending intent we'll use to report the user skipped provisioning 35 // Note: this constant must match the one defined in SetupWizardActivity 36 private static final String EXTRA_USER_SKIP_PENDING_INTENT = "ota_user_skip_pending_intent"; 37 38 @Override 39 protected void onCreate(Bundle icicle) { 40 super.onCreate(icicle); 41 42 Intent intent = getIntent(); 43 if (intent.getAction().equals(InCallScreen.ACTION_SHOW_ACTIVATION)) { 44 Intent newIntent = new Intent().setClass(this, InCallScreen.class) 45 .setAction(InCallScreen.ACTION_SHOW_ACTIVATION); 46 47 // tuck away the pending intent to send later if the user skips provisioning 48 PhoneApp app = PhoneApp.getInstance(); 49 app.cdmaOtaInCallScreenUiState.reportSkipPendingIntent = (PendingIntent) intent 50 .getParcelableExtra(EXTRA_USER_SKIP_PENDING_INTENT); 51 52 startActivity(newIntent); 53 } else { 54 Log.e(LOG_TAG, "Inappropriate launch of InCallScreenShowActivation"); 55 } 56 57 finish(); 58 } 59 60 } 61