Menu.java revision d24b8183b93e781080b2c16c487e60d51c12da31
1/*
2 * Copyright (C) 2007 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
17package com.android.dumprendertree;
18
19import android.content.Intent;
20import android.net.Uri;
21import android.os.Bundle;
22
23import java.io.File;
24
25public class Menu extends FileList {
26
27    public void onCreate(Bundle icicle)
28    {
29        super.onCreate(icicle);
30    }
31
32    boolean fileFilter(File f) {
33    	if (f.getName().startsWith("."))
34    		return false;
35    	if (f.getName().equalsIgnoreCase("resources"))
36    		return false;
37    	if (f.isDirectory())
38    		return true;
39    	if (f.getPath().toLowerCase().endsWith("ml"))
40    		return true;
41    	return false;
42    }
43
44    void processFile(String filename, boolean selection)
45    {
46        Intent result = new Intent();
47        result.setClass(this, HTMLHostActivity.class);
48        result.putExtra(HTMLHostActivity.RESUME_FROM_CRASH, false);
49        result.putExtra(HTMLHostActivity.SINGLE_TEST_MODE, true);
50        result.putExtra(HTMLHostActivity.TEST_PATH_PREFIX, filename);
51        result.putExtra(HTMLHostActivity.TIMEOUT_IN_MILLIS, 8000);
52        startActivity(result);
53    }
54
55}
56
57