Loading cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java +1 −1 Original line number Diff line number Diff line Loading @@ -373,7 +373,7 @@ public final class Bmgr { } RestoreSet[] sets = null; int err = mRestore.getAvailableRestoreSets(observer); if (err != 0) { if (err == 0) { observer.waitForCompletion(); sets = observer.sets; for (RestoreSet s : sets) { Loading core/java/android/app/IntentService.java +49 −15 Original line number Diff line number Diff line Loading @@ -24,11 +24,24 @@ import android.os.Looper; import android.os.Message; /** * An abstract {@link Service} that serializes the handling of the Intents passed upon service * start and handles them on a handler thread. * IntentService is a base class for {@link Service}s that handle asynchronous * requests (expressed as {@link Intent}s) on demand. Clients send requests * through {@link android.content.Context#startService(Intent)} calls; the * service is started as needed, handles each Intent in turn using a worker * thread, and stops itself when it runs out of work. * * <p>To use this class extend it and implement {@link #onHandleIntent}. The {@link Service} will * automatically be stopped when the last enqueued {@link Intent} is handled. * <p>This "work queue processor" pattern is commonly used to offload tasks * from an application's main thread. The IntentService class exists to * simplify this pattern and take care of the mechanics. To use it, extend * IntentService and implement {@link #onHandleIntent(Intent)}. IntentService * will receive the Intents, launch a worker thread, and stop the service as * appropriate. * * <p>All requests are handled on a single worker thread -- they may take as * long as necessary (and will not block the application's main loop), but * only one request will be processed at a time. * * @see android.os.AsyncTask */ public abstract class IntentService extends Service { private volatile Looper mServiceLooper; Loading @@ -48,19 +61,31 @@ public abstract class IntentService extends Service { } } /** * Creates an IntentService. Invoked by your subclass's constructor. * * @param name Used to name the worker thread, important only for debugging. */ public IntentService(String name) { super(); mName = name; } /** * Control redelivery of intents. If called with true, * Sets intent redelivery preferences. Usually called from the constructor * with your preferred semantics. * * <p>If enabled is true, * {@link #onStartCommand(Intent, int, int)} will return * {@link Service#START_REDELIVER_INTENT}, so if this process dies before * {@link #onHandleIntent(Intent)} returns, the process will be restarted * and the intent redelivered. If multiple Intents have been sent, only * the most recent one is guaranteed to be redelivered. * * <p>If enabled is false (the default), * {@link #onStartCommand(Intent, int, int)} will return * {@link Service#START_REDELIVER_INTENT} instead of * {@link Service#START_NOT_STICKY}, so that if this service's process * is killed while it is executing the Intent in * {@link #onHandleIntent(Intent)}, then when later restarted the same Intent * will be re-delivered to it, to retry its execution. * {@link Service#START_NOT_STICKY}, and if the process dies, the Intent * dies along with it. */ public void setIntentRedelivery(boolean enabled) { mRedelivery = enabled; Loading @@ -68,6 +93,10 @@ public abstract class IntentService extends Service { @Override public void onCreate() { // TODO: It would be nice to have an option to hold a partial wakelock // during processing, and to have a static startService(Context, Intent) // method that would launch the service & hand off a wakelock. super.onCreate(); HandlerThread thread = new HandlerThread("IntentService[" + mName + "]"); thread.start(); Loading Loading @@ -101,9 +130,14 @@ public abstract class IntentService extends Service { } /** * Invoked on the Handler thread with the {@link Intent} that is passed to {@link #onStart}. * Note that this will be invoked from a different thread than the one that handles the * {@link #onStart} call. * This method is invoked on the worker thread with a request to process. * Only one Intent is processed at a time, but the processing happens on a * worker thread that runs independently from other application logic. * So, if this code takes a long time, it will hold up other requests to * the same IntentService, but it will not hold up anything else. * * @param intent The value passed to {@link * android.content.Context#startService(Intent)}. */ protected abstract void onHandleIntent(Intent intent); } core/java/android/app/SearchableInfo.java +4 −3 Original line number Diff line number Diff line Loading @@ -258,9 +258,9 @@ public final class SearchableInfo implements Parcelable { try { theirContext = context.createPackageContext(activity.getPackageName(), 0); } catch (PackageManager.NameNotFoundException e) { // unexpected, but we deal with this by null-checking theirContext Log.e(LOG_TAG, "Package not found " + activity.getPackageName()); } catch (java.lang.SecurityException e) { // unexpected, but we deal with this by null-checking theirContext Log.e(LOG_TAG, "Can't make context for " + activity.getPackageName(), e); } return theirContext; Loading Loading @@ -552,6 +552,7 @@ public final class SearchableInfo implements Parcelable { final ComponentName cName) { SearchableInfo result = null; Context activityContext = createActivityContext(context, cName); if (activityContext == null) return null; // in order to use the attributes mechanism, we have to walk the parser // forward through the file until it's reading the tag of interest. Loading core/java/android/text/method/PasswordTransformationMethod.java +11 −8 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ implements TransformationMethod, TextWatcher sp.removeSpan(vr[i]); } removeVisibleSpans(sp); sp.setSpan(new ViewReference(view), 0, 0, Spannable.SPAN_POINT_POINT); } Loading Loading @@ -100,10 +102,7 @@ implements TransformationMethod, TextWatcher int pref = TextKeyListener.getInstance().getPrefs(v.getContext()); if ((pref & TextKeyListener.SHOW_PASSWORD) != 0) { if (count > 0) { Visible[] old = sp.getSpans(0, sp.length(), Visible.class); for (int i = 0; i < old.length; i++) { sp.removeSpan(old[i]); } removeVisibleSpans(sp); if (count == 1) { sp.setSpan(new Visible(sp, this), start, start + count, Loading @@ -125,13 +124,17 @@ implements TransformationMethod, TextWatcher if (sourceText instanceof Spannable) { Spannable sp = (Spannable) sourceText; removeVisibleSpans(sp); } } } private static void removeVisibleSpans(Spannable sp) { Visible[] old = sp.getSpans(0, sp.length(), Visible.class); for (int i = 0; i < old.length; i++) { sp.removeSpan(old[i]); } } } } private static class PasswordCharSequence implements CharSequence, GetChars Loading core/java/android/view/ViewRoot.java +5 −1 Original line number Diff line number Diff line Loading @@ -852,7 +852,11 @@ public final class ViewRoot extends Handler implements ViewParent, } boolean windowShouldResize = mLayoutRequested && windowResizesToFitContent && (mWidth != host.mMeasuredWidth || mHeight != host.mMeasuredHeight); && ((mWidth != host.mMeasuredWidth || mHeight != host.mMeasuredHeight) || (lp.width == ViewGroup.LayoutParams.WRAP_CONTENT && frame.width() < desiredWindowWidth && frame.width() != mWidth) || (lp.height == ViewGroup.LayoutParams.WRAP_CONTENT && frame.height() < desiredWindowHeight && frame.height() != mHeight)); final boolean computesInternalInsets = attachInfo.mTreeObserver.hasComputeInternalInsetsListeners(); Loading Loading
cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java +1 −1 Original line number Diff line number Diff line Loading @@ -373,7 +373,7 @@ public final class Bmgr { } RestoreSet[] sets = null; int err = mRestore.getAvailableRestoreSets(observer); if (err != 0) { if (err == 0) { observer.waitForCompletion(); sets = observer.sets; for (RestoreSet s : sets) { Loading
core/java/android/app/IntentService.java +49 −15 Original line number Diff line number Diff line Loading @@ -24,11 +24,24 @@ import android.os.Looper; import android.os.Message; /** * An abstract {@link Service} that serializes the handling of the Intents passed upon service * start and handles them on a handler thread. * IntentService is a base class for {@link Service}s that handle asynchronous * requests (expressed as {@link Intent}s) on demand. Clients send requests * through {@link android.content.Context#startService(Intent)} calls; the * service is started as needed, handles each Intent in turn using a worker * thread, and stops itself when it runs out of work. * * <p>To use this class extend it and implement {@link #onHandleIntent}. The {@link Service} will * automatically be stopped when the last enqueued {@link Intent} is handled. * <p>This "work queue processor" pattern is commonly used to offload tasks * from an application's main thread. The IntentService class exists to * simplify this pattern and take care of the mechanics. To use it, extend * IntentService and implement {@link #onHandleIntent(Intent)}. IntentService * will receive the Intents, launch a worker thread, and stop the service as * appropriate. * * <p>All requests are handled on a single worker thread -- they may take as * long as necessary (and will not block the application's main loop), but * only one request will be processed at a time. * * @see android.os.AsyncTask */ public abstract class IntentService extends Service { private volatile Looper mServiceLooper; Loading @@ -48,19 +61,31 @@ public abstract class IntentService extends Service { } } /** * Creates an IntentService. Invoked by your subclass's constructor. * * @param name Used to name the worker thread, important only for debugging. */ public IntentService(String name) { super(); mName = name; } /** * Control redelivery of intents. If called with true, * Sets intent redelivery preferences. Usually called from the constructor * with your preferred semantics. * * <p>If enabled is true, * {@link #onStartCommand(Intent, int, int)} will return * {@link Service#START_REDELIVER_INTENT}, so if this process dies before * {@link #onHandleIntent(Intent)} returns, the process will be restarted * and the intent redelivered. If multiple Intents have been sent, only * the most recent one is guaranteed to be redelivered. * * <p>If enabled is false (the default), * {@link #onStartCommand(Intent, int, int)} will return * {@link Service#START_REDELIVER_INTENT} instead of * {@link Service#START_NOT_STICKY}, so that if this service's process * is killed while it is executing the Intent in * {@link #onHandleIntent(Intent)}, then when later restarted the same Intent * will be re-delivered to it, to retry its execution. * {@link Service#START_NOT_STICKY}, and if the process dies, the Intent * dies along with it. */ public void setIntentRedelivery(boolean enabled) { mRedelivery = enabled; Loading @@ -68,6 +93,10 @@ public abstract class IntentService extends Service { @Override public void onCreate() { // TODO: It would be nice to have an option to hold a partial wakelock // during processing, and to have a static startService(Context, Intent) // method that would launch the service & hand off a wakelock. super.onCreate(); HandlerThread thread = new HandlerThread("IntentService[" + mName + "]"); thread.start(); Loading Loading @@ -101,9 +130,14 @@ public abstract class IntentService extends Service { } /** * Invoked on the Handler thread with the {@link Intent} that is passed to {@link #onStart}. * Note that this will be invoked from a different thread than the one that handles the * {@link #onStart} call. * This method is invoked on the worker thread with a request to process. * Only one Intent is processed at a time, but the processing happens on a * worker thread that runs independently from other application logic. * So, if this code takes a long time, it will hold up other requests to * the same IntentService, but it will not hold up anything else. * * @param intent The value passed to {@link * android.content.Context#startService(Intent)}. */ protected abstract void onHandleIntent(Intent intent); }
core/java/android/app/SearchableInfo.java +4 −3 Original line number Diff line number Diff line Loading @@ -258,9 +258,9 @@ public final class SearchableInfo implements Parcelable { try { theirContext = context.createPackageContext(activity.getPackageName(), 0); } catch (PackageManager.NameNotFoundException e) { // unexpected, but we deal with this by null-checking theirContext Log.e(LOG_TAG, "Package not found " + activity.getPackageName()); } catch (java.lang.SecurityException e) { // unexpected, but we deal with this by null-checking theirContext Log.e(LOG_TAG, "Can't make context for " + activity.getPackageName(), e); } return theirContext; Loading Loading @@ -552,6 +552,7 @@ public final class SearchableInfo implements Parcelable { final ComponentName cName) { SearchableInfo result = null; Context activityContext = createActivityContext(context, cName); if (activityContext == null) return null; // in order to use the attributes mechanism, we have to walk the parser // forward through the file until it's reading the tag of interest. Loading
core/java/android/text/method/PasswordTransformationMethod.java +11 −8 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ implements TransformationMethod, TextWatcher sp.removeSpan(vr[i]); } removeVisibleSpans(sp); sp.setSpan(new ViewReference(view), 0, 0, Spannable.SPAN_POINT_POINT); } Loading Loading @@ -100,10 +102,7 @@ implements TransformationMethod, TextWatcher int pref = TextKeyListener.getInstance().getPrefs(v.getContext()); if ((pref & TextKeyListener.SHOW_PASSWORD) != 0) { if (count > 0) { Visible[] old = sp.getSpans(0, sp.length(), Visible.class); for (int i = 0; i < old.length; i++) { sp.removeSpan(old[i]); } removeVisibleSpans(sp); if (count == 1) { sp.setSpan(new Visible(sp, this), start, start + count, Loading @@ -125,13 +124,17 @@ implements TransformationMethod, TextWatcher if (sourceText instanceof Spannable) { Spannable sp = (Spannable) sourceText; removeVisibleSpans(sp); } } } private static void removeVisibleSpans(Spannable sp) { Visible[] old = sp.getSpans(0, sp.length(), Visible.class); for (int i = 0; i < old.length; i++) { sp.removeSpan(old[i]); } } } } private static class PasswordCharSequence implements CharSequence, GetChars Loading
core/java/android/view/ViewRoot.java +5 −1 Original line number Diff line number Diff line Loading @@ -852,7 +852,11 @@ public final class ViewRoot extends Handler implements ViewParent, } boolean windowShouldResize = mLayoutRequested && windowResizesToFitContent && (mWidth != host.mMeasuredWidth || mHeight != host.mMeasuredHeight); && ((mWidth != host.mMeasuredWidth || mHeight != host.mMeasuredHeight) || (lp.width == ViewGroup.LayoutParams.WRAP_CONTENT && frame.width() < desiredWindowWidth && frame.width() != mWidth) || (lp.height == ViewGroup.LayoutParams.WRAP_CONTENT && frame.height() < desiredWindowHeight && frame.height() != mHeight)); final boolean computesInternalInsets = attachInfo.mTreeObserver.hasComputeInternalInsetsListeners(); Loading