Loading core/res/res/drawable/silent_mode_indicator.xml 0 → 100644 +20 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2011 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. --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_selected="false" android:drawable="@android:color/transparent" /> <item android:state_selected="true" android:drawable="@drawable/tab_selected_holo" /> </selector> core/res/res/layout/global_actions_item.xml +2 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ android:minHeight="?android:attr/listPreferredItemHeight" android:orientation="horizontal" android:paddingLeft="11dip" android:paddingLeft="16dip" android:paddingTop="6dip" android:paddingBottom="6dip" > Loading @@ -30,7 +30,7 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center" android:layout_marginRight="9dip" android:layout_marginRight="16dip" /> <LinearLayout Loading core/res/res/layout/global_actions_silent_mode.xml 0 → 100644 +97 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2011 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. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minHeight="?android:attr/listPreferredItemHeight" android:orientation="horizontal" > <LinearLayout android:id="@+id/option1" android:layout_width="64dp" android:layout_height="match_parent" android:background="?android:attr/actionBarItemBackground" > <ImageView android:layout_width="48dp" android:layout_height="match_parent" android:layout_gravity="center" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:layout_marginTop="6dp" android:layout_marginBottom="6dp" android:src="@drawable/ic_audio_vol_mute" android:scaleType="center" android:duplicateParentState="true" android:background="@drawable/silent_mode_indicator" /> </LinearLayout> <!-- Spacer --> <View android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible"/> <LinearLayout android:id="@+id/option2" android:layout_width="64dp" android:layout_height="match_parent" android:background="?android:attr/actionBarItemBackground" > <ImageView android:layout_width="48dp" android:layout_height="match_parent" android:layout_gravity="center" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:layout_marginTop="6dp" android:layout_marginBottom="6dp" android:src="@drawable/ic_audio_ring_notif_vibrate" android:scaleType="center" android:duplicateParentState="true" android:background="@drawable/silent_mode_indicator" /> </LinearLayout> <!-- Spacer --> <View android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible"/> <LinearLayout android:id="@+id/option3" android:layout_width="64dp" android:layout_height="match_parent" android:background="?android:attr/actionBarItemBackground" > <ImageView android:layout_width="48dp" android:layout_height="match_parent" android:layout_gravity="center" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:layout_marginTop="6dp" android:layout_marginBottom="6dp" android:src="@drawable/ic_audio_vol" android:scaleType="center" android:duplicateParentState="true" android:background="@drawable/silent_mode_indicator" /> </LinearLayout> </LinearLayout> No newline at end of file media/java/android/media/AudioService.java +8 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.media.AudioManager.RINGER_MODE_SILENT; import static android.media.AudioManager.RINGER_MODE_VIBRATE; import android.app.ActivityManagerNative; import android.app.KeyguardManager; import android.app.PendingIntent; import android.app.PendingIntent.CanceledException; import android.bluetooth.BluetoothA2dp; Loading Loading @@ -319,6 +320,8 @@ public class AudioService extends IAudioService.Stub { private static final int NOTIFICATION_VOLUME_DELAY_MS = 5000; // previous volume adjustment direction received by checkForRingerModeChange() private int mPrevVolDirection = AudioManager.ADJUST_SAME; // Keyguard manager proxy private KeyguardManager mKeyguardManager; /////////////////////////////////////////////////////////////////////////// // Construction Loading Loading @@ -503,9 +506,10 @@ public class AudioService extends IAudioService.Stub { streamType = getActiveStreamType(suggestedStreamType); } // Play sounds on STREAM_RING only. // Play sounds on STREAM_RING only and if lock screen is not on. if ((flags & AudioManager.FLAG_PLAY_SOUND) != 0 && ((STREAM_VOLUME_ALIAS[streamType] != AudioSystem.STREAM_RING))) { ((STREAM_VOLUME_ALIAS[streamType] != AudioSystem.STREAM_RING) || (mKeyguardManager != null && mKeyguardManager.isKeyguardLocked()))) { flags &= ~AudioManager.FLAG_PLAY_SOUND; } Loading Loading @@ -2659,6 +2663,8 @@ public class AudioService extends IAudioService.Stub { sendMsg(mAudioHandler, MSG_LOAD_SOUND_EFFECTS, SHARED_MSG, SENDMSG_NOOP, 0, 0, null, 0); mKeyguardManager = (KeyguardManager) mContext.getSystemService(Context.KEYGUARD_SERVICE); mScoConnectionState = AudioManager.SCO_AUDIO_STATE_ERROR; resetBluetoothSco(); getBluetoothHeadset(); Loading packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +19 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,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 = 72; private static final int DATABASE_VERSION = 73; private Context mContext; Loading Loading @@ -961,6 +961,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { + " VALUES(?,?);"); loadBooleanSetting(stmt, Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD, R.bool.def_accessibility_speak_password); db.setTransactionSuccessful(); } finally { db.endTransaction(); if (stmt != null) stmt.close(); Loading @@ -968,6 +969,23 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 72; } if (upgradeVersion == 72) { // update vibration settings db.beginTransaction(); SQLiteStatement stmt = null; try { stmt = db.compileStatement("INSERT OR REPLACE INTO system(name,value)" + " VALUES(?,?);"); loadBooleanSetting(stmt, Settings.System.VIBRATE_IN_SILENT, R.bool.def_vibrate_in_silent); db.setTransactionSuccessful(); } finally { db.endTransaction(); if (stmt != null) stmt.close(); } upgradeVersion = 73; } // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { Loading Loading
core/res/res/drawable/silent_mode_indicator.xml 0 → 100644 +20 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2011 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. --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_selected="false" android:drawable="@android:color/transparent" /> <item android:state_selected="true" android:drawable="@drawable/tab_selected_holo" /> </selector>
core/res/res/layout/global_actions_item.xml +2 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ android:minHeight="?android:attr/listPreferredItemHeight" android:orientation="horizontal" android:paddingLeft="11dip" android:paddingLeft="16dip" android:paddingTop="6dip" android:paddingBottom="6dip" > Loading @@ -30,7 +30,7 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center" android:layout_marginRight="9dip" android:layout_marginRight="16dip" /> <LinearLayout Loading
core/res/res/layout/global_actions_silent_mode.xml 0 → 100644 +97 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2011 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. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minHeight="?android:attr/listPreferredItemHeight" android:orientation="horizontal" > <LinearLayout android:id="@+id/option1" android:layout_width="64dp" android:layout_height="match_parent" android:background="?android:attr/actionBarItemBackground" > <ImageView android:layout_width="48dp" android:layout_height="match_parent" android:layout_gravity="center" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:layout_marginTop="6dp" android:layout_marginBottom="6dp" android:src="@drawable/ic_audio_vol_mute" android:scaleType="center" android:duplicateParentState="true" android:background="@drawable/silent_mode_indicator" /> </LinearLayout> <!-- Spacer --> <View android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible"/> <LinearLayout android:id="@+id/option2" android:layout_width="64dp" android:layout_height="match_parent" android:background="?android:attr/actionBarItemBackground" > <ImageView android:layout_width="48dp" android:layout_height="match_parent" android:layout_gravity="center" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:layout_marginTop="6dp" android:layout_marginBottom="6dp" android:src="@drawable/ic_audio_ring_notif_vibrate" android:scaleType="center" android:duplicateParentState="true" android:background="@drawable/silent_mode_indicator" /> </LinearLayout> <!-- Spacer --> <View android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible"/> <LinearLayout android:id="@+id/option3" android:layout_width="64dp" android:layout_height="match_parent" android:background="?android:attr/actionBarItemBackground" > <ImageView android:layout_width="48dp" android:layout_height="match_parent" android:layout_gravity="center" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:layout_marginTop="6dp" android:layout_marginBottom="6dp" android:src="@drawable/ic_audio_vol" android:scaleType="center" android:duplicateParentState="true" android:background="@drawable/silent_mode_indicator" /> </LinearLayout> </LinearLayout> No newline at end of file
media/java/android/media/AudioService.java +8 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.media.AudioManager.RINGER_MODE_SILENT; import static android.media.AudioManager.RINGER_MODE_VIBRATE; import android.app.ActivityManagerNative; import android.app.KeyguardManager; import android.app.PendingIntent; import android.app.PendingIntent.CanceledException; import android.bluetooth.BluetoothA2dp; Loading Loading @@ -319,6 +320,8 @@ public class AudioService extends IAudioService.Stub { private static final int NOTIFICATION_VOLUME_DELAY_MS = 5000; // previous volume adjustment direction received by checkForRingerModeChange() private int mPrevVolDirection = AudioManager.ADJUST_SAME; // Keyguard manager proxy private KeyguardManager mKeyguardManager; /////////////////////////////////////////////////////////////////////////// // Construction Loading Loading @@ -503,9 +506,10 @@ public class AudioService extends IAudioService.Stub { streamType = getActiveStreamType(suggestedStreamType); } // Play sounds on STREAM_RING only. // Play sounds on STREAM_RING only and if lock screen is not on. if ((flags & AudioManager.FLAG_PLAY_SOUND) != 0 && ((STREAM_VOLUME_ALIAS[streamType] != AudioSystem.STREAM_RING))) { ((STREAM_VOLUME_ALIAS[streamType] != AudioSystem.STREAM_RING) || (mKeyguardManager != null && mKeyguardManager.isKeyguardLocked()))) { flags &= ~AudioManager.FLAG_PLAY_SOUND; } Loading Loading @@ -2659,6 +2663,8 @@ public class AudioService extends IAudioService.Stub { sendMsg(mAudioHandler, MSG_LOAD_SOUND_EFFECTS, SHARED_MSG, SENDMSG_NOOP, 0, 0, null, 0); mKeyguardManager = (KeyguardManager) mContext.getSystemService(Context.KEYGUARD_SERVICE); mScoConnectionState = AudioManager.SCO_AUDIO_STATE_ERROR; resetBluetoothSco(); getBluetoothHeadset(); Loading
packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +19 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,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 = 72; private static final int DATABASE_VERSION = 73; private Context mContext; Loading Loading @@ -961,6 +961,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { + " VALUES(?,?);"); loadBooleanSetting(stmt, Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD, R.bool.def_accessibility_speak_password); db.setTransactionSuccessful(); } finally { db.endTransaction(); if (stmt != null) stmt.close(); Loading @@ -968,6 +969,23 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 72; } if (upgradeVersion == 72) { // update vibration settings db.beginTransaction(); SQLiteStatement stmt = null; try { stmt = db.compileStatement("INSERT OR REPLACE INTO system(name,value)" + " VALUES(?,?);"); loadBooleanSetting(stmt, Settings.System.VIBRATE_IN_SILENT, R.bool.def_vibrate_in_silent); db.setTransactionSuccessful(); } finally { db.endTransaction(); if (stmt != null) stmt.close(); } upgradeVersion = 73; } // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { Loading