SlideShare a Scribd company logo
Cyanogen Inc. Proprietary & Confidential
Platform SDK
by Adnan Begovic
Cyanogen Inc. Proprietary & Confidential
Background
What is CyanogenMod?
CyanogenMod (pronounced /saɪ.ˈæn.oʊ.ˌdʒɛn.mɒd/),
usually abbreviated to CM, is an open-source operating
system for smartphones and tablet computers, based on
the Android mobile platform. It is developed as free and
open source software based on the official releases of
Android by Google, with added original and third-party
code. It is based on a rolling release development model.
Cyanogen Inc. Proprietary & Confidential
Background
CyanogenMod User Base:
● 50+ million users
● Users in 190+ different countries
● Localized to 50+ languages via automated crowdin
system
Cyanogen Inc. Proprietary & Confidential
Background
CyanogenMod Developer base:
● Numerous active core developers/maintainers
○ Maintain devices
○ Maintain documentation for features and device specs
○ Maintain and manage their own user bases
○ Maintain crowdin
○ File and resolve bugs reported by community users
● ~163 devices supported
● Receive a substantial amount of OSS contributions
from outside sources.
Cyanogen Inc. Proprietary & Confidential
Developer Base
Cyanogen Inc. Proprietary & Confidential
Crowdsourcing Android Development
Cyanogen Inc. Proprietary & Confidential
An Example Community Contribution
Cyanogen Inc. Proprietary & Confidential
Topics
● OS development is intimidating
● Treehacks Hackathon learnings
● Cyanogen Platform
○ Infrastructure
○ Framework library
○ SDK
○ Resource Package
● Using the SDK (QST examples)
● Contributing API’s
Cyanogen Inc. Proprietary & Confidential
Contributing to an OS
The Treehacks experience
Treehacks:
● 500+ person hackathon with students from all over the country.
● Workshops to get a meaningful contribution to the OSS project
CyanogenMod.
● Open to Stanford students, external students, and outside developers.
Cyanogen Inc. Proprietary & Confidential
Treehacks Experience
Winning Project: CyanTranslate
Using CyanogenMod, the winners modified the Android operating system and
created several new built-in features for manipulating text. By highlighting text
and hitting a button, the user can take advantage of these features. The new
features include:
Automatic translation between languages
● One-tap Google search
● UrbanDictionary definition lookup
● Book information lookup
Cyanogen Inc. Proprietary & Confidential
Treehacks Experience
Cyanogen Inc. Proprietary & Confidential
Treehacks Feedback
Positives Negatives
Open platform High ramp up time
Good infrastructure
● Gerrit Code Review
● Github mirroring
Massive code base
● ~1281 github repos
● 100+ android packages
● 25+ Gb repo size
Build environment documentation
● https://wiki.cyanogenmod.org
High barrier of entry in understanding
Android’s core implementations
Cyanogen Inc. Proprietary & Confidential
Treehacks Experience
- How to decrease the barrier to entry?
- How to extend the CM experience for 3rd party
developers?
Cyanogen Inc. Proprietary & Confidential
The Cyanogen Platform
Cyanogen Inc. Proprietary & Confidential
Cyanogen Platform
The new, more approachable, infrastructure:
● CyanogenMod Platform Library
● CyanogenMod Resource Package
● CyanogenMod Platform SDK
Application
Cyanogen
Platform SDK
Platform API
Core
Resource
Package
Android OS
Cyanogen Inc. Proprietary & Confidential
Cyanogen Platform Library
Framework library similar to Android’s Framework
JAR.
● Contains System Binder Services that get spun up and managed by
Android’s SystemServer.
● Contains the implementation, state management, and persisting of
data for a specific API feature.
● Leveraging Android’s powerful IPC framework for interaction between
an application and the system process.
Further information: Understanding the Structure
Cyanogen Inc. Proprietary & Confidential
Cyanogen Resource Package
Contains exported resources and CyanogenMod specific
permissions to be leveraged by the Application and
framework.
● ex:
○ cyanogenmod.permission.PUBLISH_CUSTOM_TILE
○ cyanogenmod_system_label
Cyanogen Inc. Proprietary & Confidential
Cyanogen Platform SDK
A library that can be included in your application to interact
with CM specific binder services to gain extra functionality.
● Provides objects, object builder’s, helper methods, and simple
interfaces to push or receive data from the platform library.
Cyanogen Inc. Proprietary & Confidential
Using the SDK
Custom Quick Tiles API Example:
● Allows your application to publish a Quick Tile to be hosted in the QS
Panel.
○ Patterns similar to Notification and NotificationManager
Cyanogen Inc. Proprietary & Confidential
Exploration for an API
Bike O’Clock
● Using Quick Settings Tiles to surface commonly
used actions.
Cyanogen Inc. Proprietary & Confidential
Bike O’Clock
Cyanogen Inc. Proprietary & Confidential
Using the SDK
Creating a CustomTile:
CustomTile customTile = new CustomTile.Builder(mContext)
.setLabel("custom label")
.setContentDescription("custom description")
.setOnClickIntent(pendingIntent)
.setOnSettingsClickIntent(intent)
.setOnClickUri(Uri.parse("custom uri"))
.setIcon(R.drawable.ic_launcher)
.build();
Cyanogen Inc. Proprietary & Confidential
Using the SDK
Cyanogen Inc. Proprietary & Confidential
Using the SDK
Publishing:
CMStatusBarManager.getInstance(this)
.publishTile(CUSTOM_TILE_ID, mCustomTile);
Removing:
CMStatusBarManager.getInstance(this)
.removeTile(CUSTOM_TILE_ID, mCustomTile);
Requires:
<uses-permission android:name="cyanogenmod.permission.PUBLISH_CUSTOM_TILE" />
Cyanogen Inc. Proprietary & Confidential
Contributing
Cyanogen Inc. Proprietary & Confidential
Making a change
repo init -u git://github.com/CyanogenMod/android.git -b cm-12.1
repo sync
repo start changes vendor/cmsdk
https://www.github.com/CyanogenMod/cm_platform_sdk
Cyanogen Inc. Proprietary & Confidential
Contributing
Application
Cyanogen
Platform SDK
Platform API
Core
Community
API Core
gerrit (code review, unit tests)
Interface Changes
Unit Tests
SDK Methods
CTS
SDK methods
added to Platform
SDK project
API added along
side core
Interfaces added to
nightly builds
API Council (Change Control Board)
API Check-API
Android OS
Cyanogen Inc. Proprietary & Confidential
Contributing
Documentation generation is automated!
● make org.cyanogenmod.platform.sdk-docs
● Published directly from gerrit merge to github pages
Docs: http://cyanogenmod.github.io/cm_platform_sdk/reference/packages.html
Cyanogen Inc. Proprietary & Confidential
Contribute New APIs & Write More Functional Apps
Cyanogen Inc. Proprietary & Confidential
Questions?
Join the G+ Community: http://bit.ly/1FC6lJI
Cyanogen Inc. Proprietary & Confidential
Appendix for QA
Cyanogen Inc. Proprietary & Confidential
Security
vendor/cm/overlay
<!-- Defines external services to be started by the SystemServer at boot. The service itself
should publish as a binder services in its onStart -->
<string-array name="config_externalCMServices">
<item>org.cyanogenmod.platform.internal.CMStatusBarManagerService</item>
</string-array>
vendor/cm/sepolicy/servicecontexts
cmstatusbar u:object_r:system_server_service:s0
Cyanogen Inc. Proprietary & Confidential
Security
Selinux service_contexts
● service_contexts is used for translating service names into selinux labels.
● MAC check to the svc_can_register function in
service_manager.
https://android.googlesource.com/platform/frameworks/native/+/69154df

