diff options
author | John Spurlock <jspurlock@google.com> | 2013-06-15 13:03:45 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-06-15 13:03:46 +0000 |
commit | de44c828b5f901bd55922e5a6edbb1474a503540 (patch) | |
tree | d532c4c7c40bed9225f2024b40d2a26dbb9a1a77 /packages | |
parent | 0f6006405dd1ef1ec1dee1710a455a0cdd0b902d (diff) | |
parent | bb39a21caacb12b27e6caf7a317e8389bc5c7c7f (diff) | |
download | frameworks_base-de44c828b5f901bd55922e5a6edbb1474a503540.zip frameworks_base-de44c828b5f901bd55922e5a6edbb1474a503540.tar.gz frameworks_base-de44c828b5f901bd55922e5a6edbb1474a503540.tar.bz2 |
Merge "Remove more unused statusbar.policy items."
Diffstat (limited to 'packages')
3 files changed, 0 insertions, 196 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AirplaneModeController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AirplaneModeController.java deleted file mode 100644 index 8bbe957..0000000 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AirplaneModeController.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.systemui.statusbar.policy; - -import android.content.BroadcastReceiver; -import android.content.ContentResolver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.os.AsyncTask; -import android.os.UserHandle; -import android.provider.Settings; -import android.widget.CompoundButton; - -public class AirplaneModeController extends BroadcastReceiver - implements CompoundButton.OnCheckedChangeListener { - private static final String TAG = "StatusBar.AirplaneModeController"; - - private Context mContext; - private CompoundButton mCheckBox; - - private boolean mAirplaneMode; - - public AirplaneModeController(Context context, CompoundButton checkbox) { - mContext = context; - mAirplaneMode = getAirplaneMode(); - mCheckBox = checkbox; - checkbox.setChecked(mAirplaneMode); - checkbox.setOnCheckedChangeListener(this); - - IntentFilter filter = new IntentFilter(); - filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED); - context.registerReceiver(this, filter); - - } - - public void release() { - mContext.unregisterReceiver(this); - } - - public void onCheckedChanged(CompoundButton view, boolean checked) { - if (checked != mAirplaneMode) { - mAirplaneMode = checked; - unsafe(checked); - } - } - - public void onReceive(Context context, Intent intent) { - if (Intent.ACTION_AIRPLANE_MODE_CHANGED.equals(intent.getAction())) { - final boolean enabled = intent.getBooleanExtra("state", false); - if (enabled != mAirplaneMode) { - mAirplaneMode = enabled; - mCheckBox.setChecked(enabled); - } - } - } - - private boolean getAirplaneMode() { - ContentResolver cr = mContext.getContentResolver(); - return 0 != Settings.Global.getInt(cr, Settings.Global.AIRPLANE_MODE_ON, 0); - } - - // TODO: Fix this racy API by adding something better to TelephonyManager or - // ConnectivityService. - private void unsafe(final boolean enabled) { - AsyncTask.execute(new Runnable() { - public void run() { - Settings.Global.putInt( - mContext.getContentResolver(), - Settings.Global.AIRPLANE_MODE_ON, - enabled ? 1 : 0); - Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED); - intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING); - intent.putExtra("state", enabled); - mContext.sendBroadcastAsUser(intent, UserHandle.ALL); - } - }); - } -} - diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java deleted file mode 100644 index 7939752..0000000 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.systemui.statusbar.policy; - -import android.app.ActivityManager; -import android.content.Context; -import android.util.AttributeSet; -import android.util.Log; -import android.view.View; -import android.widget.ImageView; - -public class CompatModeButton extends ImageView { - private static final boolean DEBUG = false; - private static final String TAG = "StatusBar.CompatModeButton"; - - private ActivityManager mAM; - - public CompatModeButton(Context context, AttributeSet attrs) { - this(context, attrs, 0); - } - - public CompatModeButton(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs); - - setClickable(true); - - mAM = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); - - refresh(); - } - - public void refresh() { - int mode = mAM.getFrontActivityScreenCompatMode(); - if (mode == ActivityManager.COMPAT_MODE_UNKNOWN) { - // If in an unknown state, don't change. - return; - } - final boolean vis = (mode != ActivityManager.COMPAT_MODE_NEVER - && mode != ActivityManager.COMPAT_MODE_ALWAYS); - if (DEBUG) Log.d(TAG, "compat mode is " + mode + "; icon will " + (vis ? "show" : "hide")); - setVisibility(vis ? View.VISIBLE : View.GONE); - } -} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CurrentUserTracker.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CurrentUserTracker.java deleted file mode 100644 index 225ebc1..0000000 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CurrentUserTracker.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.systemui.statusbar.policy; - -import android.app.ActivityManager; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; - -public class CurrentUserTracker extends BroadcastReceiver { - - private int mCurrentUserId; - - public CurrentUserTracker(Context context) { - IntentFilter filter = new IntentFilter(Intent.ACTION_USER_SWITCHED); - context.registerReceiver(this, filter); - mCurrentUserId = ActivityManager.getCurrentUser(); - } - - public int getCurrentUserId() { - return mCurrentUserId; - } - - @Override - public void onReceive(Context context, Intent intent) { - if (Intent.ACTION_USER_SWITCHED.equals(intent.getAction())) { - mCurrentUserId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0); - } - } -} |