New API in Windows Phone 8.1 Update 2

Windows Phone 8.1 Update 2 v 8.10.15127 finally arrived as the default OS version on new Microsoft Lumia 640 and 640 XL, and again, there is a new hidden API in it, so let’s take a look, if there is anything interesting that we, developers, can use in our apps.

tl;dr The API diff between WP8.1 Update 1 and WP8.1 Update 2 is here on GitHub. Only added/updated Windows.Phone.Notification.Management API – nothing we can use in our apps without special Accessory extension SDK, + new property in PhoneApplicationPage,

First let’s recap some info about the previous Update 1. Windows Phone 8.1 Update 1 v8.10.14147 arrived to the Preview for Developers program on August 4th, 2014 with handful of new end user features like Folders, Apps Corner, Improved Messaging, Alarms, VPN settings, etc. It also contains several new WinRT classes accessible via Accessory extension SDK + two new properties in the PhoneApplicationPage class. I’ve summarized all the new hidden API in my previous article here on my blog.

Most of the new API in the Update 1 was based on the type names related to Accessory Apps and notification on external devices. Unfortunately when you try to use it via reflection, you get UnauthorizedAccessException. Access to this API is currently only available to selected developers with Accessory Apps extension SDK.

What’s new in Windows Phone 8.1 Update 2 for users is summarized here on Windows Central. In short: new categorized settings menu, support for Bluetooth keyboards, configurable app permissions for accessing various sensors, and more.

Comparing emulator images, the old way

In my previous posts about new API available in Windows Phone 8 GDR3 and WP8.1 Update 1 I’ve used Framework Design Studio and NDepend tools + extracted libraries from emulator images. This approach for detecting new API worked, but I was not happy with it for several reasons:

Framework Design Studio was no longer supported and not even available for download from Microsoft pages. Even though I have an installer downloaded, I was not happy with it, because it crashed for lot of input libraries that I wanted to compare.

On the other hand NDepend is actively being developed, but it’s a payed product and for my purpose getting the diff of two versions of one library, it was a bit overkill.

Comparing emulator images, the new way

Since the previous approaches are not exactly flexible – no way to dump API when you have only access to device with a new version of the OS, not to .winmd files, I decided to write my own assembly comparer called ApiPeek that runs directly as a library in Windows Phone or Windows application, traverses through all available APIs using Reflection and dumps them as a zipped JSON file. Additionally I wrote a simple comparer that takes two dumps on input and produces diff in terms of added, removed and changed types on the output.

For comparison, Zipped dump of public Windows Phone 8.1 Update 1 API got 230 KB, and unpacked takes 3,6 MB.

More details about the ApiPeek project will be described in a separate article. It will be also publish it as Open Source once I add some comments and clean up the code a bit.

The new API in Update 2

In Windows Phone 8.1 Update 2 most of the changes are in the Windows.winmd library and all those changes are only additions and changes to the Windows.Phone.Notification.Management API, that was introduced in WP8.1 Update 1. And even though we still cannot access this API with reflection without special extension SDK, let’s take a look on those new types, what hints about new features they might contain.

All types below are from the Windows.Phone.Notification.Management namespace.

New members of the root AccessoryManager type:

  • void ClearToast(String instanceId)
  • void DecreaseVolume(Int32 step)
  • void DisableEmailNotificationEmailAccount(String emailAccount)
  • void EnableEmailNotificationEmailAccount(String emailAccount)
  • void EnableEmailNotificationFolderFilter(String emailAccount, IReadOnlyList<String> folders)
  • IReadOnlyList<EmailAccountInfo> GetAllEmailAccounts()
  • IReadOnlyList<EmailFolderInfo> GetFolders(String emailAccount)
  • void IncreaseVolume(Int32 step)
  • Boolean IsPhonePinLocked { get; }
  • void RingDevice()
  • void SetMute(Boolean mute)
  • void SetRingerVibrate(Boolean ringer, Boolean vibrate)
  • IReadOnlyList<SpeedDialEntry> SpeedDialList { get; }
  • void UpdateEmailReadStatus(BinaryId messageEntryId, Boolean isRead)
  • VolumeInfo VolumeInfo { get; }

New types:

  • class BinaryId
  • class CalendarChangedNotificationTriggerDetails
  • class EmailAccountInfo
  • class EmailFolderInfo
  • class EmailReadNotificationTriggerDetails
  • class SpeedDialEntry
  • class VolumeInfo
  • enum CalendarChangedEvent
  • enum VibrateState

Updated types:

  • enum AccessoryNotificationType – with new values CalendarChanged, EmailReadStatusChanged, ToastCleared, VolumeChanged
  • class PhoneLineDetails – with new property MissedCallCount
  • Beside changes in the Windows.Phone.Notification.Management namespace, there is also a single new property in the class Windows.ApplicationModel.Chat.ChatMessage -> string RemoteId { get; } No idea, what it is good for.

New Property in PhoneApplicationPage

The only other change is a new property in the class Microsoft.Phone.Controls.PhoneApplicationPage -> bool SuppressUnorientedBottomMargin { get; set; }

I’ve not yet tested the actual behavior of this new property, but the name should be quite self-explanatory.

The summary

Although there is a new hidden API in Windows Phone 8.1. Update 2, it cannot be used by regular developers, because it requires special permission to access the Windows.Phone.Notification.Management types. Based on the new methods and fields it now enables accessory devices to be notified about changes in calendar, volume settings, number of unread emails and also to use SpeedDial entries directly.