More Related Content

PPTX
PPTX
Open-source Android 10 on Orange Pi: myth or reality?
PDF
Hacking with x86 Windows Tablet and mobile devices on Debian #debconf18
PDF
[Td 2015]조막만한 화면에서 대박만한 화면까지. 고생 끝 적응(adaptive ui) 시작(권영철)
PDF
Beginner for install Linux and *BSD in the inexpensive ARM and Intel based mo...
PDF
Android Treble: Blessing or Trouble?
PDF
Is Android the New Embedded Linux? at AnDevCon VI
Open-source Android 10 on Orange Pi: myth or reality?
Hacking with x86 Windows Tablet and mobile devices on Debian #debconf18
[Td 2015]조막만한 화면에서 대박만한 화면까지. 고생 끝 적응(adaptive ui) 시작(권영철)
Beginner for install Linux and *BSD in the inexpensive ARM and Intel based mo...
Android Treble: Blessing or Trouble?
Is Android the New Embedded Linux? at AnDevCon VI

What's hot (16)

PDF
Android Things Internals
ODP
What to do after Rooting ?
PDF
Android Things Internals
PDF
Android OTA updates
PDF
Android Things: Android for IoT
PDF
Android Things Latest News / Aug 25, 2017
PDF
Brillo / Weave Internals
PPTX
Android Things, Alexey Rybakov, Technical Evangelist, DataArt
PDF
Hacking the third Smartphone OS and Some Mobile device in #COSCUP 2019  第三款智能...
PDF
Brillo / Weave Internals
PDF
Basics of the Google Glass programming
PDF
Optimized Android N MR1 + 4.4 Kernel
PDF
Android things intro
PDF
Koubei banquet 31
PDF
BUD17-DF15 - Optimized Android N MR1 + 4.9 Kernel
Android Things Internals
What to do after Rooting ?
Android Things Internals
Android OTA updates
Android Things: Android for IoT
Android Things Latest News / Aug 25, 2017
Brillo / Weave Internals
Android Things, Alexey Rybakov, Technical Evangelist, DataArt
Hacking the third Smartphone OS and Some Mobile device in #COSCUP 2019  第三款智能...
Brillo / Weave Internals
Basics of the Google Glass programming
Optimized Android N MR1 + 4.4 Kernel
Android things intro
Koubei banquet 31
BUD17-DF15 - Optimized Android N MR1 + 4.9 Kernel
Ad

