Skip to content

Commit 280c528

Browse files
committed
QuietHours: added phone ringer whitelist management
Allows to manage list of contacts for which not to mute phone ringer during quiet hours.
1 parent bf61235 commit 280c528

18 files changed

+688
-2
lines changed

.classpath

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
55
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
66
<classpathentry kind="src" path="src"/>
7-
<classpathentry kind="src" path="gen"/>
87
<classpathentry kind="lib" path="ext/api-82.jar" sourcepath="ext/api-82-sources.jar"/>
98
<classpathentry combineaccessrules="false" kind="src" path="/android-support-v7-palette"/>
9+
<classpathentry combineaccessrules="false" kind="src" path="/android-support-v7-appcompat"/>
10+
<classpathentry kind="src" path="gen"/>
1011
<classpathentry kind="output" path="bin/classes"/>
1112
</classpath>

AndroidManifest.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
3535
<uses-permission android:name="android.permission.VIBRATE" />
3636
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
37+
<uses-permission android:name="android.permission.READ_CONTACTS" />
3738

3839
<permission
3940
android:name="gravitybox.permission.UNLOCK"
@@ -122,6 +123,12 @@
122123
android:label="@string/lc_quiet_hours" >
123124
</activity>
124125

126+
<activity
127+
android:name="com.ceco.oreo.gravitybox.ledcontrol.RingerWhitelistActivity"
128+
android:label="@string/pref_lc_qh_ringer_whitelist_title"
129+
android:theme="@style/AppCompatTheme" >
130+
</activity>
131+
125132
<activity
126133
android:name="com.ceco.oreo.gravitybox.UnlockActivity"
127134
android:theme="@android:style/Theme.Translucent.NoTitleBar"

project.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
# Project target.
1414
target=android-27
1515
sdk.buildtools=25.0.3
16-
android.library.reference.1=../android-support-v7-palette
16+
android.library.reference.1=../android-support-v7-appcompat
17+
android.library.reference.2=../android-support-v7-palette
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
* Copyright (C) 2018 Peter Gregus for GravityBox Project (C3C076@xda)
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
-->
16+
<LinearLayout
17+
xmlns:android="http://schemas.android.com/apk/res/android"
18+
xmlns:app="http://schemas.android.com/apk/res-auto"
19+
android:layout_width="match_parent"
20+
android:layout_height="match_parent"
21+
android:orientation="vertical" >
22+
23+
<fragment
24+
android:id="@+id/contacts_fragment"
25+
android:layout_width="match_parent"
26+
android:layout_weight="1"
27+
android:layout_height="0dp"
28+
class="com.ceco.oreo.gravitybox.ledcontrol.RingerWhitelistActivity$ContactsFragment" />
29+
30+
</LinearLayout>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
* Copyright (C) 2018 Peter Gregus for GravityBox Project (C3C076@xda)
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
-->
16+
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
17+
android:id="@android:id/list"
18+
android:layout_width="match_parent"
19+
android:layout_height="match_parent"/>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
* Copyright (C) 2018 Peter Gregus for GravityBox Project (C3C076@xda)
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
-->
16+
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
17+
android:id="@+id/contactName"
18+
android:layout_width="match_parent"
19+
android:layout_height="?android:attr/listPreferredItemHeight"
20+
android:textAppearance="?android:attr/textAppearanceListItem"
21+
android:gravity="center_vertical"
22+
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
23+
android:paddingStart="15dp"
24+
android:paddingEnd="10dp" />

