Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove omnijaw's remenants #32

Open
wants to merge 6 commits into
base: pie
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<uses-permission android:name="android.permission.HARDWARE_TEST" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_FONT_MANAGER" />
<uses-permission android:name="android.permission.MASTER_CLEAR" />
<uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH" />
<uses-permission android:name="android.permission.ACCESS_DOWNLOAD_MANAGER" />
Expand Down Expand Up @@ -3540,18 +3541,6 @@
android:value="com.liquid.liquidlounge.fragments.SmartPixels" />
</activity>

<!-- Weather activity -->
<activity android:name="Settings$WeatherActivity"
android:label="@string/weather_title"
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
android:value="com.liquid.liquidlounge.fragments.WeatherSettings" />
</activity>

<!-- Screen stabilization -->
<activity android:name="Settings$ScreenActivity"
android:label="@string/screen_stabilization_title"
Expand Down
8 changes: 8 additions & 0 deletions res/drawable/font_dialog_icon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- drawable/format_font.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="@*android:color/accent_device_default_light" android:pathData="M17,8H20V20H21V21H17V20H18V17H14L12.5,20H14V21H10V20H11L17,8M18,9L14.5,16H18V9M5,3H10C11.11,3 12,3.89 12,5V16H9V11H6V16H3V5C3,3.89 3.89,3 5,3M6,5V9H9V5H6Z" />
</vector>
60 changes: 60 additions & 0 deletions res/layout/font_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 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.
-->
<!-- Layout for a Preference in a PreferenceActivity. The
Preference is able to place a specific widget for its particular
type in the "widget_frame" layout. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/widget_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:gravity="center_vertical"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:background="?android:attr/selectableItemBackground">
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="12dip"
android:padding="2dp"
android:maxWidth="36dip"
android:maxHeight="36dip"
android:adjustViewBounds="true"
android:layout_gravity="center" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2dip"
android:layout_marginEnd="6dip"
android:layout_marginTop="6dip"
android:layout_marginBottom="6dip"
android:layout_weight="1">
<TextView android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="@android:style/TextAppearance.Material.Subhead"
android:textColor="?android:attr/textColorPrimary"
android:ellipsize="marquee"
android:fadingEdge="horizontal" />
<TextView android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@android:id/title"
android:layout_alignStart="@android:id/title"
android:textAppearance="@android:style/TextAppearance.Material.Body1"
android:textColor="?android:attr/textColorSecondary"
android:maxLines="2" />
</RelativeLayout>
</LinearLayout>
16 changes: 13 additions & 3 deletions res/values/custom_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@

<!-- Full Swipe Gesture, All Hail DU -->
<string name="full_gesture_mode_title">Enable full gesture mode</string>
<string name="full_gesture_mode_summary">This mode will disable also the back button and you will be able to trigger a back button action by a left swipe on navbar. Right swipe will still trigger the last-app action and left swipe will move apps. To go home you will be able to tap on any navbar empty space, not only the home button.</string>
<string name="full_gesture_mode_summary">This mode disables the back button and you can trigger a back button action by a left swipe on navbar. Right swipe still triggers the last-app and the overview apps scrolling. To go home you can tap on any navbar empty space, not only the home button. When keyboard is showing, long press on navbar to move the text cursor.</string>
<string name="full_gesture_mode_dt2s_title">Enable double tap to sleep</string>
<string name="full_gesture_mode_dt2s_summary">Tap on an empty navbar space but not the home button to switch the screen off.</string>

Expand Down Expand Up @@ -638,7 +638,7 @@
<string name="qs_header_transparent">Transparent</string>

<!-- Battery info -->
<string name="battery_info_title">Battery Info</string>
<string name="battery_info_title">Battery info</string>
<string name="battery_info_summary">Advanced battery information</string>
<string name="charge_full_design">Capacity</string>
<string name="charge_cycle">Charge cycles</string>
Expand All @@ -648,4 +648,14 @@
<string name="battery_voltage">Voltage</string>
<string name="battery_health">Health</string>

</resources>
<!-- Font manager -->
<string name="font_picker_title">Font manager</string>
<string name="disable_fonts_installed_title">Font picker is unavailable to avoid conflicts with Substratum. Uninstall it if you wish to use the font picker.</string>
<string name="font_picker_progress">Applying new font\u2026</string>

