Skip to content

Commit

Permalink
Merge remote-tracking branch 'public/r11.0' into r11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucchetto committed Nov 15, 2020
2 parents f66b42e + 258004e commit eb1940e
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 312 deletions.
3 changes: 0 additions & 3 deletions core/res/res-revengeos/values/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@
<!-- Whether to cleanup fingerprints upon connection to the daemon and when user switches -->
<bool name="config_cleanupUnusedFingerprints">true</bool>

<!-- Workaround to trim baseband version's string of some devices with duplicated baseband string -->
<bool name="config_trim_baseband_version_string">false</bool>

<!-- Defines the sysfs attribute path used by pocket bridge
to communicate pocket state to the pocket judge kernel driver. -->
<string name="config_pocketBridgeSysfsInpocket"></string>
Expand Down
2 changes: 0 additions & 2 deletions core/res/res-revengeos/values/symbols.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
<!-- Whether to cleanup fingerprints upon connection to the daemon and when user switches -->
<java-symbol type="bool" name="config_cleanupUnusedFingerprints" />

<java-symbol type="bool" name="config_trim_baseband_version_string" />

<!-- Pocket bridge -->
<java-symbol type="string" name="config_pocketBridgeSysfsInpocket" />
<java-symbol type="bool" name="config_pocketModeSupported" />
Expand Down
3 changes: 3 additions & 0 deletions packages/SystemUI/res-keyguard/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,7 @@

<!-- The translation for disappearing security views after having solved them. -->
<dimen name="disappear_y_translation">-32dp</dimen>

<!-- Padding added to keyguard status area when Type clock is in use -->
<dimen name="keyguard_status_area_typeclock_padding">32dp</dimen>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import android.util.AttributeSet;
import android.util.Log;
import android.util.MathUtils;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
Expand All @@ -29,6 +30,7 @@
import com.android.internal.colorextraction.ColorExtractor;
import com.android.internal.colorextraction.ColorExtractor.OnColorsChangedListener;
import com.android.keyguard.clock.ClockManager;
import com.android.keyguard.KeyguardSliceView;
import com.android.systemui.Interpolators;
import com.android.systemui.R;
import com.android.systemui.colorextraction.SysuiColorExtractor;
Expand Down Expand Up @@ -111,7 +113,7 @@ public class KeyguardClockSwitch extends RelativeLayout {
* Status area (date and other stuff) shown below the clock. Plugin can decide whether or not to
* show it below the alternate clock.
*/
private View mKeyguardStatusArea;
private KeyguardSliceView mKeyguardStatusArea;

/**
* Maintain state so that a newly connected plugin can be initialized.
Expand Down Expand Up @@ -238,6 +240,7 @@ private void setClockPlugin(ClockPlugin plugin) {
mClockPlugin.onDestroyView();
mClockPlugin = null;
}
adjustStatusAreaPadding(plugin);
if (plugin == null) {
if (mShowingHeader) {
mClockView.setVisibility(View.GONE);
Expand Down Expand Up @@ -470,6 +473,14 @@ private void updateBigClockAlpha() {
}
}

private void adjustStatusAreaPadding(ClockPlugin plugin) {
final boolean mIsTypeClock = plugin != null && plugin.getName().equals("type");
mKeyguardStatusArea.setRowGravity(mIsTypeClock ? Gravity.LEFT : Gravity.CENTER);
mKeyguardStatusArea.setRowPadding(mIsTypeClock ? mContext.getResources()
.getDimensionPixelSize(R.dimen.keyguard_status_area_typeclock_padding) : 0, 0, 0,
0);
}

/**
* Sets if the keyguard slice is showing a center-aligned header. We need a smaller clock in
* these cases.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ public void onVisibilityAggregated(boolean isVisible) {
setLayoutTransition(isVisible ? mLayoutTransition : null);
}

public void setRowGravity(int gravity) {
mRow.setGravity(gravity);
}

public void setRowPadding(int left, int top, int right, int bottom) {
mRow.setPadding(left, top, right, bottom);
}

/**
* Returns whether the current visible slice has a title/header.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class AnalogClockController implements ClockPlugin {
private final ClockPalette mPalette = new ClockPalette();

/**
* Create a BubbleClockController instance.
* Create a AnalogClockController instance.
*
* @param res Resources contains title and thumbnail.
* @param inflater Inflater used to inflate custom clock views.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ public ClockManager(Context context, InjectionInflationController injectionInfla
LayoutInflater layoutInflater = injectionInflater.injectable(LayoutInflater.from(context));

addBuiltinClock(() -> new DefaultClockController(res, layoutInflater, colorExtractor));
addBuiltinClock(() -> new BubbleClockController(res, layoutInflater, colorExtractor));
addBuiltinClock(() -> new AnalogClockController(res, layoutInflater, colorExtractor));
addBuiltinClock(() -> new TypeClockController(res, layoutInflater, colorExtractor));
addBuiltinClock(() -> new BinaryClockController(res, layoutInflater, colorExtractor));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ public class NotificationShadeWindowViewController {
private RectF mTempRect = new RectF();
private boolean mIsTrackingBarGesture = false;

// custom additions start
private boolean mDoubleTapEnabledNative;

@Inject
public NotificationShadeWindowViewController(
InjectionInflationController injectionInflationController,
Expand Down Expand Up @@ -170,11 +173,17 @@ public void setupExpandedStatusBar() {
break;
case Settings.Secure.DOZE_TAP_SCREEN_GESTURE:
mSingleTapEnabled = configuration.tapGestureEnabled(UserHandle.USER_CURRENT);
break;
case Settings.Secure.DOUBLE_TAP_TO_WAKE:
mDoubleTapEnabledNative = Settings.Secure.getIntForUser(mView.getContext().getContentResolver(),
Settings.Secure.DOUBLE_TAP_TO_WAKE, 0, UserHandle.USER_CURRENT) == 1;
break;
}
};
mTunerService.addTunable(tunable,
Settings.Secure.DOZE_DOUBLE_TAP_GESTURE,
Settings.Secure.DOZE_TAP_SCREEN_GESTURE);
Settings.Secure.DOZE_TAP_SCREEN_GESTURE,
Settings.Secure.DOUBLE_TAP_TO_WAKE);

GestureDetector.SimpleOnGestureListener gestureListener =
new GestureDetector.SimpleOnGestureListener() {
Expand All @@ -190,7 +199,7 @@ public boolean onSingleTapConfirmed(MotionEvent e) {

@Override
public boolean onDoubleTap(MotionEvent e) {
if (mDoubleTapEnabled || mSingleTapEnabled) {
if (mDoubleTapEnabled || mSingleTapEnabled || mDoubleTapEnabledNative) {
mService.wakeUpIfDozing(
SystemClock.uptimeMillis(), mView, "DOUBLE_TAP");
return true;
Expand Down
Loading

0 comments on commit eb1940e

Please sign in to comment.