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

Commit 966f60d1 authored by Daniel Sandler's avatar Daniel Sandler Committed by Automerger Merge Worker
Browse files

Merge "Fixed bug: Not everyone has home controls yet, or pets." into rvc-dev...

Merge "Fixed bug: Not everyone has home controls yet, or pets." into rvc-dev am: fc86cfb5 am: f9cf277b am: e9a47c7a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11933640

Change-Id: Iec20f0e1ac82b2dd677cda9946130f8ac360856c
parents 423f9c6f e9a47c7a
Loading
Loading
Loading
Loading
+20 −14
Original line number Diff line number Diff line
@@ -55,6 +55,10 @@ import org.json.JSONObject;
public class PlatLogoActivity extends Activity {
    private static final boolean WRITE_SETTINGS = true;

    private static final String R_EGG_UNLOCK_SETTING = "egg_mode_r";

    private static final int UNLOCK_TRIES = 3;

    BigDialView mDialView;

    @Override
@@ -77,8 +81,10 @@ public class PlatLogoActivity extends Activity {

        mDialView = new BigDialView(this, null);
        if (Settings.System.getLong(getContentResolver(),
                "egg_mode" /* Settings.System.EGG_MODE */, 0) == 0) {
            mDialView.setUnlockTries(3);
                R_EGG_UNLOCK_SETTING, 0) == 0) {
            mDialView.setUnlockTries(UNLOCK_TRIES);
        } else {
            mDialView.setUnlockTries(0);
        }

