1f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware/*
2f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware * Copyright (C) 2013 The Android Open Source Project
3f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware *
4f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware * Licensed under the Apache License, Version 2.0 (the "License");
5f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware * you may not use this file except in compliance with the License.
6f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware * You may obtain a copy of the License at
7f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware *
8f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware *      http://www.apache.org/licenses/LICENSE-2.0
9f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware *
10f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware * Unless required by applicable law or agreed to in writing, software
11f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware * distributed under the License is distributed on an "AS IS" BASIS,
12f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware * See the License for the specific language governing permissions and
14f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware * limitations under the License.
15f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware */
16f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiwarepackage com.android.camera;
17f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware
1806c027675948259368a902fd6f8c2ecac5db5167Mangesh Ghiwareimport com.android.gallery3d.util.IntentHelper;
19f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware
20f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiwareimport android.app.Activity;
21571bacbd331dd9fdb57bed154ce7dbb2abfffb8bMangesh Ghiwareimport android.content.Intent;
22f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiwareimport android.os.Bundle;
23f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware
2406c027675948259368a902fd6f8c2ecac5db5167Mangesh Ghiware/** Trampoline activity that launches the new Camera activity defined in IntentHelper. */
25f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiwarepublic class CameraActivity extends Activity {
26f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware    @Override
27f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware    public void onCreate(Bundle icicle) {
28f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware        super.onCreate(icicle);
299149879dc8c2ff6fe233d6e20858ebc081068abbMangesh Ghiware        Intent intent = IntentHelper.getCameraIntent(CameraActivity.this);
3094e122bf3dbcd316922cbd145adec30b49f2f8aeMangesh Ghiware        // Since this is being launched from a homescreen shorcut,
3194e122bf3dbcd316922cbd145adec30b49f2f8aeMangesh Ghiware        // it's already in a new task. Start Camera activity and
3294e122bf3dbcd316922cbd145adec30b49f2f8aeMangesh Ghiware        // reset the task to its initial state if needed.
3394e122bf3dbcd316922cbd145adec30b49f2f8aeMangesh Ghiware        intent.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
34163a97c3d3e9e1a029e04a8e629eabd8de8f3d9fAlan Newberger        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
35571bacbd331dd9fdb57bed154ce7dbb2abfffb8bMangesh Ghiware        startActivity(intent);
36f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware        finish();
37f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware    }
38f142f2f0823f08c5d6207066a291449ed90d642fMangesh Ghiware}
39