SystemUIDialog.java revision 5005244f10442e75c1f48973fdddce5facf3f360
15005244f10442e75c1f48973fdddce5facf3f360Adrian Roos/*
25005244f10442e75c1f48973fdddce5facf3f360Adrian Roos * Copyright (C) 2014 The Android Open Source Project
35005244f10442e75c1f48973fdddce5facf3f360Adrian Roos *
45005244f10442e75c1f48973fdddce5facf3f360Adrian Roos * Licensed under the Apache License, Version 2.0 (the "License");
55005244f10442e75c1f48973fdddce5facf3f360Adrian Roos * you may not use this file except in compliance with the License.
65005244f10442e75c1f48973fdddce5facf3f360Adrian Roos * You may obtain a copy of the License at
75005244f10442e75c1f48973fdddce5facf3f360Adrian Roos *
85005244f10442e75c1f48973fdddce5facf3f360Adrian Roos *      http://www.apache.org/licenses/LICENSE-2.0
95005244f10442e75c1f48973fdddce5facf3f360Adrian Roos *
105005244f10442e75c1f48973fdddce5facf3f360Adrian Roos * Unless required by applicable law or agreed to in writing, software
115005244f10442e75c1f48973fdddce5facf3f360Adrian Roos * distributed under the License is distributed on an "AS IS" BASIS,
125005244f10442e75c1f48973fdddce5facf3f360Adrian Roos * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
135005244f10442e75c1f48973fdddce5facf3f360Adrian Roos * See the License for the specific language governing permissions and
145005244f10442e75c1f48973fdddce5facf3f360Adrian Roos * limitations under the License
155005244f10442e75c1f48973fdddce5facf3f360Adrian Roos */
165005244f10442e75c1f48973fdddce5facf3f360Adrian Roos
175005244f10442e75c1f48973fdddce5facf3f360Adrian Roospackage com.android.systemui.statusbar.phone;
185005244f10442e75c1f48973fdddce5facf3f360Adrian Roos
195005244f10442e75c1f48973fdddce5facf3f360Adrian Roosimport com.android.systemui.R;
205005244f10442e75c1f48973fdddce5facf3f360Adrian Roos
215005244f10442e75c1f48973fdddce5facf3f360Adrian Roosimport android.app.AlertDialog;
225005244f10442e75c1f48973fdddce5facf3f360Adrian Roosimport android.content.Context;
235005244f10442e75c1f48973fdddce5facf3f360Adrian Roosimport android.view.WindowManager;
245005244f10442e75c1f48973fdddce5facf3f360Adrian Roos
255005244f10442e75c1f48973fdddce5facf3f360Adrian Roos/**
265005244f10442e75c1f48973fdddce5facf3f360Adrian Roos * Base class for dialogs that should appear over panels and keyguard.
275005244f10442e75c1f48973fdddce5facf3f360Adrian Roos */
285005244f10442e75c1f48973fdddce5facf3f360Adrian Roospublic class SystemUIDialog extends AlertDialog {
295005244f10442e75c1f48973fdddce5facf3f360Adrian Roos
305005244f10442e75c1f48973fdddce5facf3f360Adrian Roos    public SystemUIDialog(Context context) {
315005244f10442e75c1f48973fdddce5facf3f360Adrian Roos        super(context, R.style.Theme_SystemUI_Dialog);
325005244f10442e75c1f48973fdddce5facf3f360Adrian Roos
335005244f10442e75c1f48973fdddce5facf3f360Adrian Roos        getWindow().setType(WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL);
345005244f10442e75c1f48973fdddce5facf3f360Adrian Roos        getWindow().addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM
355005244f10442e75c1f48973fdddce5facf3f360Adrian Roos                | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
365005244f10442e75c1f48973fdddce5facf3f360Adrian Roos        WindowManager.LayoutParams attrs = getWindow().getAttributes();
375005244f10442e75c1f48973fdddce5facf3f360Adrian Roos        attrs.setTitle("SystemUIDialog");
385005244f10442e75c1f48973fdddce5facf3f360Adrian Roos        getWindow().setAttributes(attrs);
395005244f10442e75c1f48973fdddce5facf3f360Adrian Roos    }
405005244f10442e75c1f48973fdddce5facf3f360Adrian Roos}
41