res/menu/ringer_whitelist_menu.xml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
* Copyright (C) 2018 Peter Gregus for GravityBox Project (C3C076@xda)
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
-->
16+
<menu xmlns:android="http://schemas.android.com/apk/res/android"
17+
xmlns:app="http://schemas.android.com/apk/res-auto" >
18+
19+
<item android:id="@+id/search"
20+
android:title="@string/search"
21+
android:icon="@android:drawable/ic_menu_search"
22+
app:showAsAction="collapseActionView|ifRoom"
23+
app:actionViewClass="android.support.v7.widget.SearchView"
24+
android:visible="false" />
25+
26+
<item android:id="@+id/searchKeyword"
27+
android:title=""
28+
app:showAsAction="always"
29+
app:actionViewClass="android.widget.TextView"
30+
android:visible="false" />
31+
32+
<item android:id="@+id/searchReset"
33+
android:title="@string/search_reset"
34+
android:icon="@android:drawable/ic_menu_close_clear_cancel"
35+
app:showAsAction="ifRoom"
36+
android:visible="false" />
37+
38+
<item android:id="@+id/showAll"
39+
android:title="@string/qhrw_menu_show_all" />
40+
41+
<item android:id="@+id/showStarred"
42+
android:title="@string/qhrw_menu_show_starred" />
43+
44+
<item android:id="@+id/showWhitelisted"
45+
android:title="@string/qhrw_menu_show_whitelisted" />
46+
47+
</menu>

res/values-cs/strings.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,4 +2033,13 @@
20332033
<string name="pref_lc_qh_ignore_interactive_summary">Pokud povoleno, notifikace odpovídající pravidlům ignorování tichých hodin
20342034
nebudou utlumeny během interaktivního režimu</string>
20352035

2036+
<!-- QH: Phone ringer whitelist -->
2037+
<string name="pref_lc_qh_ringer_whitelist_title">Povolené kontakty</string>
2038+
<string name="pref_lc_qh_ringer_whitelist_summary">Umožňuje správu kontaktů, pro které je vyzvánění povoleno během tichých hodin</string>
2039+
<string name="search_no_contacts">Žádné kontakty pro zadané klíčové slovo</string>
2040+
<string name="qhrw_menu_show_all">Zobrazit všechny</string>
2041+
<string name="qhrw_menu_show_starred">Zobrazit oblíbené</string>
2042+
<string name="qhrw_menu_show_whitelisted">Zobrazit povolené</string>
2043+
<string name="qhrw_permission_denied">Přístup ke kontaktům byl zamítnut</string>
2044+
20362045
</resources>

res/values-sk/strings.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,4 +2038,13 @@
20382038
<string name="pref_lc_qh_ignore_interactive_summary">Ak povolené, notifikácie zodpovedajúce pravidlám ignorovania tichých hodín
20392039
nebudú utlmené počas interaktívneho režimu</string>
20402040

2041+
<!-- QH: Phone ringer whitelist -->
2042+
<string name="pref_lc_qh_ringer_whitelist_title">Povolené kontakty</string>
2043+
<string name="pref_lc_qh_ringer_whitelist_summary">Umožňuje správu kontaktov, pre ktoré je vyzváňanie povolené počas tichých hodín</string>
2044+
<string name="search_no_contacts">Žiadne kontakty pre zadané kľúčové slovo</string>
2045+
<string name="qhrw_menu_show_all">Zobraziť všetky</string>
2046+
<string name="qhrw_menu_show_starred">Zobraziť obľúbené</string>
2047+
<string name="qhrw_menu_show_whitelisted">Zobraziť povolené</string>
2048+
<string name="qhrw_permission_denied">Prístup ku kontaktom bol zamietnutý</string>
2049+
20412050
</resources>

res/values/strings.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,4 +2109,13 @@
21092109
<string name="pref_lc_qh_ignore_interactive_summary">When enabled, notifications matching ignoring rules
21102110
won\'t be muted by quiet hours interactive mode</string>
21112111

2112+
<!-- QH: Phone ringer whitelist -->
2113+
<string name="pref_lc_qh_ringer_whitelist_title">Phone ringer whitelist</string>
2114+
<string name="pref_lc_qh_ringer_whitelist_summary">Manages list of contacts for which not to mute phone ringer during quiet hours</string>
2115+
<string name="search_no_contacts">No contacts matching keyword found</string>
2116+
<string name="qhrw_menu_show_all">Show all</string>
2117+
<string name="qhrw_menu_show_starred">Show starred</string>
2118+
<string name="qhrw_menu_show_whitelisted">Show whitelisted</string>
2119+
<string name="qhrw_permission_denied">Permission to read contacts denied</string>
2120+
21122121
</resources>

0 commit comments

Comments
 (0)