diff options
Diffstat (limited to 'packages')
14 files changed, 116 insertions, 175 deletions
diff --git a/packages/Keyguard/res/layout-land/keyguard_simple_host_view.xml b/packages/Keyguard/res/layout-land/keyguard_simple_host_view.xml new file mode 100644 index 0000000..ebd0a64 --- /dev/null +++ b/packages/Keyguard/res/layout-land/keyguard_simple_host_view.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +** +** Copyright 2014, 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. +*/ +--> + +<!-- This is the host view that generally contains two sub views: the widget view + and the security view. --> +<com.android.keyguard.KeyguardSimpleHostView + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard" + android:id="@+id/keyguard_host_view" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <com.android.keyguard.KeyguardSecurityContainer + android:id="@+id/keyguard_security_container" + android:layout_width="wrap_content" + android:layout_height="@dimen/keyguard_security_height" + android:clipChildren="false" + android:clipToPadding="false" + android:padding="0dp" + android:layout_gravity="center"> + <com.android.keyguard.KeyguardSecurityViewFlipper + android:id="@+id/view_flipper" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:clipChildren="false" + android:clipToPadding="false" + android:paddingTop="@dimen/keyguard_security_view_margin" + android:gravity="center"> + </com.android.keyguard.KeyguardSecurityViewFlipper> + </com.android.keyguard.KeyguardSecurityContainer> + +</com.android.keyguard.KeyguardSimpleHostView> + diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java index 7ac94bd..1e79ee4 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java @@ -1051,9 +1051,6 @@ public class KeyguardHostView extends KeyguardViewBase { } private void enableUserSelectorIfNecessary() { - if (!UserManager.supportsMultipleUsers()) { - return; // device doesn't support multi-user mode - } final UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE); if (um == null) { Throwable t = new Throwable(); @@ -1063,61 +1060,53 @@ public class KeyguardHostView extends KeyguardViewBase { } // if there are multiple users, we need to enable to multi-user switcher - final List<UserInfo> users = um.getUsers(true); - if (users == null) { - Throwable t = new Throwable(); - t.fillInStackTrace(); - Log.e(TAG, "list of users is null.", t); + if (!um.isUserSwitcherEnabled()) { return; } final View multiUserView = findViewById(R.id.keyguard_user_selector); if (multiUserView == null) { - Throwable t = new Throwable(); - t.fillInStackTrace(); - Log.e(TAG, "can't find user_selector in layout.", t); + if (DEBUG) Log.d(TAG, "can't find user_selector in layout."); return; } - if (users.size() > 1) { - if (multiUserView instanceof KeyguardMultiUserSelectorView) { - mKeyguardMultiUserSelectorView = (KeyguardMultiUserSelectorView) multiUserView; - mKeyguardMultiUserSelectorView.setVisibility(View.VISIBLE); - mKeyguardMultiUserSelectorView.addUsers(users); - UserSwitcherCallback callback = new UserSwitcherCallback() { - @Override - public void hideSecurityView(int duration) { - getSecurityContainer().animate().alpha(0).setDuration(duration); - } + if (multiUserView instanceof KeyguardMultiUserSelectorView) { + mKeyguardMultiUserSelectorView = (KeyguardMultiUserSelectorView) multiUserView; + mKeyguardMultiUserSelectorView.setVisibility(View.VISIBLE); + mKeyguardMultiUserSelectorView.addUsers(um.getUsers(true)); + UserSwitcherCallback callback = new UserSwitcherCallback() { + @Override + public void hideSecurityView(int duration) { + getSecurityContainer().animate().alpha(0).setDuration(duration); + } - @Override - public void showSecurityView() { - getSecurityContainer().setAlpha(1.0f); - } + @Override + public void showSecurityView() { + getSecurityContainer().setAlpha(1.0f); + } - @Override - public void showUnlockHint() { - if (getSecurityContainer() != null) { - getSecurityContainer().showUsabilityHint(); - } + @Override + public void showUnlockHint() { + if (getSecurityContainer() != null) { + getSecurityContainer().showUsabilityHint(); } + } - @Override - public void userActivity() { - if (mViewMediatorCallback != null) { - mViewMediatorCallback.userActivity(); - } + @Override + public void userActivity() { + if (mViewMediatorCallback != null) { + mViewMediatorCallback.userActivity(); } - }; - mKeyguardMultiUserSelectorView.setCallback(callback); - } else { - Throwable t = new Throwable(); - t.fillInStackTrace(); - if (multiUserView == null) { - Log.e(TAG, "could not find the user_selector.", t); - } else { - Log.e(TAG, "user_selector is the wrong type.", t); } + }; + mKeyguardMultiUserSelectorView.setCallback(callback); + } else { + Throwable t = new Throwable(); + t.fillInStackTrace(); + if (multiUserView == null) { + Log.e(TAG, "could not find the user_selector.", t); + } else { + Log.e(TAG, "user_selector is the wrong type.", t); } } } diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardMultiUserSelectorView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardMultiUserSelectorView.java index 7975d8e..06815e1 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardMultiUserSelectorView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardMultiUserSelectorView.java @@ -76,11 +76,13 @@ public class KeyguardMultiUserSelectorView extends FrameLayout implements View.O Collections.sort(users, mOrderAddedComparator); for (UserInfo user: users) { - KeyguardMultiUserAvatar uv = createAndAddUser(user); - if (user.id == activeUser.id) { - mActiveUserAvatar = uv; + if (user.supportsSwitchTo()) { + KeyguardMultiUserAvatar uv = createAndAddUser(user); + if (user.id == activeUser.id) { + mActiveUserAvatar = uv; + } + uv.setActive(false, false, null); } - uv.setActive(false, false, null); } mActiveUserAvatar.lockPressed(true); } diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java index 43165eb..40087cd 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java @@ -71,6 +71,7 @@ public class KeyguardViewManager { // Timeout used for keypresses static final int DIGIT_PRESS_WAKE_MILLIS = 5000; + private static final boolean ENABLE_SIMPLE_KEYGUARD = false; private final Context mContext; private final ViewManager mViewManager; @@ -312,7 +313,7 @@ public class KeyguardViewManager { if (force || mKeyguardView == null) { mKeyguardHost.setCustomBackground(null); mKeyguardHost.removeAllViews(); - int layout = allowNotificationsOnSecureKeyguard() + int layout = (allowNotificationsOnSecureKeyguard() && ENABLE_SIMPLE_KEYGUARD) ? R.layout.keyguard_simple_host_view : R.layout.keyguard_host_view; if (mCurrentLayout != layout) { diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java index e0ee4e0..151177e 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java @@ -704,7 +704,7 @@ public class KeyguardViewMediator { private void maybeSendUserPresentBroadcast() { if (mSystemReady && mLockPatternUtils.isLockScreenDisabled() - && mUserManager.getUsers(true).size() == 1) { + && !mUserManager.isUserSwitcherEnabled()) { // Lock screen is disabled because the user has set the preference to "None". // In this case, send out ACTION_USER_PRESENT here instead of in // handleKeyguardDone() @@ -940,7 +940,7 @@ public class KeyguardViewMediator { return; } - if (mUserManager.getUsers(true).size() < 2 + if (!mUserManager.isUserSwitcherEnabled() && mLockPatternUtils.isLockScreenDisabled() && !lockedOrMissing) { if (DEBUG) Log.d(TAG, "doKeyguard: not showing because lockscreen is off"); return; diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index 69f7152..7410b9d 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -183,4 +183,7 @@ <!-- Default for Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE --> <integer name="def_wifi_scan_always_available">0</integer> + <!-- Default for Settings.Global.LOCK_SCREEN_SHOW_NOTIFICATIONS, 1==on --> + <integer name="def_lock_screen_show_notifications">1</integer> + </resources> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index f316d88..b546689 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -69,7 +69,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { // database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion' // is properly propagated through your change. Not doing so will result in a loss of user // settings. - private static final int DATABASE_VERSION = 98; + private static final int DATABASE_VERSION = 99; private Context mContext; private int mUserHandle; @@ -1556,6 +1556,24 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 98; } + if (upgradeVersion == 98) { + if (mUserHandle == UserHandle.USER_OWNER) { + db.beginTransaction(); + SQLiteStatement stmt = null; + try { + stmt = db.compileStatement("INSERT OR REPLACE INTO global(name,value)" + + " VALUES(?,?);"); + loadIntegerSetting(stmt, Settings.Global.LOCK_SCREEN_SHOW_NOTIFICATIONS, + R.integer.def_lock_screen_show_notifications); + db.setTransactionSuccessful(); + } finally { + db.endTransaction(); + if (stmt != null) stmt.close(); + } + } + upgradeVersion = 99; + } + // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { diff --git a/packages/SystemUI/res/anim/hydraulic_brake_interpolator.xml b/packages/SystemUI/res/anim/hydraulic_brake_interpolator.xml deleted file mode 100644 index 5b6778e..0000000 --- a/packages/SystemUI/res/anim/hydraulic_brake_interpolator.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* //device/apps/common/res/anim/ease_out_interpolator.xml -** -** Copyright 2007, 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. -*/ ---> - -<decelerateInterpolator - xmlns:android="http://schemas.android.com/apk/res/android" - android:factor="10.0" /> diff --git a/packages/SystemUI/res/anim/lights_out_in.xml b/packages/SystemUI/res/anim/lights_out_in.xml deleted file mode 100644 index f76a452..0000000 --- a/packages/SystemUI/res/anim/lights_out_in.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- 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. ---> - -<set xmlns:android="http://schemas.android.com/apk/res/android" - > - <translate android:fromYDelta="-100%p" android:toYDelta="0" - android:duration="@android:integer/config_mediumAnimTime" - android:interpolator="@anim/hydraulic_brake_interpolator" - /> - <alpha android:fromAlpha="0.5" android:toAlpha="1.0" - android:duration="@android:integer/config_longAnimTime" - /> -</set> diff --git a/packages/SystemUI/res/anim/lights_out_out.xml b/packages/SystemUI/res/anim/lights_out_out.xml deleted file mode 100644 index 610ac7a..0000000 --- a/packages/SystemUI/res/anim/lights_out_out.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- 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. ---> - -<set xmlns:android="http://schemas.android.com/apk/res/android" - > - <translate android:toYDelta="-100%p" android:fromYDelta="0" - android:duration="@android:integer/config_mediumAnimTime" - android:interpolator="@anim/hydraulic_brake_interpolator" - /> - <alpha android:toAlpha="0.5" android:fromAlpha="1.0" - android:duration="@android:integer/config_longAnimTime" - /> -</set> diff --git a/packages/SystemUI/res/anim/notification_dnd_off.xml b/packages/SystemUI/res/anim/notification_dnd_off.xml deleted file mode 100644 index 4e88855..0000000 --- a/packages/SystemUI/res/anim/notification_dnd_off.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- 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. ---> - -<set xmlns:android="http://schemas.android.com/apk/res/android" - > - <translate android:fromXDelta="100%p" android:toXDelta="0" - android:duration="@android:integer/config_longAnimTime" - android:interpolator="@anim/hydraulic_brake_interpolator" - /> -</set> diff --git a/packages/SystemUI/res/anim/notification_dnd_on.xml b/packages/SystemUI/res/anim/notification_dnd_on.xml deleted file mode 100644 index 309943b..0000000 --- a/packages/SystemUI/res/anim/notification_dnd_on.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- 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. ---> - -<set xmlns:android="http://schemas.android.com/apk/res/android" - > - <translate android:toXDelta="100%p" android:fromXDelta="0" - android:duration="@android:integer/config_longAnimTime" - android:interpolator="@anim/hydraulic_brake_interpolator" - /> -</set> diff --git a/packages/SystemUI/res/values-th/strings.xml b/packages/SystemUI/res/values-th/strings.xml index b5c24d7..033e56d 100644 --- a/packages/SystemUI/res/values-th/strings.xml +++ b/packages/SystemUI/res/values-th/strings.xml @@ -72,7 +72,7 @@ <string name="use_mtp_button_title" msgid="4333504413563023626">"ต่อเชื่อมเป็นโปรแกรมเล่นสื่อ (MTP)"</string> <string name="use_ptp_button_title" msgid="7517127540301625751">"ต่อเชื่อมเป็นกล้องถ่ายรูป (PTP)"</string> <string name="installer_cd_button_title" msgid="2312667578562201583">"ติดตั้งแอปพลิเคชัน Android File Transfer ของ Mac"</string> - <string name="accessibility_back" msgid="567011538994429120">"ย้อนกลับ"</string> + <string name="accessibility_back" msgid="567011538994429120">"กลับ"</string> <string name="accessibility_home" msgid="8217216074895377641">"หน้าแรก"</string> <string name="accessibility_menu" msgid="316839303324695949">"เมนู"</string> <string name="accessibility_recent" msgid="8571350598987952883">"แอปพลิเคชันล่าสุด"</string> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java index 4d7ff5e..bcb818a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java @@ -312,7 +312,7 @@ class QuickSettings { public void onClick(View v) { collapsePanels(); final UserManager um = UserManager.get(mContext); - if (um.getUsers(true).size() > 1) { + if (um.isUserSwitcherEnabled()) { // Since keyguard and systemui were merged into the same process to save // memory, they share the same Looper and graphics context. As a result, // there's no way to allow concurrent animation while keyguard inflates. |