diff --git a/core/java/com/android/internal/app/PlatLogoActivity.java b/core/java/com/android/internal/app/PlatLogoActivity.java
index 36ab394f4a79d..b22ce5e2a6ee7 100644
--- a/core/java/com/android/internal/app/PlatLogoActivity.java
+++ b/core/java/com/android/internal/app/PlatLogoActivity.java
@@ -53,8 +53,7 @@ import android.widget.FrameLayout;
import android.widget.ImageView;
public class PlatLogoActivity extends Activity {
- public static final boolean REVEAL_THE_NAME = false;
- public static final boolean FINISH = false;
+ public static final boolean FINISH = true;
FrameLayout mLayout;
int mTapCount;
@@ -85,15 +84,18 @@ public class PlatLogoActivity extends Activity {
im.setAlpha(0f);
im.setBackground(new RippleDrawable(
- ColorStateList.valueOf(0xFFFFFFFF),
+ ColorStateList.valueOf(0xFF776677),
getDrawable(com.android.internal.R.drawable.platlogo),
null));
-// im.setOutlineProvider(new ViewOutlineProvider() {
-// @Override
-// public void getOutline(View view, Outline outline) {
-// outline.setOval(0, 0, view.getWidth(), view.getHeight());
-// }
-// });
+ im.setOutlineProvider(new ViewOutlineProvider() {
+ @Override
+ public void getOutline(View view, Outline outline) {
+ final int w = view.getWidth();
+ final int h = view.getHeight();
+ outline.setOval((int)(w*.125), (int)(h*.125), (int)(w*.96), (int)(h*.96));
+ }
+ });
+ im.setElevation(12f*dp);
im.setClickable(true);
im.setOnClickListener(new View.OnClickListener() {
@Override
@@ -103,18 +105,6 @@ public class PlatLogoActivity extends Activity {
public boolean onLongClick(View v) {
if (mTapCount < 5) return false;
- if (REVEAL_THE_NAME) {
- final Drawable overlay = getDrawable(
- com.android.internal.R.drawable.platlogo_m);
- overlay.setBounds(0, 0, v.getMeasuredWidth(), v.getMeasuredHeight());
- im.getOverlay().clear();
- im.getOverlay().add(overlay);
- overlay.setAlpha(0);
- ObjectAnimator.ofInt(overlay, "alpha", 0, 255)
- .setDuration(500)
- .start();
- }
-
final ContentResolver cr = getContentResolver();
if (Settings.System.getLong(cr, Settings.System.EGG_MODE, 0)
== 0) {
diff --git a/core/res/res/drawable-nodpi/platlogo.xml b/core/res/res/drawable-nodpi/platlogo.xml
index 182ba24f2216d..a6dee8a9beb32 100644
--- a/core/res/res/drawable-nodpi/platlogo.xml
+++ b/core/res/res/drawable-nodpi/platlogo.xml
@@ -1,3 +1,4 @@
+
-
-
-
-
-
-
+ android:width="48dp"
+ android:height="48dp"
+ android:viewportWidth="48"
+ android:viewportHeight="48">
+
+
+
+
+
+
+
+
diff --git a/core/res/res/drawable-nodpi/platlogo_m.xml b/core/res/res/drawable-nodpi/platlogo_m.xml
index d9a558db859a2..aacf67483d72f 100644
--- a/core/res/res/drawable-nodpi/platlogo_m.xml
+++ b/core/res/res/drawable-nodpi/platlogo_m.xml
@@ -1,5 +1,5 @@
+
+ android:pathData="M24.0,24.0m-20.0,0.0a20.0,20.0,0,1,1,40.0,0.0a20.0,20.0,0,1,1,-40.0,0.0"
+ android:fillColor="#FFC107"/>
+ android:pathData="M44,24.2010101 L33.9004889,14.101499 L14.101499,33.9004889 L24.2010101,44 C29.2525804,43.9497929 34.2887564,41.9975027 38.1431296,38.1431296 C41.9975027,34.2887564 43.9497929,29.2525804 44,24.2010101 Z"
+ android:fillColor="#FE9F00"/>
+ android:pathData="M24.0,24.0m-14.0,0.0a14.0,14.0,0,1,1,28.0,0.0a14.0,14.0,0,1,1,-28.0,0.0"
+ android:fillColor="#FED44F"/>
+ android:pathData="M37.7829445,26.469236 L29.6578482,18.3441397 L18.3441397,29.6578482 L26.469236,37.7829445 C29.1911841,37.2979273 31.7972024,36.0037754 33.9004889,33.9004889 C36.0037754,31.7972024 37.2979273,29.1911841 37.7829445,26.469236 Z"
+ android:fillColor="#FFC107"/>
-
-
-
-
-
-
-
-
-
-
-
-
+ android:pathData="M24.0,24.0m-8.0,0.0a8.0,8.0,0,1,1,16.0,0.0a8.0,8.0,0,1,1,-16.0,0.0"
+ android:fillColor="#FFFFFF"/>
diff --git a/core/res/res/drawable-nodpi/stat_sys_adb.xml b/core/res/res/drawable-nodpi/stat_sys_adb.xml
index 89e42e6a82d57..2e2b3956dc68d 100644
--- a/core/res/res/drawable-nodpi/stat_sys_adb.xml
+++ b/core/res/res/drawable-nodpi/stat_sys_adb.xml
@@ -1,3 +1,4 @@
+
-
-
-
-
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/EasterEgg/AndroidManifest.xml b/packages/EasterEgg/AndroidManifest.xml
index 14861c261f0da..172490dc91788 100644
--- a/packages/EasterEgg/AndroidManifest.xml
+++ b/packages/EasterEgg/AndroidManifest.xml
@@ -84,5 +84,16 @@ Copyright (C) 2016 The Android Open Source Project
+
+
+
+
+
diff --git a/packages/EasterEgg/res/drawable/food_cookie.xml b/packages/EasterEgg/res/drawable/food_cookie.xml
new file mode 100644
index 0000000000000..74dd134355e23
--- /dev/null
+++ b/packages/EasterEgg/res/drawable/food_cookie.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/EasterEgg/res/values/strings.xml b/packages/EasterEgg/res/values/strings.xml
index 8478a438a0e48..61e38342872e6 100644
--- a/packages/EasterEgg/res/values/strings.xml
+++ b/packages/EasterEgg/res/values/strings.xml
@@ -17,6 +17,7 @@ Copyright (C) 2016 The Android Open Source Project
Android Easter Egg
Android Neko
+ New cats
\????
A cat is here.
Cat #%s
@@ -34,7 +35,7 @@ Copyright (C) 2016 The Android Open Source Project
- @drawable/food_bits
- @drawable/food_sysuituna
- @drawable/food_chicken
- - @drawable/food_donut
+ - @drawable/food_cookie
- 0
diff --git a/packages/EasterEgg/res/xml/filepaths.xml b/packages/EasterEgg/res/xml/filepaths.xml
new file mode 100644
index 0000000000000..2130025e92659
--- /dev/null
+++ b/packages/EasterEgg/res/xml/filepaths.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/EasterEgg/src/com/android/egg/neko/Cat.java b/packages/EasterEgg/src/com/android/egg/neko/Cat.java
index a4df372ef835c..dd1bd07f32987 100644
--- a/packages/EasterEgg/src/com/android/egg/neko/Cat.java
+++ b/packages/EasterEgg/src/com/android/egg/neko/Cat.java
@@ -31,6 +31,8 @@ import java.util.concurrent.ThreadLocalRandom;
import com.android.egg.R;
import com.android.internal.logging.MetricsLogger;
+import static com.android.egg.neko.NekoLand.CHAN_ID;
+
public class Cat extends Drawable {
public static final long[] PURR = {0, 40, 20, 40, 20, 40, 20, 40, 20, 40, 20, 40};
@@ -218,6 +220,7 @@ public class Cat extends Drawable {
.setContentText(getName())
.setContentIntent(PendingIntent.getActivity(context, 0, intent, 0))
.setAutoCancel(true)
+ .setChannel(CHAN_ID)
.setVibrate(PURR)
.addExtras(extras);
}
diff --git a/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java b/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java
index 689e38142988b..d2e37d8779d19 100644
--- a/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java
+++ b/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java
@@ -31,6 +31,7 @@ import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore.Images;
+import android.support.v4.content.FileProvider;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
@@ -56,6 +57,8 @@ import java.util.Comparator;
import java.util.List;
public class NekoLand extends Activity implements PrefsListener {
+ public static String CHAN_ID = "EGG";
+
public static boolean DEBUG = false;
public static boolean DEBUG_NOTIFICATIONS = false;
@@ -289,10 +292,13 @@ public class NekoLand extends Activity implements PrefsListener {
new String[] {png.toString()},
new String[] {"image/png"},
null);
- Uri uri = Uri.fromFile(png);
+ Log.v("Neko", "cat file: " + png);
+ Uri uri = FileProvider.getUriForFile(this, "com.android.egg.fileprovider", png);
+ Log.v("Neko", "cat uri: " + uri);
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_STREAM, uri);
intent.putExtra(Intent.EXTRA_SUBJECT, cat.getName());
+ intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
intent.setType("image/png");
startActivity(Intent.createChooser(intent, null));
cat.logShare(this);
diff --git a/packages/EasterEgg/src/com/android/egg/neko/NekoService.java b/packages/EasterEgg/src/com/android/egg/neko/NekoService.java
index 808ec361fb4f0..42506e61d2ecd 100644
--- a/packages/EasterEgg/src/com/android/egg/neko/NekoService.java
+++ b/packages/EasterEgg/src/com/android/egg/neko/NekoService.java
@@ -15,15 +15,15 @@
package com.android.egg.neko;
import android.app.Notification;
+import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.job.JobInfo;
import android.app.job.JobParameters;
import android.app.job.JobScheduler;
import android.app.job.JobService;
-import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
-import android.content.Intent;
+import android.net.Uri;
import android.os.Bundle;
import java.util.List;
@@ -33,6 +33,9 @@ import com.android.egg.R;
import java.util.Random;
+import static com.android.egg.neko.Cat.PURR;
+import static com.android.egg.neko.NekoLand.CHAN_ID;
+
public class NekoService extends JobService {
private static final String TAG = "NekoService";
@@ -40,6 +43,7 @@ public class NekoService extends JobService {
public static int JOB_ID = 42;
public static int CAT_NOTIFICATION = 1;
+ public static int DEBUG_NOTIFICATION = 1234;
public static float CAT_CAPTURE_PROB = 1.0f; // generous
@@ -50,6 +54,18 @@ public class NekoService extends JobService {
public static float INTERVAL_JITTER_FRAC = 0.25f;
+ private static void setupNotificationChannels(Context context) {
+ NotificationManager noman = context.getSystemService(NotificationManager.class);
+ NotificationChannel eggChan = new NotificationChannel(CHAN_ID,
+ context.getString(R.string.notification_channel_name),
+ NotificationManager.IMPORTANCE_DEFAULT);
+ eggChan.setSound(Uri.EMPTY, Notification.AUDIO_ATTRIBUTES_DEFAULT); // cats are quiet
+ eggChan.setVibrationPattern(PURR); // not totally quiet though
+ eggChan.setBlockableSystem(true); // unlike a real cat, you can push this one off your lap
+ eggChan.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC); // cats sit in the window
+ noman.createNotificationChannel(eggChan);
+ }
+
@Override
public boolean onStartJob(JobParameters params) {
Log.v(TAG, "Starting job: " + String.valueOf(params));
@@ -64,8 +80,9 @@ public class NekoService extends JobService {
final Notification.Builder builder
= cat.buildNotification(this)
.setContentTitle("DEBUG")
+ .setChannel(NekoLand.CHAN_ID)
.setContentText("Ran job: " + params);
- noman.notify(1, builder.build());
+ noman.notify(DEBUG_NOTIFICATION, builder.build());
}
final PrefState prefs = new PrefState(this);
@@ -111,6 +128,8 @@ public class NekoService extends JobService {
}
public static void registerJob(Context context, long intervalMinutes) {
+ setupNotificationChannels(context);
+
JobScheduler jss = context.getSystemService(JobScheduler.class);
jss.cancel(JOB_ID);
long interval = intervalMinutes * MINUTES;
@@ -126,12 +145,13 @@ public class NekoService extends JobService {
if (NekoLand.DEBUG_NOTIFICATIONS) {
NotificationManager noman = context.getSystemService(NotificationManager.class);
- noman.notify(500, new Notification.Builder(context)
+ noman.notify(DEBUG_NOTIFICATION, new Notification.Builder(context)
.setSmallIcon(R.drawable.stat_icon)
.setContentTitle(String.format("Job scheduled in %d min", (interval / MINUTES)))
.setContentText(String.valueOf(jobInfo))
.setPriority(Notification.PRIORITY_MIN)
.setCategory(Notification.CATEGORY_SERVICE)
+ .setChannel(NekoLand.CHAN_ID)
.setShowWhen(true)
.build());
}