blob: 63130159fbecfb39276dffcd97e01bec92c7bb66 [file] [log] [blame]
Bjorn Bringerte90ede42009-04-29 22:33:52 +01001/*
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
Bijan Amirzada41242f22014-03-21 12:12:18 -070017package com.android.browser;
Bjorn Bringerte90ede42009-04-29 22:33:52 +010018
19import android.app.Activity;
Vivek Sekharb7b51df2016-02-06 20:55:00 +010020import android.content.Context;
Bjorn Bringerte90ede42009-04-29 22:33:52 +010021import android.content.Intent;
22import android.os.Bundle;
Vivek Sekharb7b51df2016-02-06 20:55:00 +010023import android.util.Log;
Bjorn Bringerte90ede42009-04-29 22:33:52 +010024/**
25 * This activity is never started from the browser. Its purpose is to provide bookmark suggestions
26 * to global search (through its searchable meta-data), and to handle the intents produced
27 * by clicking such suggestions.
28 */
29public class BookmarkSearch extends Activity {
Vivek Sekharb7b51df2016-02-06 20:55:00 +010030 private final String LOGTAG = "BookmarkSearch";
Bjorn Bringerte90ede42009-04-29 22:33:52 +010031
32 @Override
33 protected void onCreate(Bundle savedInstanceState) {
Vivek Sekharb7b51df2016-02-06 20:55:00 +010034 if (!EngineInitializer.isInitialized()) {
35 Log.e(LOGTAG, "Engine not Initialized");
36 EngineInitializer.initializeSync((Context) getApplicationContext());
37 }
Bjorn Bringerte90ede42009-04-29 22:33:52 +010038 super.onCreate(savedInstanceState);
39 Intent intent = getIntent();
40 if (intent != null) {
41 String action = intent.getAction();
42 if (Intent.ACTION_VIEW.equals(action)) {
43 intent.setClass(this, BrowserActivity.class);
44 startActivity(intent);
45 }
46 }
47 finish();
48 }
49
50}