Merge "Use longer timeout for reportShown call" into sc-qpr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6ef0aae53b
@@ -548,12 +548,16 @@ public abstract class WallpaperService extends Service {
|
|||||||
*/
|
*/
|
||||||
public void reportEngineShown(boolean waitForEngineShown) {
|
public void reportEngineShown(boolean waitForEngineShown) {
|
||||||
if (mIWallpaperEngine.mShownReported) return;
|
if (mIWallpaperEngine.mShownReported) return;
|
||||||
Message message = mCaller.obtainMessage(MSG_REPORT_SHOWN);
|
|
||||||
if (!waitForEngineShown) {
|
if (!waitForEngineShown) {
|
||||||
|
Message message = mCaller.obtainMessage(MSG_REPORT_SHOWN);
|
||||||
mCaller.removeMessages(MSG_REPORT_SHOWN);
|
mCaller.removeMessages(MSG_REPORT_SHOWN);
|
||||||
mCaller.sendMessage(message);
|
mCaller.sendMessage(message);
|
||||||
} else {
|
} else {
|
||||||
mCaller.sendMessageDelayed(message, TimeUnit.SECONDS.toMillis(1));
|
// if we are already waiting, no need to reset the timeout.
|
||||||
|
if (!mCaller.hasMessages(MSG_REPORT_SHOWN)) {
|
||||||
|
Message message = mCaller.obtainMessage(MSG_REPORT_SHOWN);
|
||||||
|
mCaller.sendMessageDelayed(message, TimeUnit.SECONDS.toMillis(5));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2078,6 +2082,8 @@ public abstract class WallpaperService extends Service {
|
|||||||
mShownReported = true;
|
mShownReported = true;
|
||||||
try {
|
try {
|
||||||
mConnection.engineShown(this);
|
mConnection.engineShown(this);
|
||||||
|
Log.d(TAG, "Wallpaper has updated the surface:"
|
||||||
|
+ mWallpaperManager.getWallpaperInfo());
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.w(TAG, "Wallpaper host disappeared", e);
|
Log.w(TAG, "Wallpaper host disappeared", e);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user