Skip to content

Commit e32bb6c

Browse files
dsandlerAndroid (Google) Code Review
authored andcommitted
Merge "Only show the BeanFlinger screensaver to the worthy." into jb-mr1-dev
2 parents b788556 + 0bcf4ad commit e32bb6c

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

packages/SystemUI/AndroidManifest.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
android:name=".BeanBag"
168168
android:exported="true"
169169
android:label="BeanBag"
170-
android:icon="@drawable/redbeandroid"
170+
android:icon="@drawable/redbean2"
171171
android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
172172
android:hardwareAccelerated="true"
173173
android:launchMode="singleInstance"
@@ -184,7 +184,9 @@
184184
<service
185185
android:name=".BeanBagDream"
186186
android:exported="true"
187-
android:label="Beans in space">
187+
android:label="@string/jelly_bean_dream_name"
188+
android:enabled="false"
189+
>
188190
<intent-filter>
189191
<action android:name="android.intent.action.MAIN" />
190192
<category android:name="android.intent.category.DEFAULT" />

packages/SystemUI/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,4 +397,7 @@
397397

398398
<!-- Description of the button in the phone-style notification panel that controls auto-rotation, when auto-rotation is off. [CHAR LIMIT=NONE] -->
399399
<string name="accessibility_rotation_lock_on_portrait">Screen is locked in portrait orientation.</string>
400+
401+
<!-- Name of the Jelly Bean platlogo screensaver -->
402+
<string name="jelly_bean_dream_name">BeanFlinger</string>
400403
</resources>

packages/SystemUI/src/com/android/systemui/BeanBag.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import android.content.ComponentName;
2525
import android.content.Context;
2626
import android.content.Intent;
27+
import android.content.pm.PackageManager;
2728
import android.graphics.drawable.AnimationDrawable;
2829
import android.graphics.drawable.BitmapDrawable;
2930
import android.graphics.Bitmap;
@@ -40,6 +41,7 @@
4041
import android.graphics.RectF;
4142
import android.os.Handler;
4243
import android.os.SystemClock;
44+
import android.provider.Settings;
4345
import android.util.AttributeSet;
4446
import android.util.DisplayMetrics;
4547
import android.util.Pair;
@@ -402,6 +404,11 @@ public void onDraw(Canvas c) {
402404
public void onStart() {
403405
super.onStart();
404406

407+
// ACHIEVEMENT UNLOCKED
408+
PackageManager pm = getPackageManager();
409+
pm.setComponentEnabledSetting(new ComponentName(this, BeanBagDream.class),
410+
PackageManager.COMPONENT_ENABLED_STATE_ENABLED, 0);
411+
405412
getWindow().addFlags(
406413
WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
407414
| WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED

0 commit comments

Comments
 (0)