Could not preload class for phone policy

               
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
 */
16
17
package com.android.internal.policy.impl;
18
19
import android.content.Context;
20
import android.util.Log;
21
22
import com.android.internal.policy.IPolicy;
23
import com.android.internal.policy.impl.PhoneLayoutInflater;
24
import com.android.internal.policy.impl.PhoneWindow;
25
import com.android.internal.policy.impl.PhoneWindowManager;
26
27
/**
28
 * {@hide}
29
 */
30
31
// Simple implementation of the policy interface that spawns the right
32
// set of objects
33
public class Policy implements IPolicy {
34
    private static final String TAG = "PhonePolicy";
35
36
    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
    };
45
46
    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
    }
57
58
    public PhoneWindow makeNewWindow(Context context) {
59
        return new PhoneWindow(context);
60
    }
61
62
    public PhoneLayoutInflater makeNewLayoutInflater(Context context) {
63
        return new PhoneLayoutInflater(context);
64
    }
65
66
    public PhoneWindowManager makeNewWindowManager() {
67
        return new PhoneWindowManager();
68
    }
69
}
           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值