<!-- Sound: Title for the option defining the phone ringtone for slot1 on Muilti SIM device. [CHAR LIMIT=50] -->
<string name="ringtone1_title">Phone ringtone - SIM 1</string>
<!-- Sound: Title for the option defining the phone ringtone for slot2 on Muilti SIM device. [CHAR LIMIT=50] -->
<string name="ringtone2_title">Phone ringtone - SIM 2</string>

</resources>
5 changes: 5 additions & 0 deletions res/xml/display_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@
android:key="density_category"
android:title="@string/density_category">

<com.android.settings.display.FontDialogPreference
android:key="custom_font"
android:title="@string/font_picker_title"
android:persistent="false" />

<Preference
android:key="font_size"
android:title="@string/title_font_size"
Expand Down
14 changes: 12 additions & 2 deletions res/xml/sound_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,24 @@
android:ringtoneType="ringtone"
android:order="-100"/>

<!-- Phone ringtone for Slot2 -->
<com.android.settings.DefaultRingtonePreference
android:key="ringtone2"
android:title="@string/ringtone2_title"
android:dialogTitle="@string/ringtone_title"
android:summary="@string/summary_placeholder"
android:ringtoneType="ringtone"
settings:allowDividerAbove="false"
android:order="-90"/>

<!-- Default notification ringtone -->
<com.android.settings.DefaultRingtonePreference
android:key="notification_ringtone"
android:title="@string/notification_ringtone_title"
android:dialogTitle="@string/notification_ringtone_title"
android:summary="@string/summary_placeholder"
android:ringtoneType="notification"
android:order="-90"/>
android:order="-80"/>

<!-- Default alarm ringtone -->
<com.android.settings.DefaultRingtonePreference
Expand All @@ -127,7 +137,7 @@
android:summary="@string/summary_placeholder"
android:persistent="false"
android:ringtoneType="alarm"
android:order="-80"/>
android:order="-70"/>

<!-- Interruptions -->
<com.android.settingslib.RestrictedPreference
Expand Down
6 changes: 4 additions & 2 deletions src/com/android/settings/DefaultRingtonePreference.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ public void onPrepareRingtonePickerIntent(Intent ringtonePickerIntent) {

@Override
protected void onSaveRingtone(Uri ringtoneUri) {
RingtoneManager.setActualDefaultRingtoneUri(mUserContext, getRingtoneType(), ringtoneUri);
RingtoneManager.setActualDefaultRingtoneUriBySlot(mUserContext, getRingtoneType(),
ringtoneUri, getSlotId());
}

@Override
protected Uri onRestoreRingtone() {
return RingtoneManager.getActualDefaultRingtoneUri(mUserContext, getRingtoneType());
return RingtoneManager.getActualDefaultRingtoneUriBySlot(mUserContext, getRingtoneType(),
getSlotId());
}

}
41 changes: 41 additions & 0 deletions src/com/android/settings/DisplaySettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
package com.android.settings;

import android.app.Fragment;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.provider.SearchIndexableResource;

import com.android.internal.hardware.AmbientDisplayConfiguration;
Expand All @@ -30,6 +34,7 @@
import com.android.settings.display.ColorModePreferenceController;
import com.android.settings.display.ContentPaddingPreferenceController;
import com.android.settings.display.DarkUIPreferenceController;
import com.android.settings.display.FontPickerPreferenceController;
import com.android.settings.display.LiftToWakePreferenceController;
import com.android.settings.display.NightDisplayPreferenceController;
import com.android.settings.display.NightModePreferenceController;
Expand Down Expand Up @@ -63,6 +68,41 @@ public class DisplaySettings extends DashboardFragment {
private static final String KEY_AUTO_BRIGHTNESS = "auto_brightness_entry";
private static final String KEY_NIGHT_DISPLAY = "night_display";

private IntentFilter mIntentFilter;
private static FontPickerPreferenceController mFontPickerPreference;

private BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals("com.android.server.ACTION_FONT_CHANGED")) {
mFontPickerPreference.stopProgress();
}
}
};

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mIntentFilter = new IntentFilter();
mIntentFilter.addAction("com.android.server.ACTION_FONT_CHANGED");
}

@Override
public void onResume() {
super.onResume();
final Context context = getActivity();
context.registerReceiver(mIntentReceiver, mIntentFilter);
}

