Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nto kk4.4
  • Loading branch information
fusionjack committed Aug 27, 2014
2 parents 3ea2589 + 4551ceb commit 0917ccd
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 2 deletions.
7 changes: 7 additions & 0 deletions core/java/android/provider/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -2047,6 +2047,13 @@ public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean
/** @hide */
public static final int VOLUME_OVERLAY_NONE = 3;

/**
* Volume panel background color
*
* @hide
*/
public static final String VOLUME_PANEL_BG_COLOR = "volume_panel_bg_color";

/**
* Whether the torch will pulse on incoming call
* @hide
Expand Down
32 changes: 30 additions & 2 deletions core/java/android/view/VolumePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import android.content.IntentFilter;
import android.content.res.Resources;
import android.database.ContentObserver;
import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.media.AudioService;
import android.media.AudioSystem;
Expand Down Expand Up @@ -118,6 +119,8 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
private boolean mVoiceCapable;
private boolean mVolumeLinkNotification;
private int mCurrentOverlayStyle = -1;
private Drawable defaultBackground;
private int mPanelColor;

// True if we want to play tones on the system stream when the master stream is specified.
private final boolean mPlayMasterStreamTones;
Expand Down Expand Up @@ -236,6 +239,7 @@ public void onChange(boolean selfChange) {
Settings.System.MODE_VOLUME_OVERLAY, VOLUME_OVERLAY_EXPANDABLE,
UserHandle.USER_CURRENT);
changeOverlayStyle(overlayStyle);
setColor();
}
};

Expand Down Expand Up @@ -359,14 +363,17 @@ public void onDismiss(DialogInterface dialog) {
context.getContentResolver().registerContentObserver(
Settings.System.getUriFor(Settings.System.MODE_VOLUME_OVERLAY), false,
mSettingsObserver, UserHandle.USER_ALL);

context.getContentResolver().registerContentObserver(
Settings.System.getUriFor(Settings.System.VOLUME_PANEL_BG_COLOR), false,
mSettingsObserver, UserHandle.USER_ALL);
boolean masterVolumeKeySounds = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_useVolumeKeySounds);

mPlayMasterStreamTones = useMasterVolume && masterVolumeKeySounds;

mMoreButton.setOnClickListener(this);
listenToRingerMode();
setColor();
}

private void changeOverlayStyle(int newStyle) {
Expand Down Expand Up @@ -417,10 +424,31 @@ public void setTheme() {
// Force reload the background (to do not get the old cached one)
// and update the states.
mPanel.setBackgroundResource(R.color.transparent);
mPanel.setBackgroundResource(R.drawable.dialog_full_holo_dark);
setColor();
updateStates();
}

private void setColor() {
ContentResolver resolver = mContext.getContentResolver();

defaultBackground = mContext.getResources().getDrawable(
R.drawable.dialog_full_holo_dark).getCurrent();
mPanelColor = Settings.System.getIntForUser(resolver,
Settings.System.VOLUME_PANEL_BG_COLOR, -2, UserHandle.USER_CURRENT);

if (mPanelColor == Integer.MIN_VALUE
|| mPanelColor == -2) {
// Flag to reset volume panel background color
mPanel.setBackground(defaultBackground);
} else {
if (mPanelColor != 0x00ffffff) {
mPanel.setBackgroundColor(mPanelColor);
} else {
mPanel.setBackgroundResource(R.drawable.dialog_full_holo_dark);
}
}
}

private void listenToRingerMode() {
final IntentFilter filter = new IntentFilter();
filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);
Expand Down
109 changes: 109 additions & 0 deletions core/res/res/values-pl/slim_strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/* //device/apps/common/assets/res/any/strings.xml
**
** Copyright 2013, SlimRoms 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.
*/
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

<!-- Privacy Guard -->
<string name="permlab_changePrivacyGuardState">włącz/wyłącz Kontrolę Prywatności</string>
<string name="permdesc_changePrivacyGuardState">Pozwala aplikacji decydować, kiedy inna aplikacja zostanie uruchomiona w trybie ochrony prywatności. W trybie tym aplikacje nie mają dostępu do osobistych danych użytkownika, takich jak kontakty, historia połączeń czy wiadomości.</string>
<string name="privacy_guard_notification">Kontrola Prywatności aktywna</string>
<string name="privacy_guard_notification_detail"><xliff:g id="app">%1$s</xliff:g> nie będzie mieć dostępu do osobistych danych</string>
<string name="privacy_guard_custom_notification_detail"><xliff:g id="app">%1$s</xliff:g> nie będzie mieć dostępu do uprawnień</string>

<string name="default_string">Domyślny</string>

<!-- Button to reboot the phone, within the Phone Options dialog -->
<string name="reboot_system" product="tablet">Uruchom ponownie tablet</string>
<string name="reboot_system" product="default">Uruchom ponownie telefon</string>
<!-- Reboot Progress Dialog. This is shown if the user chooses to reboot the phone. -->

<!-- label for item that screenshots in phone options dialog -->
<string name="global_action_screenshot">Zrzut ekranu</string>

<!-- Button to reboot the phone, within the Reboot Options dialog -->
<string name="reboot_reboot">Uruchom ponownie</string>
<!-- Button to reboot the phone into recovery, within the Reboot Options dialog -->
<string name="reboot_recovery">Uruchom w trybie Recovery</string>
<!-- Button to reboot the phone into bootloader, within the Reboot Options dialog -->
<string name="reboot_bootloader">Uruchom w trybie Bootloader</string>
<!-- Button to reboot the phone into bootmenu, within the Reboot Options dialog -->
<string name="reboot_bootmenu">Uruchom Bootmenu</string>
<!-- Button to reboot the phone into fastboot, within the Reboot Options dialog -->
<string name="reboot_fastboot">Uruchom w trybie Fastboot</string>
<!-- Button to reboot the phone into download, within the Reboot Options dialog -->
<string name="reboot_download">Uruchom w trybie Download</string>

<!-- Reboot Progress Dialog. This is shown if the user chooses to reboot the phone. -->
<string name="reboot_progress">Ponowne uruchamianie\u2026</string>
<!-- Reboot Confirmation Dialog. When the user chooses to reboot the phone, there will be a confirmation dialog. This is the message. -->
<string name="reboot_confirm">Telefon zostanie uruchomiony ponownie.</string>

<!-- label for item that reboots the phone in phone options dialog -->
<string name="global_action_reboot">Uruchom ponownie</string>

<!-- label for item that opens the profile choosing dialog -->
<string name="global_action_choose_profile">Profil</string>

<!-- In WiFi AP notification -->
<string name="notify_turn_wifi_ap_off_title">Wyłącz Wi-Fi AP</string>

<!-- status message in phone options dialog for when expanded desktop is on -->
<string name="global_actions_expanded_desktop_mode_on_status">Rozszerzony pulpit włączony</string>

<!-- status message in phone options dialog for when expanded desktop is off -->
<string name="global_actions_expanded_desktop_mode_off_status">Rozszerzony pulpit wyłączony</string>

<!-- status message in phone options dialog for when pie is on -->
<string name="global_actions_pie_mode_on_status">Kontrola Pie włączona</string>

<!-- status message in phone options dialog for when pie is off -->
<string name="global_actions_pie_mode_off_status">Kontrola Pie wyłączone</string>

<!-- Error message if user want to try to disable all navigation options -->
<string name="disable_pie_navigation_error">Nie możesz wyłączyć Kontroli Pie. Żadna inna opcja nawigacji nie jest włączona. Włącz najpierw pasek nawigacji, aby wyłączyć Kontrolę Pie.</string>

<!-- status message in phone options dialog for when navigation bar is on -->
<string name="global_actions_nav_bar_mode_on_status">Pasek nawigacji włączony</string>

<!-- status message in phone options dialog for when navigation bar is off -->
<string name="global_actions_nav_bar_mode_off_status">Pasek nawigacji wyłączony</string>

<!-- Error message if user want to try to disable all navigation options -->
<string name="disable_navigation_pie_error">Nie możesz wyłączyć paska nawigacji. Żadna inna opcja nawigacji nie jest włączona. Włącz najpierw Kontrolę Pie, aby wyłączyć pasek nawigacji.</string>

<!-- Description of accessibility direction for targets [CHAR LIMIT=NONE] -->
<string name="accessibility_target_direction">Przesuń aby aktywować cel</string>

<!-- stylus gestures support -->
<string name="stylus_app_not_installed">%s nie jest zainstalowana</string>

<!-- Error description on theme switch with ligtsensor mode enabled -->
<string name="theme_auto_switch_mode_error">Automatyczna korekcja jasności jest włączona. Ręczna zmiana ustawień jest niemożliwa.</string>

<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permlab_preventpower">zastępowanie przycisku zasilania</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permdesc_preventpower">Pozwala aplikacji na zastępowanie przycisku zasilania</string>

<!-- Heads up -->
<string name="permlab_changeHeadsUpState">włącz lub wyłącz powiadomienia Heads-Up</string>
<string name="permdesc_changeHeadsUpState">Pozwala aplikacji decydować, kiedy inna aplikacja będzie mogła wyświetlać normalne powiadomienia jako powiadomienia Heads-Up.</string>


</resources>

0 comments on commit 0917ccd

Please sign in to comment.