Loading api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -23005,7 +23005,7 @@ package android.location { method protected abstract String onGetSummary(); method public final void onStart(android.content.Intent, int); method public final int onStartCommand(android.content.Intent, int, int); method public static final void refreshSettings(android.content.Context); method public static final void refreshSettings(@NonNull android.content.Context); field public static final String ACTION_INJECTED_SETTING_CHANGED = "android.location.InjectedSettingChanged"; field public static final String ACTION_SERVICE_INTENT = "android.location.SettingInjectorService"; field public static final String ATTRIBUTES_NAME = "injected-location-setting"; core/java/android/app/ActivityThread.java +10 −25 Original line number Diff line number Diff line Loading @@ -3115,10 +3115,6 @@ public final class ActivityThread extends ClientTransactionHandler { if (!r.stopped) { throw new IllegalStateException("Can't start activity that is not stopped."); } if (r.activity.mFinished) { // TODO(lifecycler): How can this happen? return; } // Start activity.performStart("handleStartActivity"); Loading Loading @@ -3241,6 +3237,8 @@ public final class ActivityThread extends ClientTransactionHandler { if (!r.activity.mFinished && pendingActions != null) { pendingActions.setOldState(r.state); pendingActions.setRestoreInstanceState(true); } if (pendingActions != null) { pendingActions.setCallOnPostCreate(true); } } else { Loading Loading @@ -3942,7 +3940,7 @@ public final class ActivityThread extends ClientTransactionHandler { if (localLOGV) { Slog.v(TAG, "Performing resume of " + r + " finished=" + r.activity.mFinished); } if (r == null || r.activity.mFinished) { if (r == null) { return null; } if (r.getLifecycleState() == ON_RESUME) { Loading Loading @@ -4212,12 +4210,6 @@ public final class ActivityThread extends ClientTransactionHandler { private Bundle performPauseActivity(ActivityClientRecord r, boolean finished, String reason, PendingTransactionActions pendingActions) { if (r.paused) { if (r.activity.mFinished) { // If we are finishing, we won't call onResume() in certain cases. // So here we likewise don't want to call onPause() if the activity // isn't resumed. return null; } RuntimeException e = new RuntimeException( "Performing pause of activity that is not resumed: " + r.intent.getComponent().toShortString()); Loading Loading @@ -4337,21 +4329,14 @@ public final class ActivityThread extends ClientTransactionHandler { boolean saveState, boolean finalStateRequest, String reason) { if (localLOGV) Slog.v(TAG, "Performing stop of " + r); if (r != null) { if (!keepShown && r.stopped) { if (r.activity.mFinished) { // If we are finishing, we won't call onResume() in certain // cases. So here we likewise don't want to call onStop() // if the activity isn't resumed. return; } if (!finalStateRequest) { if (!keepShown && r.stopped && !finalStateRequest) { // Double stop request is possible if activity receives 'sleep' followed by 'stop'. final RuntimeException e = new RuntimeException( "Performing stop of activity that is already stopped: " + r.intent.getComponent().toShortString()); Slog.e(TAG, e.getMessage(), e); Slog.e(TAG, r.getStateString()); } } // One must first be paused before stopped... performPauseActivityIfNeeded(r, reason); Loading core/java/android/content/LoggingContentInterface.java +126 −46 Original line number Diff line number Diff line Loading @@ -66,8 +66,13 @@ public class LoggingContentInterface implements ContentInterface { } else { sb.append(" = ").append(deepToString(res)); } if (res instanceof Exception) { Log.e(tag, sb.toString()); } else { Log.v(tag, sb.toString()); } } private String deepToString(Object value) { if (value != null && value.getClass().isArray()) { Loading @@ -81,119 +86,194 @@ public class LoggingContentInterface implements ContentInterface { public @Nullable Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable Bundle queryArgs, @Nullable CancellationSignal cancellationSignal) throws RemoteException { try { final Cursor res = delegate.query(uri, projection, queryArgs, cancellationSignal); log("query", res, uri, projection, queryArgs, cancellationSignal); return res; } catch (Exception res) { log("query", res, uri, projection, queryArgs, cancellationSignal); throw res; } } @Override public @Nullable String getType(@NonNull Uri uri) throws RemoteException { try { final String res = delegate.getType(uri); log("getType", res, uri); return res; } catch (Exception res) { log("getType", res, uri); throw res; } } @Override public @Nullable String[] getStreamTypes(@NonNull Uri uri, @NonNull String mimeTypeFilter) throws RemoteException { try { final String[] res = delegate.getStreamTypes(uri, mimeTypeFilter); log("getStreamTypes", res, uri, mimeTypeFilter); return res; } catch (Exception res) { log("getStreamTypes", res, uri, mimeTypeFilter); throw res; } } @Override public @Nullable Uri canonicalize(@NonNull Uri uri) throws RemoteException { try { final Uri res = delegate.canonicalize(uri); log("canonicalize", res, uri); return res; } catch (Exception res) { log("canonicalize", res, uri); throw res; } } @Override public @Nullable Uri uncanonicalize(@NonNull Uri uri) throws RemoteException { try { final Uri res = delegate.uncanonicalize(uri); log("uncanonicalize", res, uri); return res; } catch (Exception res) { log("uncanonicalize", res, uri); throw res; } } @Override public boolean refresh(@NonNull Uri uri, @Nullable Bundle args, @Nullable CancellationSignal cancellationSignal) throws RemoteException { try { final boolean res = delegate.refresh(uri, args, cancellationSignal); log("refresh", res, uri, args, cancellationSignal); return res; } catch (Exception res) { log("refresh", res, uri, args, cancellationSignal); throw res; } } @Override public @Nullable Uri insert(@NonNull Uri uri, @Nullable ContentValues initialValues) throws RemoteException { try { final Uri res = delegate.insert(uri, initialValues); log("insert", res, uri, initialValues); return res; } catch (Exception res) { log("insert", res, uri, initialValues); throw res; } } @Override public int bulkInsert(@NonNull Uri uri, @NonNull ContentValues[] initialValues) throws RemoteException { try { final int res = delegate.bulkInsert(uri, initialValues); log("bulkInsert", res, uri, initialValues); return res; } catch (Exception res) { log("bulkInsert", res, uri, initialValues); throw res; } } @Override public int delete(@NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs) throws RemoteException { try { final int res = delegate.delete(uri, selection, selectionArgs); log("delete", res, uri, selection, selectionArgs); return res; } catch (Exception res) { log("delete", res, uri, selection, selectionArgs); throw res; } } @Override public int update(@NonNull Uri uri, @Nullable ContentValues values, @Nullable String selection, @Nullable String[] selectionArgs) throws RemoteException { try { final int res = delegate.update(uri, values, selection, selectionArgs); log("update", res, uri, values, selection, selectionArgs); return res; } catch (Exception res) { log("update", res, uri, values, selection, selectionArgs); throw res; } } @Override public @Nullable ParcelFileDescriptor openFile(@NonNull Uri uri, @NonNull String mode, @Nullable CancellationSignal signal) throws RemoteException, FileNotFoundException { try { final ParcelFileDescriptor res = delegate.openFile(uri, mode, signal); log("openFile", res, uri, mode, signal); return res; } catch (Exception res) { log("openFile", res, uri, mode, signal); throw res; } } @Override public @Nullable AssetFileDescriptor openAssetFile(@NonNull Uri uri, @NonNull String mode, @Nullable CancellationSignal signal) throws RemoteException, FileNotFoundException { try { final AssetFileDescriptor res = delegate.openAssetFile(uri, mode, signal); log("openAssetFile", res, uri, mode, signal); return res; } catch (Exception res) { log("openAssetFile", res, uri, mode, signal); throw res; } } @Override public @Nullable AssetFileDescriptor openTypedAssetFile(@NonNull Uri uri, @NonNull String mimeTypeFilter, @Nullable Bundle opts, @Nullable CancellationSignal signal) throws RemoteException, FileNotFoundException { try { final AssetFileDescriptor res = delegate.openTypedAssetFile(uri, mimeTypeFilter, opts, signal); log("openTypedAssetFile", res, uri, mimeTypeFilter, opts, signal); return res; } catch (Exception res) { log("openTypedAssetFile", res, uri, mimeTypeFilter, opts, signal); throw res; } } @Override public @NonNull ContentProviderResult[] applyBatch(@NonNull String authority, @NonNull ArrayList<ContentProviderOperation> operations) throws RemoteException, OperationApplicationException { try { final ContentProviderResult[] res = delegate.applyBatch(authority, operations); log("applyBatch", res, authority, operations); return res; } catch (Exception res) { log("applyBatch", res, authority, operations); throw res; } } @Override public @Nullable Bundle call(@NonNull String authority, @NonNull String method, @Nullable String arg, @Nullable Bundle extras) throws RemoteException { try { final Bundle res = delegate.call(authority, method, arg, extras); log("call", res, authority, method, arg, extras); return res; } catch (Exception res) { log("call", res, authority, method, arg, extras); throw res; } } } location/java/android/location/SettingInjectorService.java +13 −10 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.location; import android.annotation.NonNull; import android.app.Service; import android.content.Context; import android.content.Intent; Loading Loading @@ -206,6 +207,8 @@ public abstract class SettingInjectorService extends Service { * Returns the {@link android.preference.Preference#getSummary()} value (allowed to be null or * empty). Should not perform unpredictably-long operations such as network access--see the * running-time comments in the class-level javadoc. * <p/> * This method is called on KitKat, and Q+ devices. * * @return the {@link android.preference.Preference#getSummary()} value */ Loading Loading @@ -234,7 +237,7 @@ public abstract class SettingInjectorService extends Service { /** * Sends a broadcast to refresh the injected settings on location settings page. */ public static final void refreshSettings(Context context) { public static final void refreshSettings(@NonNull Context context) { Intent intent = new Intent(ACTION_INJECTED_SETTING_CHANGED); context.sendBroadcast(intent); } Loading media/java/android/media/ExifInterface.java +1 −1 Original line number Diff line number Diff line Loading @@ -1359,7 +1359,7 @@ public class ExifInterface { if (file == null) { throw new NullPointerException("file cannot be null"); } initForFilename(file.getName()); initForFilename(file.getAbsolutePath()); } /** Loading Loading
api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -23005,7 +23005,7 @@ package android.location { method protected abstract String onGetSummary(); method public final void onStart(android.content.Intent, int); method public final int onStartCommand(android.content.Intent, int, int); method public static final void refreshSettings(android.content.Context); method public static final void refreshSettings(@NonNull android.content.Context); field public static final String ACTION_INJECTED_SETTING_CHANGED = "android.location.InjectedSettingChanged"; field public static final String ACTION_SERVICE_INTENT = "android.location.SettingInjectorService"; field public static final String ATTRIBUTES_NAME = "injected-location-setting";
core/java/android/app/ActivityThread.java +10 −25 Original line number Diff line number Diff line Loading @@ -3115,10 +3115,6 @@ public final class ActivityThread extends ClientTransactionHandler { if (!r.stopped) { throw new IllegalStateException("Can't start activity that is not stopped."); } if (r.activity.mFinished) { // TODO(lifecycler): How can this happen? return; } // Start activity.performStart("handleStartActivity"); Loading Loading @@ -3241,6 +3237,8 @@ public final class ActivityThread extends ClientTransactionHandler { if (!r.activity.mFinished && pendingActions != null) { pendingActions.setOldState(r.state); pendingActions.setRestoreInstanceState(true); } if (pendingActions != null) { pendingActions.setCallOnPostCreate(true); } } else { Loading Loading @@ -3942,7 +3940,7 @@ public final class ActivityThread extends ClientTransactionHandler { if (localLOGV) { Slog.v(TAG, "Performing resume of " + r + " finished=" + r.activity.mFinished); } if (r == null || r.activity.mFinished) { if (r == null) { return null; } if (r.getLifecycleState() == ON_RESUME) { Loading Loading @@ -4212,12 +4210,6 @@ public final class ActivityThread extends ClientTransactionHandler { private Bundle performPauseActivity(ActivityClientRecord r, boolean finished, String reason, PendingTransactionActions pendingActions) { if (r.paused) { if (r.activity.mFinished) { // If we are finishing, we won't call onResume() in certain cases. // So here we likewise don't want to call onPause() if the activity // isn't resumed. return null; } RuntimeException e = new RuntimeException( "Performing pause of activity that is not resumed: " + r.intent.getComponent().toShortString()); Loading Loading @@ -4337,21 +4329,14 @@ public final class ActivityThread extends ClientTransactionHandler { boolean saveState, boolean finalStateRequest, String reason) { if (localLOGV) Slog.v(TAG, "Performing stop of " + r); if (r != null) { if (!keepShown && r.stopped) { if (r.activity.mFinished) { // If we are finishing, we won't call onResume() in certain // cases. So here we likewise don't want to call onStop() // if the activity isn't resumed. return; } if (!finalStateRequest) { if (!keepShown && r.stopped && !finalStateRequest) { // Double stop request is possible if activity receives 'sleep' followed by 'stop'. final RuntimeException e = new RuntimeException( "Performing stop of activity that is already stopped: " + r.intent.getComponent().toShortString()); Slog.e(TAG, e.getMessage(), e); Slog.e(TAG, r.getStateString()); } } // One must first be paused before stopped... performPauseActivityIfNeeded(r, reason); Loading
core/java/android/content/LoggingContentInterface.java +126 −46 Original line number Diff line number Diff line Loading @@ -66,8 +66,13 @@ public class LoggingContentInterface implements ContentInterface { } else { sb.append(" = ").append(deepToString(res)); } if (res instanceof Exception) { Log.e(tag, sb.toString()); } else { Log.v(tag, sb.toString()); } } private String deepToString(Object value) { if (value != null && value.getClass().isArray()) { Loading @@ -81,119 +86,194 @@ public class LoggingContentInterface implements ContentInterface { public @Nullable Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable Bundle queryArgs, @Nullable CancellationSignal cancellationSignal) throws RemoteException { try { final Cursor res = delegate.query(uri, projection, queryArgs, cancellationSignal); log("query", res, uri, projection, queryArgs, cancellationSignal); return res; } catch (Exception res) { log("query", res, uri, projection, queryArgs, cancellationSignal); throw res; } } @Override public @Nullable String getType(@NonNull Uri uri) throws RemoteException { try { final String res = delegate.getType(uri); log("getType", res, uri); return res; } catch (Exception res) { log("getType", res, uri); throw res; } } @Override public @Nullable String[] getStreamTypes(@NonNull Uri uri, @NonNull String mimeTypeFilter) throws RemoteException { try { final String[] res = delegate.getStreamTypes(uri, mimeTypeFilter); log("getStreamTypes", res, uri, mimeTypeFilter); return res; } catch (Exception res) { log("getStreamTypes", res, uri, mimeTypeFilter); throw res; } } @Override public @Nullable Uri canonicalize(@NonNull Uri uri) throws RemoteException { try { final Uri res = delegate.canonicalize(uri); log("canonicalize", res, uri); return res; } catch (Exception res) { log("canonicalize", res, uri); throw res; } } @Override public @Nullable Uri uncanonicalize(@NonNull Uri uri) throws RemoteException { try { final Uri res = delegate.uncanonicalize(uri); log("uncanonicalize", res, uri); return res; } catch (Exception res) { log("uncanonicalize", res, uri); throw res; } } @Override public boolean refresh(@NonNull Uri uri, @Nullable Bundle args, @Nullable CancellationSignal cancellationSignal) throws RemoteException { try { final boolean res = delegate.refresh(uri, args, cancellationSignal); log("refresh", res, uri, args, cancellationSignal); return res; } catch (Exception res) { log("refresh", res, uri, args, cancellationSignal); throw res; } } @Override public @Nullable Uri insert(@NonNull Uri uri, @Nullable ContentValues initialValues) throws RemoteException { try { final Uri res = delegate.insert(uri, initialValues); log("insert", res, uri, initialValues); return res; } catch (Exception res) { log("insert", res, uri, initialValues); throw res; } } @Override public int bulkInsert(@NonNull Uri uri, @NonNull ContentValues[] initialValues) throws RemoteException { try { final int res = delegate.bulkInsert(uri, initialValues); log("bulkInsert", res, uri, initialValues); return res; } catch (Exception res) { log("bulkInsert", res, uri, initialValues); throw res; } } @Override public int delete(@NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs) throws RemoteException { try { final int res = delegate.delete(uri, selection, selectionArgs); log("delete", res, uri, selection, selectionArgs); return res; } catch (Exception res) { log("delete", res, uri, selection, selectionArgs); throw res; } } @Override public int update(@NonNull Uri uri, @Nullable ContentValues values, @Nullable String selection, @Nullable String[] selectionArgs) throws RemoteException { try { final int res = delegate.update(uri, values, selection, selectionArgs); log("update", res, uri, values, selection, selectionArgs); return res; } catch (Exception res) { log("update", res, uri, values, selection, selectionArgs); throw res; } } @Override public @Nullable ParcelFileDescriptor openFile(@NonNull Uri uri, @NonNull String mode, @Nullable CancellationSignal signal) throws RemoteException, FileNotFoundException { try { final ParcelFileDescriptor res = delegate.openFile(uri, mode, signal); log("openFile", res, uri, mode, signal); return res; } catch (Exception res) { log("openFile", res, uri, mode, signal); throw res; } } @Override public @Nullable AssetFileDescriptor openAssetFile(@NonNull Uri uri, @NonNull String mode, @Nullable CancellationSignal signal) throws RemoteException, FileNotFoundException { try { final AssetFileDescriptor res = delegate.openAssetFile(uri, mode, signal); log("openAssetFile", res, uri, mode, signal); return res; } catch (Exception res) { log("openAssetFile", res, uri, mode, signal); throw res; } } @Override public @Nullable AssetFileDescriptor openTypedAssetFile(@NonNull Uri uri, @NonNull String mimeTypeFilter, @Nullable Bundle opts, @Nullable CancellationSignal signal) throws RemoteException, FileNotFoundException { try { final AssetFileDescriptor res = delegate.openTypedAssetFile(uri, mimeTypeFilter, opts, signal); log("openTypedAssetFile", res, uri, mimeTypeFilter, opts, signal); return res; } catch (Exception res) { log("openTypedAssetFile", res, uri, mimeTypeFilter, opts, signal); throw res; } } @Override public @NonNull ContentProviderResult[] applyBatch(@NonNull String authority, @NonNull ArrayList<ContentProviderOperation> operations) throws RemoteException, OperationApplicationException { try { final ContentProviderResult[] res = delegate.applyBatch(authority, operations); log("applyBatch", res, authority, operations); return res; } catch (Exception res) { log("applyBatch", res, authority, operations); throw res; } } @Override public @Nullable Bundle call(@NonNull String authority, @NonNull String method, @Nullable String arg, @Nullable Bundle extras) throws RemoteException { try { final Bundle res = delegate.call(authority, method, arg, extras); log("call", res, authority, method, arg, extras); return res; } catch (Exception res) { log("call", res, authority, method, arg, extras); throw res; } } }
location/java/android/location/SettingInjectorService.java +13 −10 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.location; import android.annotation.NonNull; import android.app.Service; import android.content.Context; import android.content.Intent; Loading Loading @@ -206,6 +207,8 @@ public abstract class SettingInjectorService extends Service { * Returns the {@link android.preference.Preference#getSummary()} value (allowed to be null or * empty). Should not perform unpredictably-long operations such as network access--see the * running-time comments in the class-level javadoc. * <p/> * This method is called on KitKat, and Q+ devices. * * @return the {@link android.preference.Preference#getSummary()} value */ Loading Loading @@ -234,7 +237,7 @@ public abstract class SettingInjectorService extends Service { /** * Sends a broadcast to refresh the injected settings on location settings page. */ public static final void refreshSettings(Context context) { public static final void refreshSettings(@NonNull Context context) { Intent intent = new Intent(ACTION_INJECTED_SETTING_CHANGED); context.sendBroadcast(intent); } Loading
media/java/android/media/ExifInterface.java +1 −1 Original line number Diff line number Diff line Loading @@ -1359,7 +1359,7 @@ public class ExifInterface { if (file == null) { throw new NullPointerException("file cannot be null"); } initForFilename(file.getName()); initForFilename(file.getAbsolutePath()); } /** Loading