Skip to content

Commit

Permalink
[main] Fix selectors from submission tests (#16042)
Browse files Browse the repository at this point in the history
These selectors failed the most recent submission test:

```
UIFocusDebugger
  checkFocusGroupTreeForEnvironment:

HMMatterRequestHandler
  configureAccessoryWithName:room:completion:
  fetchRoomsInHome:completion:
  pairAccessoryInHome:onboardingPayload:completion:
HMMatterTopology
  initWithHomes:
HMMatterHome/HMMatterRoom
  initWithUUID:name:
HMAccessorySetupManager
  performMatterEcosystemAccessorySetupUsingRequest:topology:completionHandler:

ChipDeviceController
  pairDevice:address:port:discriminator:setupPINCode:error:
  setListenPort:
  sharedController
ChipLowPower
  sleep:
ChipTestCluster
  test:
  toggle:
ChipGeneralCommissioning
  commissioningComplete:
```

Passed API diff locally.

Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
  • Loading branch information
chamons and rolfbjarne authored Sep 27, 2022
1 parent 823c5ba commit 8a07db6
Show file tree
Hide file tree
Showing 10 changed files with 466 additions and 466 deletions.
353 changes: 353 additions & 0 deletions src/Chip/ChipCompat.cs

Large diffs are not rendered by default.

113 changes: 70 additions & 43 deletions src/HomeKit/HMCompat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@
//

using System;
using System.ComponentModel;
using System.Threading.Tasks;
using Foundation;
using CoreFoundation;
using ObjCRuntime;

#if !NET
using NativeHandle = System.IntPtr;
#endif

#nullable enable
namespace HomeKit {

#if !NET
[Obsolete ("Use 'HMFetchRoomHandler' instead.")]
public delegate void FetchRoomHandler (NSArray<HMChipServiceRoom> rooms, NSError error);

Expand All @@ -26,84 +31,106 @@ namespace HomeKit {
[Register ("HMCHIPServiceRequestHandler", SkipRegistration = true)]
public class HMChipServiceRequestHandler : NSObject, INSExtensionRequestHandling {

public override IntPtr ClassHandle => throw new InvalidOperationException ();
public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

public HMChipServiceRequestHandler () => throw new InvalidOperationException ();
protected HMChipServiceRequestHandler (NSObjectFlag t) => throw new InvalidOperationException ();
protected HMChipServiceRequestHandler (IntPtr handle) => throw new InvalidOperationException ();
public HMChipServiceRequestHandler () => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
protected HMChipServiceRequestHandler (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
protected HMChipServiceRequestHandler (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

public virtual void BeginRequestWithExtensionContext (NSExtensionContext context) => throw new InvalidOperationException ();
public virtual void ConfigureAccessory (string accessoryName, HMChipServiceRoom accessoryRoom, Action<NSError> completion) => throw new InvalidOperationException ();
public virtual Task ConfigureAccessoryAsync (string accessoryName, HMChipServiceRoom accessoryRoom) => throw new InvalidOperationException ();
public virtual void FetchRooms (HMChipServiceHome home, FetchRoomHandler completion) => throw new InvalidOperationException ();
public virtual Task<NSArray<HMChipServiceRoom>> FetchRoomsAsync (HMChipServiceHome home) => throw new InvalidOperationException ();
public virtual void PairAccessory (HMChipServiceHome home, string onboardingPayload, Action<NSError> completion) => throw new InvalidOperationException ();
public virtual Task PairAccessoryAsync (HMChipServiceHome home, string onboardingPayload) => throw new InvalidOperationException ();
public virtual void BeginRequestWithExtensionContext (NSExtensionContext context) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void ConfigureAccessory (string accessoryName, HMChipServiceRoom accessoryRoom, Action<NSError> completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual Task ConfigureAccessoryAsync (string accessoryName, HMChipServiceRoom accessoryRoom) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void FetchRooms (HMChipServiceHome home, FetchRoomHandler completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual Task<NSArray<HMChipServiceRoom>> FetchRoomsAsync (HMChipServiceHome home) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void PairAccessory (HMChipServiceHome home, string onboardingPayload, Action<NSError> completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual Task PairAccessoryAsync (HMChipServiceHome home, string onboardingPayload) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

} /* class HMChipServiceRequestHandler */

[Obsolete ("This class is removed, use 'HMMatterTopology' instead.")]
[Register ("HMCHIPServiceTopology", SkipRegistration = true)]
public class HMChipServiceTopology : NSObject, INSCoding, INSCopying, INSSecureCoding {

public override IntPtr ClassHandle => throw new InvalidOperationException ();
public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

protected HMChipServiceTopology (IntPtr handle) => throw new InvalidOperationException ();
public HMChipServiceTopology (NSCoder coder) => throw new InvalidOperationException ();
protected HMChipServiceTopology (NSObjectFlag t) => throw new InvalidOperationException ();
public HMChipServiceTopology (HMChipServiceHome[] homes) => throw new InvalidOperationException ();
protected HMChipServiceTopology (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public HMChipServiceTopology (NSCoder coder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
protected HMChipServiceTopology (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public HMChipServiceTopology (HMChipServiceHome[] homes) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException ();
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException ();
public virtual HMChipServiceHome[] Homes => throw new InvalidOperationException ();
public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual HMChipServiceHome[] Homes => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

} /* class HMChipServiceTopology */

[Obsolete ("This class is removed, use 'HMMatterRoom' instead.")]
[Register("HMCHIPServiceRoom", SkipRegistration = true)]
public class HMChipServiceRoom : NSObject, INSCoding, INSCopying, INSSecureCoding {

public override IntPtr ClassHandle => throw new InvalidOperationException ();
public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

protected HMChipServiceRoom (IntPtr handle) => throw new InvalidOperationException ();
public HMChipServiceRoom (NSCoder coder) => throw new InvalidOperationException ();
protected HMChipServiceRoom (NSObjectFlag t) => throw new InvalidOperationException ();
public HMChipServiceRoom (NSUuid uuid, string name) => throw new InvalidOperationException ();
protected HMChipServiceRoom (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public HMChipServiceRoom (NSCoder coder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
protected HMChipServiceRoom (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public HMChipServiceRoom (NSUuid uuid, string name) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

public virtual NSObject Copy (NSZone? zone)=> throw new InvalidOperationException ();
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException ();
public virtual string Name => throw new InvalidOperationException ();
public virtual NSUuid Uuid => throw new InvalidOperationException ();
public virtual NSObject Copy (NSZone? zone)=> throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual string Name => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual NSUuid Uuid => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

} /* class HMChipServiceRoom */

[Obsolete ("This class is removed, use 'HMMatterHome' instead.")]
[Register("HMCHIPServiceHome", SkipRegistration = true)]
public partial class HMChipServiceHome : NSObject, INSCoding, INSCopying, INSSecureCoding {

public override IntPtr ClassHandle => throw new InvalidOperationException ();
public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

protected HMChipServiceHome (IntPtr handle) => throw new InvalidOperationException ();
public HMChipServiceHome (NSCoder coder) => throw new InvalidOperationException ();
protected HMChipServiceHome (NSObjectFlag t) => throw new InvalidOperationException ();
protected HMChipServiceHome (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public HMChipServiceHome (NSCoder coder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
protected HMChipServiceHome (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

public HMChipServiceHome (NSUuid uuid, string name) => throw new InvalidOperationException ();
public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException ();
public HMChipServiceHome (NSUuid uuid, string name) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException ();
public virtual string Name => throw new InvalidOperationException ();
public virtual NSUuid Uuid => throw new InvalidOperationException ();
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual string Name => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual NSUuid Uuid => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

} /* class HMChipServiceHome */

[Obsolete ("This class is removed.")]
public partial class HMAccessorySetupManager {

#pragma warning disable CS0618 // HMChipServiceTopology and HMErrorHandler is obsolete
public virtual void AddAndSetUpAccessories (HMChipServiceTopology topology, HMErrorHandler completion) => throw new InvalidOperationException ();
public virtual Task AddAndSetUpAccessoriesAsync (HMChipServiceTopology topology) => throw new InvalidOperationException ();
public virtual void AddAndSetUpAccessories (HMChipServiceTopology topology, HMErrorHandler completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual Task AddAndSetUpAccessoriesAsync (HMChipServiceTopology topology) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
#pragma warning restore CS0618 // HMChipServiceTopology and HMErrorHandler is obsolete
}
#endif // !NET

} /* class HMAccessorySetupManager */

#if !XAMCORE_5_0
#if __IOS__ && !__MACCATALYST__
#if NET
[EditorBrowsable (EditorBrowsableState.Never)]
[Obsolete ("This class is removed.")]
#endif
public unsafe partial class HMAccessorySetupManager : NSObject {
public override NativeHandle ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

public HMAccessorySetupManager () : base (NSObjectFlag.Empty) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
protected HMAccessorySetupManager (NSObjectFlag t) : base (t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
protected internal HMAccessorySetupManager (NativeHandle handle) : base (handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

public virtual void AddAndSetUpAccessories (HMMatterTopology topology, Action<NSError> completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual Task AddAndSetUpAccessoriesAsync (HMMatterTopology topology) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void PerformAccessorySetup (HMAccessorySetupRequest request, Action<HMAccessorySetupResult, NSError> completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual Task<HMAccessorySetupResult> PerformAccessorySetupAsync (HMAccessorySetupRequest request) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void PerformMatterEcosystemAccessorySetup (HMAccessorySetupRequest request, HMMatterTopology topology, Action<NSError> completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual Task PerformMatterEcosystemAccessorySetupAsync (HMAccessorySetupRequest request, HMMatterTopology topology) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
}
#endif
#endif
}
#endif // !NET
3 changes: 3 additions & 0 deletions src/ObjCRuntime/ObsoleteConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ partial class Constants {
internal const string RemovedFromChip = "This API has been removed from the 'CHIP' framework.";

internal const string BrokenBinding = "This API was incorrectly bound and does not work correctly. Use the new version indicated in the associated Obsolete attribute.";

internal const string RemovedFromHomeKit = "This API has been removed from the 'HomeKit' framework.";

internal const string ApiRemovedGeneral = "This API has been removed from the framework.";
}
}
Loading

5 comments on commit 8a07db6

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.