@Override
public void onPause() {
super.onPause();
final Context context = getActivity();
context.unregisterReceiver(mIntentReceiver);
mFontPickerPreference.stopProgress();
}

@Override
public int getMetricsCategory() {
return MetricsEvent.DISPLAY;
Expand Down Expand Up @@ -94,6 +134,7 @@ private static List<AbstractPreferenceController> buildPreferenceControllers(
controllers.add(new AccentPickerPreferenceController(context, lifecycle, fragment));
controllers.add(new CameraGesturePreferenceController(context));
controllers.add(new DarkUIPreferenceController(context));
controllers.add(mFontPickerPreference = new FontPickerPreferenceController(context, lifecycle, fragment));
controllers.add(new LiftToWakePreferenceController(context));
controllers.add(new NightDisplayPreferenceController(context));
controllers.add(new NightModePreferenceController(context));
Expand Down
25 changes: 24 additions & 1 deletion src/com/android/settings/RingtonePreference.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* <p>
* If the user chooses the "Default" item, the saved string will be one of
* {@link System#DEFAULT_RINGTONE_URI},
* {@link System#DEFAULT_RINGTONE2_URI},
* {@link System#DEFAULT_NOTIFICATION_URI}, or
* {@link System#DEFAULT_ALARM_ALERT_URI}. If the user chooses the "Silent"
* item, the saved string will be an empty string.
Expand All @@ -50,6 +51,9 @@ public class RingtonePreference extends Preference {

private static final String TAG = "RingtonePreference";

// Default is slot0
private int mSlotId = 0;

private int mRingtoneType;
private boolean mShowDefault;
private boolean mShowSilent;
Expand Down Expand Up @@ -83,6 +87,25 @@ public int getUserId() {
return mUserId;
}

/**
* Sets the slot id that this preference belongs to.
*
* @param slotId The slot id that this preference belongs to.
*/
public void setSlotId(int slotId) {
mSlotId = slotId;
}

/**
* Returns the slot id that this preference belongs to.
*
* @return The slot id that this preference belongs to.
* @see #setSlotId(int)
*/
public int getSlotId() {
return mSlotId;
}

/**
* Returns the sound type(s) that are shown in the picker.
*
Expand Down Expand Up @@ -161,7 +184,7 @@ public void onPrepareRingtonePickerIntent(Intent ringtonePickerIntent) {
ringtonePickerIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, mShowDefault);
if (mShowDefault) {
ringtonePickerIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI,
RingtoneManager.getDefaultUri(getRingtoneType()));
RingtoneManager.getDefaultUriBySlot(getRingtoneType(), getSlotId()));
}

ringtonePickerIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, mShowSilent);
Expand Down
1 change: 0 additions & 1 deletion src/com/android/settings/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ public static class AmbientDisplayActivity extends SettingsActivity { /* empty *
public static class AmbientPlayActivity extends SettingsActivity { /* empty */ }
public static class NavigationActivity extends SettingsActivity { /* empty */ }
public static class SmartPixelsActivity extends SettingsActivity { /* empty */ }
public static class WeatherActivity extends SettingsActivity { /* empty */ }
public static class ScreenActivity extends SettingsActivity { /* empty */ }
public static class ExpandedDesktopActivity extends SettingsActivity { /* empty */ }
public static class RotationActivity extends SettingsActivity { /* empty */ }
Expand Down
2 changes: 0 additions & 2 deletions src/com/android/settings/core/gateway/SettingsGateway.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
import com.liquid.liquidlounge.fragments.HeadsUpSettings;
import com.liquid.liquidlounge.fragments.NavigationSettings;
import com.liquid.liquidlounge.fragments.SmartPixels;
import com.liquid.liquidlounge.fragments.WeatherSettings;
import com.liquid.liquidlounge.fragments.PieSettings;

public class SettingsGateway {
Expand Down Expand Up @@ -285,7 +284,6 @@ public class SettingsGateway {
AmbientPlaySettings.class.getName(),
NavigationSettings.class.getName(),
SmartPixels.class.getName(),
WeatherSettings.class.getName(),
ExpandedDesktopPreferenceFragment.class.getName(),
DisplayRotation.class.getName(),
AmbientPlayHistory.class.getName(),
Expand Down
Loading