Skip to content

[Android] Support for PhoneCallHistory - #2575

Merged
MartinZikmund merged 21 commits into
unoplatform:masterfrom
pkar70:CallLog
Sep 20, 2022
Merged

MartinZikmund merged 21 commits into
unoplatform:masterfrom
pkar70:CallLog

Conversation

@pkar70

@pkar70 pkar70 commented Feb 1, 2020 •

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): unoplatform/uno-private#1439

PR Type

What kind of change does this PR introduce?

  • Feature

What is the current behavior?

No PhoneCallHistory support

What is the new behavior?

Support on Android plaftorm.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Docs have been added/updated which fit documentation template (for bug fixes / features)
  • Unit Tests and/or UI Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Wasm UI Tests are not showing unexpected any differences. Validate PR Screenshots Compare Test Run results.
  • Contains NO breaking changes
  • Updated the Release Notes
  • Associated with an issue (GitHub or internal)

Other information

Enums are defined for every platform, code is for Android only. As far as I know (from Internet digging), support for iOS would never happen, as it is impossible to access 'calllog' on iOS platform.
Part of my app CallsStat, published on Amazon.

Internal Issue (If applicable):

Part of my app https://github.com/pkar70/CallStat

@gitpod-io

gitpod-io Bot commented Feb 1, 2020 •

Copy link
Copy Markdown

Comment thread doc/ReleaseNotes/_ReleaseNotes.md Resolved
Comment thread src/Uno.UWP/Uno.csproj Resolved

@jeromelaban jeromelaban left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please a UI test sample (no need to automate it)

@pkar70

pkar70 commented Mar 4, 2020

Copy link
Copy Markdown
Contributor Author

What test should do?
Besides, I tried to create one UI non-automatic test for CalendarDatePicker, failed (for reason uknown to me), and PR for CDP was marked as 'help needed'.
I know how to create automatic test, and such tests were included in many my Uno PR.

@jeromelaban jeromelaban left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR, can you a a set of samples to demonstrate the APIs you've implemented ?

@CLAassistant

CLAassistant commented Jun 10, 2020 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@pkar70
pkar70 requested a review from a team August 7, 2020 22:11
@pkar70 pkar70 mentioned this pull request Sep 26, 2020
2 of 6 tasks
@pkar70
pkar70 force-pushed the CallLog branch 2 times, most recently from a2b4d5a to 5c8341e Compare September 29, 2020 13:51
@pkar70

pkar70 commented Oct 9, 2020

Copy link
Copy Markdown
Contributor Author

Can build be restarted? "Publishing build artifacts failed with an error: Not found PathtoPublish" not related to changes in this PR.

@jeromelaban

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pkar70

pkar70 commented Oct 19, 2020

Copy link
Copy Markdown
Contributor Author

Can build be restarted? "Publishing build artifacts failed with an error: Not found PathtoPublish" not related to changes in this PR.

@pkar70

pkar70 commented Oct 26, 2020

Copy link
Copy Markdown
Contributor Author

"Removed method System.Void Windows.UI.Input.DraggingEventArgs..ctor() not found in ignore set.
Removed method System.Void Windows.Storage.FileIO..ctor() not found in ignore set." - errors not related to this PR. Can build be restarted?

@MartinZikmund

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pkar70

pkar70 commented Nov 13, 2020 •

Copy link
Copy Markdown
Contributor Author

Can I get any review of this PR? Build success...

@pkar70

pkar70 commented Nov 21, 2020

Copy link
Copy Markdown
Contributor Author

This functionality would never be supported for iOS, as it is impossible to access 'calllog' on iOS platform. But, can this functionality be added to Uno for Android platform, i.e. could this PR be reviewed/accepted/merged?

@jeromelaban jeromelaban left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a sample in the sample app that shows the results of the invocations for the APIs you implemented.

@gitpod-io

gitpod-io Bot commented Apr 5, 2022

Copy link
Copy Markdown

@jeromelaban jeromelaban left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few additional comments. We still need a sample in the samples app to validate the behavior.

@jeromelaban
jeromelaban marked this pull request as draft April 5, 2022 13:21
@pkar70

pkar70 commented Apr 5, 2022 •

Copy link
Copy Markdown
Contributor Author

About sample...
Reading PhoneCallHistory is relevant only on Phones, and only after at least one call. Could it be done in SamplesApp?

Can it be sample outside Uno? https://github.com/pkar70/CallStat

GitHub
Contribute to pkar70/CallStat development by creating an account on GitHub.

@pkar70

pkar70 commented Apr 5, 2022

Copy link
Copy Markdown
Contributor Author

Will build restart by itself, or should it be restarted manually?

@MartinZikmund

Copy link
Copy Markdown
Member

Did a small cleanup, a few fixes and expanded the sample to show the full log:

Screenshot_20220918-224015~2

@pkar70

pkar70 commented Sep 18, 2022 •

Copy link
Copy Markdown
Contributor Author

So, there is some chance that this code, used in my app available in Android Amazon store since May 13, 2020, will be finally included in official Uno distribution in September 2022 :)

@MartinZikmund

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@MartinZikmund
MartinZikmund merged commit 67945ca into unoplatform:master Sep 20, 2022
@@ -2,6 +2,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="uno.platform.unosampleapp" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31" />
<!-- NOTE: Add permissions in AssemblyInfo.cs -->

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pkar70 @MartinZikmund Why are permissions added here while this comment mentions they should be in AssemblyInfo?

@jeromelaban This comment was added in #3064, do you recall why permissions should be in AssemblyInfo not in AndroidManifest?

Either way, I guess we should just follow the comment and move the permissions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's generally easier to manipulate these flags in code, as they be placed pretty much anywhere, close to the code using them.

#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__ANDROID__ must be removed in this line.

{
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
[global::Uno.NotImplemented]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should pass specific platforms to the attribute here.

@@ -0,0 +1,140 @@
#nullable enable

#if __ANDROID__

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not necessary. The file is already .Android.cs and is only included in build for Android.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants