# mPrivacy: A Privacy Policy Engine and Safeguard Mechanism in Mobile Devices
## 2 Related Works
### Inference Algorithms  
One type of sensitive information is location information. Many inference algorithms can infer the user's location or location traces. The attacker can further infer other kinds of sensitive information, using location information. We collected various location inference algorithms. In [8], the authors used the accelerometer, gyroscope, GPS, and map information to obtain more accurate location information. The data from the accelerometer are used to infer the step distance, count of step, and the angularity of turn. The data from the gyroscope are used to detect whether the user has made a turn or not from time to time. Combining the data from the accelerometer and gyroscope, the algorithm can gain the turn information with accurate turn degree and relative direction. In the end, the algorithm performs map matching, using all previously inferred information, the location from the GPS as a start point, and external map. The accuracy of the GPS in their experiments is 15 m. Their algorithm is able to obtain the location in 5 m.  
A train route tracking inference algorithm is introduced in [20]. To infer the user's train routes information, the authors used data from the accelerometer, linear accelerometer, gyroscope, magnet, supervised machine learning classifier, and external train routes map as input to the inference algorithm. Linear accelerometer data can be generated by excluding the gravity information from the accelerometer data. With a pre-generated classifier and data from the previously mentioned sensors, the algorithm detects all the time whether the user is walking, using the train, or in other motion modes. Then, the departure and arrival time information is detected, using the motion and time information. Comparing the departure and arrival time information with the train route map, which includes the timetable of all train routes, the algorithm can predict the user's train routes. Using the motion sensors, especially the accelerometer, location-related information can be inferred. A few other algorithms were made to gain user location information using motion sensors in [5; 6; 7; 21; 22]. Previous location-related information is revealed via physical sensors and external information. Some other privacy-related information can also be inferred using physical sensors or logical sensors. In [23] the authors developed a keystrokes-of-keyboards snooping algorithm. If the mobile phone is located near the keyboard, the inference algorithm can detect the keystrokes. To do this inference, data from two microphones in the phone are used at first to inference the relative position of the phone. Because the arrival time of the keystrokes signal to two different microphones is varied, the keystrokes can be distributed into different key groups. After analyzing a few keystrokes, the algorithm can guess theoretical key groups based on the position of the phone for the next step. Using the theoretical key groups and keystrokes signals, the keystrokes are distributed into groups. For example, \"e, d, x\", and \"r, f, c\" are groups for which the arrival time of keystrokes signal can be applied to the same mathematical curve. Acoustic features of keystroke sounds in the same key groups are different. The algorithm uses the statistical Mel-frequency cepstral coefficients (MFCC) features of keystrokes to predict which key is the keystroke in the key group. In the end, the algorithm can inference every keystroke by combining the key groups' information and the key position information in the group. In [12], one algorithm for happiness recognition using a few logical sensors and Bluetooth is introduced. The author made use of the relationship of the user's emotion to the call log, SMS, Bluetooth, weather condition, and personality traits. A pre-generated classifier based on machine learning is used to predict the user's emotion. The classifier distributes the emotion into different classes with various regularity of the phone call, usage of SMS, and Bluetooth.