        final FrameLayout layout = new FrameLayout(this);
@@ -91,18 +97,16 @@ public class PlatLogoActivity extends Activity {
    private void launchNextStage(boolean locked) {
        final ContentResolver cr = getContentResolver();

        if (Settings.System.getLong(cr, "egg_mode" /* Settings.System.EGG_MODE */, 0) == 0) {
            // For posterity: the moment this user unlocked the easter egg
        try {
            if (WRITE_SETTINGS) {
                Settings.System.putLong(cr,
                            "egg_mode", // Settings.System.EGG_MODE,
                        R_EGG_UNLOCK_SETTING,
                        locked ? 0 : System.currentTimeMillis());
            }
        } catch (RuntimeException e) {
            Log.e("com.android.internal.app.PlatLogoActivity", "Can't write settings", e);
        }
        }

        try {
            startActivity(new Intent(Intent.ACTION_MAIN)
                    .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
@@ -235,8 +239,8 @@ public class PlatLogoActivity extends Activity {
                    }
                    return true;
                case MotionEvent.ACTION_UP:
                    if (mWasLocked && !mDialDrawable.isLocked()) {
                        launchNextStage(false);
                    if (mWasLocked != mDialDrawable.isLocked()) {
                        launchNextStage(mDialDrawable.isLocked());
                    }
                    return true;
            }
@@ -404,6 +408,8 @@ public class PlatLogoActivity extends Activity {

                    if (isLocked() && oldUserLevel != STEPS - 1 && getUserLevel() == STEPS - 1) {
                        mUnlockTries--;
                    } else if (!isLocked() && getUserLevel() == 0) {
                        mUnlockTries = UNLOCK_TRIES;
                    }

                    if (!isLocked()) {
+15 −3
Original line number Diff line number Diff line
@@ -23,11 +23,23 @@ android_app {

    name: "EasterEgg",

    platform_apis: true,
    certificate: "platform",

	sdk_version: "current",

    optimize: {
        enabled: false,
    }
    },

	static_libs: [
		"androidx.core_core",
		"androidx.recyclerview_recyclerview",
        "androidx.annotation_annotation",
		"kotlinx-coroutines-android",
		"kotlinx-coroutines-core",
		//"kotlinx-coroutines-reactive",
	],

    manifest: "AndroidManifest.xml",

    kotlincflags: ["-Xjvm-default=enable"],
}
+84 −8
Original line number Diff line number Diff line
@@ -6,19 +6,24 @@

    <uses-permission android:name="android.permission.WRITE_SETTINGS" />

    <!-- used for cat notifications -->
    <uses-permission android:name="android.permission.SUBSTITUTE_NOTIFICATION_APP_NAME" />
    <!-- used to save cat images -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <!-- controls -->
    <uses-permission android:name="android.permission.BIND_CONTROLS" />

    <application
        android:icon="@drawable/q_icon"
        android:icon="@drawable/icon"
        android:label="@string/app_name">

        <activity android:name=".quares.QuaresActivity"
            android:icon="@drawable/q_icon"
            android:label="@string/q_egg_name"
            android:exported="true"
            android:theme="@style/QuaresTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.DEFAULT" />
                <!-- <category android:name="android.intent.category.LAUNCHER" /> -->
                <category android:name="com.android.internal.category.PLATLOGO" />
            </intent-filter>
        </activity>
        <activity
@@ -26,15 +31,86 @@
            android:configChanges="orientation|keyboardHidden|screenSize|uiMode"
            android:icon="@drawable/p_icon"
            android:label="@string/p_egg_name"
            android:exported="true"
            android:theme="@style/AppTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
            </intent-filter>
        </activity>

        <!-- Android N easter egg bits -->
        <activity android:name=".neko.NekoLand"
            android:theme="@android:style/Theme.Material.NoActionBar"
            android:exported="true"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <!-- This is where the magic happens -->
        <service
            android:name=".neko.NekoService"
            android:enabled="true"
            android:permission="android.permission.BIND_JOB_SERVICE"
            android:exported="true" >
        </service>

                <!-- <category android:name="android.intent.category.DEFAULT" /> -->
                <!-- <category android:name="android.intent.category.LAUNCHER" /> -->
                <!-- <category android:name="com.android.internal.category.PLATLOGO" /> -->
        <!-- Used to show over lock screen -->
        <activity android:name=".neko.NekoLockedActivity"
            android:excludeFromRecents="true"
            android:exported="true"
            android:theme="@android:style/Theme.Material.Light.Dialog.NoActionBar"
            android:showOnLockScreen="true" />

        <!-- Used to enable easter egg -->
        <activity android:name=".neko.NekoActivationActivity"
            android:excludeFromRecents="true"
            android:exported="true"
            android:theme="@android:style/Theme.NoDisplay"
            >
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="com.android.internal.category.PLATLOGO" />
            </intent-filter>
        </activity>

        <!-- The quick settings tile, disabled by default -->
        <service
            android:name=".neko.NekoTile"
            android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
            android:icon="@drawable/stat_icon"
            android:enabled="false"
            android:label="@string/default_tile_name">
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE" />
            </intent-filter>
        </service>

        <service android:name=".neko.NekoControlsService"
            android:permission="android.permission.BIND_CONTROLS"
            android:label="@string/r_egg_name"
            android:icon="@drawable/ic_fullcat_icon"
            android:enabled="false"
            android:exported="true">
            <intent-filter>
                <action android:name="android.service.controls.ControlsProviderService" />
            </intent-filter>
        </service>

        <!-- FileProvider for sending pictures -->
        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="com.android.egg.fileprovider"
            android:grantUriPermissions="true"
            android:exported="false">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/filepaths" />
        </provider>
    </application>

</manifest>
+82 −0
Original line number Diff line number Diff line
buildscript {
    ext.kotlin_version = '1.3.71'

    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
   repositories {
       google()
       jcenter()
   }
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

final String ANDROID_ROOT = "${rootDir}/../../../.."

android {
    compileSdkVersion COMPILE_SDK
    buildToolsVersion BUILD_TOOLS_VERSION

    defaultConfig {
        applicationId "com.android.egg"
        minSdkVersion 28
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

	sourceSets {
		main {
			res.srcDirs = ['res']
			java.srcDirs = ['src']
			manifest.srcFile 'AndroidManifest.xml'
		}
	}

    signingConfigs {
        debug.storeFile file("${ANDROID_ROOT}/vendor/google/certs/devkeys/platform.keystore")
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }


}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.2.0'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.6'
    implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}"
    implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}"
}
+23 −0
Original line number Diff line number Diff line
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
android.enableJetifier=true
kotlin.code.style=official

ANDROID_X_VERSION=1+
COMPILE_SDK=android-30
BUILD_TOOLS_VERSION=28.0.3
Loading