Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
scorpio
frameworks_base
Commits
8a35305d
Commit
8a35305d
authored
5 years ago
by
Mark Stevens
Browse files
Options
Download
Email Patches
Plain Diff
fix bootanimation loop glitch on first color
parent
2fc30902
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
8 deletions
+90
-8
cmds/bootanimation/BootAnimation.cpp
cmds/bootanimation/BootAnimation.cpp
+7
-7
core/java/com/android/internal/app/AlertActivity.java
core/java/com/android/internal/app/AlertActivity.java
+4
-0
packages/SystemUI/src/com/android/systemui/usb/UsbDebuggingActivity.java
...UI/src/com/android/systemui/usb/UsbDebuggingActivity.java
+39
-1
services/core/java/com/android/server/policy/GlobalActions.java
...es/core/java/com/android/server/policy/GlobalActions.java
+40
-0
No files found.
cmds/bootanimation/BootAnimation.cpp
View file @
8a35305d
...
...
@@ -474,11 +474,11 @@ bool BootAnimation::vendor()
initTexture
(
&
mVendor
[
0
],
mAssets
,
"images/buzztime-logo-mask.png"
);
GLfloat
colorCues
[][
4
]
=
{
{(
float
)
0x9E
/
255.0
,
(
float
)
0x9E
/
255.0
,
(
float
)
0x9E
/
255.0
,
1.0
},
{(
float
)
0x00
/
255.0
,
(
float
)
0xA7
/
255.0
,
(
float
)
0xE1
/
255.0
,
1.0
},
{(
float
)
0x81
/
255.0
,
(
float
)
0x22
/
255.0
,
(
float
)
0xB0
/
255.0
,
1.0
},
{(
float
)
0x24
/
255.0
,
(
float
)
0x87
/
255.0
,
(
float
)
0x49
/
255.0
,
1.0
},
{(
float
)
0xEA
/
255.0
,
(
float
)
0x6E
/
255.0
,
(
float
)
0x2F
/
255.0
,
1.0
},
{(
float
)
0x9E
/
255.0
,
(
float
)
0x9E
/
255.0
,
(
float
)
0x9E
/
255.0
,
1.0
},
// grey
{(
float
)
0x00
/
255.0
,
(
float
)
0xA7
/
255.0
,
(
float
)
0xE1
/
255.0
,
1.0
},
// blue
{(
float
)
0x81
/
255.0
,
(
float
)
0x22
/
255.0
,
(
float
)
0xB0
/
255.0
,
1.0
},
// purple
{(
float
)
0x24
/
255.0
,
(
float
)
0x87
/
255.0
,
(
float
)
0x49
/
255.0
,
1.0
},
// Green
{(
float
)
0xEA
/
255.0
,
(
float
)
0x6E
/
255.0
,
(
float
)
0x2F
/
255.0
,
1.0
},
// orange
{
0.0
,
0.0
,
0.0
,
1.0
}
};
...
...
@@ -486,7 +486,7 @@ bool BootAnimation::vendor()
int
colorCuesCount
=
(
sizeof
(
colorCues
)
/
(
sizeof
(
GLfloat
)
*
4
)
)
-
1
;
int
color_cue
=
0
;
GLfloat
*
colorS
=
colorCues
[
colorCuesCount
+
1
];
// start on black.. move to grey
GLfloat
*
colorS
=
colorCues
[
colorCuesCount
];
// start on black.. move to grey
GLfloat
*
colorE
=
colorCues
[
0
];
GLfloat
colorIn
[]
=
{
0.0
,
0.0
,
0.0
,
1.0
};
// buffer for the current interpolated color
...
...
@@ -542,7 +542,7 @@ bool BootAnimation::vendor()
dacc
+=
parts
[
part
];
}
// fig
o
ure out the color and adjust start/end if it has changed
// figure out the color and adjust start/end if it has changed
int
color_offset
=
int
(
di
)
%
colorCuesCount
;
//ALOGD("secs: %f, pt:%d, dt: %f, di: %f, dp: %f", dt, part, dt, di, dpart);
if
(
color_offset
!=
color_cue
){
...
...
This diff is collapsed.
Click to expand it.
core/java/com/android/internal/app/AlertActivity.java
View file @
8a35305d
...
...
@@ -23,6 +23,9 @@ import android.os.Bundle;
import
android.view.KeyEvent
;
import
android.view.ViewGroup
;
import
android.view.accessibility.AccessibilityEvent
;
import
android.widget.Button
;
import
com.android.internal.R
;
/**
* An activity that follows the visual style of an AlertDialog.
...
...
@@ -88,6 +91,7 @@ public abstract class AlertActivity extends Activity implements DialogInterface
protected
void
setupAlert
()
{
mAlertParams
.
apply
(
mAlert
);
mAlert
.
installContent
();
}
@Override
...
...
This diff is collapsed.
Click to expand it.
packages/SystemUI/src/com/android/systemui/usb/UsbDebuggingActivity.java
View file @
8a35305d
...
...
@@ -29,9 +29,12 @@ import android.os.Bundle;
import
android.os.IBinder
;
import
android.os.ServiceManager
;
import
android.os.SystemProperties
;
import
android.text.format.DateUtils
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.Button
;
import
android.widget.CheckBox
;
import
com.android.internal.app.AlertActivity
;
...
...
@@ -47,6 +50,10 @@ public class UsbDebuggingActivity extends AlertActivity
private
UsbDisconnectedReceiver
mDisconnectedReceiver
;
private
String
mKey
;
private
int
countdown
=
1000
;
private
Button
mBtnCancel
=
null
;
private
Button
mBtnOk
=
null
;
@Override
public
void
onCreate
(
Bundle
icicle
)
{
super
.
onCreate
(
icicle
);
...
...
@@ -82,8 +89,11 @@ public class UsbDebuggingActivity extends AlertActivity
if
(
DEBUG_CONFIRM
&&
SystemProperties
.
getBoolean
(
"debug.update.autoconfirm"
,
false
))
{
mAlwaysAllow
.
setChecked
(
true
);
onClick
(
null
,
AlertDialog
.
BUTTON_POSITIVE
);
}
else
}
else
{
setupAlert
();
mBtnCancel
=
(
Button
)
findViewById
(
com
.
android
.
internal
.
R
.
id
.
button2
);
mBtnCancel
.
postDelayed
(
mAutoCancelRunnable
,
10000
);
}
}
private
class
UsbDisconnectedReceiver
extends
BroadcastReceiver
{
...
...
@@ -114,6 +124,8 @@ public class UsbDebuggingActivity extends AlertActivity
@Override
protected
void
onStop
()
{
if
(
mBtnCancel
!=
null
)
mBtnCancel
.
removeCallbacks
(
mAutoCancelRunnable
);
if
(
mDisconnectedReceiver
!=
null
)
{
unregisterReceiver
(
mDisconnectedReceiver
);
}
...
...
@@ -137,4 +149,30 @@ public class UsbDebuggingActivity extends AlertActivity
}
finish
();
}
private
Runnable
mAutoCancelRunnable
=
new
Runnable
()
{
@Override
public
void
run
()
{
// start the countdown, if needed
if
(
countdown
>
100
){
countdown
=
30
;
}
if
(
countdown
>
0
)
{
if
(--
countdown
<=
10
)
{
String
text
=
(
String
)
mBtnCancel
.
getText
();
if
(
text
.
contains
(
"("
))
{
text
=
text
.
replaceAll
(
"\\(\\d+\\)"
,
"("
+
countdown
+
")"
);
}
else
{
text
+=
" ("
+
countdown
+
")"
;
}
//text += "-";
mBtnCancel
.
setText
(
text
);
((
ViewGroup
)
mBtnCancel
.
getParent
()).
invalidate
();
}
mBtnCancel
.
postDelayed
(
this
,
DateUtils
.
SECOND_IN_MILLIS
);
}
else
mBtnCancel
.
performClick
();
}
};
}
This diff is collapsed.
Click to expand it.
services/core/java/com/android/server/policy/GlobalActions.java
View file @
8a35305d
...
...
@@ -27,11 +27,14 @@ import android.app.ActivityManager;
import
android.app.ActivityManagerNative
;
import
android.app.AlertDialog
;
import
android.app.Dialog
;
import
android.app.StatusBarManager
;
import
android.content.BroadcastReceiver
;
import
android.content.ComponentName
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.IntentFilter
;
import
android.content.pm.PackageManager
;
import
android.content.pm.UserInfo
;
import
android.database.ContentObserver
;
import
android.graphics.drawable.Drawable
;
...
...
@@ -306,6 +309,9 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
mItems
.
add
(
getBugReportAction
());
mItems
.
add
(
new
AutoBootModeToggleAction
());
mItems
.
add
(
getSettingsAction
());
if
(!
"user"
.
equals
(
SystemProperties
.
get
(
"ro.build.type"
,
"user"
)))
{
mItems
.
add
(
new
PowerFactoryResetAction
());
}
}
}
else
if
(
GLOBAL_ACTION_KEY_SILENT
.
equals
(
actionKey
))
{
if
(
mShowSilentToggle
)
{
...
...
@@ -467,6 +473,40 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
}
}
private
final
class
PowerFactoryResetAction
extends
SinglePressAction
implements
LongPressAction
{
private
PowerFactoryResetAction
()
{
super
(
R
.
drawable
.
ic_menu_revert
,
R
.
string
.
reboot_to_reset_title
);
}
@Override
public
boolean
onLongPress
()
{
Intent
intent
=
new
Intent
(
Intent
.
ACTION_MASTER_CLEAR
);
intent
.
addFlags
(
Intent
.
FLAG_RECEIVER_FOREGROUND
);
intent
.
putExtra
(
Intent
.
EXTRA_REASON
,
"Power dialog factory reset"
);
mContext
.
sendBroadcast
(
intent
);
//mWindowManagerFuncs.shutdown(false /* confirm */);
return
true
;
}
@Override
public
boolean
showDuringKeyguard
()
{
return
true
;
}
@Override
public
boolean
showBeforeProvisioning
()
{
return
true
;
}
@Override
public
void
onPress
()
{
// shutdown by making sure radio and power are handled accordingly.
//mWindowManagerFuncs.shutdown(false /* confirm */);
}
}
//using silent mode for the strings
private
class
AutoBootModeToggleAction
extends
ToggleAction
implements
LongPressAction
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment