# mPrivacy: A Privacy Policy Engine and Safeguard Mechanism in Mobile Devices
## 4 Approach
### Graph Based Approach  
Figure 2 is an example of an information escalation graph of three position trajectory inference algorithms using different combinations of accelerometer, magnet, and gyroscope.  
The inference algorithm uses various processes to infer a variety of lower-level information, which is expected to infer the position trajectory. There are five processes to infer various information. The information to be inferred in this graph is the moving distance, turning angle, and location trace. All inference processes use time information. Process 1 is used to infer the moving distance using data from the accelerometer [37]. Processes 2, 3, and 4 represent three different pedestrian dead reckoning algorithms to infer the turning angle of the user. Process 2 uses the accelerometer and magnet sensors [21], Process 3 uses magnet and gyroscope sensors [22], and Process 4 uses all three sensors [6]. These three inference processes return the turning angle information in different qualities. Finally, Process 5 uses a location in the GPS as the starting point, the moving distance, and the turning angle indicating the user's moving direction to infer the user's location trajectory.  
The three pedestrian dead reckoning algorithms in the graph use an accelerometer to infer the moving distance. The difference between the three algorithms is that they use different processes to infer the turning angle. Algorithm 1 uses an accelerometer and magnet, Algorithm 3 uses a magnet and gyroscope, and Algorithm 2 uses all three sensors. The three inference processes will return turning angle information of different qualities. The quality of the turning angle will affect the quality of the location trace in inference Process 5. Assume that the accuracies provided by the inference Processes 2, 3, and 4 are 80%, 90%, and 50%, and the corresponding inferred location trace accuracies are medium, high, and low. When the user allows the application to obtain the mid-level location information, the application should be prohibited from using the gyroscope. If the user chooses to allow a high level, the application is allowed to use all three sensors. However, if the user wants to select a low level, in this case, there seems to be no solution. Algorithm 1 and Algorithm 3 both require all three sensors to infer the location trace. Algorithm 1 can infer a more accurate location trace than Algorithm 3. If we disable the accelerometer or magnet to destroy the inference of Algorithm 1, then Algorithm 3 will also be destroyed. We cannot Allow algorithm 3 while disabling Algorithm 1. In this case, we can break Algorithm 1 by adjusting the frequency of the sensor while maintaining Algorithm 3. Another similar situation is that the application requires all three sensors to work properly. Our approach can maintain the utility of the application while protecting users' privacy.  
From this example, we can see how to use graphs to implement privacy policies. The implementation of the policy enforcement is based on some predefined logical rules.  
Figure 2: An example of an information escalation graph.