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

Commit 9f6f7322 authored by Dan Sandler's avatar Dan Sandler
Browse files

ANDROID 15 MISSION UPDATE -- "VANILLA ICE CREAM"

// UPDATES

  + IDLE DIVERSIONS
  + "AI" AUTOPILOT
  + TYPOGRAPHIC COMPRESSION
  + OCCUPATIONAL DESCRIPTIONS
  + RENDERING TO THE EDGE OF SPACE
  + FLAG SUPPORT: LANDED

// TECHNICAL NOTE //

  This brings back the old enable-components trick; once
  the egg has been invoked, the daydream mode will be
  unlocked for use and will appear in Settings > Display >
  Screen saver, or wherever you get your Dreams.

A PRODUCT OF YOYODROID PROPULSION SYSTEMS
"WHERE INTEGRATION COMPLETE IS TOMORROW!"

Fixes: 330919557
Bug: 320695719
Flag: com.android.egg.flags.flag_flag
Test: easter egg main entry point:
      adb shell am start -n android/com.android.internal.app.PlatLogoActivity
Test: interactive mode:
      adb shell am start -n com.android.egg/.landroid.MainActivity
Test: screensaver mode:
      # first, enable the component if you haven't gone
      # through the main entry point
      adb root ; adb shell pm enable com.android.egg/.landroid.DreamUniverse
      # select the screensaver
      adb shell settings put secure screensaver_components \
          com.android.egg.landroid/com.android.egg.landroid.DreamUniverse
      # start dreaming
      adb shell service call dreams 1
