Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64f13a56 authored by Adrian Roos's avatar Adrian Roos Committed by Android (Google) Code Review
Browse files

Merge changes Ib6de3aa3,Idc46d1b2,I889e3864,I9a50ee57,I411f08ae, ...

* changes:
  AOD: Use heads-up state instead of buzzBeepBlinked
  AOD: Do not animate shelf icons when changing ambientness
  AOD: Show ambient versions of notifications
  AoD: Reposition shelf under clock
  AoD: Adjust shelf, only show top notification
  AoD: Adjust clock layout
parents b7a77d24 4b820e4e
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.util.Log;
import android.util.Slog;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridLayout;
import android.widget.TextClock;
import android.widget.TextView;
@@ -48,6 +49,7 @@ public class KeyguardStatusView extends GridLayout {
    private TextClock mDateView;
    private TextClock mClockView;
    private TextView mOwnerInfo;
    private ViewGroup mClockContainer;

    private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() {

@@ -105,6 +107,7 @@ public class KeyguardStatusView extends GridLayout {
    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        mClockContainer = (ViewGroup) findViewById(R.id.keyguard_clock_container);
        mAlarmStatusView = (TextView) findViewById(R.id.alarm_status);
        mDateView = (TextClock) findViewById(R.id.date_view);
        mClockView = (TextClock) findViewById(R.id.clock_view);
@@ -167,6 +170,11 @@ public class KeyguardStatusView extends GridLayout {
        }
    }

    public int getClockBottom() {
        return mClockView.getBottom() +
                ((MarginLayoutParams) mClockView.getLayoutParams()).bottomMargin;
    }

    public static String formatNextAlarm(Context context, AlarmManager.AlarmClockInfo info) {
        if (info == null) {
            return "";
@@ -260,4 +268,15 @@ public class KeyguardStatusView extends GridLayout {
            cacheKey = key;
        }
    }

    public void setDark(boolean dark) {
        final int N = mClockContainer.getChildCount();
        for (int i = 0; i < N; i++) {
            View child = mClockContainer.getChildAt(i);
            if (child == mClockView) {
                continue;
            }
            child.setAlpha(dark ? 0 : 1);
        }
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -75,6 +75,9 @@
    <!-- Height of a large notification in the status bar -->
    <dimen name="notification_max_height">284dp</dimen>

    <!-- Height of an ambient notification on ambient display -->
    <dimen name="notification_ambient_height">400dp</dimen>

    <!-- Height of a heads up notification in the status bar for legacy custom views -->
    <dimen name="notification_max_heads_up_height_legacy">128dp</dimen>

+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ public interface DozeHost {

    interface Callback {
        default void onNewNotifications() {}
        default void onBuzzBeepBlinked() {}
        default void onNotificationHeadsUp() {}
        default void onNotificationLight(boolean on) {}
        default void onPowerSaveChanged(boolean active) {}
    }
+1 −1
Original line number Diff line number Diff line
@@ -309,7 +309,7 @@ public class DozeTriggers implements DozeMachine.Part {

    private DozeHost.Callback mHostCallback = new DozeHost.Callback() {
        @Override
        public void onBuzzBeepBlinked() {
        public void onNotificationHeadsUp() {
            onNotification();
        }

+18 −1
Original line number Diff line number Diff line
@@ -1524,6 +1524,7 @@ public abstract class BaseStatusBar extends SystemUI implements
        final RemoteViews bigContentView = entry.cachedBigContentView;
        final RemoteViews headsUpContentView = entry.cachedHeadsUpContentView;
        final RemoteViews publicContentView = entry.cachedPublicContentView;
        final RemoteViews ambientContentView = entry.cachedAmbientContentView;

        if (contentView == null) {
            Log.v(TAG, "no contentView for: " + sbn.getNotification());
@@ -1604,6 +1605,7 @@ public abstract class BaseStatusBar extends SystemUI implements
        View bigContentViewLocal = null;
        View headsUpContentViewLocal = null;
        View publicViewLocal = null;
        View ambientViewLocal = null;
        try {
            contentViewLocal = contentView.apply(
                    sbn.getPackageContext(mContext),
@@ -1626,6 +1628,11 @@ public abstract class BaseStatusBar extends SystemUI implements
                        sbn.getPackageContext(mContext),
                        contentContainerPublic, mOnClickHandler);
            }
            if (ambientContentView != null) {
                ambientViewLocal = ambientContentView.apply(
                        sbn.getPackageContext(mContext),
                        contentContainer, mOnClickHandler);
            }

            if (contentViewLocal != null) {
                contentViewLocal.setIsRootNamespace(true);
@@ -1643,6 +1650,11 @@ public abstract class BaseStatusBar extends SystemUI implements
                publicViewLocal.setIsRootNamespace(true);
                contentContainerPublic.setContractedChild(publicViewLocal);
            }

            if (ambientViewLocal != null) {
                ambientViewLocal.setIsRootNamespace(true);
                contentContainer.setAmbientChild(ambientViewLocal);
            }
        }
        catch (RuntimeException e) {
            final String ident = sbn.getPackageName() + "/0x" + Integer.toHexString(sbn.getId());
@@ -2139,6 +2151,7 @@ public abstract class BaseStatusBar extends SystemUI implements
                row.setOnKeyguard(false);
                row.setSystemExpanded(visibleNotifications == 0 && !childNotification);
            }
            entry.row.setShowAmbient(isDozing());
            int userId = entry.notification.getUserId();
            boolean suppressedSummary = mGroupManager.isSummaryOfSuppressedGroup(
                    entry.notification) && !entry.row.isRemoved();
@@ -2176,6 +2189,10 @@ public abstract class BaseStatusBar extends SystemUI implements
        mStackScroller.changeViewPosition(mNotificationShelf, mStackScroller.getChildCount() - 3);
    }

    public boolean isDozing() {
        return false;
    }

    public boolean shouldShowOnKeyguard(StatusBarNotification sbn) {
        return mShowLockscreenNotifications && !mNotificationData.isAmbient(sbn.getKey());
    }
@@ -2388,7 +2405,7 @@ public abstract class BaseStatusBar extends SystemUI implements
            Log.d(TAG, "failed to query dream manager", e);
        }

        if (!inUse) {
        if (!inUse && !isDozing()) {
            if (DEBUG) {
                Log.d(TAG, "No peeking: not in use: " + sbn.getKey());
            }
Loading