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

Commit 92a8d485 authored by Hui Yu's avatar Hui Yu
Browse files

AppWidget changes after bindService flags extended to 64 bits.

Bug: 191785864
Test: atest cts/tests/app/src/android/app/cts/ServiceTest.java#testBindServiceFlags
atest cts/tests/app/src/android/app/cts/ServiceTest.java
atest cts/tests/app/src/android/app/cts/ActivityManagerProcessStateTest.java
atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java

Change-Id: I92e0479b39ca0926b506304ea48453ea4247699f
parent 3d1d6c8c
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1174,18 +1174,19 @@ public class AppWidgetManager {
     *                     {@link Context#BIND_AUTO_CREATE} and
     *                     {@link Context#BIND_FOREGROUND_SERVICE_WHILE_AWAKE} are supported.
     *
     * @see Context#getServiceDispatcher(ServiceConnection, Handler, int)
     * @see Context#getServiceDispatcher(ServiceConnection, Handler, long)
     * @hide
     */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    public boolean bindRemoteViewsService(Context context, int appWidgetId, Intent intent,
            IServiceConnection connection, @Context.BindServiceFlags int flags) {
            IServiceConnection connection, @Context.BindServiceFlagsBits int flags) {
        if (mService == null) {
            return false;
        }
        try {
            return mService.bindRemoteViewsService(context.getOpPackageName(), appWidgetId, intent,
                    context.getIApplicationThread(), context.getActivityToken(), connection, flags);
                    context.getIApplicationThread(), context.getActivityToken(), connection,
                    Integer.toUnsignedLong(flags));
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ interface IAppWidgetService {
            int providerProfileId, in ComponentName providerComponent, in Bundle options);
    @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
    boolean bindRemoteViewsService(String callingPackage, int appWidgetId, in Intent intent,
            IApplicationThread caller, IBinder token, IServiceConnection connection, int flags);
            IApplicationThread caller, IBinder token, IServiceConnection connection, long flags);
    void notifyProviderInheritance(in ComponentName[] componentNames);

    @UnsupportedAppUsage
+1 −1
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ public class RemoteViewsAdapterTest {

        @Override
        public IServiceConnection getServiceDispatcher(
                ServiceConnection conn, Handler handler, int flags) {
                ServiceConnection conn, Handler handler, long flags) {
            this.conn.set(conn);
            this.handler.set(handler);
            boundCount++;
+1 −1
Original line number Diff line number Diff line
@@ -1212,7 +1212,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
    @Override
    public boolean bindRemoteViewsService(String callingPackage, int appWidgetId, Intent intent,
            IApplicationThread caller, IBinder activtiyToken, IServiceConnection connection,
            int flags) {
            long flags) {
        final int userId = UserHandle.getCallingUserId();
        if (DEBUG) {
            Slog.i(TAG, "bindRemoteViewsService() " + userId);