Change-Id: I57a8834ce7f3d41aacaa56133e6f512cf81f5346
parent 12a0c012
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ public class PlatLogoActivity extends Activity {

    private static final long LAUNCH_TIME = 5000L;

    private static final String U_EGG_UNLOCK_SETTING = "egg_mode_u";
    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
@@ -309,13 +309,12 @@ public class PlatLogoActivity extends Activity {

    private void launchNextStage(boolean locked) {
        final ContentResolver cr = getContentResolver();

        try {
            if (shouldWriteSettings()) {
                Log.v(TAG, "Saving egg locked=" + locked);
                syncTouchPressure();
                Settings.System.putLong(cr,
                        U_EGG_UNLOCK_SETTING,
                        EGG_UNLOCK_SETTING,
                        locked ? 0 : System.currentTimeMillis());
            }
        } catch (RuntimeException e) {
+21 −2
Original line number Diff line number Diff line
@@ -36,8 +36,28 @@
        android:icon="@drawable/android14_patch_adaptive"
        android:label="@string/app_name">

        <!-- Android U easter egg -->
        <!-- Android V easter egg: Daydream version of Landroid
             (must be enabled by unlocking the egg) -->
        <service
            android:name=".landroid.DreamUniverse"
            android:exported="true"
            android:icon="@drawable/android14_patch_adaptive"
            android:label="@string/v_egg_name"
            android:description="@string/dream_description"
            android:enabled="false"
            android:permission="android.permission.BIND_DREAM_SERVICE"
            >

            <intent-filter>
                <action android:name="android.service.dreams.DreamService" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <meta-data
                android:name="android.service.dream"
                android:resource="@xml/landroid_dream"/>
        </service>

        <!-- Android U easter egg -->
        <activity
            android:name=".landroid.MainActivity"
            android:exported="true"
@@ -52,7 +72,6 @@
            </intent-filter>
        </activity>


        <!-- Android Q easter egg -->
        <activity
            android:name=".quares.QuaresActivity"
+67 −18
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
    Copyright (C) 2023 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.
-->

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="u_egg_name" translatable="false">Android 14 Easter Egg</string>

    <!-- No Android's Sky -->
    <!-- Char Star Field -->
    <!-- V-leet: Harmless -->
    <!-- Contemplating My Orbital Mechanics -->
    <string name="u_egg_name" translatable="false">Landroid</string>
    <string name="v_egg_name" translatable="false">Landroid</string>
    <string name="dream_description" translatable="false">---- AUTOPILOT ENGAGED ----</string>

    <string-array name="planet_descriptors" translatable="false">
        <item>earthy</item>
@@ -368,4 +360,61 @@
        <item>soup</item>
    </string-array>

    <string-array name="fauna_generic_plurals" translatable="false">
        <item>fauna</item>
        <item>animals</item>
        <item>locals</item>
        <item>creatures</item>
        <item>critters</item>
        <item>wildlife</item>
        <item>specimens</item>
        <item>life</item>
        <item>cells</item>
    </string-array>

    <string-array name="flora_generic_plurals" translatable="false">
        <item>flora</item>
        <item>plants</item>
        <item>flowers</item>
        <item>trees</item>
        <item>mosses</item>
        <item>specimens</item>
        <item>life</item>
        <item>cells</item>
    </string-array>

    <string-array name="atmo_generic_plurals" translatable="false">
        <item>air</item>
        <item>atmosphere</item>
        <item>clouds</item>
        <item>atmo</item>
        <item>gases</item>
    </string-array>

    <string-array name="activities" translatable="false">
        <item>refueling</item>
        <item>sightseeing</item>
        <item>vacationing</item>
        <item>luncheoning</item>
        <item>recharging</item>
        <item>taking up space</item>
        <item>reticulating space splines</item>
        <item>using facilities</item>
        <item>spelunking</item>
        <item>repairing</item>
        <item>herding {fauna}</item>
        <item>taming {fauna}</item>
        <item>breeding {fauna}</item>
        <item>singing lullabies to {fauna}</item>
        <item>singing lullabies to {flora}</item>
        <item>singing lullabies to the {planet}</item>
        <item>gardening {flora}</item>
        <item>collecting {flora}</item>
        <item>surveying the {planet}</item>
        <item>mapping the {planet}</item>
        <item>breathing {atmo}</item>
        <item>reprocessing {atmo}</item>
        <item>bottling {atmo}</item>
    </string-array>

</resources>
+18 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2024 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.
-->
<dream xmlns:android="http://schemas.android.com/apk/res/android"
    android:previewImage="@*android:drawable/platlogo" />
+38 −10
Original line number Diff line number Diff line
@@ -18,11 +18,14 @@ package com.android.egg;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
import android.provider.Settings;
import android.util.Log;
import android.widget.Toast;

import com.android.egg.flags.Flags;
import com.android.egg.landroid.DreamUniverse;
import com.android.egg.neko.NekoControlsService;
import com.android.egg.widget.PaintChipsActivity;
import com.android.egg.widget.PaintChipsWidget;
@@ -33,7 +36,9 @@ import com.android.egg.widget.PaintChipsWidget;
public class ComponentActivationActivity extends Activity {
    private static final String TAG = "EasterEgg";

    // check PlatLogoActivity.java for these
    private static final String S_EGG_UNLOCK_SETTING = "egg_mode_s";
    private static final String V_EGG_UNLOCK_SETTING = "egg_mode_v";

    private void toastUp(String s) {
        Toast toast = Toast.makeText(this, s, Toast.LENGTH_SHORT);
@@ -44,14 +49,39 @@ public class ComponentActivationActivity extends Activity {
    public void onStart() {
        super.onStart();

        final PackageManager pm = getPackageManager();
        final ComponentName[] cns = new ComponentName[] {
                new ComponentName(this, NekoControlsService.class),
                new ComponentName(this, PaintChipsActivity.class),
                new ComponentName(this, PaintChipsWidget.class)
        lockUnlockComponents(this);

        finish();
    }

    /**
     * Check easter egg unlock state and update unlockable components to match.
     */
    public static void lockUnlockComponents(Context context) {
        final PackageManager pm = context.getPackageManager();
        final ComponentName[] cns;
        final String unlockSettingsKey;
        final boolean shouldReLock;
        final long unlockValue;
        if (Flags.flagFlag()) {
            unlockSettingsKey = V_EGG_UNLOCK_SETTING;
            unlockValue = 1; // since we're not toggling we actually don't need to check the setting
            shouldReLock = false;
            cns = new ComponentName[]{
                    new ComponentName(context, DreamUniverse.class)
            };
        final long unlockValue = Settings.System.getLong(getContentResolver(),
                S_EGG_UNLOCK_SETTING, 0);
        } else {
            unlockSettingsKey = S_EGG_UNLOCK_SETTING;
            unlockValue = Settings.System.getLong(context.getContentResolver(),
                    unlockSettingsKey, 0);
            shouldReLock = true;
            cns = new ComponentName[]{
                    new ComponentName(context, NekoControlsService.class),
                    new ComponentName(context, PaintChipsActivity.class),
                    new ComponentName(context, PaintChipsWidget.class),
                    new ComponentName(context, DreamUniverse.class)
            };
        }
        for (ComponentName cn : cns) {
            final boolean componentEnabled = pm.getComponentEnabledSetting(cn)
                    == PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
@@ -77,7 +107,5 @@ public class ComponentActivationActivity extends Activity {
                }
            }
        }

        finish();
    }
}
Loading