"Could not preload class for phone policy:"
23487 ワード
2
* Copyright (C) 2008 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 */
1617
package com.android.internal.policy.impl;
1819
import android.content.Context;
20import android.util.Log;
2122
import com.android.internal.policy.IPolicy;
23import com.android.internal.policy.impl.PhoneLayoutInflater;
24import com.android.internal.policy.impl.PhoneWindow;
25import com.android.internal.policy.impl.PhoneWindowManager;
2627
/**
28 * {@hide}
29 */
3031
// Simple implementation of the policy interface that spawns the right
32// set of objects
33public class Policy implements IPolicy {
34 private static final String TAG = "PhonePolicy";
3536
private static final String[] preload_classes = {
37 "com.android.internal.policy.impl.PhoneLayoutInflater",
38 "com.android.internal.policy.impl.PhoneWindow",
39 "com.android.internal.policy.impl.PhoneWindow$1",
40 "com.android.internal.policy.impl.PhoneWindow$ContextMenuCallback",
41 "com.android.internal.policy.impl.PhoneWindow$DecorView",
42 "com.android.internal.policy.impl.PhoneWindow$PanelFeatureState",
43 "com.android.internal.policy.impl.PhoneWindow$PanelFeatureState$SavedState",
44 };
4546
static {
47 // For performance reasons, preload some policy specific classes when
48 // the policy gets loaded.
49 for (String s : preload_classes) {
50 try {
51 Class.forName(s);
52 } catch (ClassNotFoundException ex) {
53 Log.e(TAG, "Could not preload class for phone policy: " + s);
54 }
55 }
56 }
5758
public PhoneWindow makeNewWindow(Context context) {
59 return new PhoneWindow(context);
60 }
6162
public PhoneLayoutInflater makeNewLayoutInflater(Context context) {
63 return new PhoneLayoutInflater(context);
64 }
6566
public PhoneWindowManager makeNewWindowManager() {
67 return new PhoneWindowManager();
68 }
69}