Similar to Cyanogen Platform SDK (20)

PPTX
Working of Cyanogen mod
PDF
Platform SDK Update
PDF
Security Issues in Android Custom Rom
PDF
Security Issues in Android Custom ROM
PDF
Continues Integration for Android
PPTX
Fast-paced Introduction to Android Internals
PDF
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon IV, 2012)
PDF
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
PDF
Android on Intel Architecture: ROM Cooking Tutorial
PDF
An Introduction To Android
PPTX
Android setup
PDF
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
PDF
Quickstart: Qt for Windows, Symbian and Maemo / Meego v2.0.8 (January 10th, 2...
PDF
Froyo to kit kat two years developing & maintaining deliradio
PPTX
Intro to Android for the iOS Fan
PPTX
Custom rom
PPT
Google android os
PDF
Android Development: The 20,000-Foot View
PPTX
Android™ application development
PDF
Droidcon uk2012 androvm
Working of Cyanogen mod
Platform SDK Update
Security Issues in Android Custom Rom
Security Issues in Android Custom ROM
Continues Integration for Android
Fast-paced Introduction to Android Internals
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon IV, 2012)
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Android on Intel Architecture: ROM Cooking Tutorial
An Introduction To Android
Android setup
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Quickstart: Qt for Windows, Symbian and Maemo / Meego v2.0.8 (January 10th, 2...
Froyo to kit kat two years developing & maintaining deliradio
Intro to Android for the iOS Fan
Custom rom
Google android os
Android Development: The 20,000-Foot View
Android™ application development
Droidcon uk2012 androvm
Ad

Recently uploaded (20)

PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PDF
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Nekopoi APK 2025 free lastest update
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PPTX
Patient Appointment Booking in Odoo with online payment
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PPTX
Transform Your Business with a Software ERP System
Autodesk AutoCAD Crack Free Download 2025
17 Powerful Integrations Your Next-Gen MLM Software Needs
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Wondershare Filmora 15 Crack With Activation Key [2025
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Nekopoi APK 2025 free lastest update
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
How to Choose the Right IT Partner for Your Business in Malaysia
CHAPTER 2 - PM Management and IT Context
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Patient Appointment Booking in Odoo with online payment
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
Design an Analysis of Algorithms I-SECS-1021-03
Why Generative AI is the Future of Content, Code & Creativity?
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
Transform Your Business with a Software ERP System

Cyanogen Platform SDK

  • 1. Cyanogen Inc. Proprietary & Confidential Platform SDK by Adnan Begovic
  • 2. Cyanogen Inc. Proprietary & Confidential Background What is CyanogenMod? CyanogenMod (pronounced /saɪ.ˈæn.oʊ.ˌdʒɛn.mɒd/), usually abbreviated to CM, is an open-source operating system for smartphones and tablet computers, based on the Android mobile platform. It is developed as free and open source software based on the official releases of Android by Google, with added original and third-party code. It is based on a rolling release development model.
  • 3. Cyanogen Inc. Proprietary & Confidential Background CyanogenMod User Base: ● 50+ million users ● Users in 190+ different countries ● Localized to 50+ languages via automated crowdin system
  • 4. Cyanogen Inc. Proprietary & Confidential Background CyanogenMod Developer base: ● Numerous active core developers/maintainers ○ Maintain devices ○ Maintain documentation for features and device specs ○ Maintain and manage their own user bases ○ Maintain crowdin ○ File and resolve bugs reported by community users ● ~163 devices supported ● Receive a substantial amount of OSS contributions from outside sources.
  • 5. Cyanogen Inc. Proprietary & Confidential Developer Base
  • 6. Cyanogen Inc. Proprietary & Confidential Crowdsourcing Android Development
  • 7. Cyanogen Inc. Proprietary & Confidential An Example Community Contribution
  • 8. Cyanogen Inc. Proprietary & Confidential Topics ● OS development is intimidating ● Treehacks Hackathon learnings ● Cyanogen Platform ○ Infrastructure ○ Framework library ○ SDK ○ Resource Package ● Using the SDK (QST examples) ● Contributing API’s
  • 9. Cyanogen Inc. Proprietary & Confidential Contributing to an OS The Treehacks experience Treehacks: ● 500+ person hackathon with students from all over the country. ● Workshops to get a meaningful contribution to the OSS project CyanogenMod. ● Open to Stanford students, external students, and outside developers.
  • 10. Cyanogen Inc. Proprietary & Confidential Treehacks Experience Winning Project: CyanTranslate Using CyanogenMod, the winners modified the Android operating system and created several new built-in features for manipulating text. By highlighting text and hitting a button, the user can take advantage of these features. The new features include: Automatic translation between languages ● One-tap Google search ● UrbanDictionary definition lookup ● Book information lookup
  • 11. Cyanogen Inc. Proprietary & Confidential Treehacks Experience
  • 12. Cyanogen Inc. Proprietary & Confidential Treehacks Feedback Positives Negatives Open platform High ramp up time Good infrastructure ● Gerrit Code Review ● Github mirroring Massive code base ● ~1281 github repos ● 100+ android packages ● 25+ Gb repo size Build environment documentation ● https://wiki.cyanogenmod.org High barrier of entry in understanding Android’s core implementations
  • 13. Cyanogen Inc. Proprietary & Confidential Treehacks Experience - How to decrease the barrier to entry? - How to extend the CM experience for 3rd party developers?
  • 14. Cyanogen Inc. Proprietary & Confidential The Cyanogen Platform
  • 15. Cyanogen Inc. Proprietary & Confidential Cyanogen Platform The new, more approachable, infrastructure: ● CyanogenMod Platform Library ● CyanogenMod Resource Package ● CyanogenMod Platform SDK Application Cyanogen Platform SDK Platform API Core Resource Package Android OS
  • 16. Cyanogen Inc. Proprietary & Confidential Cyanogen Platform Library Framework library similar to Android’s Framework JAR. ● Contains System Binder Services that get spun up and managed by Android’s SystemServer. ● Contains the implementation, state management, and persisting of data for a specific API feature. ● Leveraging Android’s powerful IPC framework for interaction between an application and the system process. Further information: Understanding the Structure
  • 17. Cyanogen Inc. Proprietary & Confidential Cyanogen Resource Package Contains exported resources and CyanogenMod specific permissions to be leveraged by the Application and framework. ● ex: ○ cyanogenmod.permission.PUBLISH_CUSTOM_TILE ○ cyanogenmod_system_label
  • 18. Cyanogen Inc. Proprietary & Confidential Cyanogen Platform SDK A library that can be included in your application to interact with CM specific binder services to gain extra functionality. ● Provides objects, object builder’s, helper methods, and simple interfaces to push or receive data from the platform library.
  • 19. Cyanogen Inc. Proprietary & Confidential Using the SDK Custom Quick Tiles API Example: ● Allows your application to publish a Quick Tile to be hosted in the QS Panel. ○ Patterns similar to Notification and NotificationManager
  • 20. Cyanogen Inc. Proprietary & Confidential Exploration for an API Bike O’Clock ● Using Quick Settings Tiles to surface commonly used actions.
  • 21. Cyanogen Inc. Proprietary & Confidential Bike O’Clock
  • 22. Cyanogen Inc. Proprietary & Confidential Using the SDK Creating a CustomTile: CustomTile customTile = new CustomTile.Builder(mContext) .setLabel("custom label") .setContentDescription("custom description") .setOnClickIntent(pendingIntent) .setOnSettingsClickIntent(intent) .setOnClickUri(Uri.parse("custom uri")) .setIcon(R.drawable.ic_launcher) .build();
  • 23. Cyanogen Inc. Proprietary & Confidential Using the SDK
  • 24. Cyanogen Inc. Proprietary & Confidential Using the SDK Publishing: CMStatusBarManager.getInstance(this) .publishTile(CUSTOM_TILE_ID, mCustomTile); Removing: CMStatusBarManager.getInstance(this) .removeTile(CUSTOM_TILE_ID, mCustomTile); Requires: <uses-permission android:name="cyanogenmod.permission.PUBLISH_CUSTOM_TILE" />
  • 25. Cyanogen Inc. Proprietary & Confidential Contributing
  • 26. Cyanogen Inc. Proprietary & Confidential Making a change repo init -u git://github.com/CyanogenMod/android.git -b cm-12.1 repo sync repo start changes vendor/cmsdk https://www.github.com/CyanogenMod/cm_platform_sdk
  • 27. Cyanogen Inc. Proprietary & Confidential Contributing Application Cyanogen Platform SDK Platform API Core Community API Core gerrit (code review, unit tests) Interface Changes Unit Tests SDK Methods CTS SDK methods added to Platform SDK project API added along side core Interfaces added to nightly builds API Council (Change Control Board) API Check-API Android OS
  • 28. Cyanogen Inc. Proprietary & Confidential Contributing Documentation generation is automated! ● make org.cyanogenmod.platform.sdk-docs ● Published directly from gerrit merge to github pages Docs: http://cyanogenmod.github.io/cm_platform_sdk/reference/packages.html
  • 29. Cyanogen Inc. Proprietary & Confidential Contribute New APIs & Write More Functional Apps
  • 30. Cyanogen Inc. Proprietary & Confidential Questions? Join the G+ Community: http://bit.ly/1FC6lJI
  • 31. Cyanogen Inc. Proprietary & Confidential Appendix for QA
  • 32. Cyanogen Inc. Proprietary & Confidential Security vendor/cm/overlay <!-- Defines external services to be started by the SystemServer at boot. The service itself should publish as a binder services in its onStart --> <string-array name="config_externalCMServices"> <item>org.cyanogenmod.platform.internal.CMStatusBarManagerService</item> </string-array> vendor/cm/sepolicy/servicecontexts cmstatusbar u:object_r:system_server_service:s0
  • 33. Cyanogen Inc. Proprietary & Confidential Security Selinux service_contexts ● service_contexts is used for translating service names into selinux labels. ● MAC check to the svc_can_register function in service_manager. https://android.googlesource.com/platform/frameworks/native/+/69154df