Fixes TIVI-2064 62/13662/1 accepted/tizen/20131212.205817 submit/tizen/20131212.182105
authorJimmy Huang <jimmy.huang@intel.com>
Wed, 11 Dec 2013 22:58:04 +0000 (14:58 -0800)
committerJimmy Huang <jimmy.huang@intel.com>
Wed, 11 Dec 2013 23:00:29 +0000 (15:00 -0800)
This is work-around to grant the app privilege to access the privacy APIs
Since the pkg manager doesn't install the package information in the privacy database
and the privacy-popup is not compatible with wayland and toyota's homescreen so for now
just manually grant access by updating the privacy database directly.

Change-Id: Iba9de2925f9288f4eec4f8a4bb43f8de97c6a4a6
Signed-off-by: Jimmy Huang <jimmy.huang@intel.com>
packaging/Settings.changes
packaging/Settings.spec

index 613a214..942fec8 100644 (file)
@@ -1,3 +1,6 @@
+* Wed Dec 11 2013 Jimmy Huang <jimmy.huang@intel.com> submit/tizen/20131127.215730@0e0c7db
+- Fixes TIVI-2064
+
 * Wed Nov 27 2013 Jimmy Huang <jimmy.huang@intel.com> ivi_oct_m2@f9f74cb
 - Reverting previous commit to add locale privilege
 
index aea0975..ddcc851 100644 (file)
@@ -10,7 +10,9 @@ BuildRequires:  zip
 BuildRequires:  desktop-file-utils
 Requires:   bluetooth-frwk-core
 Requires:   bluetooth-frwk-service
+Requires:   privacy-manager-server
 Requires:   settingsd
+Requires:   sqlite
 Requires:   wrt-installer
 
 %description
@@ -32,11 +34,24 @@ rm -rf %{buildroot}
 %post
 if [ -f /opt/usr/apps/.preinstallWidgets/preinstallDone ]; then
     wrt-installer -i /opt/usr/apps/.preinstallWidgets/Settings.wgt;
+
+# This is a work around to grant the app privilege to access the privacy APIs
+# Since the pkg manager doesn't install the package information in the privacy database
+# and the privacy-popup is not displaying to allow user to grant access, so for now
+# just manually grant access by updating the privacy database directly
+    sqlite3 /opt/dbspace/.privacy.db "DELETE FROM PackageInfo WHERE PKG_ID='ODBQpKvkS1'";
+    sqlite3 /opt/dbspace/.privacy.db "DELETE FROM PrivacyInfo WHERE PKG_ID='ODBQpKvkS1'";
+    sqlite3 /opt/dbspace/.privacy.db "INSERT INTO PackageInfo(PKG_ID, IS_SET) VALUES('ODBQpKvkS1', 1)";
+    sqlite3 /opt/dbspace/.privacy.db "INSERT INTO PrivacyInfo(PKG_ID, PRIVACY_ID, IS_ENABLED) VALUES('ODBQpKvkS1', 'http://tizen.org/privacy/bluetooth', 1)";
 fi
 
 %postun
 wrt-installer -un ODBQpKvkS1.Settings
 
+# Remove privileges from database when uninstalling
+sqlite3 /opt/dbspace/.privacy.db "DELETE FROM PackageInfo WHERE PKG_ID='ODBQpKvkS1'";
+sqlite3 /opt/dbspace/.privacy.db "DELETE FROM PrivacyInfo WHERE PKG_ID='ODBQpKvkS1'";
+
 %files
 %defattr(-,root,root,-)
 /opt/usr/apps/.preinstallWidgets/Settings.wgt