Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c897a393 authored by Pinyao Ting's avatar Pinyao Ting
Browse files

Deprecate bindRemoteViewsService

bindRemoteViewsService was a hidden API in AppWidgetManager that
only exists for RemoteViewsAdapter. With the conversion to push-based
model this method is no longer in use, this CL added the logic to
prevent potential abuse of a dead api.


Bug: 343439232
Change-Id: I3ec82be676179cd01e9448b14888ed211264ad7b
Test: manual
Flag: android.appwidget.flags.remote_adapter_conversion
parent 5f1c1da0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.appwidget;

import static android.appwidget.flags.Flags.remoteAdapterConversion;
import static android.appwidget.flags.Flags.removeAppWidgetServiceIoFromCriticalPath;
import static android.appwidget.flags.Flags.supportResumeRestoreAfterReboot;
import static android.content.Context.KEYGUARD_SERVICE;
@@ -1650,6 +1651,9 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
    public boolean bindRemoteViewsService(String callingPackage, int appWidgetId, Intent intent,
            IApplicationThread caller, IBinder activtiyToken, IServiceConnection connection,
            long flags) {
        if (remoteAdapterConversion()) {
            throw new UnsupportedOperationException("bindRemoteViewsService is deprecated");
        }
        final int userId = UserHandle.getCallingUserId();
        if (DEBUG) {
            Slog.i(TAG, "bindRemoteViewsService() " + userId);