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

Commit 8acfa7f3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "baklava-eggs" into main

* changes:
  Look again. The stars are now diamonds.
  MISSION PATCH: ANDROID 16
  Update stat_sys_adb for Android 16.
parents c05493d8 251c1951
Loading
Loading
Loading
Loading
+52 −20
Original line number Diff line number Diff line
@@ -18,6 +18,9 @@ package com.android.internal.app;

import static android.os.VibrationEffect.Composition.PRIMITIVE_SPIN;

import static java.lang.Math.hypot;
import static java.lang.Math.max;

import android.animation.ObjectAnimator;
import android.animation.TimeAnimator;
import android.annotation.SuppressLint;
@@ -26,9 +29,11 @@ import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.ContentResolver;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.ColorSpace;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
@@ -72,7 +77,7 @@ public class PlatLogoActivity extends Activity {
    private static final String EGG_UNLOCK_SETTING = "egg_mode_v";

    private static final float MIN_WARP = 1f;
    private static final float MAX_WARP = 10f; // after all these years
    private static final float MAX_WARP = 16f; // must go faster
    private static final boolean FINISH_AFTER_NEXT_STAGE_LAUNCH = false;

    private ImageView mLogo;
@@ -201,6 +206,9 @@ public class PlatLogoActivity extends Activity {
        getWindow().setStatusBarColor(0);
        getWindow().getDecorView().getWindowInsetsController().hide(WindowInsets.Type.systemBars());

        // This will be silently ignored on displays that don't support HDR color, which is fine
        getWindow().setColorMode(ActivityInfo.COLOR_MODE_HDR);

        final ActionBar ab = getActionBar();
        if (ab != null) ab.hide();

@@ -364,7 +372,7 @@ public class PlatLogoActivity extends Activity {
                mPressureMin = Math.min(mPressureMin, touchData.getDouble("min"));
            }
            if (touchData.has("max")) {
                mPressureMax = Math.max(mPressureMax, touchData.getDouble("max"));
                mPressureMax = max(mPressureMax, touchData.getDouble("max"));
            }
            if (mPressureMax >= 0) {
                touchData.put("min", mPressureMin);
@@ -392,9 +400,11 @@ public class PlatLogoActivity extends Activity {
    }

    private static class Starfield extends Drawable {
        private static final int NUM_STARS = 34; // Build.VERSION_CODES.UPSIDE_DOWN_CAKE
        private static final int NUM_STARS = 128;

        private static final int NUM_PLANES = 4;

        private static final int NUM_PLANES = 2;
        private static final float ROTATION = 45;
        private final float[] mStars = new float[NUM_STARS * 4];
        private float mVx, mVy;
        private long mDt = 0;
@@ -403,7 +413,7 @@ public class PlatLogoActivity extends Activity {
        private final Random mRng;
        private final float mSize;

        private final Rect mSpace = new Rect();
        private float mRadius = 0f;
        private float mWarp = 1f;

        private float mBuffer;
@@ -426,14 +436,15 @@ public class PlatLogoActivity extends Activity {

        @Override
        public void onBoundsChange(Rect bounds) {
            mSpace.set(bounds);
            mBuffer = mSize * NUM_PLANES * 2 * MAX_WARP;
            mSpace.inset(-(int) mBuffer, -(int) mBuffer);
            final float w = mSpace.width();
            final float h = mSpace.height();
            mRadius = ((float) hypot(bounds.width(), bounds.height()) / 2f) + mBuffer;
            // I didn't clarify this the last time, but we store both the beginning and
            // end of each star's trail in this data structure. When we're not in warp that means
            // that we've got each star in there twice. It's fine, we're gonna move it off-screen
            for (int i = 0; i < NUM_STARS; i++) {
                mStars[4 * i] = mRng.nextFloat() * w;
                mStars[4 * i + 1] = mRng.nextFloat() * h;
                mStars[4 * i] = mRng.nextFloat() * 2 * mRadius - mRadius;
                mStars[4 * i + 1] = mRng.nextFloat() * 2 * mRadius - mRadius;
                // duplicate copy (for now)
                mStars[4 * i + 2] = mStars[4 * i];
                mStars[4 * i + 3] = mStars[4 * i + 1];
            }
@@ -452,31 +463,47 @@ public class PlatLogoActivity extends Activity {

            final boolean inWarp = mWarp > 1f;

            canvas.drawColor(Color.BLACK); // 0xFF16161D);
            final float diameter = mRadius * 2f;
            final float triameter = mRadius * 3f;

            canvas.drawColor(Color.BLACK);

            final float cx = getBounds().width() / 2f;
            final float cy = getBounds().height() / 2f;
            canvas.translate(cx, cy);

            canvas.rotate(ROTATION);

            if (mDt > 0 && mDt < 1000) {
                canvas.translate(
                        -(mBuffer) + mRng.nextFloat() * (mWarp - 1f),
                        -(mBuffer) + mRng.nextFloat() * (mWarp - 1f)
                        mRng.nextFloat() * (mWarp - 1f),
                        mRng.nextFloat() * (mWarp - 1f)
                );
                final float w = mSpace.width();
                final float h = mSpace.height();
                for (int i = 0; i < NUM_STARS; i++) {
                    final int plane = (int) ((((float) i) / NUM_STARS) * NUM_PLANES) + 1;
                    mStars[4 * i + 2] = (mStars[4 * i + 2] + dx * plane + w) % w;
                    mStars[4 * i + 3] = (mStars[4 * i + 3] + dy * plane + h) % h;
                    mStars[4 * i + 0] = inWarp ? mStars[4 * i + 2] - dx * mWarp * 2 * plane : -100;
                    mStars[4 * i + 1] = inWarp ? mStars[4 * i + 3] - dy * mWarp * 2 * plane : -100;
                    mStars[4 * i + 2] = (mStars[4 * i + 2] + dx * plane + triameter) % diameter
                            - mRadius;
                    mStars[4 * i + 3] = (mStars[4 * i + 3] + dy * plane + triameter) % diameter
                            - mRadius;
                    mStars[4 * i + 0] = inWarp ? mStars[4 * i + 2] - dx * mWarp * plane : -10000;
                    mStars[4 * i + 1] = inWarp ? mStars[4 * i + 3] - dy * mWarp * plane : -10000;
                }
            }
            final int slice = (mStars.length / NUM_PLANES / 4) * 4;
            for (int p = 0; p < NUM_PLANES; p++) {
                final float value = (p + 1f) / (NUM_PLANES - 1);
                mStarPaint.setColor(packHdrColor(value, 1.0f));
                mStarPaint.setStrokeWidth(mSize * (p + 1));
                if (inWarp) {
                    canvas.drawLines(mStars, p * slice, slice, mStarPaint);
                }
                canvas.drawPoints(mStars, p * slice, slice, mStarPaint);
            }

            if (inWarp) {
                final float frac = (mWarp - MIN_WARP) / (MAX_WARP - MIN_WARP);
                canvas.drawColor(packHdrColor(2.0f, frac * frac));
            }
        }

        @Override
@@ -497,5 +524,10 @@ public class PlatLogoActivity extends Activity {
        public void update(long dt) {
            mDt = dt;
        }

        private static final ColorSpace sSrgbExt = ColorSpace.get(ColorSpace.Named.EXTENDED_SRGB);
        public static long packHdrColor(float value, float alpha) {
            return Color.valueOf(value, value, value, alpha, sSrgbExt).pack();
        }
    }
}
+122 −89

File changed.

Preview size limit exceeded, changes collapsed.

+29 −98
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2024 The Android Open Source Project

@@ -13,7 +14,6 @@ Copyright (C) 2024 The Android Open Source Project
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
@@ -21,104 +21,35 @@ Copyright (C) 2024 The Android Open Source Project
    android:viewportHeight="24">
  <group>
    <clip-path
        android:pathData="
            M12.6495 17.375
            C12.3608 17.875 11.6392 17.875 11.3505 17.375
            L3.98927 4.625
            C3.70059 4.125 4.06143 3.5 4.63878 3.5
            L19.3612 3.5
            C19.9386 3.5 20.2994 4.125 20.0107 4.625
            L12.6495 17.375
            Z
        "/>
        android:pathData="M0,0h24v24h-24z"/>
    <path
        android:pathData="M5,12 h14v9.8h-14z"
        android:fillColor="#ffffff"/>
        android:pathData="M12,8V12H8L12,8Z"
        android:fillColor="#D9D9D9"/>
    <path
        android:pathData="
            M15.97 10.48
            C15.97 10.46 15.97 10.45 15.96 10.43
            C15.95 10.33 15.93 10.23 15.90 10.13
            C15.86 9.96 15.81 9.79 15.75 9.63
            C15.69 9.50 15.63 9.36 15.57 9.23
            C15.48 9.07 15.38 8.91 15.27 8.76
            C15.14 8.57 14.99 8.40 14.83 8.24
            C14.76 8.17 14.69 8.11 14.62 8.04
            C14.47 7.91 14.30 7.78 14.12 7.67
            C14.12 7.67 14.13 7.67 14.13 7.67
            C14.21 7.53 14.29 7.39 14.37 7.25
            C14.45 7.11 14.53 6.98 14.61 6.84
            C14.66 6.74 14.72 6.64 14.78 6.55
            C14.79 6.52 14.80 6.50 14.81 6.48
            C14.83 6.41 14.83 6.33 14.81 6.27
            C14.81 6.25 14.80 6.24 14.80 6.22
            C14.79 6.20 14.78 6.19 14.77 6.17
            C14.74 6.12 14.70 6.08 14.65 6.05
            C14.60 6.02 14.54 6 14.49 6
            C14.47 5.99 14.44 5.99 14.42 6
            C14.40 6 14.38 6 14.36 6.01
            C14.30 6.02 14.23 6.06 14.19 6.11
            C14.17 6.13 14.15 6.15 14.14 6.18
            C14.08 6.28 14.03 6.37 13.97 6.47
            L13.73 6.88
            C13.65 7.02 13.57 7.16 13.49 7.30
            C13.48 7.31 13.47 7.33 13.46 7.34
            C13.45 7.34 13.44 7.33 13.43 7.33
            C12.98 7.16 12.50 7.07 12 7.07
            C11.98 7.07 11.97 7.07 11.95 7.07
            C11.51 7.07 11.07 7.15 10.67 7.29
            C10.63 7.31 10.58 7.32 10.53 7.34
            C10.53 7.33 10.52 7.31 10.51 7.30
            C10.43 7.16 10.35 7.02 10.27 6.88
            C10.19 6.74 10.11 6.61 10.03 6.47
            C9.97 6.37 9.92 6.28 9.86 6.18
            C9.85 6.15 9.83 6.13 9.81 6.11
            C9.77 6.06 9.70 6.03 9.64 6.01
            C9.62 6 9.60 6 9.58 6
            C9.56 5.99 9.53 5.99 9.51 6
            C9.46 6 9.40 6.02 9.35 6.05
            C9.30 6.08 9.26 6.12 9.23 6.17
            C9.22 6.19 9.21 6.20 9.20 6.22
            C9.20 6.24 9.19 6.25 9.19 6.27
            C9.17 6.34 9.17 6.41 9.19 6.48
            C9.20 6.50 9.21 6.52 9.22 6.55
            C9.28 6.65 9.34 6.74 9.39 6.84
            C9.47 6.98 9.55 7.11 9.63 7.25
            C9.71 7.39 9.79 7.53 9.87 7.67
            C9.87 7.67 9.87 7.67 9.88 7.67
            C9.71 7.77 9.56 7.88 9.41 8.01
            C9.32 8.08 9.24 8.16 9.16 8.24
            C9 8.40 8.85 8.57 8.72 8.76
            C8.61 8.91 8.51 9.07 8.43 9.23
            C8.36 9.36 8.30 9.50 8.24 9.63
            C8.18 9.79 8.13 9.96 8.09 10.13
            C8.06 10.23 8.04 10.33 8.03 10.43
            C8.02 10.45 8.02 10.46 8.02 10.48
            C8.01 10.54 8 10.60 8 10.65
            L16 10.65
            C15.99 10.60 15.98 10.54 15.97 10.48
            L15.97 10.48
            Z
        "
        android:fillColor="#ffffff"/>
  </group>
        android:pathData="M12,4V8H8L12,4Z"
        android:fillColor="#D9D9D9"/>
    <path
        android:pathData="M8,8V12H4L8,8Z"
        android:fillColor="#D9D9D9"/>
    <path
        android:pathData="M12,16L12,12L16,12L12,16Z"
        android:fillColor="#D9D9D9"/>
    <path
        android:pathData="M12,20L12,16L16,16L12,20Z"
        android:fillColor="#D9D9D9"/>
    <path
      android:pathData="
          M12,20.923
          C10.764,20.923 9.946,20.065 9.131,18.653
          C8.316,17.241 4.291,10.269 3.476,8.857
          C2.66,7.445 2.326,6.309 2.944,5.238
          C3.563,4.167 4.714,3.888 6.344,3.888
          C7.975,3.888 16.025,3.888 17.656,3.888
          C19.286,3.888 20.437,4.167 21.056,5.238
          C21.674,6.309 21.34,7.445 20.524,8.857
          C19.709,10.269 15.684,17.241 14.869,18.653
          C14.054,20.065 13.236,20.923 12,20.923
          H12
          Z
      "
      android:strokeWidth="2"
        android:pathData="M16,16L16,12L20,12L16,16Z"
        android:fillColor="#D9D9D9"/>
    <path
        android:pathData="M12,8L16,8L16,12L12,8Z"
        android:fillColor="#D9D9D9"/>
    <path
        android:pathData="M12,16L8,16L8,12L12,16Z"
        android:fillColor="#D9D9D9"/>
    <path
        android:pathData="M13.096,2.0354L21.9646,10.904A1.55,1.55 90,0 1,21.9646 13.096L13.096,21.9646A1.55,1.55 90,0 1,10.904 21.9646L2.0354,13.096A1.55,1.55 0,0 1,2.0354 10.904L10.904,2.0354A1.55,1.55 0,0 1,13.096 2.0354z"
        android:strokeWidth="1.5"
        android:fillColor="#00000000"
      android:strokeColor="#ffffff"/>
        android:strokeColor="#FF00FF"/>
  </group>
</vector>