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

Commit 1e385bf6 authored by Liana Kazanova's avatar Liana Kazanova Committed by Android (Google) Code Review
Browse files

Revert "[CDM][Refactoring 4/N] Move device presence logic out of..."

Revert submission 26686127-cdm-cleanup4-fix

Reason for revert: DroidMonitor: Potential culprit for b/331241826 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted

Reverted changes: /q/submissionid:26686127-cdm-cleanup4-fix

Change-Id: Ie83e3c48bf15c39b84251ac27ba927be2ccadd8f
parent e6c805e9
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1086,7 +1086,7 @@ public final class CompanionDeviceManager {
        }
        Objects.requireNonNull(deviceAddress, "address cannot be null");
        try {
            mService.legacyStartObservingDevicePresence(deviceAddress,
            mService.registerDevicePresenceListenerService(deviceAddress,
                    mContext.getOpPackageName(), mContext.getUserId());
        } catch (RemoteException e) {
            ExceptionUtils.propagateIfInstanceOf(e.getCause(), DeviceNotAssociatedException.class);
@@ -1128,7 +1128,7 @@ public final class CompanionDeviceManager {
        }
        Objects.requireNonNull(deviceAddress, "address cannot be null");
        try {
            mService.legacyStopObservingDevicePresence(deviceAddress,
            mService.unregisterDevicePresenceListenerService(deviceAddress,
                    mContext.getPackageName(), mContext.getUserId());
        } catch (RemoteException e) {
            ExceptionUtils.propagateIfInstanceOf(e.getCause(), DeviceNotAssociatedException.class);
@@ -1328,7 +1328,7 @@ public final class CompanionDeviceManager {
    @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_SELF_MANAGED)
    public void notifyDeviceAppeared(int associationId) {
        try {
            mService.notifySelfManagedDeviceAppeared(associationId);
            mService.notifyDeviceAppeared(associationId);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
@@ -1350,7 +1350,7 @@ public final class CompanionDeviceManager {
    @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_SELF_MANAGED)
    public void notifyDeviceDisappeared(int associationId) {
        try {
            mService.notifySelfManagedDeviceDisappeared(associationId);
            mService.notifyDeviceDisappeared(associationId);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
+12 −12
Original line number Diff line number Diff line
@@ -59,16 +59,12 @@ interface ICompanionDeviceManager {
        int userId);

    @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE")
    void legacyStartObservingDevicePresence(in String deviceAddress, in String callingPackage, int userId);

    @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE")
    void legacyStopObservingDevicePresence(in String deviceAddress, in String callingPackage, int userId);

    @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE")
    void startObservingDevicePresence(in ObservingDevicePresenceRequest request, in String packageName, int userId);
    void registerDevicePresenceListenerService(in String deviceAddress, in String callingPackage,
        int userId);

    @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE")
    void stopObservingDevicePresence(in ObservingDevicePresenceRequest request, in String packageName, int userId);
    void unregisterDevicePresenceListenerService(in String deviceAddress, in String callingPackage,
        int userId);

    boolean canPairWithoutPrompt(in String packageName, in String deviceMacAddress, int userId);

@@ -97,11 +93,9 @@ interface ICompanionDeviceManager {
    @EnforcePermission("USE_COMPANION_TRANSPORTS")
    void removeOnMessageReceivedListener(int messageType, IOnMessageReceivedListener listener);

    @EnforcePermission("REQUEST_COMPANION_SELF_MANAGED")
    void notifySelfManagedDeviceAppeared(int associationId);
    void notifyDeviceAppeared(int associationId);

    @EnforcePermission("REQUEST_COMPANION_SELF_MANAGED")
    void notifySelfManagedDeviceDisappeared(int associationId);
    void notifyDeviceDisappeared(int associationId);

    PendingIntent buildPermissionTransferUserConsentIntent(String callingPackage, int userId,
        int associationId);
@@ -141,4 +135,10 @@ interface ICompanionDeviceManager {
    byte[] getBackupPayload(int userId);

    void applyRestoredPayload(in byte[] payload, int userId);

    @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE")
    void startObservingDevicePresence(in ObservingDevicePresenceRequest request, in String packageName, int userId);

    @EnforcePermission("REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE")
    void stopObservingDevicePresence(in ObservingDevicePresenceRequest request, in String packageName, int userId);
}
+567 −0

File changed and moved.

Preview size limit exceeded, changes collapsed.

+500 −66

File changed.

Preview size limit exceeded, changes collapsed.

+1 −2
Original line number Diff line number Diff line
@@ -27,9 +27,8 @@ import java.util.Collection;
 * Companion Device Manager Local System Service Interface.
 */
public interface CompanionDeviceManagerServiceInternal {

    /**
     * Remove idle self-managed associations.
     * @see CompanionDeviceManagerService#removeInactiveSelfManagedAssociations
     */
    void removeInactiveSelfManagedAssociations();

Loading